@moxt-ai/mobius-sdk 0.0.106 → 0.0.108

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 (167) hide show
  1. package/dist/conversation-title.d.ts +8 -0
  2. package/dist/conversation-title.d.ts.map +1 -0
  3. package/dist/{protocol/conversation-title.js → conversation-title.js} +6 -0
  4. package/dist/conversation-title.js.map +1 -0
  5. package/dist/index.d.ts +2 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/protocol/index.d.ts +28 -17
  10. package/dist/protocol/index.d.ts.map +1 -1
  11. package/dist/protocol/index.js +35 -17
  12. package/dist/protocol/index.js.map +1 -1
  13. package/dist/protocol/platform/mobius-api.d.ts.map +1 -0
  14. package/dist/protocol/platform/mobius-api.js.map +1 -0
  15. package/dist/protocol/platform/project-location.d.ts.map +1 -0
  16. package/dist/protocol/platform/project-location.js.map +1 -0
  17. package/dist/protocol/{runtime-diagnostics.d.ts → runtime/diagnostics.d.ts} +1 -1
  18. package/dist/protocol/runtime/diagnostics.d.ts.map +1 -0
  19. package/dist/protocol/{runtime-diagnostics.js → runtime/diagnostics.js} +2 -2
  20. package/dist/protocol/runtime/diagnostics.js.map +1 -0
  21. package/dist/protocol/runtime/liveness.d.ts +43 -0
  22. package/dist/protocol/runtime/liveness.d.ts.map +1 -0
  23. package/dist/protocol/runtime/liveness.js +66 -0
  24. package/dist/protocol/runtime/liveness.js.map +1 -0
  25. package/dist/protocol/{runtime-upgrade.d.ts → runtime/upgrade.d.ts} +1 -1
  26. package/dist/protocol/runtime/upgrade.d.ts.map +1 -0
  27. package/dist/protocol/{runtime-upgrade.js → runtime/upgrade.js} +2 -2
  28. package/dist/protocol/runtime/upgrade.js.map +1 -0
  29. package/dist/protocol/{session-access.d.ts → session/access/index.d.ts} +1 -1
  30. package/dist/protocol/session/access/index.d.ts.map +1 -0
  31. package/dist/protocol/{session-access.js → session/access/index.js} +3 -3
  32. package/dist/protocol/session/access/index.js.map +1 -0
  33. package/dist/protocol/session/agent/directory.d.ts +3 -0
  34. package/dist/protocol/session/agent/directory.d.ts.map +1 -0
  35. package/dist/protocol/session/agent/directory.js +3 -0
  36. package/dist/protocol/session/agent/directory.js.map +1 -0
  37. package/dist/protocol/session/agent/settings.d.ts +112 -0
  38. package/dist/protocol/session/agent/settings.d.ts.map +1 -0
  39. package/dist/protocol/session/agent/settings.js +72 -0
  40. package/dist/protocol/session/agent/settings.js.map +1 -0
  41. package/dist/protocol/session/configuration/index.d.ts +138 -0
  42. package/dist/protocol/session/configuration/index.d.ts.map +1 -0
  43. package/dist/protocol/session/configuration/index.js +120 -0
  44. package/dist/protocol/session/configuration/index.js.map +1 -0
  45. package/dist/protocol/session/configuration/title.d.ts +24 -0
  46. package/dist/protocol/session/configuration/title.d.ts.map +1 -0
  47. package/dist/protocol/session/configuration/title.js +27 -0
  48. package/dist/protocol/session/configuration/title.js.map +1 -0
  49. package/dist/protocol/session/files/index.d.ts +58 -0
  50. package/dist/protocol/session/files/index.d.ts.map +1 -0
  51. package/dist/protocol/session/files/index.js +72 -0
  52. package/dist/protocol/session/files/index.js.map +1 -0
  53. package/dist/protocol/session/interactions/index.d.ts +178 -0
  54. package/dist/protocol/session/interactions/index.d.ts.map +1 -0
  55. package/dist/protocol/session/interactions/index.js +118 -0
  56. package/dist/protocol/session/interactions/index.js.map +1 -0
  57. package/dist/protocol/{resource-model.d.ts → session/interactions/model.d.ts} +1 -137
  58. package/dist/protocol/session/interactions/model.d.ts.map +1 -0
  59. package/dist/protocol/session/interactions/model.js +87 -0
  60. package/dist/protocol/session/interactions/model.js.map +1 -0
  61. package/dist/protocol/session/lifecycle/index.d.ts +346 -0
  62. package/dist/protocol/session/lifecycle/index.d.ts.map +1 -0
  63. package/dist/protocol/session/lifecycle/index.js +206 -0
  64. package/dist/protocol/session/lifecycle/index.js.map +1 -0
  65. package/dist/protocol/{native-sessions.d.ts → session/native/index.d.ts} +1 -1
  66. package/dist/protocol/session/native/index.d.ts.map +1 -0
  67. package/dist/protocol/{native-sessions.js → session/native/index.js} +7 -4
  68. package/dist/protocol/session/native/index.js.map +1 -0
  69. package/dist/protocol/{session-event-log.d.ts → session/observability/event-log.d.ts} +1 -1
  70. package/dist/protocol/{session-event-log.d.ts.map → session/observability/event-log.d.ts.map} +1 -1
  71. package/dist/protocol/{session-event-log.js → session/observability/event-log.js} +4 -4
  72. package/dist/protocol/session/observability/event-log.js.map +1 -0
  73. package/dist/protocol/{session-history.d.ts → session/observability/history.d.ts} +3 -3
  74. package/dist/protocol/{session-history.d.ts.map → session/observability/history.d.ts.map} +1 -1
  75. package/dist/protocol/{session-history.js → session/observability/history.js} +4 -4
  76. package/dist/protocol/session/observability/history.js.map +1 -0
  77. package/dist/protocol/session/prompt/commands.d.ts +64 -0
  78. package/dist/protocol/session/prompt/commands.d.ts.map +1 -0
  79. package/dist/protocol/session/prompt/commands.js +121 -0
  80. package/dist/protocol/session/prompt/commands.js.map +1 -0
  81. package/dist/protocol/{prompt-usage.d.ts → session/prompt/usage.d.ts} +1 -1
  82. package/dist/protocol/session/prompt/usage.d.ts.map +1 -0
  83. package/dist/protocol/{prompt-usage.js → session/prompt/usage.js} +2 -2
  84. package/dist/protocol/session/prompt/usage.js.map +1 -0
  85. package/dist/protocol/{session-recording.d.ts → session/recording/recording.d.ts} +5 -1674
  86. package/dist/protocol/session/recording/recording.d.ts.map +1 -0
  87. package/dist/protocol/session/recording/recording.js +65 -0
  88. package/dist/protocol/session/recording/recording.js.map +1 -0
  89. package/dist/protocol/session/recording/turn-history.d.ts +1615 -0
  90. package/dist/protocol/session/recording/turn-history.d.ts.map +1 -0
  91. package/dist/protocol/{session-recording.js → session/recording/turn-history.js} +6 -111
  92. package/dist/protocol/session/recording/turn-history.js.map +1 -0
  93. package/dist/protocol/session/recording/webhooks.d.ts +60 -0
  94. package/dist/protocol/session/recording/webhooks.d.ts.map +1 -0
  95. package/dist/protocol/session/recording/webhooks.js +62 -0
  96. package/dist/protocol/session/recording/webhooks.js.map +1 -0
  97. package/dist/protocol/session/shared/index.d.ts +54 -0
  98. package/dist/protocol/session/shared/index.d.ts.map +1 -0
  99. package/dist/protocol/session/shared/index.js +65 -0
  100. package/dist/protocol/session/shared/index.js.map +1 -0
  101. package/dist/protocol/session/turn/index.d.ts +138 -0
  102. package/dist/protocol/session/turn/index.d.ts.map +1 -0
  103. package/dist/protocol/{resource-model.js → session/turn/index.js} +4 -77
  104. package/dist/protocol/session/turn/index.js.map +1 -0
  105. package/dist/protocol/session/workspace/index.d.ts +30 -0
  106. package/dist/protocol/session/workspace/index.d.ts.map +1 -0
  107. package/dist/protocol/session/workspace/index.js +31 -0
  108. package/dist/protocol/session/workspace/index.js.map +1 -0
  109. package/dist/protocol/shared/identifier.d.ts.map +1 -0
  110. package/dist/protocol/shared/identifier.js.map +1 -0
  111. package/dist/protocol/shared/message-codec.d.ts +24 -0
  112. package/dist/protocol/shared/message-codec.d.ts.map +1 -0
  113. package/dist/protocol/shared/message-codec.js +120 -0
  114. package/dist/protocol/shared/message-codec.js.map +1 -0
  115. package/dist/protocol/{daemon-transport.d.ts → transport/daemon-transport.d.ts} +11 -11
  116. package/dist/protocol/{daemon-transport.d.ts.map → transport/daemon-transport.d.ts.map} +1 -1
  117. package/dist/protocol/{daemon-transport.js → transport/daemon-transport.js} +15 -8
  118. package/dist/protocol/transport/daemon-transport.js.map +1 -0
  119. package/dist/service-client.d.ts +10 -1
  120. package/dist/service-client.d.ts.map +1 -1
  121. package/dist/service-client.js +18 -2
  122. package/dist/service-client.js.map +1 -1
  123. package/package.json +1 -1
  124. package/dist/protocol/codecs/messages.d.ts +0 -32
  125. package/dist/protocol/codecs/messages.d.ts.map +0 -1
  126. package/dist/protocol/codecs/messages.js +0 -249
  127. package/dist/protocol/codecs/messages.js.map +0 -1
  128. package/dist/protocol/control-messages.d.ts +0 -909
  129. package/dist/protocol/control-messages.d.ts.map +0 -1
  130. package/dist/protocol/control-messages.js +0 -724
  131. package/dist/protocol/control-messages.js.map +0 -1
  132. package/dist/protocol/conversation-title.d.ts +0 -2
  133. package/dist/protocol/conversation-title.d.ts.map +0 -1
  134. package/dist/protocol/conversation-title.js.map +0 -1
  135. package/dist/protocol/daemon-transport.js.map +0 -1
  136. package/dist/protocol/identifier.d.ts.map +0 -1
  137. package/dist/protocol/identifier.js.map +0 -1
  138. package/dist/protocol/messages.d.ts +0 -67
  139. package/dist/protocol/messages.d.ts.map +0 -1
  140. package/dist/protocol/messages.js +0 -16
  141. package/dist/protocol/messages.js.map +0 -1
  142. package/dist/protocol/mobius-api.d.ts.map +0 -1
  143. package/dist/protocol/mobius-api.js.map +0 -1
  144. package/dist/protocol/native-sessions.d.ts.map +0 -1
  145. package/dist/protocol/native-sessions.js.map +0 -1
  146. package/dist/protocol/project-location.d.ts.map +0 -1
  147. package/dist/protocol/project-location.js.map +0 -1
  148. package/dist/protocol/prompt-usage.d.ts.map +0 -1
  149. package/dist/protocol/prompt-usage.js.map +0 -1
  150. package/dist/protocol/resource-model.d.ts.map +0 -1
  151. package/dist/protocol/resource-model.js.map +0 -1
  152. package/dist/protocol/runtime-diagnostics.d.ts.map +0 -1
  153. package/dist/protocol/runtime-diagnostics.js.map +0 -1
  154. package/dist/protocol/runtime-upgrade.d.ts.map +0 -1
  155. package/dist/protocol/runtime-upgrade.js.map +0 -1
  156. package/dist/protocol/session-access.d.ts.map +0 -1
  157. package/dist/protocol/session-access.js.map +0 -1
  158. package/dist/protocol/session-event-log.js.map +0 -1
  159. package/dist/protocol/session-history.js.map +0 -1
  160. package/dist/protocol/session-recording.d.ts.map +0 -1
  161. package/dist/protocol/session-recording.js.map +0 -1
  162. /package/dist/protocol/{mobius-api.d.ts → platform/mobius-api.d.ts} +0 -0
  163. /package/dist/protocol/{mobius-api.js → platform/mobius-api.js} +0 -0
  164. /package/dist/protocol/{project-location.d.ts → platform/project-location.d.ts} +0 -0
  165. /package/dist/protocol/{project-location.js → platform/project-location.js} +0 -0
  166. /package/dist/protocol/{identifier.d.ts → shared/identifier.d.ts} +0 -0
  167. /package/dist/protocol/{identifier.js → shared/identifier.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-history.d.ts","sourceRoot":"","sources":["../../../../src/protocol/session/recording/turn-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,MAAM,CAAC;AACzD;;;GAGG;AACH,eAAO,MAAM,0CAA0C,OAAQ,CAAC;AAChE;;;;;;;;GAQG;AACH,eAAO,MAAM,+CAA+C,QAAS,CAAC;AACtE,oCAAoC;AACpC,eAAO,MAAM,yCAAyC,OAAQ,CAAC;AAO/D,mGAAmG;AACnG,eAAO,MAAM,+BAA+B,UAAW,MAAM,KAAG,MAAM,GAAG,IACvB,CAAC;AAEnD,mGAAmG;AACnG,MAAM,MAAM,uCAAuC,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,UACrC,MAAM,KACd;IAAE,QAAQ,CAAC,SAAS,EAAE,uCAAuC,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAS/F,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,8BAA8B,cAC5B,uCAAuC,YACxC,MAAM,KACjB,MAAyC,CAAC;AAE7C,8EAA8E;AAC9E,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM5F;AA2BD,+FAA+F;AAC/F,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAsB5C,CAAC;AA4BH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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5F,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAWlG,eAAO,MAAM,8BAA8B,YAAa,MAAM,KAAG,wBACd,CAAC;AAEpD,eAAO,MAAM,8BAA8B,UAAW,wBAAwB,KAAG,MAClB,CAAC;AAEhE,eAAO,MAAM,kCAAkC,YAAa,MAAM,KAAG,4BACd,CAAC;AAExD,eAAO,MAAM,kCAAkC,UAAW,4BAA4B,KAAG,MACtB,CAAC;AAEpE,eAAO,MAAM,oCAAoC,YAAa,MAAM,KAAG,8BACd,CAAC;AAE1D,eAAO,MAAM,oCAAoC,UAAW,8BAA8B,KAAG,MACxB,CAAC"}
@@ -1,60 +1,9 @@
1
1
  import { z } from "zod";
2
- import { ProtocolMessageError } from "./codecs/messages.js";
3
- import { sessionElicitationRequestedEventSchema, sessionPermissionRequestedEventSchema } from "./control-messages.js";
4
- import { identifierStringSchema } from "./identifier.js";
5
- import { boundedJsonSchema, contentBlockSchema, sessionEventEnvelopeSchema, sessionLiveEventSchema, toolCallContentSchema, toolCallLocationSchema, toolKindSchema, toolStatusSchema, } from "./session-event-log.js";
6
- const sessionRecordingWriteSchema = z
7
- .object({
8
- envelope: sessionEventEnvelopeSchema,
9
- projectId: identifierStringSchema,
10
- runtimeId: identifierStringSchema,
11
- })
12
- .readonly();
13
- // Full history is serialized straight from storage rather than through encodeSessionRecordingHistory,
14
- // so an event cap here never bounded what a Durable Object emitted. It only rejected the reader after
15
- // the payload was already parsed, turning a long Session into a hard failure. Bounded reads use pages.
16
- const sessionRecordingHistorySchema = z
17
- .object({
18
- events: z.array(sessionLiveEventSchema).readonly(),
19
- sessionId: identifierStringSchema,
20
- })
21
- .readonly();
22
- export const sessionRecordingStatusSchema = z.enum(["running", "idle", "failed"]);
23
- // Recording cursors are opaque append-order tokens. The ordinal locates a recorded batch and the
24
- // position locates an event inside that batch; event positions alone restart after a Session reload.
25
- const recordingCursorSchema = z.string().regex(/^v2:[1-9][0-9]*:(?:0|[1-9][0-9]*)$/);
26
- const sessionRecordingHistoryPageSchema = z
27
- .object({
28
- events: z.array(sessionLiveEventSchema).max(10_000).readonly(),
29
- // The append-order cursor after this page, or null when the caller has caught up.
30
- nextCursor: recordingCursorSchema.nullable(),
31
- // The append-order cursor at the newest recorded event, so an idle poller can compare one token.
32
- tailCursor: recordingCursorSchema,
33
- // True when a Session generation changed after the caller's cursor and it must replace its
34
- // reconstructed state rather than append this page.
35
- generationReset: z.boolean(),
36
- sessionId: identifierStringSchema,
37
- truncated: z.boolean(),
38
- version: z.literal(2),
39
- })
40
- .readonly();
41
- const sessionRecordingSummarySchema = z
42
- .object({
43
- additionalDirectoryIds: z.array(identifierStringSchema).max(16).readonly(),
44
- agentId: identifierStringSchema,
45
- directoryId: z.string().min(1).max(2_048),
46
- runtimeId: identifierStringSchema,
47
- sessionId: identifierStringSchema,
48
- status: sessionRecordingStatusSchema,
49
- title: z.string().max(1_000),
50
- updatedAt: z.iso.datetime({ offset: true }),
51
- })
52
- .readonly();
53
- const sessionRecordingDirectorySchema = z
54
- .object({
55
- sessions: z.array(sessionRecordingSummarySchema).max(100_000).readonly(),
56
- })
57
- .readonly();
2
+ import { identifierStringSchema } from "../../shared/identifier.js";
3
+ import { ProtocolMessageError } from "../../shared/message-codec.js";
4
+ import { sessionElicitationRequestedEventSchema, sessionPermissionRequestedEventSchema, } from "../interactions/index.js";
5
+ import { boundedJsonSchema, contentBlockSchema, toolCallContentSchema, toolCallLocationSchema, toolKindSchema, toolStatusSchema, } from "../observability/event-log.js";
6
+ import { recordingCursorSchema } from "./recording.js";
58
7
  /**
59
8
  * Turns a caller may request from a Turn history page at most. This bounds the request only: a
60
9
  * service counts a page against it, and a page also stays inside a serialized-character budget, so
@@ -131,50 +80,6 @@ const promptFailedOutcome = {
131
80
  failedAt: isoTimestamp,
132
81
  message: z.string().min(1).max(500),
133
82
  };
134
- /**
135
- * The terminal outcome of one command, keyed by the `commandId` the Recording already uses for the
136
- * Turn. A Session status notification reports these per command because the delivery that carries it
137
- * only observes the commands that ended in it; a session-wide "nothing is running" claim cannot be
138
- * derived from one delivery.
139
- */
140
- export const sessionStatusWebhookCommandSchema = z.discriminatedUnion("outcome", [
141
- z
142
- .object({
143
- ...promptSucceededOutcome,
144
- commandId: identifierStringSchema,
145
- outcome: z.literal("succeeded"),
146
- })
147
- .readonly(),
148
- z
149
- .object({
150
- ...promptCancelledOutcome,
151
- commandId: identifierStringSchema,
152
- outcome: z.literal("cancelled"),
153
- })
154
- .readonly(),
155
- z
156
- .object({
157
- ...promptFailedOutcome,
158
- commandId: identifierStringSchema,
159
- outcome: z.literal("failed"),
160
- })
161
- .readonly(),
162
- ]);
163
- /**
164
- * One App Session status notification. `commands` names exactly the commands this delivery observed
165
- * ending, so a consumer resolves those Turns and no others. `status` is the trailing state of the
166
- * same delivery and is retained for consumers that have not adopted `commands`.
167
- */
168
- export const sessionStatusWebhookBodySchema = z
169
- .object({
170
- appId: identifierStringSchema,
171
- commands: z.array(sessionStatusWebhookCommandSchema).min(1).readonly(),
172
- projectId: identifierStringSchema,
173
- runtimeId: identifierStringSchema,
174
- sessionId: identifierStringSchema,
175
- status: sessionRecordingStatusSchema,
176
- })
177
- .readonly();
178
83
  /** Where a Turn's prompt is in its lifecycle, as projected from Recording lifecycle events. */
179
84
  export const sessionRecordingTurnAttemptSchema = z.discriminatedUnion("kind", [
180
85
  z.object({ kind: z.literal("none") }).readonly(),
@@ -346,20 +251,10 @@ function decode(encoded, schema) {
346
251
  throw new ProtocolMessageError("Invalid Session Recording message", { cause });
347
252
  }
348
253
  }
349
- export const decodeSessionRecordingWrite = (encoded) => decode(encoded, sessionRecordingWriteSchema);
350
- export const encodeSessionRecordingWrite = (value) => JSON.stringify(sessionRecordingWriteSchema.parse(value));
351
- export const decodeSessionStatusWebhookBody = (encoded) => decode(encoded, sessionStatusWebhookBodySchema);
352
- export const encodeSessionStatusWebhookBody = (value) => JSON.stringify(sessionStatusWebhookBodySchema.parse(value));
353
- export const decodeSessionRecordingHistory = (encoded) => decode(encoded, sessionRecordingHistorySchema);
354
- export const encodeSessionRecordingHistory = (value) => JSON.stringify(sessionRecordingHistorySchema.parse(value));
355
- export const decodeSessionRecordingHistoryPage = (encoded) => decode(encoded, sessionRecordingHistoryPageSchema);
356
- export const encodeSessionRecordingHistoryPage = (value) => JSON.stringify(sessionRecordingHistoryPageSchema.parse(value));
357
- export const decodeSessionRecordingDirectory = (encoded) => decode(encoded, sessionRecordingDirectorySchema);
358
- export const encodeSessionRecordingDirectory = (value) => JSON.stringify(sessionRecordingDirectorySchema.parse(value));
359
254
  export const decodeSessionRecordingTurnPage = (encoded) => decode(encoded, sessionRecordingTurnPageSchema);
360
255
  export const encodeSessionRecordingTurnPage = (value) => JSON.stringify(sessionRecordingTurnPageSchema.parse(value));
361
256
  export const decodeSessionRecordingTurnItemPage = (encoded) => decode(encoded, sessionRecordingTurnItemPageSchema);
362
257
  export const encodeSessionRecordingTurnItemPage = (value) => JSON.stringify(sessionRecordingTurnItemPageSchema.parse(value));
363
258
  export const decodeSessionRecordingTurnItemDetail = (encoded) => decode(encoded, sessionRecordingTurnItemDetailSchema);
364
259
  export const encodeSessionRecordingTurnItemDetail = (value) => JSON.stringify(sessionRecordingTurnItemDetailSchema.parse(value));
365
- //# sourceMappingURL=session-recording.js.map
260
+ //# sourceMappingURL=turn-history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"turn-history.js","sourceRoot":"","sources":["../../../../src/protocol/session/recording/turn-history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OA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AA4B,EAAE,CACxF,MAAM,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAA+B,EAAU,EAAE,CACtF,IAAI,CAAC,SAAS,CAAC,8BAA8B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAEhE,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,OAAe,EAAgC,EAAE,CAChG,MAAM,CAAC,OAAO,EAAE,kCAAkC,CAAC,CAAC;AAExD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,KAAmC,EAAU,EAAE,CAC9F,IAAI,CAAC,SAAS,CAAC,kCAAkC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAEpE,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,OAAe,EAAkC,EAAE,CACpG,MAAM,CAAC,OAAO,EAAE,oCAAoC,CAAC,CAAC;AAE1D,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,KAAqC,EAAU,EAAE,CAClG,IAAI,CAAC,SAAS,CAAC,oCAAoC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The terminal outcome of one command, keyed by the `commandId` the Recording already uses for the
4
+ * Turn. A Session status notification reports these per command because the delivery that carries it
5
+ * only observes the commands that ended in it; a session-wide "nothing is running" claim cannot be
6
+ * derived from one delivery.
7
+ */
8
+ export declare const sessionStatusWebhookCommandSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
9
+ completedAt: z.ZodISODateTime;
10
+ stopReason: z.ZodString;
11
+ commandId: z.ZodString;
12
+ outcome: z.ZodLiteral<"succeeded">;
13
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
14
+ cancelledAt: z.ZodISODateTime;
15
+ commandId: z.ZodString;
16
+ outcome: z.ZodLiteral<"cancelled">;
17
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
18
+ code: z.ZodString;
19
+ failedAt: z.ZodISODateTime;
20
+ message: z.ZodString;
21
+ commandId: z.ZodString;
22
+ outcome: z.ZodLiteral<"failed">;
23
+ }, z.core.$strip>>], "outcome">;
24
+ export type SessionStatusWebhookCommand = z.infer<typeof sessionStatusWebhookCommandSchema>;
25
+ /**
26
+ * One App Session status notification. `commands` names exactly the commands this delivery observed
27
+ * ending, so a consumer resolves those Turns and no others. `status` is the trailing state of the
28
+ * same delivery and is retained for consumers that have not adopted `commands`.
29
+ */
30
+ export declare const sessionStatusWebhookBodySchema: z.ZodReadonly<z.ZodObject<{
31
+ appId: z.ZodString;
32
+ commands: z.ZodReadonly<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
33
+ completedAt: z.ZodISODateTime;
34
+ stopReason: z.ZodString;
35
+ commandId: z.ZodString;
36
+ outcome: z.ZodLiteral<"succeeded">;
37
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
38
+ cancelledAt: z.ZodISODateTime;
39
+ commandId: z.ZodString;
40
+ outcome: z.ZodLiteral<"cancelled">;
41
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
42
+ code: z.ZodString;
43
+ failedAt: z.ZodISODateTime;
44
+ message: z.ZodString;
45
+ commandId: z.ZodString;
46
+ outcome: z.ZodLiteral<"failed">;
47
+ }, z.core.$strip>>], "outcome">>>;
48
+ projectId: z.ZodString;
49
+ runtimeId: z.ZodString;
50
+ sessionId: z.ZodString;
51
+ status: z.ZodEnum<{
52
+ failed: "failed";
53
+ idle: "idle";
54
+ running: "running";
55
+ }>;
56
+ }, z.core.$strip>>;
57
+ export type SessionStatusWebhookBody = z.infer<typeof sessionStatusWebhookBodySchema>;
58
+ export declare const decodeSessionStatusWebhookBody: (encoded: string) => SessionStatusWebhookBody;
59
+ export declare const encodeSessionStatusWebhookBody: (value: SessionStatusWebhookBody) => string;
60
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../../src/protocol/session/recording/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;+BAsB5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;kBAS5B,CAAC;AAChB,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,8BAA8B,YAAa,MAAM,KAAG,wBACd,CAAC;AAEpD,eAAO,MAAM,8BAA8B,UAAW,wBAAwB,KAAG,MAChC,CAAC"}
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ import { identifierStringSchema } from "../../shared/identifier.js";
3
+ import { decodeZodMessage as decode, encodeZodMessage as encode } from "../../shared/message-codec.js";
4
+ import { sessionRecordingStatusSchema } from "./recording.js";
5
+ const isoTimestamp = z.iso.datetime({ offset: true });
6
+ const shortText = z.string().max(2_048);
7
+ // Terminal prompt outcomes, shared so a Turn read model and a status notification cannot disagree
8
+ // on what a finished prompt looks like.
9
+ const promptSucceededOutcome = { completedAt: isoTimestamp, stopReason: shortText };
10
+ const promptCancelledOutcome = { cancelledAt: isoTimestamp };
11
+ const promptFailedOutcome = {
12
+ code: identifierStringSchema,
13
+ failedAt: isoTimestamp,
14
+ message: z.string().min(1).max(500),
15
+ };
16
+ /**
17
+ * The terminal outcome of one command, keyed by the `commandId` the Recording already uses for the
18
+ * Turn. A Session status notification reports these per command because the delivery that carries it
19
+ * only observes the commands that ended in it; a session-wide "nothing is running" claim cannot be
20
+ * derived from one delivery.
21
+ */
22
+ export const sessionStatusWebhookCommandSchema = z.discriminatedUnion("outcome", [
23
+ z
24
+ .object({
25
+ ...promptSucceededOutcome,
26
+ commandId: identifierStringSchema,
27
+ outcome: z.literal("succeeded"),
28
+ })
29
+ .readonly(),
30
+ z
31
+ .object({
32
+ ...promptCancelledOutcome,
33
+ commandId: identifierStringSchema,
34
+ outcome: z.literal("cancelled"),
35
+ })
36
+ .readonly(),
37
+ z
38
+ .object({
39
+ ...promptFailedOutcome,
40
+ commandId: identifierStringSchema,
41
+ outcome: z.literal("failed"),
42
+ })
43
+ .readonly(),
44
+ ]);
45
+ /**
46
+ * One App Session status notification. `commands` names exactly the commands this delivery observed
47
+ * ending, so a consumer resolves those Turns and no others. `status` is the trailing state of the
48
+ * same delivery and is retained for consumers that have not adopted `commands`.
49
+ */
50
+ export const sessionStatusWebhookBodySchema = z
51
+ .object({
52
+ appId: identifierStringSchema,
53
+ commands: z.array(sessionStatusWebhookCommandSchema).min(1).readonly(),
54
+ projectId: identifierStringSchema,
55
+ runtimeId: identifierStringSchema,
56
+ sessionId: identifierStringSchema,
57
+ status: sessionRecordingStatusSchema,
58
+ })
59
+ .readonly();
60
+ export const decodeSessionStatusWebhookBody = (encoded) => decode(encoded, sessionStatusWebhookBodySchema);
61
+ export const encodeSessionStatusWebhookBody = (value) => encode(value, sessionStatusWebhookBodySchema);
62
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../../src/protocol/session/recording/webhooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,YAAY,GA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AsB;IAC7B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtE,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAE,sBAAsB;IACjC,MAAM,EAAE,4BAA4B;CACvC,CAAC;KACD,QAAQ,EAAE,CAAC;AAGhB,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,OAAe,EAA4B,EAAE,CACxF,MAAM,CAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAA+B,EAAU,EAAE,CACtF,MAAM,CAAC,KAAK,EAAE,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ export declare const DIRECTORY_IDENTIFIER_PATTERN: RegExp;
3
+ export declare const DIRECTORY_IDENTIFIER: z.ZodString;
4
+ export declare const SHORT_TEXT: z.ZodString;
5
+ export declare const workspaceEntrySchema: z.ZodReadonly<z.ZodObject<{
6
+ directoryId: z.ZodString;
7
+ name: z.ZodString;
8
+ }, z.core.$strip>>;
9
+ export type WorkspaceEntry = z.infer<typeof workspaceEntrySchema>;
10
+ export declare const sessionStatusSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
11
+ kind: z.ZodLiteral<"idle">;
12
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
13
+ commandId: z.ZodString;
14
+ kind: z.ZodLiteral<"working">;
15
+ }, z.core.$strip>>], "kind">;
16
+ export type SessionStatus = z.infer<typeof sessionStatusSchema>;
17
+ export declare const sessionCapabilitiesSchema: z.ZodReadonly<z.ZodObject<{
18
+ additionalDirectories: z.ZodBoolean;
19
+ audioPrompt: z.ZodBoolean;
20
+ closeSession: z.ZodBoolean;
21
+ deleteSession: z.ZodBoolean;
22
+ embeddedContextPrompt: z.ZodBoolean;
23
+ imagePrompt: z.ZodBoolean;
24
+ listSessions: z.ZodBoolean;
25
+ loadSession: z.ZodBoolean;
26
+ promptQueueing: z.ZodDefault<z.ZodBoolean>;
27
+ renameSession: z.ZodDefault<z.ZodBoolean>;
28
+ resumeSession: z.ZodBoolean;
29
+ steering: z.ZodDefault<z.ZodBoolean>;
30
+ unstableForkSession: z.ZodDefault<z.ZodBoolean>;
31
+ }, z.core.$strip>>;
32
+ export type SessionCapabilities = z.infer<typeof sessionCapabilitiesSchema>;
33
+ export declare const sessionCommandSchema: z.ZodReadonly<z.ZodObject<{
34
+ description: z.ZodString;
35
+ inputHint: z.ZodString;
36
+ name: z.ZodString;
37
+ }, z.core.$strip>>;
38
+ export type SessionCommand = z.infer<typeof sessionCommandSchema>;
39
+ export declare const configValueSchema: z.ZodReadonly<z.ZodObject<{
40
+ description: z.ZodString;
41
+ groupId: z.ZodString;
42
+ groupName: z.ZodString;
43
+ name: z.ZodString;
44
+ value: z.ZodString;
45
+ }, z.core.$strip>>;
46
+ export type SessionConfigValue = z.infer<typeof configValueSchema>;
47
+ export declare const sessionIdentityFields: {
48
+ additionalDirectoryIds: z.ZodReadonly<z.ZodArray<z.ZodString>>;
49
+ agentId: z.ZodString;
50
+ bindingId: z.ZodString;
51
+ directoryId: z.ZodString;
52
+ sessionId: z.ZodString;
53
+ };
54
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/protocol/session/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,4BAA4B,QAAuC,CAAC;AACjF,eAAO,MAAM,oBAAoB,aAAmE,CAAC;AACrG,eAAO,MAAM,UAAU,aAAsB,CAAC;AAE9C,eAAO,MAAM,oBAAoB;;;kBAKlB,CAAC;AAEhB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,mBAAmB;;;;;4BAQ9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;kBAgBvB,CAAC;AAEhB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,oBAAoB;;;;kBAMlB,CAAC;AAEhB,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,iBAAiB;;;;;;kBAYf,CAAC;AAEhB,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAEnE,eAAO,MAAM,qBAAqB;IAC9B,sBAAsB;IACtB,OAAO;IACP,SAAS;IACT,WAAW;IACX,SAAS;CACZ,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { z } from "zod";
2
+ import { identifierStringSchema as IDENTIFIER } from "../../shared/identifier.js";
3
+ export const DIRECTORY_IDENTIFIER_PATTERN = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,2047}$/;
4
+ export const DIRECTORY_IDENTIFIER = z.string().min(1).max(2_048).regex(DIRECTORY_IDENTIFIER_PATTERN);
5
+ export const SHORT_TEXT = z.string().max(500);
6
+ export const workspaceEntrySchema = z
7
+ .object({
8
+ directoryId: DIRECTORY_IDENTIFIER,
9
+ name: z.string().min(1).max(255),
10
+ })
11
+ .readonly();
12
+ export const sessionStatusSchema = z.discriminatedUnion("kind", [
13
+ z.object({ kind: z.literal("idle") }).readonly(),
14
+ z
15
+ .object({
16
+ commandId: IDENTIFIER,
17
+ kind: z.literal("working"),
18
+ })
19
+ .readonly(),
20
+ ]);
21
+ export const sessionCapabilitiesSchema = z
22
+ .object({
23
+ additionalDirectories: z.boolean(),
24
+ audioPrompt: z.boolean(),
25
+ closeSession: z.boolean(),
26
+ deleteSession: z.boolean(),
27
+ embeddedContextPrompt: z.boolean(),
28
+ imagePrompt: z.boolean(),
29
+ listSessions: z.boolean(),
30
+ loadSession: z.boolean(),
31
+ promptQueueing: z.boolean().default(false),
32
+ renameSession: z.boolean().default(false),
33
+ resumeSession: z.boolean(),
34
+ steering: z.boolean().default(false),
35
+ unstableForkSession: z.boolean().default(false),
36
+ })
37
+ .readonly();
38
+ export const sessionCommandSchema = z
39
+ .object({
40
+ description: SHORT_TEXT,
41
+ inputHint: z.string().max(255),
42
+ name: z.string().min(1).max(128),
43
+ })
44
+ .readonly();
45
+ export const configValueSchema = z
46
+ .object({
47
+ description: SHORT_TEXT,
48
+ groupId: z.string().max(128),
49
+ groupName: z.string().max(255),
50
+ name: z.string().min(1).max(255),
51
+ // ACP types a select value id as any string, and Agents use the empty
52
+ // id to mean "the provider's own default" — no explicit setting is
53
+ // sent. Refusing it would drop the whole option, so the id is bounded
54
+ // by length alone.
55
+ value: z.string().max(500),
56
+ })
57
+ .readonly();
58
+ export const sessionIdentityFields = {
59
+ additionalDirectoryIds: z.array(DIRECTORY_IDENTIFIER).max(16).readonly(),
60
+ agentId: IDENTIFIER,
61
+ bindingId: IDENTIFIER,
62
+ directoryId: DIRECTORY_IDENTIFIER,
63
+ sessionId: IDENTIFIER,
64
+ };
65
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/protocol/session/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,sBAAsB,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElF,MAAM,CAAC,MAAM,4BAA4B,GAAG,oCAAoC,CAAC;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC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QAAQ,EAAE;IACxE,OAAO,EAAE,UAAU;IACnB,SAAS,EAAE,UAAU;IACrB,WAAW,EAAE,oBAAoB;IACjC,SAAS,EAAE,UAAU;CACxB,CAAC"}
@@ -0,0 +1,138 @@
1
+ import { z } from "zod";
2
+ declare const turnStateSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
3
+ kind: z.ZodLiteral<"queued">;
4
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
5
+ kind: z.ZodLiteral<"running">;
6
+ startedAt: z.ZodString;
7
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
8
+ completedAt: z.ZodString;
9
+ kind: z.ZodLiteral<"succeeded">;
10
+ result: z.ZodReadonly<z.ZodObject<{
11
+ kind: z.ZodLiteral<"agent_result">;
12
+ stopReason: z.ZodString;
13
+ }, z.core.$strip>>;
14
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
15
+ error: z.ZodReadonly<z.ZodObject<{
16
+ code: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
17
+ message: z.ZodString;
18
+ retryable: z.ZodBoolean;
19
+ }, z.core.$strip>>;
20
+ failedAt: z.ZodString;
21
+ kind: z.ZodLiteral<"failed">;
22
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
23
+ cancelledAt: z.ZodString;
24
+ kind: z.ZodLiteral<"cancelled">;
25
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
26
+ kind: z.ZodLiteral<"indeterminate">;
27
+ reconciliation: z.ZodReadonly<z.ZodObject<{
28
+ detectedAt: z.ZodString;
29
+ reason: z.ZodEnum<{
30
+ connection_lost: "connection_lost";
31
+ dispatch_indeterminate: "dispatch_indeterminate";
32
+ runtime_restarted: "runtime_restarted";
33
+ }>;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip>>], "kind">;
36
+ export type TurnState = z.infer<typeof turnStateSchema>;
37
+ declare const turnRequestSchema: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
38
+ content: z.ZodString;
39
+ kind: z.ZodLiteral<"prompt">;
40
+ sessionConfigurations: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
41
+ booleanValue: z.ZodBoolean;
42
+ configId: z.ZodString;
43
+ value: z.ZodString;
44
+ valueType: z.ZodEnum<{
45
+ boolean: "boolean";
46
+ select: "select";
47
+ }>;
48
+ }, z.core.$strip>>>>>;
49
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
50
+ kind: z.ZodLiteral<"not_retained">;
51
+ }, z.core.$strip>>], "kind">;
52
+ export type TurnRequest = z.infer<typeof turnRequestSchema>;
53
+ declare const turnSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
54
+ acceptedAt: z.ZodString;
55
+ bindingId: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
56
+ idempotencyKey: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
57
+ sessionId: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
58
+ turnId: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
59
+ request: z.ZodReadonly<z.ZodObject<{
60
+ content: z.ZodString;
61
+ kind: z.ZodLiteral<"prompt">;
62
+ sessionConfigurations: z.ZodDefault<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
63
+ booleanValue: z.ZodBoolean;
64
+ configId: z.ZodString;
65
+ value: z.ZodString;
66
+ valueType: z.ZodEnum<{
67
+ boolean: "boolean";
68
+ select: "select";
69
+ }>;
70
+ }, z.core.$strip>>>>>;
71
+ }, z.core.$strip>>;
72
+ state: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
73
+ kind: z.ZodLiteral<"queued">;
74
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
75
+ kind: z.ZodLiteral<"running">;
76
+ startedAt: z.ZodString;
77
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
78
+ completedAt: z.ZodString;
79
+ kind: z.ZodLiteral<"succeeded">;
80
+ result: z.ZodReadonly<z.ZodObject<{
81
+ kind: z.ZodLiteral<"agent_result">;
82
+ stopReason: z.ZodString;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
85
+ error: z.ZodReadonly<z.ZodObject<{
86
+ code: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
87
+ message: z.ZodString;
88
+ retryable: z.ZodBoolean;
89
+ }, z.core.$strip>>;
90
+ failedAt: z.ZodString;
91
+ kind: z.ZodLiteral<"failed">;
92
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
93
+ cancelledAt: z.ZodString;
94
+ kind: z.ZodLiteral<"cancelled">;
95
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
96
+ kind: z.ZodLiteral<"indeterminate">;
97
+ reconciliation: z.ZodReadonly<z.ZodObject<{
98
+ detectedAt: z.ZodString;
99
+ reason: z.ZodEnum<{
100
+ connection_lost: "connection_lost";
101
+ dispatch_indeterminate: "dispatch_indeterminate";
102
+ runtime_restarted: "runtime_restarted";
103
+ }>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>>], "kind">;
106
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
107
+ acceptedAt: z.ZodString;
108
+ bindingId: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
109
+ idempotencyKey: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
110
+ sessionId: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
111
+ turnId: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
112
+ request: z.ZodReadonly<z.ZodObject<{
113
+ kind: z.ZodLiteral<"not_retained">;
114
+ }, z.core.$strip>>;
115
+ state: z.ZodDiscriminatedUnion<[z.ZodReadonly<z.ZodObject<{
116
+ completedAt: z.ZodString;
117
+ kind: z.ZodLiteral<"succeeded">;
118
+ result: z.ZodReadonly<z.ZodObject<{
119
+ kind: z.ZodLiteral<"agent_result">;
120
+ stopReason: z.ZodString;
121
+ }, z.core.$strip>>;
122
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
123
+ error: z.ZodReadonly<z.ZodObject<{
124
+ code: z.core.$ZodBranded<z.ZodString, "Identifier", "out">;
125
+ message: z.ZodString;
126
+ retryable: z.ZodBoolean;
127
+ }, z.core.$strip>>;
128
+ failedAt: z.ZodString;
129
+ kind: z.ZodLiteral<"failed">;
130
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
131
+ cancelledAt: z.ZodString;
132
+ kind: z.ZodLiteral<"cancelled">;
133
+ }, z.core.$strip>>], "kind">;
134
+ }, z.core.$strip>>]>;
135
+ export type Turn = z.infer<typeof turnSchema>;
136
+ export declare const decodeTurn: (value: unknown) => Turn;
137
+ export {};
138
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/protocol/session/turn/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqDxB,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAUnB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAUxD,QAAA,MAAM,iBAAiB;;;;;;;;;;;;;;4BAAwF,CAAC;AAEhH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAS5D,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAGd,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAY9C,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,IAAyC,CAAC"}