@orion-agents/orion-code 0.3.2 → 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 +83 -0
- package/README.md +46 -18
- package/README.zh-CN.md +36 -16
- package/dist/runtime/agent-runtime-controller.d.ts +1 -0
- package/dist/runtime/agent-runtime-controller.js +92 -41
- 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 +2 -0
- package/dist/runtime/orion-session-runner.js +12 -4
- package/dist/runtime/product-bootstrap.d.ts +6 -0
- package/dist/runtime/product-bootstrap.js +389 -337
- package/dist/runtime/product-orion-runtime.d.ts +5 -0
- package/dist/runtime/product-orion-runtime.js +2 -0
- package/dist/runtime/release-receipts.d.ts +7 -3
- package/dist/runtime/release-receipts.js +79 -1
- 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 +19 -0
- package/dist/runtime/thread-projection.js +12 -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 +3 -0
- 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/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 +43 -6
- package/dist/web/file-read-service.d.ts +2 -0
- package/dist/web/file-read-service.js +39 -12
- package/dist/web/git-read-model-service.js +7 -0
- package/dist/web/protocol.d.ts +51 -3
- package/dist/web/protocol.js +38 -2
- package/dist/web/review-service.d.ts +1 -0
- package/dist/web/review-service.js +1 -0
- package/dist/web/server.js +30 -6
- package/dist/web/session-runtime-registry.d.ts +124 -0
- package/dist/web/session-runtime-registry.js +448 -0
- package/dist/web/terminal-manager.js +23 -4
- package/dist/web/terminal-server.js +35 -6
- package/dist/web/workbench-controller.d.ts +27 -3
- package/dist/web/workbench-controller.js +557 -134
- 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-eaQNsnCh.js → DiffViewer-D6mG729y.js} +1 -1
- package/dist/web-client/assets/FilesPanel-CCDoAZ1J.js +2 -0
- package/dist/web-client/assets/{GitPanel-CnU4XVr7.js → GitPanel-DtNgiH7A.js} +1 -1
- package/dist/web-client/assets/ReviewPanel-CKEBSt6P.js +1 -0
- package/dist/web-client/assets/{TerminalPanel-Q5mSSsoK.js → TerminalPanel-CNxMaBLp.js} +14 -14
- 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/v0.3.3-web-api.yaml +3205 -0
- package/docs/architecture/v0.3.4-stabilization-contract.md +32 -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.3-plan.md +1113 -0
- package/docs/plan/v0.3.4-stabilization-plan.md +89 -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 +10 -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/plan-review.d.ts.map +0 -1
- package/dist/runtime/plan-review.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-composer-control.d.ts.map +0 -1
- package/dist/runtime/session-composer-control.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-DYs1MhoM.js +0 -2
- package/dist/web-client/assets/ReviewPanel-BDxG670T.js +0 -1
- package/dist/web-client/assets/index-BWV5sIvw.css +0 -1
- package/dist/web-client/assets/index-VVUKj6FE.js +0 -17
|
@@ -12,6 +12,7 @@ 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
14
|
const plan_review_1 = require("../runtime/plan-review");
|
|
15
|
+
const thread_event_store_1 = require("../runtime/thread-event-store");
|
|
15
16
|
const thread_session_index_1 = require("../runtime/thread-session-index");
|
|
16
17
|
const thread_session_view_1 = require("../runtime/thread-session-view");
|
|
17
18
|
const tool_detail_repository_1 = require("../runtime/tool-detail-repository");
|
|
@@ -26,8 +27,10 @@ const errors_1 = require("./errors");
|
|
|
26
27
|
const event_hub_1 = require("./event-hub");
|
|
27
28
|
const file_read_service_1 = require("./file-read-service");
|
|
28
29
|
const git_read_model_service_1 = require("./git-read-model-service");
|
|
30
|
+
const workspace_mutation_arbiter_1 = require("./workspace-mutation-arbiter");
|
|
29
31
|
const protocol_1 = require("./protocol");
|
|
30
32
|
const review_service_1 = require("./review-service");
|
|
33
|
+
const session_runtime_registry_1 = require("./session-runtime-registry");
|
|
31
34
|
const terminal_manager_1 = require("./terminal-manager");
|
|
32
35
|
var errors_2 = require("./errors");
|
|
33
36
|
Object.defineProperty(exports, "WebWorkbenchError", { enumerable: true, get: function () { return errors_2.WebWorkbenchError; } });
|
|
@@ -35,23 +38,31 @@ const SESSION_VIEW_CACHE_BYTES = 16 * 1024 * 1024;
|
|
|
35
38
|
const MAX_MUTATION_RESULTS = 4096;
|
|
36
39
|
const MAX_CONTEXT_REFERENCE_BYTES = 64 * 1024;
|
|
37
40
|
const MAX_CONTEXT_MANIFEST_BYTES = 256 * 1024;
|
|
38
|
-
|
|
41
|
+
const CONTEXT_TRANSITION_MUTATIONS = new Set(['context.activate', 'workspace.activate']);
|
|
42
|
+
/** Owns the Workspace surface plus the bounded Web Session actor registry. */
|
|
39
43
|
class WebWorkbenchController {
|
|
40
44
|
constructor(options) {
|
|
45
|
+
this.activeOrionRuntimes = new Map();
|
|
41
46
|
this.mutationResults = new Map();
|
|
42
47
|
this.sessionViews = new Map();
|
|
43
48
|
this.sessionViewBytes = 0;
|
|
44
49
|
this.toolDetails = new tool_detail_repository_1.FileToolDetailRepository();
|
|
50
|
+
this.workspaceMutationOwners = new Map();
|
|
51
|
+
this.pendingWorkspaceMutationStates = new Map();
|
|
45
52
|
this.contextRevisionValue = (0, crypto_1.randomUUID)();
|
|
46
53
|
this.composerRevisionValue = (0, crypto_1.randomUUID)();
|
|
47
54
|
this.suppressComposerEdges = 0;
|
|
48
55
|
this.suppressContextEdges = 0;
|
|
49
56
|
this.latestStatus = 'Ready';
|
|
50
|
-
this.
|
|
57
|
+
this.activeMutationCount = 0;
|
|
58
|
+
this.contextTransitionReserved = false;
|
|
51
59
|
this.closed = false;
|
|
52
60
|
this.workspaceWatchers = [];
|
|
53
61
|
this.workspaceValue = canonicalDirectory(options.cwd);
|
|
54
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
|
+
});
|
|
55
66
|
this.workspaceRegistry = options.workspaceRegistry ?? new workspace_registry_1.WorkspaceRegistryV1();
|
|
56
67
|
this.terminalManager = new terminal_manager_1.TerminalManagerV1({
|
|
57
68
|
resolveWorkspace: workspaceId => this.workspaceRegistry.find(workspaceId)?.canonicalPath,
|
|
@@ -69,6 +80,7 @@ class WebWorkbenchController {
|
|
|
69
80
|
options.createRuntime ??
|
|
70
81
|
(cwd => (0, product_bootstrap_1.createProductUiRuntime)({
|
|
71
82
|
cwd,
|
|
83
|
+
workspaceMutationCoordinator: this.workspaceMutations,
|
|
72
84
|
shutdownReason: 'Orion Web Workbench shutdown',
|
|
73
85
|
onActiveSessionRuntime: (runtime, sessionId, activation) => this.observeThreadRuntime(runtime, sessionId, activation),
|
|
74
86
|
onSettingsInvalidated: event => {
|
|
@@ -82,6 +94,17 @@ class WebWorkbenchController {
|
|
|
82
94
|
}, false);
|
|
83
95
|
},
|
|
84
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();
|
|
85
108
|
}
|
|
86
109
|
static async create(options) {
|
|
87
110
|
const workbench = new WebWorkbenchController(options);
|
|
@@ -259,10 +282,12 @@ class WebWorkbenchController {
|
|
|
259
282
|
if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
|
|
260
283
|
throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
|
|
261
284
|
}
|
|
262
|
-
const
|
|
263
|
-
const
|
|
264
|
-
|
|
265
|
-
|
|
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();
|
|
266
291
|
let indexedPage;
|
|
267
292
|
if (tail) {
|
|
268
293
|
try {
|
|
@@ -352,13 +377,26 @@ class WebWorkbenchController {
|
|
|
352
377
|
: [];
|
|
353
378
|
const commits = commitProjections.map(commit => (0, turn_commit_1.parseTurnCommitV1)(commit.receipt));
|
|
354
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;
|
|
355
393
|
const planCommit = [...commits].reverse().find(commit => commit.planReceipt);
|
|
356
394
|
const plan = planCommit?.planReceipt
|
|
357
395
|
? pickPlanReceipt((0, turn_commit_1.parsePlanReceiptV1)(planCommit.planReceipt))
|
|
358
396
|
: null;
|
|
359
|
-
const state = this.runtimeValue.store.getSnapshot();
|
|
397
|
+
const state = (actor?.runtime ?? this.runtimeValue).store.getSnapshot();
|
|
360
398
|
const pendingPermissions = active
|
|
361
|
-
?
|
|
399
|
+
? actor.controller.getPendingPermissions().map(request => ({
|
|
362
400
|
id: request.id,
|
|
363
401
|
toolName: request.name,
|
|
364
402
|
...(request.reason ? { reason: request.reason } : {}),
|
|
@@ -374,9 +412,16 @@ class WebWorkbenchController {
|
|
|
374
412
|
state: JSON.parse(latestCommit.goalState),
|
|
375
413
|
}
|
|
376
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 });
|
|
377
421
|
const snapshot = Object.freeze({
|
|
378
422
|
apiVersion: protocol_1.WEB_API_VERSION,
|
|
379
423
|
session: (0, protocol_1.projectSessionSummary)(session),
|
|
424
|
+
sessionRuntime,
|
|
380
425
|
threadId: activeProjection?.threadId ?? indexedPage?.threadId ?? view?.threadId ?? null,
|
|
381
426
|
threadCursor: activeProjection?.cursor ?? indexedPage?.cursor ?? view?.cursor ?? 0,
|
|
382
427
|
eventCursor: this.eventHub.snapshot().latest,
|
|
@@ -393,8 +438,8 @@ class WebWorkbenchController {
|
|
|
393
438
|
processing: active ? state.isProcessing : false,
|
|
394
439
|
agentMode: state.agentMode,
|
|
395
440
|
permissionMode: state.permissionMode,
|
|
396
|
-
status:
|
|
397
|
-
followups: active ? Object.freeze([...
|
|
441
|
+
status: actor?.latestStatus ?? 'Ready',
|
|
442
|
+
followups: active ? Object.freeze([...actor.controller.getFollowupQueue()]) : [],
|
|
398
443
|
followupLimit: 16,
|
|
399
444
|
contextUsage: active ? state.contextUsage : null,
|
|
400
445
|
tokenUsage: active ? state.tokenUsage : null,
|
|
@@ -402,7 +447,7 @@ class WebWorkbenchController {
|
|
|
402
447
|
pendingApprovals: Object.freeze(pendingPermissions),
|
|
403
448
|
goal,
|
|
404
449
|
plan,
|
|
405
|
-
composer
|
|
450
|
+
composer,
|
|
406
451
|
recoveryDiagnostics: indexedPage ? [] : (view?.diagnostics ?? []),
|
|
407
452
|
});
|
|
408
453
|
if (context)
|
|
@@ -412,61 +457,82 @@ class WebWorkbenchController {
|
|
|
412
457
|
composerState(sessionId, context) {
|
|
413
458
|
if (context)
|
|
414
459
|
this.assertContextGuard(context);
|
|
415
|
-
this.assertCommandSession(sessionId);
|
|
416
460
|
const session = requireSession(sessionId);
|
|
417
|
-
|
|
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);
|
|
418
466
|
if (context)
|
|
419
467
|
this.assertContextGuard(context);
|
|
420
468
|
return state;
|
|
421
469
|
}
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
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);
|
|
426
483
|
// Durable Thread and Store authority can advance before the debounced SSE
|
|
427
484
|
// observer runs. Keep every projected control state and its CAS token in
|
|
428
485
|
// the same synchronous boundary so the UI never receives new controls
|
|
429
486
|
// paired with an older revision.
|
|
430
487
|
const authorityDigest = composerAuthorityDigest(state);
|
|
431
|
-
if (
|
|
432
|
-
|
|
488
|
+
if (actor.composerAuthorityDigest === undefined) {
|
|
489
|
+
actor.composerAuthorityDigest = authorityDigest;
|
|
433
490
|
return state;
|
|
434
491
|
}
|
|
435
|
-
if (authorityDigest ===
|
|
492
|
+
if (authorityDigest === actor.composerAuthorityDigest)
|
|
436
493
|
return state;
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
return Object.freeze({ ...state, controlRevision:
|
|
440
|
-
}
|
|
441
|
-
projectComposerStateValue(session,
|
|
442
|
-
const
|
|
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;
|
|
443
502
|
if (!controls) {
|
|
444
503
|
throw new errors_1.WebWorkbenchError(503, 'Session Composer controls are unavailable.', 'composer_controls_unavailable');
|
|
445
504
|
}
|
|
446
505
|
const runtime = controls.describeSession(session);
|
|
447
|
-
const queue =
|
|
448
|
-
?
|
|
506
|
+
const queue = actor
|
|
507
|
+
? actor.controller.getFollowupQueueSnapshot()
|
|
449
508
|
: { items: [], limit: 16 };
|
|
450
|
-
const projection =
|
|
451
|
-
? this.
|
|
509
|
+
const projection = actor
|
|
510
|
+
? this.activeOrionRuntimes.get(session.id)?.thread.getProjection()
|
|
452
511
|
: undefined;
|
|
453
|
-
const review = projection?.planReview;
|
|
454
|
-
const
|
|
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 });
|
|
455
520
|
return Object.freeze({
|
|
456
521
|
apiVersion: protocol_1.WEB_API_VERSION,
|
|
457
|
-
workspaceId
|
|
522
|
+
workspaceId,
|
|
458
523
|
sessionId: session.id,
|
|
459
524
|
contextRevision: this.contextRevisionValue,
|
|
460
|
-
controlRevision:
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
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() })
|
|
465
531
|
: Object.freeze({ baseMode: 'interactive', pendingBaseMode: null }),
|
|
466
532
|
model: runtime.model,
|
|
467
533
|
permission: runtime.permission,
|
|
468
534
|
contextUsage: runtime.contextUsage,
|
|
469
|
-
compactAvailable:
|
|
535
|
+
compactAvailable: controller?.canCompactContext() ?? false,
|
|
470
536
|
pending: runtime.pending,
|
|
471
537
|
lastError: runtime.lastError,
|
|
472
538
|
planReview: review
|
|
@@ -489,8 +555,10 @@ class WebWorkbenchController {
|
|
|
489
555
|
modelCatalog(sessionId, context) {
|
|
490
556
|
if (context)
|
|
491
557
|
this.assertContextGuard(context);
|
|
492
|
-
|
|
493
|
-
|
|
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;
|
|
494
562
|
if (!controls) {
|
|
495
563
|
throw new errors_1.WebWorkbenchError(503, 'Session model catalog is unavailable.', 'composer_controls_unavailable');
|
|
496
564
|
}
|
|
@@ -501,12 +569,29 @@ class WebWorkbenchController {
|
|
|
501
569
|
}
|
|
502
570
|
async applyComposerAction(input) {
|
|
503
571
|
this.assertContextGuard(input);
|
|
504
|
-
|
|
505
|
-
|
|
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);
|
|
506
591
|
if (input.expectedControlRevision !== admittedState.controlRevision) {
|
|
507
592
|
throw new errors_1.WebWorkbenchError(409, 'Composer controls changed before the action was admitted.', 'composer_control_conflict');
|
|
508
593
|
}
|
|
509
|
-
const controls =
|
|
594
|
+
const controls = actor.runtime.sessionComposerControls;
|
|
510
595
|
if (!controls) {
|
|
511
596
|
throw new errors_1.WebWorkbenchError(503, 'Session Composer controls are unavailable.', 'composer_controls_unavailable');
|
|
512
597
|
}
|
|
@@ -515,11 +600,11 @@ class WebWorkbenchController {
|
|
|
515
600
|
let modelReceipt;
|
|
516
601
|
let permissionReceipt;
|
|
517
602
|
let planReviewReceipt;
|
|
518
|
-
|
|
603
|
+
actor.suppressComposerEdges += 1;
|
|
519
604
|
try {
|
|
520
605
|
switch (input.type) {
|
|
521
606
|
case 'set_agent_mode': {
|
|
522
|
-
const result =
|
|
607
|
+
const result = actor.controller.setAgentMode(input.mode);
|
|
523
608
|
outcome =
|
|
524
609
|
result.type === 'agent_mode_changed' && result.appliesFrom === 'next-logical-request'
|
|
525
610
|
? 'deferred'
|
|
@@ -543,7 +628,7 @@ class WebWorkbenchController {
|
|
|
543
628
|
outcome = modelReceipt.appliesFrom === 'next-logical-request' ? 'deferred' : 'applied';
|
|
544
629
|
break;
|
|
545
630
|
case 'compact_context': {
|
|
546
|
-
const result = await
|
|
631
|
+
const result = await actor.controller.compactContext();
|
|
547
632
|
if (result.status === 'rejected') {
|
|
548
633
|
throw new errors_1.WebWorkbenchError(409, 'Context compact was rejected.', 'runtime_busy');
|
|
549
634
|
}
|
|
@@ -551,24 +636,24 @@ class WebWorkbenchController {
|
|
|
551
636
|
break;
|
|
552
637
|
}
|
|
553
638
|
case 'edit_queue_item':
|
|
554
|
-
detail = JSON.stringify(
|
|
639
|
+
detail = JSON.stringify(actor.controller.editFollowupQueueItem(input.itemId, input.expectedItemRevision, input.text));
|
|
555
640
|
break;
|
|
556
641
|
case 'move_queue_item':
|
|
557
|
-
detail = JSON.stringify(
|
|
642
|
+
detail = JSON.stringify(actor.controller.moveFollowupQueueItem(input.itemId, input.expectedItemRevision, input.targetIndex));
|
|
558
643
|
break;
|
|
559
644
|
case 'remove_queue_item':
|
|
560
|
-
detail = JSON.stringify(
|
|
645
|
+
detail = JSON.stringify(actor.controller.removeFollowupQueueItem(input.itemId, input.expectedItemRevision));
|
|
561
646
|
break;
|
|
562
647
|
case 'review_plan': {
|
|
563
|
-
planReviewReceipt = await
|
|
648
|
+
planReviewReceipt = await actor.controller.reviewPlan({
|
|
564
649
|
planDigest: input.planDigest,
|
|
565
650
|
action: input.action,
|
|
566
651
|
...(input.feedback ? { feedback: input.feedback } : {}),
|
|
567
652
|
});
|
|
568
653
|
if (input.action === 'approve')
|
|
569
|
-
|
|
654
|
+
actor.controller.setAgentMode('interactive');
|
|
570
655
|
else if (input.action === 'continue')
|
|
571
|
-
|
|
656
|
+
actor.controller.setAgentMode('plan');
|
|
572
657
|
detail = JSON.stringify(planReviewReceipt.admission);
|
|
573
658
|
break;
|
|
574
659
|
}
|
|
@@ -578,18 +663,18 @@ class WebWorkbenchController {
|
|
|
578
663
|
throw mapComposerControlError(error);
|
|
579
664
|
}
|
|
580
665
|
finally {
|
|
581
|
-
|
|
666
|
+
actor.suppressComposerEdges -= 1;
|
|
582
667
|
}
|
|
583
|
-
|
|
584
|
-
const state = this.projectComposerStateValue(
|
|
585
|
-
|
|
668
|
+
actor.composerRevision = (0, crypto_1.randomUUID)();
|
|
669
|
+
const state = this.projectComposerStateValue(actorSession, actor);
|
|
670
|
+
actor.composerAuthorityDigest = composerAuthorityDigest(state);
|
|
586
671
|
this.eventHub.emit({ type: 'composer_state_changed', state }, true, {
|
|
587
672
|
sessionId: input.expectedSessionId,
|
|
588
673
|
});
|
|
589
674
|
return Object.freeze({
|
|
590
675
|
requestId: input.requestId,
|
|
591
676
|
outcome,
|
|
592
|
-
controlRevision:
|
|
677
|
+
controlRevision: actor.composerRevision,
|
|
593
678
|
state,
|
|
594
679
|
...(modelReceipt ? { modelReceipt } : {}),
|
|
595
680
|
...(permissionReceipt ? { permissionReceipt } : {}),
|
|
@@ -727,56 +812,28 @@ class WebWorkbenchController {
|
|
|
727
812
|
return result;
|
|
728
813
|
}
|
|
729
814
|
async createSession(name, context) {
|
|
730
|
-
this.assertReadyForTransition('create a session');
|
|
731
815
|
if (context)
|
|
732
816
|
this.assertContextGuard(context);
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
await this.runtimeValue.rebindSessionRuntime?.();
|
|
742
|
-
this.eventHub.emitRuntime({ type: 'transcript_clear' });
|
|
743
|
-
this.emitState();
|
|
744
|
-
return (0, protocol_1.projectSessionSummary)(named);
|
|
745
|
-
}
|
|
746
|
-
finally {
|
|
747
|
-
this.sessionTransition = false;
|
|
748
|
-
}
|
|
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);
|
|
749
825
|
}
|
|
750
826
|
async activateSession(sessionId, context) {
|
|
751
|
-
this.assertReadyForTransition('switch sessions');
|
|
752
827
|
if (context)
|
|
753
828
|
this.assertContextGuard(context);
|
|
754
|
-
|
|
755
|
-
this.
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
const result = this.controllerValue.handle({
|
|
763
|
-
type: 'select_session',
|
|
764
|
-
sessionId: session.id,
|
|
765
|
-
source: 'programmatic',
|
|
766
|
-
});
|
|
767
|
-
await this.controllerValue.waitForIdle();
|
|
768
|
-
if (this.runtimeValue.getSession()?.id !== session.id) {
|
|
769
|
-
throw new errors_1.WebWorkbenchError(409, 'Session activation was rejected by the runtime.');
|
|
770
|
-
}
|
|
771
|
-
activated = true;
|
|
772
|
-
return { requestId: `activate:${session.id}`, result: result.type };
|
|
773
|
-
}
|
|
774
|
-
finally {
|
|
775
|
-
this.suppressContextEdges -= 1;
|
|
776
|
-
this.sessionTransition = false;
|
|
777
|
-
if (activated)
|
|
778
|
-
this.emitState();
|
|
779
|
-
}
|
|
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
|
+
};
|
|
780
837
|
}
|
|
781
838
|
renameSession(sessionId, name, context) {
|
|
782
839
|
if (context)
|
|
@@ -785,9 +842,12 @@ class WebWorkbenchController {
|
|
|
785
842
|
if (canonicalDirectory(session.projectPath) !== this.workspaceValue) {
|
|
786
843
|
throw new errors_1.WebWorkbenchError(409, 'Session belongs to another workspace.');
|
|
787
844
|
}
|
|
788
|
-
|
|
845
|
+
const normalizedName = name.trim();
|
|
846
|
+
if (!normalizedName)
|
|
847
|
+
throw new errors_1.WebWorkbenchError(400, 'Session name is required.');
|
|
848
|
+
if (normalizedName.length > 120)
|
|
789
849
|
throw new errors_1.WebWorkbenchError(400, 'Session name is too long.');
|
|
790
|
-
const updated = (0, session_storage_1.renameSession)(session.id,
|
|
850
|
+
const updated = (0, session_storage_1.renameSession)(session.id, normalizedName);
|
|
791
851
|
if (!updated)
|
|
792
852
|
throw new errors_1.WebWorkbenchError(404, 'Session no longer exists.');
|
|
793
853
|
return (0, protocol_1.projectSessionSummary)(updated);
|
|
@@ -823,10 +883,13 @@ class WebWorkbenchController {
|
|
|
823
883
|
throw new errors_1.WebWorkbenchError(409, 'Session does not belong to the requested Workspace.', 'context_session_mismatch');
|
|
824
884
|
}
|
|
825
885
|
const currentSessionId = this.runtimeValue.getSession()?.id ?? null;
|
|
826
|
-
if (targetWorkspace === this.workspaceValue
|
|
827
|
-
|
|
828
|
-
|
|
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.
|
|
829
891
|
return;
|
|
892
|
+
}
|
|
830
893
|
this.assertReadyForTransition('activate a Context');
|
|
831
894
|
const previousWorkspace = this.workspaceValue;
|
|
832
895
|
const previousSessionId = currentSessionId;
|
|
@@ -838,10 +901,11 @@ class WebWorkbenchController {
|
|
|
838
901
|
await previousController.stopActiveTurn();
|
|
839
902
|
await previousController.waitForIdle();
|
|
840
903
|
if (targetWorkspace !== previousWorkspace) {
|
|
904
|
+
await this.sessionRegistry.shutdown('Workspace Context changed');
|
|
841
905
|
await previousRuntime.shutdown();
|
|
842
906
|
await this.installRuntime(targetWorkspace, false);
|
|
907
|
+
this.sessionRegistry = this.createSessionRegistry();
|
|
843
908
|
}
|
|
844
|
-
await this.restoreContextSession(targetSession?.id ?? null);
|
|
845
909
|
this.workspaceRegistry.register(targetWorkspace, { activated: true });
|
|
846
910
|
}
|
|
847
911
|
catch (activationError) {
|
|
@@ -850,6 +914,7 @@ class WebWorkbenchController {
|
|
|
850
914
|
if (this.runtimeValue !== previousRuntime)
|
|
851
915
|
await this.runtimeValue.shutdown();
|
|
852
916
|
await this.installRuntime(previousWorkspace, false);
|
|
917
|
+
this.sessionRegistry = this.createSessionRegistry();
|
|
853
918
|
}
|
|
854
919
|
await this.restoreContextSession(previousSessionId);
|
|
855
920
|
}
|
|
@@ -875,9 +940,24 @@ class WebWorkbenchController {
|
|
|
875
940
|
dispatch(raw) {
|
|
876
941
|
const command = (0, protocol_1.parseWebCommand)(raw);
|
|
877
942
|
return this.executeMutation(command.requestId, 'command', command, async () => {
|
|
878
|
-
this.
|
|
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
|
+
}
|
|
879
960
|
const resolved = await this.resolveCommandContext(command);
|
|
880
|
-
this.assertCommandSession(command.expectedSessionId);
|
|
881
961
|
const runtimeInput = resolved && command.type === 'queue_followup'
|
|
882
962
|
? {
|
|
883
963
|
type: 'queue_followup',
|
|
@@ -886,13 +966,71 @@ class WebWorkbenchController {
|
|
|
886
966
|
source: 'programmatic',
|
|
887
967
|
}
|
|
888
968
|
: (0, protocol_1.toAgentRuntimeInput)({ ...command, ...(resolved ? { text: resolved.text } : {}) });
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
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
|
+
}
|
|
896
1034
|
});
|
|
897
1035
|
}
|
|
898
1036
|
async resolveCommandContext(command) {
|
|
@@ -1048,6 +1186,7 @@ class WebWorkbenchController {
|
|
|
1048
1186
|
return (0, redaction_1.redactTraceText)(value).split(this.workspaceValue).join('<workspace>');
|
|
1049
1187
|
}
|
|
1050
1188
|
async updateSettings(input) {
|
|
1189
|
+
this.assertContextGuard(input);
|
|
1051
1190
|
this.assertSettingsAvailable();
|
|
1052
1191
|
const update = this.runtimeValue.updateSettings;
|
|
1053
1192
|
if (!update) {
|
|
@@ -1098,10 +1237,23 @@ class WebWorkbenchController {
|
|
|
1098
1237
|
if (this.mutationResults.size >= MAX_MUTATION_RESULTS) {
|
|
1099
1238
|
throw new errors_1.WebWorkbenchError(503, 'The mutation idempotency ledger is full; restart the local Web Host before retrying.', 'mutation_capacity_exhausted');
|
|
1100
1239
|
}
|
|
1101
|
-
const
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
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
|
+
}
|
|
1105
1257
|
this.mutationResults.set(requestId, { fingerprint, result });
|
|
1106
1258
|
return result;
|
|
1107
1259
|
}
|
|
@@ -1134,9 +1286,14 @@ class WebWorkbenchController {
|
|
|
1134
1286
|
mcp: { servers: mcpServerIds(mcp) },
|
|
1135
1287
|
harness,
|
|
1136
1288
|
eventStream: this.eventHub.snapshot(),
|
|
1289
|
+
workspaceKernel: this.runtimeValue.workspaceRuntimeKernel?.diagnostics() ?? null,
|
|
1137
1290
|
performance: {
|
|
1138
1291
|
files: this.fileService.performanceCounters(),
|
|
1139
1292
|
git: this.gitService.performanceCounters(),
|
|
1293
|
+
thread: {
|
|
1294
|
+
eventStore: (0, thread_event_store_1.threadEventStorePerformanceCountersV1)(),
|
|
1295
|
+
sessionIndex: (0, thread_session_index_1.threadSessionIndexPerformanceCountersV1)(),
|
|
1296
|
+
},
|
|
1140
1297
|
},
|
|
1141
1298
|
};
|
|
1142
1299
|
if (context)
|
|
@@ -1144,16 +1301,215 @@ class WebWorkbenchController {
|
|
|
1144
1301
|
return result;
|
|
1145
1302
|
}
|
|
1146
1303
|
async shutdown() {
|
|
1147
|
-
if (this.
|
|
1148
|
-
return;
|
|
1304
|
+
if (this.shutdownResult)
|
|
1305
|
+
return this.shutdownResult;
|
|
1149
1306
|
this.closed = true;
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
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
|
+
}
|
|
1157
1513
|
}
|
|
1158
1514
|
async installRuntime(workspace, publishState = true) {
|
|
1159
1515
|
this.closeComposerObserver();
|
|
@@ -1240,7 +1596,7 @@ class WebWorkbenchController {
|
|
|
1240
1596
|
const sessionId = this.runtimeValue.getSession()?.id ?? null;
|
|
1241
1597
|
if (sessionId) {
|
|
1242
1598
|
try {
|
|
1243
|
-
this.composerAuthorityDigest = composerAuthorityDigest(this.projectComposerStateValue(requireSession(sessionId)
|
|
1599
|
+
this.composerAuthorityDigest = composerAuthorityDigest(this.projectComposerStateValue(requireSession(sessionId)));
|
|
1244
1600
|
}
|
|
1245
1601
|
catch {
|
|
1246
1602
|
this.composerAuthorityDigest = undefined;
|
|
@@ -1398,6 +1754,7 @@ class WebWorkbenchController {
|
|
|
1398
1754
|
this.rememberSessionView(sessionId, activation.view);
|
|
1399
1755
|
}
|
|
1400
1756
|
this.activeOrionRuntime = { runtime, sessionId };
|
|
1757
|
+
this.activeOrionRuntimes.set(sessionId, runtime);
|
|
1401
1758
|
}
|
|
1402
1759
|
catch (error) {
|
|
1403
1760
|
unsubscribe();
|
|
@@ -1407,6 +1764,9 @@ class WebWorkbenchController {
|
|
|
1407
1764
|
unsubscribe();
|
|
1408
1765
|
if (this.activeOrionRuntime?.runtime === runtime)
|
|
1409
1766
|
this.activeOrionRuntime = undefined;
|
|
1767
|
+
if (this.activeOrionRuntimes.get(sessionId) === runtime) {
|
|
1768
|
+
this.activeOrionRuntimes.delete(sessionId);
|
|
1769
|
+
}
|
|
1410
1770
|
};
|
|
1411
1771
|
}
|
|
1412
1772
|
loadSessionView(session, activeProjection) {
|
|
@@ -1455,20 +1815,47 @@ class WebWorkbenchController {
|
|
|
1455
1815
|
assertReadyForTransition(operation) {
|
|
1456
1816
|
if (this.closed)
|
|
1457
1817
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
|
|
1458
|
-
if (this.transition || this.
|
|
1818
|
+
if (this.transition || this.activeMutationCount > 0) {
|
|
1459
1819
|
throw new errors_1.WebWorkbenchError(409, 'A workspace transition is running.', 'runtime_busy');
|
|
1460
1820
|
}
|
|
1461
1821
|
if (this.controllerValue.hasActiveTurn()) {
|
|
1462
1822
|
throw new errors_1.WebWorkbenchError(409, `Cannot ${operation} while a turn is active.`, 'runtime_busy');
|
|
1463
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
|
+
}
|
|
1464
1830
|
}
|
|
1465
1831
|
assertMutationAdmission() {
|
|
1466
1832
|
if (this.closed)
|
|
1467
1833
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
|
|
1468
|
-
if (this.transition
|
|
1834
|
+
if (this.transition) {
|
|
1469
1835
|
throw new errors_1.WebWorkbenchError(409, 'A Context transition is running.', 'runtime_busy');
|
|
1470
1836
|
}
|
|
1471
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
|
+
}
|
|
1472
1859
|
assertContextGuard(context) {
|
|
1473
1860
|
this.assertMutationAdmission();
|
|
1474
1861
|
if (context.expectedContextRevision !== this.contextRevisionValue ||
|
|
@@ -1479,13 +1866,25 @@ class WebWorkbenchController {
|
|
|
1479
1866
|
assertCommandSession(expectedSessionId) {
|
|
1480
1867
|
if (this.closed)
|
|
1481
1868
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.');
|
|
1482
|
-
if (this.transition
|
|
1869
|
+
if (this.transition) {
|
|
1483
1870
|
throw new errors_1.WebWorkbenchError(409, 'A Session transition is running.', 'runtime_busy');
|
|
1484
1871
|
}
|
|
1485
1872
|
if (this.runtimeValue.getSession()?.id !== expectedSessionId) {
|
|
1486
1873
|
throw new errors_1.WebWorkbenchError(409, 'The active Session changed before the command was admitted.', 'active_session_changed');
|
|
1487
1874
|
}
|
|
1488
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
|
+
}
|
|
1489
1888
|
assertSettingsAvailable() {
|
|
1490
1889
|
if (this.closed) {
|
|
1491
1890
|
throw new errors_1.WebWorkbenchError(503, 'Web Workbench is closed.', 'settings_document_unavailable');
|
|
@@ -1532,6 +1931,14 @@ function mapWorkspaceRegistryError(error) {
|
|
|
1532
1931
|
}
|
|
1533
1932
|
return new errors_1.WebWorkbenchError(503, 'Workspace registry is unavailable.');
|
|
1534
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
|
+
}
|
|
1535
1942
|
function mapSettingsError(error) {
|
|
1536
1943
|
if (error instanceof errors_1.WebWorkbenchError)
|
|
1537
1944
|
return error;
|
|
@@ -1743,6 +2150,22 @@ function decodePageCursor(cursor) {
|
|
|
1743
2150
|
throw new errors_1.WebWorkbenchError(400, 'Page cursor is invalid.');
|
|
1744
2151
|
}
|
|
1745
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
|
+
}
|
|
1746
2169
|
function canonicalDirectory(path) {
|
|
1747
2170
|
const candidate = (0, path_1.resolve)(path);
|
|
1748
2171
|
let canonical;
|