@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/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { i as ports } from './index-oCM3XEu2.cjs';
2
- export { i as runtimeKernel } from './index-CZtZq3T1.cjs';
2
+ export { i as runtimeKernel } from './index-C2PSqU1I.cjs';
3
3
  export { i as contracts, g as generateAuditEnvelopeId, a as generateRunId, b as generateRuntimeEventId } from './index-JYf6n2Ik.cjs';
4
4
  export { D as DefineAgentInput, a as DefinedAgent, L as LinnkitQuickstartConfig, R as RunAgentOptions, b as RunAgentResult, d as defineAgent, c as defineConfig, r as resolveConfiguredInference, e as runAgent } from './runAgent-QiBiFXHR.cjs';
5
- export { L as LlmCallTelemetry, w as withLLMTelemetryContext } from './defaultGraphExecutor-CO3ztZdG.cjs';
5
+ export { L as LlmCallTelemetry, w as withLLMTelemetryContext } from './defaultGraphExecutor-Chr16eYO.cjs';
6
6
  import './llm-input-materialization-r-V3n9U-.cjs';
7
7
  import './provider-continuation-CTZdCB--.cjs';
8
8
  import 'zod';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { i as ports } from './index-DpSWZ1L6.js';
2
- export { i as runtimeKernel } from './index-CMUnmxhM.js';
2
+ export { i as runtimeKernel } from './index-CZMXtw4h.js';
3
3
  export { i as contracts, g as generateAuditEnvelopeId, a as generateRunId, b as generateRuntimeEventId } from './index-Cp1_oUj0.js';
4
4
  export { D as DefineAgentInput, a as DefinedAgent, L as LinnkitQuickstartConfig, R as RunAgentOptions, b as RunAgentResult, d as defineAgent, c as defineConfig, r as resolveConfiguredInference, e as runAgent } from './runAgent-jxZ0uNto.js';
5
- export { L as LlmCallTelemetry, w as withLLMTelemetryContext } from './defaultGraphExecutor-B2kGX0iA.js';
5
+ export { L as LlmCallTelemetry, w as withLLMTelemetryContext } from './defaultGraphExecutor-hT7dchpC.js';
6
6
  import './llm-input-materialization-Vce5Swvc.js';
7
7
  import './provider-continuation-CTZdCB--.js';
8
8
  import 'zod';
package/dist/index.js CHANGED
@@ -9888,6 +9888,15 @@ var ToolNode = class {
9888
9888
  });
9889
9889
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9890
9890
  }
9891
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9892
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
9893
+ toolName: context.toolName,
9894
+ toolCallId: context.toolCallId,
9895
+ conversationId: context.conversationId,
9896
+ turnId: context.turnId
9897
+ });
9898
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9899
+ }
9891
9900
  return {
9892
9901
  kind: "route",
9893
9902
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -9970,6 +9979,9 @@ var ToolNode = class {
9970
9979
  if (fuse.shouldFuse && remainingCalls.length === 0) {
9971
9980
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
9972
9981
  }
9982
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9983
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9984
+ }
9973
9985
  return {
9974
9986
  kind: "route",
9975
9987
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -10494,7 +10506,8 @@ function createHostToolCallBootstrap(input) {
10494
10506
  conversationId,
10495
10507
  turnId,
10496
10508
  history: [...input.history ?? [], decisionEvent],
10497
- pendingToolCalls: [toolCall]
10509
+ pendingToolCalls: [toolCall],
10510
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
10498
10511
  }
10499
10512
  };
10500
10513
  }