@wrongstack/cli 1.0.19 → 1.0.24

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 (124) hide show
  1. package/dist/{acp-INCNOH42.js → acp-AJWSKWE5.js} +18 -7
  2. package/dist/arg-parser.d.ts +1 -0
  3. package/dist/{auth-YXK3EDUL.js → auth-GRBZ7Y3D.js} +61 -15
  4. package/dist/auth-menu/direct.d.ts +1 -0
  5. package/dist/auth-menu/local.d.ts +2 -0
  6. package/dist/auth-menu/oauth-menu.d.ts +3 -1
  7. package/dist/auth-menu/panel-service.d.ts +20 -0
  8. package/dist/{bench-YBU6BVQP.js → bench-N5K7Z5O3.js} +2 -2
  9. package/dist/boot/config-backup-recovery.d.ts +2 -1
  10. package/dist/boot/dispatch-webui.d.ts +11 -0
  11. package/dist/boot/short-circuit-desktop.d.ts +1 -0
  12. package/dist/boot/tui-project-picker-callback.d.ts +1 -1
  13. package/dist/boot/tui-settings-adapter.d.ts +15 -2
  14. package/dist/{boot-auto-thin-MANHOYHE.js → boot-auto-thin-6Q56FY3F.js} +3 -2
  15. package/dist/{chunk-6WRKAACA.js → chunk-2BKFWIER.js} +4 -2
  16. package/dist/{chunk-JY52HWL6.js → chunk-2EBVTYJR.js} +2 -2
  17. package/dist/chunk-3OCUS3VN.js +46 -0
  18. package/dist/chunk-424ORSE7.js +56 -0
  19. package/dist/{chunk-KEPABQYT.js → chunk-5SEYGOCH.js} +8 -82
  20. package/dist/chunk-BBHWW6LR.js +549 -0
  21. package/dist/{chunk-CJTBLTS4.js → chunk-BLD5DSVA.js} +4 -3
  22. package/dist/{chunk-KK2LB3ZS.js → chunk-DRM7PSW7.js} +9 -5
  23. package/dist/{chunk-XJ7K67PP.js → chunk-JF2MULWF.js} +17 -10
  24. package/dist/{chunk-SIS37L3W.js → chunk-L2RVEQWO.js} +211 -193
  25. package/dist/{chunk-RDHFXOJM.js → chunk-LFMVHT3R.js} +106 -57
  26. package/dist/chunk-LUMETJFO.js +171 -0
  27. package/dist/{chunk-C3Z4N6A6.js → chunk-MHEBWVXL.js} +6 -2
  28. package/dist/{chunk-2ENZU66X.js → chunk-PGKJ2OQP.js} +5 -5
  29. package/dist/{chunk-672UXYL3.js → chunk-QBBF7GIK.js} +2 -2
  30. package/dist/{chunk-DE7BZDNK.js → chunk-QFPQXKCG.js} +11 -3
  31. package/dist/chunk-R4QGL6GB.js +10 -0
  32. package/dist/chunk-S4FFHDJG.js +93 -0
  33. package/dist/chunk-SFBFYIOW.js +271 -0
  34. package/dist/{chunk-JX6KL7OF.js → chunk-SKPDE62W.js} +4 -3
  35. package/dist/{chunk-RMQNCHGO.js → chunk-U46QR4WR.js} +5 -9
  36. package/dist/{chunk-B4JLSXZB.js → chunk-WSTVGC2C.js} +73 -45
  37. package/dist/chunk-YBUCXXYZ.js +36 -0
  38. package/dist/{chunk-2VMJ3E5Z.js → chunk-YTEOAWOJ.js} +6 -2
  39. package/dist/{chunk-GPPRNAKW.js → chunk-ZMX5HRLI.js} +2 -2
  40. package/dist/{chunk-YLQEGYV4.js → chunk-ZZRSG7VK.js} +14 -4
  41. package/dist/{cli-context-33F74CSZ.js → cli-context-34Q5IJRA.js} +121 -89
  42. package/dist/cli-entry-point.d.ts +2 -0
  43. package/dist/{cli-main-FNGMKPBA.js → cli-main-AELJDBGU.js} +1439 -1276
  44. package/dist/config-doctor.d.ts +10 -2
  45. package/dist/{config-transfer-2YF3CRTN.js → config-transfer-RUWLDCNK.js} +34 -13
  46. package/dist/{diag-doctor-ANPRUYFM.js → diag-doctor-WIFJH3XH.js} +2 -2
  47. package/dist/execute-deps.d.ts +2 -1
  48. package/dist/{execution-A6WJLSOC.js → execution-PYC5FCS4.js} +303 -256
  49. package/dist/{hq-XQWQTRDA.js → hq-JTUTFI4L.js} +274 -258
  50. package/dist/hq-command-controller.d.ts +1 -1
  51. package/dist/{hq-server-IIBZQZU4.js → hq-server-PC7GZMPT.js} +2 -2
  52. package/dist/{hq-service-L5INQFM4.js → hq-service-NW56MUP2.js} +11 -4
  53. package/dist/index.d.ts +1 -1
  54. package/dist/index.js +17 -12
  55. package/dist/kanban-supervisor-67ECABTD.js +7 -0
  56. package/dist/live-settings-input.d.ts +7 -0
  57. package/dist/{mailbox-serve-3GFOK2I7.js → mailbox-serve-WDOCH6KR.js} +3 -3
  58. package/dist/{mcp-DC5WSBOO.js → mcp-LBS45HWZ.js} +4 -4
  59. package/dist/modeldiag-36OGAL5C.js +828 -0
  60. package/dist/{per-subcommand-help-DHTYU524.js → per-subcommand-help-XE77MTGJ.js} +3 -3
  61. package/dist/permission-prompt-mirror.d.ts +1 -1
  62. package/dist/permission-prompt.d.ts +2 -2
  63. package/dist/plugin-config.d.ts +12 -0
  64. package/dist/plugin-management-types.d.ts +31 -0
  65. package/dist/plugin-management.d.ts +2 -30
  66. package/dist/plugin-package-install.d.ts +3 -0
  67. package/dist/{plugin-usage-M6KET4OZ.js → plugin-usage-S5LVGMBW.js} +6 -5
  68. package/dist/{plugins-WJLW6ULV.js → plugins-RHBIVLI7.js} +4 -3
  69. package/dist/provider-config-utils.d.ts +1 -6
  70. package/dist/{providers-models-LFNZ5WI7.js → providers-models-2CFG46RD.js} +41 -31
  71. package/dist/release-asset-download.d.ts +3 -0
  72. package/dist/services/dispatch-classifier.d.ts +39 -5
  73. package/dist/{sessions-config-UL45XKX7.js → sessions-config-IQUH2GXT.js} +13 -5
  74. package/dist/settings-menu.d.ts +2 -0
  75. package/dist/short-circuit-flags-SDT53OML.js +10 -0
  76. package/dist/{simpleui-dist-CXSIDAXZ.js → simpleui-dist-7BQISSEP.js} +7 -3
  77. package/dist/skill-suggest-L2EVWB6R.js +290 -0
  78. package/dist/slash-commands/effort.d.ts +1 -1
  79. package/dist/slash-commands/fallback.d.ts +1 -1
  80. package/dist/slash-commands/gitid.d.ts +1 -1
  81. package/dist/slash-commands/jev.d.ts +4 -0
  82. package/dist/slash-commands/openai-quota.d.ts +15 -0
  83. package/dist/slash-commands/sdd-task-mutations.d.ts +4 -0
  84. package/dist/slash-commands/settings-keys.d.ts +2 -0
  85. package/dist/slash-commands/settings-reset.d.ts +6 -0
  86. package/dist/standalone-update-MW47J3AK.js +164 -0
  87. package/dist/standalone-update.d.ts +19 -0
  88. package/dist/subcommands/handlers/hq-alerts.d.ts +3 -0
  89. package/dist/subcommands/handlers/hq-audit.d.ts +46 -0
  90. package/dist/subcommands/handlers/hq-data-dir.d.ts +13 -0
  91. package/dist/subcommands/handlers/skill-suggest.d.ts +21 -0
  92. package/dist/subcommands/handlers/typesafe-brain-replay.d.ts +26 -0
  93. package/dist/subcommands/handlers/typesafe-judgment-check.d.ts +3 -0
  94. package/dist/subcommands/handlers/typesafe-topic-replay.d.ts +19 -0
  95. package/dist/subcommands/handlers/typesafe-triage-replay.d.ts +18 -0
  96. package/dist/subcommands/handlers/typesafe.d.ts +23 -0
  97. package/dist/{subcommands-XSLXMIDP.js → subcommands-ZTSIN7LG.js} +2 -2
  98. package/dist/typesafe-HVEVPA6R.js +316 -0
  99. package/dist/typesafe-brain-replay-C5276FVR.js +222 -0
  100. package/dist/typesafe-judgment-check-GGYYV5UF.js +29 -0
  101. package/dist/typesafe-topic-replay-4W73BOLV.js +218 -0
  102. package/dist/typesafe-triage-replay-FGAW7QM7.js +215 -0
  103. package/dist/{update-5DPB4YD4.js → update-7XIOEXTD.js} +4 -3
  104. package/dist/{update-check-BS3DHTSI.js → update-check-2POMBHFB.js} +3 -2
  105. package/dist/update-check.d.ts +1 -1
  106. package/dist/version-help-WZ623NWM.js +10 -0
  107. package/dist/version.d.ts +3 -2
  108. package/dist/webui-client-observability.d.ts +7 -0
  109. package/dist/{webui-server-MRPGTTKL.js → webui-server-L2SICPTB.js} +158 -94
  110. package/dist/webui-server-options.d.ts +11 -0
  111. package/dist/webui-server.d.ts +15 -1
  112. package/dist/wiring/domain-glossary.d.ts +5 -4
  113. package/dist/wiring/plugins.d.ts +1 -1
  114. package/dist/wiring/provider-persisters.d.ts +24 -0
  115. package/dist/wiring/provider-runtime.d.ts +9 -1
  116. package/dist/wiring/runtime-dispatch-state.d.ts +3 -1
  117. package/package.json +28 -28
  118. package/dist/chunk-2CZEORLV.js +0 -54
  119. package/dist/chunk-DR2OXU46.js +0 -174
  120. package/dist/chunk-JACOMTIH.js +0 -275
  121. package/dist/chunk-XJXDOF63.js +0 -28
  122. package/dist/modeldiag-CJSFHZ3J.js +0 -1356
  123. package/dist/short-circuit-flags-7GQIGMVD.js +0 -10
  124. package/dist/version-help-WXI42PZ3.js +0 -10
@@ -47,7 +47,7 @@ export interface PluginSchemaInfo {
47
47
  * every theme change), and a phantom `agents` entry (that field is nested
48
48
  * under `acp`, never top-level) waved a stray top-level `agents` block
49
49
  * through. Add a field to `Config` and `tsc` now names it here. */
50
- declare const KNOWN_TOP_LEVEL_KEYS: readonly ['version', 'activeProfile', 'provider', 'model', 'apiKey', 'baseUrl', 'maxConcurrent', 'uiLocale', 'themePreset', 'providers', 'models', 'modelMatrix', 'modelTiers', 'favoriteModels', 'disabledModels', 'favoriteModelsOnly', 'modelAvailabilitySchedule', 'context', 'tools', 'mcpServers', 'acp', 'fallbackModels', 'fallbackBridge', 'fallbackProfiles', 'fallbackProfile', 'fallbackAuto', 'fallbackMaxLastResortCandidates', 'fallbackStickiness', 'fallbackGateSeconds', 'hooks', 'plugins', 'pluginManager', 'log', 'features', 'Sage', 'skills', 'yolo', 'nextPrediction', 'cwd', 'autonomy', 'hints', 'debugStream', 'configScope', 'indexing', 'circuitBreaker', 'adaptiveConcurrency', 'launch', 'session', 'chronicle', 'modelRuntime', 'systemPrompt', 'hq', 'fleet', 'brain', 'sync', 'cloudSync', 'git', 'extensions'];
50
+ declare const KNOWN_TOP_LEVEL_KEYS: readonly ['version', 'activeProfile', 'provider', 'model', 'apiKey', 'baseUrl', 'maxConcurrent', 'uiLocale', 'themePreset', 'providers', 'models', 'modelMatrix', 'modelTiers', 'favoriteModels', 'disabledModels', 'favoriteModelsOnly', 'modelAvailabilitySchedule', 'context', 'tools', 'mcpServers', 'acp', 'fallbackModels', 'fallbackBridge', 'fallbackProfiles', 'fallbackProfile', 'fallbackAuto', 'fallbackMaxLastResortCandidates', 'fallbackStickiness', 'fallbackGateSeconds', 'hooks', 'plugins', 'pluginManager', 'log', 'features', 'Sage', 'skills', 'yolo', 'nextPrediction', 'cwd', 'autonomy', 'hints', 'debugStream', 'configScope', 'indexing', 'circuitBreaker', 'adaptiveConcurrency', 'launch', 'session', 'chronicle', 'modelRuntime', 'systemPrompt', 'hq', 'typesafe', 'fleet', 'brain', 'sync', 'cloudSync', 'git', 'extensions'];
51
51
  /** Compile-time `never` assertion: instantiating it with a non-empty union
52
52
  * fails and the TS error text spells out the offending key names. */
53
53
  type AssertNever<T extends never> = T;
@@ -65,6 +65,14 @@ type PhantomDoctorKey = Exclude<(typeof KNOWN_TOP_LEVEL_KEYS)[number], keyof Con
65
65
  * pin. This resolves to `never` only while both directions are clean.
66
66
  */
67
67
  export type ConfigKeyCoverage = AssertNever<UncoveredConfigKey> | AssertNever<PhantomDoctorKey>;
68
- export declare function diagnoseConfig(cfg: Record<string, unknown>, plugins?: PluginSchemaInfo[]): DoctorReport;
68
+ export declare function diagnoseConfig(cfg: Record<string, unknown>, plugins?: PluginSchemaInfo[],
69
+ /**
70
+ * Environment consulted by rules whose verdict depends on it — currently
71
+ * only the TypeSafe account, whose key legitimately lives in `TYPESAFE_API_KEY`
72
+ * or `OPENROUTER_API_KEY` rather than the file. Passed in rather than read,
73
+ * so the module stays pure and the rule stays testable; defaults to the real
74
+ * environment because every production caller means that one.
75
+ */
76
+ env?: NodeJS.ProcessEnv): DoctorReport;
69
77
  export {};
70
78
  //# sourceMappingURL=config-doctor.d.ts.map
@@ -2,11 +2,15 @@ import {
2
2
  extractBehaviorSettings,
3
3
  mergeBehaviorSettings
4
4
  } from "./chunk-UQUYBDMG.js";
5
+ import {
6
+ appendHistory,
7
+ backupCurrent
8
+ } from "./chunk-WSTVGC2C.js";
5
9
 
6
10
  // src/subcommands/handlers/config-transfer.ts
7
11
  import * as fs from "node:fs/promises";
8
12
  import * as path from "node:path";
9
- import { color, toErrorMessage } from "@wrongstack/core/utils";
13
+ import { atomicWrite, color, toErrorMessage, withFileLock } from "@wrongstack/core/utils";
10
14
  var FILE_NAME = "wstack-config.json";
11
15
  var SAFETY_NOTE = "No providers, API keys, fallbacks, or model/fallback routing data is included.";
12
16
  var configExportCmd = async (_args, deps) => {
@@ -62,12 +66,36 @@ var configImportCmd = async (_args, deps) => {
62
66
  deps.config["activeProfile"] ?? "default"
63
67
  );
64
68
  const profilePath = deps.paths.profileConfig(profile);
65
- let disk = {};
69
+ let applied = [];
66
70
  try {
67
- disk = JSON.parse(await fs.readFile(profilePath, "utf8"));
68
- } catch {
71
+ await withFileLock(profilePath, async () => {
72
+ let disk = {};
73
+ try {
74
+ disk = JSON.parse(await fs.readFile(profilePath, "utf8"));
75
+ } catch (err) {
76
+ if (err.code !== "ENOENT") throw err;
77
+ }
78
+ const before = structuredClone(disk);
79
+ applied = mergeBehaviorSettings(disk, settings);
80
+ if (applied.length === 0) return;
81
+ await backupCurrent(void 0, profilePath);
82
+ await atomicWrite(profilePath, `${JSON.stringify(disk, null, 2)}
83
+ `, { mode: 384 });
84
+ try {
85
+ await appendHistory(
86
+ before,
87
+ disk,
88
+ `Imported portable settings: ${applied.join(", ")}`,
89
+ void 0,
90
+ profilePath
91
+ );
92
+ } catch {
93
+ }
94
+ });
95
+ } catch (err) {
96
+ deps.renderer.writeError(`Import failed while writing profile: ${toErrorMessage(err)}`);
97
+ return 1;
69
98
  }
70
- const applied = mergeBehaviorSettings(disk, settings);
71
99
  if (applied.length === 0) {
72
100
  deps.renderer.write(
73
101
  `${color.amber("Nothing to import")} \u2014 the export carries none of the known behavior sections.
@@ -75,13 +103,6 @@ var configImportCmd = async (_args, deps) => {
75
103
  );
76
104
  return 0;
77
105
  }
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
106
  deps.renderer.write(
86
107
  `${color.green("\u2713")} Imported ${applied.length} section(s) into profile ${color.cyan(profile)}: ${color.cyan(applied.join(", "))}
87
108
  `
@@ -96,4 +117,4 @@ export {
96
117
  configExportCmd,
97
118
  configImportCmd
98
119
  };
99
- //# sourceMappingURL=config-transfer-2YF3CRTN.js.map
120
+ //# sourceMappingURL=config-transfer-RUWLDCNK.js.map
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-D3K4NYQL.js";
8
8
  import {
9
9
  API_VERSION
10
- } from "./chunk-XJXDOF63.js";
10
+ } from "./chunk-YBUCXXYZ.js";
11
11
 
12
12
  // src/subcommands/handlers/diag-doctor.ts
13
13
  import * as fs2 from "node:fs/promises";
@@ -392,4 +392,4 @@ export {
392
392
  doctorCmd,
393
393
  proxyCmd
394
394
  };
395
- //# sourceMappingURL=diag-doctor-ANPRUYFM.js.map
395
+ //# sourceMappingURL=diag-doctor-WIFJH3XH.js.map
@@ -16,7 +16,7 @@ import type { EventBus } from '@wrongstack/core/kernel';
16
16
  import type { SlashCommandRegistry } from '@wrongstack/core/registry';
17
17
  import type { StatuslineDensities, StatuslineLines, StatuslineOrder } from '@wrongstack/core/statusline';
18
18
  import type { QueueStore } from '@wrongstack/core/storage';
19
- import type { AttachmentStore, AutonomyStage, Config, ConfigStore, MemoryPort, Message, ModelsRegistry, ModeStore, PromptLoader, ProviderConfig, ResolvedProvider, SessionEvent, SessionStore, SessionWriter, SkillLoader, TokenCounter } from '@wrongstack/core/types';
19
+ import type { AttachmentStore, AutonomyStage, Config, ConfigStore, MemoryPort, Message, ModelsRegistry, ModeStore, PromptLoader, ProviderConfig, ResolvedProvider, SecretVault, SessionEvent, SessionStore, SessionWriter, SkillLoader, TokenCounter } from '@wrongstack/core/types';
20
20
  import type { WstackPaths } from '@wrongstack/core/utils';
21
21
  import type { MCPRegistry } from '@wrongstack/mcp';
22
22
  import type { SddLifecycleResult, SddRunControl } from '@wrongstack/sdd';
@@ -86,6 +86,7 @@ interface CoreDeps {
86
86
  events: EventBus;
87
87
  config: Config;
88
88
  configStore: ConfigStore;
89
+ vault?: SecretVault | undefined;
89
90
  wpaths: WstackPaths;
90
91
  projectRoot: string;
91
92
  flags: Record<string, string | boolean>;