@theokit/sdk 2.15.1 → 2.15.2

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.
@@ -75,6 +75,9 @@ declare class OpenAIStreamAccumulator {
75
75
  private cacheWriteTokens?;
76
76
  private reasoningTokens?;
77
77
  private readonly toolCalls;
78
+ /** R7: present only when recovery is enabled AND the request declares tools — holds suspected
79
+ * leaked-dialect content back from the `text_delta` stream. `undefined` ⇒ stream immediately. */
80
+ private readonly suppress?;
78
81
  /**
79
82
  * @param extractFromContent opt-in leaked-dialect safe-parse (theokit#58). Default false.
80
83
  * @param providerName provider id, used only to label the recovery log line.
@@ -84,9 +87,15 @@ declare class OpenAIStreamAccumulator {
84
87
  */
85
88
  constructor(extractFromContent?: boolean, providerName?: string, allowedToolNames?: ReadonlySet<string> | undefined);
86
89
  consume(chunk: OpenAIDeltaChunk): LlmEvent[];
90
+ private applyChoice;
87
91
  private applyReasoningDelta;
88
92
  private applyUsage;
89
93
  private applyContentDelta;
94
+ /** R7 held-buffer finalizer, called at the `finish_reason` chunk (in `applyChoice`) AND after the
95
+ * SSE loop in `stream()` — so a stream that omits a `finish_reason` terminal never silently drops
96
+ * held text. `toolCalls.size > 0` (native calls present) makes `finish()` skip recovery, so the
97
+ * buffer streams the held text whole. Idempotent once drained. */
98
+ finalizeHeldText(): LlmEvent | undefined;
90
99
  private mergeToolCallDeltas;
91
100
  private applyFinishReason;
92
101
  finish(): LlmFinish;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/sdk",
3
- "version": "2.15.1",
3
+ "version": "2.15.2",
4
4
  "description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/usetheo/theokit-sdk#readme",