@wrongstack/cli 1.0.1 → 1.0.4

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 (109) hide show
  1. package/data/providers.json +21 -21
  2. package/dist/{acp-3LARESEO.js → acp-AB54FWM2.js} +122 -39
  3. package/dist/acp-agent-list.d.ts +14 -0
  4. package/dist/acp-hq-telemetry.d.ts +9 -2
  5. package/dist/acp-mcp-servers.d.ts +49 -0
  6. package/dist/acp-server-agent.d.ts +18 -6
  7. package/dist/{auth-ZUMCDNE5.js → auth-WDMSNZ3S.js} +79 -55
  8. package/dist/auth-menu/index.d.ts +1 -0
  9. package/dist/auth-menu/oauth-menu.d.ts +3 -1
  10. package/dist/auth-menu/panel-service.d.ts +2 -0
  11. package/dist/auth-menu/provider-auth-login.d.ts +12 -0
  12. package/dist/auth-menu/types.d.ts +3 -0
  13. package/dist/auto-discover-providers-DXR25GTG.js +7 -0
  14. package/dist/boot/dispatch-webui.d.ts +1 -0
  15. package/dist/boot/short-circuit-hq.d.ts +2 -0
  16. package/dist/boot/system-prompt-builder.d.ts +7 -0
  17. package/dist/boot/system-prompt.d.ts +2 -1
  18. package/dist/boot/tool-registry.d.ts +18 -1
  19. package/dist/chimera-reviewer-policy.d.ts +1 -1
  20. package/dist/{chunk-C2E24IXZ.js → chunk-3I5ZJXM5.js} +147 -241
  21. package/dist/{chunk-JHPXJRRI.js → chunk-4XCBEUBX.js} +13 -3
  22. package/dist/{chunk-FPIWTJ2G.js → chunk-6WRKAACA.js} +4 -4
  23. package/dist/chunk-AUQDGU5D.js +32 -0
  24. package/dist/{chunk-D2VCUN7M.js → chunk-BIWE22O5.js} +17 -17
  25. package/dist/{chunk-VOTTENR5.js → chunk-CDY4D5QK.js} +2 -2
  26. package/dist/chunk-D5GB5MHA.js +87 -0
  27. package/dist/chunk-DAKVBMD4.js +36 -0
  28. package/dist/{chunk-E6RFXHWD.js → chunk-EK2P53GL.js} +3 -2
  29. package/dist/chunk-I7V2OYVH.js +242 -0
  30. package/dist/{chunk-MXEJEYT7.js → chunk-JX6KL7OF.js} +15 -5
  31. package/dist/{chunk-ZSZ3EYWH.js → chunk-KEPABQYT.js} +109 -6
  32. package/dist/{chunk-IMWXXF4J.js → chunk-KNMIBKLV.js} +79 -1
  33. package/dist/{chunk-MNQQ4ZNF.js → chunk-ONOT5OJ2.js} +290 -687
  34. package/dist/chunk-Q7E3BPDU.js +62 -0
  35. package/dist/chunk-SIGUWXAA.js +43 -0
  36. package/dist/{chunk-TEBMCYZN.js → chunk-SIS37L3W.js} +58 -2
  37. package/dist/{chunk-KHWDTNBZ.js → chunk-U6PGWDMZ.js} +5 -5
  38. package/dist/{chunk-5IA5337I.js → chunk-XJ7K67PP.js} +8 -2
  39. package/dist/{cli-context-7X3M6U73.js → cli-context-WFC3BNGM.js} +131 -25
  40. package/dist/{cli-main-53KG6HAV.js → cli-main-GU3YZLMO.js} +3986 -2827
  41. package/dist/{diag-doctor-7LYUYU35.js → diag-doctor-PCER6KHH.js} +2 -2
  42. package/dist/execute-deps.d.ts +1 -0
  43. package/dist/{execution-MIBWBYB6.js → execution-RAZDDQFC.js} +115 -16
  44. package/dist/execution-specialist-trigger.d.ts +28 -0
  45. package/dist/fleet/acp-live-progress.d.ts +19 -0
  46. package/dist/fleet/host-acp-runner-cache.d.ts +3 -1
  47. package/dist/fleet/host-acp.d.ts +14 -2
  48. package/dist/fleet/host.d.ts +1 -0
  49. package/dist/{hq-IG3YRGCO.js → hq-5XHEIIH6.js} +127 -8
  50. package/dist/hq-command-controller.d.ts +31 -2
  51. package/dist/hq-server/client-address.d.ts +2 -0
  52. package/dist/hq-server/ip-allowlist.d.ts +16 -0
  53. package/dist/hq-server/preflight.d.ts +1 -0
  54. package/dist/hq-server/routes/auth/password-routes.d.ts +1 -1
  55. package/dist/hq-server/routes.d.ts +5 -4
  56. package/dist/hq-server/secret-input.d.ts +7 -0
  57. package/dist/hq-server/types.d.ts +3 -2
  58. package/dist/hq-server/upgrade-handler.d.ts +2 -0
  59. package/dist/hq-server/utils.d.ts +6 -0
  60. package/dist/{hq-server-OILU3NPI.js → hq-server-CNUTBWTK.js} +4 -3
  61. package/dist/hq-server.d.ts +4 -0
  62. package/dist/hq-service-L5INQFM4.js +507 -0
  63. package/dist/hq-service.d.ts +22 -0
  64. package/dist/index.js +4 -4
  65. package/dist/ip-allowlist-NHXO6AKJ.js +9 -0
  66. package/dist/live-settings-input.d.ts +4 -0
  67. package/dist/{mailbox-serve-VUCWZ2SJ.js → mailbox-serve-X3CR6VFW.js} +4 -3
  68. package/dist/{modeldiag-FMJT37SN.js → modeldiag-46CMWUNM.js} +31 -24
  69. package/dist/{per-subcommand-help-BWBHYVJO.js → per-subcommand-help-DHTYU524.js} +2 -2
  70. package/dist/{plugin-usage-HFBI3TFT.js → plugin-usage-M6KET4OZ.js} +2 -2
  71. package/dist/{plugins-PZ2VZL7V.js → plugins-WJLW6ULV.js} +3 -3
  72. package/dist/projects-LMNAGGEU.js +36 -0
  73. package/dist/{providers-models-YVMVYWRS.js → providers-models-6MOGAOVK.js} +2 -2
  74. package/dist/{proxy-wiring-MGRSKZZB.js → proxy-wiring-K2DORFFL.js} +3 -3
  75. package/dist/short-circuit-flags-YDMLAQ5R.js +10 -0
  76. package/dist/slash-commands/acp.d.ts +3 -0
  77. package/dist/slash-commands/codebase-map.d.ts +11 -0
  78. package/dist/slash-commands/command-context.d.ts +29 -0
  79. package/dist/slash-commands/context.d.ts +10 -0
  80. package/dist/slash-commands/ensemble.d.ts +1 -1
  81. package/dist/slash-commands/openai-quota.d.ts +31 -0
  82. package/dist/slash-commands/profile.d.ts +7 -0
  83. package/dist/subcommands/handlers/hq.d.ts +1 -0
  84. package/dist/subcommands/handlers/projects.d.ts +14 -0
  85. package/dist/{subcommands-WJLBHVKC.js → subcommands-7N4RIK6H.js} +2 -2
  86. package/dist/{version-help-MYKF724O.js → version-help-WXI42PZ3.js} +2 -2
  87. package/dist/{webui-server-5R35BHWZ.js → webui-server-OBV5JYJV.js} +27 -4
  88. package/dist/webui-server-options.d.ts +1 -0
  89. package/dist/wiring/atlas-prompt-contributor.d.ts +54 -0
  90. package/dist/wiring/cli-execute-builder.d.ts +1 -0
  91. package/dist/wiring/cli-slash-commands-setup.d.ts +7 -0
  92. package/dist/wiring/codebase-embeddings.d.ts +31 -0
  93. package/dist/wiring/command-host-state.d.ts +9 -0
  94. package/dist/wiring/concept-summarizer.d.ts +32 -0
  95. package/dist/wiring/external-plugins.d.ts +1 -0
  96. package/dist/wiring/lifecycle-plugins.d.ts +2 -1
  97. package/dist/wiring/pipeline.d.ts +2 -0
  98. package/dist/wiring/plugins.d.ts +2 -1
  99. package/dist/wiring/provider-runtime-setup.d.ts +1 -1
  100. package/dist/wiring/provider.d.ts +2 -1
  101. package/dist/wiring/session-command-handlers.d.ts +2 -1
  102. package/dist/wiring/slash-commands.d.ts +1 -0
  103. package/package.json +29 -29
  104. package/dist/auto-discover-providers-VQU3IZMR.js +0 -7
  105. package/dist/chunk-52C7PD2H.js +0 -61
  106. package/dist/chunk-Q5GTM25S.js +0 -17
  107. package/dist/chunk-TNK6237M.js +0 -262
  108. package/dist/projects-L6C6XLDY.js +0 -37
  109. package/dist/short-circuit-flags-UREFSYBL.js +0 -10
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-XJXDOF63.js";
9
9
  import {
10
10
  parseArgs
11
- } from "./chunk-E6RFXHWD.js";
11
+ } from "./chunk-EK2P53GL.js";
12
12
 
13
13
  // src/cli-entry-main.ts
14
14
  async function main(argv) {
@@ -16,14 +16,14 @@ async function main(argv) {
16
16
  applySessionShellDefault();
17
17
  const earlyFlags = parseArgs(argv).flags;
18
18
  if (earlyFlags["help"] === true || earlyFlags["version"] === true) {
19
- const { handleHelpVersionShortCircuit } = await import("./short-circuit-flags-UREFSYBL.js");
19
+ const { handleHelpVersionShortCircuit } = await import("./short-circuit-flags-YDMLAQ5R.js");
20
20
  const earlyExit = await handleHelpVersionShortCircuit(argv);
21
21
  if (earlyExit !== null) return earlyExit;
22
22
  }
23
- const { initializeCli } = await import("./cli-context-7X3M6U73.js");
23
+ const { initializeCli } = await import("./cli-context-WFC3BNGM.js");
24
24
  const cliCtx = await initializeCli(argv);
25
25
  if (typeof cliCtx === "number") return cliCtx;
26
- const { runInteractive } = await import("./cli-main-53KG6HAV.js");
26
+ const { runInteractive } = await import("./cli-main-GU3YZLMO.js");
27
27
  return runInteractive(cliCtx);
28
28
  }
29
29
 
@@ -0,0 +1,9 @@
1
+ import {
2
+ createHqIpAllowlist,
3
+ parseHqIpAllowlist
4
+ } from "./chunk-Q7E3BPDU.js";
5
+ export {
6
+ createHqIpAllowlist,
7
+ parseHqIpAllowlist
8
+ };
9
+ //# sourceMappingURL=ip-allowlist-NHXO6AKJ.js.map
@@ -39,6 +39,8 @@ export interface LiveSettingsInput {
39
39
  enhanceDelayMs?: number | undefined;
40
40
  enhanceEnabled?: boolean | undefined;
41
41
  enhanceLanguage?: string | undefined;
42
+ /** Pre-refine grace period (seconds) before the refiner LLM call starts. 0 = skip. Default: 3. */
43
+ preRefineSeconds?: number | undefined;
42
44
  /** Mid-run send-mode picker (queue/btw/steer) toggle. Default on. */
43
45
  midRunSendPicker?: boolean | undefined;
44
46
  /** Skip the confirmation prompt for the TUI `!<command>` shell shortcut. */
@@ -65,6 +67,8 @@ export interface LiveSettingsInput {
65
67
  cacheTtl?: 'default' | '5m' | '1h' | undefined;
66
68
  /** Show "Model Reasoning" blocks in chat history. Default: true. */
67
69
  showModelReasoning?: boolean | undefined;
70
+ /** Default presentation density for committed TUI tool results. */
71
+ toolResultViewMode?: 'minimal' | 'normal' | 'full' | undefined;
68
72
  /** Agent swarm panel placement: 'bottom' (lower region), 'sidebar' (right sidebar), or 'off' (hidden).
69
73
  * Backward-compat: legacy boolean values are coerced by the TUI settings adapter. Default: 'bottom'. */
70
74
  showAgentSwarmPanel?: 'bottom' | 'sidebar' | 'off' | boolean | undefined;
@@ -114,8 +114,9 @@ or stop the conflicting process and retry.
114
114
  credentialStore,
115
115
  projectId,
116
116
  authorize: (request) => {
117
- if (/^Credential\s+/i.test(request.headers.authorization ?? "")) {
118
- return { allowed: true };
117
+ const header = request.headers.authorization;
118
+ if (typeof header === "string" && /^Credential\s+/i.test(header)) {
119
+ return void 0;
119
120
  }
120
121
  return authorizeMailboxBearerToken(request, tentative.token);
121
122
  },
@@ -359,4 +360,4 @@ function printHelp(deps) {
359
360
  export {
360
361
  mailboxServeCmd
361
362
  };
362
- //# sourceMappingURL=mailbox-serve-VUCWZ2SJ.js.map
363
+ //# sourceMappingURL=mailbox-serve-X3CR6VFW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  discoverAndMergeProviders
3
- } from "./chunk-52C7PD2H.js";
3
+ } from "./chunk-D5GB5MHA.js";
4
4
  import {
5
5
  activeProfileConfigPath
6
6
  } from "./chunk-YMXXOOFN.js";
@@ -1081,30 +1081,37 @@ async function runModeldiagTest(args, deps, config) {
1081
1081
  // src/subcommands/handlers/modeldiag.ts
1082
1082
  async function readProviders(cachePath) {
1083
1083
  if (!cachePath) {
1084
- return `${color5.red("Models cache not available")}.`;
1084
+ return { ok: false, message: `${color5.red("Models cache not available")}.`, hard: true };
1085
1085
  }
1086
1086
  try {
1087
1087
  const raw = await fs.readFile(cachePath, "utf8");
1088
1088
  const parsed = JSON.parse(raw);
1089
1089
  const payload = parsed.payload ?? parsed;
1090
- return Object.entries(payload).map(([id, p]) => ({
1091
- id: p.id ?? id,
1092
- name: p.name ?? id,
1093
- family: p.npm ?? id,
1094
- models: Object.values(p.models ?? {}).map(
1095
- (m) => ({
1096
- id: m.id,
1097
- name: m.name,
1098
- capabilities: {
1099
- contextWindow: m.limit?.context,
1100
- maxOutputTokens: m.limit?.output
1101
- },
1102
- pricing: m.cost
1103
- })
1104
- )
1105
- }));
1090
+ return {
1091
+ ok: true,
1092
+ providers: Object.entries(payload).map(([id, p]) => ({
1093
+ id: p.id ?? id,
1094
+ name: p.name ?? id,
1095
+ family: p.npm ?? id,
1096
+ models: Object.values(p.models ?? {}).map(
1097
+ (m) => ({
1098
+ id: m.id,
1099
+ name: m.name,
1100
+ capabilities: {
1101
+ contextWindow: m.limit?.context,
1102
+ maxOutputTokens: m.limit?.output
1103
+ },
1104
+ pricing: m.cost
1105
+ })
1106
+ )
1107
+ }))
1108
+ };
1106
1109
  } catch {
1107
- return `${color5.amber("Models cache not available")}. Run wstack sync-models.`;
1110
+ return {
1111
+ ok: false,
1112
+ message: `${color5.amber("Models cache not available")}. Run wstack sync-models.`,
1113
+ hard: false
1114
+ };
1108
1115
  }
1109
1116
  }
1110
1117
  function checkHasKey(pid, config) {
@@ -1118,12 +1125,12 @@ function checkHasKey(pid, config) {
1118
1125
  var modeldiagCmd = async (args, deps) => {
1119
1126
  const sub = args[0]?.toLowerCase() || "full";
1120
1127
  const cacheResult = await readProviders(deps.paths.modelsCache);
1121
- if (typeof cacheResult === "string") {
1122
- deps.renderer.write(`${cacheResult}
1128
+ if (!cacheResult.ok) {
1129
+ deps.renderer.write(`${cacheResult.message}
1123
1130
  `);
1124
- return cacheResult.includes(color5.red("")) ? 1 : 0;
1131
+ return cacheResult.hard ? 1 : 0;
1125
1132
  }
1126
- const providers = cacheResult;
1133
+ const providers = cacheResult.providers;
1127
1134
  const config = deps.config;
1128
1135
  const modelMatrix = config.modelMatrix ?? {};
1129
1136
  function hasKey(pid) {
@@ -1322,4 +1329,4 @@ var modeldiagCmd = async (args, deps) => {
1322
1329
  export {
1323
1330
  modeldiagCmd
1324
1331
  };
1325
- //# sourceMappingURL=modeldiag-FMJT37SN.js.map
1332
+ //# sourceMappingURL=modeldiag-46CMWUNM.js.map
@@ -7,7 +7,7 @@ import {
7
7
  renderFocusedHelpToString,
8
8
  renderGenericHelp,
9
9
  subcommandsWithFocusedHelp
10
- } from "./chunk-MXEJEYT7.js";
10
+ } from "./chunk-JX6KL7OF.js";
11
11
  import "./chunk-2VMJ3E5Z.js";
12
12
  export {
13
13
  deepSubcommandsWithFocusedHelp,
@@ -19,4 +19,4 @@ export {
19
19
  renderGenericHelp,
20
20
  subcommandsWithFocusedHelp
21
21
  };
22
- //# sourceMappingURL=per-subcommand-help-BWBHYVJO.js.map
22
+ //# sourceMappingURL=per-subcommand-help-DHTYU524.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runPluginManagementCommand
3
- } from "./chunk-TEBMCYZN.js";
3
+ } from "./chunk-SIS37L3W.js";
4
4
  import {
5
5
  restoreFlags
6
6
  } from "./chunk-CSAPOCBP.js";
@@ -40,4 +40,4 @@ export {
40
40
  pluginCmd,
41
41
  usageCmd
42
42
  };
43
- //# sourceMappingURL=plugin-usage-HFBI3TFT.js.map
43
+ //# sourceMappingURL=plugin-usage-M6KET4OZ.js.map
@@ -6,9 +6,9 @@ import {
6
6
  pluginNameFromSpec,
7
7
  setupPlugins,
8
8
  warnIfDeprecatedPluginName
9
- } from "./chunk-5IA5337I.js";
9
+ } from "./chunk-XJ7K67PP.js";
10
10
  import "./chunk-EWKESL4L.js";
11
- import "./chunk-TEBMCYZN.js";
11
+ import "./chunk-SIS37L3W.js";
12
12
  export {
13
13
  BUILTIN_PLUGIN_FACTORIES,
14
14
  DEPRECATED_PLUGIN_NAMES,
@@ -18,4 +18,4 @@ export {
18
18
  setupPlugins,
19
19
  warnIfDeprecatedPluginName
20
20
  };
21
- //# sourceMappingURL=plugins-PZ2VZL7V.js.map
21
+ //# sourceMappingURL=plugins-WJLW6ULV.js.map
@@ -0,0 +1,36 @@
1
+
2
+ // src/subcommands/handlers/projects.ts
3
+ import * as fs from "node:fs/promises";
4
+ import * as path from "node:path";
5
+ import { color } from "@wrongstack/core/utils";
6
+ var projectsCmd = async (_args, deps) => {
7
+ const manifestPath = path.join(deps.paths.globalRoot, "projects.json");
8
+ let entries;
9
+ try {
10
+ const parsed = JSON.parse(await fs.readFile(manifestPath, "utf8"));
11
+ entries = Array.isArray(parsed.projects) ? parsed.projects : [];
12
+ } catch {
13
+ deps.renderer.write("No projects tracked yet.\n");
14
+ return 0;
15
+ }
16
+ if (entries.length === 0) {
17
+ deps.renderer.write("No projects tracked yet.\n");
18
+ return 0;
19
+ }
20
+ const sorted = [...entries].sort((a, b) => (b.lastSeen ?? "").localeCompare(a.lastSeen ?? ""));
21
+ const slugWidth = Math.min(
22
+ Math.max(...sorted.map((entry) => (entry.slug ?? "").length), 4),
23
+ 40
24
+ );
25
+ for (const entry of sorted) {
26
+ const slug = (entry.slug ?? "?").padEnd(slugWidth);
27
+ const seen = entry.lastSeen ?? "";
28
+ deps.renderer.write(` ${color.dim(slug)} ${color.dim(seen)} ${entry.root ?? "?"}
29
+ `);
30
+ }
31
+ return 0;
32
+ };
33
+ export {
34
+ projectsCmd
35
+ };
36
+ //# sourceMappingURL=projects-LMNAGGEU.js.map
@@ -239,7 +239,7 @@ function aliasProviderId(configProviderId, cfg) {
239
239
  async function discoverProviderModels(deps, ids) {
240
240
  if (!("mergeOverlay" in deps.modelsRegistry)) return void 0;
241
241
  try {
242
- const { discoverAndMergeProviders } = await import("./auto-discover-providers-VQU3IZMR.js");
242
+ const { discoverAndMergeProviders } = await import("./auto-discover-providers-DXR25GTG.js");
243
243
  await discoverAndMergeProviders({
244
244
  config: deps.config,
245
245
  registry: deps.modelsRegistry,
@@ -660,4 +660,4 @@ export {
660
660
  modelsCmd,
661
661
  providersCmd
662
662
  };
663
- //# sourceMappingURL=providers-models-YVMVYWRS.js.map
663
+ //# sourceMappingURL=providers-models-6MOGAOVK.js.map
@@ -3,12 +3,12 @@ import {
3
3
  awaitFirstWrongProxyProbe,
4
4
  bootstrapWrongProxy,
5
5
  shutdownWrongProxy
6
- } from "./chunk-VOTTENR5.js";
7
- import "./chunk-JHPXJRRI.js";
6
+ } from "./chunk-CDY4D5QK.js";
7
+ import "./chunk-4XCBEUBX.js";
8
8
  export {
9
9
  applyWrongProxyPrefs,
10
10
  awaitFirstWrongProxyProbe,
11
11
  bootstrapWrongProxy,
12
12
  shutdownWrongProxy
13
13
  };
14
- //# sourceMappingURL=proxy-wiring-MGRSKZZB.js.map
14
+ //# sourceMappingURL=proxy-wiring-K2DORFFL.js.map
@@ -0,0 +1,10 @@
1
+ import {
2
+ handleHelpVersionShortCircuit
3
+ } from "./chunk-U6PGWDMZ.js";
4
+ import "./chunk-6WRKAACA.js";
5
+ import "./chunk-XJXDOF63.js";
6
+ import "./chunk-EK2P53GL.js";
7
+ export {
8
+ handleHelpVersionShortCircuit
9
+ };
10
+ //# sourceMappingURL=short-circuit-flags-YDMLAQ5R.js.map
@@ -10,6 +10,9 @@ import type { SlashCommandContext } from './command-context.js';
10
10
  * /acp <agent-id> <task> run a task on one agent (inline, streamed)
11
11
  * /acp <agent-id> --bg <task> run it as a background fleet subagent
12
12
  * /acp parallel <csv> <task> fan a task out to several agents at once
13
+ * /acp parallel <csv> --bg <task> same, but each agent runs as a background
14
+ * fleet subagent — live progress shows in /agents,
15
+ * the TUI fleet panel and the WebUI Agents panel
13
16
  * /acp probe [csv] handshake-test agents (what actually works)
14
17
  * /acp bench [csv] [--fs] end-to-end verify each agent + graded report
15
18
  * /acp sync pull the official agentclientprotocol/registry
@@ -0,0 +1,11 @@
1
+ import type { SlashCommand } from '@wrongstack/core/types';
2
+ import type { SlashCommandContext } from './command-context.js';
3
+ /**
4
+ * `/codebase-map` — read and publish the centrality-ranked view of the index.
5
+ *
6
+ * Three jobs, one command, because they are three views of the same data:
7
+ * print the map, write the committable atlas projection, and report whether a
8
+ * previously written atlas still describes the current code.
9
+ */
10
+ export declare function buildCodebaseMapCommand(opts: SlashCommandContext): SlashCommand;
11
+ //# sourceMappingURL=codebase-map.d.ts.map
@@ -3,6 +3,7 @@ import type { EventBus } from '@wrongstack/core/kernel';
3
3
  import type { SlashCommandRegistry, ToolRegistry } from '@wrongstack/core/registry';
4
4
  import type { CompactReport, HealthRegistry, MemoryPort, MetricsRuntimeStatus, MetricsSink, ModeStore, Renderer, SessionStore, SkillLoader, TokenCounter } from '@wrongstack/core/types';
5
5
  import type { WstackPaths } from '@wrongstack/core/utils';
6
+ import type { SummarizerPort } from '@wrongstack/tools';
6
7
  import type { VectorMemoryStore } from '@wrongstack/vector-memory';
7
8
  /** Host capabilities supplied to command adapters. */
8
9
  export interface SlashCommandContext {
@@ -41,6 +42,12 @@ export interface SlashCommandContext {
41
42
  cwd: string;
42
43
  /** Project root (typically resolved from cwd). */
43
44
  projectRoot: string;
45
+ /**
46
+ * Model port for the codebase index's concept layer. Present only when
47
+ * `indexing.concepts.enabled` is true — its absence is what `/codebase-map
48
+ * --enrich` reports instead of silently doing nothing.
49
+ */
50
+ codebaseConceptSummarizer?: SummarizerPort | undefined;
44
51
  metricsSink?: MetricsSink | undefined;
45
52
  healthRegistry?: HealthRegistry | undefined;
46
53
  metricsStatus?: MetricsRuntimeStatus | undefined;
@@ -252,6 +259,16 @@ export interface SlashCommandContext {
252
259
  onContextLimit?: ((tokens?: number) => number) | undefined;
253
260
  /** Toggle or query YOLO mode at runtime. Pass undefined to query, boolean to set. */
254
261
  onYolo?: ((setTo?: boolean) => boolean) | undefined;
262
+ /**
263
+ * Read, or set, which kinds of damage still prompt while YOLO is on.
264
+ *
265
+ * Returns the EFFECTIVE map after any update — the locked kinds report `true`
266
+ * whatever was asked, so a caller can tell an ignored "off" from a real one.
267
+ */
268
+ onYoloConfirm?: ((update?: {
269
+ kind: import('@wrongstack/core/security').DestructiveKind;
270
+ confirm: boolean;
271
+ }) => Record<string, boolean>) | undefined;
255
272
  /** Toggle or query next-task prediction. Pass undefined to query, boolean to set. */
256
273
  onNextPredict?: ((setTo?: boolean) => boolean) | undefined;
257
274
  /**
@@ -589,6 +606,18 @@ export interface SlashCommandContext {
589
606
  brainTierStats?: (() => import('@wrongstack/core/coordination').BrainTierStats) | undefined;
590
607
  /** Config store for reading/writing config sections at runtime (e.g. settings menu). */
591
608
  configStore: import('@wrongstack/core/types').ConfigStore;
609
+ /**
610
+ * Host hook that adopts the store's new merged config after an in-process
611
+ * selection change (today only `/profile switch`). The host's own `config`
612
+ * object is a distinct snapshot from the store's, so a command that mutates
613
+ * the store must hand the result back or the host keeps reading the values
614
+ * it booted with.
615
+ *
616
+ * Optional by design: only the interactive CLI has a live merged config to
617
+ * keep in step. Surfaces that leave it unset still persist the selection to
618
+ * the bootstrap and pick it up on their next start.
619
+ */
620
+ onActiveProfileChange?: ((next: import('@wrongstack/core/types').Config) => void) | undefined;
592
621
  /**
593
622
  * Optional accessor for the Chronicle metrics store. When wired, the
594
623
  * `/tool autothin candidates` and `apply` commands can read the
@@ -1,4 +1,14 @@
1
1
  import type { SlashCommand } from '@wrongstack/core/types';
2
2
  import type { SlashCommandContext } from './command-context.js';
3
3
  export declare function buildContextCommand(opts: SlashCommandContext): SlashCommand;
4
+ /**
5
+ * One line naming what the recent per-request ratios mean.
6
+ *
7
+ * Deliberately reports a SHAPE, not a threshold. "40%" is a healthy young
8
+ * session and a broken old one; what separates them is whether the number is
9
+ * climbing as the conversation grows. The first request of a session can never
10
+ * hit, so it is excluded from the judgement rather than allowed to drag the
11
+ * verdict down.
12
+ */
13
+ export declare function cacheTrendVerdict(recent: readonly number[]): string;
4
14
  //# sourceMappingURL=context.d.ts.map
@@ -13,5 +13,5 @@ import type { SlashCommandContext } from './command-context.js';
13
13
  *
14
14
  * Run /ensemble (no args) to see usage and the list of available agents.
15
15
  */
16
- export declare function buildEnsembleCommand(_opts: SlashCommandContext): SlashCommand;
16
+ export declare function buildEnsembleCommand(opts: SlashCommandContext): SlashCommand;
17
17
  //# sourceMappingURL=ensemble.d.ts.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * `/openai-quota` — how much of the ChatGPT (Codex) subscription this account
3
+ * has burned, and when the windows reset.
4
+ *
5
+ * A "Sign in with ChatGPT" account is metered on rolling windows — typically a
6
+ * 5-hour one and a weekly one — and the ChatGPT backend reports the burn on
7
+ * every `/codex/responses` response, in headers. Nothing about that reaches the
8
+ * SSE body, so before this existed the first visible sign of an exhausted plan
9
+ * was a 429 in the middle of a turn.
10
+ *
11
+ * The command is provider-scoped; the machinery underneath is not. It renders
12
+ * whatever `@wrongstack/core/quota` holds for one provider id, and the renderer
13
+ * below reads only the neutral shape. A second metered provider needs a
14
+ * reporter and a one-line command, not a second copy of this file.
15
+ *
16
+ * The reading is observational: it appears after the first request of the
17
+ * session, not before, and it is never fetched on its own — spending a request
18
+ * to ask "how much have I spent" is exactly the wrong trade on a metered plan.
19
+ *
20
+ * Usage:
21
+ * /openai-quota Show the latest reading for every metered window
22
+ */
23
+ import { type ProviderQuotaSnapshot } from '@wrongstack/core/quota';
24
+ import type { SlashCommand } from '@wrongstack/core/types';
25
+ /**
26
+ * Render one meter. Provider-neutral by construction — everything it reads is
27
+ * on the shared snapshot shape.
28
+ */
29
+ export declare function renderQuotaSnapshot(snapshot: ProviderQuotaSnapshot): string[];
30
+ export declare function buildOpenAIQuotaCommand(): SlashCommand;
31
+ //# sourceMappingURL=openai-quota.d.ts.map
@@ -10,6 +10,13 @@ import type { SlashCommandContext } from './command-context.js';
10
10
  * /profile list Show available profiles (● = active)
11
11
  * /profile switch <name> Switch to an existing profile
12
12
  * /profile copy <name> Copy the active profile's settings to a new profile
13
+ *
14
+ * `switch` writes the bootstrap (the durable selection read at next boot) and
15
+ * then pushes `activeProfile` through the live ConfigStore, which is the only
16
+ * event source the provider-runtime rebind watcher observes. `syncConfig` is
17
+ * the host's own copy of the merged config; it is a separate object from the
18
+ * store, so it has to be told too or the host keeps routing against the
19
+ * profile that was active when it booted.
13
20
  */
14
21
  export declare function buildProfileCommand(opts: SlashCommandContext): SlashCommand;
15
22
  //# sourceMappingURL=profile.d.ts.map
@@ -11,6 +11,7 @@
11
11
  * wstack hq token list --client → list issued client tokens
12
12
  * wstack hq token revoke <id> → revoke a browser token (prefix match)
13
13
  * wstack hq token revoke --client <id> → revoke a client token
14
+ * wstack hq service install|status|update|uninstall → Ubuntu systemd lifecycle
14
15
  *
15
16
  * All subcommands accept `--data-dir <path>` to override the HQ data
16
17
  * directory (default `~/.wrongstack/hq`, honors `WRONGSTACK_HOME` /
@@ -1,3 +1,17 @@
1
1
  import type { SubcommandHandler } from '../contracts.js';
2
+ /**
3
+ * List the projects WrongStack has actually been used in.
4
+ *
5
+ * The source is `~/.wrongstack/projects.json`, the manifest `boot.ts` writes
6
+ * on every start and the one `/project` already reads.
7
+ *
8
+ * This used to enumerate the `~/.wrongstack/projects/` DIRECTORY instead, which
9
+ * is not the same thing: that directory also holds per-run scratch state for
10
+ * ephemeral roots — Chimera review worktrees and the like — which are created
11
+ * by the hundred and carry no `meta.json`. On a working machine the listing was
12
+ * 1,495 rows of which 1,461 printed `(no meta)` and 262 were single-use
13
+ * `chimera-*` scratch dirs, against 30 real entries in the manifest. The
14
+ * command was unusable for the one question it answers.
15
+ */
2
16
  export declare const projectsCmd: SubcommandHandler;
3
17
  //# sourceMappingURL=projects.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  subcommandNames,
3
3
  subcommands
4
- } from "./chunk-D2VCUN7M.js";
4
+ } from "./chunk-BIWE22O5.js";
5
5
  export {
6
6
  subcommandNames,
7
7
  subcommands
8
8
  };
9
- //# sourceMappingURL=subcommands-WJLBHVKC.js.map
9
+ //# sourceMappingURL=subcommands-7N4RIK6H.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  helpCmd,
3
3
  versionCmd
4
- } from "./chunk-FPIWTJ2G.js";
4
+ } from "./chunk-6WRKAACA.js";
5
5
  import "./chunk-XJXDOF63.js";
6
6
  export {
7
7
  helpCmd,
8
8
  versionCmd
9
9
  };
10
- //# sourceMappingURL=version-help-MYKF724O.js.map
10
+ //# sourceMappingURL=version-help-WXI42PZ3.js.map
@@ -1,6 +1,8 @@
1
1
  import {
2
- createHqCommandDispatcher
3
- } from "./chunk-IMWXXF4J.js";
2
+ createHqCommandDispatcher,
3
+ createProjectKanbanAssignHandler,
4
+ createProjectKanbanTransitionHandler
5
+ } from "./chunk-KNMIBKLV.js";
4
6
  import {
5
7
  createKanbanRunMirror
6
8
  } from "./chunk-VCYZ3WZV.js";
@@ -46,6 +48,7 @@ import {
46
48
  toSessionHistoryEntries
47
49
  } from "@wrongstack/webui-server";
48
50
  import { WebSocketServer } from "ws";
51
+ import { verifyClient as verifyWsClient2 } from "@wrongstack/webui-server/server/ws-auth";
49
52
 
50
53
  // src/webui-server/client-registration.ts
51
54
  import { mailboxSessionTag } from "@wrongstack/core/coordination";
@@ -70,6 +73,10 @@ function createWebuiClientRegistration(deps) {
70
73
  steerMailbox: mailbox,
71
74
  interruptLeader: control.interruptLeader,
72
75
  allowRunCommand: control.allowRunCommand,
76
+ ...deps.projectRoot ? {
77
+ kanbanTransition: createProjectKanbanTransitionHandler(deps.projectRoot),
78
+ kanbanAssign: createProjectKanbanAssignHandler(deps.projectRoot)
79
+ } : {},
73
80
  // The session HQ actually SHOWS for this client — the boot
74
81
  // session the telemetry bridge publishes under and the only one
75
82
  // `interruptLeader` speaks for. `getSessionId` follows whichever
@@ -1495,7 +1502,22 @@ async function runWebUI(opts) {
1495
1502
  ...opts.getVectorMemoryStore ? { getVectorMemoryStore: opts.getVectorMemoryStore } : {},
1496
1503
  ...opts.vectorMemoryModelCacheDir ? { vectorMemoryModelCacheDir: opts.vectorMemoryModelCacheDir } : {}
1497
1504
  });
1498
- const wss = httpServer ? new WebSocketServer({ server: httpServer.server, maxPayload: 20 * 1024 * 1024 }) : new WebSocketServer({ port: httpPort, host, maxPayload: 20 * 1024 * 1024 });
1505
+ const verifyClient = (info) => verifyWsClient2({
1506
+ origin: info.origin,
1507
+ url: info.req.url ?? "",
1508
+ hostHeader: info.req.headers.host,
1509
+ remoteAddress: info.req.socket.remoteAddress,
1510
+ cookieHeader: info.req.headers.cookie,
1511
+ wsHost: host,
1512
+ expectedToken: wsToken,
1513
+ requireToken,
1514
+ allowedHostnames: [publicUrl, publicWsUrl].filter(
1515
+ (value) => Boolean(value)
1516
+ ),
1517
+ allowBrowserUrlToken: Boolean(publicWsUrl),
1518
+ allowCrossPortLoopbackCookie: process.env["WRONGSTACK_WEBUI_DEV_CROSS_PORT_WS"] === "1"
1519
+ });
1520
+ const wss = httpServer ? new WebSocketServer({ server: httpServer.server, verifyClient, maxPayload: 20 * 1024 * 1024 }) : new WebSocketServer({ port: httpPort, host, verifyClient, maxPayload: 20 * 1024 * 1024 });
1499
1521
  wss.on("error", (err) => {
1500
1522
  console.error(
1501
1523
  JSON.stringify({
@@ -1625,6 +1647,7 @@ async function runWebUI(opts) {
1625
1647
  () => opts.appConfig?.providers ?? {}
1626
1648
  ),
1627
1649
  modelsRegistry: opts.modelsRegistry,
1650
+ providerAuthRegistry: opts.providerAuthRegistry,
1628
1651
  send,
1629
1652
  broadcast,
1630
1653
  log: (m) => console.log(m)
@@ -1951,4 +1974,4 @@ async function runWebUI(opts) {
1951
1974
  export {
1952
1975
  runWebUI
1953
1976
  };
1954
- //# sourceMappingURL=webui-server-5R35BHWZ.js.map
1977
+ //# sourceMappingURL=webui-server-OBV5JYJV.js.map
@@ -117,6 +117,7 @@ export interface CliWebUIOptions {
117
117
  webuiInstanceRegistered: boolean;
118
118
  }) => void;
119
119
  modelsRegistry?: ModelsRegistry | undefined;
120
+ providerAuthRegistry?: import('@wrongstack/core/registry').ProviderAuthRegistry | undefined;
120
121
  globalConfigPath?: string | undefined;
121
122
  /** Resolved profile config path: ~/.wrongstack/profiles/<activeProfile>/config.json */
122
123
  profileConfigPath: string;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Atlas boot-prompt contributor — the repository's shape, put in front of the
3
+ * agent instead of left to be rediscovered.
4
+ *
5
+ * Without this, every session begins the same way: a handful of searches to
6
+ * work out which packages exist, which files everything depends on, and where
7
+ * the entry points are. The index has known all of that since it was built.
8
+ * A few hundred tokens spends once what a dozen tool calls spend every time.
9
+ *
10
+ * Contract, matching `wrongtrace-prompt-contributor.ts`:
11
+ * - **Fail-open.** No index, no ranks, a throw, a timeout → `[]`. Orientation
12
+ * is a convenience; it must never be the reason a session cannot start.
13
+ * - **Bounded.** The brief is read behind a deadline, because the store lives
14
+ * on disk and a cold or busy index must not stall the first prompt.
15
+ * - **Cached per process.** The brief only changes when the index does, and
16
+ * rebuilding it on every prompt build would read SQLite on every turn.
17
+ * - **Cache-safe.** Contributor blocks are tagged `'contributor'`, which
18
+ * `EPOCH_VOLATILE_SOURCES` moves out of the wire `system` block and into
19
+ * the live-context tail — so this does not invalidate the prompt cache
20
+ * prefix the way a system-prompt edit would.
21
+ *
22
+ * It is deliberately *not* routed through SAGE. That pipeline is for episodic
23
+ * memory and gates on relevance thresholds a repository map would fail; the
24
+ * map is not a memory, it is a fact about the checkout.
25
+ */
26
+ import type { SystemPromptContributor, TokenSavingTier } from '@wrongstack/core/types';
27
+ import { type AtlasBrief } from '@wrongstack/tools';
28
+ /** Default hard ceiling on the rendered block. */
29
+ export declare const DEFAULT_BRIEF_MAX_TOKENS = 800;
30
+ /**
31
+ * Render the brief, trimming from the bottom until it fits.
32
+ *
33
+ * The order of the sections is the order of their value to somebody who knows
34
+ * nothing about the repository: what it is made of, what everything depends
35
+ * on, and — last, because it is the least load-bearing — what each subsystem
36
+ * does in prose. Trimming from the bottom therefore degrades gracefully
37
+ * instead of losing the hubs.
38
+ */
39
+ export declare function renderAtlasBrief(brief: AtlasBrief, maxTokens: number): string;
40
+ export interface AtlasPromptContributorOptions {
41
+ projectRoot: string;
42
+ indexDir?: string | undefined;
43
+ /** `indexing.atlas.injectOnSessionStart`. Default true. */
44
+ enabled?: boolean | undefined;
45
+ /** `indexing.atlas.briefMaxTokens`. Default {@link DEFAULT_BRIEF_MAX_TOKENS}. */
46
+ maxTokens?: number | undefined;
47
+ tokenSavingMode?: TokenSavingTier | boolean | undefined;
48
+ }
49
+ /**
50
+ * Build the contributor. One instance per prompt-builder binding; the brief
51
+ * cache lives on the closure, so it is per process, like the builder.
52
+ */
53
+ export declare function createAtlasPromptContributor(options: AtlasPromptContributorOptions): SystemPromptContributor;
54
+ //# sourceMappingURL=atlas-prompt-contributor.d.ts.map
@@ -73,6 +73,7 @@ export declare function runCliExecution(params: {
73
73
  agentMonitor?: X['fleet']['agentTranscripts'];
74
74
  vault: AUP['vault'];
75
75
  profileConfigPath: string;
76
+ providerAuthRegistry: NonNullable<AUP['providerAuthRegistry']>;
76
77
  onPanelOpen: X['fleet']['onPanelOpen'];
77
78
  interruptController: RC['interruptController'];
78
79
  enhanceController: RC['enhanceController'];