1717
1818import com .fasterxml .jackson .annotation .JsonProperty ;
1919import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
20+ import com .google .adk .agents .BaseAgentState ;
2021import com .google .errorprone .annotations .CanIgnoreReturnValue ;
2122import com .google .genai .types .Part ;
2223import java .util .Objects ;
@@ -37,8 +38,12 @@ public class EventActions {
3738 private Optional <Boolean > escalate ;
3839 private ConcurrentMap <String , ConcurrentMap <String , Object >> requestedAuthConfigs ;
3940 private ConcurrentMap <String , ToolConfirmation > requestedToolConfirmations ;
41+ private boolean endOfAgent ;
42+ private ConcurrentMap <String , BaseAgentState > agentStates ;
43+ private boolean pauseInvocation ;
4044 private Optional <Boolean > endInvocation ;
4145 private Optional <EventCompaction > compaction ;
46+ private Optional <String > rewindBeforeInvocationId ;
4247
4348 /** Default constructor for Jackson. */
4449 public EventActions () {
@@ -49,8 +54,12 @@ public EventActions() {
4954 this .escalate = Optional .empty ();
5055 this .requestedAuthConfigs = new ConcurrentHashMap <>();
5156 this .requestedToolConfirmations = new ConcurrentHashMap <>();
57+ this .endOfAgent = false ;
58+ this .pauseInvocation = false ;
5259 this .endInvocation = Optional .empty ();
5360 this .compaction = Optional .empty ();
61+ this .agentStates = new ConcurrentHashMap <>();
62+ this .rewindBeforeInvocationId = Optional .empty ();
5463 }
5564
5665 private EventActions (Builder builder ) {
@@ -61,8 +70,12 @@ private EventActions(Builder builder) {
6170 this .escalate = builder .escalate ;
6271 this .requestedAuthConfigs = builder .requestedAuthConfigs ;
6372 this .requestedToolConfirmations = builder .requestedToolConfirmations ;
73+ this .endOfAgent = builder .endOfAgent ;
74+ this .pauseInvocation = builder .pauseInvocation ;
6475 this .endInvocation = builder .endInvocation ;
6576 this .compaction = builder .compaction ;
77+ this .agentStates = builder .agentStates ;
78+ this .rewindBeforeInvocationId = builder .rewindBeforeInvocationId ;
6679 }
6780
6881 @ JsonProperty ("skipSummarization" )
@@ -146,6 +159,24 @@ public void setRequestedToolConfirmations(
146159 this .requestedToolConfirmations = requestedToolConfirmations ;
147160 }
148161
162+ @ JsonProperty ("endOfAgent" )
163+ public boolean endOfAgent () {
164+ return endOfAgent ;
165+ }
166+
167+ public void setEndOfAgent (boolean endOfAgent ) {
168+ this .endOfAgent = endOfAgent ;
169+ }
170+
171+ @ JsonProperty ("pauseInvocation" )
172+ public boolean pauseInvocation () {
173+ return pauseInvocation ;
174+ }
175+
176+ public void setPauseInvocation (boolean pauseInvocation ) {
177+ this .pauseInvocation = pauseInvocation ;
178+ }
179+
149180 @ JsonProperty ("endInvocation" )
150181 public Optional <Boolean > endInvocation () {
151182 return endInvocation ;
@@ -168,6 +199,24 @@ public void setCompaction(Optional<EventCompaction> compaction) {
168199 this .compaction = compaction ;
169200 }
170201
202+ @ JsonProperty ("agentStates" )
203+ public ConcurrentMap <String , BaseAgentState > agentStates () {
204+ return agentStates ;
205+ }
206+
207+ public void setAgentStates (ConcurrentMap <String , BaseAgentState > agentStates ) {
208+ this .agentStates = agentStates ;
209+ }
210+
211+ @ JsonProperty ("rewindBeforeInvocationId" )
212+ public Optional <String > rewindBeforeInvocationId () {
213+ return rewindBeforeInvocationId ;
214+ }
215+
216+ public void setRewindBeforeInvocationId (@ Nullable String rewindBeforeInvocationId ) {
217+ this .rewindBeforeInvocationId = Optional .ofNullable (rewindBeforeInvocationId );
218+ }
219+
171220 public static Builder builder () {
172221 return new Builder ();
173222 }
@@ -191,8 +240,12 @@ public boolean equals(Object o) {
191240 && Objects .equals (escalate , that .escalate )
192241 && Objects .equals (requestedAuthConfigs , that .requestedAuthConfigs )
193242 && Objects .equals (requestedToolConfirmations , that .requestedToolConfirmations )
243+ && (endOfAgent == that .endOfAgent )
244+ && (pauseInvocation == that .pauseInvocation )
194245 && Objects .equals (endInvocation , that .endInvocation )
195- && Objects .equals (compaction , that .compaction );
246+ && Objects .equals (compaction , that .compaction )
247+ && Objects .equals (agentStates , that .agentStates )
248+ && Objects .equals (rewindBeforeInvocationId , that .rewindBeforeInvocationId );
196249 }
197250
198251 @ Override
@@ -205,8 +258,12 @@ public int hashCode() {
205258 escalate ,
206259 requestedAuthConfigs ,
207260 requestedToolConfirmations ,
261+ endOfAgent ,
262+ pauseInvocation ,
208263 endInvocation ,
209- compaction );
264+ compaction ,
265+ agentStates ,
266+ rewindBeforeInvocationId );
210267 }
211268
212269 /** Builder for {@link EventActions}. */
@@ -218,8 +275,12 @@ public static class Builder {
218275 private Optional <Boolean > escalate ;
219276 private ConcurrentMap <String , ConcurrentMap <String , Object >> requestedAuthConfigs ;
220277 private ConcurrentMap <String , ToolConfirmation > requestedToolConfirmations ;
278+ private boolean endOfAgent = false ;
279+ private boolean pauseInvocation = false ;
221280 private Optional <Boolean > endInvocation ;
222281 private Optional <EventCompaction > compaction ;
282+ private ConcurrentMap <String , BaseAgentState > agentStates ;
283+ private Optional <String > rewindBeforeInvocationId ;
223284
224285 public Builder () {
225286 this .skipSummarization = Optional .empty ();
@@ -231,6 +292,8 @@ public Builder() {
231292 this .requestedToolConfirmations = new ConcurrentHashMap <>();
232293 this .endInvocation = Optional .empty ();
233294 this .compaction = Optional .empty ();
295+ this .agentStates = new ConcurrentHashMap <>();
296+ this .rewindBeforeInvocationId = Optional .empty ();
234297 }
235298
236299 private Builder (EventActions eventActions ) {
@@ -242,8 +305,12 @@ private Builder(EventActions eventActions) {
242305 this .requestedAuthConfigs = new ConcurrentHashMap <>(eventActions .requestedAuthConfigs ());
243306 this .requestedToolConfirmations =
244307 new ConcurrentHashMap <>(eventActions .requestedToolConfirmations ());
308+ this .endOfAgent = eventActions .endOfAgent ();
309+ this .pauseInvocation = eventActions .pauseInvocation ();
245310 this .endInvocation = eventActions .endInvocation ();
246311 this .compaction = eventActions .compaction ();
312+ this .agentStates = new ConcurrentHashMap <>(eventActions .agentStates ());
313+ this .rewindBeforeInvocationId = eventActions .rewindBeforeInvocationId ();
247314 }
248315
249316 @ CanIgnoreReturnValue
@@ -296,6 +363,20 @@ public Builder requestedToolConfirmations(ConcurrentMap<String, ToolConfirmation
296363 return this ;
297364 }
298365
366+ @ CanIgnoreReturnValue
367+ @ JsonProperty ("endOfAgent" )
368+ public Builder endOfAgent (boolean endOfAgent ) {
369+ this .endOfAgent = endOfAgent ;
370+ return this ;
371+ }
372+
373+ @ CanIgnoreReturnValue
374+ @ JsonProperty ("pauseInvocation" )
375+ public Builder pauseInvocation (boolean pauseInvocation ) {
376+ this .pauseInvocation = pauseInvocation ;
377+ return this ;
378+ }
379+
299380 @ CanIgnoreReturnValue
300381 @ JsonProperty ("endInvocation" )
301382 public Builder endInvocation (boolean endInvocation ) {
@@ -310,6 +391,20 @@ public Builder compaction(EventCompaction value) {
310391 return this ;
311392 }
312393
394+ @ CanIgnoreReturnValue
395+ @ JsonProperty ("agentStates" )
396+ public Builder agentStates (ConcurrentMap <String , BaseAgentState > agentStates ) {
397+ this .agentStates = agentStates ;
398+ return this ;
399+ }
400+
401+ @ CanIgnoreReturnValue
402+ @ JsonProperty ("rewindBeforeInvocationId" )
403+ public Builder rewindBeforeInvocationId (String rewindBeforeInvocationId ) {
404+ this .rewindBeforeInvocationId = Optional .ofNullable (rewindBeforeInvocationId );
405+ return this ;
406+ }
407+
313408 @ CanIgnoreReturnValue
314409 public Builder merge (EventActions other ) {
315410 other .skipSummarization ().ifPresent (this ::skipSummarization );
@@ -319,8 +414,12 @@ public Builder merge(EventActions other) {
319414 other .escalate ().ifPresent (this ::escalate );
320415 this .requestedAuthConfigs .putAll (other .requestedAuthConfigs ());
321416 this .requestedToolConfirmations .putAll (other .requestedToolConfirmations ());
417+ this .endOfAgent = other .endOfAgent ();
418+ this .pauseInvocation = other .pauseInvocation ();
322419 other .endInvocation ().ifPresent (this ::endInvocation );
323420 other .compaction ().ifPresent (this ::compaction );
421+ this .agentStates .putAll (other .agentStates ());
422+ other .rewindBeforeInvocationId ().ifPresent (this ::rewindBeforeInvocationId );
324423 return this ;
325424 }
326425
0 commit comments