veryfront 0.1.1189 → 0.1.1190

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 (210) hide show
  1. package/esm/cli/commands/analyze-chunks/command.d.ts.map +1 -1
  2. package/esm/cli/commands/analyze-chunks/command.js +3 -1
  3. package/esm/cli/commands/schedule/command-help.d.ts.map +1 -1
  4. package/esm/cli/commands/schedule/command-help.js +5 -1
  5. package/esm/cli/commands/schedule/handler.d.ts +17 -0
  6. package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
  7. package/esm/cli/commands/schedule/handler.js +119 -29
  8. package/esm/cli/commands/webhook/command-help.d.ts.map +1 -1
  9. package/esm/cli/commands/webhook/command-help.js +5 -1
  10. package/esm/cli/commands/webhook/handler.d.ts +5 -0
  11. package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
  12. package/esm/cli/commands/webhook/handler.js +62 -7
  13. package/esm/cli/templates/manifest.js +2 -2
  14. package/esm/deno.js +6 -3
  15. package/esm/src/agent/conversation/durable.d.ts.map +1 -1
  16. package/esm/src/agent/conversation/durable.js +61 -50
  17. package/esm/src/agent/conversation/private-run-event.d.ts +13 -0
  18. package/esm/src/agent/conversation/private-run-event.d.ts.map +1 -0
  19. package/esm/src/agent/conversation/private-run-event.js +38 -0
  20. package/esm/src/agent/conversation/run-event-limits.d.ts +6 -3
  21. package/esm/src/agent/conversation/run-event-limits.d.ts.map +1 -1
  22. package/esm/src/agent/conversation/run-event-limits.js +17 -3
  23. package/esm/src/agent/conversation/run-event-normalization.d.ts.map +1 -1
  24. package/esm/src/agent/conversation/run-event-normalization.js +5 -3
  25. package/esm/src/agent/hosted/chat-execution-runtime.d.ts +3 -3
  26. package/esm/src/agent/hosted/chat-execution-runtime.d.ts.map +1 -1
  27. package/esm/src/agent/hosted/chat-execution-runtime.js +14 -16
  28. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
  29. package/esm/src/agent/hosted/child-fork-execution-runner.js +10 -12
  30. package/esm/src/agent/hosted/durable-run-event-sink.d.ts +10 -0
  31. package/esm/src/agent/hosted/durable-run-event-sink.d.ts.map +1 -0
  32. package/esm/src/agent/hosted/durable-run-event-sink.js +102 -0
  33. package/esm/src/agent/index.d.ts +2 -1
  34. package/esm/src/agent/index.d.ts.map +1 -1
  35. package/esm/src/agent/index.js +1 -0
  36. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  37. package/esm/src/agent/runtime/index.js +0 -6
  38. package/esm/src/agent/types.d.ts +0 -7
  39. package/esm/src/agent/types.d.ts.map +1 -1
  40. package/esm/src/discovery/handlers/schedule-handler.d.ts.map +1 -1
  41. package/esm/src/discovery/handlers/schedule-handler.js +2 -1
  42. package/esm/src/discovery/handlers/webhook-handler.d.ts.map +1 -1
  43. package/esm/src/discovery/handlers/webhook-handler.js +2 -1
  44. package/esm/src/embedding/local-json-store-lock.d.ts +15 -0
  45. package/esm/src/embedding/local-json-store-lock.d.ts.map +1 -0
  46. package/esm/src/embedding/local-json-store-lock.js +457 -0
  47. package/esm/src/embedding/rag-store.d.ts.map +1 -1
  48. package/esm/src/embedding/rag-store.js +342 -165
  49. package/esm/src/errors/error-registry/agent.d.ts +2 -0
  50. package/esm/src/errors/error-registry/agent.d.ts.map +1 -1
  51. package/esm/src/errors/error-registry/agent.js +8 -0
  52. package/esm/src/errors/error-registry/server.d.ts +6 -0
  53. package/esm/src/errors/error-registry/server.d.ts.map +1 -1
  54. package/esm/src/errors/error-registry/server.js +18 -0
  55. package/esm/src/errors/error-registry.d.ts +3 -0
  56. package/esm/src/errors/error-registry.d.ts.map +1 -1
  57. package/esm/src/errors/index.d.ts +1 -1
  58. package/esm/src/errors/index.d.ts.map +1 -1
  59. package/esm/src/errors/index.js +2 -2
  60. package/esm/src/extensions/builtin-extensions.d.ts +10 -10
  61. package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
  62. package/esm/src/extensions/builtin-extensions.js +22 -63
  63. package/esm/src/extensions/first-party-defaults.d.ts +105 -0
  64. package/esm/src/extensions/first-party-defaults.d.ts.map +1 -0
  65. package/esm/src/extensions/first-party-defaults.js +178 -0
  66. package/esm/src/extensions/orchestrate.d.ts.map +1 -1
  67. package/esm/src/extensions/orchestrate.js +41 -4
  68. package/esm/src/extensions/websocket/node-websocket-server-provider.d.ts +4 -4
  69. package/esm/src/extensions/websocket/node-websocket-server-provider.d.ts.map +1 -1
  70. package/esm/src/extensions/websocket/node-websocket-server-provider.js +4 -4
  71. package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
  72. package/esm/src/observability/instruments/instruments-factory.d.ts.map +1 -1
  73. package/esm/src/observability/instruments/instruments-factory.js +0 -8
  74. package/esm/src/observability/metrics/index.d.ts +1 -14
  75. package/esm/src/observability/metrics/index.d.ts.map +1 -1
  76. package/esm/src/observability/metrics/index.js +0 -28
  77. package/esm/src/observability/metrics/recorder.d.ts +1 -9
  78. package/esm/src/observability/metrics/recorder.d.ts.map +1 -1
  79. package/esm/src/observability/metrics/recorder.js +0 -12
  80. package/esm/src/observability/metrics/types.d.ts +0 -12
  81. package/esm/src/observability/metrics/types.d.ts.map +1 -1
  82. package/esm/src/observability/metrics/types.js +1 -17
  83. package/esm/src/platform/adapters/file-snapshot-error.d.ts +7 -0
  84. package/esm/src/platform/adapters/file-snapshot-error.d.ts.map +1 -1
  85. package/esm/src/platform/adapters/file-snapshot-error.js +13 -0
  86. package/esm/src/platform/adapters/fs/cache/size-estimator.d.ts.map +1 -1
  87. package/esm/src/platform/adapters/fs/cache/size-estimator.js +12 -2
  88. package/esm/src/platform/adapters/fs/github/cache-scope.d.ts +8 -0
  89. package/esm/src/platform/adapters/fs/github/cache-scope.d.ts.map +1 -0
  90. package/esm/src/platform/adapters/fs/github/cache-scope.js +12 -0
  91. package/esm/src/platform/adapters/fs/github/directory-operations.d.ts.map +1 -1
  92. package/esm/src/platform/adapters/fs/github/directory-operations.js +2 -1
  93. package/esm/src/platform/adapters/fs/github/path-utils.d.ts.map +1 -1
  94. package/esm/src/platform/adapters/fs/github/path-utils.js +27 -4
  95. package/esm/src/platform/adapters/fs/github/read-operations.d.ts.map +1 -1
  96. package/esm/src/platform/adapters/fs/github/read-operations.js +4 -3
  97. package/esm/src/platform/adapters/fs/github/stat-operations.d.ts.map +1 -1
  98. package/esm/src/platform/adapters/fs/github/stat-operations.js +3 -2
  99. package/esm/src/platform/adapters/fs/integration.d.ts.map +1 -1
  100. package/esm/src/platform/adapters/fs/integration.js +4 -0
  101. package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.d.ts.map +1 -1
  102. package/esm/src/platform/adapters/fs/veryfront/adapter-helpers.js +21 -6
  103. package/esm/src/platform/adapters/fs/veryfront/path-normalizer.d.ts +2 -0
  104. package/esm/src/platform/adapters/fs/veryfront/path-normalizer.d.ts.map +1 -1
  105. package/esm/src/platform/adapters/fs/veryfront/path-normalizer.js +57 -5
  106. package/esm/src/platform/adapters/fs/veryfront/retry.d.ts.map +1 -1
  107. package/esm/src/platform/adapters/fs/veryfront/retry.js +66 -13
  108. package/esm/src/platform/adapters/fs/veryfront/types.d.ts +3 -1
  109. package/esm/src/platform/adapters/fs/veryfront/types.d.ts.map +1 -1
  110. package/esm/src/platform/adapters/mock.d.ts.map +1 -1
  111. package/esm/src/platform/adapters/mock.js +3 -7
  112. package/esm/src/platform/adapters/path-containment.d.ts +9 -0
  113. package/esm/src/platform/adapters/path-containment.d.ts.map +1 -0
  114. package/esm/src/platform/adapters/path-containment.js +13 -0
  115. package/esm/src/platform/adapters/runtime/shared/native-snapshot-identity.d.ts +13 -0
  116. package/esm/src/platform/adapters/runtime/shared/native-snapshot-identity.d.ts.map +1 -0
  117. package/esm/src/platform/adapters/runtime/shared/native-snapshot-identity.js +12 -0
  118. package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.d.ts +7 -0
  119. package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.d.ts.map +1 -1
  120. package/esm/src/platform/adapters/runtime/shared/node-filesystem-adapter.js +62 -18
  121. package/esm/src/rendering/app-route-resolver.d.ts +4 -5
  122. package/esm/src/rendering/app-route-resolver.d.ts.map +1 -1
  123. package/esm/src/rendering/app-route-resolver.js +142 -87
  124. package/esm/src/rendering/chunk-optimizer/contracts.d.ts +49 -0
  125. package/esm/src/rendering/chunk-optimizer/contracts.d.ts.map +1 -0
  126. package/esm/src/rendering/chunk-optimizer/contracts.js +1 -0
  127. package/esm/src/rendering/chunk-optimizer/data-properties.d.ts +12 -0
  128. package/esm/src/rendering/chunk-optimizer/data-properties.d.ts.map +1 -0
  129. package/esm/src/rendering/chunk-optimizer/data-properties.js +24 -0
  130. package/esm/src/rendering/chunk-optimizer/file-discovery.d.ts +3 -0
  131. package/esm/src/rendering/chunk-optimizer/file-discovery.d.ts.map +1 -0
  132. package/esm/src/rendering/chunk-optimizer/file-discovery.js +167 -0
  133. package/esm/src/rendering/chunk-optimizer/filesystem.d.ts +7 -0
  134. package/esm/src/rendering/chunk-optimizer/filesystem.d.ts.map +1 -0
  135. package/esm/src/rendering/chunk-optimizer/filesystem.js +51 -0
  136. package/esm/src/rendering/chunk-optimizer/limits.d.ts +23 -0
  137. package/esm/src/rendering/chunk-optimizer/limits.d.ts.map +1 -0
  138. package/esm/src/rendering/chunk-optimizer/limits.js +22 -0
  139. package/esm/src/rendering/chunk-optimizer/manifest.d.ts +4 -0
  140. package/esm/src/rendering/chunk-optimizer/manifest.d.ts.map +1 -0
  141. package/esm/src/rendering/chunk-optimizer/manifest.js +220 -0
  142. package/esm/src/rendering/chunk-optimizer/source-imports.d.ts +9 -0
  143. package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -0
  144. package/esm/src/rendering/chunk-optimizer/source-imports.js +359 -0
  145. package/esm/src/rendering/chunk-optimizer/specifier.d.ts +5 -0
  146. package/esm/src/rendering/chunk-optimizer/specifier.d.ts.map +1 -0
  147. package/esm/src/rendering/chunk-optimizer/specifier.js +10 -0
  148. package/esm/src/rendering/chunk-optimizer/suggestions.d.ts +3 -0
  149. package/esm/src/rendering/chunk-optimizer/suggestions.d.ts.map +1 -0
  150. package/esm/src/rendering/chunk-optimizer/suggestions.js +164 -0
  151. package/esm/src/rendering/chunk-optimizer.d.ts +10 -43
  152. package/esm/src/rendering/chunk-optimizer.d.ts.map +1 -1
  153. package/esm/src/rendering/chunk-optimizer.js +39 -161
  154. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  155. package/esm/src/rendering/orchestrator/pipeline.js +6 -2
  156. package/esm/src/rendering/page-resolution/page-resolver.d.ts +3 -2
  157. package/esm/src/rendering/page-resolution/page-resolver.d.ts.map +1 -1
  158. package/esm/src/rendering/page-resolution/page-resolver.js +21 -10
  159. package/esm/src/runtime/model-call-context.d.ts +7 -4
  160. package/esm/src/runtime/model-call-context.d.ts.map +1 -1
  161. package/esm/src/runtime/run-event-sink-context.d.ts +17 -0
  162. package/esm/src/runtime/run-event-sink-context.d.ts.map +1 -0
  163. package/esm/src/runtime/run-event-sink-context.js +47 -0
  164. package/esm/src/runtime/runtime-bridge.d.ts +0 -3
  165. package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
  166. package/esm/src/runtime/runtime-bridge.js +26 -8
  167. package/esm/src/security/http/outbound-fetch.d.ts +1 -0
  168. package/esm/src/security/http/outbound-fetch.d.ts.map +1 -1
  169. package/esm/src/security/http/outbound-fetch.js +14 -0
  170. package/esm/src/server/bootstrap.d.ts +1 -1
  171. package/esm/src/server/bootstrap.d.ts.map +1 -1
  172. package/esm/src/server/bootstrap.js +1 -1
  173. package/esm/src/server/dev-server/server.d.ts +1 -1
  174. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  175. package/esm/src/server/dev-server/server.js +1 -1
  176. package/esm/src/server/handlers/request/api/api-handler-wrapper.d.ts.map +1 -1
  177. package/esm/src/server/handlers/request/api/api-handler-wrapper.js +7 -3
  178. package/esm/src/server/handlers/request/api/app-router-resolver.d.ts.map +1 -1
  179. package/esm/src/server/handlers/request/api/app-router-resolver.js +28 -30
  180. package/esm/src/server/service-server.d.ts +1 -1
  181. package/esm/src/server/service-server.d.ts.map +1 -1
  182. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  183. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  184. package/esm/src/types/entities/getEntityInfo.d.ts +57 -3
  185. package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
  186. package/esm/src/types/entities/getEntityInfo.js +1015 -231
  187. package/esm/src/types/entities.d.ts +9 -1
  188. package/esm/src/types/entities.d.ts.map +1 -1
  189. package/esm/src/types/entities.js +92 -0
  190. package/esm/src/utils/constants/limits.d.ts +2 -0
  191. package/esm/src/utils/constants/limits.d.ts.map +1 -1
  192. package/esm/src/utils/constants/limits.js +2 -0
  193. package/esm/src/utils/route-path-utils.d.ts +9 -0
  194. package/esm/src/utils/route-path-utils.d.ts.map +1 -1
  195. package/esm/src/utils/route-path-utils.js +56 -20
  196. package/esm/src/utils/version-constant.d.ts +1 -1
  197. package/esm/src/utils/version-constant.js +1 -1
  198. package/package.json +8 -6
  199. package/esm/src/agent/conversation/model-call-context-run-event.d.ts +0 -41
  200. package/esm/src/agent/conversation/model-call-context-run-event.d.ts.map +0 -1
  201. package/esm/src/agent/conversation/model-call-context-run-event.js +0 -74
  202. package/esm/src/agent/hosted/model-call-context-run-event-recorder.d.ts +0 -35
  203. package/esm/src/agent/hosted/model-call-context-run-event-recorder.d.ts.map +0 -1
  204. package/esm/src/agent/hosted/model-call-context-run-event-recorder.js +0 -266
  205. package/esm/src/observability/instruments/model-call-context-instruments.d.ts +0 -18
  206. package/esm/src/observability/instruments/model-call-context-instruments.d.ts.map +0 -1
  207. package/esm/src/observability/instruments/model-call-context-instruments.js +0 -25
  208. package/esm/src/runtime/model-call-recorder-context.d.ts +0 -8
  209. package/esm/src/runtime/model-call-recorder-context.d.ts.map +0 -1
  210. package/esm/src/runtime/model-call-recorder-context.js +0 -14
@@ -5,7 +5,8 @@ import { AppendConversationRunEventsError, isCursorMismatchConversationRunAppend
5
5
  export { AppendConversationRunEventsResponseSchema, CompleteConversationRunResponseSchema, ConversationRunProjectionSchema, ConversationRunStatusSchema, ConversationRunTargetsSchema, CreateConversationRunAcceptedSchema, getAppendConversationRunEventsResponseSchema, getCompleteConversationRunResponseSchema, getConversationRunProjectionSchema, getConversationRunStatusSchema, getConversationRunTargetsSchema, getCreateConversationRunAcceptedSchema, resolveConversationRunTargets, } from "./durable-contracts.js";
6
6
  export { AppendConversationRunEventsError, isCursorMismatchConversationRunAppendError, isIgnorableConversationRunAppendError, isPermanentAuthConversationRunAppendError, parseAppendConversationRunEventsErrorBody, } from "./durable-append-errors.js";
7
7
  import { normalizeConversationRunEvents } from "./run-event-normalization.js";
8
- import { isModelCallContextRunEvent, ModelCallContextPersistenceError, } from "./model-call-context-run-event.js";
8
+ import { MAX_CONVERSATION_RUN_EVENT_APPEND_REQUEST_BYTES } from "./run-event-limits.js";
9
+ import { DurableRunEventPersistenceError, isPrivateConversationRunEvent, } from "./private-run-event.js";
9
10
  const AGENT_RUN_API_TIMEOUT_MS = 15_000;
10
11
  function createTimedAbortSignal(timeoutMs, abortSignal) {
11
12
  const controller = new AbortController();
@@ -38,6 +39,40 @@ function createTimedAbortSignal(timeoutMs, abortSignal) {
38
39
  };
39
40
  }
40
41
  const DEFAULT_MAX_CONVERSATION_RUN_BATCH_BYTES = 512 * 1024;
42
+ function backfillPurePrivateEventResponseCursor(responseBody, latestExternalEventSequence) {
43
+ if (!responseBody || typeof responseBody !== "object" || Array.isArray(responseBody)) {
44
+ return responseBody;
45
+ }
46
+ const body = responseBody;
47
+ const needsBodyCursor = body.latestExternalEventSequence === undefined &&
48
+ body.latest_external_event_sequence === undefined;
49
+ const run = body.run;
50
+ const runBody = run && typeof run === "object" && !Array.isArray(run)
51
+ ? run
52
+ : undefined;
53
+ const needsRunCursor = runBody !== undefined &&
54
+ runBody.latestExternalEventSequence === undefined &&
55
+ runBody.latest_external_event_sequence === undefined;
56
+ if (!needsBodyCursor && !needsRunCursor) {
57
+ return responseBody;
58
+ }
59
+ const result = { ...body };
60
+ if (needsBodyCursor) {
61
+ const cursorKey = body.latestEventId !== undefined
62
+ ? "latestExternalEventSequence"
63
+ : "latest_external_event_sequence";
64
+ result[cursorKey] = latestExternalEventSequence;
65
+ }
66
+ if (needsRunCursor && runBody) {
67
+ const runResult = { ...runBody };
68
+ const cursorKey = runBody.latestEventId !== undefined
69
+ ? "latestExternalEventSequence"
70
+ : "latest_external_event_sequence";
71
+ runResult[cursorKey] = latestExternalEventSequence;
72
+ result.run = runResult;
73
+ }
74
+ return result;
75
+ }
41
76
  /** Error shape for conversation run terminal state. */
42
77
  export class ConversationRunTerminalStateError extends Error {
43
78
  status;
@@ -308,7 +343,7 @@ export async function flushConversationRunEventBatches(input) {
308
343
  if (!batch) {
309
344
  continue;
310
345
  }
311
- const cursorMode = batch.some(isModelCallContextRunEvent)
346
+ const cursorMode = batch.some(isPrivateConversationRunEvent)
312
347
  ? "durable_event_id"
313
348
  : "external_sequence";
314
349
  try {
@@ -703,40 +738,39 @@ export async function appendConversationRunEvents(input) {
703
738
  if (input.abortSignal?.aborted) {
704
739
  throw new DOMException("This operation was aborted", "AbortError");
705
740
  }
706
- const timedAbort = createTimedAbortSignal(AGENT_RUN_API_TIMEOUT_MS, input.abortSignal);
707
741
  const normalizedEvents = normalizeConversationRunEvents(input.events);
708
- const requiresDurableCursor = normalizedEvents.some(isModelCallContextRunEvent);
709
- const isPureModelCallContextBatch = normalizedEvents.length > 0 &&
710
- normalizedEvents.every(isModelCallContextRunEvent);
742
+ const requiresDurableCursor = normalizedEvents.some(isPrivateConversationRunEvent);
743
+ const isPurePrivateEventBatch = normalizedEvents.length > 0 &&
744
+ normalizedEvents.every(isPrivateConversationRunEvent);
711
745
  if (requiresDurableCursor && input.expectedPreviousEventId === undefined) {
712
- timedAbort.cleanup();
713
- throw new ModelCallContextPersistenceError("Model-call context append requires expected_previous_event_id");
746
+ throw new DurableRunEventPersistenceError("Private run event append requires expected_previous_event_id");
714
747
  }
748
+ const timedAbort = createTimedAbortSignal(AGENT_RUN_API_TIMEOUT_MS, input.abortSignal);
715
749
  // The timed abort must stay armed while the body is read: a server that
716
750
  // stalls mid-body would otherwise hang past the timeout.
717
751
  try {
752
+ const requestBody = JSON.stringify({
753
+ ...(input.expectedPreviousEventId !== undefined
754
+ ? { expected_previous_event_id: input.expectedPreviousEventId }
755
+ : {}),
756
+ ...(!requiresDurableCursor && input.expectedPreviousExternalEventSequence !== undefined
757
+ ? {
758
+ expected_previous_external_event_sequence: input.expectedPreviousExternalEventSequence,
759
+ }
760
+ : {}),
761
+ events: normalizedEvents,
762
+ });
763
+ if (new TextEncoder().encode(requestBody).byteLength >
764
+ MAX_CONVERSATION_RUN_EVENT_APPEND_REQUEST_BYTES) {
765
+ throw new DurableRunEventPersistenceError("Run event append request exceeds the supported payload size");
766
+ }
718
767
  const response = await (input.fetch ?? globalThis.fetch)(`${input.apiUrl}/conversations/${input.conversationId}/runs/${input.runId}/events`, {
719
768
  method: "POST",
720
769
  headers: {
721
770
  Authorization: `Bearer ${input.authToken}`,
722
771
  "Content-Type": "application/json",
723
772
  },
724
- body: JSON.stringify({
725
- ...(input.expectedPreviousEventId !== undefined
726
- ? { expected_previous_event_id: input.expectedPreviousEventId }
727
- : {}),
728
- ...(!requiresDurableCursor && input.expectedPreviousExternalEventSequence !== undefined
729
- ? {
730
- expected_previous_external_event_sequence: input.expectedPreviousExternalEventSequence,
731
- }
732
- : {}),
733
- // Chokepoint guard: every append path funnels through here, so enforce the
734
- // per-event size limit here too. Upstream mirrors already normalize, but
735
- // direct callers (hosted lifecycle, child-run progress) do not — this makes
736
- // it impossible to POST an event the API would reject for size. Idempotent
737
- // on already-normalized events.
738
- events: normalizedEvents,
739
- }),
773
+ body: requestBody,
740
774
  signal: timedAbort.signal,
741
775
  });
742
776
  if (!response.ok) {
@@ -747,35 +781,12 @@ export async function appendConversationRunEvents(input) {
747
781
  statusText: response.statusText,
748
782
  });
749
783
  }
750
- const responseBody = await response.json();
784
+ let responseBody = await response.json();
751
785
  // Pure private-event appends do not advance the external cursor and the API
752
786
  // intentionally omits it. Preserve the caller's known cursor so the shared
753
787
  // queue result remains total; mixed batches return the advanced API value.
754
- if (isPureModelCallContextBatch && input.expectedPreviousExternalEventSequence !== undefined &&
755
- responseBody && typeof responseBody === "object" && !Array.isArray(responseBody)) {
756
- const body = responseBody;
757
- if (body.latestExternalEventSequence === undefined &&
758
- body.latest_external_event_sequence === undefined) {
759
- if (body.latestEventId !== undefined) {
760
- body.latestExternalEventSequence = input.expectedPreviousExternalEventSequence;
761
- }
762
- else {
763
- body.latest_external_event_sequence = input.expectedPreviousExternalEventSequence;
764
- }
765
- }
766
- const run = body.run;
767
- if (run && typeof run === "object" && !Array.isArray(run)) {
768
- const runBody = run;
769
- if (runBody.latestExternalEventSequence === undefined &&
770
- runBody.latest_external_event_sequence === undefined) {
771
- if (runBody.latestEventId !== undefined) {
772
- runBody.latestExternalEventSequence = input.expectedPreviousExternalEventSequence;
773
- }
774
- else {
775
- runBody.latest_external_event_sequence = input.expectedPreviousExternalEventSequence;
776
- }
777
- }
778
- }
788
+ if (isPurePrivateEventBatch && input.expectedPreviousExternalEventSequence !== undefined) {
789
+ responseBody = backfillPurePrivateEventResponseCursor(responseBody, input.expectedPreviousExternalEventSequence);
779
790
  }
780
791
  return AppendConversationRunEventsResponseSchema.parse(responseBody);
781
792
  }
@@ -0,0 +1,13 @@
1
+ import { VeryfrontError } from "../../errors/index.js";
2
+ /** Return whether an event declares the private durable run-event discriminator. */
3
+ export declare function hasPrivateConversationRunEventType(value: unknown): value is object;
4
+ /** Return whether an event belongs to the private durable run-event sequence. */
5
+ export declare function isPrivateConversationRunEvent(value: unknown): boolean;
6
+ /** Failure to persist a required run event before its associated operation. */
7
+ export declare class DurableRunEventPersistenceError extends VeryfrontError {
8
+ name: string;
9
+ constructor(detail: string, options?: {
10
+ cause?: unknown;
11
+ });
12
+ }
13
+ //# sourceMappingURL=private-run-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-run-event.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/private-run-event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAO7F,oFAAoF;AACpF,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAGlF;AAED,iFAAiF;AACjF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASrE;AAED,+EAA+E;AAC/E,qBAAa,+BAAgC,SAAQ,cAAc;IACxD,IAAI,SAAqC;gBAEtC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAO;CAY9D"}
@@ -0,0 +1,38 @@
1
+ import { DURABLE_RUN_EVENT_PERSISTENCE_FAILED, VeryfrontError } from "../../errors/index.js";
2
+ function ownDataValue(record, key) {
3
+ const descriptor = Object.getOwnPropertyDescriptor(record, key);
4
+ return descriptor && "value" in descriptor ? descriptor.value : undefined;
5
+ }
6
+ /** Return whether an event declares the private durable run-event discriminator. */
7
+ export function hasPrivateConversationRunEventType(value) {
8
+ return !!value && typeof value === "object" && !Array.isArray(value) &&
9
+ ownDataValue(value, "type") === "AGENT_RUN_MODEL_CALL_CONTEXT";
10
+ }
11
+ /** Return whether an event belongs to the private durable run-event sequence. */
12
+ export function isPrivateConversationRunEvent(value) {
13
+ if (!hasPrivateConversationRunEventType(value))
14
+ return false;
15
+ if (!Array.isArray(ownDataValue(value, "messages")))
16
+ return false;
17
+ const toolsDescriptor = Object.getOwnPropertyDescriptor(value, "tools");
18
+ if (toolsDescriptor !== undefined &&
19
+ (!("value" in toolsDescriptor) || !Array.isArray(toolsDescriptor.value)))
20
+ return false;
21
+ return Object.keys(value).every((key) => key === "type" || key === "messages" || key === "tools");
22
+ }
23
+ /** Failure to persist a required run event before its associated operation. */
24
+ export class DurableRunEventPersistenceError extends VeryfrontError {
25
+ name = "DurableRunEventPersistenceError";
26
+ constructor(detail, options = {}) {
27
+ super(detail, {
28
+ slug: DURABLE_RUN_EVENT_PERSISTENCE_FAILED.slug,
29
+ category: DURABLE_RUN_EVENT_PERSISTENCE_FAILED.category,
30
+ status: DURABLE_RUN_EVENT_PERSISTENCE_FAILED.status,
31
+ title: DURABLE_RUN_EVENT_PERSISTENCE_FAILED.title,
32
+ suggestion: DURABLE_RUN_EVENT_PERSISTENCE_FAILED.suggestion,
33
+ detail,
34
+ cause: options.cause,
35
+ });
36
+ this.name = "DurableRunEventPersistenceError";
37
+ }
38
+ }
@@ -1,9 +1,12 @@
1
1
  /**
2
2
  * Per-event payload budget the conversation run append endpoint accepts.
3
3
  *
4
- * Owned by a leaf module so every producer of durable run events — the generic
5
- * normalizer and the model-call context envelope alike — sizes against one
6
- * number instead of a duplicated literal.
4
+ * Owned by a leaf module so every producer of durable run events sizes against
5
+ * one number instead of a duplicated literal.
7
6
  */
8
7
  export declare const MAX_CONVERSATION_RUN_EVENT_PAYLOAD_BYTES: number;
8
+ /** Maximum JSON body accepted by the trusted conversation run-event endpoint. */
9
+ export declare const MAX_CONVERSATION_RUN_EVENT_APPEND_REQUEST_BYTES: number;
10
+ /** Return the conservative append-request size for one private durable event. */
11
+ export declare function getPrivateRunEventAppendRequestByteLength(event: unknown): number;
9
12
  //# sourceMappingURL=run-event-limits.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-event-limits.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-event-limits.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,wCAAwC,QAAa,CAAC"}
1
+ {"version":3,"file":"run-event-limits.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-event-limits.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,QAAa,CAAC;AAEnE,iFAAiF;AACjF,eAAO,MAAM,+CAA+C,QAAmB,CAAC;AAIhF,iFAAiF;AACjF,wBAAgB,yCAAyC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAShF"}
@@ -1,8 +1,22 @@
1
1
  /**
2
2
  * Per-event payload budget the conversation run append endpoint accepts.
3
3
  *
4
- * Owned by a leaf module so every producer of durable run events — the generic
5
- * normalizer and the model-call context envelope alike — sizes against one
6
- * number instead of a duplicated literal.
4
+ * Owned by a leaf module so every producer of durable run events sizes against
5
+ * one number instead of a duplicated literal.
7
6
  */
8
7
  export const MAX_CONVERSATION_RUN_EVENT_PAYLOAD_BYTES = 240 * 1024;
8
+ /** Maximum JSON body accepted by the trusted conversation run-event endpoint. */
9
+ export const MAX_CONVERSATION_RUN_EVENT_APPEND_REQUEST_BYTES = 10 * 1024 * 1024;
10
+ const encoder = new TextEncoder();
11
+ /** Return the conservative append-request size for one private durable event. */
12
+ export function getPrivateRunEventAppendRequestByteLength(event) {
13
+ try {
14
+ return encoder.encode(JSON.stringify({
15
+ expected_previous_event_id: Number.MAX_SAFE_INTEGER,
16
+ events: [event],
17
+ })).byteLength;
18
+ }
19
+ catch {
20
+ return Number.POSITIVE_INFINITY;
21
+ }
22
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"run-event-normalization.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-event-normalization.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,wCAAwC,EAAE,MAAM,uBAAuB,CAAC;AASjF,KAAK,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAS7E,sDAAsD;AACtD,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM5E;AAED,oDAAoD;AACpD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,0BAA0B,GAChC,0BAA0B,EAAE,CAY9B;AA0CD,0CAA0C;AAC1C,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAAE,GACnC,0BAA0B,EAAE,CAE9B"}
1
+ {"version":3,"file":"run-event-normalization.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/conversation/run-event-normalization.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wCAAwC,EAAE,MAAM,uBAAuB,CAAC;AASjF,KAAK,0BAA0B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAS7E,sDAAsD;AACtD,wBAAgB,qCAAqC,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM5E;AAED,oDAAoD;AACpD,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,0BAA0B,GAChC,0BAA0B,EAAE,CAc9B;AA0CD,0CAA0C;AAC1C,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,0BAA0B,EAAE,GACnC,0BAA0B,EAAE,CAE9B"}
@@ -1,5 +1,5 @@
1
- import { assertValidModelCallContextRunEvent, isModelCallContextRunEvent, } from "./model-call-context-run-event.js";
2
1
  import { MAX_CONVERSATION_RUN_EVENT_PAYLOAD_BYTES } from "./run-event-limits.js";
2
+ import { DurableRunEventPersistenceError, hasPrivateConversationRunEventType, isPrivateConversationRunEvent, } from "./private-run-event.js";
3
3
  export { MAX_CONVERSATION_RUN_EVENT_PAYLOAD_BYTES } from "./run-event-limits.js";
4
4
  const OMITTED_CONVERSATION_RUN_EVENT_TYPE = "CUSTOM";
5
5
  const MAX_SUMMARY_DEPTH = 4;
@@ -21,8 +21,10 @@ export function getConversationRunEventJsonByteLength(value) {
21
21
  }
22
22
  /** Event emitted for normalize conversation run. */
23
23
  export function normalizeConversationRunEvent(event) {
24
- if (isModelCallContextRunEvent(event)) {
25
- assertValidModelCallContextRunEvent(event);
24
+ if (hasPrivateConversationRunEventType(event)) {
25
+ if (!isPrivateConversationRunEvent(event)) {
26
+ throw new DurableRunEventPersistenceError("Invalid private run event shape");
27
+ }
26
28
  return [event];
27
29
  }
28
30
  if (getConversationRunEventJsonByteLength(event) <= MAX_CONVERSATION_RUN_EVENT_PAYLOAD_BYTES) {
@@ -9,7 +9,7 @@ import { type MirroredToolChunkState } from "../streaming/mirrored-tool-chunk-st
9
9
  import { type FinalizeHostedResponseOptions, type HostedDetachedFinalizationState, type HostedResponseFinalizationState } from "./stream-finalization.js";
10
10
  import { createChatStreamWatchdog } from "../../chat/stream-watchdog.js";
11
11
  import type { HostedChatExecutionLifecycleAdapter } from "./chat-execution-lifecycle-types.js";
12
- import type { ModelCallRecorder } from "../../runtime/model-call-context.js";
12
+ import type { AgentRunEventSink } from "../../runtime/model-call-context.js";
13
13
  export type { HostedChatExecutionLifecycleAdapter } from "./chat-execution-lifecycle-types.js";
14
14
  /** Public API contract for hosted chat execution runtime. */
15
15
  export interface HostedChatExecutionRuntime {
@@ -39,7 +39,7 @@ export interface HostedChatExecutionRuntimeBootstrap {
39
39
  capturedMessageId: string | null;
40
40
  capturedConversationId?: string;
41
41
  mirroredToolChunkState: MirroredToolChunkState;
42
- modelCallRecorder?: ModelCallRecorder;
42
+ runEventSink?: AgentRunEventSink;
43
43
  }
44
44
  /** Input payload for create hosted chat execution runtime bootstrap. */
45
45
  export interface CreateHostedChatExecutionRuntimeBootstrapInput {
@@ -53,7 +53,7 @@ export interface CreateHostedChatExecutionRuntimeBootstrapInput {
53
53
  createRootStreamWatchdog?: () => HostedChatExecutionRootStreamWatchdog;
54
54
  streamBootstrapKeepaliveIntervalMs?: number;
55
55
  streamBootstrapTimeoutMs?: number;
56
- modelCallContextMirror?: ConversationRunChunkMirror;
56
+ durableRunEventMirror?: ConversationRunChunkMirror;
57
57
  }
58
58
  /** Input payload for create hosted chat execution runtime. */
59
59
  export interface CreateHostedChatExecutionRuntimeInput {
@@ -1 +1 @@
1
- {"version":3,"file":"chat-execution-runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/chat-execution-runtime.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AE,sBAAsB,CAAC;IAC/C,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gCAAgC,EAAE,MAAM,CAAC;CAC1C,GAAG,CACF,SAAS,EAAE,OAAO,KACf,OAAO,CAAC,+BAA+B,CAAC,aAAa,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CA4BhG;AAED,4DAA4D;AAC5D,wBAAgB,0CAA0C,CAAC,KAAK,EAAE;IAChE,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,mCAAmC,CAAC;IACtD,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,gCAAgC,EAAE,MAAM,CAAC;CAC1C,GAAG,CACF,SAAS,EAAE,OAAO,KACf,OAAO,CAAC,+BAA+B,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAC,CAAC,CA2BjF;AAkID,4CAA4C;AAC5C,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,qCAAqC,GAC3C,0BAA0B,CAsI5B"}
@@ -9,8 +9,8 @@ import { createChatStreamWatchdog, DEFAULT_CHAT_STREAM_TOOL_RUNNING_TIMEOUT_MS,
9
9
  import { unrefTimer } from "../../platform/compat/process.js";
10
10
  import { AGENT_DELEGATE_TOOL_PREFIX } from "../runtime/agent-delegation-names.js";
11
11
  import { finalizeHostedChatRun } from "./hosted-chat-finalization.js";
12
- import { runWithModelCallRecorder } from "../../runtime/model-call-recorder-context.js";
13
- import { createModelCallContextRunEventRecorder, ModelCallContextPersistenceError, scopeAsyncIterableWithModelCallRecorder, } from "./model-call-context-run-event-recorder.js";
12
+ import { runWithMandatoryRunEventSink, scopeAsyncIterableWithMandatoryRunEventSink, } from "../../runtime/run-event-sink-context.js";
13
+ import { createDurableRunEventSink, DurableRunEventPersistenceError, } from "./durable-run-event-sink.js";
14
14
  const INCOMPLETE_TOOL_CALLS_PART_ERROR_TEXT = "Assistant ended before tool execution completed";
15
15
  const FINALIZATION_TERMINAL_STATE_FALLBACK_MODEL_ID = "";
16
16
  const DEFAULT_STREAM_BOOTSTRAP_KEEPALIVE_INTERVAL_MS = 30_000;
@@ -97,8 +97,8 @@ export async function createHostedChatExecutionRuntimeBootstrap(input) {
97
97
  if (input.conversationId && !streamingMessageId) {
98
98
  throw INVALID_ARGUMENT.create({ detail: "DURABLE_CHAT_ROOT_REQUIRES_CONVERSATION" });
99
99
  }
100
- if (input.lifecycleAdapter.durableRootRun && !input.modelCallContextMirror) {
101
- throw new ModelCallContextPersistenceError("Durable hosted root run requires an authorized private event mirror");
100
+ if (input.lifecycleAdapter.durableRootRun && !input.durableRunEventMirror) {
101
+ throw new DurableRunEventPersistenceError("Durable hosted root run requires an authorized private event mirror");
102
102
  }
103
103
  const rootStreamWatchdog = input.createRootStreamWatchdog
104
104
  ? input.createRootStreamWatchdog()
@@ -113,9 +113,9 @@ export async function createHostedChatExecutionRuntimeBootstrap(input) {
113
113
  rootStreamWatchdog.signal,
114
114
  bootstrapKeepalive.signal,
115
115
  ]);
116
- const modelCallRecorder = input.modelCallContextMirror
117
- ? createModelCallContextRunEventRecorder({
118
- mirror: input.modelCallContextMirror,
116
+ const runEventSink = input.durableRunEventMirror
117
+ ? createDurableRunEventSink({
118
+ mirror: input.durableRunEventMirror,
119
119
  abortSignal: streamAbortSignal,
120
120
  })
121
121
  : undefined;
@@ -125,9 +125,7 @@ export async function createHostedChatExecutionRuntimeBootstrap(input) {
125
125
  messages: input.finalMessages,
126
126
  abortSignal: streamAbortSignal,
127
127
  });
128
- streamResult = await traceHostedChatRuntimeStream(input.traceStream, () => modelCallRecorder
129
- ? runWithModelCallRecorder(modelCallRecorder, startStream)
130
- : startStream());
128
+ streamResult = await traceHostedChatRuntimeStream(input.traceStream, () => runEventSink ? runWithMandatoryRunEventSink(runEventSink, startStream) : startStream());
131
129
  }
132
130
  catch (error) {
133
131
  rootStreamWatchdog.dispose();
@@ -145,7 +143,7 @@ export async function createHostedChatExecutionRuntimeBootstrap(input) {
145
143
  capturedMessageId: streamingMessageId,
146
144
  ...(input.conversationId ? { capturedConversationId: input.conversationId } : {}),
147
145
  mirroredToolChunkState: createMirroredToolChunkState(),
148
- ...(modelCallRecorder ? { modelCallRecorder } : {}),
146
+ ...(runEventSink ? { runEventSink } : {}),
149
147
  };
150
148
  }
151
149
  async function createBootstrappedHostedChatRuntime(input, agentRunSpan) {
@@ -168,7 +166,7 @@ async function createBootstrappedHostedChatRuntime(input, agentRunSpan) {
168
166
  finalMessages: input.finalMessages,
169
167
  conversationId: input.conversationId,
170
168
  ...(input.rootRunContext.privateDurableRunMirror
171
- ? { modelCallContextMirror: input.rootRunContext.privateDurableRunMirror }
169
+ ? { durableRunEventMirror: input.rootRunContext.privateDurableRunMirror }
172
170
  : {}),
173
171
  abortSignal: input.abortSignal,
174
172
  traceStream: input.traceStream,
@@ -473,11 +471,11 @@ export function createHostedChatExecutionRuntime(input) {
473
471
  streamOptions.generateMessageId = () => responseMessageId;
474
472
  }
475
473
  const createAgentUiStream = () => input.bootstrap.streamResult.toUIMessageStream(streamOptions);
476
- const unscopedAgentUIStream = input.bootstrap.modelCallRecorder
477
- ? runWithModelCallRecorder(input.bootstrap.modelCallRecorder, createAgentUiStream)
474
+ const unscopedAgentUIStream = input.bootstrap.runEventSink
475
+ ? runWithMandatoryRunEventSink(input.bootstrap.runEventSink, createAgentUiStream)
478
476
  : createAgentUiStream();
479
- const agentUIStream = input.bootstrap.modelCallRecorder
480
- ? scopeAsyncIterableWithModelCallRecorder(input.bootstrap.modelCallRecorder, unscopedAgentUIStream)
477
+ const agentUIStream = input.bootstrap.runEventSink
478
+ ? scopeAsyncIterableWithMandatoryRunEventSink(input.bootstrap.runEventSink, unscopedAgentUIStream)
481
479
  : unscopedAgentUIStream;
482
480
  return {
483
481
  agentUIStream: createHostedMirroredUiStream({
@@ -1 +1 @@
1
- {"version":3,"file":"child-fork-execution-runner.d.ts","sourceR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C,gBAAgB,CAAC,KAC3D,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACzC,gBAAgB,CAAC,EAAE,CACjB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,4BAA4B,CAAC,gBAAgB,CAAC,KAC3D,sBAAsB,GAAG,SAAS,CAAC;IACxC,oBAAoB,CAAC,EAAE,wCAAwC,CAAC,sBAAsB,CAAC,CAAC;IACxF,eAAe,CAAC,EAAE,CAAC,aAAa,EAAE,4BAA4B,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxF,gCAAgC,CAAC,EAAE,OAAO,CAAC;CAC5C,CAAC;AAkFJ,wDAAwD;AACxD,wBAAsB,+BAA+B,CACnD,WAAW,SAAS,uBAAuB,GAAG,uBAAuB,EAErE,KAAK,EAAE,sCAAsC,CAAC,WAAW,CAAC,GACzD,OAAO,CAAC,uBAAuB,CAAC,CAQlC;AAuKD,qDAAqD;AACrD,wBAAsB,uCAAuC,CAC3D,WAAW,SAAS,uBAAuB,GAAG,uBAAuB,EAErE,KAAK,EAAE,4CAA4C,CAAC,WAAW,CAAC,GAC/D,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
1
+ {"version":3,"file":"child-fork-execution-runner.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/child-fork-execution-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,OAAO,EAKL,KAAK,gCAAgC,EACtC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,wCAAwC,EAAE,MAAM,4BAA4B,CAAC;AAK3F,OAAO,EAEL,KAAK,kCAAkC,EACxC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,wCAAwC,EAE9C,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,KAAK,6BAA6B,EAElC,KAAK,6CAA6C,EACnD,MAAM,+BAA+B,CAAC;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D;AACxD,wBAAsB,+BAA+B,CACnD,WAAW,SAAS,uBAAuB,GAAG,uBAAuB,EAErE,KAAK,EAAE,sCAAsC,CAAC,WAAW,CAAC,GACzD,OAAO,CAAC,uBAAuB,CAAC,CAQlC;AAqKD,qDAAqD;AACrD,wBAAsB,uCAAuC,CAC3D,WAAW,SAAS,uBAAuB,GAAG,uBAAuB,EAErE,KAAK,EAAE,4CAA4C,CAAC,WAAW,CAAC,GAC/D,OAAO,CAAC,uBAAuB,CAAC,CA2BlC"}
@@ -9,8 +9,8 @@ import { getActiveHostedRunEventWriterCapability, runWithHostedRunEventWriterCap
9
9
  import { throwIfChildRunAborted } from "../child-run/execution-support.js";
10
10
  import { resolveHostedChildForkRuntimeConfig, withHostedChildInvocationContext, } from "./child-tool-input.js";
11
11
  import { requireConfirmedHostedProjectReference, resolveHostedProjectReference, } from "./project-reference-resolver.js";
12
- import { runWithModelCallRecorder } from "../../runtime/model-call-recorder-context.js";
13
- import { createModelCallContextRunEventRecorder, ModelCallContextPersistenceError, } from "./model-call-context-run-event-recorder.js";
12
+ import { runWithMandatoryRunEventSink } from "../../runtime/run-event-sink-context.js";
13
+ import { createDurableRunEventSink, DurableRunEventPersistenceError, } from "./durable-run-event-sink.js";
14
14
  /** Default value for hosted child fork stream idle timeout ms. */
15
15
  export const DEFAULT_HOSTED_CHILD_FORK_STREAM_IDLE_TIMEOUT_MS = 45_000;
16
16
  /** Default value for hosted child fork stream active tool timeout ms. */
@@ -146,10 +146,10 @@ async function executeHostedChildForkWithoutWriterAuthority(input, runContext, s
146
146
  : undefined;
147
147
  const startRuntime = input.startRuntime ?? startHostedChildForkRuntimeWithHostTools;
148
148
  if (input.durableChildRun && !runContext.durableRunMirror) {
149
- throw new ModelCallContextPersistenceError("Durable hosted child run requires an event mirror");
149
+ throw new DurableRunEventPersistenceError("Durable hosted child run requires an event mirror");
150
150
  }
151
- const startupModelCallRecorder = runContext.durableRunMirror
152
- ? createModelCallContextRunEventRecorder({
151
+ const startupRunEventSink = runContext.durableRunMirror
152
+ ? createDurableRunEventSink({
153
153
  mirror: runContext.durableRunMirror,
154
154
  abortSignal: input.abortSignal,
155
155
  })
@@ -185,16 +185,16 @@ async function executeHostedChildForkWithoutWriterAuthority(input, runContext, s
185
185
  runStep: input.runStep ?? runAgentRuntimeForkStep,
186
186
  traceTools,
187
187
  });
188
- const started = await (startupModelCallRecorder
189
- ? runWithModelCallRecorder(startupModelCallRecorder, start)
188
+ const started = await (startupRunEventSink
189
+ ? runWithMandatoryRunEventSink(startupRunEventSink, start)
190
190
  : start());
191
191
  childRunMonitorAbortController = started.childRunMonitorAbortController;
192
192
  childRunMonitorPromise = started.childRunMonitorPromise;
193
193
  const streamAbortSignal = input.abortSignal
194
194
  ? AbortSignal.any([input.abortSignal, started.forkStreamAbortController.signal])
195
195
  : started.forkStreamAbortController.signal;
196
- const modelCallRecorder = runContext.durableRunMirror
197
- ? createModelCallContextRunEventRecorder({
196
+ const runEventSink = runContext.durableRunMirror
197
+ ? createDurableRunEventSink({
198
198
  mirror: runContext.durableRunMirror,
199
199
  abortSignal: streamAbortSignal,
200
200
  })
@@ -228,9 +228,7 @@ async function executeHostedChildForkWithoutWriterAuthority(input, runContext, s
228
228
  writeLog: input.writeLog,
229
229
  tracePart: input.instrumentation?.tracePart,
230
230
  });
231
- return await (modelCallRecorder
232
- ? runWithModelCallRecorder(modelCallRecorder, consume)
233
- : consume());
231
+ return await (runEventSink ? runWithMandatoryRunEventSink(runEventSink, consume) : consume());
234
232
  }
235
233
  catch (error) {
236
234
  return handleHostedChildForkRunContextError({
@@ -0,0 +1,10 @@
1
+ import type { ConversationRunChunkMirror } from "../conversation/run-chunk-mirror.js";
2
+ import type { AgentRunEventSink } from "../../runtime/model-call-context.js";
3
+ export { DurableRunEventPersistenceError } from "../conversation/private-run-event.js";
4
+ /** Create the internal fail-closed sink used by hosted durable runs. */
5
+ export declare function createDurableRunEventSink(input: {
6
+ mirror: ConversationRunChunkMirror;
7
+ abortSignal?: AbortSignal;
8
+ timeoutMs?: number;
9
+ }): AgentRunEventSink;
10
+ //# sourceMappingURL=durable-run-event-sink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"durable-run-event-sink.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/durable-run-event-sink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAC;AAOtF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAK7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AA8EvF,wEAAwE;AACxE,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,MAAM,EAAE,0BAA0B,CAAC;IACnC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,iBAAiB,CAqCpB"}