pulseed 0.6.3 → 0.6.5
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/dist/adapters/datasources/artifact-metric-datasource.d.ts +11 -1
- package/dist/adapters/datasources/artifact-metric-datasource.d.ts.map +1 -1
- package/dist/adapters/datasources/artifact-metric-datasource.js +256 -9
- package/dist/adapters/datasources/artifact-metric-datasource.js.map +1 -1
- package/dist/base/config/global-config.d.ts +7 -4
- package/dist/base/config/global-config.d.ts.map +1 -1
- package/dist/base/config/global-config.js +3 -1
- package/dist/base/config/global-config.js.map +1 -1
- package/dist/base/protocol/exact-protocol.d.ts +47 -0
- package/dist/base/protocol/exact-protocol.d.ts.map +1 -0
- package/dist/base/protocol/exact-protocol.js +175 -0
- package/dist/base/protocol/exact-protocol.js.map +1 -0
- package/dist/base/types/core.d.ts +1 -1
- package/dist/base/types/core.d.ts.map +1 -1
- package/dist/base/types/core.js +1 -0
- package/dist/base/types/core.js.map +1 -1
- package/dist/base/utils/paths.d.ts +5 -0
- package/dist/base/utils/paths.d.ts.map +1 -1
- package/dist/base/utils/paths.js +7 -0
- package/dist/base/utils/paths.js.map +1 -1
- package/dist/base/utils/workspace-path.d.ts +6 -0
- package/dist/base/utils/workspace-path.d.ts.map +1 -0
- package/dist/base/utils/workspace-path.js +24 -0
- package/dist/base/utils/workspace-path.js.map +1 -0
- package/dist/base/utils/workspace-root.d.ts +6 -0
- package/dist/base/utils/workspace-root.d.ts.map +1 -0
- package/dist/base/utils/workspace-root.js +87 -0
- package/dist/base/utils/workspace-root.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/interface/chat/chat-event-state.d.ts +2 -0
- package/dist/interface/chat/chat-event-state.d.ts.map +1 -1
- package/dist/interface/chat/chat-event-state.js +22 -41
- package/dist/interface/chat/chat-event-state.js.map +1 -1
- package/dist/interface/chat/chat-events.d.ts +15 -1
- package/dist/interface/chat/chat-events.d.ts.map +1 -1
- package/dist/interface/chat/chat-history.d.ts +3816 -192
- package/dist/interface/chat/chat-history.d.ts.map +1 -1
- package/dist/interface/chat/chat-history.js +529 -5
- package/dist/interface/chat/chat-history.js.map +1 -1
- package/dist/interface/chat/chat-runner-commands.d.ts +2 -0
- package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-commands.js +83 -22
- package/dist/interface/chat/chat-runner-commands.js.map +1 -1
- package/dist/interface/chat/chat-runner-contracts.d.ts +5 -1
- package/dist/interface/chat/chat-runner-contracts.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-event-bridge.d.ts +13 -1
- package/dist/interface/chat/chat-runner-event-bridge.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-event-bridge.js +51 -3
- package/dist/interface/chat/chat-runner-event-bridge.js.map +1 -1
- package/dist/interface/chat/chat-runner-routes.d.ts +5 -17
- package/dist/interface/chat/chat-runner-routes.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-routes.js +80 -51
- package/dist/interface/chat/chat-runner-routes.js.map +1 -1
- package/dist/interface/chat/chat-runner-runtime.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner-runtime.js +4 -0
- package/dist/interface/chat/chat-runner-runtime.js.map +1 -1
- package/dist/interface/chat/chat-runner.d.ts +7 -1
- package/dist/interface/chat/chat-runner.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner.js +135 -49
- package/dist/interface/chat/chat-runner.js.map +1 -1
- package/dist/interface/chat/chat-session-store.d.ts +3 -0
- package/dist/interface/chat/chat-session-store.d.ts.map +1 -1
- package/dist/interface/chat/chat-session-store.js +12 -0
- package/dist/interface/chat/chat-session-store.js.map +1 -1
- package/dist/interface/chat/cross-platform-session.d.ts +15 -0
- package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
- package/dist/interface/chat/cross-platform-session.js +260 -42
- package/dist/interface/chat/cross-platform-session.js.map +1 -1
- package/dist/interface/chat/failure-recovery.d.ts.map +1 -1
- package/dist/interface/chat/failure-recovery.js +15 -1
- package/dist/interface/chat/failure-recovery.js.map +1 -1
- package/dist/interface/chat/freeform-route-classifier.d.ts +4 -4
- package/dist/interface/chat/ingress-router.d.ts +3 -0
- package/dist/interface/chat/ingress-router.d.ts.map +1 -1
- package/dist/interface/chat/ingress-router.js +3 -0
- package/dist/interface/chat/ingress-router.js.map +1 -1
- package/dist/interface/chat/model-request-builder.d.ts +37 -0
- package/dist/interface/chat/model-request-builder.d.ts.map +1 -0
- package/dist/interface/chat/model-request-builder.js +76 -0
- package/dist/interface/chat/model-request-builder.js.map +1 -0
- package/dist/interface/chat/turn-context.d.ts +200 -0
- package/dist/interface/chat/turn-context.d.ts.map +1 -0
- package/dist/interface/chat/turn-context.js +249 -0
- package/dist/interface/chat/turn-context.js.map +1 -0
- package/dist/interface/chat/turn-protocol.d.ts +35 -0
- package/dist/interface/chat/turn-protocol.d.ts.map +1 -0
- package/dist/interface/chat/turn-protocol.js +27 -0
- package/dist/interface/chat/turn-protocol.js.map +1 -0
- package/dist/interface/chat/user-input.d.ts +55 -0
- package/dist/interface/chat/user-input.d.ts.map +1 -0
- package/dist/interface/chat/user-input.js +52 -0
- package/dist/interface/chat/user-input.js.map +1 -0
- package/dist/interface/cli/cli-command-registry.d.ts +1 -1
- package/dist/interface/cli/cli-command-registry.d.ts.map +1 -1
- package/dist/interface/cli/cli-command-registry.js +12 -16
- package/dist/interface/cli/cli-command-registry.js.map +1 -1
- package/dist/interface/cli/cli-runner.js +0 -0
- package/dist/interface/cli/commands/daemon-shared.d.ts +12 -1
- package/dist/interface/cli/commands/daemon-shared.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon-shared.js +26 -4
- package/dist/interface/cli/commands/daemon-shared.js.map +1 -1
- package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon.js +66 -8
- package/dist/interface/cli/commands/daemon.js.map +1 -1
- package/dist/interface/cli/commands/doctor.d.ts +1 -1
- package/dist/interface/cli/commands/doctor.d.ts.map +1 -1
- package/dist/interface/cli/commands/doctor.js +61 -29
- package/dist/interface/cli/commands/doctor.js.map +1 -1
- package/dist/interface/cli/commands/goal-dispatch.d.ts.map +1 -1
- package/dist/interface/cli/commands/goal-dispatch.js +10 -6
- package/dist/interface/cli/commands/goal-dispatch.js.map +1 -1
- package/dist/interface/cli/commands/goal-utils.d.ts.map +1 -1
- package/dist/interface/cli/commands/goal-utils.js +3 -5
- package/dist/interface/cli/commands/goal-utils.js.map +1 -1
- package/dist/interface/cli/commands/run.d.ts.map +1 -1
- package/dist/interface/cli/commands/run.js +50 -0
- package/dist/interface/cli/commands/run.js.map +1 -1
- package/dist/interface/cli/setup.d.ts +1 -1
- package/dist/interface/cli/setup.d.ts.map +1 -1
- package/dist/interface/cli/setup.js +4 -3
- package/dist/interface/cli/setup.js.map +1 -1
- package/dist/interface/cli/utils/loop-runner.d.ts +1 -0
- package/dist/interface/cli/utils/loop-runner.d.ts.map +1 -1
- package/dist/interface/cli/utils/loop-runner.js +12 -3
- package/dist/interface/cli/utils/loop-runner.js.map +1 -1
- package/dist/interface/tui/app.d.ts +6 -1
- package/dist/interface/tui/app.d.ts.map +1 -1
- package/dist/interface/tui/app.js +29 -12
- package/dist/interface/tui/app.js.map +1 -1
- package/dist/interface/tui/bash-mode.d.ts.map +1 -1
- package/dist/interface/tui/bash-mode.js +2 -9
- package/dist/interface/tui/bash-mode.js.map +1 -1
- package/dist/interface/tui/chat/viewport.d.ts.map +1 -1
- package/dist/interface/tui/chat/viewport.js +57 -11
- package/dist/interface/tui/chat/viewport.js.map +1 -1
- package/dist/interface/tui/entry-deps.d.ts +6 -1
- package/dist/interface/tui/entry-deps.d.ts.map +1 -1
- package/dist/interface/tui/entry-deps.js +3 -0
- package/dist/interface/tui/entry-deps.js.map +1 -1
- package/dist/interface/tui/entry.d.ts.map +1 -1
- package/dist/interface/tui/entry.js +6 -2
- package/dist/interface/tui/entry.js.map +1 -1
- package/dist/interface/tui/input-action.d.ts.map +1 -1
- package/dist/interface/tui/input-action.js +3 -2
- package/dist/interface/tui/input-action.js.map +1 -1
- package/dist/interface/tui/intent-recognizer.d.ts.map +1 -1
- package/dist/interface/tui/intent-recognizer.js +21 -33
- package/dist/interface/tui/intent-recognizer.js.map +1 -1
- package/dist/orchestrator/execution/adapter-layer.d.ts +10 -1
- package/dist/orchestrator/execution/adapter-layer.d.ts.map +1 -1
- package/dist/orchestrator/execution/adapter-layer.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.d.ts +12 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.js +16 -31
- package/dist/orchestrator/execution/agent-loop/agent-loop-command-classifier.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.d.ts +75 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.d.ts.map +1 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.js +10 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-compaction-record.js.map +1 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.d.ts +3 -2
- package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.js +185 -22
- package/dist/orchestrator/execution/agent-loop/agent-loop-compactor.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.js +18 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-context-assembler.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js +7 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-events.d.ts +8 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-events.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-events.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-history.d.ts +3 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-history.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-history.js +12 -3
- package/dist/orchestrator/execution/agent-loop/agent-loop-history.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-model-client.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-model-client.js +7 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-model-client.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-model.d.ts +37 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-model.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-model.js +21 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-model.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js +1 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-prompts.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts +19 -11
- package/dist/orchestrator/execution/agent-loop/agent-loop-result.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.d.ts +4 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.js +135 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-session-state.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts +3 -2
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js +68 -61
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts +3 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-timeline.d.ts +12 -1
- package/dist/orchestrator/execution/agent-loop/agent-timeline.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-timeline.js +19 -56
- package/dist/orchestrator/execution/agent-loop/agent-timeline.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/anthropic-messages-agent-loop-model-client.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/anthropic-messages-agent-loop-model-client.js +8 -2
- package/dist/orchestrator/execution/agent-loop/anthropic-messages-agent-loop-model-client.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts +14 -0
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js +440 -81
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js +80 -12
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-display-output.d.ts +1 -0
- package/dist/orchestrator/execution/agent-loop/chat-display-output.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-display-output.js +3 -1
- package/dist/orchestrator/execution/agent-loop/chat-display-output.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/index.d.ts +3 -0
- package/dist/orchestrator/execution/agent-loop/index.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/index.js +3 -0
- package/dist/orchestrator/execution/agent-loop/index.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.d.ts +1 -0
- package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.js +51 -9
- package/dist/orchestrator/execution/agent-loop/openai-responses-agent-loop-model-client.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/response-item-tool-router.d.ts +20 -0
- package/dist/orchestrator/execution/agent-loop/response-item-tool-router.d.ts.map +1 -0
- package/dist/orchestrator/execution/agent-loop/response-item-tool-router.js +181 -0
- package/dist/orchestrator/execution/agent-loop/response-item-tool-router.js.map +1 -0
- package/dist/orchestrator/execution/agent-loop/response-item.d.ts +805 -0
- package/dist/orchestrator/execution/agent-loop/response-item.d.ts.map +1 -0
- package/dist/orchestrator/execution/agent-loop/response-item.js +104 -0
- package/dist/orchestrator/execution/agent-loop/response-item.js.map +1 -0
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.d.ts +7 -2
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.js +33 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-context.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts +32 -17
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.js +174 -16
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-result.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.d.ts +2 -0
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.js +10 -4
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.d.ts +0 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.js +7 -87
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-verification.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-worktree.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-worktree.js +25 -0
- package/dist/orchestrator/execution/agent-loop/task-agent-loop-worktree.js.map +1 -1
- package/dist/orchestrator/execution/context/issue-context-fetcher.d.ts +5 -1
- package/dist/orchestrator/execution/context/issue-context-fetcher.d.ts.map +1 -1
- package/dist/orchestrator/execution/context/issue-context-fetcher.js +7 -4
- package/dist/orchestrator/execution/context/issue-context-fetcher.js.map +1 -1
- package/dist/orchestrator/execution/task/task-artifact-contract.d.ts +18 -0
- package/dist/orchestrator/execution/task/task-artifact-contract.d.ts.map +1 -0
- package/dist/orchestrator/execution/task/task-artifact-contract.js +199 -0
- package/dist/orchestrator/execution/task/task-artifact-contract.js.map +1 -0
- package/dist/orchestrator/execution/task/task-diff-capture.d.ts +15 -1
- package/dist/orchestrator/execution/task/task-diff-capture.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-diff-capture.js +271 -18
- package/dist/orchestrator/execution/task/task-diff-capture.js.map +1 -1
- package/dist/orchestrator/execution/task/task-execution-helpers.d.ts +1 -0
- package/dist/orchestrator/execution/task/task-execution-helpers.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-execution-helpers.js +76 -17
- package/dist/orchestrator/execution/task/task-execution-helpers.js.map +1 -1
- package/dist/orchestrator/execution/task/task-execution-types.d.ts +2 -0
- package/dist/orchestrator/execution/task/task-execution-types.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-execution-types.js.map +1 -1
- package/dist/orchestrator/execution/task/task-executor.d.ts +16 -1
- package/dist/orchestrator/execution/task/task-executor.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-executor.js +56 -50
- package/dist/orchestrator/execution/task/task-executor.js.map +1 -1
- package/dist/orchestrator/execution/task/task-generation.d.ts +62 -2
- package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-generation.js +30 -13
- package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts +2 -2
- package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle-runner.js +32 -4
- package/dist/orchestrator/execution/task/task-lifecycle-runner.js.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle.d.ts +3 -3
- package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle.js +109 -10
- package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
- package/dist/orchestrator/execution/task/task-outcome-ledger.d.ts +9 -0
- package/dist/orchestrator/execution/task/task-outcome-ledger.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-outcome-ledger.js +64 -3
- package/dist/orchestrator/execution/task/task-outcome-ledger.js.map +1 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.d.ts +3 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-prompt-builder.js +28 -13
- package/dist/orchestrator/execution/task/task-prompt-builder.js.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier-rules.d.ts +3 -2
- package/dist/orchestrator/execution/task/task-verifier-rules.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier-rules.js +377 -90
- package/dist/orchestrator/execution/task/task-verifier-rules.js.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier-types.d.ts +13 -0
- package/dist/orchestrator/execution/task/task-verifier-types.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier-types.js.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier.d.ts +5 -4
- package/dist/orchestrator/execution/task/task-verifier.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier.js +396 -25
- package/dist/orchestrator/execution/task/task-verifier.js.map +1 -1
- package/dist/orchestrator/execution/task/task-workspace.d.ts +5 -0
- package/dist/orchestrator/execution/task/task-workspace.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-workspace.js +20 -10
- package/dist/orchestrator/execution/task/task-workspace.js.map +1 -1
- package/dist/orchestrator/execution/types/task-group.d.ts +85 -5
- package/dist/orchestrator/execution/types/task-group.d.ts.map +1 -1
- package/dist/orchestrator/execution/types/task.d.ts +155 -3
- package/dist/orchestrator/execution/types/task.d.ts.map +1 -1
- package/dist/orchestrator/execution/types/task.js +18 -0
- package/dist/orchestrator/execution/types/task.js.map +1 -1
- package/dist/orchestrator/loop/durable-loop/contracts.d.ts +2 -0
- package/dist/orchestrator/loop/durable-loop/contracts.d.ts.map +1 -1
- package/dist/orchestrator/loop/durable-loop/contracts.js.map +1 -1
- package/dist/orchestrator/loop/durable-loop/phase-specs.d.ts +12 -12
- package/dist/orchestrator/loop/durable-loop/preparation.d.ts.map +1 -1
- package/dist/orchestrator/loop/durable-loop/preparation.js +7 -1
- package/dist/orchestrator/loop/durable-loop/preparation.js.map +1 -1
- package/dist/orchestrator/loop/loop-report-helper.d.ts.map +1 -1
- package/dist/orchestrator/loop/loop-report-helper.js +2 -0
- package/dist/orchestrator/loop/loop-report-helper.js.map +1 -1
- package/dist/platform/corrections/memory-correction-ledger.d.ts +30 -30
- package/dist/platform/corrections/memory-governance.d.ts +2 -2
- package/dist/platform/corrections/memory-quarantine.d.ts +2 -2
- package/dist/platform/dream/playbook-memory.d.ts +4 -4
- package/dist/platform/knowledge/types/agent-memory.d.ts +46 -46
- package/dist/platform/observation/context-provider/collector.d.ts.map +1 -1
- package/dist/platform/observation/context-provider/collector.js +89 -24
- package/dist/platform/observation/context-provider/collector.js.map +1 -1
- package/dist/platform/observation/data-source-adapter.d.ts +2 -0
- package/dist/platform/observation/data-source-adapter.d.ts.map +1 -1
- package/dist/platform/observation/data-source-adapter.js.map +1 -1
- package/dist/platform/observation/observation-apply.d.ts.map +1 -1
- package/dist/platform/observation/observation-apply.js +8 -2
- package/dist/platform/observation/observation-apply.js.map +1 -1
- package/dist/platform/observation/observation-engine.d.ts.map +1 -1
- package/dist/platform/observation/observation-engine.js +118 -70
- package/dist/platform/observation/observation-engine.js.map +1 -1
- package/dist/platform/observation/observation-helpers.d.ts +2 -0
- package/dist/platform/observation/observation-helpers.d.ts.map +1 -1
- package/dist/platform/observation/observation-helpers.js.map +1 -1
- package/dist/platform/observation/types/data-source.d.ts +48 -0
- package/dist/platform/observation/types/data-source.d.ts.map +1 -1
- package/dist/platform/observation/types/data-source.js +4 -0
- package/dist/platform/observation/types/data-source.js.map +1 -1
- package/dist/platform/observation/workspace-context.d.ts.map +1 -1
- package/dist/platform/observation/workspace-context.js +13 -18
- package/dist/platform/observation/workspace-context.js.map +1 -1
- package/dist/platform/soil/contracts.d.ts +58 -58
- package/dist/prompt/purposes/verification.d.ts +2 -2
- package/dist/reporting/report-formatters.d.ts.map +1 -1
- package/dist/reporting/report-formatters.js +26 -1
- package/dist/reporting/report-formatters.js.map +1 -1
- package/dist/reporting/reporting-engine.d.ts.map +1 -1
- package/dist/reporting/reporting-engine.js +1 -0
- package/dist/reporting/reporting-engine.js.map +1 -1
- package/dist/reporting/reporting-types.d.ts +7 -0
- package/dist/reporting/reporting-types.d.ts.map +1 -1
- package/dist/reporting/types/report.d.ts +12 -0
- package/dist/reporting/types/report.d.ts.map +1 -1
- package/dist/reporting/types/report.js +1 -0
- package/dist/reporting/types/report.js.map +1 -1
- package/dist/runtime/approval-broker.d.ts +12 -0
- package/dist/runtime/approval-broker.d.ts.map +1 -1
- package/dist/runtime/approval-broker.js +27 -7
- package/dist/runtime/approval-broker.js.map +1 -1
- package/dist/runtime/control/daemon-runtime-control-executor.d.ts.map +1 -1
- package/dist/runtime/control/daemon-runtime-control-executor.js +9 -4
- package/dist/runtime/control/daemon-runtime-control-executor.js.map +1 -1
- package/dist/runtime/control/runtime-control-intent.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-intent.js +3 -2
- package/dist/runtime/control/runtime-control-intent.js.map +1 -1
- package/dist/runtime/control/runtime-control-service.d.ts +27 -1
- package/dist/runtime/control/runtime-control-service.d.ts.map +1 -1
- package/dist/runtime/control/runtime-control-service.js +181 -2
- package/dist/runtime/control/runtime-control-service.js.map +1 -1
- package/dist/runtime/control/runtime-target-resolver.js +2 -0
- package/dist/runtime/control/runtime-target-resolver.js.map +1 -1
- package/dist/runtime/daemon/browser-backpressure-policy.d.ts +22 -0
- package/dist/runtime/daemon/browser-backpressure-policy.d.ts.map +1 -0
- package/dist/runtime/daemon/browser-backpressure-policy.js +95 -0
- package/dist/runtime/daemon/browser-backpressure-policy.js.map +1 -0
- package/dist/runtime/daemon/client.d.ts +1 -0
- package/dist/runtime/daemon/client.d.ts.map +1 -1
- package/dist/runtime/daemon/client.js.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.js +1 -2
- package/dist/runtime/daemon/runner-goal-cycle.js.map +1 -1
- package/dist/runtime/daemon/runner-recovery.d.ts +17 -3
- package/dist/runtime/daemon/runner-recovery.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-recovery.js +50 -12
- package/dist/runtime/daemon/runner-recovery.js.map +1 -1
- package/dist/runtime/daemon/runner-startup.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-startup.js +18 -1
- package/dist/runtime/daemon/runner-startup.js.map +1 -1
- package/dist/runtime/daemon/runner.d.ts.map +1 -1
- package/dist/runtime/daemon/runner.js +13 -3
- package/dist/runtime/daemon/runner.js.map +1 -1
- package/dist/runtime/daemon/runtime-ownership.d.ts +7 -1
- package/dist/runtime/daemon/runtime-ownership.d.ts.map +1 -1
- package/dist/runtime/daemon/runtime-ownership.js +171 -25
- package/dist/runtime/daemon/runtime-ownership.js.map +1 -1
- package/dist/runtime/daemon/wait-deadline-resolver.d.ts.map +1 -1
- package/dist/runtime/daemon/wait-deadline-resolver.js +2 -0
- package/dist/runtime/daemon/wait-deadline-resolver.js.map +1 -1
- package/dist/runtime/event/server-snapshot-reader.d.ts +3 -1
- package/dist/runtime/event/server-snapshot-reader.d.ts.map +1 -1
- package/dist/runtime/event/server-snapshot-reader.js +68 -2
- package/dist/runtime/event/server-snapshot-reader.js.map +1 -1
- package/dist/runtime/event/server-types.d.ts +2 -0
- package/dist/runtime/event/server-types.d.ts.map +1 -1
- package/dist/runtime/evidence-answer.d.ts.map +1 -1
- package/dist/runtime/evidence-answer.js +34 -7
- package/dist/runtime/evidence-answer.js.map +1 -1
- package/dist/runtime/gateway/channel-adapter.d.ts +3 -0
- package/dist/runtime/gateway/channel-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/channel-display-policy.d.ts +42 -0
- package/dist/runtime/gateway/channel-display-policy.d.ts.map +1 -0
- package/dist/runtime/gateway/channel-display-policy.js +85 -0
- package/dist/runtime/gateway/channel-display-policy.js.map +1 -0
- package/dist/runtime/gateway/chat-event-rendering.d.ts +2 -1
- package/dist/runtime/gateway/chat-event-rendering.d.ts.map +1 -1
- package/dist/runtime/gateway/chat-event-rendering.js +2 -0
- package/dist/runtime/gateway/chat-event-rendering.js.map +1 -1
- package/dist/runtime/gateway/chat-session-dispatch.d.ts.map +1 -1
- package/dist/runtime/gateway/chat-session-dispatch.js +4 -9
- package/dist/runtime/gateway/chat-session-dispatch.js.map +1 -1
- package/dist/runtime/gateway/chat-session-port.d.ts +2 -0
- package/dist/runtime/gateway/chat-session-port.d.ts.map +1 -1
- package/dist/runtime/gateway/chat-session-port.js.map +1 -1
- package/dist/runtime/gateway/discord-gateway-adapter.d.ts +4 -0
- package/dist/runtime/gateway/discord-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/discord-gateway-adapter.js +100 -31
- package/dist/runtime/gateway/discord-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/index.d.ts +4 -0
- package/dist/runtime/gateway/index.d.ts.map +1 -1
- package/dist/runtime/gateway/index.js +2 -0
- package/dist/runtime/gateway/index.js.map +1 -1
- package/dist/runtime/gateway/non-tui-display-projector.d.ts +40 -0
- package/dist/runtime/gateway/non-tui-display-projector.d.ts.map +1 -0
- package/dist/runtime/gateway/non-tui-display-projector.js +166 -0
- package/dist/runtime/gateway/non-tui-display-projector.js.map +1 -0
- package/dist/runtime/gateway/signal-gateway-adapter.d.ts +1 -0
- package/dist/runtime/gateway/signal-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/signal-gateway-adapter.js +47 -4
- package/dist/runtime/gateway/signal-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/slack-channel-adapter.d.ts +1 -0
- package/dist/runtime/gateway/slack-channel-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/slack-channel-adapter.js +93 -18
- package/dist/runtime/gateway/slack-channel-adapter.js.map +1 -1
- package/dist/runtime/gateway/telegram-gateway-adapter.d.ts +2 -0
- package/dist/runtime/gateway/telegram-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/telegram-gateway-adapter.js +61 -113
- package/dist/runtime/gateway/telegram-gateway-adapter.js.map +1 -1
- package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts +1 -0
- package/dist/runtime/gateway/whatsapp-gateway-adapter.d.ts.map +1 -1
- package/dist/runtime/gateway/whatsapp-gateway-adapter.js +49 -4
- package/dist/runtime/gateway/whatsapp-gateway-adapter.js.map +1 -1
- package/dist/runtime/interactive-automation/browser-session-resolver.d.ts +26 -0
- package/dist/runtime/interactive-automation/browser-session-resolver.d.ts.map +1 -0
- package/dist/runtime/interactive-automation/browser-session-resolver.js +75 -0
- package/dist/runtime/interactive-automation/browser-session-resolver.js.map +1 -0
- package/dist/runtime/interactive-automation/index.d.ts +2 -0
- package/dist/runtime/interactive-automation/index.d.ts.map +1 -1
- package/dist/runtime/interactive-automation/index.js +2 -0
- package/dist/runtime/interactive-automation/index.js.map +1 -1
- package/dist/runtime/interactive-automation/runtime-auth-handoff-store.d.ts +35 -0
- package/dist/runtime/interactive-automation/runtime-auth-handoff-store.d.ts.map +1 -0
- package/dist/runtime/interactive-automation/runtime-auth-handoff-store.js +125 -0
- package/dist/runtime/interactive-automation/runtime-auth-handoff-store.js.map +1 -0
- package/dist/runtime/permission-dialogue.d.ts +113 -0
- package/dist/runtime/permission-dialogue.d.ts.map +1 -0
- package/dist/runtime/permission-dialogue.js +82 -0
- package/dist/runtime/permission-dialogue.js.map +1 -0
- package/dist/runtime/run-spec/derive.d.ts +14 -14
- package/dist/runtime/run-spec/handoff.d.ts.map +1 -1
- package/dist/runtime/run-spec/handoff.js +33 -0
- package/dist/runtime/run-spec/handoff.js.map +1 -1
- package/dist/runtime/run-spec/types.d.ts +16 -16
- package/dist/runtime/session-registry/types.d.ts +12 -12
- package/dist/runtime/store/artifact-retention.d.ts +2 -0
- package/dist/runtime/store/artifact-retention.d.ts.map +1 -1
- package/dist/runtime/store/artifact-retention.js +24 -21
- package/dist/runtime/store/artifact-retention.js.map +1 -1
- package/dist/runtime/store/budget-store.d.ts +8 -8
- package/dist/runtime/store/evidence-ledger.d.ts.map +1 -1
- package/dist/runtime/store/evidence-ledger.js +39 -1
- package/dist/runtime/store/evidence-ledger.js.map +1 -1
- package/dist/runtime/store/evidence-types.d.ts +204 -204
- package/dist/runtime/store/experiment-queue-store.d.ts +20 -20
- package/dist/runtime/store/index.d.ts +2 -2
- package/dist/runtime/store/index.d.ts.map +1 -1
- package/dist/runtime/store/index.js +1 -1
- package/dist/runtime/store/index.js.map +1 -1
- package/dist/runtime/store/operator-handoff-store.d.ts +3 -3
- package/dist/runtime/store/reproducibility-manifest.d.ts +20 -20
- package/dist/runtime/store/runtime-operation-schemas.d.ts +95 -62
- package/dist/runtime/store/runtime-operation-schemas.d.ts.map +1 -1
- package/dist/runtime/store/runtime-operation-schemas.js +9 -0
- package/dist/runtime/store/runtime-operation-schemas.js.map +1 -1
- package/dist/runtime/store/runtime-paths.d.ts +2 -0
- package/dist/runtime/store/runtime-paths.d.ts.map +1 -1
- package/dist/runtime/store/runtime-paths.js +6 -0
- package/dist/runtime/store/runtime-paths.js.map +1 -1
- package/dist/runtime/store/runtime-schemas.d.ts +2256 -46
- package/dist/runtime/store/runtime-schemas.d.ts.map +1 -1
- package/dist/runtime/store/runtime-schemas.js +85 -0
- package/dist/runtime/store/runtime-schemas.js.map +1 -1
- package/dist/runtime/types/companion.d.ts +52 -52
- package/dist/runtime/types/daemon.d.ts +31 -31
- package/dist/tools/automation/InteractiveAutomationTools.d.ts +22 -2
- package/dist/tools/automation/InteractiveAutomationTools.d.ts.map +1 -1
- package/dist/tools/automation/InteractiveAutomationTools.js +75 -10
- package/dist/tools/automation/InteractiveAutomationTools.js.map +1 -1
- package/dist/tools/builtin/factory.d.ts +2 -1
- package/dist/tools/builtin/factory.d.ts.map +1 -1
- package/dist/tools/builtin/factory.js +6 -2
- package/dist/tools/builtin/factory.js.map +1 -1
- package/dist/tools/execution/MemorySaveTool/MemorySaveTool.d.ts +20 -20
- package/dist/tools/execution/RunAdapterTool/RunAdapterTool.d.ts +6 -0
- package/dist/tools/execution/RunAdapterTool/RunAdapterTool.d.ts.map +1 -1
- package/dist/tools/execution/RunAdapterTool/RunAdapterTool.js +2 -0
- package/dist/tools/execution/RunAdapterTool/RunAdapterTool.js.map +1 -1
- package/dist/tools/execution-orchestrator.d.ts +29 -0
- package/dist/tools/execution-orchestrator.d.ts.map +1 -0
- package/dist/tools/execution-orchestrator.js +153 -0
- package/dist/tools/execution-orchestrator.js.map +1 -0
- package/dist/tools/executor.d.ts +6 -0
- package/dist/tools/executor.d.ts.map +1 -1
- package/dist/tools/executor.js +48 -11
- package/dist/tools/executor.js.map +1 -1
- package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.d.ts.map +1 -1
- package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.js +130 -17
- package/dist/tools/fs/ApplyPatchTool/ApplyPatchTool.js.map +1 -1
- package/dist/tools/kaggle/KaggleExperimentTools.js +4 -3
- package/dist/tools/kaggle/KaggleExperimentTools.js.map +1 -1
- package/dist/tools/kaggle/KaggleSubmissionTools.js +6 -5
- package/dist/tools/kaggle/KaggleSubmissionTools.js.map +1 -1
- package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js +6 -5
- package/dist/tools/kaggle/KaggleWorkspacePrepareTool.js.map +1 -1
- package/dist/tools/kaggle/paths.d.ts.map +1 -1
- package/dist/tools/kaggle/paths.js +12 -8
- package/dist/tools/kaggle/paths.js.map +1 -1
- package/dist/tools/mutation/TaskStopTool/TaskStopTool.d.ts.map +1 -1
- package/dist/tools/mutation/TaskStopTool/TaskStopTool.js +8 -0
- package/dist/tools/mutation/TaskStopTool/TaskStopTool.js.map +1 -1
- package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts +8 -8
- package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.d.ts.map +1 -1
- package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js +49 -7
- package/dist/tools/mutation/TaskUpdateTool/TaskUpdateTool.js.map +1 -1
- package/dist/tools/network/GitHubCliTool/GitHubCliTool.d.ts +4 -4
- package/dist/tools/network/McpStdioTool/McpStdioTool.d.ts +4 -4
- package/dist/tools/permission.d.ts +0 -1
- package/dist/tools/permission.d.ts.map +1 -1
- package/dist/tools/permission.js +9 -33
- package/dist/tools/permission.js.map +1 -1
- package/dist/tools/query/CodeReadContextTool/CodeReadContextTool.d.ts +4 -4
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.d.ts +8 -8
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.d.ts +4 -4
- package/dist/tools/query/MemoryRecallTool/MemoryRecallTool.d.ts +4 -4
- package/dist/tools/query/runtime-session-tools.d.ts +73 -5
- package/dist/tools/query/runtime-session-tools.d.ts.map +1 -1
- package/dist/tools/query/runtime-session-tools.js +114 -0
- package/dist/tools/query/runtime-session-tools.js.map +1 -1
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +72 -54
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts.map +1 -1
- package/dist/tools/runtime/LongRunningRuntimeTools.js +4 -1
- package/dist/tools/runtime/LongRunningRuntimeTools.js.map +1 -1
- package/dist/tools/runtime/RunSpecHandoffTools.d.ts.map +1 -1
- package/dist/tools/runtime/RunSpecHandoffTools.js +162 -2
- package/dist/tools/runtime/RunSpecHandoffTools.js.map +1 -1
- package/dist/tools/runtime/SetupRuntimeControlTools.d.ts.map +1 -1
- package/dist/tools/runtime/SetupRuntimeControlTools.js +169 -17
- package/dist/tools/runtime/SetupRuntimeControlTools.js.map +1 -1
- package/dist/tools/system/EnvTool/EnvTool.d.ts +4 -4
- package/dist/tools/system/GitDiffTool/GitDiffTool.d.ts +4 -4
- package/dist/tools/system/GitLogTool/GitLogTool.d.ts +4 -4
- package/dist/tools/system/ShellCommandTool/ShellCommandTool.d.ts.map +1 -1
- package/dist/tools/system/ShellCommandTool/ShellCommandTool.js +8 -2
- package/dist/tools/system/ShellCommandTool/ShellCommandTool.js.map +1 -1
- package/dist/tools/system/ShellTool/ShellTool.d.ts.map +1 -1
- package/dist/tools/system/ShellTool/ShellTool.js +29 -11
- package/dist/tools/system/ShellTool/ShellTool.js.map +1 -1
- package/dist/tools/system/ShellTool/command-policy.d.ts +12 -8
- package/dist/tools/system/ShellTool/command-policy.d.ts.map +1 -1
- package/dist/tools/system/ShellTool/command-policy.js +412 -98
- package/dist/tools/system/ShellTool/command-policy.js.map +1 -1
- package/dist/tools/system/ShellTool/prompt.d.ts +1 -1
- package/dist/tools/system/ShellTool/prompt.d.ts.map +1 -1
- package/dist/tools/system/ShellTool/prompt.js +1 -1
- package/dist/tools/system/ShellTool/prompt.js.map +1 -1
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts +1 -1
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.d.ts.map +1 -1
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.js +152 -8
- package/dist/tools/system/TestRunnerTool/TestRunnerTool.js.map +1 -1
- package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.js +1 -1
- package/dist/tools/system/UpdatePlanTool/UpdatePlanTool.js.map +1 -1
- package/dist/tools/types.d.ts +36 -12
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +26 -3
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/workspace-scope.d.ts +11 -0
- package/dist/tools/workspace-scope.d.ts.map +1 -0
- package/dist/tools/workspace-scope.js +77 -0
- package/dist/tools/workspace-scope.js.map +1 -0
- package/package.json +2 -2
|
@@ -6,6 +6,8 @@ import { dispatchGatewayChatInput } from "./chat-session-dispatch.js";
|
|
|
6
6
|
import { formatPlaintextNotification, supportsCoreGatewayNotification } from "./core-channel-notification.js";
|
|
7
7
|
import { evaluateChannelAccess, resolveChannelRoute } from "./channel-policy.js";
|
|
8
8
|
import { createUnsupportedTypingIndicator, withTypingIndicator } from "./typing-indicator.js";
|
|
9
|
+
import { WHATSAPP_GATEWAY_DISPLAY_CONTRACT } from "./channel-display-policy.js";
|
|
10
|
+
import { NonTuiDisplayProjector } from "./non-tui-display-projector.js";
|
|
9
11
|
export class WhatsAppGatewayNotifier {
|
|
10
12
|
client;
|
|
11
13
|
config;
|
|
@@ -27,6 +29,7 @@ export class WhatsAppGatewayNotifier {
|
|
|
27
29
|
export class WhatsAppGatewayAdapter {
|
|
28
30
|
config;
|
|
29
31
|
name = "whatsapp";
|
|
32
|
+
displayContract = WHATSAPP_GATEWAY_DISPLAY_CONTRACT;
|
|
30
33
|
typingIndicator = createUnsupportedTypingIndicator("whatsapp cloud adapter has no native typing endpoint in the current contract");
|
|
31
34
|
handler = null;
|
|
32
35
|
server = null;
|
|
@@ -130,6 +133,21 @@ export class WhatsAppGatewayAdapter {
|
|
|
130
133
|
senderGoalMap: this.config.sender_goal_map,
|
|
131
134
|
defaultGoalId: this.config.default_goal_id,
|
|
132
135
|
}, channelContext);
|
|
136
|
+
const projector = new NonTuiDisplayProjector({
|
|
137
|
+
display: {
|
|
138
|
+
capabilities: WHATSAPP_GATEWAY_DISPLAY_CONTRACT.capabilities,
|
|
139
|
+
policy: {
|
|
140
|
+
progressSurface: "off",
|
|
141
|
+
finalSurface: "chunked",
|
|
142
|
+
cleanupPolicy: "none",
|
|
143
|
+
toolProgress: "off",
|
|
144
|
+
showReasoning: false,
|
|
145
|
+
progressMaxItems: 0,
|
|
146
|
+
progressMaxChars: 0,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
transport: new WhatsAppDisplayTransport(this.client, senderId),
|
|
150
|
+
});
|
|
133
151
|
const reply = await withTypingIndicator(this.typingIndicator, {
|
|
134
152
|
platform: "whatsapp",
|
|
135
153
|
conversation_id: senderId,
|
|
@@ -147,6 +165,7 @@ export class WhatsAppGatewayAdapter {
|
|
|
147
165
|
sender_id: senderId,
|
|
148
166
|
message_id: message.id,
|
|
149
167
|
goal_id: route.goalId,
|
|
168
|
+
onEvent: (event) => projector.handle(event),
|
|
150
169
|
metadata: {
|
|
151
170
|
...route.metadata,
|
|
152
171
|
message_type: message.type,
|
|
@@ -156,10 +175,16 @@ export class WhatsAppGatewayAdapter {
|
|
|
156
175
|
...(access.runtimeControlConfigured && !access.runtimeControlApproved ? { runtime_control_denied: true } : {}),
|
|
157
176
|
},
|
|
158
177
|
}));
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
178
|
+
if (!projector.renderedAssistantOutput) {
|
|
179
|
+
await projector.handle({
|
|
180
|
+
type: "assistant_final",
|
|
181
|
+
runId: "fallback",
|
|
182
|
+
turnId: "fallback",
|
|
183
|
+
createdAt: new Date().toISOString(),
|
|
184
|
+
text: reply ?? "Received.",
|
|
185
|
+
persisted: false,
|
|
186
|
+
});
|
|
187
|
+
}
|
|
163
188
|
}
|
|
164
189
|
extractMessages(payload) {
|
|
165
190
|
const messages = [];
|
|
@@ -199,6 +224,26 @@ export class WhatsAppGatewayAdapter {
|
|
|
199
224
|
res.end(JSON.stringify(payload));
|
|
200
225
|
}
|
|
201
226
|
}
|
|
227
|
+
class WhatsAppDisplayTransport {
|
|
228
|
+
client;
|
|
229
|
+
recipientId;
|
|
230
|
+
nextId = 0;
|
|
231
|
+
constructor(client, recipientId) {
|
|
232
|
+
this.client = client;
|
|
233
|
+
this.recipientId = recipientId;
|
|
234
|
+
}
|
|
235
|
+
async sendProgress(text) {
|
|
236
|
+
return this.sendFinal(text);
|
|
237
|
+
}
|
|
238
|
+
async editProgress() { }
|
|
239
|
+
async deleteProgress() { }
|
|
240
|
+
async sendFinal(text) {
|
|
241
|
+
await this.client.sendTextMessage({ to: this.recipientId, body: text });
|
|
242
|
+
this.nextId += 1;
|
|
243
|
+
return { id: `whatsapp-${this.nextId}` };
|
|
244
|
+
}
|
|
245
|
+
async editFinal() { }
|
|
246
|
+
}
|
|
202
247
|
class WhatsAppCloudClient {
|
|
203
248
|
phoneNumberId;
|
|
204
249
|
accessToken;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whatsapp-gateway-adapter.js","sourceRoot":"","sources":["../../../src/runtime/gateway/whatsapp-gateway-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAC9G,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OA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AQ,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;QACjG,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,KAAc,EAAE,OAAe;IACpD,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QACpB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,EACxF,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BrowserAutomationSessionRecord } from "../store/index.js";
|
|
2
|
+
import { BrowserSessionStore, type BrowserSessionScope } from "./browser-session-store.js";
|
|
3
|
+
export type BrowserSessionResolution = {
|
|
4
|
+
ok: true;
|
|
5
|
+
sessionId?: string;
|
|
6
|
+
record?: BrowserAutomationSessionRecord;
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
code: "browser_session_scope_required" | "browser_session_not_found" | "browser_session_stale" | "browser_session_scope_mismatch";
|
|
10
|
+
summary: string;
|
|
11
|
+
sessionId?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare class BrowserSessionResolver {
|
|
14
|
+
private readonly store?;
|
|
15
|
+
constructor(store?: BrowserSessionStore | undefined);
|
|
16
|
+
resolveForWorkflow(input: {
|
|
17
|
+
scope: BrowserSessionScope;
|
|
18
|
+
sessionId?: string;
|
|
19
|
+
}): Promise<BrowserSessionResolution>;
|
|
20
|
+
resolveForState(input: {
|
|
21
|
+
scope?: BrowserSessionScope;
|
|
22
|
+
sessionId?: string;
|
|
23
|
+
}): Promise<BrowserSessionResolution>;
|
|
24
|
+
private resolve;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=browser-session-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-session-resolver.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/browser-session-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAE3F,MAAM,MAAM,wBAAwB,GAChC;IACA,EAAE,EAAE,IAAI,CAAC;IACT,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,8BAA8B,CAAC;CACzC,GACC;IACA,EAAE,EAAE,KAAK,CAAC;IACV,IAAI,EACA,gCAAgC,GAChC,2BAA2B,GAC3B,uBAAuB,GACvB,gCAAgC,CAAC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEJ,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAN,KAAK,CAAC,EAAE,mBAAmB,YAAA;IAElD,kBAAkB,CAAC,KAAK,EAAE;QAC9B,KAAK,EAAE,mBAAmB,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAI/B,eAAe,CAAC,KAAK,EAAE;QAC3B,KAAK,CAAC,EAAE,mBAAmB,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,wBAAwB,CAAC;YAWvB,OAAO;CAgDtB"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export class BrowserSessionResolver {
|
|
2
|
+
store;
|
|
3
|
+
constructor(store) {
|
|
4
|
+
this.store = store;
|
|
5
|
+
}
|
|
6
|
+
async resolveForWorkflow(input) {
|
|
7
|
+
return this.resolve({ ...input, implicitAllowed: true });
|
|
8
|
+
}
|
|
9
|
+
async resolveForState(input) {
|
|
10
|
+
if (!input.sessionId && !input.scope) {
|
|
11
|
+
return {
|
|
12
|
+
ok: false,
|
|
13
|
+
code: "browser_session_scope_required",
|
|
14
|
+
summary: "browser_get_state requires sessionId or explicit service scope before reusing the latest browser session",
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return this.resolve({ ...input, implicitAllowed: Boolean(input.scope) });
|
|
18
|
+
}
|
|
19
|
+
async resolve(input) {
|
|
20
|
+
if (!this.store) {
|
|
21
|
+
return input.sessionId ? { ok: true, sessionId: input.sessionId } : { ok: true };
|
|
22
|
+
}
|
|
23
|
+
if (input.sessionId) {
|
|
24
|
+
const record = await this.store.load(input.sessionId);
|
|
25
|
+
if (!record) {
|
|
26
|
+
return {
|
|
27
|
+
ok: false,
|
|
28
|
+
code: "browser_session_not_found",
|
|
29
|
+
summary: `Browser session ${input.sessionId} was not found`,
|
|
30
|
+
sessionId: input.sessionId,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (input.scope && !sameScope(record, input.scope)) {
|
|
34
|
+
return {
|
|
35
|
+
ok: false,
|
|
36
|
+
code: "browser_session_scope_mismatch",
|
|
37
|
+
summary: `Browser session ${input.sessionId} does not match the requested browser scope`,
|
|
38
|
+
sessionId: input.sessionId,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const staleReason = staleSessionReason(record);
|
|
42
|
+
if (staleReason) {
|
|
43
|
+
return {
|
|
44
|
+
ok: false,
|
|
45
|
+
code: "browser_session_stale",
|
|
46
|
+
summary: `Browser session ${input.sessionId} is not reusable: ${staleReason}`,
|
|
47
|
+
sessionId: input.sessionId,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return { ok: true, sessionId: record.session_id, record };
|
|
51
|
+
}
|
|
52
|
+
if (!input.implicitAllowed || !input.scope) {
|
|
53
|
+
return { ok: true };
|
|
54
|
+
}
|
|
55
|
+
const latest = await this.store.findLatest(input.scope, ["authenticated"]);
|
|
56
|
+
return latest
|
|
57
|
+
? { ok: true, sessionId: latest.session_id, record: latest }
|
|
58
|
+
: { ok: true };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function sameScope(record, scope) {
|
|
62
|
+
return record.provider_id === scope.providerId
|
|
63
|
+
&& record.service_key === scope.serviceKey
|
|
64
|
+
&& record.workspace === scope.workspace
|
|
65
|
+
&& record.actor_key === scope.actorKey;
|
|
66
|
+
}
|
|
67
|
+
function staleSessionReason(record) {
|
|
68
|
+
if (record.state !== "authenticated")
|
|
69
|
+
return record.state;
|
|
70
|
+
if (!record.expires_at)
|
|
71
|
+
return null;
|
|
72
|
+
const expiresAtMs = Date.parse(record.expires_at);
|
|
73
|
+
return Number.isFinite(expiresAtMs) && expiresAtMs <= Date.now() ? "expired" : null;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=browser-session-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-session-resolver.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/browser-session-resolver.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,sBAAsB;IACJ;IAA7B,YAA6B,KAA2B;QAA3B,UAAK,GAAL,KAAK,CAAsB;IAAG,CAAC;IAE5D,KAAK,CAAC,kBAAkB,CAAC,KAGxB;QACC,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,KAGrB;QACC,IAAI,CAAC,KAAK,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACrC,OAAO;gBACL,EAAE,EAAE,KAAK;gBACT,IAAI,EAAE,gCAAgC;gBACtC,OAAO,EAAE,0GAA0G;aACpH,CAAC;QACJ,CAAC;QAC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I,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACtF,CAAC"}
|
|
@@ -3,6 +3,8 @@ export * from "./registry.js";
|
|
|
3
3
|
export * from "./default-registry.js";
|
|
4
4
|
export * from "./failure-classifier.js";
|
|
5
5
|
export * from "./browser-session-store.js";
|
|
6
|
+
export * from "./browser-session-resolver.js";
|
|
7
|
+
export * from "./runtime-auth-handoff-store.js";
|
|
6
8
|
export * from "./providers/noop.js";
|
|
7
9
|
export * from "./providers/codex-app.js";
|
|
8
10
|
export * from "./providers/perplexity-research.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
|
|
@@ -3,6 +3,8 @@ export * from "./registry.js";
|
|
|
3
3
|
export * from "./default-registry.js";
|
|
4
4
|
export * from "./failure-classifier.js";
|
|
5
5
|
export * from "./browser-session-store.js";
|
|
6
|
+
export * from "./browser-session-resolver.js";
|
|
7
|
+
export * from "./runtime-auth-handoff-store.js";
|
|
6
8
|
export * from "./providers/noop.js";
|
|
7
9
|
export * from "./providers/codex-app.js";
|
|
8
10
|
export * from "./providers/perplexity-research.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { RuntimeAuthHandoffRecord, RuntimeAuthHandoffState, RuntimeControlActor, RuntimeControlReplyTarget } from "../store/index.js";
|
|
2
|
+
import { type RuntimeStorePaths } from "../store/index.js";
|
|
3
|
+
import type { BrowserSessionScope } from "./browser-session-store.js";
|
|
4
|
+
export interface RuntimeAuthHandoffCreateInput {
|
|
5
|
+
providerId: string;
|
|
6
|
+
serviceKey: string;
|
|
7
|
+
workspace: string;
|
|
8
|
+
actorKey: string;
|
|
9
|
+
state?: Extract<RuntimeAuthHandoffState, "requested" | "pending_operator" | "blocked">;
|
|
10
|
+
browserSessionId?: string | null;
|
|
11
|
+
resumableSessionId?: string | null;
|
|
12
|
+
replyTarget?: RuntimeControlReplyTarget | null;
|
|
13
|
+
requestedBy?: RuntimeControlActor | null;
|
|
14
|
+
expiresAt?: string | null;
|
|
15
|
+
failureCode?: string | null;
|
|
16
|
+
failureMessage?: string | null;
|
|
17
|
+
taskSummary: string;
|
|
18
|
+
evidenceRefs?: RuntimeAuthHandoffRecord["evidence_refs"];
|
|
19
|
+
}
|
|
20
|
+
export declare class RuntimeAuthHandoffStore {
|
|
21
|
+
private readonly paths;
|
|
22
|
+
private readonly journal;
|
|
23
|
+
constructor(runtimeRootOrPaths?: string | RuntimeStorePaths);
|
|
24
|
+
ensureReady(): Promise<void>;
|
|
25
|
+
load(handoffId: string): Promise<RuntimeAuthHandoffRecord | null>;
|
|
26
|
+
list(): Promise<RuntimeAuthHandoffRecord[]>;
|
|
27
|
+
listActive(scope?: BrowserSessionScope): Promise<RuntimeAuthHandoffRecord[]>;
|
|
28
|
+
findLatestActive(scope: BrowserSessionScope): Promise<RuntimeAuthHandoffRecord | null>;
|
|
29
|
+
upsert(record: RuntimeAuthHandoffRecord): Promise<RuntimeAuthHandoffRecord>;
|
|
30
|
+
createPending(input: RuntimeAuthHandoffCreateInput): Promise<RuntimeAuthHandoffRecord>;
|
|
31
|
+
transition(handoffId: string, state: RuntimeAuthHandoffState, updates?: Partial<Pick<RuntimeAuthHandoffRecord, "browser_session_id" | "resumable_session_id" | "failure_code" | "failure_message" | "evidence_refs">>): Promise<RuntimeAuthHandoffRecord | null>;
|
|
32
|
+
transitionLatestActive(scope: BrowserSessionScope, state: RuntimeAuthHandoffState, updates?: Partial<Pick<RuntimeAuthHandoffRecord, "browser_session_id" | "resumable_session_id" | "failure_code" | "failure_message" | "evidence_refs">>): Promise<RuntimeAuthHandoffRecord | null>;
|
|
33
|
+
private supersedeActive;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=runtime-auth-handoff-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-auth-handoff-store.d.ts","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/runtime-auth-handoff-store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAWtE,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC,uBAAuB,EAAE,WAAW,GAAG,kBAAkB,GAAG,SAAS,CAAC,CAAC;IACvF,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;IAC/C,WAAW,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,wBAAwB,CAAC,eAAe,CAAC,CAAC;CAC1D;AAED,qBAAa,uB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RuntimeAuthHandoffRecordSchema, RuntimeJournal, } from "../store/index.js";
|
|
3
|
+
const ACTIVE_STATES = new Set([
|
|
4
|
+
"requested",
|
|
5
|
+
"pending_operator",
|
|
6
|
+
"in_progress",
|
|
7
|
+
"blocked",
|
|
8
|
+
]);
|
|
9
|
+
const RuntimeAuthHandoffJournalSchema = RuntimeAuthHandoffRecordSchema;
|
|
10
|
+
export class RuntimeAuthHandoffStore {
|
|
11
|
+
paths;
|
|
12
|
+
journal;
|
|
13
|
+
constructor(runtimeRootOrPaths) {
|
|
14
|
+
this.paths =
|
|
15
|
+
typeof runtimeRootOrPaths === "string"
|
|
16
|
+
? createRuntimeStorePaths(runtimeRootOrPaths)
|
|
17
|
+
: runtimeRootOrPaths ?? createRuntimeStorePaths();
|
|
18
|
+
this.journal = new RuntimeJournal(this.paths);
|
|
19
|
+
}
|
|
20
|
+
async ensureReady() {
|
|
21
|
+
await this.journal.ensureReady();
|
|
22
|
+
}
|
|
23
|
+
async load(handoffId) {
|
|
24
|
+
return this.journal.load(this.paths.authHandoffPath(handoffId), RuntimeAuthHandoffJournalSchema);
|
|
25
|
+
}
|
|
26
|
+
async list() {
|
|
27
|
+
return this.journal.list(this.paths.authHandoffsDir, RuntimeAuthHandoffJournalSchema);
|
|
28
|
+
}
|
|
29
|
+
async listActive(scope) {
|
|
30
|
+
return (await this.list())
|
|
31
|
+
.filter((record) => ACTIVE_STATES.has(record.state)
|
|
32
|
+
&& (!scope
|
|
33
|
+
|| (record.provider_id === scope.providerId
|
|
34
|
+
&& record.service_key === scope.serviceKey
|
|
35
|
+
&& record.workspace === scope.workspace
|
|
36
|
+
&& record.actor_key === scope.actorKey)))
|
|
37
|
+
.sort((a, b) => b.updated_at.localeCompare(a.updated_at));
|
|
38
|
+
}
|
|
39
|
+
async findLatestActive(scope) {
|
|
40
|
+
return (await this.listActive(scope))[0] ?? null;
|
|
41
|
+
}
|
|
42
|
+
async upsert(record) {
|
|
43
|
+
await this.ensureReady();
|
|
44
|
+
const parsed = RuntimeAuthHandoffRecordSchema.parse(record);
|
|
45
|
+
await this.journal.save(this.paths.authHandoffPath(parsed.handoff_id), RuntimeAuthHandoffJournalSchema, parsed);
|
|
46
|
+
return parsed;
|
|
47
|
+
}
|
|
48
|
+
async createPending(input) {
|
|
49
|
+
const now = new Date().toISOString();
|
|
50
|
+
const scope = {
|
|
51
|
+
providerId: input.providerId,
|
|
52
|
+
serviceKey: input.serviceKey,
|
|
53
|
+
workspace: input.workspace,
|
|
54
|
+
actorKey: input.actorKey,
|
|
55
|
+
};
|
|
56
|
+
const superseded = await this.supersedeActive(scope, now);
|
|
57
|
+
const latestSuperseded = superseded[0] ?? null;
|
|
58
|
+
const handoff = {
|
|
59
|
+
schema_version: "runtime-auth-handoff-v1",
|
|
60
|
+
handoff_id: randomUUID(),
|
|
61
|
+
provider_id: input.providerId,
|
|
62
|
+
service_key: input.serviceKey,
|
|
63
|
+
workspace: input.workspace,
|
|
64
|
+
actor_key: input.actorKey,
|
|
65
|
+
state: input.state ?? "pending_operator",
|
|
66
|
+
requested_at: now,
|
|
67
|
+
updated_at: now,
|
|
68
|
+
expires_at: input.expiresAt ?? null,
|
|
69
|
+
completed_at: null,
|
|
70
|
+
browser_session_id: input.browserSessionId ?? null,
|
|
71
|
+
resumable_session_id: input.resumableSessionId ?? null,
|
|
72
|
+
supersedes_handoff_id: latestSuperseded?.handoff_id ?? null,
|
|
73
|
+
superseded_by_handoff_id: null,
|
|
74
|
+
reply_target: input.replyTarget ?? null,
|
|
75
|
+
requested_by: input.requestedBy ?? null,
|
|
76
|
+
failure_code: input.failureCode ?? null,
|
|
77
|
+
failure_message: input.failureMessage ?? null,
|
|
78
|
+
resume_hint: {
|
|
79
|
+
tool_name: "browser_run_workflow",
|
|
80
|
+
task_summary: input.taskSummary,
|
|
81
|
+
},
|
|
82
|
+
evidence_refs: input.evidenceRefs ?? [],
|
|
83
|
+
};
|
|
84
|
+
const created = await this.upsert(handoff);
|
|
85
|
+
for (const record of superseded) {
|
|
86
|
+
await this.upsert({
|
|
87
|
+
...record,
|
|
88
|
+
superseded_by_handoff_id: created.handoff_id,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
return created;
|
|
92
|
+
}
|
|
93
|
+
async transition(handoffId, state, updates = {}) {
|
|
94
|
+
const existing = await this.load(handoffId);
|
|
95
|
+
if (!existing)
|
|
96
|
+
return null;
|
|
97
|
+
const now = new Date().toISOString();
|
|
98
|
+
return this.upsert({
|
|
99
|
+
...existing,
|
|
100
|
+
...updates,
|
|
101
|
+
state,
|
|
102
|
+
updated_at: now,
|
|
103
|
+
completed_at: state === "completed" ? now : existing.completed_at ?? null,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async transitionLatestActive(scope, state, updates = {}) {
|
|
107
|
+
const latest = await this.findLatestActive(scope);
|
|
108
|
+
if (!latest)
|
|
109
|
+
return null;
|
|
110
|
+
return this.transition(latest.handoff_id, state, updates);
|
|
111
|
+
}
|
|
112
|
+
async supersedeActive(scope, now) {
|
|
113
|
+
const active = await this.listActive(scope);
|
|
114
|
+
const superseded = active.map((record) => ({
|
|
115
|
+
...record,
|
|
116
|
+
state: "superseded",
|
|
117
|
+
updated_at: now,
|
|
118
|
+
}));
|
|
119
|
+
for (const record of superseded) {
|
|
120
|
+
await this.upsert(record);
|
|
121
|
+
}
|
|
122
|
+
return superseded;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=runtime-auth-handoff-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-auth-handoff-store.js","sourceRoot":"","sources":["../../../src/runtime/interactive-automation/runtime-auth-handoff-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,OAAO,EACL,uBAAuB,EACvB,8BAA8B,EAC9B,cAAc,GAEf,MAAM,mBAAmB,CAAC;AAI3B,MAAM,aAAa,GAAG,IAAI,GAAG,CAA0B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+
export declare const PermissionRiskClassSchema: z.ZodEnum<["low", "medium", "high", "critical", "unknown"]>;
|
|
4
|
+
export type PermissionRiskClass = z.infer<typeof PermissionRiskClassSchema>;
|
|
5
|
+
export declare const PendingPermissionTargetSchema: z.ZodObject<{
|
|
6
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
8
|
+
tool_id: z.ZodOptional<z.ZodString>;
|
|
9
|
+
tool_call_id: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
session_id?: string | undefined;
|
|
12
|
+
run_id?: string | undefined;
|
|
13
|
+
tool_id?: string | undefined;
|
|
14
|
+
tool_call_id?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
session_id?: string | undefined;
|
|
17
|
+
run_id?: string | undefined;
|
|
18
|
+
tool_id?: string | undefined;
|
|
19
|
+
tool_call_id?: string | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type PendingPermissionTarget = z.infer<typeof PendingPermissionTargetSchema>;
|
|
22
|
+
export declare const PendingPermissionTaskSchema: z.ZodObject<{
|
|
23
|
+
kind: z.ZodLiteral<"permission">;
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
description: z.ZodString;
|
|
26
|
+
action: z.ZodString;
|
|
27
|
+
operation_summary: z.ZodString;
|
|
28
|
+
risk_class: z.ZodEnum<["low", "medium", "high", "critical", "unknown"]>;
|
|
29
|
+
target: z.ZodObject<{
|
|
30
|
+
session_id: z.ZodOptional<z.ZodString>;
|
|
31
|
+
run_id: z.ZodOptional<z.ZodString>;
|
|
32
|
+
tool_id: z.ZodOptional<z.ZodString>;
|
|
33
|
+
tool_call_id: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
session_id?: string | undefined;
|
|
36
|
+
run_id?: string | undefined;
|
|
37
|
+
tool_id?: string | undefined;
|
|
38
|
+
tool_call_id?: string | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
session_id?: string | undefined;
|
|
41
|
+
run_id?: string | undefined;
|
|
42
|
+
tool_id?: string | undefined;
|
|
43
|
+
tool_call_id?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
state_epoch: z.ZodString;
|
|
46
|
+
state_version: z.ZodOptional<z.ZodString>;
|
|
47
|
+
expires_at: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
permission_level: z.ZodOptional<z.ZodString>;
|
|
49
|
+
is_destructive: z.ZodOptional<z.ZodBoolean>;
|
|
50
|
+
reversibility: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
kind: "permission";
|
|
53
|
+
id: string;
|
|
54
|
+
description: string;
|
|
55
|
+
action: string;
|
|
56
|
+
target: {
|
|
57
|
+
session_id?: string | undefined;
|
|
58
|
+
run_id?: string | undefined;
|
|
59
|
+
tool_id?: string | undefined;
|
|
60
|
+
tool_call_id?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
operation_summary: string;
|
|
63
|
+
risk_class: "unknown" | "low" | "high" | "medium" | "critical";
|
|
64
|
+
state_epoch: string;
|
|
65
|
+
reversibility?: string | undefined;
|
|
66
|
+
expires_at?: number | undefined;
|
|
67
|
+
state_version?: string | undefined;
|
|
68
|
+
permission_level?: string | undefined;
|
|
69
|
+
is_destructive?: boolean | undefined;
|
|
70
|
+
}, {
|
|
71
|
+
kind: "permission";
|
|
72
|
+
id: string;
|
|
73
|
+
description: string;
|
|
74
|
+
action: string;
|
|
75
|
+
target: {
|
|
76
|
+
session_id?: string | undefined;
|
|
77
|
+
run_id?: string | undefined;
|
|
78
|
+
tool_id?: string | undefined;
|
|
79
|
+
tool_call_id?: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
operation_summary: string;
|
|
82
|
+
risk_class: "unknown" | "low" | "high" | "medium" | "critical";
|
|
83
|
+
state_epoch: string;
|
|
84
|
+
reversibility?: string | undefined;
|
|
85
|
+
expires_at?: number | undefined;
|
|
86
|
+
state_version?: string | undefined;
|
|
87
|
+
permission_level?: string | undefined;
|
|
88
|
+
is_destructive?: boolean | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
export type PendingPermissionTask = z.infer<typeof PendingPermissionTaskSchema>;
|
|
91
|
+
export declare function createPendingPermissionTask(input: {
|
|
92
|
+
id: string;
|
|
93
|
+
description: string;
|
|
94
|
+
action: string;
|
|
95
|
+
target: PendingPermissionTarget;
|
|
96
|
+
stateEpoch: string;
|
|
97
|
+
stateVersion?: string;
|
|
98
|
+
expiresAt?: number;
|
|
99
|
+
permissionLevel?: string;
|
|
100
|
+
isDestructive?: boolean;
|
|
101
|
+
reversibility?: string;
|
|
102
|
+
}): PendingPermissionTask;
|
|
103
|
+
export declare function withPermissionExpiry<T extends {
|
|
104
|
+
kind?: string;
|
|
105
|
+
expires_at?: number;
|
|
106
|
+
}>(task: T, expiresAt: number): T;
|
|
107
|
+
export declare function getPendingPermissionTask(record: ApprovalRecord): PendingPermissionTask | null;
|
|
108
|
+
export declare function isPermissionApprovalStale(record: ApprovalRecord, currentStateEpoch: string | null): boolean;
|
|
109
|
+
export declare function classifyPermissionRisk(input: {
|
|
110
|
+
permissionLevel?: string;
|
|
111
|
+
isDestructive?: boolean;
|
|
112
|
+
}): PermissionRiskClass;
|
|
113
|
+
//# sourceMappingURL=permission-dialogue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-dialogue.d.ts","sourceRoot":"","sources":["../../src/runtime/permission-dialogue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE,eAAO,MAAM,yBAAyB,6DAA2D,CAAC;AAClG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,6BA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