@orion-agents/orion-code 0.1.9 → 0.2.2
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 +85 -0
- package/README.md +142 -323
- package/README.zh-CN.md +118 -578
- package/dist/cli.js +65 -84
- 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 +132 -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 +1 -1
- package/dist/commands/model-command-handlers.js +2 -2
- 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 +1 -1
- package/dist/commands/session-command-handlers.d.ts.map +1 -1
- package/dist/commands/session-command-handlers.js +52 -214
- 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 +0 -48
- 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 +10 -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 +3 -3
- package/dist/framework/index.d.ts.map +1 -1
- package/dist/framework/index.js +6 -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 +45 -22
- package/dist/framework/query.d.ts.map +1 -1
- package/dist/framework/query.js +64 -52
- package/dist/framework/query.js.map +1 -1
- 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/index.d.ts +70 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +64 -65
- package/dist/index.js.map +1 -1
- 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 +80 -0
- package/dist/runtime/agent-loop.d.ts.map +1 -0
- package/dist/runtime/agent-loop.js +419 -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 +270 -1216
- 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 +36 -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 +111 -0
- package/dist/runtime/goal-runtime-coordinator.d.ts.map +1 -0
- package/dist/runtime/goal-runtime-coordinator.js +511 -0
- package/dist/runtime/goal-runtime-coordinator.js.map +1 -0
- 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/orion-runtime-v1.d.ts +322 -0
- package/dist/runtime/orion-runtime-v1.d.ts.map +1 -0
- package/dist/runtime/orion-runtime-v1.js +959 -0
- package/dist/runtime/orion-runtime-v1.js.map +1 -0
- package/dist/runtime/orion-session-runner.d.ts +38 -0
- package/dist/runtime/orion-session-runner.d.ts.map +1 -0
- package/dist/runtime/orion-session-runner.js +168 -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 +1047 -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 +110 -0
- package/dist/runtime/release-receipts.d.ts.map +1 -0
- package/dist/runtime/release-receipts.js +305 -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/session-history-recovery.d.ts +19 -0
- package/dist/runtime/session-history-recovery.d.ts.map +1 -0
- package/dist/runtime/session-history-recovery.js +45 -0
- package/dist/runtime/session-history-recovery.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 +4 -1
- 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 -46
- package/dist/runtime/subagents/production.d.ts.map +1 -1
- package/dist/runtime/subagents/production.js +494 -170
- 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/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 -198
- 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 +83 -40
- package/dist/runtime/subagents/supervisor.js.map +1 -1
- package/dist/runtime/subagents/types.d.ts +1 -1
- package/dist/runtime/subagents/types.js +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-session-view.d.ts +45 -0
- package/dist/runtime/thread-session-view.d.ts.map +1 -0
- package/dist/runtime/thread-session-view.js +264 -0
- package/dist/runtime/thread-session-view.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 +87 -0
- package/dist/runtime/thread-ui-adapter.d.ts.map +1 -0
- package/dist/runtime/thread-ui-adapter.js +580 -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 +2 -1
- package/dist/runtime/ui-view-model.d.ts.map +1 -1
- package/dist/runtime/ui-view-model.js +6 -5
- package/dist/runtime/ui-view-model.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-lock.d.ts.map +1 -1
- package/dist/services/file-lock.js +42 -17
- package/dist/services/file-lock.js.map +1 -1
- package/dist/services/global-config.d.ts +2 -2
- package/dist/services/global-config.d.ts.map +1 -1
- package/dist/services/session-storage.d.ts +8 -0
- package/dist/services/session-storage.d.ts.map +1 -1
- package/dist/services/session-storage.js +76 -12
- package/dist/services/session-storage.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 +21 -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/tools/web.js +1 -1
- package/dist/tools/web.js.map +1 -1
- package/dist/tui-ui/chrome-view-model.d.ts.map +1 -1
- package/dist/tui-ui/chrome-view-model.js +22 -8
- package/dist/tui-ui/chrome-view-model.js.map +1 -1
- package/dist/tui-ui/launch.d.ts.map +1 -1
- package/dist/tui-ui/launch.js +13 -0
- package/dist/tui-ui/launch.js.map +1 -1
- package/dist/tui-ui/layout.js +1 -1
- package/dist/tui-ui/layout.js.map +1 -1
- package/dist/tui-ui/state.d.ts.map +1 -1
- package/dist/tui-ui/state.js +2 -0
- package/dist/tui-ui/state.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 +8 -8
- package/npm-shrinkwrap.json +45 -450
- package/package.json +17 -13
- 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 -291
- package/dist/agents/coordinator.js.map +0 -1
- package/dist/agents/fork.d.ts +0 -73
- package/dist/agents/fork.d.ts.map +0 -1
- package/dist/agents/fork.js +0 -163
- 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 -229
- 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 -191
- package/dist/framework/tool-scheduler.d.ts.map +0 -1
- package/dist/framework/tool-scheduler.js +0 -573
- 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 -27
- package/dist/ink-ui/screens/ReplScreen.d.ts.map +0 -1
- package/dist/ink-ui/screens/ReplScreen.js +0 -781
- 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-compact.d.ts +0 -26
- package/dist/runtime/chat-compact.d.ts.map +0 -1
- package/dist/runtime/chat-compact.js +0 -132
- package/dist/runtime/chat-compact.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 -1620
- 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 -92
- package/dist/runtime/goals/coordinator.d.ts.map +0 -1
- package/dist/runtime/goals/coordinator.js +0 -1471
- 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/stop-policy.d.ts +0 -9
- package/dist/runtime/goals/stop-policy.d.ts.map +0 -1
- package/dist/runtime/goals/stop-policy.js +0 -83
- package/dist/runtime/goals/stop-policy.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/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 -363
- 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
- package/docs/migration/v0.1.8-to-v0.1.9.md +0 -60
- package/docs/plan/v0.1.9-release-checklist.md +0 -64
|
@@ -0,0 +1,829 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilesystemSkillProviderV1 = exports.FilesystemSkillProviderError = exports.DEFAULT_FILESYSTEM_SKILL_PROVIDER_ID = exports.FILESYSTEM_SKILL_PROVIDER_VERSION = void 0;
|
|
4
|
+
exports.createFilesystemSkillRootsV1 = createFilesystemSkillRootsV1;
|
|
5
|
+
exports.createFilesystemSkillProviderV1 = createFilesystemSkillProviderV1;
|
|
6
|
+
exports.createProductionFilesystemSkillProviderV1 = createProductionFilesystemSkillProviderV1;
|
|
7
|
+
const buffer_1 = require("buffer");
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const promises_1 = require("fs/promises");
|
|
10
|
+
const os_1 = require("os");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const js_yaml_1 = require("js-yaml");
|
|
13
|
+
const paths_1 = require("../../product/paths");
|
|
14
|
+
const canonical_1 = require("../protocol/canonical");
|
|
15
|
+
const types_1 = require("./types");
|
|
16
|
+
exports.FILESYSTEM_SKILL_PROVIDER_VERSION = 1;
|
|
17
|
+
exports.DEFAULT_FILESYSTEM_SKILL_PROVIDER_ID = 'filesystem-skills-v1';
|
|
18
|
+
const SKILL_FILE_NAME = 'SKILL.md';
|
|
19
|
+
const DEFAULT_MAX_FRONTMATTER_BYTES = 16 * 1024;
|
|
20
|
+
const DEFAULT_MAX_DEFINITION_BYTES = 2 * 1024 * 1024;
|
|
21
|
+
const DEFAULT_MAX_RESOURCE_BYTES = 16 * 1024 * 1024;
|
|
22
|
+
const DEFAULT_MAX_SKILLS = 2048;
|
|
23
|
+
const DEFAULT_MAX_RESOURCE_FILES = 2048;
|
|
24
|
+
const DEFAULT_MAX_WATCH_PATHS = 1024;
|
|
25
|
+
const DEFAULT_WATCH_DEBOUNCE_MS = 25;
|
|
26
|
+
const FRONTMATTER_CHUNK_BYTES = 512;
|
|
27
|
+
const OMITTED_RESOURCE_NAMES = new Set(['.DS_Store']);
|
|
28
|
+
const OMITTED_RESOURCE_DIRECTORIES = new Set(['.git', 'node_modules']);
|
|
29
|
+
class FilesystemSkillProviderError extends Error {
|
|
30
|
+
constructor(message) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.code = 'ORION_FILESYSTEM_SKILL_PROVIDER_ERROR';
|
|
33
|
+
this.name = 'FilesystemSkillProviderError';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.FilesystemSkillProviderError = FilesystemSkillProviderError;
|
|
37
|
+
/**
|
|
38
|
+
* Descriptor-first provider for Orion's builtin, user, configured, and project roots.
|
|
39
|
+
* list() reads only bounded frontmatter prefixes; bodies/resources are selection-time IO.
|
|
40
|
+
*/
|
|
41
|
+
class FilesystemSkillProviderV1 {
|
|
42
|
+
constructor(options) {
|
|
43
|
+
this.version = exports.FILESYSTEM_SKILL_PROVIDER_VERSION;
|
|
44
|
+
this.listeners = new Set();
|
|
45
|
+
this.watchers = new Map();
|
|
46
|
+
this.records = new Map();
|
|
47
|
+
this.resourceManifests = new Map();
|
|
48
|
+
this.mutableStats = {
|
|
49
|
+
catalogScans: 0,
|
|
50
|
+
rootsObserved: 0,
|
|
51
|
+
skillFilesObserved: 0,
|
|
52
|
+
frontmatterPrefixReads: 0,
|
|
53
|
+
frontmatterPrefixBytes: 0,
|
|
54
|
+
definitionReads: 0,
|
|
55
|
+
definitionBytes: 0,
|
|
56
|
+
resourceReads: 0,
|
|
57
|
+
resourceBytes: 0,
|
|
58
|
+
unsafeEntriesRejected: 0,
|
|
59
|
+
incompleteObservations: 0,
|
|
60
|
+
watchInvalidations: 0,
|
|
61
|
+
watchErrors: 0,
|
|
62
|
+
};
|
|
63
|
+
this.id = normalizeIdentifier(options.id ?? exports.DEFAULT_FILESYSTEM_SKILL_PROVIDER_ID, 'Provider id');
|
|
64
|
+
this.roots = normalizeRoots(options.roots);
|
|
65
|
+
this.watchEnabled = options.watch !== false;
|
|
66
|
+
this.watchFactory = options.watchFactory ?? defaultWatchFactory;
|
|
67
|
+
this.watchDebounceMs = integerOption(options.watchDebounceMs ?? DEFAULT_WATCH_DEBOUNCE_MS, 'watchDebounceMs', true);
|
|
68
|
+
this.maxFrontmatterBytes = integerOption(options.maxFrontmatterBytes ?? DEFAULT_MAX_FRONTMATTER_BYTES, 'maxFrontmatterBytes');
|
|
69
|
+
this.maxDefinitionBytes = integerOption(options.maxDefinitionBytes ?? DEFAULT_MAX_DEFINITION_BYTES, 'maxDefinitionBytes');
|
|
70
|
+
this.maxResourceBytes = integerOption(options.maxResourceBytes ?? DEFAULT_MAX_RESOURCE_BYTES, 'maxResourceBytes');
|
|
71
|
+
this.maxSkills = integerOption(options.maxSkills ?? DEFAULT_MAX_SKILLS, 'maxSkills');
|
|
72
|
+
this.maxResourceFiles = integerOption(options.maxResourceFiles ?? DEFAULT_MAX_RESOURCE_FILES, 'maxResourceFiles');
|
|
73
|
+
this.maxWatchPaths = integerOption(options.maxWatchPaths ?? DEFAULT_MAX_WATCH_PATHS, 'maxWatchPaths');
|
|
74
|
+
}
|
|
75
|
+
async list(scope, signal) {
|
|
76
|
+
throwIfAborted(signal);
|
|
77
|
+
this.mutableStats.catalogScans++;
|
|
78
|
+
const allowed = new Set(scope.sourceScopeOrder ?? this.roots.map(root => root.sourceScope));
|
|
79
|
+
const scans = [];
|
|
80
|
+
let skillCount = 0;
|
|
81
|
+
for (const root of this.roots.filter(item => allowed.has(item.sourceScope))) {
|
|
82
|
+
throwIfAborted(signal);
|
|
83
|
+
const remaining = this.maxSkills - skillCount;
|
|
84
|
+
if (remaining <= 0) {
|
|
85
|
+
scans.push(emptyScan(root, 'incomplete', false));
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
const scan = await this.scanRoot(root, remaining, signal);
|
|
89
|
+
scans.push(scan);
|
|
90
|
+
skillCount += scan.records.length;
|
|
91
|
+
}
|
|
92
|
+
const records = scans
|
|
93
|
+
.flatMap(scan => scan.records)
|
|
94
|
+
.sort((left, right) => left.descriptor.name.localeCompare(right.descriptor.name) ||
|
|
95
|
+
left.descriptor.id.localeCompare(right.descriptor.id));
|
|
96
|
+
const next = new Map();
|
|
97
|
+
let collision = false;
|
|
98
|
+
for (const record of records) {
|
|
99
|
+
if (next.has(record.descriptor.id)) {
|
|
100
|
+
collision = true;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
next.set(record.descriptor.id, record);
|
|
104
|
+
}
|
|
105
|
+
this.records.clear();
|
|
106
|
+
for (const [id, record] of next)
|
|
107
|
+
this.records.set(id, record);
|
|
108
|
+
this.resourceManifests.clear();
|
|
109
|
+
const complete = scans.every(scan => scan.complete) && !collision;
|
|
110
|
+
if (!complete)
|
|
111
|
+
this.mutableStats.incompleteObservations++;
|
|
112
|
+
const descriptors = Object.freeze([...next.values()].map(record => record.descriptor));
|
|
113
|
+
const rootReceipts = scans.map(scan => scan.receipt).sort(compareRootReceipts);
|
|
114
|
+
const digest = (0, canonical_1.digestRuntimeValue)({
|
|
115
|
+
version: exports.FILESYSTEM_SKILL_PROVIDER_VERSION,
|
|
116
|
+
providerId: this.id,
|
|
117
|
+
complete,
|
|
118
|
+
roots: rootReceipts,
|
|
119
|
+
descriptors,
|
|
120
|
+
});
|
|
121
|
+
const observation = deepFreeze({
|
|
122
|
+
version: types_1.LAZY_SKILL_RUNTIME_VERSION,
|
|
123
|
+
providerId: this.id,
|
|
124
|
+
digest,
|
|
125
|
+
complete,
|
|
126
|
+
descriptors,
|
|
127
|
+
});
|
|
128
|
+
this.reconcileWatchers([
|
|
129
|
+
...this.roots.map(root => root.path),
|
|
130
|
+
...scans.flatMap(scan => scan.watchPaths),
|
|
131
|
+
]);
|
|
132
|
+
return observation;
|
|
133
|
+
}
|
|
134
|
+
async get(id, signal) {
|
|
135
|
+
throwIfAborted(signal);
|
|
136
|
+
const record = this.records.get(id);
|
|
137
|
+
if (!record)
|
|
138
|
+
return undefined;
|
|
139
|
+
const currentPath = await containedRealPath(record.skillFileRealPath, record.skillDirectoryRealPath, record.rootRealPath);
|
|
140
|
+
const read = await readBoundedFile(currentPath, this.maxDefinitionBytes, signal, 'Skill definition');
|
|
141
|
+
if (read.revision.digest !== record.skillFileRevision.digest) {
|
|
142
|
+
throw new FilesystemSkillProviderError(`Skill ${id} changed after catalog observation.`);
|
|
143
|
+
}
|
|
144
|
+
this.mutableStats.definitionReads++;
|
|
145
|
+
this.mutableStats.definitionBytes += read.buffer.byteLength;
|
|
146
|
+
const resources = await this.buildResourceManifest(record, signal);
|
|
147
|
+
const afterManifest = revisionFromStats(await (0, promises_1.stat)(currentPath, { bigint: true }));
|
|
148
|
+
if (afterManifest.digest !== record.skillFileRevision.digest) {
|
|
149
|
+
throw new FilesystemSkillProviderError(`Skill ${id} changed while loading its manifest.`);
|
|
150
|
+
}
|
|
151
|
+
this.resourceManifests.set(id, new Map(resources.map(resource => [resource.descriptor.path, resource])));
|
|
152
|
+
return deepFreeze({
|
|
153
|
+
...record.descriptor,
|
|
154
|
+
body: definitionBody(read.buffer.toString('utf8')),
|
|
155
|
+
resourceManifest: resources.map(resource => resource.descriptor),
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
async getResource(id, path, signal) {
|
|
159
|
+
throwIfAborted(signal);
|
|
160
|
+
const normalizedPath = normalizeResourcePath(path);
|
|
161
|
+
const record = this.records.get(id);
|
|
162
|
+
const resource = this.resourceManifests.get(id)?.get(normalizedPath);
|
|
163
|
+
if (!record || !resource) {
|
|
164
|
+
throw new FilesystemSkillProviderError(`Resource ${normalizedPath} is not in the selected manifest for Skill ${id}.`);
|
|
165
|
+
}
|
|
166
|
+
const currentPath = await containedRealPath(resource.realPath, record.skillDirectoryRealPath, record.rootRealPath);
|
|
167
|
+
const read = await readBoundedFile(currentPath, this.maxResourceBytes, signal, `Skill resource ${normalizedPath}`);
|
|
168
|
+
if (read.revision.digest !== resource.revision.digest) {
|
|
169
|
+
throw new FilesystemSkillProviderError(`Skill resource changed after manifest capture: ${id}/${normalizedPath}`);
|
|
170
|
+
}
|
|
171
|
+
this.mutableStats.resourceReads++;
|
|
172
|
+
this.mutableStats.resourceBytes += read.buffer.byteLength;
|
|
173
|
+
const mediaType = resource.descriptor.mediaType;
|
|
174
|
+
return Object.freeze({
|
|
175
|
+
skillId: id,
|
|
176
|
+
path: normalizedPath,
|
|
177
|
+
digest: resource.descriptor.digest,
|
|
178
|
+
content: isTextMediaType(mediaType)
|
|
179
|
+
? read.buffer.toString('utf8')
|
|
180
|
+
: new Uint8Array(read.buffer).slice(),
|
|
181
|
+
...(mediaType ? { mediaType } : {}),
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
subscribe(invalidate, signal) {
|
|
185
|
+
if (signal.aborted)
|
|
186
|
+
return Object.freeze({ dispose: () => undefined });
|
|
187
|
+
this.listeners.add(invalidate);
|
|
188
|
+
const onAbort = () => {
|
|
189
|
+
void subscription.dispose();
|
|
190
|
+
};
|
|
191
|
+
const subscription = {
|
|
192
|
+
dispose: () => {
|
|
193
|
+
signal.removeEventListener('abort', onAbort);
|
|
194
|
+
this.listeners.delete(invalidate);
|
|
195
|
+
if (this.listeners.size === 0)
|
|
196
|
+
this.closeWatchers();
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
200
|
+
this.reconcileWatchers(this.roots.map(root => root.path));
|
|
201
|
+
return subscription;
|
|
202
|
+
}
|
|
203
|
+
stats() {
|
|
204
|
+
return Object.freeze({
|
|
205
|
+
version: exports.FILESYSTEM_SKILL_PROVIDER_VERSION,
|
|
206
|
+
...this.mutableStats,
|
|
207
|
+
activeWatchers: this.watchers.size,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
async scanRoot(root, remaining, signal) {
|
|
211
|
+
this.mutableStats.rootsObserved++;
|
|
212
|
+
try {
|
|
213
|
+
const rootRealPath = await (0, promises_1.realpath)(root.path);
|
|
214
|
+
const rootStats = await (0, promises_1.stat)(rootRealPath);
|
|
215
|
+
if (!rootStats.isDirectory() && !rootStats.isFile()) {
|
|
216
|
+
return emptyScan(root, 'incomplete', false);
|
|
217
|
+
}
|
|
218
|
+
const trustedRoot = rootStats.isFile() ? (0, path_1.dirname)(rootRealPath) : rootRealPath;
|
|
219
|
+
const candidates = await skillCandidates(rootRealPath, rootStats.isFile(), remaining + 1, signal);
|
|
220
|
+
const records = [];
|
|
221
|
+
const watchPaths = new Set([rootStats.isFile() ? (0, path_1.dirname)(root.path) : root.path]);
|
|
222
|
+
let complete = true;
|
|
223
|
+
for (const candidate of candidates) {
|
|
224
|
+
throwIfAborted(signal);
|
|
225
|
+
if (records.length >= remaining) {
|
|
226
|
+
complete = false;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
const record = await this.observeSkill(root, trustedRoot, candidate, signal);
|
|
230
|
+
if (!record) {
|
|
231
|
+
complete = false;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (!record.descriptorComplete)
|
|
235
|
+
complete = false;
|
|
236
|
+
records.push(record);
|
|
237
|
+
watchPaths.add(record.skillDirectoryRealPath);
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
records,
|
|
241
|
+
receipt: {
|
|
242
|
+
pathDigest: root.pathDigest,
|
|
243
|
+
sourceScope: root.sourceScope,
|
|
244
|
+
state: complete ? 'observed' : 'incomplete',
|
|
245
|
+
skillCount: records.length,
|
|
246
|
+
},
|
|
247
|
+
watchPaths: [...watchPaths],
|
|
248
|
+
complete,
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
catch (error) {
|
|
252
|
+
return isMissing(error)
|
|
253
|
+
? emptyScan(root, 'missing', true)
|
|
254
|
+
: emptyScan(root, 'incomplete', false);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async observeSkill(root, rootRealPath, candidate, signal) {
|
|
258
|
+
try {
|
|
259
|
+
const skillFileRealPath = await (0, promises_1.realpath)(candidate);
|
|
260
|
+
const skillDirectoryRealPath = (0, path_1.dirname)(skillFileRealPath);
|
|
261
|
+
if (!containsPath(rootRealPath, skillDirectoryRealPath) ||
|
|
262
|
+
!containsPath(skillDirectoryRealPath, skillFileRealPath)) {
|
|
263
|
+
this.mutableStats.unsafeEntriesRejected++;
|
|
264
|
+
return undefined;
|
|
265
|
+
}
|
|
266
|
+
const frontmatter = await readFrontmatterPrefix(skillFileRealPath, this.maxFrontmatterBytes, this.maxDefinitionBytes, signal, this.mutableStats);
|
|
267
|
+
const revision = frontmatter.revision;
|
|
268
|
+
const fallbackName = normalizeSkillName((0, path_1.basename)(skillDirectoryRealPath));
|
|
269
|
+
const name = stringValue(frontmatter.metadata.name) || fallbackName;
|
|
270
|
+
const requestedCapabilities = normalizeStringList(frontmatter.metadata.requestedCapabilities ??
|
|
271
|
+
frontmatter.metadata.capabilities ??
|
|
272
|
+
frontmatter.metadata.tools);
|
|
273
|
+
const pathIdentity = (0, canonical_1.digestRuntimeValue)({
|
|
274
|
+
root: root.pathDigest,
|
|
275
|
+
relativePath: toPortablePath((0, path_1.relative)(rootRealPath, skillDirectoryRealPath)),
|
|
276
|
+
});
|
|
277
|
+
const descriptorBase = {
|
|
278
|
+
id: `filesystem:${root.sourceScope}:${pathIdentity.slice(0, 24)}`,
|
|
279
|
+
name: normalizeIdentifier(name, `Skill name in ${SKILL_FILE_NAME}`),
|
|
280
|
+
description: stringValue(frontmatter.metadata.description).slice(0, 240),
|
|
281
|
+
providerId: this.id,
|
|
282
|
+
sourceScope: root.sourceScope,
|
|
283
|
+
modelInvocable: booleanValue(frontmatter.metadata.modelInvocable ?? frontmatter.metadata['model-invocable'], !booleanValue(frontmatter.metadata['disable-model-invocation'], false)),
|
|
284
|
+
userInvocable: booleanValue(frontmatter.metadata.userInvocable ?? frontmatter.metadata['user-invocable'], true),
|
|
285
|
+
requestedCapabilities,
|
|
286
|
+
};
|
|
287
|
+
const digest = (0, canonical_1.digestRuntimeValue)({
|
|
288
|
+
version: exports.FILESYSTEM_SKILL_PROVIDER_VERSION,
|
|
289
|
+
descriptor: descriptorBase,
|
|
290
|
+
skillFileRevision: revision.digest,
|
|
291
|
+
frontmatterDigest: frontmatter.digest,
|
|
292
|
+
});
|
|
293
|
+
this.mutableStats.skillFilesObserved++;
|
|
294
|
+
return {
|
|
295
|
+
descriptor: deepFreeze({ ...descriptorBase, digest }),
|
|
296
|
+
descriptorComplete: frontmatter.complete,
|
|
297
|
+
rootRealPath,
|
|
298
|
+
skillDirectoryRealPath,
|
|
299
|
+
skillFileRealPath,
|
|
300
|
+
skillFileRevision: revision,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
catch (error) {
|
|
304
|
+
if (!isMissing(error))
|
|
305
|
+
this.mutableStats.unsafeEntriesRejected++;
|
|
306
|
+
return undefined;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
async buildResourceManifest(record, signal) {
|
|
310
|
+
const resources = [];
|
|
311
|
+
const pending = [record.skillDirectoryRealPath];
|
|
312
|
+
let directoriesObserved = 0;
|
|
313
|
+
while (pending.length > 0) {
|
|
314
|
+
throwIfAborted(signal);
|
|
315
|
+
directoriesObserved++;
|
|
316
|
+
if (directoriesObserved > this.maxResourceFiles) {
|
|
317
|
+
throw new FilesystemSkillProviderError(`Skill ${record.descriptor.id} exceeds the resource directory limit.`);
|
|
318
|
+
}
|
|
319
|
+
const directory = pending.pop();
|
|
320
|
+
const entries = await (0, promises_1.readdir)(directory, { withFileTypes: true });
|
|
321
|
+
entries.sort((left, right) => left.name.localeCompare(right.name));
|
|
322
|
+
for (const entry of entries) {
|
|
323
|
+
throwIfAborted(signal);
|
|
324
|
+
if (entry.name === SKILL_FILE_NAME || OMITTED_RESOURCE_NAMES.has(entry.name))
|
|
325
|
+
continue;
|
|
326
|
+
if (entry.isDirectory()) {
|
|
327
|
+
if (!OMITTED_RESOURCE_DIRECTORIES.has(entry.name))
|
|
328
|
+
pending.push((0, path_1.join)(directory, entry.name));
|
|
329
|
+
continue;
|
|
330
|
+
}
|
|
331
|
+
if (!entry.isFile()) {
|
|
332
|
+
this.mutableStats.unsafeEntriesRejected++;
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
if (resources.length >= this.maxResourceFiles) {
|
|
336
|
+
throw new FilesystemSkillProviderError(`Skill ${record.descriptor.id} exceeds the resource manifest limit.`);
|
|
337
|
+
}
|
|
338
|
+
const resourceRealPath = await containedRealPath((0, path_1.join)(directory, entry.name), record.skillDirectoryRealPath, record.rootRealPath);
|
|
339
|
+
const resourceStats = await (0, promises_1.stat)(resourceRealPath, { bigint: true });
|
|
340
|
+
if (!resourceStats.isFile())
|
|
341
|
+
continue;
|
|
342
|
+
const revision = revisionFromStats(resourceStats);
|
|
343
|
+
const path = normalizeResourcePath(toPortablePath((0, path_1.relative)(record.skillDirectoryRealPath, resourceRealPath)));
|
|
344
|
+
const mediaType = mediaTypeFor(path);
|
|
345
|
+
resources.push({
|
|
346
|
+
realPath: resourceRealPath,
|
|
347
|
+
revision,
|
|
348
|
+
descriptor: deepFreeze({
|
|
349
|
+
path,
|
|
350
|
+
digest: (0, canonical_1.digestRuntimeValue)({
|
|
351
|
+
version: exports.FILESYSTEM_SKILL_PROVIDER_VERSION,
|
|
352
|
+
path,
|
|
353
|
+
revision: revision.digest,
|
|
354
|
+
}),
|
|
355
|
+
bytes: revision.bytes,
|
|
356
|
+
...(mediaType ? { mediaType } : {}),
|
|
357
|
+
}),
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return Object.freeze(resources.sort((left, right) => left.descriptor.path.localeCompare(right.descriptor.path)));
|
|
362
|
+
}
|
|
363
|
+
reconcileWatchers(paths) {
|
|
364
|
+
if (!this.watchEnabled || this.listeners.size === 0)
|
|
365
|
+
return;
|
|
366
|
+
const desired = [
|
|
367
|
+
...new Set(paths
|
|
368
|
+
.map(path => nearestWatchablePath(path))
|
|
369
|
+
.filter((path) => Boolean(path))),
|
|
370
|
+
]
|
|
371
|
+
.sort()
|
|
372
|
+
.slice(0, this.maxWatchPaths);
|
|
373
|
+
for (const [path, watcher] of this.watchers) {
|
|
374
|
+
if (desired.includes(path))
|
|
375
|
+
continue;
|
|
376
|
+
watcher.close();
|
|
377
|
+
this.watchers.delete(path);
|
|
378
|
+
}
|
|
379
|
+
for (const path of desired) {
|
|
380
|
+
if (this.watchers.has(path))
|
|
381
|
+
continue;
|
|
382
|
+
try {
|
|
383
|
+
this.watchers.set(path, this.watchFactory(path, event => this.scheduleInvalidation(event)));
|
|
384
|
+
}
|
|
385
|
+
catch {
|
|
386
|
+
this.mutableStats.watchErrors++;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
scheduleInvalidation(event) {
|
|
391
|
+
if (this.watchDebounceMs === 0)
|
|
392
|
+
return this.emitInvalidation(event);
|
|
393
|
+
if (this.watchTimer)
|
|
394
|
+
clearTimeout(this.watchTimer);
|
|
395
|
+
this.watchTimer = setTimeout(() => this.emitInvalidation(event), this.watchDebounceMs);
|
|
396
|
+
this.watchTimer.unref?.();
|
|
397
|
+
}
|
|
398
|
+
emitInvalidation(event) {
|
|
399
|
+
if (this.watchTimer)
|
|
400
|
+
clearTimeout(this.watchTimer);
|
|
401
|
+
this.watchTimer = undefined;
|
|
402
|
+
this.mutableStats.watchInvalidations++;
|
|
403
|
+
this.records.clear();
|
|
404
|
+
this.resourceManifests.clear();
|
|
405
|
+
const value = Object.freeze({
|
|
406
|
+
providerId: this.id,
|
|
407
|
+
reason: `filesystem_change:${event || 'unknown'}`,
|
|
408
|
+
});
|
|
409
|
+
for (const listener of this.listeners)
|
|
410
|
+
listener(value);
|
|
411
|
+
}
|
|
412
|
+
closeWatchers() {
|
|
413
|
+
if (this.watchTimer)
|
|
414
|
+
clearTimeout(this.watchTimer);
|
|
415
|
+
this.watchTimer = undefined;
|
|
416
|
+
for (const watcher of this.watchers.values())
|
|
417
|
+
watcher.close();
|
|
418
|
+
this.watchers.clear();
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
exports.FilesystemSkillProviderV1 = FilesystemSkillProviderV1;
|
|
422
|
+
function createFilesystemSkillRootsV1(options) {
|
|
423
|
+
const cwd = resolveExpandedPath(options.cwd, process.cwd());
|
|
424
|
+
const configHome = resolveExpandedPath(options.configHome ?? (0, paths_1.getConfigHome)(), cwd);
|
|
425
|
+
const builtinRoot = resolveExpandedPath(options.builtinRoot ?? defaultBuiltinRoot(), cwd);
|
|
426
|
+
return Object.freeze([
|
|
427
|
+
{ path: builtinRoot, sourceScope: 'builtin' },
|
|
428
|
+
{ path: (0, path_1.join)(configHome, 'skills'), sourceScope: 'user' },
|
|
429
|
+
...(options.configuredPaths ?? []).map(path => ({
|
|
430
|
+
path: resolveExpandedPath(path, cwd),
|
|
431
|
+
sourceScope: 'configured',
|
|
432
|
+
})),
|
|
433
|
+
{ path: (0, path_1.join)(cwd, '.orion-code', 'skills'), sourceScope: 'project' },
|
|
434
|
+
]);
|
|
435
|
+
}
|
|
436
|
+
function createFilesystemSkillProviderV1(options) {
|
|
437
|
+
return new FilesystemSkillProviderV1(options);
|
|
438
|
+
}
|
|
439
|
+
function createProductionFilesystemSkillProviderV1(options) {
|
|
440
|
+
const { cwd, configuredPaths, configHome, builtinRoot, ...providerOptions } = options;
|
|
441
|
+
return new FilesystemSkillProviderV1({
|
|
442
|
+
...providerOptions,
|
|
443
|
+
roots: createFilesystemSkillRootsV1({
|
|
444
|
+
cwd,
|
|
445
|
+
...(configuredPaths ? { configuredPaths } : {}),
|
|
446
|
+
...(configHome ? { configHome } : {}),
|
|
447
|
+
...(builtinRoot ? { builtinRoot } : {}),
|
|
448
|
+
}),
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
function normalizeRoots(roots) {
|
|
452
|
+
const output = [];
|
|
453
|
+
const seen = new Set();
|
|
454
|
+
for (const root of roots) {
|
|
455
|
+
if (!['builtin', 'user', 'configured', 'project'].includes(root.sourceScope)) {
|
|
456
|
+
throw new FilesystemSkillProviderError(`Unsupported filesystem Skill scope: ${root.sourceScope}`);
|
|
457
|
+
}
|
|
458
|
+
const path = resolveExpandedPath(root.path, process.cwd());
|
|
459
|
+
const key = `${root.sourceScope}\u0000${path}`;
|
|
460
|
+
if (seen.has(key))
|
|
461
|
+
continue;
|
|
462
|
+
seen.add(key);
|
|
463
|
+
output.push(Object.freeze({
|
|
464
|
+
path,
|
|
465
|
+
sourceScope: root.sourceScope,
|
|
466
|
+
pathDigest: (0, canonical_1.digestRuntimeValue)({ path, sourceScope: root.sourceScope }),
|
|
467
|
+
}));
|
|
468
|
+
}
|
|
469
|
+
return Object.freeze(output.sort((left, right) => left.sourceScope.localeCompare(right.sourceScope) || left.path.localeCompare(right.path)));
|
|
470
|
+
}
|
|
471
|
+
async function skillCandidates(rootRealPath, rootIsFile, limit, signal) {
|
|
472
|
+
if (rootIsFile) {
|
|
473
|
+
return (0, path_1.basename)(rootRealPath).toLowerCase() === SKILL_FILE_NAME.toLowerCase()
|
|
474
|
+
? [rootRealPath]
|
|
475
|
+
: [];
|
|
476
|
+
}
|
|
477
|
+
const direct = (0, path_1.join)(rootRealPath, SKILL_FILE_NAME);
|
|
478
|
+
try {
|
|
479
|
+
if ((await (0, promises_1.stat)(direct)).isFile())
|
|
480
|
+
return [direct];
|
|
481
|
+
}
|
|
482
|
+
catch (error) {
|
|
483
|
+
if (!isMissing(error))
|
|
484
|
+
throw error;
|
|
485
|
+
}
|
|
486
|
+
const entries = await (0, promises_1.readdir)(rootRealPath, { withFileTypes: true });
|
|
487
|
+
entries.sort((left, right) => left.name.localeCompare(right.name));
|
|
488
|
+
const candidates = [];
|
|
489
|
+
for (const entry of entries) {
|
|
490
|
+
throwIfAborted(signal);
|
|
491
|
+
const directory = (0, path_1.join)(rootRealPath, entry.name);
|
|
492
|
+
try {
|
|
493
|
+
if (!(await (0, promises_1.stat)(directory)).isDirectory())
|
|
494
|
+
continue;
|
|
495
|
+
const file = (0, path_1.join)(directory, SKILL_FILE_NAME);
|
|
496
|
+
if ((await (0, promises_1.stat)(file)).isFile())
|
|
497
|
+
candidates.push(file);
|
|
498
|
+
if (candidates.length >= limit)
|
|
499
|
+
break;
|
|
500
|
+
}
|
|
501
|
+
catch (error) {
|
|
502
|
+
if (!isMissing(error))
|
|
503
|
+
throw error;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return candidates;
|
|
507
|
+
}
|
|
508
|
+
async function readFrontmatterPrefix(path, maxBytes, maxDefinitionBytes, signal, stats) {
|
|
509
|
+
const handle = await openNoFollow(path);
|
|
510
|
+
stats.frontmatterPrefixReads++;
|
|
511
|
+
try {
|
|
512
|
+
const beforeStats = await handle.stat({ bigint: true });
|
|
513
|
+
if (!beforeStats.isFile()) {
|
|
514
|
+
throw new FilesystemSkillProviderError('Skill definition is not a regular file.');
|
|
515
|
+
}
|
|
516
|
+
const revision = revisionFromStats(beforeStats);
|
|
517
|
+
if (revision.bytes > maxDefinitionBytes) {
|
|
518
|
+
throw new FilesystemSkillProviderError(`Skill definition exceeds the ${maxDefinitionBytes} byte limit.`);
|
|
519
|
+
}
|
|
520
|
+
const chunks = [];
|
|
521
|
+
let bytesRead = 0;
|
|
522
|
+
let parsedResult;
|
|
523
|
+
while (bytesRead < maxBytes) {
|
|
524
|
+
throwIfAborted(signal);
|
|
525
|
+
const size = Math.min(bytesRead === 0 ? 8 : FRONTMATTER_CHUNK_BYTES, maxBytes - bytesRead);
|
|
526
|
+
const buffer = buffer_1.Buffer.allocUnsafe(size);
|
|
527
|
+
const result = await handle.read(buffer, 0, size, bytesRead);
|
|
528
|
+
if (result.bytesRead === 0)
|
|
529
|
+
break;
|
|
530
|
+
chunks.push(buffer.subarray(0, result.bytesRead));
|
|
531
|
+
bytesRead += result.bytesRead;
|
|
532
|
+
stats.frontmatterPrefixBytes += result.bytesRead;
|
|
533
|
+
const text = buffer_1.Buffer.concat(chunks)
|
|
534
|
+
.toString('utf8')
|
|
535
|
+
.replace(/^\uFEFF/, '');
|
|
536
|
+
if (!text.startsWith('---\n') && !text.startsWith('---\r\n')) {
|
|
537
|
+
parsedResult = {
|
|
538
|
+
metadata: {},
|
|
539
|
+
digest: (0, canonical_1.digestRuntimeValue)({ kind: 'legacy', prefix: text }),
|
|
540
|
+
complete: true,
|
|
541
|
+
};
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
const match = text.match(/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/);
|
|
545
|
+
if (!match)
|
|
546
|
+
continue;
|
|
547
|
+
try {
|
|
548
|
+
const parsed = (0, js_yaml_1.load)(match[1]);
|
|
549
|
+
const metadata = isRecord(parsed) ? parsed : {};
|
|
550
|
+
parsedResult = {
|
|
551
|
+
metadata,
|
|
552
|
+
digest: (0, canonical_1.digestRuntimeValue)({ kind: 'frontmatter', raw: match[1] }),
|
|
553
|
+
complete: isRecord(parsed),
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
catch {
|
|
557
|
+
parsedResult = {
|
|
558
|
+
metadata: {},
|
|
559
|
+
digest: (0, canonical_1.digestRuntimeValue)({ kind: 'invalid-frontmatter', value: match[1] }),
|
|
560
|
+
complete: false,
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
if (!parsedResult) {
|
|
566
|
+
const text = buffer_1.Buffer.concat(chunks)
|
|
567
|
+
.toString('utf8')
|
|
568
|
+
.replace(/^\uFEFF/, '');
|
|
569
|
+
const frontmatterStarted = text.startsWith('---\n') || text.startsWith('---\r\n');
|
|
570
|
+
parsedResult = frontmatterStarted
|
|
571
|
+
? {
|
|
572
|
+
metadata: {},
|
|
573
|
+
digest: (0, canonical_1.digestRuntimeValue)({ kind: 'truncated-frontmatter', maxBytes }),
|
|
574
|
+
complete: false,
|
|
575
|
+
}
|
|
576
|
+
: {
|
|
577
|
+
metadata: {},
|
|
578
|
+
digest: (0, canonical_1.digestRuntimeValue)({ kind: 'legacy', prefix: text }),
|
|
579
|
+
complete: true,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
const after = revisionFromStats(await handle.stat({ bigint: true }));
|
|
583
|
+
if (after.digest !== revision.digest) {
|
|
584
|
+
throw new FilesystemSkillProviderError('Skill definition changed during catalog scan.');
|
|
585
|
+
}
|
|
586
|
+
return { ...parsedResult, revision };
|
|
587
|
+
}
|
|
588
|
+
finally {
|
|
589
|
+
await handle.close();
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
async function readBoundedFile(path, maxBytes, signal, label) {
|
|
593
|
+
const handle = await openNoFollow(path);
|
|
594
|
+
try {
|
|
595
|
+
const before = await handle.stat({ bigint: true });
|
|
596
|
+
if (!before.isFile())
|
|
597
|
+
throw new FilesystemSkillProviderError(`${label} is not a file.`);
|
|
598
|
+
const revision = revisionFromStats(before);
|
|
599
|
+
if (revision.bytes > maxBytes) {
|
|
600
|
+
throw new FilesystemSkillProviderError(`${label} exceeds the ${maxBytes} byte limit.`);
|
|
601
|
+
}
|
|
602
|
+
const buffer = buffer_1.Buffer.alloc(revision.bytes);
|
|
603
|
+
let offset = 0;
|
|
604
|
+
while (offset < buffer.byteLength) {
|
|
605
|
+
throwIfAborted(signal);
|
|
606
|
+
const result = await handle.read(buffer, offset, buffer.byteLength - offset, offset);
|
|
607
|
+
if (result.bytesRead === 0)
|
|
608
|
+
break;
|
|
609
|
+
offset += result.bytesRead;
|
|
610
|
+
}
|
|
611
|
+
if (offset !== buffer.byteLength) {
|
|
612
|
+
throw new FilesystemSkillProviderError(`${label} changed while it was being read.`);
|
|
613
|
+
}
|
|
614
|
+
if (revisionFromStats(await handle.stat({ bigint: true })).digest !== revision.digest) {
|
|
615
|
+
throw new FilesystemSkillProviderError(`${label} changed while it was being read.`);
|
|
616
|
+
}
|
|
617
|
+
return { buffer, revision };
|
|
618
|
+
}
|
|
619
|
+
finally {
|
|
620
|
+
await handle.close();
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
async function openNoFollow(path) {
|
|
624
|
+
const noFollow = typeof fs_1.constants.O_NOFOLLOW === 'number' ? fs_1.constants.O_NOFOLLOW : 0;
|
|
625
|
+
return (0, promises_1.open)(path, fs_1.constants.O_RDONLY | noFollow);
|
|
626
|
+
}
|
|
627
|
+
async function containedRealPath(path, skillRoot, providerRoot) {
|
|
628
|
+
const output = await (0, promises_1.realpath)(path);
|
|
629
|
+
if (!containsPath(skillRoot, output) || !containsPath(providerRoot, output)) {
|
|
630
|
+
throw new FilesystemSkillProviderError('Skill path escapes its trusted realpath roots.');
|
|
631
|
+
}
|
|
632
|
+
return output;
|
|
633
|
+
}
|
|
634
|
+
function revisionFromStats(stats) {
|
|
635
|
+
if (stats.size > BigInt(Number.MAX_SAFE_INTEGER)) {
|
|
636
|
+
throw new FilesystemSkillProviderError('Skill file size exceeds the safe integer range.');
|
|
637
|
+
}
|
|
638
|
+
return Object.freeze({
|
|
639
|
+
bytes: Number(stats.size),
|
|
640
|
+
digest: (0, canonical_1.digestRuntimeValue)({
|
|
641
|
+
dev: stats.dev.toString(),
|
|
642
|
+
ino: stats.ino.toString(),
|
|
643
|
+
size: stats.size.toString(),
|
|
644
|
+
mtimeNs: stats.mtimeNs.toString(),
|
|
645
|
+
ctimeNs: stats.ctimeNs.toString(),
|
|
646
|
+
}),
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
function definitionBody(content) {
|
|
650
|
+
const normalized = content.replace(/^\uFEFF/, '');
|
|
651
|
+
const match = normalized.match(/^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/);
|
|
652
|
+
return match ? normalized.slice(match[0].length).trim() : normalized.trim();
|
|
653
|
+
}
|
|
654
|
+
function normalizeResourcePath(path) {
|
|
655
|
+
const normalized = path.trim().replace(/\\/g, '/').replace(/^\.\//, '');
|
|
656
|
+
if (!normalized ||
|
|
657
|
+
normalized.startsWith('/') ||
|
|
658
|
+
/^[a-z]:\//i.test(normalized) ||
|
|
659
|
+
normalized.split('/').some(segment => segment === '..' || segment === '' || segment === '.')) {
|
|
660
|
+
throw new FilesystemSkillProviderError(`Skill resource path must be a contained relative path: ${path}`);
|
|
661
|
+
}
|
|
662
|
+
return normalized;
|
|
663
|
+
}
|
|
664
|
+
function containsPath(root, target) {
|
|
665
|
+
const result = (0, path_1.relative)(root, target);
|
|
666
|
+
return (result === '' || (!result.startsWith(`..${path_1.sep}`) && result !== '..' && !(0, path_1.isAbsolute)(result)));
|
|
667
|
+
}
|
|
668
|
+
function normalizeIdentifier(value, label) {
|
|
669
|
+
const normalized = value.trim();
|
|
670
|
+
if (!normalized || /[\u0000-\u001f\u007f]/.test(normalized)) {
|
|
671
|
+
throw new FilesystemSkillProviderError(`${label} must be non-empty and contain no control characters.`);
|
|
672
|
+
}
|
|
673
|
+
return normalized;
|
|
674
|
+
}
|
|
675
|
+
function normalizeSkillName(value) {
|
|
676
|
+
return (value
|
|
677
|
+
.trim()
|
|
678
|
+
.replace(/\.md$/i, '')
|
|
679
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1-$2')
|
|
680
|
+
.replace(/[^\p{L}\p{N}]+/gu, '-')
|
|
681
|
+
.replace(/^-+|-+$/g, '')
|
|
682
|
+
.toLowerCase() || 'skill');
|
|
683
|
+
}
|
|
684
|
+
function normalizeStringList(value) {
|
|
685
|
+
const values = Array.isArray(value) ? value : typeof value === 'string' ? value.split(',') : [];
|
|
686
|
+
return Object.freeze([
|
|
687
|
+
...new Set(values
|
|
688
|
+
.filter(item => typeof item === 'string')
|
|
689
|
+
.map(item => item.trim())
|
|
690
|
+
.filter(Boolean)),
|
|
691
|
+
].sort());
|
|
692
|
+
}
|
|
693
|
+
function booleanValue(value, fallback) {
|
|
694
|
+
return typeof value === 'boolean' ? value : fallback;
|
|
695
|
+
}
|
|
696
|
+
function stringValue(value) {
|
|
697
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
698
|
+
}
|
|
699
|
+
function resolveExpandedPath(value, cwd) {
|
|
700
|
+
const trimmed = value.trim();
|
|
701
|
+
if (!trimmed || trimmed.includes('\u0000')) {
|
|
702
|
+
throw new FilesystemSkillProviderError('Filesystem Skill root must not be empty.');
|
|
703
|
+
}
|
|
704
|
+
const expanded = trimmed === '~'
|
|
705
|
+
? (0, os_1.homedir)()
|
|
706
|
+
: trimmed.startsWith('~/')
|
|
707
|
+
? (0, path_1.join)((0, os_1.homedir)(), trimmed.slice(2))
|
|
708
|
+
: trimmed;
|
|
709
|
+
return (0, path_1.resolve)(cwd, expanded);
|
|
710
|
+
}
|
|
711
|
+
function defaultBuiltinRoot() {
|
|
712
|
+
return (0, path_1.resolve)(__dirname, '../../skills/builtin');
|
|
713
|
+
}
|
|
714
|
+
function defaultWatchFactory(path, invalidate) {
|
|
715
|
+
let watcher;
|
|
716
|
+
try {
|
|
717
|
+
watcher = (0, fs_1.watch)(path, { recursive: true, persistent: false }, event => invalidate(event));
|
|
718
|
+
}
|
|
719
|
+
catch {
|
|
720
|
+
watcher = (0, fs_1.watch)(path, { persistent: false }, event => invalidate(event));
|
|
721
|
+
}
|
|
722
|
+
return { close: () => watcher.close() };
|
|
723
|
+
}
|
|
724
|
+
function nearestWatchablePath(path) {
|
|
725
|
+
let candidate = (0, path_1.resolve)(path);
|
|
726
|
+
// At most the direct parent: never turn a missing project Skill directory into
|
|
727
|
+
// a recursive watch of the whole workspace.
|
|
728
|
+
for (let depth = 0; depth <= 1; depth++) {
|
|
729
|
+
if ((0, fs_1.existsSync)(candidate)) {
|
|
730
|
+
try {
|
|
731
|
+
return (0, fs_1.statSync)(candidate).isDirectory() ? candidate : (0, path_1.dirname)(candidate);
|
|
732
|
+
}
|
|
733
|
+
catch {
|
|
734
|
+
return undefined;
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
const parent = (0, path_1.dirname)(candidate);
|
|
738
|
+
if (parent === candidate)
|
|
739
|
+
return undefined;
|
|
740
|
+
candidate = parent;
|
|
741
|
+
}
|
|
742
|
+
return undefined;
|
|
743
|
+
}
|
|
744
|
+
function emptyScan(root, state, complete) {
|
|
745
|
+
return {
|
|
746
|
+
records: [],
|
|
747
|
+
receipt: {
|
|
748
|
+
pathDigest: root.pathDigest,
|
|
749
|
+
sourceScope: root.sourceScope,
|
|
750
|
+
state,
|
|
751
|
+
skillCount: 0,
|
|
752
|
+
},
|
|
753
|
+
watchPaths: [],
|
|
754
|
+
complete,
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
function compareRootReceipts(left, right) {
|
|
758
|
+
return (left.sourceScope.localeCompare(right.sourceScope) ||
|
|
759
|
+
left.pathDigest.localeCompare(right.pathDigest));
|
|
760
|
+
}
|
|
761
|
+
function mediaTypeFor(path) {
|
|
762
|
+
switch ((0, path_1.extname)(path).toLowerCase()) {
|
|
763
|
+
case '.md':
|
|
764
|
+
return 'text/markdown';
|
|
765
|
+
case '.txt':
|
|
766
|
+
return 'text/plain';
|
|
767
|
+
case '.json':
|
|
768
|
+
return 'application/json';
|
|
769
|
+
case '.yaml':
|
|
770
|
+
case '.yml':
|
|
771
|
+
return 'application/yaml';
|
|
772
|
+
case '.js':
|
|
773
|
+
case '.mjs':
|
|
774
|
+
case '.cjs':
|
|
775
|
+
return 'text/javascript';
|
|
776
|
+
case '.ts':
|
|
777
|
+
case '.tsx':
|
|
778
|
+
return 'text/typescript';
|
|
779
|
+
case '.sh':
|
|
780
|
+
return 'text/x-shellscript';
|
|
781
|
+
case '.png':
|
|
782
|
+
return 'image/png';
|
|
783
|
+
case '.jpg':
|
|
784
|
+
case '.jpeg':
|
|
785
|
+
return 'image/jpeg';
|
|
786
|
+
case '.svg':
|
|
787
|
+
return 'image/svg+xml';
|
|
788
|
+
default:
|
|
789
|
+
return undefined;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
function isTextMediaType(mediaType) {
|
|
793
|
+
return Boolean(mediaType?.startsWith('text/') ||
|
|
794
|
+
mediaType === 'application/json' ||
|
|
795
|
+
mediaType === 'application/yaml' ||
|
|
796
|
+
mediaType === 'image/svg+xml');
|
|
797
|
+
}
|
|
798
|
+
function integerOption(value, label, allowZero = false) {
|
|
799
|
+
if (!Number.isSafeInteger(value) || value < (allowZero ? 0 : 1)) {
|
|
800
|
+
throw new FilesystemSkillProviderError(`${label} must be a ${allowZero ? 'non-negative' : 'positive'} safe integer.`);
|
|
801
|
+
}
|
|
802
|
+
return value;
|
|
803
|
+
}
|
|
804
|
+
function toPortablePath(path) {
|
|
805
|
+
return path.split(path_1.sep).join('/');
|
|
806
|
+
}
|
|
807
|
+
function isRecord(value) {
|
|
808
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
809
|
+
}
|
|
810
|
+
function isMissing(error) {
|
|
811
|
+
return isRecord(error) && (error.code === 'ENOENT' || error.code === 'ENOTDIR');
|
|
812
|
+
}
|
|
813
|
+
function throwIfAborted(signal) {
|
|
814
|
+
if (!signal.aborted)
|
|
815
|
+
return;
|
|
816
|
+
throw signal.reason instanceof Error
|
|
817
|
+
? signal.reason
|
|
818
|
+
: new Error(String(signal.reason || 'Filesystem Skill operation aborted.'));
|
|
819
|
+
}
|
|
820
|
+
function deepFreeze(value) {
|
|
821
|
+
if (value === null || typeof value !== 'object' || Object.isFrozen(value))
|
|
822
|
+
return value;
|
|
823
|
+
if (ArrayBuffer.isView(value))
|
|
824
|
+
return value;
|
|
825
|
+
for (const nested of Object.values(value))
|
|
826
|
+
deepFreeze(nested);
|
|
827
|
+
return Object.freeze(value);
|
|
828
|
+
}
|
|
829
|
+
//# sourceMappingURL=filesystem-skill-provider.js.map
|