@wrongstack/cli 0.309.1 → 0.310.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-7NWCC2GO.js → acp-EA57GUFB.js} +6 -4
- package/dist/acp-server-agent.d.ts +1 -1
- package/dist/{audit-BBR22QH3.js → audit-ZPCLCC3C.js} +1 -1
- package/dist/{auth-GZ2FK5KR.js → auth-VQMSZGKE.js} +4 -4
- package/dist/{bench-XNDUJOSZ.js → bench-XYG56AMO.js} +1 -1
- package/dist/boot/tui-session-stub-enrich.d.ts +20 -0
- package/dist/{chronicle-63MFCZN6.js → chronicle-6EPPMUC5.js} +1 -1
- package/dist/{chunk-53STH6CX.js → chunk-63GFD62R.js} +3 -2
- package/dist/{chunk-SZ42FYPT.js → chunk-BXFYBQKR.js} +4 -6
- package/dist/{chunk-UINEP3E7.js → chunk-CHZZEEIP.js} +2 -2
- package/dist/{chunk-CB35UVXO.js → chunk-KQNYSZG2.js} +34 -9
- package/dist/{chunk-XSG33WHN.js → chunk-QAC263FZ.js} +4 -2
- package/dist/{chunk-XQ6FI2K6.js → chunk-QYIIOMLE.js} +2 -2
- package/dist/{chunk-ZRZ54GVL.js → chunk-USYOJIV2.js} +3 -3
- package/dist/{chunk-T6YAVFXA.js → chunk-X3N5TS2S.js} +2 -1
- package/dist/{cli-main-XGDOIPN5.js → cli-main-RFEZAJ4U.js} +3054 -2841
- package/dist/{diag-doctor-WTBHPOMB.js → diag-doctor-HJKFUY6B.js} +1 -1
- package/dist/{execution-TYUXABWI.js → execution-WA2UCXNM.js} +180 -61
- package/dist/{export-CCUXRJOU.js → export-ROG3DKTZ.js} +1 -1
- package/dist/{hq-PA6RH2UW.js → hq-AG4VW4XO.js} +18 -10
- package/dist/hq-server/handle-types.d.ts +32 -0
- package/dist/hq-server/login-attempt-store.d.ts +5 -0
- package/dist/{hq-server-PBRU275L.js → hq-server-GZGM4BHA.js} +2 -2
- package/dist/hq-server.d.ts +2 -20
- package/dist/index.js +104 -75
- package/dist/{init-E2NDDOHI.js → init-4JQSG66Q.js} +1 -1
- package/dist/{mailbox-serve-V3QIJBDH.js → mailbox-serve-5S3PHG5D.js} +1 -1
- package/dist/{mcp-CMLFHRG2.js → mcp-RRPKNRSN.js} +3 -1
- package/dist/mcp-serve.d.ts +1 -1
- package/dist/{modeldiag-ICMPHT5L.js → modeldiag-H6DKWJ2N.js} +6 -12
- package/dist/{plugin-usage-26LIIW3P.js → plugin-usage-GCTYOZPH.js} +1 -1
- package/dist/{projects-XE76NFNZ.js → projects-5J727S4L.js} +1 -1
- package/dist/provider-config-utils.d.ts +1 -2
- package/dist/{providers-models-D23WUD74.js → providers-models-663NDPRQ.js} +2 -2
- package/dist/{quick-VIO2BEHS.js → quick-XLYLZX4B.js} +1 -1
- package/dist/{replay-WBRMEWQ5.js → replay-RZXZKP2U.js} +1 -1
- package/dist/{rewind-7RE6ONIC.js → rewind-2FFNOOKS.js} +1 -1
- package/dist/{sessions-config-YX2ZPAFM.js → sessions-config-7Q7QJBKJ.js} +1 -1
- package/dist/subcommands/handlers/acp.d.ts +1 -1
- package/dist/subcommands/handlers/audit.d.ts +1 -1
- package/dist/subcommands/handlers/auth.d.ts +1 -1
- package/dist/subcommands/handlers/bench.d.ts +1 -1
- package/dist/subcommands/handlers/chronicle.d.ts +1 -1
- package/dist/subcommands/handlers/config-history.d.ts +1 -1
- package/dist/subcommands/handlers/diag-doctor.d.ts +1 -1
- package/dist/subcommands/handlers/export.d.ts +1 -1
- package/dist/subcommands/handlers/hq.d.ts +1 -1
- package/dist/subcommands/handlers/init.d.ts +1 -1
- package/dist/subcommands/handlers/mailbox-serve.d.ts +1 -1
- package/dist/subcommands/handlers/mcp.d.ts +1 -1
- package/dist/subcommands/handlers/modeldiag-bench.d.ts +1 -1
- package/dist/subcommands/handlers/modeldiag-eval.d.ts +1 -1
- package/dist/subcommands/handlers/modeldiag-test.d.ts +1 -1
- package/dist/subcommands/handlers/modeldiag.d.ts +1 -1
- package/dist/subcommands/handlers/plugin-usage.d.ts +1 -1
- package/dist/subcommands/handlers/projects.d.ts +1 -1
- package/dist/subcommands/handlers/providers-models.d.ts +1 -1
- package/dist/subcommands/handlers/quick.d.ts +1 -1
- package/dist/subcommands/handlers/replay.d.ts +1 -1
- package/dist/subcommands/handlers/rewind.d.ts +1 -1
- package/dist/subcommands/handlers/sessions-config.d.ts +1 -1
- package/dist/subcommands/handlers/sessions-fleet.d.ts +1 -1
- package/dist/subcommands/handlers/tools-skills.d.ts +1 -1
- package/dist/subcommands/handlers/update.d.ts +1 -1
- package/dist/subcommands/handlers/version-help.d.ts +1 -1
- package/dist/subcommands/index.d.ts +2 -3
- package/dist/{tools-skills-UNKLOB7M.js → tools-skills-Q4P27URS.js} +1 -1
- package/dist/{update-VZSOZGYC.js → update-RATFF63M.js} +2 -2
- package/dist/{version-help-TFD6VPF3.js → version-help-WMPSEL4U.js} +2 -2
- package/dist/{webui-server-JXJ4CGIX.js → webui-server-3DU6BVTB.js} +7 -10
- package/dist/wiring/director-announcement.d.ts +31 -0
- package/dist/wiring/session-establishment.d.ts +45 -0
- package/dist/wiring/session-registry.d.ts +1 -1
- package/dist/wiring/session-runtime.d.ts +64 -0
- package/dist/wiring/teardown-registrar.d.ts +41 -0
- package/dist/wiring/vector-memory-setup.d.ts +30 -0
- package/package.json +27 -25
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
readLocalSubagentTranscript,
|
|
16
16
|
sanitizeApiError,
|
|
17
17
|
startHqServer
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-KQNYSZG2.js";
|
|
19
19
|
import "./chunk-KE7E7DPX.js";
|
|
20
20
|
import "./chunk-Q5GTM25S.js";
|
|
21
21
|
import "./chunk-7OCVIDC7.js";
|
|
@@ -37,4 +37,4 @@ export {
|
|
|
37
37
|
sanitizeApiError,
|
|
38
38
|
startHqServer
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=hq-server-
|
|
40
|
+
//# sourceMappingURL=hq-server-GZGM4BHA.js.map
|
package/dist/hq-server.d.ts
CHANGED
|
@@ -42,25 +42,7 @@ export interface HqServerOptions {
|
|
|
42
42
|
tokenTtlMs?: number;
|
|
43
43
|
trustedProxyHops?: number;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
browserUrl: string;
|
|
48
|
-
clientUrl: string;
|
|
49
|
-
clientEnv: {
|
|
50
|
-
WRONGSTACK_HQ_URL: string;
|
|
51
|
-
WRONGSTACK_HQ_TOKEN?: string;
|
|
52
|
-
};
|
|
53
|
-
createdAuth: boolean;
|
|
54
|
-
browserTokenMode: boolean;
|
|
55
|
-
passwordMode: boolean;
|
|
56
|
-
}
|
|
57
|
-
export type HqFirstRunSetup = HqStartupConnectionInfo;
|
|
58
|
-
export interface HqServerHandle {
|
|
59
|
-
host: string;
|
|
60
|
-
port: number;
|
|
61
|
-
firstRunSetup?: HqFirstRunSetup;
|
|
62
|
-
trustPublicOrigin(origin: string): void;
|
|
63
|
-
close(): Promise<void>;
|
|
64
|
-
}
|
|
45
|
+
import type { HqServerHandle } from './hq-server/handle-types.js';
|
|
46
|
+
export type { HqFirstRunSetup, HqServerHandle, HqStartupConnectionInfo, } from './hq-server/handle-types.js';
|
|
65
47
|
export declare function startHqServer(options?: HqServerOptions): Promise<HqServerHandle>;
|
|
66
48
|
//# sourceMappingURL=hq-server.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -23,18 +23,18 @@ import {
|
|
|
23
23
|
} from "./chunk-52C7PD2H.js";
|
|
24
24
|
import {
|
|
25
25
|
runUpdateCommand
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-63GFD62R.js";
|
|
27
27
|
import "./chunk-U3SS4NRH.js";
|
|
28
28
|
import "./chunk-NUIHRGPY.js";
|
|
29
29
|
import {
|
|
30
30
|
DEFAULT_PORT
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KQNYSZG2.js";
|
|
32
32
|
import "./chunk-KE7E7DPX.js";
|
|
33
33
|
import "./chunk-Q5GTM25S.js";
|
|
34
34
|
import {
|
|
35
35
|
helpCmd,
|
|
36
36
|
versionCmd
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-QAC263FZ.js";
|
|
38
38
|
import {
|
|
39
39
|
CLI_VERSION
|
|
40
40
|
} from "./chunk-XJXDOF63.js";
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
normalizeKeys,
|
|
60
60
|
resolveActiveApiKey,
|
|
61
61
|
writeKeysBack
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-BXFYBQKR.js";
|
|
63
63
|
import "./chunk-7OCVIDC7.js";
|
|
64
64
|
|
|
65
65
|
// src/cli-context.ts
|
|
@@ -386,7 +386,7 @@ async function promptModeArrow(deps) {
|
|
|
386
386
|
const { renderer } = deps;
|
|
387
387
|
const stdin = process.stdin;
|
|
388
388
|
const out = (s) => renderer.write(s);
|
|
389
|
-
return await new Promise((
|
|
389
|
+
return await new Promise((resolve3) => {
|
|
390
390
|
let index = 0;
|
|
391
391
|
let drawn = 0;
|
|
392
392
|
let remaining = Math.round(MENU_TIMEOUT_MS / 1e3);
|
|
@@ -441,7 +441,7 @@ async function promptModeArrow(deps) {
|
|
|
441
441
|
out("\x1B[0J");
|
|
442
442
|
out(finalLine);
|
|
443
443
|
out("\x1B[?25h");
|
|
444
|
-
|
|
444
|
+
resolve3(result);
|
|
445
445
|
};
|
|
446
446
|
const pick = () => {
|
|
447
447
|
const opt = MODE_OPTIONS[index];
|
|
@@ -500,7 +500,7 @@ async function promptModeArrow(deps) {
|
|
|
500
500
|
setRawMode(stdin, true);
|
|
501
501
|
stdin.resume();
|
|
502
502
|
} catch {
|
|
503
|
-
|
|
503
|
+
resolve3(null);
|
|
504
504
|
return;
|
|
505
505
|
}
|
|
506
506
|
out("\x1B[?25l");
|
|
@@ -712,7 +712,7 @@ async function launchDesktop(args) {
|
|
|
712
712
|
);
|
|
713
713
|
return 1;
|
|
714
714
|
}
|
|
715
|
-
return await new Promise((
|
|
715
|
+
return await new Promise((resolve3) => {
|
|
716
716
|
const child = spawn(process.execPath, [launcherPath, ...args], {
|
|
717
717
|
stdio: "inherit",
|
|
718
718
|
env: process.env,
|
|
@@ -723,11 +723,11 @@ async function launchDesktop(args) {
|
|
|
723
723
|
`${color2.red("\u2717 Failed to start WrongStack Desktop:")} ${err.message}
|
|
724
724
|
`
|
|
725
725
|
);
|
|
726
|
-
|
|
726
|
+
resolve3(1);
|
|
727
727
|
});
|
|
728
728
|
child.once("exit", (code, signal) => {
|
|
729
|
-
if (typeof code === "number")
|
|
730
|
-
else
|
|
729
|
+
if (typeof code === "number") resolve3(code);
|
|
730
|
+
else resolve3(signal ? 1 : 0);
|
|
731
731
|
});
|
|
732
732
|
});
|
|
733
733
|
}
|
|
@@ -1660,7 +1660,10 @@ var helpTable = {
|
|
|
1660
1660
|
{ name: "list", description: "List available ACP agents from the cache." },
|
|
1661
1661
|
{ name: "sync", description: "Sync the official ACP agent registry into local cache." },
|
|
1662
1662
|
{ name: "spawn <id> <task>", description: "Spawn an ACP agent and wait for results." },
|
|
1663
|
-
{
|
|
1663
|
+
{
|
|
1664
|
+
name: "parallel <csv> <task>",
|
|
1665
|
+
description: "Fan a task out to multiple ACP agents in parallel."
|
|
1666
|
+
},
|
|
1664
1667
|
{ name: "probe [csv]", description: "Handshake-test installed ACP agents." },
|
|
1665
1668
|
{ name: "bench [csv] [--fs]", description: "End-to-end benchmark and grade ACP agents." }
|
|
1666
1669
|
],
|
|
@@ -1732,7 +1735,10 @@ var helpTable = {
|
|
|
1732
1735
|
usage: "wstack hq [serve] [--port <n>] [--password <secret>] [--tunnel] [--open] | wstack hq token [create|list|revoke]",
|
|
1733
1736
|
subcommands: [
|
|
1734
1737
|
{ name: "serve", description: "Start the HQ dashboard server (default)." },
|
|
1735
|
-
{
|
|
1738
|
+
{
|
|
1739
|
+
name: "token create [label]",
|
|
1740
|
+
description: "Mint a browser or client authentication token."
|
|
1741
|
+
},
|
|
1736
1742
|
{ name: "token list", description: "List active HQ authentication tokens." },
|
|
1737
1743
|
{ name: "token revoke <id>", description: "Revoke an issued HQ authentication token." }
|
|
1738
1744
|
],
|
|
@@ -1792,8 +1798,14 @@ var helpTable = {
|
|
|
1792
1798
|
{ name: "query [field=value ...]", description: "Query recorded provenance events." },
|
|
1793
1799
|
{ name: "status", description: "Check the Chronicle daemon and pipeline status." },
|
|
1794
1800
|
{ name: "facet <field>", description: "Group and count events across a facet." },
|
|
1795
|
-
{
|
|
1796
|
-
|
|
1801
|
+
{
|
|
1802
|
+
name: "metrics [providers|tasks|files|summary]",
|
|
1803
|
+
description: "Query aggregated metrics from metrics.db."
|
|
1804
|
+
},
|
|
1805
|
+
{
|
|
1806
|
+
name: "prune [--days N] [--dry-run]",
|
|
1807
|
+
description: "Purge journal entries older than N days."
|
|
1808
|
+
},
|
|
1797
1809
|
{ name: "compact", description: "Defragment and compact SQLite ledger." }
|
|
1798
1810
|
],
|
|
1799
1811
|
seeAlso: "wstack audit (per-session audit log); wstack usage (cost summary)"
|
|
@@ -1849,44 +1861,46 @@ var subcommandsWithFocusedHelp = Object.keys(helpTable);
|
|
|
1849
1861
|
|
|
1850
1862
|
// src/subcommands/index.ts
|
|
1851
1863
|
var loaders = {
|
|
1852
|
-
acp: async () => (await import("./acp-
|
|
1853
|
-
init: async () => (await import("./init-
|
|
1854
|
-
auth: async () => (await import("./auth-
|
|
1855
|
-
update: async () => (await import("./update-
|
|
1856
|
-
sessions: async () => (await import("./sessions-config-
|
|
1857
|
-
config: async () => (await import("./sessions-config-
|
|
1858
|
-
rewind: async () => (await import("./rewind-
|
|
1859
|
-
replay: async () => (await import("./replay-
|
|
1860
|
-
audit: async () => (await import("./audit-
|
|
1861
|
-
tools: async () => (await import("./tools-skills-
|
|
1862
|
-
skills: async () => (await import("./tools-skills-
|
|
1863
|
-
providers: async () => (await import("./providers-models-
|
|
1864
|
-
models: async () => (await import("./providers-models-
|
|
1865
|
-
mcp: async () => (await import("./mcp-
|
|
1866
|
-
plugin: async () => (await import("./plugin-usage-
|
|
1867
|
-
plugins: async () => (await import("./plugin-usage-
|
|
1868
|
-
diag: async () => (await import("./diag-doctor-
|
|
1869
|
-
doctor: async () => (await import("./diag-doctor-
|
|
1870
|
-
export: async () => (await import("./export-
|
|
1871
|
-
usage: async () => (await import("./plugin-usage-
|
|
1872
|
-
version: async () => (await import("./version-help-
|
|
1873
|
-
help: async () => (await import("./version-help-
|
|
1874
|
-
projects: async () => (await import("./projects-
|
|
1875
|
-
modeldiag: async () => (await import("./modeldiag-
|
|
1876
|
-
quick: async () => (await import("./quick-
|
|
1877
|
-
bench: async () => (await import("./bench-
|
|
1878
|
-
chronicle: async () => (await import("./chronicle-
|
|
1879
|
-
hq: async () => (await import("./hq-
|
|
1880
|
-
mailbox: async () => (await import("./mailbox-serve-
|
|
1864
|
+
acp: async () => (await import("./acp-EA57GUFB.js")).acpCmd,
|
|
1865
|
+
init: async () => (await import("./init-4JQSG66Q.js")).initCmd,
|
|
1866
|
+
auth: async () => (await import("./auth-VQMSZGKE.js")).authCmd,
|
|
1867
|
+
update: async () => (await import("./update-RATFF63M.js")).updateCmd,
|
|
1868
|
+
sessions: async () => (await import("./sessions-config-7Q7QJBKJ.js")).sessionsCmd,
|
|
1869
|
+
config: async () => (await import("./sessions-config-7Q7QJBKJ.js")).configCmd,
|
|
1870
|
+
rewind: async () => (await import("./rewind-2FFNOOKS.js")).rewindCmd,
|
|
1871
|
+
replay: async () => (await import("./replay-RZXZKP2U.js")).replayCmd,
|
|
1872
|
+
audit: async () => (await import("./audit-ZPCLCC3C.js")).auditCmd,
|
|
1873
|
+
tools: async () => (await import("./tools-skills-Q4P27URS.js")).toolsCmd,
|
|
1874
|
+
skills: async () => (await import("./tools-skills-Q4P27URS.js")).skillsCmd,
|
|
1875
|
+
providers: async () => (await import("./providers-models-663NDPRQ.js")).providersCmd,
|
|
1876
|
+
models: async () => (await import("./providers-models-663NDPRQ.js")).modelsCmd,
|
|
1877
|
+
mcp: async () => (await import("./mcp-RRPKNRSN.js")).mcpCmd,
|
|
1878
|
+
plugin: async () => (await import("./plugin-usage-GCTYOZPH.js")).pluginCmd,
|
|
1879
|
+
plugins: async () => (await import("./plugin-usage-GCTYOZPH.js")).pluginCmd,
|
|
1880
|
+
diag: async () => (await import("./diag-doctor-HJKFUY6B.js")).diagCmd,
|
|
1881
|
+
doctor: async () => (await import("./diag-doctor-HJKFUY6B.js")).doctorCmd,
|
|
1882
|
+
export: async () => (await import("./export-ROG3DKTZ.js")).exportCmd,
|
|
1883
|
+
usage: async () => (await import("./plugin-usage-GCTYOZPH.js")).usageCmd,
|
|
1884
|
+
version: async () => (await import("./version-help-WMPSEL4U.js")).versionCmd,
|
|
1885
|
+
help: async () => (await import("./version-help-WMPSEL4U.js")).helpCmd,
|
|
1886
|
+
projects: async () => (await import("./projects-5J727S4L.js")).projectsCmd,
|
|
1887
|
+
modeldiag: async () => (await import("./modeldiag-H6DKWJ2N.js")).modeldiagCmd,
|
|
1888
|
+
quick: async () => (await import("./quick-XLYLZX4B.js")).quickCmd,
|
|
1889
|
+
bench: async () => (await import("./bench-XYG56AMO.js")).benchCmd,
|
|
1890
|
+
chronicle: async () => (await import("./chronicle-6EPPMUC5.js")).chronicleCmd,
|
|
1891
|
+
hq: async () => (await import("./hq-AG4VW4XO.js")).hqCmd,
|
|
1892
|
+
mailbox: async () => (await import("./mailbox-serve-5S3PHG5D.js")).mailboxServeCmd,
|
|
1881
1893
|
permissions: async () => (await import("./permissions-2PWBL4YU.js")).permissionsCmd,
|
|
1882
1894
|
project: async () => (await import("./project-BLQ3ALVL.js")).projectCmd,
|
|
1883
1895
|
governance: async () => (await import("./governance-V2Z42RBE.js")).governanceCmd
|
|
1884
1896
|
};
|
|
1885
1897
|
var subcommands = Object.fromEntries(
|
|
1886
|
-
Object.entries(loaders).map(
|
|
1887
|
-
name,
|
|
1888
|
-
|
|
1889
|
-
|
|
1898
|
+
Object.entries(loaders).map(
|
|
1899
|
+
([name, load]) => [
|
|
1900
|
+
name,
|
|
1901
|
+
async (args, deps) => (await load())(args, deps)
|
|
1902
|
+
]
|
|
1903
|
+
)
|
|
1890
1904
|
);
|
|
1891
1905
|
var subcommandNames = Object.keys(loaders);
|
|
1892
1906
|
|
|
@@ -1936,24 +1950,24 @@ async function isHqAlreadyRunning(dataDir) {
|
|
|
1936
1950
|
return null;
|
|
1937
1951
|
}
|
|
1938
1952
|
async function isPortInUse(host, port) {
|
|
1939
|
-
return new Promise((
|
|
1953
|
+
return new Promise((resolve3) => {
|
|
1940
1954
|
const server = net.createServer();
|
|
1941
1955
|
server.once("error", (err) => {
|
|
1942
1956
|
if (err.code === "EADDRINUSE") {
|
|
1943
|
-
|
|
1957
|
+
resolve3(true);
|
|
1944
1958
|
} else {
|
|
1945
|
-
|
|
1959
|
+
resolve3(false);
|
|
1946
1960
|
}
|
|
1947
1961
|
});
|
|
1948
1962
|
server.once("listening", () => {
|
|
1949
|
-
server.close(() =>
|
|
1963
|
+
server.close(() => resolve3(false));
|
|
1950
1964
|
});
|
|
1951
1965
|
server.listen(port, host);
|
|
1952
1966
|
});
|
|
1953
1967
|
}
|
|
1954
1968
|
async function handleHqShortCircuit(flags) {
|
|
1955
1969
|
if (flags["hq"] !== true) return null;
|
|
1956
|
-
const { startHqServer } = await import("./hq-server-
|
|
1970
|
+
const { startHqServer } = await import("./hq-server-GZGM4BHA.js");
|
|
1957
1971
|
const tunnelRequested = flags["tunnel"] === true;
|
|
1958
1972
|
const host = typeof flags["host"] === "string" ? flags["host"] : tunnelRequested ? "127.0.0.1" : HQ_CLI_DEFAULT_HOST2;
|
|
1959
1973
|
if (tunnelRequested && !isLoopbackHost(host)) {
|
|
@@ -2084,7 +2098,7 @@ ${color6.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
2084
2098
|
} catch {
|
|
2085
2099
|
}
|
|
2086
2100
|
}
|
|
2087
|
-
await new Promise((
|
|
2101
|
+
await new Promise((resolve3) => {
|
|
2088
2102
|
const shutdown = async () => {
|
|
2089
2103
|
const results = await Promise.allSettled([
|
|
2090
2104
|
...tunnel ? [tunnel.close()] : [],
|
|
@@ -2103,7 +2117,7 @@ ${color6.green("Cloudflare Quick Tunnel ready:")} ${browserUrl}
|
|
|
2103
2117
|
})
|
|
2104
2118
|
);
|
|
2105
2119
|
}
|
|
2106
|
-
|
|
2120
|
+
resolve3();
|
|
2107
2121
|
};
|
|
2108
2122
|
process.on("SIGINT", shutdown);
|
|
2109
2123
|
process.on("SIGTERM", shutdown);
|
|
@@ -2491,7 +2505,7 @@ async function runProjectCheck(opts) {
|
|
|
2491
2505
|
if (answer2 === "y" || answer2 === "yes") {
|
|
2492
2506
|
try {
|
|
2493
2507
|
const { spawn: spawn2 } = await import("node:child_process");
|
|
2494
|
-
await new Promise((
|
|
2508
|
+
await new Promise((resolve3, reject) => {
|
|
2495
2509
|
const child = spawn2("git", ["init"], {
|
|
2496
2510
|
cwd,
|
|
2497
2511
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -2500,7 +2514,7 @@ async function runProjectCheck(opts) {
|
|
|
2500
2514
|
child.on("error", reject);
|
|
2501
2515
|
child.on(
|
|
2502
2516
|
"close",
|
|
2503
|
-
(code) => code === 0 ?
|
|
2517
|
+
(code) => code === 0 ? resolve3() : reject(new Error(`git init failed with ${code}`))
|
|
2504
2518
|
);
|
|
2505
2519
|
});
|
|
2506
2520
|
renderer.write(` ${color9.green("\u2713")} Git repository initialized
|
|
@@ -2744,25 +2758,25 @@ var ReadlineInputReader = class {
|
|
|
2744
2758
|
async readLine(prompt, timeoutOpts) {
|
|
2745
2759
|
if (this.history.length === 0) await this.loadHistory();
|
|
2746
2760
|
while (this.pending) {
|
|
2747
|
-
await new Promise((
|
|
2761
|
+
await new Promise((resolve3) => setTimeout(resolve3, 50));
|
|
2748
2762
|
}
|
|
2749
2763
|
this.pending = true;
|
|
2750
2764
|
try {
|
|
2751
2765
|
if (this.rl) {
|
|
2752
2766
|
const old = this.rl;
|
|
2753
2767
|
this.rl = void 0;
|
|
2754
|
-
await new Promise((
|
|
2768
|
+
await new Promise((resolve3) => {
|
|
2755
2769
|
if (old.closed) {
|
|
2756
|
-
|
|
2770
|
+
resolve3();
|
|
2757
2771
|
} else {
|
|
2758
|
-
old.once("close",
|
|
2772
|
+
old.once("close", resolve3);
|
|
2759
2773
|
old.close();
|
|
2760
2774
|
}
|
|
2761
2775
|
});
|
|
2762
2776
|
}
|
|
2763
2777
|
const fresh = this.ensure();
|
|
2764
2778
|
this.installPromptGuard(fresh);
|
|
2765
|
-
const line = await new Promise((
|
|
2779
|
+
const line = await new Promise((resolve3) => {
|
|
2766
2780
|
let settled = false;
|
|
2767
2781
|
let timeoutHandle;
|
|
2768
2782
|
const settle = (line2) => {
|
|
@@ -2770,7 +2784,7 @@ var ReadlineInputReader = class {
|
|
|
2770
2784
|
settled = true;
|
|
2771
2785
|
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
2772
2786
|
setOutputLineGuard(null);
|
|
2773
|
-
|
|
2787
|
+
resolve3(line2);
|
|
2774
2788
|
};
|
|
2775
2789
|
if (timeoutOpts) {
|
|
2776
2790
|
timeoutHandle = setTimeout(() => {
|
|
@@ -2835,7 +2849,7 @@ var ReadlineInputReader = class {
|
|
|
2835
2849
|
async readKey(prompt, options) {
|
|
2836
2850
|
setOutputLineGuard(null);
|
|
2837
2851
|
writeOut(prompt);
|
|
2838
|
-
return new Promise((
|
|
2852
|
+
return new Promise((resolve3) => {
|
|
2839
2853
|
const stdin = process.stdin;
|
|
2840
2854
|
const wasRaw = stdin.isRaw;
|
|
2841
2855
|
const wasPaused = stdin.isPaused();
|
|
@@ -2846,7 +2860,7 @@ var ReadlineInputReader = class {
|
|
|
2846
2860
|
if (key === "") {
|
|
2847
2861
|
cleanup();
|
|
2848
2862
|
writeOut("\n");
|
|
2849
|
-
|
|
2863
|
+
resolve3("");
|
|
2850
2864
|
return;
|
|
2851
2865
|
}
|
|
2852
2866
|
const opt = options.find(
|
|
@@ -2856,12 +2870,12 @@ var ReadlineInputReader = class {
|
|
|
2856
2870
|
cleanup();
|
|
2857
2871
|
writeOut(`${opt.key}
|
|
2858
2872
|
`);
|
|
2859
|
-
|
|
2873
|
+
resolve3(opt.value);
|
|
2860
2874
|
}
|
|
2861
2875
|
};
|
|
2862
2876
|
const onClose = () => {
|
|
2863
2877
|
cleanup();
|
|
2864
|
-
|
|
2878
|
+
resolve3("");
|
|
2865
2879
|
};
|
|
2866
2880
|
const cleanup = () => {
|
|
2867
2881
|
stdin.off("data", onData);
|
|
@@ -2893,7 +2907,7 @@ var ReadlineInputReader = class {
|
|
|
2893
2907
|
this.rl?.close();
|
|
2894
2908
|
this.rl = void 0;
|
|
2895
2909
|
writeOut(prompt);
|
|
2896
|
-
return new Promise((
|
|
2910
|
+
return new Promise((resolve3) => {
|
|
2897
2911
|
let buf = "";
|
|
2898
2912
|
const wasRaw = stdin.isRaw;
|
|
2899
2913
|
const cleanup = () => {
|
|
@@ -2922,13 +2936,13 @@ var ReadlineInputReader = class {
|
|
|
2922
2936
|
cleanup();
|
|
2923
2937
|
writeOut(` ${dim(`[${buf.length} chars]`)}
|
|
2924
2938
|
`);
|
|
2925
|
-
|
|
2939
|
+
resolve3(buf);
|
|
2926
2940
|
return;
|
|
2927
2941
|
}
|
|
2928
2942
|
if (ch === "") {
|
|
2929
2943
|
cleanup();
|
|
2930
2944
|
writeOut("\n");
|
|
2931
|
-
|
|
2945
|
+
resolve3("");
|
|
2932
2946
|
return;
|
|
2933
2947
|
}
|
|
2934
2948
|
if (ch === "") {
|
|
@@ -4197,7 +4211,7 @@ async function checkGitInCwd(opts) {
|
|
|
4197
4211
|
if (answer === "y" || answer === "yes") {
|
|
4198
4212
|
try {
|
|
4199
4213
|
const { spawn: spawn2 } = await import("node:child_process");
|
|
4200
|
-
await new Promise((
|
|
4214
|
+
await new Promise((resolve3, reject) => {
|
|
4201
4215
|
const child = spawn2("git", ["init"], {
|
|
4202
4216
|
cwd,
|
|
4203
4217
|
signal: AbortSignal.timeout(1e4),
|
|
@@ -4206,7 +4220,7 @@ async function checkGitInCwd(opts) {
|
|
|
4206
4220
|
child.on("error", reject);
|
|
4207
4221
|
child.on(
|
|
4208
4222
|
"close",
|
|
4209
|
-
(code) => code === 0 ?
|
|
4223
|
+
(code) => code === 0 ? resolve3() : reject(new Error(`git init failed with ${code}`))
|
|
4210
4224
|
);
|
|
4211
4225
|
});
|
|
4212
4226
|
renderer.write(` ${color13.green("\u2713")} Git repository initialized
|
|
@@ -4466,12 +4480,14 @@ async function initializeCli(argv) {
|
|
|
4466
4480
|
async function main(argv) {
|
|
4467
4481
|
const cliCtx = await initializeCli(argv);
|
|
4468
4482
|
if (typeof cliCtx === "number") return cliCtx;
|
|
4469
|
-
const { runInteractive } = await import("./cli-main-
|
|
4483
|
+
const { runInteractive } = await import("./cli-main-RFEZAJ4U.js");
|
|
4470
4484
|
return runInteractive(cliCtx);
|
|
4471
4485
|
}
|
|
4472
4486
|
|
|
4473
4487
|
// src/cli-entry-point.ts
|
|
4474
|
-
import {
|
|
4488
|
+
import { resolve as resolve2 } from "node:path";
|
|
4489
|
+
import { pathToFileURL } from "node:url";
|
|
4490
|
+
import { installCrashShield, runFatalSalvageSync, writeErr as writeErr4 } from "@wrongstack/core/utils";
|
|
4475
4491
|
var SQLITE_WARNING_RE = /sqlite is an experimental feature/i;
|
|
4476
4492
|
function installSqliteWarningFilter() {
|
|
4477
4493
|
const originalEmit = process.emitWarning.bind(process);
|
|
@@ -4485,7 +4501,15 @@ function installSqliteWarningFilter() {
|
|
|
4485
4501
|
});
|
|
4486
4502
|
}
|
|
4487
4503
|
installSqliteWarningFilter();
|
|
4488
|
-
|
|
4504
|
+
function isCliMain(moduleUrl, argvEntry = process.argv[1]) {
|
|
4505
|
+
if (!argvEntry) return false;
|
|
4506
|
+
try {
|
|
4507
|
+
if (moduleUrl === pathToFileURL(resolve2(argvEntry)).href) return true;
|
|
4508
|
+
} catch {
|
|
4509
|
+
}
|
|
4510
|
+
return argvEntry.endsWith("/cli/dist/index.js") || argvEntry.endsWith("\\cli\\dist\\index.js");
|
|
4511
|
+
}
|
|
4512
|
+
var isMain = isCliMain(import.meta.url);
|
|
4489
4513
|
function isBrokenOutputConsumer(error) {
|
|
4490
4514
|
if (typeof error !== "object" || error === null || !("code" in error)) return false;
|
|
4491
4515
|
return error.code === "EPIPE" || error.code === "ECONNRESET" || error.code === "ECONNABORTED";
|
|
@@ -4498,6 +4522,7 @@ function installBrokenPipeHandlers(options = {}) {
|
|
|
4498
4522
|
if (!isBrokenOutputConsumer(error)) throw error;
|
|
4499
4523
|
if (handled) return;
|
|
4500
4524
|
handled = true;
|
|
4525
|
+
runFatalSalvageSync();
|
|
4501
4526
|
exit(0);
|
|
4502
4527
|
};
|
|
4503
4528
|
for (const stream of streams) stream.on("error", onError);
|
|
@@ -4509,12 +4534,16 @@ function runAsMain(mainFn) {
|
|
|
4509
4534
|
if (!isMain) return;
|
|
4510
4535
|
installBrokenPipeHandlers();
|
|
4511
4536
|
installCrashShield();
|
|
4537
|
+
process.on("exit", () => {
|
|
4538
|
+
runFatalSalvageSync();
|
|
4539
|
+
});
|
|
4512
4540
|
mainFn(process.argv.slice(2)).then(
|
|
4513
4541
|
(c) => {
|
|
4514
4542
|
process.exitCode = c;
|
|
4515
4543
|
setTimeout(() => process.exit(c), 500).unref();
|
|
4516
4544
|
},
|
|
4517
4545
|
(err) => {
|
|
4546
|
+
runFatalSalvageSync();
|
|
4518
4547
|
writeErr4((err instanceof Error ? err.stack : String(err)) + "\n");
|
|
4519
4548
|
process.exitCode = 1;
|
|
4520
4549
|
setTimeout(() => process.exit(1), 500).unref();
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
serveStdio
|
|
34
34
|
} from "@wrongstack/mcp";
|
|
35
35
|
import { registerBuiltinToolTier } from "@wrongstack/tools/tool-tier";
|
|
36
|
+
import { wireKanbanPorts } from "@wrongstack/runtime";
|
|
36
37
|
var AllowAllPermissionPolicy = class extends AutoApprovePermissionPolicy {
|
|
37
38
|
async evaluate() {
|
|
38
39
|
return { permission: "auto", source: "default" };
|
|
@@ -210,6 +211,7 @@ async function serveMcpStdio(deps, positional) {
|
|
|
210
211
|
log(`wrongstack MCP server: ${err instanceof Error ? err.message : String(err)}`);
|
|
211
212
|
return 1;
|
|
212
213
|
}
|
|
214
|
+
wireKanbanPorts();
|
|
213
215
|
let registry = deps.toolRegistry;
|
|
214
216
|
if (!registry) {
|
|
215
217
|
registry = new ToolRegistry();
|
|
@@ -439,4 +441,4 @@ function isRecord(value) {
|
|
|
439
441
|
export {
|
|
440
442
|
mcpCmd
|
|
441
443
|
};
|
|
442
|
-
//# sourceMappingURL=mcp-
|
|
444
|
+
//# sourceMappingURL=mcp-RRPKNRSN.js.map
|
package/dist/mcp-serve.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Context } from '@wrongstack/core/agent';
|
|
|
2
2
|
import { ToolRegistry } from '@wrongstack/core/registry';
|
|
3
3
|
import type { PermissionPolicy, Tool } from '@wrongstack/core/types';
|
|
4
4
|
import { type MCPServerPrompt, type MCPServerResource } from '@wrongstack/mcp';
|
|
5
|
-
import type { SubcommandDeps } from './subcommands/
|
|
5
|
+
import type { SubcommandDeps } from './subcommands/contracts.js';
|
|
6
6
|
/**
|
|
7
7
|
* Resolve the `--tools` whitelist for `mcp serve`.
|
|
8
8
|
*
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
mutateConfigProviders,
|
|
9
9
|
normalizeKeys,
|
|
10
10
|
writeKeysBack
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BXFYBQKR.js";
|
|
12
12
|
import "./chunk-7OCVIDC7.js";
|
|
13
13
|
|
|
14
14
|
// src/subcommands/handlers/modeldiag.ts
|
|
@@ -19,8 +19,8 @@ import { color as color5 } from "@wrongstack/core/utils";
|
|
|
19
19
|
import { color as color3, toErrorMessage } from "@wrongstack/core/utils";
|
|
20
20
|
|
|
21
21
|
// src/subcommands/handlers/modeldiag-eval.ts
|
|
22
|
-
import { makeProviderFromConfig } from "@wrongstack/providers";
|
|
23
22
|
import { color as color2 } from "@wrongstack/core/utils";
|
|
23
|
+
import { makeProviderFromConfig } from "@wrongstack/providers";
|
|
24
24
|
|
|
25
25
|
// src/subcommands/handlers/modeldiag-profiles.ts
|
|
26
26
|
import { color } from "@wrongstack/core/utils";
|
|
@@ -443,9 +443,7 @@ ${color2.dim('Enter numbers or provider IDs (comma-separated, or "all"):')}
|
|
|
443
443
|
{
|
|
444
444
|
model: c.model,
|
|
445
445
|
system: [{ type: "text", text: "Be thorough and correct." }],
|
|
446
|
-
messages: [
|
|
447
|
-
{ role: "user", content: [{ type: "text", text: task.prompt }] }
|
|
448
|
-
],
|
|
446
|
+
messages: [{ role: "user", content: [{ type: "text", text: task.prompt }] }],
|
|
449
447
|
maxTokens: 1024
|
|
450
448
|
},
|
|
451
449
|
{ signal: AbortSignal.timeout(45e3) }
|
|
@@ -938,9 +936,7 @@ async function runModeldiagTest(args, deps, config) {
|
|
|
938
936
|
}
|
|
939
937
|
writeLine();
|
|
940
938
|
writeLine(
|
|
941
|
-
color4.dim(
|
|
942
|
-
`${targets.length} request(s) would run sequentially. Remove --plan to execute.`
|
|
943
|
-
)
|
|
939
|
+
color4.dim(`${targets.length} request(s) would run sequentially. Remove --plan to execute.`)
|
|
944
940
|
);
|
|
945
941
|
}
|
|
946
942
|
return targets.length > 0 ? 0 : 2;
|
|
@@ -948,9 +944,7 @@ async function runModeldiagTest(args, deps, config) {
|
|
|
948
944
|
if (targets.length === 0) {
|
|
949
945
|
const message = "No provider/model targets matched. Check the active profile or remove filters.";
|
|
950
946
|
if (smokeOptions.json) {
|
|
951
|
-
writeLine(
|
|
952
|
-
JSON.stringify({ results: [], summary: { passed: 0, failed: 0 }, error: message })
|
|
953
|
-
);
|
|
947
|
+
writeLine(JSON.stringify({ results: [], summary: { passed: 0, failed: 0 }, error: message }));
|
|
954
948
|
} else {
|
|
955
949
|
writeLine(color4.amber(message));
|
|
956
950
|
}
|
|
@@ -1329,4 +1323,4 @@ var modeldiagCmd = async (args, deps) => {
|
|
|
1329
1323
|
export {
|
|
1330
1324
|
modeldiagCmd
|
|
1331
1325
|
};
|
|
1332
|
-
//# sourceMappingURL=modeldiag-
|
|
1326
|
+
//# sourceMappingURL=modeldiag-H6DKWJ2N.js.map
|
|
@@ -39,8 +39,7 @@ export declare function clearStaleProviderDefaults(config: Record<string, unknow
|
|
|
39
39
|
export declare function activeLabel(cfg: ProviderConfig, keys: ProviderApiKey[]): string | undefined;
|
|
40
40
|
/** Mask an API key for display: show first 4 + last 4 chars. */
|
|
41
41
|
export declare function maskedKey(key: string): string;
|
|
42
|
-
|
|
43
|
-
export declare function nowIso(): string;
|
|
42
|
+
export { nowIso } from '@wrongstack/primitives';
|
|
44
43
|
/**
|
|
45
44
|
* Read the on-disk config file and return its `providers` map, fully
|
|
46
45
|
* decrypted. Returns `{}` on ENOENT or corrupt JSON (surfacing the error
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-YMXXOOFN.js";
|
|
7
7
|
import {
|
|
8
8
|
mutateConfigProviders
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BXFYBQKR.js";
|
|
10
10
|
import "./chunk-7OCVIDC7.js";
|
|
11
11
|
|
|
12
12
|
// src/subcommands/handlers/providers-models.ts
|
|
@@ -661,4 +661,4 @@ export {
|
|
|
661
661
|
modelsCmd,
|
|
662
662
|
providersCmd
|
|
663
663
|
};
|
|
664
|
-
//# sourceMappingURL=providers-models-
|
|
664
|
+
//# sourceMappingURL=providers-models-663NDPRQ.js.map
|