@orion-agents/orion-code 0.1.8 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +495 -0
- package/README.md +142 -314
- package/README.zh-CN.md +117 -559
- package/dist/cli.js +71 -90
- package/dist/cli.js.map +1 -1
- package/dist/commands/context-commands.d.ts.map +1 -1
- package/dist/commands/context-commands.js +14 -7
- package/dist/commands/context-commands.js.map +1 -1
- package/dist/commands/context-tool-command-handlers.d.ts +4 -5
- package/dist/commands/context-tool-command-handlers.d.ts.map +1 -1
- package/dist/commands/context-tool-command-handlers.js +174 -208
- package/dist/commands/context-tool-command-handlers.js.map +1 -1
- package/dist/commands/core-command-handlers.d.ts +3 -6
- package/dist/commands/core-command-handlers.d.ts.map +1 -1
- package/dist/commands/core-command-handlers.js +66 -664
- package/dist/commands/core-command-handlers.js.map +1 -1
- package/dist/commands/diagnostic-command-handlers.d.ts +1 -2
- package/dist/commands/diagnostic-command-handlers.d.ts.map +1 -1
- package/dist/commands/diagnostic-command-handlers.js +3 -17
- package/dist/commands/diagnostic-command-handlers.js.map +1 -1
- package/dist/commands/diagnostic-commands.d.ts.map +1 -1
- package/dist/commands/diagnostic-commands.js +0 -45
- package/dist/commands/diagnostic-commands.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -7
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/model-command-handlers.d.ts +2 -2
- package/dist/commands/model-command-handlers.d.ts.map +1 -1
- package/dist/commands/model-command-handlers.js +168 -3
- package/dist/commands/model-command-handlers.js.map +1 -1
- package/dist/commands/model-commands.d.ts.map +1 -1
- package/dist/commands/model-commands.js +0 -11
- package/dist/commands/model-commands.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +1 -139
- package/dist/commands/registry.js.map +1 -1
- package/dist/commands/session-command-handlers.d.ts.map +1 -1
- package/dist/commands/session-command-handlers.js +35 -119
- package/dist/commands/session-command-handlers.js.map +1 -1
- package/dist/commands/session-commands.d.ts.map +1 -1
- package/dist/commands/session-commands.js +2 -50
- package/dist/commands/session-commands.js.map +1 -1
- package/dist/commands/target-command.d.ts +9 -15
- package/dist/commands/target-command.d.ts.map +1 -1
- package/dist/commands/target-command.js +16 -130
- package/dist/commands/target-command.js.map +1 -1
- package/dist/commands/tool-commands.d.ts.map +1 -1
- package/dist/commands/tool-commands.js +0 -10
- package/dist/commands/tool-commands.js.map +1 -1
- package/dist/commands/types.d.ts +14 -14
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js +1 -1
- package/dist/commands/types.js.map +1 -1
- package/dist/commands/workflow-command-handlers.d.ts.map +1 -1
- package/dist/commands/workflow-command-handlers.js +1 -3
- package/dist/commands/workflow-command-handlers.js.map +1 -1
- package/dist/commands/workflow-commands.d.ts.map +1 -1
- package/dist/commands/workflow-commands.js +2 -24
- package/dist/commands/workflow-commands.js.map +1 -1
- package/dist/framework/agent-mode.d.ts +2 -3
- package/dist/framework/agent-mode.d.ts.map +1 -1
- package/dist/framework/agent-mode.js +8 -31
- package/dist/framework/agent-mode.js.map +1 -1
- package/dist/framework/index.d.ts +8 -6
- package/dist/framework/index.d.ts.map +1 -1
- package/dist/framework/index.js +14 -9
- package/dist/framework/index.js.map +1 -1
- package/dist/framework/loop-budget-contract.d.ts +20 -0
- package/dist/framework/loop-budget-contract.d.ts.map +1 -0
- package/dist/framework/loop-budget-contract.js +13 -0
- package/dist/framework/loop-budget-contract.js.map +1 -0
- package/dist/framework/prompt.d.ts.map +1 -1
- package/dist/framework/prompt.js +5 -4
- package/dist/framework/prompt.js.map +1 -1
- package/dist/framework/query.d.ts +71 -26
- package/dist/framework/query.d.ts.map +1 -1
- package/dist/framework/query.js +371 -102
- package/dist/framework/query.js.map +1 -1
- package/dist/framework/stop-decision.d.ts +56 -0
- package/dist/framework/stop-decision.d.ts.map +1 -0
- package/dist/framework/stop-decision.js +36 -0
- package/dist/framework/stop-decision.js.map +1 -0
- package/dist/framework/store.d.ts +4 -2
- package/dist/framework/store.d.ts.map +1 -1
- package/dist/framework/store.js +1 -0
- package/dist/framework/store.js.map +1 -1
- package/dist/framework/tool-call-orchestrator.d.ts +80 -0
- package/dist/framework/tool-call-orchestrator.d.ts.map +1 -0
- package/dist/framework/tool-call-orchestrator.js +192 -0
- package/dist/framework/tool-call-orchestrator.js.map +1 -0
- package/dist/framework/tool-state.d.ts +12 -11
- package/dist/framework/tool-state.d.ts.map +1 -1
- package/dist/framework/tool-state.js +36 -28
- package/dist/framework/tool-state.js.map +1 -1
- package/dist/framework/tool.d.ts +0 -9
- package/dist/framework/tool.d.ts.map +1 -1
- package/dist/framework/tool.js.map +1 -1
- package/dist/harness/assembler.d.ts.map +1 -1
- package/dist/harness/assembler.js +77 -19
- package/dist/harness/assembler.js.map +1 -1
- package/dist/harness/capability-profile.d.ts +3 -0
- package/dist/harness/capability-profile.d.ts.map +1 -0
- package/dist/harness/capability-profile.js +44 -0
- package/dist/harness/capability-profile.js.map +1 -0
- package/dist/harness/capsule.d.ts.map +1 -1
- package/dist/harness/capsule.js +22 -3
- package/dist/harness/capsule.js.map +1 -1
- package/dist/harness/compact-benchmark-corpus.d.ts +10 -0
- package/dist/harness/compact-benchmark-corpus.d.ts.map +1 -0
- package/dist/harness/compact-benchmark-corpus.js +56 -0
- package/dist/harness/compact-benchmark-corpus.js.map +1 -0
- package/dist/harness/context-harness.d.ts +23 -3
- package/dist/harness/context-harness.d.ts.map +1 -1
- package/dist/harness/context-harness.js +183 -11
- package/dist/harness/context-harness.js.map +1 -1
- package/dist/harness/contract.d.ts.map +1 -1
- package/dist/harness/contract.js +106 -11
- package/dist/harness/contract.js.map +1 -1
- package/dist/harness/drift-guard.d.ts +2 -1
- package/dist/harness/drift-guard.d.ts.map +1 -1
- package/dist/harness/drift-guard.js +315 -20
- package/dist/harness/drift-guard.js.map +1 -1
- package/dist/harness/evidence.d.ts.map +1 -1
- package/dist/harness/evidence.js +25 -12
- package/dist/harness/evidence.js.map +1 -1
- package/dist/harness/index.d.ts +7 -2
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js +19 -1
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/ledger.d.ts.map +1 -1
- package/dist/harness/ledger.js +44 -14
- package/dist/harness/ledger.js.map +1 -1
- package/dist/harness/progress-controller.d.ts +14 -0
- package/dist/harness/progress-controller.d.ts.map +1 -0
- package/dist/harness/progress-controller.js +110 -0
- package/dist/harness/progress-controller.js.map +1 -0
- package/dist/harness/state.d.ts.map +1 -1
- package/dist/harness/state.js +5 -2
- package/dist/harness/state.js.map +1 -1
- package/dist/harness/stop-controller.d.ts +15 -0
- package/dist/harness/stop-controller.d.ts.map +1 -0
- package/dist/harness/stop-controller.js +87 -0
- package/dist/harness/stop-controller.js.map +1 -0
- package/dist/harness/types.d.ts +137 -0
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/verification.d.ts +7 -0
- package/dist/harness/verification.d.ts.map +1 -0
- package/dist/harness/verification.js +122 -0
- package/dist/harness/verification.js.map +1 -0
- package/dist/index.d.ts +70 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -59
- package/dist/index.js.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -0
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/prompt-context.d.ts +42 -0
- package/dist/memory/prompt-context.d.ts.map +1 -0
- package/dist/memory/prompt-context.js +129 -0
- package/dist/memory/prompt-context.js.map +1 -0
- package/dist/print-ui/launch.d.ts.map +1 -1
- package/dist/print-ui/launch.js +9 -2
- package/dist/print-ui/launch.js.map +1 -1
- package/dist/product/paths.d.ts +7 -0
- package/dist/product/paths.d.ts.map +1 -1
- package/dist/product/paths.js +19 -0
- package/dist/product/paths.js.map +1 -1
- package/dist/runtime/agent-loop.d.ts +78 -0
- package/dist/runtime/agent-loop.d.ts.map +1 -0
- package/dist/runtime/agent-loop.js +418 -0
- package/dist/runtime/agent-loop.js.map +1 -0
- package/dist/runtime/agent-runtime-controller.d.ts +10 -57
- package/dist/runtime/agent-runtime-controller.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-controller.js +265 -1215
- package/dist/runtime/agent-runtime-controller.js.map +1 -1
- package/dist/runtime/agent-runtime-protocol.d.ts +4 -5
- package/dist/runtime/agent-runtime-protocol.d.ts.map +1 -1
- package/dist/runtime/agent-runtime-protocol.js.map +1 -1
- package/dist/runtime/agent-runtime-runner.d.ts +34 -0
- package/dist/runtime/agent-runtime-runner.d.ts.map +1 -0
- package/dist/runtime/agent-runtime-runner.js +3 -0
- package/dist/runtime/agent-runtime-runner.js.map +1 -0
- package/dist/runtime/batch-read-service.d.ts +29 -0
- package/dist/runtime/batch-read-service.d.ts.map +1 -0
- package/dist/runtime/batch-read-service.js +212 -0
- package/dist/runtime/batch-read-service.js.map +1 -0
- package/dist/runtime/builtin-tool-provider.d.ts +30 -0
- package/dist/runtime/builtin-tool-provider.d.ts.map +1 -0
- package/dist/runtime/builtin-tool-provider.js +233 -0
- package/dist/runtime/builtin-tool-provider.js.map +1 -0
- package/dist/runtime/capabilities/compiler.d.ts +11 -0
- package/dist/runtime/capabilities/compiler.d.ts.map +1 -0
- package/dist/runtime/capabilities/compiler.js +719 -0
- package/dist/runtime/capabilities/compiler.js.map +1 -0
- package/dist/runtime/capabilities/index.d.ts +3 -0
- package/dist/runtime/capabilities/index.d.ts.map +1 -0
- package/dist/runtime/capabilities/index.js +9 -0
- package/dist/runtime/capabilities/index.js.map +1 -0
- package/dist/runtime/capabilities/types.d.ts +175 -0
- package/dist/runtime/capabilities/types.d.ts.map +1 -0
- package/dist/runtime/capabilities/types.js +3 -0
- package/dist/runtime/capabilities/types.js.map +1 -0
- package/dist/runtime/capability-receipt-journal.d.ts +29 -0
- package/dist/runtime/capability-receipt-journal.d.ts.map +1 -0
- package/dist/runtime/capability-receipt-journal.js +264 -0
- package/dist/runtime/capability-receipt-journal.js.map +1 -0
- package/dist/runtime/capability-step-factory.d.ts +73 -0
- package/dist/runtime/capability-step-factory.d.ts.map +1 -0
- package/dist/runtime/capability-step-factory.js +302 -0
- package/dist/runtime/capability-step-factory.js.map +1 -0
- package/dist/runtime/compact-transaction.d.ts +225 -0
- package/dist/runtime/compact-transaction.d.ts.map +1 -0
- package/dist/runtime/compact-transaction.js +622 -0
- package/dist/runtime/compact-transaction.js.map +1 -0
- package/dist/runtime/composer/buffer.d.ts +3 -4
- package/dist/runtime/composer/buffer.d.ts.map +1 -1
- package/dist/runtime/composer/buffer.js +3 -4
- package/dist/runtime/composer/buffer.js.map +1 -1
- package/dist/runtime/composer/grapheme.d.ts +2 -4
- package/dist/runtime/composer/grapheme.d.ts.map +1 -1
- package/dist/runtime/composer/grapheme.js +2 -4
- package/dist/runtime/composer/grapheme.js.map +1 -1
- package/dist/runtime/composer/layout.d.ts +1 -3
- package/dist/runtime/composer/layout.d.ts.map +1 -1
- package/dist/runtime/composer/layout.js +1 -3
- package/dist/runtime/composer/layout.js.map +1 -1
- package/dist/runtime/core-tools/descriptors.d.ts +17 -0
- package/dist/runtime/core-tools/descriptors.d.ts.map +1 -0
- package/dist/runtime/core-tools/descriptors.js +185 -0
- package/dist/runtime/core-tools/descriptors.js.map +1 -0
- package/dist/runtime/first-party-core-provider.d.ts +55 -0
- package/dist/runtime/first-party-core-provider.d.ts.map +1 -0
- package/dist/runtime/first-party-core-provider.js +197 -0
- package/dist/runtime/first-party-core-provider.js.map +1 -0
- package/dist/runtime/first-party-long-tail-provider.d.ts +57 -0
- package/dist/runtime/first-party-long-tail-provider.d.ts.map +1 -0
- package/dist/runtime/first-party-long-tail-provider.js +238 -0
- package/dist/runtime/first-party-long-tail-provider.js.map +1 -0
- package/dist/runtime/first-party-tool-services.d.ts +43 -0
- package/dist/runtime/first-party-tool-services.d.ts.map +1 -0
- package/dist/runtime/first-party-tool-services.js +200 -0
- package/dist/runtime/first-party-tool-services.js.map +1 -0
- package/dist/runtime/first-party-tool-universe.d.ts +14 -0
- package/dist/runtime/first-party-tool-universe.d.ts.map +1 -0
- package/dist/runtime/first-party-tool-universe.js +20 -0
- package/dist/runtime/first-party-tool-universe.js.map +1 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts +63 -0
- package/dist/runtime/goal-lifecycle-v2.d.ts.map +1 -0
- package/dist/runtime/goal-lifecycle-v2.js +253 -0
- package/dist/runtime/goal-lifecycle-v2.js.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts +105 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.js +506 -0
- package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
- package/dist/runtime/goals/types.d.ts +0 -1
- package/dist/runtime/goals/types.d.ts.map +1 -1
- package/dist/runtime/goals/types.js +0 -1
- package/dist/runtime/goals/types.js.map +1 -1
- package/dist/runtime/harness-confluence.d.ts +165 -0
- package/dist/runtime/harness-confluence.d.ts.map +1 -0
- package/dist/runtime/harness-confluence.js +807 -0
- package/dist/runtime/harness-confluence.js.map +1 -0
- package/dist/runtime/harness-eval.d.ts +96 -0
- package/dist/runtime/harness-eval.d.ts.map +1 -0
- package/dist/runtime/harness-eval.js +181 -0
- package/dist/runtime/harness-eval.js.map +1 -0
- package/dist/runtime/harness-metrics.d.ts +202 -0
- package/dist/runtime/harness-metrics.d.ts.map +1 -0
- package/dist/runtime/harness-metrics.js +415 -0
- package/dist/runtime/harness-metrics.js.map +1 -0
- package/dist/runtime/legacy-session-importer.d.ts +99 -0
- package/dist/runtime/legacy-session-importer.d.ts.map +1 -0
- package/dist/runtime/legacy-session-importer.js +455 -0
- package/dist/runtime/legacy-session-importer.js.map +1 -0
- package/dist/runtime/legacy-thread-materializer.d.ts +72 -0
- package/dist/runtime/legacy-thread-materializer.d.ts.map +1 -0
- package/dist/runtime/legacy-thread-materializer.js +553 -0
- package/dist/runtime/legacy-thread-materializer.js.map +1 -0
- package/dist/runtime/long-tail-tools/descriptors.d.ts +23 -0
- package/dist/runtime/long-tail-tools/descriptors.d.ts.map +1 -0
- package/dist/runtime/long-tail-tools/descriptors.js +423 -0
- package/dist/runtime/long-tail-tools/descriptors.js.map +1 -0
- package/dist/runtime/loop-budget.d.ts +1 -1
- package/dist/runtime/loop-budget.d.ts.map +1 -1
- package/dist/runtime/loop-budget.js +2 -2
- package/dist/runtime/loop-budget.js.map +1 -1
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts +75 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.d.ts.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js +484 -0
- package/dist/runtime/mcp/first-party-mcp-adapter.js.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-config.d.ts +13 -0
- package/dist/runtime/mcp/first-party-mcp-config.d.ts.map +1 -0
- package/dist/runtime/mcp/first-party-mcp-config.js +139 -0
- package/dist/runtime/mcp/first-party-mcp-config.js.map +1 -0
- package/dist/runtime/mcp/index.d.ts +5 -0
- package/dist/runtime/mcp/index.d.ts.map +1 -0
- package/dist/{skills → runtime/mcp}/index.js +3 -9
- package/dist/runtime/mcp/index.js.map +1 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts +95 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.d.ts.map +1 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.js +854 -0
- package/dist/runtime/mcp/lazy-mcp-runtime.js.map +1 -0
- package/dist/runtime/mcp/types.d.ts +128 -0
- package/dist/runtime/mcp/types.d.ts.map +1 -0
- package/dist/runtime/mcp/types.js +5 -0
- package/dist/runtime/mcp/types.js.map +1 -0
- package/dist/runtime/model-coordinator.d.ts +44 -1
- package/dist/runtime/model-coordinator.d.ts.map +1 -1
- package/dist/runtime/model-coordinator.js +161 -19
- package/dist/runtime/model-coordinator.js.map +1 -1
- package/dist/runtime/orion-runtime-v1.d.ts +321 -0
- package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
- package/dist/runtime/orion-runtime-v1.js +958 -0
- package/dist/runtime/orion-runtime-v1.js.map +1 -0
- package/dist/runtime/orion-session-runner.d.ts +37 -0
- package/dist/runtime/orion-session-runner.d.ts.map +1 -0
- package/dist/runtime/orion-session-runner.js +146 -0
- package/dist/runtime/orion-session-runner.js.map +1 -0
- package/dist/runtime/product-orion-runtime.d.ts +35 -0
- package/dist/runtime/product-orion-runtime.d.ts.map +1 -0
- package/dist/runtime/product-orion-runtime.js +1019 -0
- package/dist/runtime/product-orion-runtime.js.map +1 -0
- package/dist/runtime/prompts/index.d.ts +3 -0
- package/dist/runtime/prompts/index.d.ts.map +1 -0
- package/dist/{ink-ui/types.js → runtime/prompts/index.js} +3 -2
- package/dist/runtime/prompts/index.js.map +1 -0
- package/dist/runtime/prompts/prompt-registry.d.ts +22 -0
- package/dist/runtime/prompts/prompt-registry.d.ts.map +1 -0
- package/dist/runtime/prompts/prompt-registry.js +356 -0
- package/dist/runtime/prompts/prompt-registry.js.map +1 -0
- package/dist/runtime/prompts/types.d.ts +111 -0
- package/dist/runtime/prompts/types.d.ts.map +1 -0
- package/dist/runtime/prompts/types.js +5 -0
- package/dist/runtime/prompts/types.js.map +1 -0
- package/dist/runtime/protocol/canonical.d.ts +3 -0
- package/dist/runtime/protocol/canonical.d.ts.map +1 -0
- package/dist/runtime/protocol/canonical.js +21 -0
- package/dist/runtime/protocol/canonical.js.map +1 -0
- package/dist/runtime/protocol/index.d.ts +4 -0
- package/dist/runtime/protocol/index.d.ts.map +1 -0
- package/dist/runtime/protocol/index.js +16 -0
- package/dist/runtime/protocol/index.js.map +1 -0
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts +671 -0
- package/dist/runtime/protocol/runtime-protocol-v1.d.ts.map +1 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js +557 -0
- package/dist/runtime/protocol/runtime-protocol-v1.js.map +1 -0
- package/dist/runtime/release-receipts.d.ts +109 -0
- package/dist/runtime/release-receipts.d.ts.map +1 -0
- package/dist/runtime/release-receipts.js +304 -0
- package/dist/runtime/release-receipts.js.map +1 -0
- package/dist/runtime/resource-scope.d.ts +123 -0
- package/dist/runtime/resource-scope.d.ts.map +1 -0
- package/dist/runtime/resource-scope.js +363 -0
- package/dist/runtime/resource-scope.js.map +1 -0
- package/dist/runtime/runtime-event-buffer.d.ts +78 -0
- package/dist/runtime/runtime-event-buffer.d.ts.map +1 -0
- package/dist/runtime/runtime-event-buffer.js +237 -0
- package/dist/runtime/runtime-event-buffer.js.map +1 -0
- package/dist/runtime/runtime-services.d.ts +87 -0
- package/dist/runtime/runtime-services.d.ts.map +1 -0
- package/dist/runtime/runtime-services.js +180 -0
- package/dist/runtime/runtime-services.js.map +1 -0
- package/dist/runtime/skills/bounded-lru-cache.d.ts +34 -0
- package/dist/runtime/skills/bounded-lru-cache.d.ts.map +1 -0
- package/dist/runtime/skills/bounded-lru-cache.js +100 -0
- package/dist/runtime/skills/bounded-lru-cache.js.map +1 -0
- package/dist/runtime/skills/filesystem-skill-provider.d.ts +96 -0
- package/dist/runtime/skills/filesystem-skill-provider.d.ts.map +1 -0
- package/dist/runtime/skills/filesystem-skill-provider.js +829 -0
- package/dist/runtime/skills/filesystem-skill-provider.js.map +1 -0
- package/dist/runtime/skills/index.d.ts +5 -0
- package/dist/runtime/skills/index.d.ts.map +1 -0
- package/dist/{ink-ui/controllers/chat-controller.js → runtime/skills/index.js} +5 -2
- package/dist/runtime/skills/index.js.map +1 -0
- package/dist/runtime/skills/lazy-skill-runtime.d.ts +77 -0
- package/dist/runtime/skills/lazy-skill-runtime.d.ts.map +1 -0
- package/dist/runtime/skills/lazy-skill-runtime.js +673 -0
- package/dist/runtime/skills/lazy-skill-runtime.js.map +1 -0
- package/dist/runtime/skills/types.d.ts +137 -0
- package/dist/runtime/skills/types.d.ts.map +1 -0
- package/dist/runtime/skills/types.js +13 -0
- package/dist/runtime/skills/types.js.map +1 -0
- package/dist/runtime/step-snapshot.d.ts +183 -0
- package/dist/runtime/step-snapshot.d.ts.map +1 -0
- package/dist/runtime/step-snapshot.js +286 -0
- package/dist/runtime/step-snapshot.js.map +1 -0
- package/dist/runtime/subagent-thread-runtime.d.ts +239 -0
- package/dist/runtime/subagent-thread-runtime.d.ts.map +1 -0
- package/dist/runtime/subagent-thread-runtime.js +876 -0
- package/dist/runtime/subagent-thread-runtime.js.map +1 -0
- package/dist/runtime/subagents/index.d.ts +5 -2
- package/dist/runtime/subagents/index.d.ts.map +1 -1
- package/dist/runtime/subagents/index.js +10 -2
- package/dist/runtime/subagents/index.js.map +1 -1
- package/dist/runtime/subagents/parent-step-fork.d.ts +36 -0
- package/dist/runtime/subagents/parent-step-fork.d.ts.map +1 -0
- package/dist/runtime/subagents/parent-step-fork.js +83 -0
- package/dist/runtime/subagents/parent-step-fork.js.map +1 -0
- package/dist/runtime/subagents/production.d.ts +65 -42
- package/dist/runtime/subagents/production.d.ts.map +1 -1
- package/dist/runtime/subagents/production.js +494 -151
- package/dist/runtime/subagents/production.js.map +1 -1
- package/dist/runtime/subagents/receipt-journal.d.ts +20 -0
- package/dist/runtime/subagents/receipt-journal.d.ts.map +1 -0
- package/dist/runtime/subagents/receipt-journal.js +74 -0
- package/dist/runtime/subagents/receipt-journal.js.map +1 -0
- package/dist/runtime/subagents/runner.d.ts +12 -1
- package/dist/runtime/subagents/runner.d.ts.map +1 -1
- package/dist/runtime/subagents/runner.js +62 -1
- package/dist/runtime/subagents/runner.js.map +1 -1
- package/dist/runtime/subagents/runtime-contract.d.ts +29 -0
- package/dist/runtime/subagents/runtime-contract.d.ts.map +1 -0
- package/dist/runtime/subagents/runtime-contract.js +3 -0
- package/dist/runtime/subagents/runtime-contract.js.map +1 -0
- package/dist/runtime/subagents/runtime-integration.d.ts +41 -56
- package/dist/runtime/subagents/runtime-integration.d.ts.map +1 -1
- package/dist/runtime/subagents/runtime-integration.js +34 -197
- package/dist/runtime/subagents/runtime-integration.js.map +1 -1
- package/dist/runtime/subagents/supervisor.d.ts +19 -7
- package/dist/runtime/subagents/supervisor.d.ts.map +1 -1
- package/dist/runtime/subagents/supervisor.js +88 -39
- package/dist/runtime/subagents/supervisor.js.map +1 -1
- package/dist/runtime/subagents/types.d.ts +5 -2
- package/dist/runtime/subagents/types.d.ts.map +1 -1
- package/dist/runtime/subagents/types.js +1 -1
- package/dist/runtime/subagents/types.js.map +1 -1
- package/dist/runtime/task-context-service.d.ts +91 -0
- package/dist/runtime/task-context-service.d.ts.map +1 -0
- package/dist/runtime/task-context-service.js +122 -0
- package/dist/runtime/task-context-service.js.map +1 -0
- package/dist/runtime/thread-admission.d.ts +130 -0
- package/dist/runtime/thread-admission.d.ts.map +1 -0
- package/dist/runtime/thread-admission.js +276 -0
- package/dist/runtime/thread-admission.js.map +1 -0
- package/dist/runtime/thread-compact-persistence.d.ts +50 -0
- package/dist/runtime/thread-compact-persistence.d.ts.map +1 -0
- package/dist/runtime/thread-compact-persistence.js +176 -0
- package/dist/runtime/thread-compact-persistence.js.map +1 -0
- package/dist/runtime/thread-event-store.d.ts +98 -0
- package/dist/runtime/thread-event-store.d.ts.map +1 -0
- package/dist/runtime/thread-event-store.js +737 -0
- package/dist/runtime/thread-event-store.js.map +1 -0
- package/dist/runtime/thread-projection.d.ts +91 -0
- package/dist/runtime/thread-projection.d.ts.map +1 -0
- package/dist/runtime/thread-projection.js +407 -0
- package/dist/runtime/thread-projection.js.map +1 -0
- package/dist/runtime/thread-runtime.d.ts +165 -0
- package/dist/runtime/thread-runtime.d.ts.map +1 -0
- package/dist/runtime/thread-runtime.js +704 -0
- package/dist/runtime/thread-runtime.js.map +1 -0
- package/dist/runtime/thread-tool-journal.d.ts +11 -0
- package/dist/runtime/thread-tool-journal.d.ts.map +1 -0
- package/dist/runtime/thread-tool-journal.js +131 -0
- package/dist/runtime/thread-tool-journal.js.map +1 -0
- package/dist/runtime/thread-ui-adapter.d.ts +85 -0
- package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
- package/dist/runtime/thread-ui-adapter.js +514 -0
- package/dist/runtime/thread-ui-adapter.js.map +1 -0
- package/dist/runtime/tool-gateway.d.ts +159 -0
- package/dist/runtime/tool-gateway.d.ts.map +1 -0
- package/dist/runtime/tool-gateway.js +311 -0
- package/dist/runtime/tool-gateway.js.map +1 -0
- package/dist/runtime/turn-commit.d.ts +103 -0
- package/dist/runtime/turn-commit.d.ts.map +1 -0
- package/dist/runtime/turn-commit.js +321 -0
- package/dist/runtime/turn-commit.js.map +1 -0
- package/dist/runtime/ui-events.d.ts +15 -5
- package/dist/runtime/ui-events.d.ts.map +1 -1
- package/dist/runtime/ui-events.js +0 -1
- package/dist/runtime/ui-events.js.map +1 -1
- package/dist/runtime/ui-view-model.d.ts +1 -1
- package/dist/runtime/ui-view-model.d.ts.map +1 -1
- package/dist/runtime/ui-view-model.js +3 -5
- package/dist/runtime/ui-view-model.js.map +1 -1
- package/dist/services/compact/auto-compact.d.ts +82 -2
- package/dist/services/compact/auto-compact.d.ts.map +1 -1
- package/dist/services/compact/auto-compact.js +226 -44
- package/dist/services/compact/auto-compact.js.map +1 -1
- package/dist/services/compact/compact.d.ts +54 -37
- package/dist/services/compact/compact.d.ts.map +1 -1
- package/dist/services/compact/compact.js +512 -127
- package/dist/services/compact/compact.js.map +1 -1
- package/dist/services/compact/coordinator.d.ts +5 -1
- package/dist/services/compact/coordinator.d.ts.map +1 -1
- package/dist/services/compact/coordinator.js +10 -1
- package/dist/services/compact/coordinator.js.map +1 -1
- package/dist/services/compact/fingerprint.d.ts +27 -0
- package/dist/services/compact/fingerprint.d.ts.map +1 -0
- package/dist/services/compact/fingerprint.js +69 -0
- package/dist/services/compact/fingerprint.js.map +1 -0
- package/dist/services/compact/index.d.ts +7 -5
- package/dist/services/compact/index.d.ts.map +1 -1
- package/dist/services/compact/index.js +19 -6
- package/dist/services/compact/index.js.map +1 -1
- package/dist/services/compact/planner.d.ts +41 -0
- package/dist/services/compact/planner.d.ts.map +1 -0
- package/dist/services/compact/planner.js +102 -0
- package/dist/services/compact/planner.js.map +1 -0
- package/dist/services/compact/semantic-summary.d.ts +93 -0
- package/dist/services/compact/semantic-summary.d.ts.map +1 -0
- package/dist/services/compact/semantic-summary.js +158 -0
- package/dist/services/compact/semantic-summary.js.map +1 -0
- package/dist/services/compact/summary-generator.d.ts +23 -0
- package/dist/services/compact/summary-generator.d.ts.map +1 -1
- package/dist/services/compact/summary-generator.js +173 -39
- package/dist/services/compact/summary-generator.js.map +1 -1
- package/dist/services/config-dir.d.ts +1 -1
- package/dist/services/config-dir.d.ts.map +1 -1
- package/dist/services/config-dir.js +2 -1
- package/dist/services/config-dir.js.map +1 -1
- package/dist/services/config.d.ts +2 -16
- package/dist/services/config.d.ts.map +1 -1
- package/dist/services/config.js +2 -29
- package/dist/services/config.js.map +1 -1
- package/dist/services/doctor.d.ts +0 -2
- package/dist/services/doctor.d.ts.map +1 -1
- package/dist/services/doctor.js +39 -64
- package/dist/services/doctor.js.map +1 -1
- package/dist/services/file-context.d.ts.map +1 -1
- package/dist/services/file-context.js +29 -33
- package/dist/services/file-context.js.map +1 -1
- package/dist/services/global-config.d.ts +8 -2
- package/dist/services/global-config.d.ts.map +1 -1
- package/dist/services/global-config.js +8 -0
- package/dist/services/global-config.js.map +1 -1
- package/dist/services/llm.d.ts +3 -0
- package/dist/services/llm.d.ts.map +1 -1
- package/dist/services/llm.js +7 -0
- package/dist/services/llm.js.map +1 -1
- package/dist/services/project-instructions.d.ts.map +1 -1
- package/dist/services/project-instructions.js +10 -17
- package/dist/services/project-instructions.js.map +1 -1
- package/dist/services/safe-project-reader.d.ts +30 -0
- package/dist/services/safe-project-reader.d.ts.map +1 -0
- package/dist/services/safe-project-reader.js +141 -0
- package/dist/services/safe-project-reader.js.map +1 -0
- package/dist/services/session-storage.d.ts +134 -5
- package/dist/services/session-storage.d.ts.map +1 -1
- package/dist/services/session-storage.js +727 -57
- package/dist/services/session-storage.js.map +1 -1
- package/dist/services/usage-state.d.ts +7 -0
- package/dist/services/usage-state.d.ts.map +1 -1
- package/dist/services/usage-state.js +117 -16
- package/dist/services/usage-state.js.map +1 -1
- package/dist/skills/builtin/code-review/SKILL.md +51 -0
- package/dist/skills/builtin/security-check/SKILL.md +54 -0
- package/dist/skills/builtin/test-gen/SKILL.md +49 -0
- package/dist/terminal-ui/launch.d.ts +3 -1
- package/dist/terminal-ui/launch.d.ts.map +1 -1
- package/dist/terminal-ui/launch.js +19 -3
- package/dist/terminal-ui/launch.js.map +1 -1
- package/dist/tools/core/common.d.ts +34 -0
- package/dist/tools/core/common.d.ts.map +1 -0
- package/dist/tools/core/common.js +164 -0
- package/dist/tools/core/common.js.map +1 -0
- package/dist/tools/core/edit-file.d.ts +10 -0
- package/dist/tools/core/edit-file.d.ts.map +1 -0
- package/dist/tools/core/edit-file.js +301 -0
- package/dist/tools/core/edit-file.js.map +1 -0
- package/dist/tools/core/exec-command.d.ts +2 -0
- package/dist/tools/core/exec-command.d.ts.map +1 -0
- package/dist/tools/core/exec-command.js +347 -0
- package/dist/tools/core/exec-command.js.map +1 -0
- package/dist/tools/core/glob.d.ts +2 -0
- package/dist/tools/core/glob.d.ts.map +1 -0
- package/dist/tools/core/glob.js +133 -0
- package/dist/tools/core/glob.js.map +1 -0
- package/dist/tools/core/grep.d.ts +12 -0
- package/dist/tools/core/grep.d.ts.map +1 -0
- package/dist/tools/core/grep.js +223 -0
- package/dist/tools/core/grep.js.map +1 -0
- package/dist/tools/core/index.d.ts +15 -0
- package/dist/tools/core/index.d.ts.map +1 -0
- package/dist/tools/core/index.js +31 -0
- package/dist/tools/core/index.js.map +1 -0
- package/dist/tools/core/list-files.d.ts +2 -0
- package/dist/tools/core/list-files.d.ts.map +1 -0
- package/dist/tools/core/list-files.js +87 -0
- package/dist/tools/core/list-files.js.map +1 -0
- package/dist/tools/core/read-file.d.ts +2 -0
- package/dist/tools/core/read-file.d.ts.map +1 -0
- package/dist/tools/core/read-file.js +129 -0
- package/dist/tools/core/read-file.js.map +1 -0
- package/dist/tools/core/write-file.d.ts +2 -0
- package/dist/tools/core/write-file.d.ts.map +1 -0
- package/dist/tools/core/write-file.js +65 -0
- package/dist/tools/core/write-file.js.map +1 -0
- package/dist/tools/todo.d.ts +3 -4
- package/dist/tools/todo.d.ts.map +1 -1
- package/dist/tools/todo.js +80 -79
- package/dist/tools/todo.js.map +1 -1
- package/dist/tui-ui/chrome-view-model.js +1 -1
- package/dist/tui-ui/chrome-view-model.js.map +1 -1
- package/dist/tui-ui/layout.js +1 -1
- package/dist/tui-ui/layout.js.map +1 -1
- package/docs/migration/v0.1.9-to-v0.2.0.md +98 -0
- package/docs/orion.example.json +79 -0
- package/docs/plan/v0.2.0-dsh-harness-redesign-plan.md +1234 -0
- package/docs/plan/v0.2.0-release-checklist.md +91 -0
- package/docs/readme.md +27 -0
- package/npm-shrinkwrap.json +9 -438
- package/package.json +19 -11
- package/dist/agents/coder.d.ts +0 -12
- package/dist/agents/coder.d.ts.map +0 -1
- package/dist/agents/coder.js +0 -48
- package/dist/agents/coder.js.map +0 -1
- package/dist/agents/coordinator.d.ts +0 -86
- package/dist/agents/coordinator.d.ts.map +0 -1
- package/dist/agents/coordinator.js +0 -251
- package/dist/agents/coordinator.js.map +0 -1
- package/dist/agents/fork.d.ts +0 -69
- package/dist/agents/fork.d.ts.map +0 -1
- package/dist/agents/fork.js +0 -164
- package/dist/agents/fork.js.map +0 -1
- package/dist/agents/leader.d.ts +0 -12
- package/dist/agents/leader.d.ts.map +0 -1
- package/dist/agents/leader.js +0 -49
- package/dist/agents/leader.js.map +0 -1
- package/dist/agents/router.d.ts +0 -59
- package/dist/agents/router.d.ts.map +0 -1
- package/dist/agents/router.js +0 -193
- package/dist/agents/router.js.map +0 -1
- package/dist/agents/worker-pool.d.ts +0 -72
- package/dist/agents/worker-pool.d.ts.map +0 -1
- package/dist/agents/worker-pool.js +0 -224
- package/dist/agents/worker-pool.js.map +0 -1
- package/dist/commands/legacy-commands.d.ts +0 -4
- package/dist/commands/legacy-commands.d.ts.map +0 -1
- package/dist/commands/legacy-commands.js +0 -44
- package/dist/commands/legacy-commands.js.map +0 -1
- package/dist/core/agent.d.ts +0 -84
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -58
- package/dist/core/agent.js.map +0 -1
- package/dist/core/brain.d.ts +0 -50
- package/dist/core/brain.d.ts.map +0 -1
- package/dist/core/brain.js +0 -95
- package/dist/core/brain.js.map +0 -1
- package/dist/framework/tool-scheduler.d.ts +0 -186
- package/dist/framework/tool-scheduler.d.ts.map +0 -1
- package/dist/framework/tool-scheduler.js +0 -558
- package/dist/framework/tool-scheduler.js.map +0 -1
- package/dist/harness/harness.d.ts +0 -58
- package/dist/harness/harness.d.ts.map +0 -1
- package/dist/harness/harness.js +0 -195
- package/dist/harness/harness.js.map +0 -1
- package/dist/harness/safety.d.ts +0 -101
- package/dist/harness/safety.d.ts.map +0 -1
- package/dist/harness/safety.js +0 -322
- package/dist/harness/safety.js.map +0 -1
- package/dist/init.d.ts +0 -108
- package/dist/init.d.ts.map +0 -1
- package/dist/init.js +0 -393
- package/dist/init.js.map +0 -1
- package/dist/ink-ui/App.d.ts +0 -9
- package/dist/ink-ui/App.d.ts.map +0 -1
- package/dist/ink-ui/App.js +0 -12
- package/dist/ink-ui/App.js.map +0 -1
- package/dist/ink-ui/components/Markdown.d.ts +0 -10
- package/dist/ink-ui/components/Markdown.d.ts.map +0 -1
- package/dist/ink-ui/components/Markdown.js +0 -210
- package/dist/ink-ui/components/Markdown.js.map +0 -1
- package/dist/ink-ui/components/NativeCursor.d.ts +0 -12
- package/dist/ink-ui/components/NativeCursor.d.ts.map +0 -1
- package/dist/ink-ui/components/NativeCursor.js +0 -35
- package/dist/ink-ui/components/NativeCursor.js.map +0 -1
- package/dist/ink-ui/components/PixelHorseBanner.d.ts +0 -8
- package/dist/ink-ui/components/PixelHorseBanner.d.ts.map +0 -1
- package/dist/ink-ui/components/PixelHorseBanner.js +0 -97
- package/dist/ink-ui/components/PixelHorseBanner.js.map +0 -1
- package/dist/ink-ui/components/PromptInput.d.ts +0 -13
- package/dist/ink-ui/components/PromptInput.d.ts.map +0 -1
- package/dist/ink-ui/components/PromptInput.js +0 -30
- package/dist/ink-ui/components/PromptInput.js.map +0 -1
- package/dist/ink-ui/components/RunningHorseIndicator.d.ts +0 -13
- package/dist/ink-ui/components/RunningHorseIndicator.d.ts.map +0 -1
- package/dist/ink-ui/components/RunningHorseIndicator.js +0 -53
- package/dist/ink-ui/components/RunningHorseIndicator.js.map +0 -1
- package/dist/ink-ui/components/SelectList.d.ts +0 -16
- package/dist/ink-ui/components/SelectList.d.ts.map +0 -1
- package/dist/ink-ui/components/SelectList.js +0 -60
- package/dist/ink-ui/components/SelectList.js.map +0 -1
- package/dist/ink-ui/components/StatusLine.d.ts +0 -11
- package/dist/ink-ui/components/StatusLine.d.ts.map +0 -1
- package/dist/ink-ui/components/StatusLine.js +0 -70
- package/dist/ink-ui/components/StatusLine.js.map +0 -1
- package/dist/ink-ui/components/ToolActivity.d.ts +0 -19
- package/dist/ink-ui/components/ToolActivity.d.ts.map +0 -1
- package/dist/ink-ui/components/ToolActivity.js +0 -134
- package/dist/ink-ui/components/ToolActivity.js.map +0 -1
- package/dist/ink-ui/components/Transcript.d.ts +0 -14
- package/dist/ink-ui/components/Transcript.d.ts.map +0 -1
- package/dist/ink-ui/components/Transcript.js +0 -66
- package/dist/ink-ui/components/Transcript.js.map +0 -1
- package/dist/ink-ui/controllers/chat-controller.d.ts +0 -2
- package/dist/ink-ui/controllers/chat-controller.d.ts.map +0 -1
- package/dist/ink-ui/controllers/chat-controller.js.map +0 -1
- package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts +0 -6
- package/dist/ink-ui/hooks/use-raw-input-bridge.d.ts.map +0 -1
- package/dist/ink-ui/hooks/use-raw-input-bridge.js +0 -27
- package/dist/ink-ui/hooks/use-raw-input-bridge.js.map +0 -1
- package/dist/ink-ui/hooks/use-terminal-size.d.ts +0 -7
- package/dist/ink-ui/hooks/use-terminal-size.d.ts.map +0 -1
- package/dist/ink-ui/hooks/use-terminal-size.js +0 -34
- package/dist/ink-ui/hooks/use-terminal-size.js.map +0 -1
- package/dist/ink-ui/launch.d.ts +0 -9
- package/dist/ink-ui/launch.d.ts.map +0 -1
- package/dist/ink-ui/launch.js +0 -101
- package/dist/ink-ui/launch.js.map +0 -1
- package/dist/ink-ui/runtime/grapheme.d.ts +0 -10
- package/dist/ink-ui/runtime/grapheme.d.ts.map +0 -1
- package/dist/ink-ui/runtime/grapheme.js +0 -17
- package/dist/ink-ui/runtime/grapheme.js.map +0 -1
- package/dist/ink-ui/runtime/input-buffer.d.ts +0 -10
- package/dist/ink-ui/runtime/input-buffer.d.ts.map +0 -1
- package/dist/ink-ui/runtime/input-buffer.js +0 -18
- package/dist/ink-ui/runtime/input-buffer.js.map +0 -1
- package/dist/ink-ui/runtime/layout-budget.d.ts +0 -13
- package/dist/ink-ui/runtime/layout-budget.d.ts.map +0 -1
- package/dist/ink-ui/runtime/layout-budget.js +0 -25
- package/dist/ink-ui/runtime/layout-budget.js.map +0 -1
- package/dist/ink-ui/runtime/native-cursor.d.ts +0 -62
- package/dist/ink-ui/runtime/native-cursor.d.ts.map +0 -1
- package/dist/ink-ui/runtime/native-cursor.js +0 -398
- package/dist/ink-ui/runtime/native-cursor.js.map +0 -1
- package/dist/ink-ui/runtime/prompt-layout.d.ts +0 -10
- package/dist/ink-ui/runtime/prompt-layout.d.ts.map +0 -1
- package/dist/ink-ui/runtime/prompt-layout.js +0 -21
- package/dist/ink-ui/runtime/prompt-layout.js.map +0 -1
- package/dist/ink-ui/runtime/raw-input.d.ts +0 -4
- package/dist/ink-ui/runtime/raw-input.d.ts.map +0 -1
- package/dist/ink-ui/runtime/raw-input.js +0 -15
- package/dist/ink-ui/runtime/raw-input.js.map +0 -1
- package/dist/ink-ui/runtime/transcript-state.d.ts +0 -37
- package/dist/ink-ui/runtime/transcript-state.d.ts.map +0 -1
- package/dist/ink-ui/runtime/transcript-state.js +0 -91
- package/dist/ink-ui/runtime/transcript-state.js.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.d.ts +0 -24
- package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.js +0 -756
- package/dist/ink-ui/screens/ReplScreen.js.map +0 -1
- package/dist/ink-ui/types.d.ts +0 -2
- package/dist/ink-ui/types.d.ts.map +0 -1
- package/dist/ink-ui/types.js.map +0 -1
- package/dist/runtime/chat-checkpoint.d.ts +0 -17
- package/dist/runtime/chat-checkpoint.d.ts.map +0 -1
- package/dist/runtime/chat-checkpoint.js +0 -105
- package/dist/runtime/chat-checkpoint.js.map +0 -1
- package/dist/runtime/chat-command-scope.d.ts +0 -5
- package/dist/runtime/chat-command-scope.d.ts.map +0 -1
- package/dist/runtime/chat-command-scope.js +0 -22
- package/dist/runtime/chat-command-scope.js.map +0 -1
- package/dist/runtime/chat-controller.d.ts +0 -62
- package/dist/runtime/chat-controller.d.ts.map +0 -1
- package/dist/runtime/chat-controller.js +0 -1630
- package/dist/runtime/chat-controller.js.map +0 -1
- package/dist/runtime/chat-effort.d.ts +0 -5
- package/dist/runtime/chat-effort.d.ts.map +0 -1
- package/dist/runtime/chat-effort.js +0 -47
- package/dist/runtime/chat-effort.js.map +0 -1
- package/dist/runtime/chat-presentation.d.ts +0 -63
- package/dist/runtime/chat-presentation.d.ts.map +0 -1
- package/dist/runtime/chat-presentation.js +0 -561
- package/dist/runtime/chat-presentation.js.map +0 -1
- package/dist/runtime/chat-trace.d.ts +0 -52
- package/dist/runtime/chat-trace.d.ts.map +0 -1
- package/dist/runtime/chat-trace.js +0 -234
- package/dist/runtime/chat-trace.js.map +0 -1
- package/dist/runtime/chat-workspace.d.ts +0 -22
- package/dist/runtime/chat-workspace.d.ts.map +0 -1
- package/dist/runtime/chat-workspace.js +0 -154
- package/dist/runtime/chat-workspace.js.map +0 -1
- package/dist/runtime/goals/accounting.d.ts +0 -45
- package/dist/runtime/goals/accounting.d.ts.map +0 -1
- package/dist/runtime/goals/accounting.js +0 -114
- package/dist/runtime/goals/accounting.js.map +0 -1
- package/dist/runtime/goals/coordinator.d.ts +0 -89
- package/dist/runtime/goals/coordinator.d.ts.map +0 -1
- package/dist/runtime/goals/coordinator.js +0 -1481
- package/dist/runtime/goals/coordinator.js.map +0 -1
- package/dist/runtime/goals/lifecycle.d.ts +0 -13
- package/dist/runtime/goals/lifecycle.d.ts.map +0 -1
- package/dist/runtime/goals/lifecycle.js +0 -46
- package/dist/runtime/goals/lifecycle.js.map +0 -1
- package/dist/runtime/goals/prompt.d.ts +0 -16
- package/dist/runtime/goals/prompt.d.ts.map +0 -1
- package/dist/runtime/goals/prompt.js +0 -88
- package/dist/runtime/goals/prompt.js.map +0 -1
- package/dist/runtime/goals/tools.d.ts +0 -61
- package/dist/runtime/goals/tools.d.ts.map +0 -1
- package/dist/runtime/goals/tools.js +0 -568
- package/dist/runtime/goals/tools.js.map +0 -1
- package/dist/sdk/index.d.ts +0 -10
- package/dist/sdk/index.d.ts.map +0 -1
- package/dist/sdk/index.js +0 -23
- package/dist/sdk/index.js.map +0 -1
- package/dist/sdk/init.d.ts +0 -24
- package/dist/sdk/init.d.ts.map +0 -1
- package/dist/sdk/init.js +0 -48
- package/dist/sdk/init.js.map +0 -1
- package/dist/sdk/query.d.ts +0 -19
- package/dist/sdk/query.d.ts.map +0 -1
- package/dist/sdk/query.js +0 -42
- package/dist/sdk/query.js.map +0 -1
- package/dist/sdk/sessions.d.ts +0 -19
- package/dist/sdk/sessions.d.ts.map +0 -1
- package/dist/sdk/sessions.js +0 -57
- package/dist/sdk/sessions.js.map +0 -1
- package/dist/sdk/types.d.ts +0 -47
- package/dist/sdk/types.d.ts.map +0 -1
- package/dist/sdk/types.js +0 -8
- package/dist/sdk/types.js.map +0 -1
- package/dist/services/agent-runner.d.ts +0 -71
- package/dist/services/agent-runner.d.ts.map +0 -1
- package/dist/services/agent-runner.js +0 -185
- package/dist/services/agent-runner.js.map +0 -1
- package/dist/services/compact/micro-compact.d.ts +0 -21
- package/dist/services/compact/micro-compact.d.ts.map +0 -1
- package/dist/services/compact/micro-compact.js +0 -99
- package/dist/services/compact/micro-compact.js.map +0 -1
- package/dist/services/task-manager.d.ts +0 -161
- package/dist/services/task-manager.d.ts.map +0 -1
- package/dist/services/task-manager.js +0 -315
- package/dist/services/task-manager.js.map +0 -1
- package/dist/skills/discovery.d.ts +0 -22
- package/dist/skills/discovery.d.ts.map +0 -1
- package/dist/skills/discovery.js +0 -75
- package/dist/skills/discovery.js.map +0 -1
- package/dist/skills/index.d.ts +0 -11
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/loader.d.ts +0 -53
- package/dist/skills/loader.d.ts.map +0 -1
- package/dist/skills/loader.js +0 -421
- package/dist/skills/loader.js.map +0 -1
- package/dist/skills/registry.d.ts +0 -41
- package/dist/skills/registry.d.ts.map +0 -1
- package/dist/skills/registry.js +0 -157
- package/dist/skills/registry.js.map +0 -1
- package/dist/skills/runtime.d.ts +0 -46
- package/dist/skills/runtime.d.ts.map +0 -1
- package/dist/skills/runtime.js +0 -364
- package/dist/skills/runtime.js.map +0 -1
- package/dist/skills/types.d.ts +0 -112
- package/dist/skills/types.d.ts.map +0 -1
- package/dist/skills/types.js +0 -24
- package/dist/skills/types.js.map +0 -1
- package/dist/tools/index.d.ts +0 -52
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -2268
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/mcp.d.ts +0 -99
- package/dist/tools/mcp.d.ts.map +0 -1
- package/dist/tools/mcp.js +0 -695
- package/dist/tools/mcp.js.map +0 -1
- package/dist/tools/plan.d.ts +0 -17
- package/dist/tools/plan.d.ts.map +0 -1
- package/dist/tools/plan.js +0 -84
- package/dist/tools/plan.js.map +0 -1
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LazySkillRuntime = exports.StaleSkillLoadError = exports.SkillInvocationDeniedError = exports.StaleSkillCatalogError = exports.LazySkillRuntimeError = void 0;
|
|
4
|
+
const buffer_1 = require("buffer");
|
|
5
|
+
const canonical_1 = require("../protocol/canonical");
|
|
6
|
+
const bounded_lru_cache_1 = require("./bounded-lru-cache");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
const MAX_CATALOG_DESCRIPTION_CHARS = 240;
|
|
9
|
+
const DEFAULT_DEFINITION_CACHE = Object.freeze({
|
|
10
|
+
maxEntries: 32,
|
|
11
|
+
maxBytes: 2 * 1024 * 1024,
|
|
12
|
+
ttlMs: 5 * 60 * 1000,
|
|
13
|
+
});
|
|
14
|
+
const DEFAULT_RESOURCE_CACHE = Object.freeze({
|
|
15
|
+
maxEntries: 64,
|
|
16
|
+
maxBytes: 8 * 1024 * 1024,
|
|
17
|
+
ttlMs: 5 * 60 * 1000,
|
|
18
|
+
});
|
|
19
|
+
class LazySkillRuntimeError extends Error {
|
|
20
|
+
constructor(message) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.code = 'ORION_LAZY_SKILL_RUNTIME_ERROR';
|
|
23
|
+
this.name = 'LazySkillRuntimeError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.LazySkillRuntimeError = LazySkillRuntimeError;
|
|
27
|
+
class StaleSkillCatalogError extends LazySkillRuntimeError {
|
|
28
|
+
constructor(providerId) {
|
|
29
|
+
super(`Skill catalog is stale for provider ${providerId}; observe the provider again.`);
|
|
30
|
+
this.code = 'ORION_STALE_SKILL_CATALOG';
|
|
31
|
+
this.name = 'StaleSkillCatalogError';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.StaleSkillCatalogError = StaleSkillCatalogError;
|
|
35
|
+
class SkillInvocationDeniedError extends LazySkillRuntimeError {
|
|
36
|
+
constructor(skillId, actor) {
|
|
37
|
+
super(`Skill ${skillId} is not invocable by ${actor}.`);
|
|
38
|
+
this.code = 'ORION_SKILL_INVOCATION_DENIED';
|
|
39
|
+
this.name = 'SkillInvocationDeniedError';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.SkillInvocationDeniedError = SkillInvocationDeniedError;
|
|
43
|
+
class StaleSkillLoadError extends LazySkillRuntimeError {
|
|
44
|
+
constructor(providerId, skillId) {
|
|
45
|
+
super(`Skill ${skillId} changed while loading from provider ${providerId}.`);
|
|
46
|
+
this.code = 'ORION_STALE_SKILL_LOAD';
|
|
47
|
+
this.name = 'StaleSkillLoadError';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.StaleSkillLoadError = StaleSkillLoadError;
|
|
51
|
+
/**
|
|
52
|
+
* Descriptor-first runtime for Skills.
|
|
53
|
+
*
|
|
54
|
+
* Observation exposes only bounded descriptors. Definition and resource IO are
|
|
55
|
+
* explicit, authority-scoped operations with digest-bound caches and receipts.
|
|
56
|
+
*/
|
|
57
|
+
class LazySkillRuntime {
|
|
58
|
+
constructor(options) {
|
|
59
|
+
this.version = types_1.LAZY_SKILL_RUNTIME_VERSION;
|
|
60
|
+
this.providerStates = new Map();
|
|
61
|
+
this.definitionFlights = new Map();
|
|
62
|
+
this.resourceFlights = new Map();
|
|
63
|
+
this.lifecycleController = new AbortController();
|
|
64
|
+
this.subscriptions = [];
|
|
65
|
+
this.disposed = false;
|
|
66
|
+
const providerMap = new Map();
|
|
67
|
+
for (const provider of options.providers) {
|
|
68
|
+
const providerId = validateIdentifier(provider.id, 'Skill provider id');
|
|
69
|
+
if (providerMap.has(providerId)) {
|
|
70
|
+
throw new LazySkillRuntimeError(`Duplicate Skill provider id: ${providerId}`);
|
|
71
|
+
}
|
|
72
|
+
providerMap.set(providerId, provider);
|
|
73
|
+
this.providerStates.set(providerId, {
|
|
74
|
+
generation: 0,
|
|
75
|
+
observed: false,
|
|
76
|
+
complete: false,
|
|
77
|
+
descriptorDigests: new Map(),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
this.providers = providerMap;
|
|
81
|
+
const now = options.now ?? Date.now;
|
|
82
|
+
this.definitionCache = new bounded_lru_cache_1.BoundedLruCache({
|
|
83
|
+
...DEFAULT_DEFINITION_CACHE,
|
|
84
|
+
...options.definitionCache,
|
|
85
|
+
sizeOf: definition => buffer_1.Buffer.byteLength(JSON.stringify(definition), 'utf8'),
|
|
86
|
+
now,
|
|
87
|
+
});
|
|
88
|
+
this.resourceCache = new bounded_lru_cache_1.BoundedLruCache({
|
|
89
|
+
...DEFAULT_RESOURCE_CACHE,
|
|
90
|
+
...options.resourceCache,
|
|
91
|
+
sizeOf: resource => resourceBytes(resource),
|
|
92
|
+
now,
|
|
93
|
+
});
|
|
94
|
+
if (options.signal) {
|
|
95
|
+
const abortFromParent = () => {
|
|
96
|
+
if (!this.lifecycleController.signal.aborted) {
|
|
97
|
+
this.lifecycleController.abort(options.signal?.reason);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
options.signal.addEventListener('abort', abortFromParent, { once: true });
|
|
101
|
+
this.detachParentSignal = () => options.signal?.removeEventListener('abort', abortFromParent);
|
|
102
|
+
if (options.signal.aborted)
|
|
103
|
+
abortFromParent();
|
|
104
|
+
}
|
|
105
|
+
for (const provider of this.providers.values()) {
|
|
106
|
+
if (!provider.subscribe)
|
|
107
|
+
continue;
|
|
108
|
+
const subscription = provider.subscribe(invalidation => this.handleInvalidation(provider.id, invalidation), this.lifecycleController.signal);
|
|
109
|
+
this.subscriptions.push(subscription);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Observe provider descriptors and compose the deterministic scope overlay. */
|
|
113
|
+
async observe(scope, signal) {
|
|
114
|
+
this.assertActive();
|
|
115
|
+
const normalizedScope = normalizeScope(scope);
|
|
116
|
+
const providerIds = normalizedScope.providerIds
|
|
117
|
+
? new Set(normalizedScope.providerIds)
|
|
118
|
+
: undefined;
|
|
119
|
+
const selectedProviders = [...this.providers.values()]
|
|
120
|
+
.filter(provider => !providerIds || providerIds.has(provider.id))
|
|
121
|
+
.sort((left, right) => left.id.localeCompare(right.id));
|
|
122
|
+
const linked = linkSignals(this.lifecycleController.signal, signal);
|
|
123
|
+
try {
|
|
124
|
+
throwIfAborted(linked.signal);
|
|
125
|
+
const observations = await Promise.all(selectedProviders.map(async (provider) => {
|
|
126
|
+
const observation = await provider.list(normalizedScope, linked.signal);
|
|
127
|
+
return normalizeObservation(provider.id, observation, normalizedScope.sourceScopeOrder);
|
|
128
|
+
}));
|
|
129
|
+
throwIfAborted(linked.signal);
|
|
130
|
+
for (const observation of observations)
|
|
131
|
+
this.reconcileObservation(observation);
|
|
132
|
+
return composeCatalog(normalizedScope, observations);
|
|
133
|
+
}
|
|
134
|
+
finally {
|
|
135
|
+
linked.dispose();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/** Load one selected definition and issue an authority-intersection receipt. */
|
|
139
|
+
async getDefinition(request) {
|
|
140
|
+
this.assertActive();
|
|
141
|
+
const descriptor = request.catalog.descriptors.find(item => item.id === request.skillId);
|
|
142
|
+
if (!descriptor) {
|
|
143
|
+
throw new LazySkillRuntimeError(`Skill ${request.skillId} is not present in catalog ${request.catalog.digest}.`);
|
|
144
|
+
}
|
|
145
|
+
this.assertCatalogCurrent(request.catalog, descriptor.providerId);
|
|
146
|
+
if ((request.actor === 'model' && !descriptor.modelInvocable) ||
|
|
147
|
+
(request.actor === 'user' && !descriptor.userInvocable)) {
|
|
148
|
+
throw new SkillInvocationDeniedError(descriptor.id, request.actor);
|
|
149
|
+
}
|
|
150
|
+
const receipt = createAuthorityReceipt(request, descriptor);
|
|
151
|
+
const definition = await this.loadDefinition(descriptor, request.catalog, request.signal);
|
|
152
|
+
return deepFreeze({ definition, receipt });
|
|
153
|
+
}
|
|
154
|
+
/** Read one manifest-declared resource after its definition has been selected. */
|
|
155
|
+
async getResource(request) {
|
|
156
|
+
this.assertActive();
|
|
157
|
+
const definition = request.selection.definition;
|
|
158
|
+
assertSelectionIdentity(request.selection);
|
|
159
|
+
const path = normalizeResourcePath(request.path);
|
|
160
|
+
const resourceDescriptor = definition.resourceManifest.find(resource => resource.path === path);
|
|
161
|
+
if (!resourceDescriptor) {
|
|
162
|
+
throw new LazySkillRuntimeError(`Resource ${path} is not declared by Skill ${definition.id}.`);
|
|
163
|
+
}
|
|
164
|
+
const provider = this.providers.get(definition.providerId);
|
|
165
|
+
if (!provider) {
|
|
166
|
+
throw new LazySkillRuntimeError(`Unknown Skill provider: ${definition.providerId}`);
|
|
167
|
+
}
|
|
168
|
+
const state = this.requireObservedState(definition.providerId);
|
|
169
|
+
if (state.descriptorDigests.get(definition.id) !== definition.digest) {
|
|
170
|
+
throw new StaleSkillLoadError(definition.providerId, definition.id);
|
|
171
|
+
}
|
|
172
|
+
const key = resourceCacheKey(definition, resourceDescriptor);
|
|
173
|
+
if (state.complete) {
|
|
174
|
+
const cached = this.resourceCache.get(key);
|
|
175
|
+
if (cached)
|
|
176
|
+
return cloneResource(cached);
|
|
177
|
+
}
|
|
178
|
+
let flight = this.resourceFlights.get(key);
|
|
179
|
+
if (!flight) {
|
|
180
|
+
flight = this.startResourceLoad(provider, definition, resourceDescriptor, state);
|
|
181
|
+
this.resourceFlights.set(key, flight);
|
|
182
|
+
void flight.then(() => this.resourceFlights.delete(key), () => this.resourceFlights.delete(key));
|
|
183
|
+
}
|
|
184
|
+
const resource = await waitForPromise(flight, request.signal);
|
|
185
|
+
return cloneResource(resource);
|
|
186
|
+
}
|
|
187
|
+
/** Watchers call this indirectly; tests and explicit refresh paths may call it directly. */
|
|
188
|
+
invalidateProvider(providerId, reason = 'provider_invalidated') {
|
|
189
|
+
if (!this.providers.has(providerId)) {
|
|
190
|
+
throw new LazySkillRuntimeError(`Unknown Skill provider: ${providerId}`);
|
|
191
|
+
}
|
|
192
|
+
const previous = this.providerStates.get(providerId);
|
|
193
|
+
this.providerStates.set(providerId, {
|
|
194
|
+
generation: (previous?.generation ?? 0) + 1,
|
|
195
|
+
observed: false,
|
|
196
|
+
complete: false,
|
|
197
|
+
descriptorDigests: new Map(),
|
|
198
|
+
});
|
|
199
|
+
this.deleteProviderCacheEntries(providerId);
|
|
200
|
+
void reason;
|
|
201
|
+
}
|
|
202
|
+
stats() {
|
|
203
|
+
return Object.freeze({
|
|
204
|
+
definitionCache: this.definitionCache.stats(),
|
|
205
|
+
resourceCache: this.resourceCache.stats(),
|
|
206
|
+
definitionLoadsInFlight: this.definitionFlights.size,
|
|
207
|
+
resourceLoadsInFlight: this.resourceFlights.size,
|
|
208
|
+
providerGenerations: Object.freeze(Object.fromEntries([...this.providerStates.entries()]
|
|
209
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
210
|
+
.map(([providerId, state]) => [providerId, state.generation]))),
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
async dispose() {
|
|
214
|
+
if (this.disposed)
|
|
215
|
+
return;
|
|
216
|
+
this.disposed = true;
|
|
217
|
+
this.detachParentSignal?.();
|
|
218
|
+
if (!this.lifecycleController.signal.aborted) {
|
|
219
|
+
this.lifecycleController.abort(new Error('Lazy Skill runtime disposed.'));
|
|
220
|
+
}
|
|
221
|
+
const subscriptions = this.subscriptions.splice(0).reverse();
|
|
222
|
+
await Promise.allSettled(subscriptions.map(subscription => subscription.dispose()));
|
|
223
|
+
this.definitionCache.clear();
|
|
224
|
+
this.resourceCache.clear();
|
|
225
|
+
this.providerStates.clear();
|
|
226
|
+
}
|
|
227
|
+
async loadDefinition(descriptor, catalog, signal) {
|
|
228
|
+
const provider = this.providers.get(descriptor.providerId);
|
|
229
|
+
if (!provider)
|
|
230
|
+
throw new LazySkillRuntimeError(`Unknown Skill provider: ${descriptor.providerId}`);
|
|
231
|
+
const state = this.requireObservedState(descriptor.providerId);
|
|
232
|
+
const key = definitionCacheKey(descriptor);
|
|
233
|
+
if (state.complete) {
|
|
234
|
+
const cached = this.definitionCache.get(key);
|
|
235
|
+
if (cached)
|
|
236
|
+
return cached;
|
|
237
|
+
}
|
|
238
|
+
let flight = this.definitionFlights.get(key);
|
|
239
|
+
if (!flight) {
|
|
240
|
+
flight = this.startDefinitionLoad(provider, descriptor, catalog, state);
|
|
241
|
+
this.definitionFlights.set(key, flight);
|
|
242
|
+
void flight.then(() => this.definitionFlights.delete(key), () => this.definitionFlights.delete(key));
|
|
243
|
+
}
|
|
244
|
+
return waitForPromise(flight, signal);
|
|
245
|
+
}
|
|
246
|
+
async startDefinitionLoad(provider, descriptor, catalog, state) {
|
|
247
|
+
const loaded = await provider.get(descriptor.id, this.lifecycleController.signal);
|
|
248
|
+
if (!loaded) {
|
|
249
|
+
throw new LazySkillRuntimeError(`Skill ${descriptor.id} was not found by ${provider.id}.`);
|
|
250
|
+
}
|
|
251
|
+
const definition = normalizeDefinition(descriptor, loaded);
|
|
252
|
+
const current = this.providerStates.get(provider.id);
|
|
253
|
+
if (!current || current.generation !== state.generation || !current.observed) {
|
|
254
|
+
throw new StaleSkillLoadError(provider.id, descriptor.id);
|
|
255
|
+
}
|
|
256
|
+
this.assertCatalogCurrent(catalog, provider.id);
|
|
257
|
+
if (current.complete)
|
|
258
|
+
this.definitionCache.set(definitionCacheKey(descriptor), definition);
|
|
259
|
+
return definition;
|
|
260
|
+
}
|
|
261
|
+
async startResourceLoad(provider, definition, resourceDescriptor, state) {
|
|
262
|
+
const loaded = await provider.getResource(definition.id, resourceDescriptor.path, this.lifecycleController.signal);
|
|
263
|
+
const resource = normalizeResource(definition, resourceDescriptor, loaded);
|
|
264
|
+
const current = this.providerStates.get(provider.id);
|
|
265
|
+
if (!current || current.generation !== state.generation || !current.observed) {
|
|
266
|
+
throw new StaleSkillLoadError(provider.id, definition.id);
|
|
267
|
+
}
|
|
268
|
+
if (current.complete)
|
|
269
|
+
this.resourceCache.set(resourceCacheKey(definition, resourceDescriptor), resource);
|
|
270
|
+
return resource;
|
|
271
|
+
}
|
|
272
|
+
reconcileObservation(observation) {
|
|
273
|
+
const previous = this.providerStates.get(observation.providerId);
|
|
274
|
+
const stableMatch = observation.complete &&
|
|
275
|
+
previous?.observed === true &&
|
|
276
|
+
previous.complete &&
|
|
277
|
+
previous.digest === observation.digest;
|
|
278
|
+
if (stableMatch)
|
|
279
|
+
return;
|
|
280
|
+
this.deleteProviderCacheEntries(observation.providerId);
|
|
281
|
+
this.providerStates.set(observation.providerId, {
|
|
282
|
+
generation: (previous?.generation ?? 0) + 1,
|
|
283
|
+
observed: true,
|
|
284
|
+
complete: observation.complete,
|
|
285
|
+
digest: observation.digest,
|
|
286
|
+
descriptorDigests: new Map(observation.descriptors.map(descriptor => [descriptor.id, descriptor.digest])),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
assertCatalogCurrent(catalog, providerId) {
|
|
290
|
+
const observation = catalog.observations.find(item => item.providerId === providerId);
|
|
291
|
+
const state = this.providerStates.get(providerId);
|
|
292
|
+
if (!observation || !state?.observed || state.digest !== observation.digest) {
|
|
293
|
+
throw new StaleSkillCatalogError(providerId);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
requireObservedState(providerId) {
|
|
297
|
+
const state = this.providerStates.get(providerId);
|
|
298
|
+
if (!state?.observed)
|
|
299
|
+
throw new StaleSkillCatalogError(providerId);
|
|
300
|
+
return state;
|
|
301
|
+
}
|
|
302
|
+
handleInvalidation(providerId, invalidation) {
|
|
303
|
+
if (invalidation.providerId !== providerId) {
|
|
304
|
+
throw new LazySkillRuntimeError(`Provider ${providerId} emitted invalidation for ${invalidation.providerId}.`);
|
|
305
|
+
}
|
|
306
|
+
this.invalidateProvider(providerId, invalidation.reason);
|
|
307
|
+
}
|
|
308
|
+
deleteProviderCacheEntries(providerId) {
|
|
309
|
+
const prefix = `${providerId}\u0000`;
|
|
310
|
+
this.definitionCache.deleteWhere(key => key.startsWith(prefix));
|
|
311
|
+
this.resourceCache.deleteWhere(key => key.startsWith(prefix));
|
|
312
|
+
}
|
|
313
|
+
assertActive() {
|
|
314
|
+
if (this.disposed || this.lifecycleController.signal.aborted) {
|
|
315
|
+
throw new LazySkillRuntimeError('Lazy Skill runtime is disposed.');
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
exports.LazySkillRuntime = LazySkillRuntime;
|
|
320
|
+
function composeCatalog(scope, observations) {
|
|
321
|
+
const byName = new Map();
|
|
322
|
+
const descriptorIds = new Set();
|
|
323
|
+
for (const observation of observations) {
|
|
324
|
+
for (const descriptor of observation.descriptors) {
|
|
325
|
+
const scopeRank = scope.sourceScopeOrder.indexOf(descriptor.sourceScope);
|
|
326
|
+
if (scopeRank < 0)
|
|
327
|
+
continue;
|
|
328
|
+
const nameKey = descriptor.name.toLowerCase();
|
|
329
|
+
const candidates = byName.get(nameKey) ?? [];
|
|
330
|
+
candidates.push({ descriptor, scopeRank });
|
|
331
|
+
byName.set(nameKey, candidates);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const descriptors = [];
|
|
335
|
+
const shadowDiagnostics = [];
|
|
336
|
+
for (const candidates of byName.values()) {
|
|
337
|
+
candidates.sort(compareCandidates);
|
|
338
|
+
const selected = candidates[0].descriptor;
|
|
339
|
+
if (descriptorIds.has(selected.id)) {
|
|
340
|
+
throw new LazySkillRuntimeError(`Duplicate selected Skill id: ${selected.id}`);
|
|
341
|
+
}
|
|
342
|
+
descriptorIds.add(selected.id);
|
|
343
|
+
descriptors.push(selected);
|
|
344
|
+
for (const shadowed of candidates.slice(1)) {
|
|
345
|
+
shadowDiagnostics.push(deepFreeze({
|
|
346
|
+
name: selected.name,
|
|
347
|
+
selected: descriptorIdentity(selected),
|
|
348
|
+
shadowed: descriptorIdentity(shadowed.descriptor),
|
|
349
|
+
reason: selected.sourceScope === shadowed.descriptor.sourceScope
|
|
350
|
+
? 'same source scope; deterministic provider/id tie-break'
|
|
351
|
+
: `${selected.sourceScope} source scope outranks ${shadowed.descriptor.sourceScope}`,
|
|
352
|
+
}));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
descriptors.sort((left, right) => left.name.localeCompare(right.name) || left.id.localeCompare(right.id));
|
|
356
|
+
shadowDiagnostics.sort((left, right) => left.name.localeCompare(right.name) ||
|
|
357
|
+
left.shadowed.providerId.localeCompare(right.shadowed.providerId) ||
|
|
358
|
+
left.shadowed.id.localeCompare(right.shadowed.id));
|
|
359
|
+
const observationReceipts = observations
|
|
360
|
+
.map(observation => deepFreeze({
|
|
361
|
+
providerId: observation.providerId,
|
|
362
|
+
digest: observation.digest,
|
|
363
|
+
complete: observation.complete,
|
|
364
|
+
descriptorCount: observation.descriptors.length,
|
|
365
|
+
}))
|
|
366
|
+
.sort((left, right) => left.providerId.localeCompare(right.providerId));
|
|
367
|
+
const digest = (0, canonical_1.digestRuntimeValue)({
|
|
368
|
+
version: types_1.LAZY_SKILL_RUNTIME_VERSION,
|
|
369
|
+
sourceScopeOrder: scope.sourceScopeOrder,
|
|
370
|
+
descriptors,
|
|
371
|
+
observations: observationReceipts,
|
|
372
|
+
shadowDiagnostics,
|
|
373
|
+
});
|
|
374
|
+
return deepFreeze({
|
|
375
|
+
version: types_1.LAZY_SKILL_RUNTIME_VERSION,
|
|
376
|
+
scopeId: scope.id,
|
|
377
|
+
sourceScopeOrder: scope.sourceScopeOrder,
|
|
378
|
+
descriptors,
|
|
379
|
+
observations: observationReceipts,
|
|
380
|
+
shadowDiagnostics,
|
|
381
|
+
digest,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
function compareCandidates(left, right) {
|
|
385
|
+
return (left.scopeRank - right.scopeRank ||
|
|
386
|
+
left.descriptor.providerId.localeCompare(right.descriptor.providerId) ||
|
|
387
|
+
left.descriptor.id.localeCompare(right.descriptor.id));
|
|
388
|
+
}
|
|
389
|
+
function descriptorIdentity(descriptor) {
|
|
390
|
+
return Object.freeze({
|
|
391
|
+
id: descriptor.id,
|
|
392
|
+
providerId: descriptor.providerId,
|
|
393
|
+
sourceScope: descriptor.sourceScope,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
function normalizeScope(scope) {
|
|
397
|
+
const id = validateIdentifier(scope.id, 'Skill scope id');
|
|
398
|
+
const sourceScopeOrder = [...(scope.sourceScopeOrder ?? types_1.DEFAULT_SKILL_SOURCE_SCOPE_ORDER)];
|
|
399
|
+
if (sourceScopeOrder.length === 0 || new Set(sourceScopeOrder).size !== sourceScopeOrder.length) {
|
|
400
|
+
throw new LazySkillRuntimeError('Skill source scope order must be non-empty and unique.');
|
|
401
|
+
}
|
|
402
|
+
const providerIds = scope.providerIds
|
|
403
|
+
? Object.freeze([
|
|
404
|
+
...new Set(scope.providerIds.map(providerId => validateIdentifier(providerId, 'Provider id'))),
|
|
405
|
+
].sort())
|
|
406
|
+
: undefined;
|
|
407
|
+
return {
|
|
408
|
+
id,
|
|
409
|
+
sourceScopeOrder: Object.freeze(sourceScopeOrder),
|
|
410
|
+
providerIds,
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function normalizeObservation(providerId, observation, sourceScopeOrder) {
|
|
414
|
+
if (observation.version !== types_1.LAZY_SKILL_RUNTIME_VERSION) {
|
|
415
|
+
throw new LazySkillRuntimeError(`Provider ${providerId} returned unsupported observation version.`);
|
|
416
|
+
}
|
|
417
|
+
if (observation.providerId !== providerId) {
|
|
418
|
+
throw new LazySkillRuntimeError(`Provider ${providerId} returned observation for ${observation.providerId}.`);
|
|
419
|
+
}
|
|
420
|
+
const digest = validateDigest(observation.digest, `Provider ${providerId} observation digest`);
|
|
421
|
+
const allowedScopes = new Set(sourceScopeOrder);
|
|
422
|
+
const descriptors = observation.descriptors
|
|
423
|
+
.map(descriptor => normalizeDescriptor(providerId, descriptor))
|
|
424
|
+
.filter(descriptor => allowedScopes.has(descriptor.sourceScope));
|
|
425
|
+
return deepFreeze({
|
|
426
|
+
version: types_1.LAZY_SKILL_RUNTIME_VERSION,
|
|
427
|
+
providerId,
|
|
428
|
+
digest,
|
|
429
|
+
complete: observation.complete === true,
|
|
430
|
+
descriptors,
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
function normalizeDescriptor(providerId, descriptor) {
|
|
434
|
+
if (descriptor.providerId !== providerId) {
|
|
435
|
+
throw new LazySkillRuntimeError(`Skill ${descriptor.id} belongs to ${descriptor.providerId}, not provider ${providerId}.`);
|
|
436
|
+
}
|
|
437
|
+
if (!types_1.DEFAULT_SKILL_SOURCE_SCOPE_ORDER.includes(descriptor.sourceScope)) {
|
|
438
|
+
throw new LazySkillRuntimeError(`Skill ${descriptor.id} has invalid source scope.`);
|
|
439
|
+
}
|
|
440
|
+
return deepFreeze({
|
|
441
|
+
id: validateIdentifier(descriptor.id, 'Skill id'),
|
|
442
|
+
name: validateIdentifier(descriptor.name, 'Skill name'),
|
|
443
|
+
description: descriptor.description.trim().slice(0, MAX_CATALOG_DESCRIPTION_CHARS),
|
|
444
|
+
providerId,
|
|
445
|
+
sourceScope: descriptor.sourceScope,
|
|
446
|
+
modelInvocable: descriptor.modelInvocable === true,
|
|
447
|
+
userInvocable: descriptor.userInvocable === true,
|
|
448
|
+
requestedCapabilities: normalizeCapabilities(descriptor.requestedCapabilities),
|
|
449
|
+
digest: validateDigest(descriptor.digest, `Skill ${descriptor.id} digest`),
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
function normalizeDefinition(descriptor, definition) {
|
|
453
|
+
if (definition.id !== descriptor.id ||
|
|
454
|
+
definition.providerId !== descriptor.providerId ||
|
|
455
|
+
definition.digest !== descriptor.digest) {
|
|
456
|
+
throw new LazySkillRuntimeError(`Skill definition identity or digest drifted: ${descriptor.id}`);
|
|
457
|
+
}
|
|
458
|
+
if (typeof definition.body !== 'string') {
|
|
459
|
+
throw new LazySkillRuntimeError(`Skill ${descriptor.id} definition body must be text.`);
|
|
460
|
+
}
|
|
461
|
+
const resourcePaths = new Set();
|
|
462
|
+
const resourceManifest = definition.resourceManifest
|
|
463
|
+
.map(resource => normalizeResourceDescriptor(descriptor.id, resource))
|
|
464
|
+
.sort((left, right) => left.path.localeCompare(right.path));
|
|
465
|
+
for (const resource of resourceManifest) {
|
|
466
|
+
if (resourcePaths.has(resource.path)) {
|
|
467
|
+
throw new LazySkillRuntimeError(`Skill ${descriptor.id} declares resource ${resource.path} more than once.`);
|
|
468
|
+
}
|
|
469
|
+
resourcePaths.add(resource.path);
|
|
470
|
+
}
|
|
471
|
+
return deepFreeze({
|
|
472
|
+
...descriptor,
|
|
473
|
+
body: definition.body,
|
|
474
|
+
resourceManifest,
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
function normalizeResourceDescriptor(skillId, descriptor) {
|
|
478
|
+
if (!Number.isSafeInteger(descriptor.bytes) || descriptor.bytes < 0) {
|
|
479
|
+
throw new LazySkillRuntimeError(`Skill ${skillId} resource bytes must be non-negative.`);
|
|
480
|
+
}
|
|
481
|
+
return deepFreeze({
|
|
482
|
+
path: normalizeResourcePath(descriptor.path),
|
|
483
|
+
digest: validateDigest(descriptor.digest, `Skill ${skillId} resource digest`),
|
|
484
|
+
bytes: descriptor.bytes,
|
|
485
|
+
...(descriptor.mediaType?.trim() ? { mediaType: descriptor.mediaType.trim() } : {}),
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
function normalizeResource(definition, descriptor, resource) {
|
|
489
|
+
if (resource.skillId !== definition.id ||
|
|
490
|
+
normalizeResourcePath(resource.path) !== descriptor.path ||
|
|
491
|
+
resource.digest !== descriptor.digest) {
|
|
492
|
+
throw new LazySkillRuntimeError(`Skill resource identity or digest drifted: ${definition.id}/${descriptor.path}`);
|
|
493
|
+
}
|
|
494
|
+
const content = typeof resource.content === 'string'
|
|
495
|
+
? resource.content
|
|
496
|
+
: new Uint8Array(resource.content.buffer, resource.content.byteOffset, resource.content.byteLength).slice();
|
|
497
|
+
const actualBytes = typeof content === 'string' ? buffer_1.Buffer.byteLength(content, 'utf8') : content.byteLength;
|
|
498
|
+
if (actualBytes !== descriptor.bytes) {
|
|
499
|
+
throw new LazySkillRuntimeError(`Skill resource byte count drifted: ${definition.id}/${descriptor.path}`);
|
|
500
|
+
}
|
|
501
|
+
if (descriptor.mediaType && resource.mediaType && descriptor.mediaType !== resource.mediaType) {
|
|
502
|
+
throw new LazySkillRuntimeError(`Skill resource media type drifted: ${definition.id}/${descriptor.path}`);
|
|
503
|
+
}
|
|
504
|
+
return Object.freeze({
|
|
505
|
+
skillId: definition.id,
|
|
506
|
+
path: descriptor.path,
|
|
507
|
+
digest: descriptor.digest,
|
|
508
|
+
content,
|
|
509
|
+
...(descriptor.mediaType || resource.mediaType
|
|
510
|
+
? { mediaType: descriptor.mediaType || resource.mediaType }
|
|
511
|
+
: {}),
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
function createAuthorityReceipt(request, descriptor) {
|
|
515
|
+
const authorityId = validateIdentifier(request.authority.authorityId, 'Skill authority id');
|
|
516
|
+
const authorityDigest = validateDigest(request.authority.digest, 'Skill authority digest');
|
|
517
|
+
const reason = request.reason.trim();
|
|
518
|
+
if (!reason)
|
|
519
|
+
throw new LazySkillRuntimeError('Skill load reason must not be empty.');
|
|
520
|
+
const requestedCapabilities = normalizeCapabilities(descriptor.requestedCapabilities);
|
|
521
|
+
const allowed = new Set(normalizeCapabilities(request.authority.allowedCapabilities));
|
|
522
|
+
const grantedCapabilities = requestedCapabilities.filter(capability => allowed.has(capability));
|
|
523
|
+
const omittedCapabilityReasons = Object.fromEntries(requestedCapabilities
|
|
524
|
+
.filter(capability => !allowed.has(capability))
|
|
525
|
+
.map(capability => [
|
|
526
|
+
capability,
|
|
527
|
+
request.authority.deniedCapabilityReasons?.[capability]?.trim() ||
|
|
528
|
+
'not_granted_by_current_authority',
|
|
529
|
+
]));
|
|
530
|
+
const base = {
|
|
531
|
+
version: types_1.LAZY_SKILL_RUNTIME_VERSION,
|
|
532
|
+
skillId: descriptor.id,
|
|
533
|
+
skillName: descriptor.name,
|
|
534
|
+
providerId: descriptor.providerId,
|
|
535
|
+
sourceScope: descriptor.sourceScope,
|
|
536
|
+
descriptorDigest: descriptor.digest,
|
|
537
|
+
catalogDigest: request.catalog.digest,
|
|
538
|
+
actor: request.actor,
|
|
539
|
+
reason,
|
|
540
|
+
requestedCapabilities,
|
|
541
|
+
grantedCapabilities,
|
|
542
|
+
omittedCapabilityReasons,
|
|
543
|
+
authorityId,
|
|
544
|
+
authorityDigest,
|
|
545
|
+
};
|
|
546
|
+
return deepFreeze({ ...base, digest: (0, canonical_1.digestRuntimeValue)(base) });
|
|
547
|
+
}
|
|
548
|
+
function assertSelectionIdentity(selection) {
|
|
549
|
+
const { definition, receipt } = selection;
|
|
550
|
+
if (receipt.skillId !== definition.id ||
|
|
551
|
+
receipt.skillName !== definition.name ||
|
|
552
|
+
receipt.providerId !== definition.providerId ||
|
|
553
|
+
receipt.sourceScope !== definition.sourceScope ||
|
|
554
|
+
receipt.descriptorDigest !== definition.digest) {
|
|
555
|
+
throw new LazySkillRuntimeError(`Skill selection receipt does not bind ${definition.id}.`);
|
|
556
|
+
}
|
|
557
|
+
const { digest, ...receiptBase } = receipt;
|
|
558
|
+
if ((0, canonical_1.digestRuntimeValue)(receiptBase) !== digest) {
|
|
559
|
+
throw new LazySkillRuntimeError(`Skill selection receipt digest drifted: ${definition.id}.`);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function normalizeCapabilities(capabilities) {
|
|
563
|
+
return Object.freeze([...new Set(capabilities.map(capability => capability.trim()).filter(Boolean))].sort());
|
|
564
|
+
}
|
|
565
|
+
function normalizeResourcePath(path) {
|
|
566
|
+
const normalized = path.trim().replace(/\\/g, '/').replace(/^\.\//, '');
|
|
567
|
+
if (!normalized ||
|
|
568
|
+
normalized.startsWith('/') ||
|
|
569
|
+
/^[a-z]:\//i.test(normalized) ||
|
|
570
|
+
normalized.split('/').some(segment => segment === '..' || segment === '' || segment === '.')) {
|
|
571
|
+
throw new LazySkillRuntimeError(`Skill resource path must be a contained relative path: ${path}`);
|
|
572
|
+
}
|
|
573
|
+
return normalized;
|
|
574
|
+
}
|
|
575
|
+
function validateIdentifier(value, label) {
|
|
576
|
+
const normalized = value.trim();
|
|
577
|
+
if (!normalized || normalized.includes('\u0000')) {
|
|
578
|
+
throw new LazySkillRuntimeError(`${label} must be non-empty and contain no null bytes.`);
|
|
579
|
+
}
|
|
580
|
+
return normalized;
|
|
581
|
+
}
|
|
582
|
+
function validateDigest(value, label) {
|
|
583
|
+
const normalized = value.trim();
|
|
584
|
+
if (!normalized)
|
|
585
|
+
throw new LazySkillRuntimeError(`${label} must not be empty.`);
|
|
586
|
+
return normalized;
|
|
587
|
+
}
|
|
588
|
+
function definitionCacheKey(descriptor) {
|
|
589
|
+
return `${descriptor.providerId}\u0000definition\u0000${descriptor.id}\u0000${descriptor.digest}`;
|
|
590
|
+
}
|
|
591
|
+
function resourceCacheKey(definition, resource) {
|
|
592
|
+
return (`${definition.providerId}\u0000resource\u0000${definition.id}\u0000${definition.digest}` +
|
|
593
|
+
`\u0000${resource.path}\u0000${resource.digest}`);
|
|
594
|
+
}
|
|
595
|
+
function resourceBytes(resource) {
|
|
596
|
+
const contentBytes = typeof resource.content === 'string'
|
|
597
|
+
? buffer_1.Buffer.byteLength(resource.content, 'utf8')
|
|
598
|
+
: resource.content.byteLength;
|
|
599
|
+
return contentBytes + buffer_1.Buffer.byteLength(resource.path + resource.digest, 'utf8');
|
|
600
|
+
}
|
|
601
|
+
function cloneResource(resource) {
|
|
602
|
+
return Object.freeze({
|
|
603
|
+
...resource,
|
|
604
|
+
content: typeof resource.content === 'string'
|
|
605
|
+
? resource.content
|
|
606
|
+
: new Uint8Array(resource.content).slice(),
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
function throwIfAborted(signal) {
|
|
610
|
+
if (!signal.aborted)
|
|
611
|
+
return;
|
|
612
|
+
const reason = signal.reason;
|
|
613
|
+
throw reason instanceof Error ? reason : new Error(String(reason || 'Operation aborted.'));
|
|
614
|
+
}
|
|
615
|
+
function linkSignals(primary, secondary) {
|
|
616
|
+
if (!secondary)
|
|
617
|
+
return { signal: primary, dispose: () => undefined };
|
|
618
|
+
const controller = new AbortController();
|
|
619
|
+
const abort = (signal) => {
|
|
620
|
+
if (!controller.signal.aborted)
|
|
621
|
+
controller.abort(signal.reason);
|
|
622
|
+
};
|
|
623
|
+
const onPrimary = () => abort(primary);
|
|
624
|
+
const onSecondary = () => abort(secondary);
|
|
625
|
+
primary.addEventListener('abort', onPrimary, { once: true });
|
|
626
|
+
secondary.addEventListener('abort', onSecondary, { once: true });
|
|
627
|
+
if (primary.aborted)
|
|
628
|
+
abort(primary);
|
|
629
|
+
if (secondary.aborted)
|
|
630
|
+
abort(secondary);
|
|
631
|
+
return {
|
|
632
|
+
signal: controller.signal,
|
|
633
|
+
dispose: () => {
|
|
634
|
+
primary.removeEventListener('abort', onPrimary);
|
|
635
|
+
secondary.removeEventListener('abort', onSecondary);
|
|
636
|
+
},
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
function waitForPromise(promise, signal) {
|
|
640
|
+
if (!signal)
|
|
641
|
+
return promise;
|
|
642
|
+
throwIfAborted(signal);
|
|
643
|
+
return new Promise((resolve, reject) => {
|
|
644
|
+
const onAbort = () => {
|
|
645
|
+
cleanup();
|
|
646
|
+
try {
|
|
647
|
+
throwIfAborted(signal);
|
|
648
|
+
}
|
|
649
|
+
catch (error) {
|
|
650
|
+
reject(error);
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
const cleanup = () => signal.removeEventListener('abort', onAbort);
|
|
654
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
655
|
+
void promise.then(value => {
|
|
656
|
+
cleanup();
|
|
657
|
+
resolve(value);
|
|
658
|
+
}, error => {
|
|
659
|
+
cleanup();
|
|
660
|
+
reject(error);
|
|
661
|
+
});
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
function deepFreeze(value) {
|
|
665
|
+
if (value === null || typeof value !== 'object' || Object.isFrozen(value))
|
|
666
|
+
return value;
|
|
667
|
+
if (ArrayBuffer.isView(value))
|
|
668
|
+
return value;
|
|
669
|
+
for (const nested of Object.values(value))
|
|
670
|
+
deepFreeze(nested);
|
|
671
|
+
return Object.freeze(value);
|
|
672
|
+
}
|
|
673
|
+
//# sourceMappingURL=lazy-skill-runtime.js.map
|