@linnlabs/linnkit 0.32.0 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/context-manager/features/context-compaction/definitions/contextCheckpointFormat.d.cts +3 -0
- package/dist/context-manager/features/context-compaction/definitions/contextCheckpointFormat.d.ts +3 -0
- package/dist/context-manager/features/context-compaction/definitions/historySummaryDraft.d.cts +22 -0
- package/dist/context-manager/features/context-compaction/definitions/historySummaryDraft.d.ts +22 -0
- package/dist/context-manager/profiles/agent/config.d.cts +33 -0
- package/dist/context-manager/profiles/agent/config.d.ts +33 -0
- package/dist/context-manager/profiles/agent/context/AgentContextManager.d.cts +132 -0
- package/dist/context-manager/profiles/agent/context/AgentContextManager.d.ts +132 -0
- package/dist/context-manager/profiles/agent/context/ConversationSession.d.cts +131 -0
- package/dist/context-manager/profiles/agent/context/ConversationSession.d.ts +131 -0
- package/dist/context-manager/profiles/agent/context/config.d.cts +191 -0
- package/dist/context-manager/profiles/agent/context/config.d.ts +191 -0
- package/dist/context-manager/profiles/agent/context/index.d.cts +8 -0
- package/dist/context-manager/profiles/agent/context/index.d.ts +8 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentCoreContextProvider.d.cts +52 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentCoreContextProvider.d.ts +52 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentWorkingMemoryProvider.d.cts +50 -0
- package/dist/context-manager/profiles/agent/context/providers/AgentWorkingMemoryProvider.d.ts +50 -0
- package/dist/context-manager/profiles/agent/context/providers/base.d.cts +11 -0
- package/dist/context-manager/profiles/agent/context/providers/base.d.ts +11 -0
- package/dist/context-manager/profiles/agent/context/providers/index.d.cts +12 -0
- package/dist/context-manager/profiles/agent/context/providers/index.d.ts +12 -0
- package/dist/context-manager/profiles/agent/contracts.d.cts +27 -0
- package/dist/context-manager/profiles/agent/contracts.d.ts +27 -0
- package/dist/context-manager/profiles/agent/orchestration/AgentMessageOrchestrator.d.cts +140 -0
- package/dist/context-manager/profiles/agent/orchestration/AgentMessageOrchestrator.d.ts +140 -0
- package/dist/context-manager/profiles/agent/orchestration/index.d.cts +1 -0
- package/dist/context-manager/profiles/agent/orchestration/index.d.ts +1 -0
- package/dist/context-manager/profiles/agent/preprocessors/base.d.cts +17 -0
- package/dist/context-manager/profiles/agent/preprocessors/base.d.ts +17 -0
- package/dist/context-manager/profiles/agent/preprocessors/index.d.cts +117 -0
- package/dist/context-manager/profiles/agent/preprocessors/index.d.ts +117 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolHistoryCompressor.d.cts +47 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolHistoryCompressor.d.ts +47 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolReplayProtocolGuard.d.cts +27 -0
- package/dist/context-manager/profiles/agent/preprocessors/toolReplayProtocolGuard.d.ts +27 -0
- package/dist/context-manager/profiles/agent/tasks/BaseAgentTask.d.cts +43 -0
- package/dist/context-manager/profiles/agent/tasks/BaseAgentTask.d.ts +43 -0
- package/dist/context-manager/profiles/agent/tasks/base.d.cts +18 -0
- package/dist/context-manager/profiles/agent/tasks/base.d.ts +18 -0
- package/dist/context-manager/profiles/agent/tasks/index.d.cts +2 -0
- package/dist/context-manager/profiles/agent/tasks/index.d.ts +2 -0
- package/dist/context-manager/profiles/agent/tools/ToolManager.d.cts +27 -0
- package/dist/context-manager/profiles/agent/tools/ToolManager.d.ts +27 -0
- package/dist/context-manager/profiles/agent/tools/index.d.cts +1 -0
- package/dist/context-manager/profiles/agent/tools/index.d.ts +1 -0
- package/dist/context-manager/profiles/agent/utils/eventConverter.d.cts +15 -0
- package/dist/context-manager/profiles/agent/utils/eventConverter.d.ts +15 -0
- package/dist/context-manager/profiles/agent/utils/index.d.cts +2 -0
- package/dist/context-manager/profiles/agent/utils/index.d.ts +2 -0
- package/dist/context-manager/profiles/agent/utils/toolOutputSummarizer.d.cts +26 -0
- package/dist/context-manager/profiles/agent/utils/toolOutputSummarizer.d.ts +26 -0
- package/dist/context-manager/shared/MessageFormatter.d.cts +55 -0
- package/dist/context-manager/shared/MessageFormatter.d.ts +55 -0
- package/dist/context-manager/shared/agentSpecAdapter.d.cts +63 -0
- package/dist/context-manager/shared/agentSpecAdapter.d.ts +63 -0
- package/dist/context-manager/shared/context-manager-base.d.cts +102 -0
- package/dist/context-manager/shared/context-manager-base.d.ts +102 -0
- package/dist/context-manager/shared/context-pipeline.d.cts +42 -0
- package/dist/context-manager/shared/context-pipeline.d.ts +42 -0
- package/dist/context-manager/shared/context-trace.d.cts +102 -0
- package/dist/context-manager/shared/context-trace.d.ts +102 -0
- package/dist/context-manager/shared/contextPolicyMerge.d.cts +19 -0
- package/dist/context-manager/shared/contextPolicyMerge.d.ts +19 -0
- package/dist/context-manager/shared/contracts/chatLineMessage.d.cts +15 -0
- package/dist/context-manager/shared/contracts/chatLineMessage.d.ts +15 -0
- package/dist/context-manager/shared/fences/FenceRegistry.d.cts +24 -0
- package/dist/context-manager/shared/fences/FenceRegistry.d.ts +24 -0
- package/dist/context-manager/shared/image-input-estimation.d.cts +16 -0
- package/dist/context-manager/shared/image-input-estimation.d.ts +16 -0
- package/dist/context-manager/shared/policies/MustKeepPolicy.d.cts +19 -0
- package/dist/context-manager/shared/policies/MustKeepPolicy.d.ts +19 -0
- package/dist/context-manager/shared/preprocessors/base.d.cts +43 -0
- package/dist/context-manager/shared/preprocessors/base.d.ts +43 -0
- package/dist/context-manager/shared/preprocessors/currentTurnMessageAssembler.d.cts +26 -0
- package/dist/context-manager/shared/preprocessors/currentTurnMessageAssembler.d.ts +26 -0
- package/dist/context-manager/shared/preprocessors/fenceLifetimeManager.d.cts +18 -0
- package/dist/context-manager/shared/preprocessors/fenceLifetimeManager.d.ts +18 -0
- package/dist/context-manager/shared/preprocessors/historyPurification.d.cts +19 -0
- package/dist/context-manager/shared/preprocessors/historyPurification.d.ts +19 -0
- package/dist/context-manager/shared/preprocessors/priority.d.cts +17 -0
- package/dist/context-manager/shared/preprocessors/priority.d.ts +17 -0
- package/dist/context-manager/shared/providers/base.d.cts +106 -0
- package/dist/context-manager/shared/providers/base.d.ts +106 -0
- package/dist/context-manager/shared/providers/registry.d.cts +11 -0
- package/dist/context-manager/shared/providers/registry.d.ts +11 -0
- package/dist/context-manager/shared/token-calibration.d.cts +25 -0
- package/dist/context-manager/shared/token-calibration.d.ts +25 -0
- package/dist/context-manager.d.cts +34 -1559
- package/dist/context-manager.d.ts +34 -1559
- package/dist/contracts/agentSpec.d.cts +869 -0
- package/dist/contracts/agentSpec.d.ts +869 -0
- package/dist/{audit-XsNMTt0-.d.cts → contracts/audit.d.cts} +33 -33
- package/dist/{audit-XsNMTt0-.d.ts → contracts/audit.d.ts} +33 -33
- package/dist/contracts/constants.d.cts +3 -0
- package/dist/contracts/constants.d.ts +3 -0
- package/dist/contracts/contextCompaction.d.cts +43 -0
- package/dist/contracts/contextCompaction.d.ts +43 -0
- package/dist/contracts/contextPolicy.d.cts +1121 -0
- package/dist/contracts/contextPolicy.d.ts +1121 -0
- package/dist/{final-answer-oOQ_7nPt.d.ts → contracts/events.d.cts} +1219 -1222
- package/dist/{final-answer-B0_kx5_U.d.cts → contracts/events.d.ts} +1219 -1222
- package/dist/{execution-B7e01ZjW.d.cts → contracts/execution.d.cts} +21 -21
- package/dist/{execution-B7e01ZjW.d.ts → contracts/execution.d.ts} +21 -21
- package/dist/contracts/final-answer.d.cts +7 -0
- package/dist/contracts/final-answer.d.ts +7 -0
- package/dist/contracts/identity/definitions.d.cts +70 -0
- package/dist/contracts/identity/definitions.d.ts +70 -0
- package/dist/contracts/identity/generators.d.cts +33 -0
- package/dist/contracts/identity/generators.d.ts +33 -0
- package/dist/contracts/identity/invariants.d.cts +24 -0
- package/dist/contracts/identity/invariants.d.ts +24 -0
- package/dist/contracts/json.d.cts +12 -0
- package/dist/contracts/json.d.ts +12 -0
- package/dist/{provider-continuation-CTZdCB--.d.cts → contracts/messages.d.cts} +210 -957
- package/dist/{provider-continuation-CTZdCB--.d.ts → contracts/messages.d.ts} +210 -957
- package/dist/contracts/provider-continuation.d.cts +609 -0
- package/dist/contracts/provider-continuation.d.ts +609 -0
- package/dist/contracts/reasoning.d.cts +77 -0
- package/dist/contracts/reasoning.d.ts +77 -0
- package/dist/contracts/resource-ref.d.cts +73 -0
- package/dist/contracts/resource-ref.d.ts +73 -0
- package/dist/contracts/runtime-status.d.cts +8 -0
- package/dist/contracts/runtime-status.d.ts +8 -0
- package/dist/contracts/sse-framing.d.cts +28 -0
- package/dist/contracts/sse-framing.d.ts +28 -0
- package/dist/{index-Cp1_oUj0.d.ts → contracts/sse.d.cts} +1218 -1574
- package/dist/{index-JYf6n2Ik.d.cts → contracts/sse.d.ts} +1218 -1574
- package/dist/contracts/sub-run-trace-payload.d.cts +187 -0
- package/dist/contracts/sub-run-trace-payload.d.ts +187 -0
- package/dist/{summarization-CMMLhaCe.d.ts → contracts/summarization.d.cts} +2 -2
- package/dist/{summarization-kLeweZ5-.d.cts → contracts/summarization.d.ts} +2 -2
- package/dist/contracts/token-accounting.d.cts +1177 -0
- package/dist/contracts/token-accounting.d.ts +1177 -0
- package/dist/{token-calibration-GtFyMJtM.d.cts → contracts/token-calibration.d.cts} +1 -42
- package/dist/{token-calibration-GtFyMJtM.d.ts → contracts/token-calibration.d.ts} +1 -42
- package/dist/{reasoning-bffu9R2B.d.cts → contracts/token-usage.d.cts} +9 -84
- package/dist/{reasoning-bffu9R2B.d.ts → contracts/token-usage.d.ts} +9 -84
- package/dist/contracts.d.cts +24 -10
- package/dist/contracts.d.ts +24 -10
- package/dist/index.d.cts +14 -77
- package/dist/index.d.ts +14 -77
- package/dist/ports/agent-invocation.d.cts +42 -0
- package/dist/ports/agent-invocation.d.ts +42 -0
- package/dist/{audit-DnuOSwWE.d.ts → ports/audit.d.cts} +2 -2
- package/dist/{audit-C9LPbPib.d.cts → ports/audit.d.ts} +2 -2
- package/dist/ports/canonical-inference.d.cts +135 -0
- package/dist/ports/canonical-inference.d.ts +135 -0
- package/dist/ports/llm-call.d.cts +109 -0
- package/dist/ports/llm-call.d.ts +109 -0
- package/dist/ports/llm-input-materialization.d.cts +69 -0
- package/dist/ports/llm-input-materialization.d.ts +69 -0
- package/dist/{token-counter-BjiHQEJ-.d.ts → ports/token-counter.d.cts} +3 -3
- package/dist/{token-counter-DiGIoaq2.d.cts → ports/token-counter.d.ts} +3 -3
- package/dist/{tokenizer-yIFTTc-W.d.ts → ports/tokenizer.d.cts} +2 -2
- package/dist/{tokenizer-Dz5Y3KT0.d.cts → ports/tokenizer.d.ts} +2 -2
- package/dist/ports/tool-schema.d.cts +30 -0
- package/dist/ports/tool-schema.d.ts +30 -0
- package/dist/ports/usage-normalizer.d.cts +16 -0
- package/dist/ports/usage-normalizer.d.ts +16 -0
- package/dist/ports.d.cts +10 -9
- package/dist/ports.d.ts +10 -9
- package/dist/quickstart/defineAgent.d.cts +12 -0
- package/dist/quickstart/defineAgent.d.ts +12 -0
- package/dist/quickstart/defineConfig.d.cts +7 -0
- package/dist/quickstart/defineConfig.d.ts +7 -0
- package/dist/quickstart/runAgent.d.cts +12 -0
- package/dist/quickstart/runAgent.d.ts +12 -0
- package/dist/quickstart/toolRuntime.d.cts +14 -0
- package/dist/quickstart/toolRuntime.d.ts +14 -0
- package/dist/{runAgent-jxZ0uNto.d.ts → quickstart/types.d.cts} +10 -28
- package/dist/{runAgent-QiBiFXHR.d.cts → quickstart/types.d.ts} +10 -28
- package/dist/quickstart.d.cts +5 -23
- package/dist/quickstart.d.ts +5 -23
- package/dist/runtime-kernel/audit/compositeAudit.d.cts +23 -0
- package/dist/runtime-kernel/audit/compositeAudit.d.ts +23 -0
- package/dist/runtime-kernel/audit/consoleAudit.d.cts +10 -0
- package/dist/runtime-kernel/audit/consoleAudit.d.ts +10 -0
- package/dist/runtime-kernel/audit/emitAudit.d.cts +31 -0
- package/dist/runtime-kernel/audit/emitAudit.d.ts +31 -0
- package/dist/runtime-kernel/audit/eventStoreAudit.d.cts +27 -0
- package/dist/runtime-kernel/audit/eventStoreAudit.d.ts +27 -0
- package/dist/runtime-kernel/audit/fileAudit.d.cts +22 -0
- package/dist/runtime-kernel/audit/fileAudit.d.ts +22 -0
- package/dist/runtime-kernel/audit/index.d.cts +6 -0
- package/dist/runtime-kernel/audit/index.d.ts +6 -0
- package/dist/runtime-kernel/audit/noopAudit.d.cts +5 -0
- package/dist/runtime-kernel/audit/noopAudit.d.ts +5 -0
- package/dist/runtime-kernel/child-run-trace/childRunParentTraceProjection.d.cts +26 -0
- package/dist/runtime-kernel/child-run-trace/childRunParentTraceProjection.d.ts +26 -0
- package/dist/runtime-kernel/child-run-trace/index.d.cts +4 -0
- package/dist/runtime-kernel/child-run-trace/index.d.ts +4 -0
- package/dist/runtime-kernel/child-run-trace/projectChildRuntimeEventToSubRunTrace.d.cts +10 -0
- package/dist/runtime-kernel/child-run-trace/projectChildRuntimeEventToSubRunTrace.d.ts +10 -0
- package/dist/runtime-kernel/child-run-trace/runtimeEventSubRunTracePublisher.d.cts +47 -0
- package/dist/runtime-kernel/child-run-trace/runtimeEventSubRunTracePublisher.d.ts +47 -0
- package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.cts +81 -0
- package/dist/runtime-kernel/child-run-trace/subrunTrace.types.d.ts +81 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.cts +101 -0
- package/dist/runtime-kernel/child-runs/childRunInvoker.d.ts +101 -0
- package/dist/runtime-kernel/child-runs/historyPolicy.d.cts +9 -0
- package/dist/runtime-kernel/child-runs/historyPolicy.d.ts +9 -0
- package/dist/runtime-kernel/child-runs/index.d.cts +3 -0
- package/dist/runtime-kernel/child-runs/index.d.ts +3 -0
- package/dist/runtime-kernel/child-runs/types.d.cts +82 -0
- package/dist/runtime-kernel/child-runs/types.d.ts +82 -0
- package/dist/runtime-kernel/enrichment/index.d.cts +2 -0
- package/dist/runtime-kernel/enrichment/index.d.ts +2 -0
- package/dist/runtime-kernel/enrichment/registry.d.cts +25 -0
- package/dist/runtime-kernel/enrichment/registry.d.ts +25 -0
- package/dist/runtime-kernel/enrichment/types.d.cts +83 -0
- package/dist/runtime-kernel/enrichment/types.d.ts +83 -0
- package/dist/runtime-kernel/events/agent-to-runtime.d.cts +6 -0
- package/dist/runtime-kernel/events/agent-to-runtime.d.ts +6 -0
- package/dist/{agentEvents-yvamy9xt.d.cts → runtime-kernel/events/agentEvents.d.cts} +127 -126
- package/dist/{agentEvents-DhXdKeXD.d.ts → runtime-kernel/events/agentEvents.d.ts} +127 -126
- package/dist/runtime-kernel/events/eventGovernance.d.cts +47 -0
- package/dist/runtime-kernel/events/eventGovernance.d.ts +47 -0
- package/dist/runtime-kernel/events/eventMappers.d.cts +41 -0
- package/dist/runtime-kernel/events/eventMappers.d.ts +41 -0
- package/dist/runtime-kernel/events/finalAnswerAssembler.d.cts +27 -0
- package/dist/runtime-kernel/events/finalAnswerAssembler.d.ts +27 -0
- package/dist/runtime-kernel/events/finalAnswerCompletion.d.cts +6 -0
- package/dist/runtime-kernel/events/finalAnswerCompletion.d.ts +6 -0
- package/dist/runtime-kernel/events/provider-sidecar.d.cts +33 -0
- package/dist/runtime-kernel/events/provider-sidecar.d.ts +33 -0
- package/dist/runtime-kernel/events/runtime-to-ai-message.d.cts +14 -0
- package/dist/runtime-kernel/events/runtime-to-ai-message.d.ts +14 -0
- package/dist/runtime-kernel/events.d.cts +7 -5
- package/dist/runtime-kernel/events.d.ts +7 -5
- package/dist/runtime-kernel/execution/event-bus.d.cts +52 -0
- package/dist/runtime-kernel/execution/event-bus.d.ts +52 -0
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.cts +40 -0
- package/dist/runtime-kernel/execution/eventBusEventPersistence.d.ts +40 -0
- package/dist/runtime-kernel/execution/index.d.cts +5 -0
- package/dist/runtime-kernel/execution/index.d.ts +5 -0
- package/dist/runtime-kernel/execution/runtimeErrorEventFactory.d.cts +46 -0
- package/dist/runtime-kernel/execution/runtimeErrorEventFactory.d.ts +46 -0
- package/dist/runtime-kernel/execution/runtimeEventPublisher.d.cts +34 -0
- package/dist/runtime-kernel/execution/runtimeEventPublisher.d.ts +34 -0
- package/dist/runtime-kernel/execution/sequencer.d.cts +69 -0
- package/dist/runtime-kernel/execution/sequencer.d.ts +69 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/base.d.cts +59 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/base.d.ts +59 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/memoryCheckpointer.d.cts +14 -0
- package/dist/runtime-kernel/graph-engine/checkpointer/memoryCheckpointer.d.ts +14 -0
- package/dist/runtime-kernel/graph-engine/definitions/primaryPromptCapacityError.d.cts +22 -0
- package/dist/runtime-kernel/graph-engine/definitions/primaryPromptCapacityError.d.ts +22 -0
- package/dist/runtime-kernel/graph-engine/engine.d.cts +64 -0
- package/dist/runtime-kernel/graph-engine/engine.d.ts +64 -0
- package/dist/runtime-kernel/graph-engine/event-store/base.d.cts +26 -0
- package/dist/runtime-kernel/graph-engine/event-store/base.d.ts +26 -0
- package/dist/runtime-kernel/graph-engine/event-store/memoryEventStore.d.cts +14 -0
- package/dist/runtime-kernel/graph-engine/event-store/memoryEventStore.d.ts +14 -0
- package/dist/runtime-kernel/graph-engine/executor.d.cts +59 -0
- package/dist/runtime-kernel/graph-engine/executor.d.ts +59 -0
- package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.cts +104 -0
- package/dist/runtime-kernel/graph-engine/executorContextBuilder.d.ts +104 -0
- package/dist/runtime-kernel/graph-engine/functions/createHostToolCallBootstrap.d.cts +41 -0
- package/dist/runtime-kernel/graph-engine/functions/createHostToolCallBootstrap.d.ts +41 -0
- package/dist/runtime-kernel/graph-engine/functions/engineStateSnapshot.d.cts +23 -0
- package/dist/runtime-kernel/graph-engine/functions/engineStateSnapshot.d.ts +23 -0
- package/dist/runtime-kernel/graph-engine/functions/evaluatePrimaryPromptCapacity.d.cts +15 -0
- package/dist/runtime-kernel/graph-engine/functions/evaluatePrimaryPromptCapacity.d.ts +15 -0
- package/dist/runtime-kernel/graph-engine/functions/runtimeFailureFact.d.cts +7 -0
- package/dist/runtime-kernel/graph-engine/functions/runtimeFailureFact.d.ts +7 -0
- package/dist/runtime-kernel/graph-engine/index.d.cts +18 -0
- package/dist/runtime-kernel/graph-engine/index.d.ts +18 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.d.cts +26 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.d.ts +26 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.eventBridge.d.cts +6 -0
- package/dist/runtime-kernel/graph-engine/nodes/llmNode.eventBridge.d.ts +6 -0
- package/dist/runtime-kernel/graph-engine/nodes/toolNode.d.cts +44 -0
- package/dist/runtime-kernel/graph-engine/nodes/toolNode.d.ts +44 -0
- package/dist/runtime-kernel/graph-engine/nodes/userNode.d.cts +8 -0
- package/dist/runtime-kernel/graph-engine/nodes/userNode.d.ts +8 -0
- package/dist/runtime-kernel/graph-engine/nodes/waitUserNode.d.cts +15 -0
- package/dist/runtime-kernel/graph-engine/nodes/waitUserNode.d.ts +15 -0
- package/dist/runtime-kernel/graph-engine/tick-pipeline/types.d.cts +57 -0
- package/dist/runtime-kernel/graph-engine/tick-pipeline/types.d.ts +57 -0
- package/dist/runtime-kernel/graph-engine/types.d.cts +143 -0
- package/dist/runtime-kernel/graph-engine/types.d.ts +143 -0
- package/dist/runtime-kernel/llm/caller.d.cts +50 -0
- package/dist/runtime-kernel/llm/caller.d.ts +50 -0
- package/dist/runtime-kernel/llm/canonical-inference/definitions/canonicalInferenceStreamState.d.cts +28 -0
- package/dist/runtime-kernel/llm/canonical-inference/definitions/canonicalInferenceStreamState.d.ts +28 -0
- package/dist/runtime-kernel/llm/canonical-inference/functions/advanceCanonicalInferenceStreamState.d.cts +6 -0
- package/dist/runtime-kernel/llm/canonical-inference/functions/advanceCanonicalInferenceStreamState.d.ts +6 -0
- package/dist/runtime-kernel/llm/canonical-inference/orchestration/consumeCanonicalInferenceStream.d.cts +6 -0
- package/dist/runtime-kernel/llm/canonical-inference/orchestration/consumeCanonicalInferenceStream.d.ts +6 -0
- package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.cts +29 -0
- package/dist/runtime-kernel/llm/definitions/llmCallInvocationContext.d.ts +29 -0
- package/dist/runtime-kernel/llm/definitions/llmFallbackObserver.d.cts +26 -0
- package/dist/runtime-kernel/llm/definitions/llmFallbackObserver.d.ts +26 -0
- package/dist/runtime-kernel/llm/functions/evaluateFallbackPromptCapacity.d.cts +9 -0
- package/dist/runtime-kernel/llm/functions/evaluateFallbackPromptCapacity.d.ts +9 -0
- package/dist/runtime-kernel/llm/index.d.cts +22 -0
- package/dist/runtime-kernel/llm/index.d.ts +22 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapability.d.cts +24 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapability.d.ts +24 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapabilityError.d.cts +31 -0
- package/dist/runtime-kernel/llm/input-capabilities/definitions/modelInputCapabilityError.d.ts +31 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/createModelInputCompatibilityError.d.cts +13 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/createModelInputCompatibilityError.d.ts +13 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/deriveModelInputRequirement.d.cts +6 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/deriveModelInputRequirement.d.ts +6 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/evaluateModelInputCompatibility.d.cts +7 -0
- package/dist/runtime-kernel/llm/input-capabilities/functions/evaluateModelInputCompatibility.d.ts +7 -0
- package/dist/runtime-kernel/llm/input-capabilities/orchestration/assertModelInputCompatibility.d.cts +10 -0
- package/dist/runtime-kernel/llm/input-capabilities/orchestration/assertModelInputCompatibility.d.ts +10 -0
- package/dist/runtime-kernel/llm/modelCatalog.d.cts +62 -0
- package/dist/runtime-kernel/llm/modelCatalog.d.ts +62 -0
- package/dist/runtime-kernel/llm/modelResolver.d.cts +40 -0
- package/dist/runtime-kernel/llm/modelResolver.d.ts +40 -0
- package/dist/runtime-kernel/llm/policies/defaultPolicyEngine.d.cts +15 -0
- package/dist/runtime-kernel/llm/policies/defaultPolicyEngine.d.ts +15 -0
- package/dist/runtime-kernel/llm/policies/policyEngine.d.cts +18 -0
- package/dist/runtime-kernel/llm/policies/policyEngine.d.ts +18 -0
- package/dist/runtime-kernel/llm/policies/types.d.cts +27 -0
- package/dist/runtime-kernel/llm/policies/types.d.ts +27 -0
- package/dist/runtime-kernel/llm/request-builder.d.cts +22 -0
- package/dist/runtime-kernel/llm/request-builder.d.ts +22 -0
- package/dist/runtime-kernel/llm/usage-telemetry.d.cts +17 -0
- package/dist/runtime-kernel/llm/usage-telemetry.d.ts +17 -0
- package/dist/runtime-kernel/run-context/index.d.cts +1 -0
- package/dist/runtime-kernel/run-context/index.d.ts +1 -0
- package/dist/runtime-kernel/run-context/types.d.cts +44 -0
- package/dist/runtime-kernel/run-context/types.d.ts +44 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.cts +131 -0
- package/dist/runtime-kernel/run-supervisor/definitions/runSupervisorContracts.d.ts +131 -0
- package/dist/runtime-kernel/run-supervisor/index.d.cts +6 -0
- package/dist/runtime-kernel/run-supervisor/index.d.ts +6 -0
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.cts +15 -0
- package/dist/runtime-kernel/run-supervisor/memoryRunRegistryStore.d.ts +15 -0
- package/dist/runtime-kernel/run-supervisor/runErrors.d.cts +24 -0
- package/dist/runtime-kernel/run-supervisor/runErrors.d.ts +24 -0
- package/dist/runtime-kernel/run-supervisor/runHandle.d.cts +155 -0
- package/dist/runtime-kernel/run-supervisor/runHandle.d.ts +155 -0
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.cts +47 -0
- package/dist/runtime-kernel/run-supervisor/runRegistryStorePort.d.ts +47 -0
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.cts +57 -0
- package/dist/runtime-kernel/run-supervisor/runSupervisor.d.ts +57 -0
- package/dist/runtime-kernel/system-reminder/apply.d.cts +38 -0
- package/dist/runtime-kernel/system-reminder/apply.d.ts +38 -0
- package/dist/runtime-kernel/system-reminder/helpers.d.cts +11 -0
- package/dist/runtime-kernel/system-reminder/helpers.d.ts +11 -0
- package/dist/runtime-kernel/system-reminder/index.d.cts +7 -0
- package/dist/runtime-kernel/system-reminder/index.d.ts +7 -0
- package/dist/runtime-kernel/system-reminder/registry.d.cts +17 -0
- package/dist/runtime-kernel/system-reminder/registry.d.ts +17 -0
- package/dist/runtime-kernel/system-reminder/rules.d.cts +20 -0
- package/dist/runtime-kernel/system-reminder/rules.d.ts +20 -0
- package/dist/runtime-kernel/system-reminder/templates.d.cts +10 -0
- package/dist/runtime-kernel/system-reminder/templates.d.ts +10 -0
- package/dist/runtime-kernel/system-reminder/triggers.d.cts +10 -0
- package/dist/runtime-kernel/system-reminder/triggers.d.ts +10 -0
- package/dist/runtime-kernel/system-reminder/types.d.cts +46 -0
- package/dist/runtime-kernel/system-reminder/types.d.ts +46 -0
- package/dist/runtime-kernel/telemetry/index.d.cts +3 -0
- package/dist/runtime-kernel/telemetry/index.d.ts +3 -0
- package/dist/runtime-kernel/telemetry/noopTelemetry.d.cts +5 -0
- package/dist/runtime-kernel/telemetry/noopTelemetry.d.ts +5 -0
- package/dist/runtime-kernel/telemetry/telemetryEvents.d.cts +5 -0
- package/dist/runtime-kernel/telemetry/telemetryEvents.d.ts +5 -0
- package/dist/runtime-kernel/telemetry/telemetryPort.d.cts +95 -0
- package/dist/runtime-kernel/telemetry/telemetryPort.d.ts +95 -0
- package/dist/runtime-kernel/testkit/defaultGraphExecutor.d.cts +23 -0
- package/dist/runtime-kernel/testkit/defaultGraphExecutor.d.ts +23 -0
- package/dist/runtime-kernel/testkit/graphLoopHarness.d.cts +49 -0
- package/dist/runtime-kernel/testkit/graphLoopHarness.d.ts +49 -0
- package/dist/runtime-kernel/token-accounting/functions.d.cts +27 -0
- package/dist/runtime-kernel/token-accounting/functions.d.ts +27 -0
- package/dist/runtime-kernel/token-accounting/index.d.cts +1 -0
- package/dist/runtime-kernel/token-accounting/index.d.ts +1 -0
- package/dist/runtime-kernel/tools/argNormalizer.d.cts +10 -0
- package/dist/runtime-kernel/tools/argNormalizer.d.ts +10 -0
- package/dist/runtime-kernel/tools/conversationView.d.cts +22 -0
- package/dist/runtime-kernel/tools/conversationView.d.ts +22 -0
- package/dist/runtime-kernel/tools/idempotency/toolIdempotency.d.cts +25 -0
- package/dist/runtime-kernel/tools/idempotency/toolIdempotency.d.ts +25 -0
- package/dist/runtime-kernel/tools/index.d.cts +15 -0
- package/dist/runtime-kernel/tools/index.d.ts +15 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInput.d.cts +51 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInput.d.ts +51 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInputPolicy.d.cts +17 -0
- package/dist/runtime-kernel/tools/model-input/definitions/toolModelInputPolicy.d.ts +17 -0
- package/dist/runtime-kernel/tools/model-input/functions/parseToolModelInputDeclaration.d.cts +17 -0
- package/dist/runtime-kernel/tools/model-input/functions/parseToolModelInputDeclaration.d.ts +17 -0
- package/dist/runtime-kernel/tools/model-input/orchestration/resolveToolModelInput.d.cts +16 -0
- package/dist/runtime-kernel/tools/model-input/orchestration/resolveToolModelInput.d.ts +16 -0
- package/dist/runtime-kernel/tools/ports.d.cts +119 -0
- package/dist/runtime-kernel/tools/ports.d.ts +119 -0
- package/dist/runtime-kernel/tools/schema/functions/assertToolParameterSchema.d.cts +15 -0
- package/dist/runtime-kernel/tools/schema/functions/assertToolParameterSchema.d.ts +15 -0
- package/dist/runtime-kernel/tools/toolContextPatch.d.cts +14 -0
- package/dist/runtime-kernel/tools/toolContextPatch.d.ts +14 -0
- package/dist/runtime-kernel/tools/toolContextRuntime.d.cts +37 -0
- package/dist/runtime-kernel/tools/toolContextRuntime.d.ts +37 -0
- package/dist/runtime-kernel/tools/toolContracts.d.cts +109 -0
- package/dist/runtime-kernel/tools/toolContracts.d.ts +109 -0
- package/dist/runtime-kernel/tools/toolExecutionContext.d.cts +104 -0
- package/dist/runtime-kernel/tools/toolExecutionContext.d.ts +104 -0
- package/dist/runtime-kernel/tools/ui-types.d.cts +72 -0
- package/dist/runtime-kernel/tools/ui-types.d.ts +72 -0
- package/dist/runtime-kernel.d.cts +106 -20
- package/dist/runtime-kernel.d.ts +106 -20
- package/dist/shared/defaultTokenizerPort.d.cts +29 -0
- package/dist/shared/defaultTokenizerPort.d.ts +29 -0
- package/dist/shared/errorClassifier.d.cts +42 -0
- package/dist/shared/errorClassifier.d.ts +42 -0
- package/dist/shared/llmAuditProjection.d.cts +11 -0
- package/dist/shared/llmAuditProjection.d.ts +11 -0
- package/dist/shared/llmAuditRecorder.d.cts +44 -0
- package/dist/shared/llmAuditRecorder.d.ts +44 -0
- package/dist/shared/llmImageInputError.d.cts +34 -0
- package/dist/shared/llmImageInputError.d.ts +34 -0
- package/dist/shared/llmTelemetryContext.d.cts +52 -0
- package/dist/shared/llmTelemetryContext.d.ts +52 -0
- package/dist/shared/logger.d.cts +12 -0
- package/dist/shared/logger.d.ts +12 -0
- package/dist/{prompt-budget-yciFkC9U.d.cts → shared/prompt-budget.d.cts} +2 -1
- package/dist/{prompt-budget-yciFkC9U.d.ts → shared/prompt-budget.d.ts} +2 -1
- package/dist/testkit/agent-harness/assertions.d.cts +10 -0
- package/dist/testkit/agent-harness/assertions.d.ts +10 -0
- package/dist/testkit/agent-harness/scriptedInferenceHarness.d.cts +52 -0
- package/dist/testkit/agent-harness/scriptedInferenceHarness.d.ts +52 -0
- package/dist/testkit/context-harness/invariants/index.d.cts +7 -0
- package/dist/testkit/context-harness/invariants/index.d.ts +7 -0
- package/dist/testkit/context-harness/invariants/types.d.cts +32 -0
- package/dist/testkit/context-harness/invariants/types.d.ts +32 -0
- package/dist/testkit/context-harness/replayHarness.d.cts +18 -0
- package/dist/testkit/context-harness/replayHarness.d.ts +18 -0
- package/dist/testkit/mocks/tokenizerPort.d.cts +17 -0
- package/dist/testkit/mocks/tokenizerPort.d.ts +17 -0
- package/dist/testkit/run-harness/collectingAuditPort.d.cts +21 -0
- package/dist/testkit/run-harness/collectingAuditPort.d.ts +21 -0
- package/dist/testkit/run-harness/invariants/index.d.cts +7 -0
- package/dist/testkit/run-harness/invariants/index.d.ts +7 -0
- package/dist/testkit/run-harness/invariants/types.d.cts +48 -0
- package/dist/testkit/run-harness/invariants/types.d.ts +48 -0
- package/dist/testkit/run-harness/mockTelemetryPort.d.cts +35 -0
- package/dist/testkit/run-harness/mockTelemetryPort.d.ts +35 -0
- package/dist/testkit/run-harness/runSupervisorHarness.d.cts +60 -0
- package/dist/testkit/run-harness/runSupervisorHarness.d.ts +60 -0
- package/dist/testkit/tool-fixtures/toolContext.d.cts +19 -0
- package/dist/testkit/tool-fixtures/toolContext.d.ts +19 -0
- package/dist/testkit.d.cts +17 -277
- package/dist/testkit.d.ts +17 -277
- package/package.json +6 -4
- package/dist/base-DRRrRhxS.d.cts +0 -216
- package/dist/base-DVyQIl_d.d.ts +0 -216
- package/dist/defaultGraphExecutor-Chr16eYO.d.cts +0 -914
- package/dist/defaultGraphExecutor-hT7dchpC.d.ts +0 -914
- package/dist/index-1pE6gSpV.d.cts +0 -172
- package/dist/index-C2PSqU1I.d.cts +0 -1971
- package/dist/index-CZMXtw4h.d.ts +0 -1971
- package/dist/index-D_csW7Zl.d.ts +0 -172
- package/dist/index-DpSWZ1L6.d.ts +0 -67
- package/dist/index-oCM3XEu2.d.cts +0 -67
- package/dist/llm-input-materialization-Vce5Swvc.d.ts +0 -366
- package/dist/llm-input-materialization-r-V3n9U-.d.cts +0 -366
- package/dist/runHandle--l0kE205.d.cts +0 -490
- package/dist/runHandle-ouLd6Tgp.d.ts +0 -490
- package/dist/token-accounting-19cXG7hM.d.cts +0 -3342
- package/dist/token-accounting-CVW37Uri.d.ts +0 -3342
- package/dist/toolContracts--KrHHNCY.d.cts +0 -424
- package/dist/toolContracts-BQ4kIso_.d.ts +0 -424
package/dist/quickstart.d.cts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import './provider-continuation-CTZdCB--.cjs';
|
|
7
|
-
import 'zod';
|
|
8
|
-
import './reasoning-bffu9R2B.cjs';
|
|
9
|
-
import './token-accounting-19cXG7hM.cjs';
|
|
10
|
-
import './final-answer-B0_kx5_U.cjs';
|
|
11
|
-
import './audit-C9LPbPib.cjs';
|
|
12
|
-
import './audit-XsNMTt0-.cjs';
|
|
13
|
-
import './execution-B7e01ZjW.cjs';
|
|
14
|
-
|
|
15
|
-
declare class QuickstartMemoryToolRuntime implements QuickstartToolRuntime {
|
|
16
|
-
private readonly tools;
|
|
17
|
-
constructor(tools?: readonly BaseTool<ToolArgs, string>[]);
|
|
18
|
-
getToolSchemas(input: ToolSchemaBuildRequest): FunctionToolSchema[];
|
|
19
|
-
getToolDefinition(toolName: string): ToolRuntimeDefinition | undefined;
|
|
20
|
-
executeTool(toolName: string, args: ToolArgs, context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { QuickstartMemoryToolRuntime, QuickstartToolRuntime };
|
|
1
|
+
export { defineAgent } from './quickstart/defineAgent.cjs';
|
|
2
|
+
export { defineConfig, resolveConfiguredInference } from './quickstart/defineConfig.cjs';
|
|
3
|
+
export { runAgent } from './quickstart/runAgent.cjs';
|
|
4
|
+
export { QuickstartMemoryToolRuntime } from './quickstart/toolRuntime.cjs';
|
|
5
|
+
export { DefineAgentInput, DefinedAgent, LinnkitQuickstartConfig, QuickstartToolRuntime, RunAgentOptions, RunAgentResult } from './quickstart/types.cjs';
|
package/dist/quickstart.d.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import './provider-continuation-CTZdCB--.js';
|
|
7
|
-
import 'zod';
|
|
8
|
-
import './reasoning-bffu9R2B.js';
|
|
9
|
-
import './token-accounting-CVW37Uri.js';
|
|
10
|
-
import './final-answer-oOQ_7nPt.js';
|
|
11
|
-
import './audit-DnuOSwWE.js';
|
|
12
|
-
import './audit-XsNMTt0-.js';
|
|
13
|
-
import './execution-B7e01ZjW.js';
|
|
14
|
-
|
|
15
|
-
declare class QuickstartMemoryToolRuntime implements QuickstartToolRuntime {
|
|
16
|
-
private readonly tools;
|
|
17
|
-
constructor(tools?: readonly BaseTool<ToolArgs, string>[]);
|
|
18
|
-
getToolSchemas(input: ToolSchemaBuildRequest): FunctionToolSchema[];
|
|
19
|
-
getToolDefinition(toolName: string): ToolRuntimeDefinition | undefined;
|
|
20
|
-
executeTool(toolName: string, args: ToolArgs, context: ToolExecutionContext): Promise<ToolExecutionResult>;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { QuickstartMemoryToolRuntime, QuickstartToolRuntime };
|
|
1
|
+
export { defineAgent } from './quickstart/defineAgent.js';
|
|
2
|
+
export { defineConfig, resolveConfiguredInference } from './quickstart/defineConfig.js';
|
|
3
|
+
export { runAgent } from './quickstart/runAgent.js';
|
|
4
|
+
export { QuickstartMemoryToolRuntime } from './quickstart/toolRuntime.js';
|
|
5
|
+
export { DefineAgentInput, DefinedAgent, LinnkitQuickstartConfig, QuickstartToolRuntime, RunAgentOptions, RunAgentResult } from './quickstart/types.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuditEnvelope } from '../../contracts/audit.cjs';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.cjs';
|
|
3
|
+
|
|
4
|
+
interface CompositeAuditOptions {
|
|
5
|
+
ports: readonly AuditPort[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 组合多个审计 sink。
|
|
9
|
+
*
|
|
10
|
+
* 中文备注:
|
|
11
|
+
* - 按顺序 await,确保 EventStore 这类主审计落点先完成;
|
|
12
|
+
* - 不吞异常,审计失败应该暴露给调用方,由 host 决定是否降级。
|
|
13
|
+
*/
|
|
14
|
+
declare class CompositeAuditPort implements AuditPort {
|
|
15
|
+
private readonly ports;
|
|
16
|
+
constructor(options: CompositeAuditOptions);
|
|
17
|
+
emit(envelope: AuditEnvelope): Promise<void>;
|
|
18
|
+
flush(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
declare function createCompositeAudit(options: CompositeAuditOptions): AuditPort;
|
|
21
|
+
|
|
22
|
+
export { CompositeAuditPort, createCompositeAudit };
|
|
23
|
+
export type { CompositeAuditOptions };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuditEnvelope } from '../../contracts/audit.js';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.js';
|
|
3
|
+
|
|
4
|
+
interface CompositeAuditOptions {
|
|
5
|
+
ports: readonly AuditPort[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 组合多个审计 sink。
|
|
9
|
+
*
|
|
10
|
+
* 中文备注:
|
|
11
|
+
* - 按顺序 await,确保 EventStore 这类主审计落点先完成;
|
|
12
|
+
* - 不吞异常,审计失败应该暴露给调用方,由 host 决定是否降级。
|
|
13
|
+
*/
|
|
14
|
+
declare class CompositeAuditPort implements AuditPort {
|
|
15
|
+
private readonly ports;
|
|
16
|
+
constructor(options: CompositeAuditOptions);
|
|
17
|
+
emit(envelope: AuditEnvelope): Promise<void>;
|
|
18
|
+
flush(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
declare function createCompositeAudit(options: CompositeAuditOptions): AuditPort;
|
|
21
|
+
|
|
22
|
+
export { CompositeAuditPort, createCompositeAudit };
|
|
23
|
+
export type { CompositeAuditOptions };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuditPort } from '../../ports/audit.cjs';
|
|
2
|
+
|
|
3
|
+
interface ConsoleAuditOptions {
|
|
4
|
+
sink?: Pick<Console, 'info'>;
|
|
5
|
+
}
|
|
6
|
+
declare function createConsoleAudit(options?: ConsoleAuditOptions): AuditPort;
|
|
7
|
+
declare const consoleAudit: AuditPort;
|
|
8
|
+
|
|
9
|
+
export { consoleAudit, createConsoleAudit };
|
|
10
|
+
export type { ConsoleAuditOptions };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AuditPort } from '../../ports/audit.js';
|
|
2
|
+
|
|
3
|
+
interface ConsoleAuditOptions {
|
|
4
|
+
sink?: Pick<Console, 'info'>;
|
|
5
|
+
}
|
|
6
|
+
declare function createConsoleAudit(options?: ConsoleAuditOptions): AuditPort;
|
|
7
|
+
declare const consoleAudit: AuditPort;
|
|
8
|
+
|
|
9
|
+
export { consoleAudit, createConsoleAudit };
|
|
10
|
+
export type { ConsoleAuditOptions };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AuditScope, AuditActor, AuditDecision, AuditEvidence, AuditCostDelta } from '../../contracts/audit.cjs';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.cjs';
|
|
3
|
+
|
|
4
|
+
interface EmitAuditEnvelopeParams {
|
|
5
|
+
runId?: AuditScope['runId'];
|
|
6
|
+
parentRunId?: AuditScope['parentRunId'];
|
|
7
|
+
actor?: AuditActor;
|
|
8
|
+
action: string;
|
|
9
|
+
decision?: AuditDecision;
|
|
10
|
+
evidence?: AuditEvidence[];
|
|
11
|
+
costDelta?: AuditCostDelta;
|
|
12
|
+
scope: AuditScope;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 统一发出 AuditEnvelope。
|
|
16
|
+
*
|
|
17
|
+
* 中文备注:
|
|
18
|
+
* - 调用点只描述“谁做了什么决策”,这里统一补 envelopeId / ts / runId;
|
|
19
|
+
* - 不吞 emit 异常,审计链路异常应由上层测试或 host 策略显式处理。
|
|
20
|
+
*/
|
|
21
|
+
declare function emitAuditEnvelope(auditPort: AuditPort, params: EmitAuditEnvelopeParams): Promise<void>;
|
|
22
|
+
declare function emitSandboxDecisionAudit(auditPort: AuditPort, params: {
|
|
23
|
+
scope: AuditScope;
|
|
24
|
+
allowed: boolean;
|
|
25
|
+
reason?: string;
|
|
26
|
+
policy?: string;
|
|
27
|
+
evidence?: AuditEvidence[];
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
|
|
30
|
+
export { emitAuditEnvelope, emitSandboxDecisionAudit };
|
|
31
|
+
export type { EmitAuditEnvelopeParams };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AuditScope, AuditActor, AuditDecision, AuditEvidence, AuditCostDelta } from '../../contracts/audit.js';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.js';
|
|
3
|
+
|
|
4
|
+
interface EmitAuditEnvelopeParams {
|
|
5
|
+
runId?: AuditScope['runId'];
|
|
6
|
+
parentRunId?: AuditScope['parentRunId'];
|
|
7
|
+
actor?: AuditActor;
|
|
8
|
+
action: string;
|
|
9
|
+
decision?: AuditDecision;
|
|
10
|
+
evidence?: AuditEvidence[];
|
|
11
|
+
costDelta?: AuditCostDelta;
|
|
12
|
+
scope: AuditScope;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 统一发出 AuditEnvelope。
|
|
16
|
+
*
|
|
17
|
+
* 中文备注:
|
|
18
|
+
* - 调用点只描述“谁做了什么决策”,这里统一补 envelopeId / ts / runId;
|
|
19
|
+
* - 不吞 emit 异常,审计链路异常应由上层测试或 host 策略显式处理。
|
|
20
|
+
*/
|
|
21
|
+
declare function emitAuditEnvelope(auditPort: AuditPort, params: EmitAuditEnvelopeParams): Promise<void>;
|
|
22
|
+
declare function emitSandboxDecisionAudit(auditPort: AuditPort, params: {
|
|
23
|
+
scope: AuditScope;
|
|
24
|
+
allowed: boolean;
|
|
25
|
+
reason?: string;
|
|
26
|
+
policy?: string;
|
|
27
|
+
evidence?: AuditEvidence[];
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
|
|
30
|
+
export { emitAuditEnvelope, emitSandboxDecisionAudit };
|
|
31
|
+
export type { EmitAuditEnvelopeParams };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AuditEnvelope } from '../../contracts/audit.cjs';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.cjs';
|
|
3
|
+
import { EventStore } from '../graph-engine/event-store/base.cjs';
|
|
4
|
+
|
|
5
|
+
interface EventStoreAuditOptions {
|
|
6
|
+
eventStore: EventStore;
|
|
7
|
+
}
|
|
8
|
+
declare class AuditEnvelopePersistenceError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 默认 EventStore 审计 sink。
|
|
13
|
+
*
|
|
14
|
+
* 中文备注:
|
|
15
|
+
* - 写入隐藏 RuntimeEvent:type=audit_envelope;
|
|
16
|
+
* - 事件不进 UI、不进 agent context,只作为追加只读审计事实保留;
|
|
17
|
+
* - conversationId 必须来自 envelope.scope,避免把跨会话审计混进同一条流。
|
|
18
|
+
*/
|
|
19
|
+
declare class EventStoreAuditPort implements AuditPort {
|
|
20
|
+
private readonly eventStore;
|
|
21
|
+
constructor(options: EventStoreAuditOptions);
|
|
22
|
+
emit(envelope: AuditEnvelope): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
declare function createEventStoreAudit(options: EventStoreAuditOptions): AuditPort;
|
|
25
|
+
|
|
26
|
+
export { AuditEnvelopePersistenceError, EventStoreAuditPort, createEventStoreAudit };
|
|
27
|
+
export type { EventStoreAuditOptions };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { AuditEnvelope } from '../../contracts/audit.js';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.js';
|
|
3
|
+
import { EventStore } from '../graph-engine/event-store/base.js';
|
|
4
|
+
|
|
5
|
+
interface EventStoreAuditOptions {
|
|
6
|
+
eventStore: EventStore;
|
|
7
|
+
}
|
|
8
|
+
declare class AuditEnvelopePersistenceError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 默认 EventStore 审计 sink。
|
|
13
|
+
*
|
|
14
|
+
* 中文备注:
|
|
15
|
+
* - 写入隐藏 RuntimeEvent:type=audit_envelope;
|
|
16
|
+
* - 事件不进 UI、不进 agent context,只作为追加只读审计事实保留;
|
|
17
|
+
* - conversationId 必须来自 envelope.scope,避免把跨会话审计混进同一条流。
|
|
18
|
+
*/
|
|
19
|
+
declare class EventStoreAuditPort implements AuditPort {
|
|
20
|
+
private readonly eventStore;
|
|
21
|
+
constructor(options: EventStoreAuditOptions);
|
|
22
|
+
emit(envelope: AuditEnvelope): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
declare function createEventStoreAudit(options: EventStoreAuditOptions): AuditPort;
|
|
25
|
+
|
|
26
|
+
export { AuditEnvelopePersistenceError, EventStoreAuditPort, createEventStoreAudit };
|
|
27
|
+
export type { EventStoreAuditOptions };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuditEnvelope } from '../../contracts/audit.cjs';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.cjs';
|
|
3
|
+
|
|
4
|
+
interface FileAuditOptions {
|
|
5
|
+
filePath: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* JSONL 文件审计 sink。
|
|
9
|
+
*
|
|
10
|
+
* 中文备注:
|
|
11
|
+
* - 每个 envelope 一行,便于 tail / grep / 后续导入 SIEM;
|
|
12
|
+
* - 不做轮转与脱敏,轮转/脱敏属于 host 策略,后续由 G-4 RedactionPort 处理。
|
|
13
|
+
*/
|
|
14
|
+
declare class FileAuditPort implements AuditPort {
|
|
15
|
+
private readonly filePath;
|
|
16
|
+
constructor(options: FileAuditOptions);
|
|
17
|
+
emit(envelope: AuditEnvelope): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
declare function createFileAudit(options: FileAuditOptions): AuditPort;
|
|
20
|
+
|
|
21
|
+
export { FileAuditPort, createFileAudit };
|
|
22
|
+
export type { FileAuditOptions };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AuditEnvelope } from '../../contracts/audit.js';
|
|
2
|
+
import { AuditPort } from '../../ports/audit.js';
|
|
3
|
+
|
|
4
|
+
interface FileAuditOptions {
|
|
5
|
+
filePath: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* JSONL 文件审计 sink。
|
|
9
|
+
*
|
|
10
|
+
* 中文备注:
|
|
11
|
+
* - 每个 envelope 一行,便于 tail / grep / 后续导入 SIEM;
|
|
12
|
+
* - 不做轮转与脱敏,轮转/脱敏属于 host 策略,后续由 G-4 RedactionPort 处理。
|
|
13
|
+
*/
|
|
14
|
+
declare class FileAuditPort implements AuditPort {
|
|
15
|
+
private readonly filePath;
|
|
16
|
+
constructor(options: FileAuditOptions);
|
|
17
|
+
emit(envelope: AuditEnvelope): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
declare function createFileAudit(options: FileAuditOptions): AuditPort;
|
|
20
|
+
|
|
21
|
+
export { FileAuditPort, createFileAudit };
|
|
22
|
+
export type { FileAuditOptions };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ConsoleAuditOptions, consoleAudit, createConsoleAudit } from './consoleAudit.cjs';
|
|
2
|
+
export { CompositeAuditOptions, CompositeAuditPort, createCompositeAudit } from './compositeAudit.cjs';
|
|
3
|
+
export { EmitAuditEnvelopeParams, emitAuditEnvelope, emitSandboxDecisionAudit } from './emitAudit.cjs';
|
|
4
|
+
export { AuditEnvelopePersistenceError, EventStoreAuditOptions, EventStoreAuditPort, createEventStoreAudit } from './eventStoreAudit.cjs';
|
|
5
|
+
export { FileAuditOptions, FileAuditPort, createFileAudit } from './fileAudit.cjs';
|
|
6
|
+
export { noopAudit } from './noopAudit.cjs';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ConsoleAuditOptions, consoleAudit, createConsoleAudit } from './consoleAudit.js';
|
|
2
|
+
export { CompositeAuditOptions, CompositeAuditPort, createCompositeAudit } from './compositeAudit.js';
|
|
3
|
+
export { EmitAuditEnvelopeParams, emitAuditEnvelope, emitSandboxDecisionAudit } from './emitAudit.js';
|
|
4
|
+
export { AuditEnvelopePersistenceError, EventStoreAuditOptions, EventStoreAuditPort, createEventStoreAudit } from './eventStoreAudit.js';
|
|
5
|
+
export { FileAuditOptions, FileAuditPort, createFileAudit } from './fileAudit.js';
|
|
6
|
+
export { noopAudit } from './noopAudit.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventBus } from '../execution/event-bus.cjs';
|
|
2
|
+
import { SubRunTracePublisher } from './subrunTrace.types.cjs';
|
|
3
|
+
|
|
4
|
+
interface ChildRunParentTraceProjectionOptions {
|
|
5
|
+
childEventBus: EventBus;
|
|
6
|
+
parentTracePublisher: SubRunTracePublisher;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* child EventBus 的父级 read-model consumer。
|
|
10
|
+
*
|
|
11
|
+
* 投影失败在 terminal drain 时传播,不能从同步 EventBus listener 直接抛出,
|
|
12
|
+
* 否则同一 child fact 的 persistence、observation 与 journal 会因监听器顺序产生分叉。
|
|
13
|
+
*/
|
|
14
|
+
declare class ChildRunParentTraceProjection {
|
|
15
|
+
private readonly options;
|
|
16
|
+
private firstProjectionError;
|
|
17
|
+
private connected;
|
|
18
|
+
constructor(options: ChildRunParentTraceProjectionOptions);
|
|
19
|
+
connect(): void;
|
|
20
|
+
drain(): Promise<void>;
|
|
21
|
+
private readonly onEvent;
|
|
22
|
+
private readonly disconnect;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { ChildRunParentTraceProjection };
|
|
26
|
+
export type { ChildRunParentTraceProjectionOptions };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { EventBus } from '../execution/event-bus.js';
|
|
2
|
+
import { SubRunTracePublisher } from './subrunTrace.types.js';
|
|
3
|
+
|
|
4
|
+
interface ChildRunParentTraceProjectionOptions {
|
|
5
|
+
childEventBus: EventBus;
|
|
6
|
+
parentTracePublisher: SubRunTracePublisher;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* child EventBus 的父级 read-model consumer。
|
|
10
|
+
*
|
|
11
|
+
* 投影失败在 terminal drain 时传播,不能从同步 EventBus listener 直接抛出,
|
|
12
|
+
* 否则同一 child fact 的 persistence、observation 与 journal 会因监听器顺序产生分叉。
|
|
13
|
+
*/
|
|
14
|
+
declare class ChildRunParentTraceProjection {
|
|
15
|
+
private readonly options;
|
|
16
|
+
private firstProjectionError;
|
|
17
|
+
private connected;
|
|
18
|
+
constructor(options: ChildRunParentTraceProjectionOptions);
|
|
19
|
+
connect(): void;
|
|
20
|
+
drain(): Promise<void>;
|
|
21
|
+
private readonly onEvent;
|
|
22
|
+
private readonly disconnect;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { ChildRunParentTraceProjection };
|
|
26
|
+
export type { ChildRunParentTraceProjectionOptions };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { RuntimeEventSubRunTracePublisher, RuntimeEventSubRunTracePublisherOptions } from './runtimeEventSubRunTracePublisher.cjs';
|
|
2
|
+
export { projectChildRuntimeEventToSubRunTrace } from './projectChildRuntimeEventToSubRunTrace.cjs';
|
|
3
|
+
export { ChildRunParentTraceProjection, ChildRunParentTraceProjectionOptions } from './childRunParentTraceProjection.cjs';
|
|
4
|
+
export { SubRunTraceEnvelope, SubRunTracePublisher } from './subrunTrace.types.cjs';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { RuntimeEventSubRunTracePublisher, RuntimeEventSubRunTracePublisherOptions } from './runtimeEventSubRunTracePublisher.js';
|
|
2
|
+
export { projectChildRuntimeEventToSubRunTrace } from './projectChildRuntimeEventToSubRunTrace.js';
|
|
3
|
+
export { ChildRunParentTraceProjection, ChildRunParentTraceProjectionOptions } from './childRunParentTraceProjection.js';
|
|
4
|
+
export { SubRunTraceEnvelope, SubRunTracePublisher } from './subrunTrace.types.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RoutedRuntimeEvent } from '../../contracts/events.cjs';
|
|
2
|
+
import { SubRunTraceEnvelope } from './subrunTrace.types.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* parent trace 是 child fact 的展示投影。该函数只做语义选择与字段映射,
|
|
6
|
+
* 不拥有 child admission、parent 发布、持久化或事件 ID。
|
|
7
|
+
*/
|
|
8
|
+
declare function projectChildRuntimeEventToSubRunTrace(event: RoutedRuntimeEvent): SubRunTraceEnvelope | null;
|
|
9
|
+
|
|
10
|
+
export { projectChildRuntimeEventToSubRunTrace };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RoutedRuntimeEvent } from '../../contracts/events.js';
|
|
2
|
+
import { SubRunTraceEnvelope } from './subrunTrace.types.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* parent trace 是 child fact 的展示投影。该函数只做语义选择与字段映射,
|
|
6
|
+
* 不拥有 child admission、parent 发布、持久化或事件 ID。
|
|
7
|
+
*/
|
|
8
|
+
declare function projectChildRuntimeEventToSubRunTrace(event: RoutedRuntimeEvent): SubRunTraceEnvelope | null;
|
|
9
|
+
|
|
10
|
+
export { projectChildRuntimeEventToSubRunTrace };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { RuntimeEventSink } from '../graph-engine/types.cjs';
|
|
2
|
+
import { SubRunTracePublisher, SubRunTraceEnvelope } from './subrunTrace.types.cjs';
|
|
3
|
+
import { ToolCallId } from '../../contracts/identity/definitions.cjs';
|
|
4
|
+
|
|
5
|
+
interface RuntimeEventSubRunTracePublisherOptions {
|
|
6
|
+
runtimeEventSink: RuntimeEventSink;
|
|
7
|
+
/** 父会话上下文:用于填充 RuntimeEvent 基础字段 */
|
|
8
|
+
conversationId: string;
|
|
9
|
+
turnId: string;
|
|
10
|
+
/** 绑定关系:用于 UI 精确归属与并发分桶 */
|
|
11
|
+
parentToolCallId: ToolCallId;
|
|
12
|
+
subrunId: string;
|
|
13
|
+
subrunParentId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 事件来源(用于调试与过滤)
|
|
16
|
+
* 建议格式:`subrun:<tool_name>` 或 `tool:<tool_name>:subrun`
|
|
17
|
+
*/
|
|
18
|
+
source?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 透传到 RuntimeEvent.metadata 的扩展字段(可选)
|
|
21
|
+
* 注意:metadata 只允许承载非关键展示/诊断信息。路由、归并、生命周期和副作用目标
|
|
22
|
+
* 必须使用共享正式字段或上层显式绑定,不能让前端从这里恢复业务身份。
|
|
23
|
+
*/
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* RuntimeEventSubRunTracePublisher
|
|
28
|
+
*
|
|
29
|
+
* 说明:
|
|
30
|
+
* - 该发布器在构造时绑定 parent_tool_call_id 与 subrun_id;
|
|
31
|
+
* - 每次 publish 只需要提供“分片载荷”(kind/delta/...)即可。
|
|
32
|
+
*/
|
|
33
|
+
declare class RuntimeEventSubRunTracePublisher implements SubRunTracePublisher {
|
|
34
|
+
private readonly runtimeEventSink;
|
|
35
|
+
private readonly conversationId;
|
|
36
|
+
private readonly turnId;
|
|
37
|
+
private readonly parentToolCallId;
|
|
38
|
+
private readonly subrunId;
|
|
39
|
+
private readonly subrunParentId?;
|
|
40
|
+
private readonly source;
|
|
41
|
+
private readonly metadata?;
|
|
42
|
+
constructor(options: RuntimeEventSubRunTracePublisherOptions);
|
|
43
|
+
publish(envelope: SubRunTraceEnvelope): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { RuntimeEventSubRunTracePublisher };
|
|
47
|
+
export type { RuntimeEventSubRunTracePublisherOptions };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { RuntimeEventSink } from '../graph-engine/types.js';
|
|
2
|
+
import { SubRunTracePublisher, SubRunTraceEnvelope } from './subrunTrace.types.js';
|
|
3
|
+
import { ToolCallId } from '../../contracts/identity/definitions.js';
|
|
4
|
+
|
|
5
|
+
interface RuntimeEventSubRunTracePublisherOptions {
|
|
6
|
+
runtimeEventSink: RuntimeEventSink;
|
|
7
|
+
/** 父会话上下文:用于填充 RuntimeEvent 基础字段 */
|
|
8
|
+
conversationId: string;
|
|
9
|
+
turnId: string;
|
|
10
|
+
/** 绑定关系:用于 UI 精确归属与并发分桶 */
|
|
11
|
+
parentToolCallId: ToolCallId;
|
|
12
|
+
subrunId: string;
|
|
13
|
+
subrunParentId?: string;
|
|
14
|
+
/**
|
|
15
|
+
* 事件来源(用于调试与过滤)
|
|
16
|
+
* 建议格式:`subrun:<tool_name>` 或 `tool:<tool_name>:subrun`
|
|
17
|
+
*/
|
|
18
|
+
source?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 透传到 RuntimeEvent.metadata 的扩展字段(可选)
|
|
21
|
+
* 注意:metadata 只允许承载非关键展示/诊断信息。路由、归并、生命周期和副作用目标
|
|
22
|
+
* 必须使用共享正式字段或上层显式绑定,不能让前端从这里恢复业务身份。
|
|
23
|
+
*/
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* RuntimeEventSubRunTracePublisher
|
|
28
|
+
*
|
|
29
|
+
* 说明:
|
|
30
|
+
* - 该发布器在构造时绑定 parent_tool_call_id 与 subrun_id;
|
|
31
|
+
* - 每次 publish 只需要提供“分片载荷”(kind/delta/...)即可。
|
|
32
|
+
*/
|
|
33
|
+
declare class RuntimeEventSubRunTracePublisher implements SubRunTracePublisher {
|
|
34
|
+
private readonly runtimeEventSink;
|
|
35
|
+
private readonly conversationId;
|
|
36
|
+
private readonly turnId;
|
|
37
|
+
private readonly parentToolCallId;
|
|
38
|
+
private readonly subrunId;
|
|
39
|
+
private readonly subrunParentId?;
|
|
40
|
+
private readonly source;
|
|
41
|
+
private readonly metadata?;
|
|
42
|
+
constructor(options: RuntimeEventSubRunTracePublisherOptions);
|
|
43
|
+
publish(envelope: SubRunTraceEnvelope): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { RuntimeEventSubRunTracePublisher };
|
|
47
|
+
export type { RuntimeEventSubRunTracePublisherOptions };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { RuntimeResourceRef } from '../../contracts/resource-ref.cjs';
|
|
2
|
+
import { ToolCallId } from '../../contracts/identity/definitions.cjs';
|
|
3
|
+
import { SerializableJsonRecord } from '../../contracts/json.cjs';
|
|
4
|
+
import { SubRunTraceEvent } from '../../contracts/events.cjs';
|
|
5
|
+
import { SubRunTraceToolCallDecision } from '../../contracts/sub-run-trace-payload.cjs';
|
|
6
|
+
import { FinalAnswerCompletionReason } from '../../contracts/final-answer.cjs';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 子 run trace 的“业务无关”发布载荷。
|
|
10
|
+
*
|
|
11
|
+
* 说明:
|
|
12
|
+
* - 该结构刻意只包含 subrun_trace 的 payload 字段(不包含 conversation_id/turn_id 等基础字段)
|
|
13
|
+
* - parent_tool_call_id/subrun_id 是发布器构造时绑定的,不需要每次 publish 重复提供
|
|
14
|
+
*/
|
|
15
|
+
interface SubRunTraceEnvelopeBase {
|
|
16
|
+
/** child RuntimeEvent 的稳定身份;parent trace 必须与 source fact 一一对应。 */
|
|
17
|
+
source_event_id: string;
|
|
18
|
+
/** 只允许非路由、非归并的附加展示信息。 */
|
|
19
|
+
meta?: SerializableJsonRecord;
|
|
20
|
+
}
|
|
21
|
+
type SubRunTraceEnvelope = SubRunTraceEnvelopeBase & ({
|
|
22
|
+
kind: 'thought_delta';
|
|
23
|
+
delta: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'thought_complete';
|
|
26
|
+
content: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'tool_call_decision';
|
|
29
|
+
tool_calls: readonly SubRunTraceToolCallDecision[];
|
|
30
|
+
} | {
|
|
31
|
+
kind: 'tool_process';
|
|
32
|
+
tool_name: string;
|
|
33
|
+
tool_call_id: ToolCallId;
|
|
34
|
+
phase: NonNullable<SubRunTraceEvent['phase']>;
|
|
35
|
+
status: NonNullable<SubRunTraceEvent['status']>;
|
|
36
|
+
args: SerializableJsonRecord;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'tool_output';
|
|
39
|
+
tool_name: string;
|
|
40
|
+
tool_call_id: ToolCallId;
|
|
41
|
+
status: 'success';
|
|
42
|
+
output: NonNullable<SubRunTraceEvent['output']>;
|
|
43
|
+
attachments?: readonly RuntimeResourceRef[];
|
|
44
|
+
duration_ms?: number;
|
|
45
|
+
} | {
|
|
46
|
+
kind: 'tool_output';
|
|
47
|
+
tool_name: string;
|
|
48
|
+
tool_call_id: ToolCallId;
|
|
49
|
+
status: 'error';
|
|
50
|
+
output: NonNullable<SubRunTraceEvent['output']>;
|
|
51
|
+
duration_ms?: number;
|
|
52
|
+
} | {
|
|
53
|
+
kind: 'final_answer_chunk';
|
|
54
|
+
answer_id: string;
|
|
55
|
+
seq: number;
|
|
56
|
+
delta: string;
|
|
57
|
+
is_last?: boolean;
|
|
58
|
+
} | {
|
|
59
|
+
kind: 'final_answer';
|
|
60
|
+
answer_id: string;
|
|
61
|
+
content: string;
|
|
62
|
+
completion_reason: FinalAnswerCompletionReason;
|
|
63
|
+
} | {
|
|
64
|
+
kind: 'history_summary';
|
|
65
|
+
original_message_count: number;
|
|
66
|
+
replaced_message_ids: readonly string[];
|
|
67
|
+
compression_ratio?: number;
|
|
68
|
+
included_old_summary?: boolean;
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* 子 run trace 发布器接口(面向业务工具层)。
|
|
72
|
+
*
|
|
73
|
+
* 约束:
|
|
74
|
+
* - 发布器必须确保生成的 RuntimeEvent 为 `type='subrun_trace'` 且 `ephemeral=true`
|
|
75
|
+
* - 发布器应保证每条事件的 id 唯一(用于前端 processedEvents 幂等去重)
|
|
76
|
+
*/
|
|
77
|
+
interface SubRunTracePublisher {
|
|
78
|
+
publish(envelope: SubRunTraceEnvelope): void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type { SubRunTraceEnvelope, SubRunTracePublisher };
|