@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.
package/dist/index.cjs CHANGED
@@ -2284,6 +2284,14 @@ var OpenAIChatToolCallDelta = effect$1.Schema.Struct({
2284
2284
  });
2285
2285
  var OpenAIChatDelta = effect$1.Schema.Struct({
2286
2286
  content: optionalNull(effect$1.Schema.String),
2287
+ /**
2288
+ * Thinking / chain-of-thought stream. DeepSeek + MiniMax native and
2289
+ * LiteLLM-normalized gateways use `reasoning_content`; OpenRouter (and some
2290
+ * Grok mirrors) use `reasoning`. Either must become `reasoning-delta` so
2291
+ * UIs are not stuck on a pre-text thinking spinner while the wire is live.
2292
+ */
2293
+ reasoning_content: optionalNull(effect$1.Schema.String),
2294
+ reasoning: optionalNull(effect$1.Schema.String),
2287
2295
  tool_calls: optionalNull(effect$1.Schema.Array(OpenAIChatToolCallDelta))
2288
2296
  });
2289
2297
  var OpenAIChatChoice = effect$1.Schema.Struct({
@@ -2460,6 +2468,10 @@ var step = (state, event) => effect$1.Effect.gen(function* () {
2460
2468
  const toolDeltas = delta?.tool_calls ?? [];
2461
2469
  let tools = state.tools;
2462
2470
  let textAcc = state.textAcc;
2471
+ const reasoningChunk = delta?.reasoning_content ?? delta?.reasoning;
2472
+ if (reasoningChunk) {
2473
+ events.push(LLMEvent.reasoningDelta({ id: "reasoning-0", text: reasoningChunk }));
2474
+ }
2463
2475
  if (delta?.content) {
2464
2476
  const normalised = normaliseTextDelta(textAcc, delta.content);
2465
2477
  textAcc = normalised.textAcc;