@orion-agents/orion-code 0.3.1 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/README.md +71 -32
- package/README.zh-CN.md +56 -29
- package/dist/commands/model-command-handlers.js +59 -14
- package/dist/commands/types.d.ts +6 -0
- package/dist/commands/workflow-command-handlers.d.ts +1 -1
- package/dist/commands/workflow-command-handlers.js +42 -3
- package/dist/commands/workflow-commands.js +2 -2
- package/dist/runtime/agent-runtime-controller.d.ts +17 -2
- package/dist/runtime/agent-runtime-controller.js +207 -47
- package/dist/runtime/agent-runtime-protocol.d.ts +3 -0
- package/dist/runtime/agent-runtime-runner.d.ts +8 -0
- package/dist/runtime/capability-receipt-journal.js +1 -1
- package/dist/runtime/durable-tool-receipt-reader.js +1 -1
- package/dist/runtime/legacy-thread-materializer.js +2 -2
- package/dist/runtime/orion-runtime-v1.d.ts +2 -1
- package/dist/runtime/orion-runtime-v1.js +18 -16
- package/dist/runtime/orion-session-runner.d.ts +6 -0
- package/dist/runtime/orion-session-runner.js +27 -4
- package/dist/runtime/plan-review.d.ts +38 -0
- package/dist/runtime/plan-review.js +173 -0
- package/dist/runtime/product-bootstrap.d.ts +6 -0
- package/dist/runtime/product-bootstrap.js +388 -314
- package/dist/runtime/product-orion-runtime.d.ts +5 -0
- package/dist/runtime/product-orion-runtime.js +16 -35
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts +73 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js +37 -0
- package/dist/runtime/release-receipts.d.ts +9 -3
- package/dist/runtime/release-receipts.js +120 -1
- package/dist/runtime/session-composer-control.d.ts +136 -0
- package/dist/runtime/session-composer-control.js +532 -0
- package/dist/runtime/step-snapshot.d.ts +12 -0
- package/dist/runtime/step-snapshot.js +14 -1
- package/dist/runtime/subagent-thread-runtime.js +1 -1
- package/dist/runtime/thread-event-store.d.ts +10 -1
- package/dist/runtime/thread-event-store.js +48 -12
- package/dist/runtime/thread-projection.d.ts +36 -0
- package/dist/runtime/thread-projection.js +99 -0
- package/dist/runtime/thread-runtime.d.ts +2 -2
- package/dist/runtime/thread-runtime.js +2 -2
- package/dist/runtime/thread-session-index.d.ts +17 -1
- package/dist/runtime/thread-session-index.js +89 -6
- package/dist/runtime/thread-session-view.d.ts +4 -1
- package/dist/runtime/thread-session-view.js +5 -2
- package/dist/runtime/thread-ui-adapter.js +10 -3
- package/dist/runtime/tool-gateway.js +1 -0
- package/dist/runtime/turn-commit.js +1 -1
- package/dist/runtime/ui-events.d.ts +9 -1
- package/dist/runtime/workspace-runtime-kernel.d.ts +67 -0
- package/dist/runtime/workspace-runtime-kernel.js +148 -0
- package/dist/services/global-config.d.ts +2 -0
- package/dist/services/global-config.js +7 -1
- package/dist/services/provider-resilience/coordinator.d.ts +3 -1
- package/dist/services/provider-resilience/coordinator.js +23 -1
- package/dist/services/provider-resilience/request-gate.js +7 -2
- package/dist/services/redaction.js +19 -2
- package/dist/services/session-storage.d.ts +36 -0
- package/dist/services/session-storage.js +77 -1
- package/dist/services/settings-coordinator.d.ts +3 -1
- package/dist/services/settings-coordinator.js +40 -8
- package/dist/services/settings-document-repository.d.ts +8 -1
- package/dist/services/settings-document-repository.js +22 -1
- package/dist/tui-ui/transcript-inspector-layout.js +13 -6
- package/dist/web/event-hub.d.ts +2 -0
- package/dist/web/event-hub.js +53 -6
- package/dist/web/file-read-service.d.ts +11 -0
- package/dist/web/file-read-service.js +56 -19
- package/dist/web/git-read-model-service.d.ts +8 -0
- package/dist/web/git-read-model-service.js +35 -2
- package/dist/web/protocol.d.ts +193 -3
- package/dist/web/protocol.js +245 -2
- package/dist/web/review-service.d.ts +1 -0
- package/dist/web/review-service.js +1 -0
- package/dist/web/server.js +75 -14
- package/dist/web/session-runtime-registry.d.ts +124 -0
- package/dist/web/session-runtime-registry.js +448 -0
- package/dist/web/terminal-manager.d.ts +1 -0
- package/dist/web/terminal-manager.js +60 -9
- package/dist/web/terminal-server.js +35 -6
- package/dist/web/workbench-controller.d.ts +52 -11
- package/dist/web/workbench-controller.js +1049 -110
- package/dist/web/workspace-mutation-arbiter.d.ts +54 -0
- package/dist/web/workspace-mutation-arbiter.js +267 -0
- package/dist/web-client/assets/{DiffViewer-DpKoD07C.js → DiffViewer-D6mG729y.js} +1 -1
- package/dist/web-client/assets/FilesPanel-CCDoAZ1J.js +2 -0
- package/dist/web-client/assets/{GitPanel-D20StcdG.js → GitPanel-DtNgiH7A.js} +1 -1
- package/dist/web-client/assets/ReviewPanel-CKEBSt6P.js +1 -0
- package/dist/web-client/assets/{TerminalPanel-BLQ592Fb.js → TerminalPanel-CNxMaBLp.js} +15 -13
- package/dist/web-client/assets/index-BBvNg3By.css +1 -0
- package/dist/web-client/assets/index-C6TDJwMC.js +17 -0
- package/dist/web-client/index.html +4 -4
- package/docs/architecture/agent-mode-permission-contract.md +87 -0
- package/docs/architecture/v0.3.1-web-api.yaml +53 -5
- package/docs/architecture/v0.3.2-web-api.yaml +3029 -0
- package/docs/architecture/v0.3.3-web-api.yaml +3205 -0
- package/docs/architecture/v0.3.4-stabilization-contract.md +32 -0
- package/docs/migration/v0.3.1-to-v0.3.2.md +94 -0
- package/docs/migration/v0.3.2-to-v0.3.3.md +62 -0
- package/docs/migration/v0.3.3-to-v0.3.4.md +36 -0
- package/docs/plan/v0.3.1-web-workbench-professional-shell-plan.md +1 -1
- package/docs/plan/v0.3.2-web-workbench-layout-and-composer-plan.md +869 -0
- package/docs/plan/v0.3.3-plan.md +1113 -0
- package/docs/plan/v0.3.4-stabilization-plan.md +89 -0
- package/docs/readme.md +12 -2
- package/docs/test/v0.3.1-web-workbench-e2e-plan.md +1 -1
- package/docs/test/v0.3.2-web-workbench-e2e-plan.md +100 -0
- package/docs/test/v0.3.3-web-workbench-e2e-plan.md +79 -0
- package/docs/test/v0.3.4-stabilization-e2e-plan.md +54 -0
- package/npm-shrinkwrap.json +25 -25
- package/package.json +15 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/context-commands.d.ts.map +0 -1
- package/dist/commands/context-commands.js.map +0 -1
- package/dist/commands/context-tool-command-handlers.d.ts.map +0 -1
- package/dist/commands/context-tool-command-handlers.js.map +0 -1
- package/dist/commands/core-command-handlers.d.ts.map +0 -1
- package/dist/commands/core-command-handlers.js.map +0 -1
- package/dist/commands/diagnostic-command-handlers.d.ts.map +0 -1
- package/dist/commands/diagnostic-command-handlers.js.map +0 -1
- package/dist/commands/diagnostic-commands.d.ts.map +0 -1
- package/dist/commands/diagnostic-commands.js.map +0 -1
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/model-command-handlers.d.ts.map +0 -1
- package/dist/commands/model-command-handlers.js.map +0 -1
- package/dist/commands/model-commands.d.ts.map +0 -1
- package/dist/commands/model-commands.js.map +0 -1
- package/dist/commands/parser.d.ts.map +0 -1
- package/dist/commands/parser.js.map +0 -1
- package/dist/commands/registry.d.ts.map +0 -1
- package/dist/commands/registry.js.map +0 -1
- package/dist/commands/session-command-handlers.d.ts.map +0 -1
- package/dist/commands/session-command-handlers.js.map +0 -1
- package/dist/commands/session-commands.d.ts.map +0 -1
- package/dist/commands/session-commands.js.map +0 -1
- package/dist/commands/system-commands.d.ts.map +0 -1
- package/dist/commands/system-commands.js.map +0 -1
- package/dist/commands/target-command.d.ts.map +0 -1
- package/dist/commands/target-command.js.map +0 -1
- package/dist/commands/tool-commands.d.ts.map +0 -1
- package/dist/commands/tool-commands.js.map +0 -1
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands/types.js.map +0 -1
- package/dist/commands/workflow-command-handlers.d.ts.map +0 -1
- package/dist/commands/workflow-command-handlers.js.map +0 -1
- package/dist/commands/workflow-commands.d.ts.map +0 -1
- package/dist/commands/workflow-commands.js.map +0 -1
- package/dist/core/checkpoint.d.ts.map +0 -1
- package/dist/core/checkpoint.js.map +0 -1
- package/dist/core/cost-tracker.d.ts.map +0 -1
- package/dist/core/cost-tracker.js.map +0 -1
- package/dist/core/security-warning.d.ts.map +0 -1
- package/dist/core/security-warning.js.map +0 -1
- package/dist/core/strategy-tracker.d.ts.map +0 -1
- package/dist/core/strategy-tracker.js.map +0 -1
- package/dist/core/tool-artifacts.d.ts.map +0 -1
- package/dist/core/tool-artifacts.js.map +0 -1
- package/dist/core/warn-dedup.d.ts.map +0 -1
- package/dist/core/warn-dedup.js.map +0 -1
- package/dist/framework/agent-mode.d.ts.map +0 -1
- package/dist/framework/agent-mode.js.map +0 -1
- package/dist/framework/external-assertion.d.ts.map +0 -1
- package/dist/framework/external-assertion.js.map +0 -1
- package/dist/framework/index.d.ts.map +0 -1
- package/dist/framework/index.js.map +0 -1
- package/dist/framework/loop-budget-contract.d.ts.map +0 -1
- package/dist/framework/loop-budget-contract.js.map +0 -1
- package/dist/framework/prompt.d.ts.map +0 -1
- package/dist/framework/prompt.js.map +0 -1
- package/dist/framework/query.d.ts.map +0 -1
- package/dist/framework/query.js.map +0 -1
- package/dist/framework/stop-decision.d.ts.map +0 -1
- package/dist/framework/stop-decision.js.map +0 -1
- package/dist/framework/store.d.ts.map +0 -1
- package/dist/framework/store.js.map +0 -1
- package/dist/framework/tool-call-orchestrator.d.ts.map +0 -1
- package/dist/framework/tool-call-orchestrator.js.map +0 -1
- package/dist/framework/tool-serializer.d.ts.map +0 -1
- package/dist/framework/tool-serializer.js.map +0 -1
- package/dist/framework/tool-state.d.ts.map +0 -1
- package/dist/framework/tool-state.js.map +0 -1
- package/dist/framework/tool.d.ts.map +0 -1
- package/dist/framework/tool.js.map +0 -1
- package/dist/harness/assembler.d.ts.map +0 -1
- package/dist/harness/assembler.js.map +0 -1
- package/dist/harness/capability-profile.d.ts.map +0 -1
- package/dist/harness/capability-profile.js.map +0 -1
- package/dist/harness/capsule.d.ts.map +0 -1
- package/dist/harness/capsule.js.map +0 -1
- package/dist/harness/compact-benchmark-corpus.d.ts.map +0 -1
- package/dist/harness/compact-benchmark-corpus.js.map +0 -1
- package/dist/harness/context-harness.d.ts.map +0 -1
- package/dist/harness/context-harness.js.map +0 -1
- package/dist/harness/contract.d.ts.map +0 -1
- package/dist/harness/contract.js.map +0 -1
- package/dist/harness/drift-guard.d.ts.map +0 -1
- package/dist/harness/drift-guard.js.map +0 -1
- package/dist/harness/evidence.d.ts.map +0 -1
- package/dist/harness/evidence.js.map +0 -1
- package/dist/harness/index.d.ts.map +0 -1
- package/dist/harness/index.js.map +0 -1
- package/dist/harness/intent.d.ts.map +0 -1
- package/dist/harness/intent.js.map +0 -1
- package/dist/harness/ledger.d.ts.map +0 -1
- package/dist/harness/ledger.js.map +0 -1
- package/dist/harness/progress-controller.d.ts.map +0 -1
- package/dist/harness/progress-controller.js.map +0 -1
- package/dist/harness/state.d.ts.map +0 -1
- package/dist/harness/state.js.map +0 -1
- package/dist/harness/stop-controller.d.ts.map +0 -1
- package/dist/harness/stop-controller.js.map +0 -1
- package/dist/harness/turn-summary.d.ts.map +0 -1
- package/dist/harness/turn-summary.js.map +0 -1
- package/dist/harness/types.d.ts.map +0 -1
- package/dist/harness/types.js.map +0 -1
- package/dist/harness/verification.d.ts.map +0 -1
- package/dist/harness/verification.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/memory/embeddings.d.ts.map +0 -1
- package/dist/memory/embeddings.js.map +0 -1
- package/dist/memory/entrypoint.d.ts.map +0 -1
- package/dist/memory/entrypoint.js.map +0 -1
- package/dist/memory/index.d.ts.map +0 -1
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/prompt-context.d.ts.map +0 -1
- package/dist/memory/prompt-context.js.map +0 -1
- package/dist/memory/prompts.d.ts.map +0 -1
- package/dist/memory/prompts.js.map +0 -1
- package/dist/memory/relevant-finder.d.ts.map +0 -1
- package/dist/memory/relevant-finder.js.map +0 -1
- package/dist/memory/semantic-config.d.ts.map +0 -1
- package/dist/memory/semantic-config.js.map +0 -1
- package/dist/memory/semantic-search.d.ts.map +0 -1
- package/dist/memory/semantic-search.js.map +0 -1
- package/dist/memory/storage.d.ts.map +0 -1
- package/dist/memory/storage.js.map +0 -1
- package/dist/memory/store.d.ts.map +0 -1
- package/dist/memory/store.js.map +0 -1
- package/dist/memory/team-paths.d.ts.map +0 -1
- package/dist/memory/team-paths.js.map +0 -1
- package/dist/memory/types.d.ts.map +0 -1
- package/dist/memory/types.js.map +0 -1
- package/dist/memory/validation.d.ts.map +0 -1
- package/dist/memory/validation.js.map +0 -1
- package/dist/memory/vector-store.d.ts.map +0 -1
- package/dist/memory/vector-store.js.map +0 -1
- package/dist/migration/command.d.ts.map +0 -1
- package/dist/migration/command.js.map +0 -1
- package/dist/migration/index.d.ts.map +0 -1
- package/dist/migration/index.js.map +0 -1
- package/dist/migration/migrate.d.ts.map +0 -1
- package/dist/migration/migrate.js.map +0 -1
- package/dist/migration/types.d.ts.map +0 -1
- package/dist/migration/types.js.map +0 -1
- package/dist/print-ui/launch.d.ts.map +0 -1
- package/dist/print-ui/launch.js.map +0 -1
- package/dist/product/environment.d.ts.map +0 -1
- package/dist/product/environment.js.map +0 -1
- package/dist/product/identity.d.ts.map +0 -1
- package/dist/product/identity.js.map +0 -1
- package/dist/product/index.d.ts.map +0 -1
- package/dist/product/index.js.map +0 -1
- package/dist/product/paths.d.ts.map +0 -1
- package/dist/product/paths.js.map +0 -1
- package/dist/product/version.d.ts.map +0 -1
- package/dist/product/version.js.map +0 -1
- package/dist/runtime/agent-loop.d.ts.map +0 -1
- package/dist/runtime/agent-loop.js.map +0 -1
- package/dist/runtime/agent-runtime-controller.d.ts.map +0 -1
- package/dist/runtime/agent-runtime-controller.js.map +0 -1
- package/dist/runtime/agent-runtime-protocol.d.ts.map +0 -1
- package/dist/runtime/agent-runtime-protocol.js.map +0 -1
- package/dist/runtime/agent-runtime-runner.d.ts.map +0 -1
- package/dist/runtime/agent-runtime-runner.js.map +0 -1
- package/dist/runtime/agent-status.d.ts.map +0 -1
- package/dist/runtime/agent-status.js.map +0 -1
- package/dist/runtime/aggregate-tool-presenter.d.ts.map +0 -1
- package/dist/runtime/aggregate-tool-presenter.js.map +0 -1
- package/dist/runtime/batch-read-service.d.ts.map +0 -1
- package/dist/runtime/batch-read-service.js.map +0 -1
- package/dist/runtime/builtin-tool-provider.d.ts.map +0 -1
- package/dist/runtime/builtin-tool-provider.js.map +0 -1
- package/dist/runtime/capabilities/compiler.d.ts.map +0 -1
- package/dist/runtime/capabilities/compiler.js.map +0 -1
- package/dist/runtime/capabilities/index.d.ts.map +0 -1
- package/dist/runtime/capabilities/index.js.map +0 -1
- package/dist/runtime/capabilities/types.d.ts.map +0 -1
- package/dist/runtime/capabilities/types.js.map +0 -1
- package/dist/runtime/capability-receipt-journal.d.ts.map +0 -1
- package/dist/runtime/capability-receipt-journal.js.map +0 -1
- package/dist/runtime/capability-step-factory.d.ts.map +0 -1
- package/dist/runtime/capability-step-factory.js.map +0 -1
- package/dist/runtime/compact-transaction.d.ts.map +0 -1
- package/dist/runtime/compact-transaction.js.map +0 -1
- package/dist/runtime/composer/buffer.d.ts.map +0 -1
- package/dist/runtime/composer/buffer.js.map +0 -1
- package/dist/runtime/composer/grapheme.d.ts.map +0 -1
- package/dist/runtime/composer/grapheme.js.map +0 -1
- package/dist/runtime/composer/history.d.ts.map +0 -1
- package/dist/runtime/composer/history.js.map +0 -1
- package/dist/runtime/composer/layout.d.ts.map +0 -1
- package/dist/runtime/composer/layout.js.map +0 -1
- package/dist/runtime/core-tools/descriptors.d.ts.map +0 -1
- package/dist/runtime/core-tools/descriptors.js.map +0 -1
- package/dist/runtime/durable-tool-receipt-reader.d.ts.map +0 -1
- package/dist/runtime/durable-tool-receipt-reader.js.map +0 -1
- package/dist/runtime/first-party-core-provider.d.ts.map +0 -1
- package/dist/runtime/first-party-core-provider.js.map +0 -1
- package/dist/runtime/first-party-long-tail-provider.d.ts.map +0 -1
- package/dist/runtime/first-party-long-tail-provider.js.map +0 -1
- package/dist/runtime/first-party-tool-services.d.ts.map +0 -1
- package/dist/runtime/first-party-tool-services.js.map +0 -1
- package/dist/runtime/first-party-tool-universe.d.ts.map +0 -1
- package/dist/runtime/first-party-tool-universe.js.map +0 -1
- package/dist/runtime/goal-lifecycle-v2.d.ts.map +0 -1
- package/dist/runtime/goal-lifecycle-v2.js.map +0 -1
- package/dist/runtime/goal-runtime-coordinator.d.ts.map +0 -1
- package/dist/runtime/goal-runtime-coordinator.js.map +0 -1
- package/dist/runtime/goals/completion-audit.d.ts.map +0 -1
- package/dist/runtime/goals/completion-audit.js.map +0 -1
- package/dist/runtime/goals/evidence.d.ts.map +0 -1
- package/dist/runtime/goals/evidence.js.map +0 -1
- package/dist/runtime/goals/objective.d.ts.map +0 -1
- package/dist/runtime/goals/objective.js.map +0 -1
- package/dist/runtime/goals/presentation.d.ts.map +0 -1
- package/dist/runtime/goals/presentation.js.map +0 -1
- package/dist/runtime/goals/types.d.ts.map +0 -1
- package/dist/runtime/goals/types.js.map +0 -1
- package/dist/runtime/harness-confluence.d.ts.map +0 -1
- package/dist/runtime/harness-confluence.js.map +0 -1
- package/dist/runtime/harness-eval.d.ts.map +0 -1
- package/dist/runtime/harness-eval.js.map +0 -1
- package/dist/runtime/harness-metrics.d.ts.map +0 -1
- package/dist/runtime/harness-metrics.js.map +0 -1
- package/dist/runtime/legacy-session-importer.d.ts.map +0 -1
- package/dist/runtime/legacy-session-importer.js.map +0 -1
- package/dist/runtime/legacy-thread-materializer.d.ts.map +0 -1
- package/dist/runtime/legacy-thread-materializer.js.map +0 -1
- package/dist/runtime/long-tail-tools/descriptors.d.ts.map +0 -1
- package/dist/runtime/long-tail-tools/descriptors.js.map +0 -1
- package/dist/runtime/loop-budget.d.ts.map +0 -1
- package/dist/runtime/loop-budget.js.map +0 -1
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +0 -1
- package/dist/runtime/mcp/first-party-mcp-adapter.js.map +0 -1
- package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +0 -1
- package/dist/runtime/mcp/first-party-mcp-config.js.map +0 -1
- package/dist/runtime/mcp/index.d.ts.map +0 -1
- package/dist/runtime/mcp/index.js.map +0 -1
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +0 -1
- package/dist/runtime/mcp/lazy-mcp-runtime.js.map +0 -1
- package/dist/runtime/mcp/types.d.ts.map +0 -1
- package/dist/runtime/mcp/types.js.map +0 -1
- package/dist/runtime/model-coordinator.d.ts.map +0 -1
- package/dist/runtime/model-coordinator.js.map +0 -1
- package/dist/runtime/orion-runtime-v1.d.ts.map +0 -1
- package/dist/runtime/orion-runtime-v1.js.map +0 -1
- package/dist/runtime/orion-session-runner.d.ts.map +0 -1
- package/dist/runtime/orion-session-runner.js.map +0 -1
- package/dist/runtime/product-bootstrap.d.ts.map +0 -1
- package/dist/runtime/product-bootstrap.js.map +0 -1
- package/dist/runtime/product-orion-runtime.d.ts.map +0 -1
- package/dist/runtime/product-orion-runtime.js.map +0 -1
- package/dist/runtime/prompts/index.d.ts.map +0 -1
- package/dist/runtime/prompts/index.js.map +0 -1
- package/dist/runtime/prompts/prompt-registry.d.ts.map +0 -1
- package/dist/runtime/prompts/prompt-registry.js.map +0 -1
- package/dist/runtime/prompts/types.d.ts.map +0 -1
- package/dist/runtime/prompts/types.js.map +0 -1
- package/dist/runtime/protocol/canonical.d.ts.map +0 -1
- package/dist/runtime/protocol/canonical.js.map +0 -1
- package/dist/runtime/protocol/index.d.ts.map +0 -1
- package/dist/runtime/protocol/index.js.map +0 -1
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +0 -1
- package/dist/runtime/protocol/runtime-protocol-v1.js.map +0 -1
- package/dist/runtime/release-receipts.d.ts.map +0 -1
- package/dist/runtime/release-receipts.js.map +0 -1
- package/dist/runtime/resource-scope.d.ts.map +0 -1
- package/dist/runtime/resource-scope.js.map +0 -1
- package/dist/runtime/rich-text/ansi-parser.d.ts.map +0 -1
- package/dist/runtime/rich-text/ansi-parser.js.map +0 -1
- package/dist/runtime/rich-text/layout.d.ts.map +0 -1
- package/dist/runtime/rich-text/layout.js.map +0 -1
- package/dist/runtime/rich-text/markdown-parser.d.ts.map +0 -1
- package/dist/runtime/rich-text/markdown-parser.js.map +0 -1
- package/dist/runtime/rich-text/sanitizer.d.ts.map +0 -1
- package/dist/runtime/rich-text/sanitizer.js.map +0 -1
- package/dist/runtime/rich-text/types.d.ts.map +0 -1
- package/dist/runtime/rich-text/types.js.map +0 -1
- package/dist/runtime/runtime-event-buffer.d.ts.map +0 -1
- package/dist/runtime/runtime-event-buffer.js.map +0 -1
- package/dist/runtime/runtime-services.d.ts.map +0 -1
- package/dist/runtime/runtime-services.js.map +0 -1
- package/dist/runtime/session-history-recovery.d.ts.map +0 -1
- package/dist/runtime/session-history-recovery.js.map +0 -1
- package/dist/runtime/skills/bounded-lru-cache.d.ts.map +0 -1
- package/dist/runtime/skills/bounded-lru-cache.js.map +0 -1
- package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +0 -1
- package/dist/runtime/skills/filesystem-skill-provider.js.map +0 -1
- package/dist/runtime/skills/index.d.ts.map +0 -1
- package/dist/runtime/skills/index.js.map +0 -1
- package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +0 -1
- package/dist/runtime/skills/lazy-skill-runtime.js.map +0 -1
- package/dist/runtime/skills/types.d.ts.map +0 -1
- package/dist/runtime/skills/types.js.map +0 -1
- package/dist/runtime/step-snapshot.d.ts.map +0 -1
- package/dist/runtime/step-snapshot.js.map +0 -1
- package/dist/runtime/subagent-thread-runtime.d.ts.map +0 -1
- package/dist/runtime/subagent-thread-runtime.js.map +0 -1
- package/dist/runtime/subagents/budget.d.ts.map +0 -1
- package/dist/runtime/subagents/budget.js.map +0 -1
- package/dist/runtime/subagents/child-executor-guard.d.ts.map +0 -1
- package/dist/runtime/subagents/child-executor-guard.js.map +0 -1
- package/dist/runtime/subagents/context-builder.d.ts.map +0 -1
- package/dist/runtime/subagents/context-builder.js.map +0 -1
- package/dist/runtime/subagents/index.d.ts.map +0 -1
- package/dist/runtime/subagents/index.js.map +0 -1
- package/dist/runtime/subagents/parent-step-fork.d.ts.map +0 -1
- package/dist/runtime/subagents/parent-step-fork.js.map +0 -1
- package/dist/runtime/subagents/policy.d.ts.map +0 -1
- package/dist/runtime/subagents/policy.js.map +0 -1
- package/dist/runtime/subagents/presets.d.ts.map +0 -1
- package/dist/runtime/subagents/presets.js.map +0 -1
- package/dist/runtime/subagents/production.d.ts.map +0 -1
- package/dist/runtime/subagents/production.js.map +0 -1
- package/dist/runtime/subagents/provider-gate.d.ts.map +0 -1
- package/dist/runtime/subagents/provider-gate.js.map +0 -1
- package/dist/runtime/subagents/receipt-journal.d.ts.map +0 -1
- package/dist/runtime/subagents/receipt-journal.js.map +0 -1
- package/dist/runtime/subagents/research-artifact.d.ts.map +0 -1
- package/dist/runtime/subagents/research-artifact.js.map +0 -1
- package/dist/runtime/subagents/research-citation.d.ts.map +0 -1
- package/dist/runtime/subagents/research-citation.js.map +0 -1
- package/dist/runtime/subagents/research-contract.d.ts.map +0 -1
- package/dist/runtime/subagents/research-contract.js.map +0 -1
- package/dist/runtime/subagents/research-quality.d.ts.map +0 -1
- package/dist/runtime/subagents/research-quality.js.map +0 -1
- package/dist/runtime/subagents/research-renderer.d.ts.map +0 -1
- package/dist/runtime/subagents/research-renderer.js.map +0 -1
- package/dist/runtime/subagents/research-types.d.ts.map +0 -1
- package/dist/runtime/subagents/research-types.js.map +0 -1
- package/dist/runtime/subagents/result-parser.d.ts.map +0 -1
- package/dist/runtime/subagents/result-parser.js.map +0 -1
- package/dist/runtime/subagents/runner.d.ts.map +0 -1
- package/dist/runtime/subagents/runner.js.map +0 -1
- package/dist/runtime/subagents/runtime-contract.d.ts.map +0 -1
- package/dist/runtime/subagents/runtime-contract.js.map +0 -1
- package/dist/runtime/subagents/runtime-integration.d.ts.map +0 -1
- package/dist/runtime/subagents/runtime-integration.js.map +0 -1
- package/dist/runtime/subagents/supervisor.d.ts.map +0 -1
- package/dist/runtime/subagents/supervisor.js.map +0 -1
- package/dist/runtime/subagents/tool.d.ts.map +0 -1
- package/dist/runtime/subagents/tool.js.map +0 -1
- package/dist/runtime/subagents/types.d.ts.map +0 -1
- package/dist/runtime/subagents/types.js.map +0 -1
- package/dist/runtime/subagents/web-research-adapter.d.ts.map +0 -1
- package/dist/runtime/subagents/web-research-adapter.js.map +0 -1
- package/dist/runtime/task-context-service.d.ts.map +0 -1
- package/dist/runtime/task-context-service.js.map +0 -1
- package/dist/runtime/thread-admission.d.ts.map +0 -1
- package/dist/runtime/thread-admission.js.map +0 -1
- package/dist/runtime/thread-compact-persistence.d.ts.map +0 -1
- package/dist/runtime/thread-compact-persistence.js.map +0 -1
- package/dist/runtime/thread-event-store.d.ts.map +0 -1
- package/dist/runtime/thread-event-store.js.map +0 -1
- package/dist/runtime/thread-projection.d.ts.map +0 -1
- package/dist/runtime/thread-projection.js.map +0 -1
- package/dist/runtime/thread-runtime.d.ts.map +0 -1
- package/dist/runtime/thread-runtime.js.map +0 -1
- package/dist/runtime/thread-session-index.d.ts.map +0 -1
- package/dist/runtime/thread-session-index.js.map +0 -1
- package/dist/runtime/thread-session-view.d.ts.map +0 -1
- package/dist/runtime/thread-session-view.js.map +0 -1
- package/dist/runtime/thread-tool-journal.d.ts.map +0 -1
- package/dist/runtime/thread-tool-journal.js.map +0 -1
- package/dist/runtime/thread-ui-adapter.d.ts.map +0 -1
- package/dist/runtime/thread-ui-adapter.js.map +0 -1
- package/dist/runtime/tool-detail-repository.d.ts.map +0 -1
- package/dist/runtime/tool-detail-repository.js.map +0 -1
- package/dist/runtime/tool-gateway.d.ts.map +0 -1
- package/dist/runtime/tool-gateway.js.map +0 -1
- package/dist/runtime/tool-output-presentation.d.ts.map +0 -1
- package/dist/runtime/tool-output-presentation.js.map +0 -1
- package/dist/runtime/tool-receipt-validator.d.ts.map +0 -1
- package/dist/runtime/tool-receipt-validator.js.map +0 -1
- package/dist/runtime/turn-commit.d.ts.map +0 -1
- package/dist/runtime/turn-commit.js.map +0 -1
- package/dist/runtime/turn-controller.d.ts.map +0 -1
- package/dist/runtime/turn-controller.js.map +0 -1
- package/dist/runtime/ui-events.d.ts.map +0 -1
- package/dist/runtime/ui-events.js.map +0 -1
- package/dist/runtime/ui-view-model.d.ts.map +0 -1
- package/dist/runtime/ui-view-model.js.map +0 -1
- package/dist/services/atomic-write.d.ts.map +0 -1
- package/dist/services/atomic-write.js.map +0 -1
- package/dist/services/auth/auth.d.ts.map +0 -1
- package/dist/services/auth/auth.js.map +0 -1
- package/dist/services/auth/aws.d.ts.map +0 -1
- package/dist/services/auth/aws.js.map +0 -1
- package/dist/services/auth/index.d.ts.map +0 -1
- package/dist/services/auth/index.js.map +0 -1
- package/dist/services/auto-fix/autoFixConfig.d.ts.map +0 -1
- package/dist/services/auto-fix/autoFixConfig.js.map +0 -1
- package/dist/services/auto-fix/autoFixHook.d.ts.map +0 -1
- package/dist/services/auto-fix/autoFixHook.js.map +0 -1
- package/dist/services/auto-fix/autoFixRunner.d.ts.map +0 -1
- package/dist/services/auto-fix/autoFixRunner.js.map +0 -1
- package/dist/services/auto-fix/index.d.ts.map +0 -1
- package/dist/services/auto-fix/index.js.map +0 -1
- package/dist/services/bounded-response.d.ts.map +0 -1
- package/dist/services/bounded-response.js.map +0 -1
- package/dist/services/commit-plan.d.ts.map +0 -1
- package/dist/services/commit-plan.js.map +0 -1
- package/dist/services/compact/auto-compact.d.ts.map +0 -1
- package/dist/services/compact/auto-compact.js.map +0 -1
- package/dist/services/compact/compact.d.ts.map +0 -1
- package/dist/services/compact/compact.js.map +0 -1
- package/dist/services/compact/coordinator.d.ts.map +0 -1
- package/dist/services/compact/coordinator.js.map +0 -1
- package/dist/services/compact/fingerprint.d.ts.map +0 -1
- package/dist/services/compact/fingerprint.js.map +0 -1
- package/dist/services/compact/index.d.ts.map +0 -1
- package/dist/services/compact/index.js.map +0 -1
- package/dist/services/compact/planner.d.ts.map +0 -1
- package/dist/services/compact/planner.js.map +0 -1
- package/dist/services/compact/semantic-summary.d.ts.map +0 -1
- package/dist/services/compact/semantic-summary.js.map +0 -1
- package/dist/services/compact/summary-generator.d.ts.map +0 -1
- package/dist/services/compact/summary-generator.js.map +0 -1
- package/dist/services/compact/tool-call-groups.d.ts.map +0 -1
- package/dist/services/compact/tool-call-groups.js.map +0 -1
- package/dist/services/concurrent-sessions.d.ts.map +0 -1
- package/dist/services/concurrent-sessions.js.map +0 -1
- package/dist/services/config-dir.d.ts.map +0 -1
- package/dist/services/config-dir.js.map +0 -1
- package/dist/services/config.d.ts.map +0 -1
- package/dist/services/config.js.map +0 -1
- package/dist/services/diagnostic-tracking/diagnosticTracking.d.ts.map +0 -1
- package/dist/services/diagnostic-tracking/diagnosticTracking.js.map +0 -1
- package/dist/services/diagnostic-tracking/formatter.d.ts.map +0 -1
- package/dist/services/diagnostic-tracking/formatter.js.map +0 -1
- package/dist/services/diagnostic-tracking/index.d.ts.map +0 -1
- package/dist/services/diagnostic-tracking/index.js.map +0 -1
- package/dist/services/diagnostic-tracking/types.d.ts.map +0 -1
- package/dist/services/diagnostic-tracking/types.js.map +0 -1
- package/dist/services/doctor.d.ts.map +0 -1
- package/dist/services/doctor.js.map +0 -1
- package/dist/services/effort.d.ts.map +0 -1
- package/dist/services/effort.js.map +0 -1
- package/dist/services/file-context.d.ts.map +0 -1
- package/dist/services/file-context.js.map +0 -1
- package/dist/services/file-glob.d.ts.map +0 -1
- package/dist/services/file-glob.js.map +0 -1
- package/dist/services/file-lock.d.ts.map +0 -1
- package/dist/services/file-lock.js.map +0 -1
- package/dist/services/format.d.ts.map +0 -1
- package/dist/services/format.js.map +0 -1
- package/dist/services/global-config.d.ts.map +0 -1
- package/dist/services/global-config.js.map +0 -1
- package/dist/services/goal-storage.d.ts.map +0 -1
- package/dist/services/goal-storage.js.map +0 -1
- package/dist/services/llm.d.ts.map +0 -1
- package/dist/services/llm.js.map +0 -1
- package/dist/services/mcp/index.d.ts.map +0 -1
- package/dist/services/mcp/index.js.map +0 -1
- package/dist/services/mcp/transports.d.ts.map +0 -1
- package/dist/services/mcp/transports.js.map +0 -1
- package/dist/services/memory.d.ts.map +0 -1
- package/dist/services/memory.js.map +0 -1
- package/dist/services/model-catalog.d.ts.map +0 -1
- package/dist/services/model-catalog.js.map +0 -1
- package/dist/services/model-client-pool.d.ts.map +0 -1
- package/dist/services/model-client-pool.js.map +0 -1
- package/dist/services/model-context.d.ts.map +0 -1
- package/dist/services/model-context.js.map +0 -1
- package/dist/services/model-registry.d.ts.map +0 -1
- package/dist/services/model-registry.js.map +0 -1
- package/dist/services/project-instructions.d.ts.map +0 -1
- package/dist/services/project-instructions.js.map +0 -1
- package/dist/services/prompt-context.d.ts.map +0 -1
- package/dist/services/prompt-context.js.map +0 -1
- package/dist/services/provider-diagnostics.d.ts.map +0 -1
- package/dist/services/provider-diagnostics.js.map +0 -1
- package/dist/services/provider-resilience/circuit-breaker.d.ts.map +0 -1
- package/dist/services/provider-resilience/circuit-breaker.js.map +0 -1
- package/dist/services/provider-resilience/coordinator.d.ts.map +0 -1
- package/dist/services/provider-resilience/coordinator.js.map +0 -1
- package/dist/services/provider-resilience/error-classifier.d.ts.map +0 -1
- package/dist/services/provider-resilience/error-classifier.js.map +0 -1
- package/dist/services/provider-resilience/index.d.ts.map +0 -1
- package/dist/services/provider-resilience/index.js.map +0 -1
- package/dist/services/provider-resilience/request-gate.d.ts.map +0 -1
- package/dist/services/provider-resilience/request-gate.js.map +0 -1
- package/dist/services/provider-resilience/stream-recovery.d.ts.map +0 -1
- package/dist/services/provider-resilience/stream-recovery.js.map +0 -1
- package/dist/services/provider-resilience/types.d.ts.map +0 -1
- package/dist/services/provider-resilience/types.js.map +0 -1
- package/dist/services/redaction.d.ts.map +0 -1
- package/dist/services/redaction.js.map +0 -1
- package/dist/services/safe-project-reader.d.ts.map +0 -1
- package/dist/services/safe-project-reader.js.map +0 -1
- package/dist/services/session-index.d.ts.map +0 -1
- package/dist/services/session-index.js.map +0 -1
- package/dist/services/session-memory/index.d.ts.map +0 -1
- package/dist/services/session-memory/index.js.map +0 -1
- package/dist/services/session-memory/prompts.d.ts.map +0 -1
- package/dist/services/session-memory/prompts.js.map +0 -1
- package/dist/services/session-memory/sessionMemory.d.ts.map +0 -1
- package/dist/services/session-memory/sessionMemory.js.map +0 -1
- package/dist/services/session-storage.d.ts.map +0 -1
- package/dist/services/session-storage.js.map +0 -1
- package/dist/services/settings-coordinator.d.ts.map +0 -1
- package/dist/services/settings-coordinator.js.map +0 -1
- package/dist/services/settings-document-repository.d.ts.map +0 -1
- package/dist/services/settings-document-repository.js.map +0 -1
- package/dist/services/smart-routing.d.ts.map +0 -1
- package/dist/services/smart-routing.js.map +0 -1
- package/dist/services/storage-maintenance.d.ts.map +0 -1
- package/dist/services/storage-maintenance.js.map +0 -1
- package/dist/services/tool-allowlist.d.ts.map +0 -1
- package/dist/services/tool-allowlist.js.map +0 -1
- package/dist/services/usage-state.d.ts.map +0 -1
- package/dist/services/usage-state.js.map +0 -1
- package/dist/services/verification-profile.d.ts.map +0 -1
- package/dist/services/verification-profile.js.map +0 -1
- package/dist/services/web-search-adapters.d.ts.map +0 -1
- package/dist/services/web-search-adapters.js.map +0 -1
- package/dist/services/web-search-mcp.d.ts.map +0 -1
- package/dist/services/web-search-mcp.js.map +0 -1
- package/dist/services/web-search-provider.d.ts.map +0 -1
- package/dist/services/web-search-provider.js.map +0 -1
- package/dist/services/workspace-containment.d.ts.map +0 -1
- package/dist/services/workspace-containment.js.map +0 -1
- package/dist/services/workspace-diff.d.ts.map +0 -1
- package/dist/services/workspace-diff.js.map +0 -1
- package/dist/services/workspace-registry.d.ts.map +0 -1
- package/dist/services/workspace-registry.js.map +0 -1
- package/dist/services/workspace-state.d.ts.map +0 -1
- package/dist/services/workspace-state.js.map +0 -1
- package/dist/services/yaml-config.d.ts.map +0 -1
- package/dist/services/yaml-config.js.map +0 -1
- package/dist/terminal-ui/completion.d.ts.map +0 -1
- package/dist/terminal-ui/completion.js.map +0 -1
- package/dist/terminal-ui/editor.d.ts.map +0 -1
- package/dist/terminal-ui/editor.js.map +0 -1
- package/dist/terminal-ui/launch.d.ts.map +0 -1
- package/dist/terminal-ui/launch.js.map +0 -1
- package/dist/terminal-ui/output-queue.d.ts.map +0 -1
- package/dist/terminal-ui/output-queue.js.map +0 -1
- package/dist/terminal-ui/raw-editor.d.ts.map +0 -1
- package/dist/terminal-ui/raw-editor.js.map +0 -1
- package/dist/tools/_validate.d.ts.map +0 -1
- package/dist/tools/_validate.js.map +0 -1
- package/dist/tools/bash_security.d.ts.map +0 -1
- package/dist/tools/bash_security.js.map +0 -1
- package/dist/tools/core/common.d.ts.map +0 -1
- package/dist/tools/core/common.js.map +0 -1
- package/dist/tools/core/edit-file.d.ts.map +0 -1
- package/dist/tools/core/edit-file.js.map +0 -1
- package/dist/tools/core/exec-command.d.ts.map +0 -1
- package/dist/tools/core/exec-command.js.map +0 -1
- package/dist/tools/core/glob.d.ts.map +0 -1
- package/dist/tools/core/glob.js.map +0 -1
- package/dist/tools/core/grep.d.ts.map +0 -1
- package/dist/tools/core/grep.js.map +0 -1
- package/dist/tools/core/index.d.ts.map +0 -1
- package/dist/tools/core/index.js.map +0 -1
- package/dist/tools/core/list-files.d.ts.map +0 -1
- package/dist/tools/core/list-files.js.map +0 -1
- package/dist/tools/core/read-file.d.ts.map +0 -1
- package/dist/tools/core/read-file.js.map +0 -1
- package/dist/tools/core/write-file.d.ts.map +0 -1
- package/dist/tools/core/write-file.js.map +0 -1
- package/dist/tools/git.d.ts.map +0 -1
- package/dist/tools/git.js.map +0 -1
- package/dist/tools/lsp.d.ts.map +0 -1
- package/dist/tools/lsp.js.map +0 -1
- package/dist/tools/sandbox.d.ts.map +0 -1
- package/dist/tools/sandbox.js.map +0 -1
- package/dist/tools/todo.d.ts.map +0 -1
- package/dist/tools/todo.js.map +0 -1
- package/dist/tools/web.d.ts.map +0 -1
- package/dist/tools/web.js.map +0 -1
- package/dist/tui-core/frame.d.ts.map +0 -1
- package/dist/tui-core/frame.js.map +0 -1
- package/dist/tui-core/input-parser.d.ts.map +0 -1
- package/dist/tui-core/input-parser.js.map +0 -1
- package/dist/tui-core/style.d.ts.map +0 -1
- package/dist/tui-core/style.js.map +0 -1
- package/dist/tui-core/terminal-writer.d.ts.map +0 -1
- package/dist/tui-core/terminal-writer.js.map +0 -1
- package/dist/tui-ui/chrome-view-model.d.ts.map +0 -1
- package/dist/tui-ui/chrome-view-model.js.map +0 -1
- package/dist/tui-ui/inline-surface.d.ts.map +0 -1
- package/dist/tui-ui/inline-surface.js.map +0 -1
- package/dist/tui-ui/input-ownership.d.ts.map +0 -1
- package/dist/tui-ui/input-ownership.js.map +0 -1
- package/dist/tui-ui/launch.d.ts.map +0 -1
- package/dist/tui-ui/launch.js.map +0 -1
- package/dist/tui-ui/layout.d.ts.map +0 -1
- package/dist/tui-ui/layout.js.map +0 -1
- package/dist/tui-ui/pickers.d.ts.map +0 -1
- package/dist/tui-ui/pickers.js.map +0 -1
- package/dist/tui-ui/pixel-mascot.d.ts.map +0 -1
- package/dist/tui-ui/pixel-mascot.js.map +0 -1
- package/dist/tui-ui/render-scheduler.d.ts.map +0 -1
- package/dist/tui-ui/render-scheduler.js.map +0 -1
- package/dist/tui-ui/runner.d.ts.map +0 -1
- package/dist/tui-ui/runner.js.map +0 -1
- package/dist/tui-ui/state.d.ts.map +0 -1
- package/dist/tui-ui/state.js.map +0 -1
- package/dist/tui-ui/terminal-image.d.ts.map +0 -1
- package/dist/tui-ui/terminal-image.js.map +0 -1
- package/dist/tui-ui/theme-profile.d.ts.map +0 -1
- package/dist/tui-ui/theme-profile.js.map +0 -1
- package/dist/tui-ui/theme.d.ts.map +0 -1
- package/dist/tui-ui/theme.js.map +0 -1
- package/dist/tui-ui/transcript-cache.d.ts.map +0 -1
- package/dist/tui-ui/transcript-cache.js.map +0 -1
- package/dist/tui-ui/transcript-inspector-layout.d.ts.map +0 -1
- package/dist/tui-ui/transcript-inspector-layout.js.map +0 -1
- package/dist/tui-ui/transcript-inspector-surface.d.ts.map +0 -1
- package/dist/tui-ui/transcript-inspector-surface.js.map +0 -1
- package/dist/tui-ui/transcript-inspector.d.ts.map +0 -1
- package/dist/tui-ui/transcript-inspector.js.map +0 -1
- package/dist/tui-ui/transcript-layout.d.ts.map +0 -1
- package/dist/tui-ui/transcript-layout.js.map +0 -1
- package/dist/ui/box.d.ts.map +0 -1
- package/dist/ui/box.js.map +0 -1
- package/dist/ui/command-panel.d.ts.map +0 -1
- package/dist/ui/command-panel.js.map +0 -1
- package/dist/ui/file-completion.d.ts.map +0 -1
- package/dist/ui/file-completion.js.map +0 -1
- package/dist/ui/markdown.d.ts.map +0 -1
- package/dist/ui/markdown.js.map +0 -1
- package/dist/ui/multiline-input.d.ts.map +0 -1
- package/dist/ui/multiline-input.js.map +0 -1
- package/dist/ui/progress.d.ts.map +0 -1
- package/dist/ui/progress.js.map +0 -1
- package/dist/ui/shared/command-palette.d.ts.map +0 -1
- package/dist/ui/shared/command-palette.js.map +0 -1
- package/dist/ui/shared/command-suggestions.d.ts.map +0 -1
- package/dist/ui/shared/command-suggestions.js.map +0 -1
- package/dist/ui/shared/input-frame.d.ts.map +0 -1
- package/dist/ui/shared/input-frame.js.map +0 -1
- package/dist/ui/shared/text.d.ts.map +0 -1
- package/dist/ui/shared/text.js.map +0 -1
- package/dist/ui/shared/types.d.ts.map +0 -1
- package/dist/ui/shared/types.js.map +0 -1
- package/dist/ui/status-bar.d.ts.map +0 -1
- package/dist/ui/status-bar.js.map +0 -1
- package/dist/ui/stream-markdown.d.ts.map +0 -1
- package/dist/ui/stream-markdown.js.map +0 -1
- package/dist/ui/suggestions.d.ts.map +0 -1
- package/dist/ui/suggestions.js.map +0 -1
- package/dist/ui/tool-preview.d.ts.map +0 -1
- package/dist/ui/tool-preview.js.map +0 -1
- package/dist/ui/user-input.d.ts.map +0 -1
- package/dist/ui/user-input.js.map +0 -1
- package/dist/utils/debug-log.d.ts.map +0 -1
- package/dist/utils/debug-log.js.map +0 -1
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json.js.map +0 -1
- package/dist/utils/mask.d.ts.map +0 -1
- package/dist/utils/mask.js.map +0 -1
- package/dist/utils/observability.d.ts.map +0 -1
- package/dist/utils/observability.js.map +0 -1
- package/dist/utils/token-estimate.d.ts.map +0 -1
- package/dist/utils/token-estimate.js.map +0 -1
- package/dist/web/errors.d.ts.map +0 -1
- package/dist/web/errors.js.map +0 -1
- package/dist/web/event-hub.d.ts.map +0 -1
- package/dist/web/event-hub.js.map +0 -1
- package/dist/web/file-read-service.d.ts.map +0 -1
- package/dist/web/file-read-service.js.map +0 -1
- package/dist/web/git-read-model-service.d.ts.map +0 -1
- package/dist/web/git-read-model-service.js.map +0 -1
- package/dist/web/index.d.ts.map +0 -1
- package/dist/web/index.js.map +0 -1
- package/dist/web/launch.d.ts.map +0 -1
- package/dist/web/launch.js.map +0 -1
- package/dist/web/protocol.d.ts.map +0 -1
- package/dist/web/protocol.js.map +0 -1
- package/dist/web/review-service.d.ts.map +0 -1
- package/dist/web/review-service.js.map +0 -1
- package/dist/web/server.d.ts.map +0 -1
- package/dist/web/server.js.map +0 -1
- package/dist/web/terminal-manager.d.ts.map +0 -1
- package/dist/web/terminal-manager.js.map +0 -1
- package/dist/web/terminal-server.d.ts.map +0 -1
- package/dist/web/terminal-server.js.map +0 -1
- package/dist/web/workbench-controller.d.ts.map +0 -1
- package/dist/web/workbench-controller.js.map +0 -1
- package/dist/web-client/assets/FilesPanel-BkoLmgjR.js +0 -2
- package/dist/web-client/assets/ReviewPanel-3MVWbMQV.js +0 -1
- package/dist/web-client/assets/index-BkIDl_xk.js +0 -16
- package/dist/web-client/assets/index-DXMpnWE8.css +0 -1
|
@@ -11,11 +11,15 @@ const durable_tool_receipt_reader_1 = require("../runtime/durable-tool-receipt-r
|
|
|
11
11
|
const mcp_1 = require("../runtime/mcp");
|
|
12
12
|
const product_bootstrap_1 = require("../runtime/product-bootstrap");
|
|
13
13
|
const canonical_1 = require("../runtime/protocol/canonical");
|
|
14
|
+
const plan_review_1 = require("../runtime/plan-review");
|
|
15
|
+
const thread_event_store_1 = require("../runtime/thread-event-store");
|
|
14
16
|
const thread_session_index_1 = require("../runtime/thread-session-index");
|
|
15
17
|
const thread_session_view_1 = require("../runtime/thread-session-view");
|
|
16
18
|
const tool_detail_repository_1 = require("../runtime/tool-detail-repository");
|
|
17
19
|
const turn_commit_1 = require("../runtime/turn-commit");
|
|
20
|
+
const session_composer_control_1 = require("../runtime/session-composer-control");
|
|
18
21
|
const global_config_1 = require("../services/global-config");
|
|
22
|
+
const redaction_1 = require("../services/redaction");
|
|
19
23
|
const settings_coordinator_1 = require("../services/settings-coordinator");
|
|
20
24
|
const session_storage_1 = require("../services/session-storage");
|
|
21
25
|
const workspace_registry_1 = require("../services/workspace-registry");
|
|
@@ -23,28 +27,42 @@ const errors_1 = require("./errors");
|
|
|
23
27
|
const event_hub_1 = require("./event-hub");
|
|
24
28
|
const file_read_service_1 = require("./file-read-service");
|
|
25
29
|
const git_read_model_service_1 = require("./git-read-model-service");
|
|
30
|
+
const workspace_mutation_arbiter_1 = require("./workspace-mutation-arbiter");
|
|
26
31
|
const protocol_1 = require("./protocol");
|
|
27
32
|
const review_service_1 = require("./review-service");
|
|
33
|
+
const session_runtime_registry_1 = require("./session-runtime-registry");
|
|
28
34
|
const terminal_manager_1 = require("./terminal-manager");
|
|
29
35
|
var errors_2 = require("./errors");
|
|
30
36
|
Object.defineProperty(exports, "WebWorkbenchError", { enumerable: true, get: function () { return errors_2.WebWorkbenchError; } });
|
|
31
37
|
const SESSION_VIEW_CACHE_BYTES = 16 * 1024 * 1024;
|
|
32
38
|
const MAX_MUTATION_RESULTS = 4096;
|
|
33
|
-
|
|
39
|
+
const MAX_CONTEXT_REFERENCE_BYTES = 64 * 1024;
|
|
40
|
+
const MAX_CONTEXT_MANIFEST_BYTES = 256 * 1024;
|
|
41
|
+
const CONTEXT_TRANSITION_MUTATIONS = new Set(['context.activate', 'workspace.activate']);
|
|
42
|
+
/** Owns the Workspace surface plus the bounded Web Session actor registry. */
|
|
34
43
|
class WebWorkbenchController {
|
|
35
44
|
constructor(options) {
|
|
45
|
+
this.activeOrionRuntimes = new Map();
|
|
36
46
|
this.mutationResults = new Map();
|
|
37
47
|
this.sessionViews = new Map();
|
|
38
48
|
this.sessionViewBytes = 0;
|
|
39
49
|
this.toolDetails = new tool_detail_repository_1.FileToolDetailRepository();
|
|
50
|
+
this.workspaceMutationOwners = new Map();
|
|
51
|
+
this.pendingWorkspaceMutationStates = new Map();
|
|
40
52
|
this.contextRevisionValue = (0, crypto_1.randomUUID)();
|
|
53
|
+
this.composerRevisionValue = (0, crypto_1.randomUUID)();
|
|
54
|
+
this.suppressComposerEdges = 0;
|
|
41
55
|
this.suppressContextEdges = 0;
|
|
42
56
|
this.latestStatus = 'Ready';
|
|
43
|
-
this.
|
|
57
|
+
this.activeMutationCount = 0;
|
|
58
|
+
this.contextTransitionReserved = false;
|
|
44
59
|
this.closed = false;
|
|
45
60
|
this.workspaceWatchers = [];
|
|
46
61
|
this.workspaceValue = canonicalDirectory(options.cwd);
|
|
47
62
|
this.eventHub = options.eventHub ?? new event_hub_1.WebEventHub();
|
|
63
|
+
this.workspaceMutations = new workspace_mutation_arbiter_1.WorkspaceMutationArbiterV1({
|
|
64
|
+
onStateChanged: state => this.emitWorkspaceMutationState(state),
|
|
65
|
+
});
|
|
48
66
|
this.workspaceRegistry = options.workspaceRegistry ?? new workspace_registry_1.WorkspaceRegistryV1();
|
|
49
67
|
this.terminalManager = new terminal_manager_1.TerminalManagerV1({
|
|
50
68
|
resolveWorkspace: workspaceId => this.workspaceRegistry.find(workspaceId)?.canonicalPath,
|
|
@@ -62,6 +80,7 @@ class WebWorkbenchController {
|
|
|
62
80
|
options.createRuntime ??
|
|
63
81
|
(cwd => (0, product_bootstrap_1.createProductUiRuntime)({
|
|
64
82
|
cwd,
|
|
83
|
+
workspaceMutationCoordinator: this.workspaceMutations,
|
|
65
84
|
shutdownReason: 'Orion Web Workbench shutdown',
|
|
66
85
|
onActiveSessionRuntime: (runtime, sessionId, activation) => this.observeThreadRuntime(runtime, sessionId, activation),
|
|
67
86
|
onSettingsInvalidated: event => {
|
|
@@ -75,6 +94,17 @@ class WebWorkbenchController {
|
|
|
75
94
|
}, false);
|
|
76
95
|
},
|
|
77
96
|
}));
|
|
97
|
+
this.createSessionRuntime =
|
|
98
|
+
options.createSessionRuntime ??
|
|
99
|
+
options.createRuntime ??
|
|
100
|
+
(cwd => (0, product_bootstrap_1.createProductUiRuntime)({
|
|
101
|
+
cwd,
|
|
102
|
+
workspaceRuntimeKernel: this.runtimeValue.workspaceRuntimeKernel,
|
|
103
|
+
workspaceMutationCoordinator: this.workspaceMutations,
|
|
104
|
+
shutdownReason: 'Orion Web Session actor shutdown',
|
|
105
|
+
onActiveSessionRuntime: (runtime, sessionId, activation) => this.observeThreadRuntime(runtime, sessionId, activation),
|
|
106
|
+
}));
|
|
107
|
+
this.sessionRegistry = this.createSessionRegistry();
|
|
78
108
|
}
|
|
79
109
|
static async create(options) {
|
|
80
110
|
const workbench = new WebWorkbenchController(options);
|
|
@@ -131,18 +161,15 @@ class WebWorkbenchController {
|
|
|
131
161
|
throw mapSettingsError(error);
|
|
132
162
|
}
|
|
133
163
|
}
|
|
134
|
-
listWorkspaces() {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return Object.freeze(this.workspaceRegistry.list().map(entry => {
|
|
164
|
+
listWorkspaces(context) {
|
|
165
|
+
if (context)
|
|
166
|
+
this.assertContextGuard(context);
|
|
167
|
+
// Session metadata is canonicalized before it enters the catalog. The
|
|
168
|
+
// summary read model deliberately avoids sorting Sessions or re-running
|
|
169
|
+
// realpath/stat for every historical entry. Availability is checked once
|
|
170
|
+
// per registered Workspace below.
|
|
171
|
+
const counts = (0, session_storage_1.countSessionsByProject)();
|
|
172
|
+
const result = Object.freeze(this.workspaceRegistry.list().map(entry => {
|
|
146
173
|
let available = false;
|
|
147
174
|
try {
|
|
148
175
|
available = canonicalDirectory(entry.canonicalPath) === entry.canonicalPath;
|
|
@@ -161,8 +188,13 @@ class WebWorkbenchController {
|
|
|
161
188
|
...(entry.pinnedOrder !== undefined ? { pinnedOrder: entry.pinnedOrder } : {}),
|
|
162
189
|
});
|
|
163
190
|
}));
|
|
191
|
+
if (context)
|
|
192
|
+
this.assertContextGuard(context);
|
|
193
|
+
return result;
|
|
164
194
|
}
|
|
165
|
-
listWorkspaceSessions(workspaceId) {
|
|
195
|
+
listWorkspaceSessions(workspaceId, context) {
|
|
196
|
+
if (context)
|
|
197
|
+
this.assertContextGuard(context);
|
|
166
198
|
const entry = this.workspaceRegistry.find(workspaceId);
|
|
167
199
|
if (!entry) {
|
|
168
200
|
throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
|
|
@@ -173,9 +205,14 @@ class WebWorkbenchController {
|
|
|
173
205
|
catch {
|
|
174
206
|
throw new errors_1.WebWorkbenchError(409, 'Workspace is unavailable.', 'workspace_unavailable');
|
|
175
207
|
}
|
|
176
|
-
|
|
208
|
+
const result = Object.freeze((0, session_storage_1.listProjectSessions)(entry.canonicalPath).map(protocol_1.projectSessionSummary));
|
|
209
|
+
if (context)
|
|
210
|
+
this.assertContextGuard(context);
|
|
211
|
+
return result;
|
|
177
212
|
}
|
|
178
|
-
async workspaceProjectSummary(workspaceId) {
|
|
213
|
+
async workspaceProjectSummary(workspaceId, context) {
|
|
214
|
+
if (context)
|
|
215
|
+
this.assertContextGuard(context);
|
|
179
216
|
const entry = this.workspaceRegistry.find(workspaceId);
|
|
180
217
|
if (!entry) {
|
|
181
218
|
throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
|
|
@@ -188,7 +225,7 @@ class WebWorkbenchController {
|
|
|
188
225
|
throw new errors_1.WebWorkbenchError(409, 'Workspace is unavailable.', 'workspace_unavailable');
|
|
189
226
|
}
|
|
190
227
|
const status = await new git_read_model_service_1.GitReadModelServiceV1(workspace).status({ pageSize: 2000 });
|
|
191
|
-
|
|
228
|
+
const result = Object.freeze({
|
|
192
229
|
workspaceId,
|
|
193
230
|
repositoryRevision: status.repositoryRevision,
|
|
194
231
|
isRepository: status.isRepository,
|
|
@@ -198,6 +235,9 @@ class WebWorkbenchController {
|
|
|
198
235
|
dirtyCount: status.totalFiles,
|
|
199
236
|
conflictCount: status.conflicted.length,
|
|
200
237
|
});
|
|
238
|
+
if (context)
|
|
239
|
+
this.assertContextGuard(context);
|
|
240
|
+
return result;
|
|
201
241
|
}
|
|
202
242
|
setWorkspacePinned(workspaceId, pinned, context) {
|
|
203
243
|
this.assertContextGuard(context);
|
|
@@ -242,10 +282,12 @@ class WebWorkbenchController {
|
|
|
242
282
|
if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
|
|
243
283
|
throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
|
|
244
284
|
}
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
285
|
+
const key = this.sessionActorKey(session);
|
|
286
|
+
const resident = this.sessionRegistry.residentActor(key);
|
|
287
|
+
const actor = resident?.actor;
|
|
288
|
+
const baseSessionRuntime = resident?.runtime ?? this.sessionRegistry.summary(key);
|
|
289
|
+
const active = actor !== undefined;
|
|
290
|
+
const activeProjection = this.activeOrionRuntimes.get(session.id)?.thread.getProjection();
|
|
249
291
|
let indexedPage;
|
|
250
292
|
if (tail) {
|
|
251
293
|
try {
|
|
@@ -335,13 +377,26 @@ class WebWorkbenchController {
|
|
|
335
377
|
: [];
|
|
336
378
|
const commits = commitProjections.map(commit => (0, turn_commit_1.parseTurnCommitV1)(commit.receipt));
|
|
337
379
|
const latestCommit = commits.at(-1);
|
|
380
|
+
const latestProjectedTurn = activeProjection
|
|
381
|
+
? Object.values(activeProjection.turns)
|
|
382
|
+
.sort((left, right) => left.startedSeq - right.startedSeq)
|
|
383
|
+
.at(-1)
|
|
384
|
+
: undefined;
|
|
385
|
+
const durableTerminal = latestProjectedTurn?.status ?? indexedPage?.latestTurn?.status ?? latestCommit?.terminal;
|
|
386
|
+
const recoverableTerminalPhase = durableTerminal === 'interrupted' || durableTerminal === 'failed'
|
|
387
|
+
? durableTerminal
|
|
388
|
+
: undefined;
|
|
389
|
+
const sessionRuntime = recoverableTerminalPhase &&
|
|
390
|
+
['cold', 'idle', 'interrupted', 'failed'].includes(baseSessionRuntime.phase)
|
|
391
|
+
? Object.freeze({ ...baseSessionRuntime, phase: recoverableTerminalPhase })
|
|
392
|
+
: baseSessionRuntime;
|
|
338
393
|
const planCommit = [...commits].reverse().find(commit => commit.planReceipt);
|
|
339
394
|
const plan = planCommit?.planReceipt
|
|
340
395
|
? pickPlanReceipt((0, turn_commit_1.parsePlanReceiptV1)(planCommit.planReceipt))
|
|
341
396
|
: null;
|
|
342
|
-
const state = this.runtimeValue.store.getSnapshot();
|
|
397
|
+
const state = (actor?.runtime ?? this.runtimeValue).store.getSnapshot();
|
|
343
398
|
const pendingPermissions = active
|
|
344
|
-
?
|
|
399
|
+
? actor.controller.getPendingPermissions().map(request => ({
|
|
345
400
|
id: request.id,
|
|
346
401
|
toolName: request.name,
|
|
347
402
|
...(request.reason ? { reason: request.reason } : {}),
|
|
@@ -357,9 +412,16 @@ class WebWorkbenchController {
|
|
|
357
412
|
state: JSON.parse(latestCommit.goalState),
|
|
358
413
|
}
|
|
359
414
|
: null;
|
|
415
|
+
const projectedComposer = actor
|
|
416
|
+
? this.projectActorComposerState(actor, session)
|
|
417
|
+
: this.projectComposerStateValue(session, undefined, indexedPage?.planReview);
|
|
418
|
+
const composer = projectedComposer.sessionRuntime.phase === sessionRuntime.phase
|
|
419
|
+
? projectedComposer
|
|
420
|
+
: Object.freeze({ ...projectedComposer, sessionRuntime });
|
|
360
421
|
const snapshot = Object.freeze({
|
|
361
422
|
apiVersion: protocol_1.WEB_API_VERSION,
|
|
362
423
|
session: (0, protocol_1.projectSessionSummary)(session),
|
|
424
|
+
sessionRuntime,
|
|
363
425
|
threadId: activeProjection?.threadId ?? indexedPage?.threadId ?? view?.threadId ?? null,
|
|
364
426
|
threadCursor: activeProjection?.cursor ?? indexedPage?.cursor ?? view?.cursor ?? 0,
|
|
365
427
|
eventCursor: this.eventHub.snapshot().latest,
|
|
@@ -376,8 +438,8 @@ class WebWorkbenchController {
|
|
|
376
438
|
processing: active ? state.isProcessing : false,
|
|
377
439
|
agentMode: state.agentMode,
|
|
378
440
|
permissionMode: state.permissionMode,
|
|
379
|
-
status:
|
|
380
|
-
followups: active ? Object.freeze([...
|
|
441
|
+
status: actor?.latestStatus ?? 'Ready',
|
|
442
|
+
followups: active ? Object.freeze([...actor.controller.getFollowupQueue()]) : [],
|
|
381
443
|
followupLimit: 16,
|
|
382
444
|
contextUsage: active ? state.contextUsage : null,
|
|
383
445
|
tokenUsage: active ? state.tokenUsage : null,
|
|
@@ -385,15 +447,246 @@ class WebWorkbenchController {
|
|
|
385
447
|
pendingApprovals: Object.freeze(pendingPermissions),
|
|
386
448
|
goal,
|
|
387
449
|
plan,
|
|
450
|
+
composer,
|
|
388
451
|
recoveryDiagnostics: indexedPage ? [] : (view?.diagnostics ?? []),
|
|
389
452
|
});
|
|
390
453
|
if (context)
|
|
391
454
|
this.assertContextGuard(context);
|
|
392
455
|
return snapshot;
|
|
393
456
|
}
|
|
394
|
-
|
|
457
|
+
composerState(sessionId, context) {
|
|
458
|
+
if (context)
|
|
459
|
+
this.assertContextGuard(context);
|
|
460
|
+
const session = requireSession(sessionId);
|
|
461
|
+
this.assertSessionWorkspace(session);
|
|
462
|
+
const actor = this.sessionRegistry.residentActor(this.sessionActorKey(session))?.actor;
|
|
463
|
+
const state = actor
|
|
464
|
+
? this.projectActorComposerState(actor, session)
|
|
465
|
+
: this.projectComposerStateValue(session);
|
|
466
|
+
if (context)
|
|
467
|
+
this.assertContextGuard(context);
|
|
468
|
+
return state;
|
|
469
|
+
}
|
|
470
|
+
sessionRuntimeSummary(sessionId) {
|
|
471
|
+
const session = requireSession(sessionId);
|
|
472
|
+
this.assertSessionWorkspace(session);
|
|
473
|
+
return this.sessionRegistry.summary(this.sessionActorKey(session));
|
|
474
|
+
}
|
|
475
|
+
async waitForSessionIdle(sessionId) {
|
|
476
|
+
const session = requireSession(sessionId);
|
|
477
|
+
this.assertSessionWorkspace(session);
|
|
478
|
+
const actor = this.sessionRegistry.residentActor(this.sessionActorKey(session))?.actor;
|
|
479
|
+
await actor?.controller.waitForIdle();
|
|
480
|
+
}
|
|
481
|
+
projectActorComposerState(actor, session) {
|
|
482
|
+
const state = this.projectComposerStateValue(session, actor);
|
|
483
|
+
// Durable Thread and Store authority can advance before the debounced SSE
|
|
484
|
+
// observer runs. Keep every projected control state and its CAS token in
|
|
485
|
+
// the same synchronous boundary so the UI never receives new controls
|
|
486
|
+
// paired with an older revision.
|
|
487
|
+
const authorityDigest = composerAuthorityDigest(state);
|
|
488
|
+
if (actor.composerAuthorityDigest === undefined) {
|
|
489
|
+
actor.composerAuthorityDigest = authorityDigest;
|
|
490
|
+
return state;
|
|
491
|
+
}
|
|
492
|
+
if (authorityDigest === actor.composerAuthorityDigest)
|
|
493
|
+
return state;
|
|
494
|
+
actor.composerRevision = (0, crypto_1.randomUUID)();
|
|
495
|
+
actor.composerAuthorityDigest = authorityDigest;
|
|
496
|
+
return Object.freeze({ ...state, controlRevision: actor.composerRevision });
|
|
497
|
+
}
|
|
498
|
+
projectComposerStateValue(session, actor, indexedPlanReview) {
|
|
499
|
+
const runtimeOwner = actor?.runtime ?? this.runtimeValue;
|
|
500
|
+
const controller = actor?.controller;
|
|
501
|
+
const controls = runtimeOwner.sessionComposerControls;
|
|
502
|
+
if (!controls) {
|
|
503
|
+
throw new errors_1.WebWorkbenchError(503, 'Session Composer controls are unavailable.', 'composer_controls_unavailable');
|
|
504
|
+
}
|
|
505
|
+
const runtime = controls.describeSession(session);
|
|
506
|
+
const queue = actor
|
|
507
|
+
? actor.controller.getFollowupQueueSnapshot()
|
|
508
|
+
: { items: [], limit: 16 };
|
|
509
|
+
const projection = actor
|
|
510
|
+
? this.activeOrionRuntimes.get(session.id)?.thread.getProjection()
|
|
511
|
+
: undefined;
|
|
512
|
+
const review = projection?.planReview ?? indexedPlanReview;
|
|
513
|
+
const workspaceId = this.workspaceRegistry
|
|
514
|
+
.list()
|
|
515
|
+
.find(entry => entry.canonicalPath === canonicalDirectory(session.projectPath))?.id;
|
|
516
|
+
if (!workspaceId) {
|
|
517
|
+
throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
|
|
518
|
+
}
|
|
519
|
+
const sessionRuntime = this.sessionRegistry.summary({ workspaceId, sessionId: session.id });
|
|
520
|
+
return Object.freeze({
|
|
521
|
+
apiVersion: protocol_1.WEB_API_VERSION,
|
|
522
|
+
workspaceId,
|
|
523
|
+
sessionId: session.id,
|
|
524
|
+
contextRevision: this.contextRevisionValue,
|
|
525
|
+
controlRevision: actor?.composerRevision ?? sessionRuntime.runtimeRevision,
|
|
526
|
+
sessionRuntime,
|
|
527
|
+
processing: Boolean(actor) &&
|
|
528
|
+
(runtimeOwner.store.getSnapshot().isProcessing || Boolean(projection?.activeTurnId)),
|
|
529
|
+
mode: controller
|
|
530
|
+
? Object.freeze({ ...controller.getAgentModeSnapshot() })
|
|
531
|
+
: Object.freeze({ baseMode: 'interactive', pendingBaseMode: null }),
|
|
532
|
+
model: runtime.model,
|
|
533
|
+
permission: runtime.permission,
|
|
534
|
+
contextUsage: runtime.contextUsage,
|
|
535
|
+
compactAvailable: controller?.canCompactContext() ?? false,
|
|
536
|
+
pending: runtime.pending,
|
|
537
|
+
lastError: runtime.lastError,
|
|
538
|
+
planReview: review
|
|
539
|
+
? Object.freeze({
|
|
540
|
+
planDigest: review.planDigest,
|
|
541
|
+
revision: review.revision,
|
|
542
|
+
status: review.status,
|
|
543
|
+
createdAt: review.createdAt,
|
|
544
|
+
createdModel: review.createdModel,
|
|
545
|
+
returnMode: review.returnMode,
|
|
546
|
+
...(review.resolvedAt === undefined ? {} : { resolvedAt: review.resolvedAt }),
|
|
547
|
+
})
|
|
548
|
+
: null,
|
|
549
|
+
queue: Object.freeze({
|
|
550
|
+
items: Object.freeze(queue.items.map(item => Object.freeze({ ...item }))),
|
|
551
|
+
limit: queue.limit,
|
|
552
|
+
}),
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
modelCatalog(sessionId, context) {
|
|
556
|
+
if (context)
|
|
557
|
+
this.assertContextGuard(context);
|
|
558
|
+
const session = requireSession(sessionId);
|
|
559
|
+
this.assertSessionWorkspace(session);
|
|
560
|
+
const actor = this.sessionRegistry.residentActor(this.sessionActorKey(session))?.actor;
|
|
561
|
+
const controls = (actor?.runtime ?? this.runtimeValue).sessionComposerControls;
|
|
562
|
+
if (!controls) {
|
|
563
|
+
throw new errors_1.WebWorkbenchError(503, 'Session model catalog is unavailable.', 'composer_controls_unavailable');
|
|
564
|
+
}
|
|
565
|
+
const catalog = controls.catalog();
|
|
566
|
+
if (context)
|
|
567
|
+
this.assertContextGuard(context);
|
|
568
|
+
return catalog;
|
|
569
|
+
}
|
|
570
|
+
async applyComposerAction(input) {
|
|
571
|
+
this.assertContextGuard(input);
|
|
572
|
+
const session = requireSession(input.expectedSessionId);
|
|
573
|
+
this.assertSessionWorkspace(session);
|
|
574
|
+
const key = this.sessionActorKey(session);
|
|
575
|
+
const wasResident = this.sessionRegistry.summary(key).resident;
|
|
576
|
+
let actor;
|
|
577
|
+
try {
|
|
578
|
+
actor = (await this.sessionRegistry.ensureResident(key, input.expectedSessionRuntimeRevision))
|
|
579
|
+
.actor;
|
|
580
|
+
}
|
|
581
|
+
catch (error) {
|
|
582
|
+
throw mapSessionRuntimeError(error);
|
|
583
|
+
}
|
|
584
|
+
const actorSession = actor.runtime.getSession();
|
|
585
|
+
if (!actorSession || actorSession.id !== input.expectedSessionId) {
|
|
586
|
+
throw new errors_1.WebWorkbenchError(503, 'Session actor is not bound to the expected Session.', 'session_unavailable');
|
|
587
|
+
}
|
|
588
|
+
if (!wasResident)
|
|
589
|
+
actor.composerRevision = input.expectedControlRevision;
|
|
590
|
+
const admittedState = this.projectActorComposerState(actor, actorSession);
|
|
591
|
+
if (input.expectedControlRevision !== admittedState.controlRevision) {
|
|
592
|
+
throw new errors_1.WebWorkbenchError(409, 'Composer controls changed before the action was admitted.', 'composer_control_conflict');
|
|
593
|
+
}
|
|
594
|
+
const controls = actor.runtime.sessionComposerControls;
|
|
595
|
+
if (!controls) {
|
|
596
|
+
throw new errors_1.WebWorkbenchError(503, 'Session Composer controls are unavailable.', 'composer_controls_unavailable');
|
|
597
|
+
}
|
|
598
|
+
let outcome = 'applied';
|
|
599
|
+
let detail;
|
|
600
|
+
let modelReceipt;
|
|
601
|
+
let permissionReceipt;
|
|
602
|
+
let planReviewReceipt;
|
|
603
|
+
actor.suppressComposerEdges += 1;
|
|
604
|
+
try {
|
|
605
|
+
switch (input.type) {
|
|
606
|
+
case 'set_agent_mode': {
|
|
607
|
+
const result = actor.controller.setAgentMode(input.mode);
|
|
608
|
+
outcome =
|
|
609
|
+
result.type === 'agent_mode_changed' && result.appliesFrom === 'next-logical-request'
|
|
610
|
+
? 'deferred'
|
|
611
|
+
: 'applied';
|
|
612
|
+
detail = JSON.stringify(result);
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
case 'set_permission_override':
|
|
616
|
+
permissionReceipt = await controls.setPermissionOverride(input.value);
|
|
617
|
+
outcome = permissionReceipt.appliesFrom === 'immediate' ? 'applied' : 'deferred';
|
|
618
|
+
break;
|
|
619
|
+
case 'clear_permission_override':
|
|
620
|
+
permissionReceipt = await controls.setPermissionOverride(null);
|
|
621
|
+
outcome = permissionReceipt.appliesFrom === 'immediate' ? 'applied' : 'deferred';
|
|
622
|
+
break;
|
|
623
|
+
case 'select_model':
|
|
624
|
+
modelReceipt = await controls.selectModel({
|
|
625
|
+
modelId: input.modelId,
|
|
626
|
+
...(input.effort ? { effort: input.effort } : {}),
|
|
627
|
+
});
|
|
628
|
+
outcome = modelReceipt.appliesFrom === 'next-logical-request' ? 'deferred' : 'applied';
|
|
629
|
+
break;
|
|
630
|
+
case 'compact_context': {
|
|
631
|
+
const result = await actor.controller.compactContext();
|
|
632
|
+
if (result.status === 'rejected') {
|
|
633
|
+
throw new errors_1.WebWorkbenchError(409, 'Context compact was rejected.', 'runtime_busy');
|
|
634
|
+
}
|
|
635
|
+
detail = JSON.stringify(result);
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
case 'edit_queue_item':
|
|
639
|
+
detail = JSON.stringify(actor.controller.editFollowupQueueItem(input.itemId, input.expectedItemRevision, input.text));
|
|
640
|
+
break;
|
|
641
|
+
case 'move_queue_item':
|
|
642
|
+
detail = JSON.stringify(actor.controller.moveFollowupQueueItem(input.itemId, input.expectedItemRevision, input.targetIndex));
|
|
643
|
+
break;
|
|
644
|
+
case 'remove_queue_item':
|
|
645
|
+
detail = JSON.stringify(actor.controller.removeFollowupQueueItem(input.itemId, input.expectedItemRevision));
|
|
646
|
+
break;
|
|
647
|
+
case 'review_plan': {
|
|
648
|
+
planReviewReceipt = await actor.controller.reviewPlan({
|
|
649
|
+
planDigest: input.planDigest,
|
|
650
|
+
action: input.action,
|
|
651
|
+
...(input.feedback ? { feedback: input.feedback } : {}),
|
|
652
|
+
});
|
|
653
|
+
if (input.action === 'approve')
|
|
654
|
+
actor.controller.setAgentMode('interactive');
|
|
655
|
+
else if (input.action === 'continue')
|
|
656
|
+
actor.controller.setAgentMode('plan');
|
|
657
|
+
detail = JSON.stringify(planReviewReceipt.admission);
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
catch (error) {
|
|
663
|
+
throw mapComposerControlError(error);
|
|
664
|
+
}
|
|
665
|
+
finally {
|
|
666
|
+
actor.suppressComposerEdges -= 1;
|
|
667
|
+
}
|
|
668
|
+
actor.composerRevision = (0, crypto_1.randomUUID)();
|
|
669
|
+
const state = this.projectComposerStateValue(actorSession, actor);
|
|
670
|
+
actor.composerAuthorityDigest = composerAuthorityDigest(state);
|
|
671
|
+
this.eventHub.emit({ type: 'composer_state_changed', state }, true, {
|
|
672
|
+
sessionId: input.expectedSessionId,
|
|
673
|
+
});
|
|
674
|
+
return Object.freeze({
|
|
675
|
+
requestId: input.requestId,
|
|
676
|
+
outcome,
|
|
677
|
+
controlRevision: actor.composerRevision,
|
|
678
|
+
state,
|
|
679
|
+
...(modelReceipt ? { modelReceipt } : {}),
|
|
680
|
+
...(permissionReceipt ? { permissionReceipt } : {}),
|
|
681
|
+
...(planReviewReceipt ? { planReviewReceipt } : {}),
|
|
682
|
+
...(detail ? { detail } : {}),
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
async skills(context) {
|
|
686
|
+
if (context)
|
|
687
|
+
this.assertContextGuard(context);
|
|
395
688
|
const descriptors = (await this.runtimeValue.inspectSkills?.()) ?? [];
|
|
396
|
-
|
|
689
|
+
const result = Object.freeze(descriptors.map(descriptor => Object.freeze({
|
|
397
690
|
id: descriptor.id,
|
|
398
691
|
name: descriptor.name,
|
|
399
692
|
description: descriptor.description,
|
|
@@ -404,8 +697,13 @@ class WebWorkbenchController {
|
|
|
404
697
|
requestedCapabilities: Object.freeze([...descriptor.requestedCapabilities]),
|
|
405
698
|
digest: descriptor.digest,
|
|
406
699
|
})));
|
|
700
|
+
if (context)
|
|
701
|
+
this.assertContextGuard(context);
|
|
702
|
+
return result;
|
|
407
703
|
}
|
|
408
|
-
mcp() {
|
|
704
|
+
mcp(context) {
|
|
705
|
+
if (context)
|
|
706
|
+
this.assertContextGuard(context);
|
|
409
707
|
const descriptors = this.runtimeValue.inspectMcp?.() ?? [];
|
|
410
708
|
let runtimeServers = new Map();
|
|
411
709
|
try {
|
|
@@ -417,7 +715,7 @@ class WebWorkbenchController {
|
|
|
417
715
|
catch {
|
|
418
716
|
// A concurrent session transition may close the previous diagnostics graph.
|
|
419
717
|
}
|
|
420
|
-
|
|
718
|
+
const result = Object.freeze(descriptors.map(descriptor => {
|
|
421
719
|
const runtime = runtimeServers.get(descriptor.id);
|
|
422
720
|
return Object.freeze({
|
|
423
721
|
id: descriptor.id,
|
|
@@ -435,20 +733,33 @@ class WebWorkbenchController {
|
|
|
435
733
|
: {}),
|
|
436
734
|
});
|
|
437
735
|
}));
|
|
736
|
+
if (context)
|
|
737
|
+
this.assertContextGuard(context);
|
|
738
|
+
return result;
|
|
438
739
|
}
|
|
439
|
-
async listToolDetails() {
|
|
440
|
-
|
|
740
|
+
async listToolDetails(context) {
|
|
741
|
+
if (context)
|
|
742
|
+
this.assertContextGuard(context);
|
|
743
|
+
const result = Object.freeze(await this.toolDetails.list(this.workspaceValue));
|
|
744
|
+
if (context)
|
|
745
|
+
this.assertContextGuard(context);
|
|
746
|
+
return result;
|
|
441
747
|
}
|
|
442
|
-
async readToolDetail(callId, offsetBytes, limitBytes) {
|
|
748
|
+
async readToolDetail(callId, offsetBytes, limitBytes, context) {
|
|
749
|
+
if (context)
|
|
750
|
+
this.assertContextGuard(context);
|
|
443
751
|
const entry = (await this.toolDetails.list(this.workspaceValue)).find(detail => detail.callId === callId || detail.artifactId === callId);
|
|
444
752
|
if (!entry?.artifactId)
|
|
445
753
|
throw new errors_1.WebWorkbenchError(404, 'Tool detail was not found.');
|
|
446
|
-
|
|
754
|
+
const result = await this.toolDetails.read({
|
|
447
755
|
callId: entry.callId,
|
|
448
756
|
sequence: entry.sequence,
|
|
449
757
|
artifactId: entry.artifactId,
|
|
450
758
|
outputBytes: entry.outputBytes,
|
|
451
759
|
}, { offsetBytes, limitBytes }, this.workspaceValue);
|
|
760
|
+
if (context)
|
|
761
|
+
this.assertContextGuard(context);
|
|
762
|
+
return result;
|
|
452
763
|
}
|
|
453
764
|
listFiles(context, input) {
|
|
454
765
|
this.assertContextGuard(context);
|
|
@@ -501,56 +812,28 @@ class WebWorkbenchController {
|
|
|
501
812
|
return result;
|
|
502
813
|
}
|
|
503
814
|
async createSession(name, context) {
|
|
504
|
-
this.assertReadyForTransition('create a session');
|
|
505
815
|
if (context)
|
|
506
816
|
this.assertContextGuard(context);
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
await this.runtimeValue.rebindSessionRuntime?.();
|
|
516
|
-
this.eventHub.emitRuntime({ type: 'transcript_clear' });
|
|
517
|
-
this.emitState();
|
|
518
|
-
return (0, protocol_1.projectSessionSummary)(named);
|
|
519
|
-
}
|
|
520
|
-
finally {
|
|
521
|
-
this.sessionTransition = false;
|
|
522
|
-
}
|
|
817
|
+
// A new Session inherits the durable default; an override on another
|
|
818
|
+
// Session actor must never leak into it. Creation does not activate or
|
|
819
|
+
// close any actor; foreground selection belongs to the browser tab.
|
|
820
|
+
const session = (0, session_storage_1.createSession)(this.workspaceValue, this.settings().sections.defaults.model.effectiveValue);
|
|
821
|
+
(0, global_config_1.incrementSessionCount)();
|
|
822
|
+
const named = name?.trim() ? ((0, session_storage_1.renameSession)(session.id, name.trim()) ?? session) : session;
|
|
823
|
+
this.sessionRegistry.summary(this.sessionActorKey(named));
|
|
824
|
+
return (0, protocol_1.projectSessionSummary)(named);
|
|
523
825
|
}
|
|
524
826
|
async activateSession(sessionId, context) {
|
|
525
|
-
this.assertReadyForTransition('switch sessions');
|
|
526
827
|
if (context)
|
|
527
828
|
this.assertContextGuard(context);
|
|
528
|
-
|
|
529
|
-
this.
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
const result = this.controllerValue.handle({
|
|
537
|
-
type: 'select_session',
|
|
538
|
-
sessionId: session.id,
|
|
539
|
-
source: 'programmatic',
|
|
540
|
-
});
|
|
541
|
-
await this.controllerValue.waitForIdle();
|
|
542
|
-
if (this.runtimeValue.getSession()?.id !== session.id) {
|
|
543
|
-
throw new errors_1.WebWorkbenchError(409, 'Session activation was rejected by the runtime.');
|
|
544
|
-
}
|
|
545
|
-
activated = true;
|
|
546
|
-
return { requestId: `activate:${session.id}`, result: result.type };
|
|
547
|
-
}
|
|
548
|
-
finally {
|
|
549
|
-
this.suppressContextEdges -= 1;
|
|
550
|
-
this.sessionTransition = false;
|
|
551
|
-
if (activated)
|
|
552
|
-
this.emitState();
|
|
553
|
-
}
|
|
829
|
+
const session = requireSession(sessionId);
|
|
830
|
+
this.assertSessionWorkspace(session);
|
|
831
|
+
const sessionRuntime = this.sessionRegistry.summary(this.sessionActorKey(session));
|
|
832
|
+
return {
|
|
833
|
+
requestId: `activate:${session.id}`,
|
|
834
|
+
result: 'foreground_session_selected',
|
|
835
|
+
sessionRuntime,
|
|
836
|
+
};
|
|
554
837
|
}
|
|
555
838
|
renameSession(sessionId, name, context) {
|
|
556
839
|
if (context)
|
|
@@ -559,9 +842,12 @@ class WebWorkbenchController {
|
|
|
559
842
|
if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
|
|
560
843
|
throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
|
|
561
844
|
}
|
|
562
|
-
|
|
845
|
+
const normalizedName = name.trim();
|
|
846
|
+
if (!normalizedName)
|
|
847
|
+
throw new errors_1.WebWorkbenchError(400, 'Session name is required.');
|
|
848
|
+
if (normalizedName.length > 120)
|
|
563
849
|
throw new errors_1.WebWorkbenchError(400, 'Session name is too long.');
|
|
564
|
-
const updated = (0, session_storage_1.renameSession)(session.id,
|
|
850
|
+
const updated = (0, session_storage_1.renameSession)(session.id, normalizedName);
|
|
565
851
|
if (!updated)
|
|
566
852
|
throw new errors_1.WebWorkbenchError(404, 'Session no longer exists.');
|
|
567
853
|
return (0, protocol_1.projectSessionSummary)(updated);
|
|
@@ -597,10 +883,13 @@ class WebWorkbenchController {
|
|
|
597
883
|
throw new errors_1.WebWorkbenchError(409, 'Session does not belong to the requested Workspace.', 'context_session_mismatch');
|
|
598
884
|
}
|
|
599
885
|
const currentSessionId = this.runtimeValue.getSession()?.id ?? null;
|
|
600
|
-
if (targetWorkspace === this.workspaceValue
|
|
601
|
-
|
|
602
|
-
|
|
886
|
+
if (targetWorkspace === this.workspaceValue) {
|
|
887
|
+
if (targetSession)
|
|
888
|
+
this.sessionRegistry.summary(this.sessionActorKey(targetSession));
|
|
889
|
+
// Session foreground selection is browser-local. A same-Workspace
|
|
890
|
+
// selection never mutates the Host Context or any Session actor.
|
|
603
891
|
return;
|
|
892
|
+
}
|
|
604
893
|
this.assertReadyForTransition('activate a Context');
|
|
605
894
|
const previousWorkspace = this.workspaceValue;
|
|
606
895
|
const previousSessionId = currentSessionId;
|
|
@@ -612,10 +901,11 @@ class WebWorkbenchController {
|
|
|
612
901
|
await previousController.stopActiveTurn();
|
|
613
902
|
await previousController.waitForIdle();
|
|
614
903
|
if (targetWorkspace !== previousWorkspace) {
|
|
904
|
+
await this.sessionRegistry.shutdown('Workspace Context changed');
|
|
615
905
|
await previousRuntime.shutdown();
|
|
616
906
|
await this.installRuntime(targetWorkspace, false);
|
|
907
|
+
this.sessionRegistry = this.createSessionRegistry();
|
|
617
908
|
}
|
|
618
|
-
await this.restoreContextSession(targetSession?.id ?? null);
|
|
619
909
|
this.workspaceRegistry.register(targetWorkspace, { activated: true });
|
|
620
910
|
}
|
|
621
911
|
catch (activationError) {
|
|
@@ -624,6 +914,7 @@ class WebWorkbenchController {
|
|
|
624
914
|
if (this.runtimeValue !== previousRuntime)
|
|
625
915
|
await this.runtimeValue.shutdown();
|
|
626
916
|
await this.installRuntime(previousWorkspace, false);
|
|
917
|
+
this.sessionRegistry = this.createSessionRegistry();
|
|
627
918
|
}
|
|
628
919
|
await this.restoreContextSession(previousSessionId);
|
|
629
920
|
}
|
|
@@ -648,17 +939,254 @@ class WebWorkbenchController {
|
|
|
648
939
|
}
|
|
649
940
|
dispatch(raw) {
|
|
650
941
|
const command = (0, protocol_1.parseWebCommand)(raw);
|
|
651
|
-
return this.executeMutation(command.requestId, 'command', command, () => {
|
|
652
|
-
this.
|
|
653
|
-
const
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
942
|
+
return this.executeMutation(command.requestId, 'command', command, async () => {
|
|
943
|
+
this.assertContextGuard(command);
|
|
944
|
+
const session = requireSession(command.expectedSessionId);
|
|
945
|
+
this.assertSessionWorkspace(session);
|
|
946
|
+
const key = this.sessionActorKey(session);
|
|
947
|
+
if (command.type === 'cancel_queued_turn') {
|
|
948
|
+
try {
|
|
949
|
+
const sessionRuntime = this.sessionRegistry.cancelQueued(key, command.queueId, command.expectedSessionRuntimeRevision);
|
|
950
|
+
return Object.freeze({
|
|
951
|
+
requestId: command.requestId,
|
|
952
|
+
result: 'session_turn_queue_cancelled',
|
|
953
|
+
sessionRuntime,
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
catch (error) {
|
|
957
|
+
throw mapSessionRuntimeError(error);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
const resolved = await this.resolveCommandContext(command);
|
|
961
|
+
const runtimeInput = resolved && command.type === 'queue_followup'
|
|
962
|
+
? {
|
|
963
|
+
type: 'queue_followup',
|
|
964
|
+
text: command.text,
|
|
965
|
+
resolvedText: resolved.text,
|
|
966
|
+
source: 'programmatic',
|
|
967
|
+
}
|
|
968
|
+
: (0, protocol_1.toAgentRuntimeInput)({ ...command, ...(resolved ? { text: resolved.text } : {}) });
|
|
969
|
+
try {
|
|
970
|
+
if (command.type === 'submit') {
|
|
971
|
+
const currentRuntime = this.sessionRegistry.summary(key);
|
|
972
|
+
if (['running', 'waiting_approval'].includes(currentRuntime.phase)) {
|
|
973
|
+
const routed = await this.sessionRegistry.withActor(key, command.expectedSessionRuntimeRevision, actor => {
|
|
974
|
+
if (!actor.controller.hasActiveTurn()) {
|
|
975
|
+
throw new session_runtime_registry_1.WebSessionRuntimeRegistryError(409, 'session_runtime_revision_conflict', 'The Session turn ended before steering was admitted.');
|
|
976
|
+
}
|
|
977
|
+
return actor.controller.handle(runtimeInput);
|
|
978
|
+
});
|
|
979
|
+
return Object.freeze({
|
|
980
|
+
requestId: command.requestId,
|
|
981
|
+
result: routed.result.type,
|
|
982
|
+
detail: JSON.stringify(routed.result),
|
|
983
|
+
sessionRuntime: routed.runtime,
|
|
984
|
+
...(resolved ? { contextReceipt: resolved.receipt } : {}),
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
const admission = await this.sessionRegistry.admitTurn({
|
|
988
|
+
key,
|
|
989
|
+
expectedRuntimeRevision: command.expectedSessionRuntimeRevision,
|
|
990
|
+
start: async (actor) => {
|
|
991
|
+
const runtimeResult = actor.controller.handle(runtimeInput);
|
|
992
|
+
return {
|
|
993
|
+
accepted: runtimeResult,
|
|
994
|
+
settled: actor.controller.waitForIdle(),
|
|
995
|
+
};
|
|
996
|
+
},
|
|
997
|
+
});
|
|
998
|
+
if (admission.status === 'queued') {
|
|
999
|
+
return Object.freeze({
|
|
1000
|
+
requestId: command.requestId,
|
|
1001
|
+
result: 'session_turn_queued',
|
|
1002
|
+
queueId: admission.queueId,
|
|
1003
|
+
queuePosition: admission.queuePosition,
|
|
1004
|
+
sessionRuntime: admission.runtime,
|
|
1005
|
+
...(resolved ? { contextReceipt: resolved.receipt } : {}),
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
return Object.freeze({
|
|
1009
|
+
requestId: command.requestId,
|
|
1010
|
+
result: admission.accepted.type,
|
|
1011
|
+
detail: JSON.stringify(admission.accepted),
|
|
1012
|
+
sessionRuntime: admission.runtime,
|
|
1013
|
+
...(resolved ? { contextReceipt: resolved.receipt } : {}),
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
const routed = await this.sessionRegistry.withActor(key, command.expectedSessionRuntimeRevision, actor => {
|
|
1017
|
+
const runtimeResult = actor.controller.handle(runtimeInput);
|
|
1018
|
+
if (command.type === 'permission_decision') {
|
|
1019
|
+
this.sessionRegistry.setPendingApprovalCount(key, actor.controller.getPendingPermissions().length);
|
|
1020
|
+
}
|
|
1021
|
+
return runtimeResult;
|
|
1022
|
+
});
|
|
1023
|
+
return Object.freeze({
|
|
1024
|
+
requestId: command.requestId,
|
|
1025
|
+
result: routed.result.type,
|
|
1026
|
+
detail: JSON.stringify(routed.result),
|
|
1027
|
+
sessionRuntime: routed.runtime,
|
|
1028
|
+
...(resolved ? { contextReceipt: resolved.receipt } : {}),
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
catch (error) {
|
|
1032
|
+
throw mapSessionRuntimeError(error);
|
|
1033
|
+
}
|
|
659
1034
|
});
|
|
660
1035
|
}
|
|
1036
|
+
async resolveCommandContext(command) {
|
|
1037
|
+
const references = command.contextReferences ?? [];
|
|
1038
|
+
if (references.length === 0)
|
|
1039
|
+
return undefined;
|
|
1040
|
+
if (command.type !== 'submit' && command.type !== 'queue_followup') {
|
|
1041
|
+
throw new errors_1.WebWorkbenchError(400, 'Context references are valid only for submitted or queued messages.', 'context_reference_invalid');
|
|
1042
|
+
}
|
|
1043
|
+
const resolved = [];
|
|
1044
|
+
let totalBytes = 0;
|
|
1045
|
+
for (const reference of references) {
|
|
1046
|
+
let entry;
|
|
1047
|
+
try {
|
|
1048
|
+
entry = await this.resolveContextReference(reference);
|
|
1049
|
+
}
|
|
1050
|
+
catch (error) {
|
|
1051
|
+
throw mapContextReferenceError(error);
|
|
1052
|
+
}
|
|
1053
|
+
const bytes = Buffer.byteLength(JSON.stringify(entry), 'utf8');
|
|
1054
|
+
if (bytes > MAX_CONTEXT_REFERENCE_BYTES) {
|
|
1055
|
+
throw new errors_1.WebWorkbenchError(413, 'A Context reference exceeds the per-reference byte budget.', 'context_reference_too_large');
|
|
1056
|
+
}
|
|
1057
|
+
totalBytes += bytes;
|
|
1058
|
+
if (totalBytes > MAX_CONTEXT_MANIFEST_BYTES) {
|
|
1059
|
+
throw new errors_1.WebWorkbenchError(413, 'Context references exceed the request byte budget.', 'context_reference_too_large');
|
|
1060
|
+
}
|
|
1061
|
+
resolved.push(Object.freeze(entry));
|
|
1062
|
+
}
|
|
1063
|
+
const manifestContent = Object.freeze({
|
|
1064
|
+
version: 1,
|
|
1065
|
+
references: Object.freeze(resolved),
|
|
1066
|
+
});
|
|
1067
|
+
const manifestDigest = (0, canonical_1.digestRuntimeValue)(manifestContent);
|
|
1068
|
+
const manifest = Object.freeze({ ...manifestContent, manifestDigest });
|
|
1069
|
+
return Object.freeze({
|
|
1070
|
+
text: [
|
|
1071
|
+
command.text.trim(),
|
|
1072
|
+
'',
|
|
1073
|
+
'[Orion Context Manifest V1]',
|
|
1074
|
+
JSON.stringify(manifest),
|
|
1075
|
+
].join('\n'),
|
|
1076
|
+
receipt: Object.freeze({
|
|
1077
|
+
manifestDigest,
|
|
1078
|
+
referenceCount: resolved.length,
|
|
1079
|
+
totalBytes,
|
|
1080
|
+
}),
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
async resolveContextReference(reference) {
|
|
1084
|
+
switch (reference.kind) {
|
|
1085
|
+
case 'file': {
|
|
1086
|
+
const page = this.fileService.readContent({
|
|
1087
|
+
fileId: reference.id,
|
|
1088
|
+
limitBytes: MAX_CONTEXT_REFERENCE_BYTES,
|
|
1089
|
+
});
|
|
1090
|
+
if (page.revision !== reference.revision) {
|
|
1091
|
+
throw new errors_1.WebWorkbenchError(409, 'Referenced file changed.', 'context_reference_stale');
|
|
1092
|
+
}
|
|
1093
|
+
if (page.binary || page.content === undefined) {
|
|
1094
|
+
throw new errors_1.WebWorkbenchError(403, 'Binary files cannot be added to model Context.', 'context_reference_forbidden');
|
|
1095
|
+
}
|
|
1096
|
+
return {
|
|
1097
|
+
kind: 'file',
|
|
1098
|
+
id: reference.id,
|
|
1099
|
+
label: this.sanitizeContextText(page.name),
|
|
1100
|
+
revision: page.revision,
|
|
1101
|
+
content: this.sanitizeContextText(page.content),
|
|
1102
|
+
truncated: page.nextCursor !== null,
|
|
1103
|
+
};
|
|
1104
|
+
}
|
|
1105
|
+
case 'folder': {
|
|
1106
|
+
const page = this.fileService.list({ parentId: reference.id, pageSize: 100 });
|
|
1107
|
+
if (page.revision !== reference.revision) {
|
|
1108
|
+
throw new errors_1.WebWorkbenchError(409, 'Referenced folder changed.', 'context_reference_stale');
|
|
1109
|
+
}
|
|
1110
|
+
return {
|
|
1111
|
+
kind: 'folder',
|
|
1112
|
+
id: reference.id,
|
|
1113
|
+
label: this.sanitizeContextText(reference.label),
|
|
1114
|
+
revision: page.revision,
|
|
1115
|
+
entries: page.items
|
|
1116
|
+
.filter(item => !item.sensitive)
|
|
1117
|
+
.map(item => ({
|
|
1118
|
+
name: this.sanitizeContextText(item.name),
|
|
1119
|
+
kind: item.kind,
|
|
1120
|
+
sizeBytes: item.sizeBytes ?? null,
|
|
1121
|
+
})),
|
|
1122
|
+
truncated: page.nextCursor !== null,
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
case 'review': {
|
|
1126
|
+
const snapshot = await this.reviewService.snapshot();
|
|
1127
|
+
if (snapshot.repositoryRevision !== reference.gitRevision) {
|
|
1128
|
+
throw new errors_1.WebWorkbenchError(409, 'Referenced Review changed.', 'context_reference_stale');
|
|
1129
|
+
}
|
|
1130
|
+
return {
|
|
1131
|
+
kind: 'review',
|
|
1132
|
+
id: reference.id,
|
|
1133
|
+
revision: snapshot.repositoryRevision,
|
|
1134
|
+
clean: snapshot.clean,
|
|
1135
|
+
files: snapshot.changedFiles.slice(0, 100).map(file => ({
|
|
1136
|
+
id: file.fileId,
|
|
1137
|
+
path: this.sanitizeContextText(file.path),
|
|
1138
|
+
indexStatus: file.indexStatus,
|
|
1139
|
+
worktreeStatus: file.worktreeStatus,
|
|
1140
|
+
})),
|
|
1141
|
+
truncated: snapshot.truncated || snapshot.changedFiles.length > 100,
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
case 'session': {
|
|
1145
|
+
const session = requireSession(reference.id);
|
|
1146
|
+
if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
|
|
1147
|
+
throw new errors_1.WebWorkbenchError(403, 'Referenced Session belongs to another Workspace.', 'context_reference_forbidden');
|
|
1148
|
+
}
|
|
1149
|
+
const summary = (0, protocol_1.projectSessionSummary)(session);
|
|
1150
|
+
if (summary.contextDigest !== reference.digest) {
|
|
1151
|
+
throw new errors_1.WebWorkbenchError(409, 'Referenced Session changed.', 'context_reference_stale');
|
|
1152
|
+
}
|
|
1153
|
+
const page = (0, thread_session_view_1.loadThreadSessionSnapshotPageV1)(this.workspaceValue, session.id, undefined, 8);
|
|
1154
|
+
return {
|
|
1155
|
+
kind: 'session',
|
|
1156
|
+
id: session.id,
|
|
1157
|
+
label: this.sanitizeContextText(session.name?.trim() || `Session ${session.id.slice(0, 8)}`),
|
|
1158
|
+
digest: summary.contextDigest,
|
|
1159
|
+
messages: (page?.transcript.items ?? []).map(message => ({
|
|
1160
|
+
role: message.role,
|
|
1161
|
+
content: this.sanitizeContextText(message.content),
|
|
1162
|
+
})),
|
|
1163
|
+
truncated: Boolean(page?.transcript.nextCursor),
|
|
1164
|
+
};
|
|
1165
|
+
}
|
|
1166
|
+
case 'skill': {
|
|
1167
|
+
const descriptor = ((await this.runtimeValue.inspectSkills?.()) ?? []).find(skill => skill.id === reference.id);
|
|
1168
|
+
if (!descriptor || descriptor.digest !== reference.digest) {
|
|
1169
|
+
throw new errors_1.WebWorkbenchError(409, 'Referenced Skill changed.', 'context_reference_stale');
|
|
1170
|
+
}
|
|
1171
|
+
if (!descriptor.userInvocable) {
|
|
1172
|
+
throw new errors_1.WebWorkbenchError(403, 'Referenced Skill is not user-invocable.', 'context_reference_forbidden');
|
|
1173
|
+
}
|
|
1174
|
+
return {
|
|
1175
|
+
kind: 'skill',
|
|
1176
|
+
id: descriptor.id,
|
|
1177
|
+
label: this.sanitizeContextText(descriptor.name),
|
|
1178
|
+
digest: descriptor.digest,
|
|
1179
|
+
invocation: `$${descriptor.id}`,
|
|
1180
|
+
description: this.sanitizeContextText(descriptor.description),
|
|
1181
|
+
};
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
sanitizeContextText(value) {
|
|
1186
|
+
return (0, redaction_1.redactTraceText)(value).split(this.workspaceValue).join('<workspace>');
|
|
1187
|
+
}
|
|
661
1188
|
async updateSettings(input) {
|
|
1189
|
+
this.assertContextGuard(input);
|
|
662
1190
|
this.assertSettingsAvailable();
|
|
663
1191
|
const update = this.runtimeValue.updateSettings;
|
|
664
1192
|
if (!update) {
|
|
@@ -709,14 +1237,29 @@ class WebWorkbenchController {
|
|
|
709
1237
|
if (this.mutationResults.size >= MAX_MUTATION_RESULTS) {
|
|
710
1238
|
throw new errors_1.WebWorkbenchError(503, 'The mutation idempotency ledger is full; restart the local Web Host before retrying.', 'mutation_capacity_exhausted');
|
|
711
1239
|
}
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
1240
|
+
const contextTransition = CONTEXT_TRANSITION_MUTATIONS.has(operation);
|
|
1241
|
+
let result;
|
|
1242
|
+
try {
|
|
1243
|
+
this.reserveMutation(contextTransition);
|
|
1244
|
+
result = Promise.resolve()
|
|
1245
|
+
.then(() => {
|
|
1246
|
+
this.assertMutationAdmission();
|
|
1247
|
+
return action();
|
|
1248
|
+
})
|
|
1249
|
+
.finally(() => this.releaseMutation(contextTransition));
|
|
1250
|
+
}
|
|
1251
|
+
catch (error) {
|
|
1252
|
+
// Mutation admission is part of the idempotent result contract. Cache a
|
|
1253
|
+
// rejected Promise just like failures raised by the action so a retry of
|
|
1254
|
+
// the same requestId cannot observe a different outcome.
|
|
1255
|
+
result = Promise.reject(error);
|
|
1256
|
+
}
|
|
716
1257
|
this.mutationResults.set(requestId, { fingerprint, result });
|
|
717
1258
|
return result;
|
|
718
1259
|
}
|
|
719
|
-
async diagnostics() {
|
|
1260
|
+
async diagnostics(context) {
|
|
1261
|
+
if (context)
|
|
1262
|
+
this.assertContextGuard(context);
|
|
720
1263
|
const state = this.runtimeValue.store.getSnapshot();
|
|
721
1264
|
const mcp = (0, mcp_1.loadFirstPartyMcpConfigurationV1)();
|
|
722
1265
|
const activeSessionId = this.runtimeValue.getSession()?.id ?? null;
|
|
@@ -725,7 +1268,7 @@ class WebWorkbenchController {
|
|
|
725
1268
|
const harness = activeSessionId
|
|
726
1269
|
? ((await this.runtimeValue.getHarnessDiagnostics?.()) ?? null)
|
|
727
1270
|
: null;
|
|
728
|
-
|
|
1271
|
+
const result = {
|
|
729
1272
|
workspace: this.workspaceValue,
|
|
730
1273
|
activeSessionId,
|
|
731
1274
|
configured: this.runtimeValue.isConfigured,
|
|
@@ -743,20 +1286,233 @@ class WebWorkbenchController {
|
|
|
743
1286
|
mcp: { servers: mcpServerIds(mcp) },
|
|
744
1287
|
harness,
|
|
745
1288
|
eventStream: this.eventHub.snapshot(),
|
|
1289
|
+
workspaceKernel: this.runtimeValue.workspaceRuntimeKernel?.diagnostics() ?? null,
|
|
1290
|
+
performance: {
|
|
1291
|
+
files: this.fileService.performanceCounters(),
|
|
1292
|
+
git: this.gitService.performanceCounters(),
|
|
1293
|
+
thread: {
|
|
1294
|
+
eventStore: (0, thread_event_store_1.threadEventStorePerformanceCountersV1)(),
|
|
1295
|
+
sessionIndex: (0, thread_session_index_1.threadSessionIndexPerformanceCountersV1)(),
|
|
1296
|
+
},
|
|
1297
|
+
},
|
|
746
1298
|
};
|
|
1299
|
+
if (context)
|
|
1300
|
+
this.assertContextGuard(context);
|
|
1301
|
+
return result;
|
|
747
1302
|
}
|
|
748
1303
|
async shutdown() {
|
|
749
|
-
if (this.
|
|
750
|
-
return;
|
|
1304
|
+
if (this.shutdownResult)
|
|
1305
|
+
return this.shutdownResult;
|
|
751
1306
|
this.closed = true;
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
this.
|
|
1307
|
+
this.shutdownResult = this.shutdownOwnedResources();
|
|
1308
|
+
return this.shutdownResult;
|
|
1309
|
+
}
|
|
1310
|
+
async shutdownOwnedResources() {
|
|
1311
|
+
const failures = [];
|
|
1312
|
+
this.workspaceMutations.close('Orion Web Workbench shutdown');
|
|
1313
|
+
try {
|
|
1314
|
+
await this.sessionRegistry.shutdown('Orion Web Workbench shutdown');
|
|
1315
|
+
}
|
|
1316
|
+
catch {
|
|
1317
|
+
// The registry retains failed actor handles. Retry once after every
|
|
1318
|
+
// actor received its first close attempt; a persistent failure remains
|
|
1319
|
+
// an explicit Host shutdown error rather than an orphan hidden as GO.
|
|
1320
|
+
try {
|
|
1321
|
+
await this.sessionRegistry.shutdown('Orion Web Workbench shutdown retry');
|
|
1322
|
+
}
|
|
1323
|
+
catch (retryError) {
|
|
1324
|
+
failures.push(retryError);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
await captureShutdownFailure(failures, () => this.controllerValue.stopActiveTurn());
|
|
1328
|
+
await captureShutdownFailure(failures, () => this.controllerValue.waitForIdle());
|
|
1329
|
+
try {
|
|
1330
|
+
this.closeWorkspaceWatchers();
|
|
1331
|
+
this.closeComposerObserver();
|
|
1332
|
+
}
|
|
1333
|
+
catch (error) {
|
|
1334
|
+
failures.push(error);
|
|
1335
|
+
}
|
|
1336
|
+
await captureShutdownFailure(failures, () => this.terminalManager.shutdown());
|
|
1337
|
+
await captureShutdownFailure(failures, () => this.runtimeValue.shutdown());
|
|
1338
|
+
try {
|
|
1339
|
+
this.eventHub.close();
|
|
1340
|
+
}
|
|
1341
|
+
catch (error) {
|
|
1342
|
+
failures.push(error);
|
|
1343
|
+
}
|
|
1344
|
+
this.workspaceMutationOwners.clear();
|
|
1345
|
+
this.pendingWorkspaceMutationStates.clear();
|
|
1346
|
+
if (failures.length > 0) {
|
|
1347
|
+
throw new errors_1.WebWorkbenchError(503, `${failures.length} Web Workbench resource(s) could not be closed safely.`, 'workbench_shutdown_incomplete');
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
createSessionRegistry() {
|
|
1351
|
+
return new session_runtime_registry_1.WebSessionRuntimeRegistryV1({
|
|
1352
|
+
maxRunningSessions: 3,
|
|
1353
|
+
maxResidentSessionActors: 4,
|
|
1354
|
+
createActor: key => this.createSessionActor(key),
|
|
1355
|
+
initializeActor: actor => actor.runtime.rebindSessionRuntime?.() ?? Promise.resolve(),
|
|
1356
|
+
closeActor: (actor, reason) => this.closeSessionActor(actor, reason),
|
|
1357
|
+
estimateActorBytes: actor => estimateSessionActorBytes(actor),
|
|
1358
|
+
onSummaryChanged: runtime => {
|
|
1359
|
+
if (this.closed || this.suppressContextEdges > 0)
|
|
1360
|
+
return;
|
|
1361
|
+
this.eventHub.emit({ type: 'session_runtime_changed', runtime }, true, {
|
|
1362
|
+
sessionId: runtime.sessionId,
|
|
1363
|
+
});
|
|
1364
|
+
},
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1367
|
+
async createSessionActor(key) {
|
|
1368
|
+
const workspace = this.workspaceRegistry.find(key.workspaceId);
|
|
1369
|
+
if (!workspace) {
|
|
1370
|
+
throw new errors_1.WebWorkbenchError(404, 'Workspace was not found.', 'workspace_not_found');
|
|
1371
|
+
}
|
|
1372
|
+
const session = requireSession(key.sessionId);
|
|
1373
|
+
if (canonicalDirectory(session.projectPath) !== workspace.canonicalPath) {
|
|
1374
|
+
throw new errors_1.WebWorkbenchError(409, 'Session belongs to another Workspace.', 'session_workspace_conflict');
|
|
1375
|
+
}
|
|
1376
|
+
const runtime = await this.createSessionRuntime(workspace.canonicalPath);
|
|
1377
|
+
runtime.setSession(session);
|
|
1378
|
+
const actorRef = {};
|
|
1379
|
+
const eventSink = {
|
|
1380
|
+
emit: (event) => this.emitSessionActorRuntimeEvent(key, runtime, actorRef.current, event),
|
|
1381
|
+
};
|
|
1382
|
+
const controller = new agent_runtime_controller_1.AgentRuntimeController({
|
|
1383
|
+
runtime,
|
|
1384
|
+
eventSink,
|
|
1385
|
+
uiRenderer: 'web',
|
|
1386
|
+
echoSubmittedInput: false,
|
|
1387
|
+
useRuntimeToolPermissions: true,
|
|
1388
|
+
uiCapabilities: {
|
|
1389
|
+
structuredPickers: true,
|
|
1390
|
+
inlineProgress: true,
|
|
1391
|
+
suppressLegacyTokenMeta: true,
|
|
1392
|
+
extraAssistantSpacing: true,
|
|
1393
|
+
suppressAbortNotice: true,
|
|
1394
|
+
},
|
|
1395
|
+
});
|
|
1396
|
+
const actor = {
|
|
1397
|
+
key: Object.freeze({ ...key }),
|
|
1398
|
+
runtime,
|
|
1399
|
+
controller,
|
|
1400
|
+
composerRevision: (0, crypto_1.randomUUID)(),
|
|
1401
|
+
latestStatus: 'Ready',
|
|
1402
|
+
suppressComposerEdges: 0,
|
|
1403
|
+
};
|
|
1404
|
+
actorRef.current = actor;
|
|
1405
|
+
actor.composerStoreUnsubscribe = runtime.store.subscribe(() => this.scheduleActorComposerStateChanged(actor));
|
|
1406
|
+
actor.composerControlsUnsubscribe = runtime.sessionComposerControls?.subscribe(() => this.scheduleActorComposerStateChanged(actor));
|
|
1407
|
+
return actor;
|
|
1408
|
+
}
|
|
1409
|
+
async closeSessionActor(actor, _reason) {
|
|
1410
|
+
if (actor.composerChangeTimer)
|
|
1411
|
+
clearTimeout(actor.composerChangeTimer);
|
|
1412
|
+
actor.composerChangeTimer = undefined;
|
|
1413
|
+
actor.composerStoreUnsubscribe?.();
|
|
1414
|
+
actor.composerControlsUnsubscribe?.();
|
|
1415
|
+
actor.composerStoreUnsubscribe = undefined;
|
|
1416
|
+
actor.composerControlsUnsubscribe = undefined;
|
|
1417
|
+
await actor.controller.stopActiveTurn();
|
|
1418
|
+
await actor.controller.waitForIdle();
|
|
1419
|
+
await actor.runtime.shutdown();
|
|
1420
|
+
this.activeOrionRuntimes.delete(actor.key.sessionId);
|
|
1421
|
+
for (const [invocationId, owner] of this.workspaceMutationOwners) {
|
|
1422
|
+
if (owner.sessionId === actor.key.sessionId && owner.workspaceId === actor.key.workspaceId) {
|
|
1423
|
+
this.workspaceMutationOwners.delete(invocationId);
|
|
1424
|
+
this.pendingWorkspaceMutationStates.delete(invocationId);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
emitSessionActorRuntimeEvent(key, runtime, actor, event) {
|
|
1429
|
+
if (event.type === 'status_changed' && actor)
|
|
1430
|
+
actor.latestStatus = event.message;
|
|
1431
|
+
if (event.type === 'followup_queue_changed') {
|
|
1432
|
+
if (actor && actor.suppressComposerEdges === 0) {
|
|
1433
|
+
this.publishActorComposerState(actor);
|
|
1434
|
+
}
|
|
1435
|
+
return undefined;
|
|
1436
|
+
}
|
|
1437
|
+
if (event.type === 'tool_started') {
|
|
1438
|
+
this.workspaceMutationOwners.set(event.event.callId, Object.freeze({ ...key }));
|
|
1439
|
+
}
|
|
1440
|
+
const thread = this.activeOrionRuntimes.get(key.sessionId)?.thread.getProjection().threadId;
|
|
1441
|
+
const envelope = this.eventHub.emitRuntime(event, {
|
|
1442
|
+
sessionId: key.sessionId,
|
|
1443
|
+
...(thread ? { threadId: thread } : {}),
|
|
1444
|
+
});
|
|
1445
|
+
if (event.type === 'tool_started') {
|
|
1446
|
+
const pendingMutation = this.pendingWorkspaceMutationStates.get(event.event.callId);
|
|
1447
|
+
if (pendingMutation) {
|
|
1448
|
+
this.pendingWorkspaceMutationStates.delete(event.event.callId);
|
|
1449
|
+
this.emitWorkspaceMutationState(pendingMutation);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
if (event.type === 'permission_requested' && actor) {
|
|
1453
|
+
this.sessionRegistry.setPendingApprovalCount(key, actor.controller.getPendingPermissions().length);
|
|
1454
|
+
}
|
|
1455
|
+
if (event.type === 'tool_finished' && key.workspaceId === this.activeWorkspaceEntry().id) {
|
|
1456
|
+
this.scheduleWorkspaceResourceInvalidation('tool-finished');
|
|
1457
|
+
}
|
|
1458
|
+
if (event.type === 'tool_finished') {
|
|
1459
|
+
this.workspaceMutationOwners.delete(event.event.callId);
|
|
1460
|
+
this.pendingWorkspaceMutationStates.delete(event.event.callId);
|
|
1461
|
+
}
|
|
1462
|
+
return event.type === 'transcript_append' ? `web-entry-${envelope.cursor}` : undefined;
|
|
1463
|
+
}
|
|
1464
|
+
emitWorkspaceMutationState(state) {
|
|
1465
|
+
if (this.closed || this.suppressContextEdges > 0)
|
|
1466
|
+
return;
|
|
1467
|
+
const owner = this.workspaceMutationOwners.get(state.invocationId);
|
|
1468
|
+
if (!owner) {
|
|
1469
|
+
if (state.phase === 'queued' || state.phase === 'running') {
|
|
1470
|
+
this.pendingWorkspaceMutationStates.set(state.invocationId, Object.freeze({ ...state }));
|
|
1471
|
+
}
|
|
1472
|
+
else {
|
|
1473
|
+
this.pendingWorkspaceMutationStates.delete(state.invocationId);
|
|
1474
|
+
}
|
|
1475
|
+
return;
|
|
1476
|
+
}
|
|
1477
|
+
this.eventHub.emit({
|
|
1478
|
+
type: 'workspace_mutation_changed',
|
|
1479
|
+
state: {
|
|
1480
|
+
callId: state.invocationId,
|
|
1481
|
+
phase: state.phase,
|
|
1482
|
+
...(state.queuePosition === undefined ? {} : { queuePosition: state.queuePosition }),
|
|
1483
|
+
},
|
|
1484
|
+
}, false, { sessionId: owner.sessionId });
|
|
1485
|
+
if (['completed', 'failed', 'cancelled'].includes(state.phase)) {
|
|
1486
|
+
this.workspaceMutationOwners.delete(state.invocationId);
|
|
1487
|
+
this.pendingWorkspaceMutationStates.delete(state.invocationId);
|
|
1488
|
+
}
|
|
1489
|
+
}
|
|
1490
|
+
scheduleActorComposerStateChanged(actor) {
|
|
1491
|
+
if (this.closed || actor.suppressComposerEdges > 0)
|
|
1492
|
+
return;
|
|
1493
|
+
if (actor.composerChangeTimer)
|
|
1494
|
+
clearTimeout(actor.composerChangeTimer);
|
|
1495
|
+
actor.composerChangeTimer = setTimeout(() => {
|
|
1496
|
+
actor.composerChangeTimer = undefined;
|
|
1497
|
+
if (this.closed || actor.suppressComposerEdges > 0)
|
|
1498
|
+
return;
|
|
1499
|
+
this.publishActorComposerState(actor);
|
|
1500
|
+
}, 100);
|
|
1501
|
+
actor.composerChangeTimer.unref();
|
|
1502
|
+
}
|
|
1503
|
+
publishActorComposerState(actor) {
|
|
1504
|
+
try {
|
|
1505
|
+
const state = this.projectActorComposerState(actor, requireSession(actor.key.sessionId));
|
|
1506
|
+
this.eventHub.emit({ type: 'composer_state_changed', state }, true, {
|
|
1507
|
+
sessionId: actor.key.sessionId,
|
|
1508
|
+
});
|
|
1509
|
+
}
|
|
1510
|
+
catch {
|
|
1511
|
+
// A concurrent actor teardown publishes its final Runtime summary.
|
|
1512
|
+
}
|
|
758
1513
|
}
|
|
759
1514
|
async installRuntime(workspace, publishState = true) {
|
|
1515
|
+
this.closeComposerObserver();
|
|
760
1516
|
const runtime = await this.createRuntime(workspace);
|
|
761
1517
|
this.closeWorkspaceWatchers();
|
|
762
1518
|
this.activeOrionRuntime = undefined;
|
|
@@ -775,6 +1531,21 @@ class WebWorkbenchController {
|
|
|
775
1531
|
if (this.suppressContextEdges > 0)
|
|
776
1532
|
return undefined;
|
|
777
1533
|
const activeSessionId = this.runtimeValue.getSession()?.id;
|
|
1534
|
+
if (event.type === 'followup_queue_changed') {
|
|
1535
|
+
// The queue is part of the Composer CAS authority. Publishing the
|
|
1536
|
+
// Runtime queue event on its own lets the browser observe new items
|
|
1537
|
+
// with an older controlRevision and guarantees a 409 on its next
|
|
1538
|
+
// edit/move/remove action. Project one complete Composer state in
|
|
1539
|
+
// this same synchronous boundary instead. Composer actions suppress
|
|
1540
|
+
// their intermediate queue edge and publish their final state below.
|
|
1541
|
+
if (activeSessionId && this.suppressComposerEdges === 0) {
|
|
1542
|
+
const state = this.composerState(activeSessionId);
|
|
1543
|
+
this.eventHub.emit({ type: 'composer_state_changed', state }, true, {
|
|
1544
|
+
sessionId: activeSessionId,
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
return undefined;
|
|
1548
|
+
}
|
|
778
1549
|
const activeThread = activeSessionId && this.activeOrionRuntime?.sessionId === activeSessionId
|
|
779
1550
|
? this.activeOrionRuntime.runtime.thread.getProjection().threadId
|
|
780
1551
|
: undefined;
|
|
@@ -806,6 +1577,10 @@ class WebWorkbenchController {
|
|
|
806
1577
|
suppressAbortNotice: true,
|
|
807
1578
|
},
|
|
808
1579
|
});
|
|
1580
|
+
this.composerRevisionValue = (0, crypto_1.randomUUID)();
|
|
1581
|
+
this.composerAuthorityDigest = undefined;
|
|
1582
|
+
this.composerStoreUnsubscribe = runtime.store.subscribe(() => this.scheduleComposerStateChanged());
|
|
1583
|
+
this.composerControlsUnsubscribe = runtime.sessionComposerControls?.subscribe(() => this.scheduleComposerStateChanged());
|
|
809
1584
|
this.installWorkspaceWatchers();
|
|
810
1585
|
if (publishState)
|
|
811
1586
|
this.emitState(false);
|
|
@@ -815,13 +1590,27 @@ class WebWorkbenchController {
|
|
|
815
1590
|
return;
|
|
816
1591
|
if (advanceRevision)
|
|
817
1592
|
this.contextRevisionValue = (0, crypto_1.randomUUID)();
|
|
1593
|
+
if (advanceRevision)
|
|
1594
|
+
this.composerRevisionValue = (0, crypto_1.randomUUID)();
|
|
818
1595
|
const workspace = this.activeWorkspaceEntry();
|
|
1596
|
+
const sessionId = this.runtimeValue.getSession()?.id ?? null;
|
|
1597
|
+
if (sessionId) {
|
|
1598
|
+
try {
|
|
1599
|
+
this.composerAuthorityDigest = composerAuthorityDigest(this.projectComposerStateValue(requireSession(sessionId)));
|
|
1600
|
+
}
|
|
1601
|
+
catch {
|
|
1602
|
+
this.composerAuthorityDigest = undefined;
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
else {
|
|
1606
|
+
this.composerAuthorityDigest = undefined;
|
|
1607
|
+
}
|
|
819
1608
|
this.eventHub.emit({
|
|
820
1609
|
type: 'workbench_state',
|
|
821
1610
|
contextRevision: this.contextRevisionValue,
|
|
822
1611
|
workspaceId: workspace.id,
|
|
823
1612
|
workspace: this.workspaceValue,
|
|
824
|
-
activeSessionId:
|
|
1613
|
+
activeSessionId: sessionId,
|
|
825
1614
|
});
|
|
826
1615
|
}
|
|
827
1616
|
emitWorkspaceResourceInvalidation(reason) {
|
|
@@ -848,6 +1637,42 @@ class WebWorkbenchController {
|
|
|
848
1637
|
}, 120);
|
|
849
1638
|
this.resourceInvalidationTimer.unref();
|
|
850
1639
|
}
|
|
1640
|
+
bumpComposerRevision() {
|
|
1641
|
+
this.composerRevisionValue = (0, crypto_1.randomUUID)();
|
|
1642
|
+
}
|
|
1643
|
+
scheduleComposerStateChanged() {
|
|
1644
|
+
if (this.closed ||
|
|
1645
|
+
this.suppressComposerEdges > 0 ||
|
|
1646
|
+
this.suppressContextEdges > 0 ||
|
|
1647
|
+
!this.runtimeValue.getSession()) {
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
if (this.composerChangeTimer)
|
|
1651
|
+
clearTimeout(this.composerChangeTimer);
|
|
1652
|
+
this.composerChangeTimer = setTimeout(() => {
|
|
1653
|
+
this.composerChangeTimer = undefined;
|
|
1654
|
+
const sessionId = this.runtimeValue.getSession()?.id;
|
|
1655
|
+
if (!sessionId || this.closed || this.suppressComposerEdges > 0)
|
|
1656
|
+
return;
|
|
1657
|
+
try {
|
|
1658
|
+
const state = this.composerState(sessionId);
|
|
1659
|
+
this.eventHub.emit({ type: 'composer_state_changed', state }, true, { sessionId });
|
|
1660
|
+
}
|
|
1661
|
+
catch {
|
|
1662
|
+
// A concurrent Context transition publishes a fresh baseline instead.
|
|
1663
|
+
}
|
|
1664
|
+
}, 100);
|
|
1665
|
+
this.composerChangeTimer.unref();
|
|
1666
|
+
}
|
|
1667
|
+
closeComposerObserver() {
|
|
1668
|
+
this.composerStoreUnsubscribe?.();
|
|
1669
|
+
this.composerStoreUnsubscribe = undefined;
|
|
1670
|
+
this.composerControlsUnsubscribe?.();
|
|
1671
|
+
this.composerControlsUnsubscribe = undefined;
|
|
1672
|
+
if (this.composerChangeTimer)
|
|
1673
|
+
clearTimeout(this.composerChangeTimer);
|
|
1674
|
+
this.composerChangeTimer = undefined;
|
|
1675
|
+
}
|
|
851
1676
|
installWorkspaceWatchers() {
|
|
852
1677
|
const watchPaths = [this.workspaceValue, (0, path_1.resolve)(this.workspaceValue, '.git')].filter(path => (0, fs_1.existsSync)(path));
|
|
853
1678
|
for (const path of watchPaths) {
|
|
@@ -929,6 +1754,7 @@ class WebWorkbenchController {
|
|
|
929
1754
|
this.rememberSessionView(sessionId, activation.view);
|
|
930
1755
|
}
|
|
931
1756
|
this.activeOrionRuntime = { runtime, sessionId };
|
|
1757
|
+
this.activeOrionRuntimes.set(sessionId, runtime);
|
|
932
1758
|
}
|
|
933
1759
|
catch (error) {
|
|
934
1760
|
unsubscribe();
|
|
@@ -938,6 +1764,9 @@ class WebWorkbenchController {
|
|
|
938
1764
|
unsubscribe();
|
|
939
1765
|
if (this.activeOrionRuntime?.runtime === runtime)
|
|
940
1766
|
this.activeOrionRuntime = undefined;
|
|
1767
|
+
if (this.activeOrionRuntimes.get(sessionId) === runtime) {
|
|
1768
|
+
this.activeOrionRuntimes.delete(sessionId);
|
|
1769
|
+
}
|
|
941
1770
|
};
|
|
942
1771
|
}
|
|
943
1772
|
loadSessionView(session, activeProjection) {
|
|
@@ -986,20 +1815,47 @@ class WebWorkbenchController {
|
|
|
986
1815
|
assertReadyForTransition(operation) {
|
|
987
1816
|
if (this.closed)
|
|
988
1817
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
|
|
989
|
-
if (this.transition || this.
|
|
1818
|
+
if (this.transition || this.activeMutationCount > 0) {
|
|
990
1819
|
throw new errors_1.WebWorkbenchError(409, 'A workspace transition is running.', 'runtime_busy');
|
|
991
1820
|
}
|
|
992
1821
|
if (this.controllerValue.hasActiveTurn()) {
|
|
993
1822
|
throw new errors_1.WebWorkbenchError(409, `Cannot ${operation} while a turn is active.`, 'runtime_busy');
|
|
994
1823
|
}
|
|
1824
|
+
const activeActor = this.sessionRegistry
|
|
1825
|
+
.summaries()
|
|
1826
|
+
.find(runtime => ['starting', 'queued', 'running', 'waiting_approval', 'stopping'].includes(runtime.phase));
|
|
1827
|
+
if (activeActor) {
|
|
1828
|
+
throw new errors_1.WebWorkbenchError(409, `Cannot ${operation} while Session ${activeActor.sessionId} is ${activeActor.phase}.`, 'runtime_busy');
|
|
1829
|
+
}
|
|
995
1830
|
}
|
|
996
1831
|
assertMutationAdmission() {
|
|
997
1832
|
if (this.closed)
|
|
998
1833
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
|
|
999
|
-
if (this.transition
|
|
1834
|
+
if (this.transition) {
|
|
1000
1835
|
throw new errors_1.WebWorkbenchError(409, 'A Context transition is running.', 'runtime_busy');
|
|
1001
1836
|
}
|
|
1002
1837
|
}
|
|
1838
|
+
reserveMutation(contextTransition) {
|
|
1839
|
+
this.assertMutationAdmission();
|
|
1840
|
+
if (contextTransition) {
|
|
1841
|
+
if (this.contextTransitionReserved || this.activeMutationCount > 0) {
|
|
1842
|
+
throw new errors_1.WebWorkbenchError(409, 'Another mutation is still running.', 'runtime_busy');
|
|
1843
|
+
}
|
|
1844
|
+
this.contextTransitionReserved = true;
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
if (this.contextTransitionReserved) {
|
|
1848
|
+
throw new errors_1.WebWorkbenchError(409, 'A Context transition is being admitted.', 'runtime_busy');
|
|
1849
|
+
}
|
|
1850
|
+
this.activeMutationCount += 1;
|
|
1851
|
+
}
|
|
1852
|
+
releaseMutation(contextTransition) {
|
|
1853
|
+
if (contextTransition) {
|
|
1854
|
+
this.contextTransitionReserved = false;
|
|
1855
|
+
return;
|
|
1856
|
+
}
|
|
1857
|
+
this.activeMutationCount = Math.max(0, this.activeMutationCount - 1);
|
|
1858
|
+
}
|
|
1003
1859
|
assertContextGuard(context) {
|
|
1004
1860
|
this.assertMutationAdmission();
|
|
1005
1861
|
if (context.expectedContextRevision !== this.contextRevisionValue ||
|
|
@@ -1010,13 +1866,25 @@ class WebWorkbenchController {
|
|
|
1010
1866
|
assertCommandSession(expectedSessionId) {
|
|
1011
1867
|
if (this.closed)
|
|
1012
1868
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
|
|
1013
|
-
if (this.transition
|
|
1869
|
+
if (this.transition) {
|
|
1014
1870
|
throw new errors_1.WebWorkbenchError(409, 'A Session transition is running.', 'runtime_busy');
|
|
1015
1871
|
}
|
|
1016
1872
|
if (this.runtimeValue.getSession()?.id !== expectedSessionId) {
|
|
1017
1873
|
throw new errors_1.WebWorkbenchError(409, 'The active Session changed before the command was admitted.', 'active_session_changed');
|
|
1018
1874
|
}
|
|
1019
1875
|
}
|
|
1876
|
+
assertSessionWorkspace(session) {
|
|
1877
|
+
if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
|
|
1878
|
+
throw new errors_1.WebWorkbenchError(409, 'Session belongs to another Workspace.', 'session_workspace_conflict');
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
sessionActorKey(session) {
|
|
1882
|
+
this.assertSessionWorkspace(session);
|
|
1883
|
+
return Object.freeze({
|
|
1884
|
+
workspaceId: this.activeWorkspaceEntry().id,
|
|
1885
|
+
sessionId: session.id,
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1020
1888
|
assertSettingsAvailable() {
|
|
1021
1889
|
if (this.closed) {
|
|
1022
1890
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.', 'settings_document_unavailable');
|
|
@@ -1063,6 +1931,14 @@ function mapWorkspaceRegistryError(error) {
|
|
|
1063
1931
|
}
|
|
1064
1932
|
return new errors_1.WebWorkbenchError(503, 'Workspace registry is unavailable.');
|
|
1065
1933
|
}
|
|
1934
|
+
function mapSessionRuntimeError(error) {
|
|
1935
|
+
if (error instanceof errors_1.WebWorkbenchError)
|
|
1936
|
+
return error;
|
|
1937
|
+
if (error instanceof session_runtime_registry_1.WebSessionRuntimeRegistryError) {
|
|
1938
|
+
return new errors_1.WebWorkbenchError(error.status, error.message, error.code);
|
|
1939
|
+
}
|
|
1940
|
+
throw error;
|
|
1941
|
+
}
|
|
1066
1942
|
function mapSettingsError(error) {
|
|
1067
1943
|
if (error instanceof errors_1.WebWorkbenchError)
|
|
1068
1944
|
return error;
|
|
@@ -1071,6 +1947,53 @@ function mapSettingsError(error) {
|
|
|
1071
1947
|
}
|
|
1072
1948
|
return new errors_1.WebWorkbenchError(503, 'The product Settings coordinator is unavailable.', 'settings_document_unavailable');
|
|
1073
1949
|
}
|
|
1950
|
+
function mapComposerControlError(error) {
|
|
1951
|
+
if (error instanceof errors_1.WebWorkbenchError)
|
|
1952
|
+
return error;
|
|
1953
|
+
if (error instanceof agent_runtime_controller_1.FollowupQueueConflictError) {
|
|
1954
|
+
return new errors_1.WebWorkbenchError(409, error.message, error.code);
|
|
1955
|
+
}
|
|
1956
|
+
if (error instanceof session_composer_control_1.SessionComposerControlError) {
|
|
1957
|
+
const status = error.code === 'composer_recovery_required'
|
|
1958
|
+
? 503
|
|
1959
|
+
: ['runtime_busy', 'composer_control_conflict'].includes(error.code)
|
|
1960
|
+
? 409
|
|
1961
|
+
: 422;
|
|
1962
|
+
return new errors_1.WebWorkbenchError(status, error.message, error.code);
|
|
1963
|
+
}
|
|
1964
|
+
if (error instanceof plan_review_1.PlanReviewControlError) {
|
|
1965
|
+
const status = error.code === 'plan_review_invalid' ? 422 : 409;
|
|
1966
|
+
return new errors_1.WebWorkbenchError(status, error.message, error.code);
|
|
1967
|
+
}
|
|
1968
|
+
return new errors_1.WebWorkbenchError(503, 'The Session Composer control action failed.', 'composer_control_failed');
|
|
1969
|
+
}
|
|
1970
|
+
function mapContextReferenceError(error) {
|
|
1971
|
+
if (error instanceof errors_1.WebWorkbenchError) {
|
|
1972
|
+
if (error.code.startsWith('context_reference_'))
|
|
1973
|
+
return error;
|
|
1974
|
+
if (error.status === 403 ||
|
|
1975
|
+
['sensitive_file_blocked', 'file_binary', 'file_not_regular'].includes(error.code)) {
|
|
1976
|
+
return new errors_1.WebWorkbenchError(403, 'The Context reference is not available to the model.', 'context_reference_forbidden');
|
|
1977
|
+
}
|
|
1978
|
+
if (error.status === 404 || error.status === 409) {
|
|
1979
|
+
return new errors_1.WebWorkbenchError(409, 'The Context reference changed or is no longer available.', 'context_reference_stale');
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
return new errors_1.WebWorkbenchError(422, 'The Context reference could not be resolved.', 'context_reference_invalid');
|
|
1983
|
+
}
|
|
1984
|
+
function composerAuthorityDigest(state) {
|
|
1985
|
+
return (0, canonical_1.digestRuntimeValue)({
|
|
1986
|
+
workspaceId: state.workspaceId,
|
|
1987
|
+
sessionId: state.sessionId,
|
|
1988
|
+
mode: state.mode,
|
|
1989
|
+
model: state.model,
|
|
1990
|
+
permission: state.permission,
|
|
1991
|
+
pending: state.pending,
|
|
1992
|
+
lastError: state.lastError,
|
|
1993
|
+
planReview: state.planReview,
|
|
1994
|
+
queue: state.queue,
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1074
1997
|
function pickPlanReceipt(receipt) {
|
|
1075
1998
|
return Object.freeze({
|
|
1076
1999
|
body: receipt.plan,
|
|
@@ -1227,6 +2150,22 @@ function decodePageCursor(cursor) {
|
|
|
1227
2150
|
throw new errors_1.WebWorkbenchError(400, 'Page cursor is invalid.');
|
|
1228
2151
|
}
|
|
1229
2152
|
}
|
|
2153
|
+
function estimateSessionActorBytes(actor) {
|
|
2154
|
+
try {
|
|
2155
|
+
return Math.max(256 * 1024, Buffer.byteLength(JSON.stringify(actor.runtime.store.getSnapshot()), 'utf8'));
|
|
2156
|
+
}
|
|
2157
|
+
catch {
|
|
2158
|
+
return 256 * 1024;
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
async function captureShutdownFailure(failures, operation) {
|
|
2162
|
+
try {
|
|
2163
|
+
await operation();
|
|
2164
|
+
}
|
|
2165
|
+
catch (error) {
|
|
2166
|
+
failures.push(error);
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
1230
2169
|
function canonicalDirectory(path) {
|
|
1231
2170
|
const candidate = (0, path_1.resolve)(path);
|
|
1232
2171
|
let canonical;
|