open-multi-agent-kit 0.80.5 → 0.80.7
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 +31 -0
- package/README.md +22 -14
- package/dist/cli/config-selector.d.ts +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/config.d.ts +5 -9
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +55 -23
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +45 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +197 -13
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +4 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +5 -5
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/command-safety.d.ts +11 -0
- package/dist/core/command-safety.d.ts.map +1 -0
- package/dist/core/command-safety.js +528 -0
- package/dist/core/command-safety.js.map +1 -0
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +20 -5
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +99 -1
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +655 -21
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/pruner-policy.d.ts +84 -0
- package/dist/core/compaction/pruner-policy.d.ts.map +1 -0
- package/dist/core/compaction/pruner-policy.js +273 -0
- package/dist/core/compaction/pruner-policy.js.map +1 -0
- package/dist/core/context-graph-identity-resolution.d.ts +114 -0
- package/dist/core/context-graph-identity-resolution.d.ts.map +1 -0
- package/dist/core/context-graph-identity-resolution.js +127 -0
- package/dist/core/context-graph-identity-resolution.js.map +1 -0
- package/dist/core/context-graph-memory-store.d.ts +153 -0
- package/dist/core/context-graph-memory-store.d.ts.map +1 -0
- package/dist/core/context-graph-memory-store.js +377 -0
- package/dist/core/context-graph-memory-store.js.map +1 -0
- package/dist/core/context-graph-ontology-generation.d.ts +104 -0
- package/dist/core/context-graph-ontology-generation.d.ts.map +1 -0
- package/dist/core/context-graph-ontology-generation.js +135 -0
- package/dist/core/context-graph-ontology-generation.js.map +1 -0
- package/dist/core/context-graph-ontology-registry.d.ts +766 -0
- package/dist/core/context-graph-ontology-registry.d.ts.map +1 -0
- package/dist/core/context-graph-ontology-registry.js +1133 -0
- package/dist/core/context-graph-ontology-registry.js.map +1 -0
- package/dist/core/context-graph-policy.d.ts +68 -0
- package/dist/core/context-graph-policy.d.ts.map +1 -0
- package/dist/core/context-graph-policy.js +221 -0
- package/dist/core/context-graph-policy.js.map +1 -0
- package/dist/core/context-graph-reasoning.d.ts +130 -0
- package/dist/core/context-graph-reasoning.d.ts.map +1 -0
- package/dist/core/context-graph-reasoning.js +442 -0
- package/dist/core/context-graph-reasoning.js.map +1 -0
- package/dist/core/context-graph-retrieval.d.ts +120 -0
- package/dist/core/context-graph-retrieval.d.ts.map +1 -0
- package/dist/core/context-graph-retrieval.js +288 -0
- package/dist/core/context-graph-retrieval.js.map +1 -0
- package/dist/core/contract-verification.d.ts +78 -0
- package/dist/core/contract-verification.d.ts.map +1 -0
- package/dist/core/contract-verification.js +110 -0
- package/dist/core/contract-verification.js.map +1 -0
- package/dist/core/exact-cache-policy.d.ts +100 -0
- package/dist/core/exact-cache-policy.d.ts.map +1 -0
- package/dist/core/exact-cache-policy.js +175 -0
- package/dist/core/exact-cache-policy.js.map +1 -0
- package/dist/core/exec.d.ts +2 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +1 -0
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/template.js +2 -2
- package/dist/core/extensions/builtin/command-safety-gate.d.ts +77 -0
- package/dist/core/extensions/builtin/command-safety-gate.d.ts.map +1 -0
- package/dist/core/extensions/builtin/command-safety-gate.js +147 -0
- package/dist/core/extensions/builtin/command-safety-gate.js.map +1 -0
- package/dist/core/extensions/loader.d.ts +4 -4
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +94 -56
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +1 -1
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +38 -10
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/freedom/banner.d.ts +14 -0
- package/dist/core/freedom/banner.d.ts.map +1 -0
- package/dist/core/freedom/banner.js +22 -0
- package/dist/core/freedom/banner.js.map +1 -0
- package/dist/core/freedom/config.d.ts +27 -0
- package/dist/core/freedom/config.d.ts.map +1 -0
- package/dist/core/freedom/config.js +216 -0
- package/dist/core/freedom/config.js.map +1 -0
- package/dist/core/freedom/index.d.ts +23 -0
- package/dist/core/freedom/index.d.ts.map +1 -0
- package/dist/core/freedom/index.js +19 -0
- package/dist/core/freedom/index.js.map +1 -0
- package/dist/core/freedom/policy.d.ts +42 -0
- package/dist/core/freedom/policy.d.ts.map +1 -0
- package/dist/core/freedom/policy.js +47 -0
- package/dist/core/freedom/policy.js.map +1 -0
- package/dist/core/freedom/safety-floor.d.ts +73 -0
- package/dist/core/freedom/safety-floor.d.ts.map +1 -0
- package/dist/core/freedom/safety-floor.js +275 -0
- package/dist/core/freedom/safety-floor.js.map +1 -0
- package/dist/core/harness-control-events.d.ts +91 -0
- package/dist/core/harness-control-events.d.ts.map +1 -0
- package/dist/core/harness-control-events.js +514 -0
- package/dist/core/harness-control-events.js.map +1 -0
- package/dist/core/harness-control-replay.d.ts +31 -0
- package/dist/core/harness-control-replay.d.ts.map +1 -0
- package/dist/core/harness-control-replay.js +187 -0
- package/dist/core/harness-control-replay.js.map +1 -0
- package/dist/core/headroom-middleware.d.ts +35 -0
- package/dist/core/headroom-middleware.d.ts.map +1 -0
- package/dist/core/headroom-middleware.js +166 -0
- package/dist/core/headroom-middleware.js.map +1 -0
- package/dist/core/hook-inventory.d.ts +23 -0
- package/dist/core/hook-inventory.d.ts.map +1 -0
- package/dist/core/hook-inventory.js +50 -0
- package/dist/core/hook-inventory.js.map +1 -0
- package/dist/core/keybindings.d.ts +12 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +31 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/lean-context-middleware.d.ts +12 -0
- package/dist/core/lean-context-middleware.d.ts.map +1 -0
- package/dist/core/lean-context-middleware.js +87 -0
- package/dist/core/lean-context-middleware.js.map +1 -0
- package/dist/core/lean-context-policy.d.ts +45 -0
- package/dist/core/lean-context-policy.d.ts.map +1 -0
- package/dist/core/lean-context-policy.js +108 -0
- package/dist/core/lean-context-policy.js.map +1 -0
- package/dist/core/loadout-access-policy.d.ts +41 -0
- package/dist/core/loadout-access-policy.d.ts.map +1 -0
- package/dist/core/loadout-access-policy.js +182 -0
- package/dist/core/loadout-access-policy.js.map +1 -0
- package/dist/core/loadout-runtime.d.ts +84 -0
- package/dist/core/loadout-runtime.d.ts.map +1 -0
- package/dist/core/loadout-runtime.js +157 -0
- package/dist/core/loadout-runtime.js.map +1 -0
- package/dist/core/loadouts.d.ts +147 -0
- package/dist/core/loadouts.d.ts.map +1 -0
- package/dist/core/loadouts.js +442 -0
- package/dist/core/loadouts.js.map +1 -0
- package/dist/core/mcp-inventory.d.ts +74 -0
- package/dist/core/mcp-inventory.d.ts.map +1 -0
- package/dist/core/mcp-inventory.js +156 -0
- package/dist/core/mcp-inventory.js.map +1 -0
- package/dist/core/mcp-presets.d.ts +57 -0
- package/dist/core/mcp-presets.d.ts.map +1 -0
- package/dist/core/mcp-presets.js +81 -0
- package/dist/core/mcp-presets.js.map +1 -0
- package/dist/core/model-registry.d.ts +1 -0
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +40 -17
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -0
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/native-adoption-benchmark.d.ts +166 -0
- package/dist/core/native-adoption-benchmark.d.ts.map +1 -0
- package/dist/core/native-adoption-benchmark.js +624 -0
- package/dist/core/native-adoption-benchmark.js.map +1 -0
- package/dist/core/observability-trace.d.ts +80 -0
- package/dist/core/observability-trace.d.ts.map +1 -0
- package/dist/core/observability-trace.js +140 -0
- package/dist/core/observability-trace.js.map +1 -0
- package/dist/core/orchestration/checkpoint.d.ts +83 -0
- package/dist/core/orchestration/checkpoint.d.ts.map +1 -0
- package/dist/core/orchestration/checkpoint.js +152 -0
- package/dist/core/orchestration/checkpoint.js.map +1 -0
- package/dist/core/orchestration/errors.d.ts +74 -0
- package/dist/core/orchestration/errors.d.ts.map +1 -0
- package/dist/core/orchestration/errors.js +52 -0
- package/dist/core/orchestration/errors.js.map +1 -0
- package/dist/core/orchestration/merge-queue.d.ts +121 -0
- package/dist/core/orchestration/merge-queue.d.ts.map +1 -0
- package/dist/core/orchestration/merge-queue.js +149 -0
- package/dist/core/orchestration/merge-queue.js.map +1 -0
- package/dist/core/orchestration/recovery.d.ts +106 -0
- package/dist/core/orchestration/recovery.d.ts.map +1 -0
- package/dist/core/orchestration/recovery.js +110 -0
- package/dist/core/orchestration/recovery.js.map +1 -0
- package/dist/core/orchestration/replay-ledger.d.ts +76 -0
- package/dist/core/orchestration/replay-ledger.d.ts.map +1 -0
- package/dist/core/orchestration/replay-ledger.js +395 -0
- package/dist/core/orchestration/replay-ledger.js.map +1 -0
- package/dist/core/orchestration/scheduler-state.d.ts +78 -0
- package/dist/core/orchestration/scheduler-state.d.ts.map +1 -0
- package/dist/core/orchestration/scheduler-state.js +185 -0
- package/dist/core/orchestration/scheduler-state.js.map +1 -0
- package/dist/core/orchestration/scheduler-store.d.ts +309 -0
- package/dist/core/orchestration/scheduler-store.d.ts.map +1 -0
- package/dist/core/orchestration/scheduler-store.js +368 -0
- package/dist/core/orchestration/scheduler-store.js.map +1 -0
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts +57 -0
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts.map +1 -0
- package/dist/core/orchestration/sqlite-scheduler-store.js +528 -0
- package/dist/core/orchestration/sqlite-scheduler-store.js.map +1 -0
- package/dist/core/orchestration/transaction-coordinator.d.ts +217 -0
- package/dist/core/orchestration/transaction-coordinator.d.ts.map +1 -0
- package/dist/core/orchestration/transaction-coordinator.js +281 -0
- package/dist/core/orchestration/transaction-coordinator.js.map +1 -0
- package/dist/core/orchestration/verification-contract.d.ts +197 -0
- package/dist/core/orchestration/verification-contract.d.ts.map +1 -0
- package/dist/core/orchestration/verification-contract.js +145 -0
- package/dist/core/orchestration/verification-contract.js.map +1 -0
- package/dist/core/package-composition.d.ts +68 -0
- package/dist/core/package-composition.d.ts.map +1 -0
- package/dist/core/package-composition.js +304 -0
- package/dist/core/package-composition.js.map +1 -0
- package/dist/core/package-gallery.d.ts +124 -0
- package/dist/core/package-gallery.d.ts.map +1 -0
- package/dist/core/package-gallery.js +392 -0
- package/dist/core/package-gallery.js.map +1 -0
- package/dist/core/package-manager.d.ts +69 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +367 -69
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/package-procurement.d.ts +268 -0
- package/dist/core/package-procurement.d.ts.map +1 -0
- package/dist/core/package-procurement.js +697 -0
- package/dist/core/package-procurement.js.map +1 -0
- package/dist/core/package-trial-runtime.d.ts +75 -0
- package/dist/core/package-trial-runtime.d.ts.map +1 -0
- package/dist/core/package-trial-runtime.js +73 -0
- package/dist/core/package-trial-runtime.js.map +1 -0
- package/dist/core/package-trial-sandbox.d.ts +27 -0
- package/dist/core/package-trial-sandbox.d.ts.map +1 -0
- package/dist/core/package-trial-sandbox.js +102 -0
- package/dist/core/package-trial-sandbox.js.map +1 -0
- package/dist/core/policy-overlays-runtime.d.ts +141 -0
- package/dist/core/policy-overlays-runtime.d.ts.map +1 -0
- package/dist/core/policy-overlays-runtime.js +720 -0
- package/dist/core/policy-overlays-runtime.js.map +1 -0
- package/dist/core/read-anchor-registry.d.ts +27 -0
- package/dist/core/read-anchor-registry.d.ts.map +1 -0
- package/dist/core/read-anchor-registry.js +103 -0
- package/dist/core/read-anchor-registry.js.map +1 -0
- package/dist/core/read-anchors.d.ts +110 -0
- package/dist/core/read-anchors.d.ts.map +1 -0
- package/dist/core/read-anchors.js +193 -0
- package/dist/core/read-anchors.js.map +1 -0
- package/dist/core/read-content-cache.d.ts +22 -0
- package/dist/core/read-content-cache.d.ts.map +1 -0
- package/dist/core/read-content-cache.js +79 -0
- package/dist/core/read-content-cache.js.map +1 -0
- package/dist/core/recovery-checkpoint.d.ts +196 -0
- package/dist/core/recovery-checkpoint.d.ts.map +1 -0
- package/dist/core/recovery-checkpoint.js +382 -0
- package/dist/core/recovery-checkpoint.js.map +1 -0
- package/dist/core/resolve-config-value.d.ts +1 -1
- package/dist/core/resolve-config-value.d.ts.map +1 -1
- package/dist/core/resolve-config-value.js +30 -2
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +23 -21
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +93 -15
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sandbox/backend.d.ts +25 -0
- package/dist/core/sandbox/backend.d.ts.map +1 -0
- package/dist/core/sandbox/backend.js +150 -0
- package/dist/core/sandbox/backend.js.map +1 -0
- package/dist/core/sandbox/env.d.ts +6 -0
- package/dist/core/sandbox/env.d.ts.map +1 -0
- package/dist/core/sandbox/env.js +46 -0
- package/dist/core/sandbox/env.js.map +1 -0
- package/dist/core/sandbox/path-resolver.d.ts +4 -0
- package/dist/core/sandbox/path-resolver.d.ts.map +1 -0
- package/dist/core/sandbox/path-resolver.js +44 -0
- package/dist/core/sandbox/path-resolver.js.map +1 -0
- package/dist/core/sandbox/policy.d.ts +87 -0
- package/dist/core/sandbox/policy.d.ts.map +1 -0
- package/dist/core/sandbox/policy.js +280 -0
- package/dist/core/sandbox/policy.js.map +1 -0
- package/dist/core/sandbox/spawn.d.ts +20 -0
- package/dist/core/sandbox/spawn.d.ts.map +1 -0
- package/dist/core/sandbox/spawn.js +80 -0
- package/dist/core/sandbox/spawn.js.map +1 -0
- package/dist/core/sdk.d.ts +83 -4
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +143 -55
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/semantic-cache-policy.d.ts +45 -0
- package/dist/core/semantic-cache-policy.d.ts.map +1 -0
- package/dist/core/semantic-cache-policy.js +220 -0
- package/dist/core/semantic-cache-policy.js.map +1 -0
- package/dist/core/session-digest.d.ts +57 -0
- package/dist/core/session-digest.d.ts.map +1 -0
- package/dist/core/session-digest.js +193 -0
- package/dist/core/session-digest.js.map +1 -0
- package/dist/core/session-manager.d.ts +2 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +5 -4
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +17 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +47 -2
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/spec-kit/compiler.d.ts +67 -0
- package/dist/core/spec-kit/compiler.d.ts.map +1 -0
- package/dist/core/spec-kit/compiler.js +268 -0
- package/dist/core/spec-kit/compiler.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +25 -7
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/telemetry.d.ts.map +1 -1
- package/dist/core/telemetry.js +1 -1
- package/dist/core/telemetry.js.map +1 -1
- package/dist/core/timings.d.ts +1 -1
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +2 -2
- package/dist/core/timings.js.map +1 -1
- package/dist/core/tools/bash.d.ts +28 -3
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +53 -10
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +12 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +24 -0
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +3 -0
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +3 -0
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +3 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +4 -1
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +1 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +3 -0
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +3 -0
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +1 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/read.d.ts +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +29 -2
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/write.d.ts +3 -0
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +3 -0
- package/dist/core/tools/write.js.map +1 -1
- package/dist/core/transaction-coordinator.d.ts +30 -0
- package/dist/core/transaction-coordinator.d.ts.map +1 -0
- package/dist/core/transaction-coordinator.js +173 -0
- package/dist/core/transaction-coordinator.js.map +1 -0
- package/dist/index.d.ts +19 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -6
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +35 -0
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +410 -4
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient-motion.d.ts +28 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.js +146 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.js.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient.d.ts +27 -0
- package/dist/modes/interactive/components/control-panel-gradient.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient.js +127 -0
- package/dist/modes/interactive/components/control-panel-gradient.js.map +1 -0
- package/dist/modes/interactive/components/control-panel.d.ts +56 -0
- package/dist/modes/interactive/components/control-panel.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel.js +240 -0
- package/dist/modes/interactive/components/control-panel.js.map +1 -0
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +21 -13
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js +1 -1
- package/dist/modes/interactive/components/earendil-announcement.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +8 -0
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +3 -0
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +3 -0
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/mcp-selector.d.ts +30 -0
- package/dist/modes/interactive/components/mcp-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/mcp-selector.js +155 -0
- package/dist/modes/interactive/components/mcp-selector.js.map +1 -0
- package/dist/modes/interactive/components/model-selector-state.d.ts +101 -0
- package/dist/modes/interactive/components/model-selector-state.d.ts.map +1 -0
- package/dist/modes/interactive/components/model-selector-state.js +261 -0
- package/dist/modes/interactive/components/model-selector-state.js.map +1 -0
- package/dist/modes/interactive/components/model-selector.d.ts +52 -9
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +212 -66
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +19 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +21 -8
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skills-selector.d.ts +32 -0
- package/dist/modes/interactive/components/skills-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/skills-selector.js +130 -0
- package/dist/modes/interactive/components/skills-selector.js.map +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -0
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +10 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +7 -8
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +7 -48
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +13 -2
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +399 -108
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/catppuccin-mocha.json +86 -0
- package/dist/modes/interactive/theme/dracula.json +86 -0
- package/dist/modes/interactive/theme/gruvbox-dark.json +86 -0
- package/dist/modes/interactive/theme/kanagawa-dragon.json +86 -0
- package/dist/modes/interactive/theme/omk-blackboard.json +91 -0
- package/dist/modes/interactive/theme/omk-control-panel.json +91 -0
- package/dist/modes/interactive/theme/omk-freedom-grid.json +91 -0
- package/dist/modes/interactive/theme/omk-neon-ops.json +90 -0
- package/dist/modes/interactive/theme/omk-slate-light.json +91 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +55 -16
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/interactive/theme/tokyo-night-storm.json +86 -0
- package/dist/modes/print-mode.d.ts +2 -2
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +2 -2
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +4 -0
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +114 -49
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +1 -1
- package/dist/utils/clipboard-image.js.map +1 -1
- package/dist/utils/omk-user-agent.d.ts +2 -0
- package/dist/utils/omk-user-agent.d.ts.map +1 -0
- package/dist/utils/{pi-user-agent.js → omk-user-agent.js} +2 -2
- package/dist/utils/omk-user-agent.js.map +1 -0
- package/dist/utils/tools-manager.d.ts.map +1 -1
- package/dist/utils/tools-manager.js +1 -1
- package/dist/utils/tools-manager.js.map +1 -1
- package/dist/utils/version-check.d.ts +5 -5
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +8 -11
- package/dist/utils/version-check.js.map +1 -1
- package/dist/utils/windows-self-update.d.ts.map +1 -1
- package/dist/utils/windows-self-update.js +1 -1
- package/dist/utils/windows-self-update.js.map +1 -1
- package/docs/compaction.md +21 -8
- package/docs/packages.md +47 -6
- package/docs/prompt-templates.md +2 -0
- package/docs/quickstart.md +1 -1
- package/docs/themes.md +10 -2
- package/docs/usage.md +18 -7
- package/examples/README.md +1 -1
- package/examples/extensions/README.md +11 -11
- package/examples/extensions/auto-commit-on-exit.ts +6 -6
- package/examples/extensions/bash-spawn-hook.ts +4 -4
- package/examples/extensions/bookmark.ts +5 -5
- package/examples/extensions/border-status-editor.ts +7 -7
- package/examples/extensions/built-in-tool-renderer.ts +6 -6
- package/examples/extensions/claude-rules.ts +4 -4
- package/examples/extensions/commands.ts +5 -5
- package/examples/extensions/confirm-destructive.ts +3 -3
- package/examples/extensions/custom-compaction.ts +3 -3
- package/examples/extensions/custom-footer.ts +2 -2
- package/examples/extensions/custom-header.ts +5 -5
- package/examples/extensions/custom-provider-anthropic/index.ts +4 -4
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/index.ts +3 -3
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/dirty-repo-guard.ts +7 -7
- package/examples/extensions/doom-overlay/README.md +3 -3
- package/examples/extensions/doom-overlay/doom/build.sh +2 -2
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +1 -1
- package/examples/extensions/doom-overlay/index.ts +3 -3
- package/examples/extensions/dynamic-resources/dynamic.json +1 -1
- package/examples/extensions/dynamic-resources/index.ts +2 -2
- package/examples/extensions/dynamic-tools.ts +4 -4
- package/examples/extensions/event-bus.ts +8 -8
- package/examples/extensions/file-trigger.ts +3 -3
- package/examples/extensions/git-checkpoint.ts +7 -7
- package/examples/extensions/git-merge-and-resolve.ts +14 -14
- package/examples/extensions/github-issue-autocomplete.ts +6 -6
- package/examples/extensions/gondolin/index.ts +16 -16
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/handoff.ts +2 -2
- package/examples/extensions/hello.ts +2 -2
- package/examples/extensions/hidden-thinking-label.ts +4 -4
- package/examples/extensions/inline-bash.ts +5 -5
- package/examples/extensions/input-transform-streaming.ts +5 -5
- package/examples/extensions/input-transform.ts +5 -5
- package/examples/extensions/interactive-shell.ts +3 -3
- package/examples/extensions/mac-system-theme.ts +5 -5
- package/examples/extensions/message-renderer.ts +4 -4
- package/examples/extensions/minimal-mode.ts +9 -9
- package/examples/extensions/modal-editor.ts +3 -3
- package/examples/extensions/model-status.ts +3 -3
- package/examples/extensions/notify.ts +5 -5
- package/examples/extensions/overlay-qa-tests.ts +20 -20
- package/examples/extensions/overlay-test.ts +3 -3
- package/examples/extensions/permission-gate.ts +2 -2
- package/examples/extensions/pirate.ts +4 -4
- package/examples/extensions/plan-mode/index.ts +22 -22
- package/examples/extensions/preset.ts +30 -30
- package/examples/extensions/prompt-customizer.ts +3 -3
- package/examples/extensions/protected-paths.ts +2 -2
- package/examples/extensions/provider-payload.ts +5 -5
- package/examples/extensions/qna.ts +2 -2
- package/examples/extensions/question.ts +2 -2
- package/examples/extensions/questionnaire.ts +2 -2
- package/examples/extensions/rainbow-editor.ts +3 -3
- package/examples/extensions/reload-runtime.ts +4 -4
- package/examples/extensions/rpc-demo.ts +10 -10
- package/examples/extensions/sandbox/index.ts +17 -17
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/send-user-message.ts +13 -13
- package/examples/extensions/session-name.ts +4 -4
- package/examples/extensions/shutdown-command.ts +10 -10
- package/examples/extensions/snake.ts +3 -3
- package/examples/extensions/space-invaders.ts +3 -3
- package/examples/extensions/ssh.ts +12 -12
- package/examples/extensions/status-line.ts +4 -4
- package/examples/extensions/structured-output.ts +2 -2
- package/examples/extensions/subagent/README.md +13 -13
- package/examples/extensions/subagent/agents.ts +2 -2
- package/examples/extensions/subagent/index.ts +53 -21
- package/examples/extensions/summarize.ts +2 -2
- package/examples/extensions/system-prompt-header.ts +3 -3
- package/examples/extensions/tic-tac-toe.ts +15 -15
- package/examples/extensions/timed-confirm.ts +4 -4
- package/examples/extensions/titlebar-spinner.ts +9 -9
- package/examples/extensions/todo.ts +5 -5
- package/examples/extensions/tool-override.ts +5 -5
- package/examples/extensions/tools.ts +10 -10
- package/examples/extensions/trigger-compact.ts +3 -3
- package/examples/extensions/truncated-tool.ts +3 -3
- package/examples/extensions/widget-placement.ts +2 -2
- package/examples/extensions/with-deps/index.ts +2 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/working-indicator.ts +7 -7
- package/examples/extensions/working-message-test.ts +3 -3
- package/examples/sdk/01-minimal.ts +1 -1
- package/examples/sdk/03-custom-prompt.ts +1 -1
- package/examples/sdk/04-skills.ts +1 -1
- package/examples/sdk/05-tools.ts +1 -1
- package/examples/sdk/06-extensions.ts +11 -11
- package/examples/sdk/07-context-files.ts +2 -0
- package/examples/sdk/08-prompt-templates.ts +1 -1
- package/examples/sdk/09-api-keys-and-oauth.ts +2 -2
- package/examples/sdk/README.md +2 -2
- package/node_modules/@earendil-works/omk-agent-core/README.md +488 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts +24 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js +553 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts +118 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js +402 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts +95 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js +996 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts +53 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js +175 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts +117 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js +568 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts +25 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js +131 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts +51 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js +510 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts +51 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js +102 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts +48 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js +230 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts +26 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js +101 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts +36 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js +273 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts +18 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js +42 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts +25 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js +114 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts +11 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js +39 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts +33 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js +210 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts +2 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js +50 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts +44 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js +311 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts +3 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js +30 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts +616 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js +94 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts +14 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js +126 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts +70 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js +297 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts +20 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js +25 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts +3 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js +3 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts +69 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js +278 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts +393 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js +2 -0
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-agent-core/package.json +60 -0
- package/node_modules/@earendil-works/omk-ai/README.md +1389 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts +20 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js +44 -0
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts +5 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js +6 -0
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.js +130 -0
- package/node_modules/@earendil-works/omk-ai/dist/cli.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts +20 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js +199 -0
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts +10 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts +515 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js +517 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js +23 -0
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts +14 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts +4 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.js +16 -0
- package/node_modules/@earendil-works/omk-ai/dist/images.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts +33 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.js +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts +18 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts +18762 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js +17197 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.js +78 -0
- package/node_modules/@earendil-works/omk-ai/dist/models.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts +39 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js +170 -0
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts +38 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js +826 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts +77 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js +1123 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts +15 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js +221 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js +26 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts +56 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js +368 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js +29 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts +70 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js +331 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts +15 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js +442 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js +402 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js +128 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts +4 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js +34 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts +25 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js +534 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts +30 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js +1171 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts +19 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js +977 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts +11 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts +18 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js +496 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js +233 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts +35 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js +254 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js +42 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js +82 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js +184 -0
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts +4 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.js +77 -0
- package/node_modules/@earendil-works/omk-ai/dist/stream.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts +570 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.js +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts +6 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js +34 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts +19 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js +25 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js +81 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js +14 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js +8 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts +16 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js +113 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts +10 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js +97 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts +25 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js +335 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js +56 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts +30 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js +280 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts +58 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js +122 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts +3 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js +105 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts +43 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js +487 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts +13 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js +31 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts +64 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js +2 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts +57 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js +154 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts +22 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js +26 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts +17 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js +21 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts +18 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js +281 -0
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js.map +1 -0
- package/node_modules/@earendil-works/omk-ai/package.json +106 -0
- package/node_modules/@earendil-works/omk-tui/README.md +791 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts +54 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js +632 -0
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts +22 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js +104 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts +22 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js +35 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts +249 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js +1857 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts +28 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js +89 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts +37 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js +378 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts +31 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js +69 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts +96 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js +644 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts +50 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js +159 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts +50 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js +185 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts +12 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js +23 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts +19 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js +89 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts +13 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js +51 -0
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts +39 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js +2 -0
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts +16 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js +110 -0
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts +23 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.js +32 -0
- package/node_modules/@earendil-works/omk-tui/dist/index.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts +212 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js +252 -0
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts +184 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.js +1173 -0
- package/node_modules/@earendil-works/omk-tui/dist/keys.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts +28 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js +44 -0
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts +3 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js +53 -0
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts +50 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js +361 -0
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts +90 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js +366 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts +113 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js +472 -0
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts +242 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.js +1221 -0
- package/node_modules/@earendil-works/omk-tui/dist/tui.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts +17 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js +25 -0
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts +84 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.js +1032 -0
- package/node_modules/@earendil-works/omk-tui/dist/utils.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts +25 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts.map +1 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js +96 -0
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js.map +1 -0
- package/node_modules/@earendil-works/omk-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/omk-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
- package/node_modules/@earendil-works/omk-tui/package.json +47 -0
- package/package.json +22 -6
- package/dist/utils/pi-user-agent.d.ts +0 -2
- package/dist/utils/pi-user-agent.d.ts.map +0 -1
- package/dist/utils/pi-user-agent.js.map +0 -1
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure loadout / lane-profile algorithms for the OMK control plane.
|
|
3
|
+
*
|
|
4
|
+
* This module is I/O-free. It owns the loadout schema, built-in presets,
|
|
5
|
+
* capability gating (allow/exclude/require selectors), profile validation, and
|
|
6
|
+
* the derivation of scheduler read/write/parallelizable fields from a lane's
|
|
7
|
+
* optional assigned paths. Runtime wiring (AgentSession tool registry, skill
|
|
8
|
+
* prompt construction, MCP runtime, scheduler admission) lives in sibling
|
|
9
|
+
* modules and consumes the decisions made here.
|
|
10
|
+
*
|
|
11
|
+
* Schema and presets follow `.omk/runs/omk-pi-package-hardening-plan/loadout.md`.
|
|
12
|
+
*
|
|
13
|
+
* Erasable TypeScript only (no enum/namespace/parameter properties).
|
|
14
|
+
*/
|
|
15
|
+
const AUTHORITY_RANK = {
|
|
16
|
+
advisory: 0,
|
|
17
|
+
"read-only": 1,
|
|
18
|
+
"review-only": 1,
|
|
19
|
+
"security-review": 2,
|
|
20
|
+
"execute-tests": 3,
|
|
21
|
+
"write-scoped": 4,
|
|
22
|
+
};
|
|
23
|
+
const KNOWN_RESOURCE_KINDS = new Set([
|
|
24
|
+
"extension",
|
|
25
|
+
"skill",
|
|
26
|
+
"prompt",
|
|
27
|
+
"theme",
|
|
28
|
+
"tool",
|
|
29
|
+
"mcp",
|
|
30
|
+
"hook",
|
|
31
|
+
]);
|
|
32
|
+
const KNOWN_COMMAND_MODES = new Set([
|
|
33
|
+
"none",
|
|
34
|
+
"read-only-shell",
|
|
35
|
+
"tests-only",
|
|
36
|
+
"scoped-shell",
|
|
37
|
+
]);
|
|
38
|
+
const KNOWN_TOOL_DEFAULT_MODES = new Set([
|
|
39
|
+
"default-builtins",
|
|
40
|
+
"no-tools",
|
|
41
|
+
"no-builtin-tools",
|
|
42
|
+
]);
|
|
43
|
+
/** Roles permitted to declare a non-empty writeSet during scheduler derivation. */
|
|
44
|
+
const WRITING_ROLES = new Set([
|
|
45
|
+
"coder",
|
|
46
|
+
"tester",
|
|
47
|
+
"security",
|
|
48
|
+
"synthesizer",
|
|
49
|
+
"package-maintainer",
|
|
50
|
+
]);
|
|
51
|
+
const LOCKFILE_BASENAMES = new Set([
|
|
52
|
+
"package-lock.json",
|
|
53
|
+
"npm-shrinkwrap.json",
|
|
54
|
+
"yarn.lock",
|
|
55
|
+
"pnpm-lock.yaml",
|
|
56
|
+
]);
|
|
57
|
+
function allowNames(kind, names) {
|
|
58
|
+
return { allow: [{ kind, names }] };
|
|
59
|
+
}
|
|
60
|
+
export const BUILTIN_LOADOUTS = {
|
|
61
|
+
inspect: {
|
|
62
|
+
schemaVersion: "omk.loadout.v1",
|
|
63
|
+
name: "inspect",
|
|
64
|
+
authority: "read-only",
|
|
65
|
+
tools: { allow: ["read", "grep", "find", "ls"] },
|
|
66
|
+
skills: allowNames("skill", ["understand-chat", "analyze"]),
|
|
67
|
+
mcp: allowNames("mcp", ["filesystem-readonly", "memory"]),
|
|
68
|
+
hooks: allowNames("hook", ["pre-shell-guard", "protect-secrets"]),
|
|
69
|
+
},
|
|
70
|
+
plan: {
|
|
71
|
+
schemaVersion: "omk.loadout.v1",
|
|
72
|
+
name: "plan",
|
|
73
|
+
authority: "advisory",
|
|
74
|
+
tools: { allow: ["read", "grep", "find", "ls"] },
|
|
75
|
+
skills: allowNames("skill", ["adaptorch-route", "writing-plans", "ddd-software-architecture"]),
|
|
76
|
+
mcp: allowNames("mcp", ["memory", "adaptorch"]),
|
|
77
|
+
hooks: allowNames("hook", ["session-context", "precompact-checkpoint"]),
|
|
78
|
+
},
|
|
79
|
+
code: {
|
|
80
|
+
schemaVersion: "omk.loadout.v1",
|
|
81
|
+
name: "code",
|
|
82
|
+
authority: "write-scoped",
|
|
83
|
+
tools: { allow: ["read", "grep", "find", "ls", "edit", "write", "bash"] },
|
|
84
|
+
skills: allowNames("skill", ["test-driven-development", "coding-standards"]),
|
|
85
|
+
mcp: allowNames("mcp", ["filesystem", "context7"]),
|
|
86
|
+
hooks: allowNames("hook", ["pre-shell-guard", "protect-secrets", "typecheck-after-edit"]),
|
|
87
|
+
commands: { mode: "scoped-shell" },
|
|
88
|
+
},
|
|
89
|
+
test: {
|
|
90
|
+
schemaVersion: "omk.loadout.v1",
|
|
91
|
+
name: "test",
|
|
92
|
+
authority: "execute-tests",
|
|
93
|
+
tools: { allow: ["read", "grep", "find", "ls", "bash"] },
|
|
94
|
+
skills: allowNames("skill", ["verification-before-completion"]),
|
|
95
|
+
mcp: allowNames("mcp", ["filesystem"]),
|
|
96
|
+
hooks: allowNames("hook", ["pre-shell-guard", "stop-verify"]),
|
|
97
|
+
commands: { mode: "tests-only" },
|
|
98
|
+
},
|
|
99
|
+
review: {
|
|
100
|
+
schemaVersion: "omk.loadout.v1",
|
|
101
|
+
name: "review",
|
|
102
|
+
authority: "review-only",
|
|
103
|
+
tools: { allow: ["read", "grep", "find", "ls"] },
|
|
104
|
+
skills: allowNames("skill", ["code-review", "differential-review"]),
|
|
105
|
+
mcp: allowNames("mcp", ["memory"]),
|
|
106
|
+
hooks: allowNames("hook", ["stop-verify", "subagent-stop-audit"]),
|
|
107
|
+
},
|
|
108
|
+
security: {
|
|
109
|
+
schemaVersion: "omk.loadout.v1",
|
|
110
|
+
name: "security",
|
|
111
|
+
authority: "security-review",
|
|
112
|
+
tools: { allow: ["read", "grep", "find", "ls", "bash"] },
|
|
113
|
+
skills: allowNames("skill", ["security-review", "differential-review"]),
|
|
114
|
+
mcp: allowNames("mcp", ["filesystem-readonly", "memory"]),
|
|
115
|
+
hooks: allowNames("hook", ["pre-shell-guard", "protect-secrets", "stop-verify"]),
|
|
116
|
+
commands: { mode: "read-only-shell" },
|
|
117
|
+
},
|
|
118
|
+
"package-maintainer": {
|
|
119
|
+
schemaVersion: "omk.loadout.v1",
|
|
120
|
+
name: "package-maintainer",
|
|
121
|
+
authority: "write-scoped",
|
|
122
|
+
tools: { allow: ["read", "grep", "find", "ls", "edit", "write", "bash"] },
|
|
123
|
+
skills: allowNames("skill", ["security-review", "verification-before-completion"]),
|
|
124
|
+
mcp: allowNames("mcp", ["filesystem"]),
|
|
125
|
+
hooks: allowNames("hook", ["pre-shell-guard", "protect-secrets", "npm-audit-summary"]),
|
|
126
|
+
commands: { mode: "scoped-shell" },
|
|
127
|
+
},
|
|
128
|
+
none: {
|
|
129
|
+
schemaVersion: "omk.loadout.v1",
|
|
130
|
+
name: "none",
|
|
131
|
+
authority: "advisory",
|
|
132
|
+
tools: { allow: [], defaultMode: "no-tools" },
|
|
133
|
+
commands: { mode: "none" },
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
export function inferLoadoutForRole(role) {
|
|
137
|
+
switch (role) {
|
|
138
|
+
case "planner":
|
|
139
|
+
return "plan";
|
|
140
|
+
case "explorer":
|
|
141
|
+
return "inspect";
|
|
142
|
+
case "coder":
|
|
143
|
+
return "code";
|
|
144
|
+
case "tester":
|
|
145
|
+
return "test";
|
|
146
|
+
case "reviewer":
|
|
147
|
+
return "review";
|
|
148
|
+
case "security":
|
|
149
|
+
return "security";
|
|
150
|
+
case "package-maintainer":
|
|
151
|
+
return "package-maintainer";
|
|
152
|
+
case "synthesizer":
|
|
153
|
+
return "plan";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
export function authorityWithinGrant(requested, grant) {
|
|
157
|
+
return AUTHORITY_RANK[requested] <= AUTHORITY_RANK[grant];
|
|
158
|
+
}
|
|
159
|
+
export function laneDefaultsForRole(role) {
|
|
160
|
+
const loadout = inferLoadoutForRole(role);
|
|
161
|
+
const profile = BUILTIN_LOADOUTS[loadout];
|
|
162
|
+
return {
|
|
163
|
+
loadout,
|
|
164
|
+
authority: profile.authority,
|
|
165
|
+
parallelizable: profile.authority !== "write-scoped",
|
|
166
|
+
readOnly: profile.authority === "read-only" || profile.authority === "review-only" || profile.authority === "advisory",
|
|
167
|
+
writesProductFiles: profile.authority === "write-scoped",
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
export function applyLoadoutProfile(profile, inventory, options = {}) {
|
|
171
|
+
const blockers = [];
|
|
172
|
+
const warnings = [];
|
|
173
|
+
// Deterministic blocker order: authority, then tool/skill/mcp/hook requires.
|
|
174
|
+
if (options.grantAuthority && !authorityWithinGrant(profile.authority, options.grantAuthority)) {
|
|
175
|
+
blockers.push(`loadout authority ${profile.authority} exceeds grant ${options.grantAuthority}`);
|
|
176
|
+
}
|
|
177
|
+
const activeTools = applyToolGate(profile.tools, inventory.tools, blockers, warnings);
|
|
178
|
+
const activeSkills = applyCapabilityGate("skill", profile.skills, inventory.skills, blockers, warnings);
|
|
179
|
+
const activeMcp = applyCapabilityGate("mcp", profile.mcp, inventory.mcp, blockers, warnings);
|
|
180
|
+
const activeHooks = applyCapabilityGate("hook", profile.hooks, inventory.hooks, blockers, warnings);
|
|
181
|
+
return {
|
|
182
|
+
profileName: profile.name,
|
|
183
|
+
authority: profile.authority,
|
|
184
|
+
activeTools,
|
|
185
|
+
activeSkills,
|
|
186
|
+
activeMcp,
|
|
187
|
+
activeHooks,
|
|
188
|
+
blockers,
|
|
189
|
+
warnings,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Fail-closed structural validation of a loadout profile. Errors are returned
|
|
194
|
+
* in a deterministic order: schemaVersion, name, authority, tools, skills, mcp,
|
|
195
|
+
* hooks, commands.
|
|
196
|
+
*/
|
|
197
|
+
export function validateLoadoutProfile(profile) {
|
|
198
|
+
const errors = [];
|
|
199
|
+
if (profile.schemaVersion !== "omk.loadout.v1") {
|
|
200
|
+
errors.push(`unknown schemaVersion: ${String(profile.schemaVersion)}`);
|
|
201
|
+
}
|
|
202
|
+
if (typeof profile.name !== "string" || profile.name.trim() === "") {
|
|
203
|
+
errors.push("missing loadout name");
|
|
204
|
+
}
|
|
205
|
+
if (!(profile.authority in AUTHORITY_RANK)) {
|
|
206
|
+
errors.push(`unknown authority: ${String(profile.authority)}`);
|
|
207
|
+
}
|
|
208
|
+
validateToolGate(profile.tools, errors);
|
|
209
|
+
validateCapabilityGate("skills", "skill", profile.skills, errors);
|
|
210
|
+
validateCapabilityGate("mcp", "mcp", profile.mcp, errors);
|
|
211
|
+
validateCapabilityGate("hooks", "hook", profile.hooks, errors);
|
|
212
|
+
if (profile.commands) {
|
|
213
|
+
if (!KNOWN_COMMAND_MODES.has(profile.commands.mode)) {
|
|
214
|
+
errors.push(`unknown command mode: ${String(profile.commands.mode)}`);
|
|
215
|
+
}
|
|
216
|
+
else if (profile.authority in AUTHORITY_RANK) {
|
|
217
|
+
const conflict = commandModeAuthorityConflict(profile.commands.mode, profile.authority);
|
|
218
|
+
if (conflict)
|
|
219
|
+
errors.push(conflict);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return { valid: errors.length === 0, errors };
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Derive scheduler readSet/writeSet/parallelizable from a lane role plus the
|
|
226
|
+
* optional paths granted to that lane. Non-writing roles never produce a
|
|
227
|
+
* writeSet. parallelizable is false when a write-scoped lane writes anything,
|
|
228
|
+
* or when any write touches a lockfile, package config, snapshot, or git index.
|
|
229
|
+
*/
|
|
230
|
+
export function deriveSchedulerFields(input) {
|
|
231
|
+
const defaults = laneDefaultsForRole(input.role);
|
|
232
|
+
const readSet = toAccessSet(input.assignedReadPaths);
|
|
233
|
+
const writeSet = WRITING_ROLES.has(input.role) ? toAccessSet(input.assignedWritePaths) : [];
|
|
234
|
+
const parallelizable = deriveParallelizable(defaults.authority, writeSet);
|
|
235
|
+
return { readSet, writeSet, parallelizable };
|
|
236
|
+
}
|
|
237
|
+
function deriveParallelizable(authority, writeSet) {
|
|
238
|
+
if (writeSet.length === 0)
|
|
239
|
+
return true;
|
|
240
|
+
if (authority === "write-scoped")
|
|
241
|
+
return false;
|
|
242
|
+
if (writeSet.some((entry) => isSerializeTriggerPath(entry.path)))
|
|
243
|
+
return false;
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
/** Lockfile, package config, snapshot, or git-index writes force serialization. */
|
|
247
|
+
export function isSerializeTriggerPath(path) {
|
|
248
|
+
const normalized = path.replaceAll("\\", "/");
|
|
249
|
+
const base = normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
250
|
+
if (LOCKFILE_BASENAMES.has(base))
|
|
251
|
+
return true;
|
|
252
|
+
if (base === "package.json")
|
|
253
|
+
return true;
|
|
254
|
+
if (base.endsWith(".snap"))
|
|
255
|
+
return true;
|
|
256
|
+
if (normalized === ".git/index" || normalized.startsWith(".git/") || normalized.includes("/.git/"))
|
|
257
|
+
return true;
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
function toAccessSet(paths) {
|
|
261
|
+
if (!paths)
|
|
262
|
+
return [];
|
|
263
|
+
const seen = new Set();
|
|
264
|
+
const entries = [];
|
|
265
|
+
for (const raw of paths) {
|
|
266
|
+
const path = raw.trim();
|
|
267
|
+
if (path === "" || seen.has(path))
|
|
268
|
+
continue;
|
|
269
|
+
seen.add(path);
|
|
270
|
+
entries.push({ path });
|
|
271
|
+
}
|
|
272
|
+
entries.sort((a, b) => compareString(a.path, b.path));
|
|
273
|
+
return entries;
|
|
274
|
+
}
|
|
275
|
+
function resourceNames(resources) {
|
|
276
|
+
return new Set(resources.map((resource) => resource.name));
|
|
277
|
+
}
|
|
278
|
+
function applyToolGate(gate, resources, blockers, warnings) {
|
|
279
|
+
const available = resourceNames(resources);
|
|
280
|
+
for (const required of gate.require ?? []) {
|
|
281
|
+
if (!available.has(required))
|
|
282
|
+
blockers.push(`missing required tool: ${required}`);
|
|
283
|
+
}
|
|
284
|
+
const base = gate.defaultMode === "no-tools" ? [] : (gate.allow ?? resources.map((resource) => resource.name));
|
|
285
|
+
const excluded = new Set(gate.exclude ?? []);
|
|
286
|
+
const active = [];
|
|
287
|
+
for (const tool of base) {
|
|
288
|
+
if (!available.has(tool)) {
|
|
289
|
+
warnings.push(`optional tool not available: ${tool}`);
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (!excluded.has(tool))
|
|
293
|
+
active.push(tool);
|
|
294
|
+
}
|
|
295
|
+
return [...new Set(active)].sort(compareString);
|
|
296
|
+
}
|
|
297
|
+
function applyCapabilityGate(kind, gate, resources, blockers, warnings) {
|
|
298
|
+
if (!gate)
|
|
299
|
+
return [];
|
|
300
|
+
const active = new Set();
|
|
301
|
+
// require: every required selector must resolve, else a deterministic blocker.
|
|
302
|
+
for (const selector of gate.require ?? []) {
|
|
303
|
+
resolveRequireSelector(kind, selector, resources, blockers, active);
|
|
304
|
+
}
|
|
305
|
+
// allow: union of matches; warn on named-but-missing optional capabilities.
|
|
306
|
+
for (const selector of gate.allow ?? []) {
|
|
307
|
+
for (const match of matchSelector(selector, resources))
|
|
308
|
+
active.add(match.name);
|
|
309
|
+
for (const name of selector.names ?? []) {
|
|
310
|
+
if (!resources.some((resource) => resource.name === name && matchesCriteria(selector, resource))) {
|
|
311
|
+
warnings.push(`optional ${kind} not available: ${name}`);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
// exclude: applied last.
|
|
316
|
+
const excluded = new Set();
|
|
317
|
+
for (const selector of gate.exclude ?? []) {
|
|
318
|
+
for (const match of matchSelector(selector, resources))
|
|
319
|
+
excluded.add(match.name);
|
|
320
|
+
}
|
|
321
|
+
const result = [...active].filter((name) => !excluded.has(name));
|
|
322
|
+
return [...new Set(result)].sort(compareString);
|
|
323
|
+
}
|
|
324
|
+
function resolveRequireSelector(kind, selector, resources, blockers, active) {
|
|
325
|
+
if (selector.names && selector.names.length > 0) {
|
|
326
|
+
for (const name of selector.names) {
|
|
327
|
+
const matched = resources.some((resource) => resource.name === name && matchesCriteria(selector, resource));
|
|
328
|
+
if (matched)
|
|
329
|
+
active.add(name);
|
|
330
|
+
else
|
|
331
|
+
blockers.push(`missing required ${kind}: ${name}`);
|
|
332
|
+
}
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
const matches = matchSelector(selector, resources);
|
|
336
|
+
if (matches.length === 0) {
|
|
337
|
+
blockers.push(`missing required ${kind}: ${describeSelector(selector)}`);
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
for (const match of matches)
|
|
341
|
+
active.add(match.name);
|
|
342
|
+
}
|
|
343
|
+
function matchSelector(selector, resources) {
|
|
344
|
+
return resources.filter((resource) => {
|
|
345
|
+
if (selector.names && !selector.names.includes(resource.name))
|
|
346
|
+
return false;
|
|
347
|
+
return matchesCriteria(selector, resource);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function matchesCriteria(selector, resource) {
|
|
351
|
+
if (resource.kind !== selector.kind)
|
|
352
|
+
return false;
|
|
353
|
+
if (selector.scopes && (resource.scope === undefined || !selector.scopes.includes(resource.scope)))
|
|
354
|
+
return false;
|
|
355
|
+
if (selector.origins && (resource.origin === undefined || !selector.origins.includes(resource.origin)))
|
|
356
|
+
return false;
|
|
357
|
+
if (selector.sources && !selector.sources.some((glob) => globMatch(glob, resource.source ?? "")))
|
|
358
|
+
return false;
|
|
359
|
+
if (selector.paths && !selector.paths.some((glob) => globMatch(glob, resource.path ?? "")))
|
|
360
|
+
return false;
|
|
361
|
+
return true;
|
|
362
|
+
}
|
|
363
|
+
function describeSelector(selector) {
|
|
364
|
+
const parts = [`kind=${selector.kind}`];
|
|
365
|
+
if (selector.paths)
|
|
366
|
+
parts.push(`paths=${selector.paths.join(",")}`);
|
|
367
|
+
if (selector.sources)
|
|
368
|
+
parts.push(`sources=${selector.sources.join(",")}`);
|
|
369
|
+
if (selector.scopes)
|
|
370
|
+
parts.push(`scopes=${selector.scopes.join(",")}`);
|
|
371
|
+
if (selector.origins)
|
|
372
|
+
parts.push(`origins=${selector.origins.join(",")}`);
|
|
373
|
+
return parts.join(" ");
|
|
374
|
+
}
|
|
375
|
+
function validateToolGate(gate, errors) {
|
|
376
|
+
if (!gate) {
|
|
377
|
+
errors.push("missing tools gate");
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (gate.defaultMode !== undefined && !KNOWN_TOOL_DEFAULT_MODES.has(gate.defaultMode)) {
|
|
381
|
+
errors.push(`unknown tool defaultMode: ${String(gate.defaultMode)}`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function validateCapabilityGate(gateName, expectedKind, gate, errors) {
|
|
385
|
+
if (!gate)
|
|
386
|
+
return;
|
|
387
|
+
for (const group of ["allow", "exclude", "require"]) {
|
|
388
|
+
const selectors = gate[group];
|
|
389
|
+
if (!selectors)
|
|
390
|
+
continue;
|
|
391
|
+
for (const selector of selectors) {
|
|
392
|
+
if (!KNOWN_RESOURCE_KINDS.has(selector.kind)) {
|
|
393
|
+
errors.push(`unknown resource kind in ${gateName}.${group}: ${String(selector.kind)}`);
|
|
394
|
+
}
|
|
395
|
+
else if (selector.kind !== expectedKind) {
|
|
396
|
+
errors.push(`mismatched selector kind in ${gateName}.${group}: expected ${expectedKind}, got ${selector.kind}`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function commandModeAuthorityConflict(mode, authority) {
|
|
402
|
+
if (mode === "scoped-shell" && authority !== "write-scoped") {
|
|
403
|
+
return `command mode scoped-shell requires write-scoped authority, got ${authority}`;
|
|
404
|
+
}
|
|
405
|
+
if (mode === "tests-only" && authority !== "execute-tests" && authority !== "write-scoped") {
|
|
406
|
+
return `command mode tests-only requires execute-tests or write-scoped authority, got ${authority}`;
|
|
407
|
+
}
|
|
408
|
+
return undefined;
|
|
409
|
+
}
|
|
410
|
+
function globMatch(glob, value) {
|
|
411
|
+
return globToRegExp(glob).test(value);
|
|
412
|
+
}
|
|
413
|
+
function globToRegExp(glob) {
|
|
414
|
+
let pattern = "";
|
|
415
|
+
for (let index = 0; index < glob.length; index++) {
|
|
416
|
+
const char = glob[index];
|
|
417
|
+
if (char === "*") {
|
|
418
|
+
if (glob[index + 1] === "*") {
|
|
419
|
+
pattern += ".*";
|
|
420
|
+
index++;
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
pattern += "[^/]*";
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
else if (char === "?") {
|
|
427
|
+
pattern += ".";
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
pattern += char.replace(/[.+^${}()|[\]\\]/g, "\\$&");
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return new RegExp(`^${pattern}$`);
|
|
434
|
+
}
|
|
435
|
+
function compareString(a, b) {
|
|
436
|
+
if (a < b)
|
|
437
|
+
return -1;
|
|
438
|
+
if (a > b)
|
|
439
|
+
return 1;
|
|
440
|
+
return 0;
|
|
441
|
+
}
|
|
442
|
+
//# sourceMappingURL=loadouts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load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AM,CAAC,CAAC;QACtD,CAAC;IACF,CAAC;IACD,OAAO,IAAI,MAAM,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC;AAAA,CAClC;AAED,SAAS,aAAa,CAAC,CAAS,EAAE,CAAS,EAAU;IACpD,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IACrB,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IACpB,OAAO,CAAC,CAAC;AAAA,CACT","sourcesContent":["/**\n * Pure loadout / lane-profile algorithms for the OMK control plane.\n *\n * This module is I/O-free. It owns the loadout schema, built-in presets,\n * capability gating (allow/exclude/require selectors), profile validation, and\n * the derivation of scheduler read/write/parallelizable fields from a lane's\n * optional assigned paths. Runtime wiring (AgentSession tool registry, skill\n * prompt construction, MCP runtime, scheduler admission) lives in sibling\n * modules and consumes the decisions made here.\n *\n * Schema and presets follow `.omk/runs/omk-pi-package-hardening-plan/loadout.md`.\n *\n * Erasable TypeScript only (no enum/namespace/parameter properties).\n */\n\nexport type LoadoutAuthority =\n\t| \"advisory\"\n\t| \"read-only\"\n\t| \"execute-tests\"\n\t| \"write-scoped\"\n\t| \"review-only\"\n\t| \"security-review\";\n\nexport type LoadoutRole =\n\t| \"planner\"\n\t| \"explorer\"\n\t| \"coder\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"security\"\n\t| \"synthesizer\"\n\t| \"package-maintainer\";\n\n/** Resource kinds the loadout layer can describe. Only the last four are gated here. */\nexport type ResourceKind = \"extension\" | \"skill\" | \"prompt\" | \"theme\" | \"tool\" | \"mcp\" | \"hook\";\nexport type ResourceOrigin = \"package\" | \"top-level\";\nexport type SourceScope = \"user\" | \"project\" | \"temporary\" | \"builtin\";\nexport type CommandMode = \"none\" | \"read-only-shell\" | \"tests-only\" | \"scoped-shell\";\nexport type ToolDefaultMode = \"default-builtins\" | \"no-tools\" | \"no-builtin-tools\";\n\nexport interface NamedResource {\n\tkind: ResourceKind;\n\tname: string;\n\tsource?: string;\n\tscope?: SourceScope;\n\t/** Package-relative or absolute resource path, when meaningful (skills/prompts). */\n\tpath?: string;\n\torigin?: ResourceOrigin;\n}\n\n/**\n * A selector matches inventory resources by name and/or provenance criteria.\n * A resource matches when its kind equals `kind` and every defined criterion\n * matches (names is an OR over the listed names; paths/sources are OR over globs).\n */\nexport interface ResourceSelector {\n\tkind: ResourceKind;\n\tnames?: readonly string[];\n\t/** Glob patterns matched against `NamedResource.path`. */\n\tpaths?: readonly string[];\n\t/** Glob patterns matched against `NamedResource.source`. */\n\tsources?: readonly string[];\n\tscopes?: readonly SourceScope[];\n\torigins?: readonly ResourceOrigin[];\n\t/** Marker only; requirement is expressed by placement in `CapabilityGate.require`. */\n\trequired?: boolean;\n}\n\n/** Tool gating uses flat name arrays (mapped to SDK tools / setActiveTools). */\nexport interface ToolGate {\n\tallow?: readonly string[];\n\texclude?: readonly string[];\n\trequire?: readonly string[];\n\tdefaultMode?: ToolDefaultMode;\n}\n\n/** Skills / MCP / hooks gating uses selector arrays. */\nexport interface CapabilityGate {\n\tallow?: readonly ResourceSelector[];\n\texclude?: readonly ResourceSelector[];\n\trequire?: readonly ResourceSelector[];\n}\n\nexport interface LoadoutCommands {\n\tmode: CommandMode;\n\tallowPatterns?: readonly string[];\n\tblockPatterns?: readonly string[];\n}\n\nexport interface LoadoutEvidence {\n\trequired: boolean;\n\toutputPattern: string;\n}\n\nexport interface LoadoutProfile {\n\tschemaVersion: \"omk.loadout.v1\";\n\tname: string;\n\tdescription?: string;\n\tauthority: LoadoutAuthority;\n\ttools: ToolGate;\n\tskills?: CapabilityGate;\n\tmcp?: CapabilityGate;\n\thooks?: CapabilityGate;\n\tcommands?: LoadoutCommands;\n\tevidence?: LoadoutEvidence;\n}\n\nexport interface CapabilityInventory {\n\ttools: readonly NamedResource[];\n\tskills: readonly NamedResource[];\n\tmcp: readonly NamedResource[];\n\thooks: readonly NamedResource[];\n}\n\nexport interface LaneDefaults {\n\tloadout: string;\n\tauthority: LoadoutAuthority;\n\tparallelizable: boolean;\n\treadOnly: boolean;\n\twritesProductFiles: boolean;\n}\n\nexport interface AppliedLoadout {\n\tprofileName: string;\n\tauthority: LoadoutAuthority;\n\tactiveTools: string[];\n\tactiveSkills: string[];\n\tactiveMcp: string[];\n\tactiveHooks: string[];\n\tblockers: string[];\n\twarnings: string[];\n}\n\nexport interface LoadoutValidation {\n\tvalid: boolean;\n\terrors: string[];\n}\n\n/** A scheduler access entry; shape matches `AccessSetEntry` in the orchestration layer. */\nexport interface LoadoutAccessEntry {\n\tpath: string;\n\tsymbols?: readonly string[];\n}\n\nexport interface SchedulerFields {\n\treadSet: LoadoutAccessEntry[];\n\twriteSet: LoadoutAccessEntry[];\n\tparallelizable: boolean;\n}\n\nexport interface SchedulerDerivationInput {\n\trole: LoadoutRole;\n\tassignedReadPaths?: readonly string[];\n\tassignedWritePaths?: readonly string[];\n}\n\nconst AUTHORITY_RANK: Record<LoadoutAuthority, number> = {\n\tadvisory: 0,\n\t\"read-only\": 1,\n\t\"review-only\": 1,\n\t\"security-review\": 2,\n\t\"execute-tests\": 3,\n\t\"write-scoped\": 4,\n};\n\nconst KNOWN_RESOURCE_KINDS: ReadonlySet<ResourceKind> = new Set([\n\t\"extension\",\n\t\"skill\",\n\t\"prompt\",\n\t\"theme\",\n\t\"tool\",\n\t\"mcp\",\n\t\"hook\",\n]);\n\nconst KNOWN_COMMAND_MODES: ReadonlySet<CommandMode> = new Set([\n\t\"none\",\n\t\"read-only-shell\",\n\t\"tests-only\",\n\t\"scoped-shell\",\n]);\n\nconst KNOWN_TOOL_DEFAULT_MODES: ReadonlySet<ToolDefaultMode> = new Set([\n\t\"default-builtins\",\n\t\"no-tools\",\n\t\"no-builtin-tools\",\n]);\n\n/** Roles permitted to declare a non-empty writeSet during scheduler derivation. */\nconst WRITING_ROLES: ReadonlySet<LoadoutRole> = new Set([\n\t\"coder\",\n\t\"tester\",\n\t\"security\",\n\t\"synthesizer\",\n\t\"package-maintainer\",\n]);\n\nconst LOCKFILE_BASENAMES: ReadonlySet<string> = new Set([\n\t\"package-lock.json\",\n\t\"npm-shrinkwrap.json\",\n\t\"yarn.lock\",\n\t\"pnpm-lock.yaml\",\n]);\n\nfunction allowNames(kind: ResourceKind, names: readonly string[]): CapabilityGate {\n\treturn { allow: [{ kind, names }] };\n}\n\nexport const BUILTIN_LOADOUTS: Readonly<Record<string, LoadoutProfile>> = {\n\tinspect: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"inspect\",\n\t\tauthority: \"read-only\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\"] },\n\t\tskills: allowNames(\"skill\", [\"understand-chat\", \"analyze\"]),\n\t\tmcp: allowNames(\"mcp\", [\"filesystem-readonly\", \"memory\"]),\n\t\thooks: allowNames(\"hook\", [\"pre-shell-guard\", \"protect-secrets\"]),\n\t},\n\tplan: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"plan\",\n\t\tauthority: \"advisory\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\"] },\n\t\tskills: allowNames(\"skill\", [\"adaptorch-route\", \"writing-plans\", \"ddd-software-architecture\"]),\n\t\tmcp: allowNames(\"mcp\", [\"memory\", \"adaptorch\"]),\n\t\thooks: allowNames(\"hook\", [\"session-context\", \"precompact-checkpoint\"]),\n\t},\n\tcode: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"code\",\n\t\tauthority: \"write-scoped\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\", \"edit\", \"write\", \"bash\"] },\n\t\tskills: allowNames(\"skill\", [\"test-driven-development\", \"coding-standards\"]),\n\t\tmcp: allowNames(\"mcp\", [\"filesystem\", \"context7\"]),\n\t\thooks: allowNames(\"hook\", [\"pre-shell-guard\", \"protect-secrets\", \"typecheck-after-edit\"]),\n\t\tcommands: { mode: \"scoped-shell\" },\n\t},\n\ttest: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"test\",\n\t\tauthority: \"execute-tests\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\", \"bash\"] },\n\t\tskills: allowNames(\"skill\", [\"verification-before-completion\"]),\n\t\tmcp: allowNames(\"mcp\", [\"filesystem\"]),\n\t\thooks: allowNames(\"hook\", [\"pre-shell-guard\", \"stop-verify\"]),\n\t\tcommands: { mode: \"tests-only\" },\n\t},\n\treview: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"review\",\n\t\tauthority: \"review-only\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\"] },\n\t\tskills: allowNames(\"skill\", [\"code-review\", \"differential-review\"]),\n\t\tmcp: allowNames(\"mcp\", [\"memory\"]),\n\t\thooks: allowNames(\"hook\", [\"stop-verify\", \"subagent-stop-audit\"]),\n\t},\n\tsecurity: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"security\",\n\t\tauthority: \"security-review\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\", \"bash\"] },\n\t\tskills: allowNames(\"skill\", [\"security-review\", \"differential-review\"]),\n\t\tmcp: allowNames(\"mcp\", [\"filesystem-readonly\", \"memory\"]),\n\t\thooks: allowNames(\"hook\", [\"pre-shell-guard\", \"protect-secrets\", \"stop-verify\"]),\n\t\tcommands: { mode: \"read-only-shell\" },\n\t},\n\t\"package-maintainer\": {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"package-maintainer\",\n\t\tauthority: \"write-scoped\",\n\t\ttools: { allow: [\"read\", \"grep\", \"find\", \"ls\", \"edit\", \"write\", \"bash\"] },\n\t\tskills: allowNames(\"skill\", [\"security-review\", \"verification-before-completion\"]),\n\t\tmcp: allowNames(\"mcp\", [\"filesystem\"]),\n\t\thooks: allowNames(\"hook\", [\"pre-shell-guard\", \"protect-secrets\", \"npm-audit-summary\"]),\n\t\tcommands: { mode: \"scoped-shell\" },\n\t},\n\tnone: {\n\t\tschemaVersion: \"omk.loadout.v1\",\n\t\tname: \"none\",\n\t\tauthority: \"advisory\",\n\t\ttools: { allow: [], defaultMode: \"no-tools\" },\n\t\tcommands: { mode: \"none\" },\n\t},\n};\n\nexport function inferLoadoutForRole(role: LoadoutRole): string {\n\tswitch (role) {\n\t\tcase \"planner\":\n\t\t\treturn \"plan\";\n\t\tcase \"explorer\":\n\t\t\treturn \"inspect\";\n\t\tcase \"coder\":\n\t\t\treturn \"code\";\n\t\tcase \"tester\":\n\t\t\treturn \"test\";\n\t\tcase \"reviewer\":\n\t\t\treturn \"review\";\n\t\tcase \"security\":\n\t\t\treturn \"security\";\n\t\tcase \"package-maintainer\":\n\t\t\treturn \"package-maintainer\";\n\t\tcase \"synthesizer\":\n\t\t\treturn \"plan\";\n\t}\n}\n\nexport function authorityWithinGrant(requested: LoadoutAuthority, grant: LoadoutAuthority): boolean {\n\treturn AUTHORITY_RANK[requested] <= AUTHORITY_RANK[grant];\n}\n\nexport function laneDefaultsForRole(role: LoadoutRole): LaneDefaults {\n\tconst loadout = inferLoadoutForRole(role);\n\tconst profile = BUILTIN_LOADOUTS[loadout];\n\treturn {\n\t\tloadout,\n\t\tauthority: profile.authority,\n\t\tparallelizable: profile.authority !== \"write-scoped\",\n\t\treadOnly:\n\t\t\tprofile.authority === \"read-only\" || profile.authority === \"review-only\" || profile.authority === \"advisory\",\n\t\twritesProductFiles: profile.authority === \"write-scoped\",\n\t};\n}\n\nexport function applyLoadoutProfile(\n\tprofile: LoadoutProfile,\n\tinventory: CapabilityInventory,\n\toptions: { grantAuthority?: LoadoutAuthority } = {},\n): AppliedLoadout {\n\tconst blockers: string[] = [];\n\tconst warnings: string[] = [];\n\t// Deterministic blocker order: authority, then tool/skill/mcp/hook requires.\n\tif (options.grantAuthority && !authorityWithinGrant(profile.authority, options.grantAuthority)) {\n\t\tblockers.push(`loadout authority ${profile.authority} exceeds grant ${options.grantAuthority}`);\n\t}\n\n\tconst activeTools = applyToolGate(profile.tools, inventory.tools, blockers, warnings);\n\tconst activeSkills = applyCapabilityGate(\"skill\", profile.skills, inventory.skills, blockers, warnings);\n\tconst activeMcp = applyCapabilityGate(\"mcp\", profile.mcp, inventory.mcp, blockers, warnings);\n\tconst activeHooks = applyCapabilityGate(\"hook\", profile.hooks, inventory.hooks, blockers, warnings);\n\n\treturn {\n\t\tprofileName: profile.name,\n\t\tauthority: profile.authority,\n\t\tactiveTools,\n\t\tactiveSkills,\n\t\tactiveMcp,\n\t\tactiveHooks,\n\t\tblockers,\n\t\twarnings,\n\t};\n}\n\n/**\n * Fail-closed structural validation of a loadout profile. Errors are returned\n * in a deterministic order: schemaVersion, name, authority, tools, skills, mcp,\n * hooks, commands.\n */\nexport function validateLoadoutProfile(profile: LoadoutProfile): LoadoutValidation {\n\tconst errors: string[] = [];\n\tif (profile.schemaVersion !== \"omk.loadout.v1\") {\n\t\terrors.push(`unknown schemaVersion: ${String(profile.schemaVersion)}`);\n\t}\n\tif (typeof profile.name !== \"string\" || profile.name.trim() === \"\") {\n\t\terrors.push(\"missing loadout name\");\n\t}\n\tif (!(profile.authority in AUTHORITY_RANK)) {\n\t\terrors.push(`unknown authority: ${String(profile.authority)}`);\n\t}\n\tvalidateToolGate(profile.tools, errors);\n\tvalidateCapabilityGate(\"skills\", \"skill\", profile.skills, errors);\n\tvalidateCapabilityGate(\"mcp\", \"mcp\", profile.mcp, errors);\n\tvalidateCapabilityGate(\"hooks\", \"hook\", profile.hooks, errors);\n\tif (profile.commands) {\n\t\tif (!KNOWN_COMMAND_MODES.has(profile.commands.mode)) {\n\t\t\terrors.push(`unknown command mode: ${String(profile.commands.mode)}`);\n\t\t} else if (profile.authority in AUTHORITY_RANK) {\n\t\t\tconst conflict = commandModeAuthorityConflict(profile.commands.mode, profile.authority);\n\t\t\tif (conflict) errors.push(conflict);\n\t\t}\n\t}\n\treturn { valid: errors.length === 0, errors };\n}\n\n/**\n * Derive scheduler readSet/writeSet/parallelizable from a lane role plus the\n * optional paths granted to that lane. Non-writing roles never produce a\n * writeSet. parallelizable is false when a write-scoped lane writes anything,\n * or when any write touches a lockfile, package config, snapshot, or git index.\n */\nexport function deriveSchedulerFields(input: SchedulerDerivationInput): SchedulerFields {\n\tconst defaults = laneDefaultsForRole(input.role);\n\tconst readSet = toAccessSet(input.assignedReadPaths);\n\tconst writeSet = WRITING_ROLES.has(input.role) ? toAccessSet(input.assignedWritePaths) : [];\n\tconst parallelizable = deriveParallelizable(defaults.authority, writeSet);\n\treturn { readSet, writeSet, parallelizable };\n}\n\nfunction deriveParallelizable(authority: LoadoutAuthority, writeSet: readonly LoadoutAccessEntry[]): boolean {\n\tif (writeSet.length === 0) return true;\n\tif (authority === \"write-scoped\") return false;\n\tif (writeSet.some((entry) => isSerializeTriggerPath(entry.path))) return false;\n\treturn true;\n}\n\n/** Lockfile, package config, snapshot, or git-index writes force serialization. */\nexport function isSerializeTriggerPath(path: string): boolean {\n\tconst normalized = path.replaceAll(\"\\\\\", \"/\");\n\tconst base = normalized.slice(normalized.lastIndexOf(\"/\") + 1);\n\tif (LOCKFILE_BASENAMES.has(base)) return true;\n\tif (base === \"package.json\") return true;\n\tif (base.endsWith(\".snap\")) return true;\n\tif (normalized === \".git/index\" || normalized.startsWith(\".git/\") || normalized.includes(\"/.git/\")) return true;\n\treturn false;\n}\n\nfunction toAccessSet(paths: readonly string[] | undefined): LoadoutAccessEntry[] {\n\tif (!paths) return [];\n\tconst seen = new Set<string>();\n\tconst entries: LoadoutAccessEntry[] = [];\n\tfor (const raw of paths) {\n\t\tconst path = raw.trim();\n\t\tif (path === \"\" || seen.has(path)) continue;\n\t\tseen.add(path);\n\t\tentries.push({ path });\n\t}\n\tentries.sort((a, b) => compareString(a.path, b.path));\n\treturn entries;\n}\n\nfunction resourceNames(resources: readonly NamedResource[]): Set<string> {\n\treturn new Set(resources.map((resource) => resource.name));\n}\n\nfunction applyToolGate(\n\tgate: ToolGate,\n\tresources: readonly NamedResource[],\n\tblockers: string[],\n\twarnings: string[],\n): string[] {\n\tconst available = resourceNames(resources);\n\tfor (const required of gate.require ?? []) {\n\t\tif (!available.has(required)) blockers.push(`missing required tool: ${required}`);\n\t}\n\tconst base = gate.defaultMode === \"no-tools\" ? [] : (gate.allow ?? resources.map((resource) => resource.name));\n\tconst excluded = new Set(gate.exclude ?? []);\n\tconst active: string[] = [];\n\tfor (const tool of base) {\n\t\tif (!available.has(tool)) {\n\t\t\twarnings.push(`optional tool not available: ${tool}`);\n\t\t\tcontinue;\n\t\t}\n\t\tif (!excluded.has(tool)) active.push(tool);\n\t}\n\treturn [...new Set(active)].sort(compareString);\n}\n\nfunction applyCapabilityGate(\n\tkind: ResourceKind,\n\tgate: CapabilityGate | undefined,\n\tresources: readonly NamedResource[],\n\tblockers: string[],\n\twarnings: string[],\n): string[] {\n\tif (!gate) return [];\n\tconst active = new Set<string>();\n\n\t// require: every required selector must resolve, else a deterministic blocker.\n\tfor (const selector of gate.require ?? []) {\n\t\tresolveRequireSelector(kind, selector, resources, blockers, active);\n\t}\n\n\t// allow: union of matches; warn on named-but-missing optional capabilities.\n\tfor (const selector of gate.allow ?? []) {\n\t\tfor (const match of matchSelector(selector, resources)) active.add(match.name);\n\t\tfor (const name of selector.names ?? []) {\n\t\t\tif (!resources.some((resource) => resource.name === name && matchesCriteria(selector, resource))) {\n\t\t\t\twarnings.push(`optional ${kind} not available: ${name}`);\n\t\t\t}\n\t\t}\n\t}\n\n\t// exclude: applied last.\n\tconst excluded = new Set<string>();\n\tfor (const selector of gate.exclude ?? []) {\n\t\tfor (const match of matchSelector(selector, resources)) excluded.add(match.name);\n\t}\n\n\tconst result = [...active].filter((name) => !excluded.has(name));\n\treturn [...new Set(result)].sort(compareString);\n}\n\nfunction resolveRequireSelector(\n\tkind: ResourceKind,\n\tselector: ResourceSelector,\n\tresources: readonly NamedResource[],\n\tblockers: string[],\n\tactive: Set<string>,\n): void {\n\tif (selector.names && selector.names.length > 0) {\n\t\tfor (const name of selector.names) {\n\t\t\tconst matched = resources.some((resource) => resource.name === name && matchesCriteria(selector, resource));\n\t\t\tif (matched) active.add(name);\n\t\t\telse blockers.push(`missing required ${kind}: ${name}`);\n\t\t}\n\t\treturn;\n\t}\n\tconst matches = matchSelector(selector, resources);\n\tif (matches.length === 0) {\n\t\tblockers.push(`missing required ${kind}: ${describeSelector(selector)}`);\n\t\treturn;\n\t}\n\tfor (const match of matches) active.add(match.name);\n}\n\nfunction matchSelector(selector: ResourceSelector, resources: readonly NamedResource[]): NamedResource[] {\n\treturn resources.filter((resource) => {\n\t\tif (selector.names && !selector.names.includes(resource.name)) return false;\n\t\treturn matchesCriteria(selector, resource);\n\t});\n}\n\nfunction matchesCriteria(selector: ResourceSelector, resource: NamedResource): boolean {\n\tif (resource.kind !== selector.kind) return false;\n\tif (selector.scopes && (resource.scope === undefined || !selector.scopes.includes(resource.scope))) return false;\n\tif (selector.origins && (resource.origin === undefined || !selector.origins.includes(resource.origin))) return false;\n\tif (selector.sources && !selector.sources.some((glob) => globMatch(glob, resource.source ?? \"\"))) return false;\n\tif (selector.paths && !selector.paths.some((glob) => globMatch(glob, resource.path ?? \"\"))) return false;\n\treturn true;\n}\n\nfunction describeSelector(selector: ResourceSelector): string {\n\tconst parts: string[] = [`kind=${selector.kind}`];\n\tif (selector.paths) parts.push(`paths=${selector.paths.join(\",\")}`);\n\tif (selector.sources) parts.push(`sources=${selector.sources.join(\",\")}`);\n\tif (selector.scopes) parts.push(`scopes=${selector.scopes.join(\",\")}`);\n\tif (selector.origins) parts.push(`origins=${selector.origins.join(\",\")}`);\n\treturn parts.join(\" \");\n}\n\nfunction validateToolGate(gate: ToolGate | undefined, errors: string[]): void {\n\tif (!gate) {\n\t\terrors.push(\"missing tools gate\");\n\t\treturn;\n\t}\n\tif (gate.defaultMode !== undefined && !KNOWN_TOOL_DEFAULT_MODES.has(gate.defaultMode)) {\n\t\terrors.push(`unknown tool defaultMode: ${String(gate.defaultMode)}`);\n\t}\n}\n\nfunction validateCapabilityGate(\n\tgateName: string,\n\texpectedKind: ResourceKind,\n\tgate: CapabilityGate | undefined,\n\terrors: string[],\n): void {\n\tif (!gate) return;\n\tfor (const group of [\"allow\", \"exclude\", \"require\"] as const) {\n\t\tconst selectors = gate[group];\n\t\tif (!selectors) continue;\n\t\tfor (const selector of selectors) {\n\t\t\tif (!KNOWN_RESOURCE_KINDS.has(selector.kind)) {\n\t\t\t\terrors.push(`unknown resource kind in ${gateName}.${group}: ${String(selector.kind)}`);\n\t\t\t} else if (selector.kind !== expectedKind) {\n\t\t\t\terrors.push(\n\t\t\t\t\t`mismatched selector kind in ${gateName}.${group}: expected ${expectedKind}, got ${selector.kind}`,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction commandModeAuthorityConflict(mode: CommandMode, authority: LoadoutAuthority): string | undefined {\n\tif (mode === \"scoped-shell\" && authority !== \"write-scoped\") {\n\t\treturn `command mode scoped-shell requires write-scoped authority, got ${authority}`;\n\t}\n\tif (mode === \"tests-only\" && authority !== \"execute-tests\" && authority !== \"write-scoped\") {\n\t\treturn `command mode tests-only requires execute-tests or write-scoped authority, got ${authority}`;\n\t}\n\treturn undefined;\n}\n\nfunction globMatch(glob: string, value: string): boolean {\n\treturn globToRegExp(glob).test(value);\n}\n\nfunction globToRegExp(glob: string): RegExp {\n\tlet pattern = \"\";\n\tfor (let index = 0; index < glob.length; index++) {\n\t\tconst char = glob[index];\n\t\tif (char === \"*\") {\n\t\t\tif (glob[index + 1] === \"*\") {\n\t\t\t\tpattern += \".*\";\n\t\t\t\tindex++;\n\t\t\t} else {\n\t\t\t\tpattern += \"[^/]*\";\n\t\t\t}\n\t\t} else if (char === \"?\") {\n\t\t\tpattern += \".\";\n\t\t} else {\n\t\t\tpattern += char.replace(/[.+^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\t\t}\n\t}\n\treturn new RegExp(`^${pattern}$`);\n}\n\nfunction compareString(a: string, b: string): number {\n\tif (a < b) return -1;\n\tif (a > b) return 1;\n\treturn 0;\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read-only MCP inventory reader.
|
|
3
|
+
*
|
|
4
|
+
* Aggregates MCP server configuration from up to three on-disk sources without
|
|
5
|
+
* starting, stopping, or modifying any server. Secret values from `env` are
|
|
6
|
+
* never exposed — only the key names are returned to callers.
|
|
7
|
+
*
|
|
8
|
+
* Source precedence (later wins on name collision):
|
|
9
|
+
* 1. ~/.kimi/mcp.json (global, legacy/kimi)
|
|
10
|
+
* 2. ~/.omk/mcp.json (global, omk)
|
|
11
|
+
* 3. <cwd>/.omk/mcp.json (project, highest priority)
|
|
12
|
+
*/
|
|
13
|
+
export type McpInventoryNetworkMode = "none" | "loopback" | "domain-allowlist" | "all-explicit";
|
|
14
|
+
export interface McpInventoryNetworkDecision {
|
|
15
|
+
allowed: boolean;
|
|
16
|
+
mode: McpInventoryNetworkMode;
|
|
17
|
+
rule: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
allowedDomains: string[];
|
|
20
|
+
deniedDomains: string[];
|
|
21
|
+
allowUnixSockets: string[];
|
|
22
|
+
}
|
|
23
|
+
export interface McpServerEntry {
|
|
24
|
+
name: string;
|
|
25
|
+
source: string;
|
|
26
|
+
commandSummary: string;
|
|
27
|
+
envKeys: string[];
|
|
28
|
+
argsCount: number;
|
|
29
|
+
autoApproveCount: number;
|
|
30
|
+
networkDecision: McpInventoryNetworkDecision;
|
|
31
|
+
startupTimeoutSec?: number;
|
|
32
|
+
overriddenBy?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface McpBuiltinPresetEntry {
|
|
35
|
+
name: string;
|
|
36
|
+
label: string;
|
|
37
|
+
description: string;
|
|
38
|
+
homepage: string;
|
|
39
|
+
repository: string;
|
|
40
|
+
license: string;
|
|
41
|
+
exactPackageSpec: string;
|
|
42
|
+
gitTag: string;
|
|
43
|
+
gitCommit: string;
|
|
44
|
+
commandSummary: string;
|
|
45
|
+
envKeys: string[];
|
|
46
|
+
requiredEnvKeys: string[];
|
|
47
|
+
optionalEnvKeys: string[];
|
|
48
|
+
startupTimeoutSec: number;
|
|
49
|
+
autoApproveCount: number;
|
|
50
|
+
networkDecision: McpInventoryNetworkDecision;
|
|
51
|
+
installHint: string;
|
|
52
|
+
notes: string[];
|
|
53
|
+
configured: boolean;
|
|
54
|
+
configuredBy?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface McpInventory {
|
|
57
|
+
entries: McpServerEntry[];
|
|
58
|
+
presets: McpBuiltinPresetEntry[];
|
|
59
|
+
sources: {
|
|
60
|
+
path: string;
|
|
61
|
+
exists: boolean;
|
|
62
|
+
serverCount: number;
|
|
63
|
+
}[];
|
|
64
|
+
errors: {
|
|
65
|
+
path: string;
|
|
66
|
+
message: string;
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Build the MCP inventory by merging all configured sources.
|
|
71
|
+
* The returned object is safe to render in the UI — env values are never included.
|
|
72
|
+
*/
|
|
73
|
+
export declare function loadMcpInventory(cwd?: string, home?: string): McpInventory;
|
|
74
|
+
//# sourceMappingURL=mcp-inventory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-inventory.d.ts","sourceRoot":"","sources":["../../src/core/mcp-inventory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,UAAU,GAAG,kBAAkB,GAAG,cAAc,CAAC;AAEhG,MAAM,WAAW,2BAA2B;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,uBAAuB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb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AE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5C;AAoID;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAsB,EAAE,IAAI,GAAE,MAAqB,GAAG,YAAY,CA8CvG","sourcesContent":["/**\n * Read-only MCP inventory reader.\n *\n * Aggregates MCP server configuration from up to three on-disk sources without\n * starting, stopping, or modifying any server. Secret values from `env` are\n * never exposed — only the key names are returned to callers.\n *\n * Source precedence (later wins on name collision):\n * 1. ~/.kimi/mcp.json (global, legacy/kimi)\n * 2. ~/.omk/mcp.json (global, omk)\n * 3. <cwd>/.omk/mcp.json (project, highest priority)\n */\n\nimport fs from \"node:fs\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { listBuiltinMcpPresets, summarizeBuiltinMcpPreset } from \"./mcp-presets.ts\";\n\nexport type McpInventoryNetworkMode = \"none\" | \"loopback\" | \"domain-allowlist\" | \"all-explicit\";\n\nexport interface McpInventoryNetworkDecision {\n\tallowed: boolean;\n\tmode: McpInventoryNetworkMode;\n\trule: string;\n\treason: string;\n\tallowedDomains: string[];\n\tdeniedDomains: string[];\n\tallowUnixSockets: string[];\n}\n\nexport interface McpServerEntry {\n\tname: string;\n\tsource: string;\n\tcommandSummary: string;\n\tenvKeys: string[];\n\targsCount: number;\n\tautoApproveCount: number;\n\tnetworkDecision: McpInventoryNetworkDecision;\n\tstartupTimeoutSec?: number;\n\toverriddenBy?: string;\n}\n\nexport interface McpBuiltinPresetEntry {\n\tname: string;\n\tlabel: string;\n\tdescription: string;\n\thomepage: string;\n\trepository: string;\n\tlicense: string;\n\texactPackageSpec: string;\n\tgitTag: string;\n\tgitCommit: string;\n\tcommandSummary: string;\n\tenvKeys: string[];\n\trequiredEnvKeys: string[];\n\toptionalEnvKeys: string[];\n\tstartupTimeoutSec: number;\n\tautoApproveCount: number;\n\tnetworkDecision: McpInventoryNetworkDecision;\n\tinstallHint: string;\n\tnotes: string[];\n\tconfigured: boolean;\n\tconfiguredBy?: string;\n}\n\nexport interface McpInventory {\n\tentries: McpServerEntry[];\n\tpresets: McpBuiltinPresetEntry[];\n\tsources: { path: string; exists: boolean; serverCount: number }[];\n\terrors: { path: string; message: string }[];\n}\n\ninterface RawServer {\n\tcommand?: unknown;\n\targs?: unknown;\n\tenv?: unknown;\n\tautoApprove?: unknown;\n\tstartup_timeout_sec?: unknown;\n\tnetwork?: unknown;\n}\n\nfunction readJsonSafe(filePath: string): { value: unknown; error?: string } {\n\ttry {\n\t\tconst raw = fs.readFileSync(filePath, \"utf8\");\n\t\treturn { value: JSON.parse(raw) };\n\t} catch (err) {\n\t\tif ((err as NodeJS.ErrnoException)?.code === \"ENOENT\") {\n\t\t\treturn { value: null };\n\t\t}\n\t\treturn { value: null, error: err instanceof Error ? err.message : String(err) };\n\t}\n}\n\nfunction summarizeCommand(server: RawServer): string {\n\tif (typeof server.command !== \"string\" || !server.command) {\n\t\treturn \"<unknown>\";\n\t}\n\tconst base = path.basename(server.command);\n\tif (Array.isArray(server.args) && server.args.length > 0) {\n\t\tconst first = server.args.find((a) => typeof a === \"string\" && !a.startsWith(\"-\")) as string | undefined;\n\t\tif (first) {\n\t\t\treturn `${base} ${first}`.trim();\n\t\t}\n\t}\n\treturn base;\n}\n\nfunction isMcpInventoryNetworkMode(value: unknown): value is McpInventoryNetworkMode {\n\treturn value === \"none\" || value === \"loopback\" || value === \"domain-allowlist\" || value === \"all-explicit\";\n}\n\nfunction stringList(value: unknown): string[] {\n\tif (!Array.isArray(value)) return [];\n\treturn value\n\t\t.filter((entry): entry is string => typeof entry === \"string\")\n\t\t.map((entry) => entry.trim())\n\t\t.filter((entry) => entry.length > 0);\n}\n\nfunction mcpNetworkDecision(\n\tallowed: boolean,\n\tmode: McpInventoryNetworkMode,\n\trule: string,\n\treason: string,\n\tmetadata: Pick<McpInventoryNetworkDecision, \"allowedDomains\" | \"deniedDomains\" | \"allowUnixSockets\"> = {\n\t\tallowedDomains: [],\n\t\tdeniedDomains: [],\n\t\tallowUnixSockets: [],\n\t},\n): McpInventoryNetworkDecision {\n\treturn { allowed, mode, rule, reason, ...metadata };\n}\n\nfunction decideMcpInventoryNetwork(rawNetwork: unknown): McpInventoryNetworkDecision {\n\tif (!rawNetwork || typeof rawNetwork !== \"object\" || Array.isArray(rawNetwork)) {\n\t\treturn mcpNetworkDecision(\n\t\t\tfalse,\n\t\t\t\"none\",\n\t\t\t\"mcp.network.unspecified\",\n\t\t\t\"MCP server network access is denied until an explicit network policy is present.\",\n\t\t);\n\t}\n\n\tconst network = rawNetwork as Record<string, unknown>;\n\tconst mode = network.mode;\n\tconst allowedDomains = stringList(network.allowedDomains);\n\tconst deniedDomains = stringList(network.deniedDomains);\n\tconst allowUnixSockets = stringList(network.allowUnixSockets);\n\tconst metadata = { allowedDomains, deniedDomains, allowUnixSockets };\n\n\tif (!isMcpInventoryNetworkMode(mode)) {\n\t\treturn mcpNetworkDecision(false, \"none\", \"mcp.network.invalid_mode\", \"MCP network mode is invalid.\", metadata);\n\t}\n\tif (mode === \"none\") {\n\t\treturn mcpNetworkDecision(false, mode, \"mcp.network.none\", \"MCP server network access is disabled.\", metadata);\n\t}\n\tif (mode === \"domain-allowlist\" && allowedDomains.length === 0) {\n\t\treturn mcpNetworkDecision(\n\t\t\tfalse,\n\t\t\tmode,\n\t\t\t\"mcp.network.empty_allowlist\",\n\t\t\t\"MCP domain allowlist mode requires at least one allowed domain.\",\n\t\t\tmetadata,\n\t\t);\n\t}\n\treturn mcpNetworkDecision(\n\t\ttrue,\n\t\tmode,\n\t\t`mcp.network.${mode}`,\n\t\t\"MCP server network access is explicitly configured.\",\n\t\tmetadata,\n\t);\n}\n\nfunction toEntry(name: string, server: RawServer, source: string): McpServerEntry {\n\tconst envKeys =\n\t\tserver.env && typeof server.env === \"object\" && !Array.isArray(server.env)\n\t\t\t? Object.keys(server.env as Record<string, unknown>)\n\t\t\t: [];\n\tconst argsCount = Array.isArray(server.args) ? server.args.length : 0;\n\tconst autoApproveCount = Array.isArray(server.autoApprove) ? server.autoApprove.length : 0;\n\tconst startupTimeoutSec = typeof server.startup_timeout_sec === \"number\" ? server.startup_timeout_sec : undefined;\n\treturn {\n\t\tname,\n\t\tsource,\n\t\tcommandSummary: summarizeCommand(server),\n\t\tenvKeys,\n\t\targsCount,\n\t\tautoApproveCount,\n\t\tnetworkDecision: decideMcpInventoryNetwork(server.network),\n\t\tstartupTimeoutSec,\n\t};\n}\n\nfunction extractServers(raw: unknown): Record<string, RawServer> {\n\tif (!raw || typeof raw !== \"object\") return {};\n\tconst root = raw as Record<string, unknown>;\n\tconst candidate = root.mcpServers ?? root.servers ?? root.mcp_servers;\n\tif (!candidate || typeof candidate !== \"object\" || Array.isArray(candidate)) return {};\n\treturn candidate as Record<string, RawServer>;\n}\n\n/**\n * Build the MCP inventory by merging all configured sources.\n * The returned object is safe to render in the UI — env values are never included.\n */\nexport function loadMcpInventory(cwd: string = process.cwd(), home: string = os.homedir()): McpInventory {\n\tconst candidatePaths = [\n\t\tpath.join(home, \".kimi\", \"mcp.json\"),\n\t\tpath.join(home, \".omk\", \"mcp.json\"),\n\t\tpath.join(cwd, \".omk\", \"mcp.json\"),\n\t];\n\n\tconst sources: McpInventory[\"sources\"] = [];\n\tconst errors: McpInventory[\"errors\"] = [];\n\tconst merged = new Map<string, McpServerEntry>();\n\n\tfor (const filePath of candidatePaths) {\n\t\tconst exists = fs.existsSync(filePath);\n\t\tconst { value, error } = readJsonSafe(filePath);\n\t\tif (error) {\n\t\t\terrors.push({ path: filePath, message: error });\n\t\t}\n\t\tconst servers = extractServers(value);\n\t\tconst names = Object.keys(servers).sort();\n\t\tsources.push({ path: filePath, exists, serverCount: names.length });\n\n\t\tfor (const name of names) {\n\t\t\tconst server = servers[name];\n\t\t\tif (!server || typeof server !== \"object\") continue;\n\t\t\tconst entry = toEntry(name, server as RawServer, filePath);\n\t\t\tconst previous = merged.get(name);\n\t\t\tif (previous) {\n\t\t\t\tprevious.overriddenBy = filePath;\n\t\t\t}\n\t\t\tmerged.set(name, entry);\n\t\t}\n\t}\n\n\tconst entries = Array.from(merged.values()).sort((a, b) => a.name.localeCompare(b.name));\n\tconst presets = listBuiltinMcpPresets()\n\t\t.map((preset): McpBuiltinPresetEntry => {\n\t\t\tconst configuredEntry = merged.get(preset.name);\n\t\t\treturn {\n\t\t\t\t...summarizeBuiltinMcpPreset(preset),\n\t\t\t\tnetworkDecision: configuredEntry?.networkDecision ?? decideMcpInventoryNetwork(undefined),\n\t\t\t\tconfigured: configuredEntry !== undefined,\n\t\t\t\t...(configuredEntry ? { configuredBy: configuredEntry.source } : {}),\n\t\t\t};\n\t\t})\n\t\t.sort((a, b) => a.name.localeCompare(b.name));\n\treturn { entries, presets, sources, errors };\n}\n"]}
|