@inf-monkeys-tech/monkeys 1.0.20 → 1.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -230,6 +230,31 @@ export declare const AgentSessionStatusSchema: z.ZodEnum<{
230
230
  completed: "completed";
231
231
  failed: "failed";
232
232
  }>;
233
+ export declare const AgentSessionTerminalStatusSchema: z.ZodEnum<{
234
+ stopped: "stopped";
235
+ completed: "completed";
236
+ failed: "failed";
237
+ }>;
238
+ export declare const AgentSessionRunSchema: z.ZodObject<{
239
+ runId: z.ZodString;
240
+ sessionId: z.ZodString;
241
+ sourceMessageId: z.ZodString;
242
+ status: z.ZodEnum<{
243
+ queued: "queued";
244
+ running: "running";
245
+ waiting_approval: "waiting_approval";
246
+ stopping: "stopping";
247
+ stopped: "stopped";
248
+ completed: "completed";
249
+ failed: "failed";
250
+ }>;
251
+ startedAt: z.ZodString;
252
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
253
+ stoppedAt: z.ZodOptional<z.ZodString>;
254
+ completedAt: z.ZodOptional<z.ZodString>;
255
+ failedAt: z.ZodOptional<z.ZodString>;
256
+ durationMs: z.ZodOptional<z.ZodNumber>;
257
+ }, z.core.$strict>;
233
258
  export declare const AgentSessionCommandTypeSchema: z.ZodEnum<{
234
259
  approval: "approval";
235
260
  resume: "resume";
@@ -240,6 +265,7 @@ export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
240
265
  contract: z.ZodLiteral<"AgentSessionCommand">;
241
266
  commandId: z.ZodString;
242
267
  sessionId: z.ZodString;
268
+ runId: z.ZodOptional<z.ZodString>;
243
269
  idempotencyKey: z.ZodString;
244
270
  expectedSequence: z.ZodNumber;
245
271
  issuedAt: z.ZodString;
@@ -251,6 +277,7 @@ export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
251
277
  contract: z.ZodLiteral<"AgentSessionCommand">;
252
278
  commandId: z.ZodString;
253
279
  sessionId: z.ZodString;
280
+ runId: z.ZodOptional<z.ZodString>;
254
281
  idempotencyKey: z.ZodString;
255
282
  expectedSequence: z.ZodNumber;
256
283
  issuedAt: z.ZodString;
@@ -262,6 +289,7 @@ export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
262
289
  contract: z.ZodLiteral<"AgentSessionCommand">;
263
290
  commandId: z.ZodString;
264
291
  sessionId: z.ZodString;
292
+ runId: z.ZodOptional<z.ZodString>;
265
293
  idempotencyKey: z.ZodString;
266
294
  expectedSequence: z.ZodNumber;
267
295
  issuedAt: z.ZodString;
@@ -273,6 +301,7 @@ export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
273
301
  contract: z.ZodLiteral<"AgentSessionCommand">;
274
302
  commandId: z.ZodString;
275
303
  sessionId: z.ZodString;
304
+ runId: z.ZodOptional<z.ZodString>;
276
305
  idempotencyKey: z.ZodString;
277
306
  expectedSequence: z.ZodNumber;
278
307
  issuedAt: z.ZodString;
@@ -286,8 +315,67 @@ export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodOb
286
315
  reason: z.ZodOptional<z.ZodString>;
287
316
  }, z.core.$strict>;
288
317
  }, z.core.$strict>], "commandType">;
318
+ export declare const AgentSessionTargetedCommandSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
319
+ contract: z.ZodLiteral<"AgentSessionCommand">;
320
+ commandId: z.ZodString;
321
+ sessionId: z.ZodString;
322
+ runId: z.ZodOptional<z.ZodString>;
323
+ idempotencyKey: z.ZodString;
324
+ expectedSequence: z.ZodNumber;
325
+ issuedAt: z.ZodString;
326
+ commandType: z.ZodLiteral<"stop">;
327
+ payload: z.ZodObject<{
328
+ reason: z.ZodOptional<z.ZodString>;
329
+ }, z.core.$strict>;
330
+ }, z.core.$strict>, z.ZodObject<{
331
+ contract: z.ZodLiteral<"AgentSessionCommand">;
332
+ commandId: z.ZodString;
333
+ sessionId: z.ZodString;
334
+ runId: z.ZodOptional<z.ZodString>;
335
+ idempotencyKey: z.ZodString;
336
+ expectedSequence: z.ZodNumber;
337
+ issuedAt: z.ZodString;
338
+ commandType: z.ZodLiteral<"resume">;
339
+ payload: z.ZodObject<{
340
+ resumeEventId: z.ZodOptional<z.ZodString>;
341
+ }, z.core.$strict>;
342
+ }, z.core.$strict>, z.ZodObject<{
343
+ contract: z.ZodLiteral<"AgentSessionCommand">;
344
+ commandId: z.ZodString;
345
+ sessionId: z.ZodString;
346
+ runId: z.ZodOptional<z.ZodString>;
347
+ idempotencyKey: z.ZodString;
348
+ expectedSequence: z.ZodNumber;
349
+ issuedAt: z.ZodString;
350
+ commandType: z.ZodLiteral<"retry">;
351
+ payload: z.ZodObject<{
352
+ sourceEventId: z.ZodString;
353
+ }, z.core.$strict>;
354
+ }, z.core.$strict>, z.ZodObject<{
355
+ contract: z.ZodLiteral<"AgentSessionCommand">;
356
+ commandId: z.ZodString;
357
+ sessionId: z.ZodString;
358
+ runId: z.ZodOptional<z.ZodString>;
359
+ idempotencyKey: z.ZodString;
360
+ expectedSequence: z.ZodNumber;
361
+ issuedAt: z.ZodString;
362
+ commandType: z.ZodLiteral<"approval">;
363
+ payload: z.ZodObject<{
364
+ approvalId: z.ZodString;
365
+ decision: z.ZodEnum<{
366
+ approved: "approved";
367
+ rejected: "rejected";
368
+ }>;
369
+ reason: z.ZodOptional<z.ZodString>;
370
+ }, z.core.$strict>;
371
+ }, z.core.$strict>], "commandType">, z.ZodObject<{
372
+ runId: z.ZodString;
373
+ }, z.core.$strip>>;
289
374
  export declare const AgentSessionCommandErrorCodeSchema: z.ZodEnum<{
290
375
  SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
376
+ RUN_NOT_FOUND: "RUN_NOT_FOUND";
377
+ RUN_ALREADY_FINISHED: "RUN_ALREADY_FINISHED";
378
+ STOP_TIMEOUT: "STOP_TIMEOUT";
291
379
  COMMAND_NOT_SUPPORTED: "COMMAND_NOT_SUPPORTED";
292
380
  CAPABILITY_UNAVAILABLE: "CAPABILITY_UNAVAILABLE";
293
381
  SEQUENCE_CONFLICT: "SEQUENCE_CONFLICT";
@@ -302,6 +390,7 @@ export declare const AgentSessionCommandResultSchema: z.ZodObject<{
302
390
  contract: z.ZodLiteral<"AgentSessionCommandResult">;
303
391
  commandId: z.ZodString;
304
392
  sessionId: z.ZodString;
393
+ runId: z.ZodOptional<z.ZodString>;
305
394
  idempotencyKey: z.ZodString;
306
395
  outcome: z.ZodEnum<{
307
396
  failed: "failed";
@@ -320,9 +409,16 @@ export declare const AgentSessionCommandResultSchema: z.ZodObject<{
320
409
  }>;
321
410
  acceptedSequence: z.ZodOptional<z.ZodNumber>;
322
411
  resultEventIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
412
+ termination: z.ZodOptional<z.ZodEnum<{
413
+ requested: "requested";
414
+ confirmed: "confirmed";
415
+ }>>;
323
416
  error: z.ZodOptional<z.ZodObject<{
324
417
  code: z.ZodEnum<{
325
418
  SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
419
+ RUN_NOT_FOUND: "RUN_NOT_FOUND";
420
+ RUN_ALREADY_FINISHED: "RUN_ALREADY_FINISHED";
421
+ STOP_TIMEOUT: "STOP_TIMEOUT";
326
422
  COMMAND_NOT_SUPPORTED: "COMMAND_NOT_SUPPORTED";
327
423
  CAPABILITY_UNAVAILABLE: "CAPABILITY_UNAVAILABLE";
328
424
  SEQUENCE_CONFLICT: "SEQUENCE_CONFLICT";
@@ -339,10 +435,14 @@ export declare const AgentSessionCommandResultSchema: z.ZodObject<{
339
435
  occurredAt: z.ZodString;
340
436
  }, z.core.$strict>;
341
437
  export declare function resolveAgentSessionCommandTransition(status: AgentSessionStatus, commandType: AgentSessionCommandType): AgentSessionStatus | undefined;
438
+ export declare function isAgentSessionTerminalStatus(status: AgentSessionStatus): status is AgentSessionTerminalStatus;
439
+ export declare function canApplyAgentSessionRunStatus(current: AgentSessionStatus, next: AgentSessionStatus): boolean;
342
440
  export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
343
441
  contract: z.ZodLiteral<"AgentSessionEvent">;
344
442
  eventId: z.ZodString;
345
443
  sessionId: z.ZodString;
444
+ runId: z.ZodOptional<z.ZodString>;
445
+ sourceMessageId: z.ZodOptional<z.ZodString>;
346
446
  sequence: z.ZodNumber;
347
447
  idempotencyKey: z.ZodString;
348
448
  occurredAt: z.ZodString;
@@ -369,6 +469,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
369
469
  contract: z.ZodLiteral<"AgentSessionEvent">;
370
470
  eventId: z.ZodString;
371
471
  sessionId: z.ZodString;
472
+ runId: z.ZodOptional<z.ZodString>;
473
+ sourceMessageId: z.ZodOptional<z.ZodString>;
372
474
  sequence: z.ZodNumber;
373
475
  idempotencyKey: z.ZodString;
374
476
  occurredAt: z.ZodString;
@@ -385,6 +487,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
385
487
  contract: z.ZodLiteral<"AgentSessionEvent">;
386
488
  eventId: z.ZodString;
387
489
  sessionId: z.ZodString;
490
+ runId: z.ZodOptional<z.ZodString>;
491
+ sourceMessageId: z.ZodOptional<z.ZodString>;
388
492
  sequence: z.ZodNumber;
389
493
  idempotencyKey: z.ZodString;
390
494
  occurredAt: z.ZodString;
@@ -414,6 +518,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
414
518
  contract: z.ZodLiteral<"AgentSessionEvent">;
415
519
  eventId: z.ZodString;
416
520
  sessionId: z.ZodString;
521
+ runId: z.ZodOptional<z.ZodString>;
522
+ sourceMessageId: z.ZodOptional<z.ZodString>;
417
523
  sequence: z.ZodNumber;
418
524
  idempotencyKey: z.ZodString;
419
525
  occurredAt: z.ZodString;
@@ -434,6 +540,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
434
540
  contract: z.ZodLiteral<"AgentSessionEvent">;
435
541
  eventId: z.ZodString;
436
542
  sessionId: z.ZodString;
543
+ runId: z.ZodOptional<z.ZodString>;
544
+ sourceMessageId: z.ZodOptional<z.ZodString>;
437
545
  sequence: z.ZodNumber;
438
546
  idempotencyKey: z.ZodString;
439
547
  occurredAt: z.ZodString;
@@ -458,6 +566,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
458
566
  contract: z.ZodLiteral<"AgentSessionEvent">;
459
567
  eventId: z.ZodString;
460
568
  sessionId: z.ZodString;
569
+ runId: z.ZodOptional<z.ZodString>;
570
+ sourceMessageId: z.ZodOptional<z.ZodString>;
461
571
  sequence: z.ZodNumber;
462
572
  idempotencyKey: z.ZodString;
463
573
  occurredAt: z.ZodString;
@@ -479,6 +589,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
479
589
  contract: z.ZodLiteral<"AgentSessionEvent">;
480
590
  eventId: z.ZodString;
481
591
  sessionId: z.ZodString;
592
+ runId: z.ZodOptional<z.ZodString>;
593
+ sourceMessageId: z.ZodOptional<z.ZodString>;
482
594
  sequence: z.ZodNumber;
483
595
  idempotencyKey: z.ZodString;
484
596
  occurredAt: z.ZodString;
@@ -494,11 +606,19 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
494
606
  failed: "failed";
495
607
  }>;
496
608
  detail: z.ZodOptional<z.ZodString>;
609
+ startedAt: z.ZodOptional<z.ZodString>;
610
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
611
+ stoppedAt: z.ZodOptional<z.ZodString>;
612
+ completedAt: z.ZodOptional<z.ZodString>;
613
+ failedAt: z.ZodOptional<z.ZodString>;
614
+ durationMs: z.ZodOptional<z.ZodNumber>;
497
615
  }, z.core.$strict>;
498
616
  }, z.core.$strict>, z.ZodObject<{
499
617
  contract: z.ZodLiteral<"AgentSessionEvent">;
500
618
  eventId: z.ZodString;
501
619
  sessionId: z.ZodString;
620
+ runId: z.ZodOptional<z.ZodString>;
621
+ sourceMessageId: z.ZodOptional<z.ZodString>;
502
622
  sequence: z.ZodNumber;
503
623
  idempotencyKey: z.ZodString;
504
624
  occurredAt: z.ZodString;
@@ -528,6 +648,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
528
648
  contract: z.ZodLiteral<"AgentSessionEvent">;
529
649
  eventId: z.ZodString;
530
650
  sessionId: z.ZodString;
651
+ runId: z.ZodOptional<z.ZodString>;
652
+ sourceMessageId: z.ZodOptional<z.ZodString>;
531
653
  sequence: z.ZodNumber;
532
654
  idempotencyKey: z.ZodString;
533
655
  occurredAt: z.ZodString;
@@ -543,6 +665,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
543
665
  contract: z.ZodLiteral<"AgentSessionEvent">;
544
666
  eventId: z.ZodString;
545
667
  sessionId: z.ZodString;
668
+ runId: z.ZodOptional<z.ZodString>;
669
+ sourceMessageId: z.ZodOptional<z.ZodString>;
546
670
  sequence: z.ZodNumber;
547
671
  idempotencyKey: z.ZodString;
548
672
  occurredAt: z.ZodString;
@@ -556,6 +680,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
556
680
  contract: z.ZodLiteral<"AgentSessionEvent">;
557
681
  eventId: z.ZodString;
558
682
  sessionId: z.ZodString;
683
+ runId: z.ZodOptional<z.ZodString>;
684
+ sourceMessageId: z.ZodOptional<z.ZodString>;
559
685
  sequence: z.ZodNumber;
560
686
  idempotencyKey: z.ZodString;
561
687
  occurredAt: z.ZodString;
@@ -571,6 +697,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
571
697
  contract: z.ZodLiteral<"AgentSessionEvent">;
572
698
  eventId: z.ZodString;
573
699
  sessionId: z.ZodString;
700
+ runId: z.ZodOptional<z.ZodString>;
701
+ sourceMessageId: z.ZodOptional<z.ZodString>;
574
702
  sequence: z.ZodNumber;
575
703
  idempotencyKey: z.ZodString;
576
704
  occurredAt: z.ZodString;
@@ -589,6 +717,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
589
717
  contract: z.ZodLiteral<"AgentSessionEvent">;
590
718
  eventId: z.ZodString;
591
719
  sessionId: z.ZodString;
720
+ runId: z.ZodOptional<z.ZodString>;
721
+ sourceMessageId: z.ZodOptional<z.ZodString>;
592
722
  sequence: z.ZodNumber;
593
723
  idempotencyKey: z.ZodString;
594
724
  occurredAt: z.ZodString;
@@ -606,6 +736,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
606
736
  contract: z.ZodLiteral<"AgentSessionEvent">;
607
737
  eventId: z.ZodString;
608
738
  sessionId: z.ZodString;
739
+ runId: z.ZodOptional<z.ZodString>;
740
+ sourceMessageId: z.ZodOptional<z.ZodString>;
609
741
  sequence: z.ZodNumber;
610
742
  idempotencyKey: z.ZodString;
611
743
  occurredAt: z.ZodString;
@@ -625,6 +757,347 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
625
757
  contract: z.ZodLiteral<"AgentSessionEvent">;
626
758
  eventId: z.ZodString;
627
759
  sessionId: z.ZodString;
760
+ runId: z.ZodOptional<z.ZodString>;
761
+ sourceMessageId: z.ZodOptional<z.ZodString>;
762
+ sequence: z.ZodNumber;
763
+ idempotencyKey: z.ZodString;
764
+ occurredAt: z.ZodString;
765
+ eventType: z.ZodLiteral<"test-result">;
766
+ payload: z.ZodObject<{
767
+ testId: z.ZodString;
768
+ name: z.ZodString;
769
+ status: z.ZodEnum<{
770
+ running: "running";
771
+ failed: "failed";
772
+ skipped: "skipped";
773
+ passed: "passed";
774
+ }>;
775
+ durationMs: z.ZodOptional<z.ZodNumber>;
776
+ output: z.ZodOptional<z.ZodString>;
777
+ }, z.core.$strict>;
778
+ }, z.core.$strict>], "eventType">;
779
+ export declare const AgentSessionRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
780
+ contract: z.ZodLiteral<"AgentSessionEvent">;
781
+ eventId: z.ZodString;
782
+ sessionId: z.ZodString;
783
+ runId: z.ZodOptional<z.ZodString>;
784
+ sourceMessageId: z.ZodOptional<z.ZodString>;
785
+ sequence: z.ZodNumber;
786
+ idempotencyKey: z.ZodString;
787
+ occurredAt: z.ZodString;
788
+ eventType: z.ZodLiteral<"message">;
789
+ payload: z.ZodObject<{
790
+ messageId: z.ZodString;
791
+ role: z.ZodEnum<{
792
+ user: "user";
793
+ assistant: "assistant";
794
+ system: "system";
795
+ }>;
796
+ operation: z.ZodDefault<z.ZodEnum<{
797
+ replace: "replace";
798
+ append: "append";
799
+ }>>;
800
+ parts: z.ZodArray<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
801
+ status: z.ZodOptional<z.ZodEnum<{
802
+ completed: "completed";
803
+ failed: "failed";
804
+ streaming: "streaming";
805
+ }>>;
806
+ }, z.core.$strict>;
807
+ }, z.core.$strict>, z.ZodObject<{
808
+ contract: z.ZodLiteral<"AgentSessionEvent">;
809
+ eventId: z.ZodString;
810
+ sessionId: z.ZodString;
811
+ runId: z.ZodOptional<z.ZodString>;
812
+ sourceMessageId: z.ZodOptional<z.ZodString>;
813
+ sequence: z.ZodNumber;
814
+ idempotencyKey: z.ZodString;
815
+ occurredAt: z.ZodString;
816
+ eventType: z.ZodLiteral<"reasoning">;
817
+ payload: z.ZodObject<{
818
+ reasoningId: z.ZodString;
819
+ text: z.ZodString;
820
+ status: z.ZodEnum<{
821
+ completed: "completed";
822
+ streaming: "streaming";
823
+ }>;
824
+ }, z.core.$strict>;
825
+ }, z.core.$strict>, z.ZodObject<{
826
+ contract: z.ZodLiteral<"AgentSessionEvent">;
827
+ eventId: z.ZodString;
828
+ sessionId: z.ZodString;
829
+ runId: z.ZodOptional<z.ZodString>;
830
+ sourceMessageId: z.ZodOptional<z.ZodString>;
831
+ sequence: z.ZodNumber;
832
+ idempotencyKey: z.ZodString;
833
+ occurredAt: z.ZodString;
834
+ eventType: z.ZodLiteral<"plan">;
835
+ payload: z.ZodObject<{
836
+ planId: z.ZodString;
837
+ title: z.ZodOptional<z.ZodString>;
838
+ status: z.ZodEnum<{
839
+ running: "running";
840
+ completed: "completed";
841
+ failed: "failed";
842
+ pending: "pending";
843
+ }>;
844
+ steps: z.ZodArray<z.ZodObject<{
845
+ id: z.ZodString;
846
+ title: z.ZodString;
847
+ status: z.ZodEnum<{
848
+ running: "running";
849
+ completed: "completed";
850
+ failed: "failed";
851
+ pending: "pending";
852
+ skipped: "skipped";
853
+ }>;
854
+ }, z.core.$strict>>;
855
+ }, z.core.$strict>;
856
+ }, z.core.$strict>, z.ZodObject<{
857
+ contract: z.ZodLiteral<"AgentSessionEvent">;
858
+ eventId: z.ZodString;
859
+ sessionId: z.ZodString;
860
+ runId: z.ZodOptional<z.ZodString>;
861
+ sourceMessageId: z.ZodOptional<z.ZodString>;
862
+ sequence: z.ZodNumber;
863
+ idempotencyKey: z.ZodString;
864
+ occurredAt: z.ZodString;
865
+ eventType: z.ZodLiteral<"task">;
866
+ payload: z.ZodObject<{
867
+ taskId: z.ZodString;
868
+ title: z.ZodString;
869
+ status: z.ZodEnum<{
870
+ running: "running";
871
+ completed: "completed";
872
+ failed: "failed";
873
+ pending: "pending";
874
+ skipped: "skipped";
875
+ }>;
876
+ detail: z.ZodOptional<z.ZodString>;
877
+ }, z.core.$strict>;
878
+ }, z.core.$strict>, z.ZodObject<{
879
+ contract: z.ZodLiteral<"AgentSessionEvent">;
880
+ eventId: z.ZodString;
881
+ sessionId: z.ZodString;
882
+ runId: z.ZodOptional<z.ZodString>;
883
+ sourceMessageId: z.ZodOptional<z.ZodString>;
884
+ sequence: z.ZodNumber;
885
+ idempotencyKey: z.ZodString;
886
+ occurredAt: z.ZodString;
887
+ eventType: z.ZodLiteral<"tool">;
888
+ payload: z.ZodObject<{
889
+ toolCallId: z.ZodString;
890
+ toolName: z.ZodString;
891
+ status: z.ZodEnum<{
892
+ running: "running";
893
+ completed: "completed";
894
+ failed: "failed";
895
+ pending: "pending";
896
+ denied: "denied";
897
+ }>;
898
+ input: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
899
+ output: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
900
+ error: z.ZodOptional<z.ZodString>;
901
+ startedAt: z.ZodOptional<z.ZodString>;
902
+ completedAt: z.ZodOptional<z.ZodString>;
903
+ }, z.core.$strict>;
904
+ }, z.core.$strict>, z.ZodObject<{
905
+ contract: z.ZodLiteral<"AgentSessionEvent">;
906
+ eventId: z.ZodString;
907
+ sessionId: z.ZodString;
908
+ runId: z.ZodOptional<z.ZodString>;
909
+ sourceMessageId: z.ZodOptional<z.ZodString>;
910
+ sequence: z.ZodNumber;
911
+ idempotencyKey: z.ZodString;
912
+ occurredAt: z.ZodString;
913
+ eventType: z.ZodLiteral<"approval">;
914
+ payload: z.ZodObject<{
915
+ approvalId: z.ZodString;
916
+ toolCallId: z.ZodOptional<z.ZodString>;
917
+ status: z.ZodEnum<{
918
+ approved: "approved";
919
+ rejected: "rejected";
920
+ requested: "requested";
921
+ expired: "expired";
922
+ }>;
923
+ title: z.ZodString;
924
+ description: z.ZodOptional<z.ZodString>;
925
+ requestedAction: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
926
+ }, z.core.$strict>;
927
+ }, z.core.$strict>, z.ZodObject<{
928
+ contract: z.ZodLiteral<"AgentSessionEvent">;
929
+ eventId: z.ZodString;
930
+ sessionId: z.ZodString;
931
+ runId: z.ZodOptional<z.ZodString>;
932
+ sourceMessageId: z.ZodOptional<z.ZodString>;
933
+ sequence: z.ZodNumber;
934
+ idempotencyKey: z.ZodString;
935
+ occurredAt: z.ZodString;
936
+ eventType: z.ZodLiteral<"status">;
937
+ payload: z.ZodObject<{
938
+ status: z.ZodEnum<{
939
+ queued: "queued";
940
+ running: "running";
941
+ waiting_approval: "waiting_approval";
942
+ stopping: "stopping";
943
+ stopped: "stopped";
944
+ completed: "completed";
945
+ failed: "failed";
946
+ }>;
947
+ detail: z.ZodOptional<z.ZodString>;
948
+ startedAt: z.ZodOptional<z.ZodString>;
949
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
950
+ stoppedAt: z.ZodOptional<z.ZodString>;
951
+ completedAt: z.ZodOptional<z.ZodString>;
952
+ failedAt: z.ZodOptional<z.ZodString>;
953
+ durationMs: z.ZodOptional<z.ZodNumber>;
954
+ }, z.core.$strict>;
955
+ }, z.core.$strict>, z.ZodObject<{
956
+ contract: z.ZodLiteral<"AgentSessionEvent">;
957
+ eventId: z.ZodString;
958
+ sessionId: z.ZodString;
959
+ runId: z.ZodOptional<z.ZodString>;
960
+ sourceMessageId: z.ZodOptional<z.ZodString>;
961
+ sequence: z.ZodNumber;
962
+ idempotencyKey: z.ZodString;
963
+ occurredAt: z.ZodString;
964
+ eventType: z.ZodLiteral<"artifact">;
965
+ payload: z.ZodObject<{
966
+ artifactId: z.ZodString;
967
+ name: z.ZodString;
968
+ kind: z.ZodEnum<{
969
+ file: "file";
970
+ image: "image";
971
+ video: "video";
972
+ audio: "audio";
973
+ web: "web";
974
+ other: "other";
975
+ }>;
976
+ status: z.ZodEnum<{
977
+ failed: "failed";
978
+ pending: "pending";
979
+ ready: "ready";
980
+ }>;
981
+ mimeType: z.ZodOptional<z.ZodString>;
982
+ url: z.ZodOptional<z.ZodString>;
983
+ size: z.ZodOptional<z.ZodNumber>;
984
+ sourceEventId: z.ZodOptional<z.ZodString>;
985
+ }, z.core.$strict>;
986
+ }, z.core.$strict>, z.ZodObject<{
987
+ contract: z.ZodLiteral<"AgentSessionEvent">;
988
+ eventId: z.ZodString;
989
+ sessionId: z.ZodString;
990
+ runId: z.ZodOptional<z.ZodString>;
991
+ sourceMessageId: z.ZodOptional<z.ZodString>;
992
+ sequence: z.ZodNumber;
993
+ idempotencyKey: z.ZodString;
994
+ occurredAt: z.ZodString;
995
+ eventType: z.ZodLiteral<"usage">;
996
+ payload: z.ZodObject<{
997
+ inputTokens: z.ZodOptional<z.ZodNumber>;
998
+ outputTokens: z.ZodOptional<z.ZodNumber>;
999
+ totalTokens: z.ZodOptional<z.ZodNumber>;
1000
+ contextTokens: z.ZodOptional<z.ZodNumber>;
1001
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1002
+ }, z.core.$strict>;
1003
+ }, z.core.$strict>, z.ZodObject<{
1004
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1005
+ eventId: z.ZodString;
1006
+ sessionId: z.ZodString;
1007
+ runId: z.ZodOptional<z.ZodString>;
1008
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1009
+ sequence: z.ZodNumber;
1010
+ idempotencyKey: z.ZodString;
1011
+ occurredAt: z.ZodString;
1012
+ eventType: z.ZodLiteral<"resume">;
1013
+ payload: z.ZodObject<{
1014
+ resumable: z.ZodBoolean;
1015
+ state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
1016
+ reason: z.ZodOptional<z.ZodString>;
1017
+ }, z.core.$strict>;
1018
+ }, z.core.$strict>, z.ZodObject<{
1019
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1020
+ eventId: z.ZodString;
1021
+ sessionId: z.ZodString;
1022
+ runId: z.ZodOptional<z.ZodString>;
1023
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1024
+ sequence: z.ZodNumber;
1025
+ idempotencyKey: z.ZodString;
1026
+ occurredAt: z.ZodString;
1027
+ eventType: z.ZodLiteral<"error">;
1028
+ payload: z.ZodObject<{
1029
+ code: z.ZodString;
1030
+ message: z.ZodString;
1031
+ retryable: z.ZodBoolean;
1032
+ sourceEventId: z.ZodOptional<z.ZodString>;
1033
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
1034
+ }, z.core.$strict>;
1035
+ }, z.core.$strict>, z.ZodObject<{
1036
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1037
+ eventId: z.ZodString;
1038
+ sessionId: z.ZodString;
1039
+ runId: z.ZodOptional<z.ZodString>;
1040
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1041
+ sequence: z.ZodNumber;
1042
+ idempotencyKey: z.ZodString;
1043
+ occurredAt: z.ZodString;
1044
+ eventType: z.ZodLiteral<"diff">;
1045
+ payload: z.ZodObject<{
1046
+ path: z.ZodString;
1047
+ status: z.ZodEnum<{
1048
+ added: "added";
1049
+ modified: "modified";
1050
+ deleted: "deleted";
1051
+ renamed: "renamed";
1052
+ }>;
1053
+ patch: z.ZodOptional<z.ZodString>;
1054
+ }, z.core.$strict>;
1055
+ }, z.core.$strict>, z.ZodObject<{
1056
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1057
+ eventId: z.ZodString;
1058
+ sessionId: z.ZodString;
1059
+ runId: z.ZodOptional<z.ZodString>;
1060
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1061
+ sequence: z.ZodNumber;
1062
+ idempotencyKey: z.ZodString;
1063
+ occurredAt: z.ZodString;
1064
+ eventType: z.ZodLiteral<"workspace-file">;
1065
+ payload: z.ZodObject<{
1066
+ path: z.ZodString;
1067
+ operation: z.ZodEnum<{
1068
+ upsert: "upsert";
1069
+ delete: "delete";
1070
+ }>;
1071
+ mimeType: z.ZodOptional<z.ZodString>;
1072
+ size: z.ZodOptional<z.ZodNumber>;
1073
+ }, z.core.$strict>;
1074
+ }, z.core.$strict>, z.ZodObject<{
1075
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1076
+ eventId: z.ZodString;
1077
+ sessionId: z.ZodString;
1078
+ runId: z.ZodOptional<z.ZodString>;
1079
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1080
+ sequence: z.ZodNumber;
1081
+ idempotencyKey: z.ZodString;
1082
+ occurredAt: z.ZodString;
1083
+ eventType: z.ZodLiteral<"terminal">;
1084
+ payload: z.ZodObject<{
1085
+ terminalId: z.ZodString;
1086
+ stream: z.ZodEnum<{
1087
+ status: "status";
1088
+ stdin: "stdin";
1089
+ stdout: "stdout";
1090
+ stderr: "stderr";
1091
+ }>;
1092
+ chunk: z.ZodString;
1093
+ exitCode: z.ZodOptional<z.ZodNumber>;
1094
+ }, z.core.$strict>;
1095
+ }, z.core.$strict>, z.ZodObject<{
1096
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1097
+ eventId: z.ZodString;
1098
+ sessionId: z.ZodString;
1099
+ runId: z.ZodOptional<z.ZodString>;
1100
+ sourceMessageId: z.ZodOptional<z.ZodString>;
628
1101
  sequence: z.ZodNumber;
629
1102
  idempotencyKey: z.ZodString;
630
1103
  occurredAt: z.ZodString;
@@ -684,6 +1157,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
684
1157
  contract: z.ZodLiteral<"AgentSessionEvent">;
685
1158
  eventId: z.ZodString;
686
1159
  sessionId: z.ZodString;
1160
+ runId: z.ZodOptional<z.ZodString>;
1161
+ sourceMessageId: z.ZodOptional<z.ZodString>;
687
1162
  sequence: z.ZodNumber;
688
1163
  idempotencyKey: z.ZodString;
689
1164
  occurredAt: z.ZodString;
@@ -710,6 +1185,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
710
1185
  contract: z.ZodLiteral<"AgentSessionEvent">;
711
1186
  eventId: z.ZodString;
712
1187
  sessionId: z.ZodString;
1188
+ runId: z.ZodOptional<z.ZodString>;
1189
+ sourceMessageId: z.ZodOptional<z.ZodString>;
713
1190
  sequence: z.ZodNumber;
714
1191
  idempotencyKey: z.ZodString;
715
1192
  occurredAt: z.ZodString;
@@ -726,6 +1203,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
726
1203
  contract: z.ZodLiteral<"AgentSessionEvent">;
727
1204
  eventId: z.ZodString;
728
1205
  sessionId: z.ZodString;
1206
+ runId: z.ZodOptional<z.ZodString>;
1207
+ sourceMessageId: z.ZodOptional<z.ZodString>;
729
1208
  sequence: z.ZodNumber;
730
1209
  idempotencyKey: z.ZodString;
731
1210
  occurredAt: z.ZodString;
@@ -755,6 +1234,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
755
1234
  contract: z.ZodLiteral<"AgentSessionEvent">;
756
1235
  eventId: z.ZodString;
757
1236
  sessionId: z.ZodString;
1237
+ runId: z.ZodOptional<z.ZodString>;
1238
+ sourceMessageId: z.ZodOptional<z.ZodString>;
758
1239
  sequence: z.ZodNumber;
759
1240
  idempotencyKey: z.ZodString;
760
1241
  occurredAt: z.ZodString;
@@ -775,6 +1256,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
775
1256
  contract: z.ZodLiteral<"AgentSessionEvent">;
776
1257
  eventId: z.ZodString;
777
1258
  sessionId: z.ZodString;
1259
+ runId: z.ZodOptional<z.ZodString>;
1260
+ sourceMessageId: z.ZodOptional<z.ZodString>;
778
1261
  sequence: z.ZodNumber;
779
1262
  idempotencyKey: z.ZodString;
780
1263
  occurredAt: z.ZodString;
@@ -799,6 +1282,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
799
1282
  contract: z.ZodLiteral<"AgentSessionEvent">;
800
1283
  eventId: z.ZodString;
801
1284
  sessionId: z.ZodString;
1285
+ runId: z.ZodOptional<z.ZodString>;
1286
+ sourceMessageId: z.ZodOptional<z.ZodString>;
802
1287
  sequence: z.ZodNumber;
803
1288
  idempotencyKey: z.ZodString;
804
1289
  occurredAt: z.ZodString;
@@ -820,6 +1305,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
820
1305
  contract: z.ZodLiteral<"AgentSessionEvent">;
821
1306
  eventId: z.ZodString;
822
1307
  sessionId: z.ZodString;
1308
+ runId: z.ZodOptional<z.ZodString>;
1309
+ sourceMessageId: z.ZodOptional<z.ZodString>;
823
1310
  sequence: z.ZodNumber;
824
1311
  idempotencyKey: z.ZodString;
825
1312
  occurredAt: z.ZodString;
@@ -835,11 +1322,19 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
835
1322
  failed: "failed";
836
1323
  }>;
837
1324
  detail: z.ZodOptional<z.ZodString>;
1325
+ startedAt: z.ZodOptional<z.ZodString>;
1326
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
1327
+ stoppedAt: z.ZodOptional<z.ZodString>;
1328
+ completedAt: z.ZodOptional<z.ZodString>;
1329
+ failedAt: z.ZodOptional<z.ZodString>;
1330
+ durationMs: z.ZodOptional<z.ZodNumber>;
838
1331
  }, z.core.$strict>;
839
1332
  }, z.core.$strict>, z.ZodObject<{
840
1333
  contract: z.ZodLiteral<"AgentSessionEvent">;
841
1334
  eventId: z.ZodString;
842
1335
  sessionId: z.ZodString;
1336
+ runId: z.ZodOptional<z.ZodString>;
1337
+ sourceMessageId: z.ZodOptional<z.ZodString>;
843
1338
  sequence: z.ZodNumber;
844
1339
  idempotencyKey: z.ZodString;
845
1340
  occurredAt: z.ZodString;
@@ -869,6 +1364,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
869
1364
  contract: z.ZodLiteral<"AgentSessionEvent">;
870
1365
  eventId: z.ZodString;
871
1366
  sessionId: z.ZodString;
1367
+ runId: z.ZodOptional<z.ZodString>;
1368
+ sourceMessageId: z.ZodOptional<z.ZodString>;
872
1369
  sequence: z.ZodNumber;
873
1370
  idempotencyKey: z.ZodString;
874
1371
  occurredAt: z.ZodString;
@@ -884,6 +1381,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
884
1381
  contract: z.ZodLiteral<"AgentSessionEvent">;
885
1382
  eventId: z.ZodString;
886
1383
  sessionId: z.ZodString;
1384
+ runId: z.ZodOptional<z.ZodString>;
1385
+ sourceMessageId: z.ZodOptional<z.ZodString>;
887
1386
  sequence: z.ZodNumber;
888
1387
  idempotencyKey: z.ZodString;
889
1388
  occurredAt: z.ZodString;
@@ -897,6 +1396,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
897
1396
  contract: z.ZodLiteral<"AgentSessionEvent">;
898
1397
  eventId: z.ZodString;
899
1398
  sessionId: z.ZodString;
1399
+ runId: z.ZodOptional<z.ZodString>;
1400
+ sourceMessageId: z.ZodOptional<z.ZodString>;
900
1401
  sequence: z.ZodNumber;
901
1402
  idempotencyKey: z.ZodString;
902
1403
  occurredAt: z.ZodString;
@@ -912,6 +1413,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
912
1413
  contract: z.ZodLiteral<"AgentSessionEvent">;
913
1414
  eventId: z.ZodString;
914
1415
  sessionId: z.ZodString;
1416
+ runId: z.ZodOptional<z.ZodString>;
1417
+ sourceMessageId: z.ZodOptional<z.ZodString>;
915
1418
  sequence: z.ZodNumber;
916
1419
  idempotencyKey: z.ZodString;
917
1420
  occurredAt: z.ZodString;
@@ -930,6 +1433,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
930
1433
  contract: z.ZodLiteral<"AgentSessionEvent">;
931
1434
  eventId: z.ZodString;
932
1435
  sessionId: z.ZodString;
1436
+ runId: z.ZodOptional<z.ZodString>;
1437
+ sourceMessageId: z.ZodOptional<z.ZodString>;
933
1438
  sequence: z.ZodNumber;
934
1439
  idempotencyKey: z.ZodString;
935
1440
  occurredAt: z.ZodString;
@@ -947,6 +1452,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
947
1452
  contract: z.ZodLiteral<"AgentSessionEvent">;
948
1453
  eventId: z.ZodString;
949
1454
  sessionId: z.ZodString;
1455
+ runId: z.ZodOptional<z.ZodString>;
1456
+ sourceMessageId: z.ZodOptional<z.ZodString>;
950
1457
  sequence: z.ZodNumber;
951
1458
  idempotencyKey: z.ZodString;
952
1459
  occurredAt: z.ZodString;
@@ -966,6 +1473,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
966
1473
  contract: z.ZodLiteral<"AgentSessionEvent">;
967
1474
  eventId: z.ZodString;
968
1475
  sessionId: z.ZodString;
1476
+ runId: z.ZodOptional<z.ZodString>;
1477
+ sourceMessageId: z.ZodOptional<z.ZodString>;
969
1478
  sequence: z.ZodNumber;
970
1479
  idempotencyKey: z.ZodString;
971
1480
  occurredAt: z.ZodString;
@@ -994,11 +1503,15 @@ export type AgentSessionCapability = z.infer<typeof AgentSessionCapabilitySchema
994
1503
  export type AgentSessionCapabilities = z.infer<typeof AgentSessionCapabilitiesSchema>;
995
1504
  export type AgentSessionSnapshot = z.infer<typeof AgentSessionSnapshotSchema>;
996
1505
  export type AgentSessionStatus = z.infer<typeof AgentSessionStatusSchema>;
1506
+ export type AgentSessionTerminalStatus = z.infer<typeof AgentSessionTerminalStatusSchema>;
1507
+ export type AgentSessionRun = z.infer<typeof AgentSessionRunSchema>;
997
1508
  export type AgentSessionCommandType = z.infer<typeof AgentSessionCommandTypeSchema>;
998
1509
  export type AgentSessionCommand = z.infer<typeof AgentSessionCommandSchema>;
1510
+ export type AgentSessionTargetedCommand = z.infer<typeof AgentSessionTargetedCommandSchema>;
999
1511
  export type AgentSessionCommandErrorCode = z.infer<typeof AgentSessionCommandErrorCodeSchema>;
1000
1512
  export type AgentSessionCommandResult = z.infer<typeof AgentSessionCommandResultSchema>;
1001
1513
  export type AgentSessionEvent = z.infer<typeof AgentSessionEventSchema>;
1514
+ export type AgentSessionRunEvent = z.infer<typeof AgentSessionRunEventSchema>;
1002
1515
  export type AgentSessionViewModel = z.infer<typeof AgentSessionViewModelSchema>;
1003
1516
  export declare const AgentExecutionModeSchema: z.ZodEnum<{
1004
1517
  chatbot: "chatbot";