@linnlabs/linnkit 0.32.0 → 0.32.2
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 +20 -0
- package/dist/cli.cjs +35 -14
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +35 -14
- package/dist/cli.js.map +1 -1
- package/dist/context-manager/features/context-compaction/definitions/contextCheckpointFormat.d.cts +3 -0
- package/dist/context-manager/features/context-compaction/definitions/contextCheckpointFormat.d.ts +3 -0
- package/dist/context-manager/features/context-compaction/definitions/historySummaryDraft.d.cts +22 -0
- package/dist/context-manager/features/context-compaction/definitions/historySummaryDraft.d.ts +22 -0
- package/dist/context-manager/profiles/agent/config.d.cts +33 -0
- package/dist/context-manager/profiles/agent/config.d.ts +33 -0
- package/dist/context-manager/profiles/agent/context/AgentContextManager.d.cts +132 -0
- package/dist/context-manager/profiles/agent/context/AgentContextManager.d.ts +132 -0
- package/dist/context-manager/profiles/agent/context/ConversationSession.d.cts +131 -0
- package/dist/context-manager/profiles/agent/context/ConversationSession.d.ts +131 -0
- package/dist/context-manager/profiles/agent/context/config.d.cts +191 -0
- package/dist/context-manager/profiles/agent/context/config.d.ts +191 -0
- package/dist/context-manager/profiles/agent/context/index.d.cts +8 -0
- package/dist/context-manager/profiles/agent/context/index.d.ts +8 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentCoreContextProvider.d.cts +52 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentCoreContextProvider.d.ts +52 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentWorkingMemoryProvider.d.cts +50 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentWorkingMemoryProvider.d.ts +50 -0
- package/dist/context-manager/profiles/agent/context/providers/base.d.cts +11 -0
- package/dist/context-manager/profiles/agent/context/providers/base.d.ts +11 -0
- package/dist/context-manager/profiles/agent/context/providers/index.d.cts +12 -0
- package/dist/context-manager/profiles/agent/context/providers/index.d.ts +12 -0
- package/dist/context-manager/profiles/agent/contracts.d.cts +27 -0
- package/dist/context-manager/profiles/agent/contracts.d.ts +27 -0
- package/dist/context-manager/profiles/agent/orchestration/AgentMessageOrchestrator.d.cts +140 -0
- package/dist/context-manager/profiles/agent/orchestration/AgentMessageOrchestrator.d.ts +140 -0
- package/dist/context-manager/profiles/agent/orchestration/index.d.cts +1 -0
- package/dist/context-manager/profiles/agent/orchestration/index.d.ts +1 -0
- package/dist/context-manager/profiles/agent/preprocessors/base.d.cts +17 -0
- package/dist/context-manager/profiles/agent/preprocessors/base.d.ts +17 -0
- package/dist/context-manager/profiles/agent/preprocessors/index.d.cts +117 -0
- package/dist/context-manager/profiles/agent/preprocessors/index.d.ts +117 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolHistoryCompressor.d.cts +47 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolHistoryCompressor.d.ts +47 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolReplayProtocolGuard.d.cts +27 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolReplayProtocolGuard.d.ts +27 -0
- package/dist/context-manager/profiles/agent/tasks/BaseAgentTask.d.cts +43 -0
- package/dist/context-manager/profiles/agent/tasks/BaseAgentTask.d.ts +43 -0
- package/dist/context-manager/profiles/agent/tasks/base.d.cts +18 -0
- package/dist/context-manager/profiles/agent/tasks/base.d.ts +18 -0
- package/dist/context-manager/profiles/agent/tasks/index.d.cts +2 -0
- package/dist/context-manager/profiles/agent/tasks/index.d.ts +2 -0
- package/dist/context-manager/profiles/agent/tools/ToolManager.d.cts +27 -0
- package/dist/context-manager/profiles/agent/tools/ToolManager.d.ts +27 -0
- package/dist/context-manager/profiles/agent/tools/index.d.cts +1 -0
- package/dist/context-manager/profiles/agent/tools/index.d.ts +1 -0
- package/dist/context-manager/profiles/agent/utils/eventConverter.d.cts +15 -0
- package/dist/context-manager/profiles/agent/utils/eventConverter.d.ts +15 -0
- package/dist/context-manager/profiles/agent/utils/index.d.cts +2 -0
- package/dist/context-manager/profiles/agent/utils/index.d.ts +2 -0
- package/dist/context-manager/profiles/agent/utils/toolOutputSummarizer.d.cts +26 -0
- package/dist/context-manager/profiles/agent/utils/toolOutputSummarizer.d.ts +26 -0
- package/dist/context-manager/shared/MessageFormatter.d.cts +55 -0
- package/dist/context-manager/shared/MessageFormatter.d.ts +55 -0
- package/dist/context-manager/shared/agentSpecAdapter.d.cts +63 -0
- package/dist/context-manager/shared/agentSpecAdapter.d.ts +63 -0
- package/dist/context-manager/shared/context-manager-base.d.cts +102 -0
- package/dist/context-manager/shared/context-manager-base.d.ts +102 -0
- package/dist/context-manager/shared/context-pipeline.d.cts +42 -0
- package/dist/context-manager/shared/context-pipeline.d.ts +42 -0
- package/dist/context-manager/shared/context-trace.d.cts +102 -0
- package/dist/context-manager/shared/context-trace.d.ts +102 -0
- package/dist/context-manager/shared/contextPolicyMerge.d.cts +19 -0
- package/dist/context-manager/shared/contextPolicyMerge.d.ts +19 -0
- package/dist/context-manager/shared/contracts/chatLineMessage.d.cts +15 -0
- package/dist/context-manager/shared/contracts/chatLineMessage.d.ts +15 -0
- package/dist/context-manager/shared/fences/FenceRegistry.d.cts +24 -0
- package/dist/context-manager/shared/fences/FenceRegistry.d.ts +24 -0
- package/dist/context-manager/shared/image-input-estimation.d.cts +16 -0
- package/dist/context-manager/shared/image-input-estimation.d.ts +16 -0
- package/dist/context-manager/shared/policies/MustKeepPolicy.d.cts +19 -0
- package/dist/context-manager/shared/policies/MustKeepPolicy.d.ts +19 -0
- package/dist/context-manager/shared/preprocessors/base.d.cts +43 -0
- package/dist/context-manager/shared/preprocessors/base.d.ts +43 -0
- package/dist/context-manager/shared/preprocessors/currentTurnMessageAssembler.d.cts +26 -0
- package/dist/context-manager/shared/preprocessors/currentTurnMessageAssembler.d.ts +26 -0
- package/dist/context-manager/shared/preprocessors/fenceLifetimeManager.d.cts +18 -0
- package/dist/context-manager/shared/preprocessors/fenceLifetimeManager.d.ts +18 -0
- package/dist/context-manager/shared/preprocessors/historyPurification.d.cts +19 -0
- package/dist/context-manager/shared/preprocessors/historyPurification.d.ts +19 -0
- package/dist/context-manager/shared/preprocessors/priority.d.cts +17 -0
- package/dist/context-manager/shared/preprocessors/priority.d.ts +17 -0
- package/dist/context-manager/shared/providers/base.d.cts +106 -0
- package/dist/context-manager/shared/providers/base.d.ts +106 -0
- package/dist/context-manager/shared/providers/registry.d.cts +11 -0
- package/dist/context-manager/shared/providers/registry.d.ts +11 -0
- package/dist/context-manager/shared/token-calibration.d.cts +25 -0
- package/dist/context-manager/shared/token-calibration.d.ts +25 -0
- package/dist/context-manager.d.cts +34 -1559
- package/dist/context-manager.d.ts +34 -1559
- package/dist/contracts/agentSpec.d.cts +869 -0
- package/dist/contracts/agentSpec.d.ts +869 -0
- package/dist/{audit-XsNMTt0-.d.cts → contracts/audit.d.cts} +7 -7
- package/dist/{audit-XsNMTt0-.d.ts → contracts/audit.d.ts} +7 -7
- package/dist/contracts/constants.d.cts +3 -0
- package/dist/contracts/constants.d.ts +3 -0
- package/dist/contracts/contextCompaction.d.cts +43 -0
- package/dist/contracts/contextCompaction.d.ts +43 -0
- package/dist/contracts/contextPolicy.d.cts +1121 -0
- package/dist/contracts/contextPolicy.d.ts +1121 -0
- package/dist/{final-answer-B0_kx5_U.d.cts → contracts/events.d.cts} +422 -425
- package/dist/{final-answer-oOQ_7nPt.d.ts → contracts/events.d.ts} +422 -425
- package/dist/{execution-B7e01ZjW.d.cts → contracts/execution.d.cts} +13 -13
- package/dist/{execution-B7e01ZjW.d.ts → contracts/execution.d.ts} +13 -13
- package/dist/contracts/final-answer.d.cts +7 -0
- package/dist/contracts/final-answer.d.ts +7 -0
- package/dist/contracts/identity/definitions.d.cts +70 -0
- package/dist/contracts/identity/definitions.d.ts +70 -0
- package/dist/contracts/identity/generators.d.cts +33 -0
- package/dist/contracts/identity/generators.d.ts +33 -0
- package/dist/contracts/identity/invariants.d.cts +24 -0
- package/dist/contracts/identity/invariants.d.ts +24 -0
- package/dist/contracts/json.d.cts +12 -0
- package/dist/contracts/json.d.ts +12 -0
- package/dist/{provider-continuation-CTZdCB--.d.cts → contracts/messages.d.cts} +11 -758
- package/dist/{provider-continuation-CTZdCB--.d.ts → contracts/messages.d.ts} +11 -758
- package/dist/contracts/provider-continuation.d.cts +609 -0
- package/dist/contracts/provider-continuation.d.ts +609 -0
- package/dist/contracts/reasoning.d.cts +77 -0
- package/dist/contracts/reasoning.d.ts +77 -0
- package/dist/contracts/resource-ref.d.cts +73 -0
- package/dist/contracts/resource-ref.d.ts +73 -0
- package/dist/contracts/runtime-status.d.cts +8 -0
- package/dist/contracts/runtime-status.d.ts +8 -0
- package/dist/contracts/sse-framing.d.cts +28 -0
- package/dist/contracts/sse-framing.d.ts +28 -0
- package/dist/{index-Cp1_oUj0.d.ts → contracts/sse.d.cts} +455 -811
- package/dist/{index-JYf6n2Ik.d.cts → contracts/sse.d.ts} +455 -811
- package/dist/contracts/sub-run-trace-payload.d.cts +187 -0
- package/dist/contracts/sub-run-trace-payload.d.ts +187 -0
- package/dist/{summarization-CMMLhaCe.d.ts → contracts/summarization.d.cts} +2 -2
- package/dist/{summarization-kLeweZ5-.d.cts → contracts/summarization.d.ts} +2 -2
- package/dist/contracts/token-accounting.d.cts +1177 -0
- package/dist/contracts/token-accounting.d.ts +1177 -0
- package/dist/{token-calibration-GtFyMJtM.d.cts → contracts/token-calibration.d.cts} +1 -42
- package/dist/{token-calibration-GtFyMJtM.d.ts → contracts/token-calibration.d.ts} +1 -42
- package/dist/{reasoning-bffu9R2B.d.cts → contracts/token-usage.d.cts} +9 -84
- package/dist/{reasoning-bffu9R2B.d.ts → contracts/token-usage.d.ts} +9 -84
- package/dist/contracts.d.cts +24 -10
- package/dist/contracts.d.ts +24 -10
- package/dist/index.cjs +35 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -77
- package/dist/index.d.ts +14 -77
- package/dist/index.js +35 -14
- package/dist/index.js.map +1 -1
- package/dist/ports/agent-invocation.d.cts +42 -0
- package/dist/ports/agent-invocation.d.ts +42 -0
- package/dist/{audit-DnuOSwWE.d.ts → ports/audit.d.cts} +2 -2
- package/dist/{audit-C9LPbPib.d.cts → ports/audit.d.ts} +2 -2
- package/dist/ports/canonical-inference.d.cts +135 -0
- package/dist/ports/canonical-inference.d.ts +135 -0
- package/dist/ports/llm-call.d.cts +109 -0
- package/dist/ports/llm-call.d.ts +109 -0
- package/dist/ports/llm-input-materialization.d.cts +69 -0
- package/dist/ports/llm-input-materialization.d.ts +69 -0
- package/dist/{token-counter-BjiHQEJ-.d.ts → ports/token-counter.d.cts} +3 -3
- package/dist/{token-counter-DiGIoaq2.d.cts → ports/token-counter.d.ts} +3 -3
- package/dist/{tokenizer-yIFTTc-W.d.ts → ports/tokenizer.d.cts} +2 -2
- package/dist/{tokenizer-Dz5Y3KT0.d.cts → ports/tokenizer.d.ts} +2 -2
- package/dist/ports/tool-schema.d.cts +30 -0
- package/dist/ports/tool-schema.d.ts +30 -0
- package/dist/ports/usage-normalizer.d.cts +16 -0
- package/dist/ports/usage-normalizer.d.ts +16 -0
- package/dist/ports.d.cts +10 -9
- package/dist/ports.d.ts +10 -9
- package/dist/quickstart/defineAgent.d.cts +12 -0
- package/dist/quickstart/defineAgent.d.ts +12 -0
- package/dist/quickstart/defineConfig.d.cts +7 -0
- package/dist/quickstart/defineConfig.d.ts +7 -0
- package/dist/quickstart/runAgent.d.cts +12 -0
- package/dist/quickstart/runAgent.d.ts +12 -0
- package/dist/quickstart/toolRuntime.d.cts +14 -0
- package/dist/quickstart/toolRuntime.d.ts +14 -0
- package/dist/{runAgent-jxZ0uNto.d.ts → quickstart/types.d.cts} +10 -28
- package/dist/{runAgent-QiBiFXHR.d.cts → quickstart/types.d.ts} +10 -28
- package/dist/quickstart.cjs +35 -14
- package/dist/quickstart.cjs.map +1 -1
- package/dist/quickstart.d.cts +5 -23
- package/dist/quickstart.d.ts +5 -23
- package/dist/quickstart.js +35 -14
- package/dist/quickstart.js.map +1 -1
- package/dist/runtime-kernel/audit/compositeAudit.d.cts +23 -0
- package/dist/runtime-kernel/audit/compositeAudit.d.ts +23 -0
- package/dist/runtime-kernel/audit/consoleAudit.d.cts +10 -0
- package/dist/runtime-kernel/audit/consoleAudit.d.ts +10 -0
- package/dist/runtime-kernel/audit/emitAudit.d.cts +31 -0
- package/dist/runtime-kernel/audit/emitAudit.d.ts +31 -0
- package/dist/runtime-kernel/audit/eventStoreAudit.d.cts +27 -0
- package/dist/runtime-kernel/audit/eventStoreAudit.d.ts +27 -0
- package/dist/runtime-kernel/audit/fileAudit.d.cts +22 -0
- package/dist/runtime-kernel/audit/fileAudit.d.ts +22 -0
- package/dist/runtime-kernel/audit/index.d.cts +6 -0
- package/dist/runtime-kernel/audit/index.d.ts +6 -0
- package/dist/runtime-kernel/audit/noopAudit.d.cts +5 -0
- package/dist/runtime-kernel/audit/noopAudit.d.ts +5 -0
- package/dist/runtime-kernel/child-run-trace/childRunParentTraceProjection.d.cts +26 -0
- package/dist/runtime-kernel/child-run-trace/childRunParentTraceProjection.d.ts +26 -0
- package/dist/runtime-kernel/child-run-trace/index.d.cts +4 -0
- package/dist/runtime-kernel/child-run-trace/index.d.ts +4 -0
- package/dist/runtime-kernel/child-run-trace/projectChildRuntimeEventToSubRunTrace.d.cts +10 -0
- package/dist/runtime-kernel/child-run-trace/projectChildRuntimeEventToSubRunTrace.d.ts +10 -0
- package/dist/runtime-kernel/child-run-trace/runtimeEventSubRunTracePublisher.d.cts +47 -0
- package/dist/runtime-kernel/child-run-trace/runtimeEventSubRunTracePublisher.d.ts +47 -0
- package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.cts +81 -0
- package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.ts +81 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +101 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +101 -0
- package/dist/runtime-kernel/child-runs/historyPolicy.d.cts +9 -0
- package/dist/runtime-kernel/child-runs/historyPolicy.d.ts +9 -0
- package/dist/runtime-kernel/child-runs/index.d.cts +3 -0
- package/dist/runtime-kernel/child-runs/index.d.ts +3 -0
- package/dist/runtime-kernel/child-runs/types.d.cts +82 -0
- package/dist/runtime-kernel/child-runs/types.d.ts +82 -0
- package/dist/runtime-kernel/enrichment/index.d.cts +2 -0
- package/dist/runtime-kernel/enrichment/index.d.ts +2 -0
- package/dist/runtime-kernel/enrichment/registry.d.cts +25 -0
- package/dist/runtime-kernel/enrichment/registry.d.ts +25 -0
- package/dist/runtime-kernel/enrichment/types.d.cts +83 -0
- package/dist/runtime-kernel/enrichment/types.d.ts +83 -0
- package/dist/runtime-kernel/events/agent-to-runtime.d.cts +6 -0
- package/dist/runtime-kernel/events/agent-to-runtime.d.ts +6 -0
- package/dist/{agentEvents-yvamy9xt.d.cts → runtime-kernel/events/agentEvents.d.cts} +33 -32
- package/dist/{agentEvents-DhXdKeXD.d.ts → runtime-kernel/events/agentEvents.d.ts} +33 -32
- package/dist/runtime-kernel/events/eventGovernance.d.cts +47 -0
- package/dist/runtime-kernel/events/eventGovernance.d.ts +47 -0
- package/dist/runtime-kernel/events/eventMappers.d.cts +41 -0
- package/dist/runtime-kernel/events/eventMappers.d.ts +41 -0
- package/dist/runtime-kernel/events/finalAnswerAssembler.d.cts +27 -0
- package/dist/runtime-kernel/events/finalAnswerAssembler.d.ts +27 -0
- package/dist/runtime-kernel/events/finalAnswerCompletion.d.cts +6 -0
- package/dist/runtime-kernel/events/finalAnswerCompletion.d.ts +6 -0
- package/dist/runtime-kernel/events/provider-sidecar.d.cts +33 -0
- package/dist/runtime-kernel/events/provider-sidecar.d.ts +33 -0
- package/dist/runtime-kernel/events/runtime-to-ai-message.d.cts +14 -0
- package/dist/runtime-kernel/events/runtime-to-ai-message.d.ts +14 -0
- package/dist/runtime-kernel/events.d.cts +7 -5
- package/dist/runtime-kernel/events.d.ts +7 -5
- package/dist/runtime-kernel/execution/event-bus.d.cts +52 -0
- package/dist/runtime-kernel/execution/event-bus.d.ts +52 -0
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.cts +40 -0
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +40 -0
- package/dist/runtime-kernel/execution/index.d.cts +5 -0
- package/dist/runtime-kernel/execution/index.d.ts +5 -0
- package/dist/runtime-kernel/execution/runtimeErrorEventFactory.d.cts +46 -0
- package/dist/runtime-kernel/execution/runtimeErrorEventFactory.d.ts +46 -0
- package/dist/runtime-kernel/execution/runtimeEventPublisher.d.cts +34 -0
- package/dist/runtime-kernel/execution/runtimeEventPublisher.d.ts +34 -0
- package/dist/runtime-kernel/execution/sequencer.d.cts +69 -0
- package/dist/runtime-kernel/execution/sequencer.d.ts +69 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/base.d.cts +59 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/base.d.ts +59 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/memoryCheckpointer.d.cts +14 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/memoryCheckpointer.d.ts +14 -0
- package/dist/runtime-kernel/graph-engine/definitions/primaryPromptCapacityError.d.cts +22 -0
- package/dist/runtime-kernel/graph-engine/definitions/primaryPromptCapacityError.d.ts +22 -0
- package/dist/runtime-kernel/graph-engine/engine.d.cts +64 -0
- package/dist/runtime-kernel/graph-engine/engine.d.ts +64 -0
- package/dist/runtime-kernel/graph-engine/event-store/base.d.cts +26 -0
- package/dist/runtime-kernel/graph-engine/event-store/base.d.ts +26 -0
- package/dist/runtime-kernel/graph-engine/event-store/memoryEventStore.d.cts +14 -0
- package/dist/runtime-kernel/graph-engine/event-store/memoryEventStore.d.ts +14 -0
- package/dist/runtime-kernel/graph-engine/executor.d.cts +59 -0
- package/dist/runtime-kernel/graph-engine/executor.d.ts +59 -0
- package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.cts +104 -0
- package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.ts +104 -0
- package/dist/runtime-kernel/graph-engine/functions/createHostToolCallBootstrap.d.cts +41 -0
- package/dist/runtime-kernel/graph-engine/functions/createHostToolCallBootstrap.d.ts +41 -0
- package/dist/runtime-kernel/graph-engine/functions/engineStateSnapshot.d.cts +23 -0
- package/dist/runtime-kernel/graph-engine/functions/engineStateSnapshot.d.ts +23 -0
- package/dist/runtime-kernel/graph-engine/functions/evaluatePrimaryPromptCapacity.d.cts +15 -0
- package/dist/runtime-kernel/graph-engine/functions/evaluatePrimaryPromptCapacity.d.ts +15 -0
- package/dist/runtime-kernel/graph-engine/functions/runtimeFailureFact.d.cts +7 -0
- package/dist/runtime-kernel/graph-engine/functions/runtimeFailureFact.d.ts +7 -0
- package/dist/runtime-kernel/graph-engine/index.d.cts +18 -0
- package/dist/runtime-kernel/graph-engine/index.d.ts +18 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.d.cts +26 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.d.ts +26 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.eventBridge.d.cts +6 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.eventBridge.d.ts +6 -0
- package/dist/runtime-kernel/graph-engine/nodes/toolNode.d.cts +44 -0
- package/dist/runtime-kernel/graph-engine/nodes/toolNode.d.ts +44 -0
- package/dist/runtime-kernel/graph-engine/nodes/userNode.d.cts +8 -0
- package/dist/runtime-kernel/graph-engine/nodes/userNode.d.ts +8 -0
- package/dist/runtime-kernel/graph-engine/nodes/waitUserNode.d.cts +15 -0
- package/dist/runtime-kernel/graph-engine/nodes/waitUserNode.d.ts +15 -0
- package/dist/runtime-kernel/graph-engine/tick-pipeline/types.d.cts +57 -0
- package/dist/runtime-kernel/graph-engine/tick-pipeline/types.d.ts +57 -0
- package/dist/runtime-kernel/graph-engine/types.d.cts +143 -0
- package/dist/runtime-kernel/graph-engine/types.d.ts +143 -0
- package/dist/runtime-kernel/llm/caller.d.cts +50 -0
- package/dist/runtime-kernel/llm/caller.d.ts +50 -0
- package/dist/runtime-kernel/llm/canonical-inference/definitions/canonicalInferenceStreamState.d.cts +28 -0
- package/dist/runtime-kernel/llm/canonical-inference/definitions/canonicalInferenceStreamState.d.ts +28 -0
- package/dist/runtime-kernel/llm/canonical-inference/functions/advanceCanonicalInferenceStreamState.d.cts +6 -0
- package/dist/runtime-kernel/llm/canonical-inference/functions/advanceCanonicalInferenceStreamState.d.ts +6 -0
- package/dist/runtime-kernel/llm/canonical-inference/orchestration/consumeCanonicalInferenceStream.d.cts +6 -0
- package/dist/runtime-kernel/llm/canonical-inference/orchestration/consumeCanonicalInferenceStream.d.ts +6 -0
- package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.cts +29 -0
- package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.ts +29 -0
- package/dist/runtime-kernel/llm/definitions/llmFallbackObserver.d.cts +26 -0
- package/dist/runtime-kernel/llm/definitions/llmFallbackObserver.d.ts +26 -0
- package/dist/runtime-kernel/llm/functions/evaluateFallbackPromptCapacity.d.cts +9 -0
- package/dist/runtime-kernel/llm/functions/evaluateFallbackPromptCapacity.d.ts +9 -0
- package/dist/runtime-kernel/llm/index.d.cts +22 -0
- package/dist/runtime-kernel/llm/index.d.ts +22 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapability.d.cts +24 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapability.d.ts +24 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapabilityError.d.cts +31 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapabilityError.d.ts +31 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/createModelInputCompatibilityError.d.cts +13 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/createModelInputCompatibilityError.d.ts +13 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/deriveModelInputRequirement.d.cts +6 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/deriveModelInputRequirement.d.ts +6 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/evaluateModelInputCompatibility.d.cts +7 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/evaluateModelInputCompatibility.d.ts +7 -0
- package/dist/runtime-kernel/llm/input-capabilities/orchestration/assertModelInputCompatibility.d.cts +10 -0
- package/dist/runtime-kernel/llm/input-capabilities/orchestration/assertModelInputCompatibility.d.ts +10 -0
- package/dist/runtime-kernel/llm/modelCatalog.d.cts +62 -0
- package/dist/runtime-kernel/llm/modelCatalog.d.ts +62 -0
- package/dist/runtime-kernel/llm/modelResolver.d.cts +40 -0
- package/dist/runtime-kernel/llm/modelResolver.d.ts +40 -0
- package/dist/runtime-kernel/llm/policies/defaultPolicyEngine.d.cts +15 -0
- package/dist/runtime-kernel/llm/policies/defaultPolicyEngine.d.ts +15 -0
- package/dist/runtime-kernel/llm/policies/policyEngine.d.cts +18 -0
- package/dist/runtime-kernel/llm/policies/policyEngine.d.ts +18 -0
- package/dist/runtime-kernel/llm/policies/types.d.cts +27 -0
- package/dist/runtime-kernel/llm/policies/types.d.ts +27 -0
- package/dist/runtime-kernel/llm/request-builder.d.cts +22 -0
- package/dist/runtime-kernel/llm/request-builder.d.ts +22 -0
- package/dist/runtime-kernel/llm/usage-telemetry.d.cts +17 -0
- package/dist/runtime-kernel/llm/usage-telemetry.d.ts +17 -0
- package/dist/runtime-kernel/run-context/index.d.cts +1 -0
- package/dist/runtime-kernel/run-context/index.d.ts +1 -0
- package/dist/runtime-kernel/run-context/types.d.cts +44 -0
- package/dist/runtime-kernel/run-context/types.d.ts +44 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +131 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +131 -0
- package/dist/runtime-kernel/run-supervisor/index.d.cts +6 -0
- package/dist/runtime-kernel/run-supervisor/index.d.ts +6 -0
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +15 -0
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +15 -0
- package/dist/runtime-kernel/run-supervisor/runErrors.d.cts +24 -0
- package/dist/runtime-kernel/run-supervisor/runErrors.d.ts +24 -0
- package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +155 -0
- package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +155 -0
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +47 -0
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +47 -0
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +57 -0
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +57 -0
- package/dist/runtime-kernel/system-reminder/apply.d.cts +38 -0
- package/dist/runtime-kernel/system-reminder/apply.d.ts +38 -0
- package/dist/runtime-kernel/system-reminder/helpers.d.cts +11 -0
- package/dist/runtime-kernel/system-reminder/helpers.d.ts +11 -0
- package/dist/runtime-kernel/system-reminder/index.d.cts +7 -0
- package/dist/runtime-kernel/system-reminder/index.d.ts +7 -0
- package/dist/runtime-kernel/system-reminder/registry.d.cts +17 -0
- package/dist/runtime-kernel/system-reminder/registry.d.ts +17 -0
- package/dist/runtime-kernel/system-reminder/rules.d.cts +20 -0
- package/dist/runtime-kernel/system-reminder/rules.d.ts +20 -0
- package/dist/runtime-kernel/system-reminder/templates.d.cts +10 -0
- package/dist/runtime-kernel/system-reminder/templates.d.ts +10 -0
- package/dist/runtime-kernel/system-reminder/triggers.d.cts +10 -0
- package/dist/runtime-kernel/system-reminder/triggers.d.ts +10 -0
- package/dist/runtime-kernel/system-reminder/types.d.cts +46 -0
- package/dist/runtime-kernel/system-reminder/types.d.ts +46 -0
- package/dist/runtime-kernel/telemetry/index.d.cts +3 -0
- package/dist/runtime-kernel/telemetry/index.d.ts +3 -0
- package/dist/runtime-kernel/telemetry/noopTelemetry.d.cts +5 -0
- package/dist/runtime-kernel/telemetry/noopTelemetry.d.ts +5 -0
- package/dist/runtime-kernel/telemetry/telemetryEvents.d.cts +5 -0
- package/dist/runtime-kernel/telemetry/telemetryEvents.d.ts +5 -0
- package/dist/runtime-kernel/telemetry/telemetryPort.d.cts +95 -0
- package/dist/runtime-kernel/telemetry/telemetryPort.d.ts +95 -0
- package/dist/runtime-kernel/testkit/defaultGraphExecutor.d.cts +23 -0
- package/dist/runtime-kernel/testkit/defaultGraphExecutor.d.ts +23 -0
- package/dist/runtime-kernel/testkit/graphLoopHarness.d.cts +49 -0
- package/dist/runtime-kernel/testkit/graphLoopHarness.d.ts +49 -0
- package/dist/runtime-kernel/token-accounting/functions.d.cts +27 -0
- package/dist/runtime-kernel/token-accounting/functions.d.ts +27 -0
- package/dist/runtime-kernel/token-accounting/index.d.cts +1 -0
- package/dist/runtime-kernel/token-accounting/index.d.ts +1 -0
- package/dist/runtime-kernel/tools/argNormalizer.d.cts +10 -0
- package/dist/runtime-kernel/tools/argNormalizer.d.ts +10 -0
- package/dist/runtime-kernel/tools/conversationView.d.cts +22 -0
- package/dist/runtime-kernel/tools/conversationView.d.ts +22 -0
- package/dist/runtime-kernel/tools/idempotency/toolIdempotency.d.cts +25 -0
- package/dist/runtime-kernel/tools/idempotency/toolIdempotency.d.ts +25 -0
- package/dist/runtime-kernel/tools/index.d.cts +15 -0
- package/dist/runtime-kernel/tools/index.d.ts +15 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInput.d.cts +51 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInput.d.ts +51 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInputPolicy.d.cts +17 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInputPolicy.d.ts +17 -0
- package/dist/runtime-kernel/tools/model-input/functions/parseToolModelInputDeclaration.d.cts +17 -0
- package/dist/runtime-kernel/tools/model-input/functions/parseToolModelInputDeclaration.d.ts +17 -0
- package/dist/runtime-kernel/tools/model-input/orchestration/resolveToolModelInput.d.cts +16 -0
- package/dist/runtime-kernel/tools/model-input/orchestration/resolveToolModelInput.d.ts +16 -0
- package/dist/runtime-kernel/tools/ports.d.cts +119 -0
- package/dist/runtime-kernel/tools/ports.d.ts +119 -0
- package/dist/runtime-kernel/tools/schema/functions/assertToolParameterSchema.d.cts +15 -0
- package/dist/runtime-kernel/tools/schema/functions/assertToolParameterSchema.d.ts +15 -0
- package/dist/runtime-kernel/tools/toolContextPatch.d.cts +14 -0
- package/dist/runtime-kernel/tools/toolContextPatch.d.ts +14 -0
- package/dist/runtime-kernel/tools/toolContextRuntime.d.cts +37 -0
- package/dist/runtime-kernel/tools/toolContextRuntime.d.ts +37 -0
- package/dist/runtime-kernel/tools/toolContracts.d.cts +109 -0
- package/dist/runtime-kernel/tools/toolContracts.d.ts +109 -0
- package/dist/runtime-kernel/tools/toolExecutionContext.d.cts +104 -0
- package/dist/runtime-kernel/tools/toolExecutionContext.d.ts +104 -0
- package/dist/runtime-kernel/tools/ui-types.d.cts +72 -0
- package/dist/runtime-kernel/tools/ui-types.d.ts +72 -0
- package/dist/runtime-kernel.cjs +35 -14
- package/dist/runtime-kernel.cjs.map +1 -1
- package/dist/runtime-kernel.d.cts +106 -20
- package/dist/runtime-kernel.d.ts +106 -20
- package/dist/runtime-kernel.js +35 -14
- package/dist/runtime-kernel.js.map +1 -1
- package/dist/shared/defaultTokenizerPort.d.cts +29 -0
- package/dist/shared/defaultTokenizerPort.d.ts +29 -0
- package/dist/shared/errorClassifier.d.cts +42 -0
- package/dist/shared/errorClassifier.d.ts +42 -0
- package/dist/shared/llmAuditProjection.d.cts +11 -0
- package/dist/shared/llmAuditProjection.d.ts +11 -0
- package/dist/shared/llmAuditRecorder.d.cts +44 -0
- package/dist/shared/llmAuditRecorder.d.ts +44 -0
- package/dist/shared/llmImageInputError.d.cts +34 -0
- package/dist/shared/llmImageInputError.d.ts +34 -0
- package/dist/shared/llmTelemetryContext.d.cts +52 -0
- package/dist/shared/llmTelemetryContext.d.ts +52 -0
- package/dist/shared/logger.d.cts +12 -0
- package/dist/shared/logger.d.ts +12 -0
- package/dist/{prompt-budget-yciFkC9U.d.cts → shared/prompt-budget.d.cts} +2 -1
- package/dist/{prompt-budget-yciFkC9U.d.ts → shared/prompt-budget.d.ts} +2 -1
- package/dist/testkit/agent-harness/assertions.d.cts +10 -0
- package/dist/testkit/agent-harness/assertions.d.ts +10 -0
- package/dist/testkit/agent-harness/scriptedInferenceHarness.d.cts +52 -0
- package/dist/testkit/agent-harness/scriptedInferenceHarness.d.ts +52 -0
- package/dist/testkit/context-harness/invariants/index.d.cts +7 -0
- package/dist/testkit/context-harness/invariants/index.d.ts +7 -0
- package/dist/testkit/context-harness/invariants/types.d.cts +32 -0
- package/dist/testkit/context-harness/invariants/types.d.ts +32 -0
- package/dist/testkit/context-harness/replayHarness.d.cts +18 -0
- package/dist/testkit/context-harness/replayHarness.d.ts +18 -0
- package/dist/testkit/mocks/tokenizerPort.d.cts +17 -0
- package/dist/testkit/mocks/tokenizerPort.d.ts +17 -0
- package/dist/testkit/run-harness/collectingAuditPort.d.cts +21 -0
- package/dist/testkit/run-harness/collectingAuditPort.d.ts +21 -0
- package/dist/testkit/run-harness/invariants/index.d.cts +7 -0
- package/dist/testkit/run-harness/invariants/index.d.ts +7 -0
- package/dist/testkit/run-harness/invariants/types.d.cts +48 -0
- package/dist/testkit/run-harness/invariants/types.d.ts +48 -0
- package/dist/testkit/run-harness/mockTelemetryPort.d.cts +35 -0
- package/dist/testkit/run-harness/mockTelemetryPort.d.ts +35 -0
- package/dist/testkit/run-harness/runSupervisorHarness.d.cts +60 -0
- package/dist/testkit/run-harness/runSupervisorHarness.d.ts +60 -0
- package/dist/testkit/tool-fixtures/toolContext.d.cts +19 -0
- package/dist/testkit/tool-fixtures/toolContext.d.ts +19 -0
- package/dist/testkit.cjs +35 -14
- package/dist/testkit.cjs.map +1 -1
- package/dist/testkit.d.cts +17 -277
- package/dist/testkit.d.ts +17 -277
- package/dist/testkit.js +35 -14
- package/dist/testkit.js.map +1 -1
- package/package.json +6 -4
- package/dist/base-DRRrRhxS.d.cts +0 -216
- package/dist/base-DVyQIl_d.d.ts +0 -216
- package/dist/defaultGraphExecutor-Chr16eYO.d.cts +0 -914
- package/dist/defaultGraphExecutor-hT7dchpC.d.ts +0 -914
- package/dist/index-1pE6gSpV.d.cts +0 -172
- package/dist/index-C2PSqU1I.d.cts +0 -1971
- package/dist/index-CZMXtw4h.d.ts +0 -1971
- package/dist/index-D_csW7Zl.d.ts +0 -172
- package/dist/index-DpSWZ1L6.d.ts +0 -67
- package/dist/index-oCM3XEu2.d.cts +0 -67
- package/dist/llm-input-materialization-Vce5Swvc.d.ts +0 -366
- package/dist/llm-input-materialization-r-V3n9U-.d.cts +0 -366
- package/dist/runHandle--l0kE205.d.cts +0 -490
- package/dist/runHandle-ouLd6Tgp.d.ts +0 -490
- package/dist/token-accounting-19cXG7hM.d.cts +0 -3342
- package/dist/token-accounting-CVW37Uri.d.ts +0 -3342
- package/dist/toolContracts--KrHHNCY.d.cts +0 -424
- package/dist/toolContracts-BQ4kIso_.d.ts +0 -424
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import { R as RuntimeEvent, S as SubRunTraceEvent, b as FinalAnswerCompletionReason } from './final-answer-oOQ_7nPt.js';
|
|
2
|
-
import { M as SerializableJsonRecord, T as ToolCallId, R as RuntimeResourceRef, c as RunId } from './provider-continuation-CTZdCB--.js';
|
|
3
|
-
import { x as SubRunTraceToolCallDecision } from './token-accounting-CVW37Uri.js';
|
|
4
|
-
import { L as LlmImageInputPlacement, A as AgentContextInjection, B as ToolParameterSchema } from './llm-input-materialization-Vce5Swvc.js';
|
|
5
|
-
|
|
6
|
-
interface ToolContextConversationView {
|
|
7
|
-
/**
|
|
8
|
-
* 当前工具执行可见的 working history
|
|
9
|
-
*
|
|
10
|
-
* 中文备注:
|
|
11
|
-
* - 该视图允许工具读取“本轮 run 中已产生、但可能尚未持久化”的最新事实事件;
|
|
12
|
-
* - ToolNode / graph runtime 后续只应更新这一层背后的 source,而不是覆写顶层 getter。
|
|
13
|
-
*/
|
|
14
|
-
getWorkingHistoryEvents(): ReadonlyArray<RuntimeEvent>;
|
|
15
|
-
/**
|
|
16
|
-
* run 启动时的 persisted history 视图
|
|
17
|
-
*
|
|
18
|
-
* 中文备注:
|
|
19
|
-
* - 该视图对应 EventStore 回放得到的稳定历史;
|
|
20
|
-
* - 与 working history 显式区分,避免调用方误把“最新运行态”当成“已持久化事实”。
|
|
21
|
-
*/
|
|
22
|
-
getPersistedHistoryEvents(): ReadonlyArray<RuntimeEvent>;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 子 run trace 的“业务无关”发布载荷。
|
|
27
|
-
*
|
|
28
|
-
* 说明:
|
|
29
|
-
* - 该结构刻意只包含 subrun_trace 的 payload 字段(不包含 conversation_id/turn_id 等基础字段)
|
|
30
|
-
* - parent_tool_call_id/subrun_id 是发布器构造时绑定的,不需要每次 publish 重复提供
|
|
31
|
-
*/
|
|
32
|
-
interface SubRunTraceEnvelopeBase {
|
|
33
|
-
/** child RuntimeEvent 的稳定身份;parent trace 必须与 source fact 一一对应。 */
|
|
34
|
-
source_event_id: string;
|
|
35
|
-
/** 只允许非路由、非归并的附加展示信息。 */
|
|
36
|
-
meta?: SerializableJsonRecord;
|
|
37
|
-
}
|
|
38
|
-
type SubRunTraceEnvelope = SubRunTraceEnvelopeBase & ({
|
|
39
|
-
kind: 'thought_delta';
|
|
40
|
-
delta: string;
|
|
41
|
-
} | {
|
|
42
|
-
kind: 'thought_complete';
|
|
43
|
-
content: string;
|
|
44
|
-
} | {
|
|
45
|
-
kind: 'tool_call_decision';
|
|
46
|
-
tool_calls: readonly SubRunTraceToolCallDecision[];
|
|
47
|
-
} | {
|
|
48
|
-
kind: 'tool_process';
|
|
49
|
-
tool_name: string;
|
|
50
|
-
tool_call_id: ToolCallId;
|
|
51
|
-
phase: NonNullable<SubRunTraceEvent['phase']>;
|
|
52
|
-
status: NonNullable<SubRunTraceEvent['status']>;
|
|
53
|
-
args: SerializableJsonRecord;
|
|
54
|
-
} | {
|
|
55
|
-
kind: 'tool_output';
|
|
56
|
-
tool_name: string;
|
|
57
|
-
tool_call_id: ToolCallId;
|
|
58
|
-
status: 'success';
|
|
59
|
-
output: NonNullable<SubRunTraceEvent['output']>;
|
|
60
|
-
attachments?: readonly RuntimeResourceRef[];
|
|
61
|
-
duration_ms?: number;
|
|
62
|
-
} | {
|
|
63
|
-
kind: 'tool_output';
|
|
64
|
-
tool_name: string;
|
|
65
|
-
tool_call_id: ToolCallId;
|
|
66
|
-
status: 'error';
|
|
67
|
-
output: NonNullable<SubRunTraceEvent['output']>;
|
|
68
|
-
duration_ms?: number;
|
|
69
|
-
} | {
|
|
70
|
-
kind: 'final_answer_chunk';
|
|
71
|
-
answer_id: string;
|
|
72
|
-
seq: number;
|
|
73
|
-
delta: string;
|
|
74
|
-
is_last?: boolean;
|
|
75
|
-
} | {
|
|
76
|
-
kind: 'final_answer';
|
|
77
|
-
answer_id: string;
|
|
78
|
-
content: string;
|
|
79
|
-
completion_reason: FinalAnswerCompletionReason;
|
|
80
|
-
} | {
|
|
81
|
-
kind: 'history_summary';
|
|
82
|
-
original_message_count: number;
|
|
83
|
-
replaced_message_ids: readonly string[];
|
|
84
|
-
compression_ratio?: number;
|
|
85
|
-
included_old_summary?: boolean;
|
|
86
|
-
});
|
|
87
|
-
/**
|
|
88
|
-
* 子 run trace 发布器接口(面向业务工具层)。
|
|
89
|
-
*
|
|
90
|
-
* 约束:
|
|
91
|
-
* - 发布器必须确保生成的 RuntimeEvent 为 `type='subrun_trace'` 且 `ephemeral=true`
|
|
92
|
-
* - 发布器应保证每条事件的 id 唯一(用于前端 processedEvents 幂等去重)
|
|
93
|
-
*/
|
|
94
|
-
interface SubRunTracePublisher {
|
|
95
|
-
publish(envelope: SubRunTraceEnvelope): void;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* child-run 父上下文的 runtime-owned 最小合同
|
|
100
|
-
*
|
|
101
|
-
* 中文备注:
|
|
102
|
-
* - 这里只声明 child-run 协议真正需要的 runtime capability;
|
|
103
|
-
* - 不显式依赖完整 ToolContext,避免 child-run 主链编译期吃进整套 host/product 服务类型;
|
|
104
|
-
* - 产品语义字段(如 deep_search / research)不得在这里显式声明。
|
|
105
|
-
*/
|
|
106
|
-
type ChildRunParentContext = ToolExecutionContext & object;
|
|
107
|
-
interface ChildRunHistoryPolicy {
|
|
108
|
-
inheritTurns: number;
|
|
109
|
-
/**
|
|
110
|
-
* 是否把被选中父事件的附件显式传给 child run。
|
|
111
|
-
*
|
|
112
|
-
* 默认关闭:继承对话文本不等于授权 child 读取父附件;只有调用方明确开启时,
|
|
113
|
-
* child final context 才会独立派生图片能力要求并走自己的物化链。
|
|
114
|
-
*/
|
|
115
|
-
includeAttachments?: boolean;
|
|
116
|
-
eventFilter?: (event: RuntimeEvent) => boolean;
|
|
117
|
-
}
|
|
118
|
-
interface ChildRunTracePolicy {
|
|
119
|
-
parentToolCallId?: ToolCallId;
|
|
120
|
-
subrunId?: string;
|
|
121
|
-
source?: string;
|
|
122
|
-
metadata?: Record<string, unknown>;
|
|
123
|
-
}
|
|
124
|
-
interface ChildRunExecutionPolicy {
|
|
125
|
-
/**
|
|
126
|
-
* 显式 child-run runId。默认由 host adapter 取 subrunId。
|
|
127
|
-
*/
|
|
128
|
-
runId?: RunId;
|
|
129
|
-
/**
|
|
130
|
-
* child-run 的宿主会话归属。
|
|
131
|
-
*
|
|
132
|
-
* 中文备注:
|
|
133
|
-
* - 同步 child-run 通常复用父 conversationId,方便 EventStore / Audit / Telemetry
|
|
134
|
-
* 在同一条会话链路下写入 child run;
|
|
135
|
-
* - 框架内部仍可使用独立 checkpoint key 隔离 GraphExecutor 状态。
|
|
136
|
-
*/
|
|
137
|
-
conversationId?: string;
|
|
138
|
-
/**
|
|
139
|
-
* 父 runId。默认从 parentToolContext.runId 继承。
|
|
140
|
-
*/
|
|
141
|
-
parentRunId?: RunId;
|
|
142
|
-
maxSteps?: number;
|
|
143
|
-
modelId?: string;
|
|
144
|
-
abortSignal?: AbortSignal;
|
|
145
|
-
}
|
|
146
|
-
interface ChildRunRequest<TParentToolContext = ChildRunParentContext> {
|
|
147
|
-
userMessage: string;
|
|
148
|
-
parentToolContext: TParentToolContext;
|
|
149
|
-
historyPolicy?: ChildRunHistoryPolicy;
|
|
150
|
-
tracePolicy?: ChildRunTracePolicy;
|
|
151
|
-
executionPolicy?: ChildRunExecutionPolicy;
|
|
152
|
-
}
|
|
153
|
-
interface ChildRunResult {
|
|
154
|
-
runId?: RunId;
|
|
155
|
-
parentRunId?: RunId;
|
|
156
|
-
subrunId: string;
|
|
157
|
-
success: boolean;
|
|
158
|
-
cancelled?: boolean;
|
|
159
|
-
finalAnswer?: string;
|
|
160
|
-
/** 最近一段非终态可见进度,不能作为 child 的业务交付结果。 */
|
|
161
|
-
lastProgress?: string;
|
|
162
|
-
events: RuntimeEvent[];
|
|
163
|
-
transcriptMessages?: unknown[];
|
|
164
|
-
toolset?: {
|
|
165
|
-
availableTools?: string[];
|
|
166
|
-
};
|
|
167
|
-
stepCount: number;
|
|
168
|
-
error?: string;
|
|
169
|
-
judgeToolOutput?: string;
|
|
170
|
-
}
|
|
171
|
-
interface ChildRunInvokerPort<TRequest extends ChildRunRequest = ChildRunRequest, TResult extends ChildRunResult = ChildRunResult> {
|
|
172
|
-
invoke(params: TRequest): Promise<TResult>;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
declare const MODEL_INPUT_PLACEMENTS: readonly ["user_image", "tool_result_image"];
|
|
176
|
-
type ModelInputPlacement = LlmImageInputPlacement;
|
|
177
|
-
interface AdapterInputSupport {
|
|
178
|
-
readonly user_image: boolean;
|
|
179
|
-
readonly tool_result_image: boolean;
|
|
180
|
-
}
|
|
181
|
-
interface ModelInputRequirement {
|
|
182
|
-
readonly requires_image_input: boolean;
|
|
183
|
-
readonly placements: readonly ModelInputPlacement[];
|
|
184
|
-
}
|
|
185
|
-
type ModelInputIncompatibilityReason = 'model_missing' | 'model_disabled' | 'chat_unsupported' | 'image_input_unsupported' | 'placement_unsupported';
|
|
186
|
-
type ModelInputCompatibility = {
|
|
187
|
-
readonly compatible: true;
|
|
188
|
-
} | {
|
|
189
|
-
readonly compatible: false;
|
|
190
|
-
readonly reason: ModelInputIncompatibilityReason;
|
|
191
|
-
readonly missing_placements: readonly ModelInputPlacement[];
|
|
192
|
-
};
|
|
193
|
-
declare const EMPTY_MODEL_INPUT_REQUIREMENT: ModelInputRequirement;
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* 工具结果模型输入的交付语义。
|
|
197
|
-
*
|
|
198
|
-
* `required` 表示附件是工具业务结果的一部分,当前模型不兼容时必须拒绝工具;
|
|
199
|
-
* `when_supported` 表示附件只是成功结果的增强反馈,不兼容时工具仍可返回文本结果。
|
|
200
|
-
*/
|
|
201
|
-
type ToolModelInputDelivery = 'required' | 'when_supported';
|
|
202
|
-
/** ToolNode 在真实 active model 上完成的本次调用准入事实。 */
|
|
203
|
-
interface ToolModelInputAdmission {
|
|
204
|
-
readonly requirement: ModelInputRequirement;
|
|
205
|
-
readonly delivery: ToolModelInputDelivery;
|
|
206
|
-
readonly admitted: boolean;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* runtime-owned 工具执行上下文最小合同
|
|
211
|
-
*
|
|
212
|
-
* 中文备注:
|
|
213
|
-
* - 这里只保留 graph-engine / tool runtime / child-run 真正需要解释执行的字段;
|
|
214
|
-
* - 不包含任何 host 存储、检索或数据库服务类型;
|
|
215
|
-
* - 不包含具体产品 workflow 的语义字段。
|
|
216
|
-
*/
|
|
217
|
-
interface ToolExecutionContext {
|
|
218
|
-
/**
|
|
219
|
-
* 当前工具调用的模型输入准入事实,由 ToolNode 按真实 active model 写入。
|
|
220
|
-
*
|
|
221
|
-
* 工具只能用它决定是否生产声明为 `when_supported` 的增强附件;不得据此猜模型、Provider 或 route。
|
|
222
|
-
*/
|
|
223
|
-
modelInputAdmission?: ToolModelInputAdmission;
|
|
224
|
-
/** 当前用户请求的原始文本;由 run admission 注入,工具只读。 */
|
|
225
|
-
userQuery?: string;
|
|
226
|
-
/** 当前 run 已选定的模型 ID;需要继承模型的 child-run 从这里读取。 */
|
|
227
|
-
modelId?: string;
|
|
228
|
-
/**
|
|
229
|
-
* 当前对话 run 的唯一标识(由 host admission 注入)。
|
|
230
|
-
* 说明:工具不得把 runId 当作业务数据身份;它只服务运行链路追踪和关联。
|
|
231
|
-
*/
|
|
232
|
-
runId?: RunId;
|
|
233
|
-
/**
|
|
234
|
-
* 父级 run 标识。
|
|
235
|
-
*
|
|
236
|
-
* 中文备注:
|
|
237
|
-
* - 顶层 run 通常为空;
|
|
238
|
-
* - 同步 child-run 会把自己的 `runId` 设为子 run / subrun ID,同时把父 run 写到这里;
|
|
239
|
-
* - Telemetry / Audit / Cost 聚合依赖这个字段建立父子关系,但 graph-engine 不解释产品语义。
|
|
240
|
-
*/
|
|
241
|
-
parentRunId?: RunId;
|
|
242
|
-
/**
|
|
243
|
-
* 当前工具执行所处的 child-run 嵌套深度。
|
|
244
|
-
*
|
|
245
|
-
* 中文说明:
|
|
246
|
-
* - 顶层 run 缺省为 0;
|
|
247
|
-
* - runtime-kernel 在创建 child-run ToolContext 时递增;
|
|
248
|
-
* - 这是通用执行期信号,不表达具体产品 workflow。
|
|
249
|
-
*/
|
|
250
|
-
childRunDepth?: number;
|
|
251
|
-
/**
|
|
252
|
-
* root admission 冻结的 child-run 环境上下文。
|
|
253
|
-
*
|
|
254
|
-
* 中文备注:runtime 只透传通用注入,不解释项目、文档或插件视图等 Host 语义。
|
|
255
|
-
* 它与父会话历史继承相互独立。
|
|
256
|
-
*/
|
|
257
|
-
childRunContextInjections?: ReadonlyArray<AgentContextInjection>;
|
|
258
|
-
/**
|
|
259
|
-
* 🔥 取消信号(贯穿一次对话请求)
|
|
260
|
-
*
|
|
261
|
-
* 约定:
|
|
262
|
-
* - 工具实现必须在合适的边界检查 `abortSignal.aborted` 并尽快退出;
|
|
263
|
-
* - 该字段属于“执行期上下文”,不应被写入持久化事件。
|
|
264
|
-
*/
|
|
265
|
-
abortSignal?: AbortSignal;
|
|
266
|
-
/**
|
|
267
|
-
* 🔥 当前这次工具调用的 tool_call_id(由 ToolNode 在执行前注入)
|
|
268
|
-
*
|
|
269
|
-
* 说明:
|
|
270
|
-
* - tool_call_id 属于“事件层/执行层”的稳定关联键;
|
|
271
|
-
* - 工具内部如果需要发布 subrun_trace(子 run 过程),必须使用该字段作为 parent_tool_call_id。
|
|
272
|
-
* - 该字段仅在工具执行期间有效,不应被工具写入持久化历史。
|
|
273
|
-
*/
|
|
274
|
-
parentToolCallId?: ToolCallId;
|
|
275
|
-
/**
|
|
276
|
-
* 🔥 当前对话 ID(由 GraphExecutor/ToolNode 注入,用于工具内部做链路追踪)
|
|
277
|
-
*/
|
|
278
|
-
conversationId?: string;
|
|
279
|
-
/**
|
|
280
|
-
* 🔥 当前轮次 ID(由 GraphExecutor/ToolNode 注入,用于工具内部做链路追踪)
|
|
281
|
-
*/
|
|
282
|
-
turnId?: string;
|
|
283
|
-
/**
|
|
284
|
-
* 🔥 显式会话视图 capability
|
|
285
|
-
*
|
|
286
|
-
* 中文备注:working 与 persisted history 含义不同,工具必须显式选择,禁止使用含糊的 history getter。
|
|
287
|
-
*/
|
|
288
|
-
conversationView?: ToolContextConversationView;
|
|
289
|
-
/**
|
|
290
|
-
* 🔥 SubRun Trace Channel:为工具提供 publisher 工厂(低耦合)
|
|
291
|
-
*/
|
|
292
|
-
createSubRunTracePublisher?: (opts: {
|
|
293
|
-
parentToolCallId: ToolCallId;
|
|
294
|
-
subrunId: string;
|
|
295
|
-
subrunParentId?: string;
|
|
296
|
-
source?: string;
|
|
297
|
-
metadata?: Record<string, unknown>;
|
|
298
|
-
}) => SubRunTracePublisher;
|
|
299
|
-
/**
|
|
300
|
-
* 显式 child-run invoker 注入。
|
|
301
|
-
*/
|
|
302
|
-
registeredChildRunInvoker?: ChildRunInvokerPort;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
type ToolIdempotencyScope = 'conversation' | 'turn';
|
|
306
|
-
type ToolIdempotencyPolicy = {
|
|
307
|
-
scope: ToolIdempotencyScope;
|
|
308
|
-
};
|
|
309
|
-
declare function computeToolIdempotencyKey(params: {
|
|
310
|
-
policy: ToolIdempotencyPolicy;
|
|
311
|
-
toolName: string;
|
|
312
|
-
args: Record<string, unknown>;
|
|
313
|
-
context: ToolExecutionContext;
|
|
314
|
-
}): string;
|
|
315
|
-
declare function findCachedToolOutputByIdempotencyKey(params: {
|
|
316
|
-
history: ReadonlyArray<RuntimeEvent>;
|
|
317
|
-
toolName: string;
|
|
318
|
-
idempotencyKey: string;
|
|
319
|
-
}): {
|
|
320
|
-
result: string;
|
|
321
|
-
attachments?: readonly RuntimeResourceRef[];
|
|
322
|
-
} | undefined;
|
|
323
|
-
|
|
324
|
-
type ToolArgs = Record<string, unknown>;
|
|
325
|
-
/**
|
|
326
|
-
* 工具对 LLM 流式 tool_call 生命周期的显式声明。
|
|
327
|
-
*
|
|
328
|
-
* 这里仅表达 runtime 何时发布通用事件,不包含组件、卡片或产品工具名等展示语义。
|
|
329
|
-
* 未声明时,工具只在正式 tool_call decision 与执行阶段进入事件流。
|
|
330
|
-
*/
|
|
331
|
-
interface ToolCallStreamingPolicy {
|
|
332
|
-
readonly emitPlaceholder?: true;
|
|
333
|
-
readonly emitArgumentSnapshots?: true;
|
|
334
|
-
}
|
|
335
|
-
interface ToolResult {
|
|
336
|
-
success: boolean;
|
|
337
|
-
data: string;
|
|
338
|
-
metadata?: Record<string, unknown>;
|
|
339
|
-
}
|
|
340
|
-
type UnifiedToolResult = {
|
|
341
|
-
kind: 'ok';
|
|
342
|
-
output: unknown;
|
|
343
|
-
} | {
|
|
344
|
-
kind: 'need_user';
|
|
345
|
-
spec: unknown;
|
|
346
|
-
} | {
|
|
347
|
-
kind: 'async';
|
|
348
|
-
run_id: string;
|
|
349
|
-
};
|
|
350
|
-
declare abstract class BaseTool<TArgs extends ToolArgs = ToolArgs, TResult extends string = string> {
|
|
351
|
-
abstract readonly name: string;
|
|
352
|
-
abstract readonly description: string;
|
|
353
|
-
abstract readonly parameters: ToolParameterSchema;
|
|
354
|
-
readonly idempotency?: ToolIdempotencyPolicy;
|
|
355
|
-
readonly modelInputRequirement?: ModelInputRequirement;
|
|
356
|
-
/** 模型输入是工具成功的必要结果,还是仅在当前模型支持时提供的增强反馈。 */
|
|
357
|
-
readonly modelInputDelivery?: ToolModelInputDelivery;
|
|
358
|
-
readonly resolveModelInputRequirement?: (args: ToolArgs) => ModelInputRequirement | undefined;
|
|
359
|
-
readonly streaming?: ToolCallStreamingPolicy;
|
|
360
|
-
getExecutionSummary?(output: string): string;
|
|
361
|
-
abstract run(args: TArgs, context: ToolExecutionContext): Promise<TResult>;
|
|
362
|
-
protected validateArguments(args: TArgs): {
|
|
363
|
-
success: boolean;
|
|
364
|
-
error?: string;
|
|
365
|
-
};
|
|
366
|
-
getMetadata(): {
|
|
367
|
-
name: string;
|
|
368
|
-
description: string;
|
|
369
|
-
parameters: ToolParameterSchema;
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
interface ToolRegistryEntry {
|
|
373
|
-
name: string;
|
|
374
|
-
toolClass: new () => BaseTool<ToolArgs, string>;
|
|
375
|
-
metadata: ReturnType<BaseTool['getMetadata']>;
|
|
376
|
-
}
|
|
377
|
-
declare const CommonParameterTypes: {
|
|
378
|
-
readonly docId: {
|
|
379
|
-
readonly type: "string";
|
|
380
|
-
readonly description: "The unique ID of the document";
|
|
381
|
-
};
|
|
382
|
-
readonly query: {
|
|
383
|
-
readonly type: "string";
|
|
384
|
-
readonly description: "The search query text";
|
|
385
|
-
};
|
|
386
|
-
readonly topK: {
|
|
387
|
-
readonly type: "integer";
|
|
388
|
-
readonly description: "The maximum number of results to return";
|
|
389
|
-
readonly default: 5;
|
|
390
|
-
};
|
|
391
|
-
readonly blockId: {
|
|
392
|
-
readonly type: "string";
|
|
393
|
-
readonly description: "The unique ID of a content block";
|
|
394
|
-
};
|
|
395
|
-
readonly pageNumber: {
|
|
396
|
-
readonly type: "integer";
|
|
397
|
-
readonly description: "Page number (1-indexed)";
|
|
398
|
-
readonly default: 1;
|
|
399
|
-
};
|
|
400
|
-
};
|
|
401
|
-
interface AgentTool<TArgs extends ToolArgs = ToolArgs, TResult = unknown> {
|
|
402
|
-
name: string;
|
|
403
|
-
description: string;
|
|
404
|
-
parameters: ToolParameterSchema;
|
|
405
|
-
execute(args: TArgs): Promise<TResult>;
|
|
406
|
-
}
|
|
407
|
-
interface FunctionToolSchema {
|
|
408
|
-
type: 'function';
|
|
409
|
-
function: {
|
|
410
|
-
name: string;
|
|
411
|
-
description: string;
|
|
412
|
-
parameters: ToolParameterSchema;
|
|
413
|
-
};
|
|
414
|
-
}
|
|
415
|
-
interface ToolCallResult<TResult = unknown> {
|
|
416
|
-
toolName: string;
|
|
417
|
-
args: ToolArgs;
|
|
418
|
-
result: TResult;
|
|
419
|
-
success: boolean;
|
|
420
|
-
error?: string;
|
|
421
|
-
durationMs: number;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
export { type AgentTool as A, BaseTool as B, CommonParameterTypes as C, EMPTY_MODEL_INPUT_REQUIREMENT as E, type FunctionToolSchema as F, type ModelInputPlacement as M, type SubRunTracePublisher as S, type ToolArgs as T, type UnifiedToolResult as U, type ToolExecutionContext as a, type ModelInputRequirement as b, type ModelInputCompatibility as c, type ToolCallResult as d, type ToolCallStreamingPolicy as e, type ToolContextConversationView as f, type ToolModelInputAdmission as g, type ToolModelInputDelivery as h, type ToolRegistryEntry as i, type ToolResult as j, computeToolIdempotencyKey as k, findCachedToolOutputByIdempotencyKey as l, type AdapterInputSupport as m, MODEL_INPUT_PLACEMENTS as n, type ModelInputIncompatibilityReason as o, type ChildRunParentContext as p, type ChildRunHistoryPolicy as q, type ChildRunInvokerPort as r, type ChildRunRequest as s, type ChildRunResult as t, type SubRunTraceEnvelope as u, type ToolIdempotencyPolicy as v };
|