@wrongstack/cli 0.303.0 → 0.305.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/dist/{acp-AQMGKW6O.js → acp-5ZLGFHWP.js} +4 -2
  2. package/dist/{auth-K7CYVVKH.js → auth-EPERLKYI.js} +3 -3
  3. package/dist/boot/system-prompt-builder.d.ts +24 -1
  4. package/dist/boot/tui-project-switch.d.ts +1 -1
  5. package/dist/boot/tui-runtime-state.d.ts +14 -0
  6. package/dist/{chunk-C5NXM2SI.js → chunk-2H47YMCV.js} +5 -1
  7. package/dist/{chunk-FJVCVZIV.js → chunk-5KFLLTSQ.js} +2 -2
  8. package/dist/{chunk-JW75HY4F.js → chunk-FKWHSFX4.js} +33 -4
  9. package/dist/{chunk-LUAFQIXT.js → chunk-RHLQT3EV.js} +11 -1
  10. package/dist/{cli-main-37XO26GK.js → cli-main-6YE423OH.js} +479 -326
  11. package/dist/diag-doctor-WTBHPOMB.js +329 -0
  12. package/dist/execute-deps.d.ts +16 -0
  13. package/dist/{execution-MVOH6PAQ.js → execution-QYFWDD3Y.js} +70 -35
  14. package/dist/fleet/host-context.d.ts +2 -0
  15. package/dist/fleet/host-session-writer.d.ts +33 -0
  16. package/dist/fleet/host.d.ts +10 -0
  17. package/dist/{hq-CD77GVSS.js → hq-5G6D5YIU.js} +2 -2
  18. package/dist/{hq-server-DME6EWIO.js → hq-server-IVZLVCFV.js} +2 -2
  19. package/dist/index.js +17 -60
  20. package/dist/{mailbox-serve-DBOOOOWZ.js → mailbox-serve-V3QIJBDH.js} +2 -2
  21. package/dist/{mcp-AX6ZAFJR.js → mcp-MSARYOPN.js} +4 -2
  22. package/dist/replay-XU6ZD7GM.js +34 -0
  23. package/dist/slash-commands/memory-triage.d.ts +4 -17
  24. package/dist/subcommands/handlers/daemon-inventory.d.ts +41 -0
  25. package/dist/{webui-server-E3OPEKU5.js → webui-server-FTG7JAZU.js} +5 -5
  26. package/dist/wiring/domain-glossary.d.ts +58 -0
  27. package/dist/wiring/domain-terms-mirror.d.ts +52 -0
  28. package/dist/wiring/pipeline.d.ts +2 -0
  29. package/dist/wiring/replay.d.ts +11 -1
  30. package/dist/wiring/sage.d.ts +4 -16
  31. package/package.json +24 -23
  32. package/dist/diag-doctor-ZF5BF2MK.js +0 -169
@@ -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