@wrongstack/cli 0.300.0 → 0.301.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/{acp-IDNS2YVE.js → acp-DATHHPNT.js} +34 -15
- package/dist/acp-server-agent.d.ts +1 -1
- package/dist/{audit-2ZSFGNIF.js → audit-QRCLEHHW.js} +5 -1
- package/dist/{auth-6T6ZOT2R.js → auth-JASC4K3F.js} +150 -37
- package/dist/boot/launch-menu.d.ts +2 -4
- package/dist/boot/tool-registry.d.ts +3 -0
- package/dist/chimera-reviewer-policy.d.ts +10 -3
- package/dist/chimera-work-registry.d.ts +19 -0
- package/dist/{chronicle-QQEQFSSE.js → chronicle-63MFCZN6.js} +26 -5
- package/dist/{chunk-YWUPHRGB.js → chunk-263G3FMB.js} +33 -10
- package/dist/{chunk-GYDQABMA.js → chunk-2KDOFTTM.js} +44 -32
- package/dist/chunk-CSAPOCBP.js +24 -0
- package/dist/{chunk-N7ULWBO5.js → chunk-ETOEGL3V.js} +3 -7
- package/dist/{chunk-3MWUZMOL.js → chunk-GUHQQG63.js} +14 -3
- package/dist/chunk-KE7E7DPX.js +38 -0
- package/dist/{chunk-PEMN4T5O.js → chunk-MHF2IJDE.js} +21 -4
- package/dist/{chunk-V76R7DC5.js → chunk-O7XNGCRT.js} +311 -309
- package/dist/{chunk-DPJZQCVP.js → chunk-YMXXOOFN.js} +1 -1
- package/dist/{chunk-4WJKVQJY.js → chunk-ZECLGUTF.js} +15 -3
- package/dist/{cli-main-7B3G2YSG.js → cli-main-XWC57MGE.js} +333 -98
- package/dist/{execution-SHGM7BVC.js → execution-LHMSMDHB.js} +126 -52
- package/dist/execution-chimera-cascade.d.ts +3 -4
- package/dist/execution-chimera-review.d.ts +2 -3
- package/dist/execution-cleanup.d.ts +3 -2
- package/dist/execution.d.ts +1 -1
- package/dist/{export-TPORYVRZ.js → export-DOBGPY23.js} +12 -1
- package/dist/fleet/host-context.d.ts +1 -1
- package/dist/fleet/host-helpers.d.ts +14 -0
- package/dist/fleet/status-broadcast.d.ts +1 -1
- package/dist/{hq-DVDD4XPV.js → hq-LN5CJHCM.js} +2 -2
- package/dist/hq-server/routes.d.ts +10 -1
- package/dist/hq-server/ws.d.ts +17 -6
- package/dist/{hq-server-DQHLNHDL.js → hq-server-S7HZG3PA.js} +3 -2
- package/dist/index.js +63 -98
- package/dist/live-settings-input.d.ts +5 -0
- package/dist/{mcp-CYLPUEHC.js → mcp-OHPJH73U.js} +6 -2
- package/dist/{modeldiag-YOQZHBQV.js → modeldiag-3DOK4BWW.js} +2 -2
- package/dist/{plugin-usage-EOG4ET4S.js → plugin-usage-YEVLOR33.js} +7 -3
- package/dist/{plugins-56CMWMPR.js → plugins-K3BAUP4D.js} +3 -3
- package/dist/profile-config-path.d.ts +0 -2
- package/dist/provider-helpers.d.ts +0 -5
- package/dist/{providers-models-K6RT7ABI.js → providers-models-WEZ4EGLL.js} +6 -5
- package/dist/{replay-KCTXNMZQ.js → replay-FCBNHW3K.js} +5 -1
- package/dist/{rewind-EJMVFVLS.js → rewind-AOD3JIYX.js} +5 -1
- package/dist/{sessions-config-NLCMK3BY.js → sessions-config-XXN7267N.js} +8 -3
- package/dist/subcommands/flags.d.ts +23 -0
- package/dist/terminal-format.d.ts +15 -0
- package/dist/{webui-server-G3EKFXLL.js → webui-server-DD35QFNO.js} +5 -13
- package/dist/wiring/brain-and-orchestration.d.ts +1 -1
- package/dist/wiring/mailbox-bridge-bootstrap.d.ts +3 -1
- package/dist/wiring/management-tools.d.ts +9 -1
- package/dist/wiring/pipeline.d.ts +5 -5
- package/dist/wiring/plugins.d.ts +2 -3
- package/dist/wiring/provider-utility-tools.d.ts +1 -0
- package/dist/wiring/tools.d.ts +4 -5
- package/package.json +23 -23
package/dist/index.js
CHANGED
|
@@ -15,7 +15,8 @@ import {
|
|
|
15
15
|
} from "./chunk-TYO2OVAD.js";
|
|
16
16
|
import {
|
|
17
17
|
DEFAULT_PORT
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2KDOFTTM.js";
|
|
19
|
+
import "./chunk-KE7E7DPX.js";
|
|
19
20
|
import "./chunk-Q5GTM25S.js";
|
|
20
21
|
import {
|
|
21
22
|
helpCmd,
|
|
@@ -36,21 +37,21 @@ import {
|
|
|
36
37
|
parseArgs,
|
|
37
38
|
runPicker,
|
|
38
39
|
saveToGlobalConfig
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-MHF2IJDE.js";
|
|
40
41
|
import {
|
|
41
42
|
isKeylessLocalProvider,
|
|
42
43
|
visibleModelIds
|
|
43
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-ETOEGL3V.js";
|
|
44
45
|
import {
|
|
45
46
|
mutateConfigProviders,
|
|
46
47
|
normalizeKeys,
|
|
47
48
|
resolveActiveApiKey,
|
|
48
49
|
writeKeysBack
|
|
49
50
|
} from "./chunk-PJHET45A.js";
|
|
50
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-263G3FMB.js";
|
|
51
52
|
import {
|
|
52
53
|
activeProfileConfigPath
|
|
53
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-YMXXOOFN.js";
|
|
54
55
|
import "./chunk-7OCVIDC7.js";
|
|
55
56
|
|
|
56
57
|
// src/cli-entry-point.ts
|
|
@@ -316,15 +317,15 @@ var ReadlineInputReader = class {
|
|
|
316
317
|
}
|
|
317
318
|
const fresh = this.ensure();
|
|
318
319
|
this.installPromptGuard(fresh);
|
|
319
|
-
|
|
320
|
+
const line = await new Promise((resolve2) => {
|
|
320
321
|
let settled = false;
|
|
321
322
|
let timeoutHandle;
|
|
322
|
-
const settle = (
|
|
323
|
+
const settle = (line2) => {
|
|
323
324
|
if (settled) return;
|
|
324
325
|
settled = true;
|
|
325
326
|
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
326
327
|
setOutputLineGuard(null);
|
|
327
|
-
resolve2(
|
|
328
|
+
resolve2(line2);
|
|
328
329
|
};
|
|
329
330
|
if (timeoutOpts) {
|
|
330
331
|
timeoutHandle = setTimeout(() => {
|
|
@@ -334,15 +335,15 @@ var ReadlineInputReader = class {
|
|
|
334
335
|
}
|
|
335
336
|
}, timeoutOpts.timeoutMs);
|
|
336
337
|
}
|
|
337
|
-
fresh.question(prompt ?? "> ", (
|
|
338
|
-
const persistHistory = !this.suppressNextHistory && this.shouldPersistHistory(
|
|
338
|
+
fresh.question(prompt ?? "> ", (line2) => {
|
|
339
|
+
const persistHistory = !this.suppressNextHistory && this.shouldPersistHistory(line2);
|
|
339
340
|
this.suppressNextHistory = false;
|
|
340
|
-
if (
|
|
341
|
-
this.history.push(
|
|
341
|
+
if (line2.trim() && persistHistory) {
|
|
342
|
+
this.history.push(line2);
|
|
342
343
|
this.saveHistory().then(void 0, () => {
|
|
343
344
|
});
|
|
344
345
|
}
|
|
345
|
-
settle(
|
|
346
|
+
settle(line2);
|
|
346
347
|
});
|
|
347
348
|
fresh.once("close", () => settle(""));
|
|
348
349
|
fresh.on?.("error", (_e) => settle(""));
|
|
@@ -351,6 +352,7 @@ var ReadlineInputReader = class {
|
|
|
351
352
|
fresh.close();
|
|
352
353
|
return result;
|
|
353
354
|
});
|
|
355
|
+
return line;
|
|
354
356
|
} finally {
|
|
355
357
|
this.pending = false;
|
|
356
358
|
}
|
|
@@ -1435,14 +1437,14 @@ function summarize(value, name) {
|
|
|
1435
1437
|
if (typeof v === "object" && v !== null) {
|
|
1436
1438
|
const o = v;
|
|
1437
1439
|
if (name === "edit") {
|
|
1438
|
-
const
|
|
1440
|
+
const path9 = typeof o["path"] === "string" ? o["path"] : "";
|
|
1439
1441
|
const reps = typeof o["replacements"] === "number" ? o["replacements"] : 0;
|
|
1440
|
-
return `${
|
|
1442
|
+
return `${path9} ${reps} replacement${reps === 1 ? "" : "s"}`.trim();
|
|
1441
1443
|
}
|
|
1442
1444
|
if (name === "write") {
|
|
1443
|
-
const
|
|
1445
|
+
const path9 = typeof o["path"] === "string" ? o["path"] : "";
|
|
1444
1446
|
const bytes = typeof o["bytes"] === "number" ? o["bytes"] : void 0;
|
|
1445
|
-
return bytes !== void 0 ? `${
|
|
1447
|
+
return bytes !== void 0 ? `${path9} ${bytes}B` : path9;
|
|
1446
1448
|
}
|
|
1447
1449
|
if (name === "read") {
|
|
1448
1450
|
return summarizeRead(o);
|
|
@@ -1457,13 +1459,13 @@ function summarize(value, name) {
|
|
|
1457
1459
|
return "";
|
|
1458
1460
|
}
|
|
1459
1461
|
function summarizeRead(o) {
|
|
1460
|
-
const
|
|
1462
|
+
const path9 = typeof o["path"] === "string" ? o["path"] : "";
|
|
1461
1463
|
const total = typeof o["total_lines"] === "number" ? o["total_lines"] : void 0;
|
|
1462
1464
|
const truncated = o["truncated"] === true;
|
|
1463
1465
|
const cached = o["cached"] === true;
|
|
1464
1466
|
const note = typeof o["note"] === "string" ? o["note"] : void 0;
|
|
1465
1467
|
const parts = [];
|
|
1466
|
-
if (
|
|
1468
|
+
if (path9) parts.push(path9);
|
|
1467
1469
|
if (total !== void 0) parts.push(`${total} line${total === 1 ? "" : "s"}`);
|
|
1468
1470
|
const flags = [];
|
|
1469
1471
|
if (truncated) flags.push("truncated");
|
|
@@ -1495,34 +1497,34 @@ function compactSingleLine(text) {
|
|
|
1495
1497
|
|
|
1496
1498
|
// src/subcommands/index.ts
|
|
1497
1499
|
var loaders = {
|
|
1498
|
-
acp: async () => (await import("./acp-
|
|
1500
|
+
acp: async () => (await import("./acp-DATHHPNT.js")).acpCmd,
|
|
1499
1501
|
init: async () => (await import("./init-E2NDDOHI.js")).initCmd,
|
|
1500
|
-
auth: async () => (await import("./auth-
|
|
1502
|
+
auth: async () => (await import("./auth-JASC4K3F.js")).authCmd,
|
|
1501
1503
|
update: async () => (await import("./update-MV6TUACD.js")).updateCmd,
|
|
1502
|
-
sessions: async () => (await import("./sessions-config-
|
|
1503
|
-
config: async () => (await import("./sessions-config-
|
|
1504
|
-
rewind: async () => (await import("./rewind-
|
|
1505
|
-
replay: async () => (await import("./replay-
|
|
1506
|
-
audit: async () => (await import("./audit-
|
|
1504
|
+
sessions: async () => (await import("./sessions-config-XXN7267N.js")).sessionsCmd,
|
|
1505
|
+
config: async () => (await import("./sessions-config-XXN7267N.js")).configCmd,
|
|
1506
|
+
rewind: async () => (await import("./rewind-AOD3JIYX.js")).rewindCmd,
|
|
1507
|
+
replay: async () => (await import("./replay-FCBNHW3K.js")).replayCmd,
|
|
1508
|
+
audit: async () => (await import("./audit-QRCLEHHW.js")).auditCmd,
|
|
1507
1509
|
tools: async () => (await import("./tools-skills-UNKLOB7M.js")).toolsCmd,
|
|
1508
1510
|
skills: async () => (await import("./tools-skills-UNKLOB7M.js")).skillsCmd,
|
|
1509
|
-
providers: async () => (await import("./providers-models-
|
|
1510
|
-
models: async () => (await import("./providers-models-
|
|
1511
|
-
mcp: async () => (await import("./mcp-
|
|
1512
|
-
plugin: async () => (await import("./plugin-usage-
|
|
1513
|
-
plugins: async () => (await import("./plugin-usage-
|
|
1511
|
+
providers: async () => (await import("./providers-models-WEZ4EGLL.js")).providersCmd,
|
|
1512
|
+
models: async () => (await import("./providers-models-WEZ4EGLL.js")).modelsCmd,
|
|
1513
|
+
mcp: async () => (await import("./mcp-OHPJH73U.js")).mcpCmd,
|
|
1514
|
+
plugin: async () => (await import("./plugin-usage-YEVLOR33.js")).pluginCmd,
|
|
1515
|
+
plugins: async () => (await import("./plugin-usage-YEVLOR33.js")).pluginCmd,
|
|
1514
1516
|
diag: async () => (await import("./diag-doctor-OQ3AA63O.js")).diagCmd,
|
|
1515
1517
|
doctor: async () => (await import("./diag-doctor-OQ3AA63O.js")).doctorCmd,
|
|
1516
|
-
export: async () => (await import("./export-
|
|
1517
|
-
usage: async () => (await import("./plugin-usage-
|
|
1518
|
+
export: async () => (await import("./export-DOBGPY23.js")).exportCmd,
|
|
1519
|
+
usage: async () => (await import("./plugin-usage-YEVLOR33.js")).usageCmd,
|
|
1518
1520
|
version: async () => (await import("./version-help-ASKQYXDJ.js")).versionCmd,
|
|
1519
1521
|
help: async () => (await import("./version-help-ASKQYXDJ.js")).helpCmd,
|
|
1520
1522
|
projects: async () => (await import("./projects-XE76NFNZ.js")).projectsCmd,
|
|
1521
|
-
modeldiag: async () => (await import("./modeldiag-
|
|
1523
|
+
modeldiag: async () => (await import("./modeldiag-3DOK4BWW.js")).modeldiagCmd,
|
|
1522
1524
|
quick: async () => (await import("./quick-VIO2BEHS.js")).quickCmd,
|
|
1523
1525
|
bench: async () => (await import("./bench-7ZDWSNEF.js")).benchCmd,
|
|
1524
|
-
chronicle: async () => (await import("./chronicle-
|
|
1525
|
-
hq: async () => (await import("./hq-
|
|
1526
|
+
chronicle: async () => (await import("./chronicle-63MFCZN6.js")).chronicleCmd,
|
|
1527
|
+
hq: async () => (await import("./hq-LN5CJHCM.js")).hqCmd,
|
|
1526
1528
|
mailbox: async () => (await import("./mailbox-serve-DBOOOOWZ.js")).mailboxServeCmd,
|
|
1527
1529
|
permissions: async () => (await import("./permissions-FNYLZIL4.js")).permissionsCmd,
|
|
1528
1530
|
project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
|
|
@@ -1639,7 +1641,7 @@ async function boot(argv) {
|
|
|
1639
1641
|
return 2;
|
|
1640
1642
|
}
|
|
1641
1643
|
let { paths, config, vault } = bootResult;
|
|
1642
|
-
|
|
1644
|
+
let first = positional[0];
|
|
1643
1645
|
const mayOfferConfigRecovery = isStdinTTY() && (positional.length === 0 || first === "quick") && (!config.activeProfile || config.activeProfile === "default") && typeof flags["prompt"] !== "string" && !flags["webui"] && !flags["no-interactive"] && !flags["skip"];
|
|
1644
1646
|
const renderer = new TerminalRenderer();
|
|
1645
1647
|
const reader = new ReadlineInputReader({ historyFile: paths.wpaths.historyFile });
|
|
@@ -1671,6 +1673,7 @@ async function boot(argv) {
|
|
|
1671
1673
|
flags["quick"] = true;
|
|
1672
1674
|
flags["tui"] = true;
|
|
1673
1675
|
positional.splice(0, 1);
|
|
1676
|
+
first = void 0;
|
|
1674
1677
|
const plugins = config?.plugins ?? [];
|
|
1675
1678
|
if (plugins.length === 0) {
|
|
1676
1679
|
console.debug("[wrongstack:quick] No plugins configured");
|
|
@@ -1705,7 +1708,8 @@ async function boot(argv) {
|
|
|
1705
1708
|
overlayFile: resolveBundledOverlayFile(),
|
|
1706
1709
|
overlayCacheFile: wpaths.modelsOverlayCache
|
|
1707
1710
|
});
|
|
1708
|
-
|
|
1711
|
+
const subcommandHandler = first ? subcommands[first] : void 0;
|
|
1712
|
+
if (first && subcommandHandler) {
|
|
1709
1713
|
const container = createDefaultContainer({
|
|
1710
1714
|
config,
|
|
1711
1715
|
wpaths,
|
|
@@ -1721,7 +1725,7 @@ async function boot(argv) {
|
|
|
1721
1725
|
registry: toolRegistryForSubcmd,
|
|
1722
1726
|
tier: normalizeTokenSavingTier(config.features.tokenSavingMode)
|
|
1723
1727
|
});
|
|
1724
|
-
const code = await
|
|
1728
|
+
const code = await subcommandHandler(positional.slice(1), {
|
|
1725
1729
|
config,
|
|
1726
1730
|
renderer,
|
|
1727
1731
|
reader,
|
|
@@ -2120,26 +2124,19 @@ async function launchDesktop(args) {
|
|
|
2120
2124
|
}
|
|
2121
2125
|
|
|
2122
2126
|
// src/boot/short-circuit-hq.ts
|
|
2123
|
-
import * as fs7 from "node:fs/promises";
|
|
2124
2127
|
import * as net from "node:net";
|
|
2125
|
-
import
|
|
2128
|
+
import {
|
|
2129
|
+
HQ_CLI_DEFAULT_HOST,
|
|
2130
|
+
isLoopbackHost,
|
|
2131
|
+
readHqRuntimeFileSync,
|
|
2132
|
+
resolveHqDataDir
|
|
2133
|
+
} from "@wrongstack/core/hq";
|
|
2126
2134
|
import { color as color8, isPidAlive } from "@wrongstack/core/utils";
|
|
2127
|
-
import { HQ_CLI_DEFAULT_HOST, isLoopbackHost, resolveHqDataDir } from "@wrongstack/core/hq";
|
|
2128
2135
|
async function isHqAlreadyRunning(dataDir) {
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
const content = await fd.read().then(({ buffer }) => buffer.toString("utf8"));
|
|
2134
|
-
const marker = JSON.parse(content);
|
|
2135
|
-
if (marker.pid && isPidAlive(marker.pid)) return marker;
|
|
2136
|
-
return null;
|
|
2137
|
-
} catch (err) {
|
|
2138
|
-
if (err.code === "ENOENT") return null;
|
|
2139
|
-
return null;
|
|
2140
|
-
} finally {
|
|
2141
|
-
if (fd) await fd.close();
|
|
2142
|
-
}
|
|
2136
|
+
const marker = readHqRuntimeFileSync(dataDir);
|
|
2137
|
+
if (!marker) return null;
|
|
2138
|
+
if (marker.pid && isPidAlive(marker.pid)) return marker;
|
|
2139
|
+
return null;
|
|
2143
2140
|
}
|
|
2144
2141
|
async function isPortInUse(host, port) {
|
|
2145
2142
|
return new Promise((resolve2) => {
|
|
@@ -2159,7 +2156,7 @@ async function isPortInUse(host, port) {
|
|
|
2159
2156
|
}
|
|
2160
2157
|
async function handleHqShortCircuit(flags) {
|
|
2161
2158
|
if (flags["hq"] !== true) return null;
|
|
2162
|
-
const { startHqServer } = await import("./hq-server-
|
|
2159
|
+
const { startHqServer } = await import("./hq-server-S7HZG3PA.js");
|
|
2163
2160
|
const tunnelRequested = flags["tunnel"] === true;
|
|
2164
2161
|
const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST;
|
|
2165
2162
|
if (tunnelRequested && !isLoopbackHost(host)) {
|
|
@@ -2318,7 +2315,7 @@ ${color8.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
2318
2315
|
}
|
|
2319
2316
|
|
|
2320
2317
|
// src/boot/launch-menu.ts
|
|
2321
|
-
import * as
|
|
2318
|
+
import * as fs7 from "node:fs/promises";
|
|
2322
2319
|
import { HQ_CLI_DEFAULT_HOST as HQ_CLI_DEFAULT_HOST2 } from "@wrongstack/core/hq";
|
|
2323
2320
|
import { atomicWrite as atomicWrite3, color as color9, isStdinTTY as isStdinTTY2, setRawMode as setRawMode2 } from "@wrongstack/core/utils";
|
|
2324
2321
|
|
|
@@ -2487,42 +2484,10 @@ function shouldSkipMenu(argv, flags, positional) {
|
|
|
2487
2484
|
if (flags["skip"] === true) return true;
|
|
2488
2485
|
if (typeof flags["prompt"] === "string") return true;
|
|
2489
2486
|
if (!isStdinTTY2()) return true;
|
|
2490
|
-
if (positional.length > 0)
|
|
2491
|
-
const first = positional[0];
|
|
2492
|
-
if (first && KNOWN_SUBCOMMANDS.has(first)) return true;
|
|
2493
|
-
}
|
|
2487
|
+
if (positional.length > 0) return true;
|
|
2494
2488
|
void argv;
|
|
2495
2489
|
return false;
|
|
2496
2490
|
}
|
|
2497
|
-
var KNOWN_SUBCOMMANDS = /* @__PURE__ */ new Set([
|
|
2498
|
-
"auth",
|
|
2499
|
-
"init",
|
|
2500
|
-
"mcp",
|
|
2501
|
-
"plugin",
|
|
2502
|
-
"doctor",
|
|
2503
|
-
"version",
|
|
2504
|
-
"help",
|
|
2505
|
-
"provider",
|
|
2506
|
-
"project",
|
|
2507
|
-
"governance",
|
|
2508
|
-
"session",
|
|
2509
|
-
"sessions",
|
|
2510
|
-
"replay",
|
|
2511
|
-
"export",
|
|
2512
|
-
"rewind",
|
|
2513
|
-
"config-history",
|
|
2514
|
-
"modeldiag",
|
|
2515
|
-
"models-add",
|
|
2516
|
-
"tools",
|
|
2517
|
-
"skill",
|
|
2518
|
-
"skills",
|
|
2519
|
-
"update",
|
|
2520
|
-
"quick",
|
|
2521
|
-
"audit",
|
|
2522
|
-
"bench",
|
|
2523
|
-
"mailbox-serve",
|
|
2524
|
-
"resume"
|
|
2525
|
-
]);
|
|
2526
2491
|
async function runLaunchMenu(deps) {
|
|
2527
2492
|
if (shouldSkipMenu(deps.argv, deps.flags, deps.positional)) {
|
|
2528
2493
|
return null;
|
|
@@ -2854,13 +2819,13 @@ function toPersistedMenuChoice(result) {
|
|
|
2854
2819
|
async function persistMenuChoice(globalConfigPath, choice) {
|
|
2855
2820
|
let fileExists = false;
|
|
2856
2821
|
try {
|
|
2857
|
-
await
|
|
2822
|
+
await fs7.access(globalConfigPath);
|
|
2858
2823
|
fileExists = true;
|
|
2859
2824
|
} catch {
|
|
2860
2825
|
}
|
|
2861
2826
|
let existing = {};
|
|
2862
2827
|
try {
|
|
2863
|
-
const raw = await
|
|
2828
|
+
const raw = await fs7.readFile(globalConfigPath, "utf8");
|
|
2864
2829
|
existing = JSON.parse(raw);
|
|
2865
2830
|
} catch (err) {
|
|
2866
2831
|
if (fileExists) {
|
|
@@ -2943,12 +2908,12 @@ import { createDefaultContainer as createDefaultContainer2 } from "@wrongstack/r
|
|
|
2943
2908
|
|
|
2944
2909
|
// src/cli-bundled-skills.ts
|
|
2945
2910
|
import { createRequire as createRequire3 } from "node:module";
|
|
2946
|
-
import * as
|
|
2911
|
+
import * as path7 from "node:path";
|
|
2947
2912
|
function resolveBundledSkillsDir2() {
|
|
2948
2913
|
try {
|
|
2949
2914
|
const req = createRequire3(import.meta.url);
|
|
2950
2915
|
const corePkg = req.resolve("@wrongstack/core/package.json");
|
|
2951
|
-
return
|
|
2916
|
+
return path7.join(path7.dirname(corePkg), "skills");
|
|
2952
2917
|
} catch {
|
|
2953
2918
|
return void 0;
|
|
2954
2919
|
}
|
|
@@ -2956,12 +2921,12 @@ function resolveBundledSkillsDir2() {
|
|
|
2956
2921
|
|
|
2957
2922
|
// src/cli-bundled-prompts.ts
|
|
2958
2923
|
import { createRequire as createRequire4 } from "node:module";
|
|
2959
|
-
import * as
|
|
2924
|
+
import * as path8 from "node:path";
|
|
2960
2925
|
function resolveBundledPromptsDir2() {
|
|
2961
2926
|
try {
|
|
2962
2927
|
const req = createRequire4(import.meta.url);
|
|
2963
2928
|
const corePkg = req.resolve("@wrongstack/core/package.json");
|
|
2964
|
-
return
|
|
2929
|
+
return path8.join(path8.dirname(corePkg), "data", "prompts");
|
|
2965
2930
|
} catch {
|
|
2966
2931
|
return void 0;
|
|
2967
2932
|
}
|
|
@@ -3149,7 +3114,7 @@ async function initializeCli(argv) {
|
|
|
3149
3114
|
async function main(argv) {
|
|
3150
3115
|
const cliCtx = await initializeCli(argv);
|
|
3151
3116
|
if (typeof cliCtx === "number") return cliCtx;
|
|
3152
|
-
const { runInteractive } = await import("./cli-main-
|
|
3117
|
+
const { runInteractive } = await import("./cli-main-XWC57MGE.js");
|
|
3153
3118
|
return runInteractive(cliCtx);
|
|
3154
3119
|
}
|
|
3155
3120
|
|
|
@@ -81,6 +81,11 @@ export interface LiveSettingsInput {
|
|
|
81
81
|
* file content. Persisted as `autonomy.readAdvancedMode`.
|
|
82
82
|
*/
|
|
83
83
|
readSymbols?: boolean | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* Register the leader's agent-callable `nextsteps` tool. Persisted to
|
|
86
|
+
* `tools.nextsteps.enabled`; read at boot, so it applies next session.
|
|
87
|
+
*/
|
|
88
|
+
nextStepsTool?: boolean | undefined;
|
|
84
89
|
/** Minimum relation strength for SAGE memory injection. Default: 0.85. */
|
|
85
90
|
sageMemoryInjectThreshold?: number | undefined;
|
|
86
91
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
restoreFlags
|
|
3
|
+
} from "./chunk-CSAPOCBP.js";
|
|
1
4
|
import {
|
|
2
5
|
activeProfileConfigPath
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YMXXOOFN.js";
|
|
4
7
|
import "./chunk-7OCVIDC7.js";
|
|
5
8
|
|
|
6
9
|
// src/subcommands/handlers/mcp.ts
|
|
@@ -301,6 +304,7 @@ async function serveMcpStdio(deps) {
|
|
|
301
304
|
// src/subcommands/handlers/mcp.ts
|
|
302
305
|
var BUILT_IN_MCP = allServers();
|
|
303
306
|
var mcpCmd = async (args, deps) => {
|
|
307
|
+
args = restoreFlags(args, deps, ["enable", "e", "transport", "url", "command"]);
|
|
304
308
|
const sub = args[0];
|
|
305
309
|
if (sub === "serve") {
|
|
306
310
|
return serveMcpStdio(deps);
|
|
@@ -410,4 +414,4 @@ function isRecord(value) {
|
|
|
410
414
|
export {
|
|
411
415
|
mcpCmd
|
|
412
416
|
};
|
|
413
|
-
//# sourceMappingURL=mcp-
|
|
417
|
+
//# sourceMappingURL=mcp-OHPJH73U.js.map
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-PJHET45A.js";
|
|
9
9
|
import {
|
|
10
10
|
activeProfileConfigPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YMXXOOFN.js";
|
|
12
12
|
import "./chunk-7OCVIDC7.js";
|
|
13
13
|
|
|
14
14
|
// src/subcommands/handlers/modeldiag.ts
|
|
@@ -1287,4 +1287,4 @@ ${color2.dim('Enter numbers or provider IDs (comma-separated, or "all"):')}
|
|
|
1287
1287
|
export {
|
|
1288
1288
|
modeldiagCmd
|
|
1289
1289
|
};
|
|
1290
|
-
//# sourceMappingURL=modeldiag-
|
|
1290
|
+
//# sourceMappingURL=modeldiag-3DOK4BWW.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runPluginManagementCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GUHQQG63.js";
|
|
4
|
+
import {
|
|
5
|
+
restoreFlags
|
|
6
|
+
} from "./chunk-CSAPOCBP.js";
|
|
4
7
|
import {
|
|
5
8
|
activeProfileConfigPath
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YMXXOOFN.js";
|
|
7
10
|
import "./chunk-7OCVIDC7.js";
|
|
8
11
|
|
|
9
12
|
// src/subcommands/handlers/plugin-usage.ts
|
|
10
13
|
var pluginCmd = async (args, deps) => {
|
|
14
|
+
args = restoreFlags(args, deps, ["disabled", "enable", "e", "json", "all"]);
|
|
11
15
|
const result = await runPluginManagementCommand(args, {
|
|
12
16
|
config: deps.config,
|
|
13
17
|
configPath: activeProfileConfigPath(deps.paths, deps.config)
|
|
@@ -37,4 +41,4 @@ export {
|
|
|
37
41
|
pluginCmd,
|
|
38
42
|
usageCmd
|
|
39
43
|
};
|
|
40
|
-
//# sourceMappingURL=plugin-usage-
|
|
44
|
+
//# sourceMappingURL=plugin-usage-YEVLOR33.js.map
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
pluginNameFromSpec,
|
|
8
8
|
setupPlugins,
|
|
9
9
|
warnIfDeprecatedPluginName
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-ZECLGUTF.js";
|
|
11
|
+
import "./chunk-GUHQQG63.js";
|
|
12
12
|
import "./chunk-TYO2OVAD.js";
|
|
13
13
|
import "./chunk-7OCVIDC7.js";
|
|
14
14
|
export {
|
|
@@ -21,4 +21,4 @@ export {
|
|
|
21
21
|
setupPlugins,
|
|
22
22
|
warnIfDeprecatedPluginName
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=plugins-
|
|
24
|
+
//# sourceMappingURL=plugins-K3BAUP4D.js.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Config } from '@wrongstack/core/types';
|
|
2
2
|
import type { WstackPaths } from '@wrongstack/core/utils';
|
|
3
|
-
/** Resolve the selected profile without ever treating the root bootstrap as settings. */
|
|
4
|
-
export declare function activeProfileName(config: Pick<Config, 'activeProfile'>): string;
|
|
5
3
|
/** Canonical settings file for the currently selected profile. */
|
|
6
4
|
export declare function activeProfileConfigPath(paths: Pick<WstackPaths, 'profileConfig'>, config: Pick<Config, 'activeProfile'>): string;
|
|
7
5
|
//# sourceMappingURL=profile-config-path.d.ts.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared provider-config helpers used by the picker, main boot sequence,
|
|
3
|
-
* and subcommands. Keeps provider key detection and alias resolution in
|
|
4
|
-
* one place so the logic doesn't drift between call sites.
|
|
5
|
-
*/
|
|
6
1
|
import type { Config, ModelsRegistry, ProviderConfig, ResolvedProvider } from '@wrongstack/core/types';
|
|
7
2
|
/** Return the provider's visible model ids: models.dev plus anything the saved
|
|
8
3
|
* config names that the catalog does not carry.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
visibleModelIds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ETOEGL3V.js";
|
|
4
4
|
import {
|
|
5
5
|
mutateConfigProviders
|
|
6
6
|
} from "./chunk-PJHET45A.js";
|
|
7
7
|
import {
|
|
8
8
|
activeProfileConfigPath
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YMXXOOFN.js";
|
|
10
10
|
import "./chunk-7OCVIDC7.js";
|
|
11
11
|
|
|
12
12
|
// src/subcommands/handlers/providers-models.ts
|
|
@@ -15,8 +15,9 @@ import { atomicWrite, color, expectDefined } from "@wrongstack/core/utils";
|
|
|
15
15
|
import { decryptConfigSecrets, encryptConfigSecrets } from "@wrongstack/core/security";
|
|
16
16
|
import { ConfigError } from "@wrongstack/core/types";
|
|
17
17
|
var providersCmd = async (args, deps) => {
|
|
18
|
-
const
|
|
19
|
-
const
|
|
18
|
+
const providerFlags = subcommandFlags(args, deps);
|
|
19
|
+
const showAll = providerFlags["all"] === true || providerFlags["all"] === "true";
|
|
20
|
+
const showUnsupported = providerFlags["unsupported"] === true || providerFlags["unsupported"] === "true";
|
|
20
21
|
try {
|
|
21
22
|
const all = await deps.modelsRegistry.listProviders();
|
|
22
23
|
const byFamily = {
|
|
@@ -611,4 +612,4 @@ export {
|
|
|
611
612
|
modelsCmd,
|
|
612
613
|
providersCmd
|
|
613
614
|
};
|
|
614
|
-
//# sourceMappingURL=providers-models-
|
|
615
|
+
//# sourceMappingURL=providers-models-WEZ4EGLL.js.map
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
restoreFlags
|
|
3
|
+
} from "./chunk-CSAPOCBP.js";
|
|
1
4
|
import "./chunk-7OCVIDC7.js";
|
|
2
5
|
|
|
3
6
|
// src/subcommands/handlers/replay.ts
|
|
4
7
|
import { color, resolveWstackPaths } from "@wrongstack/core/utils";
|
|
5
8
|
import { ReplayLogStore } from "@wrongstack/core/storage";
|
|
6
9
|
var replayCmd = async (args, deps) => {
|
|
10
|
+
args = restoreFlags(args, deps, ["list", "l"]);
|
|
7
11
|
const wpaths = resolveWstackPaths({
|
|
8
12
|
projectRoot: deps.projectRoot,
|
|
9
13
|
userHome: deps.userHome
|
|
@@ -72,4 +76,4 @@ Run a session with --record first, then --replay to re-execute it.`
|
|
|
72
76
|
export {
|
|
73
77
|
replayCmd
|
|
74
78
|
};
|
|
75
|
-
//# sourceMappingURL=replay-
|
|
79
|
+
//# sourceMappingURL=replay-FCBNHW3K.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
restoreFlags
|
|
3
|
+
} from "./chunk-CSAPOCBP.js";
|
|
1
4
|
import "./chunk-7OCVIDC7.js";
|
|
2
5
|
|
|
3
6
|
// src/subcommands/handlers/rewind.ts
|
|
@@ -32,6 +35,7 @@ function findSessionId(args) {
|
|
|
32
35
|
return void 0;
|
|
33
36
|
}
|
|
34
37
|
var rewindCmd = async (args, deps) => {
|
|
38
|
+
args = restoreFlags(args, deps, ["all", "last", "to", "list", "resume"]);
|
|
35
39
|
const flags = parseRewindFlags(args);
|
|
36
40
|
const wpaths = resolveWstackPaths({ projectRoot: deps.projectRoot });
|
|
37
41
|
const sessionsDir = wpaths.projectSessions;
|
|
@@ -182,4 +186,4 @@ ${result.errors.length} error(s):
|
|
|
182
186
|
export {
|
|
183
187
|
rewindCmd
|
|
184
188
|
};
|
|
185
|
-
//# sourceMappingURL=rewind-
|
|
189
|
+
//# sourceMappingURL=rewind-AOD3JIYX.js.map
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
restoreFlags
|
|
3
|
+
} from "./chunk-CSAPOCBP.js";
|
|
1
4
|
import {
|
|
2
5
|
getHistoryEntry,
|
|
3
6
|
listHistory,
|
|
4
7
|
restoreFromHistory,
|
|
5
8
|
restoreLast
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-263G3FMB.js";
|
|
7
10
|
import {
|
|
8
11
|
activeProfileConfigPath
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-YMXXOOFN.js";
|
|
10
13
|
import "./chunk-7OCVIDC7.js";
|
|
11
14
|
|
|
12
15
|
// src/subcommands/handlers/sessions-config.ts
|
|
@@ -233,6 +236,7 @@ Fleet Run: ${runId}
|
|
|
233
236
|
|
|
234
237
|
// src/subcommands/handlers/sessions-config.ts
|
|
235
238
|
var sessionsCmd = async (args, deps) => {
|
|
239
|
+
args = restoreFlags(args, deps, ["to", "id", "latest", "l"]);
|
|
236
240
|
const sub = args[0];
|
|
237
241
|
if (sub === "fleet") {
|
|
238
242
|
return sessionsFleetCmd(args.slice(1), deps);
|
|
@@ -302,6 +306,7 @@ var sessionsCmd = async (args, deps) => {
|
|
|
302
306
|
return 0;
|
|
303
307
|
};
|
|
304
308
|
var configCmd = async (args, deps) => {
|
|
309
|
+
args = restoreFlags(args, deps, ["id", "latest", "l"]);
|
|
305
310
|
const sub = args[0];
|
|
306
311
|
if (!sub || sub === "show") {
|
|
307
312
|
deps.renderer.write(JSON.stringify(redactKeys(deps.config), null, 2) + "\n");
|
|
@@ -406,4 +411,4 @@ export {
|
|
|
406
411
|
configCmd,
|
|
407
412
|
sessionsCmd
|
|
408
413
|
};
|
|
409
|
-
//# sourceMappingURL=sessions-config-
|
|
414
|
+
//# sourceMappingURL=sessions-config-XXN7267N.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Re-attach the flags `parseArgs` stripped before a subcommand handler ran.
|
|
3
|
+
*
|
|
4
|
+
* The dispatcher (`boot.ts`) hands a handler only `positional.slice(1)`, while
|
|
5
|
+
* `parseArgs` has already pulled every `--flag` into `flags`. A handler that
|
|
6
|
+
* parses its own `args` therefore saw NONE of the flags it documents:
|
|
7
|
+
* `rewind --last 2` printed usage, `export --format json --out r.json` dumped
|
|
8
|
+
* markdown to stdout, `plugin add X --disabled` wrote it enabled, and
|
|
9
|
+
* `chronicle prune --days 7 --dry-run` performed a real 30-day purge.
|
|
10
|
+
*
|
|
11
|
+
* Re-injecting every flag at the dispatcher would be wrong: top-level switches
|
|
12
|
+
* (`--verbose`, `--yolo`, `--tui`) would land in the subcommand's argv too, and
|
|
13
|
+
* handlers with an "Unknown flag" branch — `export.ts` has one — would start
|
|
14
|
+
* rejecting valid invocations. So each handler declares the flags it owns and
|
|
15
|
+
* gets back exactly those.
|
|
16
|
+
*
|
|
17
|
+
* A spelling already present in `args` always wins: a directly-invoked handler
|
|
18
|
+
* (and anything the caller placed after `--`) keeps overriding.
|
|
19
|
+
*/
|
|
20
|
+
export declare function restoreFlags(args: string[], deps: {
|
|
21
|
+
flags?: Record<string, string | boolean> | undefined;
|
|
22
|
+
}, names: readonly string[]): string[];
|
|
23
|
+
//# sourceMappingURL=flags.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TerminalTone = 'blue' | 'cyan' | 'green' | 'magenta' | 'muted' | 'success' | 'yellow';
|
|
2
|
+
export interface TerminalStyleOptions {
|
|
3
|
+
readonly bold?: boolean;
|
|
4
|
+
/** Capability override for deterministic tests; production derives this from env/TTY. */
|
|
5
|
+
readonly enabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Match the CLI banner's NO_COLOR/FORCE_COLOR/TTY precedence. */
|
|
8
|
+
export declare function terminalFormattingEnabled(env?: NodeJS.ProcessEnv, isTty?: boolean): boolean;
|
|
9
|
+
/** Add semantic color while preserving plain text when formatting is disabled. */
|
|
10
|
+
export declare function terminalText(text: string, tone: TerminalTone, options?: TerminalStyleOptions): string;
|
|
11
|
+
/** Render a colored OSC 8 hyperlink, falling back to the visible URL unchanged. */
|
|
12
|
+
export declare function terminalLink(url: string, options?: TerminalStyleOptions & {
|
|
13
|
+
readonly tone?: TerminalTone;
|
|
14
|
+
}): string;
|
|
15
|
+
//# sourceMappingURL=terminal-format.d.ts.map
|