@linnlabs/linnkit 0.31.1 → 0.32.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/CHANGELOG.md CHANGED
@@ -14,6 +14,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.32.0] - 2026-09-04
18
+
19
+ ### Added
20
+
21
+ - Added the host-controlled `yield_after_batch` tool completion mode. Host-originated
22
+ runs can now return a fully settled tool batch without invoking the LLM or changing
23
+ the reusable tool's own `terminateRun` semantics.
24
+
17
25
  ## [0.31.1] - 2026-09-03
18
26
 
19
27
  ### Fixed
package/dist/cli.cjs CHANGED
@@ -8704,6 +8704,15 @@ var ToolNode = class {
8704
8704
  });
8705
8705
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8706
8706
  }
8707
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8708
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
8709
+ toolName: context.toolName,
8710
+ toolCallId: context.toolCallId,
8711
+ conversationId: context.conversationId,
8712
+ turnId: context.turnId
8713
+ });
8714
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8715
+ }
8707
8716
  return {
8708
8717
  kind: "route",
8709
8718
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -8786,6 +8795,9 @@ var ToolNode = class {
8786
8795
  if (fuse.shouldFuse && remainingCalls.length === 0) {
8787
8796
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
8788
8797
  }
8798
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
8799
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
8800
+ }
8789
8801
  return {
8790
8802
  kind: "route",
8791
8803
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -9310,7 +9322,8 @@ function createHostToolCallBootstrap(input) {
9310
9322
  conversationId,
9311
9323
  turnId,
9312
9324
  history: [...input.history ?? [], decisionEvent],
9313
- pendingToolCalls: [toolCall]
9325
+ pendingToolCalls: [toolCall],
9326
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
9314
9327
  }
9315
9328
  };
9316
9329
  }