@wrongstack/cli 1.0.19 → 1.0.26

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 (195) hide show
  1. package/data/providers.json +44 -0
  2. package/dist/{acp-INCNOH42.js → acp-LI665LO2.js} +18 -7
  3. package/dist/arg-parser.d.ts +1 -0
  4. package/dist/ascii-mode-SG4PRNLP.js +7 -0
  5. package/dist/{auth-YXK3EDUL.js → auth-TE55JF4Z.js} +68 -22
  6. package/dist/auth-menu/direct.d.ts +1 -0
  7. package/dist/auth-menu/local.d.ts +2 -0
  8. package/dist/auth-menu/oauth-menu.d.ts +3 -1
  9. package/dist/auth-menu/panel-service.d.ts +20 -0
  10. package/dist/{bench-YBU6BVQP.js → bench-GTLPM22B.js} +2 -2
  11. package/dist/boot/append-system-prompt.d.ts +10 -0
  12. package/dist/boot/ascii-mode.d.ts +12 -0
  13. package/dist/boot/config-backup-recovery.d.ts +2 -1
  14. package/dist/boot/container-wiring.d.ts +4 -2
  15. package/dist/boot/dispatch-singleshot.d.ts +4 -1
  16. package/dist/boot/dispatch-webui.d.ts +11 -0
  17. package/dist/boot/mcp-config-flag.d.ts +22 -0
  18. package/dist/boot/piped-stdin.d.ts +40 -0
  19. package/dist/boot/restricted-mode.d.ts +15 -0
  20. package/dist/boot/safe-mode.d.ts +30 -0
  21. package/dist/boot/short-circuit-desktop.d.ts +1 -0
  22. package/dist/boot/single-shot-budget.d.ts +30 -0
  23. package/dist/boot/stream-json.d.ts +36 -0
  24. package/dist/boot/structured-output.d.ts +16 -0
  25. package/dist/boot/system-prompt-builder.d.ts +2 -0
  26. package/dist/boot/tool-restriction-flags.d.ts +36 -0
  27. package/dist/boot/tui-project-picker-callback.d.ts +1 -1
  28. package/dist/boot/tui-settings-adapter.d.ts +15 -2
  29. package/dist/boot/worktree-sessions.d.ts +21 -0
  30. package/dist/{boot-auto-thin-MANHOYHE.js → boot-auto-thin-6Q56FY3F.js} +3 -2
  31. package/dist/boot-provider-selection.d.ts +67 -0
  32. package/dist/boot.d.ts +1 -38
  33. package/dist/{chunk-JY52HWL6.js → chunk-2EBVTYJR.js} +2 -2
  34. package/dist/{chunk-RDHFXOJM.js → chunk-2ERX3RPN.js} +112 -65
  35. package/dist/chunk-4TVYGG6G.js +62 -0
  36. package/dist/chunk-5JYDKG5B.js +154 -0
  37. package/dist/{chunk-KEPABQYT.js → chunk-5SEYGOCH.js} +8 -82
  38. package/dist/{chunk-3VXYY5JC.js → chunk-5UZBUV2H.js} +3 -19
  39. package/dist/chunk-BBHWW6LR.js +549 -0
  40. package/dist/chunk-BEHGRNOQ.js +58 -0
  41. package/dist/chunk-CZTXF6HY.js +140 -0
  42. package/dist/{chunk-JX6KL7OF.js → chunk-EPR42SWM.js} +39 -8
  43. package/dist/chunk-F5DCFAKI.js +36 -0
  44. package/dist/chunk-HLSHFXTO.js +97 -0
  45. package/dist/{chunk-CJTBLTS4.js → chunk-KJS5543T.js} +4 -3
  46. package/dist/{chunk-DE7BZDNK.js → chunk-KOEO4CJG.js} +27 -4
  47. package/dist/{chunk-SIS37L3W.js → chunk-L2RVEQWO.js} +211 -193
  48. package/dist/chunk-LBPLTTZ6.js +105 -0
  49. package/dist/chunk-LDCGZJTC.js +46 -0
  50. package/dist/chunk-LKPEBZBE.js +143 -0
  51. package/dist/chunk-LUMETJFO.js +171 -0
  52. package/dist/{chunk-KK2LB3ZS.js → chunk-OAVBM55Q.js} +9 -5
  53. package/dist/chunk-PZQBGUVZ.js +18 -0
  54. package/dist/{chunk-C3Z4N6A6.js → chunk-Q4INH2DG.js} +51 -3
  55. package/dist/chunk-R4QGL6GB.js +10 -0
  56. package/dist/{chunk-YLQEGYV4.js → chunk-RZ4ZDRYA.js} +14 -4
  57. package/dist/chunk-S4FFHDJG.js +93 -0
  58. package/dist/chunk-SFBFYIOW.js +271 -0
  59. package/dist/{chunk-RMQNCHGO.js → chunk-TI7KLHYX.js} +136 -11
  60. package/dist/{chunk-2ENZU66X.js → chunk-WQV2NP57.js} +5 -5
  61. package/dist/{chunk-B4JLSXZB.js → chunk-WSTVGC2C.js} +73 -45
  62. package/dist/chunk-X756ZS72.js +329 -0
  63. package/dist/{chunk-XJ7K67PP.js → chunk-YHYINL47.js} +63 -24
  64. package/dist/{chunk-2VMJ3E5Z.js → chunk-YTEOAWOJ.js} +6 -2
  65. package/dist/{chunk-GPPRNAKW.js → chunk-ZMX5HRLI.js} +2 -2
  66. package/dist/{cli-context-33F74CSZ.js → cli-context-UVGAN3NO.js} +496 -384
  67. package/dist/cli-entry-point.d.ts +2 -0
  68. package/dist/{cli-main-FNGMKPBA.js → cli-main-TN3KZ2P6.js} +3561 -2724
  69. package/dist/cli-update-notice.d.ts +2 -1
  70. package/dist/config-doctor.d.ts +10 -2
  71. package/dist/{config-transfer-2YF3CRTN.js → config-transfer-RUWLDCNK.js} +34 -13
  72. package/dist/{diag-doctor-ANPRUYFM.js → diag-doctor-BIZAFIAT.js} +2 -2
  73. package/dist/execute-deps.d.ts +2 -1
  74. package/dist/{execution-A6WJLSOC.js → execution-7QIP6GRY.js} +2384 -2055
  75. package/dist/fleet/host-types.d.ts +3 -1
  76. package/dist/goal-commands.d.ts +47 -0
  77. package/dist/goal-host.d.ts +1 -14
  78. package/dist/{hq-XQWQTRDA.js → hq-GLZ7QESM.js} +277 -261
  79. package/dist/hq-command-controller.d.ts +1 -1
  80. package/dist/{hq-server-IIBZQZU4.js → hq-server-YTKDVQPY.js} +2 -2
  81. package/dist/{hq-service-L5INQFM4.js → hq-service-BMMJAHRT.js} +11 -4
  82. package/dist/import-claude-code-32PCSIQI.js +236 -0
  83. package/dist/index.d.ts +1 -1
  84. package/dist/index.js +19 -10
  85. package/dist/kanban-supervisor-67ECABTD.js +7 -0
  86. package/dist/live-settings-input.d.ts +7 -0
  87. package/dist/{mailbox-serve-3GFOK2I7.js → mailbox-serve-NW5VZG7R.js} +3 -3
  88. package/dist/{mcp-DC5WSBOO.js → mcp-LBS45HWZ.js} +4 -4
  89. package/dist/modeldiag-36VODVIH.js +828 -0
  90. package/dist/{per-subcommand-help-DHTYU524.js → per-subcommand-help-QDAQASPZ.js} +3 -3
  91. package/dist/permission-prompt-mirror.d.ts +1 -1
  92. package/dist/permission-prompt.d.ts +16 -2
  93. package/dist/permission-rules-view.d.ts +18 -0
  94. package/dist/{permissions-CFDLXETM.js → permissions-PL27UHYD.js} +67 -45
  95. package/dist/plugin-config.d.ts +12 -0
  96. package/dist/plugin-management-types.d.ts +31 -0
  97. package/dist/plugin-management.d.ts +2 -30
  98. package/dist/plugin-package-install.d.ts +3 -0
  99. package/dist/{plugin-usage-M6KET4OZ.js → plugin-usage-CIGOOTX3.js} +6 -5
  100. package/dist/{plugins-WJLW6ULV.js → plugins-HQTXUD6A.js} +6 -3
  101. package/dist/preflight.d.ts +1 -1
  102. package/dist/{projects-LMNAGGEU.js → projects-T4CZCA25.js} +3 -6
  103. package/dist/provider-config-utils.d.ts +1 -6
  104. package/dist/provider-helpers.d.ts +7 -11
  105. package/dist/{providers-models-LFNZ5WI7.js → providers-models-5Z2PJTEW.js} +44 -34
  106. package/dist/release-asset-download.d.ts +13 -0
  107. package/dist/release-attestation.d.ts +28 -0
  108. package/dist/remote/remote-session.d.ts +64 -0
  109. package/dist/remote/remote-target.d.ts +69 -0
  110. package/dist/remote-O5WXHLWV.js +561 -0
  111. package/dist/{replay-Z3FTJEMM.js → replay-DEI566CW.js} +2 -2
  112. package/dist/services/commit-message.d.ts +2 -1
  113. package/dist/services/dispatch-classifier.d.ts +39 -5
  114. package/dist/session-move-P2EC2COA.js +44 -0
  115. package/dist/session-move.d.ts +20 -0
  116. package/dist/session-stats.d.ts +10 -0
  117. package/dist/{sessions-config-UL45XKX7.js → sessions-config-SXTTLNXA.js} +47 -9
  118. package/dist/settings-menu.d.ts +2 -0
  119. package/dist/short-circuit-flags-74Y5N6CF.js +10 -0
  120. package/dist/{simpleui-dist-CXSIDAXZ.js → simpleui-dist-7BQISSEP.js} +7 -3
  121. package/dist/skill-suggest-L2EVWB6R.js +290 -0
  122. package/dist/slash-commands/command-context.d.ts +15 -5
  123. package/dist/slash-commands/effort.d.ts +1 -1
  124. package/dist/slash-commands/fallback.d.ts +1 -1
  125. package/dist/slash-commands/gitid.d.ts +1 -1
  126. package/dist/slash-commands/goal-refiner.d.ts +4 -49
  127. package/dist/slash-commands/jev.d.ts +4 -0
  128. package/dist/slash-commands/mcp.d.ts +2 -1
  129. package/dist/slash-commands/openai-quota.d.ts +15 -0
  130. package/dist/slash-commands/permissions.d.ts +4 -0
  131. package/dist/slash-commands/sdd-task-mutations.d.ts +4 -0
  132. package/dist/slash-commands/settings-context-mutations.d.ts +5 -0
  133. package/dist/slash-commands/settings-keys.d.ts +2 -0
  134. package/dist/slash-commands/settings-limits-mutations.d.ts +12 -0
  135. package/dist/slash-commands/settings-reset.d.ts +6 -0
  136. package/dist/standalone-auto-update-TOTRGCSA.js +249 -0
  137. package/dist/standalone-auto-update.d.ts +65 -0
  138. package/dist/standalone-update-LZO3MNLH.js +24 -0
  139. package/dist/standalone-update.d.ts +55 -0
  140. package/dist/subcommands/handlers/hq-alerts.d.ts +3 -0
  141. package/dist/subcommands/handlers/hq-audit.d.ts +46 -0
  142. package/dist/subcommands/handlers/hq-data-dir.d.ts +13 -0
  143. package/dist/subcommands/handlers/import-claude-code.d.ts +42 -0
  144. package/dist/subcommands/handlers/permissions.d.ts +9 -3
  145. package/dist/subcommands/handlers/remote.d.ts +6 -0
  146. package/dist/subcommands/handlers/skill-suggest.d.ts +21 -0
  147. package/dist/subcommands/handlers/typesafe-brain-replay.d.ts +26 -0
  148. package/dist/subcommands/handlers/typesafe-judgment-check.d.ts +3 -0
  149. package/dist/subcommands/handlers/typesafe-topic-replay.d.ts +19 -0
  150. package/dist/subcommands/handlers/typesafe-triage-replay.d.ts +18 -0
  151. package/dist/subcommands/handlers/typesafe.d.ts +23 -0
  152. package/dist/subcommands/handlers/version-help.d.ts +5 -0
  153. package/dist/{subcommands-XSLXMIDP.js → subcommands-Q6ORSB2E.js} +2 -2
  154. package/dist/tui-resume-callback.d.ts +18 -0
  155. package/dist/typesafe-U7YB2RRV.js +316 -0
  156. package/dist/typesafe-brain-replay-C5276FVR.js +222 -0
  157. package/dist/typesafe-judgment-check-GGYYV5UF.js +29 -0
  158. package/dist/typesafe-topic-replay-ZILIU3WS.js +234 -0
  159. package/dist/typesafe-triage-replay-FGAW7QM7.js +215 -0
  160. package/dist/{update-5DPB4YD4.js → update-TDZX4IL2.js} +4 -3
  161. package/dist/{update-check-BS3DHTSI.js → update-check-J5ZVKS73.js} +3 -2
  162. package/dist/update-check.d.ts +1 -1
  163. package/dist/version-JB2UAV2A.js +11 -0
  164. package/dist/version-help-XJJQ7YSH.js +10 -0
  165. package/dist/version.d.ts +3 -2
  166. package/dist/webui-client-observability.d.ts +7 -0
  167. package/dist/webui-server/route-contexts.d.ts +1 -1
  168. package/dist/webui-server/session-start-payload.d.ts +5 -1
  169. package/dist/{webui-server-MRPGTTKL.js → webui-server-YTHLRFD2.js} +577 -370
  170. package/dist/webui-server-lifecycle.d.ts +57 -0
  171. package/dist/webui-server-options.d.ts +11 -0
  172. package/dist/webui-server.d.ts +1 -1
  173. package/dist/wiring/brain-and-orchestration.d.ts +3 -1
  174. package/dist/wiring/cli-prompt-and-tools-setup.d.ts +9 -0
  175. package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
  176. package/dist/wiring/domain-glossary.d.ts +5 -4
  177. package/dist/wiring/lifecycle-plugins.d.ts +4 -2
  178. package/dist/wiring/metrics.d.ts +9 -1
  179. package/dist/wiring/pipeline.d.ts +2 -7
  180. package/dist/wiring/plugins.d.ts +4 -1
  181. package/dist/wiring/provider-persisters.d.ts +24 -0
  182. package/dist/wiring/provider-runtime.d.ts +9 -1
  183. package/dist/wiring/provider-status.d.ts +1 -0
  184. package/dist/wiring/provider-utility-tools.d.ts +3 -1
  185. package/dist/wiring/runtime-dispatch-state.d.ts +3 -1
  186. package/package.json +28 -28
  187. package/dist/chunk-2CZEORLV.js +0 -54
  188. package/dist/chunk-672UXYL3.js +0 -65
  189. package/dist/chunk-6WRKAACA.js +0 -96
  190. package/dist/chunk-DR2OXU46.js +0 -174
  191. package/dist/chunk-JACOMTIH.js +0 -275
  192. package/dist/chunk-XJXDOF63.js +0 -28
  193. package/dist/modeldiag-CJSFHZ3J.js +0 -1356
  194. package/dist/short-circuit-flags-7GQIGMVD.js +0 -10
  195. package/dist/version-help-WXI42PZ3.js +0 -10
@@ -0,0 +1,140 @@
1
+
2
+ // src/context-limit.ts
3
+ import { refreshCatalogIfStale } from "@wrongstack/core/models";
4
+ import { mergeCustomModelDefs, toErrorMessage } from "@wrongstack/core/utils";
5
+ import { capabilitiesFor } from "@wrongstack/providers";
6
+ var SIBLING_CATALOG = {
7
+ "anthropic-oauth": "anthropic",
8
+ "openai-codex": "openai",
9
+ "github-copilot": "openai",
10
+ "google-antigravity": "google"
11
+ };
12
+ async function resolveRuntimeMaxContextDetailed(input) {
13
+ const providerConfig = input.runtimeProviderConfig ?? input.config.providers?.[input.providerId];
14
+ const providerOverride = positiveNumber(readConfiguredMaxContext(providerConfig));
15
+ if (providerOverride) return { maxContext: providerOverride, branch: "provider-override" };
16
+ const catalogId = providerConfig?.type && providerConfig.type !== input.providerId ? providerConfig.type : input.providerId;
17
+ const sibling = providerConfig?.family ? SIBLING_CATALOG[providerConfig.family] : void 0;
18
+ if (sibling && input.modelsRegistry) {
19
+ const mergedModels = mergeCustomModelDefs(providerConfig?.customModels, input.config.models);
20
+ const ownModel = await input.modelsRegistry.getModel(catalogId, input.modelId).catch(() => void 0);
21
+ if (ownModel) {
22
+ const ownCaps = await capabilitiesFor(
23
+ input.modelsRegistry,
24
+ catalogId,
25
+ input.modelId,
26
+ mergedModels
27
+ ).catch(() => void 0);
28
+ const ownMax = positiveNumber(ownCaps?.maxContext) ?? positiveNumber(ownModel.capabilities.maxContext);
29
+ if (ownMax) return { maxContext: ownMax, branch: "catalog-capabilities" };
30
+ }
31
+ const caps = await capabilitiesFor(
32
+ input.modelsRegistry,
33
+ sibling,
34
+ input.modelId,
35
+ mergedModels
36
+ ).catch(() => void 0);
37
+ const siblingMax = positiveNumber(caps?.maxContext);
38
+ if (siblingMax) return { maxContext: siblingMax, branch: "sibling-capabilities" };
39
+ const directModel = await input.modelsRegistry.getModel(sibling, input.modelId).catch(() => void 0);
40
+ const directMax = positiveNumber(directModel?.capabilities.maxContext);
41
+ if (directMax) return { maxContext: directMax, branch: "sibling-direct-model" };
42
+ }
43
+ let divergedFromCatalog = false;
44
+ if (input.modelsRegistry) {
45
+ const topLevelBaseUrlApplies = input.providerId === input.config.provider;
46
+ const configuredBaseUrl = providerConfig?.baseUrl ?? (topLevelBaseUrlApplies ? input.config.baseUrl : void 0);
47
+ let divergesFromCatalog = false;
48
+ if (configuredBaseUrl) {
49
+ const resolved = await safeGetProvider(input.modelsRegistry, catalogId);
50
+ divergesFromCatalog = normalizeBaseUrl(configuredBaseUrl) !== normalizeBaseUrl(resolved?.apiBase);
51
+ }
52
+ divergedFromCatalog = divergesFromCatalog;
53
+ if (!divergesFromCatalog) {
54
+ const mergedModels = mergeCustomModelDefs(providerConfig?.customModels, input.config.models);
55
+ const caps = await capabilitiesFor(
56
+ input.modelsRegistry,
57
+ catalogId,
58
+ input.modelId,
59
+ mergedModels
60
+ ).catch(() => void 0);
61
+ const catalogMax = positiveNumber(caps?.maxContext);
62
+ if (catalogMax) return { maxContext: catalogMax, branch: "catalog-capabilities" };
63
+ const directModel = await input.modelsRegistry.getModel(catalogId, input.modelId).catch(() => void 0);
64
+ const directMax = positiveNumber(directModel?.capabilities.maxContext);
65
+ if (directMax) return { maxContext: directMax, branch: "catalog-direct-model" };
66
+ }
67
+ }
68
+ const explicitContext = positiveNumber(input.config.context?.effectiveMaxContext);
69
+ if (explicitContext) {
70
+ return { maxContext: explicitContext, branch: "explicit-config-fallback" };
71
+ }
72
+ const familyDefault = positiveNumber(input.provider.capabilities.maxContext) ?? 0;
73
+ const branch = familyDefault === 0 ? "unknown" : divergedFromCatalog ? "diverging-baseurl-family-default" : "family-default";
74
+ return { maxContext: familyDefault, branch };
75
+ }
76
+ async function resolveRuntimeMaxContext(input) {
77
+ const { maxContext } = await resolveRuntimeMaxContextDetailed(input);
78
+ return maxContext;
79
+ }
80
+ var SUSPICIOUS_SHRINK_BRANCHES = /* @__PURE__ */ new Set([
81
+ "family-default",
82
+ "diverging-baseurl-family-default"
83
+ ]);
84
+ function describeMaxContextChange(params) {
85
+ const { previous, current, providerId, modelId } = params;
86
+ if (current === previous) return void 0;
87
+ const branch = params.branch ?? "unknown";
88
+ const shrank = previous > 0 && current > 0 && current < previous;
89
+ const suspicious = SUSPICIOUS_SHRINK_BRANCHES.has(branch);
90
+ const detail = `max-context ${previous} \u2192 ${current} for ${providerId}/${modelId} (branch=${branch}${shrank ? ", DECREASED" : ""})`;
91
+ return shrank && suspicious ? {
92
+ level: "warn",
93
+ message: `Context window shrank via a non-catalog branch: ${detail}`,
94
+ shrank,
95
+ branch
96
+ } : { level: "debug", message: detail, shrank, branch };
97
+ }
98
+ async function refreshRuntimeModelCatalog(input) {
99
+ if (!input.modelsRegistry) return false;
100
+ try {
101
+ if (await refreshCatalogIfStale(input.modelsRegistry) === "recent") return false;
102
+ input.logger?.debug?.(
103
+ `models.dev catalog refreshed${input.reason ? ` (${input.reason})` : ""}`
104
+ );
105
+ return true;
106
+ } catch (err) {
107
+ input.logger?.warn?.(
108
+ `models.dev refresh failed${input.reason ? ` (${input.reason})` : ""}: ${toErrorMessage(err)}; using cached catalog`
109
+ );
110
+ return false;
111
+ }
112
+ }
113
+ async function safeGetProvider(registry, id) {
114
+ try {
115
+ return await registry.getProvider(id);
116
+ } catch {
117
+ return void 0;
118
+ }
119
+ }
120
+ function normalizeBaseUrl(url) {
121
+ if (!url) return "";
122
+ return url.trim().toLowerCase().replace(/\/+$/, "");
123
+ }
124
+ function readConfiguredMaxContext(providerConfig) {
125
+ if (!providerConfig || typeof providerConfig !== "object") return void 0;
126
+ const capabilities = providerConfig.capabilities;
127
+ if (!capabilities || typeof capabilities !== "object") return void 0;
128
+ return capabilities.maxContext;
129
+ }
130
+ function positiveNumber(value) {
131
+ return typeof value === "number" && Number.isFinite(value) && value > 0 ? value : void 0;
132
+ }
133
+
134
+ export {
135
+ resolveRuntimeMaxContextDetailed,
136
+ resolveRuntimeMaxContext,
137
+ describeMaxContextChange,
138
+ refreshRuntimeModelCatalog
139
+ };
140
+ //# sourceMappingURL=chunk-CZTXF6HY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  renderAuthLocalHelpToString
3
- } from "./chunk-2VMJ3E5Z.js";
3
+ } from "./chunk-YTEOAWOJ.js";
4
4
 
5
5
  // src/subcommands/handlers/per-subcommand-help.ts
6
6
  import { color as color3 } from "@wrongstack/core/utils";
@@ -780,10 +780,11 @@ var helpTable = {
780
780
  name: "config",
781
781
  title: "wstack config \u2014 show or edit effective config",
782
782
  description: "Print the resolved config (with the on-disk overrides merged on top), or open the active profile config in $EDITOR for interactive edits. Also exposes a small audit log of recent config-history changes for diagnostics.",
783
- usage: "wstack config [show|edit|history|restore] [...]",
783
+ usage: "wstack config [show|edit|backup|history|restore] [...]",
784
784
  subcommands: [
785
785
  { name: "show", description: "Print the resolved config to stdout (default)." },
786
786
  { name: "edit", description: "Open the active profile config in $EDITOR." },
787
+ { name: "backup", description: "Create a recoverable snapshot of the active profile." },
787
788
  { name: "history", description: "List recent config-history entries." },
788
789
  { name: "restore <id>", description: "Restore a previous config-history entry." }
789
790
  ],
@@ -816,7 +817,7 @@ var helpTable = {
816
817
  name: "sessions",
817
818
  title: "wstack sessions \u2014 list and resume recent sessions",
818
819
  description: "List recent sessions, show one session in detail, resume a session, or inspect a session's audit log. The audit log is stored as JSONL next to each session's recording.",
819
- usage: "wstack sessions [list|show|resume|fork|doctor|config|fleet] [...]",
820
+ usage: "wstack sessions [list|show|resume|fork|move|doctor|config|fleet] [...]",
820
821
  subcommands: [
821
822
  { name: "list", description: "List the most recent sessions." },
822
823
  {
@@ -829,6 +830,10 @@ var helpTable = {
829
830
  name: "fork [<id>] [--to N]",
830
831
  description: "Create an isolated child journal at a persisted boundary."
831
832
  },
833
+ {
834
+ name: "move <id> --to <path>",
835
+ description: "Move a closed session to another git worktree of this repository, or to another project (its journal moves to that project)."
836
+ },
832
837
  { name: "config", description: "Show or edit session-specific config." },
833
838
  { name: "fleet", description: "List the active fleet of sessions." }
834
839
  ],
@@ -958,6 +963,13 @@ var helpTable = {
958
963
  usage: "wstack update [--check-only] [--pm <manager>] [--allow-scripts (alias: --lifecycle-scripts)]",
959
964
  seeAlso: "wstack version (read-only version info)"
960
965
  },
966
+ remote: {
967
+ name: "remote",
968
+ title: "wstack remote \u2014 run WrongStack on another machine over SSH",
969
+ description: "Runs WrongStack on the remote machine, in the given project directory, and opens its WebUI here through an SSH tunnel; the agent, its tools and its daemons run remotely. The system ssh is used, so ~/.ssh/config, your agent and known_hosts apply. The matching build is uploaded once per version to ~/.wrongstack/remote and checked by SHA-256. A dropped connection is reopened; the remote host keeps running meanwhile. Nothing from your local configuration is copied: set up a provider in the remote WebUI the first time.",
970
+ usage: "wstack remote <user@host:/path | ssh://user@host:port/path> [--port <n>] [--open] [--keep] [--ssh-config <file>] [--remote-binary <file>]",
971
+ seeAlso: "wstack --remote <target> (same command)"
972
+ },
961
973
  // -- ACP (Agent Client Protocol) --------------------------------------
962
974
  acp: {
963
975
  name: "acp",
@@ -1079,13 +1091,17 @@ var helpTable = {
1079
1091
  // -- Permissions ────────────────────────────────────────────────────
1080
1092
  permissions: {
1081
1093
  name: "permissions",
1082
- title: "wstack permissions \u2014 explain tool permission decisions",
1083
- description: "Side-effect-free permission decision explainer. Evaluates the effective permission rules for a tool and input arguments without prompting, modifying trust files, or mutating state.",
1084
- usage: "wstack permissions explain <tool> [--input '<json>'] [--json]",
1094
+ title: "wstack permissions \u2014 list and explain the permission rules",
1095
+ description: "Side-effect-free views of the permission policy the agent runs under: every rule in the order it is checked, and how one tool call is decided, without prompting, modifying trust files, or mutating state. Inside a session, /permissions also sets allow/deny rules for that session only.",
1096
+ usage: "wstack permissions [rules|explain <tool> [--input '<json>']] [--json]",
1085
1097
  subcommands: [
1098
+ {
1099
+ name: "rules",
1100
+ description: "List every permission rule, in the order they are checked (first match decides)."
1101
+ },
1086
1102
  {
1087
1103
  name: "explain <tool>",
1088
- description: "Explain how the permission policy evaluates a tool call."
1104
+ description: "Explain how the permission policy decides a tool call, and name the rule."
1089
1105
  }
1090
1106
  ],
1091
1107
  seeAlso: "wstack tools (list available tools)"
@@ -1111,6 +1127,21 @@ var helpTable = {
1111
1127
  subcommands: [{ name: "status", description: "Show daemon and attachment-broker health." }],
1112
1128
  seeAlso: "wstack doctor (broader environment diagnostics)"
1113
1129
  },
1130
+ "import-claude-code": {
1131
+ name: "import-claude-code",
1132
+ title: "wstack import-claude-code \u2014 bring a Claude Code setup across",
1133
+ description: "Import MCP servers from ~/.claude.json (user + this project) and the repository's .mcp.json into the active profile. Previews by default. Repository servers arrive disabled unless --enable-project-servers. Skills are read in place; hooks, permission rules and CLAUDE.md are reported with next steps, not translated.",
1134
+ usage: "wstack import-claude-code [--apply] [--overwrite] [--enable-project-servers]",
1135
+ subcommands: [
1136
+ { name: "--apply", description: "Write the plan (default: preview only)." },
1137
+ { name: "--overwrite", description: "Replace servers that already exist by name." },
1138
+ {
1139
+ name: "--enable-project-servers",
1140
+ description: "Enable the repository's .mcp.json servers on import."
1141
+ }
1142
+ ],
1143
+ seeAlso: "wstack mcp list; --mcp-config (one-off servers without importing)"
1144
+ },
1114
1145
  // -- Chronicle ──────────────────────────────────────────────────────
1115
1146
  chronicle: {
1116
1147
  name: "chronicle",
@@ -1212,4 +1243,4 @@ export {
1212
1243
  subcommandsWithFocusedHelp,
1213
1244
  renderGenericHelp
1214
1245
  };
1215
- //# sourceMappingURL=chunk-JX6KL7OF.js.map
1246
+ //# sourceMappingURL=chunk-EPR42SWM.js.map
@@ -0,0 +1,36 @@
1
+
2
+ // src/version.ts
3
+ import { createRequire } from "node:module";
4
+ var req = createRequire(import.meta.url);
5
+ var standaloneBuild = globalThis[/* @__PURE__ */ Symbol.for("wrongstack.standalone-build")];
6
+ function readOwnVersion() {
7
+ if (standaloneBuild?.version) return standaloneBuild.version;
8
+ const candidates = ["../package.json", "../../package.json"];
9
+ for (const rel of candidates) {
10
+ try {
11
+ const pkg = req(rel);
12
+ if (typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
13
+ } catch {
14
+ }
15
+ }
16
+ return "dev";
17
+ }
18
+ var CLI_VERSION = readOwnVersion();
19
+ function readApiVersion() {
20
+ if (standaloneBuild?.apiVersion) return standaloneBuild.apiVersion;
21
+ try {
22
+ const corePkg = req("@wrongstack/core/package.json");
23
+ if (corePkg.wrongstackApiVersion) return corePkg.wrongstackApiVersion;
24
+ } catch {
25
+ }
26
+ return "0.0.0";
27
+ }
28
+ var API_VERSION = readApiVersion();
29
+ var STANDALONE_TARGET = standaloneBuild?.target;
30
+
31
+ export {
32
+ CLI_VERSION,
33
+ API_VERSION,
34
+ STANDALONE_TARGET
35
+ };
36
+ //# sourceMappingURL=chunk-F5DCFAKI.js.map
@@ -0,0 +1,97 @@
1
+
2
+ // src/boot/mcp-config-flag.ts
3
+ import * as fs from "node:fs/promises";
4
+ import * as path from "node:path";
5
+ function isRecord(value) {
6
+ return typeof value === "object" && value !== null && !Array.isArray(value);
7
+ }
8
+ function stringRecord(value, where) {
9
+ if (value === void 0) return void 0;
10
+ if (!isRecord(value) || Object.values(value).some((v) => typeof v !== "string")) {
11
+ throw new Error(`${where} must be an object of strings`);
12
+ }
13
+ return value;
14
+ }
15
+ function normalizeMcpServerEntry(name, raw) {
16
+ if (!isRecord(raw)) throw new Error(`server "${name}" must be an object`);
17
+ const where = `server "${name}"`;
18
+ const { type, transport: rawTransport, ...rest } = raw;
19
+ let transport;
20
+ if (rawTransport !== void 0) {
21
+ if (rawTransport !== "stdio" && rawTransport !== "sse" && rawTransport !== "streamable-http") {
22
+ throw new Error(`${where}: unknown transport "${String(rawTransport)}"`);
23
+ }
24
+ transport = rawTransport;
25
+ } else if (type !== void 0) {
26
+ if (type === "http") transport = "streamable-http";
27
+ else if (type === "sse" || type === "stdio") transport = type;
28
+ else throw new Error(`${where}: unknown type "${String(type)}"`);
29
+ } else if (typeof rest["command"] === "string") {
30
+ transport = "stdio";
31
+ }
32
+ if (transport === "stdio" && typeof rest["command"] !== "string") {
33
+ throw new Error(`${where}: stdio needs a "command"`);
34
+ }
35
+ if ((transport === "sse" || transport === "streamable-http") && typeof rest["url"] !== "string") {
36
+ throw new Error(`${where}: ${transport} needs a "url"`);
37
+ }
38
+ if (rest["args"] !== void 0 && !Array.isArray(rest["args"])) {
39
+ throw new Error(`${where}: "args" must be an array`);
40
+ }
41
+ const env = stringRecord(rest["env"], `${where} "env"`);
42
+ const headers = stringRecord(rest["headers"], `${where} "headers"`);
43
+ return {
44
+ ...rest,
45
+ ...transport ? { transport } : {},
46
+ ...env ? { env } : {},
47
+ ...headers ? { headers } : {}
48
+ };
49
+ }
50
+ function parseLaunchMcpServers(text, source) {
51
+ let doc;
52
+ try {
53
+ doc = JSON.parse(text);
54
+ } catch (err) {
55
+ throw new Error(`--mcp-config: ${source} is not valid JSON (${err.message})`);
56
+ }
57
+ if (!isRecord(doc)) throw new Error(`--mcp-config: ${source} must be a JSON object`);
58
+ const servers = isRecord(doc["mcpServers"]) ? doc["mcpServers"] : doc;
59
+ const out = {};
60
+ for (const [name, raw] of Object.entries(servers)) {
61
+ try {
62
+ out[name] = { ...normalizeMcpServerEntry(name, raw), enabled: true };
63
+ } catch (err) {
64
+ throw new Error(`--mcp-config: ${source}: ${err.message}`);
65
+ }
66
+ }
67
+ return out;
68
+ }
69
+ async function resolveLaunchMcpServers(flags, cwd) {
70
+ const value = flags["mcp-config"];
71
+ if (value === void 0) return void 0;
72
+ if (typeof value !== "string" || !value.trim()) {
73
+ throw new Error("--mcp-config needs a JSON file path or an inline JSON object");
74
+ }
75
+ const trimmed = value.trim();
76
+ if (trimmed.startsWith("{")) return parseLaunchMcpServers(trimmed, "inline JSON");
77
+ const file = path.resolve(cwd, trimmed);
78
+ let text;
79
+ try {
80
+ text = await fs.readFile(file, "utf8");
81
+ } catch (err) {
82
+ const reason = err.code ?? String(err);
83
+ throw new Error(`--mcp-config: cannot read ${file} (${reason})`);
84
+ }
85
+ return parseLaunchMcpServers(text, file);
86
+ }
87
+ function effectiveMcpServers(configured, launch, strict) {
88
+ return { ...strict ? {} : configured ?? {}, ...launch ?? {} };
89
+ }
90
+
91
+ export {
92
+ normalizeMcpServerEntry,
93
+ parseLaunchMcpServers,
94
+ resolveLaunchMcpServers,
95
+ effectiveMcpServers
96
+ };
97
+ //# sourceMappingURL=chunk-HLSHFXTO.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CLI_VERSION
3
- } from "./chunk-XJXDOF63.js";
3
+ } from "./chunk-F5DCFAKI.js";
4
4
 
5
5
  // src/hq-publisher.ts
6
6
  import { createHqPublisherFromEnv, resolveHqConfig } from "@wrongstack/core/hq";
@@ -10,6 +10,7 @@ import { WebSocket } from "ws";
10
10
  import {
11
11
  deriveHqProjectId,
12
12
  MAX_HQ_KANBAN_BOARD_BYTES,
13
+ MAX_HQ_KANBAN_BOARDS,
13
14
  redactHqEventPayload
14
15
  } from "@wrongstack/core/hq";
15
16
  import {
@@ -337,7 +338,7 @@ function chunkSnapshotPayload(projectId, generatedAt, boards, tombstones) {
337
338
  { code: "WRONGSTACK_HQ_KANBAN_OVERSIZED_RECORD" }
338
339
  );
339
340
  }
340
- if ((currentBoards.length > 0 || currentTombstones.length > 0) && currentBytes + additionalBytes > MAX_KANBAN_SNAPSHOT_PAYLOAD_BYTES) {
341
+ if ((currentBoards.length > 0 || currentTombstones.length > 0) && (currentBytes + additionalBytes > MAX_KANBAN_SNAPSHOT_PAYLOAD_BYTES || itemCount >= MAX_HQ_KANBAN_BOARDS)) {
341
342
  pushCurrent();
342
343
  }
343
344
  if (kind === "boards") {
@@ -517,4 +518,4 @@ function startCliHqConnection(options) {
517
518
  export {
518
519
  startCliHqConnection
519
520
  };
520
- //# sourceMappingURL=chunk-CJTBLTS4.js.map
521
+ //# sourceMappingURL=chunk-KJS5543T.js.map
@@ -3,12 +3,13 @@ import {
3
3
  } from "./chunk-U3SS4NRH.js";
4
4
  import {
5
5
  checkForUpdate
6
- } from "./chunk-YLQEGYV4.js";
6
+ } from "./chunk-RZ4ZDRYA.js";
7
7
 
8
8
  // src/subcommands/handlers/update.ts
9
9
  import { spawn } from "node:child_process";
10
10
  import { existsSync, realpathSync } from "node:fs";
11
11
  import * as path from "node:path";
12
+ import { isStandaloneBinary } from "@wrongstack/core/utils";
12
13
  var MAX_UPDATE_OUTPUT_CHARS = 256 * 1024;
13
14
  async function runUpdateCommand(args, deps) {
14
15
  const cwd = deps.cwd;
@@ -20,6 +21,8 @@ async function runUpdateCommand(args, deps) {
20
21
  (flag) => ![
21
22
  "check-only",
22
23
  "c",
24
+ // `-c` after the top-level parser's expansion; see mergeUpdateArgs.
25
+ "continue",
23
26
  "pm",
24
27
  "package-manager",
25
28
  "allow-scripts",
@@ -55,7 +58,7 @@ async function runUpdateCommand(args, deps) {
55
58
  });
56
59
  if (info.checkFailed) {
57
60
  deps.renderer.write(
58
- `Update check failed for ${packageName}. Check your internet connection and try again.
61
+ `Update check failed for ${isStandaloneBinary() ? "the GitHub releases" : packageName}. Check your internet connection and try again.
59
62
  `
60
63
  );
61
64
  return 1;
@@ -75,6 +78,26 @@ async function runUpdateCommand(args, deps) {
75
78
  `);
76
79
  return 0;
77
80
  }
81
+ if (isStandaloneBinary()) {
82
+ const [{ updateStandaloneBinary }, { standaloneUpdater }, { STANDALONE_TARGET }] = await Promise.all([
83
+ import("./standalone-update-LZO3MNLH.js"),
84
+ import("./standalone-auto-update-TOTRGCSA.js"),
85
+ import("./version-JB2UAV2A.js")
86
+ ]);
87
+ const updater = standaloneUpdater({
88
+ executable: realpathSync(process.execPath),
89
+ target: STANDALONE_TARGET ?? "",
90
+ current: info.current
91
+ });
92
+ const code = await updateStandaloneBinary({
93
+ current: info.current,
94
+ renderer: deps.renderer,
95
+ // A build the background updater already downloaded and verified.
96
+ staged: updater.pending()
97
+ });
98
+ if (code === 0) updater.clear();
99
+ return code;
100
+ }
78
101
  const packageManager = parsed.packageManager ?? detectUpdatePackageManager();
79
102
  let updateCommand;
80
103
  try {
@@ -176,7 +199,7 @@ function mergeUpdateArgs(args, flags) {
176
199
  if (flags[name] === true || flags[name] === "true") merged.push(`--${alias}`);
177
200
  };
178
201
  addBoolean("check-only");
179
- if (flags["c"] === true || flags["c"] === "true") merged.push("-c");
202
+ if (flags["continue"] === true || flags["c"] === true || flags["c"] === "true") merged.push("-c");
180
203
  addBoolean("allow-scripts");
181
204
  addBoolean("lifecycle-scripts");
182
205
  for (const pm of ["npm", "pnpm", "yarn", "bun"]) addBoolean(pm);
@@ -383,4 +406,4 @@ export {
383
406
  detectUpdatePackageManager,
384
407
  detectUpdatePackageName
385
408
  };
386
- //# sourceMappingURL=chunk-DE7BZDNK.js.map
409
+ //# sourceMappingURL=chunk-KOEO4CJG.js.map