@wrongstack/cli 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/data/providers.json +21 -21
  2. package/dist/{acp-3LARESEO.js → acp-JK4ZQO3R.js} +4 -3
  3. package/dist/{auth-KIBJZZIE.js → auth-XD3GN5RJ.js} +80 -56
  4. package/dist/auth-menu/index.d.ts +1 -0
  5. package/dist/auth-menu/oauth-menu.d.ts +3 -1
  6. package/dist/auth-menu/panel-service.d.ts +2 -0
  7. package/dist/auth-menu/provider-auth-login.d.ts +12 -0
  8. package/dist/auth-menu/types.d.ts +3 -0
  9. package/dist/auto-discover-providers-DXR25GTG.js +7 -0
  10. package/dist/boot/dispatch-webui.d.ts +1 -0
  11. package/dist/boot/system-prompt-builder.d.ts +7 -0
  12. package/dist/boot/system-prompt-menu.d.ts +7 -0
  13. package/dist/boot/system-prompt.d.ts +2 -1
  14. package/dist/chimera-reviewer-policy.d.ts +1 -1
  15. package/dist/{chunk-4HV5RKZH.js → chunk-4NHD5OXJ.js} +3 -3
  16. package/dist/chunk-D5GB5MHA.js +87 -0
  17. package/dist/chunk-DAKVBMD4.js +36 -0
  18. package/dist/{chunk-Z7A5MXKJ.js → chunk-E6RFXHWD.js} +1 -2
  19. package/dist/{chunk-ZSZ3EYWH.js → chunk-GMY45LO6.js} +9 -5
  20. package/dist/{chunk-ETYHZPXP.js → chunk-IUEKNHPT.js} +12 -10
  21. package/dist/{chunk-MNQQ4ZNF.js → chunk-ONOT5OJ2.js} +290 -687
  22. package/dist/chunk-SIGUWXAA.js +43 -0
  23. package/dist/{chunk-TEBMCYZN.js → chunk-SIS37L3W.js} +58 -2
  24. package/dist/{chunk-5IA5337I.js → chunk-U6KCWRMC.js} +4 -2
  25. package/dist/chunk-UQUYBDMG.js +51 -0
  26. package/dist/{cli-context-CYMKNOK3.js → cli-context-Q6QP534K.js} +20 -9
  27. package/dist/{cli-main-TTIVR4DI.js → cli-main-JQXCDZEA.js} +2979 -2279
  28. package/dist/config-transfer-2YF3CRTN.js +99 -0
  29. package/dist/execute-deps.d.ts +1 -0
  30. package/dist/{execution-3Y55IWBK.js → execution-KH7WJNAX.js} +26 -19
  31. package/dist/index.js +4 -4
  32. package/dist/live-settings-input.d.ts +2 -0
  33. package/dist/{mailbox-serve-VUCWZ2SJ.js → mailbox-serve-X3CR6VFW.js} +4 -3
  34. package/dist/{modeldiag-FMJT37SN.js → modeldiag-46CMWUNM.js} +31 -24
  35. package/dist/{plugin-usage-HFBI3TFT.js → plugin-usage-M6KET4OZ.js} +2 -2
  36. package/dist/{plugins-PZ2VZL7V.js → plugins-U7KGQAUG.js} +3 -3
  37. package/dist/{providers-models-YVMVYWRS.js → providers-models-6MOGAOVK.js} +2 -2
  38. package/dist/settings-behavior-sections.d.ts +20 -0
  39. package/dist/{short-circuit-flags-6PSP56L7.js → short-circuit-flags-ZNZX44MC.js} +3 -3
  40. package/dist/slash-commands/codebase-map.d.ts +11 -0
  41. package/dist/slash-commands/command-context.d.ts +7 -0
  42. package/dist/slash-commands/context.d.ts +10 -0
  43. package/dist/slash-commands/openai-quota.d.ts +31 -0
  44. package/dist/subcommands/handlers/config-transfer.d.ts +6 -0
  45. package/dist/{subcommands-HZQKA4G2.js → subcommands-CUTGBDKP.js} +2 -2
  46. package/dist/{webui-server-T6AMOXJJ.js → webui-server-QWBUT7BO.js} +22 -5
  47. package/dist/webui-server-options.d.ts +1 -0
  48. package/dist/wiring/atlas-prompt-contributor.d.ts +54 -0
  49. package/dist/wiring/cli-execute-builder.d.ts +1 -0
  50. package/dist/wiring/codebase-embeddings.d.ts +31 -0
  51. package/dist/wiring/command-host-state.d.ts +2 -0
  52. package/dist/wiring/concept-summarizer.d.ts +32 -0
  53. package/dist/wiring/external-plugins.d.ts +1 -0
  54. package/dist/wiring/lifecycle-plugins.d.ts +2 -1
  55. package/dist/wiring/plugins.d.ts +2 -1
  56. package/dist/wiring/provider.d.ts +2 -1
  57. package/package.json +29 -29
  58. package/dist/auto-discover-providers-VQU3IZMR.js +0 -7
  59. package/dist/chunk-52C7PD2H.js +0 -61
  60. package/dist/chunk-TNK6237M.js +0 -262
@@ -0,0 +1,99 @@
1
+ import {
2
+ extractBehaviorSettings,
3
+ mergeBehaviorSettings
4
+ } from "./chunk-UQUYBDMG.js";
5
+
6
+ // src/subcommands/handlers/config-transfer.ts
7
+ import * as fs from "node:fs/promises";
8
+ import * as path from "node:path";
9
+ import { color, toErrorMessage } from "@wrongstack/core/utils";
10
+ var FILE_NAME = "wstack-config.json";
11
+ var SAFETY_NOTE = "No providers, API keys, fallbacks, or model/fallback routing data is included.";
12
+ var configExportCmd = async (_args, deps) => {
13
+ const settings = extractBehaviorSettings(deps.config);
14
+ const payload = {
15
+ kind: "wstack-config",
16
+ version: 1,
17
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
18
+ profile: String(
19
+ deps.config["activeProfile"] ?? "default"
20
+ ),
21
+ settings
22
+ };
23
+ const target = path.resolve(deps.cwd, FILE_NAME);
24
+ try {
25
+ await fs.writeFile(target, `${JSON.stringify(payload, null, 2)}
26
+ `, "utf8");
27
+ } catch (err) {
28
+ deps.renderer.writeError(`Export failed: ${toErrorMessage(err)}`);
29
+ return 1;
30
+ }
31
+ deps.renderer.write(`${color.green("\u2713")} Wrote ${color.cyan(target)}
32
+ `);
33
+ deps.renderer.write(` Sections: ${color.cyan(Object.keys(settings).join(", "))}
34
+ `);
35
+ deps.renderer.write(` ${color.dim(SAFETY_NOTE)}
36
+ `);
37
+ return 0;
38
+ };
39
+ var configImportCmd = async (_args, deps) => {
40
+ const target = path.resolve(deps.cwd, FILE_NAME);
41
+ let payload;
42
+ try {
43
+ payload = JSON.parse(await fs.readFile(target, "utf8"));
44
+ } catch (err) {
45
+ deps.renderer.writeError(
46
+ `Import failed: cannot read ${FILE_NAME} in ${deps.cwd} \u2014 ${toErrorMessage(err)}`
47
+ );
48
+ return 1;
49
+ }
50
+ if (payload["kind"] !== "wstack-config") {
51
+ deps.renderer.writeError(
52
+ `Import failed: ${FILE_NAME} is not a wstack config export (missing "kind": "wstack-config").`
53
+ );
54
+ return 1;
55
+ }
56
+ const settings = payload["settings"];
57
+ if (settings === null || typeof settings !== "object") {
58
+ deps.renderer.writeError("Import failed: the export carries no settings object.");
59
+ return 1;
60
+ }
61
+ const profile = String(
62
+ deps.config["activeProfile"] ?? "default"
63
+ );
64
+ const profilePath = deps.paths.profileConfig(profile);
65
+ let disk = {};
66
+ try {
67
+ disk = JSON.parse(await fs.readFile(profilePath, "utf8"));
68
+ } catch {
69
+ }
70
+ const applied = mergeBehaviorSettings(disk, settings);
71
+ if (applied.length === 0) {
72
+ deps.renderer.write(
73
+ `${color.amber("Nothing to import")} \u2014 the export carries none of the known behavior sections.
74
+ `
75
+ );
76
+ return 0;
77
+ }
78
+ try {
79
+ await fs.writeFile(profilePath, `${JSON.stringify(disk, null, 2)}
80
+ `, "utf8");
81
+ } catch (err) {
82
+ deps.renderer.writeError(`Import failed while writing profile: ${toErrorMessage(err)}`);
83
+ return 1;
84
+ }
85
+ deps.renderer.write(
86
+ `${color.green("\u2713")} Imported ${applied.length} section(s) into profile ${color.cyan(profile)}: ${color.cyan(applied.join(", "))}
87
+ `
88
+ );
89
+ deps.renderer.write(` ${color.dim(SAFETY_NOTE)}
90
+ `);
91
+ deps.renderer.write(` ${color.dim("Restart wstack so imported settings take effect.")}
92
+ `);
93
+ return 0;
94
+ };
95
+ export {
96
+ configExportCmd,
97
+ configImportCmd
98
+ };
99
+ //# sourceMappingURL=config-transfer-2YF3CRTN.js.map
@@ -149,6 +149,7 @@ interface SessionDeps {
149
149
  /** Provider/model registry, selection and switching. */
150
150
  interface ProviderDeps {
151
151
  statusTracker?: import('@wrongstack/core/coordination').ProviderModelStatusTracker | undefined;
152
+ providerAuthRegistry: import('@wrongstack/core/registry').ProviderAuthRegistry;
152
153
  modelsRegistry: ModelsRegistry;
153
154
  savedProviderCfg: ProviderConfig | undefined;
154
155
  resolvedProvider: ResolvedProvider | undefined;
@@ -178,6 +178,7 @@ async function runWebUIDispatch(ctx) {
178
178
  globalConfigPath,
179
179
  projectSessionsDir,
180
180
  modelsRegistry,
181
+ providerAuthRegistry,
181
182
  mcpRegistry,
182
183
  brain,
183
184
  brainSettings,
@@ -211,7 +212,7 @@ async function runWebUIDispatch(ctx) {
211
212
  const isSimpleUi = !isSessionChild && flags["simpleui"] === true;
212
213
  agent.disableInteractiveConfirmation();
213
214
  renderer.setSilent(true);
214
- const { runWebUI } = await import("./webui-server-T6AMOXJJ.js");
215
+ const { runWebUI } = await import("./webui-server-QWBUT7BO.js");
215
216
  const flagValue = (names) => {
216
217
  for (const name of names) {
217
218
  if (!Object.hasOwn(flags, name)) continue;
@@ -305,6 +306,7 @@ async function runWebUIDispatch(ctx) {
305
306
  agentTranscripts,
306
307
  hqAllowExec: flagBoolean(["hq-allow-exec"]) ?? false,
307
308
  modelsRegistry,
309
+ providerAuthRegistry,
308
310
  globalConfigPath,
309
311
  profileConfigPath: ctx.profileConfigPath,
310
312
  mcpRegistry,
@@ -1874,20 +1876,20 @@ function createSettingsAdapter(ctx) {
1874
1876
  const contextModeRaw = cfg.context?.mode;
1875
1877
  const contextMode = contextModeRaw === "frugal" || contextModeRaw === "deep" ? contextModeRaw : "balanced";
1876
1878
  const reasoningEffortRaw = modelRuntime?.reasoning?.effort;
1877
- const reasoningEffort = reasoningEffortRaw === "none" || reasoningEffortRaw === "minimal" || reasoningEffortRaw === "low" || reasoningEffortRaw === "medium" || reasoningEffortRaw === "high" || reasoningEffortRaw === "xhigh" || reasoningEffortRaw === "max" ? reasoningEffortRaw : "high";
1879
+ const reasoningEffort = reasoningEffortRaw === "none" || reasoningEffortRaw === "minimal" || reasoningEffortRaw === "low" || reasoningEffortRaw === "medium" || reasoningEffortRaw === "high" || reasoningEffortRaw === "xhigh" || reasoningEffortRaw === "max" ? reasoningEffortRaw : "medium";
1878
1880
  const featuresAllow = cfg.features?.allowOutsideProjectRoot;
1879
1881
  const toolsRestrict = cfg.tools?.restrictToProjectRoot;
1880
1882
  const resolvedAllow = featuresAllow !== void 0 ? featuresAllow : toolsRestrict !== void 0 ? !toolsRestrict : true;
1881
1883
  const resolvedRestrict = !resolvedAllow;
1882
1884
  return {
1883
1885
  mode,
1884
- delayMs: autonomy?.autoProceedDelayMs ?? 45e3,
1886
+ delayMs: autonomy?.autoProceedDelayMs ?? 15e3,
1885
1887
  titleAnimation: autonomy?.terminalTitleAnimation !== false,
1886
- yolo: cfg.yolo ?? autonomy?.yolo ?? false,
1888
+ yolo: cfg.yolo ?? autonomy?.yolo ?? true,
1887
1889
  fleetChatVerbosity: resolveFleetChatVerbosity(cfg.autonomy),
1888
- chime: autonomy?.chime ?? false,
1890
+ chime: autonomy?.chime ?? true,
1889
1891
  confirmExit: autonomy?.confirmExit !== false,
1890
- nextPrediction: cfg.nextPrediction ?? false,
1892
+ nextPrediction: cfg.nextPrediction ?? true,
1891
1893
  featureMcp: cfg.features?.mcp !== false,
1892
1894
  featurePlugins: cfg.features?.plugins !== false,
1893
1895
  featureMemory: cfg.features?.memory !== false,
@@ -1901,11 +1903,11 @@ function createSettingsAdapter(ctx) {
1901
1903
  contextAutoCompact: cfg.context?.autoCompact !== false,
1902
1904
  contextStrategy: cfg.context?.strategy ?? "hybrid",
1903
1905
  contextMode,
1904
- maxConcurrent: cfg.maxConcurrent ?? 4,
1905
- logLevel: cfg.log?.level ?? "info",
1906
- auditLevel: cfg.session?.auditLevel ?? "standard",
1906
+ maxConcurrent: cfg.maxConcurrent ?? 10,
1907
+ logLevel: cfg.log?.level ?? "warn",
1908
+ auditLevel: cfg.session?.auditLevel ?? "full",
1907
1909
  indexOnStart: cfg.indexing?.onSessionStart !== false,
1908
- maxIterations: cfg.tools?.maxIterations ?? 500,
1910
+ maxIterations: cfg.tools?.maxIterations ?? 0,
1909
1911
  // Multi-diff summary threshold — mirrors the WebUI parity path
1910
1912
  // (pref-helpers.ts reads/writes `decrypted.autonomy.multiDiffSummaryThreshold`;
1911
1913
  // here we read from `decrypted.tools.multiDiffSummaryThreshold` to
@@ -1913,17 +1915,18 @@ function createSettingsAdapter(ctx) {
1913
1915
  multiDiffSummaryThreshold: cfg.tools?.multiDiffSummaryThreshold ?? 5,
1914
1916
  nextStepsTool: cfg.tools?.nextsteps?.enabled === true,
1915
1917
  restrictFsToRoot: resolvedRestrict,
1916
- autoProceedMaxIterations: cfg.autonomy?.autoProceedMaxIterations ?? 50,
1918
+ autoProceedMaxIterations: cfg.autonomy?.autoProceedMaxIterations ?? 0,
1917
1919
  debugStream: cfg.debugStream ?? false,
1918
1920
  shellBangWarningDontShowAgain: autonomy?.shellBangWarningDontShowAgain === true,
1919
1921
  statuslineMode: autonomy?.statuslineMode === "no-color" ? "no-color" : autonomy?.statuslineMode === "detailed" ? "detailed" : "minimum",
1920
1922
  thinkingWord: normalizeTuiThinkingWord(autonomy?.thinkingWord),
1921
1923
  animationStyle: normalizeAnimationStyle(autonomy?.animationStyle),
1922
1924
  configScope: cfg.configScope ?? "global",
1923
- systemPromptVariant: cfg.systemPrompt?.variant === "lite" || cfg.systemPrompt?.variant === "pro" ? cfg.systemPrompt.variant : "default",
1924
- enhanceDelayMs: cfg.autonomy?.enhanceDelayMs ?? 6e4,
1925
+ systemPromptVariant: cfg.systemPrompt?.variant === "lite" || cfg.systemPrompt?.variant === "pro" ? cfg.systemPrompt.variant : cfg.systemPrompt?.variant === "default" ? "default" : "pro",
1926
+ enhanceDelayMs: cfg.autonomy?.enhanceDelayMs ?? 15e3,
1925
1927
  enhanceEnabled: cfg.autonomy?.enhance ?? true,
1926
- enhanceLanguage: cfg.autonomy?.enhanceLanguage === "english" ? "english" : "original",
1928
+ preRefineSeconds: cfg.autonomy?.preRefineSeconds ?? 3,
1929
+ enhanceLanguage: cfg.autonomy?.enhanceLanguage === "english" ? "english" : cfg.autonomy?.enhanceLanguage === "original" ? "original" : "english",
1927
1930
  midRunSendPicker: cfg.autonomy?.midRunSendPicker ?? true,
1928
1931
  mouseMode: autonomy?.mouseMode ?? false,
1929
1932
  autonomyNextPrompt: cfg.autonomy?.autonomyNextPrompt ?? "auto {{suggestion}}",
@@ -1933,7 +1936,7 @@ function createSettingsAdapter(ctx) {
1933
1936
  cacheTtl: modelRuntime?.cache?.ttl === "5m" || modelRuntime?.cache?.ttl === "1h" ? modelRuntime.cache.ttl : "default",
1934
1937
  breakerEnabled: cfg.circuitBreaker?.enabled === true,
1935
1938
  breakerAutoKillResetMs: cfg.circuitBreaker?.autoKillResetMs ?? 6e4,
1936
- showModelReasoning: autonomy?.showModelReasoning ?? true,
1939
+ showModelReasoning: autonomy?.showModelReasoning ?? false,
1937
1940
  showAgentSwarmPanel: coerceAgentSwarmMode(autonomy?.showAgentSwarmPanel),
1938
1941
  showSidebar: autonomy?.showSidebar ?? true,
1939
1942
  // Migrate the legacy `autonomy.showAgentSwarmPanel: 'sidebar'` into
@@ -1960,7 +1963,7 @@ function createSettingsAdapter(ctx) {
1960
1963
  }
1961
1964
  async function saveSettings(s) {
1962
1965
  try {
1963
- if (s.mode !== void 0 || s.delayMs !== void 0 || s.titleAnimation !== void 0 || s.yolo !== void 0 || s.fleetChatVerbosity !== void 0 || s.chime !== void 0 || s.confirmExit !== void 0 || s.mouseMode !== void 0 || s.featureMcp !== void 0 || s.featurePlugins !== void 0 || s.featureMemory !== void 0 || s.featureSkills !== void 0 || s.featureModelsRegistry !== void 0 || s.featureTokenSaving !== void 0 || s.allowOutsideProjectRoot !== void 0 || s.contextAutoCompact !== void 0 || s.contextStrategy !== void 0 || s.contextMode !== void 0 || s.maxConcurrent !== void 0 || s.logLevel !== void 0 || s.auditLevel !== void 0 || s.indexOnStart !== void 0 || s.maxIterations !== void 0 || s.multiDiffSummaryThreshold !== void 0 || s.nextStepsTool !== void 0 || s.restrictFsToRoot !== void 0 || s.nextPrediction !== void 0 || s.debugStream !== void 0 || s.shellBangWarningDontShowAgain !== void 0 || s.configScope !== void 0 || s.enhanceDelayMs !== void 0 || s.enhanceEnabled !== void 0 || s.enhanceLanguage !== void 0 || s.midRunSendPicker !== void 0 || s.statuslineMode !== void 0 || s.thinkingWord !== void 0 || s.animationStyle !== void 0 || s.autonomyNextPrompt !== void 0 || s.autoProceedMaxIterations !== void 0 || s.reasoningMode !== void 0 || s.reasoningEffort !== void 0 || s.reasoningPreserve !== void 0 || s.cacheTtl !== void 0 || s.breakerEnabled !== void 0 || s.breakerAutoKillResetMs !== void 0 || s.showModelReasoning !== void 0 || s.showAgentSwarmPanel !== void 0 || s.showSidebar !== void 0 || s.panelPositions !== void 0 || s.showSageMemoryInject !== void 0 || s.sageMemoryInjectThreshold !== void 0 || s.readSymbols !== void 0 || // WrongProxy / WrongTrace: gate the persisted-section write on
1966
+ if (s.mode !== void 0 || s.delayMs !== void 0 || s.titleAnimation !== void 0 || s.yolo !== void 0 || s.fleetChatVerbosity !== void 0 || s.chime !== void 0 || s.confirmExit !== void 0 || s.mouseMode !== void 0 || s.featureMcp !== void 0 || s.featurePlugins !== void 0 || s.featureMemory !== void 0 || s.featureSkills !== void 0 || s.featureModelsRegistry !== void 0 || s.featureTokenSaving !== void 0 || s.allowOutsideProjectRoot !== void 0 || s.contextAutoCompact !== void 0 || s.contextStrategy !== void 0 || s.contextMode !== void 0 || s.maxConcurrent !== void 0 || s.logLevel !== void 0 || s.auditLevel !== void 0 || s.indexOnStart !== void 0 || s.maxIterations !== void 0 || s.multiDiffSummaryThreshold !== void 0 || s.nextStepsTool !== void 0 || s.restrictFsToRoot !== void 0 || s.nextPrediction !== void 0 || s.debugStream !== void 0 || s.shellBangWarningDontShowAgain !== void 0 || s.configScope !== void 0 || s.enhanceDelayMs !== void 0 || s.enhanceEnabled !== void 0 || s.preRefineSeconds !== void 0 || s.enhanceLanguage !== void 0 || s.midRunSendPicker !== void 0 || s.statuslineMode !== void 0 || s.thinkingWord !== void 0 || s.animationStyle !== void 0 || s.autonomyNextPrompt !== void 0 || s.autoProceedMaxIterations !== void 0 || s.reasoningMode !== void 0 || s.reasoningEffort !== void 0 || s.reasoningPreserve !== void 0 || s.cacheTtl !== void 0 || s.breakerEnabled !== void 0 || s.breakerAutoKillResetMs !== void 0 || s.showModelReasoning !== void 0 || s.showAgentSwarmPanel !== void 0 || s.showSidebar !== void 0 || s.panelPositions !== void 0 || s.showSageMemoryInject !== void 0 || s.sageMemoryInjectThreshold !== void 0 || s.readSymbols !== void 0 || // WrongProxy / WrongTrace: gate the persisted-section write on
1964
1967
  // either key being present in the live patch. Without this, a
1965
1968
  // picker toggle round-trip would silently no-op the persistence
1966
1969
  // layer (the runtime probe would never read the change).
@@ -2005,6 +2008,7 @@ function createSettingsAdapter(ctx) {
2005
2008
  if (s.mouseMode !== void 0) autonomy.mouseMode = s.mouseMode;
2006
2009
  if (s.enhanceDelayMs !== void 0) autonomy.enhanceDelayMs = s.enhanceDelayMs;
2007
2010
  if (s.enhanceEnabled !== void 0) autonomy.enhance = s.enhanceEnabled;
2011
+ if (s.preRefineSeconds !== void 0) autonomy.preRefineSeconds = s.preRefineSeconds;
2008
2012
  if (s.enhanceLanguage !== void 0) autonomy.enhanceLanguage = s.enhanceLanguage;
2009
2013
  if (s.midRunSendPicker !== void 0) autonomy.midRunSendPicker = s.midRunSendPicker;
2010
2014
  if (s.shellBangWarningDontShowAgain !== void 0)
@@ -2570,6 +2574,7 @@ var CHIMERA_REVIEW_READ_ONLY_TOOLS = Object.freeze([
2570
2574
  "codebase-stats",
2571
2575
  "codebase-search",
2572
2576
  "codebase-skeleton",
2577
+ "codebase-context",
2573
2578
  "codebase-repo-map",
2574
2579
  "codebase-incoming-calls",
2575
2580
  "codebase-outgoing-calls"
@@ -4445,7 +4450,7 @@ ${list}`);
4445
4450
  function parsePredictions(raw, max = 3) {
4446
4451
  const text = raw.trim();
4447
4452
  if (!text) return [];
4448
- if (/^none\.?\s*$/i.test(text) || /^no further steps/i.test(text)) return [];
4453
+ if (/^none\.?\s*$/i.test(text) || /^no further steps(?: needed)?\.?\s*$/i.test(text)) return [];
4449
4454
  const out = [];
4450
4455
  for (const lineRaw of text.split("\n")) {
4451
4456
  const line = lineRaw.trim();
@@ -4983,7 +4988,7 @@ function printBanner(renderer, projectName) {
4983
4988
  }
4984
4989
 
4985
4990
  // src/repl.ts
4986
- var DEFAULT_MAX_CONSECUTIVE_AUTO_PROCEED = 50;
4991
+ var DEFAULT_MAX_CONSECUTIVE_AUTO_PROCEED = 0;
4987
4992
  async function runRepl(opts) {
4988
4993
  if (opts.banner !== false) printBanner(opts.renderer, opts.projectName);
4989
4994
  await renderGoalBanner(opts);
@@ -6091,6 +6096,7 @@ async function execute(deps) {
6091
6096
  },
6092
6097
  provider: {
6093
6098
  modelsRegistry,
6099
+ providerAuthRegistry,
6094
6100
  savedProviderCfg,
6095
6101
  resolvedProvider,
6096
6102
  statusTracker,
@@ -6595,6 +6601,7 @@ async function execute(deps) {
6595
6601
  profileConfigPath: wpaths.profileConfig(profileName),
6596
6602
  projectSessionsDir: wpaths.projectSessions,
6597
6603
  modelsRegistry,
6604
+ providerAuthRegistry,
6598
6605
  mcpRegistry,
6599
6606
  brain,
6600
6607
  brainSettings,
@@ -6741,4 +6748,4 @@ export {
6741
6748
  execute,
6742
6749
  resolveReviewerFallbackModels
6743
6750
  };
6744
- //# sourceMappingURL=execution-3Y55IWBK.js.map
6751
+ //# sourceMappingURL=execution-KH7WJNAX.js.map
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-Z7A5MXKJ.js";
11
+ } from "./chunk-E6RFXHWD.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-6PSP56L7.js");
19
+ const { handleHelpVersionShortCircuit } = await import("./short-circuit-flags-ZNZX44MC.js");
20
20
  const earlyExit = await handleHelpVersionShortCircuit(argv);
21
21
  if (earlyExit !== null) return earlyExit;
22
22
  }
23
- const { initializeCli } = await import("./cli-context-CYMKNOK3.js");
23
+ const { initializeCli } = await import("./cli-context-Q6QP534K.js");
24
24
  const cliCtx = await initializeCli(argv);
25
25
  if (typeof cliCtx === "number") return cliCtx;
26
- const { runInteractive } = await import("./cli-main-TTIVR4DI.js");
26
+ const { runInteractive } = await import("./cli-main-JQXCDZEA.js");
27
27
  return runInteractive(cliCtx);
28
28
  }
29
29
 
@@ -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. */
@@ -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
@@ -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-U6KCWRMC.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-U7KGQAUG.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
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The behavior half of the config — the sections `CONFIG_BEHAVIOR_DEFAULTS`
3
+ * defines that describe *how the product behaves*. One shared list so
4
+ * `/settings reset` (factory restore) and `wstack config-export` /
5
+ * `wstack config-import` (portable settings transfer) can never drift apart.
6
+ *
7
+ * Identity and user-owned namespaces are NEVER part of this set: `provider`,
8
+ * `model`, `providers` (API keys), `mcpServers`, `extensions`, `plugins`,
9
+ * `hq`, `launch`, `fallbackAuto`, `fallbackProfiles`, `fallbackModels`,
10
+ * `fallbackBridge`, `favoriteModels*`, `modelMatrix`, `modelTiers`,
11
+ * `configScope`, `uiLocale`, `version`, `activeProfile`. Portable exports are
12
+ * therefore structurally free of credentials and model-routing data.
13
+ */
14
+ export declare const BEHAVIOR_SECTION_KEYS: readonly ['context', 'tools', 'log', 'features', 'session', 'indexing', 'circuitBreaker', 'modelRuntime', 'Sage', 'skills', 'systemPrompt', 'autonomy', 'maxConcurrent', 'yolo', 'nextPrediction', 'hints', 'debugStream'];
15
+ export type BehaviorSectionKey = (typeof BEHAVIOR_SECTION_KEYS)[number];
16
+ /** Deep-copy the behavior sections out of a loaded config. */
17
+ export declare function extractBehaviorSettings(config: Record<string, unknown>): Record<string, unknown>;
18
+ /** Merge behavior sections from a portable export over an existing config object. */
19
+ export declare function mergeBehaviorSettings(target: Record<string, unknown>, settings: Record<string, unknown>): string[];
20
+ //# sourceMappingURL=settings-behavior-sections.d.ts.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  handleHelpVersionShortCircuit
3
- } from "./chunk-4HV5RKZH.js";
3
+ } from "./chunk-4NHD5OXJ.js";
4
4
  import "./chunk-FPIWTJ2G.js";
5
5
  import "./chunk-XJXDOF63.js";
6
- import "./chunk-Z7A5MXKJ.js";
6
+ import "./chunk-E6RFXHWD.js";
7
7
  export {
8
8
  handleHelpVersionShortCircuit
9
9
  };
10
- //# sourceMappingURL=short-circuit-flags-6PSP56L7.js.map
10
+ //# sourceMappingURL=short-circuit-flags-ZNZX44MC.js.map
@@ -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;
@@ -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
@@ -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
@@ -0,0 +1,6 @@
1
+ import type { SubcommandHandler } from '../contracts.js';
2
+ /** `wstack config-export` — write portable behavior settings to ./wstack-config.json. */
3
+ export declare const configExportCmd: SubcommandHandler;
4
+ /** `wstack config-import` — apply ./wstack-config.json behavior settings to the active profile. */
5
+ export declare const configImportCmd: SubcommandHandler;
6
+ //# sourceMappingURL=config-transfer.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  subcommandNames,
3
3
  subcommands
4
- } from "./chunk-ETYHZPXP.js";
4
+ } from "./chunk-IUEKNHPT.js";
5
5
  export {
6
6
  subcommandNames,
7
7
  subcommands
8
8
  };
9
- //# sourceMappingURL=subcommands-HZQKA4G2.js.map
9
+ //# sourceMappingURL=subcommands-CUTGBDKP.js.map