@wrongstack/cli 0.319.1 → 1.0.1

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 (105) hide show
  1. package/data/providers.json +22 -15
  2. package/dist/{acp-5ANIAOZC.js → acp-3LARESEO.js} +113 -10
  3. package/dist/acp-hq-telemetry.d.ts +44 -0
  4. package/dist/{audit-ZPCLCC3C.js → audit-46YK5DSC.js} +1 -2
  5. package/dist/{auth-ND7J7DTD.js → auth-ZUMCDNE5.js} +6 -7
  6. package/dist/auth-menu/add-provider.d.ts +7 -0
  7. package/dist/auth-menu/panel-service.d.ts +2 -20
  8. package/dist/{auto-discover-providers-MHFLDSD3.js → auto-discover-providers-VQU3IZMR.js} +1 -2
  9. package/dist/{bench-XYG56AMO.js → bench-YBU6BVQP.js} +175 -35
  10. package/dist/boot/brain-decision-log.d.ts +22 -2
  11. package/dist/boot/system-prompt-menu.d.ts +7 -0
  12. package/dist/{boot-auto-thin-BZ675EVT.js → boot-auto-thin-MANHOYHE.js} +1 -2
  13. package/dist/{chronicle-6EPPMUC5.js → chronicle-UTFETHP6.js} +1 -2
  14. package/dist/{chunk-HF5VQWIY.js → chunk-5IA5337I.js} +3 -3
  15. package/dist/{chunk-TALOKMIC.js → chunk-C2E24IXZ.js} +31 -15
  16. package/dist/chunk-D2VCUN7M.js +54 -0
  17. package/dist/{chunk-XPX432BZ.js → chunk-DR2OXU46.js} +50 -39
  18. package/dist/{chunk-GGGUZSAU.js → chunk-E6RFXHWD.js} +18 -13
  19. package/dist/{chunk-TYO2OVAD.js → chunk-EWKESL4L.js} +8 -4
  20. package/dist/{chunk-QAC263FZ.js → chunk-FPIWTJ2G.js} +2 -3
  21. package/dist/{chunk-7YLN7YUA.js → chunk-IMWXXF4J.js} +61 -9
  22. package/dist/{chunk-LIWVIEZM.js → chunk-KHWDTNBZ.js} +5 -5
  23. package/dist/{chunk-IMT6PNV5.js → chunk-MNQQ4ZNF.js} +26 -22
  24. package/dist/{chunk-P2OKBDCH.js → chunk-MXEJEYT7.js} +53 -14
  25. package/dist/{chunk-PCBJSXYV.js → chunk-O4A3HHKD.js} +2 -2
  26. package/dist/{chunk-XYKYXFEE.js → chunk-TE3Q32JP.js} +10 -4
  27. package/dist/{chunk-635WW3II.js → chunk-TEBMCYZN.js} +67 -18
  28. package/dist/{chunk-E4I2TF5S.js → chunk-TNK6237M.js} +2 -2
  29. package/dist/chunk-UQUYBDMG.js +51 -0
  30. package/dist/{chunk-F5GA2QW2.js → chunk-ZSZ3EYWH.js} +2 -2
  31. package/dist/{cli-context-K73EIND5.js → cli-context-7X3M6U73.js} +59 -308
  32. package/dist/{cli-main-QXSKKANW.js → cli-main-53KG6HAV.js} +972 -293
  33. package/dist/config-transfer-2YF3CRTN.js +99 -0
  34. package/dist/{diag-doctor-QZVKUAE5.js → diag-doctor-7LYUYU35.js} +1 -2
  35. package/dist/execute-deps.d.ts +5 -1
  36. package/dist/{execution-7ZFY4FJY.js → execution-MIBWBYB6.js} +52 -35
  37. package/dist/{export-ROG3DKTZ.js → export-VVRIOWFV.js} +1 -2
  38. package/dist/{governance-JSGHHA2R.js → governance-RYSHV675.js} +1 -2
  39. package/dist/{hq-4QQJO2GN.js → hq-IG3YRGCO.js} +2 -3
  40. package/dist/hq-command-controller.d.ts +37 -7
  41. package/dist/hq-server/ws.d.ts +1 -1
  42. package/dist/{hq-server-CVAYICIS.js → hq-server-OILU3NPI.js} +2 -3
  43. package/dist/{hq-ttl-KUO3AU7X.js → hq-ttl-VJR65OBJ.js} +1 -2
  44. package/dist/{hq-tunnel-LO55RCZE.js → hq-tunnel-NIJ5EP2Y.js} +1 -2
  45. package/dist/index.js +5 -6
  46. package/dist/{init-4JQSG66Q.js → init-DRMMFG2G.js} +1 -2
  47. package/dist/{kanban-run-mirror-EKVNGXWW.js → kanban-run-mirror-22HQ5FNG.js} +1 -2
  48. package/dist/live-settings-input.d.ts +2 -0
  49. package/dist/{mailbox-serve-VKQIRCCB.js → mailbox-serve-VUCWZ2SJ.js} +2 -3
  50. package/dist/{mcp-AQKSASHD.js → mcp-HOMLC4WE.js} +1 -2
  51. package/dist/{modeldiag-ZL4ROTQ5.js → modeldiag-FMJT37SN.js} +2 -3
  52. package/dist/{per-subcommand-help-6VCIKDUW.js → per-subcommand-help-BWBHYVJO.js} +2 -3
  53. package/dist/{permissions-2PWBL4YU.js → permissions-CFDLXETM.js} +1 -2
  54. package/dist/{plugin-usage-7WCZW4NP.js → plugin-usage-HFBI3TFT.js} +2 -3
  55. package/dist/{plugins-7N3TF2QF.js → plugins-PZ2VZL7V.js} +4 -5
  56. package/dist/{project-BLQ3ALVL.js → project-AOQI5XTK.js} +1 -2
  57. package/dist/{project-manifest-RV5FXGQI.js → project-manifest-7NSFVBM3.js} +1 -2
  58. package/dist/{project-picker-CCQR3W4I.js → project-picker-SVBXMPKX.js} +1 -2
  59. package/dist/{projects-5J727S4L.js → projects-L6C6XLDY.js} +1 -2
  60. package/dist/provider-config-utils.d.ts +1 -1
  61. package/dist/{providers-models-OKKQZIWU.js → providers-models-YVMVYWRS.js} +3 -4
  62. package/dist/{proxy-wiring-QCI7EWQC.js → proxy-wiring-MGRSKZZB.js} +1 -2
  63. package/dist/{quick-XLYLZX4B.js → quick-CNB4Z3HS.js} +1 -2
  64. package/dist/{replay-RZXZKP2U.js → replay-JJ2NOWD6.js} +1 -2
  65. package/dist/{replay-FJ2JBXUA.js → replay-Z3FTJEMM.js} +1 -2
  66. package/dist/{rewind-2FFNOOKS.js → rewind-JA3ZLCNM.js} +1 -2
  67. package/dist/{sdd-runtime-R6FAK2G2.js → sdd-runtime-PTOSPYI4.js} +1 -2
  68. package/dist/services/statusline-config.d.ts +43 -13
  69. package/dist/{sessions-config-KAMEBVOX.js → sessions-config-UL45XKX7.js} +2 -3
  70. package/dist/{sessions-doctor-EXHAZSSE.js → sessions-doctor-QUL37U32.js} +1 -2
  71. package/dist/settings-behavior-sections.d.ts +20 -0
  72. package/dist/short-circuit-flags-UREFSYBL.js +10 -0
  73. package/dist/{simpleui-dist-JKNRCRRK.js → simpleui-dist-CXSIDAXZ.js} +1 -2
  74. package/dist/slash-commands/command-context.d.ts +10 -0
  75. package/dist/slash-commands/statusline.d.ts +1 -1
  76. package/dist/subcommands/handlers/bench-run-config.d.ts +18 -0
  77. package/dist/subcommands/handlers/bench.d.ts +8 -7
  78. package/dist/subcommands/handlers/config-transfer.d.ts +6 -0
  79. package/dist/subcommands-WJLBHVKC.js +9 -0
  80. package/dist/{tools-skills-Q4P27URS.js → tools-skills-GH24UCBY.js} +1 -2
  81. package/dist/{update-K45CS6SS.js → update-5DPB4YD4.js} +1 -2
  82. package/dist/{update-check-PKSMSMD6.js → update-check-BS3DHTSI.js} +1 -2
  83. package/dist/version-help-MYKF724O.js +10 -0
  84. package/dist/webui-server/client-registration.d.ts +9 -1
  85. package/dist/{webui-server-F7MSRHOF.js → webui-server-5R35BHWZ.js} +54 -15
  86. package/dist/wiring/brain-and-orchestration.d.ts +2 -0
  87. package/dist/wiring/cli-execute-builder.d.ts +4 -0
  88. package/dist/wiring/cli-slash-commands-setup.d.ts +1 -0
  89. package/dist/wiring/command-host-state.d.ts +50 -5
  90. package/dist/wiring/external-plugins.d.ts +9 -0
  91. package/dist/wiring/provider-runtime-setup.d.ts +2 -0
  92. package/dist/wiring/runtime-controller-deps.d.ts +3 -0
  93. package/dist/wiring/vector-memory-setup.d.ts +12 -0
  94. package/dist/wiring/wrongtrace-prompt-contributor.d.ts +5 -2
  95. package/dist/{wrongtrace-gate-counters-GSVY372D.js → wrongtrace-gate-counters-7C2EAAZL.js} +1 -2
  96. package/dist/{wrongtrace-telemetry-KBBM5NLQ.js → wrongtrace-telemetry-3ASFKOZO.js} +1 -2
  97. package/package.json +28 -28
  98. package/dist/chunk-7OCVIDC7.js +0 -11
  99. package/dist/chunk-KYDJJLJI.js +0 -52
  100. package/dist/launch-hints.d.ts +0 -49
  101. package/dist/short-circuit-flags-7YUCERBB.js +0 -11
  102. package/dist/subcommands-KE6MEQQP.js +0 -10
  103. package/dist/version-help-WMPSEL4U.js +0 -11
  104. package/dist/webui-server/privileged-actions.d.ts +0 -14
  105. package/dist/wiring/cli-heap-watchdog.d.ts +0 -34
@@ -1,7 +1,7 @@
1
1
 
2
2
  // src/wiring/external-plugins.ts
3
- import { fileURLToPath, pathToFileURL } from "node:url";
4
3
  import { isAbsolute, join, resolve } from "node:path";
4
+ import { fileURLToPath, pathToFileURL } from "node:url";
5
5
  import {
6
6
  defaultPluginTrustPath,
7
7
  discoverExternalPlugins,
@@ -13,6 +13,12 @@ import {
13
13
  resolvePluginTarget,
14
14
  verifyPluginTrust
15
15
  } from "@wrongstack/core/plugin";
16
+ function resolveExternalPluginTrustMode(raw) {
17
+ if (raw === false) return "off";
18
+ if (raw === "required") return "required";
19
+ if (raw === "advisory") return "advisory";
20
+ return "tofu";
21
+ }
16
22
  function normalizeConfigPath(raw, projectRoot) {
17
23
  if (raw.startsWith("file:")) return fileURLToPath(raw);
18
24
  return isAbsolute(raw) ? raw : resolve(projectRoot, raw);
@@ -50,15 +56,36 @@ async function loadExternalPlugins(ctx, hooks) {
50
56
  const { config, log } = ctx;
51
57
  if (config.features?.plugins === false) return [];
52
58
  const importModule = ctx.importModule ?? ((url) => import(url));
53
- const trustEnabled = config.features?.pluginsTrust !== false && (ctx.globalRoot !== void 0 || ctx.trustStorePath !== void 0);
59
+ const trustMode = resolveExternalPluginTrustMode(config.features?.pluginsTrust);
60
+ if (trustMode === "required" && ctx.globalRoot === void 0 && ctx.trustStorePath === void 0) {
61
+ log.error(
62
+ '[plugins] features.pluginsTrust is "required" but no trust store location is available (no globalRoot) \u2014 refusing all external plugins. Configure a global root, or set features.pluginsTrust to "tofu"/"advisory".'
63
+ );
64
+ return [];
65
+ }
66
+ const trustEnabled = trustMode !== "off";
54
67
  const trustStorePath = ctx.trustStorePath ?? (ctx.globalRoot !== void 0 ? defaultPluginTrustPath(ctx.globalRoot) : void 0);
55
68
  let trustStore;
56
- if (trustEnabled && trustStorePath !== void 0) {
69
+ let trustUsable = trustEnabled && trustStorePath !== void 0;
70
+ if (trustEnabled && !trustUsable) {
71
+ log.warn(
72
+ "[plugins] features.pluginsTrust is enabled but no trust store location is available (no globalRoot) \u2014 external plugins load WITHOUT integrity checks. Configure a global root to enable trust-on-first-use."
73
+ );
74
+ }
75
+ if (trustUsable && trustStorePath !== void 0) {
57
76
  try {
58
77
  trustStore = await readPluginTrustStore(trustStorePath);
59
78
  } catch (err) {
60
- log.error(`[plugins] ${err instanceof Error ? err.message : String(err)}`);
61
- return [];
79
+ const message = err instanceof Error ? err.message : String(err);
80
+ if (trustMode === "advisory") {
81
+ log.warn(
82
+ `[plugins] trust store unreadable (${message}) \u2014 features.pluginsTrust is 'advisory', loading external plugins WITHOUT integrity checks`
83
+ );
84
+ trustUsable = false;
85
+ } else {
86
+ log.error(`[plugins] ${message}`);
87
+ return [];
88
+ }
62
89
  }
63
90
  }
64
91
  const sources = [];
@@ -141,18 +168,25 @@ async function loadExternalPlugins(ctx, hooks) {
141
168
  const seenNames = /* @__PURE__ */ new Set();
142
169
  for (const source of sources) {
143
170
  const entryPath = source.kind === "spec" ? resolveSpecifierEntry(source.spec) : source.entryPath;
144
- if (trustEnabled && trustStorePath !== void 0 && entryPath !== void 0) {
171
+ if (trustUsable && trustStorePath !== void 0 && entryPath !== void 0) {
145
172
  const gate = await gateExternalPluginTrust({
146
173
  entryPath,
147
174
  spec: source.spec,
148
175
  label: source.label,
149
176
  store: trustStore,
150
177
  storePath: trustStorePath,
178
+ mode: trustMode,
151
179
  log
152
180
  });
153
181
  if (!gate.ok) continue;
154
182
  if (gate.pinned) trustStore = gate.store;
155
- } else if (trustEnabled && trustStorePath !== void 0 && entryPath === void 0) {
183
+ } else if (trustUsable && entryPath === void 0) {
184
+ if (trustMode === "required") {
185
+ log.error(
186
+ `[plugins] REFUSING external plugin "${source.label}" \u2014 features.pluginsTrust is 'required' and its entry file could not be resolved pre-import (spec "${source.spec}"). Install it so its entry file resolves, or load it by explicit path.`
187
+ );
188
+ continue;
189
+ }
156
190
  log.warn(
157
191
  `[plugins] trust check skipped for "${source.label}" \u2014 entry file could not be resolved pre-import`
158
192
  );
@@ -189,16 +223,21 @@ async function loadExternalPlugins(ctx, hooks) {
189
223
  return loaded;
190
224
  }
191
225
  async function gateExternalPluginTrust(args) {
192
- const { spec, label, store, storePath, log } = args;
226
+ const { spec, label, store, storePath, mode, log } = args;
193
227
  const entryPath = normalizeTrustKey(args.entryPath);
194
228
  if (!store) return { ok: true, pinned: false };
195
229
  let integrity;
196
230
  try {
197
231
  integrity = await hashFileContents(entryPath);
198
232
  } catch (err) {
199
- log.warn(
200
- `[plugins] trust check skipped for "${label}" \u2014 entry could not be read (${err instanceof Error ? err.message : String(err)})`
201
- );
233
+ const message = err instanceof Error ? err.message : String(err);
234
+ if (mode === "required") {
235
+ log.error(
236
+ `[plugins] REFUSING external plugin "${label}" \u2014 features.pluginsTrust is 'required' and its entry file could not be read (${message})`
237
+ );
238
+ return { ok: false, pinned: false };
239
+ }
240
+ log.warn(`[plugins] trust check skipped for "${label}" \u2014 entry could not be read (${message})`);
202
241
  return { ok: true, pinned: false };
203
242
  }
204
243
  const verification = verifyPluginTrust(entryPath, integrity, store);
@@ -211,15 +250,25 @@ async function gateExternalPluginTrust(args) {
211
250
  );
212
251
  return { ok: true, pinned: true, store: next };
213
252
  } catch (err) {
214
- log.warn(
215
- `[plugins] could not persist trust pin for "${label}" (${err instanceof Error ? err.message : String(err)})`
216
- );
253
+ const message = err instanceof Error ? err.message : String(err);
254
+ if (mode === "required") {
255
+ log.error(
256
+ `[plugins] REFUSING external plugin "${label}" \u2014 features.pluginsTrust is 'required' and its first-use pin could not be persisted (${message})`
257
+ );
258
+ return { ok: false, pinned: false };
259
+ }
260
+ log.warn(`[plugins] could not persist trust pin for "${label}" (${message})`);
217
261
  return { ok: true, pinned: false };
218
262
  }
219
263
  }
220
- log.error(
221
- `[plugins] REFUSING external plugin "${label}" \u2014 its entry file changed since it was first trusted (pinned ${verification.pinnedAt}). If you expected this update, re-pin it: wstack plugin trust ${label}`
222
- );
264
+ const changedMessage = `its entry file changed since it was first trusted (pinned ${verification.pinnedAt}). If you expected this update, re-pin it: wstack plugin trust ${label}`;
265
+ if (mode === "advisory") {
266
+ log.warn(
267
+ `[plugins] external plugin "${label}" \u2014 ${changedMessage} features.pluginsTrust is 'advisory', loading anyway WITHOUT integrity enforcement`
268
+ );
269
+ return { ok: true, pinned: false };
270
+ }
271
+ log.error(`[plugins] REFUSING external plugin "${label}" \u2014 ${changedMessage}`);
223
272
  return { ok: false, pinned: false };
224
273
  }
225
274
 
@@ -986,4 +1035,4 @@ export {
986
1035
  PLUGIN_AUDIT_ENTRIES,
987
1036
  runPluginManagementCommand
988
1037
  };
989
- //# sourceMappingURL=chunk-635WW3II.js.map
1038
+ //# sourceMappingURL=chunk-TEBMCYZN.js.map
@@ -3,7 +3,7 @@ import {
3
3
  normalizeKeys,
4
4
  nowIso,
5
5
  writeKeysBack
6
- } from "./chunk-XPX432BZ.js";
6
+ } from "./chunk-DR2OXU46.js";
7
7
 
8
8
  // src/auth-menu/openai-codex-oauth.ts
9
9
  import { color } from "@wrongstack/core/utils";
@@ -259,4 +259,4 @@ export {
259
259
  filterCurrentCodexModelIds,
260
260
  isCodexCatalogModel
261
261
  };
262
- //# sourceMappingURL=chunk-E4I2TF5S.js.map
262
+ //# sourceMappingURL=chunk-TNK6237M.js.map
@@ -0,0 +1,51 @@
1
+
2
+ // src/settings-behavior-sections.ts
3
+ var BEHAVIOR_SECTION_KEYS = [
4
+ "context",
5
+ "tools",
6
+ "log",
7
+ "features",
8
+ "session",
9
+ "indexing",
10
+ "circuitBreaker",
11
+ "modelRuntime",
12
+ "Sage",
13
+ "skills",
14
+ "systemPrompt",
15
+ "autonomy",
16
+ "maxConcurrent",
17
+ "yolo",
18
+ "nextPrediction",
19
+ "hints",
20
+ "debugStream"
21
+ ];
22
+ function extractBehaviorSettings(config) {
23
+ const out = {};
24
+ for (const key of BEHAVIOR_SECTION_KEYS) {
25
+ const value = config[key];
26
+ if (value !== void 0) out[key] = structuredClone(value);
27
+ }
28
+ return out;
29
+ }
30
+ function mergeBehaviorSettings(target, settings) {
31
+ const applied = [];
32
+ for (const key of BEHAVIOR_SECTION_KEYS) {
33
+ const value = settings[key];
34
+ if (value === void 0) continue;
35
+ if (value !== null && typeof value === "object") {
36
+ const current = target[key] ?? {};
37
+ target[key] = { ...current, ...value };
38
+ } else {
39
+ target[key] = value;
40
+ }
41
+ applied.push(key);
42
+ }
43
+ return applied;
44
+ }
45
+
46
+ export {
47
+ BEHAVIOR_SECTION_KEYS,
48
+ extractBehaviorSettings,
49
+ mergeBehaviorSettings
50
+ };
51
+ //# sourceMappingURL=chunk-UQUYBDMG.js.map
@@ -2,7 +2,7 @@ import {
2
2
  fallbackCodexProviderModels,
3
3
  filterCurrentCodexModelIds,
4
4
  isCodexCatalogModel
5
- } from "./chunk-E4I2TF5S.js";
5
+ } from "./chunk-TNK6237M.js";
6
6
 
7
7
  // src/acp-registry-cache.ts
8
8
  import * as fs from "node:fs/promises";
@@ -307,4 +307,4 @@ export {
307
307
  setupProvider,
308
308
  createGracefulShutdown
309
309
  };
310
- //# sourceMappingURL=chunk-F5GA2QW2.js.map
310
+ //# sourceMappingURL=chunk-ZSZ3EYWH.js.map