@assemblyline-agents/runtime 5.0.10 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/a2a-client.d.ts +1 -3
- package/dist/a2a-client.d.ts.map +1 -1
- package/dist/a2a-client.js +1 -4
- package/dist/a2a-client.js.map +1 -1
- package/dist/agent-event-handlers.d.ts +2 -0
- package/dist/agent-event-handlers.d.ts.map +1 -1
- package/dist/agent-event-handlers.js +1 -1
- package/dist/agent-event-handlers.js.map +1 -1
- package/dist/agent-hook-context.d.ts.map +1 -1
- package/dist/agent-hook-context.js +3 -1
- package/dist/agent-hook-context.js.map +1 -1
- package/dist/agent-hook-controller-factory.d.ts +5 -1
- package/dist/agent-hook-controller-factory.d.ts.map +1 -1
- package/dist/agent-hook-controller-factory.js +11 -9
- package/dist/agent-hook-controller-factory.js.map +1 -1
- package/dist/agent-hook-evaluation.d.ts +0 -2
- package/dist/agent-hook-evaluation.d.ts.map +1 -1
- package/dist/agent-hook-evaluation.js +10 -10
- package/dist/agent-hook-evaluation.js.map +1 -1
- package/dist/agent-hook-run-lifecycle.d.ts +1 -2
- package/dist/agent-hook-run-lifecycle.d.ts.map +1 -1
- package/dist/agent-hook-run-lifecycle.js +1 -2
- package/dist/agent-hook-run-lifecycle.js.map +1 -1
- package/dist/agent-surface.d.ts +5 -2
- package/dist/agent-surface.d.ts.map +1 -1
- package/dist/agent-surface.js +11 -3
- package/dist/agent-surface.js.map +1 -1
- package/dist/artifact-selection.js +1 -1
- package/dist/artifact-selection.js.map +1 -1
- package/dist/assembly-line-runtime.d.ts +9 -0
- package/dist/assembly-line-runtime.d.ts.map +1 -0
- package/dist/assembly-line-runtime.js +9 -0
- package/dist/assembly-line-runtime.js.map +1 -0
- package/dist/attachment-download.d.ts +17 -0
- package/dist/attachment-download.d.ts.map +1 -0
- package/dist/attachment-download.js +51 -0
- package/dist/attachment-download.js.map +1 -0
- package/dist/attachments.d.ts +2 -14
- package/dist/attachments.d.ts.map +1 -1
- package/dist/attachments.js +8 -80
- package/dist/attachments.js.map +1 -1
- package/dist/background-review-types.d.ts +2 -0
- package/dist/background-review-types.d.ts.map +1 -1
- package/dist/background-review.d.ts.map +1 -1
- package/dist/background-review.js +13 -0
- package/dist/background-review.js.map +1 -1
- package/dist/background-subagents.d.ts +1 -1
- package/dist/background-subagents.d.ts.map +1 -1
- package/dist/blob-storage.d.ts +12 -0
- package/dist/blob-storage.d.ts.map +1 -0
- package/dist/blob-storage.js +86 -0
- package/dist/blob-storage.js.map +1 -0
- package/dist/builtin-tool-executors.d.ts.map +1 -1
- package/dist/builtin-tool-executors.js +14 -18
- package/dist/builtin-tool-executors.js.map +1 -1
- package/dist/builtin-tools.d.ts +1 -2
- package/dist/builtin-tools.d.ts.map +1 -1
- package/dist/builtin-tools.js +0 -8
- package/dist/builtin-tools.js.map +1 -1
- package/dist/capability-inspection.d.ts +4 -0
- package/dist/capability-inspection.d.ts.map +1 -1
- package/dist/capability-inspection.js +10 -11
- package/dist/capability-inspection.js.map +1 -1
- package/dist/channel-credential-environment.d.ts +1 -1
- package/dist/channel-credential-environment.d.ts.map +1 -1
- package/dist/channel-credential-environment.js +1 -6
- package/dist/channel-credential-environment.js.map +1 -1
- package/dist/channel-ingress.d.ts +1 -2
- package/dist/channel-ingress.d.ts.map +1 -1
- package/dist/channel-ingress.js +2 -2
- package/dist/channel-ingress.js.map +1 -1
- package/dist/channel-operation.d.ts +0 -1
- package/dist/channel-operation.d.ts.map +1 -1
- package/dist/channel-operation.js +1 -2
- package/dist/channel-operation.js.map +1 -1
- package/dist/channel.d.ts +32 -3
- package/dist/channel.d.ts.map +1 -1
- package/dist/connection-assets.d.ts.map +1 -1
- package/dist/connection-assets.js.map +1 -1
- package/dist/connection-authorization-service.d.ts +52 -0
- package/dist/connection-authorization-service.d.ts.map +1 -0
- package/dist/connection-authorization-service.js +417 -0
- package/dist/connection-authorization-service.js.map +1 -0
- package/dist/connection-credential-materialization.d.ts +23 -0
- package/dist/connection-credential-materialization.d.ts.map +1 -0
- package/dist/connection-credential-materialization.js +223 -0
- package/dist/connection-credential-materialization.js.map +1 -0
- package/dist/connection-definition-loader.d.ts +6 -0
- package/dist/connection-definition-loader.d.ts.map +1 -0
- package/dist/connection-definition-loader.js +102 -0
- package/dist/connection-definition-loader.js.map +1 -0
- package/dist/connection-discovery.d.ts +11 -0
- package/dist/connection-discovery.d.ts.map +1 -0
- package/dist/connection-discovery.js +105 -0
- package/dist/connection-discovery.js.map +1 -0
- package/dist/connection-events.d.ts.map +1 -1
- package/dist/connection-events.js.map +1 -1
- package/dist/connection-oauth-client.d.ts +3 -0
- package/dist/connection-oauth-client.d.ts.map +1 -0
- package/dist/connection-oauth-client.js +64 -0
- package/dist/connection-oauth-client.js.map +1 -0
- package/dist/connection-runtime-types.d.ts +78 -0
- package/dist/connection-runtime-types.d.ts.map +1 -0
- package/dist/connection-runtime-types.js +31 -0
- package/dist/connection-runtime-types.js.map +1 -0
- package/dist/connections.d.ts +18 -167
- package/dist/connections.d.ts.map +1 -1
- package/dist/connections.js +71 -1017
- package/dist/connections.js.map +1 -1
- package/dist/context-policy-util.d.ts +0 -4
- package/dist/context-policy-util.d.ts.map +1 -1
- package/dist/context-policy-util.js +0 -10
- package/dist/context-policy-util.js.map +1 -1
- package/dist/conversation-context.d.ts +1 -1
- package/dist/conversation-context.d.ts.map +1 -1
- package/dist/conversation-context.js +12 -9
- package/dist/conversation-context.js.map +1 -1
- package/dist/default-outbound-route.d.ts +1 -0
- package/dist/default-outbound-route.d.ts.map +1 -1
- package/dist/default-outbound-route.js +1 -1
- package/dist/default-outbound-route.js.map +1 -1
- package/dist/delivery-queue.d.ts +1 -1
- package/dist/delivery-send.d.ts.map +1 -1
- package/dist/delivery-send.js +3 -2
- package/dist/delivery-send.js.map +1 -1
- package/dist/dynamic-schedule-execution.d.ts +4 -0
- package/dist/dynamic-schedule-execution.d.ts.map +1 -0
- package/dist/dynamic-schedule-execution.js +136 -0
- package/dist/dynamic-schedule-execution.js.map +1 -0
- package/dist/dynamic-schedule-runtime.d.ts +11 -20
- package/dist/dynamic-schedule-runtime.d.ts.map +1 -1
- package/dist/dynamic-schedule-runtime.js +27 -39
- package/dist/dynamic-schedule-runtime.js.map +1 -1
- package/dist/evolution-tracker.d.ts +52 -0
- package/dist/evolution-tracker.d.ts.map +1 -0
- package/dist/evolution-tracker.js +179 -0
- package/dist/evolution-tracker.js.map +1 -0
- package/dist/harness-capabilities.d.ts +7 -0
- package/dist/harness-capabilities.d.ts.map +1 -0
- package/dist/harness-capabilities.js +56 -0
- package/dist/harness-capabilities.js.map +1 -0
- package/dist/harness-continuation-persistence.d.ts +6 -0
- package/dist/harness-continuation-persistence.d.ts.map +1 -0
- package/dist/harness-continuation-persistence.js +11 -0
- package/dist/harness-continuation-persistence.js.map +1 -0
- package/dist/harness-execution-context.d.ts +10 -0
- package/dist/harness-execution-context.d.ts.map +1 -0
- package/dist/harness-execution-context.js +193 -0
- package/dist/harness-execution-context.js.map +1 -0
- package/dist/harness-loop-types.d.ts +67 -0
- package/dist/harness-loop-types.d.ts.map +1 -0
- package/dist/harness-loop-types.js +2 -0
- package/dist/harness-loop-types.js.map +1 -0
- package/dist/harness-loop.d.ts +13 -94
- package/dist/harness-loop.d.ts.map +1 -1
- package/dist/harness-loop.js +19 -551
- package/dist/harness-loop.js.map +1 -1
- package/dist/harness-tool-execution.d.ts +30 -0
- package/dist/harness-tool-execution.d.ts.map +1 -0
- package/dist/harness-tool-execution.js +397 -0
- package/dist/harness-tool-execution.js.map +1 -0
- package/dist/harness-transcript-resume.d.ts +18 -0
- package/dist/harness-transcript-resume.d.ts.map +1 -0
- package/dist/harness-transcript-resume.js +102 -0
- package/dist/harness-transcript-resume.js.map +1 -0
- package/dist/harness-turn-execution.d.ts +11 -0
- package/dist/harness-turn-execution.d.ts.map +1 -0
- package/dist/harness-turn-execution.js +157 -0
- package/dist/harness-turn-execution.js.map +1 -0
- package/dist/index.d.ts +10 -499
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -2139
- package/dist/index.js.map +1 -1
- package/dist/local-sandbox.d.ts +2 -1
- package/dist/local-sandbox.d.ts.map +1 -1
- package/dist/mcp-client.d.ts +11 -1
- package/dist/mcp-client.d.ts.map +1 -1
- package/dist/mcp-client.js +39 -7
- package/dist/mcp-client.js.map +1 -1
- package/dist/media-processor.d.ts +3 -1
- package/dist/media-processor.d.ts.map +1 -1
- package/dist/media-processor.js +15 -1
- package/dist/media-processor.js.map +1 -1
- package/dist/memory-storage.d.ts +51 -0
- package/dist/memory-storage.d.ts.map +1 -0
- package/dist/memory-storage.js +324 -0
- package/dist/memory-storage.js.map +1 -0
- package/dist/model-credential-stores.d.ts.map +1 -1
- package/dist/model-credential-stores.js +6 -12
- package/dist/model-credential-stores.js.map +1 -1
- package/dist/model-provider-environment.d.ts +4 -0
- package/dist/model-provider-environment.d.ts.map +1 -0
- package/dist/model-provider-environment.js +36 -0
- package/dist/model-provider-environment.js.map +1 -0
- package/dist/plugin-embeddings.d.ts +4 -0
- package/dist/plugin-embeddings.d.ts.map +1 -0
- package/dist/plugin-embeddings.js +75 -0
- package/dist/plugin-embeddings.js.map +1 -0
- package/dist/public-api.d.ts +8 -5
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +6 -4
- package/dist/public-api.js.map +1 -1
- package/dist/relay-mcp-client.js +1 -1
- package/dist/relay-mcp-client.js.map +1 -1
- package/dist/replay-resume-authorization.d.ts +8 -0
- package/dist/replay-resume-authorization.d.ts.map +1 -0
- package/dist/replay-resume-authorization.js +181 -0
- package/dist/replay-resume-authorization.js.map +1 -0
- package/dist/replay-resume-connection.d.ts +6 -0
- package/dist/replay-resume-connection.d.ts.map +1 -0
- package/dist/replay-resume-connection.js +75 -0
- package/dist/replay-resume-connection.js.map +1 -0
- package/dist/replay-resume-controls.d.ts +6 -0
- package/dist/replay-resume-controls.d.ts.map +1 -0
- package/dist/replay-resume-controls.js +157 -0
- package/dist/replay-resume-controls.js.map +1 -0
- package/dist/replay-resume-harness.d.ts +14 -0
- package/dist/replay-resume-harness.d.ts.map +1 -0
- package/dist/replay-resume-harness.js +158 -0
- package/dist/replay-resume-harness.js.map +1 -0
- package/dist/replay-resume-recovery.d.ts +10 -0
- package/dist/replay-resume-recovery.d.ts.map +1 -0
- package/dist/replay-resume-recovery.js +62 -0
- package/dist/replay-resume-recovery.js.map +1 -0
- package/dist/replay-resume-shared.d.ts +16 -0
- package/dist/replay-resume-shared.d.ts.map +1 -0
- package/dist/replay-resume-shared.js +55 -0
- package/dist/replay-resume-shared.js.map +1 -0
- package/dist/replay-resume-types.d.ts +85 -0
- package/dist/replay-resume-types.d.ts.map +1 -0
- package/dist/replay-resume-types.js +2 -0
- package/dist/replay-resume-types.js.map +1 -0
- package/dist/replay-resume.d.ts +7 -119
- package/dist/replay-resume.d.ts.map +1 -1
- package/dist/replay-resume.js +5 -715
- package/dist/replay-resume.js.map +1 -1
- package/dist/resource-projection-util.d.ts +1 -2
- package/dist/resource-projection-util.d.ts.map +1 -1
- package/dist/resource-projection-util.js +2 -11
- package/dist/resource-projection-util.js.map +1 -1
- package/dist/resource-projection.d.ts.map +1 -1
- package/dist/resource-projection.js +67 -22
- package/dist/resource-projection.js.map +1 -1
- package/dist/run-execution-host.d.ts +98 -0
- package/dist/run-execution-host.d.ts.map +1 -0
- package/dist/run-execution-host.js +2 -0
- package/dist/run-execution-host.js.map +1 -0
- package/dist/run-execution.d.ts +6 -0
- package/dist/run-execution.d.ts.map +1 -0
- package/dist/run-execution.js +313 -0
- package/dist/run-execution.js.map +1 -0
- package/dist/run-initialization.d.ts +19 -0
- package/dist/run-initialization.d.ts.map +1 -0
- package/dist/run-initialization.js +171 -0
- package/dist/run-initialization.js.map +1 -0
- package/dist/run-recovery.d.ts +1 -1
- package/dist/run-recovery.js.map +1 -1
- package/dist/runtime-connection-definitions.d.ts +35 -0
- package/dist/runtime-connection-definitions.d.ts.map +1 -0
- package/dist/runtime-connection-definitions.js +97 -0
- package/dist/runtime-connection-definitions.js.map +1 -0
- package/dist/runtime-engine-background.d.ts +64 -0
- package/dist/runtime-engine-background.d.ts.map +1 -0
- package/dist/runtime-engine-background.js +136 -0
- package/dist/runtime-engine-background.js.map +1 -0
- package/dist/runtime-engine-base.d.ts +60 -0
- package/dist/runtime-engine-base.d.ts.map +1 -0
- package/dist/runtime-engine-base.js +192 -0
- package/dist/runtime-engine-base.js.map +1 -0
- package/dist/runtime-engine-capabilities.d.ts +81 -0
- package/dist/runtime-engine-capabilities.d.ts.map +1 -0
- package/dist/runtime-engine-capabilities.js +198 -0
- package/dist/runtime-engine-capabilities.js.map +1 -0
- package/dist/runtime-engine-config.d.ts +77 -0
- package/dist/runtime-engine-config.d.ts.map +1 -0
- package/dist/runtime-engine-config.js +187 -0
- package/dist/runtime-engine-config.js.map +1 -0
- package/dist/runtime-engine-foundation.d.ts +11 -0
- package/dist/runtime-engine-foundation.d.ts.map +1 -0
- package/dist/runtime-engine-foundation.js +121 -0
- package/dist/runtime-engine-foundation.js.map +1 -0
- package/dist/runtime-engine-hooks.d.ts +33 -0
- package/dist/runtime-engine-hooks.d.ts.map +1 -0
- package/dist/runtime-engine-hooks.js +149 -0
- package/dist/runtime-engine-hooks.js.map +1 -0
- package/dist/runtime-engine-integrations.d.ts +16 -0
- package/dist/runtime-engine-integrations.d.ts.map +1 -0
- package/dist/runtime-engine-integrations.js +177 -0
- package/dist/runtime-engine-integrations.js.map +1 -0
- package/dist/runtime-engine-operations.d.ts +87 -0
- package/dist/runtime-engine-operations.d.ts.map +1 -0
- package/dist/runtime-engine-operations.js +204 -0
- package/dist/runtime-engine-operations.js.map +1 -0
- package/dist/runtime-engine-resources.d.ts +18 -0
- package/dist/runtime-engine-resources.d.ts.map +1 -0
- package/dist/runtime-engine-resources.js +49 -0
- package/dist/runtime-engine-resources.js.map +1 -0
- package/dist/runtime-engine-run.d.ts +70 -0
- package/dist/runtime-engine-run.d.ts.map +1 -0
- package/dist/runtime-engine-run.js +202 -0
- package/dist/runtime-engine-run.js.map +1 -0
- package/dist/runtime-engine-scheduling.d.ts +22 -0
- package/dist/runtime-engine-scheduling.d.ts.map +1 -0
- package/dist/runtime-engine-scheduling.js +45 -0
- package/dist/runtime-engine-scheduling.js.map +1 -0
- package/dist/runtime-engine-tools.d.ts +8 -0
- package/dist/runtime-engine-tools.d.ts.map +1 -0
- package/dist/runtime-engine-tools.js +80 -0
- package/dist/runtime-engine-tools.js.map +1 -0
- package/dist/runtime-evolution.d.ts +17 -0
- package/dist/runtime-evolution.d.ts.map +1 -0
- package/dist/runtime-evolution.js +51 -0
- package/dist/runtime-evolution.js.map +1 -0
- package/dist/runtime-learning.d.ts +4 -6
- package/dist/runtime-learning.d.ts.map +1 -1
- package/dist/runtime-learning.js +109 -99
- package/dist/runtime-learning.js.map +1 -1
- package/dist/runtime-types.d.ts +21 -7
- package/dist/runtime-types.d.ts.map +1 -1
- package/dist/runtime-util.d.ts +4 -3
- package/dist/runtime-util.d.ts.map +1 -1
- package/dist/runtime-util.js +0 -7
- package/dist/runtime-util.js.map +1 -1
- package/dist/sandbox-fs.d.ts +2 -7
- package/dist/sandbox-fs.d.ts.map +1 -1
- package/dist/sandbox-fs.js +6 -37
- package/dist/sandbox-fs.js.map +1 -1
- package/dist/sandbox-handle.d.ts +1 -3
- package/dist/sandbox-handle.d.ts.map +1 -1
- package/dist/sandbox-handle.js +2 -5
- package/dist/sandbox-handle.js.map +1 -1
- package/dist/sandbox-state-sync.d.ts +2 -0
- package/dist/sandbox-state-sync.d.ts.map +1 -1
- package/dist/sandbox-state-sync.js +26 -2
- package/dist/sandbox-state-sync.js.map +1 -1
- package/dist/sandbox-tool-bridge.js +2 -3
- package/dist/sandbox-tool-bridge.js.map +1 -1
- package/dist/schedule-execution.d.ts +4 -4
- package/dist/schedule-execution.d.ts.map +1 -1
- package/dist/schedule-execution.js +45 -440
- package/dist/schedule-execution.js.map +1 -1
- package/dist/schedule-trigger-context.d.ts +18 -0
- package/dist/schedule-trigger-context.d.ts.map +1 -0
- package/dist/schedule-trigger-context.js +276 -0
- package/dist/schedule-trigger-context.js.map +1 -0
- package/dist/scheduler.d.ts +1 -14
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +1 -37
- package/dist/scheduler.js.map +1 -1
- package/dist/security.d.ts +0 -4
- package/dist/security.d.ts.map +1 -1
- package/dist/security.js +0 -22
- package/dist/security.js.map +1 -1
- package/dist/self-improvement.d.ts +5 -21
- package/dist/self-improvement.d.ts.map +1 -1
- package/dist/self-improvement.js +10 -40
- package/dist/self-improvement.js.map +1 -1
- package/dist/source-loader.d.ts +0 -3
- package/dist/source-loader.d.ts.map +1 -1
- package/dist/source-loader.js +1 -10
- package/dist/source-loader.js.map +1 -1
- package/dist/state/conversation-state.d.ts +117 -0
- package/dist/state/conversation-state.d.ts.map +1 -0
- package/dist/state/conversation-state.js +2 -0
- package/dist/state/conversation-state.js.map +1 -0
- package/dist/state/run-state.d.ts +129 -0
- package/dist/state/run-state.d.ts.map +1 -0
- package/dist/state/run-state.js +3 -0
- package/dist/state/run-state.js.map +1 -0
- package/dist/state/sandbox-memory-state.d.ts +159 -0
- package/dist/state/sandbox-memory-state.d.ts.map +1 -0
- package/dist/state/sandbox-memory-state.js +2 -0
- package/dist/state/sandbox-memory-state.js.map +1 -0
- package/dist/state/store-contracts.d.ts +329 -0
- package/dist/state/store-contracts.d.ts.map +1 -0
- package/dist/state/store-contracts.js +26 -0
- package/dist/state/store-contracts.js.map +1 -0
- package/dist/state/usage-state.d.ts +111 -0
- package/dist/state/usage-state.d.ts.map +1 -0
- package/dist/state/usage-state.js +2 -0
- package/dist/state/usage-state.js.map +1 -0
- package/dist/state/workspace-state.d.ts +126 -0
- package/dist/state/workspace-state.d.ts.map +1 -0
- package/dist/state/workspace-state.js +16 -0
- package/dist/state/workspace-state.js.map +1 -0
- package/dist/state-stores.d.ts +3 -15
- package/dist/state-stores.d.ts.map +1 -1
- package/dist/state-stores.js +36 -82
- package/dist/state-stores.js.map +1 -1
- package/dist/state.d.ts +7 -1075
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +7 -88
- package/dist/state.js.map +1 -1
- package/dist/storage.d.ts +4 -64
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +5 -408
- package/dist/storage.js.map +1 -1
- package/dist/subagent-execution.d.ts +1 -2
- package/dist/subagent-execution.d.ts.map +1 -1
- package/dist/subagent-execution.js +2 -26
- package/dist/subagent-execution.js.map +1 -1
- package/dist/subagent-handoff.d.ts +13 -0
- package/dist/subagent-handoff.d.ts.map +1 -1
- package/dist/subagent-handoff.js +74 -9
- package/dist/subagent-handoff.js.map +1 -1
- package/dist/tool-apis.d.ts +2 -2
- package/dist/tool-apis.d.ts.map +1 -1
- package/dist/tool-apis.js +26 -14
- package/dist/tool-apis.js.map +1 -1
- package/dist/tool-execution-host.d.ts +121 -0
- package/dist/tool-execution-host.d.ts.map +1 -0
- package/dist/tool-execution-host.js +2 -0
- package/dist/tool-execution-host.js.map +1 -0
- package/dist/tool-execution.d.ts +5 -141
- package/dist/tool-execution.d.ts.map +1 -1
- package/dist/tool-execution.js +6 -395
- package/dist/tool-execution.js.map +1 -1
- package/dist/usage-reconciliation-support.d.ts +20 -0
- package/dist/usage-reconciliation-support.d.ts.map +1 -0
- package/dist/usage-reconciliation-support.js +95 -0
- package/dist/usage-reconciliation-support.js.map +1 -0
- package/dist/usage-reconciliation.d.ts +14 -35
- package/dist/usage-reconciliation.d.ts.map +1 -1
- package/dist/usage-reconciliation.js +17 -394
- package/dist/usage-reconciliation.js.map +1 -1
- package/dist/workspace-paths.d.ts +3 -0
- package/dist/workspace-paths.d.ts.map +1 -0
- package/dist/workspace-paths.js +13 -0
- package/dist/workspace-paths.js.map +1 -0
- package/dist/workspace-service.d.ts +0 -1
- package/dist/workspace-service.d.ts.map +1 -1
- package/dist/workspace-service.js +1 -4
- package/dist/workspace-service.js.map +1 -1
- package/package.json +3 -3
- package/dist/run-timeline.d.ts +0 -11
- package/dist/run-timeline.d.ts.map +0 -1
- package/dist/run-timeline.js +0 -2
- package/dist/run-timeline.js.map +0 -1
- package/dist/trusted-attachments.d.ts +0 -20
- package/dist/trusted-attachments.d.ts.map +0 -1
- package/dist/trusted-attachments.js +0 -276
- package/dist/trusted-attachments.js.map +0 -1
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { persistConversationTranscriptImpl } from "./conversation-transcript.js";
|
|
2
|
+
import { capabilityPromptKey, capabilitySystemPrompt, capabilityToolNames, replaceCapabilitySet } from "./harness-capabilities.js";
|
|
3
|
+
export async function resumeHarnessLoopImpl(host, run, harness, restored, resume) {
|
|
4
|
+
let currentRun = run;
|
|
5
|
+
const controller = await host.ensureAgentHookController(currentRun);
|
|
6
|
+
let appliedSnapshotId = controller.current.id;
|
|
7
|
+
const capabilities = controller.current.declaration;
|
|
8
|
+
let appliedPromptKey = capabilityPromptKey(capabilities);
|
|
9
|
+
harness = await host.resolveAgentHarness(capabilities.model);
|
|
10
|
+
if (restored.continuation.harness !== harness.id || restored.continuation.version !== harness.continuationVersion) {
|
|
11
|
+
throw new Error(`Recovered capabilities select harness "${harness.id}" v${harness.continuationVersion}, which cannot read the stored ${restored.continuation.harness} v${restored.continuation.version} continuation.`);
|
|
12
|
+
}
|
|
13
|
+
const activeSkills = new Set(capabilities.skills);
|
|
14
|
+
const rootSurface = currentRun.input.agentSurface === "root";
|
|
15
|
+
const defaultToolNames = new Set(capabilityToolNames(capabilities, rootSurface));
|
|
16
|
+
const discoveredConnectionTools = new Map();
|
|
17
|
+
let pause;
|
|
18
|
+
let bundle = await host.buildContextBundle({
|
|
19
|
+
message: "harness resume",
|
|
20
|
+
channel: restored.runtime.channel,
|
|
21
|
+
capabilities,
|
|
22
|
+
run: currentRun
|
|
23
|
+
});
|
|
24
|
+
bundle = {
|
|
25
|
+
...bundle,
|
|
26
|
+
instructions: host.resolvedInstructionsForRun(currentRun, bundle, capabilities)
|
|
27
|
+
};
|
|
28
|
+
const sandboxHandle = host.createSandboxHandle(() => currentRun, (nextRun) => {
|
|
29
|
+
currentRun = nextRun;
|
|
30
|
+
}, () => bundle);
|
|
31
|
+
const connectionRegistry = host.createConnectionRegistryForRun(run, restored.runtime.channel, sandboxHandle, new Set(capabilities.connections));
|
|
32
|
+
const session = {
|
|
33
|
+
modelSpec: capabilities.model,
|
|
34
|
+
reasoning: capabilities.reasoning,
|
|
35
|
+
systemPrompt: capabilitySystemPrompt(bundle, capabilities.outputSchema, ""),
|
|
36
|
+
outputSchema: capabilities.outputSchema,
|
|
37
|
+
maxIterations: restored.runtime.maxIterations,
|
|
38
|
+
sessionId: restored.runtime.sessionId,
|
|
39
|
+
channel: restored.runtime.channel,
|
|
40
|
+
activeSkills,
|
|
41
|
+
defaultToolNames,
|
|
42
|
+
discoveredConnectionTools
|
|
43
|
+
};
|
|
44
|
+
if (restored.runtime.conversationId)
|
|
45
|
+
session.conversationId = restored.runtime.conversationId;
|
|
46
|
+
const loopState = {
|
|
47
|
+
run: () => currentRun,
|
|
48
|
+
setRun: (nextRun) => {
|
|
49
|
+
currentRun = nextRun;
|
|
50
|
+
},
|
|
51
|
+
sandboxHandle,
|
|
52
|
+
activeSkills,
|
|
53
|
+
defaultToolNames,
|
|
54
|
+
connectionRegistry,
|
|
55
|
+
discoveredConnectionTools,
|
|
56
|
+
exposedDeferredToolNames: new Set(),
|
|
57
|
+
setPause: (nextPause) => {
|
|
58
|
+
pause ??= nextPause;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const refreshCapabilities = async () => {
|
|
62
|
+
const snapshot = await controller.refreshIfDirty();
|
|
63
|
+
if (snapshot.id !== appliedSnapshotId) {
|
|
64
|
+
const nextSandbox = snapshot.declaration.sandbox ?? null;
|
|
65
|
+
const sandboxChanged = (currentRun.input.agentSandbox ?? null) !== nextSandbox;
|
|
66
|
+
if (sandboxChanged)
|
|
67
|
+
await sandboxHandle.reset();
|
|
68
|
+
currentRun = await host.state.updateRun(currentRun.id, {
|
|
69
|
+
input: {
|
|
70
|
+
...currentRun.input,
|
|
71
|
+
model: snapshot.declaration.model,
|
|
72
|
+
agentSandbox: nextSandbox,
|
|
73
|
+
agentConnections: snapshot.declaration.connections,
|
|
74
|
+
agentSubagents: snapshot.declaration.subagents
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
loopState.setRun(currentRun);
|
|
78
|
+
const nextPromptKey = capabilityPromptKey(snapshot.declaration);
|
|
79
|
+
const promptChanged = nextPromptKey !== appliedPromptKey;
|
|
80
|
+
if (promptChanged) {
|
|
81
|
+
bundle = await host.buildContextBundle({
|
|
82
|
+
message: "harness resume",
|
|
83
|
+
channel: restored.runtime.channel,
|
|
84
|
+
capabilities: snapshot.declaration,
|
|
85
|
+
run: currentRun
|
|
86
|
+
});
|
|
87
|
+
bundle = {
|
|
88
|
+
...bundle,
|
|
89
|
+
instructions: host.resolvedInstructionsForRun(currentRun, bundle, snapshot.declaration)
|
|
90
|
+
};
|
|
91
|
+
appliedPromptKey = nextPromptKey;
|
|
92
|
+
}
|
|
93
|
+
appliedSnapshotId = snapshot.id;
|
|
94
|
+
replaceCapabilitySet(activeSkills, snapshot.declaration.skills);
|
|
95
|
+
replaceCapabilitySet(defaultToolNames, capabilityToolNames(snapshot.declaration, rootSurface));
|
|
96
|
+
loopState.connectionRegistry = host.createConnectionRegistryForRun(currentRun, restored.runtime.channel, sandboxHandle, new Set(snapshot.declaration.connections));
|
|
97
|
+
discoveredConnectionTools.clear();
|
|
98
|
+
loopState.exposedDeferredToolNames.clear();
|
|
99
|
+
session.modelSpec = snapshot.declaration.model;
|
|
100
|
+
session.reasoning = snapshot.declaration.reasoning;
|
|
101
|
+
session.outputSchema = snapshot.declaration.outputSchema;
|
|
102
|
+
if (promptChanged) {
|
|
103
|
+
session.systemPrompt = capabilitySystemPrompt(bundle, snapshot.declaration.outputSchema, "");
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
modelSpec: session.modelSpec,
|
|
108
|
+
systemPrompt: session.systemPrompt,
|
|
109
|
+
...(session.reasoning !== undefined ? { reasoning: session.reasoning } : {}),
|
|
110
|
+
...(session.outputSchema !== undefined ? { outputSchema: session.outputSchema } : {})
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
const heartbeat = host.startRunHeartbeat(run.id);
|
|
114
|
+
let policy;
|
|
115
|
+
try {
|
|
116
|
+
policy = await host.executeHarnessTurn(harness, {
|
|
117
|
+
kind: "resume",
|
|
118
|
+
continuation: restored.continuation,
|
|
119
|
+
...(resume.toolResult ? { toolResult: resume.toolResult } : {}),
|
|
120
|
+
...(resume.message !== undefined ? { message: resume.message } : {})
|
|
121
|
+
}, session, loopState, true, refreshCapabilities);
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
heartbeat.stop();
|
|
125
|
+
}
|
|
126
|
+
const result = policy.result;
|
|
127
|
+
if (pause) {
|
|
128
|
+
await host.persistHarnessContinuation(pause.run.id, session, result.continuation, pause);
|
|
129
|
+
return host.result(pause.run, result.response, pause.waitingForApproval, pause.waitingForInput, pause.waitingForConnection);
|
|
130
|
+
}
|
|
131
|
+
if (policy.failed || policy.controlStopped) {
|
|
132
|
+
await sandboxHandle.dispose();
|
|
133
|
+
return host.result(currentRun, result.response, false, false, false);
|
|
134
|
+
}
|
|
135
|
+
const completed = await host.completeRun(currentRun, sandboxHandle, result.response, restored.runtime.channel, undefined, restored.runtime.conversationId);
|
|
136
|
+
if (policy.output !== undefined)
|
|
137
|
+
completed.output = policy.output;
|
|
138
|
+
if (restored.runtime.conversationId && result.continuation && !policy.failed && !policy.controlStopped) {
|
|
139
|
+
try {
|
|
140
|
+
await persistConversationTranscriptImpl({
|
|
141
|
+
state: host.state,
|
|
142
|
+
createCheckpoint: (input) => host.createCheckpoint(input),
|
|
143
|
+
hydrateCheckpointData: (data) => host.hydrateCheckpointData(data)
|
|
144
|
+
}, {
|
|
145
|
+
runId: run.id,
|
|
146
|
+
conversationId: restored.runtime.conversationId,
|
|
147
|
+
session,
|
|
148
|
+
continuation: result.continuation,
|
|
149
|
+
...(session.lastInputTokens !== undefined ? { lastInputTokens: session.lastInputTokens } : {})
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Conversation transcript persistence remains best-effort.
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return completed;
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=replay-resume-harness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-resume-harness.js","sourceRoot":"","sources":["../src/replay-resume-harness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,2BAA2B,CAAC;AAMnC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,IAAsB,EACtB,GAAc,EACd,OAAqB,EACrB,QAAgC,EAChC,MAA6G;IAE7G,IAAI,UAAU,GAAG,GAAG,CAAC;IACrB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,CAAC;IACpE,IAAI,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9C,MAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,WAAW,CAAC;IACpD,IAAI,gBAAgB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACzD,OAAO,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAC7D,IAAI,QAAQ,CAAC,YAAY,CAAC,OAAO,KAAK,OAAO,CAAC,EAAE,IAAI,QAAQ,CAAC,YAAY,CAAC,OAAO,KAAK,OAAO,CAAC,mBAAmB,EAAE,CAAC;QAClH,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,CAAC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Q,CAAC,OAAO,CAAC,cAAc,IAAI,MAAM,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QACvG,IAAI,CAAC;YACH,MAAM,iCAAiC,CACrC;gBACE,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,gBAAgB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;gBACzD,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;aAClE,EACD;gBACE,KAAK,EAAE,GAAG,CAAC,EAAE;gBACb,cAAc,EAAE,QAAQ,CAAC,OAAO,CAAC,cAAc;gBAC/C,OAAO;gBACP,YAAY,EAAE,MAAM,CAAC,YAAY;gBACjC,GAAG,CAAC,OAAO,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC/F,CACF,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,2DAA2D;QAC7D,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReplayResumeHost } from "./replay-resume-types.js";
|
|
2
|
+
import type { RunRecord } from "./state.js";
|
|
3
|
+
/** Resume an orphaned run in place from its latest persisted continuation checkpoint. */
|
|
4
|
+
export declare function resumeRunFromContinuationImpl(host: ReplayResumeHost, run: RunRecord, context?: {
|
|
5
|
+
interruptedTools?: Array<{
|
|
6
|
+
toolCallId: string;
|
|
7
|
+
toolName: string;
|
|
8
|
+
}>;
|
|
9
|
+
}): Promise<RunRecord | undefined>;
|
|
10
|
+
//# sourceMappingURL=replay-resume-recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-resume-recovery.d.ts","sourceRoot":"","sources":["../src/replay-resume-recovery.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,yFAAyF;AACzF,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,SAAS,EACd,OAAO,CAAC,EAAE;IAAE,gBAAgB,CAAC,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAC/E,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAuDhC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { storedHarnessContinuation } from "./harness-continuation.js";
|
|
2
|
+
import { resumeHarnessLoopImpl } from "./replay-resume-harness.js";
|
|
3
|
+
import { crashResumeReport } from "./run-recovery.js";
|
|
4
|
+
/** Resume an orphaned run in place from its latest persisted continuation checkpoint. */
|
|
5
|
+
export async function resumeRunFromContinuationImpl(host, run, context) {
|
|
6
|
+
const checkpoints = await host.listHydratedCheckpoints(run.id);
|
|
7
|
+
let restored;
|
|
8
|
+
let checkpointCreatedAt;
|
|
9
|
+
for (let index = checkpoints.length - 1; index >= 0 && !restored; index -= 1) {
|
|
10
|
+
const checkpoint = checkpoints[index];
|
|
11
|
+
if (!checkpoint || checkpoint.name !== "harness.continuation")
|
|
12
|
+
continue;
|
|
13
|
+
restored = storedHarnessContinuation(checkpoint.data);
|
|
14
|
+
if (restored)
|
|
15
|
+
checkpointCreatedAt = checkpoint.createdAt;
|
|
16
|
+
}
|
|
17
|
+
if (!restored)
|
|
18
|
+
return undefined;
|
|
19
|
+
const harness = await host.resolveAgentHarness(restored.runtime.modelSpec);
|
|
20
|
+
if (restored.continuation.harness !== harness.id || restored.continuation.version !== harness.continuationVersion) {
|
|
21
|
+
await host.state.appendEvent(run.id, "harness.continuation_mismatch", {
|
|
22
|
+
expectedHarness: harness.id,
|
|
23
|
+
expectedVersion: harness.continuationVersion,
|
|
24
|
+
storedHarness: restored.continuation.harness,
|
|
25
|
+
storedVersion: restored.continuation.version
|
|
26
|
+
});
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
await host.state.appendEvent(run.id, "run.recovery_resume_attempted", { harness: harness.id });
|
|
30
|
+
const running = await host.state.updateRun(run.id, { status: "running" });
|
|
31
|
+
const pendingToolName = restored.runtime.pendingToolName;
|
|
32
|
+
const interrupted = context?.interruptedTools?.find((tool) => tool.toolName === pendingToolName);
|
|
33
|
+
const resume = interrupted
|
|
34
|
+
? {
|
|
35
|
+
toolResult: {
|
|
36
|
+
toolName: interrupted.toolName,
|
|
37
|
+
output: {
|
|
38
|
+
interrupted: true,
|
|
39
|
+
error: "This tool execution was interrupted by a runtime restart; its side effects may or may not have happened. Verify before re-running side-effecting operations."
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
: {};
|
|
44
|
+
if (!interrupted) {
|
|
45
|
+
const report = crashResumeReport(await host.state.listToolCalls(run.id), checkpointCreatedAt, context?.interruptedTools ?? []);
|
|
46
|
+
if (report)
|
|
47
|
+
resume.message = report;
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const result = await resumeHarnessLoopImpl(host, running, harness, restored, resume);
|
|
51
|
+
return result.run;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
55
|
+
if (/continue from message role/iu.test(message) || /no messages in context/iu.test(message)) {
|
|
56
|
+
await host.state.appendEvent(run.id, "run.recovery_resume_unavailable", { reason: message });
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
throw error;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=replay-resume-recovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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C;IACD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;QACrF,OAAO,MAAM,CAAC,GAAG,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,8BAA8B,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7F,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,iCAAiC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7F,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentHarness, HarnessInputMedia, JsonObject } from "@assemblyline-agents/core";
|
|
2
|
+
import { type RestoredHarnessSession } from "./harness-continuation.js";
|
|
3
|
+
import type { ReplayResumeHost } from "./replay-resume-types.js";
|
|
4
|
+
import type { CheckpointRecord, RunRecord } from "./state.js";
|
|
5
|
+
export declare function reclaimStaleResume(host: ReplayResumeHost, run: RunRecord, baseKey: string, kind: "approval" | "input"): Promise<void>;
|
|
6
|
+
export declare function restoreMatchingContinuation(host: ReplayResumeHost, runId: string, toolName: string): Promise<{
|
|
7
|
+
harness: AgentHarness;
|
|
8
|
+
restored: RestoredHarnessSession;
|
|
9
|
+
} | undefined>;
|
|
10
|
+
export declare function preparedResumeToolResult(toolName: string, output: unknown, env: Record<string, string | undefined>): {
|
|
11
|
+
toolName: string;
|
|
12
|
+
output: unknown;
|
|
13
|
+
media?: HarnessInputMedia[];
|
|
14
|
+
};
|
|
15
|
+
export declare function readHarnessContinuation(stored: JsonObject | undefined, checkpoints: CheckpointRecord[], toolName?: string): RestoredHarnessSession | undefined;
|
|
16
|
+
//# sourceMappingURL=replay-resume-shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-resume-shared.d.ts","sourceRoot":"","sources":["../src/replay-resume-shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAA6B,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAI9D,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,gBAAgB,EACtB,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,UAAU,GAAG,OAAO,GACzB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,gBAAgB,EACtB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,sBAAsB,CAAA;CAAE,GAAG,SAAS,CAAC,CAclF;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAQpE;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,UAAU,GAAG,SAAS,EAC9B,WAAW,EAAE,gBAAgB,EAAE,EAC/B,QAAQ,CAAC,EAAE,MAAM,GAChB,sBAAsB,GAAG,SAAS,CAWpC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { storedHarnessContinuation } from "./harness-continuation.js";
|
|
2
|
+
import { prepareToolModelOutput } from "./model-media.js";
|
|
3
|
+
const RESUME_RECLAIM_STALE_MS = 5 * 60_000;
|
|
4
|
+
export async function reclaimStaleResume(host, run, baseKey, kind) {
|
|
5
|
+
const inProgress = new Error(`Run ${run.id} ${kind} resume is already in progress.`);
|
|
6
|
+
if (Date.parse(run.updatedAt) > Date.now() - RESUME_RECLAIM_STALE_MS)
|
|
7
|
+
throw inProgress;
|
|
8
|
+
const reclaimed = await host.state.reserveIdempotencyKey("resume", `${baseKey}:retry:${run.updatedAt}`, run.id);
|
|
9
|
+
if (!reclaimed)
|
|
10
|
+
throw inProgress;
|
|
11
|
+
await host.state.updateRun(run.id, {});
|
|
12
|
+
}
|
|
13
|
+
export async function restoreMatchingContinuation(host, runId, toolName) {
|
|
14
|
+
const restored = readHarnessContinuation(undefined, await host.listHydratedCheckpoints(runId), toolName);
|
|
15
|
+
if (!restored)
|
|
16
|
+
return undefined;
|
|
17
|
+
const harness = await host.resolveAgentHarness(restored.runtime.modelSpec);
|
|
18
|
+
if (restored.continuation.harness !== harness.id || restored.continuation.version !== harness.continuationVersion) {
|
|
19
|
+
await host.state.appendEvent(runId, "harness.continuation_mismatch", {
|
|
20
|
+
expectedHarness: harness.id,
|
|
21
|
+
expectedVersion: harness.continuationVersion,
|
|
22
|
+
storedHarness: restored.continuation.harness,
|
|
23
|
+
storedVersion: restored.continuation.version
|
|
24
|
+
});
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return { harness, restored };
|
|
28
|
+
}
|
|
29
|
+
export function preparedResumeToolResult(toolName, output, env) {
|
|
30
|
+
const prepared = prepareToolModelOutput(output, env);
|
|
31
|
+
const result = {
|
|
32
|
+
toolName,
|
|
33
|
+
output: prepared.output
|
|
34
|
+
};
|
|
35
|
+
if (prepared.media.length > 0)
|
|
36
|
+
result.media = prepared.media;
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
export function readHarnessContinuation(stored, checkpoints, toolName) {
|
|
40
|
+
if (stored)
|
|
41
|
+
return storedHarnessContinuation(stored);
|
|
42
|
+
for (let index = checkpoints.length - 1; index >= 0; index -= 1) {
|
|
43
|
+
const checkpoint = checkpoints[index];
|
|
44
|
+
if (!checkpoint || checkpoint.name !== "harness.continuation")
|
|
45
|
+
continue;
|
|
46
|
+
const restored = storedHarnessContinuation(checkpoint.data);
|
|
47
|
+
if (!restored)
|
|
48
|
+
continue;
|
|
49
|
+
const pendingToolName = restored.runtime.pendingToolName;
|
|
50
|
+
if (toolName === undefined || typeof pendingToolName !== "string" || pendingToolName === toolName)
|
|
51
|
+
return restored;
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=replay-resume-shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-resume-shared.js","sourceRoot":"","sources":["../src/replay-resume-shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAA+B,MAAM,2BAA2B,CAAC;AACnG,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,MAAM,uBAAuB,GAAG,CAAC,GAAG,MAAM,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAsB,EACtB,GAAc,EACd,OAAe,EACf,IAA0B;IAE1B,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,IAAI,IAAI,iCAAiC,CAAC,CAAC;IACrF,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,uBAAuB;QAAE,MAAM,UAAU,CAAC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;IAEvC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrD,MAAM,MAAM,GAAuE;QACjF,QAAQ;QACR,MAAM,EAAE,QAAQ,CAAC,MAAM;KACxB,CAAC;IACF,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAC7D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,MAA8B,EAC9B,WAA+B,EAC/B,QAAiB;IAEjB,IAAI,MAAM;QAAE,OAAO,yBAAyB,CAAC,MAAM,CAAC,CAAC;IACrD,KAAK,IAAI,KAAK,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAChE,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAK,sBAAsB;YAAE,SAAS;QACxE,MAAM,QAAQ,GAAG,yBAAyB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,CAAC,QAAQ;YAAE,SAAS;QACxB,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC;QACzD,IAAI,QAAQ,KAAK,SAAS,IAAI,OAAO,eAAe,KAAK,QAAQ,IAAI,eAAe,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAC;IACrH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { AgentHarness, AgentHarnessContext, AgentManifest, AgentTurnResult, CompiledConnection, CompiledTool, HarnessContinuation, JsonObject, JsonValue, ResolvedAgentCapabilities, TriggerTarget } from "@assemblyline-agents/core";
|
|
2
|
+
import type { AgentHookRunController } from "./agent-hook-evaluation.js";
|
|
3
|
+
import type { ChannelTurn } from "./channel.js";
|
|
4
|
+
import type { ConnectionAuthorizationSessionRecord, ConnectionAuthorizationSessionStore, ConnectionGrantStore, RuntimeConnectionRegistry } from "./connections.js";
|
|
5
|
+
import type { RuntimePause } from "./harness-continuation.js";
|
|
6
|
+
import type { ContextBundle, HarnessLoopSession, HarnessLoopState, RunAgentResult, RuntimeSandboxHandle } from "./runtime-types.js";
|
|
7
|
+
import type { ResolvedCoreToolPolicy } from "./security.js";
|
|
8
|
+
import type { CheckpointRecord, RunRecord, StateAdapter, ToolCallRecord } from "./state.js";
|
|
9
|
+
import type { CredentialBroker } from "./credential-broker.js";
|
|
10
|
+
/** Runtime capabilities required by replay and every resume path. */
|
|
11
|
+
export interface ReplayResumeHost {
|
|
12
|
+
state: StateAdapter;
|
|
13
|
+
manifest: AgentManifest;
|
|
14
|
+
coreToolPolicy: ResolvedCoreToolPolicy;
|
|
15
|
+
env: Record<string, string | undefined>;
|
|
16
|
+
fetch: typeof fetch;
|
|
17
|
+
connectionAuthorizationSessionStore: ConnectionAuthorizationSessionStore;
|
|
18
|
+
connectionGrantStore: ConnectionGrantStore;
|
|
19
|
+
credentialBroker: CredentialBroker;
|
|
20
|
+
connectionCallbackBaseUrl: string | undefined;
|
|
21
|
+
boot(): void;
|
|
22
|
+
initializeInstrumentation(): Promise<void>;
|
|
23
|
+
ensureDynamicConnections(): Promise<void>;
|
|
24
|
+
withRunAdmission<T>(work: () => Promise<T>): Promise<T>;
|
|
25
|
+
listHydratedCheckpoints(runId: string): Promise<CheckpointRecord[]>;
|
|
26
|
+
resolveAgentHarness(modelSpec?: string): Promise<AgentHarness>;
|
|
27
|
+
buildContextBundle(input: {
|
|
28
|
+
message: string;
|
|
29
|
+
channel: string;
|
|
30
|
+
recentHistory?: string[];
|
|
31
|
+
attachments?: JsonObject[];
|
|
32
|
+
channelContext?: JsonObject;
|
|
33
|
+
promptContext?: JsonObject;
|
|
34
|
+
target?: TriggerTarget;
|
|
35
|
+
capabilities?: ResolvedAgentCapabilities;
|
|
36
|
+
run?: RunRecord;
|
|
37
|
+
}): Promise<ContextBundle>;
|
|
38
|
+
ensureAgentHookController(run: RunRecord): Promise<AgentHookRunController>;
|
|
39
|
+
resolvedInstructionsForRun(run: RunRecord, bundle: ContextBundle, capabilities: ResolvedAgentCapabilities): string;
|
|
40
|
+
createSandboxHandle(getRun: () => RunRecord, setRun: (run: RunRecord) => void, getBundle: () => ContextBundle): RuntimeSandboxHandle;
|
|
41
|
+
executeToolWithRecord(run: RunRecord, tool: CompiledTool, toolCall: ToolCallRecord, input: unknown, sandboxHandle: RuntimeSandboxHandle, approvedToolCall?: boolean): Promise<{
|
|
42
|
+
run: RunRecord;
|
|
43
|
+
modelOutput?: unknown;
|
|
44
|
+
waitingForInput?: boolean;
|
|
45
|
+
toolCallId?: string;
|
|
46
|
+
toolName?: string;
|
|
47
|
+
}>;
|
|
48
|
+
executeConnectionToolWithRecord(run: RunRecord, registry: RuntimeConnectionRegistry, toolName: string, toolCall: ToolCallRecord, input: unknown): Promise<{
|
|
49
|
+
run: RunRecord;
|
|
50
|
+
modelOutput?: unknown;
|
|
51
|
+
waitingForConnection?: boolean;
|
|
52
|
+
toolCallId?: string;
|
|
53
|
+
toolName?: string;
|
|
54
|
+
authorizationSessionId?: string;
|
|
55
|
+
}>;
|
|
56
|
+
createConnectionRegistry(channel: string, turn?: ChannelTurn): RuntimeConnectionRegistry;
|
|
57
|
+
createConnectionRegistryForRun(run: RunRecord, fallbackChannel: string, sandboxHandle?: RuntimeSandboxHandle, selectedConnections?: ReadonlySet<string>): RuntimeConnectionRegistry;
|
|
58
|
+
createConnectionRegistryForSession(session: ConnectionAuthorizationSessionRecord): RuntimeConnectionRegistry;
|
|
59
|
+
mergedConnections(): CompiledConnection[];
|
|
60
|
+
loadConnectionDefinition(connection: CompiledConnection): Promise<unknown>;
|
|
61
|
+
startRunHeartbeat(runId: string): {
|
|
62
|
+
stop(): void;
|
|
63
|
+
};
|
|
64
|
+
createHarnessContext(session: HarnessLoopSession, loopState: HarnessLoopState, resumed: boolean): AgentHarnessContext;
|
|
65
|
+
executeHarnessTurn(harness: AgentHarness, input: Parameters<AgentHarness["runTurn"]>[0], session: HarnessLoopSession, loopState: HarnessLoopState, resumed: boolean, refreshCapabilities?: NonNullable<AgentHarnessContext["refreshCapabilities"]>): Promise<{
|
|
66
|
+
result: AgentTurnResult;
|
|
67
|
+
output?: JsonValue;
|
|
68
|
+
failed?: boolean;
|
|
69
|
+
controlStopped?: boolean;
|
|
70
|
+
}>;
|
|
71
|
+
persistHarnessContinuation(runId: string, session: HarnessLoopSession, continuation: HarnessContinuation | undefined, pause?: RuntimePause): Promise<void>;
|
|
72
|
+
createCheckpoint(input: Omit<CheckpointRecord, "id" | "createdAt">): Promise<CheckpointRecord>;
|
|
73
|
+
hydrateCheckpointData(data: JsonObject): Promise<JsonObject>;
|
|
74
|
+
result(run: RunRecord, response: string, waitingForApproval?: boolean, waitingForInput?: boolean, waitingForConnection?: boolean): Promise<RunAgentResult>;
|
|
75
|
+
completeRun(run: RunRecord, sandboxHandle: RuntimeSandboxHandle, response: string, channel: string, turn?: ChannelTurn, conversationId?: string): Promise<RunAgentResult>;
|
|
76
|
+
runDeliveryChannel(run: RunRecord): string;
|
|
77
|
+
enqueueConversationTurn(input: {
|
|
78
|
+
turn: ChannelTurn;
|
|
79
|
+
idempotencyScope: string;
|
|
80
|
+
idempotencyKey: string;
|
|
81
|
+
}): Promise<{
|
|
82
|
+
inserted: boolean;
|
|
83
|
+
}>;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=replay-resume-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-resume-types.d.ts","sourceRoot":"","sources":["../src/replay-resume-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EAC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7B,IAAI,EAAE,WAAW,CAAC;QAClB,gBAAgB,EAAE,MAAM,CAAC;QACzB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay-resume-types.js","sourceRoot":"","sources":["../src/replay-resume-types.ts"],"names":[],"mappings":""}
|
package/dist/replay-resume.d.ts
CHANGED
|
@@ -1,121 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { type ResolvedCoreToolPolicy } from "./security.js";
|
|
9
|
-
import type { CheckpointRecord, RunRecord, StateAdapter, ToolCallRecord } from "./state.js";
|
|
10
|
-
import type { CredentialBroker } from "./credential-broker.js";
|
|
11
|
-
/**
|
|
12
|
-
* Replay and HITL resume machinery: run timeline replay, approval/input
|
|
13
|
-
* resume (with the per-pause idempotency claims), harness authorization
|
|
14
|
-
* start/callback completion, connection tool continuation resume, and the
|
|
15
|
-
* harness loop resume from a restored continuation. Follows the
|
|
16
|
-
* delivery-send/resource-projection host-delegate pattern: AssemblyLineRuntime
|
|
17
|
-
* builds a {@link ReplayResumeHost} closing over itself and keeps thin
|
|
18
|
-
* delegate methods with unchanged signatures (resumeApproval/resumeInput
|
|
19
|
-
* public signatures are untouched; the HTTP layer in packages/node calls
|
|
20
|
-
* them directly).
|
|
21
|
-
*/
|
|
22
|
-
/** Narrow slice of the runtime the replay/resume path needs. */
|
|
23
|
-
export interface ReplayResumeHost {
|
|
24
|
-
state: StateAdapter;
|
|
25
|
-
manifest: AgentManifest;
|
|
26
|
-
coreToolPolicy: ResolvedCoreToolPolicy;
|
|
27
|
-
env: Record<string, string | undefined>;
|
|
28
|
-
fetch: typeof fetch;
|
|
29
|
-
connectionAuthorizationSessionStore: ConnectionAuthorizationSessionStore;
|
|
30
|
-
connectionGrantStore: ConnectionGrantStore;
|
|
31
|
-
credentialBroker: CredentialBroker;
|
|
32
|
-
connectionCallbackBaseUrl: string | undefined;
|
|
33
|
-
boot(): void;
|
|
34
|
-
initializeInstrumentation(): Promise<void>;
|
|
35
|
-
ensureDynamicConnections(): Promise<void>;
|
|
36
|
-
withRunAdmission<T>(work: () => Promise<T>): Promise<T>;
|
|
37
|
-
listHydratedCheckpoints(runId: string): Promise<CheckpointRecord[]>;
|
|
38
|
-
resolveAgentHarness(modelSpec?: string): Promise<AgentHarness>;
|
|
39
|
-
buildContextBundle(input: {
|
|
40
|
-
message: string;
|
|
41
|
-
channel: string;
|
|
42
|
-
recentHistory?: string[];
|
|
43
|
-
attachments?: JsonObject[];
|
|
44
|
-
channelContext?: JsonObject;
|
|
45
|
-
promptContext?: JsonObject;
|
|
46
|
-
target?: TriggerTarget;
|
|
47
|
-
capabilities?: ResolvedAgentCapabilities;
|
|
48
|
-
run?: RunRecord;
|
|
49
|
-
}): Promise<ContextBundle>;
|
|
50
|
-
ensureAgentHookController(run: RunRecord): Promise<AgentHookRunController>;
|
|
51
|
-
resolvedInstructionsForRun(run: RunRecord, bundle: ContextBundle, capabilities: ResolvedAgentCapabilities): string;
|
|
52
|
-
createSandboxHandle(getRun: () => RunRecord, setRun: (run: RunRecord) => void, getBundle: () => ContextBundle): RuntimeSandboxHandle;
|
|
53
|
-
executeToolWithRecord(run: RunRecord, tool: CompiledTool, toolCall: ToolCallRecord, input: unknown, sandboxHandle: RuntimeSandboxHandle, approvedToolCall?: boolean): Promise<{
|
|
54
|
-
run: RunRecord;
|
|
55
|
-
modelOutput?: unknown;
|
|
56
|
-
waitingForInput?: boolean;
|
|
57
|
-
toolCallId?: string;
|
|
58
|
-
toolName?: string;
|
|
59
|
-
}>;
|
|
60
|
-
executeConnectionToolWithRecord(run: RunRecord, registry: RuntimeConnectionRegistry, toolName: string, toolCall: ToolCallRecord, input: unknown): Promise<{
|
|
61
|
-
run: RunRecord;
|
|
62
|
-
modelOutput?: unknown;
|
|
63
|
-
waitingForConnection?: boolean;
|
|
64
|
-
toolCallId?: string;
|
|
65
|
-
toolName?: string;
|
|
66
|
-
authorizationSessionId?: string;
|
|
67
|
-
}>;
|
|
68
|
-
createConnectionRegistry(channel: string, turn?: ChannelTurn): RuntimeConnectionRegistry;
|
|
69
|
-
createConnectionRegistryForRun(run: RunRecord, fallbackChannel: string, sandboxHandle?: RuntimeSandboxHandle, selectedConnections?: ReadonlySet<string>): RuntimeConnectionRegistry;
|
|
70
|
-
createConnectionRegistryForSession(session: ConnectionAuthorizationSessionRecord): RuntimeConnectionRegistry;
|
|
71
|
-
mergedConnections(): CompiledConnection[];
|
|
72
|
-
loadConnectionDefinition(connection: CompiledConnection): Promise<unknown>;
|
|
73
|
-
startRunHeartbeat(runId: string): {
|
|
74
|
-
stop(): void;
|
|
75
|
-
};
|
|
76
|
-
createHarnessContext(session: HarnessLoopSession, loopState: HarnessLoopState, resumed: boolean): AgentHarnessContext;
|
|
77
|
-
executeHarnessTurn(harness: AgentHarness, input: Parameters<AgentHarness["runTurn"]>[0], session: HarnessLoopSession, loopState: HarnessLoopState, resumed: boolean, refreshCapabilities?: NonNullable<AgentHarnessContext["refreshCapabilities"]>): Promise<{
|
|
78
|
-
result: AgentTurnResult;
|
|
79
|
-
output?: JsonValue;
|
|
80
|
-
failed?: boolean;
|
|
81
|
-
controlStopped?: boolean;
|
|
82
|
-
}>;
|
|
83
|
-
persistHarnessContinuation(runId: string, session: HarnessLoopSession, continuation: HarnessContinuation | undefined, pause?: RuntimePause): Promise<void>;
|
|
84
|
-
createCheckpoint(input: Omit<CheckpointRecord, "id" | "createdAt">): Promise<CheckpointRecord>;
|
|
85
|
-
hydrateCheckpointData(data: JsonObject): Promise<JsonObject>;
|
|
86
|
-
result(run: RunRecord, response: string, waitingForApproval?: boolean, waitingForInput?: boolean, waitingForConnection?: boolean): Promise<RunAgentResult>;
|
|
87
|
-
completeRun(run: RunRecord, sandboxHandle: RuntimeSandboxHandle, response: string, channel: string, turn?: ChannelTurn, conversationId?: string): Promise<RunAgentResult>;
|
|
88
|
-
runDeliveryChannel(run: RunRecord): string;
|
|
89
|
-
enqueueConversationTurn(input: {
|
|
90
|
-
turn: ChannelTurn;
|
|
91
|
-
idempotencyScope: string;
|
|
92
|
-
idempotencyKey: string;
|
|
93
|
-
}): Promise<{
|
|
94
|
-
inserted: boolean;
|
|
95
|
-
}>;
|
|
96
|
-
}
|
|
1
|
+
import type { ReplayResumeHost } from "./replay-resume-types.js";
|
|
2
|
+
import type { RunTimeline } from "./runtime-types.js";
|
|
3
|
+
export { completeConnectionAuthorizationCallbackImpl } from "./replay-resume-authorization.js";
|
|
4
|
+
export { resumeApprovalNowImpl, resumeInputNowImpl, resumeSuspendedNowImpl } from "./replay-resume-controls.js";
|
|
5
|
+
export { resumeHarnessLoopImpl } from "./replay-resume-harness.js";
|
|
6
|
+
export { resumeRunFromContinuationImpl } from "./replay-resume-recovery.js";
|
|
7
|
+
export type { ReplayResumeHost } from "./replay-resume-types.js";
|
|
97
8
|
export declare function replayImpl(host: ReplayResumeHost, runId: string): Promise<RunTimeline>;
|
|
98
|
-
export declare function resumeApprovalNowImpl(host: ReplayResumeHost, runId: string): Promise<RunAgentResult>;
|
|
99
|
-
export declare function completeConnectionAuthorizationCallbackImpl(host: ReplayResumeHost, callback: {
|
|
100
|
-
params: Record<string, string>;
|
|
101
|
-
method: string;
|
|
102
|
-
body?: string;
|
|
103
|
-
}): Promise<ConnectionAuthorizationCallbackResult>;
|
|
104
|
-
export declare function resumeInputNowImpl(host: ReplayResumeHost, runId: string, answer: string): Promise<RunAgentResult>;
|
|
105
|
-
export declare function resumeSuspendedNowImpl(host: ReplayResumeHost, runId: string): Promise<RunAgentResult>;
|
|
106
|
-
/** Resume an orphaned run in place from its latest persisted continuation checkpoint. */
|
|
107
|
-
export declare function resumeRunFromContinuationImpl(host: ReplayResumeHost, run: RunRecord, context?: {
|
|
108
|
-
interruptedTools?: Array<{
|
|
109
|
-
toolCallId: string;
|
|
110
|
-
toolName: string;
|
|
111
|
-
}>;
|
|
112
|
-
}): Promise<RunRecord | undefined>;
|
|
113
|
-
export declare function resumeHarnessLoopImpl(host: ReplayResumeHost, run: RunRecord, harness: AgentHarness, restored: RestoredHarnessSession, resume: {
|
|
114
|
-
toolResult?: {
|
|
115
|
-
toolName: string;
|
|
116
|
-
output: unknown;
|
|
117
|
-
media?: HarnessInputMedia[];
|
|
118
|
-
};
|
|
119
|
-
message?: string;
|
|
120
|
-
}): Promise<RunAgentResult>;
|
|
121
9
|
//# sourceMappingURL=replay-resume.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay-resume.d.ts","sourceRoot":"","sources":["../src/replay-resume.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"replay-resume.d.ts","sourceRoot":"","sources":["../src/replay-resume.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EAAE,2CAA2C,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,YAAY,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,wBAAsB,UAAU,CAAC,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAW5F"}
|