@slopus/happy-providers 0.0.1 → 0.0.4

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 (151) hide show
  1. package/EXAMPLES.md +39 -73
  2. package/README.md +165 -88
  3. package/dist/core/BaseSession.d.ts +1 -1
  4. package/dist/core/BaseSession.d.ts.map +1 -1
  5. package/dist/core/EmptyResponseError.d.ts +3 -3
  6. package/dist/core/EmptyResponseError.d.ts.map +1 -1
  7. package/dist/core/EmptyResponseError.js.map +1 -1
  8. package/dist/core/SessionAssistantMessageAccumulator.d.ts +17 -0
  9. package/dist/core/SessionAssistantMessageAccumulator.d.ts.map +1 -0
  10. package/dist/core/SessionAssistantMessageAccumulator.js +154 -0
  11. package/dist/core/SessionAssistantMessageAccumulator.js.map +1 -0
  12. package/dist/core/SessionCompaction.d.ts +4 -10
  13. package/dist/core/SessionCompaction.d.ts.map +1 -1
  14. package/dist/core/SessionContext.d.ts +35 -33
  15. package/dist/core/SessionContext.d.ts.map +1 -1
  16. package/dist/core/SessionEvent.d.ts +23 -8
  17. package/dist/core/SessionEvent.d.ts.map +1 -1
  18. package/dist/core/SessionEvent.js.map +1 -1
  19. package/dist/core/SessionRunRequest.d.ts +2 -4
  20. package/dist/core/SessionRunRequest.d.ts.map +1 -1
  21. package/dist/core/SessionTool.d.ts +1 -3
  22. package/dist/core/SessionTool.d.ts.map +1 -1
  23. package/dist/core/SessionUsage.d.ts +14 -0
  24. package/dist/core/SessionUsage.d.ts.map +1 -0
  25. package/dist/core/{SessionCacheUsage.js → SessionUsage.js} +2 -2
  26. package/dist/core/SessionUsage.js.map +1 -0
  27. package/dist/core/addSessionUsage.d.ts +3 -0
  28. package/dist/core/addSessionUsage.d.ts.map +1 -0
  29. package/dist/core/{addSessionCacheUsage.js → addSessionUsage.js} +3 -3
  30. package/dist/core/addSessionUsage.js.map +1 -0
  31. package/dist/core/emitToolCallResult.d.ts +1 -0
  32. package/dist/core/emitToolCallResult.d.ts.map +1 -1
  33. package/dist/core/emitToolCallResult.js +6 -2
  34. package/dist/core/emitToolCallResult.js.map +1 -1
  35. package/dist/core/toSessionReminderMessage.d.ts.map +1 -1
  36. package/dist/core/toSessionReminderMessage.js +6 -2
  37. package/dist/core/toSessionReminderMessage.js.map +1 -1
  38. package/dist/index.d.ts +6 -5
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +2 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/protocol/anthropic/collectAnthropicCompaction.d.ts +2 -2
  43. package/dist/protocol/anthropic/collectAnthropicCompaction.d.ts.map +1 -1
  44. package/dist/protocol/anthropic/collectAnthropicCompaction.js +14 -9
  45. package/dist/protocol/anthropic/collectAnthropicCompaction.js.map +1 -1
  46. package/dist/protocol/anthropic/mapAnthropicStream.d.ts.map +1 -1
  47. package/dist/protocol/anthropic/mapAnthropicStream.js +52 -30
  48. package/dist/protocol/anthropic/mapAnthropicStream.js.map +1 -1
  49. package/dist/protocol/anthropic/toAnthropicMessages.d.ts +1 -2
  50. package/dist/protocol/anthropic/toAnthropicMessages.d.ts.map +1 -1
  51. package/dist/protocol/anthropic/toAnthropicMessages.js +46 -108
  52. package/dist/protocol/anthropic/toAnthropicMessages.js.map +1 -1
  53. package/dist/protocol/responses/ResponsesSession.d.ts +1 -1
  54. package/dist/protocol/responses/ResponsesSession.d.ts.map +1 -1
  55. package/dist/protocol/responses/ResponsesSession.js +13 -42
  56. package/dist/protocol/responses/ResponsesSession.js.map +1 -1
  57. package/dist/protocol/responses/mapOpenAIResponseStream.d.ts +9 -6
  58. package/dist/protocol/responses/mapOpenAIResponseStream.d.ts.map +1 -1
  59. package/dist/protocol/responses/mapOpenAIResponseStream.js +191 -59
  60. package/dist/protocol/responses/mapOpenAIResponseStream.js.map +1 -1
  61. package/dist/protocol/responses/toOpenAIInputContent.d.ts +2 -2
  62. package/dist/protocol/responses/toOpenAIInputContent.d.ts.map +1 -1
  63. package/dist/protocol/responses/toOpenAIInputContent.js +4 -4
  64. package/dist/protocol/responses/toOpenAIInputContent.js.map +1 -1
  65. package/dist/protocol/responses/toOpenAIResponseInput.d.ts.map +1 -1
  66. package/dist/protocol/responses/toOpenAIResponseInput.js +74 -68
  67. package/dist/protocol/responses/toOpenAIResponseInput.js.map +1 -1
  68. package/dist/protocol/responses/toSessionUsage.d.ts +4 -0
  69. package/dist/protocol/responses/toSessionUsage.d.ts.map +1 -0
  70. package/dist/protocol/responses/{toSessionCacheUsage.js → toSessionUsage.js} +4 -4
  71. package/dist/protocol/responses/toSessionUsage.js.map +1 -0
  72. package/dist/vendors/bedrock/AnthropicBedrockSession.d.ts +1 -1
  73. package/dist/vendors/bedrock/AnthropicBedrockSession.d.ts.map +1 -1
  74. package/dist/vendors/bedrock/AnthropicBedrockSession.js +23 -64
  75. package/dist/vendors/bedrock/AnthropicBedrockSession.js.map +1 -1
  76. package/dist/vendors/claude/ClaudeSession.d.ts +1 -1
  77. package/dist/vendors/claude/ClaudeSession.d.ts.map +1 -1
  78. package/dist/vendors/claude/ClaudeSession.js +168 -72
  79. package/dist/vendors/claude/ClaudeSession.js.map +1 -1
  80. package/dist/vendors/claude/impl/ClaudeToolBridge.js +1 -7
  81. package/dist/vendors/claude/impl/ClaudeToolBridge.js.map +1 -1
  82. package/dist/vendors/claude/impl/claudeMessageIdentity.d.ts +3 -4
  83. package/dist/vendors/claude/impl/claudeMessageIdentity.d.ts.map +1 -1
  84. package/dist/vendors/claude/impl/claudeMessageIdentity.js +9 -12
  85. package/dist/vendors/claude/impl/claudeMessageIdentity.js.map +1 -1
  86. package/dist/vendors/claude/impl/createClaudeSessionReplay.js +36 -30
  87. package/dist/vendors/claude/impl/createClaudeSessionReplay.js.map +1 -1
  88. package/dist/vendors/claude/impl/toClaudeSdkOptions.d.ts.map +1 -1
  89. package/dist/vendors/claude/impl/toClaudeSdkOptions.js +2 -2
  90. package/dist/vendors/claude/impl/toClaudeSdkOptions.js.map +1 -1
  91. package/dist/vendors/codex/CodexSession.d.ts +1 -1
  92. package/dist/vendors/codex/CodexSession.d.ts.map +1 -1
  93. package/dist/vendors/codex/CodexSession.js +30 -51
  94. package/dist/vendors/codex/CodexSession.js.map +1 -1
  95. package/dist/vendors/codex/CodexToolVendor.d.ts +2 -1
  96. package/dist/vendors/codex/CodexToolVendor.d.ts.map +1 -1
  97. package/dist/vendors/codex/impl/codexCompaction.d.ts +2 -2
  98. package/dist/vendors/codex/impl/codexCompaction.d.ts.map +1 -1
  99. package/dist/vendors/codex/impl/codexCompaction.js +15 -7
  100. package/dist/vendors/codex/impl/codexCompaction.js.map +1 -1
  101. package/dist/vendors/codex/impl/createCodexModelSwitchMessage.d.ts.map +1 -1
  102. package/dist/vendors/codex/impl/createCodexModelSwitchMessage.js +11 -8
  103. package/dist/vendors/codex/impl/createCodexModelSwitchMessage.js.map +1 -1
  104. package/dist/vendors/codex/impl/getCodexContextSuffix.js +13 -15
  105. package/dist/vendors/codex/impl/getCodexContextSuffix.js.map +1 -1
  106. package/dist/vendors/codex/impl/getCodexIncrementalInput.d.ts +2 -2
  107. package/dist/vendors/codex/impl/getCodexIncrementalInput.d.ts.map +1 -1
  108. package/dist/vendors/codex/impl/getCodexIncrementalInput.js +15 -4
  109. package/dist/vendors/codex/impl/getCodexIncrementalInput.js.map +1 -1
  110. package/dist/vendors/codex/impl/getCodexTurnKey.js +1 -1
  111. package/dist/vendors/codex/impl/getCodexTurnKey.js.map +1 -1
  112. package/dist/vendors/codex/impl/settleCodexToolSearch.d.ts +4 -3
  113. package/dist/vendors/codex/impl/settleCodexToolSearch.d.ts.map +1 -1
  114. package/dist/vendors/codex/impl/settleCodexToolSearch.js +14 -2
  115. package/dist/vendors/codex/impl/settleCodexToolSearch.js.map +1 -1
  116. package/dist/vendors/codex/impl/toCodexToolDefinitions.d.ts.map +1 -1
  117. package/dist/vendors/codex/impl/toCodexToolDefinitions.js +6 -27
  118. package/dist/vendors/codex/impl/toCodexToolDefinitions.js.map +1 -1
  119. package/dist/vendors/codex/impl/withCodexSkills.d.ts.map +1 -1
  120. package/dist/vendors/codex/impl/withCodexSkills.js +8 -12
  121. package/dist/vendors/codex/impl/withCodexSkills.js.map +1 -1
  122. package/dist/vendors/codex/tools/tool_search.d.ts +9 -5
  123. package/dist/vendors/codex/tools/tool_search.d.ts.map +1 -1
  124. package/dist/vendors/codex/tools/tool_search.js +8 -10
  125. package/dist/vendors/codex/tools/tool_search.js.map +1 -1
  126. package/dist/vendors/grok/GrokSession.d.ts +1 -1
  127. package/dist/vendors/grok/GrokSession.d.ts.map +1 -1
  128. package/dist/vendors/grok/GrokSession.js +21 -43
  129. package/dist/vendors/grok/GrokSession.js.map +1 -1
  130. package/dist/vendors/grok/impl/grokMessages.js +11 -5
  131. package/dist/vendors/grok/impl/grokMessages.js.map +1 -1
  132. package/dist/vendors/grok/impl/stripGrokContextImages.d.ts.map +1 -1
  133. package/dist/vendors/grok/impl/stripGrokContextImages.js +3 -3
  134. package/dist/vendors/grok/impl/stripGrokContextImages.js.map +1 -1
  135. package/dist/vendors/grok/impl/toGrokInputContent.d.ts +2 -2
  136. package/dist/vendors/grok/impl/toGrokInputContent.d.ts.map +1 -1
  137. package/dist/vendors/grok/impl/toGrokInputContent.js +4 -4
  138. package/dist/vendors/grok/impl/toGrokInputContent.js.map +1 -1
  139. package/dist/vendors/grok/impl/toGrokResponseInput.d.ts.map +1 -1
  140. package/dist/vendors/grok/impl/toGrokResponseInput.js +78 -70
  141. package/dist/vendors/grok/impl/toGrokResponseInput.js.map +1 -1
  142. package/package.json +1 -1
  143. package/dist/core/SessionCacheUsage.d.ts +0 -9
  144. package/dist/core/SessionCacheUsage.d.ts.map +0 -1
  145. package/dist/core/SessionCacheUsage.js.map +0 -1
  146. package/dist/core/addSessionCacheUsage.d.ts +0 -3
  147. package/dist/core/addSessionCacheUsage.d.ts.map +0 -1
  148. package/dist/core/addSessionCacheUsage.js.map +0 -1
  149. package/dist/protocol/responses/toSessionCacheUsage.d.ts +0 -4
  150. package/dist/protocol/responses/toSessionCacheUsage.d.ts.map +0 -1
  151. package/dist/protocol/responses/toSessionCacheUsage.js.map +0 -1
package/README.md CHANGED
@@ -81,6 +81,8 @@ warm, but you own the transcript.
81
81
  import {
82
82
  CodexProvider,
83
83
  CodexSessionCredential,
84
+ SessionAssistantMessageAccumulator,
85
+ type SessionAssistantMessage,
84
86
  type SessionMessage,
85
87
  } from "@slopus/happy-providers";
86
88
 
@@ -94,25 +96,30 @@ const provider = new CodexProvider({
94
96
  model: "gpt-5.6-sol",
95
97
  transport: "auto",
96
98
  });
99
+ const instructions = "You are a concise coding assistant.";
97
100
  const session = await provider.session("conversation-1", {
98
- instructions: "You are a concise coding assistant.",
101
+ instructions,
99
102
  tools: [],
100
103
  });
101
104
 
102
105
  const messages: SessionMessage[] = [];
103
106
 
104
107
  async function ask(content: string): Promise<string> {
105
- messages.push({ role: "user", content });
108
+ messages.push({ role: "user", content: [{ type: "text", text: content }] });
106
109
 
107
110
  let response = "";
108
- for await (const event of session.run({ context: { messages } })) {
111
+ const assistant = new SessionAssistantMessageAccumulator();
112
+ for await (const event of session.run({ context: { instructions, messages } })) {
113
+ assistant.add(event);
109
114
  if (event.type === "text_delta") response += event.delta;
110
115
  if (event.type === "done" && event.state === "error") {
111
116
  throw new Error(event.message);
112
117
  }
113
118
  }
114
119
 
115
- messages.push({ role: "assistant", content: response });
120
+ const message = assistant.message();
121
+ if (message === undefined) throw new Error("The provider returned no assistant message.");
122
+ messages.push(message);
116
123
  return response;
117
124
  }
118
125
 
@@ -124,8 +131,10 @@ try {
124
131
  }
125
132
  ```
126
133
 
127
- A production caller should persist more than plain text — reasoning, response items, tool calls,
128
- tool results, and their opaque `vendor` fields all belong in your durable transcript.
134
+ A production caller reconstructs and persists the assistant message from the ordered block events.
135
+ `SessionAssistantMessageAccumulator` does that directly, including retry rewinds. Its result
136
+ contains the text, reasoning, tool calls, provider-owned tool results, and opaque replay metadata
137
+ needed for the next turn.
129
138
  [EXAMPLES.md](EXAMPLES.md) walks through a complete event collector and a tool-call continuation.
130
139
 
131
140
  ## Providers and credentials
@@ -180,7 +189,7 @@ reasoning effort, priority service tier, structured output schema, and an abort
180
189
 
181
190
  ```ts
182
191
  const stream = session.run({
183
- context: { messages },
192
+ context: { instructions, messages },
184
193
  model: "gpt-5.6-sol",
185
194
  effort: "high",
186
195
  abort: abortController.signal,
@@ -216,22 +225,23 @@ continuing the same conversation; mint a new one for a new conversation or an in
216
225
  ## Messages and events
217
226
 
218
227
  `SessionMessage` covers user, assistant, tool-result, system-notice, agent, and compaction
219
- messages. Multimodal content uses ordered text/image parts in `input`.
228
+ messages. User, system, assistant, and tool-result content is always an ordered block array.
220
229
 
221
230
  Some fields exist purely so the provider can continue a conversation faithfully, and their
222
231
  contents are intentionally opaque. Whenever these appear, store them byte-for-byte and send them
223
232
  back unchanged:
224
233
 
225
- - assistant `encryptedReasoning` and `responseItems`;
226
- - tool-call and tool-result `vendor` metadata;
227
- - signed reasoning blocks;
234
+ - reasoning block `reasoning` payloads;
235
+ - tool-call and tool-result block `vendor` metadata;
228
236
  - compaction `encryptedContent` and `vendor` metadata.
229
237
 
230
238
  `SessionStream` is an `AsyncIterable<SessionEvent>`. You'll see text and reasoning deltas,
231
239
  tool-call boundaries, provider-owned tool results, token usage, retry notices, and block rollback
232
- boundaries. Every started stream ends with exactly one `done` event. When collecting a stream, use
233
- `committedSessionEvents()` so output invalidated by `block_reset` is discarded correctly — more on
234
- that in the [retries section](#retries-happen-inside-the-session) below.
240
+ boundaries. Content-block start order is the exact order of `SessionAssistantMessage.content`;
241
+ indexes are neither exposed nor needed. Every started stream ends with exactly one `done` event.
242
+ Use `SessionAssistantMessageAccumulator` to build the message while streaming, or
243
+ `assistantMessageFromEvents()` after collecting a run. Both discard output invalidated by
244
+ `block_reset` correctly.
235
245
 
236
246
  ## Tools: you run them, not the library
237
247
 
@@ -277,8 +287,8 @@ behind your back:
277
287
 
278
288
  ```ts
279
289
  const compacted = await session.compact({
280
- context: { messages },
281
- inputTokens,
290
+ context: { instructions, messages },
291
+ instructions: "Preserve decisions, unfinished work, and exact identifiers.",
282
292
  signal: abortController.signal,
283
293
  });
284
294
 
@@ -290,6 +300,11 @@ if (compacted.status === "completed") {
290
300
  On success, adopt and persist the complete returned `context` as your new transcript. On
291
301
  cancellation or failure, keep the original — nothing was changed out from under you.
292
302
 
303
+ The `context` is the complete caller-selected input to compact: root instructions and messages
304
+ travel together exactly as they do for inference. The separate `instructions` field tells the
305
+ provider what the compacted replacement should retain. Compaction does not accept a caller token
306
+ count; providers report their own usage.
307
+
293
308
  ## The most important part: sessions are stateful and managed
294
309
 
295
310
  Everything above is mechanics. This is the mental model.
@@ -346,11 +361,11 @@ next operation.
346
361
 
347
362
  ```ts
348
363
  // Correct: turns on one session are sequential.
349
- for await (const event of session.run({ context: { messages } })) {
364
+ for await (const event of session.run({ context: { instructions, messages } })) {
350
365
  // Consume every event.
351
366
  }
352
367
 
353
- const compacted = await session.compact({ context: { messages } });
368
+ const compacted = await session.compact({ context: { instructions, messages } });
354
369
  ```
355
370
 
356
371
  Independent sessions run concurrently just fine — use one session per conversation or branch:
@@ -360,12 +375,16 @@ const first = await provider.session("conversation-1", firstOptions);
360
375
  const second = await provider.session("conversation-2", secondOptions);
361
376
 
362
377
  const runFirst = async () => {
363
- for await (const event of first.run({ context: { messages: firstMessages } })) {
378
+ for await (const event of first.run({
379
+ context: { instructions: firstInstructions, messages: firstMessages },
380
+ })) {
364
381
  // Consume the first conversation's events.
365
382
  }
366
383
  };
367
384
  const runSecond = async () => {
368
- for await (const event of second.run({ context: { messages: secondMessages } })) {
385
+ for await (const event of second.run({
386
+ context: { instructions: secondInstructions, messages: secondMessages },
387
+ })) {
369
388
  // Consume the second conversation's events.
370
389
  }
371
390
  };
@@ -384,7 +403,7 @@ the next inference begins.
384
403
  or by creating two session objects with the same ID.
385
404
 
386
405
  To branch today, copy your transcript and open a new session with its own ID. Include all opaque
387
- reasoning, response items, tool metadata, and compaction messages in the copy:
406
+ reasoning, tool metadata, and compaction messages in the copy:
388
407
 
389
408
  ```ts
390
409
  const branchMessages = structuredClone(messages);
@@ -395,7 +414,7 @@ const branch = await provider.session("conversation-1-branch-1", {
395
414
  });
396
415
 
397
416
  for await (const event of branch.run({
398
- context: { messages: branchMessages },
417
+ context: { instructions, messages: branchMessages },
399
418
  model,
400
419
  effort,
401
420
  })) {
@@ -450,7 +469,7 @@ out the rewound output:
450
469
  import { committedSessionEvents, type SessionEvent } from "@slopus/happy-providers";
451
470
 
452
471
  const streamed: SessionEvent[] = [];
453
- for await (const event of session.run({ context: { messages } })) {
472
+ for await (const event of session.run({ context: { instructions, messages } })) {
454
473
  streamed.push(event);
455
474
  }
456
475
 
@@ -598,7 +617,7 @@ abstract class BaseSession {
598
617
  readonly id: string;
599
618
 
600
619
  abstract run(request: SessionRunRequest): SessionStream;
601
- abstract compact(options?: SessionCompactionOptions): Promise<SessionCompaction>;
620
+ abstract compact(options: SessionCompactionOptions): Promise<SessionCompaction>;
602
621
  abstract destroy(): void | Promise<void>;
603
622
  }
604
623
  ```
@@ -635,10 +654,8 @@ What one `run()` takes:
635
654
 
636
655
  ```ts
637
656
  interface SessionRunRequest {
638
- /** Complete rebuilt conversation history for this inference turn. */
639
- context: {
640
- readonly messages: readonly SessionMessage[];
641
- };
657
+ /** Complete rebuilt conversation context for this inference turn. */
658
+ context: SessionContext;
642
659
  abort?: AbortSignal;
643
660
  model?: string;
644
661
  effort?: SessionReasoningEffort;
@@ -673,58 +690,54 @@ type SessionMessage =
673
690
  | SessionCompactionMessage;
674
691
  ```
675
692
 
676
- A user turn. `input`, when present, replaces `content` with ordered multimodal parts:
693
+ A user turn contains ordered multimodal blocks:
677
694
 
678
695
  ```ts
679
696
  interface SessionUserMessage {
680
697
  readonly role: "user";
681
- readonly content: string;
682
- /** Background context that does not establish a provider turn boundary. */
683
- readonly contextOnly?: true;
684
- readonly input?: SessionInputContent;
698
+ readonly content: readonly SessionInputBlock[];
685
699
  }
686
700
 
687
- type SessionInputContent = readonly (SessionTextContent | SessionImageContent)[];
701
+ type SessionInputBlock = SessionTextBlock | SessionImageBlock;
688
702
 
689
- interface SessionTextContent {
703
+ interface SessionTextBlock {
690
704
  readonly type: "text";
691
705
  readonly text: string;
692
706
  }
693
707
 
694
- interface SessionImageContent {
708
+ interface SessionImageBlock {
695
709
  readonly type: "image";
696
710
  readonly data: string;
697
711
  readonly mimeType: string;
698
712
  }
699
713
  ```
700
714
 
701
- A model turn — the shape with the most to preserve. Anthropic signs the text of its thinking
702
- blocks, so a signature replayed beside different text is rejected: keep each reasoning block and
703
- its signature together, untouched. `encryptedReasoning` and `responseItems` are opaque; store
704
- them byte-for-byte:
715
+ A model turn is one ordered block array. Do not flatten or reorder it: provider replay state lives
716
+ on the block it belongs to, so text, reasoning, client tool calls, and provider-owned tool results
717
+ retain their original sequence:
705
718
 
706
719
  ```ts
707
720
  interface SessionAssistantMessage {
708
721
  readonly role: "assistant";
709
- readonly content: string;
710
- /** Opaque encrypted reasoning from a Responses-compatible backend. */
711
- readonly encryptedReasoning?: string;
712
- /** Ordered reasoning blocks retained as caller-owned history. */
713
- readonly reasoning?: readonly SessionReasoning[];
714
- /** Completed client tool calls emitted alongside this message. */
715
- readonly toolCalls?: readonly SessionToolCall[];
716
- /** Ordered, opaque Responses output items, replayed without flattening or reordering. */
717
- readonly responseItems?: readonly string[];
722
+ readonly content: readonly SessionAssistantBlock[];
718
723
  }
719
724
 
720
- interface SessionReasoning {
721
- readonly text: string;
722
- readonly signature?: string;
723
- /** Reasoning the vendor withheld, where the signature is the whole payload. */
724
- readonly redacted?: boolean;
725
+ type SessionAssistantBlock =
726
+ | SessionTextBlock
727
+ | SessionReasoningBlock
728
+ | SessionToolCallBlock
729
+ | SessionToolResultBlock;
730
+
731
+ interface SessionReasoningBlock {
732
+ readonly type: "reasoning";
733
+ /** Human-readable reasoning, when exposed. */
734
+ readonly text?: string;
735
+ /** Opaque signed or encrypted replay state, when required. */
736
+ readonly reasoning?: string;
725
737
  }
726
738
 
727
- interface SessionToolCall {
739
+ interface SessionToolCallBlock {
740
+ readonly type: "tool_call";
728
741
  readonly callId: string;
729
742
  readonly name: string;
730
743
  readonly namespace?: string;
@@ -743,11 +756,9 @@ Your answer to a tool call, tied back by `callId`:
743
756
  interface SessionToolResultMessage {
744
757
  readonly role: "tool";
745
758
  readonly callId: string;
746
- readonly content: string;
759
+ readonly content: readonly SessionOutputBlock[];
747
760
  /** Whether the caller reported that the tool invocation failed. */
748
761
  readonly isError?: boolean;
749
- /** Ordered multimodal content. When present, providers use this instead of content. */
750
- readonly input?: SessionInputContent;
751
762
  /** The opaque metadata that arrived with the call, echoed back. */
752
763
  readonly vendor?: any;
753
764
  }
@@ -760,7 +771,7 @@ edit it):
760
771
  ```ts
761
772
  interface SessionSystemMessage {
762
773
  readonly role: "system";
763
- readonly content: string | readonly string[];
774
+ readonly content: readonly SessionTextBlock[];
764
775
  }
765
776
 
766
777
  interface SessionAgentMessage {
@@ -784,6 +795,11 @@ interface SessionCompactionMessage {
784
795
  }
785
796
  ```
786
797
 
798
+ `SessionAgentMessage` is specifically Codex cross-agent replay state. It represents encrypted
799
+ messages exchanged by Codex collaborators and preserves their author, recipient, display header,
800
+ and turn boundary. Persist and replay values emitted by Codex; do not construct it as a generic
801
+ application message. Non-Codex providers ignore it.
802
+
787
803
  ### `SessionTool`
788
804
 
789
805
  A tool definition, as covered in the [Tools section](#tools-you-run-them-not-the-library):
@@ -802,9 +818,7 @@ interface SessionTool {
802
818
  readonly description?: string;
803
819
  readonly parameters?: TSchema; // a TypeBox schema
804
820
  /** Provider-neutral request to expose this tool through native tool discovery. */
805
- readonly deferLoading?: boolean;
806
- /** Opaque provider metadata persisted with this tool definition. */
807
- readonly vendor?: any;
821
+ readonly defer?: boolean;
808
822
  /** OpenAI-style Lark grammar; ignored by providers that do not support grammar tools. */
809
823
  readonly grammar?: SessionToolLarkGrammar;
810
824
  }
@@ -821,35 +835,62 @@ interface SessionToolLarkGrammar {
821
835
 
822
836
  ```ts
823
837
  type SessionEvent =
824
- // Blocks bracket tentative output so provider-owned retries can rewind it.
838
+ // Attempt blocks bracket tentative output so provider-owned retries can rewind it.
825
839
  | { type: "block_start" }
826
840
  | { type: "block_stop" }
827
841
  | { type: "block_reset" }
828
- // Content.
842
+ // Text and reasoning blocks are sequential. Start order is message-content order.
843
+ | { type: "text_start" }
829
844
  | { type: "text_delta"; delta: string }
845
+ | { type: "text_end" }
846
+ | { type: "reasoning_start" }
830
847
  | { type: "reasoning_delta"; delta: string }
831
- | { type: "encrypted_reasoning"; content: string }
832
- | { type: "response_items"; items: readonly string[] }
848
+ | { type: "reasoning_end"; reasoning?: string }
833
849
  // Tool calls. `server: true` marks a provider-owned call the client never executes.
834
- | { type: "toolcall_start"; callId: string; name: string; namespace?: string; server?: true; vendor?: any }
850
+ | {
851
+ type: "toolcall_start";
852
+ callId: string;
853
+ name: string;
854
+ namespace?: string;
855
+ server?: true;
856
+ vendor?: any;
857
+ }
835
858
  | { type: "toolcall_delta"; callId: string; delta: string }
836
859
  | { type: "toolcall_end"; callId: string; arguments: string; incomplete?: boolean }
837
860
  // Server-tool results settle inside the same response, streamed beside the call.
838
- | { type: "toolcall_result_start"; callId: string }
861
+ | { type: "toolcall_result_start"; callId: string; vendor?: any }
839
862
  | { type: "toolcall_result_delta"; callId: string; delta: string }
840
- | { type: "toolcall_result_end"; callId: string; result: string; incomplete?: boolean }
863
+ | {
864
+ type: "toolcall_result_end";
865
+ callId: string;
866
+ content: readonly SessionOutputBlock[];
867
+ isError?: boolean;
868
+ incomplete?: boolean;
869
+ }
841
870
  // Progress.
842
871
  | { type: "retrying"; attempt: number; reason: string }
843
- | { type: "token_usage"; usage: SessionCacheUsage }
872
+ | { type: "token_usage"; usage: SessionUsage }
844
873
  // Exactly one done event ends every started stream.
845
874
  | { type: "done"; state: "cancelled" }
846
- | { type: "done"; state: "normal"; endTurn?: boolean }
847
- | { type: "done"; state: "tool_call" }
848
- | { type: "done"; state: "length" }
849
- | { type: "done"; state: "error"; kind: SessionErrorKind; message: string; providerError?: SessionProviderError };
875
+ | { type: "done"; state: "normal"; tokens: SessionTokens; endTurn?: boolean }
876
+ | { type: "done"; state: "tool_call"; tokens: SessionTokens }
877
+ | { type: "done"; state: "length"; tokens: SessionTokens }
878
+ | {
879
+ type: "done";
880
+ state: "error";
881
+ kind: SessionErrorKind;
882
+ message: string;
883
+ providerError?: SessionProviderError;
884
+ };
850
885
 
851
886
  type SessionErrorKind = "internal_error" | "context_overflow" | "billing_error" | "unknown";
852
887
 
888
+ interface SessionTokens {
889
+ /** Full input context size, including cached input. */
890
+ readonly input: number;
891
+ readonly output: number;
892
+ }
893
+
853
894
  type SessionStream = AsyncIterable<SessionEvent>;
854
895
  ```
855
896
 
@@ -859,15 +900,37 @@ response hit a length limit, `"cancelled"` means the run was aborted, and `"erro
859
900
  Ordinary tools never emit `toolcall_result_*` events — you answer those with a `role: "tool"`
860
901
  message; only server tools stream their results here.
861
902
 
903
+ No content index is exposed. A `text_start`, `reasoning_start`, `toolcall_start`, or
904
+ `toolcall_result_start` appends that block to the assistant message. Text and reasoning are
905
+ sequential; parallel tool calls are updated by `callId`. The corresponding end event closes the
906
+ block and supplies final opaque state or normalized content when needed.
907
+
908
+ The exported accumulator implements those rules and the outer retry rollback boundaries:
909
+
910
+ ```ts
911
+ const assistant = new SessionAssistantMessageAccumulator();
912
+
913
+ for await (const event of session.run({ context: { instructions, messages } })) {
914
+ assistant.add(event);
915
+ }
916
+
917
+ const message = assistant.message();
918
+ if (message !== undefined) messages.push(message);
919
+ ```
920
+
921
+ If you already collected the complete run, `assistantMessageFromEvents(events)` returns the same
922
+ result. There is no terminal `assistant_message` event and no provider-specific `response_items`
923
+ event; the ordered lifecycle is the message.
924
+
862
925
  The helpers `isSessionDoneEvent()` and `isSessionErrorDone()` narrow events, and
863
926
  `committedSessionEvents()` filters a collected stream down to what survived block rewinds.
864
927
 
865
- ### `SessionCacheUsage`
928
+ ### `SessionUsage`
866
929
 
867
930
  Token accounting for one attempt:
868
931
 
869
932
  ```ts
870
- interface SessionCacheUsage {
933
+ interface SessionUsage {
871
934
  readonly input: number;
872
935
  readonly output: number;
873
936
  readonly cacheRead: number;
@@ -876,8 +939,27 @@ interface SessionCacheUsage {
876
939
  }
877
940
  ```
878
941
 
879
- Cache reads are the payoff of prompt-cache continuity — a healthy continuation shows most of its
880
- input arriving as `cacheRead`.
942
+ The fields are normalized the same way for every provider: `input` is the complete input context,
943
+ including cached tokens; `cacheRead` and `cacheWrite` describe subsets of that input; and
944
+ `totalTokens` is `input + output`. Cache reads are the payoff of prompt-cache continuity — a
945
+ healthy continuation shows much of its input also reported as `cacheRead`.
946
+
947
+ **Getting the last turn's context size.** The size of the context the model actually saw on a
948
+ turn is `input`; cache columns are already included:
949
+
950
+ ```ts
951
+ let lastUsage: SessionUsage | undefined;
952
+ for await (const event of session.run({ context: { instructions, messages } })) {
953
+ if (event.type === "token_usage") lastUsage = event.usage;
954
+ }
955
+
956
+ const contextSize = lastUsage?.input ?? 0;
957
+ ```
958
+
959
+ Keep the _last_ `token_usage` event of the run — a retried run reports usage per attempt, and the
960
+ final event describes the attempt that produced the committed response. This is the right value
961
+ for a context-window meter in your UI. Compaction itself does not accept a caller-supplied token
962
+ count; its returned usage comes from the provider.
881
963
 
882
964
  ### `SessionCompaction`
883
965
 
@@ -889,12 +971,8 @@ interface SessionCompactionOptions {
889
971
  readonly model?: string;
890
972
  /** Provider-native instructions describing what the compaction should retain. */
891
973
  readonly instructions?: string;
892
- /** Rebuilt conversation prefix selected by the caller for this compaction. */
893
- readonly context?: {
894
- readonly messages: readonly SessionMessage[];
895
- };
896
- /** Best available count of input tokens in the selected context. */
897
- readonly inputTokens?: number;
974
+ /** Complete context to compact, including its root instructions and messages. */
975
+ readonly context: SessionContext;
898
976
  readonly signal?: AbortSignal;
899
977
  }
900
978
 
@@ -913,7 +991,7 @@ interface CompletedSessionCompaction {
913
991
  readonly encryptedReasoning?: string;
914
992
  /** Original messages intentionally retained alongside the summary. */
915
993
  readonly preservedMessages: readonly SessionMessage[];
916
- readonly usage: SessionCacheUsage;
994
+ readonly usage: SessionUsage;
917
995
  /** Complete replacement context — adopt this as your new transcript. */
918
996
  readonly context: SessionContext;
919
997
  }
@@ -928,8 +1006,6 @@ interface FailedSessionCompaction {
928
1006
  readonly status: "failed";
929
1007
  readonly kind: "inference_error" | "invalid_summary" | "tool_call";
930
1008
  readonly message: string;
931
- /** Original context left active because compaction did not complete. */
932
- readonly context: SessionContext;
933
1009
  }
934
1010
 
935
1011
  interface SessionContext {
@@ -938,7 +1014,8 @@ interface SessionContext {
938
1014
  }
939
1015
  ```
940
1016
 
941
- On `"cancelled"` and `"failed"` nothing changed — the original context is still active.
1017
+ On `"cancelled"` and `"failed"` nothing changed. Cancellation echoes the selected context;
1018
+ failure only describes the error because the caller already owns the unchanged input context.
942
1019
 
943
1020
  ### `SessionProviderError`
944
1021
 
@@ -6,7 +6,7 @@ export declare abstract class BaseSession {
6
6
  readonly id: string;
7
7
  protected constructor(id: string);
8
8
  abstract run(request: SessionRunRequest): SessionStream;
9
- abstract compact(options?: SessionCompactionOptions): Promise<SessionCompaction>;
9
+ abstract compact(options: SessionCompactionOptions): Promise<SessionCompaction>;
10
10
  abstract destroy(): void | Promise<void>;
11
11
  }
12
12
  export type { SessionCompaction, SessionContext, SessionEvent, SessionRunRequest, SessionStream };
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSession.d.ts","sourceRoot":"","sources":["../../sources/core/BaseSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,8BAAsB,WAAW;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,SAAS,aAAa,EAAE,EAAE,MAAM,EAE/B;IAED,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAAC;IAExD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEjF,QAAQ,CAAC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"BaseSession.d.ts","sourceRoot":"","sources":["../../sources/core/BaseSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,8BAAsB,WAAW;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,SAAS,aAAa,EAAE,EAAE,MAAM,EAE/B;IAED,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,GAAG,aAAa,CAAC;IAExD,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEhF,QAAQ,CAAC,OAAO,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { SessionCacheUsage } from "../core/SessionCacheUsage.js";
1
+ import type { SessionUsage } from "../core/SessionUsage.js";
2
2
  import type { SessionEvent } from "../core/SessionEvent.js";
3
3
  type ErrorDoneEvent = Extract<SessionEvent, {
4
4
  type: "done";
@@ -7,8 +7,8 @@ type ErrorDoneEvent = Extract<SessionEvent, {
7
7
  export declare class EmptyResponseError extends Error {
8
8
  readonly code = "empty_response";
9
9
  readonly errorType = "empty_response";
10
- readonly usage: SessionCacheUsage | undefined;
11
- constructor(provider: string, usage?: SessionCacheUsage);
10
+ readonly usage: SessionUsage | undefined;
11
+ constructor(provider: string, usage?: SessionUsage);
12
12
  }
13
13
  export declare function isEmptyResponseError(error: unknown): error is EmptyResponseError;
14
14
  export declare function emptyResponseDoneEvent(error: EmptyResponseError, attempts: number): ErrorDoneEvent;
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyResponseError.d.ts","sourceRoot":"","sources":["../../sources/core/EmptyResponseError.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,KAAK,cAAc,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE9E,qBAAa,kBAAmB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,SAAS,oBAAoB;IACtC,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAE9C,YAAY,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,iBAAiB,EAItD;CACJ;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,MAAM,GACjB,cAAc,CAehB"}
1
+ {"version":3,"file":"EmptyResponseError.d.ts","sourceRoot":"","sources":["../../sources/core/EmptyResponseError.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,KAAK,cAAc,GAAG,OAAO,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAE9E,qBAAa,kBAAmB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,SAAS,oBAAoB;IACtC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAAC;IAEzC,YAAY,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAIjD;CACJ;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAEhF;AAED,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,MAAM,GACjB,cAAc,CAehB"}
@@ -1 +1 @@
1
- {"version":3,"file":"EmptyResponseError.js","sourceRoot":"","sources":["../../sources/core/EmptyResponseError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAM5F,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAChC,IAAI,GAAG,gBAAgB,CAAC;IACxB,SAAS,GAAG,gBAAgB,CAAC;IAC7B,KAAK,CAAgC;IAE9C,YAAY,QAAgB,EAAE,KAAyB;QACnD,KAAK,CAAC,GAAG,QAAQ,+CAA+C,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACJ;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IAC/C,OAAO,KAAK,YAAY,kBAAkB,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAClC,KAAyB,EACzB,QAAgB;IAEhB,MAAM,WAAW,GAAG,+BAA+B,CAAC,KAAK,EAAE;QACvD,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC;QAC/B,eAAe,EAAE,KAAK,CAAC,OAAO;KACjC,CAAC,CAAC;IACH,OAAO;QACH,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,aAAa,EAAE;YACX,IAAI,EAAE,gBAAgB;YACtB,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;SACxD;KACJ,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"EmptyResponseError.js","sourceRoot":"","sources":["../../sources/core/EmptyResponseError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAM5F,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAChC,IAAI,GAAG,gBAAgB,CAAC;IACxB,SAAS,GAAG,gBAAgB,CAAC;IAC7B,KAAK,CAA2B;IAEzC,YAAY,QAAgB,EAAE,KAAoB;QAC9C,KAAK,CAAC,GAAG,QAAQ,+CAA+C,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACJ;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAc;IAC/C,OAAO,KAAK,YAAY,kBAAkB,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAClC,KAAyB,EACzB,QAAgB;IAEhB,MAAM,WAAW,GAAG,+BAA+B,CAAC,KAAK,EAAE;QACvD,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC;QAC/B,eAAe,EAAE,KAAK,CAAC,OAAO;KACjC,CAAC,CAAC;IACH,OAAO;QACH,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,OAAO;QACd,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,aAAa,EAAE;YACX,IAAI,EAAE,gBAAgB;YACtB,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;SACxD;KACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { SessionAssistantMessage } from "../core/SessionContext.js";
2
+ import type { SessionEvent } from "../core/SessionEvent.js";
3
+ /** Reconstructs one ordered assistant message from a session run's block events. */
4
+ export declare class SessionAssistantMessageAccumulator {
5
+ private readonly content;
6
+ private checkpoint;
7
+ private text;
8
+ private reasoning;
9
+ private readonly toolCalls;
10
+ private readonly toolResults;
11
+ add(event: SessionEvent): void;
12
+ message(): SessionAssistantMessage | undefined;
13
+ private clearActiveBlocks;
14
+ }
15
+ /** Reconstructs one assistant message after consuming a complete run. */
16
+ export declare function assistantMessageFromEvents(events: readonly SessionEvent[]): SessionAssistantMessage | undefined;
17
+ //# sourceMappingURL=SessionAssistantMessageAccumulator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionAssistantMessageAccumulator.d.ts","sourceRoot":"","sources":["../../sources/core/SessionAssistantMessageAccumulator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAER,uBAAuB,EAE1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AA4B3D,oFAAoF;AACpF,qBAAa,kCAAkC;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;IACvD,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,IAAI,CAA+B;IAC3C,OAAO,CAAC,SAAS,CAAoC;IACrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2C;IACrE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6C;IAEzE,GAAG,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA8G7B;IAED,OAAO,IAAI,uBAAuB,GAAG,SAAS,CAM7C;IAED,OAAO,CAAC,iBAAiB;CAM5B;AAED,yEAAyE;AACzE,wBAAgB,0BAA0B,CACtC,MAAM,EAAE,SAAS,YAAY,EAAE,GAChC,uBAAuB,GAAG,SAAS,CAIrC"}