@wrongstack/cli 0.305.1 → 0.306.0
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.
- package/dist/{auth-EPERLKYI.js → auth-GVPYLJPS.js} +7 -7
- package/dist/boot/short-circuit-flags.d.ts +7 -1
- package/dist/boot/system-prompt-menu.d.ts +151 -0
- package/dist/chimera-cascade-evidence.d.ts +102 -0
- package/dist/chimera-review-task.d.ts +7 -0
- package/dist/{chunk-2H47YMCV.js → chunk-5JW3XCRA.js} +3 -3
- package/dist/{chunk-5KFLLTSQ.js → chunk-WC3DK6BI.js} +5 -5
- package/dist/{cli-main-6YE423OH.js → cli-main-DHNFGP3Z.js} +191 -172
- package/dist/{execution-QYFWDD3Y.js → execution-TTE7R5UY.js} +311 -36
- package/dist/execution-chimera-cascade.d.ts +7 -1
- package/dist/{hq-5G6D5YIU.js → hq-ZK6PGN3W.js} +95 -6
- package/dist/index.js +755 -542
- package/dist/{modeldiag-SIVUOX2Y.js → modeldiag-6VS5KDP5.js} +4 -4
- package/dist/wiring/management-tools.d.ts +8 -1
- package/package.json +24 -24
|
@@ -44,6 +44,27 @@ import {
|
|
|
44
44
|
PLUGIN_AUDIT_ENTRIES,
|
|
45
45
|
runPluginManagementCommand
|
|
46
46
|
} from "./chunk-RK7E3IXT.js";
|
|
47
|
+
import {
|
|
48
|
+
configureSimpleUiRuntimeContext,
|
|
49
|
+
detectProjectFacts,
|
|
50
|
+
makeConfirmAwaiter,
|
|
51
|
+
renderAgentsTemplate
|
|
52
|
+
} from "./chunk-YKBRFSGL.js";
|
|
53
|
+
import "./chunk-QD544J2B.js";
|
|
54
|
+
import {
|
|
55
|
+
fmtTaskResultLine,
|
|
56
|
+
fmtTok,
|
|
57
|
+
patchConfig
|
|
58
|
+
} from "./chunk-TYO2OVAD.js";
|
|
59
|
+
import {
|
|
60
|
+
CLI_VERSION
|
|
61
|
+
} from "./chunk-XJXDOF63.js";
|
|
62
|
+
import {
|
|
63
|
+
buildWin32CmdShimInvocation
|
|
64
|
+
} from "./chunk-U3SS4NRH.js";
|
|
65
|
+
import {
|
|
66
|
+
checkForUpdate
|
|
67
|
+
} from "./chunk-NUIHRGPY.js";
|
|
47
68
|
import {
|
|
48
69
|
createGracefulShutdown,
|
|
49
70
|
loadCachedAcpRegistry,
|
|
@@ -59,30 +80,18 @@ import {
|
|
|
59
80
|
runClaudeOAuthLogin,
|
|
60
81
|
runCopilotOAuthLogin,
|
|
61
82
|
validateFamily
|
|
62
|
-
} from "./chunk-
|
|
63
|
-
import {
|
|
64
|
-
runCodexOAuthLogin
|
|
65
|
-
} from "./chunk-SSSJQVUY.js";
|
|
66
|
-
import {
|
|
67
|
-
configureSimpleUiRuntimeContext,
|
|
68
|
-
detectProjectFacts,
|
|
69
|
-
makeConfirmAwaiter,
|
|
70
|
-
renderAgentsTemplate
|
|
71
|
-
} from "./chunk-YKBRFSGL.js";
|
|
72
|
-
import "./chunk-QD544J2B.js";
|
|
73
|
-
import {
|
|
74
|
-
fmtTaskResultLine,
|
|
75
|
-
fmtTok,
|
|
76
|
-
patchConfig
|
|
77
|
-
} from "./chunk-TYO2OVAD.js";
|
|
83
|
+
} from "./chunk-WC3DK6BI.js";
|
|
78
84
|
import {
|
|
79
85
|
LOCAL_LLM_PRESETS,
|
|
80
86
|
parseSpawnFlags
|
|
81
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-5JW3XCRA.js";
|
|
82
88
|
import {
|
|
83
89
|
buildPickableProviders,
|
|
84
90
|
visibleModelIds
|
|
85
91
|
} from "./chunk-3IC4IEZC.js";
|
|
92
|
+
import {
|
|
93
|
+
runCodexOAuthLogin
|
|
94
|
+
} from "./chunk-SSSJQVUY.js";
|
|
86
95
|
import {
|
|
87
96
|
activeLabel,
|
|
88
97
|
loadConfigProviders,
|
|
@@ -97,15 +106,6 @@ import {
|
|
|
97
106
|
import {
|
|
98
107
|
activeProfileConfigPath
|
|
99
108
|
} from "./chunk-YMXXOOFN.js";
|
|
100
|
-
import {
|
|
101
|
-
buildWin32CmdShimInvocation
|
|
102
|
-
} from "./chunk-U3SS4NRH.js";
|
|
103
|
-
import {
|
|
104
|
-
checkForUpdate
|
|
105
|
-
} from "./chunk-NUIHRGPY.js";
|
|
106
|
-
import {
|
|
107
|
-
CLI_VERSION
|
|
108
|
-
} from "./chunk-XJXDOF63.js";
|
|
109
109
|
import {
|
|
110
110
|
__require
|
|
111
111
|
} from "./chunk-7OCVIDC7.js";
|
|
@@ -8033,6 +8033,12 @@ function registerProviderUtilityTools(input) {
|
|
|
8033
8033
|
fallbackProfileManager: input.fallbackProfileManager,
|
|
8034
8034
|
defaultProvider: config.provider,
|
|
8035
8035
|
defaultModel: config.model,
|
|
8036
|
+
// Same live router the council gets below. Without it the `role` input
|
|
8037
|
+
// was inert (the orchestrator's pickForTask path no-ops), and without the
|
|
8038
|
+
// tracker no llm-tool call ever recorded provider health, so blocked
|
|
8039
|
+
// entries were neither skipped nor reported for this tool's traffic.
|
|
8040
|
+
modelRouter: createLiveModelRouter(input.getConfig),
|
|
8041
|
+
statusTracker: input.statusTracker,
|
|
8036
8042
|
wrapProviderCall: input.wrapProviderCall
|
|
8037
8043
|
});
|
|
8038
8044
|
registerOrOverride(input.toolRegistry, "llm", llmTool);
|
|
@@ -8362,27 +8368,40 @@ async function setupLifecycleAndPlugins(deps) {
|
|
|
8362
8368
|
}
|
|
8363
8369
|
|
|
8364
8370
|
// src/wiring/management-tools.ts
|
|
8365
|
-
import * as fs5 from "node:fs/promises";
|
|
8366
8371
|
import {
|
|
8367
8372
|
createFallbackManageTools,
|
|
8368
8373
|
createPluginManagerTool
|
|
8369
8374
|
} from "@wrongstack/core/tools";
|
|
8375
|
+
import { updateJsonObjectFile } from "@wrongstack/core/utils";
|
|
8370
8376
|
function registerCliManagementTools({
|
|
8371
8377
|
toolRegistry,
|
|
8372
8378
|
configStore,
|
|
8373
8379
|
profileConfigPath,
|
|
8374
8380
|
stdinInteractive,
|
|
8375
|
-
getHookRunner
|
|
8381
|
+
getHookRunner,
|
|
8382
|
+
getSwitchProviderAndModel
|
|
8376
8383
|
}) {
|
|
8377
8384
|
const fallbackManageTools = createFallbackManageTools({
|
|
8378
8385
|
getConfig: () => configStore.get(),
|
|
8386
|
+
// updateJsonObjectFile is the same atomic read-mutate-write helper
|
|
8387
|
+
// mcp_control uses on this very file — the previous bare
|
|
8388
|
+
// readFile→JSON.parse→writeFile raced it and could drop concurrent
|
|
8389
|
+
// updates (and tore the file on a crash mid-write).
|
|
8379
8390
|
updateConfig: async (mutate) => {
|
|
8380
|
-
const
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
|
|
8384
|
-
configStore.update(parsed);
|
|
8391
|
+
const next = await updateJsonObjectFile(profileConfigPath, (cfg) => {
|
|
8392
|
+
mutate(cfg);
|
|
8393
|
+
});
|
|
8394
|
+
configStore.update(next);
|
|
8385
8395
|
},
|
|
8396
|
+
...getSwitchProviderAndModel ? {
|
|
8397
|
+
switchProviderAndModel: async (providerId, modelId) => {
|
|
8398
|
+
const switchFn = getSwitchProviderAndModel();
|
|
8399
|
+
if (!switchFn) {
|
|
8400
|
+
return "the live model switch is not ready yet (still booting) \u2014 try again shortly";
|
|
8401
|
+
}
|
|
8402
|
+
return switchFn(providerId, modelId);
|
|
8403
|
+
}
|
|
8404
|
+
} : {},
|
|
8386
8405
|
// Interactive key entry for REPL mode reads a line from stdin without echo.
|
|
8387
8406
|
...stdinInteractive ? {
|
|
8388
8407
|
requestInput: async (prompt) => {
|
|
@@ -8739,14 +8758,14 @@ function setupProviderRuntime(deps) {
|
|
|
8739
8758
|
}
|
|
8740
8759
|
|
|
8741
8760
|
// src/wiring/provider-status.ts
|
|
8742
|
-
import * as
|
|
8761
|
+
import * as fs5 from "node:fs/promises";
|
|
8743
8762
|
import { ProviderModelStatusTracker } from "@wrongstack/core/coordination";
|
|
8744
8763
|
import { atomicWrite as atomicWrite2, withFileLock } from "@wrongstack/core/utils";
|
|
8745
8764
|
async function setupProviderStatus(input) {
|
|
8746
8765
|
const tracker = new ProviderModelStatusTracker({ events: input.events });
|
|
8747
8766
|
const statusFile = input.paths.profileProviderStatus(input.paths.profileName);
|
|
8748
8767
|
try {
|
|
8749
|
-
const saved = JSON.parse(await
|
|
8768
|
+
const saved = JSON.parse(await fs5.readFile(statusFile, "utf8"));
|
|
8750
8769
|
const restored = tracker.restoreSnapshot(saved);
|
|
8751
8770
|
if (restored > 0) input.logger.info(`Restored ${restored} provider waiting-room entries`);
|
|
8752
8771
|
} catch (error) {
|
|
@@ -8758,7 +8777,7 @@ async function setupProviderStatus(input) {
|
|
|
8758
8777
|
tracker.sweepExpired();
|
|
8759
8778
|
if (syncRunning) return;
|
|
8760
8779
|
syncRunning = true;
|
|
8761
|
-
void
|
|
8780
|
+
void fs5.readFile(statusFile, "utf8").then((raw) => tracker.restoreSnapshot(JSON.parse(raw))).catch((error) => warnUnlessMissing(input.logger, "sync", error)).finally(() => {
|
|
8762
8781
|
syncRunning = false;
|
|
8763
8782
|
});
|
|
8764
8783
|
}, 3e4);
|
|
@@ -8773,7 +8792,7 @@ async function setupProviderStatus(input) {
|
|
|
8773
8792
|
await withFileLock(statusFile, async () => {
|
|
8774
8793
|
let statuses = [];
|
|
8775
8794
|
try {
|
|
8776
|
-
const current = JSON.parse(await
|
|
8795
|
+
const current = JSON.parse(await fs5.readFile(statusFile, "utf8"));
|
|
8777
8796
|
if (Array.isArray(current.statuses)) statuses = current.statuses;
|
|
8778
8797
|
} catch (error) {
|
|
8779
8798
|
if (error.code !== "ENOENT") throw error;
|
|
@@ -9814,7 +9833,7 @@ import {
|
|
|
9814
9833
|
readJsonObjectFile,
|
|
9815
9834
|
removeJsonPath,
|
|
9816
9835
|
setJsonPath,
|
|
9817
|
-
updateJsonObjectFile
|
|
9836
|
+
updateJsonObjectFile as updateJsonObjectFile2
|
|
9818
9837
|
} from "@wrongstack/core/utils";
|
|
9819
9838
|
function parseMcpArgs(args) {
|
|
9820
9839
|
const trimmed = args.trim();
|
|
@@ -9912,7 +9931,7 @@ async function runAdd(name, enable, configured, configPath, mcpRegistry, all) {
|
|
|
9912
9931
|
}
|
|
9913
9932
|
const existing = configured[name];
|
|
9914
9933
|
const nextCfg = existing ? { ...preset, ...existing, enabled: enable } : { ...preset, enabled: enable };
|
|
9915
|
-
await
|
|
9934
|
+
await updateJsonObjectFile2(configPath, (full) => {
|
|
9916
9935
|
const current = isMcpServerRecord(full.mcpServers) ? full.mcpServers : {};
|
|
9917
9936
|
setJsonPath(full, ["mcpServers", name], { ...current[name], ...nextCfg });
|
|
9918
9937
|
});
|
|
@@ -9951,7 +9970,7 @@ async function runRemove(name, configured, configPath, mcpRegistry) {
|
|
|
9951
9970
|
);
|
|
9952
9971
|
}
|
|
9953
9972
|
if (typeof mcpRegistry.forget === "function") mcpRegistry.forget(name);
|
|
9954
|
-
await
|
|
9973
|
+
await updateJsonObjectFile2(configPath, (full) => {
|
|
9955
9974
|
const current = isMcpServerRecord(full.mcpServers) ? full.mcpServers : configured;
|
|
9956
9975
|
setJsonPath(full, ["mcpServers"], { ...current });
|
|
9957
9976
|
removeJsonPath(full, ["mcpServers", name]);
|
|
@@ -9970,7 +9989,7 @@ async function runEnable(name, configured, configPath, mcpRegistry) {
|
|
|
9970
9989
|
return `${color8.green("Enabled")} "${name}" and started.`;
|
|
9971
9990
|
}
|
|
9972
9991
|
}
|
|
9973
|
-
await
|
|
9992
|
+
await updateJsonObjectFile2(configPath, (full) => {
|
|
9974
9993
|
const current = isMcpServerRecord(full.mcpServers) ? full.mcpServers : {};
|
|
9975
9994
|
setJsonPath(full, ["mcpServers", name], { ...cfg, ...current[name], enabled: true });
|
|
9976
9995
|
});
|
|
@@ -9998,7 +10017,7 @@ async function runDisable(name, configured, configPath, mcpRegistry) {
|
|
|
9998
10017
|
})
|
|
9999
10018
|
);
|
|
10000
10019
|
}
|
|
10001
|
-
await
|
|
10020
|
+
await updateJsonObjectFile2(configPath, (full) => {
|
|
10002
10021
|
const current = isMcpServerRecord(full.mcpServers) ? full.mcpServers : {};
|
|
10003
10022
|
setJsonPath(full, ["mcpServers", name], { ...cfg, ...current[name], enabled: false });
|
|
10004
10023
|
});
|
|
@@ -11342,7 +11361,7 @@ ${color13.dim("YOLO enabled; tool calls run without approval unless an explicit
|
|
|
11342
11361
|
|
|
11343
11362
|
// src/slash-commands/brain.ts
|
|
11344
11363
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
11345
|
-
import { readFile as
|
|
11364
|
+
import { readFile as readFile6 } from "node:fs/promises";
|
|
11346
11365
|
import { parseModelRef } from "@wrongstack/core/agent";
|
|
11347
11366
|
import { BUILTIN_COUNCIL_PERSONA_IDS, BUILTIN_COUNCIL_PERSONAS } from "@wrongstack/core/execution";
|
|
11348
11367
|
import { color as color14 } from "@wrongstack/core/utils";
|
|
@@ -11788,7 +11807,7 @@ function buildBrainCommand(opts) {
|
|
|
11788
11807
|
const n = Math.max(1, Math.min(100, Number.parseInt(rest[0] ?? "15", 10) || 15));
|
|
11789
11808
|
let raw;
|
|
11790
11809
|
try {
|
|
11791
|
-
raw = await
|
|
11810
|
+
raw = await readFile6(ledgerPath, "utf8");
|
|
11792
11811
|
} catch {
|
|
11793
11812
|
const msg3 = `No ledger entries yet (${ledgerPath}).`;
|
|
11794
11813
|
opts.renderer.write(msg3);
|
|
@@ -12667,7 +12686,7 @@ function buildCompactCommand(opts) {
|
|
|
12667
12686
|
}
|
|
12668
12687
|
|
|
12669
12688
|
// src/slash-commands/context.ts
|
|
12670
|
-
import * as
|
|
12689
|
+
import * as fs6 from "node:fs/promises";
|
|
12671
12690
|
import {
|
|
12672
12691
|
formatContextWindowModeList,
|
|
12673
12692
|
getContextWindowMode,
|
|
@@ -12981,6 +13000,7 @@ var SOURCE_LABELS = {
|
|
|
12981
13000
|
contributor: "contributor",
|
|
12982
13001
|
ledger: "completed-work ledger",
|
|
12983
13002
|
glossary: "project jargon dictionary",
|
|
13003
|
+
peers: "fleet peer awareness",
|
|
12984
13004
|
nextsteps: "next-steps gate",
|
|
12985
13005
|
other: "other (untagged)"
|
|
12986
13006
|
};
|
|
@@ -13029,7 +13049,7 @@ async function persistContextConfig(opts, patch) {
|
|
|
13029
13049
|
const configPath = activeProfileConfigPath(opts.paths, opts.configStore.get());
|
|
13030
13050
|
let raw = "{}";
|
|
13031
13051
|
try {
|
|
13032
|
-
raw = await
|
|
13052
|
+
raw = await fs6.readFile(configPath, "utf8");
|
|
13033
13053
|
} catch (err) {
|
|
13034
13054
|
if (err.code !== "ENOENT") {
|
|
13035
13055
|
return `Could not read ${configPath}: ${err.message}`;
|
|
@@ -13434,7 +13454,7 @@ function listRoles() {
|
|
|
13434
13454
|
}
|
|
13435
13455
|
|
|
13436
13456
|
// src/slash-commands/design.ts
|
|
13437
|
-
import * as
|
|
13457
|
+
import * as fs7 from "node:fs/promises";
|
|
13438
13458
|
import * as path19 from "node:path";
|
|
13439
13459
|
import {
|
|
13440
13460
|
applyTokenOverrides,
|
|
@@ -13594,8 +13614,8 @@ ${menu}` };
|
|
|
13594
13614
|
return { message: e.message };
|
|
13595
13615
|
}
|
|
13596
13616
|
try {
|
|
13597
|
-
await
|
|
13598
|
-
await
|
|
13617
|
+
await fs7.mkdir(path19.dirname(abs), { recursive: true });
|
|
13618
|
+
await fs7.writeFile(abs, result.content);
|
|
13599
13619
|
} catch (e) {
|
|
13600
13620
|
return { message: `Failed to write ${result.path}: ${e.message}` };
|
|
13601
13621
|
}
|
|
@@ -13762,7 +13782,7 @@ function buildStatsCommand(opts) {
|
|
|
13762
13782
|
}
|
|
13763
13783
|
|
|
13764
13784
|
// src/slash-commands/doctor.ts
|
|
13765
|
-
import * as
|
|
13785
|
+
import * as fs8 from "node:fs/promises";
|
|
13766
13786
|
import * as path20 from "node:path";
|
|
13767
13787
|
import { atomicWrite as atomicWrite4, color as color22, toErrorMessage as toErrorMessage10 } from "@wrongstack/core/utils";
|
|
13768
13788
|
|
|
@@ -14327,7 +14347,7 @@ function buildDoctorCommand(opts) {
|
|
|
14327
14347
|
const base = path20.basename(file);
|
|
14328
14348
|
const candidates = [`${base}.last`];
|
|
14329
14349
|
try {
|
|
14330
|
-
const siblings = await
|
|
14350
|
+
const siblings = await fs8.readdir(dir);
|
|
14331
14351
|
candidates.push(
|
|
14332
14352
|
...siblings.filter((f) => f.startsWith(`${base}.`) && f.endsWith(".bak")).sort().reverse()
|
|
14333
14353
|
);
|
|
@@ -14335,7 +14355,7 @@ function buildDoctorCommand(opts) {
|
|
|
14335
14355
|
}
|
|
14336
14356
|
for (const name of candidates) {
|
|
14337
14357
|
try {
|
|
14338
|
-
const raw = await
|
|
14358
|
+
const raw = await fs8.readFile(path20.join(dir, name), "utf8");
|
|
14339
14359
|
JSON.parse(raw);
|
|
14340
14360
|
return { name, raw };
|
|
14341
14361
|
} catch {
|
|
@@ -14388,7 +14408,7 @@ function buildDoctorCommand(opts) {
|
|
|
14388
14408
|
for (const target of targets) {
|
|
14389
14409
|
let raw;
|
|
14390
14410
|
try {
|
|
14391
|
-
raw = await
|
|
14411
|
+
raw = await fs8.readFile(target.file, "utf8");
|
|
14392
14412
|
} catch {
|
|
14393
14413
|
if (!target.isProject) {
|
|
14394
14414
|
lines.push(
|
|
@@ -14703,7 +14723,7 @@ function buildFKeyAliasCommands(opts) {
|
|
|
14703
14723
|
}
|
|
14704
14724
|
|
|
14705
14725
|
// src/slash-commands/fallback.ts
|
|
14706
|
-
import * as
|
|
14726
|
+
import * as fs9 from "node:fs/promises";
|
|
14707
14727
|
import {
|
|
14708
14728
|
normalizeModelRef,
|
|
14709
14729
|
parseModelRef as parseModelRef2,
|
|
@@ -14747,7 +14767,7 @@ async function patchGlobalConfig(globalConfigPath, mutate) {
|
|
|
14747
14767
|
let raw = "{}";
|
|
14748
14768
|
let fileExists2 = true;
|
|
14749
14769
|
try {
|
|
14750
|
-
raw = await
|
|
14770
|
+
raw = await fs9.readFile(globalConfigPath, "utf8");
|
|
14751
14771
|
} catch (err) {
|
|
14752
14772
|
if (err.code !== "ENOENT") throw err;
|
|
14753
14773
|
fileExists2 = false;
|
|
@@ -16808,7 +16828,7 @@ ${color27.dim("(dry-run)")}`
|
|
|
16808
16828
|
}
|
|
16809
16829
|
|
|
16810
16830
|
// src/slash-commands/gitid.ts
|
|
16811
|
-
import * as
|
|
16831
|
+
import * as fs10 from "node:fs/promises";
|
|
16812
16832
|
import { decryptConfigSecrets as decryptConfigSecrets2, encryptConfigSecrets as encryptConfigSecrets2, noOpVault as noOpVault3 } from "@wrongstack/core/security";
|
|
16813
16833
|
import { ConfigError as ConfigError2 } from "@wrongstack/core/types";
|
|
16814
16834
|
import {
|
|
@@ -16825,7 +16845,7 @@ async function patchGlobalConfig2(globalConfigPath, mutate) {
|
|
|
16825
16845
|
let raw = "{}";
|
|
16826
16846
|
let fileExists2 = true;
|
|
16827
16847
|
try {
|
|
16828
|
-
raw = await
|
|
16848
|
+
raw = await fs10.readFile(globalConfigPath, "utf8");
|
|
16829
16849
|
} catch (err) {
|
|
16830
16850
|
if (err.code !== "ENOENT") throw err;
|
|
16831
16851
|
fileExists2 = false;
|
|
@@ -17282,7 +17302,7 @@ function buildHelpCommand(opts) {
|
|
|
17282
17302
|
}
|
|
17283
17303
|
|
|
17284
17304
|
// src/slash-commands/init.ts
|
|
17285
|
-
import * as
|
|
17305
|
+
import * as fs11 from "node:fs/promises";
|
|
17286
17306
|
import * as path22 from "node:path";
|
|
17287
17307
|
import { color as color30 } from "@wrongstack/core/utils";
|
|
17288
17308
|
function buildInitCommand(opts) {
|
|
@@ -17297,19 +17317,19 @@ function buildInitCommand(opts) {
|
|
|
17297
17317
|
const isFirstInit = !await fileExists(file);
|
|
17298
17318
|
const detected = await detectProjectFacts(root);
|
|
17299
17319
|
const body = renderAgentsTemplate(detected);
|
|
17300
|
-
await
|
|
17320
|
+
await fs11.mkdir(dir, { recursive: true });
|
|
17301
17321
|
let backedUp = false;
|
|
17302
17322
|
if (!isFirstInit) {
|
|
17303
17323
|
try {
|
|
17304
|
-
await
|
|
17324
|
+
await fs11.copyFile(file, `${file}.bak`);
|
|
17305
17325
|
backedUp = true;
|
|
17306
17326
|
} catch {
|
|
17307
17327
|
}
|
|
17308
17328
|
}
|
|
17309
|
-
await
|
|
17329
|
+
await fs11.writeFile(file, body, "utf8");
|
|
17310
17330
|
let nodePkg = false;
|
|
17311
17331
|
try {
|
|
17312
|
-
await
|
|
17332
|
+
await fs11.access(path22.join(root, "package.json"));
|
|
17313
17333
|
nodePkg = true;
|
|
17314
17334
|
} catch {
|
|
17315
17335
|
}
|
|
@@ -17347,7 +17367,7 @@ function buildInitCommand(opts) {
|
|
|
17347
17367
|
}
|
|
17348
17368
|
async function fileExists(filePath) {
|
|
17349
17369
|
try {
|
|
17350
|
-
await
|
|
17370
|
+
await fs11.access(filePath);
|
|
17351
17371
|
return true;
|
|
17352
17372
|
} catch {
|
|
17353
17373
|
return false;
|
|
@@ -17466,6 +17486,7 @@ import {
|
|
|
17466
17486
|
updateTask,
|
|
17467
17487
|
updateTaskAssignment
|
|
17468
17488
|
} from "@wrongstack/kanban";
|
|
17489
|
+
import { preflightManagedTransition } from "@wrongstack/kanban/manager/lifecycle";
|
|
17469
17490
|
import { TaskGraphStore } from "@wrongstack/sdd";
|
|
17470
17491
|
|
|
17471
17492
|
// src/slash-commands/kanban-agent-helpers.ts
|
|
@@ -18237,9 +18258,9 @@ async function handleTaskSubcommand(opts, projectRoot, args, showHelp) {
|
|
|
18237
18258
|
try {
|
|
18238
18259
|
const result = await transitionTask(projectRoot, boardId, taskId, {
|
|
18239
18260
|
to,
|
|
18240
|
-
actor: "kanban-slash",
|
|
18241
|
-
action: `Moved to ${resolvedColumnId} via /kanban task move`,
|
|
18242
|
-
comment: moveNote ? `${moveNote} (move \u2192 ${resolvedColumnId})` :
|
|
18261
|
+
actor: "kanban-slash:move",
|
|
18262
|
+
action: moveNote ? `${moveNote} (move \u2192 ${resolvedColumnId})` : `Moved to ${resolvedColumnId} via /kanban task move`,
|
|
18263
|
+
comment: moveNote ? `${moveNote} (move \u2192 ${resolvedColumnId})` : `Moved to ${resolvedColumnId} via /kanban task move (board=${boardId}, task=${taskId})`,
|
|
18243
18264
|
// Reviewers require a non-empty attachment URL to advance into review.
|
|
18244
18265
|
// Forward the caller's `--attachment`; if missing, the move must fail at
|
|
18245
18266
|
// `validateReviewEvidence` so the audit ledger never records a fabricated
|
|
@@ -18273,7 +18294,7 @@ async function handleTaskSubcommand(opts, projectRoot, args, showHelp) {
|
|
|
18273
18294
|
)
|
|
18274
18295
|
};
|
|
18275
18296
|
}
|
|
18276
|
-
const { attachment, note, positional, warnings } = parseTaskEvidenceFlags(rest.slice(1));
|
|
18297
|
+
const { attachment, note, tickChecks, positional, warnings } = parseTaskEvidenceFlags(rest.slice(1));
|
|
18277
18298
|
if (positional.length > 0) {
|
|
18278
18299
|
return {
|
|
18279
18300
|
message: color32.red(
|
|
@@ -18302,73 +18323,36 @@ async function handleTaskSubcommand(opts, projectRoot, args, showHelp) {
|
|
|
18302
18323
|
)
|
|
18303
18324
|
};
|
|
18304
18325
|
}
|
|
18305
|
-
const preflightIssues = [];
|
|
18306
|
-
const needsRunningEvidence = path32.includes("running");
|
|
18307
|
-
const needsReviewEvidence = path32.includes("review");
|
|
18308
|
-
const needsDoneEvidence = path32.includes("done");
|
|
18309
18326
|
const currentTask = board.tasks.find((t) => t.id === taskId);
|
|
18310
18327
|
if (!currentTask) {
|
|
18311
18328
|
return { message: color32.red("Task not found") };
|
|
18312
18329
|
}
|
|
18313
|
-
|
|
18314
|
-
|
|
18315
|
-
|
|
18316
|
-
|
|
18317
|
-
|
|
18318
|
-
|
|
18319
|
-
|
|
18320
|
-
].every((value) => typeof value === "string" && value.trim().length > 0);
|
|
18321
|
-
if (!hasLease) {
|
|
18322
|
-
preflightIssues.push(
|
|
18323
|
-
"The /kanban task done path needs the card to already be Running with lease metadata; move it into Running first via /kanban task assign or /kanban task dispatch."
|
|
18324
|
-
);
|
|
18325
|
-
}
|
|
18326
|
-
}
|
|
18327
|
-
if (needsReviewEvidence && !attachment) {
|
|
18328
|
-
preflightIssues.push(
|
|
18329
|
-
'Review evidence requires --attachment <url>; re-run `/kanban task done <boardId> <taskId> --attachment https://example.test/review --note "..."`.'
|
|
18330
|
-
);
|
|
18331
|
-
} else if (needsReviewEvidence && !currentTask.assignment?.lastResult) {
|
|
18332
|
-
preflightIssues.push(
|
|
18333
|
-
"Review evidence requires the card to carry an assignment.lastResult; dispatch the worker through the agentic supervisor so it records implementation output."
|
|
18334
|
-
);
|
|
18330
|
+
const preflightIssues = [];
|
|
18331
|
+
if (!note || !note.trim()) {
|
|
18332
|
+
return {
|
|
18333
|
+
message: color32.red(
|
|
18334
|
+
`Refusing /kanban task ${currentStage ?? "unknown"} \u2192 done without a reviewer note. Re-run with --note "<what proves the work is ready>".`
|
|
18335
|
+
)
|
|
18336
|
+
};
|
|
18335
18337
|
}
|
|
18336
|
-
|
|
18337
|
-
|
|
18338
|
-
|
|
18339
|
-
|
|
18340
|
-
|
|
18341
|
-
|
|
18342
|
-
|
|
18343
|
-
|
|
18344
|
-
|
|
18345
|
-
|
|
18346
|
-
)
|
|
18347
|
-
|
|
18348
|
-
|
|
18349
|
-
|
|
18350
|
-
|
|
18351
|
-
|
|
18352
|
-
|
|
18353
|
-
|
|
18354
|
-
const childTasks = board.tasks.filter(
|
|
18355
|
-
(entry) => currentTask.childTaskIds.includes(entry.id)
|
|
18356
|
-
);
|
|
18357
|
-
const missingChildren = currentTask.childTaskIds.filter(
|
|
18358
|
-
(childId) => !childTasks.some((entry) => entry.id === childId)
|
|
18359
|
-
);
|
|
18360
|
-
if (missingChildren.length > 0) {
|
|
18361
|
-
preflightIssues.push(
|
|
18362
|
-
`Atomic parent references unresolved children (${missingChildren.join(", ")}); resolve them via the kanban tool before retrying.`
|
|
18363
|
-
);
|
|
18364
|
-
}
|
|
18365
|
-
const incompleteChildren = childTasks.filter((child) => child.status !== "completed");
|
|
18366
|
-
if (incompleteChildren.length > 0) {
|
|
18367
|
-
const ids = incompleteChildren.map((child) => child.id).join(", ");
|
|
18368
|
-
preflightIssues.push(
|
|
18369
|
-
`Atomic parent's children must be completed before the parent can advance to Done (pending: ${ids}).`
|
|
18370
|
-
);
|
|
18371
|
-
}
|
|
18338
|
+
const noteText = note.trim();
|
|
18339
|
+
const sharedAttachment = attachment ? {
|
|
18340
|
+
url: attachment,
|
|
18341
|
+
type: "url",
|
|
18342
|
+
title: "Reviewer evidence (kanban-slash:done)"
|
|
18343
|
+
} : void 0;
|
|
18344
|
+
for (const to of path32) {
|
|
18345
|
+
const transitionInput = {
|
|
18346
|
+
to,
|
|
18347
|
+
actor: "kanban-slash:done",
|
|
18348
|
+
action: `${noteText} (${to})`,
|
|
18349
|
+
comment: `${noteText} (${to})`,
|
|
18350
|
+
...sharedAttachment ? { attachment: sharedAttachment } : {},
|
|
18351
|
+
...tickChecks ? { tickChecks } : {}
|
|
18352
|
+
};
|
|
18353
|
+
const issues = preflightManagedTransition(board, currentTask, transitionInput);
|
|
18354
|
+
for (const issue of issues) {
|
|
18355
|
+
preflightIssues.push(issue.message);
|
|
18372
18356
|
}
|
|
18373
18357
|
}
|
|
18374
18358
|
if (preflightIssues.length > 0) {
|
|
@@ -18383,16 +18367,17 @@ async function handleTaskSubcommand(opts, projectRoot, args, showHelp) {
|
|
|
18383
18367
|
for (const to of path32) {
|
|
18384
18368
|
await transitionTask(projectRoot, boardId, taskId, {
|
|
18385
18369
|
to,
|
|
18386
|
-
actor: "kanban-slash",
|
|
18387
|
-
action:
|
|
18388
|
-
comment:
|
|
18370
|
+
actor: "kanban-slash:done",
|
|
18371
|
+
action: noteText ? `${noteText} (${to})` : "",
|
|
18372
|
+
comment: noteText ? `${noteText} (${to})` : "",
|
|
18389
18373
|
...attachment ? {
|
|
18390
18374
|
attachment: {
|
|
18391
18375
|
url: attachment,
|
|
18392
18376
|
type: "url",
|
|
18393
|
-
title: "Reviewer evidence (kanban-slash)"
|
|
18377
|
+
title: "Reviewer evidence (kanban-slash:done)"
|
|
18394
18378
|
}
|
|
18395
|
-
} : {}
|
|
18379
|
+
} : {},
|
|
18380
|
+
...tickChecks.length > 0 ? { tickChecks } : {}
|
|
18396
18381
|
});
|
|
18397
18382
|
}
|
|
18398
18383
|
return { message: color32.green("\u2705 Task marked completed.") };
|
|
@@ -18815,14 +18800,17 @@ function resolveColumnReference(board, requested) {
|
|
|
18815
18800
|
function parseTaskEvidenceFlags(tokens) {
|
|
18816
18801
|
let attachment;
|
|
18817
18802
|
let note;
|
|
18803
|
+
const tickChecks = [];
|
|
18818
18804
|
const positional = [];
|
|
18819
18805
|
const warnings = [];
|
|
18820
18806
|
const ATTACHMENT_KEYS = /* @__PURE__ */ new Set(["--attachment", "--evidence", "--link"]);
|
|
18821
18807
|
const NOTE_KEYS = /* @__PURE__ */ new Set(["--note", "--comment", "--action"]);
|
|
18808
|
+
const TICK_CHECK_KEYS = /* @__PURE__ */ new Set(["--tick-check", "--tick-checks"]);
|
|
18809
|
+
const VALID_TICK_STATUSES = /* @__PURE__ */ new Set(["passed", "failed", "skipped"]);
|
|
18822
18810
|
for (let i = 0; i < tokens.length; i++) {
|
|
18823
18811
|
const token = tokens[i];
|
|
18824
18812
|
const eq = token.indexOf("=");
|
|
18825
|
-
const inline = eq > 0 && (ATTACHMENT_KEYS.has(token.slice(0, eq)) || NOTE_KEYS.has(token.slice(0, eq)));
|
|
18813
|
+
const inline = eq > 0 && (ATTACHMENT_KEYS.has(token.slice(0, eq)) || NOTE_KEYS.has(token.slice(0, eq)) || TICK_CHECK_KEYS.has(token.slice(0, eq)));
|
|
18826
18814
|
const key = inline ? token.slice(0, eq) : token;
|
|
18827
18815
|
if (ATTACHMENT_KEYS.has(key)) {
|
|
18828
18816
|
const value = inline ? token.slice(eq + 1) : tokens[i + 1];
|
|
@@ -18840,6 +18828,32 @@ function parseTaskEvidenceFlags(tokens) {
|
|
|
18840
18828
|
attachment = value;
|
|
18841
18829
|
continue;
|
|
18842
18830
|
}
|
|
18831
|
+
if (TICK_CHECK_KEYS.has(key)) {
|
|
18832
|
+
const raw = inline ? token.slice(eq + 1) : tokens[i + 1];
|
|
18833
|
+
if (!raw?.trim()) {
|
|
18834
|
+
warnings.push(`${key} expects <checkId>=<status> but none was provided`);
|
|
18835
|
+
i = inline ? i : i + 1;
|
|
18836
|
+
continue;
|
|
18837
|
+
}
|
|
18838
|
+
if (!inline && raw.startsWith("-")) {
|
|
18839
|
+
warnings.push(`${key} expects <checkId>=<status> but none was provided`);
|
|
18840
|
+
i++;
|
|
18841
|
+
continue;
|
|
18842
|
+
}
|
|
18843
|
+
const sep2 = raw.lastIndexOf("=");
|
|
18844
|
+
const checkId = sep2 >= 0 ? raw.slice(0, sep2).trim() : "";
|
|
18845
|
+
const status = sep2 >= 0 ? raw.slice(sep2 + 1).trim() : "";
|
|
18846
|
+
if (!checkId || !status || !VALID_TICK_STATUSES.has(status)) {
|
|
18847
|
+
warnings.push(
|
|
18848
|
+
`${key} expects <checkId>=<status> where status is passed|failed|skipped (got "${raw}")`
|
|
18849
|
+
);
|
|
18850
|
+
i = inline ? i : i + 1;
|
|
18851
|
+
continue;
|
|
18852
|
+
}
|
|
18853
|
+
tickChecks.push({ checkId, checkStatus: status });
|
|
18854
|
+
i = inline ? i : i + 1;
|
|
18855
|
+
continue;
|
|
18856
|
+
}
|
|
18843
18857
|
if (NOTE_KEYS.has(key)) {
|
|
18844
18858
|
const inlineValue = inline ? token.slice(eq + 1) : void 0;
|
|
18845
18859
|
if (inlineValue !== void 0) {
|
|
@@ -18867,7 +18881,7 @@ function parseTaskEvidenceFlags(tokens) {
|
|
|
18867
18881
|
}
|
|
18868
18882
|
positional.push(token);
|
|
18869
18883
|
}
|
|
18870
|
-
return { attachment, note, positional, warnings };
|
|
18884
|
+
return { attachment, note, tickChecks, positional, warnings };
|
|
18871
18885
|
}
|
|
18872
18886
|
|
|
18873
18887
|
// src/slash-commands/mailbox.ts
|
|
@@ -19395,7 +19409,7 @@ function buildMailboxDemoCommand(opts) {
|
|
|
19395
19409
|
|
|
19396
19410
|
// src/slash-commands/mailbox-serve.ts
|
|
19397
19411
|
import { spawn as spawn6 } from "node:child_process";
|
|
19398
|
-
import * as
|
|
19412
|
+
import * as fs12 from "node:fs/promises";
|
|
19399
19413
|
import * as os2 from "node:os";
|
|
19400
19414
|
import * as path23 from "node:path";
|
|
19401
19415
|
import { resolveProjectDir as resolveProjectDir5 } from "@wrongstack/core/coordination";
|
|
@@ -19470,7 +19484,7 @@ function buildMailboxServeCommand(opts) {
|
|
|
19470
19484
|
});
|
|
19471
19485
|
child.unref();
|
|
19472
19486
|
try {
|
|
19473
|
-
await
|
|
19487
|
+
await fs12.writeFile(pidFile, String(child.pid ?? ""), { mode: 384 });
|
|
19474
19488
|
} catch {
|
|
19475
19489
|
}
|
|
19476
19490
|
const head = [];
|
|
@@ -21723,7 +21737,7 @@ ${targetMode.description}`
|
|
|
21723
21737
|
}
|
|
21724
21738
|
|
|
21725
21739
|
// src/slash-commands/modelcaps.ts
|
|
21726
|
-
import * as
|
|
21740
|
+
import * as fs13 from "node:fs/promises";
|
|
21727
21741
|
import { hasProviderCredential } from "@wrongstack/core/models";
|
|
21728
21742
|
import { color as color36 } from "@wrongstack/core/utils";
|
|
21729
21743
|
function fmtTokens(n) {
|
|
@@ -21796,7 +21810,7 @@ function buildModelCapsCommand(opts) {
|
|
|
21796
21810
|
}
|
|
21797
21811
|
let providers;
|
|
21798
21812
|
try {
|
|
21799
|
-
const raw = await
|
|
21813
|
+
const raw = await fs13.readFile(cachePath, "utf8");
|
|
21800
21814
|
const parsed = JSON.parse(raw);
|
|
21801
21815
|
const payload = parsed.payload ?? parsed;
|
|
21802
21816
|
providers = Object.entries(payload).map(([id, p]) => ({
|
|
@@ -21873,7 +21887,7 @@ function buildModelCapsCommand(opts) {
|
|
|
21873
21887
|
}
|
|
21874
21888
|
|
|
21875
21889
|
// src/slash-commands/models.ts
|
|
21876
|
-
import * as
|
|
21890
|
+
import * as fs14 from "node:fs/promises";
|
|
21877
21891
|
import { decryptConfigSecrets as decryptConfigSecrets3, encryptConfigSecrets as encryptConfigSecrets3, noOpVault as noOpVault4 } from "@wrongstack/core/security";
|
|
21878
21892
|
import {
|
|
21879
21893
|
ConfigError as ConfigError4,
|
|
@@ -21885,7 +21899,7 @@ async function patchProfileConfig(mutate, profileConfigPath) {
|
|
|
21885
21899
|
let raw = "{}";
|
|
21886
21900
|
let fileExists2 = true;
|
|
21887
21901
|
try {
|
|
21888
|
-
raw = await
|
|
21902
|
+
raw = await fs14.readFile(targetPath, "utf8");
|
|
21889
21903
|
} catch (err) {
|
|
21890
21904
|
if (err.code !== "ENOENT") throw err;
|
|
21891
21905
|
fileExists2 = false;
|
|
@@ -24781,7 +24795,7 @@ async function killSession(sessionId, confirm) {
|
|
|
24781
24795
|
}
|
|
24782
24796
|
|
|
24783
24797
|
// src/slash-commands/setmodel.ts
|
|
24784
|
-
import * as
|
|
24798
|
+
import * as fs15 from "node:fs/promises";
|
|
24785
24799
|
import { fallbackProfileChain, parseModelRef as parseModelRef3 } from "@wrongstack/core/agent";
|
|
24786
24800
|
import { AGENT_CATALOG as AGENT_CATALOG2, AGENTS_BY_PHASE as AGENTS_BY_PHASE3 } from "@wrongstack/core/agent-catalog";
|
|
24787
24801
|
import {
|
|
@@ -24893,7 +24907,7 @@ async function patchProfileConfig2(mutate, profileConfigPath) {
|
|
|
24893
24907
|
let raw = "{}";
|
|
24894
24908
|
let fileExists2 = true;
|
|
24895
24909
|
try {
|
|
24896
|
-
raw = await
|
|
24910
|
+
raw = await fs15.readFile(targetPath, "utf8");
|
|
24897
24911
|
} catch (err) {
|
|
24898
24912
|
if (err.code !== "ENOENT") throw err;
|
|
24899
24913
|
fileExists2 = false;
|
|
@@ -25517,7 +25531,7 @@ function parseSuggestions(raw) {
|
|
|
25517
25531
|
if (/^none\b/i.test(trimmed) || /no (?:pending actions|further steps)/i.test(trimmed)) {
|
|
25518
25532
|
return [];
|
|
25519
25533
|
}
|
|
25520
|
-
const { texts } = parseNextSteps(raw, false
|
|
25534
|
+
const { texts } = parseNextSteps(raw, false);
|
|
25521
25535
|
if (texts.length > 0) return texts;
|
|
25522
25536
|
return raw.split("\n").map((l) => l.trim()).filter((l) => l.length > 10 && !l.startsWith("#") && !l.startsWith("```")).slice(0, 5);
|
|
25523
25537
|
}
|
|
@@ -26306,7 +26320,7 @@ function buildMouseCommand(_opts) {
|
|
|
26306
26320
|
|
|
26307
26321
|
// src/slash-commands/project.ts
|
|
26308
26322
|
import { spawn as spawn7 } from "node:child_process";
|
|
26309
|
-
import * as
|
|
26323
|
+
import * as fs16 from "node:fs/promises";
|
|
26310
26324
|
import { createRequire } from "node:module";
|
|
26311
26325
|
import * as path26 from "node:path";
|
|
26312
26326
|
import {
|
|
@@ -26520,11 +26534,11 @@ async function listProjectsCommand(opts, ctx) {
|
|
|
26520
26534
|
async function addProjectCommand(opts, ctx, targetPath, displayName) {
|
|
26521
26535
|
const resolved = path26.resolve(ctx?.projectRoot ?? ctx?.cwd ?? process.cwd(), targetPath);
|
|
26522
26536
|
try {
|
|
26523
|
-
await
|
|
26537
|
+
await fs16.access(resolved);
|
|
26524
26538
|
} catch {
|
|
26525
26539
|
return { message: color48.red(`Directory not found: ${resolved}`) };
|
|
26526
26540
|
}
|
|
26527
|
-
const stat5 = await
|
|
26541
|
+
const stat5 = await fs16.stat(resolved);
|
|
26528
26542
|
if (!stat5.isDirectory()) {
|
|
26529
26543
|
return { message: color48.red(`Not a directory: ${resolved}`) };
|
|
26530
26544
|
}
|
|
@@ -26590,11 +26604,11 @@ async function removeProjectCommand(opts, _ctx, slugOrName) {
|
|
|
26590
26604
|
async function switchProjectCommand(opts, ctx, target, displayName) {
|
|
26591
26605
|
const resolved = path26.resolve(ctx?.projectRoot ?? ctx?.cwd ?? process.cwd(), target);
|
|
26592
26606
|
try {
|
|
26593
|
-
await
|
|
26607
|
+
await fs16.access(resolved);
|
|
26594
26608
|
} catch {
|
|
26595
26609
|
return { message: color48.red(`Directory not found: ${resolved}`) };
|
|
26596
26610
|
}
|
|
26597
|
-
const stat5 = await
|
|
26611
|
+
const stat5 = await fs16.stat(resolved);
|
|
26598
26612
|
if (!stat5.isDirectory()) {
|
|
26599
26613
|
return { message: color48.red(`Not a directory: ${resolved}`) };
|
|
26600
26614
|
}
|
|
@@ -26604,7 +26618,7 @@ async function switchProjectCommand(opts, ctx, target, displayName) {
|
|
|
26604
26618
|
const pkgPath = req.resolve("@wrongstack/cli/package.json");
|
|
26605
26619
|
const pkgDir = path26.dirname(pkgPath);
|
|
26606
26620
|
cliPath = path26.join(pkgDir, "dist", "index.js");
|
|
26607
|
-
await
|
|
26621
|
+
await fs16.access(cliPath);
|
|
26608
26622
|
} catch {
|
|
26609
26623
|
cliPath = process.argv[1] ?? "";
|
|
26610
26624
|
if (!cliPath) {
|
|
@@ -26749,7 +26763,7 @@ async function spawnInProject(opts, _ctx, root, projectName) {
|
|
|
26749
26763
|
const pkgPath = req.resolve("@wrongstack/cli/package.json");
|
|
26750
26764
|
const pkgDir = path26.dirname(pkgPath);
|
|
26751
26765
|
cliPath = path26.join(pkgDir, "dist", "index.js");
|
|
26752
|
-
await
|
|
26766
|
+
await fs16.access(cliPath);
|
|
26753
26767
|
} catch {
|
|
26754
26768
|
cliPath = process.argv[1] ?? "";
|
|
26755
26769
|
if (!cliPath) {
|
|
@@ -26804,7 +26818,7 @@ async function handleNewSession(_opts, _ctx) {
|
|
|
26804
26818
|
const pkgPath = req.resolve("@wrongstack/cli/package.json");
|
|
26805
26819
|
const pkgDir = path26.dirname(pkgPath);
|
|
26806
26820
|
cliPath = path26.join(pkgDir, "dist", "index.js");
|
|
26807
|
-
await
|
|
26821
|
+
await fs16.access(cliPath);
|
|
26808
26822
|
} catch {
|
|
26809
26823
|
cliPath = process.argv[1] ?? "";
|
|
26810
26824
|
if (!cliPath) {
|
|
@@ -26967,7 +26981,9 @@ function buildReviewCommand(opts) {
|
|
|
26967
26981
|
maxFiles: limit,
|
|
26968
26982
|
autoFix: "off",
|
|
26969
26983
|
cascadeOn: "off",
|
|
26970
|
-
maxCascadeDepth: 0
|
|
26984
|
+
maxCascadeDepth: 0,
|
|
26985
|
+
fallbackModels: [],
|
|
26986
|
+
fallbackProfile: void 0
|
|
26971
26987
|
},
|
|
26972
26988
|
cwd,
|
|
26973
26989
|
files: filesWithContent
|
|
@@ -29010,21 +29026,21 @@ ${formatTaskProgress(file.tasks)}`;
|
|
|
29010
29026
|
}
|
|
29011
29027
|
|
|
29012
29028
|
// src/slash-commands/techstack.ts
|
|
29013
|
-
import * as
|
|
29029
|
+
import * as fs17 from "node:fs/promises";
|
|
29014
29030
|
import * as path28 from "node:path";
|
|
29015
29031
|
import { color as color52, toErrorMessage as toErrorMessage26 } from "@wrongstack/core/utils";
|
|
29016
29032
|
async function discoverPackageFiles(projectRoot) {
|
|
29017
29033
|
const files = [];
|
|
29018
29034
|
const rootPkg = path28.join(projectRoot, "package.json");
|
|
29019
29035
|
try {
|
|
29020
|
-
await
|
|
29036
|
+
await fs17.access(rootPkg);
|
|
29021
29037
|
files.push(rootPkg);
|
|
29022
29038
|
} catch {
|
|
29023
29039
|
}
|
|
29024
29040
|
const workspaceFile = path28.join(projectRoot, "pnpm-workspace.yaml");
|
|
29025
29041
|
try {
|
|
29026
|
-
await
|
|
29027
|
-
const content = await
|
|
29042
|
+
await fs17.access(workspaceFile);
|
|
29043
|
+
const content = await fs17.readFile(workspaceFile, "utf8");
|
|
29028
29044
|
const globMatch = /packages?:\s*\[([^\]]+)\]/s.exec(content);
|
|
29029
29045
|
const rawGlobs = globMatch?.[1];
|
|
29030
29046
|
if (!rawGlobs) return files;
|
|
@@ -29033,12 +29049,12 @@ async function discoverPackageFiles(projectRoot) {
|
|
|
29033
29049
|
const dirPrefix = g.replace(/\/?\*$/, "").replace(/\/\*$/, "");
|
|
29034
29050
|
const dir = path28.join(projectRoot, dirPrefix);
|
|
29035
29051
|
try {
|
|
29036
|
-
const entries = await
|
|
29052
|
+
const entries = await fs17.readdir(dir, { withFileTypes: true });
|
|
29037
29053
|
for (const e of entries) {
|
|
29038
29054
|
if (!e.isDirectory()) continue;
|
|
29039
29055
|
const subPkg = path28.join(dir, e.name, "package.json");
|
|
29040
29056
|
try {
|
|
29041
|
-
await
|
|
29057
|
+
await fs17.access(subPkg);
|
|
29042
29058
|
files.push(subPkg);
|
|
29043
29059
|
} catch {
|
|
29044
29060
|
}
|
|
@@ -30350,7 +30366,7 @@ ${lines.join("\n")}${extra}
|
|
|
30350
30366
|
}
|
|
30351
30367
|
|
|
30352
30368
|
// src/slash-commands/tuneup.ts
|
|
30353
|
-
import * as
|
|
30369
|
+
import * as fs18 from "node:fs/promises";
|
|
30354
30370
|
import * as os3 from "node:os";
|
|
30355
30371
|
import * as path29 from "node:path";
|
|
30356
30372
|
import { atomicWrite as atomicWrite10, color as color57 } from "@wrongstack/core/utils";
|
|
@@ -30960,7 +30976,7 @@ async function gatherMemoryFiles(opts) {
|
|
|
30960
30976
|
const out = [];
|
|
30961
30977
|
for (const c of candidates) {
|
|
30962
30978
|
try {
|
|
30963
|
-
const content = await
|
|
30979
|
+
const content = await fs18.readFile(c.file, "utf8");
|
|
30964
30980
|
out.push({ label: c.label, path: c.file, content, committed: c.committed });
|
|
30965
30981
|
} catch {
|
|
30966
30982
|
}
|
|
@@ -30978,7 +30994,7 @@ async function gatherTrust(opts) {
|
|
|
30978
30994
|
const file = opts.paths?.projectTrust;
|
|
30979
30995
|
if (!file) return void 0;
|
|
30980
30996
|
try {
|
|
30981
|
-
const raw = await
|
|
30997
|
+
const raw = await fs18.readFile(file, "utf8");
|
|
30982
30998
|
const parsed = JSON.parse(raw);
|
|
30983
30999
|
if (parsed && typeof parsed === "object") return parsed;
|
|
30984
31000
|
} catch {
|
|
@@ -30989,7 +31005,7 @@ async function gatherConfigIssues(opts) {
|
|
|
30989
31005
|
if (!opts.paths) return 0;
|
|
30990
31006
|
const file = activeProfileConfigPath(opts.paths, opts.configStore.get());
|
|
30991
31007
|
try {
|
|
30992
|
-
const raw = await
|
|
31008
|
+
const raw = await fs18.readFile(file, "utf8");
|
|
30993
31009
|
const parsed = JSON.parse(raw);
|
|
30994
31010
|
return diagnoseConfig(parsed).findings.length;
|
|
30995
31011
|
} catch {
|
|
@@ -31007,14 +31023,14 @@ async function gatherSessionBytes(opts) {
|
|
|
31007
31023
|
}
|
|
31008
31024
|
async function dirSize(dir) {
|
|
31009
31025
|
let total = 0;
|
|
31010
|
-
const entries = await
|
|
31026
|
+
const entries = await fs18.readdir(dir, { withFileTypes: true });
|
|
31011
31027
|
for (const e of entries) {
|
|
31012
31028
|
const full = path29.join(dir, e.name);
|
|
31013
31029
|
if (e.isDirectory()) {
|
|
31014
31030
|
total += await dirSize(full);
|
|
31015
31031
|
} else if (e.isFile()) {
|
|
31016
31032
|
try {
|
|
31017
|
-
total += (await
|
|
31033
|
+
total += (await fs18.stat(full)).size;
|
|
31018
31034
|
} catch {
|
|
31019
31035
|
}
|
|
31020
31036
|
}
|
|
@@ -31027,7 +31043,7 @@ async function applyActions(actions, opts) {
|
|
|
31027
31043
|
const file = activeProfileConfigPath(opts.paths, opts.configStore.get());
|
|
31028
31044
|
let raw = "{}";
|
|
31029
31045
|
try {
|
|
31030
|
-
raw = await
|
|
31046
|
+
raw = await fs18.readFile(file, "utf8");
|
|
31031
31047
|
} catch {
|
|
31032
31048
|
}
|
|
31033
31049
|
let parsed;
|
|
@@ -31183,7 +31199,7 @@ function summaryLine(findings, fixable, handoffs, power) {
|
|
|
31183
31199
|
}
|
|
31184
31200
|
|
|
31185
31201
|
// src/slash-commands/working-dir.ts
|
|
31186
|
-
import * as
|
|
31202
|
+
import * as fs19 from "node:fs/promises";
|
|
31187
31203
|
import * as path30 from "node:path";
|
|
31188
31204
|
import { color as color58, toErrorMessage as toErrorMessage29 } from "@wrongstack/core/utils";
|
|
31189
31205
|
function buildWorkingDirCommand(_opts) {
|
|
@@ -31230,7 +31246,7 @@ function buildWorkingDirCommand(_opts) {
|
|
|
31230
31246
|
};
|
|
31231
31247
|
}
|
|
31232
31248
|
try {
|
|
31233
|
-
const stat5 = await
|
|
31249
|
+
const stat5 = await fs19.stat(resolved);
|
|
31234
31250
|
if (!stat5.isDirectory()) {
|
|
31235
31251
|
return { message: color58.red(`Not a directory: ${resolved}`) };
|
|
31236
31252
|
}
|
|
@@ -31585,12 +31601,14 @@ async function runInteractive(cliCtx) {
|
|
|
31585
31601
|
});
|
|
31586
31602
|
const stdinInteractive = process.stdin.isTTY;
|
|
31587
31603
|
const hookRunnerRef = { current: null };
|
|
31604
|
+
const switchProviderAndModelRef = { current: null };
|
|
31588
31605
|
registerCliManagementTools({
|
|
31589
31606
|
toolRegistry,
|
|
31590
31607
|
configStore,
|
|
31591
31608
|
profileConfigPath,
|
|
31592
31609
|
stdinInteractive,
|
|
31593
|
-
getHookRunner: () => hookRunnerRef.current
|
|
31610
|
+
getHookRunner: () => hookRunnerRef.current,
|
|
31611
|
+
getSwitchProviderAndModel: () => switchProviderAndModelRef.current
|
|
31594
31612
|
});
|
|
31595
31613
|
const { metricsSink, healthRegistry, metricsStatus } = (() => {
|
|
31596
31614
|
const ms = setupMetrics({
|
|
@@ -31835,6 +31853,7 @@ async function runInteractive(cliCtx) {
|
|
|
31835
31853
|
buildProviderForIdRuntime: buildProviderForId,
|
|
31836
31854
|
statusTracker
|
|
31837
31855
|
});
|
|
31856
|
+
switchProviderAndModelRef.current = switchProviderAndModel;
|
|
31838
31857
|
await adoptResumedProvider({
|
|
31839
31858
|
resumedProvider: sessResult.resumedProvider,
|
|
31840
31859
|
resumedModel: sessResult.resumedModel,
|
|
@@ -32223,7 +32242,7 @@ async function runInteractive(cliCtx) {
|
|
|
32223
32242
|
onEvent: evOn
|
|
32224
32243
|
});
|
|
32225
32244
|
const savedProviderCfg = config.providers?.[config.provider];
|
|
32226
|
-
const { execute } = await import("./execution-
|
|
32245
|
+
const { execute } = await import("./execution-TTE7R5UY.js");
|
|
32227
32246
|
const stopHeapWatchdog = startSharedHeapWatchdog({
|
|
32228
32247
|
collectStats: () => {
|
|
32229
32248
|
const hqQueue = hqPublisherRef.current?.getQueueStats();
|
|
@@ -32461,4 +32480,4 @@ export {
|
|
|
32461
32480
|
CLI_VERSION,
|
|
32462
32481
|
runInteractive
|
|
32463
32482
|
};
|
|
32464
|
-
//# sourceMappingURL=cli-main-
|
|
32483
|
+
//# sourceMappingURL=cli-main-DHNFGP3Z.js.map
|