@tinyweb_dev/agent-framework-llm 0.3.0 → 0.4.0

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.
@@ -2209,6 +2209,14 @@ var OpenAIChatToolCallDelta = effect$1.Schema.Struct({
2209
2209
  });
2210
2210
  var OpenAIChatDelta = effect$1.Schema.Struct({
2211
2211
  content: optionalNull(effect$1.Schema.String),
2212
+ /**
2213
+ * Thinking / chain-of-thought stream. DeepSeek + MiniMax native and
2214
+ * LiteLLM-normalized gateways use `reasoning_content`; OpenRouter (and some
2215
+ * Grok mirrors) use `reasoning`. Either must become `reasoning-delta` so
2216
+ * UIs are not stuck on a pre-text thinking spinner while the wire is live.
2217
+ */
2218
+ reasoning_content: optionalNull(effect$1.Schema.String),
2219
+ reasoning: optionalNull(effect$1.Schema.String),
2212
2220
  tool_calls: optionalNull(effect$1.Schema.Array(OpenAIChatToolCallDelta))
2213
2221
  });
2214
2222
  var OpenAIChatChoice = effect$1.Schema.Struct({
@@ -2385,6 +2393,10 @@ var step = (state, event) => effect$1.Effect.gen(function* () {
2385
2393
  const toolDeltas = delta?.tool_calls ?? [];
2386
2394
  let tools = state.tools;
2387
2395
  let textAcc = state.textAcc;
2396
+ const reasoningChunk = delta?.reasoning_content ?? delta?.reasoning;
2397
+ if (reasoningChunk) {
2398
+ events.push(LLMEvent.reasoningDelta({ id: "reasoning-0", text: reasoningChunk }));
2399
+ }
2388
2400
  if (delta?.content) {
2389
2401
  const normalised = normaliseTextDelta(textAcc, delta.content);
2390
2402
  textAcc = normalised.textAcc;