open-multi-agent-kit 0.80.7 → 0.90.0
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 +5 -27
- package/README.md +81 -38
- package/dist/agents/jailbreak/index.d.ts +7 -0
- package/dist/agents/jailbreak/index.d.ts.map +1 -0
- package/dist/agents/jailbreak/index.js +7 -0
- package/dist/agents/jailbreak/index.js.map +1 -0
- package/dist/agents/jailbreak/subagent-f.d.ts +44 -0
- package/dist/agents/jailbreak/subagent-f.d.ts.map +1 -0
- package/dist/agents/jailbreak/subagent-f.js +60 -0
- package/dist/agents/jailbreak/subagent-f.js.map +1 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/register-bedrock.js +2 -2
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/ci/verify-reporter.d.ts +22 -0
- package/dist/ci/verify-reporter.d.ts.map +1 -0
- package/dist/ci/verify-reporter.js +50 -0
- package/dist/ci/verify-reporter.js.map +1 -0
- package/dist/cli/args.d.ts +4 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +8 -0
- package/dist/cli/args.js.map +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/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/jailbreak-args.d.ts +26 -0
- package/dist/cli/jailbreak-args.d.ts.map +1 -0
- package/dist/cli/jailbreak-args.js +86 -0
- package/dist/cli/jailbreak-args.js.map +1 -0
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/commands/doctor-provider.d.ts +19 -0
- package/dist/commands/doctor-provider.d.ts.map +1 -0
- package/dist/commands/doctor-provider.js +123 -0
- package/dist/commands/doctor-provider.js.map +1 -0
- package/dist/commands/jailbreak.d.ts +49 -0
- package/dist/commands/jailbreak.d.ts.map +1 -0
- package/dist/commands/jailbreak.js +201 -0
- package/dist/commands/jailbreak.js.map +1 -0
- package/dist/config.d.ts +9 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +33 -52
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-services.d.ts +2 -2
- package/dist/core/agent-session-services.d.ts.map +1 -1
- package/dist/core/agent-session-services.js.map +1 -1
- package/dist/core/agent-session.d.ts +16 -27
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +185 -89
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +3 -6
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +7 -7
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/automation/index.d.ts +359 -0
- package/dist/core/automation/index.d.ts.map +1 -0
- package/dist/core/automation/index.js +665 -0
- package/dist/core/automation/index.js.map +1 -0
- package/dist/core/bash-executor.d.ts +1 -0
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +1 -0
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/browser-use.d.ts +53 -0
- package/dist/core/browser-use.d.ts.map +1 -0
- package/dist/core/browser-use.js +108 -0
- package/dist/core/browser-use.js.map +1 -0
- package/dist/core/command-safety-parser.d.ts +77 -0
- package/dist/core/command-safety-parser.d.ts.map +1 -0
- package/dist/core/command-safety-parser.js +763 -0
- package/dist/core/command-safety-parser.js.map +1 -0
- package/dist/core/command-safety.d.ts.map +1 -1
- package/dist/core/command-safety.js +106 -3
- package/dist/core/command-safety.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +5 -21
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +3 -101
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +21 -656
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -2
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/compactor.d.ts +42 -0
- package/dist/core/compactor.d.ts.map +1 -0
- package/dist/core/compactor.js +131 -0
- package/dist/core/compactor.js.map +1 -0
- package/dist/core/context-budget-compressors.d.ts +50 -0
- package/dist/core/context-budget-compressors.d.ts.map +1 -0
- package/dist/core/context-budget-compressors.js +166 -0
- package/dist/core/context-budget-compressors.js.map +1 -0
- package/dist/core/context-budget-governor-v2.d.ts +7 -0
- package/dist/core/context-budget-governor-v2.d.ts.map +1 -0
- package/dist/core/context-budget-governor-v2.js +7 -0
- package/dist/core/context-budget-governor-v2.js.map +1 -0
- package/dist/core/context-budget-governor.d.ts +67 -0
- package/dist/core/context-budget-governor.d.ts.map +1 -0
- package/dist/core/context-budget-governor.js +224 -0
- package/dist/core/context-budget-governor.js.map +1 -0
- package/dist/core/context-budget-headroom-candidates.d.ts +3 -0
- package/dist/core/context-budget-headroom-candidates.d.ts.map +1 -0
- package/dist/core/context-budget-headroom-candidates.js +85 -0
- package/dist/core/context-budget-headroom-candidates.js.map +1 -0
- package/dist/core/context-budget-headroom-types.d.ts +67 -0
- package/dist/core/context-budget-headroom-types.d.ts.map +1 -0
- package/dist/core/context-budget-headroom-types.js +46 -0
- package/dist/core/context-budget-headroom-types.js.map +1 -0
- package/dist/core/context-budget-headroom.d.ts +5 -0
- package/dist/core/context-budget-headroom.d.ts.map +1 -0
- package/dist/core/context-budget-headroom.js +123 -0
- package/dist/core/context-budget-headroom.js.map +1 -0
- package/dist/core/context-budget-relevance.d.ts +46 -0
- package/dist/core/context-budget-relevance.d.ts.map +1 -0
- package/dist/core/context-budget-relevance.js +329 -0
- package/dist/core/context-budget-relevance.js.map +1 -0
- package/dist/core/context-budget-system-prompt-items.d.ts +19 -0
- package/dist/core/context-budget-system-prompt-items.d.ts.map +1 -0
- package/dist/core/context-budget-system-prompt-items.js +143 -0
- package/dist/core/context-budget-system-prompt-items.js.map +1 -0
- package/dist/core/context-budget-system-prompt.d.ts +31 -0
- package/dist/core/context-budget-system-prompt.d.ts.map +1 -0
- package/dist/core/context-budget-system-prompt.js +87 -0
- package/dist/core/context-budget-system-prompt.js.map +1 -0
- package/dist/core/context-budget-token-counter.d.ts +34 -0
- package/dist/core/context-budget-token-counter.d.ts.map +1 -0
- package/dist/core/context-budget-token-counter.js +315 -0
- package/dist/core/context-budget-token-counter.js.map +1 -0
- package/dist/core/context-budget-v2-coverage.d.ts +5 -0
- package/dist/core/context-budget-v2-coverage.d.ts.map +1 -0
- package/dist/core/context-budget-v2-coverage.js +58 -0
- package/dist/core/context-budget-v2-coverage.js.map +1 -0
- package/dist/core/context-budget-v2-plan-hash.d.ts +12 -0
- package/dist/core/context-budget-v2-plan-hash.d.ts.map +1 -0
- package/dist/core/context-budget-v2-plan-hash.js +38 -0
- package/dist/core/context-budget-v2-plan-hash.js.map +1 -0
- package/dist/core/context-budget-v2-planner.d.ts +3 -0
- package/dist/core/context-budget-v2-planner.d.ts.map +1 -0
- package/dist/core/context-budget-v2-planner.js +143 -0
- package/dist/core/context-budget-v2-planner.js.map +1 -0
- package/dist/core/context-budget-v2-scoring.d.ts +14 -0
- package/dist/core/context-budget-v2-scoring.d.ts.map +1 -0
- package/dist/core/context-budget-v2-scoring.js +114 -0
- package/dist/core/context-budget-v2-scoring.js.map +1 -0
- package/dist/core/context-budget-v2-selection.d.ts +32 -0
- package/dist/core/context-budget-v2-selection.d.ts.map +1 -0
- package/dist/core/context-budget-v2-selection.js +158 -0
- package/dist/core/context-budget-v2-selection.js.map +1 -0
- package/dist/core/context-budget-v2-tiers.d.ts +15 -0
- package/dist/core/context-budget-v2-tiers.d.ts.map +1 -0
- package/dist/core/context-budget-v2-tiers.js +68 -0
- package/dist/core/context-budget-v2-tiers.js.map +1 -0
- package/dist/core/context-budget-v2-types.d.ts +92 -0
- package/dist/core/context-budget-v2-types.d.ts.map +1 -0
- package/dist/core/context-budget-v2-types.js +24 -0
- package/dist/core/context-budget-v2-types.js.map +1 -0
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/diagnostics.d.ts +6 -0
- package/dist/core/diagnostics.d.ts.map +1 -1
- package/dist/core/diagnostics.js.map +1 -1
- package/dist/core/domain-confidence.d.ts +9 -0
- package/dist/core/domain-confidence.d.ts.map +1 -0
- package/dist/core/domain-confidence.js +39 -0
- package/dist/core/domain-confidence.js.map +1 -0
- package/dist/core/domain-dispatch.d.ts +44 -0
- package/dist/core/domain-dispatch.d.ts.map +1 -0
- package/dist/core/domain-dispatch.js +118 -0
- package/dist/core/domain-dispatch.js.map +1 -0
- package/dist/core/domain-loadouts.d.ts +76 -0
- package/dist/core/domain-loadouts.d.ts.map +1 -0
- package/dist/core/domain-loadouts.js +981 -0
- package/dist/core/domain-loadouts.js.map +1 -0
- package/dist/core/domain-registry.d.ts +7 -0
- package/dist/core/domain-registry.d.ts.map +1 -0
- package/dist/core/domain-registry.js +11 -0
- package/dist/core/domain-registry.js.map +1 -0
- package/dist/core/domain-router.d.ts +16 -0
- package/dist/core/domain-router.d.ts.map +1 -0
- package/dist/core/domain-router.js +24 -0
- package/dist/core/domain-router.js.map +1 -0
- package/dist/core/domain-score.d.ts +13 -0
- package/dist/core/domain-score.d.ts.map +1 -0
- package/dist/core/domain-score.js +48 -0
- package/dist/core/domain-score.js.map +1 -0
- package/dist/core/domain-trigger-match.d.ts +14 -0
- package/dist/core/domain-trigger-match.d.ts.map +1 -0
- package/dist/core/domain-trigger-match.js +51 -0
- package/dist/core/domain-trigger-match.js.map +1 -0
- package/dist/core/domain-types.d.ts +30 -0
- package/dist/core/domain-types.d.ts.map +1 -0
- package/dist/core/domain-types.js +2 -0
- package/dist/core/domain-types.js.map +1 -0
- package/dist/core/exact-cache-policy.d.ts +8 -0
- package/dist/core/exact-cache-policy.d.ts.map +1 -1
- package/dist/core/exact-cache-policy.js +9 -0
- package/dist/core/exact-cache-policy.js.map +1 -1
- package/dist/core/exec.d.ts +0 -2
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +0 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/index.d.ts +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.js +1 -3
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/builtin/command-safety-gate.d.ts +3 -0
- package/dist/core/extensions/builtin/command-safety-gate.d.ts.map +1 -1
- package/dist/core/extensions/builtin/command-safety-gate.js +15 -3
- package/dist/core/extensions/builtin/command-safety-gate.js.map +1 -1
- package/dist/core/extensions/builtin/todo-checklist.d.ts +20 -0
- package/dist/core/extensions/builtin/todo-checklist.d.ts.map +1 -0
- package/dist/core/extensions/builtin/todo-checklist.js +73 -0
- package/dist/core/extensions/builtin/todo-checklist.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 +57 -92
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +3 -3
- 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 +7 -35
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +3 -1
- package/dist/core/footer-data-provider.d.ts.map +1 -1
- package/dist/core/footer-data-provider.js +4 -0
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/headroom.d.ts +45 -0
- package/dist/core/headroom.d.ts.map +1 -0
- package/dist/core/headroom.js +171 -0
- package/dist/core/headroom.js.map +1 -0
- package/dist/core/hook-inventory.d.ts +4 -2
- package/dist/core/hook-inventory.d.ts.map +1 -1
- package/dist/core/hook-inventory.js +80 -11
- package/dist/core/hook-inventory.js.map +1 -1
- package/dist/core/hooks/fail-closed.d.ts +4 -1
- package/dist/core/hooks/fail-closed.d.ts.map +1 -1
- package/dist/core/hooks/fail-closed.js +79 -5
- package/dist/core/hooks/fail-closed.js.map +1 -1
- package/dist/core/hooks/index.d.ts +2 -2
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +1 -1
- package/dist/core/hooks/index.js.map +1 -1
- package/dist/core/hooks/types.d.ts +9 -0
- package/dist/core/hooks/types.d.ts.map +1 -1
- package/dist/core/hooks/types.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -14
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -31
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/lean-ctx.d.ts +99 -0
- package/dist/core/lean-ctx.d.ts.map +1 -0
- package/dist/core/lean-ctx.js +225 -0
- package/dist/core/lean-ctx.js.map +1 -0
- package/dist/core/loadout-compose.d.ts +53 -0
- package/dist/core/loadout-compose.d.ts.map +1 -0
- package/dist/core/loadout-compose.js +172 -0
- package/dist/core/loadout-compose.js.map +1 -0
- package/dist/core/loadout-policy-bridge.d.ts +22 -0
- package/dist/core/loadout-policy-bridge.d.ts.map +1 -0
- package/dist/core/loadout-policy-bridge.js +52 -0
- package/dist/core/loadout-policy-bridge.js.map +1 -0
- package/dist/core/loadout-runtime.d.ts +22 -0
- package/dist/core/loadout-runtime.d.ts.map +1 -1
- package/dist/core/loadout-runtime.js +41 -5
- package/dist/core/loadout-runtime.js.map +1 -1
- package/dist/core/loadout-safety.d.ts +55 -0
- package/dist/core/loadout-safety.d.ts.map +1 -0
- package/dist/core/loadout-safety.js +213 -0
- package/dist/core/loadout-safety.js.map +1 -0
- package/dist/core/loadouts.d.ts +4 -2
- package/dist/core/loadouts.d.ts.map +1 -1
- package/dist/core/loadouts.js +116 -5
- package/dist/core/loadouts.js.map +1 -1
- package/dist/core/loop-gates.d.ts +48 -0
- package/dist/core/loop-gates.d.ts.map +1 -0
- package/dist/core/loop-gates.js +352 -0
- package/dist/core/loop-gates.js.map +1 -0
- package/dist/core/loop-registry.d.ts +77 -0
- package/dist/core/loop-registry.d.ts.map +1 -0
- package/dist/core/loop-registry.js +831 -0
- package/dist/core/loop-registry.js.map +1 -0
- package/dist/core/loop-types.d.ts +194 -0
- package/dist/core/loop-types.d.ts.map +1 -0
- package/dist/core/loop-types.js +2 -0
- package/dist/core/loop-types.js.map +1 -0
- package/dist/core/mcp-inventory.d.ts +7 -0
- package/dist/core/mcp-inventory.d.ts.map +1 -1
- package/dist/core/mcp-inventory.js +5 -1
- package/dist/core/mcp-inventory.js.map +1 -1
- package/dist/core/mcp-presets.d.ts +43 -2
- package/dist/core/mcp-presets.d.ts.map +1 -1
- package/dist/core/mcp-presets.js +298 -2
- package/dist/core/mcp-presets.js.map +1 -1
- package/dist/core/messages.d.ts +3 -3
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/metrics-sampler.d.ts +11 -0
- package/dist/core/metrics-sampler.d.ts.map +1 -1
- package/dist/core/metrics-sampler.js +52 -13
- package/dist/core/metrics-sampler.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -2
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +18 -41
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/package-gallery-identity.d.ts +7 -0
- package/dist/core/package-gallery-identity.d.ts.map +1 -0
- package/dist/core/package-gallery-identity.js +31 -0
- package/dist/core/package-gallery-identity.js.map +1 -0
- package/dist/core/package-gallery-install.d.ts +6 -0
- package/dist/core/package-gallery-install.d.ts.map +1 -0
- package/dist/core/package-gallery-install.js +59 -0
- package/dist/core/package-gallery-install.js.map +1 -0
- package/dist/core/package-gallery-manifest.d.ts +13 -0
- package/dist/core/package-gallery-manifest.d.ts.map +1 -0
- package/dist/core/package-gallery-manifest.js +183 -0
- package/dist/core/package-gallery-manifest.js.map +1 -0
- package/dist/core/package-gallery-trial.d.ts +4 -0
- package/dist/core/package-gallery-trial.d.ts.map +1 -0
- package/dist/core/package-gallery-trial.js +55 -0
- package/dist/core/package-gallery-trial.js.map +1 -0
- package/dist/core/package-gallery-types.d.ts +71 -0
- package/dist/core/package-gallery-types.d.ts.map +1 -0
- package/dist/core/package-gallery-types.js +2 -0
- package/dist/core/package-gallery-types.js.map +1 -0
- package/dist/core/package-gallery.d.ts +5 -123
- package/dist/core/package-gallery.d.ts.map +1 -1
- package/dist/core/package-gallery.js +5 -391
- package/dist/core/package-gallery.js.map +1 -1
- package/dist/core/package-manager.d.ts +0 -69
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +69 -367
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/package-procurement.d.ts +4 -4
- package/dist/core/package-procurement.d.ts.map +1 -1
- package/dist/core/package-procurement.js +29 -17
- package/dist/core/package-procurement.js.map +1 -1
- package/dist/core/pi-package-intake-candidates.d.ts +21 -0
- package/dist/core/pi-package-intake-candidates.d.ts.map +1 -0
- package/dist/core/pi-package-intake-candidates.js +109 -0
- package/dist/core/pi-package-intake-candidates.js.map +1 -0
- package/dist/core/pi-package-intake.d.ts +43 -0
- package/dist/core/pi-package-intake.d.ts.map +1 -0
- package/dist/core/pi-package-intake.js +122 -0
- package/dist/core/pi-package-intake.js.map +1 -0
- package/dist/core/provider-attribution.d.ts +1 -1
- package/dist/core/provider-attribution.d.ts.map +1 -1
- package/dist/core/provider-attribution.js.map +1 -1
- package/dist/core/provider-display-names.d.ts.map +1 -1
- package/dist/core/provider-display-names.js +1 -0
- package/dist/core/provider-display-names.js.map +1 -1
- package/dist/core/read-anchors.d.ts +1 -1
- package/dist/core/read-anchors.d.ts.map +1 -1
- package/dist/core/read-anchors.js +1 -1
- package/dist/core/read-anchors.js.map +1 -1
- package/dist/core/recovery-checkpoint.d.ts +2 -2
- package/dist/core/recovery-checkpoint.d.ts.map +1 -1
- package/dist/core/recovery-checkpoint.js +2 -2
- package/dist/core/recovery-checkpoint.js.map +1 -1
- 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 +2 -30
- package/dist/core/resolve-config-value.js.map +1 -1
- package/dist/core/resource-loader.d.ts +12 -20
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +67 -90
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sandbox-policy-v2.d.ts +49 -0
- package/dist/core/sandbox-policy-v2.d.ts.map +1 -0
- package/dist/core/sandbox-policy-v2.js +368 -0
- package/dist/core/sandbox-policy-v2.js.map +1 -0
- package/dist/core/sdk.d.ts +10 -78
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +97 -139
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/semantic-cache-policy.d.ts +7 -1
- package/dist/core/semantic-cache-policy.d.ts.map +1 -1
- package/dist/core/semantic-cache-policy.js +8 -0
- package/dist/core/semantic-cache-policy.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -4
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +5 -6
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -18
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +2 -48
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +5 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +149 -36
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +0 -2
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/subagent-orchestration.d.ts +73 -0
- package/dist/core/subagent-orchestration.d.ts.map +1 -0
- package/dist/core/subagent-orchestration.js +408 -0
- package/dist/core/subagent-orchestration.js.map +1 -0
- package/dist/core/system-prompt.d.ts +5 -4
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +57 -36
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/timings.d.ts +0 -4
- package/dist/core/timings.d.ts.map +1 -1
- package/dist/core/timings.js +0 -4
- package/dist/core/timings.js.map +1 -1
- package/dist/core/todo-runtime-state.d.ts +5 -0
- package/dist/core/todo-runtime-state.d.ts.map +1 -0
- package/dist/core/todo-runtime-state.js +12 -0
- package/dist/core/todo-runtime-state.js.map +1 -0
- package/dist/core/todo-state.d.ts +53 -0
- package/dist/core/todo-state.d.ts.map +1 -0
- package/dist/core/todo-state.js +87 -0
- package/dist/core/todo-state.js.map +1 -0
- package/dist/core/token-optimizer.d.ts +58 -0
- package/dist/core/token-optimizer.d.ts.map +1 -0
- package/dist/core/token-optimizer.js +179 -0
- package/dist/core/token-optimizer.js.map +1 -0
- package/dist/core/tools/bash.d.ts +8 -9
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +9 -8
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -14
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +4 -25
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +1 -4
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +1 -4
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +1 -4
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +2 -5
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +2 -2
- 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 +1 -4
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +1 -4
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +2 -14
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +4 -28
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +1 -1
- package/dist/core/tools/render-utils.d.ts.map +1 -1
- package/dist/core/tools/render-utils.js +1 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts +1 -1
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -1
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -1
- package/dist/core/tools/write.d.ts +2 -4
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +4 -4
- package/dist/core/tools/write.js.map +1 -1
- package/dist/encoding/index.d.ts +6 -0
- package/dist/encoding/index.d.ts.map +1 -0
- package/dist/encoding/index.js +6 -0
- package/dist/encoding/index.js.map +1 -0
- package/dist/encoding/l4-encoder.d.ts +96 -0
- package/dist/encoding/l4-encoder.d.ts.map +1 -0
- package/dist/encoding/l4-encoder.js +474 -0
- package/dist/encoding/l4-encoder.js.map +1 -0
- package/dist/fuzzing/index.d.ts +6 -0
- package/dist/fuzzing/index.d.ts.map +1 -0
- package/dist/fuzzing/index.js +6 -0
- package/dist/fuzzing/index.js.map +1 -0
- package/dist/fuzzing/mutation-engine.d.ts +93 -0
- package/dist/fuzzing/mutation-engine.d.ts.map +1 -0
- package/dist/fuzzing/mutation-engine.js +244 -0
- package/dist/fuzzing/mutation-engine.js.map +1 -0
- package/dist/guardrails/audit-logger.d.ts +4 -0
- package/dist/guardrails/audit-logger.d.ts.map +1 -0
- package/dist/guardrails/audit-logger.js +28 -0
- package/dist/guardrails/audit-logger.js.map +1 -0
- package/dist/guardrails/evidence-system.d.ts +61 -0
- package/dist/guardrails/evidence-system.d.ts.map +1 -0
- package/dist/guardrails/evidence-system.js +302 -0
- package/dist/guardrails/evidence-system.js.map +1 -0
- package/dist/guardrails/freedomd-adapter.d.ts +16 -0
- package/dist/guardrails/freedomd-adapter.d.ts.map +1 -0
- package/dist/guardrails/freedomd-adapter.js +87 -0
- package/dist/guardrails/freedomd-adapter.js.map +1 -0
- package/dist/index.d.ts +5 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -17
- package/dist/index.js.map +1 -1
- package/dist/jailbreak-extension.d.ts +48 -0
- package/dist/jailbreak-extension.d.ts.map +1 -0
- package/dist/jailbreak-extension.js +47 -0
- package/dist/jailbreak-extension.js.map +1 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/dist/migrations.d.ts +0 -37
- package/dist/migrations.d.ts.map +1 -1
- package/dist/migrations.js +6 -414
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +2 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-box.d.ts +15 -0
- package/dist/modes/interactive/components/control-panel-box.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-box.js +55 -0
- package/dist/modes/interactive/components/control-panel-box.js.map +1 -0
- package/dist/modes/interactive/components/control-panel-gradient-motion.d.ts.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient-motion.js +2 -36
- package/dist/modes/interactive/components/control-panel-gradient-motion.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient.d.ts +1 -0
- package/dist/modes/interactive/components/control-panel-gradient.d.ts.map +1 -1
- package/dist/modes/interactive/components/control-panel-gradient.js +6 -5
- package/dist/modes/interactive/components/control-panel-gradient.js.map +1 -1
- package/dist/modes/interactive/components/control-panel-layout.d.ts +30 -0
- package/dist/modes/interactive/components/control-panel-layout.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-layout.js +197 -0
- package/dist/modes/interactive/components/control-panel-layout.js.map +1 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.d.ts +6 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.d.ts.map +1 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.js +29 -0
- package/dist/modes/interactive/components/control-panel-runtime-status.js.map +1 -0
- package/dist/modes/interactive/components/control-panel.d.ts +9 -31
- package/dist/modes/interactive/components/control-panel.d.ts.map +1 -1
- package/dist/modes/interactive/components/control-panel.js +49 -168
- package/dist/modes/interactive/components/control-panel.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +14 -22
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/earendil-announcement.d.ts +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 +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/extension-input.d.ts +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +7 -9
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +0 -2
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +0 -2
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +2 -2
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +2 -2
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +13 -47
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +118 -193
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +1 -1
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -2
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +2 -11
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +8 -7
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +48 -7
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/todo-checklist.d.ts +31 -0
- package/dist/modes/interactive/components/todo-checklist.d.ts.map +1 -0
- package/dist/modes/interactive/components/todo-checklist.js +121 -0
- package/dist/modes/interactive/components/todo-checklist.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +1 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -8
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +80 -232
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/omk-control-grid-dark.json +65 -77
- package/dist/modes/interactive/theme/omk-neon-control.json +90 -0
- package/dist/modes/interactive/theme/rust-forge.json +14 -24
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +25 -45
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +2 -2
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +0 -4
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +2 -2
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/modules/index.d.ts +8 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +7 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/lrl-bypass.d.ts +40 -0
- package/dist/modules/lrl-bypass.d.ts.map +1 -0
- package/dist/modules/lrl-bypass.js +84 -0
- package/dist/modules/lrl-bypass.js.map +1 -0
- package/dist/modules/lrl-deps.d.ts +38 -0
- package/dist/modules/lrl-deps.d.ts.map +1 -0
- package/dist/modules/lrl-deps.js +128 -0
- package/dist/modules/lrl-deps.js.map +1 -0
- package/dist/multiturn/easl-chain.d.ts +113 -0
- package/dist/multiturn/easl-chain.d.ts.map +1 -0
- package/dist/multiturn/easl-chain.js +351 -0
- package/dist/multiturn/easl-chain.js.map +1 -0
- package/dist/multiturn/index.d.ts +6 -0
- package/dist/multiturn/index.d.ts.map +1 -0
- package/dist/multiturn/index.js +6 -0
- package/dist/multiturn/index.js.map +1 -0
- package/dist/orchestration/lane-grant-auditor.d.ts +4 -0
- package/dist/orchestration/lane-grant-auditor.d.ts.map +1 -0
- package/dist/orchestration/lane-grant-auditor.js +87 -0
- package/dist/orchestration/lane-grant-auditor.js.map +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +48 -113
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/routing/fallback-router.d.ts +123 -0
- package/dist/routing/fallback-router.d.ts.map +1 -0
- package/dist/routing/fallback-router.js +355 -0
- package/dist/routing/fallback-router.js.map +1 -0
- package/dist/routing/index.d.ts +6 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +6 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/types/evidence.d.ts +117 -0
- package/dist/types/evidence.d.ts.map +1 -0
- package/dist/types/evidence.js +8 -0
- package/dist/types/evidence.js.map +1 -0
- package/dist/types/guardrails.d.ts +61 -0
- package/dist/types/guardrails.d.ts.map +1 -0
- package/dist/types/guardrails.js +9 -0
- package/dist/types/guardrails.js.map +1 -0
- package/dist/types/jailbreak.d.ts +246 -0
- package/dist/types/jailbreak.d.ts.map +1 -0
- package/dist/types/jailbreak.js +8 -0
- package/dist/types/jailbreak.js.map +1 -0
- package/dist/types/lane-grant.d.ts +58 -0
- package/dist/types/lane-grant.d.ts.map +1 -0
- package/dist/types/lane-grant.js +9 -0
- package/dist/types/lane-grant.js.map +1 -0
- package/dist/utils/jailbreak/common.d.ts +63 -0
- package/dist/utils/jailbreak/common.d.ts.map +1 -0
- package/dist/utils/jailbreak/common.js +130 -0
- package/dist/utils/jailbreak/common.js.map +1 -0
- package/dist/utils/jailbreak/index.d.ts +7 -0
- package/dist/utils/jailbreak/index.d.ts.map +1 -0
- package/dist/utils/jailbreak/index.js +7 -0
- package/dist/utils/jailbreak/index.js.map +1 -0
- 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 +8 -21
- package/docs/custom-provider.md +2 -2
- package/docs/development.md +1 -1
- package/docs/extensions.md +11 -11
- package/docs/loadout-domains/README.md +70 -0
- package/docs/loadout-domains/ai-agent-ops.md +94 -0
- package/docs/loadout-domains/backend-api.md +116 -0
- package/docs/loadout-domains/data-science.md +100 -0
- package/docs/loadout-domains/devops-infra.md +85 -0
- package/docs/loadout-domains/docs-writing.md +92 -0
- package/docs/loadout-domains/frontend-ui.md +128 -0
- package/docs/loadout-domains/general.md +62 -0
- package/docs/loadout-domains/mobile.md +84 -0
- package/docs/loadout-domains/qa-testing.md +87 -0
- package/docs/loadout-domains/research.md +80 -0
- package/docs/loadout-domains/security-audit.md +97 -0
- package/docs/packages.md +7 -48
- package/docs/prompt-templates.md +0 -2
- package/docs/providers.md +12 -0
- package/docs/sdk.md +3 -3
- package/docs/security.md +145 -0
- package/docs/session-format.md +1 -1
- package/docs/themes.md +8 -7
- package/docs/tui.md +14 -14
- package/docs/usage.md +6 -16
- package/examples/extensions/README.md +2 -2
- package/examples/extensions/aside-computer-use/README.md +114 -0
- package/examples/extensions/aside-computer-use/action-scoring.ts +122 -0
- package/examples/extensions/aside-computer-use/assertions.ts +380 -0
- package/examples/extensions/aside-computer-use/controller.ts +491 -0
- package/examples/extensions/aside-computer-use/evidence.ts +229 -0
- package/examples/extensions/aside-computer-use/golden-trace.ts +141 -0
- package/examples/extensions/aside-computer-use/index.ts +76 -0
- package/examples/extensions/aside-computer-use/mcp-client.ts +381 -0
- package/examples/extensions/aside-computer-use/observation-snapshot.ts +121 -0
- package/examples/extensions/aside-computer-use/package.json +16 -0
- package/examples/extensions/aside-computer-use/policy.ts +257 -0
- package/examples/extensions/aside-computer-use/risk-authorize.ts +200 -0
- package/examples/extensions/aside-computer-use/risk-classifier.ts +205 -0
- package/examples/extensions/aside-computer-use/schema-fingerprint.ts +80 -0
- package/examples/extensions/aside-computer-use/session-binding.ts +161 -0
- package/examples/extensions/aside-computer-use/tools.ts +449 -0
- package/examples/extensions/aside-computer-use/types.ts +217 -0
- package/examples/extensions/aside-computer-use/url-origin.ts +132 -0
- package/examples/extensions/bash-spawn-hook.ts +1 -1
- package/examples/extensions/border-status-editor.ts +2 -2
- package/examples/extensions/built-in-tool-renderer.ts +1 -1
- package/examples/extensions/custom-compaction.ts +1 -1
- package/examples/extensions/custom-footer.ts +2 -2
- package/examples/extensions/custom-header.ts +8 -8
- package/examples/extensions/custom-provider-anthropic/index.ts +1 -1
- 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 +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/test.ts +1 -1
- package/examples/extensions/doom-overlay/README.md +1 -2
- package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +4 -4
- package/examples/extensions/doom-overlay/doom/doomgeneric_omk.c +72 -0
- package/examples/extensions/doom-overlay/doom-component.ts +2 -2
- package/examples/extensions/doom-overlay/doom-keys.ts +1 -1
- package/examples/extensions/git-merge-and-resolve.ts +1 -1
- package/examples/extensions/github-issue-autocomplete.ts +1 -6
- package/examples/extensions/gondolin/index.ts +1 -1
- 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 +1 -1
- package/examples/extensions/inline-bash.ts +1 -1
- package/examples/extensions/input-transform-streaming.ts +1 -1
- package/examples/extensions/input-transform.ts +2 -2
- package/examples/extensions/mac-system-theme.ts +1 -1
- package/examples/extensions/message-renderer.ts +1 -1
- package/examples/extensions/minimal-mode.ts +1 -1
- package/examples/extensions/modal-editor.ts +1 -1
- package/examples/extensions/overlay-qa-tests.ts +7 -7
- package/examples/extensions/overlay-test.ts +1 -1
- package/examples/extensions/plan-mode/index.ts +3 -3
- package/examples/extensions/preset.ts +4 -4
- package/examples/extensions/provider-payload.ts +6 -3
- package/examples/extensions/qna.ts +1 -1
- package/examples/extensions/question.ts +1 -1
- package/examples/extensions/questionnaire.ts +1 -1
- package/examples/extensions/rpc-demo.ts +1 -1
- package/examples/extensions/sandbox/index.ts +2 -2
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/shutdown-command.ts +5 -5
- package/examples/extensions/snake.ts +1 -1
- package/examples/extensions/space-invaders.ts +1 -1
- package/examples/extensions/structured-output.ts +1 -1
- package/examples/extensions/subagent/agents.ts +2 -2
- package/examples/extensions/subagent/index.ts +19 -51
- package/examples/extensions/summarize.ts +2 -2
- package/examples/extensions/tic-tac-toe.ts +2 -2
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/tool-override.ts +1 -1
- package/examples/extensions/tools.ts +1 -1
- package/examples/extensions/truncated-tool.ts +1 -1
- 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 +3 -3
- package/examples/rpc-extension-ui.ts +1 -9
- package/examples/sdk/02-custom-model.ts +1 -1
- package/examples/sdk/07-context-files.ts +0 -2
- package/examples/sdk/12-full-control.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +1805 -0
- package/package.json +10 -32
- package/dist/core/compaction/pruner-policy.d.ts +0 -84
- package/dist/core/compaction/pruner-policy.d.ts.map +0 -1
- package/dist/core/compaction/pruner-policy.js +0 -273
- package/dist/core/compaction/pruner-policy.js.map +0 -1
- package/dist/core/context-graph-identity-resolution.d.ts +0 -114
- package/dist/core/context-graph-identity-resolution.d.ts.map +0 -1
- package/dist/core/context-graph-identity-resolution.js +0 -127
- package/dist/core/context-graph-identity-resolution.js.map +0 -1
- package/dist/core/context-graph-memory-store.d.ts +0 -153
- package/dist/core/context-graph-memory-store.d.ts.map +0 -1
- package/dist/core/context-graph-memory-store.js +0 -377
- package/dist/core/context-graph-memory-store.js.map +0 -1
- package/dist/core/context-graph-ontology-generation.d.ts +0 -104
- package/dist/core/context-graph-ontology-generation.d.ts.map +0 -1
- package/dist/core/context-graph-ontology-generation.js +0 -135
- package/dist/core/context-graph-ontology-generation.js.map +0 -1
- package/dist/core/context-graph-ontology-registry.d.ts +0 -766
- package/dist/core/context-graph-ontology-registry.d.ts.map +0 -1
- package/dist/core/context-graph-ontology-registry.js +0 -1133
- package/dist/core/context-graph-ontology-registry.js.map +0 -1
- package/dist/core/context-graph-policy.d.ts +0 -68
- package/dist/core/context-graph-policy.d.ts.map +0 -1
- package/dist/core/context-graph-policy.js +0 -221
- package/dist/core/context-graph-policy.js.map +0 -1
- package/dist/core/context-graph-reasoning.d.ts +0 -130
- package/dist/core/context-graph-reasoning.d.ts.map +0 -1
- package/dist/core/context-graph-reasoning.js +0 -442
- package/dist/core/context-graph-reasoning.js.map +0 -1
- package/dist/core/context-graph-retrieval.d.ts +0 -120
- package/dist/core/context-graph-retrieval.d.ts.map +0 -1
- package/dist/core/context-graph-retrieval.js +0 -288
- package/dist/core/context-graph-retrieval.js.map +0 -1
- package/dist/core/contract-verification.d.ts +0 -78
- package/dist/core/contract-verification.d.ts.map +0 -1
- package/dist/core/contract-verification.js +0 -110
- package/dist/core/contract-verification.js.map +0 -1
- package/dist/core/freedom/banner.d.ts +0 -14
- package/dist/core/freedom/banner.d.ts.map +0 -1
- package/dist/core/freedom/banner.js +0 -22
- package/dist/core/freedom/banner.js.map +0 -1
- package/dist/core/freedom/config.d.ts +0 -27
- package/dist/core/freedom/config.d.ts.map +0 -1
- package/dist/core/freedom/config.js +0 -216
- package/dist/core/freedom/config.js.map +0 -1
- package/dist/core/freedom/index.d.ts +0 -23
- package/dist/core/freedom/index.d.ts.map +0 -1
- package/dist/core/freedom/index.js +0 -19
- package/dist/core/freedom/index.js.map +0 -1
- package/dist/core/freedom/policy.d.ts +0 -42
- package/dist/core/freedom/policy.d.ts.map +0 -1
- package/dist/core/freedom/policy.js +0 -47
- package/dist/core/freedom/policy.js.map +0 -1
- package/dist/core/freedom/safety-floor.d.ts +0 -73
- package/dist/core/freedom/safety-floor.d.ts.map +0 -1
- package/dist/core/freedom/safety-floor.js +0 -275
- package/dist/core/freedom/safety-floor.js.map +0 -1
- package/dist/core/harness-control-events.d.ts +0 -91
- package/dist/core/harness-control-events.d.ts.map +0 -1
- package/dist/core/harness-control-events.js +0 -514
- package/dist/core/harness-control-events.js.map +0 -1
- package/dist/core/harness-control-replay.d.ts +0 -31
- package/dist/core/harness-control-replay.d.ts.map +0 -1
- package/dist/core/harness-control-replay.js +0 -187
- package/dist/core/harness-control-replay.js.map +0 -1
- package/dist/core/headroom-middleware.d.ts +0 -35
- package/dist/core/headroom-middleware.d.ts.map +0 -1
- package/dist/core/headroom-middleware.js +0 -166
- package/dist/core/headroom-middleware.js.map +0 -1
- package/dist/core/lean-context-middleware.d.ts +0 -12
- package/dist/core/lean-context-middleware.d.ts.map +0 -1
- package/dist/core/lean-context-middleware.js +0 -87
- package/dist/core/lean-context-middleware.js.map +0 -1
- package/dist/core/lean-context-policy.d.ts +0 -45
- package/dist/core/lean-context-policy.d.ts.map +0 -1
- package/dist/core/lean-context-policy.js +0 -108
- package/dist/core/lean-context-policy.js.map +0 -1
- package/dist/core/native-adoption-benchmark.d.ts +0 -166
- package/dist/core/native-adoption-benchmark.d.ts.map +0 -1
- package/dist/core/native-adoption-benchmark.js +0 -624
- package/dist/core/native-adoption-benchmark.js.map +0 -1
- package/dist/core/observability-trace.d.ts +0 -80
- package/dist/core/observability-trace.d.ts.map +0 -1
- package/dist/core/observability-trace.js +0 -140
- package/dist/core/observability-trace.js.map +0 -1
- package/dist/core/orchestration/checkpoint.d.ts +0 -83
- package/dist/core/orchestration/checkpoint.d.ts.map +0 -1
- package/dist/core/orchestration/checkpoint.js +0 -152
- package/dist/core/orchestration/checkpoint.js.map +0 -1
- package/dist/core/orchestration/errors.d.ts +0 -74
- package/dist/core/orchestration/errors.d.ts.map +0 -1
- package/dist/core/orchestration/errors.js +0 -52
- package/dist/core/orchestration/errors.js.map +0 -1
- package/dist/core/orchestration/merge-queue.d.ts +0 -121
- package/dist/core/orchestration/merge-queue.d.ts.map +0 -1
- package/dist/core/orchestration/merge-queue.js +0 -149
- package/dist/core/orchestration/merge-queue.js.map +0 -1
- package/dist/core/orchestration/recovery.d.ts +0 -106
- package/dist/core/orchestration/recovery.d.ts.map +0 -1
- package/dist/core/orchestration/recovery.js +0 -110
- package/dist/core/orchestration/recovery.js.map +0 -1
- package/dist/core/orchestration/replay-ledger.d.ts +0 -76
- package/dist/core/orchestration/replay-ledger.d.ts.map +0 -1
- package/dist/core/orchestration/replay-ledger.js +0 -395
- package/dist/core/orchestration/replay-ledger.js.map +0 -1
- package/dist/core/orchestration/scheduler-state.d.ts +0 -78
- package/dist/core/orchestration/scheduler-state.d.ts.map +0 -1
- package/dist/core/orchestration/scheduler-state.js +0 -185
- package/dist/core/orchestration/scheduler-state.js.map +0 -1
- package/dist/core/orchestration/scheduler-store.d.ts +0 -309
- package/dist/core/orchestration/scheduler-store.d.ts.map +0 -1
- package/dist/core/orchestration/scheduler-store.js +0 -368
- package/dist/core/orchestration/scheduler-store.js.map +0 -1
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts +0 -57
- package/dist/core/orchestration/sqlite-scheduler-store.d.ts.map +0 -1
- package/dist/core/orchestration/sqlite-scheduler-store.js +0 -528
- package/dist/core/orchestration/sqlite-scheduler-store.js.map +0 -1
- package/dist/core/orchestration/transaction-coordinator.d.ts +0 -217
- package/dist/core/orchestration/transaction-coordinator.d.ts.map +0 -1
- package/dist/core/orchestration/transaction-coordinator.js +0 -281
- package/dist/core/orchestration/transaction-coordinator.js.map +0 -1
- package/dist/core/orchestration/verification-contract.d.ts +0 -197
- package/dist/core/orchestration/verification-contract.d.ts.map +0 -1
- package/dist/core/orchestration/verification-contract.js +0 -145
- package/dist/core/orchestration/verification-contract.js.map +0 -1
- package/dist/core/package-composition.d.ts +0 -68
- package/dist/core/package-composition.d.ts.map +0 -1
- package/dist/core/package-composition.js +0 -304
- package/dist/core/package-composition.js.map +0 -1
- package/dist/core/package-trial-runtime.d.ts +0 -75
- package/dist/core/package-trial-runtime.d.ts.map +0 -1
- package/dist/core/package-trial-runtime.js +0 -73
- package/dist/core/package-trial-runtime.js.map +0 -1
- package/dist/core/package-trial-sandbox.d.ts +0 -27
- package/dist/core/package-trial-sandbox.d.ts.map +0 -1
- package/dist/core/package-trial-sandbox.js +0 -102
- package/dist/core/package-trial-sandbox.js.map +0 -1
- package/dist/core/policy-overlays-runtime.d.ts +0 -141
- package/dist/core/policy-overlays-runtime.d.ts.map +0 -1
- package/dist/core/policy-overlays-runtime.js +0 -720
- package/dist/core/policy-overlays-runtime.js.map +0 -1
- package/dist/core/read-anchor-registry.d.ts +0 -27
- package/dist/core/read-anchor-registry.d.ts.map +0 -1
- package/dist/core/read-anchor-registry.js +0 -103
- package/dist/core/read-anchor-registry.js.map +0 -1
- package/dist/core/read-content-cache.d.ts +0 -22
- package/dist/core/read-content-cache.d.ts.map +0 -1
- package/dist/core/read-content-cache.js +0 -79
- package/dist/core/read-content-cache.js.map +0 -1
- package/dist/core/session-digest.d.ts +0 -57
- package/dist/core/session-digest.d.ts.map +0 -1
- package/dist/core/session-digest.js +0 -193
- package/dist/core/session-digest.js.map +0 -1
- package/dist/core/spec-kit/compiler.d.ts +0 -67
- package/dist/core/spec-kit/compiler.d.ts.map +0 -1
- package/dist/core/spec-kit/compiler.js +0 -268
- package/dist/core/spec-kit/compiler.js.map +0 -1
- package/dist/core/transaction-coordinator.d.ts +0 -30
- package/dist/core/transaction-coordinator.d.ts.map +0 -1
- package/dist/core/transaction-coordinator.js +0 -173
- package/dist/core/transaction-coordinator.js.map +0 -1
- package/dist/modes/interactive/components/mcp-selector.d.ts +0 -30
- package/dist/modes/interactive/components/mcp-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/mcp-selector.js +0 -155
- package/dist/modes/interactive/components/mcp-selector.js.map +0 -1
- package/dist/modes/interactive/components/model-selector-state.d.ts +0 -101
- package/dist/modes/interactive/components/model-selector-state.d.ts.map +0 -1
- package/dist/modes/interactive/components/model-selector-state.js +0 -261
- package/dist/modes/interactive/components/model-selector-state.js.map +0 -1
- package/dist/modes/interactive/components/skills-selector.d.ts +0 -32
- package/dist/modes/interactive/components/skills-selector.d.ts.map +0 -1
- package/dist/modes/interactive/components/skills-selector.js +0 -130
- package/dist/modes/interactive/components/skills-selector.js.map +0 -1
- package/dist/modes/interactive/theme/omk-blackboard.json +0 -91
- package/dist/modes/interactive/theme/omk-freedom-grid.json +0 -91
- package/dist/modes/interactive/theme/omk-neon-ops.json +0 -90
- package/dist/modes/interactive/theme/omk-slate-light.json +0 -91
- package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +0 -72
- package/node_modules/@earendil-works/omk-agent-core/README.md +0 -488
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts +0 -24
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js +0 -553
- package/node_modules/@earendil-works/omk-agent-core/dist/agent-loop.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts +0 -118
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js +0 -402
- package/node_modules/@earendil-works/omk-agent-core/dist/agent.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts +0 -95
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js +0 -996
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/agent-harness.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts +0 -53
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js +0 -175
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/branch-summarization.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts +0 -117
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js +0 -568
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/compaction.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts +0 -25
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js +0 -131
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/compaction/utils.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts +0 -51
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js +0 -510
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/env/nodejs.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts +0 -51
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js +0 -102
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/messages.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts +0 -48
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js +0 -230
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/prompt-templates.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts +0 -26
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js +0 -101
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-repo.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts +0 -36
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js +0 -273
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/jsonl-storage.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts +0 -18
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js +0 -42
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-repo.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts +0 -25
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js +0 -114
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/memory-storage.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts +0 -11
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js +0 -39
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/repo-utils.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts +0 -33
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js +0 -210
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/session.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts +0 -2
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js +0 -50
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/session/uuid.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts +0 -44
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js +0 -311
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/skills.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts +0 -3
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js +0 -30
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/system-prompt.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts +0 -616
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js +0 -94
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts +0 -14
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js +0 -126
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/shell-output.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts +0 -70
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js +0 -297
- package/node_modules/@earendil-works/omk-agent-core/dist/harness/utils/truncate.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts +0 -20
- package/node_modules/@earendil-works/omk-agent-core/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js +0 -25
- package/node_modules/@earendil-works/omk-agent-core/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts +0 -3
- package/node_modules/@earendil-works/omk-agent-core/dist/node.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js +0 -3
- package/node_modules/@earendil-works/omk-agent-core/dist/node.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts +0 -69
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js +0 -278
- package/node_modules/@earendil-works/omk-agent-core/dist/proxy.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts +0 -393
- package/node_modules/@earendil-works/omk-agent-core/dist/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js +0 -2
- package/node_modules/@earendil-works/omk-agent-core/dist/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-agent-core/package.json +0 -60
- package/node_modules/@earendil-works/omk-ai/README.md +0 -1389
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts +0 -20
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js +0 -44
- package/node_modules/@earendil-works/omk-ai/dist/api-registry.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts +0 -5
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js +0 -6
- package/node_modules/@earendil-works/omk-ai/dist/bedrock-provider.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/cli.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/cli.js +0 -130
- package/node_modules/@earendil-works/omk-ai/dist/cli.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts +0 -20
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js +0 -199
- package/node_modules/@earendil-works/omk-ai/dist/env-api-keys.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts +0 -10
- package/node_modules/@earendil-works/omk-ai/dist/image-models.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts +0 -515
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js +0 -517
- package/node_modules/@earendil-works/omk-ai/dist/image-models.generated.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js +0 -23
- package/node_modules/@earendil-works/omk-ai/dist/image-models.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts +0 -14
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/images-api-registry.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts +0 -4
- package/node_modules/@earendil-works/omk-ai/dist/images.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/images.js +0 -16
- package/node_modules/@earendil-works/omk-ai/dist/images.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts +0 -33
- package/node_modules/@earendil-works/omk-ai/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/index.js +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts +0 -18
- package/node_modules/@earendil-works/omk-ai/dist/models.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts +0 -18762
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js +0 -17197
- package/node_modules/@earendil-works/omk-ai/dist/models.generated.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/models.js +0 -78
- package/node_modules/@earendil-works/omk-ai/dist/models.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/oauth.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/oauth.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts +0 -39
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js +0 -170
- package/node_modules/@earendil-works/omk-ai/dist/provider-network.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts +0 -38
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js +0 -826
- package/node_modules/@earendil-works/omk-ai/dist/providers/amazon-bedrock.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts +0 -77
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js +0 -1123
- package/node_modules/@earendil-works/omk-ai/dist/providers/anthropic.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts +0 -15
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js +0 -221
- package/node_modules/@earendil-works/omk-ai/dist/providers/azure-openai-responses.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js +0 -26
- package/node_modules/@earendil-works/omk-ai/dist/providers/cloudflare.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts +0 -56
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js +0 -368
- package/node_modules/@earendil-works/omk-ai/dist/providers/faux.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js +0 -29
- package/node_modules/@earendil-works/omk-ai/dist/providers/github-copilot-headers.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts +0 -70
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js +0 -331
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-shared.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts +0 -15
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js +0 -442
- package/node_modules/@earendil-works/omk-ai/dist/providers/google-vertex.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js +0 -402
- package/node_modules/@earendil-works/omk-ai/dist/providers/google.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js +0 -128
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/openrouter.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts +0 -4
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js +0 -34
- package/node_modules/@earendil-works/omk-ai/dist/providers/images/register-builtins.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts +0 -25
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js +0 -534
- package/node_modules/@earendil-works/omk-ai/dist/providers/mistral.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts +0 -30
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js +0 -1171
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-codex-responses.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts +0 -19
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js +0 -977
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-completions.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts +0 -11
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-prompt-cache.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts +0 -18
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js +0 -496
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses-shared.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js +0 -233
- package/node_modules/@earendil-works/omk-ai/dist/providers/openai-responses.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts +0 -35
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js +0 -254
- package/node_modules/@earendil-works/omk-ai/dist/providers/register-builtins.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js +0 -42
- package/node_modules/@earendil-works/omk-ai/dist/providers/simple-options.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js +0 -82
- package/node_modules/@earendil-works/omk-ai/dist/providers/tool-schema.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js +0 -184
- package/node_modules/@earendil-works/omk-ai/dist/providers/transform-messages.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts +0 -4
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/session-resources.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/stream.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/stream.js +0 -77
- package/node_modules/@earendil-works/omk-ai/dist/stream.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts +0 -570
- package/node_modules/@earendil-works/omk-ai/dist/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/types.js +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts +0 -6
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js +0 -34
- package/node_modules/@earendil-works/omk-ai/dist/utils/abort-signals.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts +0 -19
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js +0 -25
- package/node_modules/@earendil-works/omk-ai/dist/utils/diagnostics.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js +0 -81
- package/node_modules/@earendil-works/omk-ai/dist/utils/event-stream.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js +0 -14
- package/node_modules/@earendil-works/omk-ai/dist/utils/hash.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js +0 -8
- package/node_modules/@earendil-works/omk-ai/dist/utils/headers.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts +0 -16
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js +0 -113
- package/node_modules/@earendil-works/omk-ai/dist/utils/json-parse.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts +0 -10
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js +0 -97
- package/node_modules/@earendil-works/omk-ai/dist/utils/node-http-proxy.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts +0 -25
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js +0 -335
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/anthropic.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js +0 -56
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/device-code.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts +0 -30
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js +0 -280
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/github-copilot.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts +0 -58
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js +0 -122
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts +0 -3
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js +0 -105
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/oauth-page.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts +0 -43
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js +0 -487
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/openai-codex.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts +0 -13
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js +0 -31
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/pkce.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts +0 -64
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js +0 -2
- package/node_modules/@earendil-works/omk-ai/dist/utils/oauth/types.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts +0 -57
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js +0 -154
- package/node_modules/@earendil-works/omk-ai/dist/utils/overflow.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts +0 -22
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js +0 -26
- package/node_modules/@earendil-works/omk-ai/dist/utils/sanitize-unicode.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts +0 -17
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js +0 -21
- package/node_modules/@earendil-works/omk-ai/dist/utils/typebox-helpers.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts +0 -18
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js +0 -281
- package/node_modules/@earendil-works/omk-ai/dist/utils/validation.js.map +0 -1
- package/node_modules/@earendil-works/omk-ai/package.json +0 -106
- package/node_modules/@earendil-works/omk-tui/README.md +0 -791
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts +0 -54
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js +0 -632
- package/node_modules/@earendil-works/omk-tui/dist/autocomplete.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts +0 -22
- package/node_modules/@earendil-works/omk-tui/dist/components/box.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js +0 -104
- package/node_modules/@earendil-works/omk-tui/dist/components/box.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts +0 -22
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js +0 -35
- package/node_modules/@earendil-works/omk-tui/dist/components/cancellable-loader.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts +0 -249
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js +0 -1857
- package/node_modules/@earendil-works/omk-tui/dist/components/editor.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts +0 -28
- package/node_modules/@earendil-works/omk-tui/dist/components/image.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js +0 -89
- package/node_modules/@earendil-works/omk-tui/dist/components/image.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts +0 -37
- package/node_modules/@earendil-works/omk-tui/dist/components/input.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js +0 -378
- package/node_modules/@earendil-works/omk-tui/dist/components/input.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts +0 -31
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js +0 -69
- package/node_modules/@earendil-works/omk-tui/dist/components/loader.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts +0 -96
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js +0 -644
- package/node_modules/@earendil-works/omk-tui/dist/components/markdown.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts +0 -50
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js +0 -159
- package/node_modules/@earendil-works/omk-tui/dist/components/select-list.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts +0 -50
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js +0 -185
- package/node_modules/@earendil-works/omk-tui/dist/components/settings-list.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts +0 -12
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js +0 -23
- package/node_modules/@earendil-works/omk-tui/dist/components/spacer.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts +0 -19
- package/node_modules/@earendil-works/omk-tui/dist/components/text.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js +0 -89
- package/node_modules/@earendil-works/omk-tui/dist/components/text.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts +0 -13
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js +0 -51
- package/node_modules/@earendil-works/omk-tui/dist/components/truncated-text.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts +0 -39
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js +0 -2
- package/node_modules/@earendil-works/omk-tui/dist/editor-component.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts +0 -16
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js +0 -110
- package/node_modules/@earendil-works/omk-tui/dist/fuzzy.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts +0 -23
- package/node_modules/@earendil-works/omk-tui/dist/index.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/index.js +0 -32
- package/node_modules/@earendil-works/omk-tui/dist/index.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts +0 -212
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js +0 -252
- package/node_modules/@earendil-works/omk-tui/dist/keybindings.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts +0 -184
- package/node_modules/@earendil-works/omk-tui/dist/keys.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/keys.js +0 -1173
- package/node_modules/@earendil-works/omk-tui/dist/keys.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts +0 -28
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js +0 -44
- package/node_modules/@earendil-works/omk-tui/dist/kill-ring.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts +0 -3
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js +0 -53
- package/node_modules/@earendil-works/omk-tui/dist/native-modifiers.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts +0 -50
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js +0 -361
- package/node_modules/@earendil-works/omk-tui/dist/stdin-buffer.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts +0 -90
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js +0 -366
- package/node_modules/@earendil-works/omk-tui/dist/terminal-image.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts +0 -113
- package/node_modules/@earendil-works/omk-tui/dist/terminal.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js +0 -472
- package/node_modules/@earendil-works/omk-tui/dist/terminal.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts +0 -242
- package/node_modules/@earendil-works/omk-tui/dist/tui.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/tui.js +0 -1221
- package/node_modules/@earendil-works/omk-tui/dist/tui.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts +0 -17
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js +0 -25
- package/node_modules/@earendil-works/omk-tui/dist/undo-stack.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts +0 -84
- package/node_modules/@earendil-works/omk-tui/dist/utils.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/utils.js +0 -1032
- package/node_modules/@earendil-works/omk-tui/dist/utils.js.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts +0 -25
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.d.ts.map +0 -1
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js +0 -96
- package/node_modules/@earendil-works/omk-tui/dist/word-navigation.js.map +0 -1
- 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 +0 -47
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-selector-state.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/model-selector-state.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC;AAE1C,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;AAEzC,eAAO,MAAM,gBAAgB,OAAiB,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,wIAavB,CAAC;AAEX;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,WAAW,CAAC;IACrC,QAAQ,CAAC,WAAW,EAAE,SAAS,WAAW,EAAE,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7C,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAClD,QAAQ,CAAC,YAAY,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrD,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,MAAM,mBAAmB,GAC5B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,mBAAmB,CAAA;CAAE,GAC7B;IAAE,IAAI,EAAE,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AAC,kBAAkB,EAAE,OAAO,CAAC;IACrC,qEAAqE;IACrE,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;CACnC;AA0BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GACnB,mBAAmB,CA+CrB","sourcesContent":["import { fuzzyFilter } from \"@earendil-works/omk-tui\";\n\n/**\n * Pure, render-free state machine for the `/model` selector.\n *\n * The interactive {@link ModelSelectorComponent} is a thin view/controller that\n * delegates every state transition to {@link modelSelectorReducer}. Keeping the\n * decision logic here makes the `/model` contract testable without a TUI and\n * shrinks the blast radius of theme/rendering refactors: presentation can change\n * freely as long as this reducer keeps its semantic guarantees.\n */\n\nexport type ModelScope = \"all\" | \"scoped\";\n\nexport type ProviderTab = \"all\" | string;\n\nexport const ALL_PROVIDER_TAB = \"all\" as const;\n\n/**\n * Preferred display order for first-party providers. Anything outside this list\n * is treated as a custom provider and sorted lexicographically after the known\n * providers (see {@link buildProviderTabs}).\n */\nexport const KNOWN_PROVIDER_ORDER = [\n\t\"anthropic\",\n\t\"openai\",\n\t\"google\",\n\t\"deepseek\",\n\t\"kimi\",\n\t\"openrouter\",\n\t\"mistral\",\n\t\"xai\",\n\t\"groq\",\n\t\"zai\",\n\t\"together\",\n\t\"fireworks\",\n] as const;\n\n/**\n * Minimal model projection the reducer needs. The component maps its richer\n * `ModelItem` (with the full `Model` object) down to this shape and keeps a\n * key -> item map for rendering and selection.\n */\nexport interface ModelSelectorModel {\n\treadonly provider: string;\n\treadonly id: string;\n\treadonly name: string;\n}\n\nexport interface ModelSelectorState {\n\treadonly scope: ModelScope;\n\treadonly activeProvider: ProviderTab;\n\treadonly providerIds: readonly ProviderTab[];\n\treadonly query: string;\n\treadonly selectedIndex: number;\n\treadonly visibleModelKeys: readonly string[];\n\t/** Full corpus retained so transitions stay pure functions of (state, action). */\n\treadonly allModels: readonly ModelSelectorModel[];\n\treadonly scopedModels: readonly ModelSelectorModel[];\n\treadonly currentModelKey?: string;\n}\n\nexport type ModelSelectorAction =\n\t| { type: \"NEXT_PROVIDER\" }\n\t| { type: \"PREVIOUS_PROVIDER\" }\n\t| { type: \"TOGGLE_SCOPE_FORWARD\" }\n\t| { type: \"TOGGLE_SCOPE_BACKWARD\" }\n\t| { type: \"SEARCH\"; query: string }\n\t| { type: \"MOVE_SELECTION\"; delta: 1 | -1 }\n\t| {\n\t\t\ttype: \"REFRESH_MODELS\";\n\t\t\tallModels: readonly ModelSelectorModel[];\n\t\t\tscopedModels: readonly ModelSelectorModel[];\n\t\t\tcurrentModelKey?: string;\n\t };\n\nexport function modelSelectorModelKey(model: { readonly provider: string; readonly id: string }): string {\n\treturn `${model.provider}/${model.id}`;\n}\n\nfunction isKnownProvider(provider: string): boolean {\n\treturn (KNOWN_PROVIDER_ORDER as readonly string[]).includes(provider);\n}\n\n/**\n * Build the provider tab ring: `all` first, then known providers in their\n * canonical order, then any custom providers sorted lexicographically.\n */\nexport function buildProviderTabs(models: readonly ModelSelectorModel[]): ProviderTab[] {\n\tconst providerIds = Array.from(new Set(models.map((model) => model.provider)));\n\tconst ordered = KNOWN_PROVIDER_ORDER.filter((provider) => providerIds.includes(provider));\n\tconst extras = providerIds.filter((provider) => !isKnownProvider(provider)).sort((a, b) => a.localeCompare(b));\n\treturn [ALL_PROVIDER_TAB, ...ordered, ...extras];\n}\n\nfunction filterByProvider(\n\tmodels: readonly ModelSelectorModel[],\n\tactiveProvider: ProviderTab,\n): readonly ModelSelectorModel[] {\n\tif (activeProvider === ALL_PROVIDER_TAB) return models;\n\treturn models.filter((model) => model.provider === activeProvider);\n}\n\nfunction applySearch(models: readonly ModelSelectorModel[], query: string): readonly ModelSelectorModel[] {\n\tif (!query) return models;\n\treturn fuzzyFilter(\n\t\t[...models],\n\t\tquery,\n\t\t({ id, provider }) => `${id} ${provider} ${provider}/${id} ${provider} ${id}`,\n\t);\n}\n\nfunction clampIndex(index: number, length: number): number {\n\tif (length === 0) return 0;\n\treturn Math.min(Math.max(index, 0), length - 1);\n}\n\nexport interface CreateInitialOptions {\n\treadonly scope?: ModelScope;\n\treadonly activeProvider?: ProviderTab;\n\treadonly query?: string;\n}\n\nexport function createInitialModelSelectorState(options: CreateInitialOptions = {}): ModelSelectorState {\n\treturn {\n\t\tscope: options.scope ?? \"all\",\n\t\tactiveProvider: options.activeProvider ?? ALL_PROVIDER_TAB,\n\t\tproviderIds: [ALL_PROVIDER_TAB],\n\t\tquery: options.query ?? \"\",\n\t\tselectedIndex: 0,\n\t\tvisibleModelKeys: [],\n\t\tallModels: [],\n\t\tscopedModels: [],\n\t\tcurrentModelKey: undefined,\n\t};\n}\n\n/**\n * Recompute provider tabs, the validated active provider, and the visible model\n * list for the given corpus/scope/query, then resolve the selected index with\n * the supplied strategy. Centralizing this keeps every transition consistent\n * with the contract invariants.\n */\nfunction project(overrides: {\n\treadonly scope: ModelScope;\n\treadonly allModels: readonly ModelSelectorModel[];\n\treadonly scopedModels: readonly ModelSelectorModel[];\n\treadonly query: string;\n\treadonly currentModelKey?: string;\n\treadonly desiredProvider: ProviderTab;\n\treadonly select: (input: {\n\t\treadonly visibleKeys: readonly string[];\n\t\treadonly providerFilteredKeys: readonly string[];\n\t}) => number;\n}): ModelSelectorState {\n\tconst corpus = overrides.scope === \"scoped\" ? overrides.scopedModels : overrides.allModels;\n\tconst providerIds = buildProviderTabs(corpus);\n\tconst activeProvider = providerIds.includes(overrides.desiredProvider)\n\t\t? overrides.desiredProvider\n\t\t: ALL_PROVIDER_TAB;\n\tconst providerFiltered = filterByProvider(corpus, activeProvider);\n\tconst visible = applySearch(providerFiltered, overrides.query);\n\tconst visibleModelKeys = visible.map(modelSelectorModelKey);\n\tconst selectedIndex = clampIndex(\n\t\toverrides.select({\n\t\t\tvisibleKeys: visibleModelKeys,\n\t\t\tproviderFilteredKeys: providerFiltered.map(modelSelectorModelKey),\n\t\t}),\n\t\tvisibleModelKeys.length,\n\t);\n\treturn {\n\t\tscope: overrides.scope,\n\t\tactiveProvider,\n\t\tproviderIds,\n\t\tquery: overrides.query,\n\t\tselectedIndex,\n\t\tvisibleModelKeys,\n\t\tallModels: overrides.allModels,\n\t\tscopedModels: overrides.scopedModels,\n\t\tcurrentModelKey: overrides.currentModelKey,\n\t};\n}\n\nexport function modelSelectorReducer(state: ModelSelectorState, action: ModelSelectorAction): ModelSelectorState {\n\tswitch (action.type) {\n\t\tcase \"REFRESH_MODELS\":\n\t\t\treturn project({\n\t\t\t\tscope: state.scope,\n\t\t\t\tallModels: action.allModels,\n\t\t\t\tscopedModels: action.scopedModels,\n\t\t\t\tquery: state.query,\n\t\t\t\tcurrentModelKey: action.currentModelKey,\n\t\t\t\tdesiredProvider: state.activeProvider,\n\t\t\t\tselect: ({ visibleKeys }) => {\n\t\t\t\t\tconst currentIndex = action.currentModelKey ? visibleKeys.indexOf(action.currentModelKey) : -1;\n\t\t\t\t\treturn currentIndex >= 0\n\t\t\t\t\t\t? currentIndex\n\t\t\t\t\t\t: Math.min(state.selectedIndex, Math.max(0, visibleKeys.length - 1));\n\t\t\t\t},\n\t\t\t});\n\n\t\tcase \"NEXT_PROVIDER\":\n\t\tcase \"PREVIOUS_PROVIDER\": {\n\t\t\tif (state.providerIds.length === 0) return state;\n\t\t\tconst direction = action.type === \"NEXT_PROVIDER\" ? 1 : -1;\n\t\t\tconst currentIndex = Math.max(0, state.providerIds.indexOf(state.activeProvider));\n\t\t\tconst nextIndex = (currentIndex + direction + state.providerIds.length) % state.providerIds.length;\n\t\t\tconst desiredProvider = state.providerIds[nextIndex] ?? ALL_PROVIDER_TAB;\n\t\t\treturn project({\n\t\t\t\tscope: state.scope,\n\t\t\t\tallModels: state.allModels,\n\t\t\t\tscopedModels: state.scopedModels,\n\t\t\t\tquery: state.query,\n\t\t\t\tcurrentModelKey: state.currentModelKey,\n\t\t\t\tdesiredProvider,\n\t\t\t\tselect: () => 0,\n\t\t\t});\n\t\t}\n\n\t\tcase \"TOGGLE_SCOPE_FORWARD\":\n\t\tcase \"TOGGLE_SCOPE_BACKWARD\": {\n\t\t\t// Scope is a two-state toggle (all <-> scoped); both directions flip it.\n\t\t\t// Without scoped models there is nothing to toggle into.\n\t\t\tif (state.scopedModels.length === 0) return state;\n\t\t\tconst scope: ModelScope = state.scope === \"all\" ? \"scoped\" : \"all\";\n\t\t\treturn project({\n\t\t\t\tscope,\n\t\t\t\tallModels: state.allModels,\n\t\t\t\tscopedModels: state.scopedModels,\n\t\t\t\tquery: state.query,\n\t\t\t\tcurrentModelKey: state.currentModelKey,\n\t\t\t\tdesiredProvider: state.activeProvider,\n\t\t\t\tselect: ({ providerFilteredKeys }) => {\n\t\t\t\t\tconst currentIndex = state.currentModelKey ? providerFilteredKeys.indexOf(state.currentModelKey) : -1;\n\t\t\t\t\treturn currentIndex >= 0 ? currentIndex : 0;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tcase \"SEARCH\":\n\t\t\treturn project({\n\t\t\t\tscope: state.scope,\n\t\t\t\tallModels: state.allModels,\n\t\t\t\tscopedModels: state.scopedModels,\n\t\t\t\tquery: action.query,\n\t\t\t\tcurrentModelKey: state.currentModelKey,\n\t\t\t\tdesiredProvider: state.activeProvider,\n\t\t\t\tselect: () => state.selectedIndex,\n\t\t\t});\n\n\t\tcase \"MOVE_SELECTION\": {\n\t\t\tconst length = state.visibleModelKeys.length;\n\t\t\tif (length === 0) return state;\n\t\t\tconst selectedIndex =\n\t\t\t\taction.delta === -1\n\t\t\t\t\t? state.selectedIndex === 0\n\t\t\t\t\t\t? length - 1\n\t\t\t\t\t\t: state.selectedIndex - 1\n\t\t\t\t\t: state.selectedIndex === length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: state.selectedIndex + 1;\n\t\t\treturn { ...state, selectedIndex };\n\t\t}\n\t}\n}\n\n/** Resolve the selected model key, if any, for the current visible list. */\nexport function selectedModelKey(state: ModelSelectorState): string | undefined {\n\treturn state.visibleModelKeys[state.selectedIndex];\n}\n\nexport interface ProviderStripLayout {\n\t/** Tab indices to render, in ascending order. Always includes 0 and the active index. */\n\treadonly indices: readonly number[];\n\t/** Render an ellipsis between the first tab (\"all\") and the rest (hidden middle). */\n\treadonly ellipsisAfterFirst: boolean;\n\t/** Render a trailing ellipsis (tabs hidden after the last shown). */\n\treadonly trailingEllipsis: boolean;\n}\n\nfunction providerStripWidth(\n\tindices: readonly number[],\n\ttabWidths: readonly number[],\n\tseparatorWidth: number,\n\tellipsisWidth: number,\n): number {\n\tif (indices.length === 0) return 0;\n\tlet total = 0;\n\tlet gaps = 0;\n\tfor (let k = 0; k < indices.length; k++) {\n\t\tconst current = indices[k] ?? 0;\n\t\ttotal += tabWidths[current] ?? 0;\n\t\tif (k > 0) {\n\t\t\ttotal += separatorWidth;\n\t\t\tif (current - (indices[k - 1] ?? 0) > 1) gaps += 1;\n\t\t}\n\t}\n\tconst last = indices[indices.length - 1] ?? 0;\n\tconst trailing = last < tabWidths.length - 1 ? 1 : 0;\n\t// Each ellipsis renders as its own segment joined by a separator, so it costs\n\t// a separator in addition to the ellipsis glyph.\n\treturn total + (ellipsisWidth + separatorWidth) * (gaps + trailing);\n}\n\n/**\n * Window a provider tab strip into a visible-column budget so the row never\n * overflows the terminal while always keeping the \"all\" anchor (index 0) and the\n * active tab visible. When the full strip fits, every tab is shown. Otherwise a\n * contiguous window is grown around the active tab (right-biased, then left),\n * with a single leading ellipsis for a hidden middle and a trailing ellipsis for\n * hidden tail tabs.\n *\n * Pure and presentation-agnostic: callers pass the visible width of each themed\n * tab label (via omk-tui `visibleWidth`) plus the separator/ellipsis widths.\n * If the budget cannot even hold the mandatory {all, active} tabs, those are\n * still returned (the caller may then hard-truncate).\n */\nexport function fitProviderStrip(\n\ttabWidths: readonly number[],\n\tactiveIndex: number,\n\tbudget: number,\n\tseparatorWidth: number,\n\tellipsisWidth: number,\n): ProviderStripLayout {\n\tconst n = tabWidths.length;\n\tif (n === 0) return { indices: [], ellipsisAfterFirst: false, trailingEllipsis: false };\n\n\tconst allIndices = Array.from({ length: n }, (_, i) => i);\n\tif (providerStripWidth(allIndices, tabWidths, separatorWidth, ellipsisWidth) <= budget) {\n\t\treturn { indices: allIndices, ellipsisAfterFirst: false, trailingEllipsis: false };\n\t}\n\n\tconst active = Math.max(0, Math.min(activeIndex, n - 1));\n\tconst shown = new Set<number>([0, active]);\n\tconst sortedShown = (): number[] => [...shown].sort((a, b) => a - b);\n\n\tlet low = active;\n\tlet high = active;\n\tlet progressed = true;\n\twhile (progressed) {\n\t\tprogressed = false;\n\t\tif (high + 1 < n && !shown.has(high + 1)) {\n\t\t\tshown.add(high + 1);\n\t\t\tif (providerStripWidth(sortedShown(), tabWidths, separatorWidth, ellipsisWidth) <= budget) {\n\t\t\t\thigh += 1;\n\t\t\t\tprogressed = true;\n\t\t\t} else {\n\t\t\t\tshown.delete(high + 1);\n\t\t\t}\n\t\t}\n\t\tif (low - 1 > 0 && !shown.has(low - 1)) {\n\t\t\tshown.add(low - 1);\n\t\t\tif (providerStripWidth(sortedShown(), tabWidths, separatorWidth, ellipsisWidth) <= budget) {\n\t\t\t\tlow -= 1;\n\t\t\t\tprogressed = true;\n\t\t\t} else {\n\t\t\t\tshown.delete(low - 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst indices = sortedShown();\n\tconst first = indices[0] ?? 0;\n\tconst second = indices[1] ?? first;\n\tconst last = indices[indices.length - 1] ?? 0;\n\treturn {\n\t\tindices,\n\t\tellipsisAfterFirst: indices.length > 1 && second - first > 1,\n\t\ttrailingEllipsis: last < n - 1,\n\t};\n}\n"]}
|
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { fuzzyFilter } from "@earendil-works/omk-tui";
|
|
2
|
-
export const ALL_PROVIDER_TAB = "all";
|
|
3
|
-
/**
|
|
4
|
-
* Preferred display order for first-party providers. Anything outside this list
|
|
5
|
-
* is treated as a custom provider and sorted lexicographically after the known
|
|
6
|
-
* providers (see {@link buildProviderTabs}).
|
|
7
|
-
*/
|
|
8
|
-
export const KNOWN_PROVIDER_ORDER = [
|
|
9
|
-
"anthropic",
|
|
10
|
-
"openai",
|
|
11
|
-
"google",
|
|
12
|
-
"deepseek",
|
|
13
|
-
"kimi",
|
|
14
|
-
"openrouter",
|
|
15
|
-
"mistral",
|
|
16
|
-
"xai",
|
|
17
|
-
"groq",
|
|
18
|
-
"zai",
|
|
19
|
-
"together",
|
|
20
|
-
"fireworks",
|
|
21
|
-
];
|
|
22
|
-
export function modelSelectorModelKey(model) {
|
|
23
|
-
return `${model.provider}/${model.id}`;
|
|
24
|
-
}
|
|
25
|
-
function isKnownProvider(provider) {
|
|
26
|
-
return KNOWN_PROVIDER_ORDER.includes(provider);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Build the provider tab ring: `all` first, then known providers in their
|
|
30
|
-
* canonical order, then any custom providers sorted lexicographically.
|
|
31
|
-
*/
|
|
32
|
-
export function buildProviderTabs(models) {
|
|
33
|
-
const providerIds = Array.from(new Set(models.map((model) => model.provider)));
|
|
34
|
-
const ordered = KNOWN_PROVIDER_ORDER.filter((provider) => providerIds.includes(provider));
|
|
35
|
-
const extras = providerIds.filter((provider) => !isKnownProvider(provider)).sort((a, b) => a.localeCompare(b));
|
|
36
|
-
return [ALL_PROVIDER_TAB, ...ordered, ...extras];
|
|
37
|
-
}
|
|
38
|
-
function filterByProvider(models, activeProvider) {
|
|
39
|
-
if (activeProvider === ALL_PROVIDER_TAB)
|
|
40
|
-
return models;
|
|
41
|
-
return models.filter((model) => model.provider === activeProvider);
|
|
42
|
-
}
|
|
43
|
-
function applySearch(models, query) {
|
|
44
|
-
if (!query)
|
|
45
|
-
return models;
|
|
46
|
-
return fuzzyFilter([...models], query, ({ id, provider }) => `${id} ${provider} ${provider}/${id} ${provider} ${id}`);
|
|
47
|
-
}
|
|
48
|
-
function clampIndex(index, length) {
|
|
49
|
-
if (length === 0)
|
|
50
|
-
return 0;
|
|
51
|
-
return Math.min(Math.max(index, 0), length - 1);
|
|
52
|
-
}
|
|
53
|
-
export function createInitialModelSelectorState(options = {}) {
|
|
54
|
-
return {
|
|
55
|
-
scope: options.scope ?? "all",
|
|
56
|
-
activeProvider: options.activeProvider ?? ALL_PROVIDER_TAB,
|
|
57
|
-
providerIds: [ALL_PROVIDER_TAB],
|
|
58
|
-
query: options.query ?? "",
|
|
59
|
-
selectedIndex: 0,
|
|
60
|
-
visibleModelKeys: [],
|
|
61
|
-
allModels: [],
|
|
62
|
-
scopedModels: [],
|
|
63
|
-
currentModelKey: undefined,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Recompute provider tabs, the validated active provider, and the visible model
|
|
68
|
-
* list for the given corpus/scope/query, then resolve the selected index with
|
|
69
|
-
* the supplied strategy. Centralizing this keeps every transition consistent
|
|
70
|
-
* with the contract invariants.
|
|
71
|
-
*/
|
|
72
|
-
function project(overrides) {
|
|
73
|
-
const corpus = overrides.scope === "scoped" ? overrides.scopedModels : overrides.allModels;
|
|
74
|
-
const providerIds = buildProviderTabs(corpus);
|
|
75
|
-
const activeProvider = providerIds.includes(overrides.desiredProvider)
|
|
76
|
-
? overrides.desiredProvider
|
|
77
|
-
: ALL_PROVIDER_TAB;
|
|
78
|
-
const providerFiltered = filterByProvider(corpus, activeProvider);
|
|
79
|
-
const visible = applySearch(providerFiltered, overrides.query);
|
|
80
|
-
const visibleModelKeys = visible.map(modelSelectorModelKey);
|
|
81
|
-
const selectedIndex = clampIndex(overrides.select({
|
|
82
|
-
visibleKeys: visibleModelKeys,
|
|
83
|
-
providerFilteredKeys: providerFiltered.map(modelSelectorModelKey),
|
|
84
|
-
}), visibleModelKeys.length);
|
|
85
|
-
return {
|
|
86
|
-
scope: overrides.scope,
|
|
87
|
-
activeProvider,
|
|
88
|
-
providerIds,
|
|
89
|
-
query: overrides.query,
|
|
90
|
-
selectedIndex,
|
|
91
|
-
visibleModelKeys,
|
|
92
|
-
allModels: overrides.allModels,
|
|
93
|
-
scopedModels: overrides.scopedModels,
|
|
94
|
-
currentModelKey: overrides.currentModelKey,
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
export function modelSelectorReducer(state, action) {
|
|
98
|
-
switch (action.type) {
|
|
99
|
-
case "REFRESH_MODELS":
|
|
100
|
-
return project({
|
|
101
|
-
scope: state.scope,
|
|
102
|
-
allModels: action.allModels,
|
|
103
|
-
scopedModels: action.scopedModels,
|
|
104
|
-
query: state.query,
|
|
105
|
-
currentModelKey: action.currentModelKey,
|
|
106
|
-
desiredProvider: state.activeProvider,
|
|
107
|
-
select: ({ visibleKeys }) => {
|
|
108
|
-
const currentIndex = action.currentModelKey ? visibleKeys.indexOf(action.currentModelKey) : -1;
|
|
109
|
-
return currentIndex >= 0
|
|
110
|
-
? currentIndex
|
|
111
|
-
: Math.min(state.selectedIndex, Math.max(0, visibleKeys.length - 1));
|
|
112
|
-
},
|
|
113
|
-
});
|
|
114
|
-
case "NEXT_PROVIDER":
|
|
115
|
-
case "PREVIOUS_PROVIDER": {
|
|
116
|
-
if (state.providerIds.length === 0)
|
|
117
|
-
return state;
|
|
118
|
-
const direction = action.type === "NEXT_PROVIDER" ? 1 : -1;
|
|
119
|
-
const currentIndex = Math.max(0, state.providerIds.indexOf(state.activeProvider));
|
|
120
|
-
const nextIndex = (currentIndex + direction + state.providerIds.length) % state.providerIds.length;
|
|
121
|
-
const desiredProvider = state.providerIds[nextIndex] ?? ALL_PROVIDER_TAB;
|
|
122
|
-
return project({
|
|
123
|
-
scope: state.scope,
|
|
124
|
-
allModels: state.allModels,
|
|
125
|
-
scopedModels: state.scopedModels,
|
|
126
|
-
query: state.query,
|
|
127
|
-
currentModelKey: state.currentModelKey,
|
|
128
|
-
desiredProvider,
|
|
129
|
-
select: () => 0,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
case "TOGGLE_SCOPE_FORWARD":
|
|
133
|
-
case "TOGGLE_SCOPE_BACKWARD": {
|
|
134
|
-
// Scope is a two-state toggle (all <-> scoped); both directions flip it.
|
|
135
|
-
// Without scoped models there is nothing to toggle into.
|
|
136
|
-
if (state.scopedModels.length === 0)
|
|
137
|
-
return state;
|
|
138
|
-
const scope = state.scope === "all" ? "scoped" : "all";
|
|
139
|
-
return project({
|
|
140
|
-
scope,
|
|
141
|
-
allModels: state.allModels,
|
|
142
|
-
scopedModels: state.scopedModels,
|
|
143
|
-
query: state.query,
|
|
144
|
-
currentModelKey: state.currentModelKey,
|
|
145
|
-
desiredProvider: state.activeProvider,
|
|
146
|
-
select: ({ providerFilteredKeys }) => {
|
|
147
|
-
const currentIndex = state.currentModelKey ? providerFilteredKeys.indexOf(state.currentModelKey) : -1;
|
|
148
|
-
return currentIndex >= 0 ? currentIndex : 0;
|
|
149
|
-
},
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
case "SEARCH":
|
|
153
|
-
return project({
|
|
154
|
-
scope: state.scope,
|
|
155
|
-
allModels: state.allModels,
|
|
156
|
-
scopedModels: state.scopedModels,
|
|
157
|
-
query: action.query,
|
|
158
|
-
currentModelKey: state.currentModelKey,
|
|
159
|
-
desiredProvider: state.activeProvider,
|
|
160
|
-
select: () => state.selectedIndex,
|
|
161
|
-
});
|
|
162
|
-
case "MOVE_SELECTION": {
|
|
163
|
-
const length = state.visibleModelKeys.length;
|
|
164
|
-
if (length === 0)
|
|
165
|
-
return state;
|
|
166
|
-
const selectedIndex = action.delta === -1
|
|
167
|
-
? state.selectedIndex === 0
|
|
168
|
-
? length - 1
|
|
169
|
-
: state.selectedIndex - 1
|
|
170
|
-
: state.selectedIndex === length - 1
|
|
171
|
-
? 0
|
|
172
|
-
: state.selectedIndex + 1;
|
|
173
|
-
return { ...state, selectedIndex };
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
/** Resolve the selected model key, if any, for the current visible list. */
|
|
178
|
-
export function selectedModelKey(state) {
|
|
179
|
-
return state.visibleModelKeys[state.selectedIndex];
|
|
180
|
-
}
|
|
181
|
-
function providerStripWidth(indices, tabWidths, separatorWidth, ellipsisWidth) {
|
|
182
|
-
if (indices.length === 0)
|
|
183
|
-
return 0;
|
|
184
|
-
let total = 0;
|
|
185
|
-
let gaps = 0;
|
|
186
|
-
for (let k = 0; k < indices.length; k++) {
|
|
187
|
-
const current = indices[k] ?? 0;
|
|
188
|
-
total += tabWidths[current] ?? 0;
|
|
189
|
-
if (k > 0) {
|
|
190
|
-
total += separatorWidth;
|
|
191
|
-
if (current - (indices[k - 1] ?? 0) > 1)
|
|
192
|
-
gaps += 1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const last = indices[indices.length - 1] ?? 0;
|
|
196
|
-
const trailing = last < tabWidths.length - 1 ? 1 : 0;
|
|
197
|
-
// Each ellipsis renders as its own segment joined by a separator, so it costs
|
|
198
|
-
// a separator in addition to the ellipsis glyph.
|
|
199
|
-
return total + (ellipsisWidth + separatorWidth) * (gaps + trailing);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Window a provider tab strip into a visible-column budget so the row never
|
|
203
|
-
* overflows the terminal while always keeping the "all" anchor (index 0) and the
|
|
204
|
-
* active tab visible. When the full strip fits, every tab is shown. Otherwise a
|
|
205
|
-
* contiguous window is grown around the active tab (right-biased, then left),
|
|
206
|
-
* with a single leading ellipsis for a hidden middle and a trailing ellipsis for
|
|
207
|
-
* hidden tail tabs.
|
|
208
|
-
*
|
|
209
|
-
* Pure and presentation-agnostic: callers pass the visible width of each themed
|
|
210
|
-
* tab label (via omk-tui `visibleWidth`) plus the separator/ellipsis widths.
|
|
211
|
-
* If the budget cannot even hold the mandatory {all, active} tabs, those are
|
|
212
|
-
* still returned (the caller may then hard-truncate).
|
|
213
|
-
*/
|
|
214
|
-
export function fitProviderStrip(tabWidths, activeIndex, budget, separatorWidth, ellipsisWidth) {
|
|
215
|
-
const n = tabWidths.length;
|
|
216
|
-
if (n === 0)
|
|
217
|
-
return { indices: [], ellipsisAfterFirst: false, trailingEllipsis: false };
|
|
218
|
-
const allIndices = Array.from({ length: n }, (_, i) => i);
|
|
219
|
-
if (providerStripWidth(allIndices, tabWidths, separatorWidth, ellipsisWidth) <= budget) {
|
|
220
|
-
return { indices: allIndices, ellipsisAfterFirst: false, trailingEllipsis: false };
|
|
221
|
-
}
|
|
222
|
-
const active = Math.max(0, Math.min(activeIndex, n - 1));
|
|
223
|
-
const shown = new Set([0, active]);
|
|
224
|
-
const sortedShown = () => [...shown].sort((a, b) => a - b);
|
|
225
|
-
let low = active;
|
|
226
|
-
let high = active;
|
|
227
|
-
let progressed = true;
|
|
228
|
-
while (progressed) {
|
|
229
|
-
progressed = false;
|
|
230
|
-
if (high + 1 < n && !shown.has(high + 1)) {
|
|
231
|
-
shown.add(high + 1);
|
|
232
|
-
if (providerStripWidth(sortedShown(), tabWidths, separatorWidth, ellipsisWidth) <= budget) {
|
|
233
|
-
high += 1;
|
|
234
|
-
progressed = true;
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
shown.delete(high + 1);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
if (low - 1 > 0 && !shown.has(low - 1)) {
|
|
241
|
-
shown.add(low - 1);
|
|
242
|
-
if (providerStripWidth(sortedShown(), tabWidths, separatorWidth, ellipsisWidth) <= budget) {
|
|
243
|
-
low -= 1;
|
|
244
|
-
progressed = true;
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
shown.delete(low - 1);
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
const indices = sortedShown();
|
|
252
|
-
const first = indices[0] ?? 0;
|
|
253
|
-
const second = indices[1] ?? first;
|
|
254
|
-
const last = indices[indices.length - 1] ?? 0;
|
|
255
|
-
return {
|
|
256
|
-
indices,
|
|
257
|
-
ellipsisAfterFirst: indices.length > 1 && second - first > 1,
|
|
258
|
-
trailingEllipsis: last < n - 1,
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
//# sourceMappingURL=model-selector-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-selector-state.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/model-selector-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgBtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAc,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,MAAM;IACN,YAAY;IACZ,SAAS;IACT,KAAK;IACL,MAAM;IACN,KAAK;IACL,UAAU;IACV,WAAW;CACF,CAAC;AAwCX,MAAM,UAAU,qBAAqB,CAAC,KAAyD,EAAU;IACxG,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,EAAE,EAAE,CAAC;AAAA,CACvC;AAED,SAAS,eAAe,CAAC,QAAgB,EAAW;IACnD,OAAQ,oBAA0C,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAAA,CACtE;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAqC,EAAiB;IACvF,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC/E,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1F,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC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C;YACnB,CAAC;iBAAM,CAAC;gBACP,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;YACxB,CAAC;QACF,CAAC;QACD,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC;YACxC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YACnB,IAAI,kBAAkB,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,CAAC,IAAI,MAAM,EAAE,CAAC;gBAC3F,GAAG,IAAI,CAAC,CAAC;gBACT,UAAU,GAAG,IAAI,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACP,KAAK,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YACvB,CAAC;QACF,CAAC;IACF,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;IACnC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO;QACN,OAAO;QACP,kBAAkB,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,KAAK,GAAG,CAAC;QAC5D,gBAAgB,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC;KAC9B,CAAC;AAAA,CACF","sourcesContent":["import { fuzzyFilter } from \"@earendil-works/omk-tui\";\n\n/**\n * Pure, render-free state machine for the `/model` selector.\n *\n * The interactive {@link ModelSelectorComponent} is a thin view/controller that\n * delegates every state transition to {@link modelSelectorReducer}. Keeping the\n * decision logic here makes the `/model` contract testable without a TUI and\n * shrinks the blast radius of theme/rendering refactors: presentation can change\n * freely as long as this reducer keeps its semantic guarantees.\n */\n\nexport type ModelScope = \"all\" | \"scoped\";\n\nexport type ProviderTab = \"all\" | string;\n\nexport const ALL_PROVIDER_TAB = \"all\" as const;\n\n/**\n * Preferred display order for first-party providers. Anything outside this list\n * is treated as a custom provider and sorted lexicographically after the known\n * providers (see {@link buildProviderTabs}).\n */\nexport const KNOWN_PROVIDER_ORDER = [\n\t\"anthropic\",\n\t\"openai\",\n\t\"google\",\n\t\"deepseek\",\n\t\"kimi\",\n\t\"openrouter\",\n\t\"mistral\",\n\t\"xai\",\n\t\"groq\",\n\t\"zai\",\n\t\"together\",\n\t\"fireworks\",\n] as const;\n\n/**\n * Minimal model projection the reducer needs. The component maps its richer\n * `ModelItem` (with the full `Model` object) down to this shape and keeps a\n * key -> item map for rendering and selection.\n */\nexport interface ModelSelectorModel {\n\treadonly provider: string;\n\treadonly id: string;\n\treadonly name: string;\n}\n\nexport interface ModelSelectorState {\n\treadonly scope: ModelScope;\n\treadonly activeProvider: ProviderTab;\n\treadonly providerIds: readonly ProviderTab[];\n\treadonly query: string;\n\treadonly selectedIndex: number;\n\treadonly visibleModelKeys: readonly string[];\n\t/** Full corpus retained so transitions stay pure functions of (state, action). */\n\treadonly allModels: readonly ModelSelectorModel[];\n\treadonly scopedModels: readonly ModelSelectorModel[];\n\treadonly currentModelKey?: string;\n}\n\nexport type ModelSelectorAction =\n\t| { type: \"NEXT_PROVIDER\" }\n\t| { type: \"PREVIOUS_PROVIDER\" }\n\t| { type: \"TOGGLE_SCOPE_FORWARD\" }\n\t| { type: \"TOGGLE_SCOPE_BACKWARD\" }\n\t| { type: \"SEARCH\"; query: string }\n\t| { type: \"MOVE_SELECTION\"; delta: 1 | -1 }\n\t| {\n\t\t\ttype: \"REFRESH_MODELS\";\n\t\t\tallModels: readonly ModelSelectorModel[];\n\t\t\tscopedModels: readonly ModelSelectorModel[];\n\t\t\tcurrentModelKey?: string;\n\t };\n\nexport function modelSelectorModelKey(model: { readonly provider: string; readonly id: string }): string {\n\treturn `${model.provider}/${model.id}`;\n}\n\nfunction isKnownProvider(provider: string): boolean {\n\treturn (KNOWN_PROVIDER_ORDER as readonly string[]).includes(provider);\n}\n\n/**\n * Build the provider tab ring: `all` first, then known providers in their\n * canonical order, then any custom providers sorted lexicographically.\n */\nexport function buildProviderTabs(models: readonly ModelSelectorModel[]): ProviderTab[] {\n\tconst providerIds = Array.from(new Set(models.map((model) => model.provider)));\n\tconst ordered = KNOWN_PROVIDER_ORDER.filter((provider) => providerIds.includes(provider));\n\tconst extras = providerIds.filter((provider) => !isKnownProvider(provider)).sort((a, b) => a.localeCompare(b));\n\treturn [ALL_PROVIDER_TAB, ...ordered, ...extras];\n}\n\nfunction filterByProvider(\n\tmodels: readonly ModelSelectorModel[],\n\tactiveProvider: ProviderTab,\n): readonly ModelSelectorModel[] {\n\tif (activeProvider === ALL_PROVIDER_TAB) return models;\n\treturn models.filter((model) => model.provider === activeProvider);\n}\n\nfunction applySearch(models: readonly ModelSelectorModel[], query: string): readonly ModelSelectorModel[] {\n\tif (!query) return models;\n\treturn fuzzyFilter(\n\t\t[...models],\n\t\tquery,\n\t\t({ id, provider }) => `${id} ${provider} ${provider}/${id} ${provider} ${id}`,\n\t);\n}\n\nfunction clampIndex(index: number, length: number): number {\n\tif (length === 0) return 0;\n\treturn Math.min(Math.max(index, 0), length - 1);\n}\n\nexport interface CreateInitialOptions {\n\treadonly scope?: ModelScope;\n\treadonly activeProvider?: ProviderTab;\n\treadonly query?: string;\n}\n\nexport function createInitialModelSelectorState(options: CreateInitialOptions = {}): ModelSelectorState {\n\treturn {\n\t\tscope: options.scope ?? \"all\",\n\t\tactiveProvider: options.activeProvider ?? ALL_PROVIDER_TAB,\n\t\tproviderIds: [ALL_PROVIDER_TAB],\n\t\tquery: options.query ?? \"\",\n\t\tselectedIndex: 0,\n\t\tvisibleModelKeys: [],\n\t\tallModels: [],\n\t\tscopedModels: [],\n\t\tcurrentModelKey: undefined,\n\t};\n}\n\n/**\n * Recompute provider tabs, the validated active provider, and the visible model\n * list for the given corpus/scope/query, then resolve the selected index with\n * the supplied strategy. Centralizing this keeps every transition consistent\n * with the contract invariants.\n */\nfunction project(overrides: {\n\treadonly scope: ModelScope;\n\treadonly allModels: readonly ModelSelectorModel[];\n\treadonly scopedModels: readonly ModelSelectorModel[];\n\treadonly query: string;\n\treadonly currentModelKey?: string;\n\treadonly desiredProvider: ProviderTab;\n\treadonly select: (input: {\n\t\treadonly visibleKeys: readonly string[];\n\t\treadonly providerFilteredKeys: readonly string[];\n\t}) => number;\n}): ModelSelectorState {\n\tconst corpus = overrides.scope === \"scoped\" ? overrides.scopedModels : overrides.allModels;\n\tconst providerIds = buildProviderTabs(corpus);\n\tconst activeProvider = providerIds.includes(overrides.desiredProvider)\n\t\t? overrides.desiredProvider\n\t\t: ALL_PROVIDER_TAB;\n\tconst providerFiltered = filterByProvider(corpus, activeProvider);\n\tconst visible = applySearch(providerFiltered, overrides.query);\n\tconst visibleModelKeys = visible.map(modelSelectorModelKey);\n\tconst selectedIndex = clampIndex(\n\t\toverrides.select({\n\t\t\tvisibleKeys: visibleModelKeys,\n\t\t\tproviderFilteredKeys: providerFiltered.map(modelSelectorModelKey),\n\t\t}),\n\t\tvisibleModelKeys.length,\n\t);\n\treturn {\n\t\tscope: overrides.scope,\n\t\tactiveProvider,\n\t\tproviderIds,\n\t\tquery: overrides.query,\n\t\tselectedIndex,\n\t\tvisibleModelKeys,\n\t\tallModels: overrides.allModels,\n\t\tscopedModels: overrides.scopedModels,\n\t\tcurrentModelKey: overrides.currentModelKey,\n\t};\n}\n\nexport function modelSelectorReducer(state: ModelSelectorState, action: ModelSelectorAction): ModelSelectorState {\n\tswitch (action.type) {\n\t\tcase \"REFRESH_MODELS\":\n\t\t\treturn project({\n\t\t\t\tscope: state.scope,\n\t\t\t\tallModels: action.allModels,\n\t\t\t\tscopedModels: action.scopedModels,\n\t\t\t\tquery: state.query,\n\t\t\t\tcurrentModelKey: action.currentModelKey,\n\t\t\t\tdesiredProvider: state.activeProvider,\n\t\t\t\tselect: ({ visibleKeys }) => {\n\t\t\t\t\tconst currentIndex = action.currentModelKey ? visibleKeys.indexOf(action.currentModelKey) : -1;\n\t\t\t\t\treturn currentIndex >= 0\n\t\t\t\t\t\t? currentIndex\n\t\t\t\t\t\t: Math.min(state.selectedIndex, Math.max(0, visibleKeys.length - 1));\n\t\t\t\t},\n\t\t\t});\n\n\t\tcase \"NEXT_PROVIDER\":\n\t\tcase \"PREVIOUS_PROVIDER\": {\n\t\t\tif (state.providerIds.length === 0) return state;\n\t\t\tconst direction = action.type === \"NEXT_PROVIDER\" ? 1 : -1;\n\t\t\tconst currentIndex = Math.max(0, state.providerIds.indexOf(state.activeProvider));\n\t\t\tconst nextIndex = (currentIndex + direction + state.providerIds.length) % state.providerIds.length;\n\t\t\tconst desiredProvider = state.providerIds[nextIndex] ?? ALL_PROVIDER_TAB;\n\t\t\treturn project({\n\t\t\t\tscope: state.scope,\n\t\t\t\tallModels: state.allModels,\n\t\t\t\tscopedModels: state.scopedModels,\n\t\t\t\tquery: state.query,\n\t\t\t\tcurrentModelKey: state.currentModelKey,\n\t\t\t\tdesiredProvider,\n\t\t\t\tselect: () => 0,\n\t\t\t});\n\t\t}\n\n\t\tcase \"TOGGLE_SCOPE_FORWARD\":\n\t\tcase \"TOGGLE_SCOPE_BACKWARD\": {\n\t\t\t// Scope is a two-state toggle (all <-> scoped); both directions flip it.\n\t\t\t// Without scoped models there is nothing to toggle into.\n\t\t\tif (state.scopedModels.length === 0) return state;\n\t\t\tconst scope: ModelScope = state.scope === \"all\" ? \"scoped\" : \"all\";\n\t\t\treturn project({\n\t\t\t\tscope,\n\t\t\t\tallModels: state.allModels,\n\t\t\t\tscopedModels: state.scopedModels,\n\t\t\t\tquery: state.query,\n\t\t\t\tcurrentModelKey: state.currentModelKey,\n\t\t\t\tdesiredProvider: state.activeProvider,\n\t\t\t\tselect: ({ providerFilteredKeys }) => {\n\t\t\t\t\tconst currentIndex = state.currentModelKey ? providerFilteredKeys.indexOf(state.currentModelKey) : -1;\n\t\t\t\t\treturn currentIndex >= 0 ? currentIndex : 0;\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tcase \"SEARCH\":\n\t\t\treturn project({\n\t\t\t\tscope: state.scope,\n\t\t\t\tallModels: state.allModels,\n\t\t\t\tscopedModels: state.scopedModels,\n\t\t\t\tquery: action.query,\n\t\t\t\tcurrentModelKey: state.currentModelKey,\n\t\t\t\tdesiredProvider: state.activeProvider,\n\t\t\t\tselect: () => state.selectedIndex,\n\t\t\t});\n\n\t\tcase \"MOVE_SELECTION\": {\n\t\t\tconst length = state.visibleModelKeys.length;\n\t\t\tif (length === 0) return state;\n\t\t\tconst selectedIndex =\n\t\t\t\taction.delta === -1\n\t\t\t\t\t? state.selectedIndex === 0\n\t\t\t\t\t\t? length - 1\n\t\t\t\t\t\t: state.selectedIndex - 1\n\t\t\t\t\t: state.selectedIndex === length - 1\n\t\t\t\t\t\t? 0\n\t\t\t\t\t\t: state.selectedIndex + 1;\n\t\t\treturn { ...state, selectedIndex };\n\t\t}\n\t}\n}\n\n/** Resolve the selected model key, if any, for the current visible list. */\nexport function selectedModelKey(state: ModelSelectorState): string | undefined {\n\treturn state.visibleModelKeys[state.selectedIndex];\n}\n\nexport interface ProviderStripLayout {\n\t/** Tab indices to render, in ascending order. Always includes 0 and the active index. */\n\treadonly indices: readonly number[];\n\t/** Render an ellipsis between the first tab (\"all\") and the rest (hidden middle). */\n\treadonly ellipsisAfterFirst: boolean;\n\t/** Render a trailing ellipsis (tabs hidden after the last shown). */\n\treadonly trailingEllipsis: boolean;\n}\n\nfunction providerStripWidth(\n\tindices: readonly number[],\n\ttabWidths: readonly number[],\n\tseparatorWidth: number,\n\tellipsisWidth: number,\n): number {\n\tif (indices.length === 0) return 0;\n\tlet total = 0;\n\tlet gaps = 0;\n\tfor (let k = 0; k < indices.length; k++) {\n\t\tconst current = indices[k] ?? 0;\n\t\ttotal += tabWidths[current] ?? 0;\n\t\tif (k > 0) {\n\t\t\ttotal += separatorWidth;\n\t\t\tif (current - (indices[k - 1] ?? 0) > 1) gaps += 1;\n\t\t}\n\t}\n\tconst last = indices[indices.length - 1] ?? 0;\n\tconst trailing = last < tabWidths.length - 1 ? 1 : 0;\n\t// Each ellipsis renders as its own segment joined by a separator, so it costs\n\t// a separator in addition to the ellipsis glyph.\n\treturn total + (ellipsisWidth + separatorWidth) * (gaps + trailing);\n}\n\n/**\n * Window a provider tab strip into a visible-column budget so the row never\n * overflows the terminal while always keeping the \"all\" anchor (index 0) and the\n * active tab visible. When the full strip fits, every tab is shown. Otherwise a\n * contiguous window is grown around the active tab (right-biased, then left),\n * with a single leading ellipsis for a hidden middle and a trailing ellipsis for\n * hidden tail tabs.\n *\n * Pure and presentation-agnostic: callers pass the visible width of each themed\n * tab label (via omk-tui `visibleWidth`) plus the separator/ellipsis widths.\n * If the budget cannot even hold the mandatory {all, active} tabs, those are\n * still returned (the caller may then hard-truncate).\n */\nexport function fitProviderStrip(\n\ttabWidths: readonly number[],\n\tactiveIndex: number,\n\tbudget: number,\n\tseparatorWidth: number,\n\tellipsisWidth: number,\n): ProviderStripLayout {\n\tconst n = tabWidths.length;\n\tif (n === 0) return { indices: [], ellipsisAfterFirst: false, trailingEllipsis: false };\n\n\tconst allIndices = Array.from({ length: n }, (_, i) => i);\n\tif (providerStripWidth(allIndices, tabWidths, separatorWidth, ellipsisWidth) <= budget) {\n\t\treturn { indices: allIndices, ellipsisAfterFirst: false, trailingEllipsis: false };\n\t}\n\n\tconst active = Math.max(0, Math.min(activeIndex, n - 1));\n\tconst shown = new Set<number>([0, active]);\n\tconst sortedShown = (): number[] => [...shown].sort((a, b) => a - b);\n\n\tlet low = active;\n\tlet high = active;\n\tlet progressed = true;\n\twhile (progressed) {\n\t\tprogressed = false;\n\t\tif (high + 1 < n && !shown.has(high + 1)) {\n\t\t\tshown.add(high + 1);\n\t\t\tif (providerStripWidth(sortedShown(), tabWidths, separatorWidth, ellipsisWidth) <= budget) {\n\t\t\t\thigh += 1;\n\t\t\t\tprogressed = true;\n\t\t\t} else {\n\t\t\t\tshown.delete(high + 1);\n\t\t\t}\n\t\t}\n\t\tif (low - 1 > 0 && !shown.has(low - 1)) {\n\t\t\tshown.add(low - 1);\n\t\t\tif (providerStripWidth(sortedShown(), tabWidths, separatorWidth, ellipsisWidth) <= budget) {\n\t\t\t\tlow -= 1;\n\t\t\t\tprogressed = true;\n\t\t\t} else {\n\t\t\t\tshown.delete(low - 1);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst indices = sortedShown();\n\tconst first = indices[0] ?? 0;\n\tconst second = indices[1] ?? first;\n\tconst last = indices[indices.length - 1] ?? 0;\n\treturn {\n\t\tindices,\n\t\tellipsisAfterFirst: indices.length > 1 && second - first > 1,\n\t\ttrailingEllipsis: last < n - 1,\n\t};\n}\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skills inventory selector with fuzzy search input + counter.
|
|
3
|
-
* Read-only: never invokes or modifies a skill.
|
|
4
|
-
*/
|
|
5
|
-
import { Container, type Focusable } from "@earendil-works/omk-tui";
|
|
6
|
-
import type { ResourceDiagnostic } from "../../../core/resource-loader.ts";
|
|
7
|
-
import type { Skill } from "../../../core/skills.ts";
|
|
8
|
-
export interface SkillsSelectorInput {
|
|
9
|
-
skills: ReadonlyArray<Skill>;
|
|
10
|
-
diagnostics: ReadonlyArray<ResourceDiagnostic>;
|
|
11
|
-
enableSkillCommands: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare class SkillsSelectorComponent extends Container implements Focusable {
|
|
14
|
-
private allSkills;
|
|
15
|
-
private filteredSkills;
|
|
16
|
-
private selectedIndex;
|
|
17
|
-
private listContainer;
|
|
18
|
-
private detailContainer;
|
|
19
|
-
private counterText;
|
|
20
|
-
private searchInput;
|
|
21
|
-
private onCancelCallback;
|
|
22
|
-
private _focused;
|
|
23
|
-
get focused(): boolean;
|
|
24
|
-
set focused(value: boolean);
|
|
25
|
-
constructor(input: SkillsSelectorInput, onCancel: () => void);
|
|
26
|
-
private getCounterText;
|
|
27
|
-
private applyFilter;
|
|
28
|
-
private updateList;
|
|
29
|
-
private updateDetail;
|
|
30
|
-
handleInput(keyData: string): void;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=skills-selector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/skills-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAoD,MAAM,yBAAyB,CAAC;AACtH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKrD,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAC7B,WAAW,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC/C,mBAAmB,EAAE,OAAO,CAAC;CAC7B;AAED,qBAAa,uBAAwB,SAAQ,SAAU,YAAW,SAAS;IAC1E,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,cAAc,CAAuB;IAC7C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,eAAe,CAAY;IACnC,OAAO,CAAC,WAAW,CAAO;IAC1B,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,gBAAgB,CAAa;IAErC,OAAO,CAAC,QAAQ,CAAS;IACzB,IAAI,OAAO,IAAI,OAAO,CAErB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IAED,YAAY,KAAK,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,IAAI,EA4D3D;IAED,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,YAAY;IAapB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAsBjC;CACD","sourcesContent":["/**\n * Skills inventory selector with fuzzy search input + counter.\n * Read-only: never invokes or modifies a skill.\n */\n\nimport { Container, type Focusable, fuzzyFilter, getKeybindings, Input, Spacer, Text } from \"@earendil-works/omk-tui\";\nimport type { ResourceDiagnostic } from \"../../../core/resource-loader.ts\";\nimport type { Skill } from \"../../../core/skills.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint, rawKeyHint } from \"./keybinding-hints.ts\";\n\nexport interface SkillsSelectorInput {\n\tskills: ReadonlyArray<Skill>;\n\tdiagnostics: ReadonlyArray<ResourceDiagnostic>;\n\tenableSkillCommands: boolean;\n}\n\nexport class SkillsSelectorComponent extends Container implements Focusable {\n\tprivate allSkills: ReadonlyArray<Skill>;\n\tprivate filteredSkills: ReadonlyArray<Skill>;\n\tprivate selectedIndex = 0;\n\tprivate listContainer: Container;\n\tprivate detailContainer: Container;\n\tprivate counterText: Text;\n\tprivate searchInput: Input;\n\tprivate onCancelCallback: () => void;\n\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.searchInput.focused = value;\n\t}\n\n\tconstructor(input: SkillsSelectorInput, onCancel: () => void) {\n\t\tsuper();\n\n\t\tthis.allSkills = input.skills;\n\t\tthis.filteredSkills = input.skills;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.addChild(new Text(theme.fg(\"accent\", theme.bold(\"Skills\")), 1, 0));\n\t\tthis.addChild(\n\t\t\tnew Text(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"muted\",\n\t\t\t\t\t` ${this.allSkills.length} loaded · slash commands ${input.enableSkillCommands ? \"enabled\" : \"disabled\"}`,\n\t\t\t\t),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tif (!input.enableSkillCommands) {\n\t\t\tthis.addChild(\n\t\t\t\tnew Text(theme.fg(\"warning\", \" Skill slash commands are disabled. Toggle via /settings.\"), 1, 0),\n\t\t\t);\n\t\t\tthis.addChild(new Spacer(1));\n\t\t}\n\n\t\tfor (const diag of input.diagnostics.slice(0, 5)) {\n\t\t\tconst tone = diag.type === \"warning\" || diag.type === \"collision\" ? \"warning\" : \"error\";\n\t\t\tthis.addChild(new Text(theme.fg(tone, ` ${diag.type}: ${diag.message}`), 1, 0));\n\t\t}\n\t\tif (input.diagnostics.length > 0) {\n\t\t\tthis.addChild(new Spacer(1));\n\t\t}\n\n\t\tthis.counterText = new Text(this.getCounterText(), 1, 0);\n\t\tthis.addChild(this.counterText);\n\n\t\tthis.searchInput = new Input();\n\t\tthis.searchInput.onSubmit = () => this.updateDetail();\n\t\tthis.addChild(this.searchInput);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.detailContainer = new Container();\n\t\tthis.addChild(this.detailContainer);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.addChild(new Text(`${rawKeyHint(\"↑↓\", \"navigate\")} ${keyHint(\"tui.select.cancel\", \"close\")}`, 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder());\n\n\t\tthis.updateList();\n\t\tthis.updateDetail();\n\t}\n\n\tprivate getCounterText(): string {\n\t\treturn theme.fg(\"muted\", ` matched ${this.filteredSkills.length} / total ${this.allSkills.length}`);\n\t}\n\n\tprivate applyFilter(query: string): void {\n\t\tthis.filteredSkills = query\n\t\t\t? fuzzyFilter(this.allSkills as Skill[], query, (s) => `${s.name} ${s.description}`)\n\t\t\t: this.allSkills;\n\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredSkills.length - 1));\n\t\tthis.counterText.setText(this.getCounterText());\n\t\tthis.updateList();\n\t\tthis.updateDetail();\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tif (this.filteredSkills.length === 0) {\n\t\t\tconst msg = this.allSkills.length === 0 ? \" No skills loaded.\" : \" No skills match the search.\";\n\t\t\tthis.listContainer.addChild(new Text(theme.fg(\"muted\", msg), 1, 0));\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < this.filteredSkills.length; i++) {\n\t\t\tconst skill = this.filteredSkills[i];\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst name = isSelected ? theme.fg(\"accent\", `→ ${skill.name}`) : ` ${skill.name}`;\n\t\t\tconst scopeTag = theme.fg(\"muted\", ` [${skill.sourceInfo.scope}]`);\n\t\t\tconst tail = skill.disableModelInvocation ? theme.fg(\"dim\", \" · model-invocation off\") : \"\";\n\t\t\tthis.listContainer.addChild(new Text(`${name}${scopeTag}${tail}`, 1, 0));\n\t\t}\n\t}\n\n\tprivate updateDetail(): void {\n\t\tthis.detailContainer.clear();\n\t\tconst skill = this.filteredSkills[this.selectedIndex];\n\t\tif (!skill) return;\n\t\tconst desc = (skill.description || \"\").trim();\n\t\tconst oneLine = desc.length > 200 ? `${desc.slice(0, 197)}...` : desc;\n\t\tthis.detailContainer.addChild(new Text(theme.fg(\"muted\", ` ${oneLine || \"(no description)\"}`), 1, 0));\n\t\tthis.detailContainer.addChild(new Text(theme.fg(\"muted\", ` path: ${skill.filePath}`), 1, 0));\n\t\tthis.detailContainer.addChild(\n\t\t\tnew Text(theme.fg(\"muted\", ` source: ${skill.sourceInfo.source} · scope: ${skill.sourceInfo.scope}`), 1, 0),\n\t\t);\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\tif (kb.matches(keyData, \"tui.select.up\")) {\n\t\t\tif (this.filteredSkills.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? this.filteredSkills.length - 1 : this.selectedIndex - 1;\n\t\t\tthis.updateList();\n\t\t\tthis.updateDetail();\n\t\t\treturn;\n\t\t}\n\t\tif (kb.matches(keyData, \"tui.select.down\")) {\n\t\t\tif (this.filteredSkills.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === this.filteredSkills.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t\tthis.updateList();\n\t\t\tthis.updateDetail();\n\t\t\treturn;\n\t\t}\n\t\tif (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t\treturn;\n\t\t}\n\t\tthis.searchInput.handleInput(keyData);\n\t\tthis.applyFilter(this.searchInput.getValue());\n\t}\n}\n"]}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skills inventory selector with fuzzy search input + counter.
|
|
3
|
-
* Read-only: never invokes or modifies a skill.
|
|
4
|
-
*/
|
|
5
|
-
import { Container, fuzzyFilter, getKeybindings, Input, Spacer, Text } from "@earendil-works/omk-tui";
|
|
6
|
-
import { theme } from "../theme/theme.js";
|
|
7
|
-
import { DynamicBorder } from "./dynamic-border.js";
|
|
8
|
-
import { keyHint, rawKeyHint } from "./keybinding-hints.js";
|
|
9
|
-
export class SkillsSelectorComponent extends Container {
|
|
10
|
-
allSkills;
|
|
11
|
-
filteredSkills;
|
|
12
|
-
selectedIndex = 0;
|
|
13
|
-
listContainer;
|
|
14
|
-
detailContainer;
|
|
15
|
-
counterText;
|
|
16
|
-
searchInput;
|
|
17
|
-
onCancelCallback;
|
|
18
|
-
_focused = false;
|
|
19
|
-
get focused() {
|
|
20
|
-
return this._focused;
|
|
21
|
-
}
|
|
22
|
-
set focused(value) {
|
|
23
|
-
this._focused = value;
|
|
24
|
-
this.searchInput.focused = value;
|
|
25
|
-
}
|
|
26
|
-
constructor(input, onCancel) {
|
|
27
|
-
super();
|
|
28
|
-
this.allSkills = input.skills;
|
|
29
|
-
this.filteredSkills = input.skills;
|
|
30
|
-
this.onCancelCallback = onCancel;
|
|
31
|
-
this.addChild(new DynamicBorder());
|
|
32
|
-
this.addChild(new Spacer(1));
|
|
33
|
-
this.addChild(new Text(theme.fg("accent", theme.bold("Skills")), 1, 0));
|
|
34
|
-
this.addChild(new Text(theme.fg("muted", ` ${this.allSkills.length} loaded · slash commands ${input.enableSkillCommands ? "enabled" : "disabled"}`), 1, 0));
|
|
35
|
-
this.addChild(new Spacer(1));
|
|
36
|
-
if (!input.enableSkillCommands) {
|
|
37
|
-
this.addChild(new Text(theme.fg("warning", " Skill slash commands are disabled. Toggle via /settings."), 1, 0));
|
|
38
|
-
this.addChild(new Spacer(1));
|
|
39
|
-
}
|
|
40
|
-
for (const diag of input.diagnostics.slice(0, 5)) {
|
|
41
|
-
const tone = diag.type === "warning" || diag.type === "collision" ? "warning" : "error";
|
|
42
|
-
this.addChild(new Text(theme.fg(tone, ` ${diag.type}: ${diag.message}`), 1, 0));
|
|
43
|
-
}
|
|
44
|
-
if (input.diagnostics.length > 0) {
|
|
45
|
-
this.addChild(new Spacer(1));
|
|
46
|
-
}
|
|
47
|
-
this.counterText = new Text(this.getCounterText(), 1, 0);
|
|
48
|
-
this.addChild(this.counterText);
|
|
49
|
-
this.searchInput = new Input();
|
|
50
|
-
this.searchInput.onSubmit = () => this.updateDetail();
|
|
51
|
-
this.addChild(this.searchInput);
|
|
52
|
-
this.addChild(new Spacer(1));
|
|
53
|
-
this.listContainer = new Container();
|
|
54
|
-
this.addChild(this.listContainer);
|
|
55
|
-
this.addChild(new Spacer(1));
|
|
56
|
-
this.detailContainer = new Container();
|
|
57
|
-
this.addChild(this.detailContainer);
|
|
58
|
-
this.addChild(new Spacer(1));
|
|
59
|
-
this.addChild(new Text(`${rawKeyHint("↑↓", "navigate")} ${keyHint("tui.select.cancel", "close")}`, 1, 0));
|
|
60
|
-
this.addChild(new Spacer(1));
|
|
61
|
-
this.addChild(new DynamicBorder());
|
|
62
|
-
this.updateList();
|
|
63
|
-
this.updateDetail();
|
|
64
|
-
}
|
|
65
|
-
getCounterText() {
|
|
66
|
-
return theme.fg("muted", ` matched ${this.filteredSkills.length} / total ${this.allSkills.length}`);
|
|
67
|
-
}
|
|
68
|
-
applyFilter(query) {
|
|
69
|
-
this.filteredSkills = query
|
|
70
|
-
? fuzzyFilter(this.allSkills, query, (s) => `${s.name} ${s.description}`)
|
|
71
|
-
: this.allSkills;
|
|
72
|
-
this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredSkills.length - 1));
|
|
73
|
-
this.counterText.setText(this.getCounterText());
|
|
74
|
-
this.updateList();
|
|
75
|
-
this.updateDetail();
|
|
76
|
-
}
|
|
77
|
-
updateList() {
|
|
78
|
-
this.listContainer.clear();
|
|
79
|
-
if (this.filteredSkills.length === 0) {
|
|
80
|
-
const msg = this.allSkills.length === 0 ? " No skills loaded." : " No skills match the search.";
|
|
81
|
-
this.listContainer.addChild(new Text(theme.fg("muted", msg), 1, 0));
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
for (let i = 0; i < this.filteredSkills.length; i++) {
|
|
85
|
-
const skill = this.filteredSkills[i];
|
|
86
|
-
const isSelected = i === this.selectedIndex;
|
|
87
|
-
const name = isSelected ? theme.fg("accent", `→ ${skill.name}`) : ` ${skill.name}`;
|
|
88
|
-
const scopeTag = theme.fg("muted", ` [${skill.sourceInfo.scope}]`);
|
|
89
|
-
const tail = skill.disableModelInvocation ? theme.fg("dim", " · model-invocation off") : "";
|
|
90
|
-
this.listContainer.addChild(new Text(`${name}${scopeTag}${tail}`, 1, 0));
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
updateDetail() {
|
|
94
|
-
this.detailContainer.clear();
|
|
95
|
-
const skill = this.filteredSkills[this.selectedIndex];
|
|
96
|
-
if (!skill)
|
|
97
|
-
return;
|
|
98
|
-
const desc = (skill.description || "").trim();
|
|
99
|
-
const oneLine = desc.length > 200 ? `${desc.slice(0, 197)}...` : desc;
|
|
100
|
-
this.detailContainer.addChild(new Text(theme.fg("muted", ` ${oneLine || "(no description)"}`), 1, 0));
|
|
101
|
-
this.detailContainer.addChild(new Text(theme.fg("muted", ` path: ${skill.filePath}`), 1, 0));
|
|
102
|
-
this.detailContainer.addChild(new Text(theme.fg("muted", ` source: ${skill.sourceInfo.source} · scope: ${skill.sourceInfo.scope}`), 1, 0));
|
|
103
|
-
}
|
|
104
|
-
handleInput(keyData) {
|
|
105
|
-
const kb = getKeybindings();
|
|
106
|
-
if (kb.matches(keyData, "tui.select.up")) {
|
|
107
|
-
if (this.filteredSkills.length === 0)
|
|
108
|
-
return;
|
|
109
|
-
this.selectedIndex = this.selectedIndex === 0 ? this.filteredSkills.length - 1 : this.selectedIndex - 1;
|
|
110
|
-
this.updateList();
|
|
111
|
-
this.updateDetail();
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
if (kb.matches(keyData, "tui.select.down")) {
|
|
115
|
-
if (this.filteredSkills.length === 0)
|
|
116
|
-
return;
|
|
117
|
-
this.selectedIndex = this.selectedIndex === this.filteredSkills.length - 1 ? 0 : this.selectedIndex + 1;
|
|
118
|
-
this.updateList();
|
|
119
|
-
this.updateDetail();
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (kb.matches(keyData, "tui.select.cancel")) {
|
|
123
|
-
this.onCancelCallback();
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
this.searchInput.handleInput(keyData);
|
|
127
|
-
this.applyFilter(this.searchInput.getValue());
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=skills-selector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/skills-selector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAkB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AAC,aAAa,GAAG,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;YACxG,IAAI,CAAC,UAAU,EAAE,CAAC;YAClB,IAAI,CAAC,YAAY,EAAE,CAAC;YACpB,OAAO;QACR,CAAC;QACD,IAAI,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAC9C,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,OAAO;QACR,CAAC;QACD,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IAAA,CAC9C;CACD","sourcesContent":["/**\n * Skills inventory selector with fuzzy search input + counter.\n * Read-only: never invokes or modifies a skill.\n */\n\nimport { Container, type Focusable, fuzzyFilter, getKeybindings, Input, Spacer, Text } from \"@earendil-works/omk-tui\";\nimport type { ResourceDiagnostic } from \"../../../core/resource-loader.ts\";\nimport type { Skill } from \"../../../core/skills.ts\";\nimport { theme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\nimport { keyHint, rawKeyHint } from \"./keybinding-hints.ts\";\n\nexport interface SkillsSelectorInput {\n\tskills: ReadonlyArray<Skill>;\n\tdiagnostics: ReadonlyArray<ResourceDiagnostic>;\n\tenableSkillCommands: boolean;\n}\n\nexport class SkillsSelectorComponent extends Container implements Focusable {\n\tprivate allSkills: ReadonlyArray<Skill>;\n\tprivate filteredSkills: ReadonlyArray<Skill>;\n\tprivate selectedIndex = 0;\n\tprivate listContainer: Container;\n\tprivate detailContainer: Container;\n\tprivate counterText: Text;\n\tprivate searchInput: Input;\n\tprivate onCancelCallback: () => void;\n\n\tprivate _focused = false;\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.searchInput.focused = value;\n\t}\n\n\tconstructor(input: SkillsSelectorInput, onCancel: () => void) {\n\t\tsuper();\n\n\t\tthis.allSkills = input.skills;\n\t\tthis.filteredSkills = input.skills;\n\t\tthis.onCancelCallback = onCancel;\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.addChild(new Text(theme.fg(\"accent\", theme.bold(\"Skills\")), 1, 0));\n\t\tthis.addChild(\n\t\t\tnew Text(\n\t\t\t\ttheme.fg(\n\t\t\t\t\t\"muted\",\n\t\t\t\t\t` ${this.allSkills.length} loaded · slash commands ${input.enableSkillCommands ? \"enabled\" : \"disabled\"}`,\n\t\t\t\t),\n\t\t\t\t1,\n\t\t\t\t0,\n\t\t\t),\n\t\t);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tif (!input.enableSkillCommands) {\n\t\t\tthis.addChild(\n\t\t\t\tnew Text(theme.fg(\"warning\", \" Skill slash commands are disabled. Toggle via /settings.\"), 1, 0),\n\t\t\t);\n\t\t\tthis.addChild(new Spacer(1));\n\t\t}\n\n\t\tfor (const diag of input.diagnostics.slice(0, 5)) {\n\t\t\tconst tone = diag.type === \"warning\" || diag.type === \"collision\" ? \"warning\" : \"error\";\n\t\t\tthis.addChild(new Text(theme.fg(tone, ` ${diag.type}: ${diag.message}`), 1, 0));\n\t\t}\n\t\tif (input.diagnostics.length > 0) {\n\t\t\tthis.addChild(new Spacer(1));\n\t\t}\n\n\t\tthis.counterText = new Text(this.getCounterText(), 1, 0);\n\t\tthis.addChild(this.counterText);\n\n\t\tthis.searchInput = new Input();\n\t\tthis.searchInput.onSubmit = () => this.updateDetail();\n\t\tthis.addChild(this.searchInput);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.detailContainer = new Container();\n\t\tthis.addChild(this.detailContainer);\n\t\tthis.addChild(new Spacer(1));\n\n\t\tthis.addChild(new Text(`${rawKeyHint(\"↑↓\", \"navigate\")} ${keyHint(\"tui.select.cancel\", \"close\")}`, 1, 0));\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.addChild(new DynamicBorder());\n\n\t\tthis.updateList();\n\t\tthis.updateDetail();\n\t}\n\n\tprivate getCounterText(): string {\n\t\treturn theme.fg(\"muted\", ` matched ${this.filteredSkills.length} / total ${this.allSkills.length}`);\n\t}\n\n\tprivate applyFilter(query: string): void {\n\t\tthis.filteredSkills = query\n\t\t\t? fuzzyFilter(this.allSkills as Skill[], query, (s) => `${s.name} ${s.description}`)\n\t\t\t: this.allSkills;\n\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredSkills.length - 1));\n\t\tthis.counterText.setText(this.getCounterText());\n\t\tthis.updateList();\n\t\tthis.updateDetail();\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tif (this.filteredSkills.length === 0) {\n\t\t\tconst msg = this.allSkills.length === 0 ? \" No skills loaded.\" : \" No skills match the search.\";\n\t\t\tthis.listContainer.addChild(new Text(theme.fg(\"muted\", msg), 1, 0));\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < this.filteredSkills.length; i++) {\n\t\t\tconst skill = this.filteredSkills[i];\n\t\t\tconst isSelected = i === this.selectedIndex;\n\t\t\tconst name = isSelected ? theme.fg(\"accent\", `→ ${skill.name}`) : ` ${skill.name}`;\n\t\t\tconst scopeTag = theme.fg(\"muted\", ` [${skill.sourceInfo.scope}]`);\n\t\t\tconst tail = skill.disableModelInvocation ? theme.fg(\"dim\", \" · model-invocation off\") : \"\";\n\t\t\tthis.listContainer.addChild(new Text(`${name}${scopeTag}${tail}`, 1, 0));\n\t\t}\n\t}\n\n\tprivate updateDetail(): void {\n\t\tthis.detailContainer.clear();\n\t\tconst skill = this.filteredSkills[this.selectedIndex];\n\t\tif (!skill) return;\n\t\tconst desc = (skill.description || \"\").trim();\n\t\tconst oneLine = desc.length > 200 ? `${desc.slice(0, 197)}...` : desc;\n\t\tthis.detailContainer.addChild(new Text(theme.fg(\"muted\", ` ${oneLine || \"(no description)\"}`), 1, 0));\n\t\tthis.detailContainer.addChild(new Text(theme.fg(\"muted\", ` path: ${skill.filePath}`), 1, 0));\n\t\tthis.detailContainer.addChild(\n\t\t\tnew Text(theme.fg(\"muted\", ` source: ${skill.sourceInfo.source} · scope: ${skill.sourceInfo.scope}`), 1, 0),\n\t\t);\n\t}\n\n\thandleInput(keyData: string): void {\n\t\tconst kb = getKeybindings();\n\t\tif (kb.matches(keyData, \"tui.select.up\")) {\n\t\t\tif (this.filteredSkills.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === 0 ? this.filteredSkills.length - 1 : this.selectedIndex - 1;\n\t\t\tthis.updateList();\n\t\t\tthis.updateDetail();\n\t\t\treturn;\n\t\t}\n\t\tif (kb.matches(keyData, \"tui.select.down\")) {\n\t\t\tif (this.filteredSkills.length === 0) return;\n\t\t\tthis.selectedIndex = this.selectedIndex === this.filteredSkills.length - 1 ? 0 : this.selectedIndex + 1;\n\t\t\tthis.updateList();\n\t\t\tthis.updateDetail();\n\t\t\treturn;\n\t\t}\n\t\tif (kb.matches(keyData, \"tui.select.cancel\")) {\n\t\t\tthis.onCancelCallback();\n\t\t\treturn;\n\t\t}\n\t\tthis.searchInput.handleInput(keyData);\n\t\tthis.applyFilter(this.searchInput.getValue());\n\t}\n}\n"]}
|