@inf-monkeys-tech/monkeys 1.0.20 → 1.0.22

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.
@@ -60,6 +60,10 @@ export declare const AgentSessionCapabilitySchema: z.ZodEnum<{
60
60
  workspaceFiles: "workspaceFiles";
61
61
  terminal: "terminal";
62
62
  testResults: "testResults";
63
+ threadForking: "threadForking";
64
+ editAndRerun: "editAndRerun";
65
+ steering: "steering";
66
+ summary: "summary";
63
67
  }>;
64
68
  export declare const AgentSessionCapabilitiesSchema: z.ZodObject<{
65
69
  text: z.ZodDefault<z.ZodBoolean>;
@@ -79,6 +83,10 @@ export declare const AgentSessionCapabilitiesSchema: z.ZodObject<{
79
83
  workspaceFiles: z.ZodDefault<z.ZodBoolean>;
80
84
  terminal: z.ZodDefault<z.ZodBoolean>;
81
85
  testResults: z.ZodDefault<z.ZodBoolean>;
86
+ threadForking: z.ZodDefault<z.ZodBoolean>;
87
+ editAndRerun: z.ZodDefault<z.ZodBoolean>;
88
+ steering: z.ZodDefault<z.ZodBoolean>;
89
+ summary: z.ZodDefault<z.ZodBoolean>;
82
90
  }, z.core.$strict>;
83
91
  export declare const AGENT_SESSION_RUNTIME_CAPABILITIES: Readonly<{
84
92
  chatbot: {
@@ -99,6 +107,10 @@ export declare const AGENT_SESSION_RUNTIME_CAPABILITIES: Readonly<{
99
107
  workspaceFiles: boolean;
100
108
  terminal: boolean;
101
109
  testResults: boolean;
110
+ threadForking: boolean;
111
+ editAndRerun: boolean;
112
+ steering: boolean;
113
+ summary: boolean;
102
114
  };
103
115
  agent: {
104
116
  text: boolean;
@@ -118,6 +130,10 @@ export declare const AGENT_SESSION_RUNTIME_CAPABILITIES: Readonly<{
118
130
  workspaceFiles: boolean;
119
131
  terminal: boolean;
120
132
  testResults: boolean;
133
+ threadForking: boolean;
134
+ editAndRerun: boolean;
135
+ steering: boolean;
136
+ summary: boolean;
121
137
  };
122
138
  }>;
123
139
  export declare function getAgentSessionRuntimeCapabilities(mode: AgentMode): AgentSessionCapabilities;
@@ -190,6 +206,22 @@ export declare const AGENT_SESSION_CAPABILITY_EVIDENCE: Readonly<{
190
206
  readonly eventTypes: readonly ["test-result"];
191
207
  readonly commandTypes: readonly [];
192
208
  };
209
+ readonly threadForking: {
210
+ readonly eventTypes: readonly [];
211
+ readonly commandTypes: readonly ["fork"];
212
+ };
213
+ readonly editAndRerun: {
214
+ readonly eventTypes: readonly [];
215
+ readonly commandTypes: readonly ["edit-and-rerun"];
216
+ };
217
+ readonly steering: {
218
+ readonly eventTypes: readonly [];
219
+ readonly commandTypes: readonly ["steer"];
220
+ };
221
+ readonly summary: {
222
+ readonly eventTypes: readonly ["summary"];
223
+ readonly commandTypes: readonly [];
224
+ };
193
225
  }>;
194
226
  export declare function findUnsupportedAgentSessionCapabilities(capabilities: AgentSessionCapabilities, evidence: {
195
227
  eventTypes?: readonly string[];
@@ -219,130 +251,939 @@ export declare const AgentSessionSnapshotSchema: z.ZodObject<{
219
251
  workspaceFiles: z.ZodDefault<z.ZodBoolean>;
220
252
  terminal: z.ZodDefault<z.ZodBoolean>;
221
253
  testResults: z.ZodDefault<z.ZodBoolean>;
254
+ threadForking: z.ZodDefault<z.ZodBoolean>;
255
+ editAndRerun: z.ZodDefault<z.ZodBoolean>;
256
+ steering: z.ZodDefault<z.ZodBoolean>;
257
+ summary: z.ZodDefault<z.ZodBoolean>;
258
+ }, z.core.$strict>;
259
+ }, z.core.$strict>;
260
+ export declare const AgentSessionStatusSchema: z.ZodEnum<{
261
+ queued: "queued";
262
+ running: "running";
263
+ waiting_approval: "waiting_approval";
264
+ stopping: "stopping";
265
+ stopped: "stopped";
266
+ completed: "completed";
267
+ failed: "failed";
268
+ }>;
269
+ export declare const AgentSessionTerminalStatusSchema: z.ZodEnum<{
270
+ stopped: "stopped";
271
+ completed: "completed";
272
+ failed: "failed";
273
+ }>;
274
+ export declare const AgentSessionLineageSchema: z.ZodObject<{
275
+ forkedFromThreadId: z.ZodString;
276
+ forkedFromMessageId: z.ZodString;
277
+ sourceRunId: z.ZodString;
278
+ }, z.core.$strict>;
279
+ export declare const AgentSessionContextInheritanceSchema: z.ZodObject<{
280
+ messages: z.ZodEnum<{
281
+ "through-source-message": "through-source-message";
282
+ exclude: "exclude";
283
+ }>;
284
+ attachments: z.ZodEnum<{
285
+ exclude: "exclude";
286
+ inherit: "inherit";
287
+ }>;
288
+ summaries: z.ZodEnum<{
289
+ exclude: "exclude";
290
+ inherit: "inherit";
291
+ }>;
292
+ toolResults: z.ZodEnum<{
293
+ exclude: "exclude";
294
+ inherit: "inherit";
295
+ }>;
296
+ codeChanges: z.ZodEnum<{
297
+ exclude: "exclude";
298
+ inherit: "inherit";
299
+ }>;
300
+ }, z.core.$strict>;
301
+ export declare const AgentSessionActiveBranchSchema: z.ZodObject<{
302
+ branchId: z.ZodString;
303
+ threadId: z.ZodString;
304
+ sourceMessageId: z.ZodString;
305
+ runId: z.ZodString;
306
+ lineage: z.ZodOptional<z.ZodObject<{
307
+ forkedFromThreadId: z.ZodString;
308
+ forkedFromMessageId: z.ZodString;
309
+ sourceRunId: z.ZodString;
310
+ }, z.core.$strict>>;
311
+ createdAt: z.ZodString;
312
+ }, z.core.$strict>;
313
+ export declare const AgentSessionRunSchema: z.ZodObject<{
314
+ runId: z.ZodString;
315
+ sessionId: z.ZodString;
316
+ sourceMessageId: z.ZodString;
317
+ status: z.ZodEnum<{
318
+ queued: "queued";
319
+ running: "running";
320
+ waiting_approval: "waiting_approval";
321
+ stopping: "stopping";
322
+ stopped: "stopped";
323
+ completed: "completed";
324
+ failed: "failed";
325
+ }>;
326
+ startedAt: z.ZodString;
327
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
328
+ stoppedAt: z.ZodOptional<z.ZodString>;
329
+ completedAt: z.ZodOptional<z.ZodString>;
330
+ failedAt: z.ZodOptional<z.ZodString>;
331
+ durationMs: z.ZodOptional<z.ZodNumber>;
332
+ }, z.core.$strict>;
333
+ export declare const AgentSessionCommandTypeSchema: z.ZodEnum<{
334
+ approval: "approval";
335
+ resume: "resume";
336
+ fork: "fork";
337
+ "edit-and-rerun": "edit-and-rerun";
338
+ steer: "steer";
339
+ stop: "stop";
340
+ retry: "retry";
341
+ }>;
342
+ export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[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<"stop">;
351
+ payload: z.ZodObject<{
352
+ reason: z.ZodOptional<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<"resume">;
363
+ payload: z.ZodObject<{
364
+ resumeEventId: z.ZodOptional<z.ZodString>;
365
+ }, z.core.$strict>;
366
+ }, z.core.$strict>, z.ZodObject<{
367
+ contract: z.ZodLiteral<"AgentSessionCommand">;
368
+ commandId: z.ZodString;
369
+ sessionId: z.ZodString;
370
+ runId: z.ZodOptional<z.ZodString>;
371
+ idempotencyKey: z.ZodString;
372
+ expectedSequence: z.ZodNumber;
373
+ issuedAt: z.ZodString;
374
+ commandType: z.ZodLiteral<"retry">;
375
+ payload: z.ZodObject<{
376
+ sourceEventId: z.ZodString;
377
+ }, z.core.$strict>;
378
+ }, z.core.$strict>, z.ZodObject<{
379
+ contract: z.ZodLiteral<"AgentSessionCommand">;
380
+ commandId: z.ZodString;
381
+ sessionId: z.ZodString;
382
+ runId: z.ZodOptional<z.ZodString>;
383
+ idempotencyKey: z.ZodString;
384
+ expectedSequence: z.ZodNumber;
385
+ issuedAt: z.ZodString;
386
+ commandType: z.ZodLiteral<"approval">;
387
+ payload: z.ZodObject<{
388
+ approvalId: z.ZodString;
389
+ decision: z.ZodEnum<{
390
+ approved: "approved";
391
+ rejected: "rejected";
392
+ }>;
393
+ reason: z.ZodOptional<z.ZodString>;
394
+ }, z.core.$strict>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ contract: z.ZodLiteral<"AgentSessionCommand">;
397
+ commandId: z.ZodString;
398
+ sessionId: z.ZodString;
399
+ runId: z.ZodOptional<z.ZodString>;
400
+ idempotencyKey: z.ZodString;
401
+ expectedSequence: z.ZodNumber;
402
+ issuedAt: z.ZodString;
403
+ commandType: z.ZodLiteral<"fork">;
404
+ payload: z.ZodObject<{
405
+ sourceThreadId: z.ZodString;
406
+ sourceMessageId: z.ZodString;
407
+ sourceRunId: z.ZodString;
408
+ inheritance: z.ZodObject<{
409
+ messages: z.ZodEnum<{
410
+ "through-source-message": "through-source-message";
411
+ exclude: "exclude";
412
+ }>;
413
+ attachments: z.ZodEnum<{
414
+ exclude: "exclude";
415
+ inherit: "inherit";
416
+ }>;
417
+ summaries: z.ZodEnum<{
418
+ exclude: "exclude";
419
+ inherit: "inherit";
420
+ }>;
421
+ toolResults: z.ZodEnum<{
422
+ exclude: "exclude";
423
+ inherit: "inherit";
424
+ }>;
425
+ codeChanges: z.ZodEnum<{
426
+ exclude: "exclude";
427
+ inherit: "inherit";
428
+ }>;
429
+ }, z.core.$strict>;
430
+ }, z.core.$strict>;
431
+ }, z.core.$strict>, z.ZodObject<{
432
+ contract: z.ZodLiteral<"AgentSessionCommand">;
433
+ commandId: z.ZodString;
434
+ sessionId: z.ZodString;
435
+ runId: z.ZodOptional<z.ZodString>;
436
+ idempotencyKey: z.ZodString;
437
+ expectedSequence: z.ZodNumber;
438
+ issuedAt: z.ZodString;
439
+ commandType: z.ZodLiteral<"edit-and-rerun">;
440
+ payload: z.ZodObject<{
441
+ sourceThreadId: z.ZodString;
442
+ sourceMessageId: z.ZodString;
443
+ sourceRunId: z.ZodString;
444
+ replacementParts: z.ZodArray<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
445
+ inheritance: z.ZodObject<{
446
+ messages: z.ZodEnum<{
447
+ "through-source-message": "through-source-message";
448
+ exclude: "exclude";
449
+ }>;
450
+ attachments: z.ZodEnum<{
451
+ exclude: "exclude";
452
+ inherit: "inherit";
453
+ }>;
454
+ summaries: z.ZodEnum<{
455
+ exclude: "exclude";
456
+ inherit: "inherit";
457
+ }>;
458
+ toolResults: z.ZodEnum<{
459
+ exclude: "exclude";
460
+ inherit: "inherit";
461
+ }>;
462
+ codeChanges: z.ZodEnum<{
463
+ exclude: "exclude";
464
+ inherit: "inherit";
465
+ }>;
466
+ }, z.core.$strict>;
467
+ }, z.core.$strict>;
468
+ }, z.core.$strict>, z.ZodObject<{
469
+ contract: z.ZodLiteral<"AgentSessionCommand">;
470
+ commandId: z.ZodString;
471
+ sessionId: z.ZodString;
472
+ runId: z.ZodOptional<z.ZodString>;
473
+ idempotencyKey: z.ZodString;
474
+ expectedSequence: z.ZodNumber;
475
+ issuedAt: z.ZodString;
476
+ commandType: z.ZodLiteral<"steer">;
477
+ payload: z.ZodObject<{
478
+ targetRunId: z.ZodString;
479
+ guidanceParts: z.ZodArray<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
480
+ }, z.core.$strict>;
481
+ }, z.core.$strict>], "commandType">;
482
+ export declare const AgentSessionTargetedCommandSchema: z.ZodIntersection<z.ZodDiscriminatedUnion<[z.ZodObject<{
483
+ contract: z.ZodLiteral<"AgentSessionCommand">;
484
+ commandId: z.ZodString;
485
+ sessionId: z.ZodString;
486
+ runId: z.ZodOptional<z.ZodString>;
487
+ idempotencyKey: z.ZodString;
488
+ expectedSequence: z.ZodNumber;
489
+ issuedAt: z.ZodString;
490
+ commandType: z.ZodLiteral<"stop">;
491
+ payload: z.ZodObject<{
492
+ reason: z.ZodOptional<z.ZodString>;
493
+ }, z.core.$strict>;
494
+ }, z.core.$strict>, z.ZodObject<{
495
+ contract: z.ZodLiteral<"AgentSessionCommand">;
496
+ commandId: z.ZodString;
497
+ sessionId: z.ZodString;
498
+ runId: z.ZodOptional<z.ZodString>;
499
+ idempotencyKey: z.ZodString;
500
+ expectedSequence: z.ZodNumber;
501
+ issuedAt: z.ZodString;
502
+ commandType: z.ZodLiteral<"resume">;
503
+ payload: z.ZodObject<{
504
+ resumeEventId: z.ZodOptional<z.ZodString>;
505
+ }, z.core.$strict>;
506
+ }, z.core.$strict>, z.ZodObject<{
507
+ contract: z.ZodLiteral<"AgentSessionCommand">;
508
+ commandId: z.ZodString;
509
+ sessionId: z.ZodString;
510
+ runId: z.ZodOptional<z.ZodString>;
511
+ idempotencyKey: z.ZodString;
512
+ expectedSequence: z.ZodNumber;
513
+ issuedAt: z.ZodString;
514
+ commandType: z.ZodLiteral<"retry">;
515
+ payload: z.ZodObject<{
516
+ sourceEventId: z.ZodString;
517
+ }, z.core.$strict>;
518
+ }, z.core.$strict>, z.ZodObject<{
519
+ contract: z.ZodLiteral<"AgentSessionCommand">;
520
+ commandId: z.ZodString;
521
+ sessionId: z.ZodString;
522
+ runId: z.ZodOptional<z.ZodString>;
523
+ idempotencyKey: z.ZodString;
524
+ expectedSequence: z.ZodNumber;
525
+ issuedAt: z.ZodString;
526
+ commandType: z.ZodLiteral<"approval">;
527
+ payload: z.ZodObject<{
528
+ approvalId: z.ZodString;
529
+ decision: z.ZodEnum<{
530
+ approved: "approved";
531
+ rejected: "rejected";
532
+ }>;
533
+ reason: z.ZodOptional<z.ZodString>;
534
+ }, z.core.$strict>;
535
+ }, z.core.$strict>, z.ZodObject<{
536
+ contract: z.ZodLiteral<"AgentSessionCommand">;
537
+ commandId: z.ZodString;
538
+ sessionId: z.ZodString;
539
+ runId: z.ZodOptional<z.ZodString>;
540
+ idempotencyKey: z.ZodString;
541
+ expectedSequence: z.ZodNumber;
542
+ issuedAt: z.ZodString;
543
+ commandType: z.ZodLiteral<"fork">;
544
+ payload: z.ZodObject<{
545
+ sourceThreadId: z.ZodString;
546
+ sourceMessageId: z.ZodString;
547
+ sourceRunId: z.ZodString;
548
+ inheritance: z.ZodObject<{
549
+ messages: z.ZodEnum<{
550
+ "through-source-message": "through-source-message";
551
+ exclude: "exclude";
552
+ }>;
553
+ attachments: z.ZodEnum<{
554
+ exclude: "exclude";
555
+ inherit: "inherit";
556
+ }>;
557
+ summaries: z.ZodEnum<{
558
+ exclude: "exclude";
559
+ inherit: "inherit";
560
+ }>;
561
+ toolResults: z.ZodEnum<{
562
+ exclude: "exclude";
563
+ inherit: "inherit";
564
+ }>;
565
+ codeChanges: z.ZodEnum<{
566
+ exclude: "exclude";
567
+ inherit: "inherit";
568
+ }>;
569
+ }, z.core.$strict>;
570
+ }, z.core.$strict>;
571
+ }, z.core.$strict>, z.ZodObject<{
572
+ contract: z.ZodLiteral<"AgentSessionCommand">;
573
+ commandId: z.ZodString;
574
+ sessionId: z.ZodString;
575
+ runId: z.ZodOptional<z.ZodString>;
576
+ idempotencyKey: z.ZodString;
577
+ expectedSequence: z.ZodNumber;
578
+ issuedAt: z.ZodString;
579
+ commandType: z.ZodLiteral<"edit-and-rerun">;
580
+ payload: z.ZodObject<{
581
+ sourceThreadId: z.ZodString;
582
+ sourceMessageId: z.ZodString;
583
+ sourceRunId: z.ZodString;
584
+ replacementParts: z.ZodArray<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
585
+ inheritance: z.ZodObject<{
586
+ messages: z.ZodEnum<{
587
+ "through-source-message": "through-source-message";
588
+ exclude: "exclude";
589
+ }>;
590
+ attachments: z.ZodEnum<{
591
+ exclude: "exclude";
592
+ inherit: "inherit";
593
+ }>;
594
+ summaries: z.ZodEnum<{
595
+ exclude: "exclude";
596
+ inherit: "inherit";
597
+ }>;
598
+ toolResults: z.ZodEnum<{
599
+ exclude: "exclude";
600
+ inherit: "inherit";
601
+ }>;
602
+ codeChanges: z.ZodEnum<{
603
+ exclude: "exclude";
604
+ inherit: "inherit";
605
+ }>;
606
+ }, z.core.$strict>;
607
+ }, z.core.$strict>;
608
+ }, z.core.$strict>, z.ZodObject<{
609
+ contract: z.ZodLiteral<"AgentSessionCommand">;
610
+ commandId: z.ZodString;
611
+ sessionId: z.ZodString;
612
+ runId: z.ZodOptional<z.ZodString>;
613
+ idempotencyKey: z.ZodString;
614
+ expectedSequence: z.ZodNumber;
615
+ issuedAt: z.ZodString;
616
+ commandType: z.ZodLiteral<"steer">;
617
+ payload: z.ZodObject<{
618
+ targetRunId: z.ZodString;
619
+ guidanceParts: z.ZodArray<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
620
+ }, z.core.$strict>;
621
+ }, z.core.$strict>], "commandType">, z.ZodObject<{
622
+ runId: z.ZodString;
623
+ }, z.core.$strip>>;
624
+ export declare const AgentSessionCommandErrorCodeSchema: z.ZodEnum<{
625
+ SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
626
+ RUN_NOT_FOUND: "RUN_NOT_FOUND";
627
+ RUN_ALREADY_FINISHED: "RUN_ALREADY_FINISHED";
628
+ STOP_TIMEOUT: "STOP_TIMEOUT";
629
+ COMMAND_NOT_SUPPORTED: "COMMAND_NOT_SUPPORTED";
630
+ CAPABILITY_UNAVAILABLE: "CAPABILITY_UNAVAILABLE";
631
+ SEQUENCE_CONFLICT: "SEQUENCE_CONFLICT";
632
+ INVALID_SESSION_STATE: "INVALID_SESSION_STATE";
633
+ TARGET_EVENT_NOT_FOUND: "TARGET_EVENT_NOT_FOUND";
634
+ TARGET_EVENT_NOT_RETRYABLE: "TARGET_EVENT_NOT_RETRYABLE";
635
+ APPROVAL_NOT_FOUND: "APPROVAL_NOT_FOUND";
636
+ APPROVAL_ALREADY_RESOLVED: "APPROVAL_ALREADY_RESOLVED";
637
+ SOURCE_THREAD_NOT_FOUND: "SOURCE_THREAD_NOT_FOUND";
638
+ SOURCE_MESSAGE_NOT_FOUND: "SOURCE_MESSAGE_NOT_FOUND";
639
+ SOURCE_RUN_NOT_FOUND: "SOURCE_RUN_NOT_FOUND";
640
+ SOURCE_LINEAGE_INVALID: "SOURCE_LINEAGE_INVALID";
641
+ ACTIVE_BRANCH_NOT_FOUND: "ACTIVE_BRANCH_NOT_FOUND";
642
+ COMMAND_EXECUTION_FAILED: "COMMAND_EXECUTION_FAILED";
643
+ }>;
644
+ export declare const AgentSessionCommandResultSchema: z.ZodObject<{
645
+ contract: z.ZodLiteral<"AgentSessionCommandResult">;
646
+ commandId: z.ZodString;
647
+ sessionId: z.ZodString;
648
+ runId: z.ZodOptional<z.ZodString>;
649
+ idempotencyKey: z.ZodString;
650
+ outcome: z.ZodEnum<{
651
+ failed: "failed";
652
+ rejected: "rejected";
653
+ accepted: "accepted";
654
+ duplicate: "duplicate";
655
+ }>;
656
+ sessionStatus: z.ZodEnum<{
657
+ queued: "queued";
658
+ running: "running";
659
+ waiting_approval: "waiting_approval";
660
+ stopping: "stopping";
661
+ stopped: "stopped";
662
+ completed: "completed";
663
+ failed: "failed";
664
+ }>;
665
+ acceptedSequence: z.ZodOptional<z.ZodNumber>;
666
+ resultEventIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
667
+ operation: z.ZodOptional<z.ZodObject<{
668
+ lineage: z.ZodObject<{
669
+ forkedFromThreadId: z.ZodString;
670
+ forkedFromMessageId: z.ZodString;
671
+ sourceRunId: z.ZodString;
672
+ }, z.core.$strict>;
673
+ activeBranch: z.ZodObject<{
674
+ branchId: z.ZodString;
675
+ threadId: z.ZodString;
676
+ sourceMessageId: z.ZodString;
677
+ runId: z.ZodString;
678
+ lineage: z.ZodOptional<z.ZodObject<{
679
+ forkedFromThreadId: z.ZodString;
680
+ forkedFromMessageId: z.ZodString;
681
+ sourceRunId: z.ZodString;
682
+ }, z.core.$strict>>;
683
+ createdAt: z.ZodString;
684
+ }, z.core.$strict>;
685
+ }, z.core.$strict>>;
686
+ termination: z.ZodOptional<z.ZodEnum<{
687
+ requested: "requested";
688
+ confirmed: "confirmed";
689
+ }>>;
690
+ error: z.ZodOptional<z.ZodObject<{
691
+ code: z.ZodEnum<{
692
+ SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
693
+ RUN_NOT_FOUND: "RUN_NOT_FOUND";
694
+ RUN_ALREADY_FINISHED: "RUN_ALREADY_FINISHED";
695
+ STOP_TIMEOUT: "STOP_TIMEOUT";
696
+ COMMAND_NOT_SUPPORTED: "COMMAND_NOT_SUPPORTED";
697
+ CAPABILITY_UNAVAILABLE: "CAPABILITY_UNAVAILABLE";
698
+ SEQUENCE_CONFLICT: "SEQUENCE_CONFLICT";
699
+ INVALID_SESSION_STATE: "INVALID_SESSION_STATE";
700
+ TARGET_EVENT_NOT_FOUND: "TARGET_EVENT_NOT_FOUND";
701
+ TARGET_EVENT_NOT_RETRYABLE: "TARGET_EVENT_NOT_RETRYABLE";
702
+ APPROVAL_NOT_FOUND: "APPROVAL_NOT_FOUND";
703
+ APPROVAL_ALREADY_RESOLVED: "APPROVAL_ALREADY_RESOLVED";
704
+ SOURCE_THREAD_NOT_FOUND: "SOURCE_THREAD_NOT_FOUND";
705
+ SOURCE_MESSAGE_NOT_FOUND: "SOURCE_MESSAGE_NOT_FOUND";
706
+ SOURCE_RUN_NOT_FOUND: "SOURCE_RUN_NOT_FOUND";
707
+ SOURCE_LINEAGE_INVALID: "SOURCE_LINEAGE_INVALID";
708
+ ACTIVE_BRANCH_NOT_FOUND: "ACTIVE_BRANCH_NOT_FOUND";
709
+ COMMAND_EXECUTION_FAILED: "COMMAND_EXECUTION_FAILED";
710
+ }>;
711
+ message: z.ZodString;
712
+ retryable: z.ZodBoolean;
713
+ }, z.core.$strict>>;
714
+ occurredAt: z.ZodString;
715
+ }, z.core.$strict>;
716
+ export declare const AgentSessionCommandPolicySchema: z.ZodObject<{
717
+ capability: z.ZodOptional<z.ZodEnum<{
718
+ tools: "tools";
719
+ text: "text";
720
+ skills: "skills";
721
+ mcp: "mcp";
722
+ reasoning: "reasoning";
723
+ plan: "plan";
724
+ tasks: "tasks";
725
+ shell: "shell";
726
+ fileChange: "fileChange";
727
+ approval: "approval";
728
+ artifacts: "artifacts";
729
+ usage: "usage";
730
+ resume: "resume";
731
+ diff: "diff";
732
+ workspaceFiles: "workspaceFiles";
733
+ terminal: "terminal";
734
+ testResults: "testResults";
735
+ threadForking: "threadForking";
736
+ editAndRerun: "editAndRerun";
737
+ steering: "steering";
738
+ summary: "summary";
739
+ }>>;
740
+ allowedStatuses: z.ZodArray<z.ZodEnum<{
741
+ queued: "queued";
742
+ running: "running";
743
+ waiting_approval: "waiting_approval";
744
+ stopping: "stopping";
745
+ stopped: "stopped";
746
+ completed: "completed";
747
+ failed: "failed";
748
+ }>>;
749
+ requiresRunId: z.ZodBoolean;
750
+ sourceSessionEffect: z.ZodEnum<{
751
+ transition: "transition";
752
+ preserve: "preserve";
753
+ }>;
754
+ idempotencyScope: z.ZodLiteral<"session-command">;
755
+ sequenceRule: z.ZodLiteral<"match-current">;
756
+ }, z.core.$strict>;
757
+ export declare const AGENT_SESSION_COMMAND_POLICIES: Readonly<{
758
+ stop: {
759
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
760
+ requiresRunId: boolean;
761
+ sourceSessionEffect: "transition" | "preserve";
762
+ idempotencyScope: "session-command";
763
+ sequenceRule: "match-current";
764
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
765
+ };
766
+ resume: {
767
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
768
+ requiresRunId: boolean;
769
+ sourceSessionEffect: "transition" | "preserve";
770
+ idempotencyScope: "session-command";
771
+ sequenceRule: "match-current";
772
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
773
+ };
774
+ retry: {
775
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
776
+ requiresRunId: boolean;
777
+ sourceSessionEffect: "transition" | "preserve";
778
+ idempotencyScope: "session-command";
779
+ sequenceRule: "match-current";
780
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
781
+ };
782
+ approval: {
783
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
784
+ requiresRunId: boolean;
785
+ sourceSessionEffect: "transition" | "preserve";
786
+ idempotencyScope: "session-command";
787
+ sequenceRule: "match-current";
788
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
789
+ };
790
+ fork: {
791
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
792
+ requiresRunId: boolean;
793
+ sourceSessionEffect: "transition" | "preserve";
794
+ idempotencyScope: "session-command";
795
+ sequenceRule: "match-current";
796
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
797
+ };
798
+ 'edit-and-rerun': {
799
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
800
+ requiresRunId: boolean;
801
+ sourceSessionEffect: "transition" | "preserve";
802
+ idempotencyScope: "session-command";
803
+ sequenceRule: "match-current";
804
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
805
+ };
806
+ steer: {
807
+ allowedStatuses: ("queued" | "running" | "waiting_approval" | "stopping" | "stopped" | "completed" | "failed")[];
808
+ requiresRunId: boolean;
809
+ sourceSessionEffect: "transition" | "preserve";
810
+ idempotencyScope: "session-command";
811
+ sequenceRule: "match-current";
812
+ capability?: "tools" | "text" | "skills" | "mcp" | "reasoning" | "plan" | "tasks" | "shell" | "fileChange" | "approval" | "artifacts" | "usage" | "resume" | "diff" | "workspaceFiles" | "terminal" | "testResults" | "threadForking" | "editAndRerun" | "steering" | "summary" | undefined;
813
+ };
814
+ }>;
815
+ export declare function getAgentSessionCommandPolicy(commandType: AgentSessionCommandType): AgentSessionCommandPolicy;
816
+ export declare function canIssueAgentSessionCommand(status: AgentSessionStatus, commandType: AgentSessionCommandType): boolean;
817
+ export declare function resolveAgentSessionCommandTransition(status: AgentSessionStatus, commandType: AgentSessionCommandType): AgentSessionStatus | undefined;
818
+ export declare function isAgentSessionTerminalStatus(status: AgentSessionStatus): status is AgentSessionTerminalStatus;
819
+ export declare function canApplyAgentSessionRunStatus(current: AgentSessionStatus, next: AgentSessionStatus): boolean;
820
+ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
821
+ contract: z.ZodLiteral<"AgentSessionEvent">;
822
+ eventId: z.ZodString;
823
+ sessionId: z.ZodString;
824
+ runId: z.ZodOptional<z.ZodString>;
825
+ sourceMessageId: z.ZodOptional<z.ZodString>;
826
+ sequence: z.ZodNumber;
827
+ idempotencyKey: z.ZodString;
828
+ occurredAt: z.ZodString;
829
+ eventType: z.ZodLiteral<"message">;
830
+ payload: z.ZodObject<{
831
+ messageId: z.ZodString;
832
+ role: z.ZodEnum<{
833
+ user: "user";
834
+ assistant: "assistant";
835
+ system: "system";
836
+ }>;
837
+ operation: z.ZodDefault<z.ZodEnum<{
838
+ replace: "replace";
839
+ append: "append";
840
+ }>>;
841
+ parts: z.ZodArray<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
842
+ status: z.ZodOptional<z.ZodEnum<{
843
+ completed: "completed";
844
+ failed: "failed";
845
+ streaming: "streaming";
846
+ }>>;
847
+ }, z.core.$strict>;
848
+ }, z.core.$strict>, z.ZodObject<{
849
+ contract: z.ZodLiteral<"AgentSessionEvent">;
850
+ eventId: z.ZodString;
851
+ sessionId: z.ZodString;
852
+ runId: z.ZodOptional<z.ZodString>;
853
+ sourceMessageId: z.ZodOptional<z.ZodString>;
854
+ sequence: z.ZodNumber;
855
+ idempotencyKey: z.ZodString;
856
+ occurredAt: z.ZodString;
857
+ eventType: z.ZodLiteral<"reasoning">;
858
+ payload: z.ZodObject<{
859
+ reasoningId: z.ZodString;
860
+ text: z.ZodString;
861
+ status: z.ZodEnum<{
862
+ completed: "completed";
863
+ streaming: "streaming";
864
+ }>;
865
+ }, z.core.$strict>;
866
+ }, z.core.$strict>, z.ZodObject<{
867
+ contract: z.ZodLiteral<"AgentSessionEvent">;
868
+ eventId: z.ZodString;
869
+ sessionId: z.ZodString;
870
+ runId: z.ZodOptional<z.ZodString>;
871
+ sourceMessageId: z.ZodOptional<z.ZodString>;
872
+ sequence: z.ZodNumber;
873
+ idempotencyKey: z.ZodString;
874
+ occurredAt: z.ZodString;
875
+ eventType: z.ZodLiteral<"plan">;
876
+ payload: z.ZodObject<{
877
+ planId: z.ZodString;
878
+ title: z.ZodOptional<z.ZodString>;
879
+ status: z.ZodEnum<{
880
+ running: "running";
881
+ completed: "completed";
882
+ failed: "failed";
883
+ pending: "pending";
884
+ }>;
885
+ steps: z.ZodArray<z.ZodObject<{
886
+ id: z.ZodString;
887
+ title: z.ZodString;
888
+ status: z.ZodEnum<{
889
+ running: "running";
890
+ completed: "completed";
891
+ failed: "failed";
892
+ pending: "pending";
893
+ skipped: "skipped";
894
+ }>;
895
+ }, z.core.$strict>>;
896
+ }, z.core.$strict>;
897
+ }, z.core.$strict>, z.ZodObject<{
898
+ contract: z.ZodLiteral<"AgentSessionEvent">;
899
+ eventId: z.ZodString;
900
+ sessionId: z.ZodString;
901
+ runId: z.ZodOptional<z.ZodString>;
902
+ sourceMessageId: z.ZodOptional<z.ZodString>;
903
+ sequence: z.ZodNumber;
904
+ idempotencyKey: z.ZodString;
905
+ occurredAt: z.ZodString;
906
+ eventType: z.ZodLiteral<"task">;
907
+ payload: z.ZodObject<{
908
+ taskId: z.ZodString;
909
+ title: z.ZodString;
910
+ status: z.ZodEnum<{
911
+ running: "running";
912
+ completed: "completed";
913
+ failed: "failed";
914
+ pending: "pending";
915
+ skipped: "skipped";
916
+ }>;
917
+ detail: z.ZodOptional<z.ZodString>;
918
+ }, z.core.$strict>;
919
+ }, z.core.$strict>, z.ZodObject<{
920
+ contract: z.ZodLiteral<"AgentSessionEvent">;
921
+ eventId: z.ZodString;
922
+ sessionId: z.ZodString;
923
+ runId: z.ZodOptional<z.ZodString>;
924
+ sourceMessageId: z.ZodOptional<z.ZodString>;
925
+ sequence: z.ZodNumber;
926
+ idempotencyKey: z.ZodString;
927
+ occurredAt: z.ZodString;
928
+ eventType: z.ZodLiteral<"tool">;
929
+ payload: z.ZodObject<{
930
+ toolCallId: z.ZodString;
931
+ toolName: z.ZodString;
932
+ status: z.ZodEnum<{
933
+ running: "running";
934
+ completed: "completed";
935
+ failed: "failed";
936
+ pending: "pending";
937
+ denied: "denied";
938
+ }>;
939
+ input: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
940
+ output: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
941
+ error: z.ZodOptional<z.ZodString>;
942
+ startedAt: z.ZodOptional<z.ZodString>;
943
+ completedAt: z.ZodOptional<z.ZodString>;
944
+ }, z.core.$strict>;
945
+ }, z.core.$strict>, z.ZodObject<{
946
+ contract: z.ZodLiteral<"AgentSessionEvent">;
947
+ eventId: z.ZodString;
948
+ sessionId: z.ZodString;
949
+ runId: z.ZodOptional<z.ZodString>;
950
+ sourceMessageId: z.ZodOptional<z.ZodString>;
951
+ sequence: z.ZodNumber;
952
+ idempotencyKey: z.ZodString;
953
+ occurredAt: z.ZodString;
954
+ eventType: z.ZodLiteral<"approval">;
955
+ payload: z.ZodObject<{
956
+ approvalId: z.ZodString;
957
+ toolCallId: z.ZodOptional<z.ZodString>;
958
+ status: z.ZodEnum<{
959
+ approved: "approved";
960
+ rejected: "rejected";
961
+ requested: "requested";
962
+ expired: "expired";
963
+ }>;
964
+ title: z.ZodString;
965
+ description: z.ZodOptional<z.ZodString>;
966
+ requestedAction: z.ZodOptional<z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>;
967
+ }, z.core.$strict>;
968
+ }, z.core.$strict>, z.ZodObject<{
969
+ contract: z.ZodLiteral<"AgentSessionEvent">;
970
+ eventId: z.ZodString;
971
+ sessionId: z.ZodString;
972
+ runId: z.ZodOptional<z.ZodString>;
973
+ sourceMessageId: z.ZodOptional<z.ZodString>;
974
+ sequence: z.ZodNumber;
975
+ idempotencyKey: z.ZodString;
976
+ occurredAt: z.ZodString;
977
+ eventType: z.ZodLiteral<"status">;
978
+ payload: z.ZodObject<{
979
+ status: z.ZodEnum<{
980
+ queued: "queued";
981
+ running: "running";
982
+ waiting_approval: "waiting_approval";
983
+ stopping: "stopping";
984
+ stopped: "stopped";
985
+ completed: "completed";
986
+ failed: "failed";
987
+ }>;
988
+ detail: z.ZodOptional<z.ZodString>;
989
+ startedAt: z.ZodOptional<z.ZodString>;
990
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
991
+ stoppedAt: z.ZodOptional<z.ZodString>;
992
+ completedAt: z.ZodOptional<z.ZodString>;
993
+ failedAt: z.ZodOptional<z.ZodString>;
994
+ durationMs: z.ZodOptional<z.ZodNumber>;
995
+ }, z.core.$strict>;
996
+ }, z.core.$strict>, z.ZodObject<{
997
+ contract: z.ZodLiteral<"AgentSessionEvent">;
998
+ eventId: z.ZodString;
999
+ sessionId: z.ZodString;
1000
+ runId: z.ZodOptional<z.ZodString>;
1001
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1002
+ sequence: z.ZodNumber;
1003
+ idempotencyKey: z.ZodString;
1004
+ occurredAt: z.ZodString;
1005
+ eventType: z.ZodLiteral<"artifact">;
1006
+ payload: z.ZodObject<{
1007
+ artifactId: z.ZodString;
1008
+ name: z.ZodString;
1009
+ kind: z.ZodEnum<{
1010
+ file: "file";
1011
+ image: "image";
1012
+ video: "video";
1013
+ audio: "audio";
1014
+ web: "web";
1015
+ other: "other";
1016
+ }>;
1017
+ status: z.ZodEnum<{
1018
+ failed: "failed";
1019
+ pending: "pending";
1020
+ ready: "ready";
1021
+ }>;
1022
+ mimeType: z.ZodOptional<z.ZodString>;
1023
+ url: z.ZodOptional<z.ZodString>;
1024
+ size: z.ZodOptional<z.ZodNumber>;
1025
+ sourceEventId: z.ZodOptional<z.ZodString>;
222
1026
  }, z.core.$strict>;
223
- }, z.core.$strict>;
224
- export declare const AgentSessionStatusSchema: z.ZodEnum<{
225
- queued: "queued";
226
- running: "running";
227
- waiting_approval: "waiting_approval";
228
- stopping: "stopping";
229
- stopped: "stopped";
230
- completed: "completed";
231
- failed: "failed";
232
- }>;
233
- export declare const AgentSessionCommandTypeSchema: z.ZodEnum<{
234
- approval: "approval";
235
- resume: "resume";
236
- stop: "stop";
237
- retry: "retry";
238
- }>;
239
- export declare const AgentSessionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
240
- contract: z.ZodLiteral<"AgentSessionCommand">;
241
- commandId: z.ZodString;
1027
+ }, z.core.$strict>, z.ZodObject<{
1028
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1029
+ eventId: z.ZodString;
242
1030
  sessionId: z.ZodString;
1031
+ runId: z.ZodOptional<z.ZodString>;
1032
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1033
+ sequence: z.ZodNumber;
243
1034
  idempotencyKey: z.ZodString;
244
- expectedSequence: z.ZodNumber;
245
- issuedAt: z.ZodString;
246
- commandType: z.ZodLiteral<"stop">;
1035
+ occurredAt: z.ZodString;
1036
+ eventType: z.ZodLiteral<"usage">;
1037
+ payload: z.ZodObject<{
1038
+ inputTokens: z.ZodOptional<z.ZodNumber>;
1039
+ outputTokens: z.ZodOptional<z.ZodNumber>;
1040
+ totalTokens: z.ZodOptional<z.ZodNumber>;
1041
+ contextTokens: z.ZodOptional<z.ZodNumber>;
1042
+ contextWindow: z.ZodOptional<z.ZodNumber>;
1043
+ }, z.core.$strict>;
1044
+ }, z.core.$strict>, z.ZodObject<{
1045
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1046
+ eventId: z.ZodString;
1047
+ sessionId: z.ZodString;
1048
+ runId: z.ZodOptional<z.ZodString>;
1049
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1050
+ sequence: z.ZodNumber;
1051
+ idempotencyKey: z.ZodString;
1052
+ occurredAt: z.ZodString;
1053
+ eventType: z.ZodLiteral<"resume">;
247
1054
  payload: z.ZodObject<{
1055
+ resumable: z.ZodBoolean;
1056
+ state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
248
1057
  reason: z.ZodOptional<z.ZodString>;
249
1058
  }, z.core.$strict>;
250
1059
  }, z.core.$strict>, z.ZodObject<{
251
- contract: z.ZodLiteral<"AgentSessionCommand">;
252
- commandId: z.ZodString;
1060
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1061
+ eventId: z.ZodString;
253
1062
  sessionId: z.ZodString;
1063
+ runId: z.ZodOptional<z.ZodString>;
1064
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1065
+ sequence: z.ZodNumber;
254
1066
  idempotencyKey: z.ZodString;
255
- expectedSequence: z.ZodNumber;
256
- issuedAt: z.ZodString;
257
- commandType: z.ZodLiteral<"resume">;
1067
+ occurredAt: z.ZodString;
1068
+ eventType: z.ZodLiteral<"error">;
258
1069
  payload: z.ZodObject<{
259
- resumeEventId: z.ZodOptional<z.ZodString>;
1070
+ code: z.ZodString;
1071
+ message: z.ZodString;
1072
+ retryable: z.ZodBoolean;
1073
+ sourceEventId: z.ZodOptional<z.ZodString>;
1074
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<import("./common").JsonValue, unknown, z.core.$ZodTypeInternals<import("./common").JsonValue, unknown>>>>;
260
1075
  }, z.core.$strict>;
261
1076
  }, z.core.$strict>, z.ZodObject<{
262
- contract: z.ZodLiteral<"AgentSessionCommand">;
263
- commandId: z.ZodString;
1077
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1078
+ eventId: z.ZodString;
264
1079
  sessionId: z.ZodString;
1080
+ runId: z.ZodOptional<z.ZodString>;
1081
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1082
+ sequence: z.ZodNumber;
265
1083
  idempotencyKey: z.ZodString;
266
- expectedSequence: z.ZodNumber;
267
- issuedAt: z.ZodString;
268
- commandType: z.ZodLiteral<"retry">;
1084
+ occurredAt: z.ZodString;
1085
+ eventType: z.ZodLiteral<"diff">;
269
1086
  payload: z.ZodObject<{
270
- sourceEventId: z.ZodString;
1087
+ path: z.ZodString;
1088
+ status: z.ZodEnum<{
1089
+ added: "added";
1090
+ modified: "modified";
1091
+ deleted: "deleted";
1092
+ renamed: "renamed";
1093
+ }>;
1094
+ patch: z.ZodOptional<z.ZodString>;
271
1095
  }, z.core.$strict>;
272
1096
  }, z.core.$strict>, z.ZodObject<{
273
- contract: z.ZodLiteral<"AgentSessionCommand">;
274
- commandId: z.ZodString;
1097
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1098
+ eventId: z.ZodString;
275
1099
  sessionId: z.ZodString;
1100
+ runId: z.ZodOptional<z.ZodString>;
1101
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1102
+ sequence: z.ZodNumber;
276
1103
  idempotencyKey: z.ZodString;
277
- expectedSequence: z.ZodNumber;
278
- issuedAt: z.ZodString;
279
- commandType: z.ZodLiteral<"approval">;
1104
+ occurredAt: z.ZodString;
1105
+ eventType: z.ZodLiteral<"workspace-file">;
280
1106
  payload: z.ZodObject<{
281
- approvalId: z.ZodString;
282
- decision: z.ZodEnum<{
283
- approved: "approved";
284
- rejected: "rejected";
1107
+ path: z.ZodString;
1108
+ operation: z.ZodEnum<{
1109
+ upsert: "upsert";
1110
+ delete: "delete";
285
1111
  }>;
286
- reason: z.ZodOptional<z.ZodString>;
1112
+ mimeType: z.ZodOptional<z.ZodString>;
1113
+ size: z.ZodOptional<z.ZodNumber>;
287
1114
  }, z.core.$strict>;
288
- }, z.core.$strict>], "commandType">;
289
- export declare const AgentSessionCommandErrorCodeSchema: z.ZodEnum<{
290
- SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
291
- COMMAND_NOT_SUPPORTED: "COMMAND_NOT_SUPPORTED";
292
- CAPABILITY_UNAVAILABLE: "CAPABILITY_UNAVAILABLE";
293
- SEQUENCE_CONFLICT: "SEQUENCE_CONFLICT";
294
- INVALID_SESSION_STATE: "INVALID_SESSION_STATE";
295
- TARGET_EVENT_NOT_FOUND: "TARGET_EVENT_NOT_FOUND";
296
- TARGET_EVENT_NOT_RETRYABLE: "TARGET_EVENT_NOT_RETRYABLE";
297
- APPROVAL_NOT_FOUND: "APPROVAL_NOT_FOUND";
298
- APPROVAL_ALREADY_RESOLVED: "APPROVAL_ALREADY_RESOLVED";
299
- COMMAND_EXECUTION_FAILED: "COMMAND_EXECUTION_FAILED";
300
- }>;
301
- export declare const AgentSessionCommandResultSchema: z.ZodObject<{
302
- contract: z.ZodLiteral<"AgentSessionCommandResult">;
303
- commandId: z.ZodString;
1115
+ }, z.core.$strict>, z.ZodObject<{
1116
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1117
+ eventId: z.ZodString;
304
1118
  sessionId: z.ZodString;
1119
+ runId: z.ZodOptional<z.ZodString>;
1120
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1121
+ sequence: z.ZodNumber;
305
1122
  idempotencyKey: z.ZodString;
306
- outcome: z.ZodEnum<{
307
- failed: "failed";
308
- rejected: "rejected";
309
- accepted: "accepted";
310
- duplicate: "duplicate";
311
- }>;
312
- sessionStatus: z.ZodEnum<{
313
- queued: "queued";
314
- running: "running";
315
- waiting_approval: "waiting_approval";
316
- stopping: "stopping";
317
- stopped: "stopped";
318
- completed: "completed";
319
- failed: "failed";
320
- }>;
321
- acceptedSequence: z.ZodOptional<z.ZodNumber>;
322
- resultEventIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
323
- error: z.ZodOptional<z.ZodObject<{
324
- code: z.ZodEnum<{
325
- SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
326
- COMMAND_NOT_SUPPORTED: "COMMAND_NOT_SUPPORTED";
327
- CAPABILITY_UNAVAILABLE: "CAPABILITY_UNAVAILABLE";
328
- SEQUENCE_CONFLICT: "SEQUENCE_CONFLICT";
329
- INVALID_SESSION_STATE: "INVALID_SESSION_STATE";
330
- TARGET_EVENT_NOT_FOUND: "TARGET_EVENT_NOT_FOUND";
331
- TARGET_EVENT_NOT_RETRYABLE: "TARGET_EVENT_NOT_RETRYABLE";
332
- APPROVAL_NOT_FOUND: "APPROVAL_NOT_FOUND";
333
- APPROVAL_ALREADY_RESOLVED: "APPROVAL_ALREADY_RESOLVED";
334
- COMMAND_EXECUTION_FAILED: "COMMAND_EXECUTION_FAILED";
1123
+ occurredAt: z.ZodString;
1124
+ eventType: z.ZodLiteral<"terminal">;
1125
+ payload: z.ZodObject<{
1126
+ terminalId: z.ZodString;
1127
+ stream: z.ZodEnum<{
1128
+ status: "status";
1129
+ stdin: "stdin";
1130
+ stdout: "stdout";
1131
+ stderr: "stderr";
335
1132
  }>;
336
- message: z.ZodString;
337
- retryable: z.ZodBoolean;
338
- }, z.core.$strict>>;
1133
+ chunk: z.ZodString;
1134
+ exitCode: z.ZodOptional<z.ZodNumber>;
1135
+ }, z.core.$strict>;
1136
+ }, z.core.$strict>, z.ZodObject<{
1137
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1138
+ eventId: z.ZodString;
1139
+ sessionId: z.ZodString;
1140
+ runId: z.ZodOptional<z.ZodString>;
1141
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1142
+ sequence: z.ZodNumber;
1143
+ idempotencyKey: z.ZodString;
339
1144
  occurredAt: z.ZodString;
340
- }, z.core.$strict>;
341
- export declare function resolveAgentSessionCommandTransition(status: AgentSessionStatus, commandType: AgentSessionCommandType): AgentSessionStatus | undefined;
342
- export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1145
+ eventType: z.ZodLiteral<"test-result">;
1146
+ payload: z.ZodObject<{
1147
+ testId: z.ZodString;
1148
+ name: z.ZodString;
1149
+ status: z.ZodEnum<{
1150
+ running: "running";
1151
+ failed: "failed";
1152
+ skipped: "skipped";
1153
+ passed: "passed";
1154
+ }>;
1155
+ durationMs: z.ZodOptional<z.ZodNumber>;
1156
+ output: z.ZodOptional<z.ZodString>;
1157
+ }, z.core.$strict>;
1158
+ }, z.core.$strict>, z.ZodObject<{
1159
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1160
+ eventId: z.ZodString;
1161
+ sessionId: z.ZodString;
1162
+ runId: z.ZodOptional<z.ZodString>;
1163
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1164
+ sequence: z.ZodNumber;
1165
+ idempotencyKey: z.ZodString;
1166
+ occurredAt: z.ZodString;
1167
+ eventType: z.ZodLiteral<"summary">;
1168
+ payload: z.ZodObject<{
1169
+ summaryId: z.ZodString;
1170
+ runId: z.ZodString;
1171
+ text: z.ZodString;
1172
+ highlights: z.ZodArray<z.ZodString>;
1173
+ pendingItems: z.ZodArray<z.ZodString>;
1174
+ status: z.ZodEnum<{
1175
+ completed: "completed";
1176
+ failed: "failed";
1177
+ generating: "generating";
1178
+ }>;
1179
+ }, z.core.$strict>;
1180
+ }, z.core.$strict>], "eventType">;
1181
+ export declare const AgentSessionRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
343
1182
  contract: z.ZodLiteral<"AgentSessionEvent">;
344
1183
  eventId: z.ZodString;
345
1184
  sessionId: z.ZodString;
1185
+ runId: z.ZodOptional<z.ZodString>;
1186
+ sourceMessageId: z.ZodOptional<z.ZodString>;
346
1187
  sequence: z.ZodNumber;
347
1188
  idempotencyKey: z.ZodString;
348
1189
  occurredAt: z.ZodString;
@@ -369,6 +1210,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
369
1210
  contract: z.ZodLiteral<"AgentSessionEvent">;
370
1211
  eventId: z.ZodString;
371
1212
  sessionId: z.ZodString;
1213
+ runId: z.ZodOptional<z.ZodString>;
1214
+ sourceMessageId: z.ZodOptional<z.ZodString>;
372
1215
  sequence: z.ZodNumber;
373
1216
  idempotencyKey: z.ZodString;
374
1217
  occurredAt: z.ZodString;
@@ -385,6 +1228,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
385
1228
  contract: z.ZodLiteral<"AgentSessionEvent">;
386
1229
  eventId: z.ZodString;
387
1230
  sessionId: z.ZodString;
1231
+ runId: z.ZodOptional<z.ZodString>;
1232
+ sourceMessageId: z.ZodOptional<z.ZodString>;
388
1233
  sequence: z.ZodNumber;
389
1234
  idempotencyKey: z.ZodString;
390
1235
  occurredAt: z.ZodString;
@@ -414,6 +1259,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
414
1259
  contract: z.ZodLiteral<"AgentSessionEvent">;
415
1260
  eventId: z.ZodString;
416
1261
  sessionId: z.ZodString;
1262
+ runId: z.ZodOptional<z.ZodString>;
1263
+ sourceMessageId: z.ZodOptional<z.ZodString>;
417
1264
  sequence: z.ZodNumber;
418
1265
  idempotencyKey: z.ZodString;
419
1266
  occurredAt: z.ZodString;
@@ -434,6 +1281,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
434
1281
  contract: z.ZodLiteral<"AgentSessionEvent">;
435
1282
  eventId: z.ZodString;
436
1283
  sessionId: z.ZodString;
1284
+ runId: z.ZodOptional<z.ZodString>;
1285
+ sourceMessageId: z.ZodOptional<z.ZodString>;
437
1286
  sequence: z.ZodNumber;
438
1287
  idempotencyKey: z.ZodString;
439
1288
  occurredAt: z.ZodString;
@@ -458,6 +1307,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
458
1307
  contract: z.ZodLiteral<"AgentSessionEvent">;
459
1308
  eventId: z.ZodString;
460
1309
  sessionId: z.ZodString;
1310
+ runId: z.ZodOptional<z.ZodString>;
1311
+ sourceMessageId: z.ZodOptional<z.ZodString>;
461
1312
  sequence: z.ZodNumber;
462
1313
  idempotencyKey: z.ZodString;
463
1314
  occurredAt: z.ZodString;
@@ -479,6 +1330,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
479
1330
  contract: z.ZodLiteral<"AgentSessionEvent">;
480
1331
  eventId: z.ZodString;
481
1332
  sessionId: z.ZodString;
1333
+ runId: z.ZodOptional<z.ZodString>;
1334
+ sourceMessageId: z.ZodOptional<z.ZodString>;
482
1335
  sequence: z.ZodNumber;
483
1336
  idempotencyKey: z.ZodString;
484
1337
  occurredAt: z.ZodString;
@@ -494,11 +1347,19 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
494
1347
  failed: "failed";
495
1348
  }>;
496
1349
  detail: z.ZodOptional<z.ZodString>;
1350
+ startedAt: z.ZodOptional<z.ZodString>;
1351
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
1352
+ stoppedAt: z.ZodOptional<z.ZodString>;
1353
+ completedAt: z.ZodOptional<z.ZodString>;
1354
+ failedAt: z.ZodOptional<z.ZodString>;
1355
+ durationMs: z.ZodOptional<z.ZodNumber>;
497
1356
  }, z.core.$strict>;
498
1357
  }, z.core.$strict>, z.ZodObject<{
499
1358
  contract: z.ZodLiteral<"AgentSessionEvent">;
500
1359
  eventId: z.ZodString;
501
1360
  sessionId: z.ZodString;
1361
+ runId: z.ZodOptional<z.ZodString>;
1362
+ sourceMessageId: z.ZodOptional<z.ZodString>;
502
1363
  sequence: z.ZodNumber;
503
1364
  idempotencyKey: z.ZodString;
504
1365
  occurredAt: z.ZodString;
@@ -528,6 +1389,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
528
1389
  contract: z.ZodLiteral<"AgentSessionEvent">;
529
1390
  eventId: z.ZodString;
530
1391
  sessionId: z.ZodString;
1392
+ runId: z.ZodOptional<z.ZodString>;
1393
+ sourceMessageId: z.ZodOptional<z.ZodString>;
531
1394
  sequence: z.ZodNumber;
532
1395
  idempotencyKey: z.ZodString;
533
1396
  occurredAt: z.ZodString;
@@ -543,6 +1406,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
543
1406
  contract: z.ZodLiteral<"AgentSessionEvent">;
544
1407
  eventId: z.ZodString;
545
1408
  sessionId: z.ZodString;
1409
+ runId: z.ZodOptional<z.ZodString>;
1410
+ sourceMessageId: z.ZodOptional<z.ZodString>;
546
1411
  sequence: z.ZodNumber;
547
1412
  idempotencyKey: z.ZodString;
548
1413
  occurredAt: z.ZodString;
@@ -556,6 +1421,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
556
1421
  contract: z.ZodLiteral<"AgentSessionEvent">;
557
1422
  eventId: z.ZodString;
558
1423
  sessionId: z.ZodString;
1424
+ runId: z.ZodOptional<z.ZodString>;
1425
+ sourceMessageId: z.ZodOptional<z.ZodString>;
559
1426
  sequence: z.ZodNumber;
560
1427
  idempotencyKey: z.ZodString;
561
1428
  occurredAt: z.ZodString;
@@ -571,6 +1438,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
571
1438
  contract: z.ZodLiteral<"AgentSessionEvent">;
572
1439
  eventId: z.ZodString;
573
1440
  sessionId: z.ZodString;
1441
+ runId: z.ZodOptional<z.ZodString>;
1442
+ sourceMessageId: z.ZodOptional<z.ZodString>;
574
1443
  sequence: z.ZodNumber;
575
1444
  idempotencyKey: z.ZodString;
576
1445
  occurredAt: z.ZodString;
@@ -589,6 +1458,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
589
1458
  contract: z.ZodLiteral<"AgentSessionEvent">;
590
1459
  eventId: z.ZodString;
591
1460
  sessionId: z.ZodString;
1461
+ runId: z.ZodOptional<z.ZodString>;
1462
+ sourceMessageId: z.ZodOptional<z.ZodString>;
592
1463
  sequence: z.ZodNumber;
593
1464
  idempotencyKey: z.ZodString;
594
1465
  occurredAt: z.ZodString;
@@ -606,6 +1477,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
606
1477
  contract: z.ZodLiteral<"AgentSessionEvent">;
607
1478
  eventId: z.ZodString;
608
1479
  sessionId: z.ZodString;
1480
+ runId: z.ZodOptional<z.ZodString>;
1481
+ sourceMessageId: z.ZodOptional<z.ZodString>;
609
1482
  sequence: z.ZodNumber;
610
1483
  idempotencyKey: z.ZodString;
611
1484
  occurredAt: z.ZodString;
@@ -625,6 +1498,8 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
625
1498
  contract: z.ZodLiteral<"AgentSessionEvent">;
626
1499
  eventId: z.ZodString;
627
1500
  sessionId: z.ZodString;
1501
+ runId: z.ZodOptional<z.ZodString>;
1502
+ sourceMessageId: z.ZodOptional<z.ZodString>;
628
1503
  sequence: z.ZodNumber;
629
1504
  idempotencyKey: z.ZodString;
630
1505
  occurredAt: z.ZodString;
@@ -641,6 +1516,28 @@ export declare const AgentSessionEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
641
1516
  durationMs: z.ZodOptional<z.ZodNumber>;
642
1517
  output: z.ZodOptional<z.ZodString>;
643
1518
  }, z.core.$strict>;
1519
+ }, z.core.$strict>, z.ZodObject<{
1520
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1521
+ eventId: z.ZodString;
1522
+ sessionId: z.ZodString;
1523
+ runId: z.ZodOptional<z.ZodString>;
1524
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1525
+ sequence: z.ZodNumber;
1526
+ idempotencyKey: z.ZodString;
1527
+ occurredAt: z.ZodString;
1528
+ eventType: z.ZodLiteral<"summary">;
1529
+ payload: z.ZodObject<{
1530
+ summaryId: z.ZodString;
1531
+ runId: z.ZodString;
1532
+ text: z.ZodString;
1533
+ highlights: z.ZodArray<z.ZodString>;
1534
+ pendingItems: z.ZodArray<z.ZodString>;
1535
+ status: z.ZodEnum<{
1536
+ completed: "completed";
1537
+ failed: "failed";
1538
+ generating: "generating";
1539
+ }>;
1540
+ }, z.core.$strict>;
644
1541
  }, z.core.$strict>], "eventType">;
645
1542
  export declare const AgentSessionViewModelSchema: z.ZodObject<{
646
1543
  contract: z.ZodLiteral<"AgentSessionViewModel">;
@@ -669,6 +1566,10 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
669
1566
  workspaceFiles: z.ZodDefault<z.ZodBoolean>;
670
1567
  terminal: z.ZodDefault<z.ZodBoolean>;
671
1568
  testResults: z.ZodDefault<z.ZodBoolean>;
1569
+ threadForking: z.ZodDefault<z.ZodBoolean>;
1570
+ editAndRerun: z.ZodDefault<z.ZodBoolean>;
1571
+ steering: z.ZodDefault<z.ZodBoolean>;
1572
+ summary: z.ZodDefault<z.ZodBoolean>;
672
1573
  }, z.core.$strict>;
673
1574
  }, z.core.$strict>;
674
1575
  status: z.ZodEnum<{
@@ -684,6 +1585,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
684
1585
  contract: z.ZodLiteral<"AgentSessionEvent">;
685
1586
  eventId: z.ZodString;
686
1587
  sessionId: z.ZodString;
1588
+ runId: z.ZodOptional<z.ZodString>;
1589
+ sourceMessageId: z.ZodOptional<z.ZodString>;
687
1590
  sequence: z.ZodNumber;
688
1591
  idempotencyKey: z.ZodString;
689
1592
  occurredAt: z.ZodString;
@@ -710,6 +1613,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
710
1613
  contract: z.ZodLiteral<"AgentSessionEvent">;
711
1614
  eventId: z.ZodString;
712
1615
  sessionId: z.ZodString;
1616
+ runId: z.ZodOptional<z.ZodString>;
1617
+ sourceMessageId: z.ZodOptional<z.ZodString>;
713
1618
  sequence: z.ZodNumber;
714
1619
  idempotencyKey: z.ZodString;
715
1620
  occurredAt: z.ZodString;
@@ -726,6 +1631,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
726
1631
  contract: z.ZodLiteral<"AgentSessionEvent">;
727
1632
  eventId: z.ZodString;
728
1633
  sessionId: z.ZodString;
1634
+ runId: z.ZodOptional<z.ZodString>;
1635
+ sourceMessageId: z.ZodOptional<z.ZodString>;
729
1636
  sequence: z.ZodNumber;
730
1637
  idempotencyKey: z.ZodString;
731
1638
  occurredAt: z.ZodString;
@@ -755,6 +1662,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
755
1662
  contract: z.ZodLiteral<"AgentSessionEvent">;
756
1663
  eventId: z.ZodString;
757
1664
  sessionId: z.ZodString;
1665
+ runId: z.ZodOptional<z.ZodString>;
1666
+ sourceMessageId: z.ZodOptional<z.ZodString>;
758
1667
  sequence: z.ZodNumber;
759
1668
  idempotencyKey: z.ZodString;
760
1669
  occurredAt: z.ZodString;
@@ -775,6 +1684,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
775
1684
  contract: z.ZodLiteral<"AgentSessionEvent">;
776
1685
  eventId: z.ZodString;
777
1686
  sessionId: z.ZodString;
1687
+ runId: z.ZodOptional<z.ZodString>;
1688
+ sourceMessageId: z.ZodOptional<z.ZodString>;
778
1689
  sequence: z.ZodNumber;
779
1690
  idempotencyKey: z.ZodString;
780
1691
  occurredAt: z.ZodString;
@@ -799,6 +1710,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
799
1710
  contract: z.ZodLiteral<"AgentSessionEvent">;
800
1711
  eventId: z.ZodString;
801
1712
  sessionId: z.ZodString;
1713
+ runId: z.ZodOptional<z.ZodString>;
1714
+ sourceMessageId: z.ZodOptional<z.ZodString>;
802
1715
  sequence: z.ZodNumber;
803
1716
  idempotencyKey: z.ZodString;
804
1717
  occurredAt: z.ZodString;
@@ -820,6 +1733,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
820
1733
  contract: z.ZodLiteral<"AgentSessionEvent">;
821
1734
  eventId: z.ZodString;
822
1735
  sessionId: z.ZodString;
1736
+ runId: z.ZodOptional<z.ZodString>;
1737
+ sourceMessageId: z.ZodOptional<z.ZodString>;
823
1738
  sequence: z.ZodNumber;
824
1739
  idempotencyKey: z.ZodString;
825
1740
  occurredAt: z.ZodString;
@@ -835,11 +1750,19 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
835
1750
  failed: "failed";
836
1751
  }>;
837
1752
  detail: z.ZodOptional<z.ZodString>;
1753
+ startedAt: z.ZodOptional<z.ZodString>;
1754
+ stoppingRequestedAt: z.ZodOptional<z.ZodString>;
1755
+ stoppedAt: z.ZodOptional<z.ZodString>;
1756
+ completedAt: z.ZodOptional<z.ZodString>;
1757
+ failedAt: z.ZodOptional<z.ZodString>;
1758
+ durationMs: z.ZodOptional<z.ZodNumber>;
838
1759
  }, z.core.$strict>;
839
1760
  }, z.core.$strict>, z.ZodObject<{
840
1761
  contract: z.ZodLiteral<"AgentSessionEvent">;
841
1762
  eventId: z.ZodString;
842
1763
  sessionId: z.ZodString;
1764
+ runId: z.ZodOptional<z.ZodString>;
1765
+ sourceMessageId: z.ZodOptional<z.ZodString>;
843
1766
  sequence: z.ZodNumber;
844
1767
  idempotencyKey: z.ZodString;
845
1768
  occurredAt: z.ZodString;
@@ -869,6 +1792,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
869
1792
  contract: z.ZodLiteral<"AgentSessionEvent">;
870
1793
  eventId: z.ZodString;
871
1794
  sessionId: z.ZodString;
1795
+ runId: z.ZodOptional<z.ZodString>;
1796
+ sourceMessageId: z.ZodOptional<z.ZodString>;
872
1797
  sequence: z.ZodNumber;
873
1798
  idempotencyKey: z.ZodString;
874
1799
  occurredAt: z.ZodString;
@@ -884,6 +1809,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
884
1809
  contract: z.ZodLiteral<"AgentSessionEvent">;
885
1810
  eventId: z.ZodString;
886
1811
  sessionId: z.ZodString;
1812
+ runId: z.ZodOptional<z.ZodString>;
1813
+ sourceMessageId: z.ZodOptional<z.ZodString>;
887
1814
  sequence: z.ZodNumber;
888
1815
  idempotencyKey: z.ZodString;
889
1816
  occurredAt: z.ZodString;
@@ -897,6 +1824,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
897
1824
  contract: z.ZodLiteral<"AgentSessionEvent">;
898
1825
  eventId: z.ZodString;
899
1826
  sessionId: z.ZodString;
1827
+ runId: z.ZodOptional<z.ZodString>;
1828
+ sourceMessageId: z.ZodOptional<z.ZodString>;
900
1829
  sequence: z.ZodNumber;
901
1830
  idempotencyKey: z.ZodString;
902
1831
  occurredAt: z.ZodString;
@@ -912,6 +1841,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
912
1841
  contract: z.ZodLiteral<"AgentSessionEvent">;
913
1842
  eventId: z.ZodString;
914
1843
  sessionId: z.ZodString;
1844
+ runId: z.ZodOptional<z.ZodString>;
1845
+ sourceMessageId: z.ZodOptional<z.ZodString>;
915
1846
  sequence: z.ZodNumber;
916
1847
  idempotencyKey: z.ZodString;
917
1848
  occurredAt: z.ZodString;
@@ -930,6 +1861,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
930
1861
  contract: z.ZodLiteral<"AgentSessionEvent">;
931
1862
  eventId: z.ZodString;
932
1863
  sessionId: z.ZodString;
1864
+ runId: z.ZodOptional<z.ZodString>;
1865
+ sourceMessageId: z.ZodOptional<z.ZodString>;
933
1866
  sequence: z.ZodNumber;
934
1867
  idempotencyKey: z.ZodString;
935
1868
  occurredAt: z.ZodString;
@@ -947,6 +1880,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
947
1880
  contract: z.ZodLiteral<"AgentSessionEvent">;
948
1881
  eventId: z.ZodString;
949
1882
  sessionId: z.ZodString;
1883
+ runId: z.ZodOptional<z.ZodString>;
1884
+ sourceMessageId: z.ZodOptional<z.ZodString>;
950
1885
  sequence: z.ZodNumber;
951
1886
  idempotencyKey: z.ZodString;
952
1887
  occurredAt: z.ZodString;
@@ -966,6 +1901,8 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
966
1901
  contract: z.ZodLiteral<"AgentSessionEvent">;
967
1902
  eventId: z.ZodString;
968
1903
  sessionId: z.ZodString;
1904
+ runId: z.ZodOptional<z.ZodString>;
1905
+ sourceMessageId: z.ZodOptional<z.ZodString>;
969
1906
  sequence: z.ZodNumber;
970
1907
  idempotencyKey: z.ZodString;
971
1908
  occurredAt: z.ZodString;
@@ -982,9 +1919,48 @@ export declare const AgentSessionViewModelSchema: z.ZodObject<{
982
1919
  durationMs: z.ZodOptional<z.ZodNumber>;
983
1920
  output: z.ZodOptional<z.ZodString>;
984
1921
  }, z.core.$strict>;
1922
+ }, z.core.$strict>, z.ZodObject<{
1923
+ contract: z.ZodLiteral<"AgentSessionEvent">;
1924
+ eventId: z.ZodString;
1925
+ sessionId: z.ZodString;
1926
+ runId: z.ZodOptional<z.ZodString>;
1927
+ sourceMessageId: z.ZodOptional<z.ZodString>;
1928
+ sequence: z.ZodNumber;
1929
+ idempotencyKey: z.ZodString;
1930
+ occurredAt: z.ZodString;
1931
+ eventType: z.ZodLiteral<"summary">;
1932
+ payload: z.ZodObject<{
1933
+ summaryId: z.ZodString;
1934
+ runId: z.ZodString;
1935
+ text: z.ZodString;
1936
+ highlights: z.ZodArray<z.ZodString>;
1937
+ pendingItems: z.ZodArray<z.ZodString>;
1938
+ status: z.ZodEnum<{
1939
+ completed: "completed";
1940
+ failed: "failed";
1941
+ generating: "generating";
1942
+ }>;
1943
+ }, z.core.$strict>;
985
1944
  }, z.core.$strict>], "eventType">>;
986
1945
  lastSequence: z.ZodNumber;
987
1946
  resumable: z.ZodDefault<z.ZodBoolean>;
1947
+ lineage: z.ZodOptional<z.ZodObject<{
1948
+ forkedFromThreadId: z.ZodString;
1949
+ forkedFromMessageId: z.ZodString;
1950
+ sourceRunId: z.ZodString;
1951
+ }, z.core.$strict>>;
1952
+ activeBranch: z.ZodOptional<z.ZodObject<{
1953
+ branchId: z.ZodString;
1954
+ threadId: z.ZodString;
1955
+ sourceMessageId: z.ZodString;
1956
+ runId: z.ZodString;
1957
+ lineage: z.ZodOptional<z.ZodObject<{
1958
+ forkedFromThreadId: z.ZodString;
1959
+ forkedFromMessageId: z.ZodString;
1960
+ sourceRunId: z.ZodString;
1961
+ }, z.core.$strict>>;
1962
+ createdAt: z.ZodString;
1963
+ }, z.core.$strict>>;
988
1964
  }, z.core.$strict>;
989
1965
  export type AgentMode = z.infer<typeof AgentModeSchema>;
990
1966
  export type AgentConfigurationCapability = z.infer<typeof AgentConfigurationCapabilitySchema>;
@@ -994,11 +1970,19 @@ export type AgentSessionCapability = z.infer<typeof AgentSessionCapabilitySchema
994
1970
  export type AgentSessionCapabilities = z.infer<typeof AgentSessionCapabilitiesSchema>;
995
1971
  export type AgentSessionSnapshot = z.infer<typeof AgentSessionSnapshotSchema>;
996
1972
  export type AgentSessionStatus = z.infer<typeof AgentSessionStatusSchema>;
1973
+ export type AgentSessionTerminalStatus = z.infer<typeof AgentSessionTerminalStatusSchema>;
1974
+ export type AgentSessionLineage = z.infer<typeof AgentSessionLineageSchema>;
1975
+ export type AgentSessionContextInheritance = z.infer<typeof AgentSessionContextInheritanceSchema>;
1976
+ export type AgentSessionActiveBranch = z.infer<typeof AgentSessionActiveBranchSchema>;
1977
+ export type AgentSessionRun = z.infer<typeof AgentSessionRunSchema>;
997
1978
  export type AgentSessionCommandType = z.infer<typeof AgentSessionCommandTypeSchema>;
998
1979
  export type AgentSessionCommand = z.infer<typeof AgentSessionCommandSchema>;
1980
+ export type AgentSessionTargetedCommand = z.infer<typeof AgentSessionTargetedCommandSchema>;
999
1981
  export type AgentSessionCommandErrorCode = z.infer<typeof AgentSessionCommandErrorCodeSchema>;
1000
1982
  export type AgentSessionCommandResult = z.infer<typeof AgentSessionCommandResultSchema>;
1983
+ export type AgentSessionCommandPolicy = z.infer<typeof AgentSessionCommandPolicySchema>;
1001
1984
  export type AgentSessionEvent = z.infer<typeof AgentSessionEventSchema>;
1985
+ export type AgentSessionRunEvent = z.infer<typeof AgentSessionRunEventSchema>;
1002
1986
  export type AgentSessionViewModel = z.infer<typeof AgentSessionViewModelSchema>;
1003
1987
  export declare const AgentExecutionModeSchema: z.ZodEnum<{
1004
1988
  chatbot: "chatbot";