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,304 @@
|
|
|
1
|
+
const ALL_RESOURCES = {
|
|
2
|
+
extensions: true,
|
|
3
|
+
skills: true,
|
|
4
|
+
prompts: true,
|
|
5
|
+
themes: true,
|
|
6
|
+
};
|
|
7
|
+
const SIDE_EFFECT_CAPABILITIES = new Set([
|
|
8
|
+
"child-process",
|
|
9
|
+
"network",
|
|
10
|
+
"filesystem-write",
|
|
11
|
+
"browser-control",
|
|
12
|
+
"telemetry",
|
|
13
|
+
]);
|
|
14
|
+
const RESOURCE_PATTERNS = {
|
|
15
|
+
extensions: ["**/*"],
|
|
16
|
+
skills: ["**/*"],
|
|
17
|
+
prompts: ["**/*"],
|
|
18
|
+
themes: ["**/*"],
|
|
19
|
+
};
|
|
20
|
+
export function createDefaultCompositionPolicy() {
|
|
21
|
+
return {
|
|
22
|
+
omkOwnedDomains: ["ontology", "search", "memory", "cache", "compaction", "multi-agent", "session", "scheduler"],
|
|
23
|
+
surfaceOwnership: [
|
|
24
|
+
{ surface: "theme", ownerPackageIdentity: "npm:pi-tokyo-night" },
|
|
25
|
+
{ surface: "footer", ownerPackageIdentity: "npm:pi-zentui" },
|
|
26
|
+
{ surface: "editor", ownerPackageIdentity: "npm:pi-zentui" },
|
|
27
|
+
{ surface: "header", ownerPackageIdentity: "omk:core" },
|
|
28
|
+
{ surface: "tool-row", ownerPackageIdentity: "npm:pi-claude-style-tools" },
|
|
29
|
+
{ surface: "loadout", ownerPackageIdentity: "npm:pi-loadout" },
|
|
30
|
+
{ surface: "permission", ownerPackageIdentity: "npm:@gotgenes/pi-permission-system" },
|
|
31
|
+
{ surface: "structured-input", ownerPackageIdentity: "npm:@juicesharp/rpiv-ask-user-question" },
|
|
32
|
+
{ surface: "report-preview", ownerPackageIdentity: "npm:pi-markdown-preview" },
|
|
33
|
+
],
|
|
34
|
+
allowedResources: {
|
|
35
|
+
"npm:pi-tokyo-night": { extensions: false, skills: false, prompts: false, themes: true },
|
|
36
|
+
"npm:pi-zentui": { extensions: true, skills: false, prompts: false, themes: false },
|
|
37
|
+
"npm:pi-claude-style-tools": { extensions: true, skills: false, prompts: false, themes: false },
|
|
38
|
+
"npm:pi-loadout": { extensions: true, skills: false, prompts: false, themes: false },
|
|
39
|
+
"npm:pi-lens": { extensions: true, skills: false, prompts: false, themes: false },
|
|
40
|
+
"npm:@gotgenes/pi-permission-system": { extensions: true, skills: false, prompts: false, themes: false },
|
|
41
|
+
"npm:@juicesharp/rpiv-ask-user-question": { extensions: true, skills: false, prompts: false, themes: false },
|
|
42
|
+
"npm:pi-markdown-preview": { extensions: true, skills: false, prompts: false, themes: false },
|
|
43
|
+
"npm:pi-langfuse": { extensions: true, skills: false, prompts: false, themes: false },
|
|
44
|
+
"npm:pi-cache-optimizer": { extensions: true, skills: false, prompts: false, themes: false },
|
|
45
|
+
"npm:pi-sandbox": { extensions: true, skills: false, prompts: false, themes: false },
|
|
46
|
+
},
|
|
47
|
+
capabilityToSurfaces: {
|
|
48
|
+
setFooter: ["footer"],
|
|
49
|
+
setEditorComponent: ["editor"],
|
|
50
|
+
setHeader: ["header"],
|
|
51
|
+
setStatus: ["status"],
|
|
52
|
+
renderCall: ["tool-row"],
|
|
53
|
+
renderResult: ["tool-row"],
|
|
54
|
+
registerMessageRenderer: ["assistant-markdown"],
|
|
55
|
+
setActiveTools: ["loadout"],
|
|
56
|
+
permission: ["permission"],
|
|
57
|
+
askUserQuestion: ["structured-input"],
|
|
58
|
+
markdownPreview: ["report-preview"],
|
|
59
|
+
},
|
|
60
|
+
capabilityToOmkDomains: {
|
|
61
|
+
context: ["session"],
|
|
62
|
+
before_provider_request: ["cache", "session"],
|
|
63
|
+
session_before_compact: ["compaction"],
|
|
64
|
+
setModel: ["session"],
|
|
65
|
+
setThinkingLevel: ["session"],
|
|
66
|
+
memory: ["memory"],
|
|
67
|
+
cache: ["cache"],
|
|
68
|
+
ontology: ["ontology"],
|
|
69
|
+
multiAgent: ["multi-agent"],
|
|
70
|
+
scheduler: ["scheduler"],
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function checkSingleSurfaceOwner(identity, requestedSurfaces, existingOwners) {
|
|
75
|
+
const key = packageIdentityKey(identity);
|
|
76
|
+
const conflicts = [];
|
|
77
|
+
for (const surface of uniqueSorted(requestedSurfaces)) {
|
|
78
|
+
const owner = existingOwners.find((rule) => rule.surface === surface);
|
|
79
|
+
if (!owner)
|
|
80
|
+
continue;
|
|
81
|
+
if (owner.ownerPackageIdentity === key || owner.ownerPackageIdentity === identity)
|
|
82
|
+
continue;
|
|
83
|
+
conflicts.push({
|
|
84
|
+
kind: "duplicate-surface-owner",
|
|
85
|
+
surface,
|
|
86
|
+
owner: owner.ownerPackageIdentity,
|
|
87
|
+
reason: `${identity} cannot claim ${surface}; ${owner.ownerPackageIdentity} already owns it`,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return conflicts;
|
|
91
|
+
}
|
|
92
|
+
export function checkOmkDomainMutation(identity, capabilities, policy) {
|
|
93
|
+
const conflicts = [];
|
|
94
|
+
for (const capability of capabilities) {
|
|
95
|
+
const domains = policy.capabilityToOmkDomains[capability] ?? [];
|
|
96
|
+
for (const domain of domains) {
|
|
97
|
+
conflicts.push({
|
|
98
|
+
kind: "omk-domain-mutation",
|
|
99
|
+
domain,
|
|
100
|
+
capability,
|
|
101
|
+
reason: `${identity} requested ${capability}, which mutates OMK-owned ${domain}`,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return conflicts;
|
|
106
|
+
}
|
|
107
|
+
export function checkCapabilitySurfaceMatch(identity, requestedSurfaces, capabilities, policy) {
|
|
108
|
+
if (capabilities.length === 0)
|
|
109
|
+
return [];
|
|
110
|
+
const supported = new Set();
|
|
111
|
+
for (const capability of capabilities) {
|
|
112
|
+
for (const surface of policy.capabilityToSurfaces[capability] ?? []) {
|
|
113
|
+
supported.add(surface);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return uniqueSorted(requestedSurfaces)
|
|
117
|
+
.filter((surface) => !supported.has(surface))
|
|
118
|
+
.map((surface) => ({
|
|
119
|
+
kind: "capability-surface-mismatch",
|
|
120
|
+
surface,
|
|
121
|
+
reason: `${identity} requested ${surface}, but no detected capability supports that surface`,
|
|
122
|
+
}));
|
|
123
|
+
}
|
|
124
|
+
export function resolveResourceFilter(identity, policy) {
|
|
125
|
+
const override = policy.allowedResources[identity] ?? policy.allowedResources[packageIdentityKey(identity)] ?? {};
|
|
126
|
+
return { ...ALL_RESOURCES, ...override };
|
|
127
|
+
}
|
|
128
|
+
export function inferRequestedSurfaces(review, policy) {
|
|
129
|
+
const surfaces = new Set();
|
|
130
|
+
for (const resource of review.candidate.expectedResources) {
|
|
131
|
+
if (resource === "theme")
|
|
132
|
+
surfaces.add("theme");
|
|
133
|
+
}
|
|
134
|
+
for (const capability of review.capabilities) {
|
|
135
|
+
for (const surface of policy.capabilityToSurfaces[capability] ?? []) {
|
|
136
|
+
surfaces.add(surface);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return uniqueSorted([...surfaces]);
|
|
140
|
+
}
|
|
141
|
+
export function composePackage(input, policy) {
|
|
142
|
+
const requestedSurfaces = uniqueSorted(input.requestedSurfaces ?? inferRequestedSurfaces(input.review, policy));
|
|
143
|
+
const allowedResources = resolveResourceFilter(input.identity, policy);
|
|
144
|
+
const conflicts = [
|
|
145
|
+
...checkSingleSurfaceOwner(input.identity, requestedSurfaces, policy.surfaceOwnership),
|
|
146
|
+
...checkOmkDomainMutation(input.identity, input.review.capabilities, policy),
|
|
147
|
+
...checkCapabilitySurfaceMatch(input.identity, requestedSurfaces, input.review.capabilities, policy),
|
|
148
|
+
...checkResourceFilter(input.identity, requestedSurfaces, allowedResources),
|
|
149
|
+
];
|
|
150
|
+
const rejectedReasons = [...input.review.rejectedReasons, ...conflicts.map((conflict) => conflict.reason)];
|
|
151
|
+
const blockingConflict = conflicts.find((conflict) => [
|
|
152
|
+
"duplicate-surface-owner",
|
|
153
|
+
"omk-domain-mutation",
|
|
154
|
+
"unapproved-surface",
|
|
155
|
+
"capability-surface-mismatch",
|
|
156
|
+
"resource-filter-blocked",
|
|
157
|
+
].includes(conflict.kind));
|
|
158
|
+
if (!input.review.pinned) {
|
|
159
|
+
return compositionReview(input.identity, "reject", allowedResources, requestedSurfaces, conflicts, undefined, [
|
|
160
|
+
...rejectedReasons,
|
|
161
|
+
"missing-exact-pin",
|
|
162
|
+
]);
|
|
163
|
+
}
|
|
164
|
+
if (input.review.licenseVerdict === "reject" || input.review.lifecycleVerdict === "reject") {
|
|
165
|
+
return compositionReview(input.identity, "reject", allowedResources, requestedSurfaces, conflicts, undefined, rejectedReasons);
|
|
166
|
+
}
|
|
167
|
+
if (input.review.pathCompatibility === "pi-hardcoded") {
|
|
168
|
+
return compositionReview(input.identity, "reject", allowedResources, requestedSurfaces, conflicts, undefined, [
|
|
169
|
+
...rejectedReasons,
|
|
170
|
+
"pi-hardcoded-paths",
|
|
171
|
+
]);
|
|
172
|
+
}
|
|
173
|
+
if (blockingConflict) {
|
|
174
|
+
return compositionReview(input.identity, "reject", allowedResources, requestedSurfaces, conflicts, undefined, rejectedReasons);
|
|
175
|
+
}
|
|
176
|
+
if (input.review.adoption === "deferred") {
|
|
177
|
+
return compositionReview(input.identity, "defer", allowedResources, requestedSurfaces, conflicts, input.review.deferredReason, rejectedReasons);
|
|
178
|
+
}
|
|
179
|
+
if (input.review.adoption === "reject") {
|
|
180
|
+
return compositionReview(input.identity, "reject", allowedResources, requestedSurfaces, conflicts, undefined, rejectedReasons);
|
|
181
|
+
}
|
|
182
|
+
const canaryReasons = canaryRequiredReasons(input.review.capabilities);
|
|
183
|
+
if (input.review.risk === "high" && canaryReasons.length === 0) {
|
|
184
|
+
canaryReasons.push("canary-required: high-risk");
|
|
185
|
+
}
|
|
186
|
+
if (canaryReasons.length > 0) {
|
|
187
|
+
return compositionReview(input.identity, "canary", allowedResources, requestedSurfaces, conflicts, undefined, [
|
|
188
|
+
...rejectedReasons,
|
|
189
|
+
...canaryReasons,
|
|
190
|
+
]);
|
|
191
|
+
}
|
|
192
|
+
return compositionReview(input.identity, "admit", allowedResources, requestedSurfaces, conflicts, undefined, rejectedReasons);
|
|
193
|
+
}
|
|
194
|
+
export function composeCandidateBatch(inputs, basePolicy) {
|
|
195
|
+
const owners = [...basePolicy.surfaceOwnership];
|
|
196
|
+
const results = [];
|
|
197
|
+
for (const input of inputs) {
|
|
198
|
+
const policy = { ...basePolicy, surfaceOwnership: owners };
|
|
199
|
+
const result = composePackage(input, policy);
|
|
200
|
+
results.push(result);
|
|
201
|
+
if (result.verdict === "admit" || result.verdict === "canary") {
|
|
202
|
+
const ownerKey = packageIdentityKey(result.identity);
|
|
203
|
+
for (const surface of result.admittedSurfaces) {
|
|
204
|
+
if (!owners.some((owner) => owner.surface === surface)) {
|
|
205
|
+
owners.push({ surface, ownerPackageIdentity: ownerKey });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return results;
|
|
211
|
+
}
|
|
212
|
+
export function toPackageSource(review) {
|
|
213
|
+
assertPromotable(review);
|
|
214
|
+
if (isAllResourcesEnabled(review.allowedResources)) {
|
|
215
|
+
return review.identity;
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
source: review.identity,
|
|
219
|
+
extensions: review.allowedResources.extensions ? RESOURCE_PATTERNS.extensions : [],
|
|
220
|
+
skills: review.allowedResources.skills ? RESOURCE_PATTERNS.skills : [],
|
|
221
|
+
prompts: review.allowedResources.prompts ? RESOURCE_PATTERNS.prompts : [],
|
|
222
|
+
themes: review.allowedResources.themes ? RESOURCE_PATTERNS.themes : [],
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
export function createPromotionRecord(review, source, options = {}) {
|
|
226
|
+
assertPromotable(review);
|
|
227
|
+
return {
|
|
228
|
+
schemaVersion: "omk.package-composition.promotion.v1",
|
|
229
|
+
identity: review.identity,
|
|
230
|
+
source: redactSource(source),
|
|
231
|
+
scope: "project",
|
|
232
|
+
allowedResources: review.allowedResources,
|
|
233
|
+
admittedSurfaces: review.admittedSurfaces,
|
|
234
|
+
reviewedAt: (options.now ?? new Date()).toISOString(),
|
|
235
|
+
reviewedBy: options.reviewedBy ?? "root-orchestrator",
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
function checkResourceFilter(identity, requestedSurfaces, filter) {
|
|
239
|
+
const conflicts = [];
|
|
240
|
+
for (const surface of requestedSurfaces) {
|
|
241
|
+
const resource = resourceForSurface(surface);
|
|
242
|
+
if (filter[resource])
|
|
243
|
+
continue;
|
|
244
|
+
conflicts.push({
|
|
245
|
+
kind: "resource-filter-blocked",
|
|
246
|
+
surface,
|
|
247
|
+
reason: `${identity} requested ${surface}, but ${resource} resources are disabled`,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return conflicts;
|
|
251
|
+
}
|
|
252
|
+
function resourceForSurface(surface) {
|
|
253
|
+
return surface === "theme" ? "themes" : "extensions";
|
|
254
|
+
}
|
|
255
|
+
function canaryRequiredReasons(capabilities) {
|
|
256
|
+
const reasons = [];
|
|
257
|
+
for (const capability of capabilities) {
|
|
258
|
+
if (SIDE_EFFECT_CAPABILITIES.has(capability)) {
|
|
259
|
+
reasons.push(`canary-required: ${capability}`);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return uniqueSorted(reasons);
|
|
263
|
+
}
|
|
264
|
+
function compositionReview(identity, verdict, allowedResources, admittedSurfaces, conflicts, deferredReason, rejectedReasons) {
|
|
265
|
+
return {
|
|
266
|
+
identity,
|
|
267
|
+
verdict,
|
|
268
|
+
allowedResources,
|
|
269
|
+
admittedSurfaces: uniqueSorted(admittedSurfaces),
|
|
270
|
+
conflicts: [...conflicts],
|
|
271
|
+
...(deferredReason === undefined ? {} : { deferredReason }),
|
|
272
|
+
rejectedReasons: uniqueSorted(rejectedReasons),
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function assertPromotable(review) {
|
|
276
|
+
if (review.verdict !== "admit") {
|
|
277
|
+
throw new Error(`Package composition verdict ${review.verdict} cannot be promoted`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
function isAllResourcesEnabled(filter) {
|
|
281
|
+
return filter.extensions && filter.skills && filter.prompts && filter.themes;
|
|
282
|
+
}
|
|
283
|
+
function packageIdentityKey(identity) {
|
|
284
|
+
if (!identity.startsWith("npm:"))
|
|
285
|
+
return identity;
|
|
286
|
+
const spec = identity.slice("npm:".length);
|
|
287
|
+
const at = spec.lastIndexOf("@");
|
|
288
|
+
if (at <= 0)
|
|
289
|
+
return identity;
|
|
290
|
+
if (spec.startsWith("@")) {
|
|
291
|
+
const scopedVersionAt = spec.indexOf("@", spec.indexOf("/") + 1);
|
|
292
|
+
return scopedVersionAt > 0 ? `npm:${spec.slice(0, scopedVersionAt)}` : identity;
|
|
293
|
+
}
|
|
294
|
+
return `npm:${spec.slice(0, at)}`;
|
|
295
|
+
}
|
|
296
|
+
function uniqueSorted(values) {
|
|
297
|
+
return [...new Set(values)].sort();
|
|
298
|
+
}
|
|
299
|
+
function redactSource(source) {
|
|
300
|
+
return source
|
|
301
|
+
.replace(/(https?:\/\/)([^\s/@]+@)/gi, "$1<redacted>@")
|
|
302
|
+
.replace(/([?&](?:access_token|auth|key|password|token)=)[^&#]+/gi, "$1<redacted>");
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=package-composition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-composition.js","sourceRoot":"","sources":["../../src/core/package-composition.ts"],"names":[],"mappings":"AAyFA,MAAM,aAAa,GAA8B;IAChD,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;CACZ,CAAC;AAEF,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC;IACxC,eAAe;IACf,SAAS;IACT,kBAAkB;IAClB,iBAAiB;IACjB,WAAW;CACX,CAAC,CAAC;AAEH,MAAM,iBAAiB,GAAsD;IAC5E,UAAU,EAAE,CAAC,MAAM,CAAC;IACpB,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,OAAO,EAAE,CAAC,MAAM,CAAC;IACjB,MAAM,EAAE,CAAC,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,UAAU,8BAA8B,GAA6B;IAC1E,OAAO;QACN,eAAe,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC;QAC/G,gBAAgB,EAAE;YACjB,EAAE,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE;YAChE,EAAE,OAAO,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EAAE,cAAc,CAAC,CAAC;AAAA,CACrF","sourcesContent":["import type { ProcurementReview } from \"./package-procurement.ts\";\nimport type { PackageSource } from \"./settings-manager.ts\";\n\nexport type CompositionSurface =\n\t| \"theme\"\n\t| \"footer\"\n\t| \"header\"\n\t| \"editor\"\n\t| \"tool-row\"\n\t| \"assistant-markdown\"\n\t| \"status\"\n\t| \"permission\"\n\t| \"structured-input\"\n\t| \"report-preview\"\n\t| \"loadout\";\n\nexport type OmkOwnedDomain =\n\t| \"ontology\"\n\t| \"search\"\n\t| \"memory\"\n\t| \"cache\"\n\t| \"compaction\"\n\t| \"multi-agent\"\n\t| \"session\"\n\t| \"scheduler\";\n\nexport type CompositionVerdict = \"admit\" | \"reject\" | \"defer\" | \"canary\";\n\nexport interface CompositionResourceFilter {\n\textensions: boolean;\n\tskills: boolean;\n\tprompts: boolean;\n\tthemes: boolean;\n}\n\nexport interface SurfaceOwnerRule {\n\tsurface: CompositionSurface;\n\townerPackageIdentity: string;\n}\n\nexport interface PackageCompositionPolicy {\n\treadonly omkOwnedDomains: readonly OmkOwnedDomain[];\n\treadonly surfaceOwnership: readonly SurfaceOwnerRule[];\n\treadonly allowedResources: Readonly<Record<string, Partial<CompositionResourceFilter>>>;\n\treadonly capabilityToSurfaces: Readonly<Record<string, readonly CompositionSurface[]>>;\n\treadonly capabilityToOmkDomains: Readonly<Record<string, readonly OmkOwnedDomain[]>>;\n}\n\nexport interface CompositionInput {\n\tidentity: string;\n\treview: ProcurementReview;\n\trequestedSurfaces?: readonly CompositionSurface[];\n}\n\nexport interface CompositionConflict {\n\tkind:\n\t\t| \"duplicate-surface-owner\"\n\t\t| \"omk-domain-mutation\"\n\t\t| \"unapproved-surface\"\n\t\t| \"capability-surface-mismatch\"\n\t\t| \"resource-filter-blocked\";\n\tsurface?: CompositionSurface;\n\tdomain?: OmkOwnedDomain;\n\towner?: string;\n\tcapability?: string;\n\treason: string;\n}\n\nexport interface CompositionReview {\n\tidentity: string;\n\tverdict: CompositionVerdict;\n\tallowedResources: CompositionResourceFilter;\n\tadmittedSurfaces: CompositionSurface[];\n\tconflicts: CompositionConflict[];\n\tdeferredReason?: string;\n\trejectedReasons: string[];\n}\n\nexport interface CompositionPromotionRecord {\n\tschemaVersion: \"omk.package-composition.promotion.v1\";\n\tidentity: string;\n\tsource: string;\n\tscope: \"project\";\n\tallowedResources: CompositionResourceFilter;\n\tadmittedSurfaces: CompositionSurface[];\n\treviewedAt: string;\n\treviewedBy: \"manual\" | \"root-orchestrator\";\n}\n\nconst ALL_RESOURCES: CompositionResourceFilter = {\n\textensions: true,\n\tskills: true,\n\tprompts: true,\n\tthemes: true,\n};\n\nconst SIDE_EFFECT_CAPABILITIES = new Set([\n\t\"child-process\",\n\t\"network\",\n\t\"filesystem-write\",\n\t\"browser-control\",\n\t\"telemetry\",\n]);\n\nconst RESOURCE_PATTERNS: Record<keyof CompositionResourceFilter, string[]> = {\n\textensions: [\"**/*\"],\n\tskills: [\"**/*\"],\n\tprompts: [\"**/*\"],\n\tthemes: [\"**/*\"],\n};\n\nexport function createDefaultCompositionPolicy(): PackageCompositionPolicy {\n\treturn {\n\t\tomkOwnedDomains: [\"ontology\", \"search\", \"memory\", \"cache\", \"compaction\", \"multi-agent\", \"session\", \"scheduler\"],\n\t\tsurfaceOwnership: [\n\t\t\t{ surface: \"theme\", ownerPackageIdentity: \"npm:pi-tokyo-night\" },\n\t\t\t{ surface: \"footer\", ownerPackageIdentity: \"npm:pi-zentui\" },\n\t\t\t{ surface: \"editor\", ownerPackageIdentity: \"npm:pi-zentui\" },\n\t\t\t{ surface: \"header\", ownerPackageIdentity: \"omk:core\" },\n\t\t\t{ surface: \"tool-row\", ownerPackageIdentity: \"npm:pi-claude-style-tools\" },\n\t\t\t{ surface: \"loadout\", ownerPackageIdentity: \"npm:pi-loadout\" },\n\t\t\t{ surface: \"permission\", ownerPackageIdentity: \"npm:@gotgenes/pi-permission-system\" },\n\t\t\t{ surface: \"structured-input\", ownerPackageIdentity: \"npm:@juicesharp/rpiv-ask-user-question\" },\n\t\t\t{ surface: \"report-preview\", ownerPackageIdentity: \"npm:pi-markdown-preview\" },\n\t\t],\n\t\tallowedResources: {\n\t\t\t\"npm:pi-tokyo-night\": { extensions: false, skills: false, prompts: false, themes: true },\n\t\t\t\"npm:pi-zentui\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-claude-style-tools\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-loadout\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-lens\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:@gotgenes/pi-permission-system\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:@juicesharp/rpiv-ask-user-question\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-markdown-preview\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-langfuse\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-cache-optimizer\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-sandbox\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t},\n\t\tcapabilityToSurfaces: {\n\t\t\tsetFooter: [\"footer\"],\n\t\t\tsetEditorComponent: [\"editor\"],\n\t\t\tsetHeader: [\"header\"],\n\t\t\tsetStatus: [\"status\"],\n\t\t\trenderCall: [\"tool-row\"],\n\t\t\trenderResult: [\"tool-row\"],\n\t\t\tregisterMessageRenderer: [\"assistant-markdown\"],\n\t\t\tsetActiveTools: [\"loadout\"],\n\t\t\tpermission: [\"permission\"],\n\t\t\taskUserQuestion: [\"structured-input\"],\n\t\t\tmarkdownPreview: [\"report-preview\"],\n\t\t},\n\t\tcapabilityToOmkDomains: {\n\t\t\tcontext: [\"session\"],\n\t\t\tbefore_provider_request: [\"cache\", \"session\"],\n\t\t\tsession_before_compact: [\"compaction\"],\n\t\t\tsetModel: [\"session\"],\n\t\t\tsetThinkingLevel: [\"session\"],\n\t\t\tmemory: [\"memory\"],\n\t\t\tcache: [\"cache\"],\n\t\t\tontology: [\"ontology\"],\n\t\t\tmultiAgent: [\"multi-agent\"],\n\t\t\tscheduler: [\"scheduler\"],\n\t\t},\n\t};\n}\n\nexport function checkSingleSurfaceOwner(\n\tidentity: string,\n\trequestedSurfaces: readonly CompositionSurface[],\n\texistingOwners: readonly SurfaceOwnerRule[],\n): CompositionConflict[] {\n\tconst key = packageIdentityKey(identity);\n\tconst conflicts: CompositionConflict[] = [];\n\tfor (const surface of uniqueSorted(requestedSurfaces)) {\n\t\tconst owner = existingOwners.find((rule) => rule.surface === surface);\n\t\tif (!owner) continue;\n\t\tif (owner.ownerPackageIdentity === key || owner.ownerPackageIdentity === identity) continue;\n\t\tconflicts.push({\n\t\t\tkind: \"duplicate-surface-owner\",\n\t\t\tsurface,\n\t\t\towner: owner.ownerPackageIdentity,\n\t\t\treason: `${identity} cannot claim ${surface}; ${owner.ownerPackageIdentity} already owns it`,\n\t\t});\n\t}\n\treturn conflicts;\n}\n\nexport function checkOmkDomainMutation(\n\tidentity: string,\n\tcapabilities: readonly string[],\n\tpolicy: PackageCompositionPolicy,\n): CompositionConflict[] {\n\tconst conflicts: CompositionConflict[] = [];\n\tfor (const capability of capabilities) {\n\t\tconst domains = policy.capabilityToOmkDomains[capability] ?? [];\n\t\tfor (const domain of domains) {\n\t\t\tconflicts.push({\n\t\t\t\tkind: \"omk-domain-mutation\",\n\t\t\t\tdomain,\n\t\t\t\tcapability,\n\t\t\t\treason: `${identity} requested ${capability}, which mutates OMK-owned ${domain}`,\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts;\n}\n\nexport function checkCapabilitySurfaceMatch(\n\tidentity: string,\n\trequestedSurfaces: readonly CompositionSurface[],\n\tcapabilities: readonly string[],\n\tpolicy: PackageCompositionPolicy,\n): CompositionConflict[] {\n\tif (capabilities.length === 0) return [];\n\tconst supported = new Set<CompositionSurface>();\n\tfor (const capability of capabilities) {\n\t\tfor (const surface of policy.capabilityToSurfaces[capability] ?? []) {\n\t\t\tsupported.add(surface);\n\t\t}\n\t}\n\n\treturn uniqueSorted(requestedSurfaces)\n\t\t.filter((surface) => !supported.has(surface))\n\t\t.map((surface) => ({\n\t\t\tkind: \"capability-surface-mismatch\" as const,\n\t\t\tsurface,\n\t\t\treason: `${identity} requested ${surface}, but no detected capability supports that surface`,\n\t\t}));\n}\n\nexport function resolveResourceFilter(identity: string, policy: PackageCompositionPolicy): CompositionResourceFilter {\n\tconst override = policy.allowedResources[identity] ?? policy.allowedResources[packageIdentityKey(identity)] ?? {};\n\treturn { ...ALL_RESOURCES, ...override };\n}\n\nexport function inferRequestedSurfaces(\n\treview: ProcurementReview,\n\tpolicy: PackageCompositionPolicy,\n): CompositionSurface[] {\n\tconst surfaces = new Set<CompositionSurface>();\n\tfor (const resource of review.candidate.expectedResources) {\n\t\tif (resource === \"theme\") surfaces.add(\"theme\");\n\t}\n\tfor (const capability of review.capabilities) {\n\t\tfor (const surface of policy.capabilityToSurfaces[capability] ?? []) {\n\t\t\tsurfaces.add(surface);\n\t\t}\n\t}\n\treturn uniqueSorted([...surfaces]);\n}\n\nexport function composePackage(input: CompositionInput, policy: PackageCompositionPolicy): CompositionReview {\n\tconst requestedSurfaces = uniqueSorted(input.requestedSurfaces ?? inferRequestedSurfaces(input.review, policy));\n\tconst allowedResources = resolveResourceFilter(input.identity, policy);\n\tconst conflicts = [\n\t\t...checkSingleSurfaceOwner(input.identity, requestedSurfaces, policy.surfaceOwnership),\n\t\t...checkOmkDomainMutation(input.identity, input.review.capabilities, policy),\n\t\t...checkCapabilitySurfaceMatch(input.identity, requestedSurfaces, input.review.capabilities, policy),\n\t\t...checkResourceFilter(input.identity, requestedSurfaces, allowedResources),\n\t];\n\n\tconst rejectedReasons = [...input.review.rejectedReasons, ...conflicts.map((conflict) => conflict.reason)];\n\tconst blockingConflict = conflicts.find((conflict) =>\n\t\t[\n\t\t\t\"duplicate-surface-owner\",\n\t\t\t\"omk-domain-mutation\",\n\t\t\t\"unapproved-surface\",\n\t\t\t\"capability-surface-mismatch\",\n\t\t\t\"resource-filter-blocked\",\n\t\t].includes(conflict.kind),\n\t);\n\n\tif (!input.review.pinned) {\n\t\treturn compositionReview(input.identity, \"reject\", allowedResources, requestedSurfaces, conflicts, undefined, [\n\t\t\t...rejectedReasons,\n\t\t\t\"missing-exact-pin\",\n\t\t]);\n\t}\n\tif (input.review.licenseVerdict === \"reject\" || input.review.lifecycleVerdict === \"reject\") {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"reject\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tundefined,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\tif (input.review.pathCompatibility === \"pi-hardcoded\") {\n\t\treturn compositionReview(input.identity, \"reject\", allowedResources, requestedSurfaces, conflicts, undefined, [\n\t\t\t...rejectedReasons,\n\t\t\t\"pi-hardcoded-paths\",\n\t\t]);\n\t}\n\tif (blockingConflict) {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"reject\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tundefined,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\tif (input.review.adoption === \"deferred\") {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"defer\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tinput.review.deferredReason,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\tif (input.review.adoption === \"reject\") {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"reject\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tundefined,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\n\tconst canaryReasons = canaryRequiredReasons(input.review.capabilities);\n\tif (input.review.risk === \"high\" && canaryReasons.length === 0) {\n\t\tcanaryReasons.push(\"canary-required: high-risk\");\n\t}\n\tif (canaryReasons.length > 0) {\n\t\treturn compositionReview(input.identity, \"canary\", allowedResources, requestedSurfaces, conflicts, undefined, [\n\t\t\t...rejectedReasons,\n\t\t\t...canaryReasons,\n\t\t]);\n\t}\n\n\treturn compositionReview(\n\t\tinput.identity,\n\t\t\"admit\",\n\t\tallowedResources,\n\t\trequestedSurfaces,\n\t\tconflicts,\n\t\tundefined,\n\t\trejectedReasons,\n\t);\n}\n\nexport function composeCandidateBatch(\n\tinputs: readonly CompositionInput[],\n\tbasePolicy: PackageCompositionPolicy,\n): CompositionReview[] {\n\tconst owners = [...basePolicy.surfaceOwnership];\n\tconst results: CompositionReview[] = [];\n\tfor (const input of inputs) {\n\t\tconst policy = { ...basePolicy, surfaceOwnership: owners };\n\t\tconst result = composePackage(input, policy);\n\t\tresults.push(result);\n\t\tif (result.verdict === \"admit\" || result.verdict === \"canary\") {\n\t\t\tconst ownerKey = packageIdentityKey(result.identity);\n\t\t\tfor (const surface of result.admittedSurfaces) {\n\t\t\t\tif (!owners.some((owner) => owner.surface === surface)) {\n\t\t\t\t\towners.push({ surface, ownerPackageIdentity: ownerKey });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn results;\n}\n\nexport function toPackageSource(review: CompositionReview): PackageSource {\n\tassertPromotable(review);\n\tif (isAllResourcesEnabled(review.allowedResources)) {\n\t\treturn review.identity;\n\t}\n\treturn {\n\t\tsource: review.identity,\n\t\textensions: review.allowedResources.extensions ? RESOURCE_PATTERNS.extensions : [],\n\t\tskills: review.allowedResources.skills ? RESOURCE_PATTERNS.skills : [],\n\t\tprompts: review.allowedResources.prompts ? RESOURCE_PATTERNS.prompts : [],\n\t\tthemes: review.allowedResources.themes ? RESOURCE_PATTERNS.themes : [],\n\t};\n}\n\nexport function createPromotionRecord(\n\treview: CompositionReview,\n\tsource: string,\n\toptions: { reviewedBy?: \"manual\" | \"root-orchestrator\"; now?: Date } = {},\n): CompositionPromotionRecord {\n\tassertPromotable(review);\n\treturn {\n\t\tschemaVersion: \"omk.package-composition.promotion.v1\",\n\t\tidentity: review.identity,\n\t\tsource: redactSource(source),\n\t\tscope: \"project\",\n\t\tallowedResources: review.allowedResources,\n\t\tadmittedSurfaces: review.admittedSurfaces,\n\t\treviewedAt: (options.now ?? new Date()).toISOString(),\n\t\treviewedBy: options.reviewedBy ?? \"root-orchestrator\",\n\t};\n}\n\nfunction checkResourceFilter(\n\tidentity: string,\n\trequestedSurfaces: readonly CompositionSurface[],\n\tfilter: CompositionResourceFilter,\n): CompositionConflict[] {\n\tconst conflicts: CompositionConflict[] = [];\n\tfor (const surface of requestedSurfaces) {\n\t\tconst resource = resourceForSurface(surface);\n\t\tif (filter[resource]) continue;\n\t\tconflicts.push({\n\t\t\tkind: \"resource-filter-blocked\",\n\t\t\tsurface,\n\t\t\treason: `${identity} requested ${surface}, but ${resource} resources are disabled`,\n\t\t});\n\t}\n\treturn conflicts;\n}\n\nfunction resourceForSurface(surface: CompositionSurface): keyof CompositionResourceFilter {\n\treturn surface === \"theme\" ? \"themes\" : \"extensions\";\n}\n\nfunction canaryRequiredReasons(capabilities: readonly string[]): string[] {\n\tconst reasons: string[] = [];\n\tfor (const capability of capabilities) {\n\t\tif (SIDE_EFFECT_CAPABILITIES.has(capability)) {\n\t\t\treasons.push(`canary-required: ${capability}`);\n\t\t}\n\t}\n\treturn uniqueSorted(reasons);\n}\n\nfunction compositionReview(\n\tidentity: string,\n\tverdict: CompositionVerdict,\n\tallowedResources: CompositionResourceFilter,\n\tadmittedSurfaces: readonly CompositionSurface[],\n\tconflicts: readonly CompositionConflict[],\n\tdeferredReason: string | undefined,\n\trejectedReasons: readonly string[],\n): CompositionReview {\n\treturn {\n\t\tidentity,\n\t\tverdict,\n\t\tallowedResources,\n\t\tadmittedSurfaces: uniqueSorted(admittedSurfaces),\n\t\tconflicts: [...conflicts],\n\t\t...(deferredReason === undefined ? {} : { deferredReason }),\n\t\trejectedReasons: uniqueSorted(rejectedReasons),\n\t};\n}\n\nfunction assertPromotable(review: CompositionReview): void {\n\tif (review.verdict !== \"admit\") {\n\t\tthrow new Error(`Package composition verdict ${review.verdict} cannot be promoted`);\n\t}\n}\n\nfunction isAllResourcesEnabled(filter: CompositionResourceFilter): boolean {\n\treturn filter.extensions && filter.skills && filter.prompts && filter.themes;\n}\n\nfunction packageIdentityKey(identity: string): string {\n\tif (!identity.startsWith(\"npm:\")) return identity;\n\tconst spec = identity.slice(\"npm:\".length);\n\tconst at = spec.lastIndexOf(\"@\");\n\tif (at <= 0) return identity;\n\tif (spec.startsWith(\"@\")) {\n\t\tconst scopedVersionAt = spec.indexOf(\"@\", spec.indexOf(\"/\") + 1);\n\t\treturn scopedVersionAt > 0 ? `npm:${spec.slice(0, scopedVersionAt)}` : identity;\n\t}\n\treturn `npm:${spec.slice(0, at)}`;\n}\n\nfunction uniqueSorted<T extends string>(values: readonly T[]): T[] {\n\treturn [...new Set(values)].sort();\n}\n\nfunction redactSource(source: string): string {\n\treturn source\n\t\t.replace(/(https?:\\/\\/)([^\\s/@]+@)/gi, \"$1<redacted>@\")\n\t\t.replace(/([?&](?:access_token|auth|key|password|token)=)[^&#]+/gi, \"$1<redacted>\");\n}\n"]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { type Adoption, type GateVerdict, type PathCompatibility } from "./package-procurement.ts";
|
|
2
|
+
export type GalleryResourceType = "extension" | "skill" | "prompt" | "theme";
|
|
3
|
+
export type GalleryManifestKey = "omk" | "pi";
|
|
4
|
+
export type GalleryInstallSourceKind = "npm" | "git" | "local";
|
|
5
|
+
export type GalleryInstallTrust = "code-execution" | "declarative";
|
|
6
|
+
export type GalleryPreviewKind = "video" | "image" | "generated-theme";
|
|
7
|
+
export type ExtensionCapabilityBadge = "tools" | "commands" | "hooks" | "provider" | "ui" | "compaction";
|
|
8
|
+
export interface NormalizedGalleryManifest {
|
|
9
|
+
manifestKey: GalleryManifestKey;
|
|
10
|
+
extensions: string[];
|
|
11
|
+
skills: string[];
|
|
12
|
+
prompts: string[];
|
|
13
|
+
themes: string[];
|
|
14
|
+
video: string | undefined;
|
|
15
|
+
image: string | undefined;
|
|
16
|
+
description: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface GalleryTypedEntry {
|
|
19
|
+
resourceTypes: readonly GalleryResourceType[];
|
|
20
|
+
}
|
|
21
|
+
export interface GalleryPreviewInput {
|
|
22
|
+
video?: string;
|
|
23
|
+
image?: string;
|
|
24
|
+
resourceTypes: readonly GalleryResourceType[];
|
|
25
|
+
themeName?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface GalleryPreviewSelection {
|
|
28
|
+
kind: GalleryPreviewKind;
|
|
29
|
+
url?: string;
|
|
30
|
+
marker?: string;
|
|
31
|
+
}
|
|
32
|
+
export type GalleryInstallSource = {
|
|
33
|
+
kind: "npm";
|
|
34
|
+
name: string;
|
|
35
|
+
version?: string;
|
|
36
|
+
} | {
|
|
37
|
+
kind: "git";
|
|
38
|
+
repo: string;
|
|
39
|
+
ref?: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "local";
|
|
42
|
+
path: string;
|
|
43
|
+
};
|
|
44
|
+
export interface GalleryInstallOptions {
|
|
45
|
+
local?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface GalleryInstallSpec {
|
|
48
|
+
kind: GalleryInstallSourceKind;
|
|
49
|
+
source: string;
|
|
50
|
+
installCommand: string;
|
|
51
|
+
tryEphemeralCommand: string;
|
|
52
|
+
trust: GalleryInstallTrust;
|
|
53
|
+
}
|
|
54
|
+
export type GalleryEntryIdentity = {
|
|
55
|
+
kind: "npm";
|
|
56
|
+
name: string;
|
|
57
|
+
} | {
|
|
58
|
+
kind: "git";
|
|
59
|
+
repo: string;
|
|
60
|
+
ref?: string;
|
|
61
|
+
} | {
|
|
62
|
+
kind: "local";
|
|
63
|
+
path: string;
|
|
64
|
+
};
|
|
65
|
+
export interface GalleryEntryWithIdentity {
|
|
66
|
+
identity: GalleryEntryIdentity;
|
|
67
|
+
}
|
|
68
|
+
export declare function normalizeGalleryManifest(pkgJson: unknown): NormalizedGalleryManifest | null;
|
|
69
|
+
export declare function hasGalleryKeyword(pkgJson: unknown): boolean;
|
|
70
|
+
export declare function resolveGalleryTypeFacet(facet: string | undefined): GalleryResourceType | undefined;
|
|
71
|
+
export declare function classifyGalleryResourceTypes(manifest: NormalizedGalleryManifest | null, conventionDirs?: readonly string[]): GalleryResourceType[];
|
|
72
|
+
export declare function filterGalleryEntriesByType<T extends GalleryTypedEntry>(entries: readonly T[], facet: string | undefined): T[];
|
|
73
|
+
export declare function isValidGalleryVideoUrl(url: string | undefined): boolean;
|
|
74
|
+
export declare function isValidGalleryImageUrl(url: string | undefined): boolean;
|
|
75
|
+
export declare function selectGalleryPreview(input: GalleryPreviewInput): GalleryPreviewSelection | null;
|
|
76
|
+
export declare function isPathInsideRootByRealpath(packageRoot: string, candidatePath: string): boolean;
|
|
77
|
+
export declare function resolveManifestEntryInsideRoot(packageRoot: string, entry: string, baseDir?: string): string | undefined;
|
|
78
|
+
export declare function filterManifestEntriesInsideRoot(packageRoot: string, entries: readonly string[]): string[];
|
|
79
|
+
export declare function buildGalleryInstallSpec(input: GalleryInstallSource, hasExtension: boolean, options?: GalleryInstallOptions): GalleryInstallSpec;
|
|
80
|
+
export declare function inferExtensionCapabilityBadges(sourceText: string): ExtensionCapabilityBadge[];
|
|
81
|
+
export declare function dedupeGalleryEntries<T extends GalleryEntryWithIdentity>(entries: readonly T[]): T[];
|
|
82
|
+
/**
|
|
83
|
+
* Procurement-derived safe-gate outcome for an unpromoted (ephemeral trial) gallery install.
|
|
84
|
+
*
|
|
85
|
+
* Closes G9: gallery trust is derived from capability scan and procurement verdicts, not
|
|
86
|
+
* from manifest claims. A trial is "admitted" only when the source is exact-pinned, carries
|
|
87
|
+
* no hard-block capability (credential reads, host sockets), and passed explicit license,
|
|
88
|
+
* lifecycle, and path-compatibility gates. Procurement rejection reasons are surfaced
|
|
89
|
+
* verbatim so callers can show why an unpromoted trial would be blocked.
|
|
90
|
+
*/
|
|
91
|
+
export type GalleryTrialGateOutcome = "admitted" | "blocked";
|
|
92
|
+
export interface GalleryTrialGateStatus {
|
|
93
|
+
readonly outcome: GalleryTrialGateOutcome;
|
|
94
|
+
readonly identity: string;
|
|
95
|
+
readonly adoption: Adoption;
|
|
96
|
+
readonly pinned: boolean;
|
|
97
|
+
readonly reasons: readonly string[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Structural subset of a procurement review consumed by the trial gate. The full procurement
|
|
101
|
+
* review (`ProcurementReview`) satisfies this shape, so callers may pass `procureCandidate(...)`
|
|
102
|
+
* output directly; tests can construct focused reviews without the full procurement input.
|
|
103
|
+
*/
|
|
104
|
+
export interface GalleryTrialGateReview {
|
|
105
|
+
readonly pinned: boolean;
|
|
106
|
+
readonly capabilities: readonly string[];
|
|
107
|
+
readonly adoption: Adoption;
|
|
108
|
+
readonly rejectedReasons: readonly string[];
|
|
109
|
+
readonly licenseVerdict?: GateVerdict;
|
|
110
|
+
readonly lifecycleVerdict?: GateVerdict;
|
|
111
|
+
readonly pathCompatibility?: PathCompatibility;
|
|
112
|
+
readonly candidate?: {
|
|
113
|
+
readonly expectedResources?: readonly string[];
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Classify whether a candidate package may be safely admitted to an unpromoted (ephemeral,
|
|
118
|
+
* sandboxed, `--ignore-scripts`) trial. Pure and deterministic: identical inputs always
|
|
119
|
+
* produce identical output, and no I/O is performed.
|
|
120
|
+
*/
|
|
121
|
+
export declare function assessGalleryTrialGate(identity: GalleryEntryIdentity, review: GalleryTrialGateReview): GalleryTrialGateStatus;
|
|
122
|
+
export declare function deriveGalleryInstallTrustFromReview(review: GalleryTrialGateReview): GalleryInstallTrust;
|
|
123
|
+
export declare function buildGalleryInstallSpecFromReview(input: GalleryInstallSource, review: GalleryTrialGateReview, options?: GalleryInstallOptions): GalleryInstallSpec;
|
|
124
|
+
//# sourceMappingURL=package-gallery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-gallery.d.ts","sourceRoot":"","sources":["../../src/core/package-gallery.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,iBAAiB,EAGtB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC7E,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAC;AAC/D,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AACnE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,OAAO,GAAG,iBAAiB,CAAC;AACvE,MAAM,MAAM,wBAAwB,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,IAAI,GAAG,YAAY,CAAC;AAEzG,MAAM,WAAW,yBAAyB;IACzC,WAAW,EAAE,kBAAkB,CAAC;IAChC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,iBAAiB;IACjC,aAAa,EAAE,SAAS,mBAAmB,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CA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,GACjC,kBAAkB,CAOpB","sourcesContent":["import { existsSync, realpathSync } from \"node:fs\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport {\n\ttype Adoption,\n\ttype GateVerdict,\n\ttype PathCompatibility,\n\tvalidateExactNpmVersion,\n\tvalidateGitRef,\n} from \"./package-procurement.ts\";\n\nexport type GalleryResourceType = \"extension\" | \"skill\" | \"prompt\" | \"theme\";\nexport type GalleryManifestKey = \"omk\" | \"pi\";\nexport type GalleryInstallSourceKind = \"npm\" | \"git\" | \"local\";\nexport type GalleryInstallTrust = \"code-execution\" | \"declarative\";\nexport type GalleryPreviewKind = \"video\" | \"image\" | \"generated-theme\";\nexport type ExtensionCapabilityBadge = \"tools\" | \"commands\" | \"hooks\" | \"provider\" | \"ui\" | \"compaction\";\n\nexport interface NormalizedGalleryManifest {\n\tmanifestKey: GalleryManifestKey;\n\textensions: string[];\n\tskills: string[];\n\tprompts: string[];\n\tthemes: string[];\n\tvideo: string | undefined;\n\timage: string | undefined;\n\tdescription: string | undefined;\n}\n\nexport interface GalleryTypedEntry {\n\tresourceTypes: readonly GalleryResourceType[];\n}\n\nexport interface GalleryPreviewInput {\n\tvideo?: string;\n\timage?: string;\n\tresourceTypes: readonly GalleryResourceType[];\n\tthemeName?: string;\n}\n\nexport interface GalleryPreviewSelection {\n\tkind: GalleryPreviewKind;\n\turl?: string;\n\tmarker?: string;\n}\n\nexport type GalleryInstallSource =\n\t| { kind: \"npm\"; name: string; version?: string }\n\t| { kind: \"git\"; repo: string; ref?: string }\n\t| { kind: \"local\"; path: string };\n\nexport interface GalleryInstallOptions {\n\tlocal?: boolean;\n}\n\nexport interface GalleryInstallSpec {\n\tkind: GalleryInstallSourceKind;\n\tsource: string;\n\tinstallCommand: string;\n\ttryEphemeralCommand: string;\n\ttrust: GalleryInstallTrust;\n}\n\nexport type GalleryEntryIdentity =\n\t| { kind: \"npm\"; name: string }\n\t| { kind: \"git\"; repo: string; ref?: string }\n\t| { kind: \"local\"; path: string };\n\nexport interface GalleryEntryWithIdentity {\n\tidentity: GalleryEntryIdentity;\n}\n\nconst RESOURCE_ORDER: readonly GalleryResourceType[] = [\"extension\", \"skill\", \"prompt\", \"theme\"];\nconst CAPABILITY_ORDER: readonly ExtensionCapabilityBadge[] = [\n\t\"tools\",\n\t\"commands\",\n\t\"hooks\",\n\t\"provider\",\n\t\"ui\",\n\t\"compaction\",\n];\nconst IMAGE_EXTENSIONS = [\".png\", \".jpg\", \".jpeg\", \".gif\", \".webp\"] as const;\n\nconst FACET_ALIASES: Readonly<Record<string, GalleryResourceType>> = {\n\textension: \"extension\",\n\textensions: \"extension\",\n\tskill: \"skill\",\n\tskills: \"skill\",\n\tprompt: \"prompt\",\n\tprompts: \"prompt\",\n\ttheme: \"theme\",\n\tthemes: \"theme\",\n};\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction toStringArray(value: unknown): string[] {\n\tif (!Array.isArray(value)) return [];\n\treturn value\n\t\t.filter((item): item is string => typeof item === \"string\")\n\t\t.map((item) => item.trim())\n\t\t.filter(Boolean);\n}\n\nfunction toOptionalString(value: unknown): string | undefined {\n\tif (typeof value !== \"string\") return undefined;\n\tconst trimmed = value.trim();\n\treturn trimmed.length > 0 ? trimmed : undefined;\n}\n\nfunction readManifestRecord(pkgJson: unknown): { key: GalleryManifestKey; manifest: Record<string, unknown> } | null {\n\tif (!isRecord(pkgJson)) return null;\n\tif (isRecord(pkgJson.omk)) return { key: \"omk\", manifest: pkgJson.omk };\n\tif (isRecord(pkgJson.pi)) return { key: \"pi\", manifest: pkgJson.pi };\n\treturn null;\n}\n\nexport function normalizeGalleryManifest(pkgJson: unknown): NormalizedGalleryManifest | null {\n\tconst source = readManifestRecord(pkgJson);\n\tif (!source) return null;\n\n\treturn {\n\t\tmanifestKey: source.key,\n\t\textensions: toStringArray(source.manifest.extensions),\n\t\tskills: toStringArray(source.manifest.skills),\n\t\tprompts: toStringArray(source.manifest.prompts),\n\t\tthemes: toStringArray(source.manifest.themes),\n\t\tvideo: toOptionalString(source.manifest.video),\n\t\timage: toOptionalString(source.manifest.image),\n\t\tdescription: toOptionalString(source.manifest.description),\n\t};\n}\n\nexport function hasGalleryKeyword(pkgJson: unknown): boolean {\n\tif (!isRecord(pkgJson) || !Array.isArray(pkgJson.keywords)) return false;\n\treturn pkgJson.keywords.some((keyword) => keyword === \"omk-package\" || keyword === \"pi-package\");\n}\n\nfunction hasManifestResources(manifest: NormalizedGalleryManifest | null, type: GalleryResourceType): boolean {\n\tif (!manifest) return false;\n\tif (type === \"extension\") return manifest.extensions.length > 0;\n\tif (type === \"skill\") return manifest.skills.length > 0;\n\tif (type === \"prompt\") return manifest.prompts.length > 0;\n\treturn manifest.themes.length > 0;\n}\n\nexport function resolveGalleryTypeFacet(facet: string | undefined): GalleryResourceType | undefined {\n\tif (!facet) return undefined;\n\treturn FACET_ALIASES[facet.trim().toLowerCase()];\n}\n\nexport function classifyGalleryResourceTypes(\n\tmanifest: NormalizedGalleryManifest | null,\n\tconventionDirs: readonly string[] = [],\n): GalleryResourceType[] {\n\tconst types = new Set<GalleryResourceType>();\n\tfor (const type of RESOURCE_ORDER) {\n\t\tif (hasManifestResources(manifest, type)) types.add(type);\n\t}\n\tfor (const dir of conventionDirs) {\n\t\tconst firstSegment = dir.trim().replace(/\\\\/g, \"/\").split(\"/\").filter(Boolean)[0];\n\t\tconst type = resolveGalleryTypeFacet(firstSegment);\n\t\tif (type) types.add(type);\n\t}\n\treturn RESOURCE_ORDER.filter((type) => types.has(type));\n}\n\nexport function filterGalleryEntriesByType<T extends GalleryTypedEntry>(\n\tentries: readonly T[],\n\tfacet: string | undefined,\n): T[] {\n\tif (facet === undefined) return [...entries];\n\tconst type = resolveGalleryTypeFacet(facet);\n\tif (!type) return [];\n\treturn entries.filter((entry) => entry.resourceTypes.includes(type));\n}\n\nfunction parseAllowedGalleryUrl(url: string | undefined): URL | null {\n\tif (!url) return null;\n\tif (/[\\s\\u0000-\\u001f\\u007f]/.test(url)) return null;\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.protocol !== \"https:\") return null;\n\t\tif (parsed.username || parsed.password) return null;\n\t\tif (parsed.port) return null;\n\t\treturn parsed;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\nexport function isValidGalleryVideoUrl(url: string | undefined): boolean {\n\tconst parsed = parseAllowedGalleryUrl(url);\n\treturn parsed ? parsed.pathname.toLowerCase().endsWith(\".mp4\") : false;\n}\n\nexport function isValidGalleryImageUrl(url: string | undefined): boolean {\n\tconst parsed = parseAllowedGalleryUrl(url);\n\treturn parsed ? IMAGE_EXTENSIONS.some((extension) => parsed.pathname.toLowerCase().endsWith(extension)) : false;\n}\n\nexport function selectGalleryPreview(input: GalleryPreviewInput): GalleryPreviewSelection | null {\n\tif (isValidGalleryVideoUrl(input.video)) return { kind: \"video\", url: input.video };\n\tif (isValidGalleryImageUrl(input.image)) return { kind: \"image\", url: input.image };\n\tif (input.resourceTypes.includes(\"theme\")) {\n\t\tconst marker = input.themeName?.trim() || \"theme\";\n\t\treturn { kind: \"generated-theme\", marker };\n\t}\n\treturn null;\n}\n\nfunction isPathInsideRoot(root: string, candidate: string): boolean {\n\tconst rel = relative(root, candidate);\n\treturn rel === \"\" || (rel !== \"..\" && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));\n}\n\nfunction realpathIfPossible(path: string): string {\n\ttry {\n\t\treturn realpathSync(path);\n\t} catch {\n\t\treturn resolve(path);\n\t}\n}\n\nexport function isPathInsideRootByRealpath(packageRoot: string, candidatePath: string): boolean {\n\tconst root = resolve(packageRoot);\n\tconst candidate = resolve(candidatePath);\n\tif (!isPathInsideRoot(root, candidate)) return false;\n\tif (!existsSync(candidate)) return true;\n\treturn isPathInsideRoot(realpathIfPossible(root), realpathIfPossible(candidate));\n}\n\nexport function resolveManifestEntryInsideRoot(\n\tpackageRoot: string,\n\tentry: string,\n\tbaseDir = packageRoot,\n): string | undefined {\n\tconst trimmed = entry.trim();\n\tif (!trimmed || isAbsolute(trimmed)) return undefined;\n\tconst root = resolve(packageRoot);\n\tconst base = resolve(baseDir);\n\tif (!isPathInsideRootByRealpath(root, base)) return undefined;\n\tconst candidate = resolve(base, trimmed);\n\tif (!isPathInsideRootByRealpath(root, candidate)) return undefined;\n\treturn (relative(root, candidate) || \".\").replace(/\\\\/g, \"/\");\n}\n\nexport function filterManifestEntriesInsideRoot(packageRoot: string, entries: readonly string[]): string[] {\n\tconst safeEntries: string[] = [];\n\tfor (const entry of entries) {\n\t\tconst safeEntry = resolveManifestEntryInsideRoot(packageRoot, entry);\n\t\tif (safeEntry && safeEntry !== \".\") {\n\t\t\tsafeEntries.push(safeEntry);\n\t\t}\n\t}\n\treturn safeEntries;\n}\n\nfunction requireNonEmpty(value: string, label: string): string {\n\tconst trimmed = value.trim();\n\tif (!trimmed) throw new Error(`${label} must not be empty`);\n\treturn trimmed;\n}\n\nfunction buildGallerySource(source: GalleryInstallSource): { kind: GalleryInstallSourceKind; source: string } {\n\tif (source.kind === \"npm\") {\n\t\tconst name = requireNonEmpty(source.name, \"npm package name\");\n\t\tconst versionVerdict = validateExactNpmVersion(source.version);\n\t\tif (!versionVerdict.ok) {\n\t\t\tthrow new Error(\n\t\t\t\t`Gallery npm installs require an exact pinned version for ${name}. ${versionVerdict.message}.`,\n\t\t\t);\n\t\t}\n\t\treturn { kind: \"npm\", source: `npm:${name}@${versionVerdict.version}` };\n\t}\n\tif (source.kind === \"git\") {\n\t\tconst repo = requireNonEmpty(source.repo, \"git repository\").replace(/^git:/, \"\");\n\t\tconst refVerdict = validateGitRef(source.ref);\n\t\tif (!refVerdict.ok) {\n\t\t\tthrow new Error(`Gallery git installs require a full commit SHA for ${repo}. ${refVerdict.message}.`);\n\t\t}\n\t\treturn { kind: \"git\", source: `git:${repo}@${refVerdict.commit}` };\n\t}\n\treturn { kind: \"local\", source: requireNonEmpty(source.path, \"local path\") };\n}\n\nexport function buildGalleryInstallSpec(\n\tinput: GalleryInstallSource,\n\thasExtension: boolean,\n\toptions: GalleryInstallOptions = {},\n): GalleryInstallSpec {\n\tconst source = buildGallerySource(input);\n\tconst localFlag = options.local ? \" -l\" : \"\";\n\treturn {\n\t\tkind: source.kind,\n\t\tsource: source.source,\n\t\tinstallCommand: `omk install ${source.source}${localFlag}`,\n\t\ttryEphemeralCommand: `omk -e ${source.source}`,\n\t\ttrust: hasExtension ? \"code-execution\" : \"declarative\",\n\t};\n}\n\nfunction stripComments(sourceText: string, stripStrings: boolean): string {\n\tlet output = \"\";\n\tlet index = 0;\n\twhile (index < sourceText.length) {\n\t\tconst current = sourceText[index];\n\t\tconst next = sourceText[index + 1];\n\t\tif (current === \"/\" && next === \"/\") {\n\t\t\tindex += 2;\n\t\t\twhile (index < sourceText.length && sourceText[index] !== \"\\n\") index += 1;\n\t\t\toutput += \"\\n\";\n\t\t\tindex += 1;\n\t\t\tcontinue;\n\t\t}\n\t\tif (current === \"/\" && next === \"*\") {\n\t\t\tindex += 2;\n\t\t\twhile (index < sourceText.length && !(sourceText[index] === \"*\" && sourceText[index + 1] === \"/\")) index += 1;\n\t\t\tindex += 2;\n\t\t\toutput += \" \";\n\t\t\tcontinue;\n\t\t}\n\t\tif (stripStrings && (current === '\"' || current === \"'\" || current === \"`\")) {\n\t\t\tconst quote = current;\n\t\t\tindex += 1;\n\t\t\twhile (index < sourceText.length) {\n\t\t\t\tif (sourceText[index] === \"\\\\\") {\n\t\t\t\t\tindex += 2;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (sourceText[index] === quote) {\n\t\t\t\t\tindex += 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tindex += 1;\n\t\t\t}\n\t\t\toutput += \" \";\n\t\t\tcontinue;\n\t\t}\n\t\toutput += current;\n\t\tindex += 1;\n\t}\n\treturn output;\n}\n\nfunction capabilityOrder(badge: ExtensionCapabilityBadge): number {\n\treturn CAPABILITY_ORDER.indexOf(badge);\n}\n\nexport function inferExtensionCapabilityBadges(sourceText: string): ExtensionCapabilityBadge[] {\n\tconst withoutComments = stripComments(sourceText, false);\n\tconst code = stripComments(sourceText, true);\n\tconst badges = new Set<ExtensionCapabilityBadge>();\n\n\tif (/\\bomk\\s*\\.\\s*registerTool\\s*\\(/.test(code)) badges.add(\"tools\");\n\tif (/\\bomk\\s*\\.\\s*registerCommand\\s*\\(/.test(code)) badges.add(\"commands\");\n\tif (/\\bomk\\s*\\.\\s*on\\s*\\(/.test(code) || /\\bregisterHook\\s*\\(/.test(code)) badges.add(\"hooks\");\n\tif (/\\bomk\\s*\\.\\s*registerProvider\\s*\\(/.test(code)) badges.add(\"provider\");\n\tif (\n\t\t/\\bomk\\s*\\.\\s*(registerShortcut|registerFlag|registerMessageRenderer|registerComponent|setFooter)\\s*\\(/.test(code)\n\t) {\n\t\tbadges.add(\"ui\");\n\t}\n\tif (/\\bomk\\s*\\.\\s*on\\s*\\(\\s*([\"'`])(?:session_before_compact|session_compact|context)\\1/.test(withoutComments)) {\n\t\tbadges.add(\"hooks\");\n\t\tbadges.add(\"compaction\");\n\t}\n\n\treturn [...badges].sort((left, right) => capabilityOrder(left) - capabilityOrder(right));\n}\n\nfunction identityKey(identity: GalleryEntryIdentity): string {\n\tif (identity.kind === \"npm\") return `npm:${identity.name.trim().toLowerCase()}`;\n\tif (identity.kind === \"git\") {\n\t\tconst repo = identity.repo\n\t\t\t.trim()\n\t\t\t.replace(/^git:/, \"\")\n\t\t\t.replace(/\\.git$/i, \"\")\n\t\t\t.toLowerCase();\n\t\treturn `git:${repo}`;\n\t}\n\treturn `local:${resolve(identity.path)}`;\n}\n\nexport function dedupeGalleryEntries<T extends GalleryEntryWithIdentity>(entries: readonly T[]): T[] {\n\tconst seen = new Set<string>();\n\tconst result: T[] = [];\n\tfor (const entry of entries) {\n\t\tconst key = identityKey(entry.identity);\n\t\tif (seen.has(key)) continue;\n\t\tseen.add(key);\n\t\tresult.push(entry);\n\t}\n\treturn result;\n}\n\n/**\n * Procurement-derived safe-gate outcome for an unpromoted (ephemeral trial) gallery install.\n *\n * Closes G9: gallery trust is derived from capability scan and procurement verdicts, not\n * from manifest claims. A trial is \"admitted\" only when the source is exact-pinned, carries\n * no hard-block capability (credential reads, host sockets), and passed explicit license,\n * lifecycle, and path-compatibility gates. Procurement rejection reasons are surfaced\n * verbatim so callers can show why an unpromoted trial would be blocked.\n */\nexport type GalleryTrialGateOutcome = \"admitted\" | \"blocked\";\n\nexport interface GalleryTrialGateStatus {\n\treadonly outcome: GalleryTrialGateOutcome;\n\treadonly identity: string;\n\treadonly adoption: Adoption;\n\treadonly pinned: boolean;\n\treadonly reasons: readonly string[];\n}\n\n/**\n * Structural subset of a procurement review consumed by the trial gate. The full procurement\n * review (`ProcurementReview`) satisfies this shape, so callers may pass `procureCandidate(...)`\n * output directly; tests can construct focused reviews without the full procurement input.\n */\nexport interface GalleryTrialGateReview {\n\treadonly pinned: boolean;\n\treadonly capabilities: readonly string[];\n\treadonly adoption: Adoption;\n\treadonly rejectedReasons: readonly string[];\n\treadonly licenseVerdict?: GateVerdict;\n\treadonly lifecycleVerdict?: GateVerdict;\n\treadonly pathCompatibility?: PathCompatibility;\n\treadonly candidate?: { readonly expectedResources?: readonly string[] };\n}\n\nconst TRIAL_HARD_BLOCK_CAPABILITIES: ReadonlySet<string> = new Set([\"credential-read\", \"host-socket\"]);\nconst CODE_EXECUTION_RESOURCES: ReadonlySet<string> = new Set([\"extension\", \"tool\"]);\nconst CODE_EXECUTION_CAPABILITIES: ReadonlySet<string> = new Set([\n\t\"browser-control\",\n\t\"child-process\",\n\t\"credential-read\",\n\t\"filesystem-write\",\n\t\"host-socket\",\n\t\"network\",\n]);\n\nfunction pushUniqueReason(reasons: string[], reason: string): void {\n\tif (!reasons.includes(reason)) reasons.push(reason);\n}\n\n/**\n * Classify whether a candidate package may be safely admitted to an unpromoted (ephemeral,\n * sandboxed, `--ignore-scripts`) trial. Pure and deterministic: identical inputs always\n * produce identical output, and no I/O is performed.\n */\nexport function assessGalleryTrialGate(\n\tidentity: GalleryEntryIdentity,\n\treview: GalleryTrialGateReview,\n): GalleryTrialGateStatus {\n\tconst hardBlocks = review.capabilities.filter((capability) => TRIAL_HARD_BLOCK_CAPABILITIES.has(capability));\n\tconst reasons: string[] = [];\n\tif (!review.pinned) pushUniqueReason(reasons, \"exact-pin-required\");\n\tif (hardBlocks.length > 0) pushUniqueReason(reasons, `capability-hard-block: ${hardBlocks.join(\",\")}`);\n\tif (review.licenseVerdict === \"reject\") pushUniqueReason(reasons, \"license-blocked\");\n\tif (review.lifecycleVerdict === \"reject\") pushUniqueReason(reasons, \"lifecycle-scripts-blocked\");\n\tif (review.pathCompatibility === \"pi-hardcoded\") pushUniqueReason(reasons, \"pi-hardcoded-paths\");\n\tif (review.adoption === \"reject\") {\n\t\tfor (const reason of review.rejectedReasons) pushUniqueReason(reasons, reason);\n\t}\n\n\tconst blocked =\n\t\t!review.pinned ||\n\t\thardBlocks.length > 0 ||\n\t\treview.licenseVerdict === \"reject\" ||\n\t\treview.lifecycleVerdict === \"reject\" ||\n\t\treview.pathCompatibility === \"pi-hardcoded\" ||\n\t\treview.adoption === \"reject\";\n\n\treturn {\n\t\toutcome: blocked ? \"blocked\" : \"admitted\",\n\t\tidentity: identityKey(identity),\n\t\tadoption: review.adoption,\n\t\tpinned: review.pinned,\n\t\treasons,\n\t};\n}\n\nexport function deriveGalleryInstallTrustFromReview(review: GalleryTrialGateReview): GalleryInstallTrust {\n\tconst expectedResources = review.candidate?.expectedResources ?? [];\n\tif (expectedResources.some((resource) => CODE_EXECUTION_RESOURCES.has(resource))) return \"code-execution\";\n\tif (review.capabilities.some((capability) => CODE_EXECUTION_CAPABILITIES.has(capability))) return \"code-execution\";\n\treturn \"declarative\";\n}\n\nexport function buildGalleryInstallSpecFromReview(\n\tinput: GalleryInstallSource,\n\treview: GalleryTrialGateReview,\n\toptions: GalleryInstallOptions = {},\n): GalleryInstallSpec {\n\tconst spec = buildGalleryInstallSpec(input, false, options);\n\tconst gate = assessGalleryTrialGate(galleryIdentityFromInstallSource(input), review);\n\tif (gate.outcome === \"blocked\") {\n\t\tthrow new Error(`Gallery trial blocked for ${gate.identity}: ${gate.reasons.join(\", \")}`);\n\t}\n\treturn { ...spec, trust: deriveGalleryInstallTrustFromReview(review) };\n}\n\nfunction galleryIdentityFromInstallSource(input: GalleryInstallSource): GalleryEntryIdentity {\n\tif (input.kind === \"npm\") return { kind: \"npm\", name: input.name };\n\tif (input.kind === \"git\") return { kind: \"git\", repo: input.repo, ref: input.ref };\n\treturn { kind: \"local\", path: input.path };\n}\n"]}
|