@makaio/framework 1.0.0-dev-1781260968078 → 1.0.0-dev-1781354548379

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.
Files changed (140) hide show
  1. package/dist/.makaio-build.json +2 -2
  2. package/dist/adapter-UpcpZDOv.mjs +1 -0
  3. package/dist/adapters/config/index.d.mts +1 -1
  4. package/dist/adapters/index.d.mts +11 -3
  5. package/dist/adapters/index.mjs +1 -1
  6. package/dist/bus/index.mjs +1 -1
  7. package/dist/clients/index.d.mts +4 -7
  8. package/dist/clients/index.mjs +1 -1
  9. package/dist/contracts/adapter/index.d.mts +2 -2
  10. package/dist/contracts/adapter/index.mjs +1 -1
  11. package/dist/contracts/adapter/schemas/session-lineage.d.mts +1 -1
  12. package/dist/contracts/artifact/index.d.mts +1 -1
  13. package/dist/contracts/client/index.d.mts +1 -1
  14. package/dist/contracts/extension/index.d.mts +2 -2
  15. package/dist/contracts/facet/index.d.mts +1 -1
  16. package/dist/contracts/index.d.mts +219 -54
  17. package/dist/contracts/index.mjs +1 -1
  18. package/dist/contracts/materialization/index.d.mts +3 -3
  19. package/dist/contracts/session/index.d.mts +3 -3
  20. package/dist/contracts/session/index.mjs +1 -1
  21. package/dist/{definition-SiimP25_.d.mts → definition-DqJOg6Lv.d.mts} +1 -1
  22. package/dist/drizzle/0015_m_mqbh8q5b.sql +1 -0
  23. package/dist/drizzle/0016_m_mqbmq8h7.sql +1 -0
  24. package/dist/drizzle/0017_m_mqbnf924.sql +1 -0
  25. package/dist/drizzle/meta/0015_snapshot.json +2966 -0
  26. package/dist/drizzle/meta/0016_snapshot.json +2973 -0
  27. package/dist/drizzle/meta/0017_snapshot.json +2980 -0
  28. package/dist/drizzle/meta/_journal.json +21 -0
  29. package/dist/{handler-DSfSAlxx.mjs → handler-DqpiV9eA.mjs} +1 -1
  30. package/dist/handlers-BAB4fQNH.mjs +41 -0
  31. package/dist/{index-B2xbnMZe.d.mts → index-BCKRUuI2.d.mts} +1 -1
  32. package/dist/{index-CARxIllg.d.mts → index-BHAOu6Hs.d.mts} +20 -20
  33. package/dist/{index-Cb64d5c5.d.mts → index-BHzgDuRE.d.mts} +20 -3
  34. package/dist/{index-BtztOqaF.d.mts → index-BheaEhyI.d.mts} +6 -6
  35. package/dist/{index-CZ_TcT6J.d.mts → index-Bibt5jAX.d.mts} +8 -8
  36. package/dist/{index-D5CI1V5d.d.mts → index-C3zfJg6s.d.mts} +16 -16
  37. package/dist/{index-DTdqGAfH2.d.mts → index-CH5U3zSA2.d.mts} +1 -1
  38. package/dist/{index-CgjslA5-.d.mts → index-CTn_Xi-p.d.mts} +4 -4
  39. package/dist/{index-DDQkhhRo.d.mts → index-DPIdX6kb.d.mts} +363 -123
  40. package/dist/{index-BQiHs8EF.d.mts → index-Da4ABgRq.d.mts} +12 -12
  41. package/dist/{index-BvSyOgTY.d.mts → index-DrGLAuZc.d.mts} +98 -29
  42. package/dist/{index-BKKNWqkP2.d.mts → index-zgm2j9V92.d.mts} +44 -2
  43. package/dist/kernel/extension/index.d.mts +1 -1
  44. package/dist/kernel/index.d.mts +2 -2
  45. package/dist/kernel/observability/index.d.mts +1 -1
  46. package/dist/mcp-http-server/index.d.mts +132 -19
  47. package/dist/mcp-http-server/index.mjs +1 -1
  48. package/dist/{namespace-D1Iw_d1P.d.mts → namespace--s0d86h-.d.mts} +144 -0
  49. package/dist/{namespace-7tsuJhQ9.d.mts → namespace-Boe6l5n9.d.mts} +78 -42
  50. package/dist/{namespace-Ba4bxtHQ.d.mts → namespace-BxxBhcV_.d.mts} +9 -9
  51. package/dist/{namespace-DwE2g8Wm.mjs → namespace-Dfq6MDN9.mjs} +1 -1
  52. package/dist/{namespace-DDCjoQUj.d.mts → namespace-aJJfBJU5.d.mts} +170 -0
  53. package/dist/{orchestrator-shared-Dt4WDse7.mjs → orchestrator-shared-BKFXaKPL.mjs} +1 -1
  54. package/dist/{package-BSnp1zOR.d.mts → package--RZnpN2J.d.mts} +2 -3
  55. package/dist/package-BzJvtM5O.mjs +1 -0
  56. package/dist/package-DzN_jdqd.mjs +1 -0
  57. package/dist/package.json +1 -1
  58. package/dist/primitive-runtime-CNC_bSac.mjs +1 -0
  59. package/dist/runtime-node/bus/runtime/namespace.d.mts +8 -8
  60. package/dist/runtime-node/bus/runtime/schemas.d.mts +11 -4
  61. package/dist/runtime-node/bus/runtime/schemas.mjs +1 -1
  62. package/dist/runtime-node/index.d.mts +19 -1
  63. package/dist/runtime-node/index.mjs +1 -1
  64. package/dist/{schema-BerZmr2q.mjs → schema-C3TgjrsV.mjs} +1 -1
  65. package/dist/{schema-BrnYlDwZ.mjs → schema-CzhOc7TV.mjs} +1 -1
  66. package/dist/{schema-BNrM9LWb.d.mts → schema-DGMLvVoQ.d.mts} +23 -3
  67. package/dist/schemas-CuKayWhA.mjs +1 -0
  68. package/dist/{schemas-DAFYpgHk2.d.mts → schemas-kVcJMjjn2.d.mts} +8 -8
  69. package/dist/{schemas-CkOSG2eJ.d.mts → schemas-t1VR6_b_.d.mts} +3 -3
  70. package/dist/services/filesystem/namespace.d.mts +6 -6
  71. package/dist/services/filesystem/schemas.d.mts +3 -3
  72. package/dist/services/git/namespace.d.mts +2 -2
  73. package/dist/services/git/schemas.d.mts +2 -2
  74. package/dist/services/harness/index.d.mts +3 -4
  75. package/dist/services/harness/index.mjs +1 -1
  76. package/dist/services/index.d.mts +112 -15
  77. package/dist/services/index.mjs +1 -1
  78. package/dist/services/log-import/browser.d.mts +2 -2
  79. package/dist/services/log-import/index.d.mts +4 -5
  80. package/dist/services/log-import/index.mjs +1 -1
  81. package/dist/services/log-import/log-import.d.mts +1 -1
  82. package/dist/services/log-import/namespace.d.mts +2 -2
  83. package/dist/services/log-import/schemas.d.mts +1 -1
  84. package/dist/services/provider-context/index.mjs +1 -1
  85. package/dist/services/session/handlers/index.mjs +1 -1
  86. package/dist/services/session/index.d.mts +6 -6
  87. package/dist/services/session/index.mjs +1 -1
  88. package/dist/services/session/messages/namespace.mjs +1 -1
  89. package/dist/services/session/orchestrator-testing/index.mjs +1 -1
  90. package/dist/services/session/session-events/namespace.d.mts +1 -1
  91. package/dist/services/session/session-events/namespace.mjs +1 -1
  92. package/dist/services/session/storage/namespace.d.mts +1 -1
  93. package/dist/services/session/storage/schema.d.mts +1 -1
  94. package/dist/services/session/storage/schema.mjs +1 -1
  95. package/dist/services/session/testing/index.mjs +5 -3
  96. package/dist/services/session/testing/orchestrator-shared.mjs +1 -1
  97. package/dist/services/session/turns/namespace.d.mts +1 -1
  98. package/dist/services/session/turns/namespace.mjs +1 -1
  99. package/dist/services/settings/index.mjs +1 -1
  100. package/dist/services/settings/namespace.d.mts +8 -8
  101. package/dist/services/settings/storage/clients-namespace.mjs +1 -1
  102. package/dist/services/settings/storage/index.mjs +1 -1
  103. package/dist/services/settings/storage/providers-namespace.mjs +1 -1
  104. package/dist/services/subagent/index.d.mts +1 -1
  105. package/dist/services/subagent/index.mjs +1 -1
  106. package/dist/services/subagent-template/index.d.mts +1 -1
  107. package/dist/services/subagent-template/schemas.d.mts +1 -1
  108. package/dist/services/tool-approval/index.mjs +1 -1
  109. package/dist/services/tools/index.mjs +1 -1
  110. package/dist/services/turn/index.d.mts +1 -1
  111. package/dist/services/turn/namespace.d.mts +1 -1
  112. package/dist/services/turn/schemas.d.mts +72 -0
  113. package/dist/services/turn/schemas.mjs +1 -1
  114. package/dist/{session-C1Cami7U.mjs → session-BwX5_k47.mjs} +1 -1
  115. package/dist/session-P4nX60Xx.mjs +39 -0
  116. package/dist/{session-lineage-CXzV_hAP.d.mts → session-lineage-CKg6mErA.d.mts} +1 -1
  117. package/dist/storage/drizzle/index.d.mts +1 -1
  118. package/dist/storage/drizzle/index.mjs +1 -1
  119. package/dist/{tool-approval-service-Cb2F1yT6.mjs → tool-approval-service-DNHV5x0M.mjs} +1 -1
  120. package/dist/{tools-D5DVHC-R.mjs → tools-CQImrHAp.mjs} +1 -1
  121. package/dist/{types-DLVitCZP.d.mts → types-BpuLMR2m.d.mts} +626 -443
  122. package/dist/{types-D5IMwOkJ.d.mts → types-D0fPFh-D.d.mts} +1 -1
  123. package/dist/{types-BMpIa4fx.d.mts → types-D6jnDjP2.d.mts} +18 -5
  124. package/dist/ui-components/index.d.mts +36 -37
  125. package/dist/ui-views/index.d.mts +2 -2
  126. package/dist/workflow-engine/index.d.mts +58 -25
  127. package/dist/workflow-engine/index.mjs +1 -1
  128. package/dist/workflow-engine/package.d.mts +1 -1
  129. package/dist/workflow-engine/package.mjs +1 -1
  130. package/dist/workflow-engine/workflow-orchestrator.mjs +1 -1
  131. package/package.json +10 -1
  132. package/dist/adapter-Dt2FDMs4.mjs +0 -1
  133. package/dist/handlers-C8EtpSqK.mjs +0 -41
  134. package/dist/package-Be2Ez4vv.mjs +0 -1
  135. package/dist/package-OE9dMQsq.mjs +0 -1
  136. package/dist/primitive-runtime-Xrc9xh6p.mjs +0 -1
  137. package/dist/schemas-CSUwpaNm.mjs +0 -1
  138. package/dist/session-KnewDVxt.mjs +0 -39
  139. /package/dist/{provider-context-lfG0BpqX.mjs → provider-context-wp4VSJFI.mjs} +0 -0
  140. /package/dist/{shared-schemas-CKe2uN4-.mjs → shared-schemas-DYL7a-No.mjs} +0 -0
@@ -4,6 +4,60 @@ import { z } from "zod";
4
4
  import * as _$_makaio_contracts0 from "@makaio/framework/contracts";
5
5
  import * as _$zod_v4_core0 from "zod/v4/core";
6
6
 
7
+ //#region core/contracts/src/session/schemas/crud.d.ts
8
+ /**
9
+ * Caller-facing fields shared by `session.create` and `session.registerExternal`.
10
+ *
11
+ * Extracted so that both subjects stay in sync — changes here are automatically
12
+ * reflected in both schemas. Both subjects apply {@link refineSpawningToolCallId}
13
+ * over this shape for the `spawningToolCallId` invariant.
14
+ */
15
+ declare const SessionCreateBaseSchema: z.ZodObject<{
16
+ sessionId: z.ZodOptional<z.ZodString>;
17
+ parentSessionId: z.ZodOptional<z.ZodString>;
18
+ contextInheritance: z.ZodOptional<z.ZodEnum<{
19
+ none: "none";
20
+ "parent-history": "parent-history";
21
+ }>>;
22
+ forkPointMessageId: z.ZodOptional<z.ZodString>;
23
+ branchKind: z.ZodOptional<z.ZodEnum<{
24
+ fork: "fork";
25
+ subagent: "subagent";
26
+ compress: "compress";
27
+ branch: "branch";
28
+ rewrite: "rewrite";
29
+ coordinator: "coordinator";
30
+ aside: "aside";
31
+ }>>;
32
+ forkTransforms: z.ZodOptional<z.ZodObject<{
33
+ removedMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
+ appliedPipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
35
+ actionId: z.ZodString;
36
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
37
+ }, z.core.$strip>>>;
38
+ segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
+ fromMessageId: z.ZodString;
40
+ toMessageId: z.ZodString;
41
+ policy: z.ZodEnum<{
42
+ verbatim: "verbatim";
43
+ summarize: "summarize";
44
+ exclude: "exclude";
45
+ }>;
46
+ stripReasoning: z.ZodOptional<z.ZodBoolean>;
47
+ stripToolOutputs: z.ZodOptional<z.ZodBoolean>;
48
+ overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLiteral<"exclude">>>;
49
+ summaryText: z.ZodOptional<z.ZodString>;
50
+ }, z.core.$strip>>>;
51
+ }, z.core.$strip>>;
52
+ title: z.ZodOptional<z.ZodString>;
53
+ targetWorkingDirectory: z.ZodOptional<z.ZodString>;
54
+ executionTargetId: z.ZodOptional<z.ZodString>;
55
+ spawningToolCallId: z.ZodOptional<z.ZodString>;
56
+ originWindowId: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ /** Parsed type for {@link SessionCreateBaseSchema}. */
59
+ type SessionCreateBase = z.infer<typeof SessionCreateBaseSchema>;
60
+ //#endregion
7
61
  //#region core/contracts/src/session/schemas/agent.d.ts
8
62
  /**
9
63
  * Agent lifecycle status.
@@ -33,6 +87,7 @@ declare const MakaioSessionAgentSchema$1: z.ZodObject<{
33
87
  adapterSessionId: z.ZodOptional<z.ZodString>;
34
88
  model: z.ZodOptional<z.ZodString>;
35
89
  cwd: z.ZodOptional<z.ZodString>;
90
+ allowedDirectories: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
91
  providerConfigId: z.ZodOptional<z.ZodString>;
37
92
  personaId: z.ZodOptional<z.ZodString>;
38
93
  profileId: z.ZodOptional<z.ZodString>;
@@ -76,6 +131,7 @@ declare const MakaioSessionSchema: z.ZodObject<{
76
131
  adapterSessionId: z.ZodOptional<z.ZodString>;
77
132
  model: z.ZodOptional<z.ZodString>;
78
133
  cwd: z.ZodOptional<z.ZodString>;
134
+ allowedDirectories: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
135
  providerConfigId: z.ZodOptional<z.ZodString>;
80
136
  personaId: z.ZodOptional<z.ZodString>;
81
137
  profileId: z.ZodOptional<z.ZodString>;
@@ -101,9 +157,9 @@ declare const MakaioSessionSchema: z.ZodObject<{
101
157
  }, z.core.$strip>>;
102
158
  status: z.ZodEnum<{
103
159
  closed: "closed";
160
+ discovered: "discovered";
104
161
  active: "active";
105
162
  archived: "archived";
106
- discovered: "discovered";
107
163
  }>;
108
164
  leadAgentId: z.ZodOptional<z.ZodString>;
109
165
  parentSessionId: z.ZodOptional<z.ZodString>;
@@ -114,10 +170,10 @@ declare const MakaioSessionSchema: z.ZodObject<{
114
170
  rootSessionId: z.ZodOptional<z.ZodString>;
115
171
  forkPointMessageId: z.ZodOptional<z.ZodString>;
116
172
  branchKind: z.ZodOptional<z.ZodEnum<{
117
- branch: "branch";
118
173
  fork: "fork";
119
174
  subagent: "subagent";
120
175
  compress: "compress";
176
+ branch: "branch";
121
177
  rewrite: "rewrite";
122
178
  coordinator: "coordinator";
123
179
  aside: "aside";
@@ -200,6 +256,7 @@ declare const SessionWithPreviewSchema: z.ZodObject<{
200
256
  adapterSessionId: z.ZodOptional<z.ZodString>;
201
257
  model: z.ZodOptional<z.ZodString>;
202
258
  cwd: z.ZodOptional<z.ZodString>;
259
+ allowedDirectories: z.ZodOptional<z.ZodArray<z.ZodString>>;
203
260
  providerConfigId: z.ZodOptional<z.ZodString>;
204
261
  personaId: z.ZodOptional<z.ZodString>;
205
262
  profileId: z.ZodOptional<z.ZodString>;
@@ -225,9 +282,9 @@ declare const SessionWithPreviewSchema: z.ZodObject<{
225
282
  }, z.core.$strip>>;
226
283
  status: z.ZodEnum<{
227
284
  closed: "closed";
285
+ discovered: "discovered";
228
286
  active: "active";
229
287
  archived: "archived";
230
- discovered: "discovered";
231
288
  }>;
232
289
  leadAgentId: z.ZodOptional<z.ZodString>;
233
290
  parentSessionId: z.ZodOptional<z.ZodString>;
@@ -238,10 +295,10 @@ declare const SessionWithPreviewSchema: z.ZodObject<{
238
295
  rootSessionId: z.ZodOptional<z.ZodString>;
239
296
  forkPointMessageId: z.ZodOptional<z.ZodString>;
240
297
  branchKind: z.ZodOptional<z.ZodEnum<{
241
- branch: "branch";
242
298
  fork: "fork";
243
299
  subagent: "subagent";
244
300
  compress: "compress";
301
+ branch: "branch";
245
302
  rewrite: "rewrite";
246
303
  coordinator: "coordinator";
247
304
  aside: "aside";
@@ -398,6 +455,7 @@ declare const SessionSnapshotSchema: z.ZodObject<{
398
455
  adapterSessionId: z.ZodOptional<z.ZodString>;
399
456
  model: z.ZodOptional<z.ZodString>;
400
457
  cwd: z.ZodOptional<z.ZodString>;
458
+ allowedDirectories: z.ZodOptional<z.ZodArray<z.ZodString>>;
401
459
  providerConfigId: z.ZodOptional<z.ZodString>;
402
460
  personaId: z.ZodOptional<z.ZodString>;
403
461
  profileId: z.ZodOptional<z.ZodString>;
@@ -423,9 +481,9 @@ declare const SessionSnapshotSchema: z.ZodObject<{
423
481
  }, z.core.$strip>>;
424
482
  status: z.ZodEnum<{
425
483
  closed: "closed";
484
+ discovered: "discovered";
426
485
  active: "active";
427
486
  archived: "archived";
428
- discovered: "discovered";
429
487
  }>;
430
488
  leadAgentId: z.ZodOptional<z.ZodString>;
431
489
  parentSessionId: z.ZodOptional<z.ZodString>;
@@ -436,10 +494,10 @@ declare const SessionSnapshotSchema: z.ZodObject<{
436
494
  rootSessionId: z.ZodOptional<z.ZodString>;
437
495
  forkPointMessageId: z.ZodOptional<z.ZodString>;
438
496
  branchKind: z.ZodOptional<z.ZodEnum<{
439
- branch: "branch";
440
497
  fork: "fork";
441
498
  subagent: "subagent";
442
499
  compress: "compress";
500
+ branch: "branch";
443
501
  rewrite: "rewrite";
444
502
  coordinator: "coordinator";
445
503
  aside: "aside";
@@ -507,6 +565,7 @@ declare const SessionSnapshotSchema: z.ZodObject<{
507
565
  adapterSessionId: z.ZodOptional<z.ZodString>;
508
566
  model: z.ZodOptional<z.ZodString>;
509
567
  cwd: z.ZodOptional<z.ZodString>;
568
+ allowedDirectories: z.ZodOptional<z.ZodArray<z.ZodString>>;
510
569
  providerConfigId: z.ZodOptional<z.ZodString>;
511
570
  personaId: z.ZodOptional<z.ZodString>;
512
571
  profileId: z.ZodOptional<z.ZodString>;
@@ -632,6 +691,14 @@ declare const SessionSnapshotSchema: z.ZodObject<{
632
691
  cost: z.ZodOptional<z.ZodNumber>;
633
692
  }, z.core.$strip>>>;
634
693
  }, z.core.$strip>>;
694
+ initiator: z.ZodOptional<z.ZodObject<{
695
+ source: z.ZodEnum<{
696
+ user: "user";
697
+ system: "system";
698
+ extension: "extension";
699
+ }>;
700
+ sourceId: z.ZodOptional<z.ZodString>;
701
+ }, z.core.$strip>>;
635
702
  }, z.core.$strip>>;
636
703
  events: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
637
704
  sessionId: z.ZodString;
@@ -892,10 +959,10 @@ declare const SessionSnapshotSchema: z.ZodObject<{
892
959
  childSessionId: z.ZodString;
893
960
  parentSessionId: z.ZodString;
894
961
  kind: z.ZodEnum<{
895
- branch: "branch";
896
962
  fork: "fork";
897
963
  subagent: "subagent";
898
964
  compress: "compress";
965
+ branch: "branch";
899
966
  rewrite: "rewrite";
900
967
  coordinator: "coordinator";
901
968
  aside: "aside";
@@ -976,10 +1043,10 @@ type AgentRole = z.infer<typeof AgentRoleSchema>;
976
1043
  * by session boundary (child sessions are never in parent's context assembly)
977
1044
  */
978
1045
  declare const BranchKindSchema: z.ZodEnum<{
979
- branch: "branch";
980
1046
  fork: "fork";
981
1047
  subagent: "subagent";
982
1048
  compress: "compress";
1049
+ branch: "branch";
983
1050
  rewrite: "rewrite";
984
1051
  coordinator: "coordinator";
985
1052
  aside: "aside";
@@ -998,34 +1065,309 @@ declare const ImportStatusSchema: z.ZodEnum<{
998
1065
  }>;
999
1066
  type ImportStatus = z.infer<typeof ImportStatusSchema>;
1000
1067
  //#endregion
1001
- //#region core/contracts/src/session/schemas/orchestrator.d.ts
1068
+ //#region core/contracts/src/session/schemas/message.d.ts
1002
1069
  /**
1003
- * Identifies the origin of a turn for loop prevention and audit.
1070
+ * Session message block types for structured content within stored messages.
1004
1071
  *
1005
- * Used by extensions (e.g., Routine) to distinguish user-initiated turns from
1006
- * extension-initiated turns, preventing recursive execution loops.
1072
+ * Unified with MessageBlock all block types (text, image, document, attachment,
1073
+ * reasoning, tool_call, tool_output) are first-class citizens in both storage
1074
+ * and SDK contexts.
1007
1075
  */
1008
- declare const TurnInitiatorSchema: z.ZodObject<{
1009
- source: z.ZodEnum<{
1076
+ declare const SessionMessageBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1077
+ type: z.ZodLiteral<"text">;
1078
+ content: z.ZodString;
1079
+ }, z.core.$strip>, z.ZodObject<{
1080
+ type: z.ZodLiteral<"image">;
1081
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1082
+ type: z.ZodLiteral<"base64">;
1083
+ data: z.ZodString;
1084
+ mimeType: z.ZodString;
1085
+ }, z.core.$strip>, z.ZodObject<{
1086
+ type: z.ZodLiteral<"url">;
1087
+ url: z.ZodString;
1088
+ mimeType: z.ZodOptional<z.ZodString>;
1089
+ }, z.core.$strip>], "type">;
1090
+ }, z.core.$strip>, z.ZodObject<{
1091
+ type: z.ZodLiteral<"document">;
1092
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1093
+ type: z.ZodLiteral<"base64">;
1094
+ data: z.ZodString;
1095
+ mimeType: z.ZodString;
1096
+ }, z.core.$strip>, z.ZodObject<{
1097
+ type: z.ZodLiteral<"url">;
1098
+ url: z.ZodString;
1099
+ mimeType: z.ZodOptional<z.ZodString>;
1100
+ }, z.core.$strip>], "type">;
1101
+ }, z.core.$strip>, z.ZodObject<{
1102
+ type: z.ZodLiteral<"attachment">;
1103
+ fileName: z.ZodString;
1104
+ filePath: z.ZodString;
1105
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1106
+ type: z.ZodLiteral<"base64">;
1107
+ data: z.ZodString;
1108
+ mimeType: z.ZodString;
1109
+ }, z.core.$strip>, z.ZodObject<{
1110
+ type: z.ZodLiteral<"url">;
1111
+ url: z.ZodString;
1112
+ mimeType: z.ZodOptional<z.ZodString>;
1113
+ }, z.core.$strip>], "type">;
1114
+ displayName: z.ZodOptional<z.ZodString>;
1115
+ attachmentType: z.ZodEnum<{
1116
+ file: "file";
1117
+ directory: "directory";
1118
+ }>;
1119
+ }, z.core.$strip>, z.ZodObject<{
1120
+ type: z.ZodLiteral<"reasoning">;
1121
+ content: z.ZodString;
1122
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1123
+ }, z.core.$strip>, z.ZodObject<{
1124
+ type: z.ZodLiteral<"tool_call">;
1125
+ toolCallId: z.ZodString;
1126
+ name: z.ZodString;
1127
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1128
+ }, z.core.$strip>, z.ZodObject<{
1129
+ type: z.ZodLiteral<"tool_output">;
1130
+ toolCallId: z.ZodString;
1131
+ output: z.ZodString;
1132
+ isError: z.ZodOptional<z.ZodBoolean>;
1133
+ }, z.core.$strip>], "type">;
1134
+ type SessionMessageBlock$1 = MessageBlock$1;
1135
+ /**
1136
+ * Session message role in a conversation.
1137
+ */
1138
+ declare const SessionMessageRoleSchema: z.ZodEnum<{
1139
+ user: "user";
1140
+ assistant: "assistant";
1141
+ }>;
1142
+ type SessionMessageRole = z.infer<typeof SessionMessageRoleSchema>;
1143
+ declare const SessionMessageOriginSchema: z.ZodEnum<{
1144
+ text: "text";
1145
+ voice: "voice";
1146
+ compact: "compact";
1147
+ }>;
1148
+ type SessionMessageOrigin = z.infer<typeof SessionMessageOriginSchema>;
1149
+ /**
1150
+ * A stored message in a session conversation.
1151
+ *
1152
+ * Distinct from `shared/Message` which is the SDK message format for runtime.
1153
+ * SessionMessage includes storage metadata (messageId, turnId, timestamp, etc.).
1154
+ *
1155
+ * Messages are first-class entities stored in the `messages` table.
1156
+ *
1157
+ * Design principles:
1158
+ * - Single source of truth for conversation content
1159
+ * - Blocks preserve full response fidelity (reasoning, tools)
1160
+ * - contentText extracted for full-text search
1161
+ * - Events remain for lifecycle/audit only
1162
+ */
1163
+ declare const SessionMessageSchema$1: z.ZodObject<{
1164
+ messageId: z.ZodString;
1165
+ turnId: z.ZodNullable<z.ZodString>;
1166
+ sessionId: z.ZodString;
1167
+ role: z.ZodEnum<{
1010
1168
  user: "user";
1011
- system: "system";
1012
- extension: "extension";
1169
+ assistant: "assistant";
1013
1170
  }>;
1014
- sourceId: z.ZodOptional<z.ZodString>;
1171
+ contentText: z.ZodString;
1172
+ blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1173
+ type: z.ZodLiteral<"text">;
1174
+ content: z.ZodString;
1175
+ }, z.core.$strip>, z.ZodObject<{
1176
+ type: z.ZodLiteral<"image">;
1177
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1178
+ type: z.ZodLiteral<"base64">;
1179
+ data: z.ZodString;
1180
+ mimeType: z.ZodString;
1181
+ }, z.core.$strip>, z.ZodObject<{
1182
+ type: z.ZodLiteral<"url">;
1183
+ url: z.ZodString;
1184
+ mimeType: z.ZodOptional<z.ZodString>;
1185
+ }, z.core.$strip>], "type">;
1186
+ }, z.core.$strip>, z.ZodObject<{
1187
+ type: z.ZodLiteral<"document">;
1188
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1189
+ type: z.ZodLiteral<"base64">;
1190
+ data: z.ZodString;
1191
+ mimeType: z.ZodString;
1192
+ }, z.core.$strip>, z.ZodObject<{
1193
+ type: z.ZodLiteral<"url">;
1194
+ url: z.ZodString;
1195
+ mimeType: z.ZodOptional<z.ZodString>;
1196
+ }, z.core.$strip>], "type">;
1197
+ }, z.core.$strip>, z.ZodObject<{
1198
+ type: z.ZodLiteral<"attachment">;
1199
+ fileName: z.ZodString;
1200
+ filePath: z.ZodString;
1201
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1202
+ type: z.ZodLiteral<"base64">;
1203
+ data: z.ZodString;
1204
+ mimeType: z.ZodString;
1205
+ }, z.core.$strip>, z.ZodObject<{
1206
+ type: z.ZodLiteral<"url">;
1207
+ url: z.ZodString;
1208
+ mimeType: z.ZodOptional<z.ZodString>;
1209
+ }, z.core.$strip>], "type">;
1210
+ displayName: z.ZodOptional<z.ZodString>;
1211
+ attachmentType: z.ZodEnum<{
1212
+ file: "file";
1213
+ directory: "directory";
1214
+ }>;
1215
+ }, z.core.$strip>, z.ZodObject<{
1216
+ type: z.ZodLiteral<"reasoning">;
1217
+ content: z.ZodString;
1218
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1219
+ }, z.core.$strip>, z.ZodObject<{
1220
+ type: z.ZodLiteral<"tool_call">;
1221
+ toolCallId: z.ZodString;
1222
+ name: z.ZodString;
1223
+ args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1224
+ }, z.core.$strip>, z.ZodObject<{
1225
+ type: z.ZodLiteral<"tool_output">;
1226
+ toolCallId: z.ZodString;
1227
+ output: z.ZodString;
1228
+ isError: z.ZodOptional<z.ZodBoolean>;
1229
+ }, z.core.$strip>], "type">>;
1230
+ agentId: z.ZodOptional<z.ZodString>;
1231
+ adapterSessionId: z.ZodOptional<z.ZodString>;
1232
+ adapterMessageId: z.ZodOptional<z.ZodString>;
1233
+ timestamp: z.ZodNumber;
1234
+ editOf: z.ZodOptional<z.ZodString>;
1235
+ origin: z.ZodOptional<z.ZodEnum<{
1236
+ text: "text";
1237
+ voice: "voice";
1238
+ compact: "compact";
1239
+ }>>;
1015
1240
  }, z.core.$strip>;
1016
- /** Parsed type for {@link TurnInitiatorSchema}. */
1017
- type TurnInitiator$1 = z.infer<typeof TurnInitiatorSchema>;
1241
+ type SessionMessage$1 = z.infer<typeof SessionMessageSchema$1>;
1018
1242
  /**
1019
- * Orchestrator schemas for turn lifecycle and user message routing.
1020
- *
1021
- * These schemas are owned by SessionOrchestrator, not SessionService.
1022
- * SessionService handles lifecycle (CRUD); orchestrator handles routing/turns.
1243
+ * Turn status in the conversation lifecycle.
1023
1244
  */
1024
- declare const OrchestratorSchemas: {
1025
- /**
1026
- * Send a message to a session's agents.
1027
- *
1028
- * Subject: `session.sendMessage`
1245
+ declare const TurnStatusSchema$1: z.ZodEnum<{
1246
+ error: "error";
1247
+ completed: "completed";
1248
+ active: "active";
1249
+ }>;
1250
+ type TurnStatus = z.infer<typeof TurnStatusSchema$1>;
1251
+ /**
1252
+ * Usage metrics for a single agent or aggregated total.
1253
+ */
1254
+ declare const UsageMetricsSchema: z.ZodObject<{
1255
+ inputTokens: z.ZodNumber;
1256
+ outputTokens: z.ZodNumber;
1257
+ cost: z.ZodOptional<z.ZodNumber>;
1258
+ }, z.core.$strip>;
1259
+ type UsageMetrics = z.infer<typeof UsageMetricsSchema>;
1260
+ /**
1261
+ * Aggregated usage for a turn, with optional per-agent breakdown.
1262
+ */
1263
+ declare const TurnUsageSchema$1: z.ZodObject<{
1264
+ total: z.ZodObject<{
1265
+ inputTokens: z.ZodNumber;
1266
+ outputTokens: z.ZodNumber;
1267
+ cost: z.ZodOptional<z.ZodNumber>;
1268
+ }, z.core.$strip>;
1269
+ byAgent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1270
+ inputTokens: z.ZodNumber;
1271
+ outputTokens: z.ZodNumber;
1272
+ cost: z.ZodOptional<z.ZodNumber>;
1273
+ }, z.core.$strip>>>;
1274
+ }, z.core.$strip>;
1275
+ type TurnUsage = z.infer<typeof TurnUsageSchema$1>;
1276
+ /**
1277
+ * Identifies the origin of a turn for loop prevention and audit.
1278
+ *
1279
+ * Used by extensions (e.g., Routine) to distinguish user-initiated turns from
1280
+ * extension-initiated turns, preventing recursive execution loops.
1281
+ */
1282
+ declare const TurnInitiatorSchema$1: z.ZodObject<{
1283
+ source: z.ZodEnum<{
1284
+ user: "user";
1285
+ system: "system";
1286
+ extension: "extension";
1287
+ }>;
1288
+ sourceId: z.ZodOptional<z.ZodString>;
1289
+ }, z.core.$strip>;
1290
+ /** Parsed type for {@link TurnInitiatorSchema}. */
1291
+ type TurnInitiator$2 = z.infer<typeof TurnInitiatorSchema$1>;
1292
+ /**
1293
+ * A turn in a session conversation.
1294
+ *
1295
+ * A turn represents a user message and all agent responses to it.
1296
+ * Extracted from events to provide explicit turn boundaries.
1297
+ */
1298
+ declare const TurnSchema$1: z.ZodObject<{
1299
+ turnId: z.ZodString;
1300
+ sessionId: z.ZodString;
1301
+ turnNumber: z.ZodNumber;
1302
+ startedAt: z.ZodNumber;
1303
+ completedAt: z.ZodOptional<z.ZodNumber>;
1304
+ status: z.ZodEnum<{
1305
+ error: "error";
1306
+ completed: "completed";
1307
+ active: "active";
1308
+ }>;
1309
+ error: z.ZodOptional<z.ZodString>;
1310
+ usage: z.ZodOptional<z.ZodObject<{
1311
+ total: z.ZodObject<{
1312
+ inputTokens: z.ZodNumber;
1313
+ outputTokens: z.ZodNumber;
1314
+ cost: z.ZodOptional<z.ZodNumber>;
1315
+ }, z.core.$strip>;
1316
+ byAgent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1317
+ inputTokens: z.ZodNumber;
1318
+ outputTokens: z.ZodNumber;
1319
+ cost: z.ZodOptional<z.ZodNumber>;
1320
+ }, z.core.$strip>>>;
1321
+ }, z.core.$strip>>;
1322
+ initiator: z.ZodOptional<z.ZodObject<{
1323
+ source: z.ZodEnum<{
1324
+ user: "user";
1325
+ system: "system";
1326
+ extension: "extension";
1327
+ }>;
1328
+ sourceId: z.ZodOptional<z.ZodString>;
1329
+ }, z.core.$strip>>;
1330
+ }, z.core.$strip>;
1331
+ type Turn$1 = z.infer<typeof TurnSchema$1>;
1332
+ /**
1333
+ * Message routing status for multi-agent delivery tracking.
1334
+ */
1335
+ declare const MessageRoutingStatusSchema: z.ZodEnum<{
1336
+ completed: "completed";
1337
+ sent: "sent";
1338
+ acknowledged: "acknowledged";
1339
+ }>;
1340
+ type MessageRoutingStatus = z.infer<typeof MessageRoutingStatusSchema>;
1341
+ /**
1342
+ * Tracks delivery status of a message to agents in multi-agent sessions.
1343
+ */
1344
+ declare const MessageRoutingSchema$1: z.ZodObject<{
1345
+ messageId: z.ZodString;
1346
+ agentId: z.ZodString;
1347
+ status: z.ZodEnum<{
1348
+ completed: "completed";
1349
+ sent: "sent";
1350
+ acknowledged: "acknowledged";
1351
+ }>;
1352
+ timestamp: z.ZodNumber;
1353
+ error: z.ZodOptional<z.ZodString>;
1354
+ }, z.core.$strip>;
1355
+ type MessageRouting = z.infer<typeof MessageRoutingSchema$1>;
1356
+ //#endregion
1357
+ //#region core/contracts/src/session/schemas/orchestrator.d.ts
1358
+ /** Parsed type for {@link TurnInitiatorSchema}. */
1359
+ type TurnInitiator$1 = z.infer<typeof TurnInitiatorSchema$1>;
1360
+ /**
1361
+ * Orchestrator schemas for turn lifecycle and user message routing.
1362
+ *
1363
+ * These schemas are owned by SessionOrchestrator, not SessionService.
1364
+ * SessionService handles lifecycle (CRUD); orchestrator handles routing/turns.
1365
+ */
1366
+ declare const OrchestratorSchemas: {
1367
+ /**
1368
+ * Send a message to a session's agents.
1369
+ *
1370
+ * Subject: `session.sendMessage`
1029
1371
  * Type: Request (RPC)
1030
1372
  *
1031
1373
  * Single entry point for all user messages. Handles:
@@ -1978,6 +2320,39 @@ declare const OrchestratorSchemas: {
1978
2320
  sourceId: z.ZodOptional<z.ZodString>;
1979
2321
  }, z.core.$strip>>;
1980
2322
  }, z.core.$strip>;
2323
+ /**
2324
+ * Await completion of a specific session turn.
2325
+ *
2326
+ * Subject: `session.turn.await`
2327
+ * Type: Request (RPC)
2328
+ *
2329
+ * Resolves with the matching `session.turn.completed` payload. The timeout is
2330
+ * required so callers cannot accidentally create an unbounded wait.
2331
+ */
2332
+ 'turn.await': {
2333
+ request: z.ZodObject<{
2334
+ sessionId: z.ZodString;
2335
+ turnId: z.ZodString;
2336
+ timeoutMs: z.ZodNumber;
2337
+ }, z.core.$strip>;
2338
+ response: z.ZodObject<{
2339
+ completion: z.ZodObject<{
2340
+ sessionId: z.ZodString;
2341
+ turnId: z.ZodString;
2342
+ turnNumber: z.ZodNumber;
2343
+ success: z.ZodBoolean;
2344
+ error: z.ZodOptional<z.ZodString>;
2345
+ initiator: z.ZodOptional<z.ZodObject<{
2346
+ source: z.ZodEnum<{
2347
+ user: "user";
2348
+ system: "system";
2349
+ extension: "extension";
2350
+ }>;
2351
+ sourceId: z.ZodOptional<z.ZodString>;
2352
+ }, z.core.$strip>>;
2353
+ }, z.core.$strip>;
2354
+ }, z.core.$strip>;
2355
+ };
1981
2356
  /**
1982
2357
  * User message sent to session.
1983
2358
  *
@@ -2195,8 +2570,8 @@ declare const OrchestratorSchemas: {
2195
2570
  fromMessageId: z.ZodOptional<z.ZodString>;
2196
2571
  name: z.ZodOptional<z.ZodString>;
2197
2572
  branchKind: z.ZodOptional<z.ZodEnum<{
2198
- branch: "branch";
2199
2573
  fork: "fork";
2574
+ branch: "branch";
2200
2575
  aside: "aside";
2201
2576
  }>>;
2202
2577
  transforms: z.ZodOptional<z.ZodObject<{
@@ -2226,47 +2601,9 @@ declare const OrchestratorSchemas: {
2226
2601
  sessionId: z.ZodString;
2227
2602
  }, z.core.$strip>;
2228
2603
  };
2229
- /**
2230
- * Aggregated session-level token usage.
2231
- *
2232
- * Subject: `session.usage`
2233
- * Type: Event (fire-and-forget)
2234
- * Emitted when: UsageAggregator receives adapter.session.usage events
2235
- *
2236
- * Aggregates token usage across all adapters in a session.
2237
- * UsageAggregator listens to adapter.session.usage events, aggregates them
2238
- * per-session (keyed by adapterSessionId to avoid collisions), and emits
2239
- * this canonical session-level usage event.
2240
- *
2241
- * ContextTracker consumes this to track context window usage against thresholds.
2242
- * @example
2243
- * ```typescript
2244
- * bus.on(SessionSubjects.usage, (ctx) => {
2245
- * console.debug(
2246
- * `Session ${ctx.payload.sessionId}: ${ctx.payload.totalTokens} tokens ` +
2247
- * `(${ctx.payload.adapterCount} adapters)`
2248
- * );
2249
- * });
2250
- * ```
2251
- */
2252
- usage: {
2253
- request: z.ZodObject<{
2254
- sessionId: z.ZodString;
2255
- totalInputTokens: z.ZodNumber;
2256
- totalOutputTokens: z.ZodNumber;
2257
- totalTokens: z.ZodNumber;
2258
- totalCalls: z.ZodNumber;
2259
- adapterCount: z.ZodNumber;
2260
- }, z.core.$strip>;
2261
- response: z.ZodObject<{
2262
- acknowledged: z.ZodLiteral<true>;
2263
- }, z.core.$strip>;
2264
- };
2265
2604
  };
2266
2605
  type SendMessageRequest = z.infer<typeof OrchestratorSchemas.sendMessage.request>;
2267
2606
  type SendMessageResponse = z.infer<typeof OrchestratorSchemas.sendMessage.response>;
2268
- type SessionUsagePayload = z.infer<typeof OrchestratorSchemas.usage.request>;
2269
- type SessionUsageResponse = z.infer<typeof OrchestratorSchemas.usage.response>;
2270
2607
  //#endregion
2271
2608
  //#region core/contracts/src/session/schemas/event.d.ts
2272
2609
  /**
@@ -2546,10 +2883,10 @@ declare const MakaioSessionEventSchema: z.ZodUnion<readonly [z.ZodDiscriminatedU
2546
2883
  childSessionId: z.ZodString;
2547
2884
  parentSessionId: z.ZodString;
2548
2885
  kind: z.ZodEnum<{
2549
- branch: "branch";
2550
2886
  fork: "fork";
2551
2887
  subagent: "subagent";
2552
2888
  compress: "compress";
2889
+ branch: "branch";
2553
2890
  rewrite: "rewrite";
2554
2891
  coordinator: "coordinator";
2555
2892
  aside: "aside";
@@ -2735,362 +3072,97 @@ declare const ForkChildInfoSchema: z.ZodObject<{
2735
3072
  title: z.ZodNullable<z.ZodString>;
2736
3073
  forkPointMessageId: z.ZodNullable<z.ZodString>;
2737
3074
  branchKind: z.ZodNullable<z.ZodEnum<{
2738
- branch: "branch";
2739
3075
  fork: "fork";
2740
3076
  subagent: "subagent";
2741
3077
  compress: "compress";
2742
- rewrite: "rewrite";
2743
- coordinator: "coordinator";
2744
- aside: "aside";
2745
- }>>;
2746
- messageCount: z.ZodNumber;
2747
- hasChildren: z.ZodBoolean;
2748
- spawningToolCallId: z.ZodOptional<z.ZodString>;
2749
- }, z.core.$strip>;
2750
- type ForkChildInfo = z.infer<typeof ForkChildInfoSchema>;
2751
- //#endregion
2752
- //#region core/contracts/src/session/schemas/lifecycle-events.d.ts
2753
- /**
2754
- * Session lifecycle event schemas.
2755
- * These extend SessionSchemas for fork/merge/abandon lifecycle.
2756
- */
2757
- /**
2758
- * Policy for a contiguous range of messages in a fork context window.
2759
- *
2760
- * Segments define how a slice of conversation history is projected into the
2761
- * child session. When `segments` is present on {@link ForkTransforms},
2762
- * `removedMessageIds` and `appliedPipeline` are ignored — segments take
2763
- * precedence as the authoritative context curation strategy.
2764
- */
2765
- declare const SegmentPolicySchema: z.ZodObject<{
2766
- fromMessageId: z.ZodString;
2767
- toMessageId: z.ZodString;
2768
- policy: z.ZodEnum<{
2769
- verbatim: "verbatim";
2770
- summarize: "summarize";
2771
- exclude: "exclude";
2772
- }>;
2773
- stripReasoning: z.ZodOptional<z.ZodBoolean>;
2774
- stripToolOutputs: z.ZodOptional<z.ZodBoolean>;
2775
- overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLiteral<"exclude">>>;
2776
- summaryText: z.ZodOptional<z.ZodString>;
2777
- }, z.core.$strip>;
2778
- /** Inferred type for {@link SegmentPolicySchema}. */
2779
- type SegmentPolicy = z.infer<typeof SegmentPolicySchema>;
2780
- /**
2781
- * Transform configuration for fork sessions.
2782
- * Stored on session record and applied by getFullConversation().
2783
- *
2784
- * When `segments` is present, it takes precedence over `removedMessageIds`
2785
- * and `appliedPipeline` — those fields are ignored at runtime.
2786
- */
2787
- declare const ForkTransformsSchema$1: z.ZodObject<{
2788
- removedMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
2789
- appliedPipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
2790
- actionId: z.ZodString;
2791
- options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2792
- }, z.core.$strip>>>;
2793
- segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
2794
- fromMessageId: z.ZodString;
2795
- toMessageId: z.ZodString;
2796
- policy: z.ZodEnum<{
2797
- verbatim: "verbatim";
2798
- summarize: "summarize";
2799
- exclude: "exclude";
2800
- }>;
2801
- stripReasoning: z.ZodOptional<z.ZodBoolean>;
2802
- stripToolOutputs: z.ZodOptional<z.ZodBoolean>;
2803
- overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLiteral<"exclude">>>;
2804
- summaryText: z.ZodOptional<z.ZodString>;
2805
- }, z.core.$strip>>>;
2806
- }, z.core.$strip>;
2807
- type ForkTransforms$1 = z.infer<typeof ForkTransformsSchema$1>;
2808
- declare const SessionCreatedEventSchema: z.ZodObject<{
2809
- sessionId: z.ZodString;
2810
- parentSessionId: z.ZodNullable<z.ZodString>;
2811
- branchKind: z.ZodNullable<z.ZodEnum<{
2812
3078
  branch: "branch";
2813
- fork: "fork";
2814
- subagent: "subagent";
2815
- compress: "compress";
2816
3079
  rewrite: "rewrite";
2817
3080
  coordinator: "coordinator";
2818
3081
  aside: "aside";
2819
3082
  }>>;
2820
- createdAt: z.ZodNumber;
2821
- originWindowId: z.ZodOptional<z.ZodString>;
2822
- }, z.core.$strip>;
2823
- declare const SessionUpdatedEventSchema: z.ZodObject<{
2824
- sessionId: z.ZodString;
2825
- changedProperties: z.ZodArray<z.ZodString>;
2826
- }, z.core.$strip>;
2827
- type SessionCreated = z.infer<typeof SessionCreatedEventSchema>;
2828
- type SessionUpdatedEvent = z.infer<typeof SessionUpdatedEventSchema>;
2829
- //#endregion
2830
- //#region core/contracts/src/session/schemas/message.d.ts
2831
- /**
2832
- * Session message block types for structured content within stored messages.
2833
- *
2834
- * Unified with MessageBlock — all block types (text, image, document, attachment,
2835
- * reasoning, tool_call, tool_output) are first-class citizens in both storage
2836
- * and SDK contexts.
2837
- */
2838
- declare const SessionMessageBlockSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2839
- type: z.ZodLiteral<"text">;
2840
- content: z.ZodString;
2841
- }, z.core.$strip>, z.ZodObject<{
2842
- type: z.ZodLiteral<"image">;
2843
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2844
- type: z.ZodLiteral<"base64">;
2845
- data: z.ZodString;
2846
- mimeType: z.ZodString;
2847
- }, z.core.$strip>, z.ZodObject<{
2848
- type: z.ZodLiteral<"url">;
2849
- url: z.ZodString;
2850
- mimeType: z.ZodOptional<z.ZodString>;
2851
- }, z.core.$strip>], "type">;
2852
- }, z.core.$strip>, z.ZodObject<{
2853
- type: z.ZodLiteral<"document">;
2854
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2855
- type: z.ZodLiteral<"base64">;
2856
- data: z.ZodString;
2857
- mimeType: z.ZodString;
2858
- }, z.core.$strip>, z.ZodObject<{
2859
- type: z.ZodLiteral<"url">;
2860
- url: z.ZodString;
2861
- mimeType: z.ZodOptional<z.ZodString>;
2862
- }, z.core.$strip>], "type">;
2863
- }, z.core.$strip>, z.ZodObject<{
2864
- type: z.ZodLiteral<"attachment">;
2865
- fileName: z.ZodString;
2866
- filePath: z.ZodString;
2867
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2868
- type: z.ZodLiteral<"base64">;
2869
- data: z.ZodString;
2870
- mimeType: z.ZodString;
2871
- }, z.core.$strip>, z.ZodObject<{
2872
- type: z.ZodLiteral<"url">;
2873
- url: z.ZodString;
2874
- mimeType: z.ZodOptional<z.ZodString>;
2875
- }, z.core.$strip>], "type">;
2876
- displayName: z.ZodOptional<z.ZodString>;
2877
- attachmentType: z.ZodEnum<{
2878
- file: "file";
2879
- directory: "directory";
2880
- }>;
2881
- }, z.core.$strip>, z.ZodObject<{
2882
- type: z.ZodLiteral<"reasoning">;
2883
- content: z.ZodString;
2884
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2885
- }, z.core.$strip>, z.ZodObject<{
2886
- type: z.ZodLiteral<"tool_call">;
2887
- toolCallId: z.ZodString;
2888
- name: z.ZodString;
2889
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2890
- }, z.core.$strip>, z.ZodObject<{
2891
- type: z.ZodLiteral<"tool_output">;
2892
- toolCallId: z.ZodString;
2893
- output: z.ZodString;
2894
- isError: z.ZodOptional<z.ZodBoolean>;
2895
- }, z.core.$strip>], "type">;
2896
- type SessionMessageBlock$1 = MessageBlock$1;
2897
- /**
2898
- * Session message role in a conversation.
2899
- */
2900
- declare const SessionMessageRoleSchema: z.ZodEnum<{
2901
- user: "user";
2902
- assistant: "assistant";
2903
- }>;
2904
- type SessionMessageRole = z.infer<typeof SessionMessageRoleSchema>;
2905
- declare const SessionMessageOriginSchema: z.ZodEnum<{
2906
- text: "text";
2907
- voice: "voice";
2908
- compact: "compact";
2909
- }>;
2910
- type SessionMessageOrigin = z.infer<typeof SessionMessageOriginSchema>;
2911
- /**
2912
- * A stored message in a session conversation.
2913
- *
2914
- * Distinct from `shared/Message` which is the SDK message format for runtime.
2915
- * SessionMessage includes storage metadata (messageId, turnId, timestamp, etc.).
2916
- *
2917
- * Messages are first-class entities stored in the `messages` table.
2918
- *
2919
- * Design principles:
2920
- * - Single source of truth for conversation content
2921
- * - Blocks preserve full response fidelity (reasoning, tools)
2922
- * - contentText extracted for full-text search
2923
- * - Events remain for lifecycle/audit only
2924
- */
2925
- declare const SessionMessageSchema$1: z.ZodObject<{
2926
- messageId: z.ZodString;
2927
- turnId: z.ZodNullable<z.ZodString>;
2928
- sessionId: z.ZodString;
2929
- role: z.ZodEnum<{
2930
- user: "user";
2931
- assistant: "assistant";
2932
- }>;
2933
- contentText: z.ZodString;
2934
- blocks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
2935
- type: z.ZodLiteral<"text">;
2936
- content: z.ZodString;
2937
- }, z.core.$strip>, z.ZodObject<{
2938
- type: z.ZodLiteral<"image">;
2939
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2940
- type: z.ZodLiteral<"base64">;
2941
- data: z.ZodString;
2942
- mimeType: z.ZodString;
2943
- }, z.core.$strip>, z.ZodObject<{
2944
- type: z.ZodLiteral<"url">;
2945
- url: z.ZodString;
2946
- mimeType: z.ZodOptional<z.ZodString>;
2947
- }, z.core.$strip>], "type">;
2948
- }, z.core.$strip>, z.ZodObject<{
2949
- type: z.ZodLiteral<"document">;
2950
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2951
- type: z.ZodLiteral<"base64">;
2952
- data: z.ZodString;
2953
- mimeType: z.ZodString;
2954
- }, z.core.$strip>, z.ZodObject<{
2955
- type: z.ZodLiteral<"url">;
2956
- url: z.ZodString;
2957
- mimeType: z.ZodOptional<z.ZodString>;
2958
- }, z.core.$strip>], "type">;
2959
- }, z.core.$strip>, z.ZodObject<{
2960
- type: z.ZodLiteral<"attachment">;
2961
- fileName: z.ZodString;
2962
- filePath: z.ZodString;
2963
- source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2964
- type: z.ZodLiteral<"base64">;
2965
- data: z.ZodString;
2966
- mimeType: z.ZodString;
2967
- }, z.core.$strip>, z.ZodObject<{
2968
- type: z.ZodLiteral<"url">;
2969
- url: z.ZodString;
2970
- mimeType: z.ZodOptional<z.ZodString>;
2971
- }, z.core.$strip>], "type">;
2972
- displayName: z.ZodOptional<z.ZodString>;
2973
- attachmentType: z.ZodEnum<{
2974
- file: "file";
2975
- directory: "directory";
2976
- }>;
2977
- }, z.core.$strip>, z.ZodObject<{
2978
- type: z.ZodLiteral<"reasoning">;
2979
- content: z.ZodString;
2980
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2981
- }, z.core.$strip>, z.ZodObject<{
2982
- type: z.ZodLiteral<"tool_call">;
2983
- toolCallId: z.ZodString;
2984
- name: z.ZodString;
2985
- args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
2986
- }, z.core.$strip>, z.ZodObject<{
2987
- type: z.ZodLiteral<"tool_output">;
2988
- toolCallId: z.ZodString;
2989
- output: z.ZodString;
2990
- isError: z.ZodOptional<z.ZodBoolean>;
2991
- }, z.core.$strip>], "type">>;
2992
- agentId: z.ZodOptional<z.ZodString>;
2993
- adapterSessionId: z.ZodOptional<z.ZodString>;
2994
- adapterMessageId: z.ZodOptional<z.ZodString>;
2995
- timestamp: z.ZodNumber;
2996
- editOf: z.ZodOptional<z.ZodString>;
2997
- origin: z.ZodOptional<z.ZodEnum<{
2998
- text: "text";
2999
- voice: "voice";
3000
- compact: "compact";
3001
- }>>;
3002
- }, z.core.$strip>;
3003
- type SessionMessage$1 = z.infer<typeof SessionMessageSchema$1>;
3004
- /**
3005
- * Turn status in the conversation lifecycle.
3006
- */
3007
- declare const TurnStatusSchema$1: z.ZodEnum<{
3008
- error: "error";
3009
- completed: "completed";
3010
- active: "active";
3011
- }>;
3012
- type TurnStatus = z.infer<typeof TurnStatusSchema$1>;
3013
- /**
3014
- * Usage metrics for a single agent or aggregated total.
3015
- */
3016
- declare const UsageMetricsSchema: z.ZodObject<{
3017
- inputTokens: z.ZodNumber;
3018
- outputTokens: z.ZodNumber;
3019
- cost: z.ZodOptional<z.ZodNumber>;
3020
- }, z.core.$strip>;
3021
- type UsageMetrics = z.infer<typeof UsageMetricsSchema>;
3022
- /**
3023
- * Aggregated usage for a turn, with optional per-agent breakdown.
3024
- */
3025
- declare const TurnUsageSchema$1: z.ZodObject<{
3026
- total: z.ZodObject<{
3027
- inputTokens: z.ZodNumber;
3028
- outputTokens: z.ZodNumber;
3029
- cost: z.ZodOptional<z.ZodNumber>;
3030
- }, z.core.$strip>;
3031
- byAgent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3032
- inputTokens: z.ZodNumber;
3033
- outputTokens: z.ZodNumber;
3034
- cost: z.ZodOptional<z.ZodNumber>;
3035
- }, z.core.$strip>>>;
3083
+ messageCount: z.ZodNumber;
3084
+ hasChildren: z.ZodBoolean;
3085
+ spawningToolCallId: z.ZodOptional<z.ZodString>;
3036
3086
  }, z.core.$strip>;
3037
- type TurnUsage = z.infer<typeof TurnUsageSchema$1>;
3087
+ type ForkChildInfo = z.infer<typeof ForkChildInfoSchema>;
3088
+ //#endregion
3089
+ //#region core/contracts/src/session/schemas/lifecycle-events.d.ts
3038
3090
  /**
3039
- * A turn in a session conversation.
3091
+ * Session lifecycle event schemas.
3092
+ * These extend SessionSchemas for fork/merge/abandon lifecycle.
3093
+ */
3094
+ /**
3095
+ * Policy for a contiguous range of messages in a fork context window.
3040
3096
  *
3041
- * A turn represents a user message and all agent responses to it.
3042
- * Extracted from events to provide explicit turn boundaries.
3097
+ * Segments define how a slice of conversation history is projected into the
3098
+ * child session. When `segments` is present on {@link ForkTransforms},
3099
+ * `removedMessageIds` and `appliedPipeline` are ignored — segments take
3100
+ * precedence as the authoritative context curation strategy.
3043
3101
  */
3044
- declare const TurnSchema$1: z.ZodObject<{
3045
- turnId: z.ZodString;
3046
- sessionId: z.ZodString;
3047
- turnNumber: z.ZodNumber;
3048
- startedAt: z.ZodNumber;
3049
- completedAt: z.ZodOptional<z.ZodNumber>;
3050
- status: z.ZodEnum<{
3051
- error: "error";
3052
- completed: "completed";
3053
- active: "active";
3102
+ declare const SegmentPolicySchema: z.ZodObject<{
3103
+ fromMessageId: z.ZodString;
3104
+ toMessageId: z.ZodString;
3105
+ policy: z.ZodEnum<{
3106
+ verbatim: "verbatim";
3107
+ summarize: "summarize";
3108
+ exclude: "exclude";
3054
3109
  }>;
3055
- error: z.ZodOptional<z.ZodString>;
3056
- usage: z.ZodOptional<z.ZodObject<{
3057
- total: z.ZodObject<{
3058
- inputTokens: z.ZodNumber;
3059
- outputTokens: z.ZodNumber;
3060
- cost: z.ZodOptional<z.ZodNumber>;
3061
- }, z.core.$strip>;
3062
- byAgent: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
3063
- inputTokens: z.ZodNumber;
3064
- outputTokens: z.ZodNumber;
3065
- cost: z.ZodOptional<z.ZodNumber>;
3066
- }, z.core.$strip>>>;
3067
- }, z.core.$strip>>;
3110
+ stripReasoning: z.ZodOptional<z.ZodBoolean>;
3111
+ stripToolOutputs: z.ZodOptional<z.ZodBoolean>;
3112
+ overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLiteral<"exclude">>>;
3113
+ summaryText: z.ZodOptional<z.ZodString>;
3068
3114
  }, z.core.$strip>;
3069
- type Turn$1 = z.infer<typeof TurnSchema$1>;
3070
- /**
3071
- * Message routing status for multi-agent delivery tracking.
3072
- */
3073
- declare const MessageRoutingStatusSchema: z.ZodEnum<{
3074
- completed: "completed";
3075
- sent: "sent";
3076
- acknowledged: "acknowledged";
3077
- }>;
3078
- type MessageRoutingStatus = z.infer<typeof MessageRoutingStatusSchema>;
3115
+ /** Inferred type for {@link SegmentPolicySchema}. */
3116
+ type SegmentPolicy = z.infer<typeof SegmentPolicySchema>;
3079
3117
  /**
3080
- * Tracks delivery status of a message to agents in multi-agent sessions.
3118
+ * Transform configuration for fork sessions.
3119
+ * Stored on session record and applied by getFullConversation().
3120
+ *
3121
+ * When `segments` is present, it takes precedence over `removedMessageIds`
3122
+ * and `appliedPipeline` — those fields are ignored at runtime.
3081
3123
  */
3082
- declare const MessageRoutingSchema$1: z.ZodObject<{
3083
- messageId: z.ZodString;
3084
- agentId: z.ZodString;
3085
- status: z.ZodEnum<{
3086
- completed: "completed";
3087
- sent: "sent";
3088
- acknowledged: "acknowledged";
3089
- }>;
3090
- timestamp: z.ZodNumber;
3091
- error: z.ZodOptional<z.ZodString>;
3124
+ declare const ForkTransformsSchema$1: z.ZodObject<{
3125
+ removedMessageIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
3126
+ appliedPipeline: z.ZodOptional<z.ZodArray<z.ZodObject<{
3127
+ actionId: z.ZodString;
3128
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3129
+ }, z.core.$strip>>>;
3130
+ segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
3131
+ fromMessageId: z.ZodString;
3132
+ toMessageId: z.ZodString;
3133
+ policy: z.ZodEnum<{
3134
+ verbatim: "verbatim";
3135
+ summarize: "summarize";
3136
+ exclude: "exclude";
3137
+ }>;
3138
+ stripReasoning: z.ZodOptional<z.ZodBoolean>;
3139
+ stripToolOutputs: z.ZodOptional<z.ZodBoolean>;
3140
+ overrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLiteral<"exclude">>>;
3141
+ summaryText: z.ZodOptional<z.ZodString>;
3142
+ }, z.core.$strip>>>;
3092
3143
  }, z.core.$strip>;
3093
- type MessageRouting = z.infer<typeof MessageRoutingSchema$1>;
3144
+ type ForkTransforms$1 = z.infer<typeof ForkTransformsSchema$1>;
3145
+ declare const SessionCreatedEventSchema: z.ZodObject<{
3146
+ sessionId: z.ZodString;
3147
+ parentSessionId: z.ZodNullable<z.ZodString>;
3148
+ branchKind: z.ZodNullable<z.ZodEnum<{
3149
+ fork: "fork";
3150
+ subagent: "subagent";
3151
+ compress: "compress";
3152
+ branch: "branch";
3153
+ rewrite: "rewrite";
3154
+ coordinator: "coordinator";
3155
+ aside: "aside";
3156
+ }>>;
3157
+ createdAt: z.ZodNumber;
3158
+ originWindowId: z.ZodOptional<z.ZodString>;
3159
+ }, z.core.$strip>;
3160
+ declare const SessionUpdatedEventSchema: z.ZodObject<{
3161
+ sessionId: z.ZodString;
3162
+ changedProperties: z.ZodArray<z.ZodString>;
3163
+ }, z.core.$strip>;
3164
+ type SessionCreated = z.infer<typeof SessionCreatedEventSchema>;
3165
+ type SessionUpdatedEvent = z.infer<typeof SessionUpdatedEventSchema>;
3094
3166
  //#endregion
3095
3167
  //#region core/contracts/src/session/schemas.d.ts
3096
3168
  /**
@@ -4129,6 +4201,30 @@ declare const SessionSchemas: {
4129
4201
  sourceId: _$zod.ZodOptional<_$zod.ZodString>;
4130
4202
  }, _$zod_v4_core0.$strip>>;
4131
4203
  }, _$zod_v4_core0.$strip>;
4204
+ 'turn.await': {
4205
+ request: _$zod.ZodObject<{
4206
+ sessionId: _$zod.ZodString;
4207
+ turnId: _$zod.ZodString;
4208
+ timeoutMs: _$zod.ZodNumber;
4209
+ }, _$zod_v4_core0.$strip>;
4210
+ response: _$zod.ZodObject<{
4211
+ completion: _$zod.ZodObject<{
4212
+ sessionId: _$zod.ZodString;
4213
+ turnId: _$zod.ZodString;
4214
+ turnNumber: _$zod.ZodNumber;
4215
+ success: _$zod.ZodBoolean;
4216
+ error: _$zod.ZodOptional<_$zod.ZodString>;
4217
+ initiator: _$zod.ZodOptional<_$zod.ZodObject<{
4218
+ source: _$zod.ZodEnum<{
4219
+ user: "user";
4220
+ system: "system";
4221
+ extension: "extension";
4222
+ }>;
4223
+ sourceId: _$zod.ZodOptional<_$zod.ZodString>;
4224
+ }, _$zod_v4_core0.$strip>>;
4225
+ }, _$zod_v4_core0.$strip>;
4226
+ }, _$zod_v4_core0.$strip>;
4227
+ };
4132
4228
  'user_message.sent': _$zod.ZodObject<{
4133
4229
  sessionId: _$zod.ZodString;
4134
4230
  turnId: _$zod.ZodString;
@@ -4299,8 +4395,8 @@ declare const SessionSchemas: {
4299
4395
  fromMessageId: _$zod.ZodOptional<_$zod.ZodString>;
4300
4396
  name: _$zod.ZodOptional<_$zod.ZodString>;
4301
4397
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
4302
- branch: "branch";
4303
4398
  fork: "fork";
4399
+ branch: "branch";
4304
4400
  aside: "aside";
4305
4401
  }>>;
4306
4402
  transforms: _$zod.ZodOptional<_$zod.ZodObject<{
@@ -4330,19 +4426,6 @@ declare const SessionSchemas: {
4330
4426
  sessionId: _$zod.ZodString;
4331
4427
  }, _$zod_v4_core0.$strip>;
4332
4428
  };
4333
- usage: {
4334
- request: _$zod.ZodObject<{
4335
- sessionId: _$zod.ZodString;
4336
- totalInputTokens: _$zod.ZodNumber;
4337
- totalOutputTokens: _$zod.ZodNumber;
4338
- totalTokens: _$zod.ZodNumber;
4339
- totalCalls: _$zod.ZodNumber;
4340
- adapterCount: _$zod.ZodNumber;
4341
- }, _$zod_v4_core0.$strip>;
4342
- response: _$zod.ZodObject<{
4343
- acknowledged: _$zod.ZodLiteral<true>;
4344
- }, _$zod_v4_core0.$strip>;
4345
- };
4346
4429
  merge: {
4347
4430
  request: _$zod.ZodObject<{
4348
4431
  parentSessionId: _$zod.ZodString;
@@ -4385,10 +4468,10 @@ declare const SessionSchemas: {
4385
4468
  title: _$zod.ZodNullable<_$zod.ZodString>;
4386
4469
  forkPointMessageId: _$zod.ZodNullable<_$zod.ZodString>;
4387
4470
  branchKind: _$zod.ZodNullable<_$zod.ZodEnum<{
4388
- branch: "branch";
4389
4471
  fork: "fork";
4390
4472
  subagent: "subagent";
4391
4473
  compress: "compress";
4474
+ branch: "branch";
4392
4475
  rewrite: "rewrite";
4393
4476
  coordinator: "coordinator";
4394
4477
  aside: "aside";
@@ -4442,10 +4525,10 @@ declare const SessionSchemas: {
4442
4525
  childSessionId: _$zod.ZodString;
4443
4526
  parentSessionId: _$zod.ZodString;
4444
4527
  kind: _$zod.ZodEnum<{
4445
- branch: "branch";
4446
4528
  fork: "fork";
4447
4529
  subagent: "subagent";
4448
4530
  compress: "compress";
4531
+ branch: "branch";
4449
4532
  rewrite: "rewrite";
4450
4533
  coordinator: "coordinator";
4451
4534
  aside: "aside";
@@ -4490,10 +4573,10 @@ declare const SessionSchemas: {
4490
4573
  sessionId: _$zod.ZodString;
4491
4574
  parentSessionId: _$zod.ZodNullable<_$zod.ZodString>;
4492
4575
  branchKind: _$zod.ZodNullable<_$zod.ZodEnum<{
4493
- branch: "branch";
4494
4576
  fork: "fork";
4495
4577
  subagent: "subagent";
4496
4578
  compress: "compress";
4579
+ branch: "branch";
4497
4580
  rewrite: "rewrite";
4498
4581
  coordinator: "coordinator";
4499
4582
  aside: "aside";
@@ -4552,6 +4635,7 @@ declare const SessionSchemas: {
4552
4635
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
4553
4636
  model: _$zod.ZodOptional<_$zod.ZodString>;
4554
4637
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
4638
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
4555
4639
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
4556
4640
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
4557
4641
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -4577,9 +4661,9 @@ declare const SessionSchemas: {
4577
4661
  }, _$zod_v4_core0.$strip>>;
4578
4662
  status: _$zod.ZodEnum<{
4579
4663
  closed: "closed";
4664
+ discovered: "discovered";
4580
4665
  active: "active";
4581
4666
  archived: "archived";
4582
- discovered: "discovered";
4583
4667
  }>;
4584
4668
  leadAgentId: _$zod.ZodOptional<_$zod.ZodString>;
4585
4669
  parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -4590,10 +4674,10 @@ declare const SessionSchemas: {
4590
4674
  rootSessionId: _$zod.ZodOptional<_$zod.ZodString>;
4591
4675
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
4592
4676
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
4593
- branch: "branch";
4594
4677
  fork: "fork";
4595
4678
  subagent: "subagent";
4596
4679
  compress: "compress";
4680
+ branch: "branch";
4597
4681
  rewrite: "rewrite";
4598
4682
  coordinator: "coordinator";
4599
4683
  aside: "aside";
@@ -4661,6 +4745,7 @@ declare const SessionSchemas: {
4661
4745
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
4662
4746
  model: _$zod.ZodOptional<_$zod.ZodString>;
4663
4747
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
4748
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
4664
4749
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
4665
4750
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
4666
4751
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -4786,6 +4871,14 @@ declare const SessionSchemas: {
4786
4871
  cost: _$zod.ZodOptional<_$zod.ZodNumber>;
4787
4872
  }, _$zod_v4_core0.$strip>>>;
4788
4873
  }, _$zod_v4_core0.$strip>>;
4874
+ initiator: _$zod.ZodOptional<_$zod.ZodObject<{
4875
+ source: _$zod.ZodEnum<{
4876
+ user: "user";
4877
+ system: "system";
4878
+ extension: "extension";
4879
+ }>;
4880
+ sourceId: _$zod.ZodOptional<_$zod.ZodString>;
4881
+ }, _$zod_v4_core0.$strip>>;
4789
4882
  }, _$zod_v4_core0.$strip>>;
4790
4883
  events: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodUnion<readonly [_$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
4791
4884
  sessionId: _$zod.ZodString;
@@ -5046,10 +5139,10 @@ declare const SessionSchemas: {
5046
5139
  childSessionId: _$zod.ZodString;
5047
5140
  parentSessionId: _$zod.ZodString;
5048
5141
  kind: _$zod.ZodEnum<{
5049
- branch: "branch";
5050
5142
  fork: "fork";
5051
5143
  subagent: "subagent";
5052
5144
  compress: "compress";
5145
+ branch: "branch";
5053
5146
  rewrite: "rewrite";
5054
5147
  coordinator: "coordinator";
5055
5148
  aside: "aside";
@@ -5111,6 +5204,7 @@ declare const SessionSchemas: {
5111
5204
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
5112
5205
  model: _$zod.ZodOptional<_$zod.ZodString>;
5113
5206
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
5207
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
5114
5208
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
5115
5209
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
5116
5210
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -5136,9 +5230,9 @@ declare const SessionSchemas: {
5136
5230
  }, _$zod_v4_core0.$strip>>;
5137
5231
  status: _$zod.ZodEnum<{
5138
5232
  closed: "closed";
5233
+ discovered: "discovered";
5139
5234
  active: "active";
5140
5235
  archived: "archived";
5141
- discovered: "discovered";
5142
5236
  }>;
5143
5237
  leadAgentId: _$zod.ZodOptional<_$zod.ZodString>;
5144
5238
  parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -5149,10 +5243,10 @@ declare const SessionSchemas: {
5149
5243
  rootSessionId: _$zod.ZodOptional<_$zod.ZodString>;
5150
5244
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
5151
5245
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
5152
- branch: "branch";
5153
5246
  fork: "fork";
5154
5247
  subagent: "subagent";
5155
5248
  compress: "compress";
5249
+ branch: "branch";
5156
5250
  rewrite: "rewrite";
5157
5251
  coordinator: "coordinator";
5158
5252
  aside: "aside";
@@ -5220,6 +5314,7 @@ declare const SessionSchemas: {
5220
5314
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
5221
5315
  model: _$zod.ZodOptional<_$zod.ZodString>;
5222
5316
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
5317
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
5223
5318
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
5224
5319
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
5225
5320
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -5345,6 +5440,14 @@ declare const SessionSchemas: {
5345
5440
  cost: _$zod.ZodOptional<_$zod.ZodNumber>;
5346
5441
  }, _$zod_v4_core0.$strip>>>;
5347
5442
  }, _$zod_v4_core0.$strip>>;
5443
+ initiator: _$zod.ZodOptional<_$zod.ZodObject<{
5444
+ source: _$zod.ZodEnum<{
5445
+ user: "user";
5446
+ system: "system";
5447
+ extension: "extension";
5448
+ }>;
5449
+ sourceId: _$zod.ZodOptional<_$zod.ZodString>;
5450
+ }, _$zod_v4_core0.$strip>>;
5348
5451
  }, _$zod_v4_core0.$strip>>;
5349
5452
  events: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodUnion<readonly [_$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
5350
5453
  sessionId: _$zod.ZodString;
@@ -5605,10 +5708,10 @@ declare const SessionSchemas: {
5605
5708
  childSessionId: _$zod.ZodString;
5606
5709
  parentSessionId: _$zod.ZodString;
5607
5710
  kind: _$zod.ZodEnum<{
5608
- branch: "branch";
5609
5711
  fork: "fork";
5610
5712
  subagent: "subagent";
5611
5713
  compress: "compress";
5714
+ branch: "branch";
5612
5715
  rewrite: "rewrite";
5613
5716
  coordinator: "coordinator";
5614
5717
  aside: "aside";
@@ -6016,10 +6119,10 @@ declare const SessionSchemas: {
6016
6119
  childSessionId: _$zod.ZodString;
6017
6120
  parentSessionId: _$zod.ZodString;
6018
6121
  kind: _$zod.ZodEnum<{
6019
- branch: "branch";
6020
6122
  fork: "fork";
6021
6123
  subagent: "subagent";
6022
6124
  compress: "compress";
6125
+ branch: "branch";
6023
6126
  rewrite: "rewrite";
6024
6127
  coordinator: "coordinator";
6025
6128
  aside: "aside";
@@ -6060,9 +6163,9 @@ declare const SessionSchemas: {
6060
6163
  status: _$zod.ZodOptional<_$zod.ZodEnum<{
6061
6164
  all: "all";
6062
6165
  closed: "closed";
6166
+ discovered: "discovered";
6063
6167
  active: "active";
6064
6168
  archived: "archived";
6065
- discovered: "discovered";
6066
6169
  }>>;
6067
6170
  limit: _$zod.ZodOptional<_$zod.ZodNumber>;
6068
6171
  offset: _$zod.ZodOptional<_$zod.ZodNumber>;
@@ -6082,6 +6185,7 @@ declare const SessionSchemas: {
6082
6185
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6083
6186
  model: _$zod.ZodOptional<_$zod.ZodString>;
6084
6187
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
6188
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
6085
6189
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
6086
6190
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
6087
6191
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6107,9 +6211,9 @@ declare const SessionSchemas: {
6107
6211
  }, _$zod_v4_core0.$strip>>;
6108
6212
  status: _$zod.ZodEnum<{
6109
6213
  closed: "closed";
6214
+ discovered: "discovered";
6110
6215
  active: "active";
6111
6216
  archived: "archived";
6112
- discovered: "discovered";
6113
6217
  }>;
6114
6218
  leadAgentId: _$zod.ZodOptional<_$zod.ZodString>;
6115
6219
  parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6120,10 +6224,10 @@ declare const SessionSchemas: {
6120
6224
  rootSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6121
6225
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
6122
6226
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
6123
- branch: "branch";
6124
6227
  fork: "fork";
6125
6228
  subagent: "subagent";
6126
6229
  compress: "compress";
6230
+ branch: "branch";
6127
6231
  rewrite: "rewrite";
6128
6232
  coordinator: "coordinator";
6129
6233
  aside: "aside";
@@ -6197,9 +6301,9 @@ declare const SessionSchemas: {
6197
6301
  status: _$zod.ZodOptional<_$zod.ZodEnum<{
6198
6302
  all: "all";
6199
6303
  closed: "closed";
6304
+ discovered: "discovered";
6200
6305
  active: "active";
6201
6306
  archived: "archived";
6202
- discovered: "discovered";
6203
6307
  }>>;
6204
6308
  isImported: _$zod.ZodOptional<_$zod.ZodBoolean>;
6205
6309
  }, _$zod_v4_core0.$strip>;
@@ -6216,6 +6320,7 @@ declare const SessionSchemas: {
6216
6320
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6217
6321
  model: _$zod.ZodOptional<_$zod.ZodString>;
6218
6322
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
6323
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
6219
6324
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
6220
6325
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
6221
6326
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6241,9 +6346,9 @@ declare const SessionSchemas: {
6241
6346
  }, _$zod_v4_core0.$strip>>;
6242
6347
  status: _$zod.ZodEnum<{
6243
6348
  closed: "closed";
6349
+ discovered: "discovered";
6244
6350
  active: "active";
6245
6351
  archived: "archived";
6246
- discovered: "discovered";
6247
6352
  }>;
6248
6353
  leadAgentId: _$zod.ZodOptional<_$zod.ZodString>;
6249
6354
  parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6254,10 +6359,10 @@ declare const SessionSchemas: {
6254
6359
  rootSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6255
6360
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
6256
6361
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
6257
- branch: "branch";
6258
6362
  fork: "fork";
6259
6363
  subagent: "subagent";
6260
6364
  compress: "compress";
6365
+ branch: "branch";
6261
6366
  rewrite: "rewrite";
6262
6367
  coordinator: "coordinator";
6263
6368
  aside: "aside";
@@ -6341,6 +6446,7 @@ declare const SessionSchemas: {
6341
6446
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6342
6447
  model: _$zod.ZodOptional<_$zod.ZodString>;
6343
6448
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
6449
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
6344
6450
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
6345
6451
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
6346
6452
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6366,9 +6472,9 @@ declare const SessionSchemas: {
6366
6472
  }, _$zod_v4_core0.$strip>>;
6367
6473
  status: _$zod.ZodEnum<{
6368
6474
  closed: "closed";
6475
+ discovered: "discovered";
6369
6476
  active: "active";
6370
6477
  archived: "archived";
6371
- discovered: "discovered";
6372
6478
  }>;
6373
6479
  leadAgentId: _$zod.ZodOptional<_$zod.ZodString>;
6374
6480
  parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6379,10 +6485,10 @@ declare const SessionSchemas: {
6379
6485
  rootSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6380
6486
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
6381
6487
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
6382
- branch: "branch";
6383
6488
  fork: "fork";
6384
6489
  subagent: "subagent";
6385
6490
  compress: "compress";
6491
+ branch: "branch";
6386
6492
  rewrite: "rewrite";
6387
6493
  coordinator: "coordinator";
6388
6494
  aside: "aside";
@@ -6454,10 +6560,10 @@ declare const SessionSchemas: {
6454
6560
  }>>;
6455
6561
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
6456
6562
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
6457
- branch: "branch";
6458
6563
  fork: "fork";
6459
6564
  subagent: "subagent";
6460
6565
  compress: "compress";
6566
+ branch: "branch";
6461
6567
  rewrite: "rewrite";
6462
6568
  coordinator: "coordinator";
6463
6569
  aside: "aside";
@@ -6508,6 +6614,24 @@ declare const SessionSchemas: {
6508
6614
  success: _$zod.ZodBoolean;
6509
6615
  }, _$zod_v4_core0.$strip>;
6510
6616
  };
6617
+ restartAgents: {
6618
+ request: _$zod.ZodObject<{
6619
+ sessionId: _$zod.ZodString;
6620
+ }, _$zod_v4_core0.$strip>;
6621
+ response: _$zod.ZodObject<{
6622
+ sessionId: _$zod.ZodString;
6623
+ results: _$zod.ZodArray<_$zod.ZodDiscriminatedUnion<[_$zod.ZodObject<{
6624
+ agentId: _$zod.ZodString;
6625
+ adapterId: _$zod.ZodString;
6626
+ success: _$zod.ZodLiteral<true>;
6627
+ }, _$zod_v4_core0.$strip>, _$zod.ZodObject<{
6628
+ agentId: _$zod.ZodString;
6629
+ adapterId: _$zod.ZodString;
6630
+ success: _$zod.ZodLiteral<false>;
6631
+ error: _$zod.ZodString;
6632
+ }, _$zod_v4_core0.$strip>], "success">>;
6633
+ }, _$zod_v4_core0.$strip>;
6634
+ };
6511
6635
  archive: {
6512
6636
  request: _$zod.ZodObject<{
6513
6637
  sessionId: _$zod.ZodString;
@@ -6558,6 +6682,7 @@ declare const SessionSchemas: {
6558
6682
  adapterSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6559
6683
  model: _$zod.ZodOptional<_$zod.ZodString>;
6560
6684
  cwd: _$zod.ZodOptional<_$zod.ZodString>;
6685
+ allowedDirectories: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
6561
6686
  providerConfigId: _$zod.ZodOptional<_$zod.ZodString>;
6562
6687
  personaId: _$zod.ZodOptional<_$zod.ZodString>;
6563
6688
  profileId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6583,9 +6708,9 @@ declare const SessionSchemas: {
6583
6708
  }, _$zod_v4_core0.$strip>>;
6584
6709
  status: _$zod.ZodEnum<{
6585
6710
  closed: "closed";
6711
+ discovered: "discovered";
6586
6712
  active: "active";
6587
6713
  archived: "archived";
6588
- discovered: "discovered";
6589
6714
  }>;
6590
6715
  leadAgentId: _$zod.ZodOptional<_$zod.ZodString>;
6591
6716
  parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
@@ -6596,10 +6721,10 @@ declare const SessionSchemas: {
6596
6721
  rootSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6597
6722
  forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
6598
6723
  branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
6599
- branch: "branch";
6600
6724
  fork: "fork";
6601
6725
  subagent: "subagent";
6602
6726
  compress: "compress";
6727
+ branch: "branch";
6603
6728
  rewrite: "rewrite";
6604
6729
  coordinator: "coordinator";
6605
6730
  aside: "aside";
@@ -6671,6 +6796,64 @@ declare const SessionSchemas: {
6671
6796
  discovered: _$zod.ZodNumber;
6672
6797
  }, _$zod_v4_core0.$strip>;
6673
6798
  };
6799
+ registerExternal: {
6800
+ request: _$zod.ZodObject<{
6801
+ sessionId: _$zod.ZodOptional<_$zod.ZodString>;
6802
+ parentSessionId: _$zod.ZodOptional<_$zod.ZodString>;
6803
+ contextInheritance: _$zod.ZodOptional<_$zod.ZodEnum<{
6804
+ none: "none";
6805
+ "parent-history": "parent-history";
6806
+ }>>;
6807
+ forkPointMessageId: _$zod.ZodOptional<_$zod.ZodString>;
6808
+ branchKind: _$zod.ZodOptional<_$zod.ZodEnum<{
6809
+ fork: "fork";
6810
+ subagent: "subagent";
6811
+ compress: "compress";
6812
+ branch: "branch";
6813
+ rewrite: "rewrite";
6814
+ coordinator: "coordinator";
6815
+ aside: "aside";
6816
+ }>>;
6817
+ forkTransforms: _$zod.ZodOptional<_$zod.ZodObject<{
6818
+ removedMessageIds: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodString>>;
6819
+ appliedPipeline: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
6820
+ actionId: _$zod.ZodString;
6821
+ options: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodUnknown>>;
6822
+ }, _$zod_v4_core0.$strip>>>;
6823
+ segments: _$zod.ZodOptional<_$zod.ZodArray<_$zod.ZodObject<{
6824
+ fromMessageId: _$zod.ZodString;
6825
+ toMessageId: _$zod.ZodString;
6826
+ policy: _$zod.ZodEnum<{
6827
+ verbatim: "verbatim";
6828
+ summarize: "summarize";
6829
+ exclude: "exclude";
6830
+ }>;
6831
+ stripReasoning: _$zod.ZodOptional<_$zod.ZodBoolean>;
6832
+ stripToolOutputs: _$zod.ZodOptional<_$zod.ZodBoolean>;
6833
+ overrides: _$zod.ZodOptional<_$zod.ZodRecord<_$zod.ZodString, _$zod.ZodLiteral<"exclude">>>;
6834
+ summaryText: _$zod.ZodOptional<_$zod.ZodString>;
6835
+ }, _$zod_v4_core0.$strip>>>;
6836
+ }, _$zod_v4_core0.$strip>>;
6837
+ title: _$zod.ZodOptional<_$zod.ZodString>;
6838
+ targetWorkingDirectory: _$zod.ZodOptional<_$zod.ZodString>;
6839
+ executionTargetId: _$zod.ZodOptional<_$zod.ZodString>;
6840
+ spawningToolCallId: _$zod.ZodOptional<_$zod.ZodString>;
6841
+ originWindowId: _$zod.ZodOptional<_$zod.ZodString>;
6842
+ adapterName: _$zod.ZodString;
6843
+ adapterSessionId: _$zod.ZodString;
6844
+ lastClientIdentityObservation: _$zod.ZodOptional<_$zod.ZodObject<{
6845
+ clientId: _$zod.ZodString;
6846
+ source: _$zod.ZodString;
6847
+ kind: _$zod.ZodString;
6848
+ observedAt: _$zod.ZodNumber;
6849
+ payload: _$zod.ZodType<Record<string, unknown>, Record<string, unknown>, _$zod_v4_core0.$ZodTypeInternals<Record<string, unknown>, Record<string, unknown>>>;
6850
+ }, _$zod_v4_core0.$strip>>;
6851
+ }, _$zod_v4_core0.$strip>;
6852
+ response: _$zod.ZodObject<{
6853
+ sessionId: _$zod.ZodString;
6854
+ created: _$zod.ZodBoolean;
6855
+ }, _$zod_v4_core0.$strip>;
6856
+ };
6674
6857
  };
6675
6858
  //#endregion
6676
6859
  //#region core/contracts/src/session/types.d.ts
@@ -6774,4 +6957,4 @@ type KnownSessionEvent = { [K in RuntimeKnownSessionEventType]: SessionEventBase
6774
6957
  */
6775
6958
  declare function isKnownSessionEvent(event: MakaioSessionEvent$1): event is KnownSessionEvent;
6776
6959
  //#endregion
6777
- export { BranchKind$1 as $, ForkTransformsSchema$1 as A, SESSION_EVENT_TYPES as B, TurnStatus as C, UsageMetrics as D, TurnUsageSchema$1 as E, SessionUpdatedEvent as F, SendMessageRequest as G, SessionEventType as H, SessionUpdatedEventSchema as I, SessionUsageResponse as J, SendMessageResponse as K, ForkChildInfo as L, SegmentPolicySchema as M, SessionCreated as N, UsageMetricsSchema as O, SessionCreatedEventSchema as P, AgentRoleSchema as Q, ForkChildInfoSchema as R, TurnSchema$1 as S, TurnUsage as T, SessionEventTypeMap as U, SessionEventPayload as V, SessionEventTypeSchema as W, TurnInitiatorSchema as X, TurnInitiator$1 as Y, AgentRole as Z, SessionMessageOriginSchema as _, MakaioSessionAgentSchema$1 as _t, SessionPreviewData as a, SessionSnapshotSchema as at, SessionMessageSchema$1 as b, SessionSchemas as c, SnapshotImportConflictErrorData as ct, MessageRoutingStatus as d, validateSnapshot as dt, BranchKindSchema as et, MessageRoutingStatusSchema as f, MakaioSessionSchema as ft, SessionMessageOrigin as g, AgentStatusSchema$1 as gt, SessionMessageBlockSchema as h, AgentStatus as ht, MakaioSessionEvent$1 as i, SessionSnapshot as it, SegmentPolicy as j, ForkTransforms$1 as k, MessageRouting as l, SnapshotPreviewData as lt, SessionMessageBlock$1 as m, SessionWithPreviewSchema as mt, KnownSessionEvent as n, ImportStatusSchema as nt, SessionWithPreview as o, SnapshotExportOptions as ot, SessionMessage$1 as p, SessionPreviewDataSchema as pt, SessionUsagePayload as q, MakaioSessionAgent$1 as r, SNAPSHOT_VERSION as rt, isKnownSessionEvent as s, SnapshotExportOptionsSchema as st, IMakaioSession$1 as t, ImportStatus as tt, MessageRoutingSchema$1 as u, safeValidateSnapshot as ut, SessionMessageRole as v, TurnStatusSchema$1 as w, Turn$1 as x, SessionMessageRoleSchema as y, MakaioSessionEventSchema as z };
6960
+ export { ImportStatus as $, MessageRoutingStatusSchema as A, TurnInitiator$2 as B, SessionEventTypeMap as C, MessageRouting as D, SendMessageResponse as E, SessionMessageOriginSchema as F, TurnUsage as G, TurnSchema$1 as H, SessionMessageRole as I, UsageMetricsSchema as J, TurnUsageSchema$1 as K, SessionMessageRoleSchema as L, SessionMessageBlock$1 as M, SessionMessageBlockSchema as N, MessageRoutingSchema$1 as O, SessionMessageOrigin as P, BranchKindSchema as Q, SessionMessageSchema$1 as R, SessionEventType as S, SendMessageRequest as T, TurnStatus as U, TurnInitiatorSchema$1 as V, TurnStatusSchema$1 as W, AgentRoleSchema as X, AgentRole as Y, BranchKind$1 as Z, ForkChildInfo as _, SessionCreateBaseSchema as _t, SessionPreviewData as a, SnapshotExportOptionsSchema as at, SESSION_EVENT_TYPES as b, SessionSchemas as c, safeValidateSnapshot as ct, SegmentPolicy as d, SessionPreviewDataSchema as dt, ImportStatusSchema as et, SegmentPolicySchema as f, SessionWithPreviewSchema as ft, SessionUpdatedEventSchema as g, SessionCreateBase as gt, SessionUpdatedEvent as h, MakaioSessionAgentSchema$1 as ht, MakaioSessionEvent$1 as i, SnapshotExportOptions as it, SessionMessage$1 as j, MessageRoutingStatus as k, ForkTransforms$1 as l, validateSnapshot as lt, SessionCreatedEventSchema as m, AgentStatusSchema$1 as mt, KnownSessionEvent as n, SessionSnapshot as nt, SessionWithPreview as o, SnapshotImportConflictErrorData as ot, SessionCreated as p, AgentStatus as pt, UsageMetrics as q, MakaioSessionAgent$1 as r, SessionSnapshotSchema as rt, isKnownSessionEvent as s, SnapshotPreviewData as st, IMakaioSession$1 as t, SNAPSHOT_VERSION as tt, ForkTransformsSchema$1 as u, MakaioSessionSchema as ut, ForkChildInfoSchema as v, SessionEventTypeSchema as w, SessionEventPayload as x, MakaioSessionEventSchema as y, Turn$1 as z };