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,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure VerificationContract evaluation helpers.
|
|
3
|
+
*
|
|
4
|
+
* These functions evaluate a verification contract against already-captured
|
|
5
|
+
* evidence (command receipts, passed gate ids, agent contexts). They perform NO
|
|
6
|
+
* real command execution, NO filesystem access, and NO network calls — every
|
|
7
|
+
* input is passed in by the caller. This keeps them deterministic, fast, and
|
|
8
|
+
* safe to run inside any lane without write/execute scope.
|
|
9
|
+
*
|
|
10
|
+
* The shapes here are a focused, machine-verifiable subset of the orchestration
|
|
11
|
+
* verification contract (see `.omk/runs/omk-orchestration-upgrade-plan/
|
|
12
|
+
* verification-contract.md`). Downstream lanes add the executor (spawning,
|
|
13
|
+
* hashing, globbing) on top of these pure evaluators.
|
|
14
|
+
*/
|
|
15
|
+
/** Where an {@link OutputMatcher} should look for its pattern. */
|
|
16
|
+
export type OutputSource = "stdout" | "stderr" | "combined";
|
|
17
|
+
/** Match predicates supported by {@link evaluateOutputMatchers}. */
|
|
18
|
+
export type OutputPredicate = "includes" | "regex" | "not-includes";
|
|
19
|
+
/**
|
|
20
|
+
* A serializable matcher over a captured command stream.
|
|
21
|
+
*
|
|
22
|
+
* - `includes` : the stream must contain `value` as a substring.
|
|
23
|
+
* - `regex` : the stream must match the RegExp built from `value`.
|
|
24
|
+
* - `not-includes` : the stream must NOT contain `value` as a substring.
|
|
25
|
+
*/
|
|
26
|
+
export interface OutputMatcher {
|
|
27
|
+
readonly source: OutputSource;
|
|
28
|
+
readonly predicate: OutputPredicate;
|
|
29
|
+
readonly value: string;
|
|
30
|
+
}
|
|
31
|
+
/** Optional exit-code constraint for a {@link CommandGate}. */
|
|
32
|
+
export type ExpectedExitCode = number | {
|
|
33
|
+
readonly min: number;
|
|
34
|
+
readonly max: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A single executable gate inside a verification contract. The gate itself is
|
|
38
|
+
* data only; {@link evaluateCommandGate} evaluates it against a receipt.
|
|
39
|
+
*/
|
|
40
|
+
export interface CommandGate {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly cmd: string;
|
|
43
|
+
readonly args?: readonly string[];
|
|
44
|
+
/** Exact code or inclusive range. Omit to skip the exit-code constraint. */
|
|
45
|
+
readonly expectedExitCode?: ExpectedExitCode;
|
|
46
|
+
readonly matchers?: readonly OutputMatcher[];
|
|
47
|
+
readonly timeoutMs: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Captured output of an already-executed command. `combined` defaults to
|
|
51
|
+
* `stdout + stderr` when omitted so matchers that select `combined` still work.
|
|
52
|
+
*/
|
|
53
|
+
export interface CommandReceipt {
|
|
54
|
+
readonly exitCode: number;
|
|
55
|
+
readonly stdout: string;
|
|
56
|
+
readonly stderr: string;
|
|
57
|
+
readonly combined?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An artifact existence/hash/size requirement. (Type shape only — artifact
|
|
61
|
+
* verification touches the filesystem and is implemented by the executor lane.)
|
|
62
|
+
*/
|
|
63
|
+
export interface ArtifactRule {
|
|
64
|
+
readonly id: string;
|
|
65
|
+
readonly pathGlob: string;
|
|
66
|
+
readonly mustExist: boolean;
|
|
67
|
+
readonly expectedHash?: string;
|
|
68
|
+
readonly sizeBytes?: {
|
|
69
|
+
readonly min?: number;
|
|
70
|
+
readonly max?: number;
|
|
71
|
+
};
|
|
72
|
+
readonly containment?: "file" | "directory" | "any";
|
|
73
|
+
}
|
|
74
|
+
/** Supported test frameworks for a {@link TestSelector}. */
|
|
75
|
+
export type TestFramework = "vitest" | "jest" | "pytest" | "go";
|
|
76
|
+
/**
|
|
77
|
+
* A test-suite selector. (Type shape only — running and parsing test output is
|
|
78
|
+
* implemented by the executor lane.)
|
|
79
|
+
*/
|
|
80
|
+
export interface TestSelector {
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly framework: TestFramework;
|
|
83
|
+
readonly fileOrPattern: string;
|
|
84
|
+
readonly expectedResult?: {
|
|
85
|
+
readonly passed?: number;
|
|
86
|
+
readonly failed?: number;
|
|
87
|
+
readonly skipped?: number;
|
|
88
|
+
};
|
|
89
|
+
readonly timeoutMs: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* How gate results are aggregated into a single pass/fail.
|
|
93
|
+
*
|
|
94
|
+
* - `all` : every gate must pass (and there must be at least one gate).
|
|
95
|
+
* - `quorum` : at least `requiredPasses` gates must pass.
|
|
96
|
+
*/
|
|
97
|
+
export type EvidencePolicy = {
|
|
98
|
+
readonly mode: "all";
|
|
99
|
+
} | {
|
|
100
|
+
readonly mode: "quorum";
|
|
101
|
+
readonly requiredPasses: number;
|
|
102
|
+
};
|
|
103
|
+
/** The kind of gate a {@link VerificationGateResult} summarizes. */
|
|
104
|
+
export type GateKind = "command" | "artifact" | "test";
|
|
105
|
+
/** Result of evaluating a single gate. */
|
|
106
|
+
export interface VerificationGateResult {
|
|
107
|
+
readonly id: string;
|
|
108
|
+
readonly kind: GateKind;
|
|
109
|
+
readonly pass: boolean;
|
|
110
|
+
readonly exitCode?: number;
|
|
111
|
+
readonly matcherFailures?: readonly string[];
|
|
112
|
+
readonly errors?: readonly string[];
|
|
113
|
+
}
|
|
114
|
+
/** Top-level verification outcome after aggregation and policy checks. */
|
|
115
|
+
export interface VerificationResult {
|
|
116
|
+
readonly pass: boolean;
|
|
117
|
+
readonly evidencePolicy: EvidencePolicy;
|
|
118
|
+
readonly gates: readonly VerificationGateResult[];
|
|
119
|
+
readonly traceabilityOk: boolean;
|
|
120
|
+
readonly independenceOk: boolean;
|
|
121
|
+
readonly errorSummary?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Maps a requirement to the gate ids that prove it. `minPassingGates` defaults
|
|
125
|
+
* to 1 when omitted.
|
|
126
|
+
*/
|
|
127
|
+
export interface RequirementLink {
|
|
128
|
+
readonly requirementId: string;
|
|
129
|
+
readonly gateIds: readonly string[];
|
|
130
|
+
readonly minPassingGates?: number;
|
|
131
|
+
}
|
|
132
|
+
/** Identity of an executor or reviewer agent for independence checks. */
|
|
133
|
+
export interface AgentContext {
|
|
134
|
+
readonly modelId: string;
|
|
135
|
+
readonly contextId: string;
|
|
136
|
+
/** Reviewer-only: declares the reviewer ran in a freshly created context. */
|
|
137
|
+
readonly freshContext?: boolean;
|
|
138
|
+
}
|
|
139
|
+
/** Streams available to matchers. */
|
|
140
|
+
export interface CommandOutputs {
|
|
141
|
+
readonly stdout: string;
|
|
142
|
+
readonly stderr: string;
|
|
143
|
+
readonly combined?: string;
|
|
144
|
+
}
|
|
145
|
+
/** Outcome of {@link evaluateOutputMatchers}. */
|
|
146
|
+
export interface MatcherEvaluation {
|
|
147
|
+
readonly pass: boolean;
|
|
148
|
+
readonly failures: readonly string[];
|
|
149
|
+
}
|
|
150
|
+
/** Outcome of {@link aggregateGateResults}. */
|
|
151
|
+
export interface AggregationEvaluation {
|
|
152
|
+
readonly pass: boolean;
|
|
153
|
+
readonly passedCount: number;
|
|
154
|
+
}
|
|
155
|
+
/** Outcome of {@link verifyTraceability}. */
|
|
156
|
+
export interface TraceabilityEvaluation {
|
|
157
|
+
readonly pass: boolean;
|
|
158
|
+
readonly failures: readonly string[];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Evaluate a list of {@link OutputMatcher}s against captured command streams.
|
|
162
|
+
* All matchers must pass. Invalid regex is treated as a failure (never thrown).
|
|
163
|
+
*/
|
|
164
|
+
export declare function evaluateOutputMatchers(outputs: CommandOutputs, matchers: readonly OutputMatcher[]): MatcherEvaluation;
|
|
165
|
+
/**
|
|
166
|
+
* Evaluate a {@link CommandGate} against an executed-command receipt. The gate
|
|
167
|
+
* passes when the exit code satisfies `expectedExitCode` (if set) AND every
|
|
168
|
+
* matcher passes. No execution happens here.
|
|
169
|
+
*/
|
|
170
|
+
export declare function evaluateCommandGate(gate: CommandGate, receipt: CommandReceipt): VerificationGateResult;
|
|
171
|
+
/**
|
|
172
|
+
* Aggregate gate results under an {@link EvidencePolicy}.
|
|
173
|
+
*
|
|
174
|
+
* - `all` : passes only when there is at least one gate and every gate passes.
|
|
175
|
+
* - `quorum` : passes when at least `requiredPasses` gates pass.
|
|
176
|
+
*/
|
|
177
|
+
export declare function aggregateGateResults(results: readonly VerificationGateResult[], policy: EvidencePolicy): AggregationEvaluation;
|
|
178
|
+
/**
|
|
179
|
+
* Verify every requirement id is covered by enough passed gates.
|
|
180
|
+
*
|
|
181
|
+
* For each requirement id in `requirements`, its {@link RequirementLink} must
|
|
182
|
+
* exist and at least `minPassingGates` (default 1) of its linked gate ids must
|
|
183
|
+
* appear in `passedGateIds`. A missing link is a traceability gap.
|
|
184
|
+
*/
|
|
185
|
+
export declare function verifyTraceability(requirements: readonly string[], links: readonly RequirementLink[], passedGateIds: readonly string[]): TraceabilityEvaluation;
|
|
186
|
+
/**
|
|
187
|
+
* Check reviewer/executor independence.
|
|
188
|
+
*
|
|
189
|
+
* Passes only when:
|
|
190
|
+
* - the reviewer's model differs from the executor's model, OR
|
|
191
|
+
* - the reviewer's context differs AND the reviewer declared `freshContext`.
|
|
192
|
+
*
|
|
193
|
+
* This is the fail-closed gate that prevents a node's executor from also being
|
|
194
|
+
* its verifier.
|
|
195
|
+
*/
|
|
196
|
+
export declare function checkReviewerExecutorIndependence(executor: AgentContext, reviewer: AgentContext): boolean;
|
|
197
|
+
//# sourceMappingURL=verification-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-contract.d.ts","sourceRoot":"","sources":["../../../src/core/orchestration/verification-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,kEAAkE;AAClE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE5D,oEAAoE;AACpE,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,cAAc,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,4EAA4E;IAC5E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AgB,kBAAkB,CACjC,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,KAAK,EAAE,SAAS,eAAe,EAAE,EACjC,aAAa,EAAE,SAAS,MAAM,EAAE,GAC9B,sBAAsB,CAkBxB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO,CAIzG","sourcesContent":["/**\n * Pure VerificationContract evaluation helpers.\n *\n * These functions evaluate a verification contract against already-captured\n * evidence (command receipts, passed gate ids, agent contexts). They perform NO\n * real command execution, NO filesystem access, and NO network calls — every\n * input is passed in by the caller. This keeps them deterministic, fast, and\n * safe to run inside any lane without write/execute scope.\n *\n * The shapes here are a focused, machine-verifiable subset of the orchestration\n * verification contract (see `.omk/runs/omk-orchestration-upgrade-plan/\n * verification-contract.md`). Downstream lanes add the executor (spawning,\n * hashing, globbing) on top of these pure evaluators.\n */\n\n/** Where an {@link OutputMatcher} should look for its pattern. */\nexport type OutputSource = \"stdout\" | \"stderr\" | \"combined\";\n\n/** Match predicates supported by {@link evaluateOutputMatchers}. */\nexport type OutputPredicate = \"includes\" | \"regex\" | \"not-includes\";\n\n/**\n * A serializable matcher over a captured command stream.\n *\n * - `includes` : the stream must contain `value` as a substring.\n * - `regex` : the stream must match the RegExp built from `value`.\n * - `not-includes` : the stream must NOT contain `value` as a substring.\n */\nexport interface OutputMatcher {\n\treadonly source: OutputSource;\n\treadonly predicate: OutputPredicate;\n\treadonly value: string;\n}\n\n/** Optional exit-code constraint for a {@link CommandGate}. */\nexport type ExpectedExitCode = number | { readonly min: number; readonly max: number };\n\n/**\n * A single executable gate inside a verification contract. The gate itself is\n * data only; {@link evaluateCommandGate} evaluates it against a receipt.\n */\nexport interface CommandGate {\n\treadonly id: string;\n\treadonly cmd: string;\n\treadonly args?: readonly string[];\n\t/** Exact code or inclusive range. Omit to skip the exit-code constraint. */\n\treadonly expectedExitCode?: ExpectedExitCode;\n\treadonly matchers?: readonly OutputMatcher[];\n\treadonly timeoutMs: number;\n}\n\n/**\n * Captured output of an already-executed command. `combined` defaults to\n * `stdout + stderr` when omitted so matchers that select `combined` still work.\n */\nexport interface CommandReceipt {\n\treadonly exitCode: number;\n\treadonly stdout: string;\n\treadonly stderr: string;\n\treadonly combined?: string;\n}\n\n/**\n * An artifact existence/hash/size requirement. (Type shape only — artifact\n * verification touches the filesystem and is implemented by the executor lane.)\n */\nexport interface ArtifactRule {\n\treadonly id: string;\n\treadonly pathGlob: string;\n\treadonly mustExist: boolean;\n\treadonly expectedHash?: string;\n\treadonly sizeBytes?: { readonly min?: number; readonly max?: number };\n\treadonly containment?: \"file\" | \"directory\" | \"any\";\n}\n\n/** Supported test frameworks for a {@link TestSelector}. */\nexport type TestFramework = \"vitest\" | \"jest\" | \"pytest\" | \"go\";\n\n/**\n * A test-suite selector. (Type shape only — running and parsing test output is\n * implemented by the executor lane.)\n */\nexport interface TestSelector {\n\treadonly id: string;\n\treadonly framework: TestFramework;\n\treadonly fileOrPattern: string;\n\treadonly expectedResult?: {\n\t\treadonly passed?: number;\n\t\treadonly failed?: number;\n\t\treadonly skipped?: number;\n\t};\n\treadonly timeoutMs: number;\n}\n\n/**\n * How gate results are aggregated into a single pass/fail.\n *\n * - `all` : every gate must pass (and there must be at least one gate).\n * - `quorum` : at least `requiredPasses` gates must pass.\n */\nexport type EvidencePolicy = { readonly mode: \"all\" } | { readonly mode: \"quorum\"; readonly requiredPasses: number };\n\n/** The kind of gate a {@link VerificationGateResult} summarizes. */\nexport type GateKind = \"command\" | \"artifact\" | \"test\";\n\n/** Result of evaluating a single gate. */\nexport interface VerificationGateResult {\n\treadonly id: string;\n\treadonly kind: GateKind;\n\treadonly pass: boolean;\n\treadonly exitCode?: number;\n\treadonly matcherFailures?: readonly string[];\n\treadonly errors?: readonly string[];\n}\n\n/** Top-level verification outcome after aggregation and policy checks. */\nexport interface VerificationResult {\n\treadonly pass: boolean;\n\treadonly evidencePolicy: EvidencePolicy;\n\treadonly gates: readonly VerificationGateResult[];\n\treadonly traceabilityOk: boolean;\n\treadonly independenceOk: boolean;\n\treadonly errorSummary?: string;\n}\n\n/**\n * Maps a requirement to the gate ids that prove it. `minPassingGates` defaults\n * to 1 when omitted.\n */\nexport interface RequirementLink {\n\treadonly requirementId: string;\n\treadonly gateIds: readonly string[];\n\treadonly minPassingGates?: number;\n}\n\n/** Identity of an executor or reviewer agent for independence checks. */\nexport interface AgentContext {\n\treadonly modelId: string;\n\treadonly contextId: string;\n\t/** Reviewer-only: declares the reviewer ran in a freshly created context. */\n\treadonly freshContext?: boolean;\n}\n\n/** Streams available to matchers. */\nexport interface CommandOutputs {\n\treadonly stdout: string;\n\treadonly stderr: string;\n\treadonly combined?: string;\n}\n\n/** Outcome of {@link evaluateOutputMatchers}. */\nexport interface MatcherEvaluation {\n\treadonly pass: boolean;\n\treadonly failures: readonly string[];\n}\n\n/** Outcome of {@link aggregateGateResults}. */\nexport interface AggregationEvaluation {\n\treadonly pass: boolean;\n\treadonly passedCount: number;\n}\n\n/** Outcome of {@link verifyTraceability}. */\nexport interface TraceabilityEvaluation {\n\treadonly pass: boolean;\n\treadonly failures: readonly string[];\n}\n\nfunction selectStream(outputs: CommandOutputs, source: OutputSource): string {\n\tif (source === \"stdout\") return outputs.stdout;\n\tif (source === \"stderr\") return outputs.stderr;\n\t// `combined` defaults to stdout + stderr so callers can omit it.\n\treturn outputs.combined ?? `${outputs.stdout}${outputs.stderr}`;\n}\n\nfunction describeMatcher(matcher: OutputMatcher): string {\n\treturn `${matcher.source}/${matcher.predicate}=${JSON.stringify(matcher.value)}`;\n}\n\n/**\n * Evaluate a list of {@link OutputMatcher}s against captured command streams.\n * All matchers must pass. Invalid regex is treated as a failure (never thrown).\n */\nexport function evaluateOutputMatchers(outputs: CommandOutputs, matchers: readonly OutputMatcher[]): MatcherEvaluation {\n\tconst failures: string[] = [];\n\tfor (const matcher of matchers) {\n\t\tconst stream = selectStream(outputs, matcher.source);\n\t\tlet ok: boolean;\n\t\tif (matcher.predicate === \"includes\") {\n\t\t\tok = stream.includes(matcher.value);\n\t\t} else if (matcher.predicate === \"not-includes\") {\n\t\t\tok = !stream.includes(matcher.value);\n\t\t} else {\n\t\t\t// regex: a malformed pattern is a failed matcher, not a crash.\n\t\t\ttry {\n\t\t\t\tok = new RegExp(matcher.value).test(stream);\n\t\t\t} catch {\n\t\t\t\tfailures.push(`invalid regex for ${describeMatcher(matcher)}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (!ok) {\n\t\t\tfailures.push(`matcher failed: ${describeMatcher(matcher)}`);\n\t\t}\n\t}\n\treturn { pass: failures.length === 0, failures };\n}\n\nfunction evaluateExitCode(expected: ExpectedExitCode | undefined, exitCode: number): boolean {\n\tif (expected === undefined) return true;\n\tif (typeof expected === \"number\") return exitCode === expected;\n\treturn exitCode >= expected.min && exitCode <= expected.max;\n}\n\n/**\n * Evaluate a {@link CommandGate} against an executed-command receipt. The gate\n * passes when the exit code satisfies `expectedExitCode` (if set) AND every\n * matcher passes. No execution happens here.\n */\nexport function evaluateCommandGate(gate: CommandGate, receipt: CommandReceipt): VerificationGateResult {\n\tconst errors: string[] = [];\n\tconst exitOk = evaluateExitCode(gate.expectedExitCode, receipt.exitCode);\n\tif (!exitOk) {\n\t\terrors.push(`exit code ${receipt.exitCode} did not satisfy ${JSON.stringify(gate.expectedExitCode)}`);\n\t}\n\tconst matcherResult = evaluateOutputMatchers(receipt, gate.matchers ?? []);\n\tconst pass = exitOk && matcherResult.pass;\n\treturn {\n\t\tid: gate.id,\n\t\tkind: \"command\",\n\t\tpass,\n\t\texitCode: receipt.exitCode,\n\t\t...(matcherResult.failures.length > 0 ? { matcherFailures: matcherResult.failures } : {}),\n\t\t...(errors.length > 0 ? { errors } : {}),\n\t};\n}\n\n/**\n * Aggregate gate results under an {@link EvidencePolicy}.\n *\n * - `all` : passes only when there is at least one gate and every gate passes.\n * - `quorum` : passes when at least `requiredPasses` gates pass.\n */\nexport function aggregateGateResults(\n\tresults: readonly VerificationGateResult[],\n\tpolicy: EvidencePolicy,\n): AggregationEvaluation {\n\tconst passedCount = results.filter((r) => r.pass).length;\n\tlet pass: boolean;\n\tif (policy.mode === \"all\") {\n\t\tpass = results.length > 0 && passedCount === results.length;\n\t} else {\n\t\tpass = passedCount >= policy.requiredPasses;\n\t}\n\treturn { pass, passedCount };\n}\n\n/**\n * Verify every requirement id is covered by enough passed gates.\n *\n * For each requirement id in `requirements`, its {@link RequirementLink} must\n * exist and at least `minPassingGates` (default 1) of its linked gate ids must\n * appear in `passedGateIds`. A missing link is a traceability gap.\n */\nexport function verifyTraceability(\n\trequirements: readonly string[],\n\tlinks: readonly RequirementLink[],\n\tpassedGateIds: readonly string[],\n): TraceabilityEvaluation {\n\tconst failures: string[] = [];\n\tconst passed = new Set(passedGateIds);\n\tconst byId = new Map<string, RequirementLink>();\n\tfor (const link of links) byId.set(link.requirementId, link);\n\tfor (const requirementId of requirements) {\n\t\tconst link = byId.get(requirementId);\n\t\tif (!link) {\n\t\t\tfailures.push(`requirement ${requirementId} has no gate link (traceability gap)`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst minPassing = link.minPassingGates ?? 1;\n\t\tconst passing = link.gateIds.filter((id) => passed.has(id)).length;\n\t\tif (passing < minPassing) {\n\t\t\tfailures.push(`requirement ${requirementId} covered by ${passing}/${minPassing} passed gates`);\n\t\t}\n\t}\n\treturn { pass: failures.length === 0, failures };\n}\n\n/**\n * Check reviewer/executor independence.\n *\n * Passes only when:\n * - the reviewer's model differs from the executor's model, OR\n * - the reviewer's context differs AND the reviewer declared `freshContext`.\n *\n * This is the fail-closed gate that prevents a node's executor from also being\n * its verifier.\n */\nexport function checkReviewerExecutorIndependence(executor: AgentContext, reviewer: AgentContext): boolean {\n\tconst differentModel = reviewer.modelId !== executor.modelId;\n\tconst freshDifferentContext = reviewer.contextId !== executor.contextId && reviewer.freshContext === true;\n\treturn differentModel || freshDifferentContext;\n}\n"]}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure VerificationContract evaluation helpers.
|
|
3
|
+
*
|
|
4
|
+
* These functions evaluate a verification contract against already-captured
|
|
5
|
+
* evidence (command receipts, passed gate ids, agent contexts). They perform NO
|
|
6
|
+
* real command execution, NO filesystem access, and NO network calls — every
|
|
7
|
+
* input is passed in by the caller. This keeps them deterministic, fast, and
|
|
8
|
+
* safe to run inside any lane without write/execute scope.
|
|
9
|
+
*
|
|
10
|
+
* The shapes here are a focused, machine-verifiable subset of the orchestration
|
|
11
|
+
* verification contract (see `.omk/runs/omk-orchestration-upgrade-plan/
|
|
12
|
+
* verification-contract.md`). Downstream lanes add the executor (spawning,
|
|
13
|
+
* hashing, globbing) on top of these pure evaluators.
|
|
14
|
+
*/
|
|
15
|
+
function selectStream(outputs, source) {
|
|
16
|
+
if (source === "stdout")
|
|
17
|
+
return outputs.stdout;
|
|
18
|
+
if (source === "stderr")
|
|
19
|
+
return outputs.stderr;
|
|
20
|
+
// `combined` defaults to stdout + stderr so callers can omit it.
|
|
21
|
+
return outputs.combined ?? `${outputs.stdout}${outputs.stderr}`;
|
|
22
|
+
}
|
|
23
|
+
function describeMatcher(matcher) {
|
|
24
|
+
return `${matcher.source}/${matcher.predicate}=${JSON.stringify(matcher.value)}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Evaluate a list of {@link OutputMatcher}s against captured command streams.
|
|
28
|
+
* All matchers must pass. Invalid regex is treated as a failure (never thrown).
|
|
29
|
+
*/
|
|
30
|
+
export function evaluateOutputMatchers(outputs, matchers) {
|
|
31
|
+
const failures = [];
|
|
32
|
+
for (const matcher of matchers) {
|
|
33
|
+
const stream = selectStream(outputs, matcher.source);
|
|
34
|
+
let ok;
|
|
35
|
+
if (matcher.predicate === "includes") {
|
|
36
|
+
ok = stream.includes(matcher.value);
|
|
37
|
+
}
|
|
38
|
+
else if (matcher.predicate === "not-includes") {
|
|
39
|
+
ok = !stream.includes(matcher.value);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
// regex: a malformed pattern is a failed matcher, not a crash.
|
|
43
|
+
try {
|
|
44
|
+
ok = new RegExp(matcher.value).test(stream);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
failures.push(`invalid regex for ${describeMatcher(matcher)}`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!ok) {
|
|
52
|
+
failures.push(`matcher failed: ${describeMatcher(matcher)}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return { pass: failures.length === 0, failures };
|
|
56
|
+
}
|
|
57
|
+
function evaluateExitCode(expected, exitCode) {
|
|
58
|
+
if (expected === undefined)
|
|
59
|
+
return true;
|
|
60
|
+
if (typeof expected === "number")
|
|
61
|
+
return exitCode === expected;
|
|
62
|
+
return exitCode >= expected.min && exitCode <= expected.max;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Evaluate a {@link CommandGate} against an executed-command receipt. The gate
|
|
66
|
+
* passes when the exit code satisfies `expectedExitCode` (if set) AND every
|
|
67
|
+
* matcher passes. No execution happens here.
|
|
68
|
+
*/
|
|
69
|
+
export function evaluateCommandGate(gate, receipt) {
|
|
70
|
+
const errors = [];
|
|
71
|
+
const exitOk = evaluateExitCode(gate.expectedExitCode, receipt.exitCode);
|
|
72
|
+
if (!exitOk) {
|
|
73
|
+
errors.push(`exit code ${receipt.exitCode} did not satisfy ${JSON.stringify(gate.expectedExitCode)}`);
|
|
74
|
+
}
|
|
75
|
+
const matcherResult = evaluateOutputMatchers(receipt, gate.matchers ?? []);
|
|
76
|
+
const pass = exitOk && matcherResult.pass;
|
|
77
|
+
return {
|
|
78
|
+
id: gate.id,
|
|
79
|
+
kind: "command",
|
|
80
|
+
pass,
|
|
81
|
+
exitCode: receipt.exitCode,
|
|
82
|
+
...(matcherResult.failures.length > 0 ? { matcherFailures: matcherResult.failures } : {}),
|
|
83
|
+
...(errors.length > 0 ? { errors } : {}),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Aggregate gate results under an {@link EvidencePolicy}.
|
|
88
|
+
*
|
|
89
|
+
* - `all` : passes only when there is at least one gate and every gate passes.
|
|
90
|
+
* - `quorum` : passes when at least `requiredPasses` gates pass.
|
|
91
|
+
*/
|
|
92
|
+
export function aggregateGateResults(results, policy) {
|
|
93
|
+
const passedCount = results.filter((r) => r.pass).length;
|
|
94
|
+
let pass;
|
|
95
|
+
if (policy.mode === "all") {
|
|
96
|
+
pass = results.length > 0 && passedCount === results.length;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
pass = passedCount >= policy.requiredPasses;
|
|
100
|
+
}
|
|
101
|
+
return { pass, passedCount };
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Verify every requirement id is covered by enough passed gates.
|
|
105
|
+
*
|
|
106
|
+
* For each requirement id in `requirements`, its {@link RequirementLink} must
|
|
107
|
+
* exist and at least `minPassingGates` (default 1) of its linked gate ids must
|
|
108
|
+
* appear in `passedGateIds`. A missing link is a traceability gap.
|
|
109
|
+
*/
|
|
110
|
+
export function verifyTraceability(requirements, links, passedGateIds) {
|
|
111
|
+
const failures = [];
|
|
112
|
+
const passed = new Set(passedGateIds);
|
|
113
|
+
const byId = new Map();
|
|
114
|
+
for (const link of links)
|
|
115
|
+
byId.set(link.requirementId, link);
|
|
116
|
+
for (const requirementId of requirements) {
|
|
117
|
+
const link = byId.get(requirementId);
|
|
118
|
+
if (!link) {
|
|
119
|
+
failures.push(`requirement ${requirementId} has no gate link (traceability gap)`);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const minPassing = link.minPassingGates ?? 1;
|
|
123
|
+
const passing = link.gateIds.filter((id) => passed.has(id)).length;
|
|
124
|
+
if (passing < minPassing) {
|
|
125
|
+
failures.push(`requirement ${requirementId} covered by ${passing}/${minPassing} passed gates`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return { pass: failures.length === 0, failures };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Check reviewer/executor independence.
|
|
132
|
+
*
|
|
133
|
+
* Passes only when:
|
|
134
|
+
* - the reviewer's model differs from the executor's model, OR
|
|
135
|
+
* - the reviewer's context differs AND the reviewer declared `freshContext`.
|
|
136
|
+
*
|
|
137
|
+
* This is the fail-closed gate that prevents a node's executor from also being
|
|
138
|
+
* its verifier.
|
|
139
|
+
*/
|
|
140
|
+
export function checkReviewerExecutorIndependence(executor, reviewer) {
|
|
141
|
+
const differentModel = reviewer.modelId !== executor.modelId;
|
|
142
|
+
const freshDifferentContext = reviewer.contextId !== executor.contextId && reviewer.freshContext === true;
|
|
143
|
+
return differentModel || freshDifferentContext;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=verification-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verification-contract.js","sourceRoot":"","sources":["../../../src/core/orchestration/verification-contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AA2JH,SAAS,YAAY,CAAC,OAAuB,EAAE,MAAoB,EAAU;IAC5E,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAC/C,IAAI,MAAM,KAAK,QAAQ;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC;IAC/C,iEAAiE;IACjE,OAAO,OAAO,CAAC,QAAQ,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAAA,CAChE;AAED,SAAS,eAAe,CAAC,OAAsB,EAAU;IACxD,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;AAAA,CACjF;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAuB,EAAE,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AChG,CAAC;IACF,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;AAAA,CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iCAAiC,CAAC,QAAsB,EAAE,QAAsB,EAAW;IAC1G,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO,CAAC;IAC7D,MAAM,qBAAqB,GAAG,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,YAAY,KAAK,IAAI,CAAC;IAC1G,OAAO,cAAc,IAAI,qBAAqB,CAAC;AAAA,CAC/C","sourcesContent":["/**\n * Pure VerificationContract evaluation helpers.\n *\n * These functions evaluate a verification contract against already-captured\n * evidence (command receipts, passed gate ids, agent contexts). They perform NO\n * real command execution, NO filesystem access, and NO network calls — every\n * input is passed in by the caller. This keeps them deterministic, fast, and\n * safe to run inside any lane without write/execute scope.\n *\n * The shapes here are a focused, machine-verifiable subset of the orchestration\n * verification contract (see `.omk/runs/omk-orchestration-upgrade-plan/\n * verification-contract.md`). Downstream lanes add the executor (spawning,\n * hashing, globbing) on top of these pure evaluators.\n */\n\n/** Where an {@link OutputMatcher} should look for its pattern. */\nexport type OutputSource = \"stdout\" | \"stderr\" | \"combined\";\n\n/** Match predicates supported by {@link evaluateOutputMatchers}. */\nexport type OutputPredicate = \"includes\" | \"regex\" | \"not-includes\";\n\n/**\n * A serializable matcher over a captured command stream.\n *\n * - `includes` : the stream must contain `value` as a substring.\n * - `regex` : the stream must match the RegExp built from `value`.\n * - `not-includes` : the stream must NOT contain `value` as a substring.\n */\nexport interface OutputMatcher {\n\treadonly source: OutputSource;\n\treadonly predicate: OutputPredicate;\n\treadonly value: string;\n}\n\n/** Optional exit-code constraint for a {@link CommandGate}. */\nexport type ExpectedExitCode = number | { readonly min: number; readonly max: number };\n\n/**\n * A single executable gate inside a verification contract. The gate itself is\n * data only; {@link evaluateCommandGate} evaluates it against a receipt.\n */\nexport interface CommandGate {\n\treadonly id: string;\n\treadonly cmd: string;\n\treadonly args?: readonly string[];\n\t/** Exact code or inclusive range. Omit to skip the exit-code constraint. */\n\treadonly expectedExitCode?: ExpectedExitCode;\n\treadonly matchers?: readonly OutputMatcher[];\n\treadonly timeoutMs: number;\n}\n\n/**\n * Captured output of an already-executed command. `combined` defaults to\n * `stdout + stderr` when omitted so matchers that select `combined` still work.\n */\nexport interface CommandReceipt {\n\treadonly exitCode: number;\n\treadonly stdout: string;\n\treadonly stderr: string;\n\treadonly combined?: string;\n}\n\n/**\n * An artifact existence/hash/size requirement. (Type shape only — artifact\n * verification touches the filesystem and is implemented by the executor lane.)\n */\nexport interface ArtifactRule {\n\treadonly id: string;\n\treadonly pathGlob: string;\n\treadonly mustExist: boolean;\n\treadonly expectedHash?: string;\n\treadonly sizeBytes?: { readonly min?: number; readonly max?: number };\n\treadonly containment?: \"file\" | \"directory\" | \"any\";\n}\n\n/** Supported test frameworks for a {@link TestSelector}. */\nexport type TestFramework = \"vitest\" | \"jest\" | \"pytest\" | \"go\";\n\n/**\n * A test-suite selector. (Type shape only — running and parsing test output is\n * implemented by the executor lane.)\n */\nexport interface TestSelector {\n\treadonly id: string;\n\treadonly framework: TestFramework;\n\treadonly fileOrPattern: string;\n\treadonly expectedResult?: {\n\t\treadonly passed?: number;\n\t\treadonly failed?: number;\n\t\treadonly skipped?: number;\n\t};\n\treadonly timeoutMs: number;\n}\n\n/**\n * How gate results are aggregated into a single pass/fail.\n *\n * - `all` : every gate must pass (and there must be at least one gate).\n * - `quorum` : at least `requiredPasses` gates must pass.\n */\nexport type EvidencePolicy = { readonly mode: \"all\" } | { readonly mode: \"quorum\"; readonly requiredPasses: number };\n\n/** The kind of gate a {@link VerificationGateResult} summarizes. */\nexport type GateKind = \"command\" | \"artifact\" | \"test\";\n\n/** Result of evaluating a single gate. */\nexport interface VerificationGateResult {\n\treadonly id: string;\n\treadonly kind: GateKind;\n\treadonly pass: boolean;\n\treadonly exitCode?: number;\n\treadonly matcherFailures?: readonly string[];\n\treadonly errors?: readonly string[];\n}\n\n/** Top-level verification outcome after aggregation and policy checks. */\nexport interface VerificationResult {\n\treadonly pass: boolean;\n\treadonly evidencePolicy: EvidencePolicy;\n\treadonly gates: readonly VerificationGateResult[];\n\treadonly traceabilityOk: boolean;\n\treadonly independenceOk: boolean;\n\treadonly errorSummary?: string;\n}\n\n/**\n * Maps a requirement to the gate ids that prove it. `minPassingGates` defaults\n * to 1 when omitted.\n */\nexport interface RequirementLink {\n\treadonly requirementId: string;\n\treadonly gateIds: readonly string[];\n\treadonly minPassingGates?: number;\n}\n\n/** Identity of an executor or reviewer agent for independence checks. */\nexport interface AgentContext {\n\treadonly modelId: string;\n\treadonly contextId: string;\n\t/** Reviewer-only: declares the reviewer ran in a freshly created context. */\n\treadonly freshContext?: boolean;\n}\n\n/** Streams available to matchers. */\nexport interface CommandOutputs {\n\treadonly stdout: string;\n\treadonly stderr: string;\n\treadonly combined?: string;\n}\n\n/** Outcome of {@link evaluateOutputMatchers}. */\nexport interface MatcherEvaluation {\n\treadonly pass: boolean;\n\treadonly failures: readonly string[];\n}\n\n/** Outcome of {@link aggregateGateResults}. */\nexport interface AggregationEvaluation {\n\treadonly pass: boolean;\n\treadonly passedCount: number;\n}\n\n/** Outcome of {@link verifyTraceability}. */\nexport interface TraceabilityEvaluation {\n\treadonly pass: boolean;\n\treadonly failures: readonly string[];\n}\n\nfunction selectStream(outputs: CommandOutputs, source: OutputSource): string {\n\tif (source === \"stdout\") return outputs.stdout;\n\tif (source === \"stderr\") return outputs.stderr;\n\t// `combined` defaults to stdout + stderr so callers can omit it.\n\treturn outputs.combined ?? `${outputs.stdout}${outputs.stderr}`;\n}\n\nfunction describeMatcher(matcher: OutputMatcher): string {\n\treturn `${matcher.source}/${matcher.predicate}=${JSON.stringify(matcher.value)}`;\n}\n\n/**\n * Evaluate a list of {@link OutputMatcher}s against captured command streams.\n * All matchers must pass. Invalid regex is treated as a failure (never thrown).\n */\nexport function evaluateOutputMatchers(outputs: CommandOutputs, matchers: readonly OutputMatcher[]): MatcherEvaluation {\n\tconst failures: string[] = [];\n\tfor (const matcher of matchers) {\n\t\tconst stream = selectStream(outputs, matcher.source);\n\t\tlet ok: boolean;\n\t\tif (matcher.predicate === \"includes\") {\n\t\t\tok = stream.includes(matcher.value);\n\t\t} else if (matcher.predicate === \"not-includes\") {\n\t\t\tok = !stream.includes(matcher.value);\n\t\t} else {\n\t\t\t// regex: a malformed pattern is a failed matcher, not a crash.\n\t\t\ttry {\n\t\t\t\tok = new RegExp(matcher.value).test(stream);\n\t\t\t} catch {\n\t\t\t\tfailures.push(`invalid regex for ${describeMatcher(matcher)}`);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tif (!ok) {\n\t\t\tfailures.push(`matcher failed: ${describeMatcher(matcher)}`);\n\t\t}\n\t}\n\treturn { pass: failures.length === 0, failures };\n}\n\nfunction evaluateExitCode(expected: ExpectedExitCode | undefined, exitCode: number): boolean {\n\tif (expected === undefined) return true;\n\tif (typeof expected === \"number\") return exitCode === expected;\n\treturn exitCode >= expected.min && exitCode <= expected.max;\n}\n\n/**\n * Evaluate a {@link CommandGate} against an executed-command receipt. The gate\n * passes when the exit code satisfies `expectedExitCode` (if set) AND every\n * matcher passes. No execution happens here.\n */\nexport function evaluateCommandGate(gate: CommandGate, receipt: CommandReceipt): VerificationGateResult {\n\tconst errors: string[] = [];\n\tconst exitOk = evaluateExitCode(gate.expectedExitCode, receipt.exitCode);\n\tif (!exitOk) {\n\t\terrors.push(`exit code ${receipt.exitCode} did not satisfy ${JSON.stringify(gate.expectedExitCode)}`);\n\t}\n\tconst matcherResult = evaluateOutputMatchers(receipt, gate.matchers ?? []);\n\tconst pass = exitOk && matcherResult.pass;\n\treturn {\n\t\tid: gate.id,\n\t\tkind: \"command\",\n\t\tpass,\n\t\texitCode: receipt.exitCode,\n\t\t...(matcherResult.failures.length > 0 ? { matcherFailures: matcherResult.failures } : {}),\n\t\t...(errors.length > 0 ? { errors } : {}),\n\t};\n}\n\n/**\n * Aggregate gate results under an {@link EvidencePolicy}.\n *\n * - `all` : passes only when there is at least one gate and every gate passes.\n * - `quorum` : passes when at least `requiredPasses` gates pass.\n */\nexport function aggregateGateResults(\n\tresults: readonly VerificationGateResult[],\n\tpolicy: EvidencePolicy,\n): AggregationEvaluation {\n\tconst passedCount = results.filter((r) => r.pass).length;\n\tlet pass: boolean;\n\tif (policy.mode === \"all\") {\n\t\tpass = results.length > 0 && passedCount === results.length;\n\t} else {\n\t\tpass = passedCount >= policy.requiredPasses;\n\t}\n\treturn { pass, passedCount };\n}\n\n/**\n * Verify every requirement id is covered by enough passed gates.\n *\n * For each requirement id in `requirements`, its {@link RequirementLink} must\n * exist and at least `minPassingGates` (default 1) of its linked gate ids must\n * appear in `passedGateIds`. A missing link is a traceability gap.\n */\nexport function verifyTraceability(\n\trequirements: readonly string[],\n\tlinks: readonly RequirementLink[],\n\tpassedGateIds: readonly string[],\n): TraceabilityEvaluation {\n\tconst failures: string[] = [];\n\tconst passed = new Set(passedGateIds);\n\tconst byId = new Map<string, RequirementLink>();\n\tfor (const link of links) byId.set(link.requirementId, link);\n\tfor (const requirementId of requirements) {\n\t\tconst link = byId.get(requirementId);\n\t\tif (!link) {\n\t\t\tfailures.push(`requirement ${requirementId} has no gate link (traceability gap)`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst minPassing = link.minPassingGates ?? 1;\n\t\tconst passing = link.gateIds.filter((id) => passed.has(id)).length;\n\t\tif (passing < minPassing) {\n\t\t\tfailures.push(`requirement ${requirementId} covered by ${passing}/${minPassing} passed gates`);\n\t\t}\n\t}\n\treturn { pass: failures.length === 0, failures };\n}\n\n/**\n * Check reviewer/executor independence.\n *\n * Passes only when:\n * - the reviewer's model differs from the executor's model, OR\n * - the reviewer's context differs AND the reviewer declared `freshContext`.\n *\n * This is the fail-closed gate that prevents a node's executor from also being\n * its verifier.\n */\nexport function checkReviewerExecutorIndependence(executor: AgentContext, reviewer: AgentContext): boolean {\n\tconst differentModel = reviewer.modelId !== executor.modelId;\n\tconst freshDifferentContext = reviewer.contextId !== executor.contextId && reviewer.freshContext === true;\n\treturn differentModel || freshDifferentContext;\n}\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { ProcurementReview } from "./package-procurement.ts";
|
|
2
|
+
import type { PackageSource } from "./settings-manager.ts";
|
|
3
|
+
export type CompositionSurface = "theme" | "footer" | "header" | "editor" | "tool-row" | "assistant-markdown" | "status" | "permission" | "structured-input" | "report-preview" | "loadout";
|
|
4
|
+
export type OmkOwnedDomain = "ontology" | "search" | "memory" | "cache" | "compaction" | "multi-agent" | "session" | "scheduler";
|
|
5
|
+
export type CompositionVerdict = "admit" | "reject" | "defer" | "canary";
|
|
6
|
+
export interface CompositionResourceFilter {
|
|
7
|
+
extensions: boolean;
|
|
8
|
+
skills: boolean;
|
|
9
|
+
prompts: boolean;
|
|
10
|
+
themes: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SurfaceOwnerRule {
|
|
13
|
+
surface: CompositionSurface;
|
|
14
|
+
ownerPackageIdentity: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PackageCompositionPolicy {
|
|
17
|
+
readonly omkOwnedDomains: readonly OmkOwnedDomain[];
|
|
18
|
+
readonly surfaceOwnership: readonly SurfaceOwnerRule[];
|
|
19
|
+
readonly allowedResources: Readonly<Record<string, Partial<CompositionResourceFilter>>>;
|
|
20
|
+
readonly capabilityToSurfaces: Readonly<Record<string, readonly CompositionSurface[]>>;
|
|
21
|
+
readonly capabilityToOmkDomains: Readonly<Record<string, readonly OmkOwnedDomain[]>>;
|
|
22
|
+
}
|
|
23
|
+
export interface CompositionInput {
|
|
24
|
+
identity: string;
|
|
25
|
+
review: ProcurementReview;
|
|
26
|
+
requestedSurfaces?: readonly CompositionSurface[];
|
|
27
|
+
}
|
|
28
|
+
export interface CompositionConflict {
|
|
29
|
+
kind: "duplicate-surface-owner" | "omk-domain-mutation" | "unapproved-surface" | "capability-surface-mismatch" | "resource-filter-blocked";
|
|
30
|
+
surface?: CompositionSurface;
|
|
31
|
+
domain?: OmkOwnedDomain;
|
|
32
|
+
owner?: string;
|
|
33
|
+
capability?: string;
|
|
34
|
+
reason: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CompositionReview {
|
|
37
|
+
identity: string;
|
|
38
|
+
verdict: CompositionVerdict;
|
|
39
|
+
allowedResources: CompositionResourceFilter;
|
|
40
|
+
admittedSurfaces: CompositionSurface[];
|
|
41
|
+
conflicts: CompositionConflict[];
|
|
42
|
+
deferredReason?: string;
|
|
43
|
+
rejectedReasons: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface CompositionPromotionRecord {
|
|
46
|
+
schemaVersion: "omk.package-composition.promotion.v1";
|
|
47
|
+
identity: string;
|
|
48
|
+
source: string;
|
|
49
|
+
scope: "project";
|
|
50
|
+
allowedResources: CompositionResourceFilter;
|
|
51
|
+
admittedSurfaces: CompositionSurface[];
|
|
52
|
+
reviewedAt: string;
|
|
53
|
+
reviewedBy: "manual" | "root-orchestrator";
|
|
54
|
+
}
|
|
55
|
+
export declare function createDefaultCompositionPolicy(): PackageCompositionPolicy;
|
|
56
|
+
export declare function checkSingleSurfaceOwner(identity: string, requestedSurfaces: readonly CompositionSurface[], existingOwners: readonly SurfaceOwnerRule[]): CompositionConflict[];
|
|
57
|
+
export declare function checkOmkDomainMutation(identity: string, capabilities: readonly string[], policy: PackageCompositionPolicy): CompositionConflict[];
|
|
58
|
+
export declare function checkCapabilitySurfaceMatch(identity: string, requestedSurfaces: readonly CompositionSurface[], capabilities: readonly string[], policy: PackageCompositionPolicy): CompositionConflict[];
|
|
59
|
+
export declare function resolveResourceFilter(identity: string, policy: PackageCompositionPolicy): CompositionResourceFilter;
|
|
60
|
+
export declare function inferRequestedSurfaces(review: ProcurementReview, policy: PackageCompositionPolicy): CompositionSurface[];
|
|
61
|
+
export declare function composePackage(input: CompositionInput, policy: PackageCompositionPolicy): CompositionReview;
|
|
62
|
+
export declare function composeCandidateBatch(inputs: readonly CompositionInput[], basePolicy: PackageCompositionPolicy): CompositionReview[];
|
|
63
|
+
export declare function toPackageSource(review: CompositionReview): PackageSource;
|
|
64
|
+
export declare function createPromotionRecord(review: CompositionReview, source: string, options?: {
|
|
65
|
+
reviewedBy?: "manual" | "root-orchestrator";
|
|
66
|
+
now?: Date;
|
|
67
|
+
}): CompositionPromotionRecord;
|
|
68
|
+
//# sourceMappingURL=package-composition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-composition.d.ts","sourceRoot":"","sources":["../../src/core/package-composition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAC3B,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,oBAAoB,GACpB,QAAQ,GACR,YAAY,GACZ,kBAAkB,GAClB,gBAAgB,GAChB,SAAS,CAAC;AAEb,MAAM,MAAM,cAAc,GACvB,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,aAAa,GACb,SAAS,GACT,WAAW,CAAC;AAEf,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEzE,MAAM,WAAW,yBAAyB;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACxC,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B,GAAG,aAAa,CAYxE;AAED,wBAAgB,qBAAqB,CACpC,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,mBAAmB,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAO,GACvE,0BAA0B,CAY5B","sourcesContent":["import type { ProcurementReview } from \"./package-procurement.ts\";\nimport type { PackageSource } from \"./settings-manager.ts\";\n\nexport type CompositionSurface =\n\t| \"theme\"\n\t| \"footer\"\n\t| \"header\"\n\t| \"editor\"\n\t| \"tool-row\"\n\t| \"assistant-markdown\"\n\t| \"status\"\n\t| \"permission\"\n\t| \"structured-input\"\n\t| \"report-preview\"\n\t| \"loadout\";\n\nexport type OmkOwnedDomain =\n\t| \"ontology\"\n\t| \"search\"\n\t| \"memory\"\n\t| \"cache\"\n\t| \"compaction\"\n\t| \"multi-agent\"\n\t| \"session\"\n\t| \"scheduler\";\n\nexport type CompositionVerdict = \"admit\" | \"reject\" | \"defer\" | \"canary\";\n\nexport interface CompositionResourceFilter {\n\textensions: boolean;\n\tskills: boolean;\n\tprompts: boolean;\n\tthemes: boolean;\n}\n\nexport interface SurfaceOwnerRule {\n\tsurface: CompositionSurface;\n\townerPackageIdentity: string;\n}\n\nexport interface PackageCompositionPolicy {\n\treadonly omkOwnedDomains: readonly OmkOwnedDomain[];\n\treadonly surfaceOwnership: readonly SurfaceOwnerRule[];\n\treadonly allowedResources: Readonly<Record<string, Partial<CompositionResourceFilter>>>;\n\treadonly capabilityToSurfaces: Readonly<Record<string, readonly CompositionSurface[]>>;\n\treadonly capabilityToOmkDomains: Readonly<Record<string, readonly OmkOwnedDomain[]>>;\n}\n\nexport interface CompositionInput {\n\tidentity: string;\n\treview: ProcurementReview;\n\trequestedSurfaces?: readonly CompositionSurface[];\n}\n\nexport interface CompositionConflict {\n\tkind:\n\t\t| \"duplicate-surface-owner\"\n\t\t| \"omk-domain-mutation\"\n\t\t| \"unapproved-surface\"\n\t\t| \"capability-surface-mismatch\"\n\t\t| \"resource-filter-blocked\";\n\tsurface?: CompositionSurface;\n\tdomain?: OmkOwnedDomain;\n\towner?: string;\n\tcapability?: string;\n\treason: string;\n}\n\nexport interface CompositionReview {\n\tidentity: string;\n\tverdict: CompositionVerdict;\n\tallowedResources: CompositionResourceFilter;\n\tadmittedSurfaces: CompositionSurface[];\n\tconflicts: CompositionConflict[];\n\tdeferredReason?: string;\n\trejectedReasons: string[];\n}\n\nexport interface CompositionPromotionRecord {\n\tschemaVersion: \"omk.package-composition.promotion.v1\";\n\tidentity: string;\n\tsource: string;\n\tscope: \"project\";\n\tallowedResources: CompositionResourceFilter;\n\tadmittedSurfaces: CompositionSurface[];\n\treviewedAt: string;\n\treviewedBy: \"manual\" | \"root-orchestrator\";\n}\n\nconst ALL_RESOURCES: CompositionResourceFilter = {\n\textensions: true,\n\tskills: true,\n\tprompts: true,\n\tthemes: true,\n};\n\nconst SIDE_EFFECT_CAPABILITIES = new Set([\n\t\"child-process\",\n\t\"network\",\n\t\"filesystem-write\",\n\t\"browser-control\",\n\t\"telemetry\",\n]);\n\nconst RESOURCE_PATTERNS: Record<keyof CompositionResourceFilter, string[]> = {\n\textensions: [\"**/*\"],\n\tskills: [\"**/*\"],\n\tprompts: [\"**/*\"],\n\tthemes: [\"**/*\"],\n};\n\nexport function createDefaultCompositionPolicy(): PackageCompositionPolicy {\n\treturn {\n\t\tomkOwnedDomains: [\"ontology\", \"search\", \"memory\", \"cache\", \"compaction\", \"multi-agent\", \"session\", \"scheduler\"],\n\t\tsurfaceOwnership: [\n\t\t\t{ surface: \"theme\", ownerPackageIdentity: \"npm:pi-tokyo-night\" },\n\t\t\t{ surface: \"footer\", ownerPackageIdentity: \"npm:pi-zentui\" },\n\t\t\t{ surface: \"editor\", ownerPackageIdentity: \"npm:pi-zentui\" },\n\t\t\t{ surface: \"header\", ownerPackageIdentity: \"omk:core\" },\n\t\t\t{ surface: \"tool-row\", ownerPackageIdentity: \"npm:pi-claude-style-tools\" },\n\t\t\t{ surface: \"loadout\", ownerPackageIdentity: \"npm:pi-loadout\" },\n\t\t\t{ surface: \"permission\", ownerPackageIdentity: \"npm:@gotgenes/pi-permission-system\" },\n\t\t\t{ surface: \"structured-input\", ownerPackageIdentity: \"npm:@juicesharp/rpiv-ask-user-question\" },\n\t\t\t{ surface: \"report-preview\", ownerPackageIdentity: \"npm:pi-markdown-preview\" },\n\t\t],\n\t\tallowedResources: {\n\t\t\t\"npm:pi-tokyo-night\": { extensions: false, skills: false, prompts: false, themes: true },\n\t\t\t\"npm:pi-zentui\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-claude-style-tools\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-loadout\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-lens\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:@gotgenes/pi-permission-system\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:@juicesharp/rpiv-ask-user-question\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-markdown-preview\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-langfuse\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-cache-optimizer\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t\t\"npm:pi-sandbox\": { extensions: true, skills: false, prompts: false, themes: false },\n\t\t},\n\t\tcapabilityToSurfaces: {\n\t\t\tsetFooter: [\"footer\"],\n\t\t\tsetEditorComponent: [\"editor\"],\n\t\t\tsetHeader: [\"header\"],\n\t\t\tsetStatus: [\"status\"],\n\t\t\trenderCall: [\"tool-row\"],\n\t\t\trenderResult: [\"tool-row\"],\n\t\t\tregisterMessageRenderer: [\"assistant-markdown\"],\n\t\t\tsetActiveTools: [\"loadout\"],\n\t\t\tpermission: [\"permission\"],\n\t\t\taskUserQuestion: [\"structured-input\"],\n\t\t\tmarkdownPreview: [\"report-preview\"],\n\t\t},\n\t\tcapabilityToOmkDomains: {\n\t\t\tcontext: [\"session\"],\n\t\t\tbefore_provider_request: [\"cache\", \"session\"],\n\t\t\tsession_before_compact: [\"compaction\"],\n\t\t\tsetModel: [\"session\"],\n\t\t\tsetThinkingLevel: [\"session\"],\n\t\t\tmemory: [\"memory\"],\n\t\t\tcache: [\"cache\"],\n\t\t\tontology: [\"ontology\"],\n\t\t\tmultiAgent: [\"multi-agent\"],\n\t\t\tscheduler: [\"scheduler\"],\n\t\t},\n\t};\n}\n\nexport function checkSingleSurfaceOwner(\n\tidentity: string,\n\trequestedSurfaces: readonly CompositionSurface[],\n\texistingOwners: readonly SurfaceOwnerRule[],\n): CompositionConflict[] {\n\tconst key = packageIdentityKey(identity);\n\tconst conflicts: CompositionConflict[] = [];\n\tfor (const surface of uniqueSorted(requestedSurfaces)) {\n\t\tconst owner = existingOwners.find((rule) => rule.surface === surface);\n\t\tif (!owner) continue;\n\t\tif (owner.ownerPackageIdentity === key || owner.ownerPackageIdentity === identity) continue;\n\t\tconflicts.push({\n\t\t\tkind: \"duplicate-surface-owner\",\n\t\t\tsurface,\n\t\t\towner: owner.ownerPackageIdentity,\n\t\t\treason: `${identity} cannot claim ${surface}; ${owner.ownerPackageIdentity} already owns it`,\n\t\t});\n\t}\n\treturn conflicts;\n}\n\nexport function checkOmkDomainMutation(\n\tidentity: string,\n\tcapabilities: readonly string[],\n\tpolicy: PackageCompositionPolicy,\n): CompositionConflict[] {\n\tconst conflicts: CompositionConflict[] = [];\n\tfor (const capability of capabilities) {\n\t\tconst domains = policy.capabilityToOmkDomains[capability] ?? [];\n\t\tfor (const domain of domains) {\n\t\t\tconflicts.push({\n\t\t\t\tkind: \"omk-domain-mutation\",\n\t\t\t\tdomain,\n\t\t\t\tcapability,\n\t\t\t\treason: `${identity} requested ${capability}, which mutates OMK-owned ${domain}`,\n\t\t\t});\n\t\t}\n\t}\n\treturn conflicts;\n}\n\nexport function checkCapabilitySurfaceMatch(\n\tidentity: string,\n\trequestedSurfaces: readonly CompositionSurface[],\n\tcapabilities: readonly string[],\n\tpolicy: PackageCompositionPolicy,\n): CompositionConflict[] {\n\tif (capabilities.length === 0) return [];\n\tconst supported = new Set<CompositionSurface>();\n\tfor (const capability of capabilities) {\n\t\tfor (const surface of policy.capabilityToSurfaces[capability] ?? []) {\n\t\t\tsupported.add(surface);\n\t\t}\n\t}\n\n\treturn uniqueSorted(requestedSurfaces)\n\t\t.filter((surface) => !supported.has(surface))\n\t\t.map((surface) => ({\n\t\t\tkind: \"capability-surface-mismatch\" as const,\n\t\t\tsurface,\n\t\t\treason: `${identity} requested ${surface}, but no detected capability supports that surface`,\n\t\t}));\n}\n\nexport function resolveResourceFilter(identity: string, policy: PackageCompositionPolicy): CompositionResourceFilter {\n\tconst override = policy.allowedResources[identity] ?? policy.allowedResources[packageIdentityKey(identity)] ?? {};\n\treturn { ...ALL_RESOURCES, ...override };\n}\n\nexport function inferRequestedSurfaces(\n\treview: ProcurementReview,\n\tpolicy: PackageCompositionPolicy,\n): CompositionSurface[] {\n\tconst surfaces = new Set<CompositionSurface>();\n\tfor (const resource of review.candidate.expectedResources) {\n\t\tif (resource === \"theme\") surfaces.add(\"theme\");\n\t}\n\tfor (const capability of review.capabilities) {\n\t\tfor (const surface of policy.capabilityToSurfaces[capability] ?? []) {\n\t\t\tsurfaces.add(surface);\n\t\t}\n\t}\n\treturn uniqueSorted([...surfaces]);\n}\n\nexport function composePackage(input: CompositionInput, policy: PackageCompositionPolicy): CompositionReview {\n\tconst requestedSurfaces = uniqueSorted(input.requestedSurfaces ?? inferRequestedSurfaces(input.review, policy));\n\tconst allowedResources = resolveResourceFilter(input.identity, policy);\n\tconst conflicts = [\n\t\t...checkSingleSurfaceOwner(input.identity, requestedSurfaces, policy.surfaceOwnership),\n\t\t...checkOmkDomainMutation(input.identity, input.review.capabilities, policy),\n\t\t...checkCapabilitySurfaceMatch(input.identity, requestedSurfaces, input.review.capabilities, policy),\n\t\t...checkResourceFilter(input.identity, requestedSurfaces, allowedResources),\n\t];\n\n\tconst rejectedReasons = [...input.review.rejectedReasons, ...conflicts.map((conflict) => conflict.reason)];\n\tconst blockingConflict = conflicts.find((conflict) =>\n\t\t[\n\t\t\t\"duplicate-surface-owner\",\n\t\t\t\"omk-domain-mutation\",\n\t\t\t\"unapproved-surface\",\n\t\t\t\"capability-surface-mismatch\",\n\t\t\t\"resource-filter-blocked\",\n\t\t].includes(conflict.kind),\n\t);\n\n\tif (!input.review.pinned) {\n\t\treturn compositionReview(input.identity, \"reject\", allowedResources, requestedSurfaces, conflicts, undefined, [\n\t\t\t...rejectedReasons,\n\t\t\t\"missing-exact-pin\",\n\t\t]);\n\t}\n\tif (input.review.licenseVerdict === \"reject\" || input.review.lifecycleVerdict === \"reject\") {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"reject\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tundefined,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\tif (input.review.pathCompatibility === \"pi-hardcoded\") {\n\t\treturn compositionReview(input.identity, \"reject\", allowedResources, requestedSurfaces, conflicts, undefined, [\n\t\t\t...rejectedReasons,\n\t\t\t\"pi-hardcoded-paths\",\n\t\t]);\n\t}\n\tif (blockingConflict) {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"reject\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tundefined,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\tif (input.review.adoption === \"deferred\") {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"defer\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tinput.review.deferredReason,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\tif (input.review.adoption === \"reject\") {\n\t\treturn compositionReview(\n\t\t\tinput.identity,\n\t\t\t\"reject\",\n\t\t\tallowedResources,\n\t\t\trequestedSurfaces,\n\t\t\tconflicts,\n\t\t\tundefined,\n\t\t\trejectedReasons,\n\t\t);\n\t}\n\n\tconst canaryReasons = canaryRequiredReasons(input.review.capabilities);\n\tif (input.review.risk === \"high\" && canaryReasons.length === 0) {\n\t\tcanaryReasons.push(\"canary-required: high-risk\");\n\t}\n\tif (canaryReasons.length > 0) {\n\t\treturn compositionReview(input.identity, \"canary\", allowedResources, requestedSurfaces, conflicts, undefined, [\n\t\t\t...rejectedReasons,\n\t\t\t...canaryReasons,\n\t\t]);\n\t}\n\n\treturn compositionReview(\n\t\tinput.identity,\n\t\t\"admit\",\n\t\tallowedResources,\n\t\trequestedSurfaces,\n\t\tconflicts,\n\t\tundefined,\n\t\trejectedReasons,\n\t);\n}\n\nexport function composeCandidateBatch(\n\tinputs: readonly CompositionInput[],\n\tbasePolicy: PackageCompositionPolicy,\n): CompositionReview[] {\n\tconst owners = [...basePolicy.surfaceOwnership];\n\tconst results: CompositionReview[] = [];\n\tfor (const input of inputs) {\n\t\tconst policy = { ...basePolicy, surfaceOwnership: owners };\n\t\tconst result = composePackage(input, policy);\n\t\tresults.push(result);\n\t\tif (result.verdict === \"admit\" || result.verdict === \"canary\") {\n\t\t\tconst ownerKey = packageIdentityKey(result.identity);\n\t\t\tfor (const surface of result.admittedSurfaces) {\n\t\t\t\tif (!owners.some((owner) => owner.surface === surface)) {\n\t\t\t\t\towners.push({ surface, ownerPackageIdentity: ownerKey });\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn results;\n}\n\nexport function toPackageSource(review: CompositionReview): PackageSource {\n\tassertPromotable(review);\n\tif (isAllResourcesEnabled(review.allowedResources)) {\n\t\treturn review.identity;\n\t}\n\treturn {\n\t\tsource: review.identity,\n\t\textensions: review.allowedResources.extensions ? RESOURCE_PATTERNS.extensions : [],\n\t\tskills: review.allowedResources.skills ? RESOURCE_PATTERNS.skills : [],\n\t\tprompts: review.allowedResources.prompts ? RESOURCE_PATTERNS.prompts : [],\n\t\tthemes: review.allowedResources.themes ? RESOURCE_PATTERNS.themes : [],\n\t};\n}\n\nexport function createPromotionRecord(\n\treview: CompositionReview,\n\tsource: string,\n\toptions: { reviewedBy?: \"manual\" | \"root-orchestrator\"; now?: Date } = {},\n): CompositionPromotionRecord {\n\tassertPromotable(review);\n\treturn {\n\t\tschemaVersion: \"omk.package-composition.promotion.v1\",\n\t\tidentity: review.identity,\n\t\tsource: redactSource(source),\n\t\tscope: \"project\",\n\t\tallowedResources: review.allowedResources,\n\t\tadmittedSurfaces: review.admittedSurfaces,\n\t\treviewedAt: (options.now ?? new Date()).toISOString(),\n\t\treviewedBy: options.reviewedBy ?? \"root-orchestrator\",\n\t};\n}\n\nfunction checkResourceFilter(\n\tidentity: string,\n\trequestedSurfaces: readonly CompositionSurface[],\n\tfilter: CompositionResourceFilter,\n): CompositionConflict[] {\n\tconst conflicts: CompositionConflict[] = [];\n\tfor (const surface of requestedSurfaces) {\n\t\tconst resource = resourceForSurface(surface);\n\t\tif (filter[resource]) continue;\n\t\tconflicts.push({\n\t\t\tkind: \"resource-filter-blocked\",\n\t\t\tsurface,\n\t\t\treason: `${identity} requested ${surface}, but ${resource} resources are disabled`,\n\t\t});\n\t}\n\treturn conflicts;\n}\n\nfunction resourceForSurface(surface: CompositionSurface): keyof CompositionResourceFilter {\n\treturn surface === \"theme\" ? \"themes\" : \"extensions\";\n}\n\nfunction canaryRequiredReasons(capabilities: readonly string[]): string[] {\n\tconst reasons: string[] = [];\n\tfor (const capability of capabilities) {\n\t\tif (SIDE_EFFECT_CAPABILITIES.has(capability)) {\n\t\t\treasons.push(`canary-required: ${capability}`);\n\t\t}\n\t}\n\treturn uniqueSorted(reasons);\n}\n\nfunction compositionReview(\n\tidentity: string,\n\tverdict: CompositionVerdict,\n\tallowedResources: CompositionResourceFilter,\n\tadmittedSurfaces: readonly CompositionSurface[],\n\tconflicts: readonly CompositionConflict[],\n\tdeferredReason: string | undefined,\n\trejectedReasons: readonly string[],\n): CompositionReview {\n\treturn {\n\t\tidentity,\n\t\tverdict,\n\t\tallowedResources,\n\t\tadmittedSurfaces: uniqueSorted(admittedSurfaces),\n\t\tconflicts: [...conflicts],\n\t\t...(deferredReason === undefined ? {} : { deferredReason }),\n\t\trejectedReasons: uniqueSorted(rejectedReasons),\n\t};\n}\n\nfunction assertPromotable(review: CompositionReview): void {\n\tif (review.verdict !== \"admit\") {\n\t\tthrow new Error(`Package composition verdict ${review.verdict} cannot be promoted`);\n\t}\n}\n\nfunction isAllResourcesEnabled(filter: CompositionResourceFilter): boolean {\n\treturn filter.extensions && filter.skills && filter.prompts && filter.themes;\n}\n\nfunction packageIdentityKey(identity: string): string {\n\tif (!identity.startsWith(\"npm:\")) return identity;\n\tconst spec = identity.slice(\"npm:\".length);\n\tconst at = spec.lastIndexOf(\"@\");\n\tif (at <= 0) return identity;\n\tif (spec.startsWith(\"@\")) {\n\t\tconst scopedVersionAt = spec.indexOf(\"@\", spec.indexOf(\"/\") + 1);\n\t\treturn scopedVersionAt > 0 ? `npm:${spec.slice(0, scopedVersionAt)}` : identity;\n\t}\n\treturn `npm:${spec.slice(0, at)}`;\n}\n\nfunction uniqueSorted<T extends string>(values: readonly T[]): T[] {\n\treturn [...new Set(values)].sort();\n}\n\nfunction redactSource(source: string): string {\n\treturn source\n\t\t.replace(/(https?:\\/\\/)([^\\s/@]+@)/gi, \"$1<redacted>@\")\n\t\t.replace(/([?&](?:access_token|auth|key|password|token)=)[^&#]+/gi, \"$1<redacted>\");\n}\n"]}
|