@wrongstack/cli 0.305.0 → 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-K7CYVVKH.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-C5NXM2SI.js → chunk-5JW3XCRA.js} +7 -3
- package/dist/{chunk-FJVCVZIV.js → chunk-WC3DK6BI.js} +5 -5
- package/dist/{cli-main-W3T56YCY.js → cli-main-DHNFGP3Z.js} +278 -197
- package/dist/diag-doctor-WTBHPOMB.js +329 -0
- package/dist/{execution-YMBD7YWC.js → execution-TTE7R5UY.js} +313 -53
- package/dist/execution-chimera-cascade.d.ts +7 -1
- package/dist/{hq-5G6D5YIU.js → hq-ZK6PGN3W.js} +95 -6
- package/dist/index.js +759 -546
- package/dist/{modeldiag-SIVUOX2Y.js → modeldiag-6VS5KDP5.js} +4 -4
- package/dist/subcommands/handlers/daemon-inventory.d.ts +41 -0
- package/dist/wiring/management-tools.d.ts +8 -1
- package/package.json +24 -23
- package/dist/diag-doctor-ZF5BF2MK.js +0 -169
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
discoverAndMergeProviders
|
|
3
|
+
} from "./chunk-52C7PD2H.js";
|
|
1
4
|
import {
|
|
2
5
|
mutateConfigProviders,
|
|
3
6
|
normalizeKeys,
|
|
@@ -6,9 +9,6 @@ import {
|
|
|
6
9
|
import {
|
|
7
10
|
activeProfileConfigPath
|
|
8
11
|
} from "./chunk-YMXXOOFN.js";
|
|
9
|
-
import {
|
|
10
|
-
discoverAndMergeProviders
|
|
11
|
-
} from "./chunk-52C7PD2H.js";
|
|
12
12
|
import "./chunk-7OCVIDC7.js";
|
|
13
13
|
|
|
14
14
|
// src/subcommands/handlers/modeldiag.ts
|
|
@@ -1292,4 +1292,4 @@ ${color2.dim('Enter numbers or provider IDs (comma-separated, or "all"):')}
|
|
|
1292
1292
|
export {
|
|
1293
1293
|
modeldiagCmd
|
|
1294
1294
|
};
|
|
1295
|
-
//# sourceMappingURL=modeldiag-
|
|
1295
|
+
//# sourceMappingURL=modeldiag-6VS5KDP5.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type DaemonStatus =
|
|
2
|
+
/** Answering on its endpoint. */
|
|
3
|
+
'live'
|
|
4
|
+
/**
|
|
5
|
+
* The endpoint exists on disk but nothing answers on it. This is the wedge:
|
|
6
|
+
* clients get ECONNREFUSED and conclude "spawn one", the replacement gets
|
|
7
|
+
* EADDRINUSE from the leftover file. Self-healing daemons reclaim it on
|
|
8
|
+
* their next start; seeing this means one has not been started since.
|
|
9
|
+
*/
|
|
10
|
+
| 'stale'
|
|
11
|
+
/** No endpoint and no daemon. The normal state before first use. */
|
|
12
|
+
| 'stopped';
|
|
13
|
+
export interface DaemonReport {
|
|
14
|
+
readonly name: string;
|
|
15
|
+
readonly endpoint: string;
|
|
16
|
+
readonly status: DaemonStatus;
|
|
17
|
+
/** Owning process id, when a metadata file was readable. */
|
|
18
|
+
readonly pid?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface DaemonInventoryOptions {
|
|
21
|
+
readonly projectRoot: string;
|
|
22
|
+
/**
|
|
23
|
+
* The project's slot under the global root — `~/.wrongstack/projects/<hash>`,
|
|
24
|
+
* NOT the in-repo `.wrongstack/`. Most daemons key their endpoint and
|
|
25
|
+
* metadata off this; kanban is the exception and uses the repo directory.
|
|
26
|
+
*/
|
|
27
|
+
readonly projectDir: string;
|
|
28
|
+
}
|
|
29
|
+
/** Probe every project daemon concurrently. Never spawns one. */
|
|
30
|
+
export declare function collectDaemonReports(options: DaemonInventoryOptions): Promise<readonly DaemonReport[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Delete stale endpoints so the next client spawn can bind.
|
|
33
|
+
*
|
|
34
|
+
* Only ever removes an endpoint that a fresh probe just reported as stale —
|
|
35
|
+
* unlinking a live daemon's socket would sever every connected client and
|
|
36
|
+
* elect a second writer over the same database. Restarting is therefore not
|
|
37
|
+
* an operation this offers: daemons are spawned on demand, so clearing the
|
|
38
|
+
* wedge is the whole job, and the next command that needs one starts it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function clearStaleDaemonEndpoints(options: DaemonInventoryOptions): Promise<readonly string[]>;
|
|
41
|
+
//# sourceMappingURL=daemon-inventory.d.ts.map
|
|
@@ -17,7 +17,14 @@ export interface RegisterCliManagementToolsDeps {
|
|
|
17
17
|
* starts null and is filled once wiring completes.
|
|
18
18
|
*/
|
|
19
19
|
getHookRunner?: (() => PluginManagerHookRunner | null) | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Late-bound live provider/model switch for leader_model_set. Like the hook
|
|
22
|
+
* runner, cli-main creates switchProviderAndModel AFTER the management tools
|
|
23
|
+
* register (it needs the provider runtime), so it passes a ref-backed getter
|
|
24
|
+
* that starts null and is filled once provider wiring completes.
|
|
25
|
+
*/
|
|
26
|
+
getSwitchProviderAndModel?: (() => ((providerId: string, modelId: string) => Promise<string | null>) | null) | undefined;
|
|
20
27
|
}
|
|
21
|
-
export declare function registerCliManagementTools({ toolRegistry, configStore, profileConfigPath, stdinInteractive, getHookRunner, }: RegisterCliManagementToolsDeps): void;
|
|
28
|
+
export declare function registerCliManagementTools({ toolRegistry, configStore, profileConfigPath, stdinInteractive, getHookRunner, getSwitchProviderAndModel, }: RegisterCliManagementToolsDeps): void;
|
|
22
29
|
export {};
|
|
23
30
|
//# sourceMappingURL=management-tools.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrongstack/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.306.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "WrongStack CLI — terminal AI coding agent with provider catalog from models.dev. Provides `wrongstack` and `wstack` binaries.",
|
|
6
6
|
"keywords": [
|
|
@@ -42,30 +42,31 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"ws": "^8.21.1",
|
|
45
|
-
"@wrongstack/bench": "0.
|
|
46
|
-
"@wrongstack/
|
|
47
|
-
"@wrongstack/
|
|
48
|
-
"@wrongstack/
|
|
49
|
-
"@wrongstack/
|
|
50
|
-
"@wrongstack/
|
|
51
|
-
"@wrongstack/
|
|
52
|
-
"@wrongstack/
|
|
53
|
-
"@wrongstack/
|
|
54
|
-
"@wrongstack/
|
|
55
|
-
"@wrongstack/runtime": "0.
|
|
56
|
-
"@wrongstack/
|
|
57
|
-
"@wrongstack/
|
|
58
|
-
"@wrongstack/
|
|
59
|
-
"@wrongstack/
|
|
60
|
-
"@wrongstack/
|
|
61
|
-
"@wrongstack/
|
|
62
|
-
"@wrongstack/
|
|
63
|
-
"@wrongstack/webui": "0.
|
|
64
|
-
"@wrongstack/
|
|
65
|
-
"@wrongstack/
|
|
45
|
+
"@wrongstack/bench": "0.306.0",
|
|
46
|
+
"@wrongstack/acp": "0.306.0",
|
|
47
|
+
"@wrongstack/mcp": "0.306.0",
|
|
48
|
+
"@wrongstack/core": "0.306.0",
|
|
49
|
+
"@wrongstack/plugins": "0.306.0",
|
|
50
|
+
"@wrongstack/providers": "0.306.0",
|
|
51
|
+
"@wrongstack/persistence": "0.306.0",
|
|
52
|
+
"@wrongstack/plug-lsp": "0.306.0",
|
|
53
|
+
"@wrongstack/requirement-intake": "0.306.0",
|
|
54
|
+
"@wrongstack/kanban": "0.306.0",
|
|
55
|
+
"@wrongstack/runtime": "0.306.0",
|
|
56
|
+
"@wrongstack/simpleui": "0.306.0",
|
|
57
|
+
"@wrongstack/sage": "0.306.0",
|
|
58
|
+
"@wrongstack/security-scanner": "0.306.0",
|
|
59
|
+
"@wrongstack/tools": "0.306.0",
|
|
60
|
+
"@wrongstack/sdd": "0.306.0",
|
|
61
|
+
"@wrongstack/webui": "0.306.0",
|
|
62
|
+
"@wrongstack/techstack": "0.306.0",
|
|
63
|
+
"@wrongstack/webui-server": "0.306.0",
|
|
64
|
+
"@wrongstack/telegram": "0.306.0",
|
|
65
|
+
"@wrongstack/tui": "0.306.0",
|
|
66
|
+
"@wrongstack/webui-hq": "0.306.0"
|
|
66
67
|
},
|
|
67
68
|
"optionalDependencies": {
|
|
68
|
-
"@wrongstack/desktop": "0.
|
|
69
|
+
"@wrongstack/desktop": "0.306.0"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
72
|
"@types/node": "^26.1.2",
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
API_VERSION
|
|
3
|
-
} from "./chunk-XJXDOF63.js";
|
|
4
|
-
import "./chunk-7OCVIDC7.js";
|
|
5
|
-
|
|
6
|
-
// src/subcommands/handlers/diag-doctor.ts
|
|
7
|
-
import * as fs from "node:fs/promises";
|
|
8
|
-
import * as os from "node:os";
|
|
9
|
-
import * as path from "node:path";
|
|
10
|
-
import { color, toErrorMessage } from "@wrongstack/core/utils";
|
|
11
|
-
var diagCmd = async (_args, deps) => {
|
|
12
|
-
const cfg = deps.config;
|
|
13
|
-
const age = await deps.modelsRegistry.ageSeconds();
|
|
14
|
-
const lines = [
|
|
15
|
-
color.bold("WrongStack diagnostics"),
|
|
16
|
-
` apiVersion: ${API_VERSION}`,
|
|
17
|
-
` cwd: ${deps.cwd}`,
|
|
18
|
-
` projectRoot: ${deps.projectRoot}`,
|
|
19
|
-
` projectHash: ${deps.paths.projectHash}`,
|
|
20
|
-
` projectDir: ${deps.paths.projectDir}`,
|
|
21
|
-
` globalRoot: ${deps.paths.globalRoot}`,
|
|
22
|
-
` modelsCache: ${deps.paths.modelsCache}`,
|
|
23
|
-
` cacheAge: ${isFinite(age) ? `${Math.round(age / 60)}m` : "never"}`,
|
|
24
|
-
` node: ${process.version}`,
|
|
25
|
-
` os: ${os.platform()} ${os.release()}`,
|
|
26
|
-
` provider: ${cfg.provider ?? "<unset>"}`,
|
|
27
|
-
` model: ${cfg.model ?? "<unset>"}`,
|
|
28
|
-
` tools: ${deps.toolRegistry?.list().length ?? 0}`,
|
|
29
|
-
` plugins: ${cfg.plugins?.length ?? 0}`,
|
|
30
|
-
` mcpServers: ${Object.keys(cfg.mcpServers ?? {}).length}`
|
|
31
|
-
];
|
|
32
|
-
deps.renderer.write(lines.join("\n") + "\n");
|
|
33
|
-
return 0;
|
|
34
|
-
};
|
|
35
|
-
var doctorCmd = async (_args, deps) => {
|
|
36
|
-
const checks = [];
|
|
37
|
-
const cfg = deps.config;
|
|
38
|
-
if (!cfg.provider)
|
|
39
|
-
checks.push({
|
|
40
|
-
name: "provider",
|
|
41
|
-
status: "fail",
|
|
42
|
-
detail: "no provider configured \u2014 run `wstack auth` to set up"
|
|
43
|
-
});
|
|
44
|
-
else checks.push({ name: "provider", status: "ok", detail: cfg.provider });
|
|
45
|
-
if (!cfg.model)
|
|
46
|
-
checks.push({
|
|
47
|
-
name: "model",
|
|
48
|
-
status: "fail",
|
|
49
|
-
detail: "no model configured \u2014 run `wstack auth` to configure"
|
|
50
|
-
});
|
|
51
|
-
else checks.push({ name: "model", status: "ok", detail: cfg.model });
|
|
52
|
-
if (cfg.provider) {
|
|
53
|
-
const providerCfg = cfg.providers?.[cfg.provider];
|
|
54
|
-
const hasVaultKey = typeof providerCfg?.apiKey === "string" && providerCfg.apiKey.length > 0;
|
|
55
|
-
const envHit = providerCfg?.envVars?.some((v) => process.env[v]) ?? false;
|
|
56
|
-
if (hasVaultKey || envHit)
|
|
57
|
-
checks.push({
|
|
58
|
-
name: "api key",
|
|
59
|
-
status: "ok",
|
|
60
|
-
detail: hasVaultKey ? "found in vault" : "found in env"
|
|
61
|
-
});
|
|
62
|
-
else
|
|
63
|
-
checks.push({
|
|
64
|
-
name: "api key",
|
|
65
|
-
status: "fail",
|
|
66
|
-
detail: `no key for "${cfg.provider}" in vault or env \u2014 run \`wstack auth ${cfg.provider}\``
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
try {
|
|
70
|
-
const age = await deps.modelsRegistry.ageSeconds();
|
|
71
|
-
if (!isFinite(age))
|
|
72
|
-
checks.push({
|
|
73
|
-
name: "models cache",
|
|
74
|
-
status: "warn",
|
|
75
|
-
detail: "never fetched \u2014 run `wstack models refresh`"
|
|
76
|
-
});
|
|
77
|
-
else if (age > 7 * 24 * 3600)
|
|
78
|
-
checks.push({
|
|
79
|
-
name: "models cache",
|
|
80
|
-
status: "warn",
|
|
81
|
-
detail: `${Math.round(age / 86400)} days old \u2014 run \`wstack models refresh\``
|
|
82
|
-
});
|
|
83
|
-
else
|
|
84
|
-
checks.push({ name: "models cache", status: "ok", detail: `${Math.round(age / 60)}m old` });
|
|
85
|
-
} catch (err) {
|
|
86
|
-
checks.push({
|
|
87
|
-
name: "models cache",
|
|
88
|
-
status: "warn",
|
|
89
|
-
detail: `read failed: ${toErrorMessage(err)}`
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
try {
|
|
93
|
-
await fs.access(deps.paths.secretsKey);
|
|
94
|
-
checks.push({ name: "secret vault", status: "ok", detail: deps.paths.secretsKey });
|
|
95
|
-
} catch {
|
|
96
|
-
checks.push({
|
|
97
|
-
name: "secret vault",
|
|
98
|
-
status: "warn",
|
|
99
|
-
detail: "not yet initialized (created lazily on first encrypt)"
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
try {
|
|
103
|
-
await fs.mkdir(deps.paths.projectSessions, { recursive: true });
|
|
104
|
-
const probe = path.join(deps.paths.projectSessions, `.probe-${Date.now()}`);
|
|
105
|
-
await fs.writeFile(probe, "");
|
|
106
|
-
await fs.unlink(probe);
|
|
107
|
-
checks.push({ name: "sessions writable", status: "ok", detail: deps.paths.projectSessions });
|
|
108
|
-
} catch (err) {
|
|
109
|
-
checks.push({
|
|
110
|
-
name: "sessions writable",
|
|
111
|
-
status: "fail",
|
|
112
|
-
detail: `cannot write to ${deps.paths.projectSessions}: ${toErrorMessage(err)}`
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
const mcpEntries = Object.entries(cfg.mcpServers ?? {});
|
|
116
|
-
for (const [name, srv] of mcpEntries) {
|
|
117
|
-
if (!srv.enabled) continue;
|
|
118
|
-
if ((srv.transport === "sse" || srv.transport === "streamable-http") && !srv.url)
|
|
119
|
-
checks.push({ name: `mcp:${name}`, status: "fail", detail: "transport requires url" });
|
|
120
|
-
else if (srv.transport === "stdio" && !srv.command)
|
|
121
|
-
checks.push({
|
|
122
|
-
name: `mcp:${name}`,
|
|
123
|
-
status: "fail",
|
|
124
|
-
detail: "stdio transport requires command"
|
|
125
|
-
});
|
|
126
|
-
else
|
|
127
|
-
checks.push({
|
|
128
|
-
name: `mcp:${name}`,
|
|
129
|
-
status: "ok",
|
|
130
|
-
detail: `${srv.transport} ${srv.command ?? srv.url ?? ""}`.trim()
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
const major = Number.parseInt(process.version.replace(/^v/, "").split(".")[0] ?? "0", 10);
|
|
134
|
-
if (major < 22)
|
|
135
|
-
checks.push({ name: "node", status: "fail", detail: `${process.version} (need \u226522)` });
|
|
136
|
-
else checks.push({ name: "node", status: "ok", detail: process.version });
|
|
137
|
-
deps.renderer.write(color.bold("WrongStack doctor\n\n"));
|
|
138
|
-
let failed = 0;
|
|
139
|
-
let warned = 0;
|
|
140
|
-
for (const c of checks) {
|
|
141
|
-
const icon = c.status === "ok" ? color.green("\u2713") : c.status === "warn" ? color.amber("\u25CF") : color.red("\u2717");
|
|
142
|
-
deps.renderer.write(` ${icon} ${c.name.padEnd(20)} ${color.dim(c.detail)}
|
|
143
|
-
`);
|
|
144
|
-
if (c.status === "fail") failed++;
|
|
145
|
-
if (c.status === "warn") warned++;
|
|
146
|
-
}
|
|
147
|
-
deps.renderer.write("\n");
|
|
148
|
-
if (failed > 0) {
|
|
149
|
-
deps.renderer.write(
|
|
150
|
-
color.red(`${failed} failed, ${warned} warning${warned === 1 ? "" : "s"}
|
|
151
|
-
`)
|
|
152
|
-
);
|
|
153
|
-
return 1;
|
|
154
|
-
}
|
|
155
|
-
if (warned > 0) {
|
|
156
|
-
deps.renderer.write(
|
|
157
|
-
color.amber(`All checks passed (${warned} warning${warned === 1 ? "" : "s"})
|
|
158
|
-
`)
|
|
159
|
-
);
|
|
160
|
-
return 0;
|
|
161
|
-
}
|
|
162
|
-
deps.renderer.write(color.green("All checks passed.\n"));
|
|
163
|
-
return 0;
|
|
164
|
-
};
|
|
165
|
-
export {
|
|
166
|
-
diagCmd,
|
|
167
|
-
doctorCmd
|
|
168
|
-
};
|
|
169
|
-
//# sourceMappingURL=diag-doctor-ZF5BF2MK.js.map
|