effect-durable-agent 0.1.0 → 0.2.1

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 (110) hide show
  1. package/dist/{compaction-63iEDHHl.js → compaction-D7WJa899.js} +3 -3
  2. package/dist/{compaction-63iEDHHl.js.map → compaction-D7WJa899.js.map} +1 -1
  3. package/dist/{delivery-2ZILvoRD.js → delivery-BoF-NZbZ.js} +3 -3
  4. package/dist/{delivery-2ZILvoRD.js.map → delivery-BoF-NZbZ.js.map} +1 -1
  5. package/dist/{delivery-D3MxW4wg.d.ts → delivery-v42MAMEP.d.ts} +153 -10
  6. package/dist/domain/command-queues.d.ts +1 -1
  7. package/dist/domain/message-transcript.d.ts +1 -1
  8. package/dist/domain/model-usage.d.ts +1 -1
  9. package/dist/domain/model-usage.js +1 -1
  10. package/dist/domain/reduced-state-schema.d.ts +2 -2
  11. package/dist/domain/reduced-state-schema.js +2 -2
  12. package/dist/domain/reduced-state.d.ts +2 -2
  13. package/dist/domain/reduced-state.js +3 -2
  14. package/dist/domain/reduced-state.js.map +1 -1
  15. package/dist/domain/run-scheduling.d.ts +1 -1
  16. package/dist/{durable-168Womqp.d.ts → durable-BXqwM70o.d.ts} +510 -3
  17. package/dist/{durable-D13w1Qr3.js → durable-Da57Rcml.js} +17 -3
  18. package/dist/durable-Da57Rcml.js.map +1 -0
  19. package/dist/{envelope-BCzKUq_z.js → envelope-BSI_Xh-f.js} +21 -5
  20. package/dist/envelope-BSI_Xh-f.js.map +1 -0
  21. package/dist/{envelope-Che6KatU.d.ts → envelope-CJnPfbjC.d.ts} +53 -6
  22. package/dist/{event-factory-_vF1bIJ7.js → event-factory-BUoBwqAy.js} +3 -3
  23. package/dist/{event-factory-_vF1bIJ7.js.map → event-factory-BUoBwqAy.js.map} +1 -1
  24. package/dist/{events-DwTARLMv.d.ts → events-AIIwZ6dS.d.ts} +3 -3
  25. package/dist/{in-memory-CeODnZhE.js → in-memory-E497WhtS.js} +3 -3
  26. package/dist/{in-memory-CeODnZhE.js.map → in-memory-E497WhtS.js.map} +1 -1
  27. package/dist/index.d.ts +5 -5
  28. package/dist/index.js +3 -3
  29. package/dist/{interpreter-DKGJ1sSx.js → interpreter-BwYN2PCC.js} +5 -4
  30. package/dist/interpreter-BwYN2PCC.js.map +1 -0
  31. package/dist/{model-resolver-DeBDK8XO.d.ts → model-resolver-O8Kn27GH.d.ts} +3 -3
  32. package/dist/{model-usage-0GeHwaaU.d.ts → model-usage-mttrPN0j.d.ts} +2 -2
  33. package/dist/{records--54mZEBx.js → records-D0ZIAOzd.js} +3 -3
  34. package/dist/{records--54mZEBx.js.map → records-D0ZIAOzd.js.map} +1 -1
  35. package/dist/{reduced-state-B1cvy8N_.d.ts → reduced-state-DB_iANjR.d.ts} +50549 -48726
  36. package/dist/{reduced-state-schema-B98exWxQ.d.ts → reduced-state-schema-B9TYxkP9.d.ts} +2 -2
  37. package/dist/{reducer-registry-DhGVzHBV.d.ts → reducer-registry-Bqn5B4JO.d.ts} +5 -5
  38. package/dist/{run-scheduling-wakeup-Mjic4tb_.d.ts → run-scheduling-wakeup-DX2zRAxd.d.ts} +2 -2
  39. package/dist/services/compaction.d.ts +1 -1
  40. package/dist/services/compaction.js +1 -1
  41. package/dist/services/decider.d.ts +2 -0
  42. package/dist/services/decider.js +97 -0
  43. package/dist/services/decider.js.map +1 -0
  44. package/dist/services/model-call.d.ts +1 -1
  45. package/dist/services/model-resolver.d.ts +1 -1
  46. package/dist/services/prompt-projector.d.ts +1 -1
  47. package/dist/services/reducer-registry.d.ts +1 -1
  48. package/dist/services/run-scheduler.d.ts +1 -1
  49. package/dist/services/run-scheduling-wakeup.d.ts +1 -1
  50. package/dist/services/runtime-layer.d.ts +13 -9
  51. package/dist/services/runtime-layer.js +10 -7
  52. package/dist/services/runtime-layer.js.map +1 -1
  53. package/dist/services/runtime.d.ts +1 -1
  54. package/dist/services/runtime.js +4 -3
  55. package/dist/services/runtime.js.map +1 -1
  56. package/dist/services/session-event-observer.d.ts +1 -1
  57. package/dist/services/session-query.d.ts +1 -1
  58. package/dist/services/session-query.js +3 -3
  59. package/dist/services/session-state.d.ts +2 -2
  60. package/dist/services/session-state.js +2 -1
  61. package/dist/services/session-store.d.ts +2 -2
  62. package/dist/services/session-store.js +32 -17
  63. package/dist/services/session-store.js.map +1 -1
  64. package/dist/services/sink-checkpoint-store.d.ts +1 -1
  65. package/dist/services/sink-registry.d.ts +1 -1
  66. package/dist/services/sink-registry.js +1 -1
  67. package/dist/services/span-names.d.ts +1 -1
  68. package/dist/services/span-names.js +1 -0
  69. package/dist/services/span-names.js.map +1 -1
  70. package/dist/services/tool-registry.d.ts +1 -1
  71. package/dist/services/tool-registry.js.map +1 -1
  72. package/dist/services/tracing.d.ts +2 -2
  73. package/dist/session-admission-WE8J_0z9.js +138 -0
  74. package/dist/session-admission-WE8J_0z9.js.map +1 -0
  75. package/dist/{session-event-observer-DlP9ITB2.d.ts → session-event-observer-BWQUJTcN.d.ts} +3 -3
  76. package/dist/{session-state-BehvUVyq.js → session-state-BII-Jhf-.js} +171 -19
  77. package/dist/session-state-BII-Jhf-.js.map +1 -0
  78. package/dist/{session-store-BL6sfrnn.d.ts → session-store-DaSHeg8Q.d.ts} +25 -8
  79. package/dist/{sink-checkpoint-store-DvuHwvx_.d.ts → sink-checkpoint-store-CUvIVvlZ.d.ts} +2 -2
  80. package/dist/{sink-registry-DskRcyOS.js → sink-registry-AOjX5_A1.js} +34 -10
  81. package/dist/sink-registry-AOjX5_A1.js.map +1 -0
  82. package/dist/{subscription-DZNWFDTV.d.ts → subscription-BhwUmsl4.d.ts} +2 -2
  83. package/dist/{subscription-DmO3BcdT.js → subscription-D7U4Tziv.js} +3 -3
  84. package/dist/{subscription-DmO3BcdT.js.map → subscription-D7U4Tziv.js.map} +1 -1
  85. package/dist/testkit/layers.d.ts +13 -10
  86. package/dist/testkit/layers.js +16 -9
  87. package/dist/testkit/layers.js.map +1 -1
  88. package/dist/testkit/transcript.d.ts +10 -4
  89. package/dist/testkit/transcript.js +58 -7
  90. package/dist/testkit/transcript.js.map +1 -1
  91. package/dist/transcript.d.ts +5 -5
  92. package/dist/transcript.js +5 -5
  93. package/dist/types/events/durable.d.ts +2 -2
  94. package/dist/types/events/durable.js +2 -2
  95. package/dist/types/events.d.ts +4 -4
  96. package/dist/types/events.js +3 -3
  97. package/dist/websocket/events.d.ts +1 -1
  98. package/dist/websocket/events.js +1 -1
  99. package/dist/websocket.d.ts +3 -3
  100. package/dist/websocket.js +3 -3
  101. package/dist/{window-read-Brov9VdQ.d.ts → window-read-BELSkO-r.d.ts} +2 -2
  102. package/dist/{window-read-DPFAA1hM.js → window-read-FJTCDaSq.js} +3 -3
  103. package/dist/{window-read-DPFAA1hM.js.map → window-read-FJTCDaSq.js.map} +1 -1
  104. package/package.json +5 -1
  105. package/dist/durable-D13w1Qr3.js.map +0 -1
  106. package/dist/envelope-BCzKUq_z.js.map +0 -1
  107. package/dist/interpreter-DKGJ1sSx.js.map +0 -1
  108. package/dist/session-state-BehvUVyq.js.map +0 -1
  109. package/dist/sink-registry-DskRcyOS.js.map +0 -1
  110. package/dist/tool-registry-CHHUU9BN.d.ts +0 -87
@@ -1 +1 @@
1
- {"version":3,"file":"transcript.js","names":[],"sources":["../../src/transcript/transcript-testkit.ts","../../src/transcript/transcript-scenarios.ts"],"sourcesContent":["import * as Prompt from \"effect/ai/Prompt\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\n\nimport { durableMessageTranscript } from \"../domain/message-transcript\";\nimport { reduceCommittedEvents } from \"../domain/reduced-state\";\nimport type { CommittedDurableEvent } from \"../services/session-store\";\nimport { SequenceNumber, SessionId, durablePosition } from \"../types/core\";\nimport { effectDurableAgentNamespace, type DurableEventEnvelope } from \"../types/events/envelope\";\nimport { decodeDurableEventSync } from \"../types/events/durable\";\nimport { makeEDATraceContext } from \"../types/tracing\";\nimport { canonicalJson } from \"./version\";\nimport {\n advanceTranscriptVersion,\n emptyTranscriptVersion,\n type InMemoryTranscriptVersion,\n} from \"./in-memory\";\nimport {\n emptyTranscriptMappings,\n makeTranscriptDefinition,\n type TranscriptDefinition,\n type TranscriptMappings,\n} from \"./mapping\";\nimport {\n TranscriptRecordFromEnvelope,\n isTopLevelTranscriptRecord,\n type TranscriptRecord,\n} from \"./records\";\n\n/**\n * Test-only builders for transcript interpretation: deterministic ids, a log writer that goes\n * through the real durable decoders, and helpers that project and normalize logs.\n */\n\nconst traceContext = makeEDATraceContext({\n traceId: \"0123456789abcdef0123456789abcdef\",\n spanId: \"0123456789abcdef\",\n});\n/** The encoded trace every test event carries. */\nexport const testEventTrace = { span: traceContext, links: [] };\nconst runTrace = { root: traceContext, links: [] };\n\n/** Deterministic UUIDv7-shaped id; `space` keeps identities of different kinds apart. */\nexport const testId = (space: number, slot: number): string =>\n `018f6bd5-2f2a-7${space.toString(16).padStart(3, \"0\")}-8${(slot >> 48).toString(16).padStart(3, \"0\")}-${(\n slot %\n 2 ** 48\n )\n .toString(16)\n .padStart(12, \"0\")}`;\n\nexport const ids = {\n command: (slot: number) => testId(0x101, slot),\n message: (slot: number) => testId(0x102, slot),\n run: (slot: number) => testId(0x103, slot),\n turn: (slot: number) => testId(0x104, slot),\n inference: (slot: number) => testId(0x105, slot),\n tool: (slot: number) => testId(0x106, slot),\n compaction: (slot: number) => testId(0x107, slot),\n summary: (slot: number) => testId(0x108, slot),\n event: (slot: number) => testId(0x109, slot),\n} as const;\n\nexport const testSessionId = SessionId.make(testId(0x100, 1));\nexport const testModel = { provider: \"test\", modelId: \"model-a\" } as const;\n\nconst summaryPromptMessage = (text: string) =>\n Schema.encodeSync(Prompt.UserMessage)(\n Prompt.makeMessage(\"user\", { content: [Prompt.textPart({ text })] }),\n );\n\n/**\n * Append-only test log. Every event is built as a raw envelope and decoded through the store's\n * durable decoder, so tests exercise the same shapes the interpreter receives in production.\n */\nexport class TestLog {\n readonly events: Array<CommittedDurableEvent> = [];\n private readonly envelopes: Array<DurableEventEnvelope> = [];\n private nextEvent = 1;\n\n /** The raw envelopes, for seeding an in-memory store. */\n get durableEnvelopes(): ReadonlyArray<DurableEventEnvelope> {\n return this.envelopes;\n }\n\n append(type: string, payload: Record<string, unknown>, namespace = effectDurableAgentNamespace) {\n const slot = this.nextEvent++;\n const raw = {\n namespace,\n type,\n schemaVersion: 1,\n durability: \"durable\",\n eventId: ids.event(slot),\n sessionId: testSessionId,\n createdAtMs: 1_760_000_000_000 + slot * 1_000,\n trace: testEventTrace,\n payload,\n };\n const event = decodeDurableEventSync(raw);\n const envelope = event.namespace === \"__foreign\" ? event.envelope : event;\n this.envelopes.push(envelope);\n this.events.push({\n position: durablePosition(SequenceNumber.make(this.events.length + 1)),\n event,\n });\n return this;\n }\n\n appendForeign(namespace: string, type: string, payload: Record<string, unknown>) {\n return this.append(type, payload, namespace);\n }\n\n configure() {\n return this.append(\"SessionConfigured\", { modelSelection: testModel });\n }\n\n /** Command admission plus the submitted message, as session ingress writes them. */\n submit(input: {\n readonly command: number;\n readonly message: number;\n readonly text: string;\n readonly disposition?: \"queue\" | \"steer\";\n readonly idempotencyKey?: string;\n }) {\n const disposition = input.disposition ?? \"queue\";\n this.append(\"CommandAdmitted\", {\n command: {\n _tag: \"SubmitMessage\",\n commandId: ids.command(input.command),\n disposition,\n content: input.text,\n ...(input.idempotencyKey === undefined ? {} : { idempotencyKey: input.idempotencyKey }),\n },\n });\n return this.append(\"UserMessageSubmitted\", {\n commandId: ids.command(input.command),\n messageId: ids.message(input.message),\n disposition,\n content: input.text,\n });\n }\n\n /** A legacy or interrupt-path admission: the message is committed when the command starts. */\n admitOnly(input: {\n readonly command: number;\n readonly text: string;\n readonly idempotencyKey?: string;\n }) {\n return this.append(\"CommandAdmitted\", {\n command: {\n _tag: \"SubmitMessage\",\n commandId: ids.command(input.command),\n disposition: \"interrupt\",\n content: input.text,\n ...(input.idempotencyKey === undefined ? {} : { idempotencyKey: input.idempotencyKey }),\n },\n });\n }\n\n commitUser(input: { readonly command: number; readonly message: number; readonly text: string }) {\n return this.append(\"UserMessageCommitted\", {\n commandId: ids.command(input.command),\n messageId: ids.message(input.message),\n content: input.text,\n });\n }\n\n startRun(input: { readonly run: number; readonly commands: ReadonlyArray<number> }) {\n for (const command of input.commands) {\n this.append(\"CommandStarted\", { commandId: ids.command(command) });\n }\n return this.runStarted(input);\n }\n\n runStarted(input: { readonly run: number; readonly commands: ReadonlyArray<number> }) {\n return this.append(\"RunStarted\", {\n runId: ids.run(input.run),\n commandIds: input.commands.map(ids.command),\n modelSelection: testModel,\n trace: runTrace,\n });\n }\n\n turn(input: {\n readonly run: number;\n readonly turn: number;\n readonly inputs?: ReadonlyArray<number>;\n }) {\n return this.append(\"TurnStarted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n ...(input.inputs === undefined ? {} : { inputMessageIds: input.inputs.map(ids.message) }),\n });\n }\n\n inferenceStarted(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n }) {\n return this.append(\"InferenceStarted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n });\n }\n\n assistant(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly message: number;\n readonly text?: string;\n readonly reasoning?: string;\n readonly toolCalls?: ReadonlyArray<{ readonly providerId: string; readonly name: string }>;\n readonly partial?: string;\n }) {\n const promptParts = [\n ...(input.reasoning === undefined ? [] : [{ type: \"reasoning\", text: input.reasoning }]),\n ...(input.text === undefined ? [] : [{ type: \"text\", text: input.text }]),\n ...(input.toolCalls ?? []).map((call) => ({\n type: \"tool-call\",\n id: call.providerId,\n name: call.name,\n params: { q: call.name },\n providerExecuted: false,\n })),\n ];\n return this.append(\n input.partial === undefined ? \"AssistantMessageCommitted\" : \"AssistantPartialCommitted\",\n {\n messageId: ids.message(input.message),\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n promptParts,\n ...(input.partial === undefined ? {} : { reason: input.partial }),\n },\n );\n }\n\n importAssistant(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly message: number;\n readonly text: string;\n }) {\n return this.append(\"AssistantMessageImported\", {\n messageId: ids.message(input.message),\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n promptParts: [{ type: \"text\", text: input.text }],\n });\n }\n\n inferenceCompleted(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly outputTokens?: number;\n }) {\n return this.append(\"InferenceCompleted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n finishReason: \"stop\",\n usage: { inputTokens: 10, outputTokens: input.outputTokens ?? 5 },\n });\n }\n\n inferenceFailed(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly code?: string;\n }) {\n return this.append(\"InferenceFailed\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n error: {\n message: \"inference failed\",\n ...(input.code === undefined ? {} : { code: input.code }),\n },\n });\n }\n\n toolCreated(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly tool: number;\n readonly providerId: string;\n readonly name: string;\n }) {\n return this.append(\"ToolCallCreated\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n toolCallId: ids.tool(input.tool),\n promptPart: {\n type: \"tool-call\",\n id: input.providerId,\n name: input.name,\n params: { q: input.name },\n providerExecuted: false,\n },\n });\n }\n\n toolRejected(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly tool: number;\n readonly providerId: string;\n readonly name: string;\n }) {\n return this.append(\"ToolCallRejected\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n toolCallId: ids.tool(input.tool),\n promptPart: {\n type: \"tool-result\",\n id: input.providerId,\n name: input.name,\n isFailure: true,\n result: { message: \"unknown tool\", reason: \"unknown-tool\", modelFeedback: \"no such tool\" },\n },\n });\n }\n\n toolStarted(tool: number) {\n return this.append(\"ToolCallStarted\", { toolCallId: ids.tool(tool) });\n }\n\n toolCompleted(input: {\n readonly tool: number;\n readonly providerId: string;\n readonly name: string;\n readonly result?: unknown;\n }) {\n return this.append(\"ToolCallCompleted\", {\n toolCallId: ids.tool(input.tool),\n promptPart: {\n type: \"tool-result\",\n id: input.providerId,\n name: input.name,\n isFailure: false,\n result: input.result ?? { ok: true },\n },\n });\n }\n\n toolFailed(input: { readonly tool: number; readonly providerId: string; readonly name: string }) {\n return this.append(\"ToolCallFailed\", {\n toolCallId: ids.tool(input.tool),\n error: { message: \"tool cancelled\", code: \"tool.cancelled\" },\n promptPart: {\n type: \"tool-result\",\n id: input.providerId,\n name: input.name,\n isFailure: true,\n result: { message: \"tool cancelled\" },\n },\n });\n }\n\n turnCompleted(input: { readonly run: number; readonly turn: number }) {\n return this.append(\"TurnCompleted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n });\n }\n\n runCompleted(run: number, commands: ReadonlyArray<number> = []) {\n this.append(\"RunCompleted\", { runId: ids.run(run) });\n for (const command of commands)\n this.append(\"CommandCompleted\", { commandId: ids.command(command) });\n return this;\n }\n\n runInterrupted(run: number) {\n return this.append(\"RunFailed\", {\n runId: ids.run(run),\n error: { message: \"run interrupted: restart\", code: \"run.interrupted\" },\n });\n }\n\n steer(input: {\n readonly command: number;\n readonly message: number;\n readonly run: number;\n readonly text: string;\n }) {\n return this.append(\"SteeringMessageQueued\", {\n commandId: ids.command(input.command),\n messageId: ids.message(input.message),\n runId: ids.run(input.run),\n content: input.text,\n });\n }\n\n compaction(input: {\n readonly compaction: number;\n readonly summary: number;\n readonly retainedFromContextSeq: number;\n readonly contextVersion: number;\n }) {\n const seq = this.events.length;\n this.append(\"CompactionRequested\", {\n compactionId: ids.compaction(input.compaction),\n sourceFromSeq: 1,\n sourceToSeq: seq,\n });\n this.append(\"CompactionStarted\", { compactionId: ids.compaction(input.compaction) });\n this.append(\"SummaryCreated\", {\n compactionId: ids.compaction(input.compaction),\n summaryId: ids.summary(input.summary),\n sourceFromSeq: 1,\n sourceToSeq: seq,\n summary: {\n compactionId: ids.compaction(input.compaction),\n summaryId: ids.summary(input.summary),\n sourceFromSeq: 1,\n sourceToSeq: seq,\n retainedFromContextSeq: input.retainedFromContextSeq,\n text: \"summary\",\n promptMessage: summaryPromptMessage(\"summary\"),\n policyId: \"test\",\n },\n });\n this.append(\"ContextRebased\", {\n compactionId: ids.compaction(input.compaction),\n summaryId: ids.summary(input.summary),\n contextVersion: input.contextVersion,\n retainedFromContextSeq: input.retainedFromContextSeq,\n });\n return this.append(\"CompactionCompleted\", {\n compactionId: ids.compaction(input.compaction),\n modelSelection: testModel,\n usage: { inputTokens: 100, outputTokens: 20 },\n });\n }\n\n /** One complete assistant turn: start, content, optional tools run to completion, finish. */\n assistantTurn(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly message: number;\n readonly text: string;\n readonly inputs?: ReadonlyArray<number>;\n readonly tools?: ReadonlyArray<number>;\n }) {\n this.turn({\n run: input.run,\n turn: input.turn,\n ...(input.inputs === undefined ? {} : { inputs: input.inputs }),\n });\n this.inferenceStarted(input);\n const toolCalls = (input.tools ?? []).map((tool) => ({\n tool,\n providerId: `call_${tool}`,\n name: `tool_${tool}`,\n }));\n this.assistant({ ...input, toolCalls });\n for (const call of toolCalls) this.toolCreated({ ...input, ...call });\n this.inferenceCompleted(input);\n for (const call of toolCalls) {\n this.toolStarted(call.tool);\n this.toolCompleted(call);\n }\n return this.turnCompleted(input);\n }\n}\n\n/** A definition, built synchronously for tests. */\nexport const testDefinition = (\n mappings: TranscriptMappings = emptyTranscriptMappings,\n): TranscriptDefinition => Effect.runSync(makeTranscriptDefinition(mappings));\n\n/** Project a log split into the given batches, starting from an empty version. */\nexport const projectBatches = (\n definition: TranscriptDefinition,\n batches: ReadonlyArray<ReadonlyArray<CommittedDurableEvent>>,\n): InMemoryTranscriptVersion =>\n batches.reduce(\n (version, batch) => advanceTranscriptVersion(version, definition, batch),\n emptyTranscriptVersion(definition.version, \"active\"),\n );\n\n/**\n * A semantic view of a projected version for equality: every record encoded through its stored\n * envelope with `updatedSeq` normalized, every alias, and the cursor and status.\n */\nexport const normalizedProjection = (version: InMemoryTranscriptVersion) => ({\n meta: version.meta,\n records: Array.from(version.records.values())\n .map((record) => ({\n ...Schema.encodeSync(TranscriptRecordFromEnvelope)(record),\n updatedSeq: 0,\n }))\n .sort((left, right) => (left.id < right.id ? -1 : left.id > right.id ? 1 : 0)),\n aliases: Array.from(version.aliases.entries()).sort(([left], [right]) =>\n left < right ? -1 : left > right ? 1 : 0,\n ),\n});\n\n/** Canonical JSON of every record, for fingerprints. */\nexport const projectionJson = (records: Iterable<TranscriptRecord>): string =>\n canonicalJson(\n Array.from(records)\n .map((record) => Schema.encodeSync(TranscriptRecordFromEnvelope)(record))\n .sort((left, right) => (left.id < right.id ? -1 : left.id > right.id ? 1 : 0)),\n );\n\n/** History the transcript renders: consumed users and committed assistants, in order. */\nexport const renderedTranscriptHistory = (\n version: InMemoryTranscriptVersion,\n): ReadonlyArray<string> =>\n Array.from(version.records.values())\n .filter(isTopLevelTranscriptRecord)\n .sort(\n (left, right) =>\n left.position.anchorSeq - right.position.anchorSeq ||\n left.position.ordinal - right.position.ordinal,\n )\n .flatMap((record) => {\n switch (record.kind) {\n case \"user\":\n return [`user:${record.commandId}`];\n case \"assistant\":\n return record.messageId === undefined ? [] : [`assistant:${record.inferenceId}`];\n case \"compaction\":\n return [];\n }\n });\n\n/** The same history as the model sees it today, from the (possibly pruned) reduced state. */\nexport const reducedStateHistory = (\n events: ReadonlyArray<CommittedDurableEvent>,\n): ReadonlyArray<string> =>\n durableMessageTranscript(reduceCommittedEvents(events))\n .filter(\n (message) =>\n message._tag !== \"User\" ||\n message.requestedDisposition === undefined ||\n message.consumedSeq !== undefined,\n )\n .map((message) =>\n message._tag === \"User\" || message._tag === \"Steering\"\n ? `user:${message.commandId}`\n : `assistant:${message.inferenceId}`,\n );\n\n/**\n * Plausible logs from a small session simulator: each step picks an action that is valid in the\n * simulated state, so every generated log follows the runtime's event protocol.\n */\nexport const generatedTestLog = (\n steps: ReadonlyArray<number>,\n): { log: TestLog; compacted: boolean } => {\n const log = new TestLog().configure();\n let next = 1;\n let compacted = false;\n const pending: Array<number> = [];\n const steering: Array<number> = [];\n let active: { run: number; commands: Array<number>; turns: number; first?: number } | undefined;\n for (const step of steps) {\n const slot = next++;\n switch (step % 11) {\n case 0: {\n const key = slot % 2 === 0 ? `k:${slot}` : undefined;\n if (key !== undefined) {\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", {\n relatedCommandIdempotencyKey: key,\n userEmail: `u${slot}@example.com`,\n });\n }\n log.submit({\n command: slot,\n message: slot,\n text: `q${slot}`,\n ...(key === undefined ? {} : { idempotencyKey: key }),\n });\n pending.push(slot);\n break;\n }\n case 1:\n if (active !== undefined) {\n log.steer({ command: slot, message: slot, run: active.run, text: `s${slot}` });\n steering.push(slot);\n }\n break;\n case 2: {\n const first = pending.shift();\n if (active === undefined && first !== undefined) {\n log.startRun({ run: slot, commands: [first] });\n active = { run: slot, commands: [first], turns: 0, first };\n } else if (first !== undefined) {\n pending.unshift(first);\n }\n break;\n }\n case 3:\n case 4: {\n if (active === undefined) break;\n const inputs = [\n ...(active.first === undefined ? [] : [active.first]),\n ...steering.splice(0),\n ];\n active.first = undefined;\n active.turns += 1;\n const tools = step % 3 === 0 ? [slot] : [];\n log.assistantTurn({\n run: active.run,\n turn: slot,\n inference: slot,\n message: 10_000 + slot,\n text: `a${slot}`,\n inputs,\n tools,\n });\n break;\n }\n case 5:\n if (active !== undefined && active.first === undefined) {\n log.turn({ run: active.run, turn: slot, inputs: steering.splice(0) });\n log.inferenceStarted({ run: active.run, turn: slot, inference: slot });\n log.assistant({\n run: active.run,\n turn: slot,\n inference: slot,\n message: 10_000 + slot,\n text: \"cut\",\n partial: \"stopped\",\n });\n log.inferenceFailed({\n run: active.run,\n turn: slot,\n inference: slot,\n code: \"inference.interrupted\",\n });\n }\n break;\n case 6:\n if (active !== undefined && active.first === undefined) {\n log.runCompleted(active.run, active.commands);\n active = undefined;\n }\n break;\n case 7:\n if (active !== undefined && active.first === undefined) {\n log.runInterrupted(active.run);\n log.runStarted({ run: slot, commands: active.commands });\n log.append(\"RecoveryCompleted\", {\n trigger: \"runtime-restart\",\n continuation: {\n commandId: ids.command(active.commands[0] ?? 0),\n interruptedRunId: ids.run(active.run),\n replacementRunId: ids.run(slot),\n },\n });\n active = { ...active, run: slot };\n }\n break;\n case 8:\n if (log.events.length > 4) {\n log.compaction({\n compaction: slot,\n summary: slot,\n retainedFromContextSeq: log.events.length,\n contextVersion: slot,\n });\n compacted = true;\n }\n break;\n case 9: {\n const cancelled = pending.pop();\n if (cancelled !== undefined) {\n log.append(\"UserMessageCancelled\", {\n commandId: ids.command(slot),\n messageId: ids.message(cancelled),\n reason: \"user-cancel\",\n });\n }\n break;\n }\n case 10: {\n const promoted = pending.shift();\n if (promoted !== undefined && active !== undefined) {\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(slot),\n messageId: ids.message(promoted),\n from: \"queue\",\n to: \"steer\",\n });\n steering.push(promoted);\n } else if (promoted !== undefined) {\n pending.unshift(promoted);\n }\n break;\n }\n }\n }\n return { log, compacted };\n};\n","import type { CommittedDurableEvent } from \"../services/session-store\";\nimport type { TranscriptMappings } from \"./mapping\";\nimport { TestLog, ids } from \"./transcript-testkit\";\n\n/**\n * The fixed scenario corpus: one named log per interpretation rule the transcript must get\n * right. The oracle, the fingerprint and the prompt-parity check all run over it. Add a scenario\n * for every new rule; never edit an existing one without bumping the semantic revision.\n */\nexport interface TranscriptScenario {\n readonly name: string;\n readonly events: ReadonlyArray<CommittedDurableEvent>;\n /** Whether the log contains a context rebase (the reduced state is pruned). */\n readonly compacted: boolean;\n}\n\n/** Gia-shaped decorations used by the decoration scenarios. */\nexport const giaLikeTestMappings: TranscriptMappings = {\n mappings: [\n {\n name: \"author\",\n event: { namespace: \"gia-agent\", type: \"GiaUserMessageAuthorCommitted\", schemaVersion: 1 },\n target: { _tag: \"UserByIdempotencyKey\", path: [\"relatedCommandIdempotencyKey\"] },\n operations: [{ _tag: \"FirstWins\", from: [\"userEmail\"], to: \"author\" }],\n },\n {\n name: \"lastAuthor\",\n event: { namespace: \"gia-agent\", type: \"GiaUserMessageAuthorCommitted\", schemaVersion: 1 },\n target: { _tag: \"Session\" },\n operations: [{ _tag: \"Copy\", from: [\"userEmail\"], to: \"lastAuthor\" }],\n },\n {\n name: \"owner\",\n event: { namespace: \"gia-agent\", type: \"GiaSessionMetadataCommitted\", schemaVersion: 1 },\n target: { _tag: \"Session\" },\n operations: [{ _tag: \"FirstWins\", from: [\"ownerUserEmail\"], to: \"owner\" }],\n },\n {\n name: \"attachments\",\n event: { namespace: \"gia-agent\", type: \"GiaFileAttachmentCreated\", schemaVersion: 1 },\n target: { _tag: \"UserByIdempotencyKey\", path: [\"relatedCommandIdempotencyKey\"] },\n operations: [\n {\n _tag: \"ReplaceListEntry\",\n from: [],\n to: \"attachments\",\n key: { _tag: \"Id\", path: [\"attachmentId\"] },\n },\n ],\n },\n {\n name: \"references\",\n event: { namespace: \"gia-agent\", type: \"GiaReferenceCreated\", schemaVersion: 1 },\n target: { _tag: \"UserByIdempotencyKey\", path: [\"relatedCommandIdempotencyKey\"] },\n operations: [\n {\n _tag: \"ReplaceListEntry\",\n from: [\"target\"],\n to: \"references\",\n key: { _tag: \"Ordinal\", path: [\"ordinal\"] },\n },\n ],\n },\n {\n name: \"subagentNotice\",\n event: { namespace: \"gia-agent\", type: \"GiaSubagentNotificationCommitted\", schemaVersion: 1 },\n target: { _tag: \"UserByCommandId\", path: [\"notificationId\"] },\n operations: [\n { _tag: \"Classify\", classification: \"subagentNotice\" },\n { _tag: \"FirstWins\", from: [\"children\"], to: \"subagentChildren\" },\n ],\n },\n ],\n userFallbacks: [\n { to: \"author\", fromSession: \"lastAuthor\" },\n { to: \"author\", fromSession: \"owner\" },\n ],\n};\n\nconst author = (key: string, email: string) => ({\n relatedCommandIdempotencyKey: key,\n userEmail: email,\n});\n\nconst queueRunTools = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"hi\", idempotencyKey: \"web:1\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"calling\",\n inputs: [1],\n tools: [1, 2],\n });\n log.assistantTurn({ run: 1, turn: 2, inference: 2, message: 102, text: \"done\" });\n return log.runCompleted(1, [1]);\n};\n\nconst legacyCommitted = () => {\n const log = new TestLog().configure();\n log.admitOnly({ command: 1, text: \"interrupting\" });\n log.append(\"CommandStarted\", { commandId: ids.command(1) });\n log.commitUser({ command: 1, message: 1, text: \"interrupting\" });\n log.runStarted({ run: 1, commands: [1] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"ok\", inputs: [1] });\n // A committed user without any admission, as very old logs have.\n log.commitUser({ command: 2, message: 2, text: \"old\" });\n return log.runCompleted(1, [1]);\n};\n\nconst steering = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"start\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.submit({ command: 2, message: 2, text: \"steer me\", disposition: \"steer\" });\n log.steer({ command: 3, message: 3, run: 1, text: \"also this\" });\n log.steer({ command: 4, message: 4, run: 1, text: \"never mind\" });\n log.append(\"SteeringMessageCancelled\", {\n messageId: ids.message(4),\n runId: ids.run(1),\n reason: \"run ended\",\n });\n log.assistant({ run: 1, turn: 1, inference: 1, message: 101, text: \"first\" });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.turnCompleted({ run: 1, turn: 1 });\n log.assistantTurn({\n run: 1,\n turn: 2,\n inference: 2,\n message: 102,\n text: \"steered\",\n inputs: [2, 3],\n });\n return log.runCompleted(1, [1]);\n};\n\nconst promotePauseCancel = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.submit({ command: 2, message: 2, text: \"queued a\" });\n log.submit({ command: 3, message: 3, text: \"queued b\" });\n log.submit({ command: 4, message: 4, text: \"queued c\" });\n log.submit({ command: 5, message: 5, text: \"queued d\" });\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(6),\n messageId: ids.message(2),\n from: \"queue\",\n to: \"steer\",\n });\n log.append(\"PendingMessagesPaused\", {\n interruptionCommandId: ids.command(7),\n runId: ids.run(1),\n messageIds: [ids.message(3), ids.message(4)],\n reason: \"user-interrupted\",\n });\n log.append(\"UserMessageCancelled\", {\n commandId: ids.command(8),\n messageId: ids.message(4),\n reason: \"user-cancel\",\n });\n log.append(\"UserMessageCancelled\", {\n commandId: ids.command(9),\n messageId: ids.message(5),\n reason: \"edit\",\n });\n log.append(\"CommandCancelled\", { commandId: ids.command(5), reason: \"edited\" });\n log.admitOnly({ command: 10, text: \"admitted then cancelled\" });\n log.append(\"CommandCancelled\", { commandId: ids.command(10), reason: \"stopped\" });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.assistant({ run: 1, turn: 1, inference: 1, message: 101, text: \"answer\" });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.turnCompleted({ run: 1, turn: 1 });\n log.assistantTurn({ run: 1, turn: 2, inference: 2, message: 102, text: \"promoted\", inputs: [2] });\n return log.runCompleted(1, [1]);\n};\n\nconst partialEmptyImport = () => {\n const log = new TestLog().configure();\n log.importAssistant({ run: 9, turn: 9, inference: 9, message: 99, text: \"imported context\" });\n log.submit({ command: 1, message: 1, text: \"go\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.assistant({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"half\",\n reasoning: \"hmm\",\n partial: \"inference failed before completion\",\n });\n log.inferenceFailed({ run: 1, turn: 1, inference: 1 });\n log.inferenceStarted({ run: 1, turn: 1, inference: 2 });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 2, outputTokens: 0 });\n log.turnCompleted({ run: 1, turn: 1 });\n return log.runCompleted(1, [1]);\n};\n\nconst rejectedAndRepeatedTerminals = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"tools\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n // The tool is sealed before the assistant content, the reverse of the usual order.\n log.toolCreated({ run: 1, turn: 1, inference: 1, tool: 1, providerId: \"call_1\", name: \"search\" });\n log.toolRejected({ run: 1, turn: 1, inference: 1, tool: 2, providerId: \"call_2\", name: \"nope\" });\n log.assistant({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"using tools\",\n toolCalls: [\n { providerId: \"call_1\", name: \"search\" },\n { providerId: \"call_2\", name: \"nope\" },\n ],\n });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.toolStarted(1);\n log.toolCompleted({ tool: 1, providerId: \"call_1\", name: \"search\", result: { hits: 3 } });\n log.toolFailed({ tool: 1, providerId: \"call_1\", name: \"search\" });\n log.turnCompleted({ run: 1, turn: 1 });\n return log.runCompleted(1, [1]);\n};\n\nconst recovery = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"long task\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.assistant({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"working\",\n toolCalls: [{ providerId: \"call_1\", name: \"bash\" }],\n });\n log.toolCreated({ run: 1, turn: 1, inference: 1, tool: 1, providerId: \"call_1\", name: \"bash\" });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.toolStarted(1);\n // Startup recovery: one batch that fails everything open and continues the run.\n log.toolFailed({ tool: 1, providerId: \"call_1\", name: \"bash\" });\n log.append(\"TurnFailed\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n error: { message: \"turn interrupted\", code: \"turn.interrupted\" },\n });\n log.runInterrupted(1);\n log.runStarted({ run: 2, commands: [1] });\n log.append(\"RecoveryCompleted\", {\n trigger: \"runtime-restart\",\n continuation: {\n commandId: ids.command(1),\n interruptedRunId: ids.run(1),\n replacementRunId: ids.run(2),\n },\n });\n log.assistantTurn({ run: 2, turn: 2, inference: 2, message: 102, text: \"resumed\" });\n return log.runCompleted(2, [1]);\n};\n\nconst midRunCompaction = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"one\",\n inputs: [1],\n tools: [1],\n });\n log.runCompleted(1, [1]);\n log.submit({ command: 2, message: 2, text: \"second\" });\n log.startRun({ run: 2, commands: [2] });\n log.assistantTurn({ run: 2, turn: 2, inference: 2, message: 102, text: \"two\", inputs: [2] });\n log.compaction({\n compaction: 1,\n summary: 1,\n retainedFromContextSeq: log.events.length,\n contextVersion: 1,\n });\n log.assistantTurn({ run: 2, turn: 3, inference: 3, message: 103, text: \"three\" });\n return log.runCompleted(2, [2]);\n};\n\nconst replacementMessageId = () => {\n // A pending submission pruned by a rebase is re-committed under a new message id when its\n // command starts (session 01a13b26 in the design): one record, two aliases.\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"before\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"busy\", inputs: [1] });\n log.submit({ command: 2, message: 2, text: \"queued during run\" });\n log.compaction({\n compaction: 1,\n summary: 1,\n retainedFromContextSeq: log.events.length + 1,\n contextVersion: 1,\n });\n log.runCompleted(1, [1]);\n log.append(\"CommandStarted\", { commandId: ids.command(2) });\n log.commitUser({ command: 2, message: 22, text: \"queued during run\" });\n log.runStarted({ run: 2, commands: [2] });\n log.assistantTurn({\n run: 2,\n turn: 2,\n inference: 2,\n message: 102,\n text: \"answered\",\n inputs: [22],\n });\n return log.runCompleted(2, [2]);\n};\n\nconst decorations = () => {\n const log = new TestLog().configure();\n log.appendForeign(\"gia-agent\", \"GiaSessionMetadataCommitted\", {\n ownerUserEmail: \"owner@example.com\",\n });\n // Web follow-up: author, attachments and a reference precede the command in one batch.\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", author(\"web:1\", \"a@example.com\"));\n log.appendForeign(\"gia-agent\", \"GiaFileAttachmentCreated\", {\n attachmentId: \"att-1\",\n relatedCommandIdempotencyKey: \"web:1\",\n ordinal: 0,\n fileName: \"a.txt\",\n });\n log.appendForeign(\"gia-agent\", \"GiaReferenceCreated\", {\n ordinal: 1,\n referenceId: \"ref-2\",\n relatedCommandIdempotencyKey: \"web:1\",\n target: { kind: \"doc\", id: \"d2\" },\n });\n log.appendForeign(\"gia-agent\", \"GiaReferenceCreated\", {\n ordinal: 0,\n referenceId: \"ref-1\",\n relatedCommandIdempotencyKey: \"web:1\",\n target: { kind: \"doc\", id: \"d1\" },\n });\n log.submit({ command: 1, message: 1, text: \"with files\", idempotencyKey: \"web:1\" });\n // A decoration after its command, a replaced attachment, and a second author (first wins).\n log.appendForeign(\"gia-agent\", \"GiaFileAttachmentCreated\", {\n attachmentId: \"att-1\",\n relatedCommandIdempotencyKey: \"web:1\",\n ordinal: 0,\n fileName: \"a-renamed.txt\",\n });\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", author(\"web:1\", \"b@example.com\"));\n // Subagent wakeup: the notice precedes a command whose id is the notification id.\n log.appendForeign(\"gia-agent\", \"GiaSubagentNotificationCommitted\", {\n notificationId: ids.command(2),\n children: [{ name: \"child\", sessionId: \"s\", state: \"completed\" }],\n });\n log.submit({\n command: 2,\n message: 2,\n text: \"children done\",\n idempotencyKey: `subagent:notify:${ids.command(2)}`,\n });\n // No author event for this key: the latest author is the fallback.\n log.submit({ command: 3, message: 3, text: \"no author\", idempotencyKey: \"slack:3\" });\n // Invalid decorations degrade only themselves; unmapped namespaces are ignored.\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", {\n relatedCommandIdempotencyKey: \"slack:3\",\n });\n log.appendForeign(\"gia-agent\", \"GiaFileAttachmentCreated\", {\n relatedCommandIdempotencyKey: \"slack:3\",\n fileName: \"no id\",\n });\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", {\n relatedCommandIdempotencyKey: 7,\n userEmail: \"x\",\n });\n log.appendForeign(\"other-app\", \"Whatever\", { relatedCommandIdempotencyKey: \"web:1\" });\n // An orphan decoration whose command never arrives.\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", author(\"never\", \"c@example.com\"));\n log.startRun({ run: 1, commands: [1, 2, 3] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"ok\", inputs: [1, 2, 3] });\n return log.runCompleted(1, [1, 2, 3]);\n};\n\nconst ignoredEvents = () => {\n const log = new TestLog().configure();\n log.append(\"SystemMessageCommitted\", { messageId: ids.message(90), content: \"system prompt\" });\n log.append(\"RunSchedulingRequested\", {\n requestId: ids.event(900),\n work: { _tag: \"Command\", commandId: ids.command(1) },\n });\n log.append(\"RunSchedulingDelivered\", { requestId: ids.event(900) });\n log.append(\"RunSchedulingGranted\", { requestId: ids.event(900), runId: ids.run(1) });\n log.append(\"RunSchedulingInvalidated\", { requestId: ids.event(901), reason: \"stopped\" });\n log.submit({ command: 1, message: 1, text: \"hello\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.append(\"StopTurnRequested\", {\n commandId: ids.command(2),\n runId: ids.run(1),\n turnId: ids.turn(1),\n });\n log.append(\"StopTurnApplied\", {\n commandId: ids.command(2),\n runId: ids.run(1),\n turnId: ids.turn(1),\n });\n log.append(\"TurnStopped\", { runId: ids.run(1), turnId: ids.turn(1), reason: \"stop\" });\n log.append(\"ContextProjected\", { contextVersion: 0, throughSeq: log.events.length });\n log.append(\"BaseStateRequested\", { baseStateId: ids.event(902), requestedThroughSeq: 1 });\n log.append(\"BaseStateCreated\", { baseStateId: ids.event(902), coversThroughSeq: 1 });\n log.append(\"BaseStateFailed\", { baseStateId: ids.event(903), error: { message: \"x\" } });\n log.append(\"CompactionRequested\", {\n compactionId: ids.compaction(9),\n sourceFromSeq: 1,\n sourceToSeq: 2,\n });\n log.append(\"CompactionStarted\", { compactionId: ids.compaction(9) });\n log.append(\"CompactionFailed\", { compactionId: ids.compaction(9), error: { message: \"no\" } });\n log.append(\"RunInterrupted\", { runId: ids.run(1), reason: \"legacy stop\" });\n log.append(\"CommandFailed\", { commandId: ids.command(1), error: { message: \"x\" } });\n return log;\n};\n\nconst legacyAttempts = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"legacy\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.append(\"TurnAttemptStarted\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n });\n log.append(\"AssistantMessageCommitted\", {\n messageId: ids.message(101),\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n promptParts: [\n { type: \"text\", text: \"legacy answer\" },\n { type: \"tool-call\", id: \"call_1\", name: \"search\", params: {}, providerExecuted: false },\n ],\n });\n log.append(\"ToolCallCreated\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n toolCallId: ids.tool(1),\n promptPart: {\n type: \"tool-call\",\n id: \"call_1\",\n name: \"search\",\n params: {},\n providerExecuted: false,\n },\n });\n log.append(\"TurnAttemptCompleted\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n usage: { inputTokens: 3, outputTokens: 4 },\n });\n log.toolStarted(1);\n log.toolCompleted({ tool: 1, providerId: \"call_1\", name: \"search\" });\n log.turnCompleted({ run: 1, turn: 1 });\n return log.runCompleted(1, [1]);\n};\n\nconst failuresAndRepeatedCompletion = () => {\n const log = new TestLog().configure();\n // An interrupt submission whose start fails never becomes a message: it is withdrawn.\n log.admitOnly({ command: 1, text: \"stop and do this\" });\n log.append(\"CommandStarted\", { commandId: ids.command(1) });\n log.append(\"CommandFailed\", { commandId: ids.command(1), error: { message: \"start failed\" } });\n log.submit({ command: 2, message: 2, text: \"next\" });\n log.startRun({ run: 1, commands: [2] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"ok\", inputs: [2] });\n log.compaction({\n compaction: 1,\n summary: 1,\n retainedFromContextSeq: log.events.length,\n contextVersion: 1,\n });\n // A repeated completion adds no usage, as in the reduced state.\n log.append(\"CompactionCompleted\", {\n compactionId: ids.compaction(1),\n modelSelection: { provider: \"test\", modelId: \"model-a\" },\n usage: { inputTokens: 100, outputTokens: 20 },\n });\n return log.runCompleted(1, [2]);\n};\n\nconst oneTurnConsumesSeveral = () => {\n // A queued message is promoted after steering arrives; the turn lists the steering first, but the\n // prompt (and so the transcript) orders the submissions as they were submitted.\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.submit({ command: 2, message: 2, text: \"queued\" });\n log.startRun({ run: 1, commands: [1] });\n log.steer({ command: 3, message: 3, run: 1, text: \"steering\" });\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(9),\n messageId: ids.message(2),\n from: \"queue\",\n to: \"steer\",\n });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"all three\",\n inputs: [1, 3, 2],\n });\n return log.runCompleted(1, [1]);\n};\n\nconst oneTurnConsumesSeveralSubmitted = () => {\n // The same tie with today's runtime shapes: steering arrives as a steer-disposition submission.\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.submit({ command: 2, message: 2, text: \"queued\" });\n log.startRun({ run: 1, commands: [1] });\n log.submit({ command: 3, message: 3, text: \"steering\", disposition: \"steer\" });\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(9),\n messageId: ids.message(2),\n from: \"queue\",\n to: \"steer\",\n });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"all three\",\n inputs: [1, 3, 2],\n });\n return log.runCompleted(1, [1]);\n};\n\nconst scenario = (name: string, compacted: boolean, build: () => TestLog): TranscriptScenario => ({\n name,\n compacted,\n events: build().events,\n});\n\n/** Build the corpus. Logs are deterministic: ids, timestamps and traces are fixed. */\nexport const transcriptScenarios = (): ReadonlyArray<TranscriptScenario> => [\n scenario(\"queue-run-tools\", false, queueRunTools),\n scenario(\"legacy-committed-user\", false, legacyCommitted),\n scenario(\"steering\", false, steering),\n scenario(\"promote-pause-cancel\", false, promotePauseCancel),\n scenario(\"partial-failure-empty-success-import\", false, partialEmptyImport),\n scenario(\"rejected-tool-repeated-terminals\", false, rejectedAndRepeatedTerminals),\n scenario(\"recovery-continuation\", false, recovery),\n scenario(\"mid-run-compaction\", true, midRunCompaction),\n scenario(\"replacement-message-id\", true, replacementMessageId),\n scenario(\"host-decorations\", false, decorations),\n scenario(\"events-without-transcript-meaning\", false, ignoredEvents),\n scenario(\"legacy-attempts\", false, legacyAttempts),\n scenario(\"failed-interrupt-repeated-compaction-completion\", true, failuresAndRepeatedCompletion),\n scenario(\"one-turn-consumes-several\", false, oneTurnConsumesSeveral),\n scenario(\"one-turn-consumes-several-submitted\", false, oneTurnConsumesSeveralSubmitted),\n];\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAM,eAAe,oBAAoB;CACvC,SAAS;CACT,QAAQ;AACV,CAAC;;AAED,MAAa,iBAAiB;CAAE,M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EAAE,KAAK;EAAG,UAAU,CAAC,CAAC;CAAE,CAAC;CACtC,IAAI,OAAO;EAAE,SAAS;EAAG,SAAS;EAAG,MAAM;EAAY,aAAa;CAAQ,CAAC;CAC7E,IAAI,OAAO,uBAAuB;EAChC,WAAW,IAAI,QAAQ,CAAC;EACxB,WAAW,IAAI,QAAQ,CAAC;EACxB,MAAM;EACN,IAAI;CACN,CAAC;CACD,IAAI,cAAc;EAChB,KAAK;EACL,MAAM;EACN,WAAW;EACX,SAAS;EACT,MAAM;EACN,QAAQ;GAAC;GAAG;GAAG;EAAC;CAClB,CAAC;CACD,OAAO,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC;AAChC;AAEA,MAAM,YAAY,MAAc,WAAoB,WAA8C;CAChG;CACA;CACA,QAAQ,MAAM,CAAC,CAAC;AAClB;;AAGA,MAAa,4BAA+D;CAC1E,SAAS,mBAAmB,OAAO,aAAa;CAChD,SAAS,yBAAyB,OAAO,eAAe;CACxD,SAAS,YAAY,OAAO,QAAQ;CACpC,SAAS,wBAAwB,OAAO,kBAAkB;CAC1D,SAAS,wCAAwC,OAAO,kBAAkB;CAC1E,SAAS,oCAAoC,OAAO,4BAA4B;CAChF,SAAS,yBAAyB,OAAO,QAAQ;CACjD,SAAS,sBAAsB,MAAM,gBAAgB;CACrD,SAAS,0BAA0B,MAAM,oBAAoB;CAC7D,SAAS,oBAAoB,OAAO,WAAW;CAC/C,SAAS,qCAAqC,OAAO,aAAa;CAClE,SAAS,mBAAmB,OAAO,cAAc;CACjD,SAAS,mDAAmD,MAAM,6BAA6B;CAC/F,SAAS,6BAA6B,OAAO,sBAAsB;CACnE,SAAS,uCAAuC,OAAO,+BAA+B;AACxF"}
1
+ {"version":3,"file":"transcript.js","names":[],"sources":["../../src/transcript/transcript-testkit.ts","../../src/transcript/transcript-scenarios.ts"],"sourcesContent":["import * as Prompt from \"effect/ai/Prompt\";\nimport * as Effect from \"effect/Effect\";\nimport * as Schema from \"effect/Schema\";\n\nimport { durableMessageTranscript } from \"../domain/message-transcript\";\nimport { reduceCommittedEvents } from \"../domain/reduced-state\";\nimport type { CommittedDurableEvent } from \"../services/session-store\";\nimport { SequenceNumber, SessionId, durablePosition } from \"../types/core\";\nimport { effectDurableAgentNamespace, type DurableEventEnvelope } from \"../types/events/envelope\";\nimport { decodeDurableEventSync } from \"../types/events/durable\";\nimport { makeEDATraceContext } from \"../types/tracing\";\nimport { canonicalJson } from \"./version\";\nimport {\n advanceTranscriptVersion,\n emptyTranscriptVersion,\n type InMemoryTranscriptVersion,\n} from \"./in-memory\";\nimport {\n emptyTranscriptMappings,\n makeTranscriptDefinition,\n type TranscriptDefinition,\n type TranscriptMappings,\n} from \"./mapping\";\nimport {\n TranscriptRecordFromEnvelope,\n isTopLevelTranscriptRecord,\n type TranscriptRecord,\n} from \"./records\";\n\n/**\n * Test-only builders for transcript interpretation: deterministic ids, a log writer that goes\n * through the real durable decoders, and helpers that project and normalize logs.\n */\n\nconst traceContext = makeEDATraceContext({\n traceId: \"0123456789abcdef0123456789abcdef\",\n spanId: \"0123456789abcdef\",\n});\n/** The encoded trace every test event carries. */\nexport const testEventTrace = { span: traceContext, links: [] };\nconst runTrace = { root: traceContext, links: [] };\n\n/** Deterministic UUIDv7-shaped id; `space` keeps identities of different kinds apart. */\nexport const testId = (space: number, slot: number): string =>\n `018f6bd5-2f2a-7${space.toString(16).padStart(3, \"0\")}-8${(slot >> 48).toString(16).padStart(3, \"0\")}-${(\n slot %\n 2 ** 48\n )\n .toString(16)\n .padStart(12, \"0\")}`;\n\nexport const ids = {\n command: (slot: number) => testId(0x101, slot),\n message: (slot: number) => testId(0x102, slot),\n run: (slot: number) => testId(0x103, slot),\n turn: (slot: number) => testId(0x104, slot),\n inference: (slot: number) => testId(0x105, slot),\n tool: (slot: number) => testId(0x106, slot),\n compaction: (slot: number) => testId(0x107, slot),\n summary: (slot: number) => testId(0x108, slot),\n event: (slot: number) => testId(0x109, slot),\n} as const;\n\nexport const testSessionId = SessionId.make(testId(0x100, 1));\nexport const testModel = { provider: \"test\", modelId: \"model-a\" } as const;\n\nconst summaryPromptMessage = (text: string) =>\n Schema.encodeSync(Prompt.UserMessage)(\n Prompt.makeMessage(\"user\", { content: [Prompt.textPart({ text })] }),\n );\n\n/**\n * Append-only test log. Every event is built as a raw envelope and decoded through the store's\n * durable decoder, so tests exercise the same shapes the interpreter receives in production.\n */\nexport class TestLog {\n readonly events: Array<CommittedDurableEvent> = [];\n private readonly envelopes: Array<DurableEventEnvelope> = [];\n private nextEvent = 1;\n\n /** The raw envelopes, for seeding an in-memory store. */\n get durableEnvelopes(): ReadonlyArray<DurableEventEnvelope> {\n return this.envelopes;\n }\n\n append(\n type: string,\n payload: Record<string, unknown>,\n namespace = effectDurableAgentNamespace,\n dedupeKey?: string,\n ) {\n const slot = this.nextEvent++;\n const raw = {\n ...(dedupeKey === undefined ? {} : { dedupeKey }),\n namespace,\n type,\n schemaVersion: 1,\n durability: \"durable\",\n eventId: ids.event(slot),\n sessionId: testSessionId,\n createdAtMs: 1_760_000_000_000 + slot * 1_000,\n trace: testEventTrace,\n payload,\n };\n const event = decodeDurableEventSync(raw);\n const envelope = event.namespace === \"__foreign\" ? event.envelope : event;\n this.envelopes.push(envelope);\n this.events.push({\n position: durablePosition(SequenceNumber.make(this.events.length + 1)),\n event,\n });\n return this;\n }\n\n appendForeign(namespace: string, type: string, payload: Record<string, unknown>) {\n return this.append(type, payload, namespace);\n }\n\n configure() {\n return this.append(\"SessionConfigured\", { modelSelection: testModel });\n }\n\n /** A decider's acceptance marker, as `decide` commits it first in its batch. */\n deciderAccepted(input: {\n readonly decider: string;\n readonly key: string;\n readonly result: unknown;\n }) {\n return this.append(\n \"DeciderAccepted\",\n { decider: input.decider, idempotencyKey: input.key, result: input.result },\n effectDurableAgentNamespace,\n `${input.decider}\\n${input.key}`,\n );\n }\n\n /** Command admission plus the submitted message, as session ingress writes them. */\n submit(input: {\n readonly command: number;\n readonly message: number;\n readonly text: string;\n readonly disposition?: \"queue\" | \"steer\";\n readonly idempotencyKey?: string;\n }) {\n const disposition = input.disposition ?? \"queue\";\n this.append(\"CommandAdmitted\", {\n command: {\n _tag: \"SubmitMessage\",\n commandId: ids.command(input.command),\n disposition,\n content: input.text,\n ...(input.idempotencyKey === undefined ? {} : { idempotencyKey: input.idempotencyKey }),\n },\n });\n return this.append(\"UserMessageSubmitted\", {\n commandId: ids.command(input.command),\n messageId: ids.message(input.message),\n disposition,\n content: input.text,\n });\n }\n\n /** A legacy or interrupt-path admission: the message is committed when the command starts. */\n admitOnly(input: {\n readonly command: number;\n readonly text: string;\n readonly idempotencyKey?: string;\n }) {\n return this.append(\"CommandAdmitted\", {\n command: {\n _tag: \"SubmitMessage\",\n commandId: ids.command(input.command),\n disposition: \"interrupt\",\n content: input.text,\n ...(input.idempotencyKey === undefined ? {} : { idempotencyKey: input.idempotencyKey }),\n },\n });\n }\n\n commitUser(input: { readonly command: number; readonly message: number; readonly text: string }) {\n return this.append(\"UserMessageCommitted\", {\n commandId: ids.command(input.command),\n messageId: ids.message(input.message),\n content: input.text,\n });\n }\n\n startRun(input: { readonly run: number; readonly commands: ReadonlyArray<number> }) {\n for (const command of input.commands) {\n this.append(\"CommandStarted\", { commandId: ids.command(command) });\n }\n return this.runStarted(input);\n }\n\n runStarted(input: { readonly run: number; readonly commands: ReadonlyArray<number> }) {\n return this.append(\"RunStarted\", {\n runId: ids.run(input.run),\n commandIds: input.commands.map(ids.command),\n modelSelection: testModel,\n trace: runTrace,\n });\n }\n\n turn(input: {\n readonly run: number;\n readonly turn: number;\n readonly inputs?: ReadonlyArray<number>;\n }) {\n return this.append(\"TurnStarted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n ...(input.inputs === undefined ? {} : { inputMessageIds: input.inputs.map(ids.message) }),\n });\n }\n\n inferenceStarted(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n }) {\n return this.append(\"InferenceStarted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n });\n }\n\n assistant(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly message: number;\n readonly text?: string;\n readonly reasoning?: string;\n readonly toolCalls?: ReadonlyArray<{ readonly providerId: string; readonly name: string }>;\n readonly partial?: string;\n }) {\n const promptParts = [\n ...(input.reasoning === undefined ? [] : [{ type: \"reasoning\", text: input.reasoning }]),\n ...(input.text === undefined ? [] : [{ type: \"text\", text: input.text }]),\n ...(input.toolCalls ?? []).map((call) => ({\n type: \"tool-call\",\n id: call.providerId,\n name: call.name,\n params: { q: call.name },\n providerExecuted: false,\n })),\n ];\n return this.append(\n input.partial === undefined ? \"AssistantMessageCommitted\" : \"AssistantPartialCommitted\",\n {\n messageId: ids.message(input.message),\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n promptParts,\n ...(input.partial === undefined ? {} : { reason: input.partial }),\n },\n );\n }\n\n importAssistant(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly message: number;\n readonly text: string;\n }) {\n return this.append(\"AssistantMessageImported\", {\n messageId: ids.message(input.message),\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n promptParts: [{ type: \"text\", text: input.text }],\n });\n }\n\n inferenceCompleted(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly outputTokens?: number;\n }) {\n return this.append(\"InferenceCompleted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n finishReason: \"stop\",\n usage: { inputTokens: 10, outputTokens: input.outputTokens ?? 5 },\n });\n }\n\n inferenceFailed(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly code?: string;\n }) {\n return this.append(\"InferenceFailed\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n error: {\n message: \"inference failed\",\n ...(input.code === undefined ? {} : { code: input.code }),\n },\n });\n }\n\n toolCreated(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly tool: number;\n readonly providerId: string;\n readonly name: string;\n }) {\n return this.append(\"ToolCallCreated\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n toolCallId: ids.tool(input.tool),\n promptPart: {\n type: \"tool-call\",\n id: input.providerId,\n name: input.name,\n params: { q: input.name },\n providerExecuted: false,\n },\n });\n }\n\n toolRejected(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly tool: number;\n readonly providerId: string;\n readonly name: string;\n }) {\n return this.append(\"ToolCallRejected\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n inferenceId: ids.inference(input.inference),\n toolCallId: ids.tool(input.tool),\n promptPart: {\n type: \"tool-result\",\n id: input.providerId,\n name: input.name,\n isFailure: true,\n result: { message: \"unknown tool\", reason: \"unknown-tool\", modelFeedback: \"no such tool\" },\n },\n });\n }\n\n toolStarted(tool: number) {\n return this.append(\"ToolCallStarted\", { toolCallId: ids.tool(tool) });\n }\n\n toolCompleted(input: {\n readonly tool: number;\n readonly providerId: string;\n readonly name: string;\n readonly result?: unknown;\n }) {\n return this.append(\"ToolCallCompleted\", {\n toolCallId: ids.tool(input.tool),\n promptPart: {\n type: \"tool-result\",\n id: input.providerId,\n name: input.name,\n isFailure: false,\n result: input.result ?? { ok: true },\n },\n });\n }\n\n toolFailed(input: { readonly tool: number; readonly providerId: string; readonly name: string }) {\n return this.append(\"ToolCallFailed\", {\n toolCallId: ids.tool(input.tool),\n error: { message: \"tool cancelled\", code: \"tool.cancelled\" },\n promptPart: {\n type: \"tool-result\",\n id: input.providerId,\n name: input.name,\n isFailure: true,\n result: { message: \"tool cancelled\" },\n },\n });\n }\n\n turnCompleted(input: { readonly run: number; readonly turn: number }) {\n return this.append(\"TurnCompleted\", {\n runId: ids.run(input.run),\n turnId: ids.turn(input.turn),\n });\n }\n\n runCompleted(run: number, commands: ReadonlyArray<number> = []) {\n this.append(\"RunCompleted\", { runId: ids.run(run) });\n for (const command of commands)\n this.append(\"CommandCompleted\", { commandId: ids.command(command) });\n return this;\n }\n\n runInterrupted(run: number) {\n return this.append(\"RunFailed\", {\n runId: ids.run(run),\n error: { message: \"run interrupted: restart\", code: \"run.interrupted\" },\n });\n }\n\n steer(input: {\n readonly command: number;\n readonly message: number;\n readonly run: number;\n readonly text: string;\n }) {\n return this.append(\"SteeringMessageQueued\", {\n commandId: ids.command(input.command),\n messageId: ids.message(input.message),\n runId: ids.run(input.run),\n content: input.text,\n });\n }\n\n compaction(input: {\n readonly compaction: number;\n readonly summary: number;\n readonly retainedFromContextSeq: number;\n readonly contextVersion: number;\n }) {\n const seq = this.events.length;\n this.append(\"CompactionRequested\", {\n compactionId: ids.compaction(input.compaction),\n sourceFromSeq: 1,\n sourceToSeq: seq,\n });\n this.append(\"CompactionStarted\", { compactionId: ids.compaction(input.compaction) });\n this.append(\"SummaryCreated\", {\n compactionId: ids.compaction(input.compaction),\n summaryId: ids.summary(input.summary),\n sourceFromSeq: 1,\n sourceToSeq: seq,\n summary: {\n compactionId: ids.compaction(input.compaction),\n summaryId: ids.summary(input.summary),\n sourceFromSeq: 1,\n sourceToSeq: seq,\n retainedFromContextSeq: input.retainedFromContextSeq,\n text: \"summary\",\n promptMessage: summaryPromptMessage(\"summary\"),\n policyId: \"test\",\n },\n });\n this.append(\"ContextRebased\", {\n compactionId: ids.compaction(input.compaction),\n summaryId: ids.summary(input.summary),\n contextVersion: input.contextVersion,\n retainedFromContextSeq: input.retainedFromContextSeq,\n });\n return this.append(\"CompactionCompleted\", {\n compactionId: ids.compaction(input.compaction),\n modelSelection: testModel,\n usage: { inputTokens: 100, outputTokens: 20 },\n });\n }\n\n /** One complete assistant turn: start, content, optional tools run to completion, finish. */\n assistantTurn(input: {\n readonly run: number;\n readonly turn: number;\n readonly inference: number;\n readonly message: number;\n readonly text: string;\n readonly inputs?: ReadonlyArray<number>;\n readonly tools?: ReadonlyArray<number>;\n }) {\n this.turn({\n run: input.run,\n turn: input.turn,\n ...(input.inputs === undefined ? {} : { inputs: input.inputs }),\n });\n this.inferenceStarted(input);\n const toolCalls = (input.tools ?? []).map((tool) => ({\n tool,\n providerId: `call_${tool}`,\n name: `tool_${tool}`,\n }));\n this.assistant({ ...input, toolCalls });\n for (const call of toolCalls) this.toolCreated({ ...input, ...call });\n this.inferenceCompleted(input);\n for (const call of toolCalls) {\n this.toolStarted(call.tool);\n this.toolCompleted(call);\n }\n return this.turnCompleted(input);\n }\n}\n\n/** A definition, built synchronously for tests. */\nexport const testDefinition = (\n mappings: TranscriptMappings = emptyTranscriptMappings,\n): TranscriptDefinition => Effect.runSync(makeTranscriptDefinition(mappings));\n\n/** Project a log split into the given batches, starting from an empty version. */\nexport const projectBatches = (\n definition: TranscriptDefinition,\n batches: ReadonlyArray<ReadonlyArray<CommittedDurableEvent>>,\n): InMemoryTranscriptVersion =>\n batches.reduce(\n (version, batch) => advanceTranscriptVersion(version, definition, batch),\n emptyTranscriptVersion(definition.version, \"active\"),\n );\n\n/**\n * A semantic view of a projected version for equality: every record encoded through its stored\n * envelope with `updatedSeq` normalized, every alias, and the cursor and status.\n */\nexport const normalizedProjection = (version: InMemoryTranscriptVersion) => ({\n meta: version.meta,\n records: Array.from(version.records.values())\n .map((record) => ({\n ...Schema.encodeSync(TranscriptRecordFromEnvelope)(record),\n updatedSeq: 0,\n }))\n .sort((left, right) => (left.id < right.id ? -1 : left.id > right.id ? 1 : 0)),\n aliases: Array.from(version.aliases.entries()).sort(([left], [right]) =>\n left < right ? -1 : left > right ? 1 : 0,\n ),\n});\n\n/** Canonical JSON of every record, for fingerprints. */\nexport const projectionJson = (records: Iterable<TranscriptRecord>): string =>\n canonicalJson(\n Array.from(records)\n .map((record) => Schema.encodeSync(TranscriptRecordFromEnvelope)(record))\n .sort((left, right) => (left.id < right.id ? -1 : left.id > right.id ? 1 : 0)),\n );\n\n/** History the transcript renders: consumed users and committed assistants, in order. */\nexport const renderedTranscriptHistory = (\n version: InMemoryTranscriptVersion,\n): ReadonlyArray<string> =>\n Array.from(version.records.values())\n .filter(isTopLevelTranscriptRecord)\n .sort(\n (left, right) =>\n left.position.anchorSeq - right.position.anchorSeq ||\n left.position.ordinal - right.position.ordinal,\n )\n .flatMap((record) => {\n switch (record.kind) {\n case \"user\":\n return [`user:${record.commandId}`];\n case \"assistant\":\n return record.messageId === undefined ? [] : [`assistant:${record.inferenceId}`];\n case \"compaction\":\n return [];\n }\n });\n\n/** The same history as the model sees it today, from the (possibly pruned) reduced state. */\nexport const reducedStateHistory = (\n events: ReadonlyArray<CommittedDurableEvent>,\n): ReadonlyArray<string> =>\n durableMessageTranscript(reduceCommittedEvents(events))\n .filter(\n (message) =>\n message._tag !== \"User\" ||\n message.requestedDisposition === undefined ||\n message.consumedSeq !== undefined,\n )\n .map((message) =>\n message._tag === \"User\" || message._tag === \"Steering\"\n ? `user:${message.commandId}`\n : `assistant:${message.inferenceId}`,\n );\n\n/**\n * Plausible logs from a small session simulator: each step picks an action that is valid in the\n * simulated state, so every generated log follows the runtime's event protocol.\n */\nexport const generatedTestLog = (\n steps: ReadonlyArray<number>,\n): { log: TestLog; compacted: boolean } => {\n const log = new TestLog().configure();\n let next = 1;\n let compacted = false;\n const pending: Array<number> = [];\n const steering: Array<number> = [];\n let active: { run: number; commands: Array<number>; turns: number; first?: number } | undefined;\n for (const step of steps) {\n const slot = next++;\n switch (step % 11) {\n case 0: {\n const key = slot % 2 === 0 ? `k:${slot}` : undefined;\n if (key !== undefined) {\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", {\n relatedCommandIdempotencyKey: key,\n userEmail: `u${slot}@example.com`,\n });\n }\n log.submit({\n command: slot,\n message: slot,\n text: `q${slot}`,\n ...(key === undefined ? {} : { idempotencyKey: key }),\n });\n pending.push(slot);\n break;\n }\n case 1:\n if (active !== undefined) {\n log.steer({ command: slot, message: slot, run: active.run, text: `s${slot}` });\n steering.push(slot);\n }\n break;\n case 2: {\n const first = pending.shift();\n if (active === undefined && first !== undefined) {\n log.startRun({ run: slot, commands: [first] });\n active = { run: slot, commands: [first], turns: 0, first };\n } else if (first !== undefined) {\n pending.unshift(first);\n }\n break;\n }\n case 3:\n case 4: {\n if (active === undefined) break;\n const inputs = [\n ...(active.first === undefined ? [] : [active.first]),\n ...steering.splice(0),\n ];\n active.first = undefined;\n active.turns += 1;\n const tools = step % 3 === 0 ? [slot] : [];\n log.assistantTurn({\n run: active.run,\n turn: slot,\n inference: slot,\n message: 10_000 + slot,\n text: `a${slot}`,\n inputs,\n tools,\n });\n break;\n }\n case 5:\n if (active !== undefined && active.first === undefined) {\n log.turn({ run: active.run, turn: slot, inputs: steering.splice(0) });\n log.inferenceStarted({ run: active.run, turn: slot, inference: slot });\n log.assistant({\n run: active.run,\n turn: slot,\n inference: slot,\n message: 10_000 + slot,\n text: \"cut\",\n partial: \"stopped\",\n });\n log.inferenceFailed({\n run: active.run,\n turn: slot,\n inference: slot,\n code: \"inference.interrupted\",\n });\n }\n break;\n case 6:\n if (active !== undefined && active.first === undefined) {\n log.runCompleted(active.run, active.commands);\n active = undefined;\n }\n break;\n case 7:\n if (active !== undefined && active.first === undefined) {\n log.runInterrupted(active.run);\n log.runStarted({ run: slot, commands: active.commands });\n log.append(\"RecoveryCompleted\", {\n trigger: \"runtime-restart\",\n continuation: {\n commandId: ids.command(active.commands[0] ?? 0),\n interruptedRunId: ids.run(active.run),\n replacementRunId: ids.run(slot),\n },\n });\n active = { ...active, run: slot };\n }\n break;\n case 8:\n if (log.events.length > 4) {\n log.compaction({\n compaction: slot,\n summary: slot,\n retainedFromContextSeq: log.events.length,\n contextVersion: slot,\n });\n compacted = true;\n }\n break;\n case 9: {\n const cancelled = pending.pop();\n if (cancelled !== undefined) {\n log.append(\"UserMessageCancelled\", {\n commandId: ids.command(slot),\n messageId: ids.message(cancelled),\n reason: \"user-cancel\",\n });\n }\n break;\n }\n case 10: {\n const promoted = pending.shift();\n if (promoted !== undefined && active !== undefined) {\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(slot),\n messageId: ids.message(promoted),\n from: \"queue\",\n to: \"steer\",\n });\n steering.push(promoted);\n } else if (promoted !== undefined) {\n pending.unshift(promoted);\n }\n break;\n }\n }\n }\n return { log, compacted };\n};\n","import type { CommittedDurableEvent } from \"../services/session-store\";\nimport type { TranscriptMappings } from \"./mapping\";\nimport { TestLog, ids } from \"./transcript-testkit\";\n\n/**\n * The fixed scenario corpus: one named log per interpretation rule the transcript must get\n * right. The oracle, the fingerprint and the prompt-parity check all run over it. Add a scenario\n * for every new rule; never edit an existing one without bumping the semantic revision.\n */\nexport interface TranscriptScenario {\n readonly name: string;\n readonly events: ReadonlyArray<CommittedDurableEvent>;\n /** Whether the log contains a context rebase (the reduced state is pruned). */\n readonly compacted: boolean;\n}\n\n/** Gia-shaped decorations used by the decoration scenarios. */\nexport const giaLikeTestMappings: TranscriptMappings = {\n mappings: [\n {\n name: \"author\",\n event: { namespace: \"gia-agent\", type: \"GiaUserMessageAuthorCommitted\", schemaVersion: 1 },\n target: { _tag: \"UserByIdempotencyKey\", path: [\"relatedCommandIdempotencyKey\"] },\n operations: [{ _tag: \"FirstWins\", from: [\"userEmail\"], to: \"author\" }],\n },\n {\n name: \"lastAuthor\",\n event: { namespace: \"gia-agent\", type: \"GiaUserMessageAuthorCommitted\", schemaVersion: 1 },\n target: { _tag: \"Session\" },\n operations: [{ _tag: \"Copy\", from: [\"userEmail\"], to: \"lastAuthor\" }],\n },\n {\n name: \"owner\",\n event: { namespace: \"gia-agent\", type: \"GiaSessionMetadataCommitted\", schemaVersion: 1 },\n target: { _tag: \"Session\" },\n operations: [{ _tag: \"FirstWins\", from: [\"ownerUserEmail\"], to: \"owner\" }],\n },\n {\n name: \"attachments\",\n event: { namespace: \"gia-agent\", type: \"GiaFileAttachmentCreated\", schemaVersion: 1 },\n target: { _tag: \"UserByIdempotencyKey\", path: [\"relatedCommandIdempotencyKey\"] },\n operations: [\n {\n _tag: \"ReplaceListEntry\",\n from: [],\n to: \"attachments\",\n key: { _tag: \"Id\", path: [\"attachmentId\"] },\n },\n ],\n },\n {\n name: \"references\",\n event: { namespace: \"gia-agent\", type: \"GiaReferenceCreated\", schemaVersion: 1 },\n target: { _tag: \"UserByIdempotencyKey\", path: [\"relatedCommandIdempotencyKey\"] },\n operations: [\n {\n _tag: \"ReplaceListEntry\",\n from: [\"target\"],\n to: \"references\",\n key: { _tag: \"Ordinal\", path: [\"ordinal\"] },\n },\n ],\n },\n {\n name: \"subagentNotice\",\n event: { namespace: \"gia-agent\", type: \"GiaSubagentNotificationCommitted\", schemaVersion: 1 },\n target: { _tag: \"UserByCommandId\", path: [\"notificationId\"] },\n operations: [\n { _tag: \"Classify\", classification: \"subagentNotice\" },\n { _tag: \"FirstWins\", from: [\"children\"], to: \"subagentChildren\" },\n ],\n },\n ],\n userFallbacks: [\n { to: \"author\", fromSession: \"lastAuthor\" },\n { to: \"author\", fromSession: \"owner\" },\n ],\n};\n\nconst author = (key: string, email: string) => ({\n relatedCommandIdempotencyKey: key,\n userEmail: email,\n});\n\nconst queueRunTools = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"hi\", idempotencyKey: \"web:1\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"calling\",\n inputs: [1],\n tools: [1, 2],\n });\n log.assistantTurn({ run: 1, turn: 2, inference: 2, message: 102, text: \"done\" });\n return log.runCompleted(1, [1]);\n};\n\nconst legacyCommitted = () => {\n const log = new TestLog().configure();\n log.admitOnly({ command: 1, text: \"interrupting\" });\n log.append(\"CommandStarted\", { commandId: ids.command(1) });\n log.commitUser({ command: 1, message: 1, text: \"interrupting\" });\n log.runStarted({ run: 1, commands: [1] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"ok\", inputs: [1] });\n // A committed user without any admission, as very old logs have.\n log.commitUser({ command: 2, message: 2, text: \"old\" });\n return log.runCompleted(1, [1]);\n};\n\nconst steering = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"start\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.submit({ command: 2, message: 2, text: \"steer me\", disposition: \"steer\" });\n log.steer({ command: 3, message: 3, run: 1, text: \"also this\" });\n log.steer({ command: 4, message: 4, run: 1, text: \"never mind\" });\n log.append(\"SteeringMessageCancelled\", {\n messageId: ids.message(4),\n runId: ids.run(1),\n reason: \"run ended\",\n });\n log.assistant({ run: 1, turn: 1, inference: 1, message: 101, text: \"first\" });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.turnCompleted({ run: 1, turn: 1 });\n log.assistantTurn({\n run: 1,\n turn: 2,\n inference: 2,\n message: 102,\n text: \"steered\",\n inputs: [2, 3],\n });\n return log.runCompleted(1, [1]);\n};\n\nconst promotePauseCancel = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.submit({ command: 2, message: 2, text: \"queued a\" });\n log.submit({ command: 3, message: 3, text: \"queued b\" });\n log.submit({ command: 4, message: 4, text: \"queued c\" });\n log.submit({ command: 5, message: 5, text: \"queued d\" });\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(6),\n messageId: ids.message(2),\n from: \"queue\",\n to: \"steer\",\n });\n log.append(\"PendingMessagesPaused\", {\n interruptionCommandId: ids.command(7),\n runId: ids.run(1),\n messageIds: [ids.message(3), ids.message(4)],\n reason: \"user-interrupted\",\n });\n log.append(\"UserMessageCancelled\", {\n commandId: ids.command(8),\n messageId: ids.message(4),\n reason: \"user-cancel\",\n });\n log.append(\"UserMessageCancelled\", {\n commandId: ids.command(9),\n messageId: ids.message(5),\n reason: \"edit\",\n });\n log.append(\"CommandCancelled\", { commandId: ids.command(5), reason: \"edited\" });\n log.admitOnly({ command: 10, text: \"admitted then cancelled\" });\n log.append(\"CommandCancelled\", { commandId: ids.command(10), reason: \"stopped\" });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.assistant({ run: 1, turn: 1, inference: 1, message: 101, text: \"answer\" });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.turnCompleted({ run: 1, turn: 1 });\n log.assistantTurn({ run: 1, turn: 2, inference: 2, message: 102, text: \"promoted\", inputs: [2] });\n return log.runCompleted(1, [1]);\n};\n\nconst partialEmptyImport = () => {\n const log = new TestLog().configure();\n log.importAssistant({ run: 9, turn: 9, inference: 9, message: 99, text: \"imported context\" });\n log.submit({ command: 1, message: 1, text: \"go\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.assistant({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"half\",\n reasoning: \"hmm\",\n partial: \"inference failed before completion\",\n });\n log.inferenceFailed({ run: 1, turn: 1, inference: 1 });\n log.inferenceStarted({ run: 1, turn: 1, inference: 2 });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 2, outputTokens: 0 });\n log.turnCompleted({ run: 1, turn: 1 });\n return log.runCompleted(1, [1]);\n};\n\nconst rejectedAndRepeatedTerminals = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"tools\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n // The tool is sealed before the assistant content, the reverse of the usual order.\n log.toolCreated({ run: 1, turn: 1, inference: 1, tool: 1, providerId: \"call_1\", name: \"search\" });\n log.toolRejected({ run: 1, turn: 1, inference: 1, tool: 2, providerId: \"call_2\", name: \"nope\" });\n log.assistant({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"using tools\",\n toolCalls: [\n { providerId: \"call_1\", name: \"search\" },\n { providerId: \"call_2\", name: \"nope\" },\n ],\n });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.toolStarted(1);\n log.toolCompleted({ tool: 1, providerId: \"call_1\", name: \"search\", result: { hits: 3 } });\n log.toolFailed({ tool: 1, providerId: \"call_1\", name: \"search\" });\n log.turnCompleted({ run: 1, turn: 1 });\n return log.runCompleted(1, [1]);\n};\n\nconst recovery = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"long task\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.inferenceStarted({ run: 1, turn: 1, inference: 1 });\n log.assistant({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"working\",\n toolCalls: [{ providerId: \"call_1\", name: \"bash\" }],\n });\n log.toolCreated({ run: 1, turn: 1, inference: 1, tool: 1, providerId: \"call_1\", name: \"bash\" });\n log.inferenceCompleted({ run: 1, turn: 1, inference: 1 });\n log.toolStarted(1);\n // Startup recovery: one batch that fails everything open and continues the run.\n log.toolFailed({ tool: 1, providerId: \"call_1\", name: \"bash\" });\n log.append(\"TurnFailed\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n error: { message: \"turn interrupted\", code: \"turn.interrupted\" },\n });\n log.runInterrupted(1);\n log.runStarted({ run: 2, commands: [1] });\n log.append(\"RecoveryCompleted\", {\n trigger: \"runtime-restart\",\n continuation: {\n commandId: ids.command(1),\n interruptedRunId: ids.run(1),\n replacementRunId: ids.run(2),\n },\n });\n log.assistantTurn({ run: 2, turn: 2, inference: 2, message: 102, text: \"resumed\" });\n return log.runCompleted(2, [1]);\n};\n\nconst midRunCompaction = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"one\",\n inputs: [1],\n tools: [1],\n });\n log.runCompleted(1, [1]);\n log.submit({ command: 2, message: 2, text: \"second\" });\n log.startRun({ run: 2, commands: [2] });\n log.assistantTurn({ run: 2, turn: 2, inference: 2, message: 102, text: \"two\", inputs: [2] });\n log.compaction({\n compaction: 1,\n summary: 1,\n retainedFromContextSeq: log.events.length,\n contextVersion: 1,\n });\n log.assistantTurn({ run: 2, turn: 3, inference: 3, message: 103, text: \"three\" });\n return log.runCompleted(2, [2]);\n};\n\nconst replacementMessageId = () => {\n // A pending submission pruned by a rebase is re-committed under a new message id when its\n // command starts (session 01a13b26 in the design): one record, two aliases.\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"before\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"busy\", inputs: [1] });\n log.submit({ command: 2, message: 2, text: \"queued during run\" });\n log.compaction({\n compaction: 1,\n summary: 1,\n retainedFromContextSeq: log.events.length + 1,\n contextVersion: 1,\n });\n log.runCompleted(1, [1]);\n log.append(\"CommandStarted\", { commandId: ids.command(2) });\n log.commitUser({ command: 2, message: 22, text: \"queued during run\" });\n log.runStarted({ run: 2, commands: [2] });\n log.assistantTurn({\n run: 2,\n turn: 2,\n inference: 2,\n message: 102,\n text: \"answered\",\n inputs: [22],\n });\n return log.runCompleted(2, [2]);\n};\n\nconst decorations = () => {\n const log = new TestLog().configure();\n log.appendForeign(\"gia-agent\", \"GiaSessionMetadataCommitted\", {\n ownerUserEmail: \"owner@example.com\",\n });\n // Web follow-up: author, attachments and a reference precede the command in one batch.\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", author(\"web:1\", \"a@example.com\"));\n log.appendForeign(\"gia-agent\", \"GiaFileAttachmentCreated\", {\n attachmentId: \"att-1\",\n relatedCommandIdempotencyKey: \"web:1\",\n ordinal: 0,\n fileName: \"a.txt\",\n });\n log.appendForeign(\"gia-agent\", \"GiaReferenceCreated\", {\n ordinal: 1,\n referenceId: \"ref-2\",\n relatedCommandIdempotencyKey: \"web:1\",\n target: { kind: \"doc\", id: \"d2\" },\n });\n log.appendForeign(\"gia-agent\", \"GiaReferenceCreated\", {\n ordinal: 0,\n referenceId: \"ref-1\",\n relatedCommandIdempotencyKey: \"web:1\",\n target: { kind: \"doc\", id: \"d1\" },\n });\n log.submit({ command: 1, message: 1, text: \"with files\", idempotencyKey: \"web:1\" });\n // A decoration after its command, a replaced attachment, and a second author (first wins).\n log.appendForeign(\"gia-agent\", \"GiaFileAttachmentCreated\", {\n attachmentId: \"att-1\",\n relatedCommandIdempotencyKey: \"web:1\",\n ordinal: 0,\n fileName: \"a-renamed.txt\",\n });\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", author(\"web:1\", \"b@example.com\"));\n // Subagent wakeup: the notice precedes a command whose id is the notification id.\n log.appendForeign(\"gia-agent\", \"GiaSubagentNotificationCommitted\", {\n notificationId: ids.command(2),\n children: [{ name: \"child\", sessionId: \"s\", state: \"completed\" }],\n });\n log.submit({\n command: 2,\n message: 2,\n text: \"children done\",\n idempotencyKey: `subagent:notify:${ids.command(2)}`,\n });\n // No author event for this key: the latest author is the fallback.\n log.submit({ command: 3, message: 3, text: \"no author\", idempotencyKey: \"slack:3\" });\n // Invalid decorations degrade only themselves; unmapped namespaces are ignored.\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", {\n relatedCommandIdempotencyKey: \"slack:3\",\n });\n log.appendForeign(\"gia-agent\", \"GiaFileAttachmentCreated\", {\n relatedCommandIdempotencyKey: \"slack:3\",\n fileName: \"no id\",\n });\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", {\n relatedCommandIdempotencyKey: 7,\n userEmail: \"x\",\n });\n log.appendForeign(\"other-app\", \"Whatever\", { relatedCommandIdempotencyKey: \"web:1\" });\n // An orphan decoration whose command never arrives.\n log.appendForeign(\"gia-agent\", \"GiaUserMessageAuthorCommitted\", author(\"never\", \"c@example.com\"));\n log.startRun({ run: 1, commands: [1, 2, 3] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"ok\", inputs: [1, 2, 3] });\n return log.runCompleted(1, [1, 2, 3]);\n};\n\nconst ignoredEvents = () => {\n const log = new TestLog().configure();\n log.append(\"SystemMessageCommitted\", { messageId: ids.message(90), content: \"system prompt\" });\n log.append(\"RunSchedulingRequested\", {\n requestId: ids.event(900),\n work: { _tag: \"Command\", commandId: ids.command(1) },\n });\n log.append(\"RunSchedulingDelivered\", { requestId: ids.event(900) });\n log.append(\"RunSchedulingGranted\", { requestId: ids.event(900), runId: ids.run(1) });\n log.append(\"RunSchedulingInvalidated\", { requestId: ids.event(901), reason: \"stopped\" });\n log.submit({ command: 1, message: 1, text: \"hello\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.append(\"StopTurnRequested\", {\n commandId: ids.command(2),\n runId: ids.run(1),\n turnId: ids.turn(1),\n });\n log.append(\"StopTurnApplied\", {\n commandId: ids.command(2),\n runId: ids.run(1),\n turnId: ids.turn(1),\n });\n log.append(\"TurnStopped\", { runId: ids.run(1), turnId: ids.turn(1), reason: \"stop\" });\n log.append(\"ContextProjected\", { contextVersion: 0, throughSeq: log.events.length });\n log.append(\"BaseStateRequested\", { baseStateId: ids.event(902), requestedThroughSeq: 1 });\n log.append(\"BaseStateCreated\", { baseStateId: ids.event(902), coversThroughSeq: 1 });\n log.append(\"BaseStateFailed\", { baseStateId: ids.event(903), error: { message: \"x\" } });\n log.append(\"CompactionRequested\", {\n compactionId: ids.compaction(9),\n sourceFromSeq: 1,\n sourceToSeq: 2,\n });\n log.append(\"CompactionStarted\", { compactionId: ids.compaction(9) });\n log.append(\"CompactionFailed\", { compactionId: ids.compaction(9), error: { message: \"no\" } });\n log.append(\"RunInterrupted\", { runId: ids.run(1), reason: \"legacy stop\" });\n log.append(\"CommandFailed\", { commandId: ids.command(1), error: { message: \"x\" } });\n return log;\n};\n\nconst legacyAttempts = () => {\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"legacy\" });\n log.startRun({ run: 1, commands: [1] });\n log.turn({ run: 1, turn: 1, inputs: [1] });\n log.append(\"TurnAttemptStarted\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n });\n log.append(\"AssistantMessageCommitted\", {\n messageId: ids.message(101),\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n promptParts: [\n { type: \"text\", text: \"legacy answer\" },\n { type: \"tool-call\", id: \"call_1\", name: \"search\", params: {}, providerExecuted: false },\n ],\n });\n log.append(\"ToolCallCreated\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n toolCallId: ids.tool(1),\n promptPart: {\n type: \"tool-call\",\n id: \"call_1\",\n name: \"search\",\n params: {},\n providerExecuted: false,\n },\n });\n log.append(\"TurnAttemptCompleted\", {\n runId: ids.run(1),\n turnId: ids.turn(1),\n attemptId: ids.inference(1),\n usage: { inputTokens: 3, outputTokens: 4 },\n });\n log.toolStarted(1);\n log.toolCompleted({ tool: 1, providerId: \"call_1\", name: \"search\" });\n log.turnCompleted({ run: 1, turn: 1 });\n return log.runCompleted(1, [1]);\n};\n\nconst failuresAndRepeatedCompletion = () => {\n const log = new TestLog().configure();\n // An interrupt submission whose start fails never becomes a message: it is withdrawn.\n log.admitOnly({ command: 1, text: \"stop and do this\" });\n log.append(\"CommandStarted\", { commandId: ids.command(1) });\n log.append(\"CommandFailed\", { commandId: ids.command(1), error: { message: \"start failed\" } });\n log.submit({ command: 2, message: 2, text: \"next\" });\n log.startRun({ run: 1, commands: [2] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"ok\", inputs: [2] });\n log.compaction({\n compaction: 1,\n summary: 1,\n retainedFromContextSeq: log.events.length,\n contextVersion: 1,\n });\n // A repeated completion adds no usage, as in the reduced state.\n log.append(\"CompactionCompleted\", {\n compactionId: ids.compaction(1),\n modelSelection: { provider: \"test\", modelId: \"model-a\" },\n usage: { inputTokens: 100, outputTokens: 20 },\n });\n return log.runCompleted(1, [2]);\n};\n\nconst oneTurnConsumesSeveral = () => {\n // A queued message is promoted after steering arrives; the turn lists the steering first, but the\n // prompt (and so the transcript) orders the submissions as they were submitted.\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.submit({ command: 2, message: 2, text: \"queued\" });\n log.startRun({ run: 1, commands: [1] });\n log.steer({ command: 3, message: 3, run: 1, text: \"steering\" });\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(9),\n messageId: ids.message(2),\n from: \"queue\",\n to: \"steer\",\n });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"all three\",\n inputs: [1, 3, 2],\n });\n return log.runCompleted(1, [1]);\n};\n\nconst oneTurnConsumesSeveralSubmitted = () => {\n // The same tie with today's runtime shapes: steering arrives as a steer-disposition submission.\n const log = new TestLog().configure();\n log.submit({ command: 1, message: 1, text: \"first\" });\n log.submit({ command: 2, message: 2, text: \"queued\" });\n log.startRun({ run: 1, commands: [1] });\n log.submit({ command: 3, message: 3, text: \"steering\", disposition: \"steer\" });\n log.append(\"UserMessagePromoted\", {\n commandId: ids.command(9),\n messageId: ids.message(2),\n from: \"queue\",\n to: \"steer\",\n });\n log.assistantTurn({\n run: 1,\n turn: 1,\n inference: 1,\n message: 101,\n text: \"all three\",\n inputs: [1, 3, 2],\n });\n return log.runCompleted(1, [1]);\n};\n\n/** A decider's batch: its marker, an app fact and the admitted message, then a reply. */\nconst deciderBatch = () => {\n const log = new TestLog().configure();\n log.deciderAccepted({ decider: \"docs.chat.PostMessage\", key: \"msg-1\", result: { route: \"ai\" } });\n log.appendForeign(\"docs.chat\", \"MessageRouted\", { route: \"ai\", idempotencyKey: \"msg-1\" });\n log.submit({ command: 1, message: 1, text: \"hello\", idempotencyKey: \"msg-1\" });\n log.startRun({ run: 1, commands: [1] });\n log.assistantTurn({ run: 1, turn: 1, inference: 1, message: 101, text: \"hi\", inputs: [1] });\n // A retry found the marker and committed nothing; a second decision commits its own marker.\n log.deciderAccepted({\n decider: \"docs.chat.PostMessage\",\n key: \"msg-2\",\n result: { route: \"human\" },\n });\n log.appendForeign(\"docs.chat\", \"MessageRouted\", { route: \"human\", idempotencyKey: \"msg-2\" });\n return log.runCompleted(1, [1]);\n};\n\nconst scenario = (name: string, compacted: boolean, build: () => TestLog): TranscriptScenario => ({\n name,\n compacted,\n events: build().events,\n});\n\n/** Build the corpus. Logs are deterministic: ids, timestamps and traces are fixed. */\nexport const transcriptScenarios = (): ReadonlyArray<TranscriptScenario> => [\n scenario(\"queue-run-tools\", false, queueRunTools),\n scenario(\"legacy-committed-user\", false, legacyCommitted),\n scenario(\"steering\", false, steering),\n scenario(\"promote-pause-cancel\", false, promotePauseCancel),\n scenario(\"partial-failure-empty-success-import\", false, partialEmptyImport),\n scenario(\"rejected-tool-repeated-terminals\", false, rejectedAndRepeatedTerminals),\n scenario(\"recovery-continuation\", false, recovery),\n scenario(\"mid-run-compaction\", true, midRunCompaction),\n scenario(\"replacement-message-id\", true, replacementMessageId),\n scenario(\"host-decorations\", false, decorations),\n scenario(\"events-without-transcript-meaning\", false, ignoredEvents),\n scenario(\"legacy-attempts\", false, legacyAttempts),\n scenario(\"failed-interrupt-repeated-compaction-completion\", true, failuresAndRepeatedCompletion),\n scenario(\"one-turn-consumes-several\", false, oneTurnConsumesSeveral),\n scenario(\"one-turn-consumes-several-submitted\", false, oneTurnConsumesSeveralSubmitted),\n scenario(\"decider-marker\", false, deciderBatch),\n];\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,MAAM,eAAe,oBAAoB;CACvC,SAAS;CACT,QAAQ;AACV,CAAC;;AAED,MAAa,iBAAiB;CAAE,MAAM;CAAc,OAAO,CAAC;AAAE;AAC9D,MAAM,WAAW;CAAE,MAAM;CAAc,OAAO,CAAC;AAAE;;AAGjD,MAAa,UAAU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,CAAC,CAAC,CAAC;AAChC;AAEA,MAAM,YAAY,MAAc,WAAoB,WAA8C;CAChG;CACA;CACA,QAAQ,MAAM,CAAC,CAAC;AAClB;;AAGA,MAAa,4BAA+D;CAC1E,SAAS,mBAAmB,OAAO,aAAa;CAChD,SAAS,yBAAyB,OAAO,eAAe;CACxD,SAAS,YAAY,OAAO,QAAQ;CACpC,SAAS,wBAAwB,OAAO,kBAAkB;CAC1D,SAAS,wCAAwC,OAAO,kBAAkB;CAC1E,SAAS,oCAAoC,OAAO,4BAA4B;CAChF,SAAS,yBAAyB,OAAO,QAAQ;CACjD,SAAS,sBAAsB,MAAM,gBAAgB;CACrD,SAAS,0BAA0B,MAAM,oBAAoB;CAC7D,SAAS,oBAAoB,OAAO,WAAW;CAC/C,SAAS,qCAAqC,OAAO,aAAa;CAClE,SAAS,mBAAmB,OAAO,cAAc;CACjD,SAAS,mDAAmD,MAAM,6BAA6B;CAC/F,SAAS,6BAA6B,OAAO,sBAAsB;CACnE,SAAS,uCAAuC,OAAO,+BAA+B;CACtF,SAAS,kBAAkB,OAAO,YAAY;AAChD"}
@@ -1,9 +1,9 @@
1
1
  import { b as TurnId, h as SequenceNumber, l as InferenceId } from "./core-BcimKMIv.js";
2
- import { f as PositionedEvent } from "./envelope-Che6KatU.js";
3
- import "./events-DwTARLMv.js";
4
- import { $ as TranscriptAssistantPart, A as TranscriptDefinition, At as TranscriptToolRecord, B as makeTranscriptDefinition, Bt as transcriptDecorationBufferLimit, C as TranscriptVersionMeta, Ct as TranscriptRecordView, D as TranscriptWindowSelector, Dt as TranscriptRunOutcome, E as TranscriptWindowLimits, Et as TranscriptRunMember, F as TranscriptMappingOperation, Ft as TranscriptVersion, G as DecorationBufferRecordId, H as AssistantRecordId, Ht as transcriptRecordId, I as TranscriptMappingTarget, It as UserRecordId, J as PendingTranscriptUserRecord, K as ImportAssistantRecordId, L as TranscriptMappings, Lt as isPendingTranscriptUserRecord, M as TranscriptListEntryKey, Mt as TranscriptUnknownRecord, N as TranscriptMappedEvent, Nt as TranscriptUserRecord, O as defaultTranscriptWindowLimits, Ot as TranscriptSessionContextRecord, P as TranscriptMapping, Pt as TranscriptUserState, Q as TranscriptAssistantLifecycle, R as TranscriptUserFallback, Rt as isTopLevelTranscriptRecord, S as TranscriptReadiness, St as TranscriptRecordKind, T as TranscriptWindow, Tt as TranscriptRunGroupRecord, U as CompactionRecordId, Ut as transcriptStoredInlineBodyLimit, V as transcriptMappingBounds, Vt as transcriptRecordEnvelopeFormat, W as ConsumedTranscriptUserRecord, X as SessionContextRecordId, Y as RunGroupRecordId, Z as ToolRecordId, _ as EDATranscriptStoreShape, _t as TranscriptPosition, at as TranscriptCompactionRecord, b as TranscriptActiveContent, bt as TranscriptRecordFromEnvelope, ct as TranscriptDecorationBufferRecord, dt as TranscriptDecorationKey, et as TranscriptAssistantRecord, ft as TranscriptDecorations, g as EDATranscriptStore, gt as TranscriptOrderKey, ht as TranscriptOrder, it as TranscriptClassification, j as TranscriptDefinitionError, jt as TranscriptTopLevelRecord, k as transcriptCursorOf, kt as TranscriptToolLifecycle, lt as TranscriptDecorationEntryId, mt as TranscriptLogIncarnation, nt as TranscriptBodySource, ot as TranscriptCursor, pt as TranscriptFieldPath, q as InferenceAssistantRecordId, rt as TranscriptBufferedDecoration, st as TranscriptDecoration, tt as TranscriptBody, ut as TranscriptDecorationEntryKey, v as TranscriptCursorMismatch, vt as TranscriptRecord, w as TranscriptVersionStatus, wt as TranscriptRecordViewFromEnvelope, x as TranscriptActivePart, xt as TranscriptRecordId, y as TranscriptMaintenanceConfig, yt as TranscriptRecordEnvelope, z as emptyTranscriptMappings, zt as runGroupStatus } from "./session-store-BL6sfrnn.js";
5
- import { a as transcriptReadiness, c as TranscriptAliasNamespace, d as TranscriptProjectionError, i as readTranscriptWindowFrom, l as TranscriptChangePlan, n as buildingTranscriptWindow, o as PlanTranscriptBatch, r as inactiveTranscriptWindow, s as TranscriptAlias, t as TranscriptWindowSource, u as TranscriptLookup } from "./window-read-Brov9VdQ.js";
6
- import { a as TranscriptSubscriptionRead, c as defaultTranscriptSubscriptionPolicy, d as transcriptCoverageOf, f as transcriptSubscriptionBaseOf, i as TranscriptSubscriptionPolicy, l as planTranscriptUpdate, n as TranscriptRequestId, o as TranscriptSubscriptionRequest, r as TranscriptSubscriptionBase, s as TranscriptUpdate, t as TranscriptCoverage, u as readTranscriptSubscription } from "./subscription-DZNWFDTV.js";
2
+ import { p as PositionedEvent } from "./envelope-CJnPfbjC.js";
3
+ import "./events-AIIwZ6dS.js";
4
+ import { $ as TranscriptAssistantLifecycle, A as transcriptCursorOf, At as TranscriptToolLifecycle, B as emptyTranscriptMappings, Bt as runGroupStatus, C as TranscriptReadiness, Ct as TranscriptRecordKind, D as TranscriptWindowLimits, Dt as TranscriptRunMember, E as TranscriptWindow, Et as TranscriptRunGroupRecord, F as TranscriptMapping, Ft as TranscriptUserState, G as ConsumedTranscriptUserRecord, H as transcriptMappingBounds, Ht as transcriptRecordEnvelopeFormat, I as TranscriptMappingOperation, It as TranscriptVersion, J as InferenceAssistantRecordId, K as DecorationBufferRecordId, L as TranscriptMappingTarget, Lt as UserRecordId, M as TranscriptDefinitionError, Mt as TranscriptTopLevelRecord, N as TranscriptListEntryKey, Nt as TranscriptUnknownRecord, O as TranscriptWindowSelector, Ot as TranscriptRunOutcome, P as TranscriptMappedEvent, Pt as TranscriptUserRecord, Q as ToolRecordId, R as TranscriptMappings, Rt as isPendingTranscriptUserRecord, S as TranscriptActivePart, St as TranscriptRecordId, T as TranscriptVersionStatus, Tt as TranscriptRecordViewFromEnvelope, U as AssistantRecordId, Ut as transcriptRecordId, V as makeTranscriptDefinition, Vt as transcriptDecorationBufferLimit, W as CompactionRecordId, Wt as transcriptStoredInlineBodyLimit, X as RunGroupRecordId, Y as PendingTranscriptUserRecord, Z as SessionContextRecordId, _ as EDATranscriptStore, _t as TranscriptOrderKey, at as TranscriptClassification, b as TranscriptMaintenanceConfig, bt as TranscriptRecordEnvelope, ct as TranscriptDecoration, dt as TranscriptDecorationEntryKey, et as TranscriptAssistantPart, ft as TranscriptDecorationKey, gt as TranscriptOrder, ht as TranscriptLogIncarnation, it as TranscriptBufferedDecoration, j as TranscriptDefinition, jt as TranscriptToolRecord, k as defaultTranscriptWindowLimits, kt as TranscriptSessionContextRecord, lt as TranscriptDecorationBufferRecord, mt as TranscriptFieldPath, nt as TranscriptBody, ot as TranscriptCompactionRecord, pt as TranscriptDecorations, q as ImportAssistantRecordId, rt as TranscriptBodySource, st as TranscriptCursor, tt as TranscriptAssistantRecord, ut as TranscriptDecorationEntryId, v as EDATranscriptStoreShape, vt as TranscriptPosition, w as TranscriptVersionMeta, wt as TranscriptRecordView, x as TranscriptActiveContent, xt as TranscriptRecordFromEnvelope, y as TranscriptCursorMismatch, yt as TranscriptRecord, z as TranscriptUserFallback, zt as isTopLevelTranscriptRecord } from "./session-store-DaSHeg8Q.js";
5
+ import { a as transcriptReadiness, c as TranscriptAliasNamespace, d as TranscriptProjectionError, i as readTranscriptWindowFrom, l as TranscriptChangePlan, n as buildingTranscriptWindow, o as PlanTranscriptBatch, r as inactiveTranscriptWindow, s as TranscriptAlias, t as TranscriptWindowSource, u as TranscriptLookup } from "./window-read-BELSkO-r.js";
6
+ import { a as TranscriptSubscriptionRead, c as defaultTranscriptSubscriptionPolicy, d as transcriptCoverageOf, f as transcriptSubscriptionBaseOf, i as TranscriptSubscriptionPolicy, l as planTranscriptUpdate, n as TranscriptRequestId, o as TranscriptSubscriptionRequest, r as TranscriptSubscriptionBase, s as TranscriptUpdate, t as TranscriptCoverage, u as readTranscriptSubscription } from "./subscription-BhwUmsl4.js";
7
7
  import * as Schema from "effect/Schema";
8
8
  //#region src/transcript/interpreter.d.ts
9
9
  /**
@@ -1,10 +1,10 @@
1
1
  import { SequenceNumber } from "./types/core.js";
2
- import { G as InferenceCompletedEvent, J as InferenceFailedEvent, X as InferenceStartedEvent, cn as TurnCompletedEvent, dn as TurnFailedEvent, hn as TurnStoppedEvent } from "./durable-D13w1Qr3.js";
2
+ import { Q as InferenceStartedEvent, X as InferenceFailedEvent, _n as TurnStoppedEvent, pn as TurnFailedEvent, q as InferenceCompletedEvent, un as TurnCompletedEvent } from "./durable-Da57Rcml.js";
3
3
  import { ReasoningDeltaEvent, TextDeltaEvent, ToolParamsDeltaEvent, ToolParamsStartEvent } from "./types/events.js";
4
- import { _ as computeTranscriptVersion, a as TranscriptDefinitionError, c as TranscriptMapping, d as TranscriptMappings, f as TranscriptUserFallback, g as canonicalJson, h as transcriptMappingBounds, i as TranscriptDefinition, l as TranscriptMappingOperation, m as makeTranscriptDefinition, n as TranscriptAliasNamespace, o as TranscriptListEntryKey, p as emptyTranscriptMappings, r as TranscriptProjectionError, s as TranscriptMappedEvent, t as planTranscriptBatch, u as TranscriptMappingTarget, v as transcriptSemanticRevision, y as resolveTranscriptBody } from "./interpreter-DKGJ1sSx.js";
5
- import { A as TranscriptRecordFromEnvelope, B as TranscriptUserRecord, C as TranscriptDecorations, D as TranscriptPosition, E as TranscriptOrder, F as TranscriptRunOutcome, G as isTopLevelTranscriptRecord, H as TranscriptVersion, I as TranscriptSessionContextRecord, J as transcriptRecordEnvelopeFormat, K as runGroupStatus, L as TranscriptToolLifecycle, M as TranscriptRecordViewFromEnvelope, N as TranscriptRunGroupRecord, O as TranscriptRecord, P as TranscriptRunMember, R as TranscriptToolRecord, S as TranscriptDecorationKey, T as TranscriptLogIncarnation, U as UserRecordId, V as TranscriptUserState, W as isPendingTranscriptUserRecord, X as transcriptStoredInlineBodyLimit, Y as transcriptRecordId, _ as TranscriptCursor, a as InferenceAssistantRecordId, b as TranscriptDecorationEntryId, c as ToolRecordId, d as TranscriptAssistantRecord, f as TranscriptBody, g as TranscriptCompactionRecord, h as TranscriptClassification, i as ImportAssistantRecordId, j as TranscriptRecordId, k as TranscriptRecordEnvelope, l as TranscriptAssistantLifecycle, m as TranscriptBufferedDecoration, n as CompactionRecordId, o as RunGroupRecordId, p as TranscriptBodySource, q as transcriptDecorationBufferLimit, r as DecorationBufferRecordId, s as SessionContextRecordId, t as AssistantRecordId, u as TranscriptAssistantPart, v as TranscriptDecoration, w as TranscriptFieldPath, x as TranscriptDecorationEntryKey, y as TranscriptDecorationBufferRecord, z as TranscriptUnknownRecord } from "./records--54mZEBx.js";
6
- import { a as EDATranscriptStore, i as transcriptReadiness, n as inactiveTranscriptWindow, o as TranscriptCursorMismatch, r as readTranscriptWindowFrom, t as buildingTranscriptWindow } from "./window-read-DPFAA1hM.js";
7
- import { _ as TranscriptWindowSelector, a as defaultTranscriptSubscriptionPolicy, c as transcriptCoverageOf, d as TranscriptActivePart, f as TranscriptReadiness, g as TranscriptWindowLimits, h as TranscriptWindow, i as TranscriptUpdate, l as transcriptSubscriptionBaseOf, m as TranscriptVersionStatus, n as TranscriptRequestId, o as planTranscriptUpdate, p as TranscriptVersionMeta, r as TranscriptSubscriptionBase, s as readTranscriptSubscription, t as TranscriptCoverage, u as TranscriptActiveContent, v as defaultTranscriptWindowLimits, y as transcriptCursorOf } from "./subscription-DmO3BcdT.js";
4
+ import { _ as computeTranscriptVersion, a as TranscriptDefinitionError, c as TranscriptMapping, d as TranscriptMappings, f as TranscriptUserFallback, g as canonicalJson, h as transcriptMappingBounds, i as TranscriptDefinition, l as TranscriptMappingOperation, m as makeTranscriptDefinition, n as TranscriptAliasNamespace, o as TranscriptListEntryKey, p as emptyTranscriptMappings, r as TranscriptProjectionError, s as TranscriptMappedEvent, t as planTranscriptBatch, u as TranscriptMappingTarget, v as transcriptSemanticRevision, y as resolveTranscriptBody } from "./interpreter-BwYN2PCC.js";
5
+ import { A as TranscriptRecordFromEnvelope, B as TranscriptUserRecord, C as TranscriptDecorations, D as TranscriptPosition, E as TranscriptOrder, F as TranscriptRunOutcome, G as isTopLevelTranscriptRecord, H as TranscriptVersion, I as TranscriptSessionContextRecord, J as transcriptRecordEnvelopeFormat, K as runGroupStatus, L as TranscriptToolLifecycle, M as TranscriptRecordViewFromEnvelope, N as TranscriptRunGroupRecord, O as TranscriptRecord, P as TranscriptRunMember, R as TranscriptToolRecord, S as TranscriptDecorationKey, T as TranscriptLogIncarnation, U as UserRecordId, V as TranscriptUserState, W as isPendingTranscriptUserRecord, X as transcriptStoredInlineBodyLimit, Y as transcriptRecordId, _ as TranscriptCursor, a as InferenceAssistantRecordId, b as TranscriptDecorationEntryId, c as ToolRecordId, d as TranscriptAssistantRecord, f as TranscriptBody, g as TranscriptCompactionRecord, h as TranscriptClassification, i as ImportAssistantRecordId, j as TranscriptRecordId, k as TranscriptRecordEnvelope, l as TranscriptAssistantLifecycle, m as TranscriptBufferedDecoration, n as CompactionRecordId, o as RunGroupRecordId, p as TranscriptBodySource, q as transcriptDecorationBufferLimit, r as DecorationBufferRecordId, s as SessionContextRecordId, t as AssistantRecordId, u as TranscriptAssistantPart, v as TranscriptDecoration, w as TranscriptFieldPath, x as TranscriptDecorationEntryKey, y as TranscriptDecorationBufferRecord, z as TranscriptUnknownRecord } from "./records-D0ZIAOzd.js";
6
+ import { a as EDATranscriptStore, i as transcriptReadiness, n as inactiveTranscriptWindow, o as TranscriptCursorMismatch, r as readTranscriptWindowFrom, t as buildingTranscriptWindow } from "./window-read-FJTCDaSq.js";
7
+ import { _ as TranscriptWindowSelector, a as defaultTranscriptSubscriptionPolicy, c as transcriptCoverageOf, d as TranscriptActivePart, f as TranscriptReadiness, g as TranscriptWindowLimits, h as TranscriptWindow, i as TranscriptUpdate, l as transcriptSubscriptionBaseOf, m as TranscriptVersionStatus, n as TranscriptRequestId, o as planTranscriptUpdate, p as TranscriptVersionMeta, r as TranscriptSubscriptionBase, s as readTranscriptSubscription, t as TranscriptCoverage, u as TranscriptActiveContent, v as defaultTranscriptWindowLimits, y as transcriptCursorOf } from "./subscription-D7U4Tziv.js";
8
8
  import * as Schema from "effect/Schema";
9
9
  //#region src/transcript/active-content.ts
10
10
  /** The accumulator before anything is published in this isolate. */
@@ -1,2 +1,2 @@
1
- import { $ as LegacyAttemptEvent, $n as pendingMessagesPausedEventType, $t as ToolCallRejectedPayload, A as CompactionFailedEvent, An as baseStateCreatedEventType, At as SessionConfiguredEvent, B as ContextRebasedPayload, Bn as compactionRequestedEventType, Bt as SummaryCreatedEvent, C as CommandEvent, Cn as UserMessagePromotedEvent, Cr as turnStartedEventType, Ct as RunSchedulingGrantedPayload, D as CommandStartedPayload, Dn as assistantMessageCommittedEventType, Dr as userMessagePromotedEventType, Dt as RunSchedulingRequestedPayload, E as CommandStartedEvent, En as UserMessageSubmittedPayload, Er as userMessageCommittedEventType, Et as RunSchedulingRequestedEvent, F as CompactionStartedPayload, Fn as commandCompletedEventType, Ft as StopControlEvent, G as InferenceCompletedEvent, Gn as decodeUnknownEDADurableEvent, Gt as ToolCallCompletedPayload, H as DecodedDurableEvent, Hn as contextProjectedEventType, Ht as SystemMessageCommittedEvent, I as ContextAndCompactionEvent, In as commandFailedEventType, It as StopTurnAppliedEvent, J as InferenceFailedEvent, Jn as inferenceCompletedEventType, Jt as ToolCallEvent, K as InferenceCompletedPayload, Kn as decodeUnknownEDADurableEventSync, Kt as ToolCallCreatedEvent, L as ContextProjectedEvent, Ln as commandStartedEventType, Lt as StopTurnAppliedPayload, M as CompactionRequestedEvent, Mn as baseStateRequestedEventType, Mt as SteeringMessageCancelledPayload, N as CompactionRequestedPayload, Nn as commandAdmittedEventType, Nt as SteeringMessageQueuedEvent, O as CompactionCompletedEvent, On as assistantMessageImportedEventType, Or as userMessageSubmittedEventType, Ot as RunStartedEvent, P as CompactionStartedEvent, Pn as commandCancelledEventType, Pt as SteeringMessageQueuedPayload, Q as LegacyAssistantMessageCommittedEvent, Qn as messageQueuePausedEventType, Qt as ToolCallRejectedEvent, R as ContextProjectedPayload, Rn as compactionCompletedEventType, Rt as StopTurnRequestedEvent, S as CommandCompletedPayload, Sn as UserMessageDisposition, Sr as turnFailedEventType, St as RunSchedulingGrantedEvent, T as CommandFailedPayload, Tn as UserMessageSubmittedEvent, Tr as userMessageCancelledEventType, Tt as RunSchedulingInvalidatedPayload, U as EDADurableEvent, Un as contextRebasedEventType, Ut as SystemMessageCommittedPayload, V as CurrentEDADurableEvent, Vn as compactionStartedEventType, Vt as SummaryCreatedPayload, W as EDADurableEventV1, Wn as decodeDurableEventSync, Wt as ToolCallCompletedEvent, X as InferenceStartedEvent, Xn as inferenceStartedEventType, Xt as ToolCallFailedPayload, Y as InferenceFailedPayload, Yn as inferenceFailedEventType, Yt as ToolCallFailedEvent, Z as InferenceStartedPayload, Zn as interpretLegacyAttemptForReduction, Zt as ToolCallPromptPart, _ as CommandAdmittedEvent, _n as UserMessageCancellationReason, _r as toolCallCreatedEventType, _t as RunInterruptedEvent, a as AssistantMessageImportedPayload, an as ToolPromptPart, ar as runSchedulingGrantedEventType, at as MessageQueuePausedPayload, b as CommandCancelledPayload, bn as UserMessageCommittedEvent, br as toolCallStartedEventType, bt as RunSchedulingDeliveredPayload, c as AssistantPromptPart, cn as TurnCompletedEvent, cr as runStartedEventType, ct as RecoveryCompletedEvent, d as BaseStateCreatedPayload, dn as TurnFailedEvent, dr as steeringMessageQueuedEventType, dt as RecoveryEvent, en as ToolCallRejectionFeedback, er as recoveryCompletedEventType, et as LegacyToolCallCreatedEvent, f as BaseStateEvent, fn as TurnFailedPayload, fr as stopTurnAppliedEventType, ft as RunCompletedEvent, g as BaseStateRequestedPayload, gn as TurnStoppedPayload, gr as toolCallCompletedEventType, gt as RunFailedPayload, h as BaseStateRequestedEvent, hn as TurnStoppedEvent, hr as systemMessageCommittedEventType, ht as RunFailedEvent, i as AssistantMessageImportedEvent, in as ToolFailurePromptPart, ir as runSchedulingDeliveredEventType, it as MessageQueuePausedEvent, j as CompactionFailedPayload, jn as baseStateFailedEventType, jt as SteeringMessageCancelledEvent, k as CompactionCompletedPayload, kn as assistantPartialCommittedEventType, kt as RunStartedPayload, l as AssistantPromptParts, ln as TurnCompletedPayload, lr as sessionConfiguredEventType, lt as RecoveryCompletedPayload, m as BaseStateFailedPayload, mn as TurnStartedPayload, mr as summaryCreatedEventType, mt as RunEvent, n as AssistantMessageCommittedPayload, nn as ToolCallStartedEvent, nr as runFailedEventType, nt as LegacyTurnAttemptStartedEvent, o as AssistantPartialCommittedEvent, on as ToolRejectionPromptPart, or as runSchedulingInvalidatedEventType, ot as PendingMessagesPausedEvent, p as BaseStateFailedEvent, pn as TurnStartedEvent, pr as stopTurnRequestedEventType, pt as RunCompletedPayload, q as InferenceEvent, qn as durableEventEnvelope, qt as ToolCallCreatedPayload, r as AssistantMessageContent, rn as ToolCallStartedPayload, rr as runInterruptedEventType, rt as MessageEvent, s as AssistantPartialCommittedPayload, sn as ToolSuccessPromptPart, sr as runSchedulingRequestedEventType, st as PendingMessagesPausedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallRejectionReason, tr as runCompletedEventType, tt as LegacyTurnAttemptCompletedEvent, u as BaseStateCreatedEvent, un as TurnEvent, ur as steeringMessageCancelledEventType, ut as RecoveryContinuation, v as CommandAdmittedPayload, vn as UserMessageCancelledEvent, vr as toolCallFailedEventType, vt as RunInterruptedPayload, w as CommandFailedEvent, wn as UserMessagePromotedPayload, wr as turnStoppedEventType, wt as RunSchedulingInvalidatedEvent, x as CommandCompletedEvent, xn as UserMessageCommittedPayload, xr as turnCompletedEventType, xt as RunSchedulingEvent, y as CommandCancelledEvent, yn as UserMessageCancelledPayload, yr as toolCallRejectedEventType, yt as RunSchedulingDeliveredEvent, z as ContextRebasedEvent, zn as compactionFailedEventType, zt as StopTurnRequestedPayload } from "../../durable-168Womqp.js";
2
- export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, CurrentEDADurableEvent, DecodedDurableEvent, EDADurableEvent, EDADurableEventV1, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, PendingMessagesPausedEvent, PendingMessagesPausedPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, SessionConfiguredEvent, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, decodeDurableEventSync, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durableEventEnvelope, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, messageQueuePausedEventType, pendingMessagesPausedEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, summaryCreatedEventType, systemMessageCommittedEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };
1
+ import { $ as InferenceStartedPayload, $n as inferenceStartedEventType, $t as ToolCallPromptPart, A as CompactionFailedEvent, An as assistantMessageImportedEventType, Ar as userMessagePromotedEventType, At as RunStartedEvent, B as ContextRebasedPayload, Bn as compactionCompletedEventType, Bt as StopTurnRequestedEvent, C as CommandEvent, Cn as UserMessageCommittedPayload, Cr as toolCallStartedEventType, Ct as RunSchedulingEvent, D as CommandStartedPayload, Dn as UserMessageSubmittedEvent, Dr as turnStoppedEventType, Dt as RunSchedulingInvalidatedPayload, E as CommandStartedEvent, En as UserMessagePromotedPayload, Er as turnStartedEventType, Et as RunSchedulingInvalidatedEvent, F as CompactionStartedPayload, Fn as commandAdmittedEventType, Ft as SteeringMessageQueuedEvent, G as EDADurableEvent, Gn as contextRebasedEventType, Gt as SystemMessageCommittedPayload, H as DeciderAcceptedEvent, Hn as compactionRequestedEventType, Ht as SummaryCreatedEvent, I as ContextAndCompactionEvent, In as commandCancelledEventType, It as SteeringMessageQueuedPayload, J as InferenceCompletedPayload, Jn as decodeUnknownEDADurableEvent, Jt as ToolCallCreatedEvent, K as EDADurableEventV1, Kn as deciderAcceptedEventType, Kt as ToolCallCompletedEvent, L as ContextProjectedEvent, Ln as commandCompletedEventType, Lt as StopControlEvent, M as CompactionRequestedEvent, Mn as baseStateCreatedEventType, Mt as SessionConfiguredEvent, N as CompactionRequestedPayload, Nn as baseStateFailedEventType, Nt as SteeringMessageCancelledEvent, O as CompactionCompletedEvent, On as UserMessageSubmittedPayload, Or as userMessageCancelledEventType, Ot as RunSchedulingRequestedEvent, P as CompactionStartedEvent, Pn as baseStateRequestedEventType, Pt as SteeringMessageCancelledPayload, Q as InferenceStartedEvent, Qn as inferenceFailedEventType, Qt as ToolCallFailedPayload, R as ContextProjectedPayload, Rn as commandFailedEventType, Rt as StopTurnAppliedEvent, S as CommandCompletedPayload, Sn as UserMessageCommittedEvent, Sr as toolCallRejectedEventType, St as RunSchedulingDeliveredPayload, T as CommandFailedPayload, Tn as UserMessagePromotedEvent, Tr as turnFailedEventType, Tt as RunSchedulingGrantedPayload, U as DeciderAcceptedPayload, Un as compactionStartedEventType, Ut as SummaryCreatedPayload, V as CurrentEDADurableEvent, Vn as compactionFailedEventType, Vt as StopTurnRequestedPayload, W as DecodedDurableEvent, Wn as contextProjectedEventType, Wt as SystemMessageCommittedEvent, X as InferenceFailedEvent, Xn as durableEventEnvelope, Xt as ToolCallEvent, Y as InferenceEvent, Yn as decodeUnknownEDADurableEventSync, Yt as ToolCallCreatedPayload, Z as InferenceFailedPayload, Zn as inferenceCompletedEventType, Zt as ToolCallFailedEvent, _ as CommandAdmittedEvent, _n as TurnStoppedEvent, _r as summaryCreatedEventType, _t as RunFailedEvent, a as AssistantMessageImportedPayload, an as ToolCallStartedPayload, ar as runFailedEventType, at as MessageEvent, b as CommandCancelledPayload, bn as UserMessageCancelledEvent, br as toolCallCreatedEventType, bt as RunInterruptedPayload, c as AssistantPromptPart, cn as ToolRejectionPromptPart, cr as runSchedulingGrantedEventType, ct as PendingMessagesPausedEvent, d as BaseStateCreatedPayload, dn as TurnCompletedPayload, dr as runStartedEventType, dt as RecoveryCompletedPayload, en as ToolCallRejectedEvent, er as interpretLegacyAttemptForReduction, et as LegacyAssistantMessageCommittedEvent, f as BaseStateEvent, fn as TurnEvent, fr as sessionConfiguredEventType, ft as RecoveryContinuation, g as BaseStateRequestedPayload, gn as TurnStartedPayload, gr as stopTurnRequestedEventType, gt as RunEvent, h as BaseStateRequestedEvent, hn as TurnStartedEvent, hr as stopTurnAppliedEventType, ht as RunCompletedPayload, i as AssistantMessageImportedEvent, in as ToolCallStartedEvent, ir as runCompletedEventType, it as LegacyTurnAttemptStartedEvent, j as CompactionFailedPayload, jn as assistantPartialCommittedEventType, jr as userMessageSubmittedEventType, jt as RunStartedPayload, k as CompactionCompletedPayload, kn as assistantMessageCommittedEventType, kr as userMessageCommittedEventType, kt as RunSchedulingRequestedPayload, l as AssistantPromptParts, ln as ToolSuccessPromptPart, lr as runSchedulingInvalidatedEventType, lt as PendingMessagesPausedPayload, m as BaseStateFailedPayload, mn as TurnFailedPayload, mr as steeringMessageQueuedEventType, mt as RunCompletedEvent, n as AssistantMessageCommittedPayload, nn as ToolCallRejectionFeedback, nr as pendingMessagesPausedEventType, nt as LegacyToolCallCreatedEvent, o as AssistantPartialCommittedEvent, on as ToolFailurePromptPart, or as runInterruptedEventType, ot as MessageQueuePausedEvent, p as BaseStateFailedEvent, pn as TurnFailedEvent, pr as steeringMessageCancelledEventType, pt as RecoveryEvent, q as InferenceCompletedEvent, qn as decodeDurableEventSync, qt as ToolCallCompletedPayload, r as AssistantMessageContent, rn as ToolCallRejectionReason, rr as recoveryCompletedEventType, rt as LegacyTurnAttemptCompletedEvent, s as AssistantPartialCommittedPayload, sn as ToolPromptPart, sr as runSchedulingDeliveredEventType, st as MessageQueuePausedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallRejectedPayload, tr as messageQueuePausedEventType, tt as LegacyAttemptEvent, u as BaseStateCreatedEvent, un as TurnCompletedEvent, ur as runSchedulingRequestedEventType, ut as RecoveryCompletedEvent, v as CommandAdmittedPayload, vn as TurnStoppedPayload, vr as systemMessageCommittedEventType, vt as RunFailedPayload, w as CommandFailedEvent, wn as UserMessageDisposition, wr as turnCompletedEventType, wt as RunSchedulingGrantedEvent, x as CommandCompletedEvent, xn as UserMessageCancelledPayload, xr as toolCallFailedEventType, xt as RunSchedulingDeliveredEvent, y as CommandCancelledEvent, yn as UserMessageCancellationReason, yr as toolCallCompletedEventType, yt as RunInterruptedEvent, z as ContextRebasedEvent, zn as commandStartedEventType, zt as StopTurnAppliedPayload } from "../../durable-BXqwM70o.js";
2
+ export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, CurrentEDADurableEvent, DeciderAcceptedEvent, DeciderAcceptedPayload, DecodedDurableEvent, EDADurableEvent, EDADurableEventV1, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, PendingMessagesPausedEvent, PendingMessagesPausedPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, SessionConfiguredEvent, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, deciderAcceptedEventType, decodeDurableEventSync, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durableEventEnvelope, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, messageQueuePausedEventType, pendingMessagesPausedEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, summaryCreatedEventType, systemMessageCommittedEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };
@@ -1,2 +1,2 @@
1
- import { $ as LegacyAttemptEvent, $n as pendingMessagesPausedEventType, $t as ToolCallRejectedPayload, A as CompactionFailedEvent, An as baseStateCreatedEventType, At as SessionConfiguredEvent, B as ContextRebasedPayload, Bn as compactionRequestedEventType, Bt as SummaryCreatedEvent, C as CommandEvent, Cn as UserMessagePromotedEvent, Cr as turnStartedEventType, Ct as RunSchedulingGrantedPayload, D as CommandStartedPayload, Dn as assistantMessageCommittedEventType, Dr as userMessagePromotedEventType, Dt as RunSchedulingRequestedPayload, E as CommandStartedEvent, En as UserMessageSubmittedPayload, Er as userMessageCommittedEventType, Et as RunSchedulingRequestedEvent, F as CompactionStartedPayload, Fn as commandCompletedEventType, Ft as StopControlEvent, G as InferenceCompletedEvent, Gn as decodeUnknownEDADurableEvent, Gt as ToolCallCompletedPayload, H as DecodedDurableEvent, Hn as contextProjectedEventType, Ht as SystemMessageCommittedEvent, I as ContextAndCompactionEvent, In as commandFailedEventType, It as StopTurnAppliedEvent, J as InferenceFailedEvent, Jn as inferenceCompletedEventType, Jt as ToolCallEvent, K as InferenceCompletedPayload, Kn as decodeUnknownEDADurableEventSync, Kt as ToolCallCreatedEvent, L as ContextProjectedEvent, Ln as commandStartedEventType, Lt as StopTurnAppliedPayload, M as CompactionRequestedEvent, Mn as baseStateRequestedEventType, Mt as SteeringMessageCancelledPayload, N as CompactionRequestedPayload, Nn as commandAdmittedEventType, Nt as SteeringMessageQueuedEvent, O as CompactionCompletedEvent, On as assistantMessageImportedEventType, Or as userMessageSubmittedEventType, Ot as RunStartedEvent, P as CompactionStartedEvent, Pn as commandCancelledEventType, Pt as SteeringMessageQueuedPayload, Q as LegacyAssistantMessageCommittedEvent, Qn as messageQueuePausedEventType, Qt as ToolCallRejectedEvent, R as ContextProjectedPayload, Rn as compactionCompletedEventType, Rt as StopTurnRequestedEvent, S as CommandCompletedPayload, Sn as UserMessageDisposition, Sr as turnFailedEventType, St as RunSchedulingGrantedEvent, T as CommandFailedPayload, Tn as UserMessageSubmittedEvent, Tr as userMessageCancelledEventType, Tt as RunSchedulingInvalidatedPayload, U as EDADurableEvent, Un as contextRebasedEventType, Ut as SystemMessageCommittedPayload, V as CurrentEDADurableEvent, Vn as compactionStartedEventType, Vt as SummaryCreatedPayload, W as EDADurableEventV1, Wn as decodeDurableEventSync, Wt as ToolCallCompletedEvent, X as InferenceStartedEvent, Xn as inferenceStartedEventType, Xt as ToolCallFailedPayload, Y as InferenceFailedPayload, Yn as inferenceFailedEventType, Yt as ToolCallFailedEvent, Z as InferenceStartedPayload, Zn as interpretLegacyAttemptForReduction, Zt as ToolCallPromptPart, _ as CommandAdmittedEvent, _n as UserMessageCancellationReason, _r as toolCallCreatedEventType, _t as RunInterruptedEvent, a as AssistantMessageImportedPayload, an as ToolPromptPart, ar as runSchedulingGrantedEventType, at as MessageQueuePausedPayload, b as CommandCancelledPayload, bn as UserMessageCommittedEvent, br as toolCallStartedEventType, bt as RunSchedulingDeliveredPayload, c as AssistantPromptPart, cn as TurnCompletedEvent, cr as runStartedEventType, ct as RecoveryCompletedEvent, d as BaseStateCreatedPayload, dn as TurnFailedEvent, dr as steeringMessageQueuedEventType, dt as RecoveryEvent, en as ToolCallRejectionFeedback, er as recoveryCompletedEventType, et as LegacyToolCallCreatedEvent, f as BaseStateEvent, fn as TurnFailedPayload, fr as stopTurnAppliedEventType, ft as RunCompletedEvent, g as BaseStateRequestedPayload, gn as TurnStoppedPayload, gr as toolCallCompletedEventType, gt as RunFailedPayload, h as BaseStateRequestedEvent, hn as TurnStoppedEvent, hr as systemMessageCommittedEventType, ht as RunFailedEvent, i as AssistantMessageImportedEvent, in as ToolFailurePromptPart, ir as runSchedulingDeliveredEventType, it as MessageQueuePausedEvent, j as CompactionFailedPayload, jn as baseStateFailedEventType, jt as SteeringMessageCancelledEvent, k as CompactionCompletedPayload, kn as assistantPartialCommittedEventType, kt as RunStartedPayload, l as AssistantPromptParts, ln as TurnCompletedPayload, lr as sessionConfiguredEventType, lt as RecoveryCompletedPayload, m as BaseStateFailedPayload, mn as TurnStartedPayload, mr as summaryCreatedEventType, mt as RunEvent, n as AssistantMessageCommittedPayload, nn as ToolCallStartedEvent, nr as runFailedEventType, nt as LegacyTurnAttemptStartedEvent, o as AssistantPartialCommittedEvent, on as ToolRejectionPromptPart, or as runSchedulingInvalidatedEventType, ot as PendingMessagesPausedEvent, p as BaseStateFailedEvent, pn as TurnStartedEvent, pr as stopTurnRequestedEventType, pt as RunCompletedPayload, q as InferenceEvent, qn as durableEventEnvelope, qt as ToolCallCreatedPayload, r as AssistantMessageContent, rn as ToolCallStartedPayload, rr as runInterruptedEventType, rt as MessageEvent, s as AssistantPartialCommittedPayload, sn as ToolSuccessPromptPart, sr as runSchedulingRequestedEventType, st as PendingMessagesPausedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallRejectionReason, tr as runCompletedEventType, tt as LegacyTurnAttemptCompletedEvent, u as BaseStateCreatedEvent, un as TurnEvent, ur as steeringMessageCancelledEventType, ut as RecoveryContinuation, v as CommandAdmittedPayload, vn as UserMessageCancelledEvent, vr as toolCallFailedEventType, vt as RunInterruptedPayload, w as CommandFailedEvent, wn as UserMessagePromotedPayload, wr as turnStoppedEventType, wt as RunSchedulingInvalidatedEvent, x as CommandCompletedEvent, xn as UserMessageCommittedPayload, xr as turnCompletedEventType, xt as RunSchedulingEvent, y as CommandCancelledEvent, yn as UserMessageCancelledPayload, yr as toolCallRejectedEventType, yt as RunSchedulingDeliveredEvent, z as ContextRebasedEvent, zn as compactionFailedEventType, zt as StopTurnRequestedPayload } from "../../durable-D13w1Qr3.js";
2
- export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, CurrentEDADurableEvent, DecodedDurableEvent, EDADurableEvent, EDADurableEventV1, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, PendingMessagesPausedEvent, PendingMessagesPausedPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, SessionConfiguredEvent, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, decodeDurableEventSync, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durableEventEnvelope, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, messageQueuePausedEventType, pendingMessagesPausedEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, summaryCreatedEventType, systemMessageCommittedEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };
1
+ import { $ as InferenceStartedPayload, $n as inferenceStartedEventType, $t as ToolCallPromptPart, A as CompactionFailedEvent, An as assistantMessageImportedEventType, Ar as userMessagePromotedEventType, At as RunStartedEvent, B as ContextRebasedPayload, Bn as compactionCompletedEventType, Bt as StopTurnRequestedEvent, C as CommandEvent, Cn as UserMessageCommittedPayload, Cr as toolCallStartedEventType, Ct as RunSchedulingEvent, D as CommandStartedPayload, Dn as UserMessageSubmittedEvent, Dr as turnStoppedEventType, Dt as RunSchedulingInvalidatedPayload, E as CommandStartedEvent, En as UserMessagePromotedPayload, Er as turnStartedEventType, Et as RunSchedulingInvalidatedEvent, F as CompactionStartedPayload, Fn as commandAdmittedEventType, Ft as SteeringMessageQueuedEvent, G as EDADurableEvent, Gn as contextRebasedEventType, Gt as SystemMessageCommittedPayload, H as DeciderAcceptedEvent, Hn as compactionRequestedEventType, Ht as SummaryCreatedEvent, I as ContextAndCompactionEvent, In as commandCancelledEventType, It as SteeringMessageQueuedPayload, J as InferenceCompletedPayload, Jn as decodeUnknownEDADurableEvent, Jt as ToolCallCreatedEvent, K as EDADurableEventV1, Kn as deciderAcceptedEventType, Kt as ToolCallCompletedEvent, L as ContextProjectedEvent, Ln as commandCompletedEventType, Lt as StopControlEvent, M as CompactionRequestedEvent, Mn as baseStateCreatedEventType, Mt as SessionConfiguredEvent, N as CompactionRequestedPayload, Nn as baseStateFailedEventType, Nt as SteeringMessageCancelledEvent, O as CompactionCompletedEvent, On as UserMessageSubmittedPayload, Or as userMessageCancelledEventType, Ot as RunSchedulingRequestedEvent, P as CompactionStartedEvent, Pn as baseStateRequestedEventType, Pt as SteeringMessageCancelledPayload, Q as InferenceStartedEvent, Qn as inferenceFailedEventType, Qt as ToolCallFailedPayload, R as ContextProjectedPayload, Rn as commandFailedEventType, Rt as StopTurnAppliedEvent, S as CommandCompletedPayload, Sn as UserMessageCommittedEvent, Sr as toolCallRejectedEventType, St as RunSchedulingDeliveredPayload, T as CommandFailedPayload, Tn as UserMessagePromotedEvent, Tr as turnFailedEventType, Tt as RunSchedulingGrantedPayload, U as DeciderAcceptedPayload, Un as compactionStartedEventType, Ut as SummaryCreatedPayload, V as CurrentEDADurableEvent, Vn as compactionFailedEventType, Vt as StopTurnRequestedPayload, W as DecodedDurableEvent, Wn as contextProjectedEventType, Wt as SystemMessageCommittedEvent, X as InferenceFailedEvent, Xn as durableEventEnvelope, Xt as ToolCallEvent, Y as InferenceEvent, Yn as decodeUnknownEDADurableEventSync, Yt as ToolCallCreatedPayload, Z as InferenceFailedPayload, Zn as inferenceCompletedEventType, Zt as ToolCallFailedEvent, _ as CommandAdmittedEvent, _n as TurnStoppedEvent, _r as summaryCreatedEventType, _t as RunFailedEvent, a as AssistantMessageImportedPayload, an as ToolCallStartedPayload, ar as runFailedEventType, at as MessageEvent, b as CommandCancelledPayload, bn as UserMessageCancelledEvent, br as toolCallCreatedEventType, bt as RunInterruptedPayload, c as AssistantPromptPart, cn as ToolRejectionPromptPart, cr as runSchedulingGrantedEventType, ct as PendingMessagesPausedEvent, d as BaseStateCreatedPayload, dn as TurnCompletedPayload, dr as runStartedEventType, dt as RecoveryCompletedPayload, en as ToolCallRejectedEvent, er as interpretLegacyAttemptForReduction, et as LegacyAssistantMessageCommittedEvent, f as BaseStateEvent, fn as TurnEvent, fr as sessionConfiguredEventType, ft as RecoveryContinuation, g as BaseStateRequestedPayload, gn as TurnStartedPayload, gr as stopTurnRequestedEventType, gt as RunEvent, h as BaseStateRequestedEvent, hn as TurnStartedEvent, hr as stopTurnAppliedEventType, ht as RunCompletedPayload, i as AssistantMessageImportedEvent, in as ToolCallStartedEvent, ir as runCompletedEventType, it as LegacyTurnAttemptStartedEvent, j as CompactionFailedPayload, jn as assistantPartialCommittedEventType, jr as userMessageSubmittedEventType, jt as RunStartedPayload, k as CompactionCompletedPayload, kn as assistantMessageCommittedEventType, kr as userMessageCommittedEventType, kt as RunSchedulingRequestedPayload, l as AssistantPromptParts, ln as ToolSuccessPromptPart, lr as runSchedulingInvalidatedEventType, lt as PendingMessagesPausedPayload, m as BaseStateFailedPayload, mn as TurnFailedPayload, mr as steeringMessageQueuedEventType, mt as RunCompletedEvent, n as AssistantMessageCommittedPayload, nn as ToolCallRejectionFeedback, nr as pendingMessagesPausedEventType, nt as LegacyToolCallCreatedEvent, o as AssistantPartialCommittedEvent, on as ToolFailurePromptPart, or as runInterruptedEventType, ot as MessageQueuePausedEvent, p as BaseStateFailedEvent, pn as TurnFailedEvent, pr as steeringMessageCancelledEventType, pt as RecoveryEvent, q as InferenceCompletedEvent, qn as decodeDurableEventSync, qt as ToolCallCompletedPayload, r as AssistantMessageContent, rn as ToolCallRejectionReason, rr as recoveryCompletedEventType, rt as LegacyTurnAttemptCompletedEvent, s as AssistantPartialCommittedPayload, sn as ToolPromptPart, sr as runSchedulingDeliveredEventType, st as MessageQueuePausedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallRejectedPayload, tr as messageQueuePausedEventType, tt as LegacyAttemptEvent, u as BaseStateCreatedEvent, un as TurnCompletedEvent, ur as runSchedulingRequestedEventType, ut as RecoveryCompletedEvent, v as CommandAdmittedPayload, vn as TurnStoppedPayload, vr as systemMessageCommittedEventType, vt as RunFailedPayload, w as CommandFailedEvent, wn as UserMessageDisposition, wr as turnCompletedEventType, wt as RunSchedulingGrantedEvent, x as CommandCompletedEvent, xn as UserMessageCancelledPayload, xr as toolCallFailedEventType, xt as RunSchedulingDeliveredEvent, y as CommandCancelledEvent, yn as UserMessageCancellationReason, yr as toolCallCompletedEventType, yt as RunInterruptedEvent, z as ContextRebasedEvent, zn as commandStartedEventType, zt as StopTurnAppliedPayload } from "../../durable-Da57Rcml.js";
2
+ export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, CurrentEDADurableEvent, DeciderAcceptedEvent, DeciderAcceptedPayload, DecodedDurableEvent, EDADurableEvent, EDADurableEventV1, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, PendingMessagesPausedEvent, PendingMessagesPausedPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, SessionConfiguredEvent, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, deciderAcceptedEventType, decodeDurableEventSync, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durableEventEnvelope, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, messageQueuePausedEventType, pendingMessagesPausedEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, summaryCreatedEventType, systemMessageCommittedEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };