@linnlabs/linnkit 0.32.0 → 0.32.1
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 +14 -0
- 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} +33 -33
- package/dist/{audit-XsNMTt0-.d.ts → contracts/audit.d.ts} +33 -33
- 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-oOQ_7nPt.d.ts → contracts/events.d.cts} +1219 -1222
- package/dist/{final-answer-B0_kx5_U.d.cts → contracts/events.d.ts} +1219 -1222
- package/dist/{execution-B7e01ZjW.d.cts → contracts/execution.d.cts} +21 -21
- package/dist/{execution-B7e01ZjW.d.ts → contracts/execution.d.ts} +21 -21
- 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} +210 -957
- package/dist/{provider-continuation-CTZdCB--.d.ts → contracts/messages.d.ts} +210 -957
- 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} +1218 -1574
- package/dist/{index-JYf6n2Ik.d.cts → contracts/sse.d.ts} +1218 -1574
- 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.d.cts +14 -77
- package/dist/index.d.ts +14 -77
- 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.d.cts +5 -23
- package/dist/quickstart.d.ts +5 -23
- 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} +127 -126
- package/dist/{agentEvents-DhXdKeXD.d.ts → runtime-kernel/events/agentEvents.d.ts} +127 -126
- 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.d.cts +106 -20
- package/dist/runtime-kernel.d.ts +106 -20
- 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.d.cts +17 -277
- package/dist/testkit.d.ts +17 -277
- 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,490 +0,0 @@
|
|
|
1
|
-
import { R as RuntimeResourceRef, c as RunId, T as ToolCallId } from './provider-continuation-CTZdCB--.js';
|
|
2
|
-
import { a as ToolExecutionContext, F as FunctionToolSchema, T as ToolArgs, v as ToolIdempotencyPolicy, b as ModelInputRequirement, h as ToolModelInputDelivery, e as ToolCallStreamingPolicy, c as ModelInputCompatibility } from './toolContracts-BQ4kIso_.js';
|
|
3
|
-
import { b as AgentInvocationRequest, B as ToolParameterSchema } from './llm-input-materialization-Vce5Swvc.js';
|
|
4
|
-
import { R as RunTokenUsageAggregate, c as AgentSpec } from './token-accounting-CVW37Uri.js';
|
|
5
|
-
import { f as RoutedRuntimeEvent, R as RuntimeEvent } from './final-answer-oOQ_7nPt.js';
|
|
6
|
-
import { A as AuditPort } from './audit-DnuOSwWE.js';
|
|
7
|
-
import { E as EventEnvelope } from './execution-B7e01ZjW.js';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* 工具对模型输入附件的声明。
|
|
11
|
-
*
|
|
12
|
-
* 中文说明:
|
|
13
|
-
* - 这里只表达工具选择了哪个资源,不代表资源已经可信或可读;
|
|
14
|
-
* - `uri` 的协议、作用域与完整性由 host resolver 校验;
|
|
15
|
-
* - path、bytes、base64 和 durable ref 都不属于工具声明面。
|
|
16
|
-
*/
|
|
17
|
-
interface ToolModelInputAttachmentSelection {
|
|
18
|
-
readonly id: string;
|
|
19
|
-
readonly uri: string;
|
|
20
|
-
readonly label?: string;
|
|
21
|
-
}
|
|
22
|
-
interface ToolModelInputDeclaration {
|
|
23
|
-
readonly attachments: readonly ToolModelInputAttachmentSelection[];
|
|
24
|
-
}
|
|
25
|
-
interface ResolveToolModelInputParams {
|
|
26
|
-
readonly toolName: string;
|
|
27
|
-
readonly toolCallId: string;
|
|
28
|
-
readonly selections: readonly ToolModelInputAttachmentSelection[];
|
|
29
|
-
readonly context: ToolExecutionContext;
|
|
30
|
-
}
|
|
31
|
-
interface CompleteToolModelInputParams {
|
|
32
|
-
readonly toolName: string;
|
|
33
|
-
readonly toolCallId: string;
|
|
34
|
-
readonly context: ToolExecutionContext;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* host 把不可信 selection 解析为 durable resource ref 的唯一端口。
|
|
38
|
-
* framework 不知道 host 存储、资源路径或授权规则。
|
|
39
|
-
*/
|
|
40
|
-
interface ToolModelInputResolverPort {
|
|
41
|
-
resolveToolModelInput(params: ResolveToolModelInputParams): Promise<readonly RuntimeResourceRef[]>;
|
|
42
|
-
/**
|
|
43
|
-
* 一次工具调用完成后释放尚未消费的临时模型输入授权。
|
|
44
|
-
*
|
|
45
|
-
* framework 只表达调用生命周期,不知道 host 使用的是 claim、lease 或其他机制。
|
|
46
|
-
*/
|
|
47
|
-
completeToolModelInput(params: CompleteToolModelInputParams): Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
declare class ToolModelInputResolutionError extends Error {
|
|
50
|
-
readonly name = "ToolModelInputResolutionError";
|
|
51
|
-
readonly errorCode = "tool.model_input.resolution_failed";
|
|
52
|
-
constructor(message: string);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** 工具结果中由 runtime 解释或转交给 Host 的显式合同。 */
|
|
56
|
-
interface ToolObservationPreviewMeta {
|
|
57
|
-
filename?: string;
|
|
58
|
-
doc_name?: string;
|
|
59
|
-
document_name?: string;
|
|
60
|
-
/** 宿主或插件拥有的文档类型;runtime-kernel 只透传,不维护产品类型枚举。 */
|
|
61
|
-
doc_type?: string;
|
|
62
|
-
}
|
|
63
|
-
interface ToolResultImageMedia {
|
|
64
|
-
path: string;
|
|
65
|
-
width: number;
|
|
66
|
-
height: number;
|
|
67
|
-
}
|
|
68
|
-
interface ToolControlInfo {
|
|
69
|
-
requireUser?: boolean;
|
|
70
|
-
questionnaireId?: string;
|
|
71
|
-
resumeStrategy?: 'continue';
|
|
72
|
-
terminateRun?: boolean;
|
|
73
|
-
/**
|
|
74
|
-
* 将工具产物投影为本轮最终答案。
|
|
75
|
-
*
|
|
76
|
-
* 中文说明:
|
|
77
|
-
* - 这是通用工具输出契约,不绑定具体工具名;
|
|
78
|
-
* - 适用于“工具是最终产物出口”的场景,例如报告写入、子任务汇总等;
|
|
79
|
-
* - ToolNode 只解释该控制字段,不内置宿主业务工具名。
|
|
80
|
-
*/
|
|
81
|
-
finalAnswer?: string;
|
|
82
|
-
reason?: string;
|
|
83
|
-
}
|
|
84
|
-
interface StructuredToolResult<T = Record<string, unknown>> {
|
|
85
|
-
data: T;
|
|
86
|
-
/**
|
|
87
|
-
* 唯一进入 AI 上下文的业务结果视图。
|
|
88
|
-
*
|
|
89
|
-
* 中文说明:
|
|
90
|
-
* - Agent 工具必须返回包含非空白字符的纯文本 observation;正文自然首尾空白可以保留;
|
|
91
|
-
* - data 只服务 UI、审计和程序化消费,工具不得假设模型能读取 data;
|
|
92
|
-
* - ToolNode 会在运行时校验该合同,缺失或空 observation 会被判为工具实现错误。
|
|
93
|
-
*/
|
|
94
|
-
observation: string;
|
|
95
|
-
/**
|
|
96
|
-
* 工具结果的展示元数据。
|
|
97
|
-
*
|
|
98
|
-
* 中文说明:
|
|
99
|
-
* - `data` 仍是唯一业务数据,产物创建、摘要和后续工具链不得依赖 media;
|
|
100
|
-
* - media 只服务 UI 占位、预估高度、预览等展示场景;
|
|
101
|
-
* - 图片宽高必须成对出现,缺失时工具不要写入对应 entry。
|
|
102
|
-
*/
|
|
103
|
-
media?: ToolResultImageMedia[];
|
|
104
|
-
/**
|
|
105
|
-
* 工具希望交给下一轮模型的资源选择。
|
|
106
|
-
*
|
|
107
|
-
* 中文说明:
|
|
108
|
-
* - 这是未验证的声明,不是 durable resource ref;
|
|
109
|
-
* - ToolNode 必须经 host resolver 授权和完整性校验后才能写入 runtime event;
|
|
110
|
-
* - 与只服务 UI 的 media 完全独立。
|
|
111
|
-
*/
|
|
112
|
-
modelInput?: ToolModelInputDeclaration;
|
|
113
|
-
/**
|
|
114
|
-
* observation 被落盘/预览时传给 host 的轻量展示元数据。
|
|
115
|
-
*
|
|
116
|
-
* 中文说明:
|
|
117
|
-
* - 由工具自己声明,runtime-kernel 不按具体工具名猜测业务字段;
|
|
118
|
-
* - host 可用它给大段输出预览命名或选择展示样式。
|
|
119
|
-
*/
|
|
120
|
-
observationPreviewMeta?: ToolObservationPreviewMeta;
|
|
121
|
-
control?: ToolControlInfo;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
interface ToolRuntimeDefinition {
|
|
125
|
-
parameters: ToolParameterSchema;
|
|
126
|
-
/**
|
|
127
|
-
* 工具 owner 的深层参数 admission。
|
|
128
|
-
*
|
|
129
|
-
* ToolNode 在发布 tool_process(start) 之前调用它;失败会直接结算为
|
|
130
|
-
* tool_output(error),避免把尚未真正启动的调用展示成 running。
|
|
131
|
-
*/
|
|
132
|
-
validateArguments?: (args: ToolArgs) => {
|
|
133
|
-
success: boolean;
|
|
134
|
-
error?: string;
|
|
135
|
-
};
|
|
136
|
-
idempotency?: ToolIdempotencyPolicy;
|
|
137
|
-
/** 静态声明该工具成功结果可能要求的模型输入能力。 */
|
|
138
|
-
modelInputRequirement?: ModelInputRequirement;
|
|
139
|
-
/** 未声明时保持既有 required 语义。 */
|
|
140
|
-
modelInputDelivery?: ToolModelInputDelivery;
|
|
141
|
-
/**
|
|
142
|
-
* 按本次规范化参数解析执行前的模型输入要求。
|
|
143
|
-
*
|
|
144
|
-
* 中文说明:
|
|
145
|
-
* - 只用于同一工具既可能返回纯文本、也可能返回模型附件的真实场景;
|
|
146
|
-
* - 动态 resolver 存在时取代静态声明,返回 undefined 表示本次调用无额外要求;
|
|
147
|
-
* - prepare 阶段仍只消费静态声明,不能在模型产生工具参数前猜测动态结果。
|
|
148
|
-
* - resolver 抛错时 ToolNode 会拒绝本次调用、生成配对 error output,并继续同批其他调用;
|
|
149
|
-
* 宿主异常原文不会进入模型上下文或审计 reason。
|
|
150
|
-
*/
|
|
151
|
-
resolveModelInputRequirement?: (args: ToolArgs) => ModelInputRequirement | undefined;
|
|
152
|
-
/** LLM 流式 tool_call 的通用事件发布策略;未声明即不发布早期生命周期事件。 */
|
|
153
|
-
streaming?: ToolCallStreamingPolicy;
|
|
154
|
-
}
|
|
155
|
-
interface ToolExecutionResult {
|
|
156
|
-
success: boolean;
|
|
157
|
-
result?: string;
|
|
158
|
-
error?: string;
|
|
159
|
-
/** 工具 owner 声明的稳定业务错误码;不得从自然语言错误文本反推。 */
|
|
160
|
-
errorCode?: string;
|
|
161
|
-
errorKind?: 'protocol' | 'execution' | 'capability';
|
|
162
|
-
durationMs: number;
|
|
163
|
-
idempotency?: {
|
|
164
|
-
key: string;
|
|
165
|
-
cacheHit: boolean;
|
|
166
|
-
};
|
|
167
|
-
/** 幂等历史命中时复用已经完成授权与完整性校验的正式资源引用。 */
|
|
168
|
-
cachedAttachments?: readonly RuntimeResourceRef[];
|
|
169
|
-
}
|
|
170
|
-
interface ToolModelInputCapabilityValidatorPort {
|
|
171
|
-
evaluate(input: {
|
|
172
|
-
readonly activeModelId: string;
|
|
173
|
-
readonly requirement: ModelInputRequirement;
|
|
174
|
-
}): ModelInputCompatibility;
|
|
175
|
-
assertCompatible(input: {
|
|
176
|
-
readonly activeModelId: string;
|
|
177
|
-
readonly requirement: ModelInputRequirement;
|
|
178
|
-
}): void;
|
|
179
|
-
}
|
|
180
|
-
type ObservationPreviewMeta = ToolObservationPreviewMeta;
|
|
181
|
-
type ObservationPreviewContext = ToolExecutionContext;
|
|
182
|
-
/**
|
|
183
|
-
* Host 按本次 Agent 调用构建工具 Schema 的最小输入。
|
|
184
|
-
*
|
|
185
|
-
* Linnkit 只规定调用时机并转交通用 invocation;Host 如何验证扩展字段并
|
|
186
|
-
* 派生 concrete tools 的窄动态 Schema 上下文,属于 Host 工具注册表职责。
|
|
187
|
-
*/
|
|
188
|
-
interface ToolSchemaBuildRequest {
|
|
189
|
-
readonly toolNames?: readonly string[];
|
|
190
|
-
readonly invocation: AgentInvocationRequest;
|
|
191
|
-
}
|
|
192
|
-
type ObservationPreviewResult = {
|
|
193
|
-
truncated: false;
|
|
194
|
-
preview: string;
|
|
195
|
-
} | {
|
|
196
|
-
truncated: true;
|
|
197
|
-
preview: string;
|
|
198
|
-
blob_id: string;
|
|
199
|
-
originalChars?: number;
|
|
200
|
-
previewChars?: number;
|
|
201
|
-
originalLines?: number;
|
|
202
|
-
previewLines?: number;
|
|
203
|
-
};
|
|
204
|
-
interface ToolCatalogPort {
|
|
205
|
-
getToolSchemas(input: ToolSchemaBuildRequest): FunctionToolSchema[];
|
|
206
|
-
getToolDefinition(toolName: string): ToolRuntimeDefinition | undefined;
|
|
207
|
-
}
|
|
208
|
-
interface ToolExecutionPort {
|
|
209
|
-
executeTool(toolName: string, args: ToolArgs, context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
210
|
-
}
|
|
211
|
-
interface ObservationPreviewPort {
|
|
212
|
-
/**
|
|
213
|
-
* 执行期 observation 预览/落盘治理。
|
|
214
|
-
*
|
|
215
|
-
* 中文说明:
|
|
216
|
-
* - framework 只把 `maxChars/maxLines` 和工具上下文传给 host;
|
|
217
|
-
* - 完整内容写到本地目录、对象存储还是数据库,由 host 的这个 port 决定;
|
|
218
|
-
* - 如果返回 `blob_id`,host 需要保证对应读取工具使用同一个 store。
|
|
219
|
-
*/
|
|
220
|
-
truncateObservation(params: {
|
|
221
|
-
context: ObservationPreviewContext;
|
|
222
|
-
toolName: string;
|
|
223
|
-
text: string;
|
|
224
|
-
maxChars: number;
|
|
225
|
-
maxLines: number;
|
|
226
|
-
meta?: ObservationPreviewMeta;
|
|
227
|
-
}): Promise<ObservationPreviewResult>;
|
|
228
|
-
}
|
|
229
|
-
interface ToolRuntimePort extends ToolCatalogPort, ToolExecutionPort {
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
type PersistedEvent = {
|
|
233
|
-
/** EventStore 内用于稳定分页的单调游标,不等同于 RuntimeEvent.id。 */
|
|
234
|
-
eventStoreId: string;
|
|
235
|
-
event: RoutedRuntimeEvent;
|
|
236
|
-
};
|
|
237
|
-
type EventRangeOptions = {
|
|
238
|
-
fromEventStoreId?: string;
|
|
239
|
-
toEventStoreId?: string;
|
|
240
|
-
limit?: number;
|
|
241
|
-
};
|
|
242
|
-
interface EventStore {
|
|
243
|
-
append(event: PersistedEvent): Promise<void>;
|
|
244
|
-
range(conversationId: string, opts?: EventRangeOptions): Promise<PersistedEvent[]>;
|
|
245
|
-
latestEventStoreId(conversationId: string): Promise<string | null>;
|
|
246
|
-
truncate?(conversationId: string, opts: {
|
|
247
|
-
beforeEventStoreId?: string;
|
|
248
|
-
beforeMs?: number;
|
|
249
|
-
}): Promise<void>;
|
|
250
|
-
}
|
|
251
|
-
declare function requireEventStoreId(eventStoreId: string): string;
|
|
252
|
-
declare function createMonotonicEventStoreIdFactory(nowProvider?: () => number): () => string;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* @file src/agent/runtime-kernel/execution/event-bus.ts
|
|
256
|
-
* @description 内存中的事件总线
|
|
257
|
-
*
|
|
258
|
-
* 功能 (What):
|
|
259
|
-
* - 提供一个中央事件中心,用于发布和订阅 `EventEnvelope` 事件。
|
|
260
|
-
* - 解耦事件的产生方(如 Runners)和消费方(如持久化、SSE推送)。
|
|
261
|
-
* - 保证事件处理的逻辑集中化。
|
|
262
|
-
*
|
|
263
|
-
* 这是一个简单的内存实现,为每个执行流程(execution)创建一个实例。
|
|
264
|
-
*/
|
|
265
|
-
|
|
266
|
-
type EventBusEvents = {
|
|
267
|
-
'event': (envelope: EventEnvelope<RoutedRuntimeEvent>) => void;
|
|
268
|
-
'error': (error: Error) => void;
|
|
269
|
-
'close': () => void;
|
|
270
|
-
};
|
|
271
|
-
type EventListener = (...args: never[]) => void;
|
|
272
|
-
declare class TypedEventEmitter<TEvents extends Record<string, EventListener>> {
|
|
273
|
-
private readonly listeners;
|
|
274
|
-
private maxListeners;
|
|
275
|
-
on<TEvent extends keyof TEvents>(event: TEvent, listener: TEvents[TEvent]): this;
|
|
276
|
-
off<TEvent extends keyof TEvents>(event: TEvent, listener: TEvents[TEvent]): this;
|
|
277
|
-
once<TEvent extends keyof TEvents>(event: TEvent, listener: TEvents[TEvent]): this;
|
|
278
|
-
emit<TEvent extends keyof TEvents>(event: TEvent, ...args: Parameters<TEvents[TEvent]>): boolean;
|
|
279
|
-
removeAllListeners<TEvent extends keyof TEvents>(event?: TEvent): this;
|
|
280
|
-
setMaxListeners(n: number): this;
|
|
281
|
-
private getListeners;
|
|
282
|
-
}
|
|
283
|
-
/**
|
|
284
|
-
* 事件总线类
|
|
285
|
-
*
|
|
286
|
-
* 为每一次执行(execution)实例化一次,管理该执行生命周期内的所有事件。
|
|
287
|
-
*/
|
|
288
|
-
declare class EventBus extends TypedEventEmitter<EventBusEvents> {
|
|
289
|
-
readonly executionId: string;
|
|
290
|
-
constructor(executionId: string);
|
|
291
|
-
/**
|
|
292
|
-
* 发布一个事件到总线
|
|
293
|
-
* @param envelope - 经过序列器包装的事件信封
|
|
294
|
-
*/
|
|
295
|
-
publish(envelope: EventEnvelope<RuntimeEvent>): void;
|
|
296
|
-
/**
|
|
297
|
-
* 关闭总线,清理所有监听器
|
|
298
|
-
*/
|
|
299
|
-
close(): void;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
type RunStatus = 'pending' | 'running' | 'awaiting_user' | 'paused' | 'completed' | 'failed' | 'cancelled';
|
|
303
|
-
type ListRunsFilter = {
|
|
304
|
-
conversationId?: string;
|
|
305
|
-
status?: RunStatus | RunStatus[];
|
|
306
|
-
parentRunId?: RunId;
|
|
307
|
-
agentSpecId?: string;
|
|
308
|
-
startedAfter?: number;
|
|
309
|
-
startedBefore?: number;
|
|
310
|
-
limit?: number;
|
|
311
|
-
cursor?: string;
|
|
312
|
-
};
|
|
313
|
-
type RunRecord = {
|
|
314
|
-
runId: RunId;
|
|
315
|
-
conversationId: string;
|
|
316
|
-
parentRunId?: RunId;
|
|
317
|
-
agentSpecId?: string;
|
|
318
|
-
status: RunStatus;
|
|
319
|
-
currentNode?: string;
|
|
320
|
-
startedAt: number;
|
|
321
|
-
updatedAt: number;
|
|
322
|
-
pausedAt?: number;
|
|
323
|
-
pauseReason?: string;
|
|
324
|
-
iterationsUsed?: number;
|
|
325
|
-
iterationBudget?: {
|
|
326
|
-
max: number;
|
|
327
|
-
refundable: boolean;
|
|
328
|
-
};
|
|
329
|
-
errorIfAny?: {
|
|
330
|
-
errorCode: string;
|
|
331
|
-
message: string;
|
|
332
|
-
recoverable: boolean;
|
|
333
|
-
};
|
|
334
|
-
metadata?: Record<string, unknown>;
|
|
335
|
-
};
|
|
336
|
-
interface RunRegistryStore {
|
|
337
|
-
save(record: RunRecord): Promise<void>;
|
|
338
|
-
load(runId: RunId): Promise<RunRecord | null>;
|
|
339
|
-
list(filter?: ListRunsFilter): Promise<{
|
|
340
|
-
runs: RunRecord[];
|
|
341
|
-
nextCursor?: string;
|
|
342
|
-
}>;
|
|
343
|
-
delete(runId: RunId): Promise<void>;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
type RunRequestSnapshot = Readonly<object>;
|
|
347
|
-
interface CancelOpts {
|
|
348
|
-
reason: string;
|
|
349
|
-
forceCleanup?: boolean;
|
|
350
|
-
timeout?: number;
|
|
351
|
-
}
|
|
352
|
-
interface RunCost {
|
|
353
|
-
tokensInput: number;
|
|
354
|
-
tokensOutput: number;
|
|
355
|
-
tokenUsage?: RunTokenUsageAggregate;
|
|
356
|
-
tokenLedgerEntryIds?: string[];
|
|
357
|
-
totalCostUsd?: number;
|
|
358
|
-
latencyMs?: number;
|
|
359
|
-
childrenTotal?: RunCost;
|
|
360
|
-
}
|
|
361
|
-
interface RunCostCollector {
|
|
362
|
-
snapshot(runId: RunId): RunCost | Promise<RunCost>;
|
|
363
|
-
}
|
|
364
|
-
interface RunLifecyclePatch {
|
|
365
|
-
currentNode?: string;
|
|
366
|
-
iterationsUsed?: number;
|
|
367
|
-
}
|
|
368
|
-
interface RunAwaitingUserPatch extends RunLifecyclePatch {
|
|
369
|
-
reason?: string;
|
|
370
|
-
eventId?: string;
|
|
371
|
-
interaction?: {
|
|
372
|
-
interactionId: string;
|
|
373
|
-
toolCallId: ToolCallId;
|
|
374
|
-
checkpointRevision: number;
|
|
375
|
-
resumeToken: string;
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
interface RunFailureInfo {
|
|
379
|
-
errorCode: string;
|
|
380
|
-
message: string;
|
|
381
|
-
recoverable: boolean;
|
|
382
|
-
}
|
|
383
|
-
interface RunMeta {
|
|
384
|
-
runId: RunId;
|
|
385
|
-
parentRunId?: RunId;
|
|
386
|
-
agentSpecId?: string;
|
|
387
|
-
conversationId: string;
|
|
388
|
-
status: RunStatus;
|
|
389
|
-
currentNode?: string;
|
|
390
|
-
startedAt: number;
|
|
391
|
-
updatedAt: number;
|
|
392
|
-
pausedAt?: number;
|
|
393
|
-
pauseReason?: string;
|
|
394
|
-
iterationsUsed?: number;
|
|
395
|
-
errorIfAny?: {
|
|
396
|
-
errorCode: string;
|
|
397
|
-
message: string;
|
|
398
|
-
recoverable: boolean;
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
interface RunObserveFilter {
|
|
402
|
-
/** RuntimeEvent 使用 type 作为主判别字段;保留 kinds 只是为了贴近 N-3 草案措辞。 */
|
|
403
|
-
types?: RuntimeEvent['type'][];
|
|
404
|
-
kinds?: RuntimeEvent['type'][];
|
|
405
|
-
includePersisted?: boolean;
|
|
406
|
-
}
|
|
407
|
-
interface RunHandle<TRequest extends RunRequestSnapshot = RunRequestSnapshot> {
|
|
408
|
-
readonly runId: RunId;
|
|
409
|
-
readonly parentRunId?: RunId;
|
|
410
|
-
readonly signal: AbortSignal;
|
|
411
|
-
spec(): Promise<AgentSpec>;
|
|
412
|
-
request(): Promise<TRequest>;
|
|
413
|
-
/** 将同一个逻辑 run 重新挂载到当前请求的 transport 事件总线。 */
|
|
414
|
-
attachTransportEventBus(eventBus: EventBus): void;
|
|
415
|
-
cancel(opts: CancelOpts, patch?: RunLifecyclePatch): Promise<void>;
|
|
416
|
-
observe(filter?: RunObserveFilter): AsyncIterable<RuntimeEvent>;
|
|
417
|
-
cost(): Promise<RunCost>;
|
|
418
|
-
meta(): Promise<RunMeta>;
|
|
419
|
-
markRunning(patch?: RunLifecyclePatch): Promise<void>;
|
|
420
|
-
markAwaitingUser(patch?: RunAwaitingUserPatch): Promise<void>;
|
|
421
|
-
markCompleted(patch?: RunLifecyclePatch): Promise<void>;
|
|
422
|
-
markFailed(error: RunFailureInfo, patch?: RunLifecyclePatch): Promise<void>;
|
|
423
|
-
pause(reason?: string): Promise<never>;
|
|
424
|
-
resume(): Promise<never>;
|
|
425
|
-
}
|
|
426
|
-
interface DefaultRunHandleOptions<TRequest extends RunRequestSnapshot = RunRequestSnapshot> {
|
|
427
|
-
runRecord: RunRecord;
|
|
428
|
-
abortController: AbortController;
|
|
429
|
-
agentSpec: AgentSpec;
|
|
430
|
-
request: TRequest;
|
|
431
|
-
eventBus: EventBus;
|
|
432
|
-
eventStore: EventStore;
|
|
433
|
-
costCollector: RunCostCollector;
|
|
434
|
-
registryStore: RunRegistryStore;
|
|
435
|
-
auditPort?: AuditPort;
|
|
436
|
-
onCancelled?: (runId: RunId, opts: CancelOpts) => void;
|
|
437
|
-
onTerminal?: (runId: RunId) => void;
|
|
438
|
-
}
|
|
439
|
-
/**
|
|
440
|
-
* RunHandle 的默认实现只编织现有机制:
|
|
441
|
-
* - cancel 只触发 AbortController,不改 GraphExecutor;
|
|
442
|
-
* - observe 只包装 EventBus/EventStore;
|
|
443
|
-
* - cost 只读取外部注入的 CostCollector。
|
|
444
|
-
*/
|
|
445
|
-
declare class DefaultRunHandle<TRequest extends RunRequestSnapshot = RunRequestSnapshot> implements RunHandle<TRequest> {
|
|
446
|
-
readonly runId: RunId;
|
|
447
|
-
readonly parentRunId?: RunId;
|
|
448
|
-
private runRecord;
|
|
449
|
-
private abortController;
|
|
450
|
-
private readonly agentSpecSnapshot;
|
|
451
|
-
private readonly requestSnapshot;
|
|
452
|
-
private transportEventBus;
|
|
453
|
-
private readonly observationEventBus;
|
|
454
|
-
private readonly eventStore;
|
|
455
|
-
private readonly costCollector;
|
|
456
|
-
private readonly registryStore;
|
|
457
|
-
private readonly auditPort;
|
|
458
|
-
private readonly onCancelled?;
|
|
459
|
-
private readonly onTerminal?;
|
|
460
|
-
constructor(options: DefaultRunHandleOptions<TRequest>);
|
|
461
|
-
get signal(): AbortSignal;
|
|
462
|
-
/**
|
|
463
|
-
* awaiting_user 之后的 resume 是同一逻辑 run 的新 execution。
|
|
464
|
-
* 必须切换取消控制器,避免旧 transport 的迟到 abort 污染新 execution。
|
|
465
|
-
*/
|
|
466
|
-
replaceExecutionAbortController(controller: AbortController): void;
|
|
467
|
-
spec(): Promise<AgentSpec>;
|
|
468
|
-
request(): Promise<TRequest>;
|
|
469
|
-
attachTransportEventBus(eventBus: EventBus): void;
|
|
470
|
-
cancel(opts: CancelOpts, patch?: RunLifecyclePatch): Promise<void>;
|
|
471
|
-
observe(filter?: RunObserveFilter): AsyncIterable<RuntimeEvent>;
|
|
472
|
-
cost(): Promise<RunCost>;
|
|
473
|
-
meta(): Promise<RunMeta>;
|
|
474
|
-
markRunning(patch?: RunLifecyclePatch): Promise<void>;
|
|
475
|
-
markAwaitingUser(patch?: RunAwaitingUserPatch): Promise<void>;
|
|
476
|
-
markCompleted(patch?: RunLifecyclePatch): Promise<void>;
|
|
477
|
-
markFailed(error: RunFailureInfo, patch?: RunLifecyclePatch): Promise<void>;
|
|
478
|
-
pause(_reason?: string): Promise<never>;
|
|
479
|
-
resume(): Promise<never>;
|
|
480
|
-
private saveLifecycleStatus;
|
|
481
|
-
private readonly forwardTransportEvent;
|
|
482
|
-
private readonly forwardTransportError;
|
|
483
|
-
private readonly detachClosedTransport;
|
|
484
|
-
private attachTransportBridge;
|
|
485
|
-
private detachTransportBridge;
|
|
486
|
-
private closeObservationChannel;
|
|
487
|
-
}
|
|
488
|
-
declare function runMetaFromRecord(record: RunRecord): RunMeta;
|
|
489
|
-
|
|
490
|
-
export { type RunHandle as A, type RunLifecyclePatch as B, type CompleteToolModelInputParams as C, DefaultRunHandle as D, type EventRangeOptions as E, type RunMeta as F, type RunObserveFilter as G, type RunRecord as H, type RunRegistryStore as I, type RunRequestSnapshot as J, type RunStatus as K, type ListRunsFilter as L, runMetaFromRecord as M, type ObservationPreviewPort as O, type PersistedEvent as P, type RunCost as R, type StructuredToolResult as S, type ToolSchemaBuildRequest as T, type ToolRuntimeDefinition as a, type ToolExecutionResult as b, type ToolModelInputDeclaration as c, type ToolModelInputAttachmentSelection as d, type ToolModelInputResolverPort as e, type ToolModelInputCapabilityValidatorPort as f, type ToolCatalogPort as g, type ToolExecutionPort as h, type EventStore as i, createMonotonicEventStoreIdFactory as j, type ObservationPreviewContext as k, type ObservationPreviewMeta as l, type ObservationPreviewResult as m, type ResolveToolModelInputParams as n, type ToolControlInfo as o, ToolModelInputResolutionError as p, type ToolObservationPreviewMeta as q, requireEventStoreId as r, type ToolResultImageMedia as s, type ToolRuntimePort as t, EventBus as u, type CancelOpts as v, type DefaultRunHandleOptions as w, type RunAwaitingUserPatch as x, type RunCostCollector as y, type RunFailureInfo as z };
|