@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.
@@ -1,8 +1,8 @@
1
1
  import { C as CanonicalLlmUsage } from './reasoning-bffu9R2B.cjs';
2
2
  import { P as ProviderContinuation, A as AiMessage } from './provider-continuation-CTZdCB--.cjs';
3
3
  import { m as CanonicalInferenceRequest, r as LlmCallOptions, v as LlmInputMaterializerPort, i as CanonicalInferenceFinishReason, w as LlmRequestMessage } from './llm-input-materialization-r-V3n9U-.cjs';
4
- import { d as LlmCaller, a as ModelCatalogLike, aa as TelemetryEvent$2, P as DefaultRunSupervisor, W as MemoryRunRegistryStore, n as MemoryEventStore, Y as RunExecutorPort$1, Z as RunOutcome$1, q as ToolContextPatch$1 } from './defaultGraphExecutor-CO3ztZdG.cjs';
5
- export { ac as DefaultGraphExecutorOptions, ad as GraphLoopHarness, ae as GraphLoopHarnessOptions, af as GraphLoopHarnessRunResult, ag as GraphLoopLlmNodeFactoryParams, ah as createDefaultGraphExecutor, ai as createGraphLoopHarness } from './defaultGraphExecutor-CO3ztZdG.cjs';
4
+ import { d as LlmCaller, a as ModelCatalogLike, ab as TelemetryEvent$2, Q as DefaultRunSupervisor, X as MemoryRunRegistryStore, o as MemoryEventStore, Z as RunExecutorPort$1, _ as RunOutcome$1, r as ToolContextPatch$1 } from './defaultGraphExecutor-Chr16eYO.cjs';
5
+ export { ad as DefaultGraphExecutorOptions, ae as GraphLoopHarness, af as GraphLoopHarnessOptions, ag as GraphLoopHarnessRunResult, ah as GraphLoopLlmNodeFactoryParams, ai as createDefaultGraphExecutor, aj as createGraphLoopHarness } from './defaultGraphExecutor-Chr16eYO.cjs';
6
6
  import { R as RuntimeEvent, f as RoutedRuntimeEvent } from './final-answer-B0_kx5_U.cjs';
7
7
  import { b as ContextTrace } from './base-DRRrRhxS.cjs';
8
8
  import { d as AgentSpecContextPolicy, c as AgentSpec } from './token-accounting-19cXG7hM.cjs';
package/dist/testkit.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { C as CanonicalLlmUsage } from './reasoning-bffu9R2B.js';
2
2
  import { P as ProviderContinuation, A as AiMessage } from './provider-continuation-CTZdCB--.js';
3
3
  import { m as CanonicalInferenceRequest, r as LlmCallOptions, v as LlmInputMaterializerPort, i as CanonicalInferenceFinishReason, w as LlmRequestMessage } from './llm-input-materialization-Vce5Swvc.js';
4
- import { d as LlmCaller, a as ModelCatalogLike, aa as TelemetryEvent$2, P as DefaultRunSupervisor, W as MemoryRunRegistryStore, n as MemoryEventStore, Y as RunExecutorPort$1, Z as RunOutcome$1, q as ToolContextPatch$1 } from './defaultGraphExecutor-B2kGX0iA.js';
5
- export { ac as DefaultGraphExecutorOptions, ad as GraphLoopHarness, ae as GraphLoopHarnessOptions, af as GraphLoopHarnessRunResult, ag as GraphLoopLlmNodeFactoryParams, ah as createDefaultGraphExecutor, ai as createGraphLoopHarness } from './defaultGraphExecutor-B2kGX0iA.js';
4
+ import { d as LlmCaller, a as ModelCatalogLike, ab as TelemetryEvent$2, Q as DefaultRunSupervisor, X as MemoryRunRegistryStore, o as MemoryEventStore, Z as RunExecutorPort$1, _ as RunOutcome$1, r as ToolContextPatch$1 } from './defaultGraphExecutor-hT7dchpC.js';
5
+ export { ad as DefaultGraphExecutorOptions, ae as GraphLoopHarness, af as GraphLoopHarnessOptions, ag as GraphLoopHarnessRunResult, ah as GraphLoopLlmNodeFactoryParams, ai as createDefaultGraphExecutor, aj as createGraphLoopHarness } from './defaultGraphExecutor-hT7dchpC.js';
6
6
  import { R as RuntimeEvent, f as RoutedRuntimeEvent } from './final-answer-oOQ_7nPt.js';
7
7
  import { b as ContextTrace } from './base-DVyQIl_d.js';
8
8
  import { d as AgentSpecContextPolicy, c as AgentSpec } from './token-accounting-CVW37Uri.js';
package/dist/testkit.js CHANGED
@@ -9069,6 +9069,15 @@ var ToolNode = class {
9069
9069
  });
9070
9070
  return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9071
9071
  }
9072
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9073
+ logger11.info("[ToolNode] \u5DE5\u5177\u6279\u6B21\u5DF2\u7ED3\u7B97\uFF0C\u6309 Host \u7B56\u7565\u76F4\u63A5 yield", {
9074
+ toolName: context.toolName,
9075
+ toolCallId: context.toolCallId,
9076
+ conversationId: context.conversationId,
9077
+ turnId: context.turnId
9078
+ });
9079
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9080
+ }
9072
9081
  return {
9073
9082
  kind: "route",
9074
9083
  nextNodeId: remainingCalls.length > 0 ? "tool" : "llm",
@@ -9151,6 +9160,9 @@ var ToolNode = class {
9151
9160
  if (fuse.shouldFuse && remainingCalls.length === 0) {
9152
9161
  throw createToolProtocolFuseError(fuse.nextCount, context.exec.error);
9153
9162
  }
9163
+ if (remainingCalls.length === 0 && context.local.toolBatchCompletionMode === "yield_after_batch") {
9164
+ return { kind: "yield", events: context.bridge.getRuntimeEvents() };
9165
+ }
9154
9166
  return {
9155
9167
  kind: "route",
9156
9168
  // 同一个 assistant.tool_calls batch 必须为每个 call 产出 tool_output。
@@ -9675,7 +9687,8 @@ function createHostToolCallBootstrap(input) {
9675
9687
  conversationId,
9676
9688
  turnId,
9677
9689
  history: [...input.history ?? [], decisionEvent],
9678
- pendingToolCalls: [toolCall]
9690
+ pendingToolCalls: [toolCall],
9691
+ ...input.completionMode === void 0 ? {} : { toolBatchCompletionMode: input.completionMode }
9679
9692
  }
9680
9693
  };
9681
9694
  }