@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
package/dist/index-CZMXtw4h.d.ts
DELETED
|
@@ -1,1971 +0,0 @@
|
|
|
1
|
-
import { M as ModelCatalogEntry, a as ModelCatalogLike, E as ExecutorLocalState, R as RuntimeEventCommitPort, S as StandardToolCall, b as ExecutorLocalPatch, c as ModelResolverLike, d as LlmCaller, T as TelemetryPort, G as GraphNode, e as EngineState, N as NodeResult, C as Checkpointer, f as CheckpointMeta, g as CheckpointListFilter, h as CheckpointSummary, i as ToolBatchCompletionMode, j as EngineLocalState, k as RuntimeFailureFact, l as ENGINE_STATE_SCHEMA_VERSION, m as ExecutorLlmInvocationKind, n as GraphExecutor, o as MemoryEventStore, p as RuntimeEventSink, q as RuntimeFailureFactSink, s as summarizeCheckpoint, r as ToolContextPatch, t as copyToolContextRuntimeCapability, u as ensureToolContextRuntimeCapability, v as getToolContextRuntimeBinding, x as readToolContextPersistedHistory, y as readToolContextWorkingHistory, z as stripRuntimeReservedToolContextPatch, A as LLMPolicy, B as LLMPolicyMatchContext, D as LLMPolicyErrorDecision, F as LlmCallInvocationContext, H as LlmFallbackObserver, I as ModelFallbackAppliedInfo, J as ModelFallbackPolicy, K as ModelFallbackRejectedInfo, O as ModelResolver, P as createFixedChatModelCatalog, Q as DefaultRunSupervisor, U as DefaultRunSupervisorOptions, V as FindActiveByConversationOptions, W as FindRunsByConversationOptions, X as MemoryRunRegistryStore, Y as RunExecutionContext, Z as RunExecutorPort, _ as RunOutcome, $ as RunRegistrationSpec, a0 as RunResumeClaim, a1 as RunResumeInteraction, a2 as RunSnapshot, a3 as RunSupervisor, a4 as RunTerminalError, a5 as RunTerminalEvent, a6 as RunTerminalStatus, a7 as RunWaitForTerminalOptions, a8 as ContextCompactionSuppressedReason, a9 as ContextCompactionTelemetryOutcome, aa as TELEMETRY_EVENT_KINDS, ab as TelemetryEvent, ac as TelemetryScope, ad as DefaultGraphExecutorOptions, ae as GraphLoopHarness, af as GraphLoopHarnessOptions, ag as GraphLoopHarnessRunResult, ah as GraphLoopLlmNodeFactoryParams, ai as createDefaultGraphExecutor, aj as createGraphLoopHarness } from './defaultGraphExecutor-hT7dchpC.js';
|
|
2
|
-
import { P as PromptUsageMeasurementPolicy, c as ContextUsageSnapshot, T as TokenRoute, a as TokenCountSource, b as TokenCountConfidence, M as ModelReasoningConfig, R as REASONING_EFFORTS, d as ReasoningEffort, i as isValidReasoningEffort, r as resolveEffectiveEffort, C as CanonicalLlmUsage } from './reasoning-bffu9R2B.js';
|
|
3
|
-
import { A as AuditPort } from './audit-DnuOSwWE.js';
|
|
4
|
-
import { T as TokenCounterPort } from './token-counter-BjiHQEJ-.js';
|
|
5
|
-
import { T as TokenizerPort } from './tokenizer-yIFTTc-W.js';
|
|
6
|
-
import { c as ToolModelInputDeclaration, d as ToolModelInputAttachmentSelection, e as ToolModelInputResolverPort, f as ToolModelInputCapabilityValidatorPort, g as ToolCatalogPort, h as ToolExecutionPort, O as ObservationPreviewPort, E as EventRangeOptions, i as EventStore, P as PersistedEvent, j as createMonotonicEventStoreIdFactory, r as requireEventStoreId, C as CompleteToolModelInputParams, k as ObservationPreviewContext, l as ObservationPreviewMeta, m as ObservationPreviewResult, n as ResolveToolModelInputParams, S as StructuredToolResult, o as ToolControlInfo, b as ToolExecutionResult, p as ToolModelInputResolutionError, q as ToolObservationPreviewMeta, s as ToolResultImageMedia, a as ToolRuntimeDefinition, t as ToolRuntimePort, T as ToolSchemaBuildRequest, u as EventBus, v as CancelOpts, D as DefaultRunHandle, w as DefaultRunHandleOptions, L as ListRunsFilter, x as RunAwaitingUserPatch, R as RunCost, y as RunCostCollector, z as RunFailureInfo, A as RunHandle, B as RunLifecyclePatch, F as RunMeta, G as RunObserveFilter, H as RunRecord, I as RunRegistryStore, J as RunRequestSnapshot, K as RunStatus, M as runMetaFromRecord } from './runHandle-ouLd6Tgp.js';
|
|
7
|
-
import { w as LlmRequestMessage, b as AgentInvocationRequest, e as CanonicalInferenceCachePolicy, I as ImageInputAdmissionEvidence, B as ToolParameterSchema, J as JsonSchemaValue, z as ToolParameterProperty, D as ToolParameterType, i as CanonicalInferenceFinishReason, h as CanonicalInferenceFailureKind, g as CanonicalInferenceEvent, L as LlmImageInputPlacement, r as LlmCallOptions, x as LlmRetryConfig, T as ToolCall } from './llm-input-materialization-Vce5Swvc.js';
|
|
8
|
-
import { b as ContextCompactionCandidate, R as ResolvedContextCompactionPolicy, C as ContextBuildTokenEstimate, c as ContextCompactionPlan } from './token-calibration-GtFyMJtM.js';
|
|
9
|
-
import { R as RuntimeEvent, H as HistorySummaryEvent, o as ToolCallDecisionEvent, f as RoutedRuntimeEvent, j as RuntimeEventRoutingIdentity, E as ErrorEvent } from './final-answer-oOQ_7nPt.js';
|
|
10
|
-
import { C as ContextTokenComponent, s as ContextComponentTokenLedgerEntry, d as AgentSpecContextPolicy, b as AgentSpecSystemReminderPolicy, o as AgentSpecSystemReminderTrigger, n as AgentSpecSystemReminderExtraRule, L as LlmUsageTokenLedgerEntry, y as TokenLedgerAggregate, E as TokenUsageTotals, z as TokenLedgerEntry, D as TokenPricing, u as CostBreakdown, R as RunTokenUsageAggregate } from './token-accounting-CVW37Uri.js';
|
|
11
|
-
import { E as EffectivePromptBudget, R as ResolveEffectivePromptBudgetInput, r as resolveEffectivePromptBudget } from './prompt-budget-yciFkC9U.js';
|
|
12
|
-
import { R as RuntimeResourceRef, M as SerializableJsonRecord, c as RunId, P as ProviderContinuation, T as ToolCallId } from './provider-continuation-CTZdCB--.js';
|
|
13
|
-
import { S as SummarizationCallbacks } from './summarization-CMMLhaCe.js';
|
|
14
|
-
import { A as AnyAgentEvent } from './agentEvents-DhXdKeXD.js';
|
|
15
|
-
import { M as ModelInputPlacement, b as ModelInputRequirement, c as ModelInputCompatibility, a as ToolExecutionContext, A as AgentTool, B as BaseTool, C as CommonParameterTypes, F as FunctionToolSchema, T as ToolArgs, d as ToolCallResult, e as ToolCallStreamingPolicy, f as ToolContextConversationView, g as ToolModelInputAdmission, h as ToolModelInputDelivery, i as ToolRegistryEntry, j as ToolResult, U as UnifiedToolResult, k as computeToolIdempotencyKey, l as findCachedToolOutputByIdempotencyKey, m as AdapterInputSupport, E as EMPTY_MODEL_INPUT_REQUIREMENT, n as MODEL_INPUT_PLACEMENTS, o as ModelInputIncompatibilityReason, p as ChildRunParentContext, q as ChildRunHistoryPolicy, r as ChildRunInvokerPort, s as ChildRunRequest, t as ChildRunResult, S as SubRunTracePublisher, u as SubRunTraceEnvelope } from './toolContracts-BQ4kIso_.js';
|
|
16
|
-
import { a as ExecutionTraceContext, E as EventEnvelope } from './execution-B7e01ZjW.js';
|
|
17
|
-
import { i as index$e } from './index-D_csW7Zl.js';
|
|
18
|
-
import { e as AuditEnvelope, g as AuditScope, b as AuditActor, d as AuditDecision, f as AuditEvidence, c as AuditCostDelta } from './audit-XsNMTt0-.js';
|
|
19
|
-
|
|
20
|
-
declare const MODEL_INPUT_ERROR_CODES: {
|
|
21
|
-
readonly MODEL_UNSUPPORTED: "llm.image_input.model_unsupported";
|
|
22
|
-
readonly PLACEMENT_UNSUPPORTED: "llm.image_input.placement_unsupported";
|
|
23
|
-
readonly MATERIALIZATION_PENDING: "llm.image_input.materialization_pending";
|
|
24
|
-
};
|
|
25
|
-
type ModelInputErrorCode = typeof MODEL_INPUT_ERROR_CODES[keyof typeof MODEL_INPUT_ERROR_CODES];
|
|
26
|
-
declare const LLM_MODEL_ELIGIBILITY_ERROR_CODE: "llm.unsupported_capability";
|
|
27
|
-
interface ModelInputErrorMetadata {
|
|
28
|
-
readonly active_model_id: string;
|
|
29
|
-
readonly required_placements: readonly ModelInputPlacement[];
|
|
30
|
-
readonly missing_conditions?: readonly string[];
|
|
31
|
-
readonly compatible_model_ids?: readonly string[];
|
|
32
|
-
readonly fallback_rejections?: readonly string[];
|
|
33
|
-
}
|
|
34
|
-
declare class ModelInputCapabilityError extends Error {
|
|
35
|
-
readonly errorCode: ModelInputErrorCode;
|
|
36
|
-
readonly recoverable = false;
|
|
37
|
-
readonly metadata: ModelInputErrorMetadata;
|
|
38
|
-
constructor(errorCode: ModelInputErrorCode, message: string, metadata: ModelInputErrorMetadata);
|
|
39
|
-
}
|
|
40
|
-
declare class LlmModelEligibilityError extends Error {
|
|
41
|
-
readonly errorCode: "llm.unsupported_capability";
|
|
42
|
-
readonly recoverable = false;
|
|
43
|
-
readonly metadata: ModelInputErrorMetadata;
|
|
44
|
-
constructor(message: string, metadata: ModelInputErrorMetadata);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
declare function createModelInputCompatibilityError(input: {
|
|
48
|
-
readonly modelId: string;
|
|
49
|
-
readonly requirement: ModelInputRequirement;
|
|
50
|
-
readonly incompatibility: Exclude<ModelInputCompatibility, {
|
|
51
|
-
readonly compatible: true;
|
|
52
|
-
}>;
|
|
53
|
-
readonly compatibleModelIds?: readonly string[];
|
|
54
|
-
}): ModelInputCapabilityError | LlmModelEligibilityError;
|
|
55
|
-
|
|
56
|
-
declare function deriveModelInputRequirement(messages: readonly LlmRequestMessage[]): ModelInputRequirement;
|
|
57
|
-
|
|
58
|
-
declare function evaluateModelInputCompatibility(model: ModelCatalogEntry | undefined, requirement: ModelInputRequirement): ModelInputCompatibility;
|
|
59
|
-
declare function listCompatibleModelIds(models: readonly ModelCatalogEntry[], requirement: ModelInputRequirement): readonly string[];
|
|
60
|
-
|
|
61
|
-
declare function assertModelInputCompatibility(input: {
|
|
62
|
-
readonly modelCatalog: ModelCatalogLike;
|
|
63
|
-
readonly modelId: string;
|
|
64
|
-
readonly requirement: ModelInputRequirement;
|
|
65
|
-
}): void;
|
|
66
|
-
|
|
67
|
-
type ToolModelInputDeclarationValidation = {
|
|
68
|
-
readonly ok: true;
|
|
69
|
-
readonly declaration: ToolModelInputDeclaration;
|
|
70
|
-
} | {
|
|
71
|
-
readonly ok: false;
|
|
72
|
-
readonly reason: string;
|
|
73
|
-
};
|
|
74
|
-
/**
|
|
75
|
-
* 只校验 framework 拥有的声明形状。
|
|
76
|
-
* URI scheme、资源授权与图片完整性必须留给 host resolver,避免 host 存储语义反向进入 linnkit。
|
|
77
|
-
*/
|
|
78
|
-
declare function parseToolModelInputDeclaration(value: unknown): ToolModelInputDeclarationValidation;
|
|
79
|
-
|
|
80
|
-
declare function resolveToolModelInput(input: {
|
|
81
|
-
readonly activeModelId: string | undefined;
|
|
82
|
-
readonly toolName: string;
|
|
83
|
-
readonly toolCallId: string;
|
|
84
|
-
readonly selections: readonly ToolModelInputAttachmentSelection[] | undefined;
|
|
85
|
-
readonly context: ToolExecutionContext;
|
|
86
|
-
readonly resolver?: ToolModelInputResolverPort;
|
|
87
|
-
readonly capabilityValidator?: ToolModelInputCapabilityValidatorPort;
|
|
88
|
-
}): Promise<readonly RuntimeResourceRef[] | undefined>;
|
|
89
|
-
|
|
90
|
-
interface GraphExecutorOutputProcessor {
|
|
91
|
-
/**
|
|
92
|
-
* 中文备注:outputProcessor 来自 host task 实例,方法可能依赖 `this`。
|
|
93
|
-
* runtime-kernel 调用时必须保留对象接收者,不要拆成裸函数传递。
|
|
94
|
-
*/
|
|
95
|
-
processResponse?(this: GraphExecutorOutputProcessor, rawResponse: string): string;
|
|
96
|
-
processStreamChunk?(this: GraphExecutorOutputProcessor, chunk: string): string;
|
|
97
|
-
}
|
|
98
|
-
interface GraphExecutorContextBuildInput {
|
|
99
|
-
request: AgentInvocationRequest;
|
|
100
|
-
history: RuntimeEvent[];
|
|
101
|
-
modelId: string;
|
|
102
|
-
/** `prepare_call` 对最终 tools/control 的本地估算,Context Builder 必须先从输入预算扣除。 */
|
|
103
|
-
toolDefinitionTokens: number;
|
|
104
|
-
signal?: AbortSignal;
|
|
105
|
-
}
|
|
106
|
-
interface GraphExecutorContextBuildOutput {
|
|
107
|
-
llmMessages: LlmRequestMessage[];
|
|
108
|
-
/** 当前正式主 Prompt 的稳定前缀锚点;由 Host 根据消息语义标注。 */
|
|
109
|
-
cachePolicy?: CanonicalInferenceCachePolicy;
|
|
110
|
-
/** 模型 route、Agent policy 与 prepared tools 合并后的单一预算事实。 */
|
|
111
|
-
promptBudget?: EffectivePromptBudget;
|
|
112
|
-
/** reminder 后最终 Prompt 计数必须遵守的 route、remote count 与 calibration 策略。 */
|
|
113
|
-
promptUsageMeasurementPolicy?: PromptUsageMeasurementPolicy;
|
|
114
|
-
/** Context Manager 产出的短生命周期图片预算证据;不得写入 checkpoint 或 provider options。 */
|
|
115
|
-
imageInputAdmissionEvidence?: ImageInputAdmissionEvidence;
|
|
116
|
-
/** 最终 Prompt 达阈值时,Graph 可消费的纯压缩计划。 */
|
|
117
|
-
contextCompactionCandidate?: GraphContextCompactionCandidate;
|
|
118
|
-
/** 即使当前没有可替换区段,Graph 仍需知道策略以正确结算硬超限。 */
|
|
119
|
-
contextCompactionPolicy?: ResolvedContextCompactionPolicy;
|
|
120
|
-
/**
|
|
121
|
-
* Host 注入的输出文本处理器。
|
|
122
|
-
*
|
|
123
|
-
* 中文备注:
|
|
124
|
-
* - runtime-kernel 只知道“把模型输出字符串交给一个可选函数处理”;
|
|
125
|
-
* - 具体规则仍由 host 的 agent/task 定义提供,避免 framework 反向识别 promptKey 或产品语义。
|
|
126
|
-
*/
|
|
127
|
-
outputProcessor?: GraphExecutorOutputProcessor;
|
|
128
|
-
/**
|
|
129
|
-
* 上下文构建旁路 trace。
|
|
130
|
-
*
|
|
131
|
-
* 中文备注:runtime-kernel 只负责透传,不理解 context-manager 的具体 trace 类型,
|
|
132
|
-
* 避免 graph-engine 反向依赖 context-manager。
|
|
133
|
-
*/
|
|
134
|
-
contextTrace?: unknown;
|
|
135
|
-
/**
|
|
136
|
-
* 构建期 token 估算快照。
|
|
137
|
-
*
|
|
138
|
-
* 中文备注:runtime-kernel 只透传稳定 DTO;它不解析 context-manager 内部 trace,
|
|
139
|
-
* 也不把 provider remote count 当成本地估算样本来源。
|
|
140
|
-
*/
|
|
141
|
-
tokenEstimate?: ContextBuildTokenEstimate;
|
|
142
|
-
/**
|
|
143
|
-
* 构建期上下文分项 token 估算。
|
|
144
|
-
*
|
|
145
|
-
* 中文备注:context-manager 只产稳定 DTO,runtime-kernel 在带 run/turn scope 的地方
|
|
146
|
-
* 再创建账本条目,避免反向读取 ContextTrace 内部结构。
|
|
147
|
-
*/
|
|
148
|
-
tokenComponents?: ContextTokenComponent[];
|
|
149
|
-
tokenLedgerEntry?: ContextComponentTokenLedgerEntry;
|
|
150
|
-
}
|
|
151
|
-
type GraphContextCompactionCandidate = ContextCompactionCandidate;
|
|
152
|
-
interface GraphExecutorContextApplyInput extends GraphExecutorContextBuildInput {
|
|
153
|
-
plan: ContextCompactionPlan;
|
|
154
|
-
checkpointContent: string;
|
|
155
|
-
summaryId: string;
|
|
156
|
-
conversationId: string;
|
|
157
|
-
turnId: string;
|
|
158
|
-
timestamp: number;
|
|
159
|
-
maxOutputTokens: number;
|
|
160
|
-
}
|
|
161
|
-
type GraphExecutorContextApplyOutput = {
|
|
162
|
-
kind: 'ready';
|
|
163
|
-
rebuiltContext: GraphExecutorContextBuildOutput;
|
|
164
|
-
pendingSummaryEvent: HistorySummaryEvent;
|
|
165
|
-
compressionRatio: number;
|
|
166
|
-
summaryTokenEstimate: number;
|
|
167
|
-
} | {
|
|
168
|
-
kind: 'invalid';
|
|
169
|
-
reason: string;
|
|
170
|
-
tokenEstimate?: number;
|
|
171
|
-
messageId?: string;
|
|
172
|
-
} | {
|
|
173
|
-
kind: 'ineffective';
|
|
174
|
-
compressionRatio: number;
|
|
175
|
-
summaryTokenEstimate: number;
|
|
176
|
-
};
|
|
177
|
-
interface GraphExecutorContextBuilder {
|
|
178
|
-
build(input: GraphExecutorContextBuildInput): Promise<GraphExecutorContextBuildOutput>;
|
|
179
|
-
applyCompaction?(input: GraphExecutorContextApplyInput): Promise<GraphExecutorContextApplyOutput>;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
type TickEvent$1 = AnyAgentEvent | RuntimeEvent;
|
|
183
|
-
type AgentStepDecision = {
|
|
184
|
-
kind: 'tool_calls';
|
|
185
|
-
toolCalls: StandardToolCall[];
|
|
186
|
-
} | {
|
|
187
|
-
kind: 'final_answer';
|
|
188
|
-
answer: string;
|
|
189
|
-
} | {
|
|
190
|
-
kind: 'wait_user';
|
|
191
|
-
pendingInteractionSpec: Record<string, unknown>;
|
|
192
|
-
lastToolResult: Record<string, unknown>;
|
|
193
|
-
} | {
|
|
194
|
-
kind: 'yield';
|
|
195
|
-
} | {
|
|
196
|
-
kind: 'error';
|
|
197
|
-
error: Error;
|
|
198
|
-
};
|
|
199
|
-
interface TickInput {
|
|
200
|
-
request: AgentInvocationRequest;
|
|
201
|
-
toolContext?: ToolExecutionContext;
|
|
202
|
-
stream?: boolean;
|
|
203
|
-
history: RuntimeEvent[];
|
|
204
|
-
signal?: AbortSignal;
|
|
205
|
-
/**
|
|
206
|
-
* 🔥 达到最大步数时的强制收尾开关:
|
|
207
|
-
* - true 时:禁用工具(不下发 tools schema,tool_choice=none)
|
|
208
|
-
* - 并注入 system 指令,要求模型必须直接输出最终答案
|
|
209
|
-
*/
|
|
210
|
-
forceFinalAnswer?: boolean;
|
|
211
|
-
/**
|
|
212
|
-
* 执行阶段信号(由 GraphExecutor 注入到 local.executorLocal)
|
|
213
|
-
*
|
|
214
|
-
* 中文备注:
|
|
215
|
-
* - SystemReminder 引擎会基于它生成 <system-reminder> 并追加到最后一条消息末尾
|
|
216
|
-
* - 该字段仅用于“本次 tick 的 LLM 输入”,不得写入历史事件或持久化
|
|
217
|
-
*/
|
|
218
|
-
executorLocal?: ExecutorLocalState;
|
|
219
|
-
summarizationCallbacks?: SummarizationCallbacks;
|
|
220
|
-
runtimeEventCommitPort?: RuntimeEventCommitPort;
|
|
221
|
-
}
|
|
222
|
-
interface TickOutput {
|
|
223
|
-
decision: AgentStepDecision;
|
|
224
|
-
executorLocalPatch?: ExecutorLocalPatch;
|
|
225
|
-
contextTrace?: SerializableJsonRecord;
|
|
226
|
-
contextUsage?: ContextUsageSnapshot;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* @file src/agent/runtime-kernel/graph-engine/executor.ts
|
|
231
|
-
*
|
|
232
|
-
* @brief 图执行引擎的单步推理执行器
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
interface GraphAgentExecutorOptions {
|
|
236
|
-
cloudQuotaFallbackModelId?: string;
|
|
237
|
-
modelCatalog?: ModelCatalogLike;
|
|
238
|
-
modelResolver?: Pick<ModelResolverLike, 'resolveModelId'>;
|
|
239
|
-
}
|
|
240
|
-
type GraphAgentExecutorToolRuntime = Pick<ToolCatalogPort, 'getToolSchemas' | 'getToolDefinition'>;
|
|
241
|
-
interface GraphAgentExecutorLlmCaller extends Pick<LlmCaller, 'callWithRetries'>, Partial<Pick<LlmCaller, 'call'>> {
|
|
242
|
-
}
|
|
243
|
-
interface GraphAgentExecutorDependencies extends GraphAgentExecutorOptions {
|
|
244
|
-
llmCaller: GraphAgentExecutorLlmCaller;
|
|
245
|
-
toolRuntime: GraphAgentExecutorToolRuntime;
|
|
246
|
-
contextBuilder: GraphExecutorContextBuilder;
|
|
247
|
-
/**
|
|
248
|
-
* 可选:宿主提供的 TelemetryPort 实现。
|
|
249
|
-
* 不传时使用 noopTelemetry(保持当前行为:observability 默认关闭,零业务影响)。
|
|
250
|
-
*/
|
|
251
|
-
telemetryPort?: TelemetryPort;
|
|
252
|
-
auditPort?: AuditPort;
|
|
253
|
-
tokenizer?: TokenizerPort;
|
|
254
|
-
tokenCounter?: TokenCounterPort;
|
|
255
|
-
resolveTokenRoute?: (modelId: string) => TokenRoute | undefined;
|
|
256
|
-
}
|
|
257
|
-
declare class GraphAgentExecutor {
|
|
258
|
-
private readonly llmCaller;
|
|
259
|
-
private readonly toolRuntime;
|
|
260
|
-
private readonly contextBuilder;
|
|
261
|
-
private readonly cloudQuotaFallbackModelId?;
|
|
262
|
-
private readonly modelResolver;
|
|
263
|
-
private readonly modelCatalog;
|
|
264
|
-
private readonly telemetryPort;
|
|
265
|
-
private readonly auditPort;
|
|
266
|
-
private readonly tokenizer;
|
|
267
|
-
private readonly stages;
|
|
268
|
-
private readonly middlewares;
|
|
269
|
-
constructor(dependencies: GraphAgentExecutorDependencies);
|
|
270
|
-
tick(input: TickInput, eventHandler?: (event: TickEvent$1) => void): Promise<TickOutput>;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
type TickEvent = AnyAgentEvent | RuntimeEvent;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* LlmNode 只依赖"单步推理"能力,不直接依赖具体执行器实现。
|
|
277
|
-
*
|
|
278
|
-
* 中文备注:
|
|
279
|
-
* - 这样节点本身只关注图节点职责,不负责组装 `LlmCaller` / `ToolRegistry`;
|
|
280
|
-
* - 默认依赖装配放到工厂里,方便测试替换,也降低构造函数耦合。
|
|
281
|
-
*/
|
|
282
|
-
interface LlmNodeReasoner {
|
|
283
|
-
tick(input: TickInput, eventHandler?: (event: TickEvent) => void): Promise<TickOutput>;
|
|
284
|
-
}
|
|
285
|
-
interface LlmNodeDependencies {
|
|
286
|
-
reasoner: LlmNodeReasoner;
|
|
287
|
-
}
|
|
288
|
-
declare class LlmNode implements GraphNode {
|
|
289
|
-
id: string;
|
|
290
|
-
private readonly reasoner;
|
|
291
|
-
constructor(dependencies: LlmNodeDependencies);
|
|
292
|
-
run(state: EngineState): Promise<NodeResult>;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
interface ToolNodeDependencies {
|
|
296
|
-
toolRuntime: Pick<ToolCatalogPort, 'getToolDefinition'> & Pick<ToolExecutionPort, 'executeTool'>;
|
|
297
|
-
observationPreview: ObservationPreviewPort;
|
|
298
|
-
/**
|
|
299
|
-
* 可选:宿主提供的 TelemetryPort 实现。
|
|
300
|
-
* 不传时使用 noopTelemetry(observability 默认关闭,业务零影响)。
|
|
301
|
-
*/
|
|
302
|
-
telemetryPort?: TelemetryPort;
|
|
303
|
-
auditPort?: AuditPort;
|
|
304
|
-
modelInputCapabilityValidator?: ToolModelInputCapabilityValidatorPort;
|
|
305
|
-
modelInputResolver?: ToolModelInputResolverPort;
|
|
306
|
-
}
|
|
307
|
-
declare class ToolNode implements GraphNode {
|
|
308
|
-
id: string;
|
|
309
|
-
private readonly toolRuntime;
|
|
310
|
-
private readonly observationPreview;
|
|
311
|
-
private readonly telemetryPort;
|
|
312
|
-
private readonly auditPort;
|
|
313
|
-
private readonly modelInputCapabilityValidator?;
|
|
314
|
-
private readonly modelInputResolver?;
|
|
315
|
-
private readonly idempotencyInFlight;
|
|
316
|
-
constructor(dependencies: ToolNodeDependencies);
|
|
317
|
-
/**
|
|
318
|
-
* B2-engine Batch 2: 上报 tool_call 事件到宿主侧 TelemetryPort。
|
|
319
|
-
* 在 handleSuccess / handleError 入口处调用。
|
|
320
|
-
*/
|
|
321
|
-
private emitToolCallTelemetry;
|
|
322
|
-
private emitToolDecisionAudit;
|
|
323
|
-
private emitToolProtocolErrorAudit;
|
|
324
|
-
run(state: EngineState): Promise<NodeResult>;
|
|
325
|
-
private runNextPendingToolCall;
|
|
326
|
-
private handleSuccess;
|
|
327
|
-
private handleRequireUserSuccess;
|
|
328
|
-
private handleError;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
declare class UserNode implements GraphNode {
|
|
332
|
-
id: string;
|
|
333
|
-
run(state: EngineState): Promise<NodeResult>;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
interface WaitUserNodeDependencies {
|
|
337
|
-
auditPort?: AuditPort;
|
|
338
|
-
}
|
|
339
|
-
declare class WaitUserNode implements GraphNode {
|
|
340
|
-
id: string;
|
|
341
|
-
private readonly auditPort;
|
|
342
|
-
constructor(dependencies?: WaitUserNodeDependencies);
|
|
343
|
-
run(state: EngineState): Promise<NodeResult>;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
declare class MemoryCheckpointer implements Checkpointer {
|
|
347
|
-
private store;
|
|
348
|
-
private cloneState;
|
|
349
|
-
load(checkpointKey: string): Promise<EngineState | null>;
|
|
350
|
-
save(checkpointKey: string, state: EngineState): Promise<void>;
|
|
351
|
-
clear(checkpointKey: string): Promise<void>;
|
|
352
|
-
peekMeta(checkpointKey: string): Promise<CheckpointMeta | null>;
|
|
353
|
-
list(filter?: CheckpointListFilter): Promise<CheckpointSummary[]>;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
interface HostToolCallBootstrapInput {
|
|
357
|
-
readonly eventId: string;
|
|
358
|
-
readonly conversationId: string;
|
|
359
|
-
readonly turnId: string;
|
|
360
|
-
readonly toolName: string;
|
|
361
|
-
readonly toolCallId: string;
|
|
362
|
-
readonly args: SerializableJsonRecord;
|
|
363
|
-
readonly history?: readonly RuntimeEvent[];
|
|
364
|
-
readonly timestamp?: number;
|
|
365
|
-
readonly metadata?: SerializableJsonRecord;
|
|
366
|
-
readonly decisionMeta?: SerializableJsonRecord;
|
|
367
|
-
readonly parentToolCallId?: string;
|
|
368
|
-
/** 工具批次完成后继续交还 LLM,或直接把执行权交还 Host。 */
|
|
369
|
-
readonly completionMode?: ToolBatchCompletionMode;
|
|
370
|
-
}
|
|
371
|
-
interface HostToolCallBootstrapLocalPatch {
|
|
372
|
-
readonly conversationId: string;
|
|
373
|
-
readonly turnId: string;
|
|
374
|
-
readonly history: RuntimeEvent[];
|
|
375
|
-
readonly pendingToolCalls: StandardToolCall[];
|
|
376
|
-
readonly toolBatchCompletionMode?: ToolBatchCompletionMode;
|
|
377
|
-
}
|
|
378
|
-
interface HostToolCallBootstrap {
|
|
379
|
-
readonly nodeId: 'tool';
|
|
380
|
-
readonly toolCall: StandardToolCall;
|
|
381
|
-
readonly decisionEvent: ToolCallDecisionEvent;
|
|
382
|
-
readonly localPatch: HostToolCallBootstrapLocalPatch;
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* 为 host 主动发起的单次工具调用构造同源 Graph 起点。
|
|
386
|
-
*
|
|
387
|
-
* host 仍负责发布和持久化 decisionEvent,并将其它运行时 local 与 localPatch 合并后 prime GraphExecutor。
|
|
388
|
-
*/
|
|
389
|
-
declare function createHostToolCallBootstrap(input: HostToolCallBootstrapInput): HostToolCallBootstrap;
|
|
390
|
-
|
|
391
|
-
type PrimaryPromptCapacityAdmission = {
|
|
392
|
-
admitted: true;
|
|
393
|
-
} | {
|
|
394
|
-
admitted: false;
|
|
395
|
-
usedTokens: number;
|
|
396
|
-
inputBudgetTokens: number;
|
|
397
|
-
exceededByTokens: number;
|
|
398
|
-
};
|
|
399
|
-
/** Provider 前的主模型 Prompt 容量判定;等于预算仍可提交,只有严格超出才拒绝。 */
|
|
400
|
-
declare function evaluatePrimaryPromptCapacity(snapshot: ContextUsageSnapshot): PrimaryPromptCapacityAdmission;
|
|
401
|
-
|
|
402
|
-
declare const PRIMARY_PROMPT_CAPACITY_ERROR_CODE: "llm.prompt.input_budget_exceeded";
|
|
403
|
-
interface PrimaryPromptCapacityErrorMetadata {
|
|
404
|
-
readonly modelId: string;
|
|
405
|
-
readonly budgetModelId?: string;
|
|
406
|
-
readonly usedTokens: number;
|
|
407
|
-
readonly inputBudgetTokens: number;
|
|
408
|
-
readonly exceededByTokens: number;
|
|
409
|
-
readonly source: TokenCountSource;
|
|
410
|
-
readonly confidence: TokenCountConfidence;
|
|
411
|
-
}
|
|
412
|
-
/** 主模型 Prompt 在 Provider admission 前已确认超出输入预算。 */
|
|
413
|
-
declare class PrimaryPromptCapacityError extends Error {
|
|
414
|
-
readonly errorCode: "llm.prompt.input_budget_exceeded";
|
|
415
|
-
readonly recoverable = false;
|
|
416
|
-
readonly metadata: PrimaryPromptCapacityErrorMetadata;
|
|
417
|
-
constructor(snapshot: ContextUsageSnapshot);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/** checkpoint 上一旦存在 contextUsage,就必须按公共合同严格 admission。 */
|
|
421
|
-
declare function readCheckpointContextUsage(local: EngineLocalState | Record<string, unknown> | undefined): {
|
|
422
|
-
source: "local-estimate" | "provider-preflight-count" | "provider-response-usage" | "host-supplied" | "test-fixture";
|
|
423
|
-
confidence: "estimate" | "provider-estimate" | "actual";
|
|
424
|
-
basis: "last_completed_llm_prompt";
|
|
425
|
-
budget_model_id: string;
|
|
426
|
-
used_tokens: number;
|
|
427
|
-
components: {
|
|
428
|
-
system_prompt_tokens: number;
|
|
429
|
-
conversation_tokens: number;
|
|
430
|
-
tool_definition_tokens: number;
|
|
431
|
-
};
|
|
432
|
-
component_attribution: "normalized_local_estimate";
|
|
433
|
-
input_budget_tokens: number;
|
|
434
|
-
remaining_tokens: number;
|
|
435
|
-
output_limit_tokens: number;
|
|
436
|
-
measured_at: number;
|
|
437
|
-
served_model_id?: string | undefined;
|
|
438
|
-
} | undefined;
|
|
439
|
-
|
|
440
|
-
/** 校验 Runtime error 已具备 lifecycle 结算所需的稳定分类字段。 */
|
|
441
|
-
declare function isRuntimeFailureFact(event: RoutedRuntimeEvent): event is RuntimeFailureFact;
|
|
442
|
-
|
|
443
|
-
declare const index$d_CheckpointListFilter: typeof CheckpointListFilter;
|
|
444
|
-
declare const index$d_CheckpointMeta: typeof CheckpointMeta;
|
|
445
|
-
declare const index$d_CheckpointSummary: typeof CheckpointSummary;
|
|
446
|
-
declare const index$d_Checkpointer: typeof Checkpointer;
|
|
447
|
-
declare const index$d_ENGINE_STATE_SCHEMA_VERSION: typeof ENGINE_STATE_SCHEMA_VERSION;
|
|
448
|
-
declare const index$d_EffectivePromptBudget: typeof EffectivePromptBudget;
|
|
449
|
-
declare const index$d_EngineState: typeof EngineState;
|
|
450
|
-
declare const index$d_EventRangeOptions: typeof EventRangeOptions;
|
|
451
|
-
declare const index$d_EventStore: typeof EventStore;
|
|
452
|
-
declare const index$d_ExecutorLlmInvocationKind: typeof ExecutorLlmInvocationKind;
|
|
453
|
-
declare const index$d_ExecutorLocalPatch: typeof ExecutorLocalPatch;
|
|
454
|
-
declare const index$d_ExecutorLocalState: typeof ExecutorLocalState;
|
|
455
|
-
type index$d_GraphAgentExecutor = GraphAgentExecutor;
|
|
456
|
-
declare const index$d_GraphAgentExecutor: typeof GraphAgentExecutor;
|
|
457
|
-
type index$d_GraphAgentExecutorDependencies = GraphAgentExecutorDependencies;
|
|
458
|
-
type index$d_GraphContextCompactionCandidate = GraphContextCompactionCandidate;
|
|
459
|
-
declare const index$d_GraphExecutor: typeof GraphExecutor;
|
|
460
|
-
type index$d_GraphExecutorContextApplyInput = GraphExecutorContextApplyInput;
|
|
461
|
-
type index$d_GraphExecutorContextApplyOutput = GraphExecutorContextApplyOutput;
|
|
462
|
-
type index$d_GraphExecutorContextBuildInput = GraphExecutorContextBuildInput;
|
|
463
|
-
type index$d_GraphExecutorContextBuildOutput = GraphExecutorContextBuildOutput;
|
|
464
|
-
type index$d_GraphExecutorContextBuilder = GraphExecutorContextBuilder;
|
|
465
|
-
type index$d_GraphExecutorOutputProcessor = GraphExecutorOutputProcessor;
|
|
466
|
-
declare const index$d_GraphNode: typeof GraphNode;
|
|
467
|
-
type index$d_HostToolCallBootstrap = HostToolCallBootstrap;
|
|
468
|
-
type index$d_HostToolCallBootstrapInput = HostToolCallBootstrapInput;
|
|
469
|
-
type index$d_HostToolCallBootstrapLocalPatch = HostToolCallBootstrapLocalPatch;
|
|
470
|
-
type index$d_LlmNode = LlmNode;
|
|
471
|
-
declare const index$d_LlmNode: typeof LlmNode;
|
|
472
|
-
type index$d_MemoryCheckpointer = MemoryCheckpointer;
|
|
473
|
-
declare const index$d_MemoryCheckpointer: typeof MemoryCheckpointer;
|
|
474
|
-
declare const index$d_MemoryEventStore: typeof MemoryEventStore;
|
|
475
|
-
declare const index$d_PRIMARY_PROMPT_CAPACITY_ERROR_CODE: typeof PRIMARY_PROMPT_CAPACITY_ERROR_CODE;
|
|
476
|
-
declare const index$d_PersistedEvent: typeof PersistedEvent;
|
|
477
|
-
type index$d_PrimaryPromptCapacityAdmission = PrimaryPromptCapacityAdmission;
|
|
478
|
-
type index$d_PrimaryPromptCapacityError = PrimaryPromptCapacityError;
|
|
479
|
-
declare const index$d_PrimaryPromptCapacityError: typeof PrimaryPromptCapacityError;
|
|
480
|
-
type index$d_PrimaryPromptCapacityErrorMetadata = PrimaryPromptCapacityErrorMetadata;
|
|
481
|
-
declare const index$d_ResolveEffectivePromptBudgetInput: typeof ResolveEffectivePromptBudgetInput;
|
|
482
|
-
declare const index$d_RuntimeEventCommitPort: typeof RuntimeEventCommitPort;
|
|
483
|
-
declare const index$d_RuntimeEventSink: typeof RuntimeEventSink;
|
|
484
|
-
declare const index$d_RuntimeFailureFact: typeof RuntimeFailureFact;
|
|
485
|
-
declare const index$d_RuntimeFailureFactSink: typeof RuntimeFailureFactSink;
|
|
486
|
-
declare const index$d_ToolBatchCompletionMode: typeof ToolBatchCompletionMode;
|
|
487
|
-
type index$d_ToolNode = ToolNode;
|
|
488
|
-
declare const index$d_ToolNode: typeof ToolNode;
|
|
489
|
-
type index$d_UserNode = UserNode;
|
|
490
|
-
declare const index$d_UserNode: typeof UserNode;
|
|
491
|
-
type index$d_WaitUserNode = WaitUserNode;
|
|
492
|
-
declare const index$d_WaitUserNode: typeof WaitUserNode;
|
|
493
|
-
declare const index$d_createHostToolCallBootstrap: typeof createHostToolCallBootstrap;
|
|
494
|
-
declare const index$d_createMonotonicEventStoreIdFactory: typeof createMonotonicEventStoreIdFactory;
|
|
495
|
-
declare const index$d_evaluatePrimaryPromptCapacity: typeof evaluatePrimaryPromptCapacity;
|
|
496
|
-
declare const index$d_isRuntimeFailureFact: typeof isRuntimeFailureFact;
|
|
497
|
-
declare const index$d_readCheckpointContextUsage: typeof readCheckpointContextUsage;
|
|
498
|
-
declare const index$d_requireEventStoreId: typeof requireEventStoreId;
|
|
499
|
-
declare const index$d_resolveEffectivePromptBudget: typeof resolveEffectivePromptBudget;
|
|
500
|
-
declare const index$d_summarizeCheckpoint: typeof summarizeCheckpoint;
|
|
501
|
-
declare namespace index$d {
|
|
502
|
-
export { index$d_CheckpointListFilter as CheckpointListFilter, index$d_CheckpointMeta as CheckpointMeta, index$d_CheckpointSummary as CheckpointSummary, index$d_Checkpointer as Checkpointer, index$d_ENGINE_STATE_SCHEMA_VERSION as ENGINE_STATE_SCHEMA_VERSION, index$d_EffectivePromptBudget as EffectivePromptBudget, index$d_EngineState as EngineState, index$d_EventRangeOptions as EventRangeOptions, index$d_EventStore as EventStore, index$d_ExecutorLlmInvocationKind as ExecutorLlmInvocationKind, index$d_ExecutorLocalPatch as ExecutorLocalPatch, index$d_ExecutorLocalState as ExecutorLocalState, index$d_GraphAgentExecutor as GraphAgentExecutor, type index$d_GraphAgentExecutorDependencies as GraphAgentExecutorDependencies, type index$d_GraphContextCompactionCandidate as GraphContextCompactionCandidate, index$d_GraphExecutor as GraphExecutor, type index$d_GraphExecutorContextApplyInput as GraphExecutorContextApplyInput, type index$d_GraphExecutorContextApplyOutput as GraphExecutorContextApplyOutput, type index$d_GraphExecutorContextBuildInput as GraphExecutorContextBuildInput, type index$d_GraphExecutorContextBuildOutput as GraphExecutorContextBuildOutput, type index$d_GraphExecutorContextBuilder as GraphExecutorContextBuilder, type index$d_GraphExecutorOutputProcessor as GraphExecutorOutputProcessor, index$d_GraphNode as GraphNode, type index$d_HostToolCallBootstrap as HostToolCallBootstrap, type index$d_HostToolCallBootstrapInput as HostToolCallBootstrapInput, type index$d_HostToolCallBootstrapLocalPatch as HostToolCallBootstrapLocalPatch, index$d_LlmNode as LlmNode, index$d_MemoryCheckpointer as MemoryCheckpointer, index$d_MemoryEventStore as MemoryEventStore, index$d_PRIMARY_PROMPT_CAPACITY_ERROR_CODE as PRIMARY_PROMPT_CAPACITY_ERROR_CODE, index$d_PersistedEvent as PersistedEvent, type index$d_PrimaryPromptCapacityAdmission as PrimaryPromptCapacityAdmission, index$d_PrimaryPromptCapacityError as PrimaryPromptCapacityError, type index$d_PrimaryPromptCapacityErrorMetadata as PrimaryPromptCapacityErrorMetadata, index$d_ResolveEffectivePromptBudgetInput as ResolveEffectivePromptBudgetInput, index$d_RuntimeEventCommitPort as RuntimeEventCommitPort, index$d_RuntimeEventSink as RuntimeEventSink, index$d_RuntimeFailureFact as RuntimeFailureFact, index$d_RuntimeFailureFactSink as RuntimeFailureFactSink, index$d_ToolBatchCompletionMode as ToolBatchCompletionMode, index$d_ToolNode as ToolNode, index$d_UserNode as UserNode, index$d_WaitUserNode as WaitUserNode, index$d_createHostToolCallBootstrap as createHostToolCallBootstrap, index$d_createMonotonicEventStoreIdFactory as createMonotonicEventStoreIdFactory, index$d_evaluatePrimaryPromptCapacity as evaluatePrimaryPromptCapacity, index$d_isRuntimeFailureFact as isRuntimeFailureFact, index$d_readCheckpointContextUsage as readCheckpointContextUsage, index$d_requireEventStoreId as requireEventStoreId, index$d_resolveEffectivePromptBudget as resolveEffectivePromptBudget, index$d_summarizeCheckpoint as summarizeCheckpoint };
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
type UnknownRecord = Record<string, unknown>;
|
|
506
|
-
type NormalizeToolArgsOptions = {
|
|
507
|
-
toolName?: string;
|
|
508
|
-
path?: string;
|
|
509
|
-
};
|
|
510
|
-
declare function normalizeToolArgs(schema: ToolParameterSchema, args: UnknownRecord, options?: NormalizeToolArgsOptions): UnknownRecord;
|
|
511
|
-
|
|
512
|
-
declare class ToolParameterSchemaError extends Error {
|
|
513
|
-
readonly schemaPath: string;
|
|
514
|
-
constructor(schemaPath: string, message: string);
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* 校验 Linnkit 正式工具 schema 子集。
|
|
518
|
-
*
|
|
519
|
-
* 中文备注:这里校验的是跨 Host/Provider 的公共合同,不替代工具 owner 对真实参数的业务校验。
|
|
520
|
-
* 先在工具注册阶段拒绝不可无损重建的 schema,避免 Provider 请求时再静默删关键字。
|
|
521
|
-
*/
|
|
522
|
-
declare function assertToolParameterSchema(schema: ToolParameterSchema, path?: string): void;
|
|
523
|
-
|
|
524
|
-
declare const index$c_AgentTool: typeof AgentTool;
|
|
525
|
-
declare const index$c_BaseTool: typeof BaseTool;
|
|
526
|
-
declare const index$c_CommonParameterTypes: typeof CommonParameterTypes;
|
|
527
|
-
declare const index$c_CompleteToolModelInputParams: typeof CompleteToolModelInputParams;
|
|
528
|
-
declare const index$c_FunctionToolSchema: typeof FunctionToolSchema;
|
|
529
|
-
declare const index$c_JsonSchemaValue: typeof JsonSchemaValue;
|
|
530
|
-
declare const index$c_ObservationPreviewContext: typeof ObservationPreviewContext;
|
|
531
|
-
declare const index$c_ObservationPreviewMeta: typeof ObservationPreviewMeta;
|
|
532
|
-
declare const index$c_ObservationPreviewPort: typeof ObservationPreviewPort;
|
|
533
|
-
declare const index$c_ObservationPreviewResult: typeof ObservationPreviewResult;
|
|
534
|
-
declare const index$c_ResolveToolModelInputParams: typeof ResolveToolModelInputParams;
|
|
535
|
-
declare const index$c_StructuredToolResult: typeof StructuredToolResult;
|
|
536
|
-
declare const index$c_ToolArgs: typeof ToolArgs;
|
|
537
|
-
declare const index$c_ToolCallResult: typeof ToolCallResult;
|
|
538
|
-
declare const index$c_ToolCallStreamingPolicy: typeof ToolCallStreamingPolicy;
|
|
539
|
-
declare const index$c_ToolCatalogPort: typeof ToolCatalogPort;
|
|
540
|
-
declare const index$c_ToolContextConversationView: typeof ToolContextConversationView;
|
|
541
|
-
declare const index$c_ToolContextPatch: typeof ToolContextPatch;
|
|
542
|
-
declare const index$c_ToolControlInfo: typeof ToolControlInfo;
|
|
543
|
-
declare const index$c_ToolExecutionContext: typeof ToolExecutionContext;
|
|
544
|
-
declare const index$c_ToolExecutionPort: typeof ToolExecutionPort;
|
|
545
|
-
declare const index$c_ToolExecutionResult: typeof ToolExecutionResult;
|
|
546
|
-
declare const index$c_ToolModelInputAdmission: typeof ToolModelInputAdmission;
|
|
547
|
-
declare const index$c_ToolModelInputAttachmentSelection: typeof ToolModelInputAttachmentSelection;
|
|
548
|
-
declare const index$c_ToolModelInputCapabilityValidatorPort: typeof ToolModelInputCapabilityValidatorPort;
|
|
549
|
-
declare const index$c_ToolModelInputDeclaration: typeof ToolModelInputDeclaration;
|
|
550
|
-
type index$c_ToolModelInputDeclarationValidation = ToolModelInputDeclarationValidation;
|
|
551
|
-
declare const index$c_ToolModelInputDelivery: typeof ToolModelInputDelivery;
|
|
552
|
-
declare const index$c_ToolModelInputResolutionError: typeof ToolModelInputResolutionError;
|
|
553
|
-
declare const index$c_ToolModelInputResolverPort: typeof ToolModelInputResolverPort;
|
|
554
|
-
declare const index$c_ToolObservationPreviewMeta: typeof ToolObservationPreviewMeta;
|
|
555
|
-
declare const index$c_ToolParameterProperty: typeof ToolParameterProperty;
|
|
556
|
-
declare const index$c_ToolParameterSchema: typeof ToolParameterSchema;
|
|
557
|
-
type index$c_ToolParameterSchemaError = ToolParameterSchemaError;
|
|
558
|
-
declare const index$c_ToolParameterSchemaError: typeof ToolParameterSchemaError;
|
|
559
|
-
declare const index$c_ToolParameterType: typeof ToolParameterType;
|
|
560
|
-
declare const index$c_ToolRegistryEntry: typeof ToolRegistryEntry;
|
|
561
|
-
declare const index$c_ToolResult: typeof ToolResult;
|
|
562
|
-
declare const index$c_ToolResultImageMedia: typeof ToolResultImageMedia;
|
|
563
|
-
declare const index$c_ToolRuntimeDefinition: typeof ToolRuntimeDefinition;
|
|
564
|
-
declare const index$c_ToolRuntimePort: typeof ToolRuntimePort;
|
|
565
|
-
declare const index$c_ToolSchemaBuildRequest: typeof ToolSchemaBuildRequest;
|
|
566
|
-
declare const index$c_UnifiedToolResult: typeof UnifiedToolResult;
|
|
567
|
-
declare const index$c_assertToolParameterSchema: typeof assertToolParameterSchema;
|
|
568
|
-
declare const index$c_computeToolIdempotencyKey: typeof computeToolIdempotencyKey;
|
|
569
|
-
declare const index$c_copyToolContextRuntimeCapability: typeof copyToolContextRuntimeCapability;
|
|
570
|
-
declare const index$c_ensureToolContextRuntimeCapability: typeof ensureToolContextRuntimeCapability;
|
|
571
|
-
declare const index$c_findCachedToolOutputByIdempotencyKey: typeof findCachedToolOutputByIdempotencyKey;
|
|
572
|
-
declare const index$c_getToolContextRuntimeBinding: typeof getToolContextRuntimeBinding;
|
|
573
|
-
declare const index$c_normalizeToolArgs: typeof normalizeToolArgs;
|
|
574
|
-
declare const index$c_parseToolModelInputDeclaration: typeof parseToolModelInputDeclaration;
|
|
575
|
-
declare const index$c_readToolContextPersistedHistory: typeof readToolContextPersistedHistory;
|
|
576
|
-
declare const index$c_readToolContextWorkingHistory: typeof readToolContextWorkingHistory;
|
|
577
|
-
declare const index$c_resolveToolModelInput: typeof resolveToolModelInput;
|
|
578
|
-
declare const index$c_stripRuntimeReservedToolContextPatch: typeof stripRuntimeReservedToolContextPatch;
|
|
579
|
-
declare namespace index$c {
|
|
580
|
-
export { index$c_AgentTool as AgentTool, index$c_BaseTool as BaseTool, index$c_CommonParameterTypes as CommonParameterTypes, index$c_CompleteToolModelInputParams as CompleteToolModelInputParams, index$c_FunctionToolSchema as FunctionToolSchema, index$c_JsonSchemaValue as JsonSchemaValue, index$c_ObservationPreviewContext as ObservationPreviewContext, index$c_ObservationPreviewMeta as ObservationPreviewMeta, index$c_ObservationPreviewPort as ObservationPreviewPort, index$c_ObservationPreviewResult as ObservationPreviewResult, index$c_ResolveToolModelInputParams as ResolveToolModelInputParams, index$c_StructuredToolResult as StructuredToolResult, index$c_ToolArgs as ToolArgs, index$c_ToolCallResult as ToolCallResult, index$c_ToolCallStreamingPolicy as ToolCallStreamingPolicy, index$c_ToolCatalogPort as ToolCatalogPort, index$c_ToolContextConversationView as ToolContextConversationView, index$c_ToolContextPatch as ToolContextPatch, index$c_ToolControlInfo as ToolControlInfo, index$c_ToolExecutionContext as ToolExecutionContext, index$c_ToolExecutionPort as ToolExecutionPort, index$c_ToolExecutionResult as ToolExecutionResult, index$c_ToolModelInputAdmission as ToolModelInputAdmission, index$c_ToolModelInputAttachmentSelection as ToolModelInputAttachmentSelection, index$c_ToolModelInputCapabilityValidatorPort as ToolModelInputCapabilityValidatorPort, index$c_ToolModelInputDeclaration as ToolModelInputDeclaration, type index$c_ToolModelInputDeclarationValidation as ToolModelInputDeclarationValidation, index$c_ToolModelInputDelivery as ToolModelInputDelivery, index$c_ToolModelInputResolutionError as ToolModelInputResolutionError, index$c_ToolModelInputResolverPort as ToolModelInputResolverPort, index$c_ToolObservationPreviewMeta as ToolObservationPreviewMeta, index$c_ToolParameterProperty as ToolParameterProperty, index$c_ToolParameterSchema as ToolParameterSchema, index$c_ToolParameterSchemaError as ToolParameterSchemaError, index$c_ToolParameterType as ToolParameterType, index$c_ToolRegistryEntry as ToolRegistryEntry, index$c_ToolResult as ToolResult, index$c_ToolResultImageMedia as ToolResultImageMedia, index$c_ToolRuntimeDefinition as ToolRuntimeDefinition, index$c_ToolRuntimePort as ToolRuntimePort, index$c_ToolSchemaBuildRequest as ToolSchemaBuildRequest, index$c_UnifiedToolResult as UnifiedToolResult, index$c_assertToolParameterSchema as assertToolParameterSchema, index$c_computeToolIdempotencyKey as computeToolIdempotencyKey, index$c_copyToolContextRuntimeCapability as copyToolContextRuntimeCapability, index$c_ensureToolContextRuntimeCapability as ensureToolContextRuntimeCapability, index$c_findCachedToolOutputByIdempotencyKey as findCachedToolOutputByIdempotencyKey, index$c_getToolContextRuntimeBinding as getToolContextRuntimeBinding, index$c_normalizeToolArgs as normalizeToolArgs, index$c_parseToolModelInputDeclaration as parseToolModelInputDeclaration, index$c_readToolContextPersistedHistory as readToolContextPersistedHistory, index$c_readToolContextWorkingHistory as readToolContextWorkingHistory, index$c_resolveToolModelInput as resolveToolModelInput, index$c_stripRuntimeReservedToolContextPatch as stripRuntimeReservedToolContextPatch };
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* @file src/agent/runtime-kernel/execution/sequencer.ts
|
|
585
|
-
* @description 事件序列器 - 为事件分配序号和执行上下文
|
|
586
|
-
*
|
|
587
|
-
* 功能 (What):
|
|
588
|
-
* - 为每个执行流程生成唯一的 execution_id
|
|
589
|
-
* - 为事件分配单调递增的序号 (seq)
|
|
590
|
-
* - 将 RuntimeEvent 包装为 EventEnvelope,提供追踪和渲染元数据
|
|
591
|
-
*
|
|
592
|
-
* 输入 (Input):
|
|
593
|
-
* - RuntimeEvent 或原始事件数据
|
|
594
|
-
* - source 信息(事件来源)
|
|
595
|
-
*
|
|
596
|
-
* 输出 (Output):
|
|
597
|
-
* - EventEnvelope 包装的事件
|
|
598
|
-
*
|
|
599
|
-
* 副作用 (Side-effects):
|
|
600
|
-
* - 维护内存中的序号状态
|
|
601
|
-
*/
|
|
602
|
-
|
|
603
|
-
/**
|
|
604
|
-
* 事件序列器类
|
|
605
|
-
*
|
|
606
|
-
* 职责:
|
|
607
|
-
* - 管理执行上下文(execution_id, trace_id)
|
|
608
|
-
* - 为事件分配严格递增的序号
|
|
609
|
-
* - 提供事件包装功能
|
|
610
|
-
*/
|
|
611
|
-
declare class EventSequencer {
|
|
612
|
-
private readonly executionId;
|
|
613
|
-
private readonly traceId;
|
|
614
|
-
private currentSeq;
|
|
615
|
-
constructor(conversationId: string, traceId?: string);
|
|
616
|
-
/**
|
|
617
|
-
* 获取执行上下文
|
|
618
|
-
*/
|
|
619
|
-
getExecutionContext(): ExecutionTraceContext;
|
|
620
|
-
/**
|
|
621
|
-
* 获取下一个序号
|
|
622
|
-
* 这个方法是线程安全的,因为 Node.js 是单线程的
|
|
623
|
-
*/
|
|
624
|
-
private getNextSeq;
|
|
625
|
-
/**
|
|
626
|
-
* 将 RuntimeEvent 包装为 EventEnvelope
|
|
627
|
-
*
|
|
628
|
-
* @param runtimeEvent - 需要包装的运行时事件
|
|
629
|
-
* @param source - 事件来源标识
|
|
630
|
-
* @param renderHint - 可选的渲染建议
|
|
631
|
-
* @param runLocation - 可选的执行位置
|
|
632
|
-
* @returns 包装后的事件信封
|
|
633
|
-
*/
|
|
634
|
-
wrapEvent<TEvent extends RuntimeEvent>(runtimeEvent: TEvent, source: string, options?: {
|
|
635
|
-
renderHint?: EventEnvelope<RuntimeEvent>['render_hint'];
|
|
636
|
-
runLocation?: EventEnvelope<RuntimeEvent>['run_location'];
|
|
637
|
-
}): EventEnvelope<TEvent>;
|
|
638
|
-
/**
|
|
639
|
-
* 获取当前序号(调试用)
|
|
640
|
-
*/
|
|
641
|
-
getCurrentSeq(): number;
|
|
642
|
-
/**
|
|
643
|
-
* 获取执行ID(调试用)
|
|
644
|
-
*/
|
|
645
|
-
getExecutionId(): string;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
|
-
interface PublishRuntimeEventOptions {
|
|
649
|
-
renderHint?: EventEnvelope<RuntimeEvent>['render_hint'];
|
|
650
|
-
runLocation?: EventEnvelope<RuntimeEvent>['run_location'];
|
|
651
|
-
/** 已由 Host 提交的 incoming fact 需要 fan-out,但不属于本次 agent 生成结果。 */
|
|
652
|
-
recordInGeneratedJournal?: boolean;
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* 单次 execution 的 RuntimeEvent 唯一发布入口。
|
|
656
|
-
*
|
|
657
|
-
* 节点拥有事实内容;publisher 只附着 host 已确定的 run 路由身份、生成 envelope 并 fan-out。
|
|
658
|
-
*/
|
|
659
|
-
declare class RuntimeEventPublisher {
|
|
660
|
-
private readonly eventBus;
|
|
661
|
-
private readonly sequencer;
|
|
662
|
-
private readonly identity;
|
|
663
|
-
private readonly generatedEvents;
|
|
664
|
-
constructor(eventBus: EventBus, sequencer: EventSequencer, identity: RuntimeEventRoutingIdentity);
|
|
665
|
-
publish(event: RuntimeEvent, source: string, options?: PublishRuntimeEventOptions): RoutedRuntimeEvent;
|
|
666
|
-
/** 在 durable commit 前为 incoming fact 附着与后续发布完全一致的正式路由身份。 */
|
|
667
|
-
route(event: RuntimeEvent): RoutedRuntimeEvent;
|
|
668
|
-
/** 发布已经持久化的正式事实;身份不一致时拒绝静默改写 durable 语义。 */
|
|
669
|
-
publishRouted(routedEvent: RoutedRuntimeEvent, source: string, options?: PublishRuntimeEventOptions): RoutedRuntimeEvent;
|
|
670
|
-
getGeneratedEvents(): RoutedRuntimeEvent[];
|
|
671
|
-
/** Publisher 再次锁定跨字段身份关系,防止非 schema 调用路径构造非法事实。 */
|
|
672
|
-
private assertAdmissionIdentity;
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
interface EventBusEventPersistenceOptions {
|
|
676
|
-
eventBus: EventBus;
|
|
677
|
-
eventStore: EventStore;
|
|
678
|
-
nextEventStoreId: () => string;
|
|
679
|
-
}
|
|
680
|
-
/**
|
|
681
|
-
* EventBus durable consumer:按发布顺序串行写入事实,并在 run 进入终态前传播首个失败。
|
|
682
|
-
* root、child 与 standalone runtime 共用这一实现,宿主不再各自维护 persistence queue。
|
|
683
|
-
*/
|
|
684
|
-
declare class EventBusEventPersistence {
|
|
685
|
-
private readonly options;
|
|
686
|
-
private readonly scheduledEventIds;
|
|
687
|
-
private writeTail;
|
|
688
|
-
private firstWriteError;
|
|
689
|
-
private connected;
|
|
690
|
-
constructor(options: EventBusEventPersistenceOptions);
|
|
691
|
-
connect(): void;
|
|
692
|
-
drain(): Promise<void>;
|
|
693
|
-
/**
|
|
694
|
-
* 在 EventBus fan-out 前提交一条 durable fact。
|
|
695
|
-
*
|
|
696
|
-
* 中文备注:自动上下文压缩会立即使用 `history_summary`
|
|
697
|
-
* 重建后续 Prompt,因此必须先确认事实已落盘,再让 realtime 和其它
|
|
698
|
-
* observer 看到它。这仍复用同一条写队列,并用事件 ID 防止随后的
|
|
699
|
-
* EventBus publish 重复落库。
|
|
700
|
-
*/
|
|
701
|
-
commitBeforePublish(event: RoutedRuntimeEvent): Promise<void>;
|
|
702
|
-
/** 已由 Host admission transaction 提交的 incoming fact 不得再次落盘。 */
|
|
703
|
-
acknowledgePersisted(events: readonly RuntimeEvent[]): void;
|
|
704
|
-
private readonly onEvent;
|
|
705
|
-
private scheduleWrite;
|
|
706
|
-
private readonly disconnect;
|
|
707
|
-
}
|
|
708
|
-
|
|
709
|
-
interface CreateRuntimeErrorEventInput {
|
|
710
|
-
/** 由事实 owner 在调用本工厂前创建的稳定 Runtime event ID。 */
|
|
711
|
-
id: string;
|
|
712
|
-
conversationId: string;
|
|
713
|
-
turnId: string;
|
|
714
|
-
error: unknown;
|
|
715
|
-
/**
|
|
716
|
-
* 事件来源,用于排查(不会直接展示给用户)。
|
|
717
|
-
*/
|
|
718
|
-
source?: string;
|
|
719
|
-
/**
|
|
720
|
-
* 可选:覆盖 error_code,用于保留业务错误的稳定分类。
|
|
721
|
-
*/
|
|
722
|
-
errorCode?: string;
|
|
723
|
-
/**
|
|
724
|
-
* 可选:覆盖 retryable。
|
|
725
|
-
*/
|
|
726
|
-
retryable?: boolean;
|
|
727
|
-
/**
|
|
728
|
-
* 可选:覆盖 error 文本(默认使用原始 error.message)。
|
|
729
|
-
* 注意:这不是“用户友好化文案”,只是允许在系统级错误里加上更明确的上下文前缀。
|
|
730
|
-
*/
|
|
731
|
-
errorText?: string;
|
|
732
|
-
/**
|
|
733
|
-
* 可选:合并到 details 的附加字段(便于调用方补充上下文信息)。
|
|
734
|
-
*/
|
|
735
|
-
detailsPatch?: Record<string, unknown>;
|
|
736
|
-
}
|
|
737
|
-
type ClassifiedRuntimeErrorEvent = ErrorEvent & {
|
|
738
|
-
error_code: string;
|
|
739
|
-
retryable: boolean;
|
|
740
|
-
};
|
|
741
|
-
/**
|
|
742
|
-
* 统一创建 RuntimeEvent(type='error')。
|
|
743
|
-
*
|
|
744
|
-
* 中文备注:
|
|
745
|
-
* - `error` 字段保留原始 message(前端负责友好化);
|
|
746
|
-
* - `error_code` 尽量稳定:优先上游结构化 type,否则 fallback 到分类结果;
|
|
747
|
-
* - `retryable` 与 `details.classification` 使用同一份 classifier 输出,避免重复判断。
|
|
748
|
-
*/
|
|
749
|
-
declare function createRuntimeErrorEvent(input: CreateRuntimeErrorEventInput): ClassifiedRuntimeErrorEvent;
|
|
750
|
-
|
|
751
|
-
type index$b_ClassifiedRuntimeErrorEvent = ClassifiedRuntimeErrorEvent;
|
|
752
|
-
declare const index$b_EventBus: typeof EventBus;
|
|
753
|
-
type index$b_EventBusEventPersistence = EventBusEventPersistence;
|
|
754
|
-
declare const index$b_EventBusEventPersistence: typeof EventBusEventPersistence;
|
|
755
|
-
type index$b_EventBusEventPersistenceOptions = EventBusEventPersistenceOptions;
|
|
756
|
-
type index$b_EventSequencer = EventSequencer;
|
|
757
|
-
declare const index$b_EventSequencer: typeof EventSequencer;
|
|
758
|
-
type index$b_PublishRuntimeEventOptions = PublishRuntimeEventOptions;
|
|
759
|
-
type index$b_RuntimeEventPublisher = RuntimeEventPublisher;
|
|
760
|
-
declare const index$b_RuntimeEventPublisher: typeof RuntimeEventPublisher;
|
|
761
|
-
declare const index$b_createRuntimeErrorEvent: typeof createRuntimeErrorEvent;
|
|
762
|
-
declare namespace index$b {
|
|
763
|
-
export { type index$b_ClassifiedRuntimeErrorEvent as ClassifiedRuntimeErrorEvent, index$b_EventBus as EventBus, index$b_EventBusEventPersistence as EventBusEventPersistence, type index$b_EventBusEventPersistenceOptions as EventBusEventPersistenceOptions, index$b_EventSequencer as EventSequencer, type index$b_PublishRuntimeEventOptions as PublishRuntimeEventOptions, index$b_RuntimeEventPublisher as RuntimeEventPublisher, index$b_createRuntimeErrorEvent as createRuntimeErrorEvent };
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* @file src/agent/runtime-kernel/run-context/types.ts
|
|
768
|
-
* @description 统一运行上下文定义
|
|
769
|
-
*
|
|
770
|
-
* 核心目标:
|
|
771
|
-
* - 统一管理跨 Run(Graph执行)的链路追踪信息
|
|
772
|
-
* - 支持父子任务(SubAgent)与审阅等长程业务的上下文贯穿
|
|
773
|
-
* - 替代散落在各处的 review_run_id 等专用字段
|
|
774
|
-
*/
|
|
775
|
-
interface RunContext {
|
|
776
|
-
/**
|
|
777
|
-
* 当前 Run 的唯一标识(对应一次 Graph 执行 / 一次 conversation turn)
|
|
778
|
-
* - 通常对应 `turnId` 或 `messageId`
|
|
779
|
-
*/
|
|
780
|
-
runId: RunId;
|
|
781
|
-
/**
|
|
782
|
-
* 链路追踪 ID(贯穿业务全流程)
|
|
783
|
-
* - Review场景:对应 review_run_id(一次审阅包含多次 AI 调用)
|
|
784
|
-
* - 简单对话场景:可与 conversationId 或 runId 相同
|
|
785
|
-
*/
|
|
786
|
-
traceId: string;
|
|
787
|
-
/**
|
|
788
|
-
* 父级 Run ID(用于子 Agent / 嵌套图)
|
|
789
|
-
* - 如果是顶层任务,则为 undefined
|
|
790
|
-
*/
|
|
791
|
-
parentId?: RunId;
|
|
792
|
-
/**
|
|
793
|
-
* 根 Run ID(业务发起的原点)
|
|
794
|
-
*/
|
|
795
|
-
rootRunId?: RunId;
|
|
796
|
-
/**
|
|
797
|
-
* 业务标签/元数据(业务特定的上下文挂载点)
|
|
798
|
-
* - 例如:{ agentId: 'logicCheck', chunkIndex: 0 }
|
|
799
|
-
* - 替代原先散落在 ToolContext 顶层的 loose fields
|
|
800
|
-
*/
|
|
801
|
-
tags: Record<string, string | number | boolean | undefined>;
|
|
802
|
-
}
|
|
803
|
-
/** 由 run admission 使用已确定的身份创建执行上下文。 */
|
|
804
|
-
declare function createRunContext(input: Pick<RunContext, 'runId' | 'traceId'> & Partial<Omit<RunContext, 'runId' | 'traceId'>>): RunContext;
|
|
805
|
-
|
|
806
|
-
type index$a_RunContext = RunContext;
|
|
807
|
-
declare const index$a_createRunContext: typeof createRunContext;
|
|
808
|
-
declare namespace index$a {
|
|
809
|
-
export { type index$a_RunContext as RunContext, index$a_createRunContext as createRunContext };
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
type CanonicalInferenceTerminal = {
|
|
813
|
-
readonly type: 'finish';
|
|
814
|
-
readonly reason: CanonicalInferenceFinishReason;
|
|
815
|
-
} | {
|
|
816
|
-
readonly type: 'failure';
|
|
817
|
-
readonly kind: CanonicalInferenceFailureKind;
|
|
818
|
-
readonly code: string;
|
|
819
|
-
readonly retryable: boolean;
|
|
820
|
-
};
|
|
821
|
-
interface OpenCanonicalToolCall {
|
|
822
|
-
readonly index: number;
|
|
823
|
-
readonly part_index: number;
|
|
824
|
-
readonly id?: string;
|
|
825
|
-
readonly name?: string;
|
|
826
|
-
}
|
|
827
|
-
interface CanonicalInferenceStreamState {
|
|
828
|
-
readonly phase: 'idle' | 'streaming' | 'terminal';
|
|
829
|
-
readonly open_tool_calls: readonly OpenCanonicalToolCall[];
|
|
830
|
-
readonly usage_seen: boolean;
|
|
831
|
-
readonly assistant_part_indices: readonly number[];
|
|
832
|
-
readonly terminal?: CanonicalInferenceTerminal;
|
|
833
|
-
}
|
|
834
|
-
declare const INITIAL_CANONICAL_INFERENCE_STREAM_STATE: CanonicalInferenceStreamState;
|
|
835
|
-
|
|
836
|
-
declare function advanceCanonicalInferenceStreamState(state: CanonicalInferenceStreamState, event: CanonicalInferenceEvent): CanonicalInferenceStreamState;
|
|
837
|
-
|
|
838
|
-
declare function consumeCanonicalInferenceStream(events: AsyncIterable<CanonicalInferenceEvent>, onEvent: (event: CanonicalInferenceEvent) => void): Promise<CanonicalInferenceTerminal>;
|
|
839
|
-
|
|
840
|
-
interface DefaultTokenizerPortConfig {
|
|
841
|
-
/** Host 显式选择的 tiktoken encoding 名;未提供时使用字符/token 粗估。 */
|
|
842
|
-
encoding?: string;
|
|
843
|
-
/** tiktoken 不可用或不指定 encoding 时的字符/token 兜底比。 */
|
|
844
|
-
avgCharsPerToken?: number;
|
|
845
|
-
/** 单个 tool_call 的额外 token 开销估算。 */
|
|
846
|
-
toolCallOverhead?: number;
|
|
847
|
-
}
|
|
848
|
-
/**
|
|
849
|
-
* linnkit 默认 tokenizer。
|
|
850
|
-
*
|
|
851
|
-
* 中文备注:
|
|
852
|
-
* - 这是 TokenCalculator 的薄包装,保持 0.7.x 默认行为;
|
|
853
|
-
* - host 不注入 TokenizerPort 时,context-manager 自动使用该实现;
|
|
854
|
-
* - 只用于上下文 budget 估算,不用于计费。
|
|
855
|
-
*/
|
|
856
|
-
declare class DefaultTokenizerPort implements TokenizerPort {
|
|
857
|
-
private readonly config;
|
|
858
|
-
constructor(config?: DefaultTokenizerPortConfig);
|
|
859
|
-
estimateText(text: string, _modelId?: string): number;
|
|
860
|
-
estimateMessage(message: LlmRequestMessage, _modelId?: string): number;
|
|
861
|
-
}
|
|
862
|
-
declare function createDefaultTokenizerPort(config?: DefaultTokenizerPortConfig): TokenizerPort;
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* @file src/agent/runtime-kernel/llm/policies/policyEngine.ts
|
|
866
|
-
*
|
|
867
|
-
* @description
|
|
868
|
-
* 失败后的 LLM 路由建议引擎:按 match 条件筛选 policies,再依次询问 onError。
|
|
869
|
-
* 它不能观察或改写 Provider request/response wire 数据。
|
|
870
|
-
*/
|
|
871
|
-
|
|
872
|
-
declare class LLMPolicyEngine {
|
|
873
|
-
private readonly policies;
|
|
874
|
-
constructor(policies: LLMPolicy[]);
|
|
875
|
-
private matched;
|
|
876
|
-
decideOnError(error: Error, ctx: LLMPolicyMatchContext): LLMPolicyErrorDecision;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* @file src/agent/runtime-kernel/llm/policies/defaultPolicyEngine.ts
|
|
881
|
-
*
|
|
882
|
-
* @description
|
|
883
|
-
* Linnkit 的默认 PolicyEngine 不注册任何失败路由策略。
|
|
884
|
-
*
|
|
885
|
-
* Host 可以复用 `LLMPolicyEngine` 并显式注入自己的路由 policies;
|
|
886
|
-
* Provider wire 适配仍必须通过 canonical inference port 注入。
|
|
887
|
-
*/
|
|
888
|
-
|
|
889
|
-
declare const defaultPolicyEngine: LLMPolicyEngine;
|
|
890
|
-
|
|
891
|
-
declare const LLM_IMAGE_INPUT_ERROR_CODES: {
|
|
892
|
-
readonly ATTACHMENT_UNAVAILABLE: "llm.image_input.attachment_unavailable";
|
|
893
|
-
readonly ATTACHMENT_INTEGRITY_FAILED: "llm.image_input.attachment_integrity_failed";
|
|
894
|
-
readonly ROUTE_LIMIT_EXCEEDED: "llm.image_input.route_limit_exceeded";
|
|
895
|
-
readonly MAPPING_UNSUPPORTED: "llm.image_input.mapping_unsupported";
|
|
896
|
-
readonly CONTEXT_BUDGET_EXCEEDED: "llm.image_input.context_budget_exceeded";
|
|
897
|
-
};
|
|
898
|
-
type LlmImageInputErrorCode = typeof LLM_IMAGE_INPUT_ERROR_CODES[keyof typeof LLM_IMAGE_INPUT_ERROR_CODES];
|
|
899
|
-
type LlmImageInputLimitKind = 'image_count' | 'single_image_bytes' | 'total_image_bytes' | 'context_tokens';
|
|
900
|
-
interface LlmImageInputErrorMetadata {
|
|
901
|
-
readonly active_model_id: string;
|
|
902
|
-
readonly placement?: LlmImageInputPlacement;
|
|
903
|
-
readonly message_id?: string;
|
|
904
|
-
readonly attachment_id?: string;
|
|
905
|
-
readonly resource_id?: string;
|
|
906
|
-
readonly message_index?: number;
|
|
907
|
-
readonly attachment_index?: number;
|
|
908
|
-
readonly profile_id?: string;
|
|
909
|
-
readonly limit_kind?: LlmImageInputLimitKind;
|
|
910
|
-
readonly actual_value?: number;
|
|
911
|
-
readonly limit_value?: number;
|
|
912
|
-
}
|
|
913
|
-
/** context build 与 provider preflight 共用的结构化图片输入错误。 */
|
|
914
|
-
declare class LlmImageInputError extends Error {
|
|
915
|
-
readonly errorCode: LlmImageInputErrorCode;
|
|
916
|
-
readonly recoverable = false;
|
|
917
|
-
readonly metadata: Readonly<LlmImageInputErrorMetadata>;
|
|
918
|
-
constructor(errorCode: LlmImageInputErrorCode, message: string, metadata: LlmImageInputErrorMetadata);
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
declare const index$9_AdapterInputSupport: typeof AdapterInputSupport;
|
|
922
|
-
type index$9_CanonicalInferenceStreamState = CanonicalInferenceStreamState;
|
|
923
|
-
type index$9_CanonicalInferenceTerminal = CanonicalInferenceTerminal;
|
|
924
|
-
type index$9_DefaultTokenizerPort = DefaultTokenizerPort;
|
|
925
|
-
declare const index$9_DefaultTokenizerPort: typeof DefaultTokenizerPort;
|
|
926
|
-
type index$9_DefaultTokenizerPortConfig = DefaultTokenizerPortConfig;
|
|
927
|
-
declare const index$9_EMPTY_MODEL_INPUT_REQUIREMENT: typeof EMPTY_MODEL_INPUT_REQUIREMENT;
|
|
928
|
-
declare const index$9_INITIAL_CANONICAL_INFERENCE_STREAM_STATE: typeof INITIAL_CANONICAL_INFERENCE_STREAM_STATE;
|
|
929
|
-
declare const index$9_LLMPolicy: typeof LLMPolicy;
|
|
930
|
-
type index$9_LLMPolicyEngine = LLMPolicyEngine;
|
|
931
|
-
declare const index$9_LLMPolicyEngine: typeof LLMPolicyEngine;
|
|
932
|
-
declare const index$9_LLMPolicyErrorDecision: typeof LLMPolicyErrorDecision;
|
|
933
|
-
declare const index$9_LLMPolicyMatchContext: typeof LLMPolicyMatchContext;
|
|
934
|
-
declare const index$9_LLM_IMAGE_INPUT_ERROR_CODES: typeof LLM_IMAGE_INPUT_ERROR_CODES;
|
|
935
|
-
declare const index$9_LLM_MODEL_ELIGIBILITY_ERROR_CODE: typeof LLM_MODEL_ELIGIBILITY_ERROR_CODE;
|
|
936
|
-
declare const index$9_LlmCallInvocationContext: typeof LlmCallInvocationContext;
|
|
937
|
-
declare const index$9_LlmCallOptions: typeof LlmCallOptions;
|
|
938
|
-
declare const index$9_LlmCaller: typeof LlmCaller;
|
|
939
|
-
declare const index$9_LlmFallbackObserver: typeof LlmFallbackObserver;
|
|
940
|
-
type index$9_LlmImageInputError = LlmImageInputError;
|
|
941
|
-
declare const index$9_LlmImageInputError: typeof LlmImageInputError;
|
|
942
|
-
type index$9_LlmImageInputErrorCode = LlmImageInputErrorCode;
|
|
943
|
-
type index$9_LlmImageInputErrorMetadata = LlmImageInputErrorMetadata;
|
|
944
|
-
type index$9_LlmImageInputLimitKind = LlmImageInputLimitKind;
|
|
945
|
-
type index$9_LlmModelEligibilityError = LlmModelEligibilityError;
|
|
946
|
-
declare const index$9_LlmModelEligibilityError: typeof LlmModelEligibilityError;
|
|
947
|
-
declare const index$9_LlmRequestMessage: typeof LlmRequestMessage;
|
|
948
|
-
declare const index$9_LlmRetryConfig: typeof LlmRetryConfig;
|
|
949
|
-
declare const index$9_MODEL_INPUT_ERROR_CODES: typeof MODEL_INPUT_ERROR_CODES;
|
|
950
|
-
declare const index$9_MODEL_INPUT_PLACEMENTS: typeof MODEL_INPUT_PLACEMENTS;
|
|
951
|
-
declare const index$9_ModelCatalogEntry: typeof ModelCatalogEntry;
|
|
952
|
-
declare const index$9_ModelCatalogLike: typeof ModelCatalogLike;
|
|
953
|
-
declare const index$9_ModelFallbackAppliedInfo: typeof ModelFallbackAppliedInfo;
|
|
954
|
-
declare const index$9_ModelFallbackPolicy: typeof ModelFallbackPolicy;
|
|
955
|
-
declare const index$9_ModelFallbackRejectedInfo: typeof ModelFallbackRejectedInfo;
|
|
956
|
-
type index$9_ModelInputCapabilityError = ModelInputCapabilityError;
|
|
957
|
-
declare const index$9_ModelInputCapabilityError: typeof ModelInputCapabilityError;
|
|
958
|
-
declare const index$9_ModelInputCompatibility: typeof ModelInputCompatibility;
|
|
959
|
-
type index$9_ModelInputErrorCode = ModelInputErrorCode;
|
|
960
|
-
type index$9_ModelInputErrorMetadata = ModelInputErrorMetadata;
|
|
961
|
-
declare const index$9_ModelInputIncompatibilityReason: typeof ModelInputIncompatibilityReason;
|
|
962
|
-
declare const index$9_ModelInputPlacement: typeof ModelInputPlacement;
|
|
963
|
-
declare const index$9_ModelInputRequirement: typeof ModelInputRequirement;
|
|
964
|
-
declare const index$9_ModelReasoningConfig: typeof ModelReasoningConfig;
|
|
965
|
-
declare const index$9_ModelResolver: typeof ModelResolver;
|
|
966
|
-
declare const index$9_ProviderContinuation: typeof ProviderContinuation;
|
|
967
|
-
declare const index$9_REASONING_EFFORTS: typeof REASONING_EFFORTS;
|
|
968
|
-
declare const index$9_ReasoningEffort: typeof ReasoningEffort;
|
|
969
|
-
declare const index$9_ToolCall: typeof ToolCall;
|
|
970
|
-
declare const index$9_advanceCanonicalInferenceStreamState: typeof advanceCanonicalInferenceStreamState;
|
|
971
|
-
declare const index$9_assertModelInputCompatibility: typeof assertModelInputCompatibility;
|
|
972
|
-
declare const index$9_consumeCanonicalInferenceStream: typeof consumeCanonicalInferenceStream;
|
|
973
|
-
declare const index$9_createDefaultTokenizerPort: typeof createDefaultTokenizerPort;
|
|
974
|
-
declare const index$9_createFixedChatModelCatalog: typeof createFixedChatModelCatalog;
|
|
975
|
-
declare const index$9_createModelInputCompatibilityError: typeof createModelInputCompatibilityError;
|
|
976
|
-
declare const index$9_defaultPolicyEngine: typeof defaultPolicyEngine;
|
|
977
|
-
declare const index$9_deriveModelInputRequirement: typeof deriveModelInputRequirement;
|
|
978
|
-
declare const index$9_evaluateModelInputCompatibility: typeof evaluateModelInputCompatibility;
|
|
979
|
-
declare const index$9_isValidReasoningEffort: typeof isValidReasoningEffort;
|
|
980
|
-
declare const index$9_listCompatibleModelIds: typeof listCompatibleModelIds;
|
|
981
|
-
declare const index$9_resolveEffectiveEffort: typeof resolveEffectiveEffort;
|
|
982
|
-
declare namespace index$9 {
|
|
983
|
-
export { index$9_AdapterInputSupport as AdapterInputSupport, type index$9_CanonicalInferenceStreamState as CanonicalInferenceStreamState, type index$9_CanonicalInferenceTerminal as CanonicalInferenceTerminal, index$9_DefaultTokenizerPort as DefaultTokenizerPort, type index$9_DefaultTokenizerPortConfig as DefaultTokenizerPortConfig, index$9_EMPTY_MODEL_INPUT_REQUIREMENT as EMPTY_MODEL_INPUT_REQUIREMENT, index$9_INITIAL_CANONICAL_INFERENCE_STREAM_STATE as INITIAL_CANONICAL_INFERENCE_STREAM_STATE, index$9_LLMPolicy as LLMPolicy, index$9_LLMPolicyEngine as LLMPolicyEngine, index$9_LLMPolicyErrorDecision as LLMPolicyErrorDecision, index$9_LLMPolicyMatchContext as LLMPolicyMatchContext, index$9_LLM_IMAGE_INPUT_ERROR_CODES as LLM_IMAGE_INPUT_ERROR_CODES, index$9_LLM_MODEL_ELIGIBILITY_ERROR_CODE as LLM_MODEL_ELIGIBILITY_ERROR_CODE, index$9_LlmCallInvocationContext as LlmCallInvocationContext, index$9_LlmCallOptions as LlmCallOptions, index$9_LlmCaller as LlmCaller, index$9_LlmFallbackObserver as LlmFallbackObserver, index$9_LlmImageInputError as LlmImageInputError, type index$9_LlmImageInputErrorCode as LlmImageInputErrorCode, type index$9_LlmImageInputErrorMetadata as LlmImageInputErrorMetadata, type index$9_LlmImageInputLimitKind as LlmImageInputLimitKind, index$9_LlmModelEligibilityError as LlmModelEligibilityError, index$9_LlmRequestMessage as LlmRequestMessage, index$9_LlmRetryConfig as LlmRetryConfig, index$9_MODEL_INPUT_ERROR_CODES as MODEL_INPUT_ERROR_CODES, index$9_MODEL_INPUT_PLACEMENTS as MODEL_INPUT_PLACEMENTS, index$9_ModelCatalogEntry as ModelCatalogEntry, index$9_ModelCatalogLike as ModelCatalogLike, index$9_ModelFallbackAppliedInfo as ModelFallbackAppliedInfo, index$9_ModelFallbackPolicy as ModelFallbackPolicy, index$9_ModelFallbackRejectedInfo as ModelFallbackRejectedInfo, index$9_ModelInputCapabilityError as ModelInputCapabilityError, index$9_ModelInputCompatibility as ModelInputCompatibility, type index$9_ModelInputErrorCode as ModelInputErrorCode, type index$9_ModelInputErrorMetadata as ModelInputErrorMetadata, index$9_ModelInputIncompatibilityReason as ModelInputIncompatibilityReason, index$9_ModelInputPlacement as ModelInputPlacement, index$9_ModelInputRequirement as ModelInputRequirement, index$9_ModelReasoningConfig as ModelReasoningConfig, index$9_ModelResolver as ModelResolver, index$9_ProviderContinuation as ProviderContinuation, index$9_REASONING_EFFORTS as REASONING_EFFORTS, index$9_ReasoningEffort as ReasoningEffort, index$9_ToolCall as ToolCall, index$9_advanceCanonicalInferenceStreamState as advanceCanonicalInferenceStreamState, index$9_assertModelInputCompatibility as assertModelInputCompatibility, index$9_consumeCanonicalInferenceStream as consumeCanonicalInferenceStream, index$9_createDefaultTokenizerPort as createDefaultTokenizerPort, index$9_createFixedChatModelCatalog as createFixedChatModelCatalog, index$9_createModelInputCompatibilityError as createModelInputCompatibilityError, index$9_defaultPolicyEngine as defaultPolicyEngine, index$9_deriveModelInputRequirement as deriveModelInputRequirement, index$9_evaluateModelInputCompatibility as evaluateModelInputCompatibility, index$9_isValidReasoningEffort as isValidReasoningEffort, index$9_listCompatibleModelIds as listCompatibleModelIds, index$9_resolveEffectiveEffort as resolveEffectiveEffort };
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
* @file src/agent/runtime-kernel/child-runs/childRunInvoker.ts
|
|
988
|
-
* @description child-run 调用器
|
|
989
|
-
*/
|
|
990
|
-
|
|
991
|
-
interface ChildRunAgentConfig {
|
|
992
|
-
id: string;
|
|
993
|
-
promptKey: string;
|
|
994
|
-
availableTools?: readonly string[];
|
|
995
|
-
modelPolicy?: {
|
|
996
|
-
kind: 'fixed';
|
|
997
|
-
modelId: string;
|
|
998
|
-
};
|
|
999
|
-
stepPolicy?: {
|
|
1000
|
-
kind: 'final_answer' | 'force_tools';
|
|
1001
|
-
lastStepsHintThreshold?: number;
|
|
1002
|
-
forcedTools?: readonly string[];
|
|
1003
|
-
};
|
|
1004
|
-
contextPolicy?: AgentSpecContextPolicy;
|
|
1005
|
-
systemReminderPolicy?: AgentSpecSystemReminderPolicy;
|
|
1006
|
-
systemPromptBuilder?: (request: AgentInvocationRequest) => string;
|
|
1007
|
-
judgeToolName?: string;
|
|
1008
|
-
}
|
|
1009
|
-
interface ChildRunInvokeConfig {
|
|
1010
|
-
agentConfig: ChildRunAgentConfig;
|
|
1011
|
-
userMessage: string;
|
|
1012
|
-
parentToolContext: ChildRunParentContext;
|
|
1013
|
-
/**
|
|
1014
|
-
* child-run 的宿主会话归属,用于 RuntimeEvent / Audit / Telemetry。
|
|
1015
|
-
*
|
|
1016
|
-
* 未显式提供时继承父 ToolContext;两处都缺失属于 admission 错误。
|
|
1017
|
-
*/
|
|
1018
|
-
conversationId?: string;
|
|
1019
|
-
runId?: RunId;
|
|
1020
|
-
parentRunId?: RunId;
|
|
1021
|
-
abortSignal?: AbortSignal;
|
|
1022
|
-
/** 由 child lifecycle 装配的唯一 RuntimeEvent admission 入口。 */
|
|
1023
|
-
runtimeEventSink: RuntimeEventSink;
|
|
1024
|
-
/** 由 child lifecycle 装配,用于在 fan-out 前持久化单个 durable fact。 */
|
|
1025
|
-
runtimeEventCommitPort?: RuntimeEventCommitPort;
|
|
1026
|
-
seedHistoryEvents?: RuntimeEvent[];
|
|
1027
|
-
maxSteps?: number;
|
|
1028
|
-
modelId?: string;
|
|
1029
|
-
}
|
|
1030
|
-
interface ChildRunInvokeResult {
|
|
1031
|
-
runId?: RunId;
|
|
1032
|
-
parentRunId?: RunId;
|
|
1033
|
-
subrunId: string;
|
|
1034
|
-
success: boolean;
|
|
1035
|
-
cancelled?: boolean;
|
|
1036
|
-
judgeToolOutput?: string;
|
|
1037
|
-
finalAnswer?: string;
|
|
1038
|
-
lastProgress?: string;
|
|
1039
|
-
events: RoutedRuntimeEvent[];
|
|
1040
|
-
transcriptMessages?: unknown[];
|
|
1041
|
-
toolset?: {
|
|
1042
|
-
availableTools?: string[];
|
|
1043
|
-
};
|
|
1044
|
-
stepCount: number;
|
|
1045
|
-
error?: string;
|
|
1046
|
-
}
|
|
1047
|
-
declare class ChildRunInvoker {
|
|
1048
|
-
private readonly modelResolver;
|
|
1049
|
-
private readonly createLlmNode;
|
|
1050
|
-
private readonly toolRuntime;
|
|
1051
|
-
private readonly observationPreview;
|
|
1052
|
-
private readonly modelInputCapabilityValidator?;
|
|
1053
|
-
private readonly modelInputResolver?;
|
|
1054
|
-
private readonly eventToMessageConverter;
|
|
1055
|
-
private readonly defaultJudgeToolName?;
|
|
1056
|
-
private readonly telemetryPort;
|
|
1057
|
-
private readonly auditPort;
|
|
1058
|
-
constructor(dependencies: {
|
|
1059
|
-
modelResolver: Pick<ModelResolverLike, 'resolveModelId'>;
|
|
1060
|
-
createLlmNode: () => GraphNode;
|
|
1061
|
-
toolRuntime: Pick<ToolRuntimePort, 'getToolDefinition' | 'executeTool'>;
|
|
1062
|
-
observationPreview: ObservationPreviewPort;
|
|
1063
|
-
modelInputCapabilityValidator?: ToolModelInputCapabilityValidatorPort;
|
|
1064
|
-
modelInputResolver?: ToolModelInputResolverPort;
|
|
1065
|
-
eventToMessageConverter: (events: RuntimeEvent[]) => unknown[];
|
|
1066
|
-
defaultJudgeToolName?: string;
|
|
1067
|
-
telemetryPort?: TelemetryPort;
|
|
1068
|
-
auditPort?: AuditPort;
|
|
1069
|
-
});
|
|
1070
|
-
invoke(config: ChildRunInvokeConfig): Promise<ChildRunInvokeResult>;
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
declare function pickChildRunSeedHistory(params: {
|
|
1074
|
-
parentHistory: ReadonlyArray<RuntimeEvent>;
|
|
1075
|
-
historyPolicy?: ChildRunHistoryPolicy;
|
|
1076
|
-
}): RuntimeEvent[];
|
|
1077
|
-
|
|
1078
|
-
type index$8_ChildRunAgentConfig = ChildRunAgentConfig;
|
|
1079
|
-
type index$8_ChildRunInvokeConfig = ChildRunInvokeConfig;
|
|
1080
|
-
type index$8_ChildRunInvokeResult = ChildRunInvokeResult;
|
|
1081
|
-
type index$8_ChildRunInvoker = ChildRunInvoker;
|
|
1082
|
-
declare const index$8_ChildRunInvoker: typeof ChildRunInvoker;
|
|
1083
|
-
declare const index$8_ChildRunInvokerPort: typeof ChildRunInvokerPort;
|
|
1084
|
-
declare const index$8_ChildRunRequest: typeof ChildRunRequest;
|
|
1085
|
-
declare const index$8_ChildRunResult: typeof ChildRunResult;
|
|
1086
|
-
declare const index$8_pickChildRunSeedHistory: typeof pickChildRunSeedHistory;
|
|
1087
|
-
declare namespace index$8 {
|
|
1088
|
-
export { type index$8_ChildRunAgentConfig as ChildRunAgentConfig, type index$8_ChildRunInvokeConfig as ChildRunInvokeConfig, type index$8_ChildRunInvokeResult as ChildRunInvokeResult, index$8_ChildRunInvoker as ChildRunInvoker, index$8_ChildRunInvokerPort as ChildRunInvokerPort, index$8_ChildRunRequest as ChildRunRequest, index$8_ChildRunResult as ChildRunResult, index$8_pickChildRunSeedHistory as pickChildRunSeedHistory };
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
interface RuntimeEventSubRunTracePublisherOptions {
|
|
1092
|
-
runtimeEventSink: RuntimeEventSink;
|
|
1093
|
-
/** 父会话上下文:用于填充 RuntimeEvent 基础字段 */
|
|
1094
|
-
conversationId: string;
|
|
1095
|
-
turnId: string;
|
|
1096
|
-
/** 绑定关系:用于 UI 精确归属与并发分桶 */
|
|
1097
|
-
parentToolCallId: ToolCallId;
|
|
1098
|
-
subrunId: string;
|
|
1099
|
-
subrunParentId?: string;
|
|
1100
|
-
/**
|
|
1101
|
-
* 事件来源(用于调试与过滤)
|
|
1102
|
-
* 建议格式:`subrun:<tool_name>` 或 `tool:<tool_name>:subrun`
|
|
1103
|
-
*/
|
|
1104
|
-
source?: string;
|
|
1105
|
-
/**
|
|
1106
|
-
* 透传到 RuntimeEvent.metadata 的扩展字段(可选)
|
|
1107
|
-
* 注意:metadata 只允许承载非关键展示/诊断信息。路由、归并、生命周期和副作用目标
|
|
1108
|
-
* 必须使用共享正式字段或上层显式绑定,不能让前端从这里恢复业务身份。
|
|
1109
|
-
*/
|
|
1110
|
-
metadata?: Record<string, unknown>;
|
|
1111
|
-
}
|
|
1112
|
-
/**
|
|
1113
|
-
* RuntimeEventSubRunTracePublisher
|
|
1114
|
-
*
|
|
1115
|
-
* 说明:
|
|
1116
|
-
* - 该发布器在构造时绑定 parent_tool_call_id 与 subrun_id;
|
|
1117
|
-
* - 每次 publish 只需要提供“分片载荷”(kind/delta/...)即可。
|
|
1118
|
-
*/
|
|
1119
|
-
declare class RuntimeEventSubRunTracePublisher implements SubRunTracePublisher {
|
|
1120
|
-
private readonly runtimeEventSink;
|
|
1121
|
-
private readonly conversationId;
|
|
1122
|
-
private readonly turnId;
|
|
1123
|
-
private readonly parentToolCallId;
|
|
1124
|
-
private readonly subrunId;
|
|
1125
|
-
private readonly subrunParentId?;
|
|
1126
|
-
private readonly source;
|
|
1127
|
-
private readonly metadata?;
|
|
1128
|
-
constructor(options: RuntimeEventSubRunTracePublisherOptions);
|
|
1129
|
-
publish(envelope: SubRunTraceEnvelope): void;
|
|
1130
|
-
}
|
|
1131
|
-
|
|
1132
|
-
/**
|
|
1133
|
-
* parent trace 是 child fact 的展示投影。该函数只做语义选择与字段映射,
|
|
1134
|
-
* 不拥有 child admission、parent 发布、持久化或事件 ID。
|
|
1135
|
-
*/
|
|
1136
|
-
declare function projectChildRuntimeEventToSubRunTrace(event: RoutedRuntimeEvent): SubRunTraceEnvelope | null;
|
|
1137
|
-
|
|
1138
|
-
interface ChildRunParentTraceProjectionOptions {
|
|
1139
|
-
childEventBus: EventBus;
|
|
1140
|
-
parentTracePublisher: SubRunTracePublisher;
|
|
1141
|
-
}
|
|
1142
|
-
/**
|
|
1143
|
-
* child EventBus 的父级 read-model consumer。
|
|
1144
|
-
*
|
|
1145
|
-
* 投影失败在 terminal drain 时传播,不能从同步 EventBus listener 直接抛出,
|
|
1146
|
-
* 否则同一 child fact 的 persistence、observation 与 journal 会因监听器顺序产生分叉。
|
|
1147
|
-
*/
|
|
1148
|
-
declare class ChildRunParentTraceProjection {
|
|
1149
|
-
private readonly options;
|
|
1150
|
-
private firstProjectionError;
|
|
1151
|
-
private connected;
|
|
1152
|
-
constructor(options: ChildRunParentTraceProjectionOptions);
|
|
1153
|
-
connect(): void;
|
|
1154
|
-
drain(): Promise<void>;
|
|
1155
|
-
private readonly onEvent;
|
|
1156
|
-
private readonly disconnect;
|
|
1157
|
-
}
|
|
1158
|
-
|
|
1159
|
-
type index$7_ChildRunParentTraceProjection = ChildRunParentTraceProjection;
|
|
1160
|
-
declare const index$7_ChildRunParentTraceProjection: typeof ChildRunParentTraceProjection;
|
|
1161
|
-
type index$7_ChildRunParentTraceProjectionOptions = ChildRunParentTraceProjectionOptions;
|
|
1162
|
-
type index$7_RuntimeEventSubRunTracePublisher = RuntimeEventSubRunTracePublisher;
|
|
1163
|
-
declare const index$7_RuntimeEventSubRunTracePublisher: typeof RuntimeEventSubRunTracePublisher;
|
|
1164
|
-
type index$7_RuntimeEventSubRunTracePublisherOptions = RuntimeEventSubRunTracePublisherOptions;
|
|
1165
|
-
declare const index$7_SubRunTraceEnvelope: typeof SubRunTraceEnvelope;
|
|
1166
|
-
declare const index$7_SubRunTracePublisher: typeof SubRunTracePublisher;
|
|
1167
|
-
declare const index$7_projectChildRuntimeEventToSubRunTrace: typeof projectChildRuntimeEventToSubRunTrace;
|
|
1168
|
-
declare namespace index$7 {
|
|
1169
|
-
export { index$7_ChildRunParentTraceProjection as ChildRunParentTraceProjection, type index$7_ChildRunParentTraceProjectionOptions as ChildRunParentTraceProjectionOptions, index$7_RuntimeEventSubRunTracePublisher as RuntimeEventSubRunTracePublisher, type index$7_RuntimeEventSubRunTracePublisherOptions as RuntimeEventSubRunTracePublisherOptions, index$7_SubRunTraceEnvelope as SubRunTraceEnvelope, index$7_SubRunTracePublisher as SubRunTracePublisher, index$7_projectChildRuntimeEventToSubRunTrace as projectChildRuntimeEventToSubRunTrace };
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
/**
|
|
1173
|
-
* @file packages/linnkit/src/runtime-kernel/enrichment/types.ts
|
|
1174
|
-
* @description 请求增强器(Request Enricher)接口定义
|
|
1175
|
-
*
|
|
1176
|
-
* 核心目标:
|
|
1177
|
-
* - 将 host 特定的请求补全逻辑从主循环剥离
|
|
1178
|
-
* - 提供统一的扩展点,主循环只负责调度,不感知具体业务
|
|
1179
|
-
*/
|
|
1180
|
-
|
|
1181
|
-
interface EnrichmentContext {
|
|
1182
|
-
/**
|
|
1183
|
-
* 当前会话 ID
|
|
1184
|
-
*
|
|
1185
|
-
* 中文备注:
|
|
1186
|
-
* - RequestEnricher 的目标是"把业务特定逻辑从主循环剥离",但它仍然是"针对某个会话的增强";
|
|
1187
|
-
* - host workflow 可能需要按会话读取或写入自己的状态,
|
|
1188
|
-
* 因此把 conversationId 纳入 enrichment 上下文是结构性必需条件;
|
|
1189
|
-
* - 该字段是运行期上下文,不属于模型输入。
|
|
1190
|
-
*/
|
|
1191
|
-
conversationId: string;
|
|
1192
|
-
/** 原始请求;runtime 只依赖 AgentInvocationRequest 协议面。 */
|
|
1193
|
-
request: AgentInvocationRequest;
|
|
1194
|
-
/** 当前运行上下文 */
|
|
1195
|
-
runContext: RunContext;
|
|
1196
|
-
}
|
|
1197
|
-
interface EnrichmentResult {
|
|
1198
|
-
/**
|
|
1199
|
-
* 增强后的请求对象(例如补全 host 注册字段)
|
|
1200
|
-
* - 如果不需要修改,可返回原对象
|
|
1201
|
-
*/
|
|
1202
|
-
request: AgentInvocationRequest;
|
|
1203
|
-
/**
|
|
1204
|
-
* 需要注入到 ToolContext 的额外数据
|
|
1205
|
-
* - 例如 host 工具执行所需的窄元信息
|
|
1206
|
-
* - 这些数据仅工具可见,模型不可见
|
|
1207
|
-
*/
|
|
1208
|
-
toolContextPatch?: ToolContextPatch;
|
|
1209
|
-
/**
|
|
1210
|
-
* 对 RunContext 的更新(可选)
|
|
1211
|
-
* - 例如:业务层解析出了更准确的 traceId 或 tags
|
|
1212
|
-
*/
|
|
1213
|
-
runContextPatch?: Partial<RunContext>;
|
|
1214
|
-
}
|
|
1215
|
-
/**
|
|
1216
|
-
* Registry 输出的最终增强结果
|
|
1217
|
-
*
|
|
1218
|
-
* 说明:
|
|
1219
|
-
* - `RequestEnricher.enrich()` 返回 patch(增量)
|
|
1220
|
-
* - Registry 会把所有 patch 串行合并,并返回最终的 `runContext`
|
|
1221
|
-
*/
|
|
1222
|
-
interface RegistryEnrichmentResult {
|
|
1223
|
-
request: AgentInvocationRequest;
|
|
1224
|
-
toolContextPatch?: ToolContextPatch;
|
|
1225
|
-
runContext: RunContext;
|
|
1226
|
-
}
|
|
1227
|
-
/**
|
|
1228
|
-
* 请求增强器接口
|
|
1229
|
-
*
|
|
1230
|
-
* 中文备注:
|
|
1231
|
-
* - runtime 层只依赖 AgentInvocationRequest 协议面;
|
|
1232
|
-
* - host enricher 可以接收结构上满足该协议的更丰富请求;
|
|
1233
|
-
* - 访问 host 字段前必须在适配边界完成显式校验和窄化。
|
|
1234
|
-
*/
|
|
1235
|
-
interface RequestEnricher {
|
|
1236
|
-
/** 增强器名称(用于调试/日志) */
|
|
1237
|
-
name: string;
|
|
1238
|
-
/**
|
|
1239
|
-
* 判断该增强器是否适用于当前请求
|
|
1240
|
-
* - 通常基于 promptKey 或 mode 判断
|
|
1241
|
-
*/
|
|
1242
|
-
isApplicable(request: AgentInvocationRequest): boolean;
|
|
1243
|
-
/**
|
|
1244
|
-
* 执行增强逻辑
|
|
1245
|
-
* - 可以包含异步操作(查库、调 RPC 等)
|
|
1246
|
-
*/
|
|
1247
|
-
enrich(context: EnrichmentContext): Promise<EnrichmentResult>;
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
/**
|
|
1251
|
-
* @file src/agent/runtime-kernel/enrichment/registry.ts
|
|
1252
|
-
* @description 请求增强器注册表
|
|
1253
|
-
*/
|
|
1254
|
-
|
|
1255
|
-
declare class RequestEnricherRegistry {
|
|
1256
|
-
private enrichers;
|
|
1257
|
-
private readonly logger;
|
|
1258
|
-
/**
|
|
1259
|
-
* 注册增强器
|
|
1260
|
-
*/
|
|
1261
|
-
register(enricher: RequestEnricher): void;
|
|
1262
|
-
snapshot(): readonly string[];
|
|
1263
|
-
reset(): void;
|
|
1264
|
-
/**
|
|
1265
|
-
* 执行所有适用的增强器
|
|
1266
|
-
* - 按注册顺序串行执行(后续增强器基于前序结果继续增强)
|
|
1267
|
-
*/
|
|
1268
|
-
enrich(context: EnrichmentContext): Promise<RegistryEnrichmentResult>;
|
|
1269
|
-
}
|
|
1270
|
-
declare const requestEnricherRegistry: RequestEnricherRegistry;
|
|
1271
|
-
|
|
1272
|
-
type index$6_EnrichmentContext = EnrichmentContext;
|
|
1273
|
-
type index$6_EnrichmentResult = EnrichmentResult;
|
|
1274
|
-
type index$6_RegistryEnrichmentResult = RegistryEnrichmentResult;
|
|
1275
|
-
type index$6_RequestEnricher = RequestEnricher;
|
|
1276
|
-
declare const index$6_requestEnricherRegistry: typeof requestEnricherRegistry;
|
|
1277
|
-
declare namespace index$6 {
|
|
1278
|
-
export { type index$6_EnrichmentContext as EnrichmentContext, type index$6_EnrichmentResult as EnrichmentResult, type index$6_RegistryEnrichmentResult as RegistryEnrichmentResult, type index$6_RequestEnricher as RequestEnricher, index$6_requestEnricherRegistry as requestEnricherRegistry };
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
declare class NotImplementedError extends Error {
|
|
1282
|
-
constructor(message: string);
|
|
1283
|
-
}
|
|
1284
|
-
declare class RunNotFoundError extends Error {
|
|
1285
|
-
constructor(runId: string);
|
|
1286
|
-
}
|
|
1287
|
-
declare class RunAlreadyRegisteredError extends Error {
|
|
1288
|
-
readonly runId: string;
|
|
1289
|
-
constructor(runId: string);
|
|
1290
|
-
}
|
|
1291
|
-
declare class RunConcurrencyLimitExceededError extends Error {
|
|
1292
|
-
readonly runId: string;
|
|
1293
|
-
readonly maxActiveRuns: number;
|
|
1294
|
-
readonly activeRuns: number;
|
|
1295
|
-
constructor(runId: string, maxActiveRuns: number, activeRuns: number);
|
|
1296
|
-
}
|
|
1297
|
-
declare class RunConcurrencyKeyOccupiedError extends Error {
|
|
1298
|
-
readonly concurrencyKey: string;
|
|
1299
|
-
readonly activeRunId: string;
|
|
1300
|
-
readonly requestedRunId: string;
|
|
1301
|
-
constructor(concurrencyKey: string, activeRunId: string, requestedRunId: string);
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
declare const index$5_CancelOpts: typeof CancelOpts;
|
|
1305
|
-
declare const index$5_DefaultRunHandle: typeof DefaultRunHandle;
|
|
1306
|
-
declare const index$5_DefaultRunHandleOptions: typeof DefaultRunHandleOptions;
|
|
1307
|
-
declare const index$5_DefaultRunSupervisor: typeof DefaultRunSupervisor;
|
|
1308
|
-
declare const index$5_DefaultRunSupervisorOptions: typeof DefaultRunSupervisorOptions;
|
|
1309
|
-
declare const index$5_FindActiveByConversationOptions: typeof FindActiveByConversationOptions;
|
|
1310
|
-
declare const index$5_FindRunsByConversationOptions: typeof FindRunsByConversationOptions;
|
|
1311
|
-
declare const index$5_ListRunsFilter: typeof ListRunsFilter;
|
|
1312
|
-
declare const index$5_MemoryRunRegistryStore: typeof MemoryRunRegistryStore;
|
|
1313
|
-
type index$5_NotImplementedError = NotImplementedError;
|
|
1314
|
-
declare const index$5_NotImplementedError: typeof NotImplementedError;
|
|
1315
|
-
type index$5_RunAlreadyRegisteredError = RunAlreadyRegisteredError;
|
|
1316
|
-
declare const index$5_RunAlreadyRegisteredError: typeof RunAlreadyRegisteredError;
|
|
1317
|
-
declare const index$5_RunAwaitingUserPatch: typeof RunAwaitingUserPatch;
|
|
1318
|
-
type index$5_RunConcurrencyKeyOccupiedError = RunConcurrencyKeyOccupiedError;
|
|
1319
|
-
declare const index$5_RunConcurrencyKeyOccupiedError: typeof RunConcurrencyKeyOccupiedError;
|
|
1320
|
-
type index$5_RunConcurrencyLimitExceededError = RunConcurrencyLimitExceededError;
|
|
1321
|
-
declare const index$5_RunConcurrencyLimitExceededError: typeof RunConcurrencyLimitExceededError;
|
|
1322
|
-
declare const index$5_RunCost: typeof RunCost;
|
|
1323
|
-
declare const index$5_RunCostCollector: typeof RunCostCollector;
|
|
1324
|
-
declare const index$5_RunExecutionContext: typeof RunExecutionContext;
|
|
1325
|
-
declare const index$5_RunExecutorPort: typeof RunExecutorPort;
|
|
1326
|
-
declare const index$5_RunFailureInfo: typeof RunFailureInfo;
|
|
1327
|
-
declare const index$5_RunHandle: typeof RunHandle;
|
|
1328
|
-
declare const index$5_RunLifecyclePatch: typeof RunLifecyclePatch;
|
|
1329
|
-
declare const index$5_RunMeta: typeof RunMeta;
|
|
1330
|
-
type index$5_RunNotFoundError = RunNotFoundError;
|
|
1331
|
-
declare const index$5_RunNotFoundError: typeof RunNotFoundError;
|
|
1332
|
-
declare const index$5_RunObserveFilter: typeof RunObserveFilter;
|
|
1333
|
-
declare const index$5_RunOutcome: typeof RunOutcome;
|
|
1334
|
-
declare const index$5_RunRecord: typeof RunRecord;
|
|
1335
|
-
declare const index$5_RunRegistrationSpec: typeof RunRegistrationSpec;
|
|
1336
|
-
declare const index$5_RunRegistryStore: typeof RunRegistryStore;
|
|
1337
|
-
declare const index$5_RunRequestSnapshot: typeof RunRequestSnapshot;
|
|
1338
|
-
declare const index$5_RunResumeClaim: typeof RunResumeClaim;
|
|
1339
|
-
declare const index$5_RunResumeInteraction: typeof RunResumeInteraction;
|
|
1340
|
-
declare const index$5_RunSnapshot: typeof RunSnapshot;
|
|
1341
|
-
declare const index$5_RunStatus: typeof RunStatus;
|
|
1342
|
-
declare const index$5_RunSupervisor: typeof RunSupervisor;
|
|
1343
|
-
declare const index$5_RunTerminalError: typeof RunTerminalError;
|
|
1344
|
-
declare const index$5_RunTerminalEvent: typeof RunTerminalEvent;
|
|
1345
|
-
declare const index$5_RunTerminalStatus: typeof RunTerminalStatus;
|
|
1346
|
-
declare const index$5_RunWaitForTerminalOptions: typeof RunWaitForTerminalOptions;
|
|
1347
|
-
declare const index$5_runMetaFromRecord: typeof runMetaFromRecord;
|
|
1348
|
-
declare namespace index$5 {
|
|
1349
|
-
export { index$5_CancelOpts as CancelOpts, index$5_DefaultRunHandle as DefaultRunHandle, index$5_DefaultRunHandleOptions as DefaultRunHandleOptions, index$5_DefaultRunSupervisor as DefaultRunSupervisor, index$5_DefaultRunSupervisorOptions as DefaultRunSupervisorOptions, index$5_FindActiveByConversationOptions as FindActiveByConversationOptions, index$5_FindRunsByConversationOptions as FindRunsByConversationOptions, index$5_ListRunsFilter as ListRunsFilter, index$5_MemoryRunRegistryStore as MemoryRunRegistryStore, index$5_NotImplementedError as NotImplementedError, index$5_RunAlreadyRegisteredError as RunAlreadyRegisteredError, index$5_RunAwaitingUserPatch as RunAwaitingUserPatch, index$5_RunConcurrencyKeyOccupiedError as RunConcurrencyKeyOccupiedError, index$5_RunConcurrencyLimitExceededError as RunConcurrencyLimitExceededError, index$5_RunCost as RunCost, index$5_RunCostCollector as RunCostCollector, index$5_RunExecutionContext as RunExecutionContext, index$5_RunExecutorPort as RunExecutorPort, index$5_RunFailureInfo as RunFailureInfo, index$5_RunHandle as RunHandle, index$5_RunLifecyclePatch as RunLifecyclePatch, index$5_RunMeta as RunMeta, index$5_RunNotFoundError as RunNotFoundError, index$5_RunObserveFilter as RunObserveFilter, index$5_RunOutcome as RunOutcome, index$5_RunRecord as RunRecord, index$5_RunRegistrationSpec as RunRegistrationSpec, index$5_RunRegistryStore as RunRegistryStore, index$5_RunRequestSnapshot as RunRequestSnapshot, index$5_RunResumeClaim as RunResumeClaim, index$5_RunResumeInteraction as RunResumeInteraction, index$5_RunSnapshot as RunSnapshot, index$5_RunStatus as RunStatus, index$5_RunSupervisor as RunSupervisor, index$5_RunTerminalError as RunTerminalError, index$5_RunTerminalEvent as RunTerminalEvent, index$5_RunTerminalStatus as RunTerminalStatus, index$5_RunWaitForTerminalOptions as RunWaitForTerminalOptions, index$5_runMetaFromRecord as runMetaFromRecord };
|
|
1350
|
-
}
|
|
1351
|
-
|
|
1352
|
-
declare const noopTelemetry: TelemetryPort;
|
|
1353
|
-
|
|
1354
|
-
declare const index$4_ContextCompactionSuppressedReason: typeof ContextCompactionSuppressedReason;
|
|
1355
|
-
declare const index$4_ContextCompactionTelemetryOutcome: typeof ContextCompactionTelemetryOutcome;
|
|
1356
|
-
declare const index$4_TELEMETRY_EVENT_KINDS: typeof TELEMETRY_EVENT_KINDS;
|
|
1357
|
-
declare const index$4_TelemetryEvent: typeof TelemetryEvent;
|
|
1358
|
-
declare const index$4_TelemetryPort: typeof TelemetryPort;
|
|
1359
|
-
declare const index$4_TelemetryScope: typeof TelemetryScope;
|
|
1360
|
-
declare const index$4_noopTelemetry: typeof noopTelemetry;
|
|
1361
|
-
declare namespace index$4 {
|
|
1362
|
-
export { index$4_ContextCompactionSuppressedReason as ContextCompactionSuppressedReason, index$4_ContextCompactionTelemetryOutcome as ContextCompactionTelemetryOutcome, index$4_TELEMETRY_EVENT_KINDS as TELEMETRY_EVENT_KINDS, index$4_TelemetryEvent as TelemetryEvent, index$4_TelemetryPort as TelemetryPort, index$4_TelemetryScope as TelemetryScope, index$4_noopTelemetry as noopTelemetry };
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
interface ConsoleAuditOptions {
|
|
1366
|
-
sink?: Pick<Console, 'info'>;
|
|
1367
|
-
}
|
|
1368
|
-
declare function createConsoleAudit(options?: ConsoleAuditOptions): AuditPort;
|
|
1369
|
-
declare const consoleAudit: AuditPort;
|
|
1370
|
-
|
|
1371
|
-
interface CompositeAuditOptions {
|
|
1372
|
-
ports: readonly AuditPort[];
|
|
1373
|
-
}
|
|
1374
|
-
/**
|
|
1375
|
-
* 组合多个审计 sink。
|
|
1376
|
-
*
|
|
1377
|
-
* 中文备注:
|
|
1378
|
-
* - 按顺序 await,确保 EventStore 这类主审计落点先完成;
|
|
1379
|
-
* - 不吞异常,审计失败应该暴露给调用方,由 host 决定是否降级。
|
|
1380
|
-
*/
|
|
1381
|
-
declare class CompositeAuditPort implements AuditPort {
|
|
1382
|
-
private readonly ports;
|
|
1383
|
-
constructor(options: CompositeAuditOptions);
|
|
1384
|
-
emit(envelope: AuditEnvelope): Promise<void>;
|
|
1385
|
-
flush(): Promise<void>;
|
|
1386
|
-
}
|
|
1387
|
-
declare function createCompositeAudit(options: CompositeAuditOptions): AuditPort;
|
|
1388
|
-
|
|
1389
|
-
interface EmitAuditEnvelopeParams {
|
|
1390
|
-
runId?: AuditScope['runId'];
|
|
1391
|
-
parentRunId?: AuditScope['parentRunId'];
|
|
1392
|
-
actor?: AuditActor;
|
|
1393
|
-
action: string;
|
|
1394
|
-
decision?: AuditDecision;
|
|
1395
|
-
evidence?: AuditEvidence[];
|
|
1396
|
-
costDelta?: AuditCostDelta;
|
|
1397
|
-
scope: AuditScope;
|
|
1398
|
-
}
|
|
1399
|
-
/**
|
|
1400
|
-
* 统一发出 AuditEnvelope。
|
|
1401
|
-
*
|
|
1402
|
-
* 中文备注:
|
|
1403
|
-
* - 调用点只描述“谁做了什么决策”,这里统一补 envelopeId / ts / runId;
|
|
1404
|
-
* - 不吞 emit 异常,审计链路异常应由上层测试或 host 策略显式处理。
|
|
1405
|
-
*/
|
|
1406
|
-
declare function emitAuditEnvelope(auditPort: AuditPort, params: EmitAuditEnvelopeParams): Promise<void>;
|
|
1407
|
-
declare function emitSandboxDecisionAudit(auditPort: AuditPort, params: {
|
|
1408
|
-
scope: AuditScope;
|
|
1409
|
-
allowed: boolean;
|
|
1410
|
-
reason?: string;
|
|
1411
|
-
policy?: string;
|
|
1412
|
-
evidence?: AuditEvidence[];
|
|
1413
|
-
}): Promise<void>;
|
|
1414
|
-
|
|
1415
|
-
interface EventStoreAuditOptions {
|
|
1416
|
-
eventStore: EventStore;
|
|
1417
|
-
}
|
|
1418
|
-
declare class AuditEnvelopePersistenceError extends Error {
|
|
1419
|
-
constructor(message: string);
|
|
1420
|
-
}
|
|
1421
|
-
/**
|
|
1422
|
-
* 默认 EventStore 审计 sink。
|
|
1423
|
-
*
|
|
1424
|
-
* 中文备注:
|
|
1425
|
-
* - 写入隐藏 RuntimeEvent:type=audit_envelope;
|
|
1426
|
-
* - 事件不进 UI、不进 agent context,只作为追加只读审计事实保留;
|
|
1427
|
-
* - conversationId 必须来自 envelope.scope,避免把跨会话审计混进同一条流。
|
|
1428
|
-
*/
|
|
1429
|
-
declare class EventStoreAuditPort implements AuditPort {
|
|
1430
|
-
private readonly eventStore;
|
|
1431
|
-
constructor(options: EventStoreAuditOptions);
|
|
1432
|
-
emit(envelope: AuditEnvelope): Promise<void>;
|
|
1433
|
-
}
|
|
1434
|
-
declare function createEventStoreAudit(options: EventStoreAuditOptions): AuditPort;
|
|
1435
|
-
|
|
1436
|
-
interface FileAuditOptions {
|
|
1437
|
-
filePath: string;
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* JSONL 文件审计 sink。
|
|
1441
|
-
*
|
|
1442
|
-
* 中文备注:
|
|
1443
|
-
* - 每个 envelope 一行,便于 tail / grep / 后续导入 SIEM;
|
|
1444
|
-
* - 不做轮转与脱敏,轮转/脱敏属于 host 策略,后续由 G-4 RedactionPort 处理。
|
|
1445
|
-
*/
|
|
1446
|
-
declare class FileAuditPort implements AuditPort {
|
|
1447
|
-
private readonly filePath;
|
|
1448
|
-
constructor(options: FileAuditOptions);
|
|
1449
|
-
emit(envelope: AuditEnvelope): Promise<void>;
|
|
1450
|
-
}
|
|
1451
|
-
declare function createFileAudit(options: FileAuditOptions): AuditPort;
|
|
1452
|
-
|
|
1453
|
-
declare const noopAudit: AuditPort;
|
|
1454
|
-
|
|
1455
|
-
type index$3_AuditEnvelopePersistenceError = AuditEnvelopePersistenceError;
|
|
1456
|
-
declare const index$3_AuditEnvelopePersistenceError: typeof AuditEnvelopePersistenceError;
|
|
1457
|
-
type index$3_CompositeAuditOptions = CompositeAuditOptions;
|
|
1458
|
-
type index$3_CompositeAuditPort = CompositeAuditPort;
|
|
1459
|
-
declare const index$3_CompositeAuditPort: typeof CompositeAuditPort;
|
|
1460
|
-
type index$3_ConsoleAuditOptions = ConsoleAuditOptions;
|
|
1461
|
-
type index$3_EmitAuditEnvelopeParams = EmitAuditEnvelopeParams;
|
|
1462
|
-
type index$3_EventStoreAuditOptions = EventStoreAuditOptions;
|
|
1463
|
-
type index$3_EventStoreAuditPort = EventStoreAuditPort;
|
|
1464
|
-
declare const index$3_EventStoreAuditPort: typeof EventStoreAuditPort;
|
|
1465
|
-
type index$3_FileAuditOptions = FileAuditOptions;
|
|
1466
|
-
type index$3_FileAuditPort = FileAuditPort;
|
|
1467
|
-
declare const index$3_FileAuditPort: typeof FileAuditPort;
|
|
1468
|
-
declare const index$3_consoleAudit: typeof consoleAudit;
|
|
1469
|
-
declare const index$3_createCompositeAudit: typeof createCompositeAudit;
|
|
1470
|
-
declare const index$3_createConsoleAudit: typeof createConsoleAudit;
|
|
1471
|
-
declare const index$3_createEventStoreAudit: typeof createEventStoreAudit;
|
|
1472
|
-
declare const index$3_createFileAudit: typeof createFileAudit;
|
|
1473
|
-
declare const index$3_emitAuditEnvelope: typeof emitAuditEnvelope;
|
|
1474
|
-
declare const index$3_emitSandboxDecisionAudit: typeof emitSandboxDecisionAudit;
|
|
1475
|
-
declare const index$3_noopAudit: typeof noopAudit;
|
|
1476
|
-
declare namespace index$3 {
|
|
1477
|
-
export { index$3_AuditEnvelopePersistenceError as AuditEnvelopePersistenceError, type index$3_CompositeAuditOptions as CompositeAuditOptions, index$3_CompositeAuditPort as CompositeAuditPort, type index$3_ConsoleAuditOptions as ConsoleAuditOptions, type index$3_EmitAuditEnvelopeParams as EmitAuditEnvelopeParams, type index$3_EventStoreAuditOptions as EventStoreAuditOptions, index$3_EventStoreAuditPort as EventStoreAuditPort, type index$3_FileAuditOptions as FileAuditOptions, index$3_FileAuditPort as FileAuditPort, index$3_consoleAudit as consoleAudit, index$3_createCompositeAudit as createCompositeAudit, index$3_createConsoleAudit as createConsoleAudit, index$3_createEventStoreAudit as createEventStoreAudit, index$3_createFileAudit as createFileAudit, index$3_emitAuditEnvelope as emitAuditEnvelope, index$3_emitSandboxDecisionAudit as emitSandboxDecisionAudit, index$3_noopAudit as noopAudit };
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1480
|
-
/**
|
|
1481
|
-
* @file packages/linnkit/src/runtime-kernel/system-reminder/types.ts
|
|
1482
|
-
* @description SystemReminder(系统提醒)类型定义
|
|
1483
|
-
*
|
|
1484
|
-
* 设计目标(必须遵守):
|
|
1485
|
-
* - ✅ 只对“当前 tick / 当前 request”生效:不写入 history,不转换成 RuntimeEvent,不进入持久化
|
|
1486
|
-
* - ✅ 配置驱动:新增/调整提醒只改 rules 配置文件
|
|
1487
|
-
* - ✅ 普通 tick 注入:追加到最后一条 message.content,继承该消息 role
|
|
1488
|
-
* - ✅ 压缩专用注入:完整原 Prompt 后新增瞬态 user message;不由本规则模块构造
|
|
1489
|
-
* - ❌ System Reminder 标签不代表独立 system-role message
|
|
1490
|
-
*/
|
|
1491
|
-
|
|
1492
|
-
interface SystemReminderContext {
|
|
1493
|
-
request: AgentInvocationRequest;
|
|
1494
|
-
history: ReadonlyArray<RuntimeEvent>;
|
|
1495
|
-
/**
|
|
1496
|
-
* 执行阶段信号(由 GraphExecutor 注入)
|
|
1497
|
-
* - stepCount/maxSteps/remainingSteps/phase/finalStepPolicy...
|
|
1498
|
-
*/
|
|
1499
|
-
executorLocal?: ExecutorLocalState;
|
|
1500
|
-
}
|
|
1501
|
-
interface SystemReminderRule {
|
|
1502
|
-
/**
|
|
1503
|
-
* 规则唯一 ID(用于本 tick 内去重与调试定位)
|
|
1504
|
-
*/
|
|
1505
|
-
id: string;
|
|
1506
|
-
/**
|
|
1507
|
-
* 是否触发
|
|
1508
|
-
*/
|
|
1509
|
-
when: (ctx: SystemReminderContext) => boolean;
|
|
1510
|
-
/**
|
|
1511
|
-
* 构建提醒正文(不包含外层 <system-reminder> 标签)
|
|
1512
|
-
*/
|
|
1513
|
-
build: (ctx: SystemReminderContext) => string;
|
|
1514
|
-
}
|
|
1515
|
-
type SystemReminderTriggerEvaluator = (ctx: SystemReminderContext, trigger: AgentSpecSystemReminderTrigger) => boolean;
|
|
1516
|
-
type SystemReminderContentTemplate = (ctx: SystemReminderContext, args: Record<string, unknown> | undefined) => string;
|
|
1517
|
-
interface SystemReminderRuleDefinition extends AgentSpecSystemReminderExtraRule {
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
declare class SystemReminderRegistry {
|
|
1521
|
-
private readonly triggers;
|
|
1522
|
-
private readonly templates;
|
|
1523
|
-
constructor(seed?: {
|
|
1524
|
-
triggers?: Record<string, SystemReminderTriggerEvaluator>;
|
|
1525
|
-
templates?: Record<string, SystemReminderContentTemplate>;
|
|
1526
|
-
});
|
|
1527
|
-
registerTriggerKind(kind: string, evaluator: SystemReminderTriggerEvaluator): void;
|
|
1528
|
-
registerContentTemplate(name: string, template: SystemReminderContentTemplate): void;
|
|
1529
|
-
buildRule(definition: SystemReminderRuleDefinition): SystemReminderRule | undefined;
|
|
1530
|
-
}
|
|
1531
|
-
declare function createDefaultSystemReminderRegistry(): SystemReminderRegistry;
|
|
1532
|
-
declare const defaultSystemReminderRegistry: SystemReminderRegistry;
|
|
1533
|
-
|
|
1534
|
-
/**
|
|
1535
|
-
* @file packages/linnkit/src/runtime-kernel/system-reminder/apply.ts
|
|
1536
|
-
* @description 普通 tick SystemReminder 注入引擎
|
|
1537
|
-
*
|
|
1538
|
-
* 关键约束(根因级):
|
|
1539
|
-
* - 这里的注入只发生在“即将发给 LLM 的 messages”数组上
|
|
1540
|
-
* - 不生成 RuntimeEvent,不写入 history,不进入数据库(下一次 request 不可回放)
|
|
1541
|
-
* - 普通 Reminder 允许出现在 LLMRunAudit(after_context_manager)里,因为它属于本次真实输入
|
|
1542
|
-
* - 压缩专用 Reminder 由 Graph compaction feature 追加为末尾 user message,不经过本文件注入
|
|
1543
|
-
*/
|
|
1544
|
-
|
|
1545
|
-
/**
|
|
1546
|
-
* 将普通 system-reminder 追加到最后一条消息末尾(返回新数组,不修改原数组)
|
|
1547
|
-
*/
|
|
1548
|
-
declare function applySystemReminders(params: {
|
|
1549
|
-
llmMessages: LlmRequestMessage[];
|
|
1550
|
-
ctx: SystemReminderContext;
|
|
1551
|
-
rules?: ReadonlyArray<SystemReminderRule>;
|
|
1552
|
-
policy?: AgentSpecSystemReminderPolicy;
|
|
1553
|
-
registry?: SystemReminderRegistry;
|
|
1554
|
-
/**
|
|
1555
|
-
* 🔔 命中回调:仅当本次确实发生注入时触发
|
|
1556
|
-
*
|
|
1557
|
-
* 中文备注:
|
|
1558
|
-
* - 用于“审计增强”:在 after_context_manager 覆盖写语义下,仍能保留命中时刻的快照;
|
|
1559
|
-
* - 回调只传递最小信息(ruleIds),避免额外依赖和体积膨胀。
|
|
1560
|
-
*/
|
|
1561
|
-
onInjected?: (info: {
|
|
1562
|
-
ruleIds: string[];
|
|
1563
|
-
}) => void;
|
|
1564
|
-
}): LlmRequestMessage[];
|
|
1565
|
-
|
|
1566
|
-
declare function readNonEmptyStrings(value: unknown): string[];
|
|
1567
|
-
declare function toDisplayStep(nodeSwitches: number): number;
|
|
1568
|
-
/**
|
|
1569
|
-
* 统计“本轮请求内”的工具调用次数(LLM 决策层)。
|
|
1570
|
-
*
|
|
1571
|
-
* 中文备注:只统计最后一个 user_input 之后的 tool_call_decision,避免旧事件或 ToolNode
|
|
1572
|
-
* 复用 action 语义时把同一轮工具调用重复计数。
|
|
1573
|
-
*/
|
|
1574
|
-
declare function countToolCallsInCurrentRequest(history: ReadonlyArray<unknown>): number;
|
|
1575
|
-
|
|
1576
|
-
/**
|
|
1577
|
-
* @file packages/linnkit/src/runtime-kernel/system-reminder/rules.ts
|
|
1578
|
-
* @description SystemReminder 规则集合(注册式配置入口)
|
|
1579
|
-
*
|
|
1580
|
-
* 中文备注:
|
|
1581
|
-
* - 内置规则也走 trigger + template,和 host extraRules 使用同一套解释链路;
|
|
1582
|
-
* - spec 只引用 rule/template/trigger ID,不塞函数,保证可序列化、可回放、可审计。
|
|
1583
|
-
*/
|
|
1584
|
-
|
|
1585
|
-
declare const SYSTEM_REMINDER_RULES: ReadonlyArray<SystemReminderRuleDefinition>;
|
|
1586
|
-
declare function createSystemReminderRules(params?: {
|
|
1587
|
-
policy?: AgentSpecSystemReminderPolicy;
|
|
1588
|
-
registry?: SystemReminderRegistry;
|
|
1589
|
-
}): ReadonlyArray<SystemReminderRule>;
|
|
1590
|
-
|
|
1591
|
-
declare const maxStepsForceFinalAnswerTemplate: SystemReminderContentTemplate;
|
|
1592
|
-
declare const lastStepsHintTemplate: SystemReminderContentTemplate;
|
|
1593
|
-
declare const toolCallStreakTemplate: SystemReminderContentTemplate;
|
|
1594
|
-
declare const periodicProgressReflectionTemplate: SystemReminderContentTemplate;
|
|
1595
|
-
declare const hostReminderTextTemplate: SystemReminderContentTemplate;
|
|
1596
|
-
declare const BUILTIN_SYSTEM_REMINDER_TEMPLATES: Record<string, SystemReminderContentTemplate>;
|
|
1597
|
-
|
|
1598
|
-
declare const phaseEqualsTrigger: SystemReminderTriggerEvaluator;
|
|
1599
|
-
declare const remainingStepsLeqTrigger: SystemReminderTriggerEvaluator;
|
|
1600
|
-
declare const stepCountModuloTrigger: SystemReminderTriggerEvaluator;
|
|
1601
|
-
declare const toolCallStreakTrigger: SystemReminderTriggerEvaluator;
|
|
1602
|
-
declare const agentHasToolTrigger: SystemReminderTriggerEvaluator;
|
|
1603
|
-
declare const BUILTIN_SYSTEM_REMINDER_TRIGGERS: Record<string, SystemReminderTriggerEvaluator>;
|
|
1604
|
-
|
|
1605
|
-
declare const index$2_BUILTIN_SYSTEM_REMINDER_TEMPLATES: typeof BUILTIN_SYSTEM_REMINDER_TEMPLATES;
|
|
1606
|
-
declare const index$2_BUILTIN_SYSTEM_REMINDER_TRIGGERS: typeof BUILTIN_SYSTEM_REMINDER_TRIGGERS;
|
|
1607
|
-
declare const index$2_SYSTEM_REMINDER_RULES: typeof SYSTEM_REMINDER_RULES;
|
|
1608
|
-
type index$2_SystemReminderContentTemplate = SystemReminderContentTemplate;
|
|
1609
|
-
type index$2_SystemReminderContext = SystemReminderContext;
|
|
1610
|
-
type index$2_SystemReminderRegistry = SystemReminderRegistry;
|
|
1611
|
-
declare const index$2_SystemReminderRegistry: typeof SystemReminderRegistry;
|
|
1612
|
-
type index$2_SystemReminderRule = SystemReminderRule;
|
|
1613
|
-
type index$2_SystemReminderRuleDefinition = SystemReminderRuleDefinition;
|
|
1614
|
-
type index$2_SystemReminderTriggerEvaluator = SystemReminderTriggerEvaluator;
|
|
1615
|
-
declare const index$2_agentHasToolTrigger: typeof agentHasToolTrigger;
|
|
1616
|
-
declare const index$2_applySystemReminders: typeof applySystemReminders;
|
|
1617
|
-
declare const index$2_countToolCallsInCurrentRequest: typeof countToolCallsInCurrentRequest;
|
|
1618
|
-
declare const index$2_createDefaultSystemReminderRegistry: typeof createDefaultSystemReminderRegistry;
|
|
1619
|
-
declare const index$2_createSystemReminderRules: typeof createSystemReminderRules;
|
|
1620
|
-
declare const index$2_defaultSystemReminderRegistry: typeof defaultSystemReminderRegistry;
|
|
1621
|
-
declare const index$2_hostReminderTextTemplate: typeof hostReminderTextTemplate;
|
|
1622
|
-
declare const index$2_lastStepsHintTemplate: typeof lastStepsHintTemplate;
|
|
1623
|
-
declare const index$2_maxStepsForceFinalAnswerTemplate: typeof maxStepsForceFinalAnswerTemplate;
|
|
1624
|
-
declare const index$2_periodicProgressReflectionTemplate: typeof periodicProgressReflectionTemplate;
|
|
1625
|
-
declare const index$2_phaseEqualsTrigger: typeof phaseEqualsTrigger;
|
|
1626
|
-
declare const index$2_readNonEmptyStrings: typeof readNonEmptyStrings;
|
|
1627
|
-
declare const index$2_remainingStepsLeqTrigger: typeof remainingStepsLeqTrigger;
|
|
1628
|
-
declare const index$2_stepCountModuloTrigger: typeof stepCountModuloTrigger;
|
|
1629
|
-
declare const index$2_toDisplayStep: typeof toDisplayStep;
|
|
1630
|
-
declare const index$2_toolCallStreakTemplate: typeof toolCallStreakTemplate;
|
|
1631
|
-
declare const index$2_toolCallStreakTrigger: typeof toolCallStreakTrigger;
|
|
1632
|
-
declare namespace index$2 {
|
|
1633
|
-
export { index$2_BUILTIN_SYSTEM_REMINDER_TEMPLATES as BUILTIN_SYSTEM_REMINDER_TEMPLATES, index$2_BUILTIN_SYSTEM_REMINDER_TRIGGERS as BUILTIN_SYSTEM_REMINDER_TRIGGERS, index$2_SYSTEM_REMINDER_RULES as SYSTEM_REMINDER_RULES, type index$2_SystemReminderContentTemplate as SystemReminderContentTemplate, type index$2_SystemReminderContext as SystemReminderContext, index$2_SystemReminderRegistry as SystemReminderRegistry, type index$2_SystemReminderRule as SystemReminderRule, type index$2_SystemReminderRuleDefinition as SystemReminderRuleDefinition, type index$2_SystemReminderTriggerEvaluator as SystemReminderTriggerEvaluator, index$2_agentHasToolTrigger as agentHasToolTrigger, index$2_applySystemReminders as applySystemReminders, index$2_countToolCallsInCurrentRequest as countToolCallsInCurrentRequest, index$2_createDefaultSystemReminderRegistry as createDefaultSystemReminderRegistry, index$2_createSystemReminderRules as createSystemReminderRules, index$2_defaultSystemReminderRegistry as defaultSystemReminderRegistry, index$2_hostReminderTextTemplate as hostReminderTextTemplate, index$2_lastStepsHintTemplate as lastStepsHintTemplate, index$2_maxStepsForceFinalAnswerTemplate as maxStepsForceFinalAnswerTemplate, index$2_periodicProgressReflectionTemplate as periodicProgressReflectionTemplate, index$2_phaseEqualsTrigger as phaseEqualsTrigger, index$2_readNonEmptyStrings as readNonEmptyStrings, index$2_remainingStepsLeqTrigger as remainingStepsLeqTrigger, index$2_stepCountModuloTrigger as stepCountModuloTrigger, index$2_toDisplayStep as toDisplayStep, index$2_toolCallStreakTemplate as toolCallStreakTemplate, index$2_toolCallStreakTrigger as toolCallStreakTrigger };
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
type LedgerEntryScope = Pick<LlmUsageTokenLedgerEntry, 'runId' | 'parentRunId' | 'conversationId' | 'turnId' | 'stepId' | 'route' | 'createdAt'>;
|
|
1637
|
-
interface CreateLlmUsageLedgerEntryInput extends LedgerEntryScope {
|
|
1638
|
-
id: string;
|
|
1639
|
-
modelId?: string;
|
|
1640
|
-
usage: CanonicalLlmUsage;
|
|
1641
|
-
}
|
|
1642
|
-
interface CreateContextComponentLedgerEntryInput extends LedgerEntryScope {
|
|
1643
|
-
id: string;
|
|
1644
|
-
components: readonly ContextTokenComponent[];
|
|
1645
|
-
}
|
|
1646
|
-
declare function aggregateCanonicalUsage(usages: readonly CanonicalLlmUsage[]): TokenUsageTotals | undefined;
|
|
1647
|
-
declare function createLlmUsageLedgerEntry(input: CreateLlmUsageLedgerEntryInput): LlmUsageTokenLedgerEntry;
|
|
1648
|
-
declare function createContextComponentLedgerEntry(input: CreateContextComponentLedgerEntryInput): ContextComponentTokenLedgerEntry;
|
|
1649
|
-
declare function addUsageTotals(left: TokenUsageTotals | undefined, right: TokenUsageTotals | undefined): TokenUsageTotals | undefined;
|
|
1650
|
-
declare function addLedgerAggregate(left: TokenLedgerAggregate, right: TokenLedgerAggregate): TokenLedgerAggregate;
|
|
1651
|
-
declare function aggregateTokenLedgerEntries(entries: readonly TokenLedgerEntry[]): TokenLedgerAggregate;
|
|
1652
|
-
declare function createRunTokenUsageAggregate(input: {
|
|
1653
|
-
ownEntries: readonly TokenLedgerEntry[];
|
|
1654
|
-
childAggregates?: readonly TokenLedgerAggregate[];
|
|
1655
|
-
}): RunTokenUsageAggregate;
|
|
1656
|
-
declare function computeCost(usage: CanonicalLlmUsage, pricing?: TokenPricing): CostBreakdown;
|
|
1657
|
-
|
|
1658
|
-
type index$1_CreateContextComponentLedgerEntryInput = CreateContextComponentLedgerEntryInput;
|
|
1659
|
-
type index$1_CreateLlmUsageLedgerEntryInput = CreateLlmUsageLedgerEntryInput;
|
|
1660
|
-
declare const index$1_addLedgerAggregate: typeof addLedgerAggregate;
|
|
1661
|
-
declare const index$1_addUsageTotals: typeof addUsageTotals;
|
|
1662
|
-
declare const index$1_aggregateCanonicalUsage: typeof aggregateCanonicalUsage;
|
|
1663
|
-
declare const index$1_aggregateTokenLedgerEntries: typeof aggregateTokenLedgerEntries;
|
|
1664
|
-
declare const index$1_computeCost: typeof computeCost;
|
|
1665
|
-
declare const index$1_createContextComponentLedgerEntry: typeof createContextComponentLedgerEntry;
|
|
1666
|
-
declare const index$1_createLlmUsageLedgerEntry: typeof createLlmUsageLedgerEntry;
|
|
1667
|
-
declare const index$1_createRunTokenUsageAggregate: typeof createRunTokenUsageAggregate;
|
|
1668
|
-
declare namespace index$1 {
|
|
1669
|
-
export { type index$1_CreateContextComponentLedgerEntryInput as CreateContextComponentLedgerEntryInput, type index$1_CreateLlmUsageLedgerEntryInput as CreateLlmUsageLedgerEntryInput, index$1_addLedgerAggregate as addLedgerAggregate, index$1_addUsageTotals as addUsageTotals, index$1_aggregateCanonicalUsage as aggregateCanonicalUsage, index$1_aggregateTokenLedgerEntries as aggregateTokenLedgerEntries, index$1_computeCost as computeCost, index$1_createContextComponentLedgerEntry as createContextComponentLedgerEntry, index$1_createLlmUsageLedgerEntry as createLlmUsageLedgerEntry, index$1_createRunTokenUsageAggregate as createRunTokenUsageAggregate };
|
|
1670
|
-
}
|
|
1671
|
-
|
|
1672
|
-
/**
|
|
1673
|
-
* @file src/agent/shared/errorClassifier.ts
|
|
1674
|
-
*
|
|
1675
|
-
* @brief Agent runtime 自己拥有的错误分类器
|
|
1676
|
-
*
|
|
1677
|
-
* @description
|
|
1678
|
-
* 错误分类与重试策略属于 Agent runtime 的执行协议,不应该继续由 app shared owner 持有。
|
|
1679
|
-
*/
|
|
1680
|
-
declare enum ErrorCategory {
|
|
1681
|
-
RETRYABLE = "retryable",
|
|
1682
|
-
NON_RETRYABLE = "non_retryable",
|
|
1683
|
-
RATE_LIMIT = "rate_limit"
|
|
1684
|
-
}
|
|
1685
|
-
declare const ENGINE_ERROR_CODES: {
|
|
1686
|
-
readonly LLM_RATE_LIMIT: "llm.rate_limit";
|
|
1687
|
-
readonly LLM_INVALID_TOOL_ARGS: "llm.invalid_tool_args";
|
|
1688
|
-
readonly LLM_PROVIDER_DOWN: "llm.provider_down";
|
|
1689
|
-
readonly LLM_UNSUPPORTED_CAPABILITY: "llm.unsupported_capability";
|
|
1690
|
-
readonly LLM_AUTH_FAILED: "llm.auth_failed";
|
|
1691
|
-
readonly LLM_INVALID_REQUEST: "llm.invalid_request";
|
|
1692
|
-
readonly LLM_RESOURCE_NOT_FOUND: "llm.resource_not_found";
|
|
1693
|
-
readonly LLM_OUTPUT_LIMIT_REACHED: "llm.output_limit_reached";
|
|
1694
|
-
readonly LLM_CONTENT_FILTERED: "llm.content_filtered";
|
|
1695
|
-
readonly TOOL_TIMEOUT: "tool.timeout";
|
|
1696
|
-
readonly TOOL_PROTOCOL_FUSE: "tool.protocol_fuse";
|
|
1697
|
-
readonly ENGINE_DELEGATE_DEPTH: "engine.delegate_depth_exceeded";
|
|
1698
|
-
readonly ENGINE_BUDGET_EXHAUSTED: "engine.budget_exhausted";
|
|
1699
|
-
readonly ENGINE_UNKNOWN: "engine.unknown";
|
|
1700
|
-
};
|
|
1701
|
-
interface ErrorClassification {
|
|
1702
|
-
category: ErrorCategory;
|
|
1703
|
-
reason: string;
|
|
1704
|
-
suggestedDelay: number | null;
|
|
1705
|
-
errorCode: string;
|
|
1706
|
-
recoverable: boolean;
|
|
1707
|
-
retryAfterMs?: number;
|
|
1708
|
-
hint?: string;
|
|
1709
|
-
metadata?: Record<string, unknown>;
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
declare const index_AdapterInputSupport: typeof AdapterInputSupport;
|
|
1713
|
-
declare const index_AgentTool: typeof AgentTool;
|
|
1714
|
-
type index_AuditEnvelopePersistenceError = AuditEnvelopePersistenceError;
|
|
1715
|
-
declare const index_AuditEnvelopePersistenceError: typeof AuditEnvelopePersistenceError;
|
|
1716
|
-
declare const index_BUILTIN_SYSTEM_REMINDER_TEMPLATES: typeof BUILTIN_SYSTEM_REMINDER_TEMPLATES;
|
|
1717
|
-
declare const index_BUILTIN_SYSTEM_REMINDER_TRIGGERS: typeof BUILTIN_SYSTEM_REMINDER_TRIGGERS;
|
|
1718
|
-
declare const index_BaseTool: typeof BaseTool;
|
|
1719
|
-
type index_CanonicalInferenceStreamState = CanonicalInferenceStreamState;
|
|
1720
|
-
type index_CanonicalInferenceTerminal = CanonicalInferenceTerminal;
|
|
1721
|
-
declare const index_CheckpointListFilter: typeof CheckpointListFilter;
|
|
1722
|
-
declare const index_CheckpointMeta: typeof CheckpointMeta;
|
|
1723
|
-
declare const index_CheckpointSummary: typeof CheckpointSummary;
|
|
1724
|
-
declare const index_Checkpointer: typeof Checkpointer;
|
|
1725
|
-
type index_ChildRunParentTraceProjection = ChildRunParentTraceProjection;
|
|
1726
|
-
declare const index_ChildRunParentTraceProjection: typeof ChildRunParentTraceProjection;
|
|
1727
|
-
type index_ChildRunParentTraceProjectionOptions = ChildRunParentTraceProjectionOptions;
|
|
1728
|
-
declare const index_CommonParameterTypes: typeof CommonParameterTypes;
|
|
1729
|
-
declare const index_CompleteToolModelInputParams: typeof CompleteToolModelInputParams;
|
|
1730
|
-
type index_CompositeAuditOptions = CompositeAuditOptions;
|
|
1731
|
-
type index_CompositeAuditPort = CompositeAuditPort;
|
|
1732
|
-
declare const index_CompositeAuditPort: typeof CompositeAuditPort;
|
|
1733
|
-
type index_ConsoleAuditOptions = ConsoleAuditOptions;
|
|
1734
|
-
type index_CreateContextComponentLedgerEntryInput = CreateContextComponentLedgerEntryInput;
|
|
1735
|
-
type index_CreateLlmUsageLedgerEntryInput = CreateLlmUsageLedgerEntryInput;
|
|
1736
|
-
declare const index_DefaultGraphExecutorOptions: typeof DefaultGraphExecutorOptions;
|
|
1737
|
-
type index_DefaultTokenizerPort = DefaultTokenizerPort;
|
|
1738
|
-
declare const index_DefaultTokenizerPort: typeof DefaultTokenizerPort;
|
|
1739
|
-
type index_DefaultTokenizerPortConfig = DefaultTokenizerPortConfig;
|
|
1740
|
-
declare const index_EMPTY_MODEL_INPUT_REQUIREMENT: typeof EMPTY_MODEL_INPUT_REQUIREMENT;
|
|
1741
|
-
declare const index_ENGINE_ERROR_CODES: typeof ENGINE_ERROR_CODES;
|
|
1742
|
-
declare const index_ENGINE_STATE_SCHEMA_VERSION: typeof ENGINE_STATE_SCHEMA_VERSION;
|
|
1743
|
-
declare const index_EffectivePromptBudget: typeof EffectivePromptBudget;
|
|
1744
|
-
type index_EmitAuditEnvelopeParams = EmitAuditEnvelopeParams;
|
|
1745
|
-
declare const index_EngineState: typeof EngineState;
|
|
1746
|
-
type index_EnrichmentContext = EnrichmentContext;
|
|
1747
|
-
type index_EnrichmentResult = EnrichmentResult;
|
|
1748
|
-
type index_ErrorClassification = ErrorClassification;
|
|
1749
|
-
declare const index_EventRangeOptions: typeof EventRangeOptions;
|
|
1750
|
-
declare const index_EventStore: typeof EventStore;
|
|
1751
|
-
type index_EventStoreAuditOptions = EventStoreAuditOptions;
|
|
1752
|
-
type index_EventStoreAuditPort = EventStoreAuditPort;
|
|
1753
|
-
declare const index_EventStoreAuditPort: typeof EventStoreAuditPort;
|
|
1754
|
-
declare const index_ExecutorLlmInvocationKind: typeof ExecutorLlmInvocationKind;
|
|
1755
|
-
declare const index_ExecutorLocalPatch: typeof ExecutorLocalPatch;
|
|
1756
|
-
declare const index_ExecutorLocalState: typeof ExecutorLocalState;
|
|
1757
|
-
type index_FileAuditOptions = FileAuditOptions;
|
|
1758
|
-
type index_FileAuditPort = FileAuditPort;
|
|
1759
|
-
declare const index_FileAuditPort: typeof FileAuditPort;
|
|
1760
|
-
declare const index_FunctionToolSchema: typeof FunctionToolSchema;
|
|
1761
|
-
type index_GraphAgentExecutor = GraphAgentExecutor;
|
|
1762
|
-
declare const index_GraphAgentExecutor: typeof GraphAgentExecutor;
|
|
1763
|
-
type index_GraphAgentExecutorDependencies = GraphAgentExecutorDependencies;
|
|
1764
|
-
type index_GraphContextCompactionCandidate = GraphContextCompactionCandidate;
|
|
1765
|
-
declare const index_GraphExecutor: typeof GraphExecutor;
|
|
1766
|
-
type index_GraphExecutorContextApplyInput = GraphExecutorContextApplyInput;
|
|
1767
|
-
type index_GraphExecutorContextApplyOutput = GraphExecutorContextApplyOutput;
|
|
1768
|
-
type index_GraphExecutorContextBuildInput = GraphExecutorContextBuildInput;
|
|
1769
|
-
type index_GraphExecutorContextBuildOutput = GraphExecutorContextBuildOutput;
|
|
1770
|
-
type index_GraphExecutorContextBuilder = GraphExecutorContextBuilder;
|
|
1771
|
-
type index_GraphExecutorOutputProcessor = GraphExecutorOutputProcessor;
|
|
1772
|
-
declare const index_GraphLoopHarness: typeof GraphLoopHarness;
|
|
1773
|
-
declare const index_GraphLoopHarnessOptions: typeof GraphLoopHarnessOptions;
|
|
1774
|
-
declare const index_GraphLoopHarnessRunResult: typeof GraphLoopHarnessRunResult;
|
|
1775
|
-
declare const index_GraphLoopLlmNodeFactoryParams: typeof GraphLoopLlmNodeFactoryParams;
|
|
1776
|
-
declare const index_GraphNode: typeof GraphNode;
|
|
1777
|
-
type index_HostToolCallBootstrap = HostToolCallBootstrap;
|
|
1778
|
-
type index_HostToolCallBootstrapInput = HostToolCallBootstrapInput;
|
|
1779
|
-
type index_HostToolCallBootstrapLocalPatch = HostToolCallBootstrapLocalPatch;
|
|
1780
|
-
declare const index_INITIAL_CANONICAL_INFERENCE_STREAM_STATE: typeof INITIAL_CANONICAL_INFERENCE_STREAM_STATE;
|
|
1781
|
-
declare const index_JsonSchemaValue: typeof JsonSchemaValue;
|
|
1782
|
-
declare const index_LLMPolicy: typeof LLMPolicy;
|
|
1783
|
-
type index_LLMPolicyEngine = LLMPolicyEngine;
|
|
1784
|
-
declare const index_LLMPolicyEngine: typeof LLMPolicyEngine;
|
|
1785
|
-
declare const index_LLMPolicyErrorDecision: typeof LLMPolicyErrorDecision;
|
|
1786
|
-
declare const index_LLMPolicyMatchContext: typeof LLMPolicyMatchContext;
|
|
1787
|
-
declare const index_LLM_IMAGE_INPUT_ERROR_CODES: typeof LLM_IMAGE_INPUT_ERROR_CODES;
|
|
1788
|
-
declare const index_LLM_MODEL_ELIGIBILITY_ERROR_CODE: typeof LLM_MODEL_ELIGIBILITY_ERROR_CODE;
|
|
1789
|
-
declare const index_LlmCallInvocationContext: typeof LlmCallInvocationContext;
|
|
1790
|
-
declare const index_LlmCallOptions: typeof LlmCallOptions;
|
|
1791
|
-
declare const index_LlmCaller: typeof LlmCaller;
|
|
1792
|
-
declare const index_LlmFallbackObserver: typeof LlmFallbackObserver;
|
|
1793
|
-
type index_LlmImageInputError = LlmImageInputError;
|
|
1794
|
-
declare const index_LlmImageInputError: typeof LlmImageInputError;
|
|
1795
|
-
type index_LlmImageInputErrorCode = LlmImageInputErrorCode;
|
|
1796
|
-
type index_LlmImageInputErrorMetadata = LlmImageInputErrorMetadata;
|
|
1797
|
-
type index_LlmImageInputLimitKind = LlmImageInputLimitKind;
|
|
1798
|
-
type index_LlmModelEligibilityError = LlmModelEligibilityError;
|
|
1799
|
-
declare const index_LlmModelEligibilityError: typeof LlmModelEligibilityError;
|
|
1800
|
-
type index_LlmNode = LlmNode;
|
|
1801
|
-
declare const index_LlmNode: typeof LlmNode;
|
|
1802
|
-
declare const index_LlmRequestMessage: typeof LlmRequestMessage;
|
|
1803
|
-
declare const index_LlmRetryConfig: typeof LlmRetryConfig;
|
|
1804
|
-
declare const index_MODEL_INPUT_ERROR_CODES: typeof MODEL_INPUT_ERROR_CODES;
|
|
1805
|
-
declare const index_MODEL_INPUT_PLACEMENTS: typeof MODEL_INPUT_PLACEMENTS;
|
|
1806
|
-
type index_MemoryCheckpointer = MemoryCheckpointer;
|
|
1807
|
-
declare const index_MemoryCheckpointer: typeof MemoryCheckpointer;
|
|
1808
|
-
declare const index_MemoryEventStore: typeof MemoryEventStore;
|
|
1809
|
-
declare const index_ModelCatalogEntry: typeof ModelCatalogEntry;
|
|
1810
|
-
declare const index_ModelCatalogLike: typeof ModelCatalogLike;
|
|
1811
|
-
declare const index_ModelFallbackAppliedInfo: typeof ModelFallbackAppliedInfo;
|
|
1812
|
-
declare const index_ModelFallbackPolicy: typeof ModelFallbackPolicy;
|
|
1813
|
-
declare const index_ModelFallbackRejectedInfo: typeof ModelFallbackRejectedInfo;
|
|
1814
|
-
type index_ModelInputCapabilityError = ModelInputCapabilityError;
|
|
1815
|
-
declare const index_ModelInputCapabilityError: typeof ModelInputCapabilityError;
|
|
1816
|
-
declare const index_ModelInputCompatibility: typeof ModelInputCompatibility;
|
|
1817
|
-
type index_ModelInputErrorCode = ModelInputErrorCode;
|
|
1818
|
-
type index_ModelInputErrorMetadata = ModelInputErrorMetadata;
|
|
1819
|
-
declare const index_ModelInputIncompatibilityReason: typeof ModelInputIncompatibilityReason;
|
|
1820
|
-
declare const index_ModelInputPlacement: typeof ModelInputPlacement;
|
|
1821
|
-
declare const index_ModelInputRequirement: typeof ModelInputRequirement;
|
|
1822
|
-
declare const index_ModelReasoningConfig: typeof ModelReasoningConfig;
|
|
1823
|
-
declare const index_ModelResolver: typeof ModelResolver;
|
|
1824
|
-
declare const index_ObservationPreviewContext: typeof ObservationPreviewContext;
|
|
1825
|
-
declare const index_ObservationPreviewMeta: typeof ObservationPreviewMeta;
|
|
1826
|
-
declare const index_ObservationPreviewPort: typeof ObservationPreviewPort;
|
|
1827
|
-
declare const index_ObservationPreviewResult: typeof ObservationPreviewResult;
|
|
1828
|
-
declare const index_PRIMARY_PROMPT_CAPACITY_ERROR_CODE: typeof PRIMARY_PROMPT_CAPACITY_ERROR_CODE;
|
|
1829
|
-
declare const index_PersistedEvent: typeof PersistedEvent;
|
|
1830
|
-
type index_PrimaryPromptCapacityAdmission = PrimaryPromptCapacityAdmission;
|
|
1831
|
-
type index_PrimaryPromptCapacityError = PrimaryPromptCapacityError;
|
|
1832
|
-
declare const index_PrimaryPromptCapacityError: typeof PrimaryPromptCapacityError;
|
|
1833
|
-
type index_PrimaryPromptCapacityErrorMetadata = PrimaryPromptCapacityErrorMetadata;
|
|
1834
|
-
declare const index_ProviderContinuation: typeof ProviderContinuation;
|
|
1835
|
-
declare const index_REASONING_EFFORTS: typeof REASONING_EFFORTS;
|
|
1836
|
-
declare const index_ReasoningEffort: typeof ReasoningEffort;
|
|
1837
|
-
type index_RegistryEnrichmentResult = RegistryEnrichmentResult;
|
|
1838
|
-
type index_RequestEnricher = RequestEnricher;
|
|
1839
|
-
declare const index_ResolveEffectivePromptBudgetInput: typeof ResolveEffectivePromptBudgetInput;
|
|
1840
|
-
declare const index_ResolveToolModelInputParams: typeof ResolveToolModelInputParams;
|
|
1841
|
-
declare const index_RuntimeEventCommitPort: typeof RuntimeEventCommitPort;
|
|
1842
|
-
declare const index_RuntimeEventSink: typeof RuntimeEventSink;
|
|
1843
|
-
type index_RuntimeEventSubRunTracePublisher = RuntimeEventSubRunTracePublisher;
|
|
1844
|
-
declare const index_RuntimeEventSubRunTracePublisher: typeof RuntimeEventSubRunTracePublisher;
|
|
1845
|
-
type index_RuntimeEventSubRunTracePublisherOptions = RuntimeEventSubRunTracePublisherOptions;
|
|
1846
|
-
declare const index_RuntimeFailureFact: typeof RuntimeFailureFact;
|
|
1847
|
-
declare const index_RuntimeFailureFactSink: typeof RuntimeFailureFactSink;
|
|
1848
|
-
declare const index_SYSTEM_REMINDER_RULES: typeof SYSTEM_REMINDER_RULES;
|
|
1849
|
-
declare const index_StructuredToolResult: typeof StructuredToolResult;
|
|
1850
|
-
declare const index_SubRunTraceEnvelope: typeof SubRunTraceEnvelope;
|
|
1851
|
-
declare const index_SubRunTracePublisher: typeof SubRunTracePublisher;
|
|
1852
|
-
type index_SystemReminderContentTemplate = SystemReminderContentTemplate;
|
|
1853
|
-
type index_SystemReminderContext = SystemReminderContext;
|
|
1854
|
-
type index_SystemReminderRegistry = SystemReminderRegistry;
|
|
1855
|
-
declare const index_SystemReminderRegistry: typeof SystemReminderRegistry;
|
|
1856
|
-
type index_SystemReminderRule = SystemReminderRule;
|
|
1857
|
-
type index_SystemReminderRuleDefinition = SystemReminderRuleDefinition;
|
|
1858
|
-
type index_SystemReminderTriggerEvaluator = SystemReminderTriggerEvaluator;
|
|
1859
|
-
declare const index_ToolArgs: typeof ToolArgs;
|
|
1860
|
-
declare const index_ToolBatchCompletionMode: typeof ToolBatchCompletionMode;
|
|
1861
|
-
declare const index_ToolCall: typeof ToolCall;
|
|
1862
|
-
declare const index_ToolCallResult: typeof ToolCallResult;
|
|
1863
|
-
declare const index_ToolCallStreamingPolicy: typeof ToolCallStreamingPolicy;
|
|
1864
|
-
declare const index_ToolCatalogPort: typeof ToolCatalogPort;
|
|
1865
|
-
declare const index_ToolContextConversationView: typeof ToolContextConversationView;
|
|
1866
|
-
declare const index_ToolContextPatch: typeof ToolContextPatch;
|
|
1867
|
-
declare const index_ToolControlInfo: typeof ToolControlInfo;
|
|
1868
|
-
declare const index_ToolExecutionContext: typeof ToolExecutionContext;
|
|
1869
|
-
declare const index_ToolExecutionPort: typeof ToolExecutionPort;
|
|
1870
|
-
declare const index_ToolExecutionResult: typeof ToolExecutionResult;
|
|
1871
|
-
declare const index_ToolModelInputAdmission: typeof ToolModelInputAdmission;
|
|
1872
|
-
declare const index_ToolModelInputAttachmentSelection: typeof ToolModelInputAttachmentSelection;
|
|
1873
|
-
declare const index_ToolModelInputCapabilityValidatorPort: typeof ToolModelInputCapabilityValidatorPort;
|
|
1874
|
-
declare const index_ToolModelInputDeclaration: typeof ToolModelInputDeclaration;
|
|
1875
|
-
type index_ToolModelInputDeclarationValidation = ToolModelInputDeclarationValidation;
|
|
1876
|
-
declare const index_ToolModelInputDelivery: typeof ToolModelInputDelivery;
|
|
1877
|
-
declare const index_ToolModelInputResolutionError: typeof ToolModelInputResolutionError;
|
|
1878
|
-
declare const index_ToolModelInputResolverPort: typeof ToolModelInputResolverPort;
|
|
1879
|
-
type index_ToolNode = ToolNode;
|
|
1880
|
-
declare const index_ToolNode: typeof ToolNode;
|
|
1881
|
-
declare const index_ToolObservationPreviewMeta: typeof ToolObservationPreviewMeta;
|
|
1882
|
-
declare const index_ToolParameterProperty: typeof ToolParameterProperty;
|
|
1883
|
-
declare const index_ToolParameterSchema: typeof ToolParameterSchema;
|
|
1884
|
-
type index_ToolParameterSchemaError = ToolParameterSchemaError;
|
|
1885
|
-
declare const index_ToolParameterSchemaError: typeof ToolParameterSchemaError;
|
|
1886
|
-
declare const index_ToolParameterType: typeof ToolParameterType;
|
|
1887
|
-
declare const index_ToolRegistryEntry: typeof ToolRegistryEntry;
|
|
1888
|
-
declare const index_ToolResult: typeof ToolResult;
|
|
1889
|
-
declare const index_ToolResultImageMedia: typeof ToolResultImageMedia;
|
|
1890
|
-
declare const index_ToolRuntimeDefinition: typeof ToolRuntimeDefinition;
|
|
1891
|
-
declare const index_ToolRuntimePort: typeof ToolRuntimePort;
|
|
1892
|
-
declare const index_ToolSchemaBuildRequest: typeof ToolSchemaBuildRequest;
|
|
1893
|
-
declare const index_UnifiedToolResult: typeof UnifiedToolResult;
|
|
1894
|
-
type index_UserNode = UserNode;
|
|
1895
|
-
declare const index_UserNode: typeof UserNode;
|
|
1896
|
-
type index_WaitUserNode = WaitUserNode;
|
|
1897
|
-
declare const index_WaitUserNode: typeof WaitUserNode;
|
|
1898
|
-
declare const index_addLedgerAggregate: typeof addLedgerAggregate;
|
|
1899
|
-
declare const index_addUsageTotals: typeof addUsageTotals;
|
|
1900
|
-
declare const index_advanceCanonicalInferenceStreamState: typeof advanceCanonicalInferenceStreamState;
|
|
1901
|
-
declare const index_agentHasToolTrigger: typeof agentHasToolTrigger;
|
|
1902
|
-
declare const index_aggregateCanonicalUsage: typeof aggregateCanonicalUsage;
|
|
1903
|
-
declare const index_aggregateTokenLedgerEntries: typeof aggregateTokenLedgerEntries;
|
|
1904
|
-
declare const index_applySystemReminders: typeof applySystemReminders;
|
|
1905
|
-
declare const index_assertModelInputCompatibility: typeof assertModelInputCompatibility;
|
|
1906
|
-
declare const index_assertToolParameterSchema: typeof assertToolParameterSchema;
|
|
1907
|
-
declare const index_computeCost: typeof computeCost;
|
|
1908
|
-
declare const index_computeToolIdempotencyKey: typeof computeToolIdempotencyKey;
|
|
1909
|
-
declare const index_consoleAudit: typeof consoleAudit;
|
|
1910
|
-
declare const index_consumeCanonicalInferenceStream: typeof consumeCanonicalInferenceStream;
|
|
1911
|
-
declare const index_copyToolContextRuntimeCapability: typeof copyToolContextRuntimeCapability;
|
|
1912
|
-
declare const index_countToolCallsInCurrentRequest: typeof countToolCallsInCurrentRequest;
|
|
1913
|
-
declare const index_createCompositeAudit: typeof createCompositeAudit;
|
|
1914
|
-
declare const index_createConsoleAudit: typeof createConsoleAudit;
|
|
1915
|
-
declare const index_createContextComponentLedgerEntry: typeof createContextComponentLedgerEntry;
|
|
1916
|
-
declare const index_createDefaultGraphExecutor: typeof createDefaultGraphExecutor;
|
|
1917
|
-
declare const index_createDefaultSystemReminderRegistry: typeof createDefaultSystemReminderRegistry;
|
|
1918
|
-
declare const index_createDefaultTokenizerPort: typeof createDefaultTokenizerPort;
|
|
1919
|
-
declare const index_createEventStoreAudit: typeof createEventStoreAudit;
|
|
1920
|
-
declare const index_createFileAudit: typeof createFileAudit;
|
|
1921
|
-
declare const index_createFixedChatModelCatalog: typeof createFixedChatModelCatalog;
|
|
1922
|
-
declare const index_createGraphLoopHarness: typeof createGraphLoopHarness;
|
|
1923
|
-
declare const index_createHostToolCallBootstrap: typeof createHostToolCallBootstrap;
|
|
1924
|
-
declare const index_createLlmUsageLedgerEntry: typeof createLlmUsageLedgerEntry;
|
|
1925
|
-
declare const index_createModelInputCompatibilityError: typeof createModelInputCompatibilityError;
|
|
1926
|
-
declare const index_createMonotonicEventStoreIdFactory: typeof createMonotonicEventStoreIdFactory;
|
|
1927
|
-
declare const index_createRunTokenUsageAggregate: typeof createRunTokenUsageAggregate;
|
|
1928
|
-
declare const index_createSystemReminderRules: typeof createSystemReminderRules;
|
|
1929
|
-
declare const index_defaultPolicyEngine: typeof defaultPolicyEngine;
|
|
1930
|
-
declare const index_defaultSystemReminderRegistry: typeof defaultSystemReminderRegistry;
|
|
1931
|
-
declare const index_deriveModelInputRequirement: typeof deriveModelInputRequirement;
|
|
1932
|
-
declare const index_emitAuditEnvelope: typeof emitAuditEnvelope;
|
|
1933
|
-
declare const index_emitSandboxDecisionAudit: typeof emitSandboxDecisionAudit;
|
|
1934
|
-
declare const index_ensureToolContextRuntimeCapability: typeof ensureToolContextRuntimeCapability;
|
|
1935
|
-
declare const index_evaluateModelInputCompatibility: typeof evaluateModelInputCompatibility;
|
|
1936
|
-
declare const index_evaluatePrimaryPromptCapacity: typeof evaluatePrimaryPromptCapacity;
|
|
1937
|
-
declare const index_findCachedToolOutputByIdempotencyKey: typeof findCachedToolOutputByIdempotencyKey;
|
|
1938
|
-
declare const index_getToolContextRuntimeBinding: typeof getToolContextRuntimeBinding;
|
|
1939
|
-
declare const index_hostReminderTextTemplate: typeof hostReminderTextTemplate;
|
|
1940
|
-
declare const index_isRuntimeFailureFact: typeof isRuntimeFailureFact;
|
|
1941
|
-
declare const index_isValidReasoningEffort: typeof isValidReasoningEffort;
|
|
1942
|
-
declare const index_lastStepsHintTemplate: typeof lastStepsHintTemplate;
|
|
1943
|
-
declare const index_listCompatibleModelIds: typeof listCompatibleModelIds;
|
|
1944
|
-
declare const index_maxStepsForceFinalAnswerTemplate: typeof maxStepsForceFinalAnswerTemplate;
|
|
1945
|
-
declare const index_noopAudit: typeof noopAudit;
|
|
1946
|
-
declare const index_normalizeToolArgs: typeof normalizeToolArgs;
|
|
1947
|
-
declare const index_parseToolModelInputDeclaration: typeof parseToolModelInputDeclaration;
|
|
1948
|
-
declare const index_periodicProgressReflectionTemplate: typeof periodicProgressReflectionTemplate;
|
|
1949
|
-
declare const index_phaseEqualsTrigger: typeof phaseEqualsTrigger;
|
|
1950
|
-
declare const index_projectChildRuntimeEventToSubRunTrace: typeof projectChildRuntimeEventToSubRunTrace;
|
|
1951
|
-
declare const index_readCheckpointContextUsage: typeof readCheckpointContextUsage;
|
|
1952
|
-
declare const index_readNonEmptyStrings: typeof readNonEmptyStrings;
|
|
1953
|
-
declare const index_readToolContextPersistedHistory: typeof readToolContextPersistedHistory;
|
|
1954
|
-
declare const index_readToolContextWorkingHistory: typeof readToolContextWorkingHistory;
|
|
1955
|
-
declare const index_remainingStepsLeqTrigger: typeof remainingStepsLeqTrigger;
|
|
1956
|
-
declare const index_requestEnricherRegistry: typeof requestEnricherRegistry;
|
|
1957
|
-
declare const index_requireEventStoreId: typeof requireEventStoreId;
|
|
1958
|
-
declare const index_resolveEffectiveEffort: typeof resolveEffectiveEffort;
|
|
1959
|
-
declare const index_resolveEffectivePromptBudget: typeof resolveEffectivePromptBudget;
|
|
1960
|
-
declare const index_resolveToolModelInput: typeof resolveToolModelInput;
|
|
1961
|
-
declare const index_stepCountModuloTrigger: typeof stepCountModuloTrigger;
|
|
1962
|
-
declare const index_stripRuntimeReservedToolContextPatch: typeof stripRuntimeReservedToolContextPatch;
|
|
1963
|
-
declare const index_summarizeCheckpoint: typeof summarizeCheckpoint;
|
|
1964
|
-
declare const index_toDisplayStep: typeof toDisplayStep;
|
|
1965
|
-
declare const index_toolCallStreakTemplate: typeof toolCallStreakTemplate;
|
|
1966
|
-
declare const index_toolCallStreakTrigger: typeof toolCallStreakTrigger;
|
|
1967
|
-
declare namespace index {
|
|
1968
|
-
export { index_AdapterInputSupport as AdapterInputSupport, index_AgentTool as AgentTool, index_AuditEnvelopePersistenceError as AuditEnvelopePersistenceError, index_BUILTIN_SYSTEM_REMINDER_TEMPLATES as BUILTIN_SYSTEM_REMINDER_TEMPLATES, index_BUILTIN_SYSTEM_REMINDER_TRIGGERS as BUILTIN_SYSTEM_REMINDER_TRIGGERS, index_BaseTool as BaseTool, type index_CanonicalInferenceStreamState as CanonicalInferenceStreamState, type index_CanonicalInferenceTerminal as CanonicalInferenceTerminal, index_CheckpointListFilter as CheckpointListFilter, index_CheckpointMeta as CheckpointMeta, index_CheckpointSummary as CheckpointSummary, index_Checkpointer as Checkpointer, index_ChildRunParentTraceProjection as ChildRunParentTraceProjection, type index_ChildRunParentTraceProjectionOptions as ChildRunParentTraceProjectionOptions, index_CommonParameterTypes as CommonParameterTypes, index_CompleteToolModelInputParams as CompleteToolModelInputParams, type index_CompositeAuditOptions as CompositeAuditOptions, index_CompositeAuditPort as CompositeAuditPort, type index_ConsoleAuditOptions as ConsoleAuditOptions, type index_CreateContextComponentLedgerEntryInput as CreateContextComponentLedgerEntryInput, type index_CreateLlmUsageLedgerEntryInput as CreateLlmUsageLedgerEntryInput, index_DefaultGraphExecutorOptions as DefaultGraphExecutorOptions, index_DefaultTokenizerPort as DefaultTokenizerPort, type index_DefaultTokenizerPortConfig as DefaultTokenizerPortConfig, index_EMPTY_MODEL_INPUT_REQUIREMENT as EMPTY_MODEL_INPUT_REQUIREMENT, index_ENGINE_ERROR_CODES as ENGINE_ERROR_CODES, index_ENGINE_STATE_SCHEMA_VERSION as ENGINE_STATE_SCHEMA_VERSION, index_EffectivePromptBudget as EffectivePromptBudget, type index_EmitAuditEnvelopeParams as EmitAuditEnvelopeParams, index_EngineState as EngineState, type index_EnrichmentContext as EnrichmentContext, type index_EnrichmentResult as EnrichmentResult, type index_ErrorClassification as ErrorClassification, index_EventRangeOptions as EventRangeOptions, index_EventStore as EventStore, type index_EventStoreAuditOptions as EventStoreAuditOptions, index_EventStoreAuditPort as EventStoreAuditPort, index_ExecutorLlmInvocationKind as ExecutorLlmInvocationKind, index_ExecutorLocalPatch as ExecutorLocalPatch, index_ExecutorLocalState as ExecutorLocalState, type index_FileAuditOptions as FileAuditOptions, index_FileAuditPort as FileAuditPort, index_FunctionToolSchema as FunctionToolSchema, index_GraphAgentExecutor as GraphAgentExecutor, type index_GraphAgentExecutorDependencies as GraphAgentExecutorDependencies, type index_GraphContextCompactionCandidate as GraphContextCompactionCandidate, index_GraphExecutor as GraphExecutor, type index_GraphExecutorContextApplyInput as GraphExecutorContextApplyInput, type index_GraphExecutorContextApplyOutput as GraphExecutorContextApplyOutput, type index_GraphExecutorContextBuildInput as GraphExecutorContextBuildInput, type index_GraphExecutorContextBuildOutput as GraphExecutorContextBuildOutput, type index_GraphExecutorContextBuilder as GraphExecutorContextBuilder, type index_GraphExecutorOutputProcessor as GraphExecutorOutputProcessor, index_GraphLoopHarness as GraphLoopHarness, index_GraphLoopHarnessOptions as GraphLoopHarnessOptions, index_GraphLoopHarnessRunResult as GraphLoopHarnessRunResult, index_GraphLoopLlmNodeFactoryParams as GraphLoopLlmNodeFactoryParams, index_GraphNode as GraphNode, type index_HostToolCallBootstrap as HostToolCallBootstrap, type index_HostToolCallBootstrapInput as HostToolCallBootstrapInput, type index_HostToolCallBootstrapLocalPatch as HostToolCallBootstrapLocalPatch, index_INITIAL_CANONICAL_INFERENCE_STREAM_STATE as INITIAL_CANONICAL_INFERENCE_STREAM_STATE, index_JsonSchemaValue as JsonSchemaValue, index_LLMPolicy as LLMPolicy, index_LLMPolicyEngine as LLMPolicyEngine, index_LLMPolicyErrorDecision as LLMPolicyErrorDecision, index_LLMPolicyMatchContext as LLMPolicyMatchContext, index_LLM_IMAGE_INPUT_ERROR_CODES as LLM_IMAGE_INPUT_ERROR_CODES, index_LLM_MODEL_ELIGIBILITY_ERROR_CODE as LLM_MODEL_ELIGIBILITY_ERROR_CODE, index_LlmCallInvocationContext as LlmCallInvocationContext, index_LlmCallOptions as LlmCallOptions, index_LlmCaller as LlmCaller, index_LlmFallbackObserver as LlmFallbackObserver, index_LlmImageInputError as LlmImageInputError, type index_LlmImageInputErrorCode as LlmImageInputErrorCode, type index_LlmImageInputErrorMetadata as LlmImageInputErrorMetadata, type index_LlmImageInputLimitKind as LlmImageInputLimitKind, index_LlmModelEligibilityError as LlmModelEligibilityError, index_LlmNode as LlmNode, index_LlmRequestMessage as LlmRequestMessage, index_LlmRetryConfig as LlmRetryConfig, index_MODEL_INPUT_ERROR_CODES as MODEL_INPUT_ERROR_CODES, index_MODEL_INPUT_PLACEMENTS as MODEL_INPUT_PLACEMENTS, index_MemoryCheckpointer as MemoryCheckpointer, index_MemoryEventStore as MemoryEventStore, index_ModelCatalogEntry as ModelCatalogEntry, index_ModelCatalogLike as ModelCatalogLike, index_ModelFallbackAppliedInfo as ModelFallbackAppliedInfo, index_ModelFallbackPolicy as ModelFallbackPolicy, index_ModelFallbackRejectedInfo as ModelFallbackRejectedInfo, index_ModelInputCapabilityError as ModelInputCapabilityError, index_ModelInputCompatibility as ModelInputCompatibility, type index_ModelInputErrorCode as ModelInputErrorCode, type index_ModelInputErrorMetadata as ModelInputErrorMetadata, index_ModelInputIncompatibilityReason as ModelInputIncompatibilityReason, index_ModelInputPlacement as ModelInputPlacement, index_ModelInputRequirement as ModelInputRequirement, index_ModelReasoningConfig as ModelReasoningConfig, index_ModelResolver as ModelResolver, index_ObservationPreviewContext as ObservationPreviewContext, index_ObservationPreviewMeta as ObservationPreviewMeta, index_ObservationPreviewPort as ObservationPreviewPort, index_ObservationPreviewResult as ObservationPreviewResult, index_PRIMARY_PROMPT_CAPACITY_ERROR_CODE as PRIMARY_PROMPT_CAPACITY_ERROR_CODE, index_PersistedEvent as PersistedEvent, type index_PrimaryPromptCapacityAdmission as PrimaryPromptCapacityAdmission, index_PrimaryPromptCapacityError as PrimaryPromptCapacityError, type index_PrimaryPromptCapacityErrorMetadata as PrimaryPromptCapacityErrorMetadata, index_ProviderContinuation as ProviderContinuation, index_REASONING_EFFORTS as REASONING_EFFORTS, index_ReasoningEffort as ReasoningEffort, type index_RegistryEnrichmentResult as RegistryEnrichmentResult, type index_RequestEnricher as RequestEnricher, index_ResolveEffectivePromptBudgetInput as ResolveEffectivePromptBudgetInput, index_ResolveToolModelInputParams as ResolveToolModelInputParams, index_RuntimeEventCommitPort as RuntimeEventCommitPort, index_RuntimeEventSink as RuntimeEventSink, index_RuntimeEventSubRunTracePublisher as RuntimeEventSubRunTracePublisher, type index_RuntimeEventSubRunTracePublisherOptions as RuntimeEventSubRunTracePublisherOptions, index_RuntimeFailureFact as RuntimeFailureFact, index_RuntimeFailureFactSink as RuntimeFailureFactSink, index_SYSTEM_REMINDER_RULES as SYSTEM_REMINDER_RULES, index_StructuredToolResult as StructuredToolResult, index_SubRunTraceEnvelope as SubRunTraceEnvelope, index_SubRunTracePublisher as SubRunTracePublisher, type index_SystemReminderContentTemplate as SystemReminderContentTemplate, type index_SystemReminderContext as SystemReminderContext, index_SystemReminderRegistry as SystemReminderRegistry, type index_SystemReminderRule as SystemReminderRule, type index_SystemReminderRuleDefinition as SystemReminderRuleDefinition, type index_SystemReminderTriggerEvaluator as SystemReminderTriggerEvaluator, index_ToolArgs as ToolArgs, index_ToolBatchCompletionMode as ToolBatchCompletionMode, index_ToolCall as ToolCall, index_ToolCallResult as ToolCallResult, index_ToolCallStreamingPolicy as ToolCallStreamingPolicy, index_ToolCatalogPort as ToolCatalogPort, index_ToolContextConversationView as ToolContextConversationView, index_ToolContextPatch as ToolContextPatch, index_ToolControlInfo as ToolControlInfo, index_ToolExecutionContext as ToolExecutionContext, index_ToolExecutionPort as ToolExecutionPort, index_ToolExecutionResult as ToolExecutionResult, index_ToolModelInputAdmission as ToolModelInputAdmission, index_ToolModelInputAttachmentSelection as ToolModelInputAttachmentSelection, index_ToolModelInputCapabilityValidatorPort as ToolModelInputCapabilityValidatorPort, index_ToolModelInputDeclaration as ToolModelInputDeclaration, type index_ToolModelInputDeclarationValidation as ToolModelInputDeclarationValidation, index_ToolModelInputDelivery as ToolModelInputDelivery, index_ToolModelInputResolutionError as ToolModelInputResolutionError, index_ToolModelInputResolverPort as ToolModelInputResolverPort, index_ToolNode as ToolNode, index_ToolObservationPreviewMeta as ToolObservationPreviewMeta, index_ToolParameterProperty as ToolParameterProperty, index_ToolParameterSchema as ToolParameterSchema, index_ToolParameterSchemaError as ToolParameterSchemaError, index_ToolParameterType as ToolParameterType, index_ToolRegistryEntry as ToolRegistryEntry, index_ToolResult as ToolResult, index_ToolResultImageMedia as ToolResultImageMedia, index_ToolRuntimeDefinition as ToolRuntimeDefinition, index_ToolRuntimePort as ToolRuntimePort, index_ToolSchemaBuildRequest as ToolSchemaBuildRequest, index_UnifiedToolResult as UnifiedToolResult, index_UserNode as UserNode, index_WaitUserNode as WaitUserNode, index_addLedgerAggregate as addLedgerAggregate, index_addUsageTotals as addUsageTotals, index_advanceCanonicalInferenceStreamState as advanceCanonicalInferenceStreamState, index_agentHasToolTrigger as agentHasToolTrigger, index_aggregateCanonicalUsage as aggregateCanonicalUsage, index_aggregateTokenLedgerEntries as aggregateTokenLedgerEntries, index_applySystemReminders as applySystemReminders, index_assertModelInputCompatibility as assertModelInputCompatibility, index_assertToolParameterSchema as assertToolParameterSchema, index$3 as audit, index$7 as childRunTrace, index$8 as childRuns, index_computeCost as computeCost, index_computeToolIdempotencyKey as computeToolIdempotencyKey, index_consoleAudit as consoleAudit, index_consumeCanonicalInferenceStream as consumeCanonicalInferenceStream, index_copyToolContextRuntimeCapability as copyToolContextRuntimeCapability, index_countToolCallsInCurrentRequest as countToolCallsInCurrentRequest, index_createCompositeAudit as createCompositeAudit, index_createConsoleAudit as createConsoleAudit, index_createContextComponentLedgerEntry as createContextComponentLedgerEntry, index_createDefaultGraphExecutor as createDefaultGraphExecutor, index_createDefaultSystemReminderRegistry as createDefaultSystemReminderRegistry, index_createDefaultTokenizerPort as createDefaultTokenizerPort, index_createEventStoreAudit as createEventStoreAudit, index_createFileAudit as createFileAudit, index_createFixedChatModelCatalog as createFixedChatModelCatalog, index_createGraphLoopHarness as createGraphLoopHarness, index_createHostToolCallBootstrap as createHostToolCallBootstrap, index_createLlmUsageLedgerEntry as createLlmUsageLedgerEntry, index_createModelInputCompatibilityError as createModelInputCompatibilityError, index_createMonotonicEventStoreIdFactory as createMonotonicEventStoreIdFactory, index_createRunTokenUsageAggregate as createRunTokenUsageAggregate, index_createSystemReminderRules as createSystemReminderRules, index_defaultPolicyEngine as defaultPolicyEngine, index_defaultSystemReminderRegistry as defaultSystemReminderRegistry, index_deriveModelInputRequirement as deriveModelInputRequirement, index_emitAuditEnvelope as emitAuditEnvelope, index_emitSandboxDecisionAudit as emitSandboxDecisionAudit, index$6 as enrichment, index_ensureToolContextRuntimeCapability as ensureToolContextRuntimeCapability, index_evaluateModelInputCompatibility as evaluateModelInputCompatibility, index_evaluatePrimaryPromptCapacity as evaluatePrimaryPromptCapacity, index$e as events, index$b as execution, index_findCachedToolOutputByIdempotencyKey as findCachedToolOutputByIdempotencyKey, index_getToolContextRuntimeBinding as getToolContextRuntimeBinding, index$d as graph, index_hostReminderTextTemplate as hostReminderTextTemplate, index_isRuntimeFailureFact as isRuntimeFailureFact, index_isValidReasoningEffort as isValidReasoningEffort, index_lastStepsHintTemplate as lastStepsHintTemplate, index_listCompatibleModelIds as listCompatibleModelIds, index$9 as llm, index_maxStepsForceFinalAnswerTemplate as maxStepsForceFinalAnswerTemplate, index_noopAudit as noopAudit, index_normalizeToolArgs as normalizeToolArgs, index_parseToolModelInputDeclaration as parseToolModelInputDeclaration, index_periodicProgressReflectionTemplate as periodicProgressReflectionTemplate, index_phaseEqualsTrigger as phaseEqualsTrigger, index_projectChildRuntimeEventToSubRunTrace as projectChildRuntimeEventToSubRunTrace, index_readCheckpointContextUsage as readCheckpointContextUsage, index_readNonEmptyStrings as readNonEmptyStrings, index_readToolContextPersistedHistory as readToolContextPersistedHistory, index_readToolContextWorkingHistory as readToolContextWorkingHistory, index_remainingStepsLeqTrigger as remainingStepsLeqTrigger, index_requestEnricherRegistry as requestEnricherRegistry, index_requireEventStoreId as requireEventStoreId, index_resolveEffectiveEffort as resolveEffectiveEffort, index_resolveEffectivePromptBudget as resolveEffectivePromptBudget, index_resolveToolModelInput as resolveToolModelInput, index$a as runContext, index$5 as runSupervisor, index_stepCountModuloTrigger as stepCountModuloTrigger, index_stripRuntimeReservedToolContextPatch as stripRuntimeReservedToolContextPatch, index_summarizeCheckpoint as summarizeCheckpoint, index$2 as systemReminder, index$4 as telemetry, index_toDisplayStep as toDisplayStep, index$1 as tokenAccounting, index_toolCallStreakTemplate as toolCallStreakTemplate, index_toolCallStreakTrigger as toolCallStreakTrigger, index$c as tools };
|
|
1969
|
-
}
|
|
1970
|
-
|
|
1971
|
-
export { PrimaryPromptCapacityError as $, AuditEnvelopePersistenceError as A, BUILTIN_SYSTEM_REMINDER_TEMPLATES as B, type CanonicalInferenceStreamState as C, DefaultTokenizerPort as D, ENGINE_ERROR_CODES as E, type FileAuditOptions as F, GraphAgentExecutor as G, type HostToolCallBootstrap as H, type HostToolCallBootstrapInput as I, type HostToolCallBootstrapLocalPatch as J, INITIAL_CANONICAL_INFERENCE_STREAM_STATE as K, LLMPolicyEngine as L, LLM_IMAGE_INPUT_ERROR_CODES as M, LLM_MODEL_ELIGIBILITY_ERROR_CODE as N, LlmImageInputError as O, type LlmImageInputErrorCode as P, type LlmImageInputErrorMetadata as Q, type LlmImageInputLimitKind as R, LlmModelEligibilityError as S, LlmNode as T, MODEL_INPUT_ERROR_CODES as U, MemoryCheckpointer as V, ModelInputCapabilityError as W, type ModelInputErrorCode as X, type ModelInputErrorMetadata as Y, PRIMARY_PROMPT_CAPACITY_ERROR_CODE as Z, type PrimaryPromptCapacityAdmission as _, BUILTIN_SYSTEM_REMINDER_TRIGGERS as a, parseToolModelInputDeclaration as a$, type PrimaryPromptCapacityErrorMetadata as a0, type RegistryEnrichmentResult as a1, type RequestEnricher as a2, RuntimeEventSubRunTracePublisher as a3, type RuntimeEventSubRunTracePublisherOptions as a4, SYSTEM_REMINDER_RULES as a5, type SystemReminderContentTemplate as a6, type SystemReminderContext as a7, SystemReminderRegistry as a8, type SystemReminderRule as a9, createDefaultSystemReminderRegistry as aA, createDefaultTokenizerPort as aB, createEventStoreAudit as aC, createFileAudit as aD, createHostToolCallBootstrap as aE, createLlmUsageLedgerEntry as aF, createModelInputCompatibilityError as aG, createRunTokenUsageAggregate as aH, createSystemReminderRules as aI, defaultPolicyEngine as aJ, defaultSystemReminderRegistry as aK, deriveModelInputRequirement as aL, emitAuditEnvelope as aM, emitSandboxDecisionAudit as aN, index$6 as aO, evaluateModelInputCompatibility as aP, evaluatePrimaryPromptCapacity as aQ, index$b as aR, index$d as aS, hostReminderTextTemplate as aT, isRuntimeFailureFact as aU, lastStepsHintTemplate as aV, listCompatibleModelIds as aW, index$9 as aX, maxStepsForceFinalAnswerTemplate as aY, noopAudit as aZ, normalizeToolArgs as a_, type SystemReminderRuleDefinition as aa, type SystemReminderTriggerEvaluator as ab, type ToolModelInputDeclarationValidation as ac, ToolNode as ad, ToolParameterSchemaError as ae, UserNode as af, WaitUserNode as ag, addLedgerAggregate as ah, addUsageTotals as ai, advanceCanonicalInferenceStreamState as aj, agentHasToolTrigger as ak, aggregateCanonicalUsage as al, aggregateTokenLedgerEntries as am, applySystemReminders as an, assertModelInputCompatibility as ao, assertToolParameterSchema as ap, index$3 as aq, index$7 as ar, index$8 as as, computeCost as at, consoleAudit as au, consumeCanonicalInferenceStream as av, countToolCallsInCurrentRequest as aw, createCompositeAudit as ax, createConsoleAudit as ay, createContextComponentLedgerEntry as az, type CanonicalInferenceTerminal as b, periodicProgressReflectionTemplate as b0, phaseEqualsTrigger as b1, projectChildRuntimeEventToSubRunTrace as b2, readCheckpointContextUsage as b3, readNonEmptyStrings as b4, remainingStepsLeqTrigger as b5, requestEnricherRegistry as b6, resolveToolModelInput as b7, index$a as b8, index$5 as b9, stepCountModuloTrigger as ba, index$2 as bb, index$4 as bc, toDisplayStep as bd, index$1 as be, toolCallStreakTemplate as bf, toolCallStreakTrigger as bg, index$c as bh, ChildRunParentTraceProjection as c, type ChildRunParentTraceProjectionOptions as d, type CompositeAuditOptions as e, CompositeAuditPort as f, type ConsoleAuditOptions as g, type CreateContextComponentLedgerEntryInput as h, index as i, type CreateLlmUsageLedgerEntryInput as j, type DefaultTokenizerPortConfig as k, type EmitAuditEnvelopeParams as l, type EnrichmentContext as m, type EnrichmentResult as n, type ErrorClassification as o, type EventStoreAuditOptions as p, EventStoreAuditPort as q, FileAuditPort as r, type GraphAgentExecutorDependencies as s, type GraphContextCompactionCandidate as t, type GraphExecutorContextApplyInput as u, type GraphExecutorContextApplyOutput as v, type GraphExecutorContextBuildInput as w, type GraphExecutorContextBuildOutput as x, type GraphExecutorContextBuilder as y, type GraphExecutorOutputProcessor as z };
|