@wrongstack/cli 1.0.33 → 1.0.35

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.
Files changed (121) hide show
  1. package/dist/{acp-EDGUWU7N.js → acp-T77EAEDB.js} +469 -465
  2. package/dist/{auth-SUHKFFO4.js → auth-M6LXZTDA.js} +4 -4
  3. package/dist/auth-menu/openai-codex-oauth.d.ts +1 -1
  4. package/dist/auth-menu/panel-provider-edits.d.ts +15 -0
  5. package/dist/auth-menu/panel-service.d.ts +1 -1
  6. package/dist/boot/governance-evidence-candidate.d.ts +1 -2
  7. package/dist/boot/system-prompt-builder.d.ts +1 -1
  8. package/dist/boot/tui-project-spawn.d.ts +0 -1
  9. package/dist/boot/tui-session-resume-contracts.d.ts +95 -0
  10. package/dist/boot/tui-session-resume.d.ts +2 -88
  11. package/dist/boot/tui-settings-read.d.ts +3 -0
  12. package/dist/{boot-auto-thin-K2DHHYIW.js → boot-auto-thin-YMAZI3QL.js} +2 -2
  13. package/dist/boot-launch-choices.d.ts +22 -0
  14. package/dist/boot-provider-gate.d.ts +28 -0
  15. package/dist/boot-subcommand-dispatch.d.ts +24 -0
  16. package/dist/boot.d.ts +1 -1
  17. package/dist/chimera-cascade-evidence.d.ts +1 -1
  18. package/dist/{chunk-TI7KLHYX.js → chunk-2CMMWRQH.js} +81 -80
  19. package/dist/{chunk-3LEFXLAW.js → chunk-6SIUTX75.js} +36 -36
  20. package/dist/{chunk-RQ4UBKYH.js → chunk-6Z6C6ZHH.js} +3 -3
  21. package/dist/{chunk-5EA6OTLJ.js → chunk-AFOH6CHO.js} +2 -2
  22. package/dist/{chunk-WHEYHDIE.js → chunk-AKESWZH5.js} +2 -1
  23. package/dist/{chunk-JHUJUIOH.js → chunk-AT2A7RJZ.js} +4 -16
  24. package/dist/{chunk-U3SS4NRH.js → chunk-BHXAKTBE.js} +1 -1
  25. package/dist/{chunk-MPQCHBDJ.js → chunk-CJSHS2K7.js} +5 -1
  26. package/dist/{chunk-P3GRLV47.js → chunk-GZSKLXYG.js} +208 -141
  27. package/dist/{chunk-4MDRHMX4.js → chunk-KMU7GF7X.js} +3 -26
  28. package/dist/{chunk-SWOPJHXI.js → chunk-LDV4ERNV.js} +4 -4
  29. package/dist/{chunk-24C6VVLM.js → chunk-LDXXMPMS.js} +12 -12
  30. package/dist/{chunk-UQUYBDMG.js → chunk-M4G5FO7F.js} +1 -1
  31. package/dist/{chunk-5UZBUV2H.js → chunk-RKU66D2O.js} +6 -4
  32. package/dist/{chunk-PGNERAZL.js → chunk-RWNI5OWT.js} +2 -2
  33. package/dist/chunk-TGSPCFBT.js +1 -0
  34. package/dist/{cli-context-7HK67B2Z.js → cli-context-II57EHD2.js} +1554 -1450
  35. package/dist/cli-initial-tools.d.ts +54 -0
  36. package/dist/{cli-main-TQGLKB6D.js → cli-main-YR2WJCPL.js} +38062 -37035
  37. package/dist/cli-main-boot.d.ts +133 -0
  38. package/dist/cli-main-orchestration.d.ts +170 -0
  39. package/dist/cli-main-state.d.ts +19 -0
  40. package/dist/config-doctor.d.ts +1 -1
  41. package/dist/{config-transfer-UE37X4B5.js → config-transfer-VOIFY7U4.js} +2 -2
  42. package/dist/{execution-C2IECWF7.js → execution-IBAZ2EIU.js} +138 -124
  43. package/dist/fleet/host-director-setup.d.ts +41 -0
  44. package/dist/fleet/host-spawn-types.d.ts +17 -0
  45. package/dist/fleet/host.d.ts +2 -1
  46. package/dist/goal-host-prompts.d.ts +5 -0
  47. package/dist/goal-host-types.d.ts +94 -0
  48. package/dist/goal-host.d.ts +2 -91
  49. package/dist/{hq-KBFDKTDD.js → hq-5OIEKB4V.js} +5 -6
  50. package/dist/hq-server/handle-types.d.ts +1 -1
  51. package/dist/hq-server/routes/auth-handlers.d.ts +1 -1
  52. package/dist/hq-server/routes.d.ts +1 -13
  53. package/dist/hq-server/utils.d.ts +1 -1
  54. package/dist/{hq-server-AVNKZ2PV.js → hq-server-DU3ZH3X7.js} +3 -3
  55. package/dist/{hq-service-FGB7BY2D.js → hq-service-LYZV7EK7.js} +3 -3
  56. package/dist/index.js +4 -4
  57. package/dist/live-settings-input.d.ts +2 -0
  58. package/dist/mailbox-bridge-bootstrap.d.ts +1 -4
  59. package/dist/picker-effort.d.ts +32 -0
  60. package/dist/picker-model-picker.d.ts +13 -2
  61. package/dist/picker-provider-list.d.ts +66 -0
  62. package/dist/picker.d.ts +12 -12
  63. package/dist/{providers-models-O75MKLN2.js → providers-models-37DUV2GW.js} +247 -237
  64. package/dist/repl-suggestions.d.ts +0 -5
  65. package/dist/{sdd-runtime-PTOSPYI4.js → sdd-runtime-PF72WHLO.js} +3 -20
  66. package/dist/services/sdd/task-manager.d.ts +1 -12
  67. package/dist/services/sdd-runtime.d.ts +3 -4
  68. package/dist/services/statusline-config.d.ts +0 -2
  69. package/dist/settings-behavior-sections.d.ts +0 -1
  70. package/dist/short-circuit-flags-EXJBJ5GT.js +10 -0
  71. package/dist/{skill-suggest-L2EVWB6R.js → skill-suggest-THANK3LV.js} +1 -1
  72. package/dist/slash-commands/command-context.d.ts +2 -0
  73. package/dist/slash-commands/fallback-chain-view.d.ts +3 -0
  74. package/dist/slash-commands/fallback-ref-validation.d.ts +34 -0
  75. package/dist/slash-commands/goal-refiner.d.ts +10 -2
  76. package/dist/slash-commands/goals.d.ts +6 -0
  77. package/dist/slash-commands/kanban-task-completion.d.ts +17 -0
  78. package/dist/slash-commands/mcp.d.ts +0 -1
  79. package/dist/slash-commands/memory-purge-domain-terms.d.ts +5 -0
  80. package/dist/slash-commands/nextsteps-mode.d.ts +13 -0
  81. package/dist/slash-commands/session-live-status.d.ts +21 -0
  82. package/dist/slash-commands/session.d.ts +1 -1
  83. package/dist/slash-commands/settings-feature-ui-mutations.d.ts +8 -0
  84. package/dist/slash-commands/settings-hq-autonomy-mutations.d.ts +8 -0
  85. package/dist/slash-commands/settings-persist-deps.d.ts +10 -0
  86. package/dist/slash-commands/settings-runtime-mutations.d.ts +12 -0
  87. package/dist/slash-commands/shadow.d.ts +0 -1
  88. package/dist/slash-commands/tool-auto-thin-commands.d.ts +15 -0
  89. package/dist/subcommands/handlers/acp-agents.d.ts +9 -0
  90. package/dist/subcommands/handlers/acp-server.d.ts +7 -0
  91. package/dist/subcommands/handlers/hq.d.ts +0 -1
  92. package/dist/subcommands/handlers/providers-models-custom.d.ts +33 -0
  93. package/dist/subcommands/handlers/providers-models-visibility.d.ts +29 -0
  94. package/dist/subcommands/handlers/skill-suggest.d.ts +0 -2
  95. package/dist/{subcommands-CLI6QTLU.js → subcommands-DTKBXLPU.js} +2 -2
  96. package/dist/{update-J5WHAFPE.js → update-6OEPAEUV.js} +3 -3
  97. package/dist/utils/win32-cmd.d.ts +1 -1
  98. package/dist/{version-help-ATOKGMTK.js → version-help-JQGRPDJW.js} +2 -2
  99. package/dist/webui-server/host-settings.d.ts +17 -0
  100. package/dist/webui-server/http-bridge.d.ts +32 -0
  101. package/dist/webui-server/instance-registration.d.ts +19 -0
  102. package/dist/webui-server/kanban-services.d.ts +9 -0
  103. package/dist/webui-server/message-router.d.ts +14 -0
  104. package/dist/webui-server/prefs-seeding.d.ts +1 -2
  105. package/dist/webui-server/provider-config.d.ts +0 -1
  106. package/dist/webui-server/provider-plane.d.ts +14 -0
  107. package/dist/webui-server/session-agents.d.ts +18 -0
  108. package/dist/webui-server/session-start-live.d.ts +11 -0
  109. package/dist/webui-server/stream-coalescer.d.ts +1 -1
  110. package/dist/webui-server/transport.d.ts +12 -0
  111. package/dist/{webui-server-GQOVLQS3.js → webui-server-6IC3SLZG.js} +1600 -1435
  112. package/dist/webui-session-maintenance.d.ts +16 -0
  113. package/dist/wiring/brain-and-orchestration.d.ts +1 -1
  114. package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
  115. package/dist/wiring/command-host-state.d.ts +11 -2
  116. package/dist/wiring/dep-watcher-bridge.d.ts +8 -1
  117. package/dist/wiring/session-command-handlers.d.ts +2 -1
  118. package/dist/worktree-command-host.d.ts +31 -0
  119. package/package.json +30 -30
  120. package/dist/chunk-WHOIR577.js +0 -1
  121. package/dist/short-circuit-flags-D6VAG47Y.js +0 -10
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  visibleModelIds
3
- } from "./chunk-5UZBUV2H.js";
3
+ } from "./chunk-RKU66D2O.js";
4
4
  import {
5
5
  mutateConfigProviders
6
6
  } from "./chunk-ZYACRPLN.js";
@@ -9,6 +9,9 @@ import {
9
9
  } from "./chunk-YMXXOOFN.js";
10
10
 
11
11
  // src/subcommands/handlers/providers-models.ts
12
+ import { color as color3 } from "@wrongstack/core/utils";
13
+
14
+ // src/subcommands/handlers/providers-models-custom.ts
12
15
  import * as fs from "node:fs/promises";
13
16
  import { decryptConfigSecretsForRewrite, encryptConfigSecrets } from "@wrongstack/core/security";
14
17
  import {
@@ -17,229 +20,13 @@ import {
17
20
  import {
18
21
  atomicWrite,
19
22
  backupConfigFile,
20
- color,
23
+ color as color2,
21
24
  expectDefined,
22
25
  withFileLock
23
26
  } from "@wrongstack/core/utils";
24
- var providersCmd = async (args, deps) => {
25
- const providerFlags = subcommandFlags(args, deps);
26
- const showAll = providerFlags["all"] === true || providerFlags["all"] === "true";
27
- const showUnsupported = providerFlags["unsupported"] === true || providerFlags["unsupported"] === "true";
28
- try {
29
- const all = await deps.modelsRegistry.listProviders();
30
- const byFamily = {
31
- anthropic: [],
32
- "anthropic-oauth": [],
33
- openai: [],
34
- "openai-compatible": [],
35
- "openai-codex": [],
36
- "github-copilot": [],
37
- google: [],
38
- "google-antigravity": [],
39
- unsupported: []
40
- };
41
- for (const p of all) byFamily[p.family].push(p);
42
- const families = showUnsupported ? ["unsupported"] : showAll ? ["anthropic", "openai", "google", "openai-compatible", "unsupported"] : ["anthropic", "openai", "google", "openai-compatible"];
43
- for (const family of families) {
44
- const list = byFamily[family];
45
- if (list.length === 0) continue;
46
- deps.renderer.write(`
47
- ${color.bold(family)} (${list.length}):
48
- `);
49
- for (const p of list) {
50
- const envFound = p.envVars.some((v) => process.env[v]);
51
- const marker = envFound ? color.green("\u25CF") : color.dim("\u25CB");
52
- const envHint = p.envVars[0] ? color.dim(`[${p.envVars[0]}]`) : "";
53
- const note = family === "unsupported" ? color.dim("(needs plugin)") : "";
54
- deps.renderer.write(
55
- ` ${marker} ${p.id.padEnd(20)} ${p.name.padEnd(28)} ${envHint} ${note}
56
- `
57
- );
58
- }
59
- }
60
- deps.renderer.write(
61
- `
62
- ${color.dim(`Current: ${deps.config.provider ?? "<unset>"} / ${deps.config.model ?? "<unset>"}. Use --all to include unsupported families.`)}
63
- `
64
- );
65
- return 0;
66
- } catch (err) {
67
- deps.renderer.writeError(
68
- `Failed to list providers: ${err instanceof Error ? err.message : err}`
69
- );
70
- return 1;
71
- }
72
- };
73
- function parseFlags(args) {
74
- const flags = {};
75
- for (let i = 0; i < args.length; i++) {
76
- const a = expectDefined(args[i]);
77
- if (a.startsWith("--")) {
78
- const eq = a.indexOf("=");
79
- if (eq !== -1) {
80
- flags[a.slice(2, eq)] = a.slice(eq + 1);
81
- } else {
82
- const name = a.slice(2);
83
- if (i + 1 < args.length && !args[i + 1]?.startsWith("--")) {
84
- flags[name] = args[++i] ?? "";
85
- } else {
86
- flags[name] = true;
87
- }
88
- }
89
- }
90
- }
91
- return flags;
92
- }
93
- function positionals(args) {
94
- const out = [];
95
- for (let i = 0; i < args.length; i++) {
96
- const a = expectDefined(args[i]);
97
- if (a.startsWith("--")) {
98
- const eq = a.indexOf("=");
99
- if (eq === -1) {
100
- if (i + 1 < args.length && !args[i + 1]?.startsWith("--")) {
101
- i++;
102
- }
103
- }
104
- continue;
105
- }
106
- out.push(a);
107
- }
108
- return out;
109
- }
110
- var DEFAULT_PER_PAGE = 15;
111
- function fmtPrice(usdPer1M) {
112
- if (usdPer1M === void 0) return color.dim("?");
113
- const value = usdPer1M >= 10 ? usdPer1M.toFixed(1) : usdPer1M.toFixed(2);
114
- return "$" + value;
115
- }
116
- var modelsCmd = async (args, deps) => {
117
- const sub = args[0];
118
- if (sub === "hide") return modelsHide(args.slice(1), deps);
119
- if (sub === "show") return modelsShow(args.slice(1), deps);
120
- if (sub === "hidden") return modelsHidden(args.slice(1), deps);
121
- if (sub === "reset") return modelsReset(args.slice(1), deps);
122
- if (sub === "add") return modelsAdd(args.slice(1), deps);
123
- if (sub === "remove") return modelsRemove(args.slice(1), deps);
124
- if (sub === "list") return modelsList(args.slice(1), deps);
125
- if (sub === "caps" || sub === "capabilities") return modelsCaps(args.slice(1), deps);
126
- if (sub === "refresh") {
127
- deps.renderer.writeInfo("Refreshing models.dev cache\u2026");
128
- try {
129
- const payload = await deps.modelsRegistry.refresh();
130
- deps.renderer.writeInfo(
131
- `Cached ${Object.keys(payload).length} providers to ${deps.paths.modelsCache}`
132
- );
133
- return 0;
134
- } catch (err) {
135
- deps.renderer.writeError(`Refresh failed: ${err instanceof Error ? err.message : err}`);
136
- return 1;
137
- }
138
- }
139
- const flags = subcommandFlags(args, deps);
140
- const search = typeof flags["search"] === "string" ? flags["search"].toLowerCase() : "";
141
- const perPage = Number(flags["per-page"]) > 0 ? Number(flags["per-page"]) : DEFAULT_PER_PAGE;
142
- const page = Math.max(1, Number(flags["page"]) || 1);
143
- const providerId = sub ?? deps.config.provider ?? "";
144
- if (!providerId) {
145
- deps.renderer.writeError(
146
- "Usage: wstack models <provider> [--search <term>] [--page N] [--per-page N]"
147
- );
148
- return 1;
149
- }
150
- const { providerId: lookupId, provider } = await getCatalogProviderForConfigProvider(
151
- providerId,
152
- deps
153
- );
154
- if (!provider) {
155
- deps.renderer.writeError(
156
- lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
157
- );
158
- return 1;
159
- }
160
- if (lookupId !== providerId)
161
- deps.renderer.write(
162
- color.dim(`(showing catalog models for "${lookupId}" via alias "${providerId}")
163
- `)
164
- );
165
- deps.renderer.write(`${color.bold(provider.name)} ${color.dim(`(${provider.id})`)}
166
- `);
167
- if (provider.doc) deps.renderer.write(color.dim(`Docs: ${provider.doc}
168
- `));
169
- const savedProvider = deps.config.providers?.[providerId];
170
- const userModels = savedProvider?.models;
171
- const catalogById = new Map(provider.models.map((m) => [m.id, m]));
172
- const allKnownSorted = [...provider.models].sort(
173
- (a, b) => (b.release_date ?? "").localeCompare(a.release_date ?? "")
174
- );
175
- const visibleIds = visibleModelIds(
176
- providerId,
177
- deps.config,
178
- allKnownSorted.map((m) => m.id),
179
- savedProvider
180
- );
181
- const allSorted = visibleIds.map((id) => catalogById.get(id) ?? { id, name: id });
182
- if (userModels !== void 0) {
183
- const hiddenCount = Math.max(0, allKnownSorted.length - visibleIds.length);
184
- const restoredCount = Math.max(0, visibleIds.length - userModels.length);
185
- deps.renderer.write(
186
- color.dim(
187
- `(${visibleIds.length} visible model(s)${restoredCount > 0 ? `, ${restoredCount} from providers.json/catalog fallback` : " from your saved config"}${hiddenCount > 0 ? `, ${hiddenCount} hidden` : ""})
188
- `
189
- )
190
- );
191
- }
192
- const filtered = search ? allSorted.filter((m) => m.id.toLowerCase().includes(search)) : allSorted;
193
- const total = filtered.length;
194
- const totalPages = Math.max(1, Math.ceil(total / perPage));
195
- const actualPage = Math.min(page, totalPages);
196
- const start = (actualPage - 1) * perPage;
197
- const pageItems = filtered.slice(start, start + perPage);
198
- const end = Math.min(start + pageItems.length, total);
199
- const pageHint = totalPages > 1 ? color.cyan(`[page ${actualPage}/${totalPages}]`) : "";
200
- const searchHint = search ? color.yellow(` (filtered: "${search}" \u2014 ${total} match${total === 1 ? "" : "es"})`) : color.dim(` (${total} model${total === 1 ? "" : "s"})`);
201
- deps.renderer.write(`${pageHint}${searchHint}
202
- `);
203
- if (pageItems.length === 0) {
204
- deps.renderer.write(color.dim("(no models match)\n"));
205
- } else {
206
- if (start > 0)
207
- deps.renderer.write(color.dim(` ${String.fromCharCode(8593)} ${start} above
208
- `));
209
- for (const m of pageItems) {
210
- const caps = [];
211
- if ("tool_call" in m && m.tool_call) caps.push("tools");
212
- if ("reasoning" in m && m.reasoning) caps.push("reasoning");
213
- if ("modalities" in m && m.modalities?.input?.includes("image")) caps.push("vision");
214
- const ctx = "limit" in m && m.limit?.context ? `${(m.limit.context / 1e3).toFixed(0)}k` : "?";
215
- const cost = "cost" in m && m.cost?.input !== void 0 ? `${m.cost.input}/${m.cost.output ?? "?"}` : "";
216
- deps.renderer.write(
217
- ` ${m.id.padEnd(40)} ${color.dim(ctx.padStart(6))} ${color.dim(cost.padEnd(14))} ${color.dim(caps.join(","))}
218
- `
219
- );
220
- }
221
- if (end < total)
222
- deps.renderer.write(color.dim(` ${String.fromCharCode(8595)} ${total - end} below
223
- `));
224
- }
225
- const navLines = [];
226
- if (totalPages > 1) {
227
- if (actualPage > 1) navLines.push(`--page ${actualPage - 1} (prev)`);
228
- if (actualPage < totalPages) navLines.push(`--page ${actualPage + 1} (next)`);
229
- }
230
- navLines.push("--search <term> (filter)");
231
- deps.renderer.write(color.dim(`
232
- ${navLines.join(" \xB7 ")}
233
- `));
234
- const age = await deps.modelsRegistry.ageSeconds();
235
- deps.renderer.write(
236
- color.dim(
237
- `Cache age: ${isFinite(age) ? `${Math.round(age / 60)}m` : "never fetched"}. Run \`wstack models refresh\` to update.
238
- `
239
- )
240
- );
241
- return 0;
242
- };
27
+
28
+ // src/subcommands/handlers/providers-models-visibility.ts
29
+ import { color } from "@wrongstack/core/utils";
243
30
  function aliasProviderId(configProviderId, cfg) {
244
31
  return cfg?.type && cfg.type !== configProviderId ? cfg.type : configProviderId;
245
32
  }
@@ -423,6 +210,50 @@ function publishProviderConfig(deps, providerId, next) {
423
210
  providers: { ...deps.config.providers ?? {}, [providerId]: next }
424
211
  };
425
212
  }
213
+
214
+ // src/subcommands/handlers/providers-models-custom.ts
215
+ function parseFlags(args) {
216
+ const flags = {};
217
+ for (let i = 0; i < args.length; i++) {
218
+ const a = expectDefined(args[i]);
219
+ if (a.startsWith("--")) {
220
+ const eq = a.indexOf("=");
221
+ if (eq !== -1) {
222
+ flags[a.slice(2, eq)] = a.slice(eq + 1);
223
+ } else {
224
+ const name = a.slice(2);
225
+ if (i + 1 < args.length && !args[i + 1]?.startsWith("--")) {
226
+ flags[name] = args[++i] ?? "";
227
+ } else {
228
+ flags[name] = true;
229
+ }
230
+ }
231
+ }
232
+ }
233
+ return flags;
234
+ }
235
+ function positionals(args) {
236
+ const out = [];
237
+ for (let i = 0; i < args.length; i++) {
238
+ const a = expectDefined(args[i]);
239
+ if (a.startsWith("--")) {
240
+ const eq = a.indexOf("=");
241
+ if (eq === -1) {
242
+ if (i + 1 < args.length && !args[i + 1]?.startsWith("--")) {
243
+ i++;
244
+ }
245
+ }
246
+ continue;
247
+ }
248
+ out.push(a);
249
+ }
250
+ return out;
251
+ }
252
+ function fmtPrice(usdPer1M) {
253
+ if (usdPer1M === void 0) return color2.dim("?");
254
+ const value = usdPer1M >= 10 ? usdPer1M.toFixed(1) : usdPer1M.toFixed(2);
255
+ return "$" + value;
256
+ }
426
257
  async function modelsResetCustomModel(providerId, modelId, saved, deps) {
427
258
  if (!saved.customModels || !Object.hasOwn(saved.customModels, modelId)) {
428
259
  deps.renderer.writeInfo(`${providerId}/${modelId} has no custom definition; nothing to reset.`);
@@ -485,7 +316,7 @@ async function modelsCaps(args, deps) {
485
316
  const modelId = args[1] ?? deps.config.model;
486
317
  if (!providerId || !modelId) {
487
318
  deps.renderer.writeError("Usage: wstack models caps [provider] [model]");
488
- deps.renderer.write(color.dim("Defaults to current configured provider/model when omitted.\n"));
319
+ deps.renderer.write(color2.dim("Defaults to current configured provider/model when omitted.\n"));
489
320
  return 1;
490
321
  }
491
322
  if (usesAccountCatalog(deps.config.providers?.[providerId])) {
@@ -495,7 +326,7 @@ async function modelsCaps(args, deps) {
495
326
  if (!resolved) {
496
327
  deps.renderer.writeError("Model not found in catalog: " + providerId + "/" + modelId);
497
328
  deps.renderer.write(
498
- color.dim("Run `wstack models refresh` or add a custom model if this is expected.\n")
329
+ color2.dim("Run `wstack models refresh` or add a custom model if this is expected.\n")
499
330
  );
500
331
  return 1;
501
332
  }
@@ -508,17 +339,17 @@ async function modelsCaps(args, deps) {
508
339
  const rc = caps.reasoningConfig;
509
340
  const cost = resolved.cost;
510
341
  deps.renderer.write(
511
- color.bold("Model capabilities") + " " + color.dim(providerId + "/" + modelId) + "\n"
342
+ color2.bold("Model capabilities") + " " + color2.dim(providerId + "/" + modelId) + "\n"
512
343
  );
513
344
  deps.renderer.write(
514
- " context: " + (caps.maxContext ? color.yellow(String(caps.maxContext)) : color.dim("?")) + "\n"
345
+ " context: " + (caps.maxContext ? color2.yellow(String(caps.maxContext)) : color2.dim("?")) + "\n"
515
346
  );
516
347
  if (caps.maxOutput !== void 0) {
517
- deps.renderer.write(" max output: " + color.yellow(String(caps.maxOutput)) + "\n");
348
+ deps.renderer.write(" max output: " + color2.yellow(String(caps.maxOutput)) + "\n");
518
349
  }
519
350
  if (caps.knowledge) deps.renderer.write(" knowledge: " + caps.knowledge + "\n");
520
351
  deps.renderer.write(
521
- " flags: " + (flags.length > 0 ? flags.join(", ") : color.dim("(none)")) + "\n"
352
+ " flags: " + (flags.length > 0 ? flags.join(", ") : color2.dim("(none)")) + "\n"
522
353
  );
523
354
  deps.renderer.write(
524
355
  " pricing/1M: input " + fmtPrice(cost?.input) + " output " + fmtPrice(cost?.output) + " cacheR " + fmtPrice(cost?.cache_read) + "\n"
@@ -541,7 +372,7 @@ async function modelsCaps(args, deps) {
541
372
  deps.renderer.write(" preserve: " + rc.preserveThinking + "\n");
542
373
  } else if (caps.reasoning) {
543
374
  deps.renderer.write(
544
- color.dim(" reasoning: supported, but no detailed config in catalog\n")
375
+ color2.dim(" reasoning: supported, but no detailed config in catalog\n")
545
376
  );
546
377
  }
547
378
  return 0;
@@ -650,7 +481,7 @@ async function modelsAdd(args, deps) {
650
481
  }
651
482
  if (def.maxOutput !== void 0) capLines.push(` maxOutput: ${def.maxOutput}`);
652
483
  if (capLines.length > 0) {
653
- deps.renderer.write(color.dim(capLines.join("\n") + "\n"));
484
+ deps.renderer.write(color2.dim(capLines.join("\n") + "\n"));
654
485
  }
655
486
  return 0;
656
487
  }
@@ -675,33 +506,212 @@ async function modelsList(_args, deps) {
675
506
  const models = deps.config.models ?? {};
676
507
  const entries = Object.entries(models);
677
508
  if (entries.length === 0) {
678
- deps.renderer.write(color.dim("No custom models defined.\n"));
509
+ deps.renderer.write(color2.dim("No custom models defined.\n"));
679
510
  deps.renderer.write(
680
- color.dim("Use `wstack models add <modelId> --max-context 128k --tools`\n")
511
+ color2.dim("Use `wstack models add <modelId> --max-context 128k --tools`\n")
681
512
  );
682
513
  return 0;
683
514
  }
684
- deps.renderer.write(color.bold("Custom models\n"));
515
+ deps.renderer.write(color2.bold("Custom models\n"));
685
516
  for (const [id, def] of entries.sort(([a], [b]) => a.localeCompare(b))) {
686
517
  const label = def.name ?? id;
687
- const provider = def.provider ? ` ${color.dim(`(${def.provider})`)}` : "";
688
- deps.renderer.write(` ${color.bold(label)}${provider}
518
+ const provider = def.provider ? ` ${color2.dim(`(${def.provider})`)}` : "";
519
+ deps.renderer.write(` ${color2.bold(label)}${provider}
689
520
  `);
690
521
  if (def.capabilities) {
691
522
  for (const [k, v] of Object.entries(def.capabilities)) {
692
- deps.renderer.write(` ${color.dim(`${k}:`)} ${v}
523
+ deps.renderer.write(` ${color2.dim(`${k}:`)} ${v}
693
524
  `);
694
525
  }
695
526
  }
696
527
  if (def.maxOutput !== void 0) {
697
- deps.renderer.write(` ${color.dim("maxOutput:")} ${def.maxOutput}
528
+ deps.renderer.write(` ${color2.dim("maxOutput:")} ${def.maxOutput}
698
529
  `);
699
530
  }
700
531
  }
701
532
  return 0;
702
533
  }
534
+
535
+ // src/subcommands/handlers/providers-models.ts
536
+ var providersCmd = async (args, deps) => {
537
+ const providerFlags = subcommandFlags(args, deps);
538
+ const showAll = providerFlags["all"] === true || providerFlags["all"] === "true";
539
+ const showUnsupported = providerFlags["unsupported"] === true || providerFlags["unsupported"] === "true";
540
+ try {
541
+ const all = await deps.modelsRegistry.listProviders();
542
+ const byFamily = {
543
+ anthropic: [],
544
+ "anthropic-oauth": [],
545
+ openai: [],
546
+ "openai-compatible": [],
547
+ "openai-codex": [],
548
+ "github-copilot": [],
549
+ google: [],
550
+ "google-antigravity": [],
551
+ unsupported: []
552
+ };
553
+ for (const p of all) byFamily[p.family].push(p);
554
+ const families = showUnsupported ? ["unsupported"] : showAll ? ["anthropic", "openai", "google", "openai-compatible", "unsupported"] : ["anthropic", "openai", "google", "openai-compatible"];
555
+ for (const family of families) {
556
+ const list = byFamily[family];
557
+ if (list.length === 0) continue;
558
+ deps.renderer.write(`
559
+ ${color3.bold(family)} (${list.length}):
560
+ `);
561
+ for (const p of list) {
562
+ const envFound = p.envVars.some((v) => process.env[v]);
563
+ const marker = envFound ? color3.green("\u25CF") : color3.dim("\u25CB");
564
+ const envHint = p.envVars[0] ? color3.dim(`[${p.envVars[0]}]`) : "";
565
+ const note = family === "unsupported" ? color3.dim("(needs plugin)") : "";
566
+ deps.renderer.write(
567
+ ` ${marker} ${p.id.padEnd(20)} ${p.name.padEnd(28)} ${envHint} ${note}
568
+ `
569
+ );
570
+ }
571
+ }
572
+ deps.renderer.write(
573
+ `
574
+ ${color3.dim(`Current: ${deps.config.provider ?? "<unset>"} / ${deps.config.model ?? "<unset>"}. Use --all to include unsupported families.`)}
575
+ `
576
+ );
577
+ return 0;
578
+ } catch (err) {
579
+ deps.renderer.writeError(
580
+ `Failed to list providers: ${err instanceof Error ? err.message : err}`
581
+ );
582
+ return 1;
583
+ }
584
+ };
585
+ var DEFAULT_PER_PAGE = 15;
586
+ var modelsCmd = async (args, deps) => {
587
+ const sub = args[0];
588
+ if (sub === "hide") return modelsHide(args.slice(1), deps);
589
+ if (sub === "show") return modelsShow(args.slice(1), deps);
590
+ if (sub === "hidden") return modelsHidden(args.slice(1), deps);
591
+ if (sub === "reset") return modelsReset(args.slice(1), deps);
592
+ if (sub === "add") return modelsAdd(args.slice(1), deps);
593
+ if (sub === "remove") return modelsRemove(args.slice(1), deps);
594
+ if (sub === "list") return modelsList(args.slice(1), deps);
595
+ if (sub === "caps" || sub === "capabilities") return modelsCaps(args.slice(1), deps);
596
+ if (sub === "refresh") {
597
+ deps.renderer.writeInfo("Refreshing models.dev cache\u2026");
598
+ try {
599
+ const payload = await deps.modelsRegistry.refresh();
600
+ deps.renderer.writeInfo(
601
+ `Cached ${Object.keys(payload).length} providers to ${deps.paths.modelsCache}`
602
+ );
603
+ return 0;
604
+ } catch (err) {
605
+ deps.renderer.writeError(`Refresh failed: ${err instanceof Error ? err.message : err}`);
606
+ return 1;
607
+ }
608
+ }
609
+ const flags = subcommandFlags(args, deps);
610
+ const search = typeof flags["search"] === "string" ? flags["search"].toLowerCase() : "";
611
+ const perPage = Number(flags["per-page"]) > 0 ? Number(flags["per-page"]) : DEFAULT_PER_PAGE;
612
+ const page = Math.max(1, Number(flags["page"]) || 1);
613
+ const providerId = sub ?? deps.config.provider ?? "";
614
+ if (!providerId) {
615
+ deps.renderer.writeError(
616
+ "Usage: wstack models <provider> [--search <term>] [--page N] [--per-page N]"
617
+ );
618
+ return 1;
619
+ }
620
+ const { providerId: lookupId, provider } = await getCatalogProviderForConfigProvider(
621
+ providerId,
622
+ deps
623
+ );
624
+ if (!provider) {
625
+ deps.renderer.writeError(
626
+ lookupId !== providerId ? `Alias "${providerId}" points at catalog id "${lookupId}" which is not in the cache.` : `Provider "${providerId}" not in catalog.`
627
+ );
628
+ return 1;
629
+ }
630
+ if (lookupId !== providerId)
631
+ deps.renderer.write(
632
+ color3.dim(`(showing catalog models for "${lookupId}" via alias "${providerId}")
633
+ `)
634
+ );
635
+ deps.renderer.write(`${color3.bold(provider.name)} ${color3.dim(`(${provider.id})`)}
636
+ `);
637
+ if (provider.doc) deps.renderer.write(color3.dim(`Docs: ${provider.doc}
638
+ `));
639
+ const savedProvider = deps.config.providers?.[providerId];
640
+ const userModels = savedProvider?.models;
641
+ const catalogById = new Map(provider.models.map((m) => [m.id, m]));
642
+ const allKnownSorted = [...provider.models].sort(
643
+ (a, b) => (b.release_date ?? "").localeCompare(a.release_date ?? "")
644
+ );
645
+ const visibleIds = visibleModelIds(
646
+ providerId,
647
+ deps.config,
648
+ allKnownSorted.map((m) => m.id),
649
+ savedProvider
650
+ );
651
+ const allSorted = visibleIds.map((id) => catalogById.get(id) ?? { id, name: id });
652
+ if (userModels !== void 0) {
653
+ const hiddenCount = Math.max(0, allKnownSorted.length - visibleIds.length);
654
+ const restoredCount = Math.max(0, visibleIds.length - userModels.length);
655
+ deps.renderer.write(
656
+ color3.dim(
657
+ `(${visibleIds.length} visible model(s)${restoredCount > 0 ? `, ${restoredCount} from providers.json/catalog fallback` : " from your saved config"}${hiddenCount > 0 ? `, ${hiddenCount} hidden` : ""})
658
+ `
659
+ )
660
+ );
661
+ }
662
+ const filtered = search ? allSorted.filter((m) => m.id.toLowerCase().includes(search)) : allSorted;
663
+ const total = filtered.length;
664
+ const totalPages = Math.max(1, Math.ceil(total / perPage));
665
+ const actualPage = Math.min(page, totalPages);
666
+ const start = (actualPage - 1) * perPage;
667
+ const pageItems = filtered.slice(start, start + perPage);
668
+ const end = Math.min(start + pageItems.length, total);
669
+ const pageHint = totalPages > 1 ? color3.cyan(`[page ${actualPage}/${totalPages}]`) : "";
670
+ const searchHint = search ? color3.yellow(` (filtered: "${search}" \u2014 ${total} match${total === 1 ? "" : "es"})`) : color3.dim(` (${total} model${total === 1 ? "" : "s"})`);
671
+ deps.renderer.write(`${pageHint}${searchHint}
672
+ `);
673
+ if (pageItems.length === 0) {
674
+ deps.renderer.write(color3.dim("(no models match)\n"));
675
+ } else {
676
+ if (start > 0)
677
+ deps.renderer.write(color3.dim(` ${String.fromCharCode(8593)} ${start} above
678
+ `));
679
+ for (const m of pageItems) {
680
+ const caps = [];
681
+ if ("tool_call" in m && m.tool_call) caps.push("tools");
682
+ if ("reasoning" in m && m.reasoning) caps.push("reasoning");
683
+ if ("modalities" in m && m.modalities?.input?.includes("image")) caps.push("vision");
684
+ const ctx = "limit" in m && m.limit?.context ? `${(m.limit.context / 1e3).toFixed(0)}k` : "?";
685
+ const cost = "cost" in m && m.cost?.input !== void 0 ? `${m.cost.input}/${m.cost.output ?? "?"}` : "";
686
+ deps.renderer.write(
687
+ ` ${m.id.padEnd(40)} ${color3.dim(ctx.padStart(6))} ${color3.dim(cost.padEnd(14))} ${color3.dim(caps.join(","))}
688
+ `
689
+ );
690
+ }
691
+ if (end < total)
692
+ deps.renderer.write(color3.dim(` ${String.fromCharCode(8595)} ${total - end} below
693
+ `));
694
+ }
695
+ const navLines = [];
696
+ if (totalPages > 1) {
697
+ if (actualPage > 1) navLines.push(`--page ${actualPage - 1} (prev)`);
698
+ if (actualPage < totalPages) navLines.push(`--page ${actualPage + 1} (next)`);
699
+ }
700
+ navLines.push("--search <term> (filter)");
701
+ deps.renderer.write(color3.dim(`
702
+ ${navLines.join(" \xB7 ")}
703
+ `));
704
+ const age = await deps.modelsRegistry.ageSeconds();
705
+ deps.renderer.write(
706
+ color3.dim(
707
+ `Cache age: ${isFinite(age) ? `${Math.round(age / 60)}m` : "never fetched"}. Run \`wstack models refresh\` to update.
708
+ `
709
+ )
710
+ );
711
+ return 0;
712
+ };
703
713
  export {
704
714
  modelsCmd,
705
715
  providersCmd
706
716
  };
707
- //# sourceMappingURL=providers-models-O75MKLN2.js.map
717
+ //# sourceMappingURL=providers-models-37DUV2GW.js.map
@@ -13,9 +13,4 @@ import type { TodoItem } from '@wrongstack/core/agent';
13
13
  * on the next turn once everything is `completed`.
14
14
  */
15
15
  export declare function parseSuggestionsFromOutput(finalText: string, todos?: readonly TodoItem[] | null): string[] | null;
16
- /**
17
- * Extract only the auto="true" items from next_steps output.
18
- * Used by YOLO+auto autonomy mode.
19
- */
20
- export declare function parseAutoSuggestionsFromOutput(finalText: string): string[] | null;
21
16
  //# sourceMappingURL=repl-suggestions.d.ts.map
@@ -1,51 +1,34 @@
1
- import "./chunk-WHOIR577.js";
1
+ import "./chunk-TGSPCFBT.js";
2
2
  import {
3
- SDDState,
4
3
  advanceToNextTask,
5
4
  autoDetectTaskCompletion,
6
- findSpec,
7
- formatElapsed,
8
- gatherProjectContext,
9
5
  getActiveBuilder,
10
6
  getActiveSDDContext,
11
7
  getActiveSDDPhase,
12
8
  getCurrentExecutingContext,
13
- getSessionState,
14
9
  getTaskGraphId,
15
10
  getTaskListText,
16
11
  getTaskProgress,
17
12
  getTaskTrackerExport,
18
- isExplanatoryText,
19
- markTaskCompleted,
20
13
  renderTaskListWithProgress,
21
- sddState,
22
14
  trySaveImplementationPlan,
23
15
  trySaveSpecFromAIOutput,
24
16
  trySaveTasksFromAIOutput
25
- } from "./chunk-JHUJUIOH.js";
17
+ } from "./chunk-AT2A7RJZ.js";
26
18
  export {
27
- SDDState,
28
19
  advanceToNextTask,
29
20
  autoDetectTaskCompletion,
30
- findSpec,
31
- formatElapsed,
32
- gatherProjectContext,
33
21
  getActiveBuilder,
34
22
  getActiveSDDContext,
35
23
  getActiveSDDPhase,
36
24
  getCurrentExecutingContext,
37
- getSessionState,
38
25
  getTaskGraphId,
39
26
  getTaskListText,
40
27
  getTaskProgress,
41
28
  getTaskTrackerExport as getTaskTracker,
42
- getTaskTrackerExport,
43
- isExplanatoryText,
44
- markTaskCompleted,
45
29
  renderTaskListWithProgress,
46
- sddState,
47
30
  trySaveImplementationPlan,
48
31
  trySaveSpecFromAIOutput,
49
32
  trySaveTasksFromAIOutput
50
33
  };
51
- //# sourceMappingURL=sdd-runtime-PTOSPYI4.js.map
34
+ //# sourceMappingURL=sdd-runtime-PF72WHLO.js.map
@@ -1,22 +1,11 @@
1
1
  import type { TaskProgress } from '@wrongstack/core/types';
2
- import { renderProgress, TaskTracker } from '@wrongstack/sdd';
3
- export type { TaskProgress };
4
- export { renderProgress };
2
+ import { TaskTracker } from '@wrongstack/sdd';
5
3
  /**
6
4
  * Format elapsed milliseconds as a human-readable string.
7
5
  */
8
6
  export declare function formatElapsed(ms: number): string;
9
7
  export declare function trySaveTasksFromAIOutput(aiOutput: string): Promise<boolean>;
10
8
  export declare function getTaskProgress(): TaskProgress | null;
11
- export declare function getCurrentTask(): {
12
- id: string;
13
- title: string;
14
- description: string;
15
- priority: string;
16
- estimateHours: number;
17
- tags: string[];
18
- startedAt: number | undefined;
19
- } | null;
20
9
  export declare function advanceToNextTask(): boolean;
21
10
  export declare function getTaskListText(): string | null;
22
11
  export declare function renderTaskListWithProgress(): string | null;
@@ -1,5 +1,4 @@
1
- export { findSpec, gatherProjectContext, getActiveBuilder, getActiveSDDContext, getActiveSDDPhase, } from './sdd/project-context.js';
2
- export { autoDetectTaskCompletion, isExplanatoryText, trySaveImplementationPlan, trySaveSpecFromAIOutput, } from './sdd/spec-detection.js';
3
- export { getSessionState, SDDState, sddState } from './sdd/state.js';
4
- export { advanceToNextTask, formatElapsed, getCurrentExecutingContext, getTaskGraphId, getTaskListText, getTaskProgress, getTaskTrackerExport as getTaskTracker, getTaskTrackerExport, markTaskCompleted, renderTaskListWithProgress, trySaveTasksFromAIOutput, } from './sdd/task-manager.js';
1
+ export { getActiveBuilder, getActiveSDDContext, getActiveSDDPhase, } from './sdd/project-context.js';
2
+ export { autoDetectTaskCompletion, trySaveImplementationPlan, trySaveSpecFromAIOutput, } from './sdd/spec-detection.js';
3
+ export { advanceToNextTask, getCurrentExecutingContext, getTaskGraphId, getTaskListText, getTaskProgress, getTaskTrackerExport as getTaskTracker, renderTaskListWithProgress, trySaveTasksFromAIOutput, } from './sdd/task-manager.js';
5
4
  //# sourceMappingURL=sdd-runtime.d.ts.map
@@ -65,6 +65,4 @@ export declare function saveStatuslineLayout(layout: {
65
65
  export declare function saveStatuslineChips(chips: StatuslineConfig): Promise<void>;
66
66
  /** Back-compat alias: persist only the line assignment. */
67
67
  export declare function saveStatuslineLines(lines: StatuslineLines): Promise<void>;
68
- /** Back-compat-sized helper: persist only the custom chip order. */
69
- export declare function saveStatuslineOrder(order: StatuslineOrder): Promise<void>;
70
68
  //# sourceMappingURL=statusline-config.d.ts.map