@wrongstack/cli 0.295.1 → 0.296.3
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/data/providers.json +0 -24
- package/dist/acp-A5OSIU2P.js +824 -0
- package/dist/acp-A5OSIU2P.js.map +7 -0
- package/dist/acp-server-agent.d.ts.map +1 -1
- package/dist/arg-parser.d.ts.map +1 -1
- package/dist/audit-2ZSFGNIF.js +102 -0
- package/dist/audit-2ZSFGNIF.js.map +7 -0
- package/dist/auth-CJWQJVRH.js +504 -0
- package/dist/auth-CJWQJVRH.js.map +7 -0
- package/dist/auth-menu/auth-menu-audit.d.ts +0 -4
- package/dist/auth-menu/auth-menu-audit.d.ts.map +1 -1
- package/dist/bench-7ZDWSNEF.js +278 -0
- package/dist/bench-7ZDWSNEF.js.map +7 -0
- package/dist/boot/brain-decision-log.d.ts +7 -5
- package/dist/boot/brain-decision-log.d.ts.map +1 -1
- package/dist/boot/dispatch-webui.d.ts +5 -8
- package/dist/boot/dispatch-webui.d.ts.map +1 -1
- package/dist/boot/system-prompt-builder.d.ts +3 -0
- package/dist/boot/system-prompt-builder.d.ts.map +1 -1
- package/dist/boot/tui-coordinator-callbacks.d.ts +45 -0
- package/dist/boot/tui-coordinator-callbacks.d.ts.map +1 -0
- package/dist/boot/tui-project-switch.d.ts +2 -3
- package/dist/boot/tui-project-switch.d.ts.map +1 -1
- package/dist/boot/tui-runtime-state.d.ts +5 -6
- package/dist/boot/tui-runtime-state.d.ts.map +1 -1
- package/dist/boot/tui-session-resume.d.ts.map +1 -1
- package/dist/boot/tui-settings-adapter.d.ts +2 -3
- package/dist/boot/tui-settings-adapter.d.ts.map +1 -1
- package/dist/boot.d.ts.map +1 -1
- package/dist/brain-menu/panel-service.d.ts.map +1 -1
- package/dist/chimera-review-task.d.ts +6 -0
- package/dist/chimera-review-task.d.ts.map +1 -0
- package/dist/chimera-reviewer-policy.d.ts +34 -0
- package/dist/chimera-reviewer-policy.d.ts.map +1 -0
- package/dist/chronicle-QQEQFSSE.js +256 -0
- package/dist/chronicle-QQEQFSSE.js.map +7 -0
- package/dist/chunk-5N34EWJR.js +418 -0
- package/dist/chunk-5N34EWJR.js.map +7 -0
- package/dist/chunk-66T43Q4Y.js +90 -0
- package/dist/chunk-66T43Q4Y.js.map +7 -0
- package/dist/chunk-7OCVIDC7.js +11 -0
- package/dist/chunk-7OCVIDC7.js.map +7 -0
- package/dist/chunk-ABXK4VVY.js +84 -0
- package/dist/chunk-ABXK4VVY.js.map +7 -0
- package/dist/chunk-AXVZMEWG.js +306 -0
- package/dist/chunk-AXVZMEWG.js.map +7 -0
- package/dist/chunk-AZESNNIC.js +216 -0
- package/dist/chunk-AZESNNIC.js.map +7 -0
- package/dist/chunk-BGFM3PD7.js +41 -0
- package/dist/chunk-BGFM3PD7.js.map +7 -0
- package/dist/chunk-BQCAJ7FI.js +425 -0
- package/dist/chunk-BQCAJ7FI.js.map +7 -0
- package/dist/chunk-DPJZQCVP.js +13 -0
- package/dist/chunk-DPJZQCVP.js.map +7 -0
- package/dist/chunk-F4PEGAJZ.js +176 -0
- package/dist/chunk-F4PEGAJZ.js.map +7 -0
- package/dist/chunk-IHBYBYGA.js +443 -0
- package/dist/chunk-IHBYBYGA.js.map +7 -0
- package/dist/chunk-JBSQ7ONN.js +1023 -0
- package/dist/chunk-JBSQ7ONN.js.map +7 -0
- package/dist/chunk-JBTFWWKV.js +1325 -0
- package/dist/chunk-JBTFWWKV.js.map +7 -0
- package/dist/chunk-JUHRI6OV.js +100 -0
- package/dist/chunk-JUHRI6OV.js.map +7 -0
- package/dist/chunk-OI7GWJDS.js +3303 -0
- package/dist/chunk-OI7GWJDS.js.map +7 -0
- package/dist/chunk-OP47B3IX.js +142 -0
- package/dist/chunk-OP47B3IX.js.map +7 -0
- package/dist/chunk-PJHET45A.js +158 -0
- package/dist/chunk-PJHET45A.js.map +7 -0
- package/dist/chunk-Q5GTM25S.js +17 -0
- package/dist/chunk-Q5GTM25S.js.map +7 -0
- package/dist/chunk-QD544J2B.js +19 -0
- package/dist/chunk-QD544J2B.js.map +7 -0
- package/dist/chunk-QUNHS6O3.js +258 -0
- package/dist/chunk-QUNHS6O3.js.map +7 -0
- package/dist/chunk-TADVX644.js +480 -0
- package/dist/chunk-TADVX644.js.map +7 -0
- package/dist/chunk-TGDHN4LM.js +81 -0
- package/dist/chunk-TGDHN4LM.js.map +7 -0
- package/dist/chunk-TYO2OVAD.js +50 -0
- package/dist/chunk-TYO2OVAD.js.map +7 -0
- package/dist/chunk-VCYZ3WZV.js +14 -0
- package/dist/chunk-VCYZ3WZV.js.map +7 -0
- package/dist/chunk-VJUEZZYB.js +29 -0
- package/dist/chunk-VJUEZZYB.js.map +7 -0
- package/dist/chunk-WHOIR577.js +1 -0
- package/dist/chunk-WHOIR577.js.map +7 -0
- package/dist/chunk-WY7KKOUK.js +460 -0
- package/dist/chunk-WY7KKOUK.js.map +7 -0
- package/dist/chunk-XJXDOF63.js +28 -0
- package/dist/chunk-XJXDOF63.js.map +7 -0
- package/dist/chunk-XWEGWYDU.js +560 -0
- package/dist/chunk-XWEGWYDU.js.map +7 -0
- package/dist/chunk-YWUPHRGB.js +346 -0
- package/dist/chunk-YWUPHRGB.js.map +7 -0
- package/dist/chunk-Z7YGASQP.js +313 -0
- package/dist/chunk-Z7YGASQP.js.map +7 -0
- package/dist/cli-entry-main.d.ts +2 -0
- package/dist/cli-entry-main.d.ts.map +1 -0
- package/dist/cli-entry-point.d.ts +3 -3
- package/dist/cli-entry-point.d.ts.map +1 -1
- package/dist/cli-main-RTY35OPD.js +29268 -0
- package/dist/cli-main-RTY35OPD.js.map +7 -0
- package/dist/cli-main-helpers.d.ts +21 -0
- package/dist/cli-main-helpers.d.ts.map +1 -0
- package/dist/cli-main.d.ts +25 -1
- package/dist/cli-main.d.ts.map +1 -1
- package/dist/context-limit.d.ts +48 -0
- package/dist/context-limit.d.ts.map +1 -1
- package/dist/diag-doctor-OQ3AA63O.js +170 -0
- package/dist/diag-doctor-OQ3AA63O.js.map +7 -0
- package/dist/execute-deps.d.ts +11 -12
- package/dist/execute-deps.d.ts.map +1 -1
- package/dist/execution-O7I5DYE6.js +4682 -0
- package/dist/execution-O7I5DYE6.js.map +7 -0
- package/dist/execution-chimera-ask.d.ts +10 -0
- package/dist/execution-chimera-ask.d.ts.map +1 -0
- package/dist/execution-chimera-cascade.d.ts +15 -0
- package/dist/execution-chimera-cascade.d.ts.map +1 -0
- package/dist/execution-cleanup.d.ts +23 -0
- package/dist/execution-cleanup.d.ts.map +1 -0
- package/dist/execution-kanban-dispatch.d.ts +10 -0
- package/dist/execution-kanban-dispatch.d.ts.map +1 -0
- package/dist/execution-repl-fleet-callbacks.d.ts +11 -0
- package/dist/execution-repl-fleet-callbacks.d.ts.map +1 -0
- package/dist/execution-storage-observability.d.ts +3 -0
- package/dist/execution-storage-observability.d.ts.map +1 -0
- package/dist/execution-tui-next-step-callbacks.d.ts +20 -0
- package/dist/execution-tui-next-step-callbacks.d.ts.map +1 -0
- package/dist/execution.d.ts +2 -139
- package/dist/execution.d.ts.map +1 -1
- package/dist/export-TPORYVRZ.js +64 -0
- package/dist/export-TPORYVRZ.js.map +7 -0
- package/dist/fleet/host-acp-runner-cache.d.ts +9 -0
- package/dist/fleet/host-acp-runner-cache.d.ts.map +1 -0
- package/dist/fleet/host-acp.d.ts +3 -0
- package/dist/fleet/host-acp.d.ts.map +1 -0
- package/dist/fleet/host-concurrency.d.ts +2 -0
- package/dist/fleet/host-concurrency.d.ts.map +1 -0
- package/dist/fleet/host-context.d.ts +5 -0
- package/dist/fleet/host-context.d.ts.map +1 -0
- package/dist/fleet/host-director-builder.d.ts +24 -0
- package/dist/fleet/host-director-builder.d.ts.map +1 -0
- package/dist/fleet/host-director-event-bridges.d.ts +37 -0
- package/dist/fleet/host-director-event-bridges.d.ts.map +1 -0
- package/dist/fleet/host-director-services.d.ts +20 -0
- package/dist/fleet/host-director-services.d.ts.map +1 -0
- package/dist/fleet/host-event-bridge.d.ts +17 -0
- package/dist/fleet/host-event-bridge.d.ts.map +1 -0
- package/dist/fleet/host-helpers.d.ts +22 -0
- package/dist/fleet/host-helpers.d.ts.map +1 -0
- package/dist/fleet/host-learning-tracker.d.ts +11 -0
- package/dist/fleet/host-learning-tracker.d.ts.map +1 -0
- package/dist/fleet/host-learning.d.ts +4 -0
- package/dist/fleet/host-learning.d.ts.map +1 -0
- package/dist/fleet/host-lifecycle-events.d.ts +4 -0
- package/dist/fleet/host-lifecycle-events.d.ts.map +1 -0
- package/dist/fleet/host-paths.d.ts +3 -0
- package/dist/fleet/host-paths.d.ts.map +1 -0
- package/dist/fleet/host-provider.d.ts +22 -0
- package/dist/fleet/host-provider.d.ts.map +1 -0
- package/dist/fleet/host-session-writer.d.ts +3 -0
- package/dist/fleet/host-session-writer.d.ts.map +1 -0
- package/dist/fleet/host-shadow-pass.d.ts +21 -0
- package/dist/fleet/host-shadow-pass.d.ts.map +1 -0
- package/dist/fleet/host-spawn-types.d.ts +25 -0
- package/dist/fleet/host-spawn-types.d.ts.map +1 -0
- package/dist/fleet/host-status.d.ts +48 -0
- package/dist/fleet/host-status.d.ts.map +1 -0
- package/dist/fleet/host-subagent-factory.d.ts +16 -0
- package/dist/fleet/host-subagent-factory.d.ts.map +1 -0
- package/dist/fleet/host-supervisor.d.ts +16 -0
- package/dist/fleet/host-supervisor.d.ts.map +1 -0
- package/dist/fleet/host-task-result-report.d.ts +11 -0
- package/dist/fleet/host-task-result-report.d.ts.map +1 -0
- package/dist/fleet/host-types.d.ts +89 -0
- package/dist/fleet/host-types.d.ts.map +1 -0
- package/dist/fleet/host.d.ts +10 -357
- package/dist/fleet/host.d.ts.map +1 -1
- package/dist/hq-JUYKUNJX.js +547 -0
- package/dist/hq-JUYKUNJX.js.map +7 -0
- package/dist/hq-command-controller.d.ts +2 -2
- package/dist/hq-command-controller.d.ts.map +1 -1
- package/dist/hq-server/auth.d.ts +15 -4
- package/dist/hq-server/auth.d.ts.map +1 -1
- package/dist/hq-server/project-root.d.ts +5 -0
- package/dist/hq-server/project-root.d.ts.map +1 -0
- package/dist/hq-server/routes/auth-handlers.d.ts +25 -0
- package/dist/hq-server/routes/auth-handlers.d.ts.map +1 -0
- package/dist/hq-server/routes/session-handlers.d.ts +8 -0
- package/dist/hq-server/routes/session-handlers.d.ts.map +1 -0
- package/dist/hq-server/routes.d.ts +8 -6
- package/dist/hq-server/routes.d.ts.map +1 -1
- package/dist/hq-server/snapshot.d.ts +44 -0
- package/dist/hq-server/snapshot.d.ts.map +1 -1
- package/dist/hq-server/types.d.ts +22 -4
- package/dist/hq-server/types.d.ts.map +1 -1
- package/dist/hq-server/utils.d.ts +8 -0
- package/dist/hq-server/utils.d.ts.map +1 -1
- package/dist/hq-server/ws.d.ts +1 -1
- package/dist/hq-server/ws.d.ts.map +1 -1
- package/dist/hq-server-6AQ3BXZA.js +39 -0
- package/dist/hq-server-6AQ3BXZA.js.map +7 -0
- package/dist/hq-server.d.ts +3 -3
- package/dist/hq-server.d.ts.map +1 -1
- package/dist/hq-ttl-U2FAYFAT.js +8 -0
- package/dist/hq-ttl-U2FAYFAT.js.map +7 -0
- package/dist/hq-tunnel-RFKGC4HI.js +114 -0
- package/dist/hq-tunnel-RFKGC4HI.js.map +7 -0
- package/dist/hq-tunnel.d.ts +1 -1
- package/dist/hq-tunnel.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2503 -53026
- package/dist/index.js.map +4 -4
- package/dist/init-E2NDDOHI.js +27 -0
- package/dist/init-E2NDDOHI.js.map +7 -0
- package/dist/kanban-dispatch-route.d.ts +14 -0
- package/dist/kanban-dispatch-route.d.ts.map +1 -0
- package/dist/kanban-hq-sync.d.ts +2 -0
- package/dist/kanban-hq-sync.d.ts.map +1 -1
- package/dist/kanban-run-mirror-EKVNGXWW.js +12 -0
- package/dist/kanban-run-mirror-EKVNGXWW.js.map +7 -0
- package/dist/live-settings-input.d.ts +69 -0
- package/dist/live-settings-input.d.ts.map +1 -0
- package/dist/mailbox-serve-2UWHEN3M.js +302 -0
- package/dist/mailbox-serve-2UWHEN3M.js.map +7 -0
- package/dist/mcp-CYLPUEHC.js +413 -0
- package/dist/mcp-CYLPUEHC.js.map +7 -0
- package/dist/modeldiag-HENYJ4N7.js +1290 -0
- package/dist/modeldiag-HENYJ4N7.js.map +7 -0
- package/dist/permissions-FNYLZIL4.js +115 -0
- package/dist/permissions-FNYLZIL4.js.map +7 -0
- package/dist/picker-key-state.d.ts +7 -0
- package/dist/picker-key-state.d.ts.map +1 -0
- package/dist/picker-model-picker.d.ts +6 -0
- package/dist/picker-model-picker.d.ts.map +1 -0
- package/dist/picker-ui.d.ts +17 -0
- package/dist/picker-ui.d.ts.map +1 -0
- package/dist/picker.d.ts +4 -37
- package/dist/picker.d.ts.map +1 -1
- package/dist/plugin-usage-OU6X6LM3.js +40 -0
- package/dist/plugin-usage-OU6X6LM3.js.map +7 -0
- package/dist/plugins-4LJ5IUBI.js +24 -0
- package/dist/plugins-4LJ5IUBI.js.map +7 -0
- package/dist/pre-launch.d.ts +0 -1
- package/dist/pre-launch.d.ts.map +1 -1
- package/dist/project-BLQ3ALVL.js +76 -0
- package/dist/project-BLQ3ALVL.js.map +7 -0
- package/dist/project-manifest-GE25PW4S.js +18 -0
- package/dist/project-manifest-GE25PW4S.js.map +7 -0
- package/dist/project-picker-BOCWHBXP.js +17 -0
- package/dist/project-picker-BOCWHBXP.js.map +7 -0
- package/dist/projects-XE76NFNZ.js +38 -0
- package/dist/projects-XE76NFNZ.js.map +7 -0
- package/dist/provider-helpers.d.ts +22 -6
- package/dist/provider-helpers.d.ts.map +1 -1
- package/dist/providers-models-GDELBHZK.js +589 -0
- package/dist/providers-models-GDELBHZK.js.map +7 -0
- package/dist/quick-VIO2BEHS.js +10 -0
- package/dist/quick-VIO2BEHS.js.map +7 -0
- package/dist/repl-auto-proceed.d.ts +19 -0
- package/dist/repl-auto-proceed.d.ts.map +1 -0
- package/dist/repl-client-registration.d.ts +7 -0
- package/dist/repl-client-registration.d.ts.map +1 -0
- package/dist/repl-input.d.ts +11 -0
- package/dist/repl-input.d.ts.map +1 -0
- package/dist/repl-options.d.ts +54 -0
- package/dist/repl-options.d.ts.map +1 -0
- package/dist/repl-rendering.d.ts +4 -0
- package/dist/repl-rendering.d.ts.map +1 -0
- package/dist/repl-suggestions.d.ts +21 -0
- package/dist/repl-suggestions.d.ts.map +1 -0
- package/dist/repl.d.ts +3 -162
- package/dist/repl.d.ts.map +1 -1
- package/dist/replay-KCTXNMZQ.js +75 -0
- package/dist/replay-KCTXNMZQ.js.map +7 -0
- package/dist/rewind-EJMVFVLS.js +185 -0
- package/dist/rewind-EJMVFVLS.js.map +7 -0
- package/dist/sdd-runtime-JG4EEKL6.js +54 -0
- package/dist/sdd-runtime-JG4EEKL6.js.map +7 -0
- package/dist/services/sdd/project-context.d.ts +1 -1
- package/dist/services/sdd/project-context.d.ts.map +1 -1
- package/dist/services/sdd/task-manager.d.ts.map +1 -1
- package/dist/services/statusline-config.d.ts +1 -1
- package/dist/services/statusline-config.d.ts.map +1 -1
- package/dist/session-event-wiring.d.ts +2 -2
- package/dist/session-event-wiring.d.ts.map +1 -1
- package/dist/sessions-config-NLCMK3BY.js +409 -0
- package/dist/sessions-config-NLCMK3BY.js.map +7 -0
- package/dist/settings-menu.d.ts +3 -18
- package/dist/settings-menu.d.ts.map +1 -1
- package/dist/simpleui-dist-JIFGUJO7.js +93 -0
- package/dist/simpleui-dist-JIFGUJO7.js.map +7 -0
- package/dist/slash-commands/brain.d.ts.map +1 -1
- package/dist/slash-commands/clear.d.ts.map +1 -1
- package/dist/slash-commands/fallback.d.ts.map +1 -1
- package/dist/slash-commands/kanban-agent-helpers.d.ts +18 -0
- package/dist/slash-commands/kanban-agent-helpers.d.ts.map +1 -0
- package/dist/slash-commands/kanban-format.d.ts +16 -0
- package/dist/slash-commands/kanban-format.d.ts.map +1 -0
- package/dist/slash-commands/kanban-help.d.ts +2 -0
- package/dist/slash-commands/kanban-help.d.ts.map +1 -0
- package/dist/slash-commands/kanban.d.ts.map +1 -1
- package/dist/slash-commands/mailbox-demo.d.ts.map +1 -1
- package/dist/slash-commands/mailbox.d.ts +2 -1
- package/dist/slash-commands/mailbox.d.ts.map +1 -1
- package/dist/slash-commands/memory-compact.d.ts +5 -0
- package/dist/slash-commands/memory-compact.d.ts.map +1 -0
- package/dist/slash-commands/memory-flags.d.ts +36 -0
- package/dist/slash-commands/memory-flags.d.ts.map +1 -0
- package/dist/slash-commands/memory-formatters.d.ts +16 -0
- package/dist/slash-commands/memory-formatters.d.ts.map +1 -0
- package/dist/slash-commands/memory.d.ts.map +1 -1
- package/dist/slash-commands/mouse.d.ts +2 -2
- package/dist/slash-commands/review.d.ts.map +1 -1
- package/dist/slash-commands/sdd-command-helpers.d.ts +23 -0
- package/dist/slash-commands/sdd-command-helpers.d.ts.map +1 -0
- package/dist/slash-commands/sdd-format.d.ts +32 -0
- package/dist/slash-commands/sdd-format.d.ts.map +1 -0
- package/dist/slash-commands/sdd.d.ts.map +1 -1
- package/dist/slash-commands/settings.d.ts.map +1 -1
- package/dist/subcommands/handlers/chronicle.d.ts.map +1 -1
- package/dist/subcommands/handlers/mailbox-serve.d.ts.map +1 -1
- package/dist/subcommands/handlers/model-smoke-test.d.ts +51 -0
- package/dist/subcommands/handlers/model-smoke-test.d.ts.map +1 -0
- package/dist/subcommands/handlers/modeldiag-profiles.d.ts +64 -0
- package/dist/subcommands/handlers/modeldiag-profiles.d.ts.map +1 -0
- package/dist/subcommands/handlers/modeldiag.d.ts.map +1 -1
- package/dist/subcommands/handlers/per-subcommand-deep-help-table.d.ts +3 -0
- package/dist/subcommands/handlers/per-subcommand-deep-help-table.d.ts.map +1 -0
- package/dist/subcommands/handlers/per-subcommand-help-data.d.ts +3 -0
- package/dist/subcommands/handlers/per-subcommand-help-data.d.ts.map +1 -0
- package/dist/subcommands/handlers/per-subcommand-help-table.d.ts +36 -0
- package/dist/subcommands/handlers/per-subcommand-help-table.d.ts.map +1 -0
- package/dist/subcommands/handlers/per-subcommand-help-types.d.ts +18 -0
- package/dist/subcommands/handlers/per-subcommand-help-types.d.ts.map +1 -0
- package/dist/subcommands/handlers/per-subcommand-help.d.ts +2 -80
- package/dist/subcommands/handlers/per-subcommand-help.d.ts.map +1 -1
- package/dist/subcommands/handlers/rewind.d.ts.map +1 -1
- package/dist/subcommands/index.d.ts +7 -0
- package/dist/subcommands/index.d.ts.map +1 -1
- package/dist/tools-skills-UNKLOB7M.js +29 -0
- package/dist/tools-skills-UNKLOB7M.js.map +7 -0
- package/dist/update-YC4TYW2Y.js +16 -0
- package/dist/update-YC4TYW2Y.js.map +7 -0
- package/dist/update-check-UMYTOH7Z.js +18 -0
- package/dist/update-check-UMYTOH7Z.js.map +7 -0
- package/dist/version-help-DROHZRW6.js +11 -0
- package/dist/version-help-DROHZRW6.js.map +7 -0
- package/dist/webui-server/connection-handler.d.ts.map +1 -1
- package/dist/webui-server/kanban-host-adapter.d.ts +5 -1
- package/dist/webui-server/kanban-host-adapter.d.ts.map +1 -1
- package/dist/webui-server/listen-helpers.d.ts +18 -0
- package/dist/webui-server/listen-helpers.d.ts.map +1 -0
- package/dist/webui-server/node-pty-loader.d.ts +6 -0
- package/dist/webui-server/node-pty-loader.d.ts.map +1 -0
- package/dist/webui-server-ZF5KVGC5.js +1460 -0
- package/dist/webui-server-ZF5KVGC5.js.map +7 -0
- package/dist/webui-server-options.d.ts +191 -0
- package/dist/webui-server-options.d.ts.map +1 -0
- package/dist/webui-server.d.ts +2 -178
- package/dist/webui-server.d.ts.map +1 -1
- package/dist/wiring/brain-and-orchestration.d.ts.map +1 -1
- package/dist/wiring/codebase-index.d.ts.map +1 -1
- package/dist/wiring/command-host-state.d.ts +4 -4
- package/dist/wiring/dep-watcher-bridge.d.ts +23 -0
- package/dist/wiring/dep-watcher-bridge.d.ts.map +1 -0
- package/dist/wiring/dep-watcher.d.ts.map +1 -1
- package/dist/wiring/hq-telemetry.d.ts +2 -2
- package/dist/wiring/lifecycle-plugins.d.ts +4 -3
- package/dist/wiring/lifecycle-plugins.d.ts.map +1 -1
- package/dist/wiring/mailbox-bridge-bootstrap.d.ts +1 -1
- package/dist/wiring/management-tools.d.ts +15 -0
- package/dist/wiring/management-tools.d.ts.map +1 -0
- package/dist/wiring/pipeline.d.ts +2 -1
- package/dist/wiring/pipeline.d.ts.map +1 -1
- package/dist/wiring/plugins.d.ts +1 -1
- package/dist/wiring/plugins.d.ts.map +1 -1
- package/dist/wiring/provider-runtime-setup.d.ts +14 -1
- package/dist/wiring/provider-runtime-setup.d.ts.map +1 -1
- package/dist/wiring/provider.d.ts.map +1 -1
- package/dist/wiring/runtime-controller-deps.d.ts +1 -1
- package/dist/wiring/runtime-controller-deps.d.ts.map +1 -1
- package/dist/wiring/sage.d.ts.map +1 -1
- package/dist/wiring/session-registry.d.ts +38 -0
- package/dist/wiring/session-registry.d.ts.map +1 -0
- package/dist/wiring/session.d.ts +10 -6
- package/dist/wiring/session.d.ts.map +1 -1
- package/dist/wiring/tools.d.ts.map +1 -1
- package/package.json +22 -22
- package/dist/cli-recovery-prompt.d.ts +0 -19
- package/dist/cli-recovery-prompt.d.ts.map +0 -1
- package/dist/first-run-auth-gate.d.ts +0 -20
- package/dist/first-run-auth-gate.d.ts.map +0 -1
- package/dist/pre-launch/indexing-question.d.ts +0 -28
- package/dist/pre-launch/indexing-question.d.ts.map +0 -1
|
@@ -0,0 +1,589 @@
|
|
|
1
|
+
import {
|
|
2
|
+
visibleModelIds
|
|
3
|
+
} from "./chunk-66T43Q4Y.js";
|
|
4
|
+
import {
|
|
5
|
+
mutateConfigProviders
|
|
6
|
+
} from "./chunk-PJHET45A.js";
|
|
7
|
+
import {
|
|
8
|
+
activeProfileConfigPath
|
|
9
|
+
} from "./chunk-DPJZQCVP.js";
|
|
10
|
+
import "./chunk-7OCVIDC7.js";
|
|
11
|
+
|
|
12
|
+
// src/subcommands/handlers/providers-models.ts
|
|
13
|
+
import * as fs from "node:fs/promises";
|
|
14
|
+
import { atomicWrite, color, expectDefined } from "@wrongstack/core/utils";
|
|
15
|
+
import { decryptConfigSecrets, encryptConfigSecrets } from "@wrongstack/core/security";
|
|
16
|
+
import { ConfigError } from "@wrongstack/core/types";
|
|
17
|
+
var providersCmd = async (args, deps) => {
|
|
18
|
+
const showAll = args.includes("--all");
|
|
19
|
+
const showUnsupported = args.includes("--unsupported");
|
|
20
|
+
try {
|
|
21
|
+
const all = await deps.modelsRegistry.listProviders();
|
|
22
|
+
const byFamily = {
|
|
23
|
+
anthropic: [],
|
|
24
|
+
"anthropic-oauth": [],
|
|
25
|
+
openai: [],
|
|
26
|
+
"openai-compatible": [],
|
|
27
|
+
"openai-codex": [],
|
|
28
|
+
"github-copilot": [],
|
|
29
|
+
google: [],
|
|
30
|
+
unsupported: []
|
|
31
|
+
};
|
|
32
|
+
for (const p of all) byFamily[p.family].push(p);
|
|
33
|
+
const families = showUnsupported ? ["unsupported"] : showAll ? ["anthropic", "openai", "google", "openai-compatible", "unsupported"] : ["anthropic", "openai", "google", "openai-compatible"];
|
|
34
|
+
for (const family of families) {
|
|
35
|
+
const list = byFamily[family];
|
|
36
|
+
if (list.length === 0) continue;
|
|
37
|
+
deps.renderer.write(`
|
|
38
|
+
${color.bold(family)} (${list.length}):
|
|
39
|
+
`);
|
|
40
|
+
for (const p of list) {
|
|
41
|
+
const envFound = p.envVars.some((v) => process.env[v]);
|
|
42
|
+
const marker = envFound ? color.green("\u25CF") : color.dim("\u25CB");
|
|
43
|
+
const envHint = p.envVars[0] ? color.dim(`[${p.envVars[0]}]`) : "";
|
|
44
|
+
const note = family === "unsupported" ? color.dim("(needs plugin)") : "";
|
|
45
|
+
deps.renderer.write(
|
|
46
|
+
` ${marker} ${p.id.padEnd(20)} ${p.name.padEnd(28)} ${envHint} ${note}
|
|
47
|
+
`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
deps.renderer.write(
|
|
52
|
+
`
|
|
53
|
+
${color.dim(`Current: ${deps.config.provider ?? "<unset>"} / ${deps.config.model ?? "<unset>"}. Use --all to include unsupported families.`)}
|
|
54
|
+
`
|
|
55
|
+
);
|
|
56
|
+
return 0;
|
|
57
|
+
} catch (err) {
|
|
58
|
+
deps.renderer.writeError(
|
|
59
|
+
`Failed to list providers: ${err instanceof Error ? err.message : err}`
|
|
60
|
+
);
|
|
61
|
+
return 1;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
function parseFlags(args) {
|
|
65
|
+
const flags = {};
|
|
66
|
+
for (let i = 0; i < args.length; i++) {
|
|
67
|
+
const a = expectDefined(args[i]);
|
|
68
|
+
if (a.startsWith("--")) {
|
|
69
|
+
const eq = a.indexOf("=");
|
|
70
|
+
if (eq !== -1) {
|
|
71
|
+
flags[a.slice(2, eq)] = a.slice(eq + 1);
|
|
72
|
+
} else {
|
|
73
|
+
const name = a.slice(2);
|
|
74
|
+
if (i + 1 < args.length && !args[i + 1]?.startsWith("--")) {
|
|
75
|
+
flags[name] = args[++i] ?? "";
|
|
76
|
+
} else {
|
|
77
|
+
flags[name] = true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return flags;
|
|
83
|
+
}
|
|
84
|
+
function positionals(args) {
|
|
85
|
+
const out = [];
|
|
86
|
+
for (let i = 0; i < args.length; i++) {
|
|
87
|
+
const a = expectDefined(args[i]);
|
|
88
|
+
if (a.startsWith("--")) {
|
|
89
|
+
const eq = a.indexOf("=");
|
|
90
|
+
if (eq === -1) {
|
|
91
|
+
if (i + 1 < args.length && !args[i + 1]?.startsWith("--")) {
|
|
92
|
+
i++;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
out.push(a);
|
|
98
|
+
}
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
var DEFAULT_PER_PAGE = 15;
|
|
102
|
+
function fmtPrice(usdPer1M) {
|
|
103
|
+
if (usdPer1M === void 0) return color.dim("?");
|
|
104
|
+
const value = usdPer1M >= 10 ? usdPer1M.toFixed(1) : usdPer1M.toFixed(2);
|
|
105
|
+
return "$" + value;
|
|
106
|
+
}
|
|
107
|
+
var modelsCmd = async (args, deps) => {
|
|
108
|
+
const sub = args[0];
|
|
109
|
+
if (sub === "hide") return modelsHide(args.slice(1), deps);
|
|
110
|
+
if (sub === "show") return modelsShow(args.slice(1), deps);
|
|
111
|
+
if (sub === "hidden") return modelsHidden(args.slice(1), deps);
|
|
112
|
+
if (sub === "reset") return modelsReset(args.slice(1), deps);
|
|
113
|
+
if (sub === "add") return modelsAdd(args.slice(1), deps);
|
|
114
|
+
if (sub === "remove") return modelsRemove(args.slice(1), deps);
|
|
115
|
+
if (sub === "list") return modelsList(args.slice(1), deps);
|
|
116
|
+
if (sub === "caps" || sub === "capabilities") return modelsCaps(args.slice(1), deps);
|
|
117
|
+
if (sub === "refresh") {
|
|
118
|
+
deps.renderer.writeInfo("Refreshing models.dev cache\u2026");
|
|
119
|
+
try {
|
|
120
|
+
const payload = await deps.modelsRegistry.refresh();
|
|
121
|
+
deps.renderer.writeInfo(
|
|
122
|
+
`Cached ${Object.keys(payload).length} providers to ${deps.paths.modelsCache}`
|
|
123
|
+
);
|
|
124
|
+
return 0;
|
|
125
|
+
} catch (err) {
|
|
126
|
+
deps.renderer.writeError(`Refresh failed: ${err instanceof Error ? err.message : err}`);
|
|
127
|
+
return 1;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
const flags = parseFlags(args);
|
|
131
|
+
const search = typeof flags["search"] === "string" ? flags["search"].toLowerCase() : "";
|
|
132
|
+
const perPage = Number(flags["per-page"]) > 0 ? Number(flags["per-page"]) : DEFAULT_PER_PAGE;
|
|
133
|
+
const page = Math.max(1, Number(flags["page"]) || 1);
|
|
134
|
+
const providerId = sub ?? deps.config.provider ?? "";
|
|
135
|
+
if (!providerId) {
|
|
136
|
+
deps.renderer.writeError(
|
|
137
|
+
"Usage: wstack models <provider> [--search <term>] [--page N] [--per-page N]"
|
|
138
|
+
);
|
|
139
|
+
return 1;
|
|
140
|
+
}
|
|
141
|
+
let lookupId = providerId;
|
|
142
|
+
const savedAlias = deps.config.providers?.[providerId];
|
|
143
|
+
if (savedAlias?.type && savedAlias.type !== providerId) lookupId = savedAlias.type;
|
|
144
|
+
const provider = await deps.modelsRegistry.getProvider(lookupId);
|
|
145
|
+
if (!provider) {
|
|
146
|
+
deps.renderer.writeError(
|
|
147
|
+
lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
|
|
148
|
+
);
|
|
149
|
+
return 1;
|
|
150
|
+
}
|
|
151
|
+
if (lookupId !== providerId)
|
|
152
|
+
deps.renderer.write(
|
|
153
|
+
color.dim(`(showing catalog models for "${lookupId}" via alias "${providerId}")
|
|
154
|
+
`)
|
|
155
|
+
);
|
|
156
|
+
deps.renderer.write(`${color.bold(provider.name)} ${color.dim(`(${provider.id})`)}
|
|
157
|
+
`);
|
|
158
|
+
if (provider.doc) deps.renderer.write(color.dim(`Docs: ${provider.doc}
|
|
159
|
+
`));
|
|
160
|
+
const savedProvider = deps.config.providers?.[providerId];
|
|
161
|
+
const userModels = savedProvider?.models;
|
|
162
|
+
const catalogById = new Map(provider.models.map((m) => [m.id, m]));
|
|
163
|
+
const allKnownSorted = [...provider.models].sort(
|
|
164
|
+
(a, b) => (b.release_date ?? "").localeCompare(a.release_date ?? "")
|
|
165
|
+
);
|
|
166
|
+
const visibleIds = visibleModelIds(
|
|
167
|
+
providerId,
|
|
168
|
+
deps.config,
|
|
169
|
+
allKnownSorted.map((m) => m.id),
|
|
170
|
+
savedProvider
|
|
171
|
+
);
|
|
172
|
+
const allSorted = visibleIds.map((id) => catalogById.get(id) ?? { id, name: id });
|
|
173
|
+
if (userModels !== void 0) {
|
|
174
|
+
const hiddenCount = Math.max(0, allKnownSorted.length - visibleIds.length);
|
|
175
|
+
const restoredCount = Math.max(0, visibleIds.length - userModels.length);
|
|
176
|
+
deps.renderer.write(
|
|
177
|
+
color.dim(
|
|
178
|
+
`(${visibleIds.length} visible model(s)${restoredCount > 0 ? `, ${restoredCount} from providers.json/catalog fallback` : " from your saved config"}${hiddenCount > 0 ? `, ${hiddenCount} hidden` : ""})
|
|
179
|
+
`
|
|
180
|
+
)
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
const filtered = search ? allSorted.filter((m) => m.id.toLowerCase().includes(search)) : allSorted;
|
|
184
|
+
const total = filtered.length;
|
|
185
|
+
const totalPages = Math.max(1, Math.ceil(total / perPage));
|
|
186
|
+
const actualPage = Math.min(page, totalPages);
|
|
187
|
+
const start = (actualPage - 1) * perPage;
|
|
188
|
+
const pageItems = filtered.slice(start, start + perPage);
|
|
189
|
+
const end = Math.min(start + pageItems.length, total);
|
|
190
|
+
const pageHint = totalPages > 1 ? color.cyan(`[page ${actualPage}/${totalPages}]`) : "";
|
|
191
|
+
const searchHint = search ? color.yellow(` (filtered: "${search}" \u2014 ${total} match${total === 1 ? "" : "es"})`) : color.dim(` (${total} model${total === 1 ? "" : "s"})`);
|
|
192
|
+
deps.renderer.write(`${pageHint}${searchHint}
|
|
193
|
+
`);
|
|
194
|
+
if (pageItems.length === 0) {
|
|
195
|
+
deps.renderer.write(color.dim("(no models match)\n"));
|
|
196
|
+
} else {
|
|
197
|
+
if (start > 0)
|
|
198
|
+
deps.renderer.write(color.dim(` ${String.fromCharCode(8593)} ${start} above
|
|
199
|
+
`));
|
|
200
|
+
for (const m of pageItems) {
|
|
201
|
+
const caps = [];
|
|
202
|
+
if ("tool_call" in m && m.tool_call) caps.push("tools");
|
|
203
|
+
if ("reasoning" in m && m.reasoning) caps.push("reasoning");
|
|
204
|
+
if ("modalities" in m && m.modalities?.input?.includes("image")) caps.push("vision");
|
|
205
|
+
const ctx = "limit" in m && m.limit?.context ? `${(m.limit.context / 1e3).toFixed(0)}k` : "?";
|
|
206
|
+
const cost = "cost" in m && m.cost?.input !== void 0 ? `${m.cost.input}/${m.cost.output ?? "?"}` : "";
|
|
207
|
+
deps.renderer.write(
|
|
208
|
+
` ${m.id.padEnd(40)} ${color.dim(ctx.padStart(6))} ${color.dim(cost.padEnd(14))} ${color.dim(caps.join(","))}
|
|
209
|
+
`
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
if (end < total)
|
|
213
|
+
deps.renderer.write(color.dim(` ${String.fromCharCode(8595)} ${total - end} below
|
|
214
|
+
`));
|
|
215
|
+
}
|
|
216
|
+
const navLines = [];
|
|
217
|
+
if (totalPages > 1) {
|
|
218
|
+
if (actualPage > 1) navLines.push(`--page ${actualPage - 1} (prev)`);
|
|
219
|
+
if (actualPage < totalPages) navLines.push(`--page ${actualPage + 1} (next)`);
|
|
220
|
+
}
|
|
221
|
+
navLines.push("--search <term> (filter)");
|
|
222
|
+
deps.renderer.write(color.dim(`
|
|
223
|
+
${navLines.join(" \xB7 ")}
|
|
224
|
+
`));
|
|
225
|
+
const age = await deps.modelsRegistry.ageSeconds();
|
|
226
|
+
deps.renderer.write(
|
|
227
|
+
color.dim(
|
|
228
|
+
`Cache age: ${isFinite(age) ? `${Math.round(age / 60)}m` : "never fetched"}. Run \`wstack models refresh\` to update.
|
|
229
|
+
`
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
return 0;
|
|
233
|
+
};
|
|
234
|
+
function aliasProviderId(configProviderId, cfg) {
|
|
235
|
+
return cfg?.type && cfg.type !== configProviderId ? cfg.type : configProviderId;
|
|
236
|
+
}
|
|
237
|
+
async function getCatalogProviderForConfigProvider(providerId, deps) {
|
|
238
|
+
const cfg = deps.config.providers?.[providerId];
|
|
239
|
+
const lookupId = aliasProviderId(providerId, cfg);
|
|
240
|
+
const provider = await deps.modelsRegistry.getProvider(lookupId);
|
|
241
|
+
return { providerId: lookupId, provider };
|
|
242
|
+
}
|
|
243
|
+
function uniqueStrings(values) {
|
|
244
|
+
return [...new Set(values.map((v) => v.trim()).filter(Boolean))];
|
|
245
|
+
}
|
|
246
|
+
async function modelsHide(args, deps) {
|
|
247
|
+
const providerId = args[0];
|
|
248
|
+
const modelId = args[1];
|
|
249
|
+
if (!providerId || !modelId) {
|
|
250
|
+
deps.renderer.writeError("Usage: wstack models hide <provider> <model>");
|
|
251
|
+
return 1;
|
|
252
|
+
}
|
|
253
|
+
const saved = deps.config.providers?.[providerId];
|
|
254
|
+
if (!saved) {
|
|
255
|
+
deps.renderer.writeError(`Provider "${providerId}" is not configured.`);
|
|
256
|
+
return 1;
|
|
257
|
+
}
|
|
258
|
+
const { providerId: lookupId, provider } = await getCatalogProviderForConfigProvider(providerId, deps);
|
|
259
|
+
if (!provider) {
|
|
260
|
+
deps.renderer.writeError(
|
|
261
|
+
lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
|
|
262
|
+
);
|
|
263
|
+
return 1;
|
|
264
|
+
}
|
|
265
|
+
const knownIds = provider.models.map((m) => m.id);
|
|
266
|
+
const visible = saved.models !== void 0 ? [...saved.models] : [...knownIds];
|
|
267
|
+
if (!visible.includes(modelId)) {
|
|
268
|
+
deps.renderer.writeInfo(`${providerId}/${modelId} is already hidden.`);
|
|
269
|
+
return 0;
|
|
270
|
+
}
|
|
271
|
+
const nextVisible = visible.filter((id) => id !== modelId);
|
|
272
|
+
await mutateConfigProviders(activeProfileConfigPath(deps.paths, deps.config), deps.vault, (providers) => {
|
|
273
|
+
const p = providers[providerId];
|
|
274
|
+
if (!p) return;
|
|
275
|
+
p.models = nextVisible;
|
|
276
|
+
});
|
|
277
|
+
deps.config.providers = {
|
|
278
|
+
...deps.config.providers ?? {},
|
|
279
|
+
[providerId]: { ...saved, models: nextVisible }
|
|
280
|
+
};
|
|
281
|
+
deps.renderer.writeInfo(
|
|
282
|
+
`Hidden ${providerId}/${modelId}. Visible: ${nextVisible.length}, hidden: ${Math.max(0, knownIds.length - nextVisible.length)}.`
|
|
283
|
+
);
|
|
284
|
+
if (nextVisible.length === 0) {
|
|
285
|
+
deps.renderer.write(color.dim("This provider now has no visible models. Use `wstack models show` or `wstack models reset` to restore.\n"));
|
|
286
|
+
}
|
|
287
|
+
return 0;
|
|
288
|
+
}
|
|
289
|
+
async function modelsShow(args, deps) {
|
|
290
|
+
const providerId = args[0];
|
|
291
|
+
const modelId = args[1];
|
|
292
|
+
if (!providerId || !modelId) {
|
|
293
|
+
deps.renderer.writeError("Usage: wstack models show <provider> <model>");
|
|
294
|
+
return 1;
|
|
295
|
+
}
|
|
296
|
+
const saved = deps.config.providers?.[providerId];
|
|
297
|
+
if (!saved) {
|
|
298
|
+
deps.renderer.writeError(`Provider "${providerId}" is not configured.`);
|
|
299
|
+
return 1;
|
|
300
|
+
}
|
|
301
|
+
const { providerId: lookupId, provider } = await getCatalogProviderForConfigProvider(providerId, deps);
|
|
302
|
+
if (!provider) {
|
|
303
|
+
deps.renderer.writeError(
|
|
304
|
+
lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
|
|
305
|
+
);
|
|
306
|
+
return 1;
|
|
307
|
+
}
|
|
308
|
+
const knownIds = provider.models.map((m) => m.id);
|
|
309
|
+
if (saved.models === void 0) {
|
|
310
|
+
deps.renderer.writeInfo(`${providerId}/${modelId} is already visible.`);
|
|
311
|
+
return 0;
|
|
312
|
+
}
|
|
313
|
+
const nextVisible = uniqueStrings([...saved.models, modelId]);
|
|
314
|
+
await mutateConfigProviders(activeProfileConfigPath(deps.paths, deps.config), deps.vault, (providers) => {
|
|
315
|
+
const p = providers[providerId];
|
|
316
|
+
if (!p) return;
|
|
317
|
+
p.models = nextVisible;
|
|
318
|
+
});
|
|
319
|
+
deps.config.providers = {
|
|
320
|
+
...deps.config.providers ?? {},
|
|
321
|
+
[providerId]: { ...saved, models: nextVisible }
|
|
322
|
+
};
|
|
323
|
+
const isKnown = knownIds.includes(modelId);
|
|
324
|
+
deps.renderer.writeInfo(
|
|
325
|
+
`Visible ${providerId}/${modelId}${isKnown ? "" : " (not in current catalog)"}. Visible: ${nextVisible.length}.`
|
|
326
|
+
);
|
|
327
|
+
return 0;
|
|
328
|
+
}
|
|
329
|
+
async function modelsHidden(args, deps) {
|
|
330
|
+
const providerId = args[0] ?? deps.config.provider;
|
|
331
|
+
if (!providerId) {
|
|
332
|
+
deps.renderer.writeError("Usage: wstack models hidden <provider>");
|
|
333
|
+
return 1;
|
|
334
|
+
}
|
|
335
|
+
const saved = deps.config.providers?.[providerId];
|
|
336
|
+
if (!saved) {
|
|
337
|
+
deps.renderer.writeError(`Provider "${providerId}" is not configured.`);
|
|
338
|
+
return 1;
|
|
339
|
+
}
|
|
340
|
+
const { providerId: lookupId, provider } = await getCatalogProviderForConfigProvider(providerId, deps);
|
|
341
|
+
if (!provider) {
|
|
342
|
+
deps.renderer.writeError(
|
|
343
|
+
lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
|
|
344
|
+
);
|
|
345
|
+
return 1;
|
|
346
|
+
}
|
|
347
|
+
const knownIds = provider.models.map((m) => m.id);
|
|
348
|
+
const visible = saved.models;
|
|
349
|
+
const hidden = visible === void 0 ? [] : knownIds.filter((id) => !visible.includes(id));
|
|
350
|
+
deps.renderer.write(`${color.bold("Hidden models")} ${color.dim(`(${providerId})`)}
|
|
351
|
+
`);
|
|
352
|
+
if (hidden.length === 0) {
|
|
353
|
+
deps.renderer.write(color.dim("(none hidden)\n"));
|
|
354
|
+
return 0;
|
|
355
|
+
}
|
|
356
|
+
for (const id of hidden) deps.renderer.write(` ${id}
|
|
357
|
+
`);
|
|
358
|
+
deps.renderer.write(color.dim(`
|
|
359
|
+
Restore: wstack models show ${providerId} <model> \xB7 reset ${providerId}
|
|
360
|
+
`));
|
|
361
|
+
return 0;
|
|
362
|
+
}
|
|
363
|
+
async function modelsReset(args, deps) {
|
|
364
|
+
const providerId = args[0];
|
|
365
|
+
if (!providerId) {
|
|
366
|
+
deps.renderer.writeError("Usage: wstack models reset <provider>");
|
|
367
|
+
return 1;
|
|
368
|
+
}
|
|
369
|
+
const saved = deps.config.providers?.[providerId];
|
|
370
|
+
if (!saved) {
|
|
371
|
+
deps.renderer.writeError(`Provider "${providerId}" is not configured.`);
|
|
372
|
+
return 1;
|
|
373
|
+
}
|
|
374
|
+
if (saved.models === void 0) {
|
|
375
|
+
deps.renderer.writeInfo(`${providerId} already shows the full catalog model list.`);
|
|
376
|
+
return 0;
|
|
377
|
+
}
|
|
378
|
+
await mutateConfigProviders(activeProfileConfigPath(deps.paths, deps.config), deps.vault, (providers) => {
|
|
379
|
+
const p = providers[providerId];
|
|
380
|
+
if (!p) return;
|
|
381
|
+
delete p.models;
|
|
382
|
+
});
|
|
383
|
+
const nextProvider = { ...saved };
|
|
384
|
+
delete nextProvider.models;
|
|
385
|
+
deps.config.providers = {
|
|
386
|
+
...deps.config.providers ?? {},
|
|
387
|
+
[providerId]: nextProvider
|
|
388
|
+
};
|
|
389
|
+
deps.renderer.writeInfo(`Reset visible model list for ${providerId} to the full catalog default.`);
|
|
390
|
+
return 0;
|
|
391
|
+
}
|
|
392
|
+
async function modelsCaps(args, deps) {
|
|
393
|
+
const providerId = args[0] ?? deps.config.provider;
|
|
394
|
+
const modelId = args[1] ?? deps.config.model;
|
|
395
|
+
if (!providerId || !modelId) {
|
|
396
|
+
deps.renderer.writeError("Usage: wstack models caps [provider] [model]");
|
|
397
|
+
deps.renderer.write(color.dim("Defaults to current configured provider/model when omitted.\n"));
|
|
398
|
+
return 1;
|
|
399
|
+
}
|
|
400
|
+
const resolved = await deps.modelsRegistry.getModel(providerId, modelId);
|
|
401
|
+
if (!resolved) {
|
|
402
|
+
deps.renderer.writeError("Model not found in catalog: " + providerId + "/" + modelId);
|
|
403
|
+
deps.renderer.write(color.dim("Run `wstack models refresh` or add a custom model if this is expected.\n"));
|
|
404
|
+
return 1;
|
|
405
|
+
}
|
|
406
|
+
const caps = resolved.capabilities;
|
|
407
|
+
const flags = [
|
|
408
|
+
caps.tools ? "tools" : void 0,
|
|
409
|
+
caps.vision ? "vision" : void 0,
|
|
410
|
+
caps.reasoning ? "reasoning" : void 0
|
|
411
|
+
].filter((v) => v !== void 0);
|
|
412
|
+
const rc = caps.reasoningConfig;
|
|
413
|
+
const cost = resolved.cost;
|
|
414
|
+
deps.renderer.write(color.bold("Model capabilities") + " " + color.dim(providerId + "/" + modelId) + "\n");
|
|
415
|
+
deps.renderer.write(" context: " + (caps.maxContext ? color.yellow(String(caps.maxContext)) : color.dim("?")) + "\n");
|
|
416
|
+
if (caps.maxOutput !== void 0) {
|
|
417
|
+
deps.renderer.write(" max output: " + color.yellow(String(caps.maxOutput)) + "\n");
|
|
418
|
+
}
|
|
419
|
+
if (caps.knowledge) deps.renderer.write(" knowledge: " + caps.knowledge + "\n");
|
|
420
|
+
deps.renderer.write(" flags: " + (flags.length > 0 ? flags.join(", ") : color.dim("(none)")) + "\n");
|
|
421
|
+
deps.renderer.write(" pricing/1M: input " + fmtPrice(cost?.input) + " output " + fmtPrice(cost?.output) + " cacheR " + fmtPrice(cost?.cache_read) + "\n");
|
|
422
|
+
if (cost?.cache_write !== void 0 || cost?.cache_write_5m !== void 0 || cost?.cache_write_1h !== void 0) {
|
|
423
|
+
const cacheWrite1h = cost.cache_write_1h ?? (cost.input !== void 0 ? cost.input * 2 : void 0);
|
|
424
|
+
deps.renderer.write(" cache write: default " + fmtPrice(cost.cache_write) + " 5m " + fmtPrice(cost.cache_write_5m ?? cost.cache_write) + " 1h " + fmtPrice(cacheWrite1h) + "\n");
|
|
425
|
+
}
|
|
426
|
+
if (rc) {
|
|
427
|
+
deps.renderer.write(" reasoning:\n");
|
|
428
|
+
deps.renderer.write(" default: " + rc.default + "\n");
|
|
429
|
+
deps.renderer.write(" disable: " + (rc.disableSupported ? "supported" : "unsupported") + "\n");
|
|
430
|
+
deps.renderer.write(" effort: " + (rc.effortSupported ? rc.effortLevels.join(", ") : "unsupported") + "\n");
|
|
431
|
+
deps.renderer.write(" preserve: " + rc.preserveThinking + "\n");
|
|
432
|
+
} else if (caps.reasoning) {
|
|
433
|
+
deps.renderer.write(color.dim(" reasoning: supported, but no detailed config in catalog\n"));
|
|
434
|
+
}
|
|
435
|
+
return 0;
|
|
436
|
+
}
|
|
437
|
+
async function mutateModelsConfig(deps, mutator) {
|
|
438
|
+
const vault = deps.vault;
|
|
439
|
+
const configPath = activeProfileConfigPath(deps.paths, deps.config);
|
|
440
|
+
let fileExists = true;
|
|
441
|
+
let raw;
|
|
442
|
+
try {
|
|
443
|
+
raw = await fs.readFile(configPath, "utf8");
|
|
444
|
+
} catch (err) {
|
|
445
|
+
if (err.code !== "ENOENT") throw err;
|
|
446
|
+
fileExists = false;
|
|
447
|
+
raw = "{}";
|
|
448
|
+
}
|
|
449
|
+
let parsed;
|
|
450
|
+
try {
|
|
451
|
+
parsed = JSON.parse(raw);
|
|
452
|
+
} catch (err) {
|
|
453
|
+
if (fileExists) {
|
|
454
|
+
throw new ConfigError({
|
|
455
|
+
message: `Refusing to overwrite corrupt config at ${configPath} (${err.message}).`,
|
|
456
|
+
code: "CONFIG_PARSE_FAILED",
|
|
457
|
+
context: { filePath: configPath, operation: "mutateModelsConfig" }
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
parsed = {};
|
|
461
|
+
}
|
|
462
|
+
const decrypted = decryptConfigSecrets(parsed, vault);
|
|
463
|
+
const models = decrypted.models ?? {};
|
|
464
|
+
mutator(models);
|
|
465
|
+
decrypted.models = models;
|
|
466
|
+
const encrypted = encryptConfigSecrets(decrypted, vault);
|
|
467
|
+
await atomicWrite(configPath, JSON.stringify(encrypted, null, 2), { mode: 384 });
|
|
468
|
+
}
|
|
469
|
+
function parseSizeFlag(raw) {
|
|
470
|
+
if (!raw) return void 0;
|
|
471
|
+
const s = raw.trim().toLowerCase();
|
|
472
|
+
const match = /^(\d+(?:\.\d+)?)\s*(k|m|b)?$/.exec(s);
|
|
473
|
+
if (!match) return void 0;
|
|
474
|
+
const num = Number.parseFloat(expectDefined(match[1]));
|
|
475
|
+
const unit = match[2];
|
|
476
|
+
if (unit === "b") return Math.round(num * 1e9);
|
|
477
|
+
if (unit === "m") return Math.round(num * 1e6);
|
|
478
|
+
if (unit === "k") return Math.round(num * 1e3);
|
|
479
|
+
return Math.round(num);
|
|
480
|
+
}
|
|
481
|
+
function parseBoolFlag(flags, key) {
|
|
482
|
+
if (flags[key] === true || flags[key] === "true") return true;
|
|
483
|
+
if (flags[`no-${key}`] !== void 0) return false;
|
|
484
|
+
return void 0;
|
|
485
|
+
}
|
|
486
|
+
async function modelsAdd(args, deps) {
|
|
487
|
+
const flags = parseFlags(args);
|
|
488
|
+
const pos = positionals(args);
|
|
489
|
+
const modelId = pos[0];
|
|
490
|
+
if (!modelId) {
|
|
491
|
+
deps.renderer.writeError(
|
|
492
|
+
"Usage: wstack models add <modelId> [--provider <id>] [--name <name>] [--max-context <N>] [--max-output <N>] [--tools] [--no-tools] [--vision] [--no-vision] [--reasoning] [--streaming] [--no-streaming] [--json-mode]"
|
|
493
|
+
);
|
|
494
|
+
return 1;
|
|
495
|
+
}
|
|
496
|
+
const existing = deps.config.models?.[modelId];
|
|
497
|
+
if (existing) {
|
|
498
|
+
deps.renderer.writeWarning(`Model "${modelId}" already defined. Overwriting.`);
|
|
499
|
+
}
|
|
500
|
+
const capabilities = {};
|
|
501
|
+
const toolsVal = parseBoolFlag(flags, "tools");
|
|
502
|
+
if (toolsVal !== void 0) capabilities.tools = toolsVal;
|
|
503
|
+
const visionVal = parseBoolFlag(flags, "vision");
|
|
504
|
+
if (visionVal !== void 0) capabilities.vision = visionVal;
|
|
505
|
+
const streamingVal = parseBoolFlag(flags, "streaming");
|
|
506
|
+
if (streamingVal !== void 0) capabilities.streaming = streamingVal;
|
|
507
|
+
const reasoningVal = parseBoolFlag(flags, "reasoning");
|
|
508
|
+
if (reasoningVal !== void 0) capabilities.reasoning = reasoningVal;
|
|
509
|
+
const jsonModeVal = parseBoolFlag(flags, "json-mode");
|
|
510
|
+
if (jsonModeVal !== void 0) capabilities.jsonMode = jsonModeVal;
|
|
511
|
+
const maxContextRaw = typeof flags["max-context"] === "string" ? flags["max-context"] : void 0;
|
|
512
|
+
const maxContext = parseSizeFlag(maxContextRaw);
|
|
513
|
+
if (maxContext !== void 0) capabilities.maxContext = maxContext;
|
|
514
|
+
const def = {};
|
|
515
|
+
const nameFlag = typeof flags["name"] === "string" ? flags["name"] : void 0;
|
|
516
|
+
const providerFlag = typeof flags["provider"] === "string" ? flags["provider"] : void 0;
|
|
517
|
+
if (nameFlag) def.name = nameFlag;
|
|
518
|
+
if (providerFlag) def.provider = providerFlag;
|
|
519
|
+
if (Object.keys(capabilities).length > 0) def.capabilities = capabilities;
|
|
520
|
+
const maxOutputRaw = typeof flags["max-output"] === "string" ? flags["max-output"] : void 0;
|
|
521
|
+
const maxOutput = parseSizeFlag(maxOutputRaw);
|
|
522
|
+
if (maxOutput !== void 0) def.maxOutput = maxOutput;
|
|
523
|
+
await mutateModelsConfig(deps, (models) => {
|
|
524
|
+
models[modelId] = def;
|
|
525
|
+
});
|
|
526
|
+
deps.renderer.writeInfo(`Custom model "${modelId}" ${existing ? "updated" : "added"}.`);
|
|
527
|
+
const capLines = [];
|
|
528
|
+
if (def.capabilities) {
|
|
529
|
+
for (const [k, v] of Object.entries(def.capabilities)) {
|
|
530
|
+
capLines.push(` ${k}: ${v}`);
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
if (def.maxOutput !== void 0) capLines.push(` maxOutput: ${def.maxOutput}`);
|
|
534
|
+
if (capLines.length > 0) {
|
|
535
|
+
deps.renderer.write(color.dim(capLines.join("\n") + "\n"));
|
|
536
|
+
}
|
|
537
|
+
return 0;
|
|
538
|
+
}
|
|
539
|
+
async function modelsRemove(args, deps) {
|
|
540
|
+
const modelId = args[0];
|
|
541
|
+
if (!modelId) {
|
|
542
|
+
deps.renderer.writeError("Usage: wstack models remove <modelId>");
|
|
543
|
+
return 1;
|
|
544
|
+
}
|
|
545
|
+
const existing = deps.config.models?.[modelId];
|
|
546
|
+
if (!existing) {
|
|
547
|
+
deps.renderer.writeError(`No custom model "${modelId}" found.`);
|
|
548
|
+
return 1;
|
|
549
|
+
}
|
|
550
|
+
await mutateModelsConfig(deps, (models) => {
|
|
551
|
+
delete models[modelId];
|
|
552
|
+
});
|
|
553
|
+
deps.renderer.writeInfo(`Removed custom model "${modelId}".`);
|
|
554
|
+
return 0;
|
|
555
|
+
}
|
|
556
|
+
async function modelsList(_args, deps) {
|
|
557
|
+
const models = deps.config.models ?? {};
|
|
558
|
+
const entries = Object.entries(models);
|
|
559
|
+
if (entries.length === 0) {
|
|
560
|
+
deps.renderer.write(color.dim("No custom models defined.\n"));
|
|
561
|
+
deps.renderer.write(
|
|
562
|
+
color.dim("Use `wstack models add <modelId> --max-context 128k --tools`\n")
|
|
563
|
+
);
|
|
564
|
+
return 0;
|
|
565
|
+
}
|
|
566
|
+
deps.renderer.write(color.bold("Custom models\n"));
|
|
567
|
+
for (const [id, def] of entries.sort(([a], [b]) => a.localeCompare(b))) {
|
|
568
|
+
const label = def.name ?? id;
|
|
569
|
+
const provider = def.provider ? ` ${color.dim(`(${def.provider})`)}` : "";
|
|
570
|
+
deps.renderer.write(` ${color.bold(label)}${provider}
|
|
571
|
+
`);
|
|
572
|
+
if (def.capabilities) {
|
|
573
|
+
for (const [k, v] of Object.entries(def.capabilities)) {
|
|
574
|
+
deps.renderer.write(` ${color.dim(`${k}:`)} ${v}
|
|
575
|
+
`);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (def.maxOutput !== void 0) {
|
|
579
|
+
deps.renderer.write(` ${color.dim("maxOutput:")} ${def.maxOutput}
|
|
580
|
+
`);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
return 0;
|
|
584
|
+
}
|
|
585
|
+
export {
|
|
586
|
+
modelsCmd,
|
|
587
|
+
providersCmd
|
|
588
|
+
};
|
|
589
|
+
//# sourceMappingURL=providers-models-GDELBHZK.js.map
|