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,392 @@
|
|
|
1
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, relative, resolve, sep } from "node:path";
|
|
3
|
+
import { validateExactNpmVersion, validateGitRef, } from "./package-procurement.js";
|
|
4
|
+
const RESOURCE_ORDER = ["extension", "skill", "prompt", "theme"];
|
|
5
|
+
const CAPABILITY_ORDER = [
|
|
6
|
+
"tools",
|
|
7
|
+
"commands",
|
|
8
|
+
"hooks",
|
|
9
|
+
"provider",
|
|
10
|
+
"ui",
|
|
11
|
+
"compaction",
|
|
12
|
+
];
|
|
13
|
+
const IMAGE_EXTENSIONS = [".png", ".jpg", ".jpeg", ".gif", ".webp"];
|
|
14
|
+
const FACET_ALIASES = {
|
|
15
|
+
extension: "extension",
|
|
16
|
+
extensions: "extension",
|
|
17
|
+
skill: "skill",
|
|
18
|
+
skills: "skill",
|
|
19
|
+
prompt: "prompt",
|
|
20
|
+
prompts: "prompt",
|
|
21
|
+
theme: "theme",
|
|
22
|
+
themes: "theme",
|
|
23
|
+
};
|
|
24
|
+
function isRecord(value) {
|
|
25
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26
|
+
}
|
|
27
|
+
function toStringArray(value) {
|
|
28
|
+
if (!Array.isArray(value))
|
|
29
|
+
return [];
|
|
30
|
+
return value
|
|
31
|
+
.filter((item) => typeof item === "string")
|
|
32
|
+
.map((item) => item.trim())
|
|
33
|
+
.filter(Boolean);
|
|
34
|
+
}
|
|
35
|
+
function toOptionalString(value) {
|
|
36
|
+
if (typeof value !== "string")
|
|
37
|
+
return undefined;
|
|
38
|
+
const trimmed = value.trim();
|
|
39
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
40
|
+
}
|
|
41
|
+
function readManifestRecord(pkgJson) {
|
|
42
|
+
if (!isRecord(pkgJson))
|
|
43
|
+
return null;
|
|
44
|
+
if (isRecord(pkgJson.omk))
|
|
45
|
+
return { key: "omk", manifest: pkgJson.omk };
|
|
46
|
+
if (isRecord(pkgJson.pi))
|
|
47
|
+
return { key: "pi", manifest: pkgJson.pi };
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
export function normalizeGalleryManifest(pkgJson) {
|
|
51
|
+
const source = readManifestRecord(pkgJson);
|
|
52
|
+
if (!source)
|
|
53
|
+
return null;
|
|
54
|
+
return {
|
|
55
|
+
manifestKey: source.key,
|
|
56
|
+
extensions: toStringArray(source.manifest.extensions),
|
|
57
|
+
skills: toStringArray(source.manifest.skills),
|
|
58
|
+
prompts: toStringArray(source.manifest.prompts),
|
|
59
|
+
themes: toStringArray(source.manifest.themes),
|
|
60
|
+
video: toOptionalString(source.manifest.video),
|
|
61
|
+
image: toOptionalString(source.manifest.image),
|
|
62
|
+
description: toOptionalString(source.manifest.description),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function hasGalleryKeyword(pkgJson) {
|
|
66
|
+
if (!isRecord(pkgJson) || !Array.isArray(pkgJson.keywords))
|
|
67
|
+
return false;
|
|
68
|
+
return pkgJson.keywords.some((keyword) => keyword === "omk-package" || keyword === "pi-package");
|
|
69
|
+
}
|
|
70
|
+
function hasManifestResources(manifest, type) {
|
|
71
|
+
if (!manifest)
|
|
72
|
+
return false;
|
|
73
|
+
if (type === "extension")
|
|
74
|
+
return manifest.extensions.length > 0;
|
|
75
|
+
if (type === "skill")
|
|
76
|
+
return manifest.skills.length > 0;
|
|
77
|
+
if (type === "prompt")
|
|
78
|
+
return manifest.prompts.length > 0;
|
|
79
|
+
return manifest.themes.length > 0;
|
|
80
|
+
}
|
|
81
|
+
export function resolveGalleryTypeFacet(facet) {
|
|
82
|
+
if (!facet)
|
|
83
|
+
return undefined;
|
|
84
|
+
return FACET_ALIASES[facet.trim().toLowerCase()];
|
|
85
|
+
}
|
|
86
|
+
export function classifyGalleryResourceTypes(manifest, conventionDirs = []) {
|
|
87
|
+
const types = new Set();
|
|
88
|
+
for (const type of RESOURCE_ORDER) {
|
|
89
|
+
if (hasManifestResources(manifest, type))
|
|
90
|
+
types.add(type);
|
|
91
|
+
}
|
|
92
|
+
for (const dir of conventionDirs) {
|
|
93
|
+
const firstSegment = dir.trim().replace(/\\/g, "/").split("/").filter(Boolean)[0];
|
|
94
|
+
const type = resolveGalleryTypeFacet(firstSegment);
|
|
95
|
+
if (type)
|
|
96
|
+
types.add(type);
|
|
97
|
+
}
|
|
98
|
+
return RESOURCE_ORDER.filter((type) => types.has(type));
|
|
99
|
+
}
|
|
100
|
+
export function filterGalleryEntriesByType(entries, facet) {
|
|
101
|
+
if (facet === undefined)
|
|
102
|
+
return [...entries];
|
|
103
|
+
const type = resolveGalleryTypeFacet(facet);
|
|
104
|
+
if (!type)
|
|
105
|
+
return [];
|
|
106
|
+
return entries.filter((entry) => entry.resourceTypes.includes(type));
|
|
107
|
+
}
|
|
108
|
+
function parseAllowedGalleryUrl(url) {
|
|
109
|
+
if (!url)
|
|
110
|
+
return null;
|
|
111
|
+
if (/[\s\u0000-\u001f\u007f]/.test(url))
|
|
112
|
+
return null;
|
|
113
|
+
try {
|
|
114
|
+
const parsed = new URL(url);
|
|
115
|
+
if (parsed.protocol !== "https:")
|
|
116
|
+
return null;
|
|
117
|
+
if (parsed.username || parsed.password)
|
|
118
|
+
return null;
|
|
119
|
+
if (parsed.port)
|
|
120
|
+
return null;
|
|
121
|
+
return parsed;
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
export function isValidGalleryVideoUrl(url) {
|
|
128
|
+
const parsed = parseAllowedGalleryUrl(url);
|
|
129
|
+
return parsed ? parsed.pathname.toLowerCase().endsWith(".mp4") : false;
|
|
130
|
+
}
|
|
131
|
+
export function isValidGalleryImageUrl(url) {
|
|
132
|
+
const parsed = parseAllowedGalleryUrl(url);
|
|
133
|
+
return parsed ? IMAGE_EXTENSIONS.some((extension) => parsed.pathname.toLowerCase().endsWith(extension)) : false;
|
|
134
|
+
}
|
|
135
|
+
export function selectGalleryPreview(input) {
|
|
136
|
+
if (isValidGalleryVideoUrl(input.video))
|
|
137
|
+
return { kind: "video", url: input.video };
|
|
138
|
+
if (isValidGalleryImageUrl(input.image))
|
|
139
|
+
return { kind: "image", url: input.image };
|
|
140
|
+
if (input.resourceTypes.includes("theme")) {
|
|
141
|
+
const marker = input.themeName?.trim() || "theme";
|
|
142
|
+
return { kind: "generated-theme", marker };
|
|
143
|
+
}
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
function isPathInsideRoot(root, candidate) {
|
|
147
|
+
const rel = relative(root, candidate);
|
|
148
|
+
return rel === "" || (rel !== ".." && !rel.startsWith(`..${sep}`) && !isAbsolute(rel));
|
|
149
|
+
}
|
|
150
|
+
function realpathIfPossible(path) {
|
|
151
|
+
try {
|
|
152
|
+
return realpathSync(path);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return resolve(path);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
export function isPathInsideRootByRealpath(packageRoot, candidatePath) {
|
|
159
|
+
const root = resolve(packageRoot);
|
|
160
|
+
const candidate = resolve(candidatePath);
|
|
161
|
+
if (!isPathInsideRoot(root, candidate))
|
|
162
|
+
return false;
|
|
163
|
+
if (!existsSync(candidate))
|
|
164
|
+
return true;
|
|
165
|
+
return isPathInsideRoot(realpathIfPossible(root), realpathIfPossible(candidate));
|
|
166
|
+
}
|
|
167
|
+
export function resolveManifestEntryInsideRoot(packageRoot, entry, baseDir = packageRoot) {
|
|
168
|
+
const trimmed = entry.trim();
|
|
169
|
+
if (!trimmed || isAbsolute(trimmed))
|
|
170
|
+
return undefined;
|
|
171
|
+
const root = resolve(packageRoot);
|
|
172
|
+
const base = resolve(baseDir);
|
|
173
|
+
if (!isPathInsideRootByRealpath(root, base))
|
|
174
|
+
return undefined;
|
|
175
|
+
const candidate = resolve(base, trimmed);
|
|
176
|
+
if (!isPathInsideRootByRealpath(root, candidate))
|
|
177
|
+
return undefined;
|
|
178
|
+
return (relative(root, candidate) || ".").replace(/\\/g, "/");
|
|
179
|
+
}
|
|
180
|
+
export function filterManifestEntriesInsideRoot(packageRoot, entries) {
|
|
181
|
+
const safeEntries = [];
|
|
182
|
+
for (const entry of entries) {
|
|
183
|
+
const safeEntry = resolveManifestEntryInsideRoot(packageRoot, entry);
|
|
184
|
+
if (safeEntry && safeEntry !== ".") {
|
|
185
|
+
safeEntries.push(safeEntry);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return safeEntries;
|
|
189
|
+
}
|
|
190
|
+
function requireNonEmpty(value, label) {
|
|
191
|
+
const trimmed = value.trim();
|
|
192
|
+
if (!trimmed)
|
|
193
|
+
throw new Error(`${label} must not be empty`);
|
|
194
|
+
return trimmed;
|
|
195
|
+
}
|
|
196
|
+
function buildGallerySource(source) {
|
|
197
|
+
if (source.kind === "npm") {
|
|
198
|
+
const name = requireNonEmpty(source.name, "npm package name");
|
|
199
|
+
const versionVerdict = validateExactNpmVersion(source.version);
|
|
200
|
+
if (!versionVerdict.ok) {
|
|
201
|
+
throw new Error(`Gallery npm installs require an exact pinned version for ${name}. ${versionVerdict.message}.`);
|
|
202
|
+
}
|
|
203
|
+
return { kind: "npm", source: `npm:${name}@${versionVerdict.version}` };
|
|
204
|
+
}
|
|
205
|
+
if (source.kind === "git") {
|
|
206
|
+
const repo = requireNonEmpty(source.repo, "git repository").replace(/^git:/, "");
|
|
207
|
+
const refVerdict = validateGitRef(source.ref);
|
|
208
|
+
if (!refVerdict.ok) {
|
|
209
|
+
throw new Error(`Gallery git installs require a full commit SHA for ${repo}. ${refVerdict.message}.`);
|
|
210
|
+
}
|
|
211
|
+
return { kind: "git", source: `git:${repo}@${refVerdict.commit}` };
|
|
212
|
+
}
|
|
213
|
+
return { kind: "local", source: requireNonEmpty(source.path, "local path") };
|
|
214
|
+
}
|
|
215
|
+
export function buildGalleryInstallSpec(input, hasExtension, options = {}) {
|
|
216
|
+
const source = buildGallerySource(input);
|
|
217
|
+
const localFlag = options.local ? " -l" : "";
|
|
218
|
+
return {
|
|
219
|
+
kind: source.kind,
|
|
220
|
+
source: source.source,
|
|
221
|
+
installCommand: `omk install ${source.source}${localFlag}`,
|
|
222
|
+
tryEphemeralCommand: `omk -e ${source.source}`,
|
|
223
|
+
trust: hasExtension ? "code-execution" : "declarative",
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
function stripComments(sourceText, stripStrings) {
|
|
227
|
+
let output = "";
|
|
228
|
+
let index = 0;
|
|
229
|
+
while (index < sourceText.length) {
|
|
230
|
+
const current = sourceText[index];
|
|
231
|
+
const next = sourceText[index + 1];
|
|
232
|
+
if (current === "/" && next === "/") {
|
|
233
|
+
index += 2;
|
|
234
|
+
while (index < sourceText.length && sourceText[index] !== "\n")
|
|
235
|
+
index += 1;
|
|
236
|
+
output += "\n";
|
|
237
|
+
index += 1;
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
if (current === "/" && next === "*") {
|
|
241
|
+
index += 2;
|
|
242
|
+
while (index < sourceText.length && !(sourceText[index] === "*" && sourceText[index + 1] === "/"))
|
|
243
|
+
index += 1;
|
|
244
|
+
index += 2;
|
|
245
|
+
output += " ";
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
if (stripStrings && (current === '"' || current === "'" || current === "`")) {
|
|
249
|
+
const quote = current;
|
|
250
|
+
index += 1;
|
|
251
|
+
while (index < sourceText.length) {
|
|
252
|
+
if (sourceText[index] === "\\") {
|
|
253
|
+
index += 2;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
if (sourceText[index] === quote) {
|
|
257
|
+
index += 1;
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
index += 1;
|
|
261
|
+
}
|
|
262
|
+
output += " ";
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
output += current;
|
|
266
|
+
index += 1;
|
|
267
|
+
}
|
|
268
|
+
return output;
|
|
269
|
+
}
|
|
270
|
+
function capabilityOrder(badge) {
|
|
271
|
+
return CAPABILITY_ORDER.indexOf(badge);
|
|
272
|
+
}
|
|
273
|
+
export function inferExtensionCapabilityBadges(sourceText) {
|
|
274
|
+
const withoutComments = stripComments(sourceText, false);
|
|
275
|
+
const code = stripComments(sourceText, true);
|
|
276
|
+
const badges = new Set();
|
|
277
|
+
if (/\bomk\s*\.\s*registerTool\s*\(/.test(code))
|
|
278
|
+
badges.add("tools");
|
|
279
|
+
if (/\bomk\s*\.\s*registerCommand\s*\(/.test(code))
|
|
280
|
+
badges.add("commands");
|
|
281
|
+
if (/\bomk\s*\.\s*on\s*\(/.test(code) || /\bregisterHook\s*\(/.test(code))
|
|
282
|
+
badges.add("hooks");
|
|
283
|
+
if (/\bomk\s*\.\s*registerProvider\s*\(/.test(code))
|
|
284
|
+
badges.add("provider");
|
|
285
|
+
if (/\bomk\s*\.\s*(registerShortcut|registerFlag|registerMessageRenderer|registerComponent|setFooter)\s*\(/.test(code)) {
|
|
286
|
+
badges.add("ui");
|
|
287
|
+
}
|
|
288
|
+
if (/\bomk\s*\.\s*on\s*\(\s*(["'`])(?:session_before_compact|session_compact|context)\1/.test(withoutComments)) {
|
|
289
|
+
badges.add("hooks");
|
|
290
|
+
badges.add("compaction");
|
|
291
|
+
}
|
|
292
|
+
return [...badges].sort((left, right) => capabilityOrder(left) - capabilityOrder(right));
|
|
293
|
+
}
|
|
294
|
+
function identityKey(identity) {
|
|
295
|
+
if (identity.kind === "npm")
|
|
296
|
+
return `npm:${identity.name.trim().toLowerCase()}`;
|
|
297
|
+
if (identity.kind === "git") {
|
|
298
|
+
const repo = identity.repo
|
|
299
|
+
.trim()
|
|
300
|
+
.replace(/^git:/, "")
|
|
301
|
+
.replace(/\.git$/i, "")
|
|
302
|
+
.toLowerCase();
|
|
303
|
+
return `git:${repo}`;
|
|
304
|
+
}
|
|
305
|
+
return `local:${resolve(identity.path)}`;
|
|
306
|
+
}
|
|
307
|
+
export function dedupeGalleryEntries(entries) {
|
|
308
|
+
const seen = new Set();
|
|
309
|
+
const result = [];
|
|
310
|
+
for (const entry of entries) {
|
|
311
|
+
const key = identityKey(entry.identity);
|
|
312
|
+
if (seen.has(key))
|
|
313
|
+
continue;
|
|
314
|
+
seen.add(key);
|
|
315
|
+
result.push(entry);
|
|
316
|
+
}
|
|
317
|
+
return result;
|
|
318
|
+
}
|
|
319
|
+
const TRIAL_HARD_BLOCK_CAPABILITIES = new Set(["credential-read", "host-socket"]);
|
|
320
|
+
const CODE_EXECUTION_RESOURCES = new Set(["extension", "tool"]);
|
|
321
|
+
const CODE_EXECUTION_CAPABILITIES = new Set([
|
|
322
|
+
"browser-control",
|
|
323
|
+
"child-process",
|
|
324
|
+
"credential-read",
|
|
325
|
+
"filesystem-write",
|
|
326
|
+
"host-socket",
|
|
327
|
+
"network",
|
|
328
|
+
]);
|
|
329
|
+
function pushUniqueReason(reasons, reason) {
|
|
330
|
+
if (!reasons.includes(reason))
|
|
331
|
+
reasons.push(reason);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Classify whether a candidate package may be safely admitted to an unpromoted (ephemeral,
|
|
335
|
+
* sandboxed, `--ignore-scripts`) trial. Pure and deterministic: identical inputs always
|
|
336
|
+
* produce identical output, and no I/O is performed.
|
|
337
|
+
*/
|
|
338
|
+
export function assessGalleryTrialGate(identity, review) {
|
|
339
|
+
const hardBlocks = review.capabilities.filter((capability) => TRIAL_HARD_BLOCK_CAPABILITIES.has(capability));
|
|
340
|
+
const reasons = [];
|
|
341
|
+
if (!review.pinned)
|
|
342
|
+
pushUniqueReason(reasons, "exact-pin-required");
|
|
343
|
+
if (hardBlocks.length > 0)
|
|
344
|
+
pushUniqueReason(reasons, `capability-hard-block: ${hardBlocks.join(",")}`);
|
|
345
|
+
if (review.licenseVerdict === "reject")
|
|
346
|
+
pushUniqueReason(reasons, "license-blocked");
|
|
347
|
+
if (review.lifecycleVerdict === "reject")
|
|
348
|
+
pushUniqueReason(reasons, "lifecycle-scripts-blocked");
|
|
349
|
+
if (review.pathCompatibility === "pi-hardcoded")
|
|
350
|
+
pushUniqueReason(reasons, "pi-hardcoded-paths");
|
|
351
|
+
if (review.adoption === "reject") {
|
|
352
|
+
for (const reason of review.rejectedReasons)
|
|
353
|
+
pushUniqueReason(reasons, reason);
|
|
354
|
+
}
|
|
355
|
+
const blocked = !review.pinned ||
|
|
356
|
+
hardBlocks.length > 0 ||
|
|
357
|
+
review.licenseVerdict === "reject" ||
|
|
358
|
+
review.lifecycleVerdict === "reject" ||
|
|
359
|
+
review.pathCompatibility === "pi-hardcoded" ||
|
|
360
|
+
review.adoption === "reject";
|
|
361
|
+
return {
|
|
362
|
+
outcome: blocked ? "blocked" : "admitted",
|
|
363
|
+
identity: identityKey(identity),
|
|
364
|
+
adoption: review.adoption,
|
|
365
|
+
pinned: review.pinned,
|
|
366
|
+
reasons,
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
export function deriveGalleryInstallTrustFromReview(review) {
|
|
370
|
+
const expectedResources = review.candidate?.expectedResources ?? [];
|
|
371
|
+
if (expectedResources.some((resource) => CODE_EXECUTION_RESOURCES.has(resource)))
|
|
372
|
+
return "code-execution";
|
|
373
|
+
if (review.capabilities.some((capability) => CODE_EXECUTION_CAPABILITIES.has(capability)))
|
|
374
|
+
return "code-execution";
|
|
375
|
+
return "declarative";
|
|
376
|
+
}
|
|
377
|
+
export function buildGalleryInstallSpecFromReview(input, review, options = {}) {
|
|
378
|
+
const spec = buildGalleryInstallSpec(input, false, options);
|
|
379
|
+
const gate = assessGalleryTrialGate(galleryIdentityFromInstallSource(input), review);
|
|
380
|
+
if (gate.outcome === "blocked") {
|
|
381
|
+
throw new Error(`Gallery trial blocked for ${gate.identity}: ${gate.reasons.join(", ")}`);
|
|
382
|
+
}
|
|
383
|
+
return { ...spec, trust: deriveGalleryInstallTrustFromReview(review) };
|
|
384
|
+
}
|
|
385
|
+
function galleryIdentityFromInstallSource(input) {
|
|
386
|
+
if (input.kind === "npm")
|
|
387
|
+
return { kind: "npm", name: input.name };
|
|
388
|
+
if (input.kind === "git")
|
|
389
|
+
return { kind: "git", repo: input.repo, ref: input.ref };
|
|
390
|
+
return { kind: "local", path: input.path };
|
|
391
|
+
}
|
|
392
|
+
//# sourceMappingURL=package-gallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-gallery.js","sourceRoot":"","sources":["../../src/core/package-gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAIN,uBAAuB,EACvB,cAAc,GACd,MAAM,0BAA0B,CAAC;AA+DlC,MAAM,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} 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"]}
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
+
import { type TrialAuditRecord } from "./package-trial-runtime.ts";
|
|
2
|
+
import type { SandboxBackendStatus, SandboxPathResolver, SandboxPolicy } from "./sandbox/policy.ts";
|
|
1
3
|
import type { SettingsManager } from "./settings-manager.ts";
|
|
4
|
+
export declare function buildGitDependencyInstallArgs(hasConfiguredNpmCommand: boolean, allowScripts?: boolean): string[];
|
|
5
|
+
export declare function buildNpmInstallArgs(packageManagerName: string, specs: string[], installRoot: string, allowScripts?: boolean): string[];
|
|
6
|
+
/**
|
|
7
|
+
* Exact-match membership for npm install units. Returns true only when the install unit is non-empty and
|
|
8
|
+
* EVERY top-level spec is listed (by `npm:<name>` identity or `npm:<spec>`). Mixed/partial lists stay false
|
|
9
|
+
* so a single unlisted spec keeps the whole install fail-closed under --ignore-scripts.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isNpmInstallAllowed(specs: string[], allowList: readonly string[]): boolean;
|
|
12
|
+
/** Exact-match membership for a git install unit by `git:<host>/<path>` identity or `...@<ref>` spec. */
|
|
13
|
+
export declare function isGitInstallAllowed(source: {
|
|
14
|
+
host: string;
|
|
15
|
+
path: string;
|
|
16
|
+
ref?: string;
|
|
17
|
+
}, allowList: readonly string[]): boolean;
|
|
18
|
+
export type InstallAllowScriptResolution = {
|
|
19
|
+
ok: true;
|
|
20
|
+
entry: string;
|
|
21
|
+
} | {
|
|
22
|
+
ok: false;
|
|
23
|
+
expected: string[];
|
|
24
|
+
};
|
|
2
25
|
export interface PathMetadata {
|
|
3
26
|
source: string;
|
|
4
27
|
scope: SourceScope;
|
|
@@ -44,9 +67,11 @@ export interface PackageManager {
|
|
|
44
67
|
resolve(onMissing?: (source: string) => Promise<MissingSourceAction>): Promise<ResolvedPaths>;
|
|
45
68
|
install(source: string, options?: {
|
|
46
69
|
local?: boolean;
|
|
70
|
+
resolvedCommit?: string;
|
|
47
71
|
}): Promise<void>;
|
|
48
72
|
installAndPersist(source: string, options?: {
|
|
49
73
|
local?: boolean;
|
|
74
|
+
resolvedCommit?: string;
|
|
50
75
|
}): Promise<void>;
|
|
51
76
|
remove(source: string, options?: {
|
|
52
77
|
local?: boolean;
|
|
@@ -67,12 +92,22 @@ export interface PackageManager {
|
|
|
67
92
|
local?: boolean;
|
|
68
93
|
}): boolean;
|
|
69
94
|
setProgressCallback(callback: ProgressCallback | undefined): void;
|
|
95
|
+
cleanupTemporaryTrialInstalls(): void;
|
|
70
96
|
getInstalledPath(source: string, scope: "user" | "project"): string | undefined;
|
|
97
|
+
resolveInstallAllowScriptEntry(source: string, requested: string): InstallAllowScriptResolution;
|
|
98
|
+
}
|
|
99
|
+
export interface PackageTrialRuntimeOptions {
|
|
100
|
+
readonly policy: SandboxPolicy;
|
|
101
|
+
readonly backend?: SandboxBackendStatus;
|
|
102
|
+
readonly resolver?: SandboxPathResolver;
|
|
103
|
+
readonly env?: () => NodeJS.ProcessEnv;
|
|
104
|
+
readonly onAudit?: (record: TrialAuditRecord) => void;
|
|
71
105
|
}
|
|
72
106
|
interface PackageManagerOptions {
|
|
73
107
|
cwd: string;
|
|
74
108
|
agentDir: string;
|
|
75
109
|
settingsManager: SettingsManager;
|
|
110
|
+
trialRuntime?: PackageTrialRuntimeOptions;
|
|
76
111
|
}
|
|
77
112
|
type SourceScope = "user" | "project" | "temporary";
|
|
78
113
|
export declare function getExtensionTempFolder(agentDir: string): string;
|
|
@@ -80,11 +115,14 @@ export declare class DefaultPackageManager implements PackageManager {
|
|
|
80
115
|
private cwd;
|
|
81
116
|
private agentDir;
|
|
82
117
|
private settingsManager;
|
|
118
|
+
private trialRuntime;
|
|
119
|
+
private trialCleanups;
|
|
83
120
|
private globalNpmRoot;
|
|
84
121
|
private globalNpmRootCommandKey;
|
|
85
122
|
private progressCallback;
|
|
86
123
|
constructor(options: PackageManagerOptions);
|
|
87
124
|
setProgressCallback(callback: ProgressCallback | undefined): void;
|
|
125
|
+
cleanupTemporaryTrialInstalls(): void;
|
|
88
126
|
addSourceToSettings(source: string, options?: {
|
|
89
127
|
local?: boolean;
|
|
90
128
|
}): boolean;
|
|
@@ -94,6 +132,7 @@ export declare class DefaultPackageManager implements PackageManager {
|
|
|
94
132
|
getInstalledPath(source: string, scope: "user" | "project"): string | undefined;
|
|
95
133
|
private emitProgress;
|
|
96
134
|
private withProgress;
|
|
135
|
+
private cleanupTrialInstall;
|
|
97
136
|
resolve(onMissing?: (source: string) => Promise<MissingSourceAction>): Promise<ResolvedPaths>;
|
|
98
137
|
resolveExtensionSources(sources: string[], options?: {
|
|
99
138
|
local?: boolean;
|
|
@@ -102,10 +141,27 @@ export declare class DefaultPackageManager implements PackageManager {
|
|
|
102
141
|
listConfiguredPackages(): ConfiguredPackage[];
|
|
103
142
|
install(source: string, options?: {
|
|
104
143
|
local?: boolean;
|
|
144
|
+
resolvedCommit?: string;
|
|
105
145
|
}): Promise<void>;
|
|
106
146
|
installAndPersist(source: string, options?: {
|
|
107
147
|
local?: boolean;
|
|
148
|
+
resolvedCommit?: string;
|
|
108
149
|
}): Promise<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Procurement admission gate for explicit installs (and installAndPersist via install()).
|
|
152
|
+
*
|
|
153
|
+
* Pure check: no fetch, clone, npm install, or other dependency-install side effect. It reuses the
|
|
154
|
+
* native procurement validators (`validateExactNpmVersion`, `validateGitRef`) so the installer never
|
|
155
|
+
* runs against an unpinned, mutable, or range/dist-tag source. Rules:
|
|
156
|
+
* - non-local npm packages must carry an exact pinned version (no missing/range/wildcard/dist-tag);
|
|
157
|
+
* - git packages must use a full commit SHA, or a tag anchored to a reviewed resolved commit SHA
|
|
158
|
+
* supplied through `options.resolvedCommit`.
|
|
159
|
+
* Local sources are exempt so local development paths keep working unchanged.
|
|
160
|
+
*
|
|
161
|
+
* Only the explicit install/persist entry point is gated. resolve()'s auto-install of
|
|
162
|
+
* already-configured packages is intentionally left unchanged so existing settings keep loading.
|
|
163
|
+
*/
|
|
164
|
+
private assertInstallAdmission;
|
|
109
165
|
remove(source: string, options?: {
|
|
110
166
|
local?: boolean;
|
|
111
167
|
}): Promise<void>;
|
|
@@ -122,6 +178,7 @@ export declare class DefaultPackageManager implements PackageManager {
|
|
|
122
178
|
private warnPackageSourceFailure;
|
|
123
179
|
private resolveLocalExtensionSource;
|
|
124
180
|
private installParsedSource;
|
|
181
|
+
private installTemporaryTrialSource;
|
|
125
182
|
private getPackageSourceString;
|
|
126
183
|
private getSourceMatchKeyForInput;
|
|
127
184
|
private getSourceMatchKeyForSettings;
|
|
@@ -155,10 +212,21 @@ export declare class DefaultPackageManager implements PackageManager {
|
|
|
155
212
|
private parseNpmSpec;
|
|
156
213
|
private getNpmCommand;
|
|
157
214
|
private getPackageManagerName;
|
|
215
|
+
private getTrialPackageManagerName;
|
|
158
216
|
private runNpmCommand;
|
|
159
217
|
private getGitDependencyInstallArgs;
|
|
160
218
|
private runNpmCommandSync;
|
|
161
219
|
private getNpmInstallArgs;
|
|
220
|
+
private shouldAllowNpmInstallScripts;
|
|
221
|
+
private shouldAllowGitInstallScripts;
|
|
222
|
+
private logInstallScriptDecision;
|
|
223
|
+
/**
|
|
224
|
+
* Validate a CLI `--allow-scripts <name>` value against an install source and return the canonical allowlist
|
|
225
|
+
* entry to persist. Exact match only; an unrelated name yields `{ ok: false, expected }` so the CLI can abort
|
|
226
|
+
* and print the manual settings example.
|
|
227
|
+
*/
|
|
228
|
+
resolveInstallAllowScriptEntry(source: string, requested: string): InstallAllowScriptResolution;
|
|
229
|
+
private installTemporaryNpmTrial;
|
|
162
230
|
private installNpm;
|
|
163
231
|
private uninstallNpm;
|
|
164
232
|
private installGit;
|
|
@@ -172,6 +240,7 @@ export declare class DefaultPackageManager implements PackageManager {
|
|
|
172
240
|
private getNpmInstallRoot;
|
|
173
241
|
private getGlobalNpmRoot;
|
|
174
242
|
private getPnpmGlobalPackagePath;
|
|
243
|
+
private getTemporaryNpmInstallRoot;
|
|
175
244
|
private getManagedNpmInstallPath;
|
|
176
245
|
private getLegacyGlobalNpmInstallPath;
|
|
177
246
|
private getNpmInstallPath;
|