@mozole/cli 1.3.1 → 1.3.2
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/README.md +7 -17
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +26 -43
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.js +1 -1
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +289 -271
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +10 -3
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/new.d.ts +7 -4
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +25 -23
- package/dist/commands/new.js.map +1 -1
- package/dist/config/project.d.ts +5 -4
- package/dist/config/project.d.ts.map +1 -1
- package/dist/config/project.js +28 -14
- package/dist/config/project.js.map +1 -1
- package/dist/context/cce.d.ts +0 -7
- package/dist/context/cce.d.ts.map +1 -1
- package/dist/context/cce.js +12 -43
- package/dist/context/cce.js.map +1 -1
- package/dist/governor/fingerprint.d.ts.map +1 -1
- package/dist/governor/fingerprint.js +36 -20
- package/dist/governor/fingerprint.js.map +1 -1
- package/dist/governor/hook.d.ts +1 -1
- package/dist/governor/hook.d.ts.map +1 -1
- package/dist/governor/hook.js +2 -2
- package/dist/governor/hook.js.map +1 -1
- package/dist/platform/executable.d.ts.map +1 -1
- package/dist/platform/executable.js +12 -4
- package/dist/platform/executable.js.map +1 -1
- package/dist/platform/process.d.ts.map +1 -1
- package/dist/platform/process.js +46 -66
- package/dist/platform/process.js.map +1 -1
- package/dist/qa/diff.d.ts +3 -3
- package/dist/qa/diff.d.ts.map +1 -1
- package/dist/qa/diff.js +13 -1
- package/dist/qa/diff.js.map +1 -1
- package/dist/qa/runner.d.ts +9 -9
- package/dist/qa/runner.d.ts.map +1 -1
- package/dist/qa/runner.js +45 -22
- package/dist/qa/runner.js.map +1 -1
- package/dist/qa/server.d.ts.map +1 -1
- package/dist/qa/server.js +6 -1
- package/dist/qa/server.js.map +1 -1
- package/dist/scaffold/backend.d.ts +9 -0
- package/dist/scaffold/backend.d.ts.map +1 -0
- package/dist/scaffold/backend.js +178 -0
- package/dist/scaffold/backend.js.map +1 -0
- package/dist/scaffold/templates.d.ts +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +62 -72
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/telemetry/store.js +7 -3
- package/dist/telemetry/store.js.map +1 -1
- package/dist/verify/runner.d.ts.map +1 -1
- package/dist/verify/runner.js +13 -13
- package/dist/verify/runner.js.map +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +4 -1
- package/dist/scaffold/admin.d.ts +0 -8
- package/dist/scaffold/admin.d.ts.map +0 -1
- package/dist/scaffold/admin.js +0 -45
- package/dist/scaffold/admin.js.map +0 -1
package/dist/commands/doctor.js
CHANGED
|
@@ -8,7 +8,7 @@ import { inspectAntigravityWorkspace } from "../integrations/antigravity.js";
|
|
|
8
8
|
import { resolveExecutable } from "../platform/executable.js";
|
|
9
9
|
import { run } from "../platform/process.js";
|
|
10
10
|
import { TaskProgress } from "../progress.js";
|
|
11
|
-
import {
|
|
11
|
+
import { inspectBackendScaffold } from "../scaffold/backend.js";
|
|
12
12
|
async function executable(name, args = ["--version"], required = false) {
|
|
13
13
|
const resolved = await resolveExecutable(name);
|
|
14
14
|
if (!resolved)
|
|
@@ -49,301 +49,319 @@ export async function doctorCommand(cwd, output = console, options = {}) {
|
|
|
49
49
|
output,
|
|
50
50
|
onUpdate: options.onProgress,
|
|
51
51
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
name: "Antigravity",
|
|
66
|
-
healthy: false,
|
|
67
|
-
value: "optional runtime not found",
|
|
68
|
-
required: false,
|
|
69
|
-
};
|
|
70
|
-
if (antigravityPath) {
|
|
71
|
-
const result = await run(antigravityPath, ["--version"], {
|
|
72
|
-
cwd,
|
|
73
|
-
timeoutMs: 5_000,
|
|
74
|
-
});
|
|
75
|
-
antigravity = {
|
|
52
|
+
try {
|
|
53
|
+
progress.step("Probing platform & runtime executables", "Node, npm, Git");
|
|
54
|
+
const node = await executable("node", ["--version"], true);
|
|
55
|
+
const nodeMajor = Number(node.value?.match(/\d+/)?.[0] ?? 0);
|
|
56
|
+
node.healthy = node.healthy && nodeMajor >= 22;
|
|
57
|
+
const npm = await executable("npm", ["--version"], true);
|
|
58
|
+
const git = await executable("git");
|
|
59
|
+
progress.logVerbose(`Node: ${node.value}, npm: ${npm.value}, git: ${git.value}`);
|
|
60
|
+
progress.step("Probing AI agent toolchains", "Codex, Claude Code, Antigravity");
|
|
61
|
+
const codex = await executable("codex");
|
|
62
|
+
const claude = await executable("claude");
|
|
63
|
+
const antigravityPath = await detectAntigravityRuntime();
|
|
64
|
+
let antigravity = {
|
|
76
65
|
group: "Agents",
|
|
77
66
|
name: "Antigravity",
|
|
78
|
-
healthy:
|
|
79
|
-
value:
|
|
67
|
+
healthy: false,
|
|
68
|
+
value: "optional runtime not found",
|
|
80
69
|
required: false,
|
|
81
70
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
71
|
+
if (antigravityPath) {
|
|
72
|
+
const result = await run(antigravityPath, ["--version"], {
|
|
73
|
+
cwd,
|
|
74
|
+
timeoutMs: 5_000,
|
|
75
|
+
});
|
|
76
|
+
antigravity = {
|
|
77
|
+
group: "Agents",
|
|
78
|
+
name: "Antigravity",
|
|
79
|
+
healthy: result.exitCode === 0,
|
|
80
|
+
value: (result.stdout || result.stderr).trim().split(/\r?\n/)[0],
|
|
81
|
+
required: false,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
progress.logVerbose(`Agents: Codex=${codex.healthy}, Claude=${claude.healthy}, Antigravity=${antigravity.healthy}`);
|
|
85
|
+
progress.step("Verifying headless browser environment", "Chromium");
|
|
86
|
+
progress.logVerbose("Checking Playwright Chromium executable");
|
|
87
|
+
const cceInspection = await inspectCceRuntime(resolveExecutable, cwd);
|
|
88
|
+
const cceRuntime = cceInspection.runtime;
|
|
89
|
+
const cceDiagnostic = {
|
|
90
|
+
group: "Context",
|
|
91
|
+
name: "CCE runtime",
|
|
92
|
+
healthy: cceInspection.healthy,
|
|
93
|
+
value: cceInspection.value,
|
|
94
|
+
required: false,
|
|
95
|
+
};
|
|
96
|
+
const diagnostics = [
|
|
97
|
+
{
|
|
98
|
+
group: "Platform",
|
|
99
|
+
name: "OS",
|
|
100
|
+
healthy: true,
|
|
101
|
+
value: os.platform(),
|
|
102
|
+
required: true,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
group: "Platform",
|
|
106
|
+
name: "Architecture",
|
|
107
|
+
healthy: true,
|
|
108
|
+
value: os.arch(),
|
|
109
|
+
required: true,
|
|
110
|
+
},
|
|
111
|
+
{ ...node, group: "Runtime", name: "Node" },
|
|
112
|
+
{ ...npm, group: "Runtime", name: "npm" },
|
|
113
|
+
{ ...git, group: "Runtime", name: "Git" },
|
|
114
|
+
{ ...codex, group: "Agents", name: "Codex", required: false },
|
|
115
|
+
{ ...claude, group: "Agents", name: "Claude Code", required: false },
|
|
116
|
+
antigravity,
|
|
117
|
+
];
|
|
118
|
+
try {
|
|
119
|
+
await access(chromium.executablePath());
|
|
120
|
+
diagnostics.push({
|
|
121
|
+
group: "Browser",
|
|
122
|
+
name: "Chromium",
|
|
123
|
+
healthy: true,
|
|
124
|
+
required: true,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
diagnostics.push({
|
|
129
|
+
group: "Browser",
|
|
130
|
+
name: "Chromium",
|
|
131
|
+
healthy: false,
|
|
132
|
+
required: true,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
progress.step("Inspecting project structure & dependencies", "package.json, configs");
|
|
137
|
+
const root = await findProjectRoot(cwd);
|
|
138
|
+
const mozoleConfig = await readConfig(root);
|
|
139
|
+
const antigravityWorkspace = await inspectAntigravityWorkspace(root);
|
|
140
|
+
progress.logVerbose(`Found project root: ${root}`);
|
|
141
|
+
progress.step("Testing context retrieval & workspace integration", "CCE index, MCP & retrieval probe");
|
|
142
|
+
const cceRequired = mozoleConfig.cce.enabled;
|
|
143
|
+
let indexHealthy = !mozoleConfig.cce.enabled;
|
|
144
|
+
let indexValue;
|
|
145
|
+
if (mozoleConfig.cce.enabled) {
|
|
146
|
+
if (cceDiagnostic.healthy && cceRuntime) {
|
|
147
|
+
progress.logVerbose("Checking CCE status");
|
|
148
|
+
const status = await run(cceRuntime.command, [...cceRuntime.prefix, "status"], { cwd: root, timeoutMs: 5_000 });
|
|
149
|
+
if (status.signal === "SIGTERM" || status.signal === "SIGKILL") {
|
|
155
150
|
indexHealthy = false;
|
|
156
|
-
indexValue = "
|
|
151
|
+
indexValue = "timed out";
|
|
157
152
|
}
|
|
158
153
|
else {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
154
|
+
const statusText = `${status.stdout}\n${status.stderr}`;
|
|
155
|
+
if (isBrokenUvTrampoline(statusText)) {
|
|
156
|
+
indexHealthy = false;
|
|
157
|
+
indexValue = "uv trampoline broken";
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
indexHealthy =
|
|
161
|
+
status.exitCode === 0 &&
|
|
162
|
+
!statusText.includes("Project not indexed yet") &&
|
|
163
|
+
!statusText.includes("Not indexed yet") &&
|
|
164
|
+
mozoleConfig.cce.initialized;
|
|
165
|
+
if (!indexHealthy) {
|
|
166
|
+
indexValue = "not indexed";
|
|
167
|
+
}
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
170
|
}
|
|
171
|
+
else {
|
|
172
|
+
indexHealthy = false;
|
|
173
|
+
indexValue = cceInspection.brokenTrampoline
|
|
174
|
+
? "uv trampoline broken"
|
|
175
|
+
: "cce unavailable";
|
|
176
|
+
}
|
|
169
177
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
178
|
+
let mcpHealthy = !mozoleConfig.cce.enabled;
|
|
179
|
+
let mcpValue;
|
|
180
|
+
if (mozoleConfig.cce.enabled) {
|
|
181
|
+
mcpHealthy = antigravityWorkspace.cceMcp;
|
|
182
|
+
if (!mcpHealthy)
|
|
183
|
+
mcpValue = "not configured";
|
|
175
184
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
let retrievalHealthy = !mozoleConfig.cce.enabled;
|
|
186
|
+
let retrievalValue;
|
|
187
|
+
if (mozoleConfig.cce.enabled) {
|
|
188
|
+
if (!cceDiagnostic.healthy || !cceRuntime) {
|
|
189
|
+
retrievalHealthy = false;
|
|
190
|
+
retrievalValue = cceInspection.brokenTrampoline
|
|
191
|
+
? "uv trampoline broken"
|
|
192
|
+
: "cce unavailable";
|
|
193
|
+
}
|
|
194
|
+
else if (!indexHealthy) {
|
|
195
|
+
retrievalHealthy = false;
|
|
196
|
+
retrievalValue = indexValue ?? "not indexed";
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
progress.logVerbose("Probing CCE retrieval");
|
|
200
|
+
const probe = await probeCceRetrieval(root, cceRuntime, 5_000);
|
|
201
|
+
retrievalHealthy = probe.healthy;
|
|
202
|
+
retrievalValue = probe.value;
|
|
203
|
+
}
|
|
192
204
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
205
|
+
diagnostics.push({
|
|
206
|
+
group: "Context",
|
|
207
|
+
name: "CCE runtime",
|
|
208
|
+
healthy: cceDiagnostic.healthy,
|
|
209
|
+
value: cceDiagnostic.value,
|
|
210
|
+
required: cceRequired,
|
|
211
|
+
});
|
|
212
|
+
diagnostics.push({
|
|
213
|
+
group: "Context",
|
|
214
|
+
name: "CCE index",
|
|
215
|
+
healthy: indexHealthy,
|
|
216
|
+
value: indexValue,
|
|
217
|
+
required: cceRequired,
|
|
218
|
+
});
|
|
219
|
+
diagnostics.push({
|
|
220
|
+
group: "Context",
|
|
221
|
+
name: "CCE MCP",
|
|
222
|
+
healthy: mcpHealthy,
|
|
223
|
+
value: mcpValue,
|
|
224
|
+
required: cceRequired,
|
|
225
|
+
});
|
|
226
|
+
diagnostics.push({
|
|
227
|
+
group: "Context",
|
|
228
|
+
name: "CCE retrieval",
|
|
229
|
+
healthy: retrievalHealthy,
|
|
230
|
+
value: retrievalValue,
|
|
231
|
+
required: cceRequired,
|
|
232
|
+
});
|
|
233
|
+
let pkg = {};
|
|
234
|
+
let pkgError;
|
|
235
|
+
try {
|
|
236
|
+
pkg = JSON.parse(await readFile(path.join(root, "package.json"), "utf8"));
|
|
196
237
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
238
|
+
catch (error) {
|
|
239
|
+
pkgError =
|
|
240
|
+
error instanceof SyntaxError
|
|
241
|
+
? "invalid package.json"
|
|
242
|
+
: "missing package.json";
|
|
202
243
|
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
name: "CCE retrieval",
|
|
228
|
-
healthy: retrievalHealthy,
|
|
229
|
-
value: retrievalValue,
|
|
230
|
-
required: cceRequired,
|
|
231
|
-
});
|
|
232
|
-
const pkg = JSON.parse(await readFile(path.join(root, "package.json"), "utf8"));
|
|
233
|
-
const hasReactRouter = Boolean(packageVersion(pkg, "react-router") ||
|
|
234
|
-
packageVersion(pkg, "@react-router/dev"));
|
|
235
|
-
const hasVite = Boolean(packageVersion(pkg, "vite") ||
|
|
236
|
-
packageVersion(pkg, "@vitejs/plugin-react"));
|
|
237
|
-
for (const [label, key, required, opt] of [
|
|
238
|
-
[
|
|
239
|
-
"React Router",
|
|
240
|
-
"react-router",
|
|
241
|
-
hasReactRouter || !hasVite,
|
|
242
|
-
!hasReactRouter && hasVite,
|
|
243
|
-
],
|
|
244
|
-
["React", "react", true, false],
|
|
245
|
-
["Vite", "vite", hasVite || !hasReactRouter, false],
|
|
246
|
-
["TypeScript", "typescript", true, false],
|
|
247
|
-
["Biome", "@biomejs/biome", true, false],
|
|
248
|
-
["Vitest", "vitest", true, false],
|
|
249
|
-
])
|
|
244
|
+
const hasReactRouter = Boolean(packageVersion(pkg, "react-router") ||
|
|
245
|
+
packageVersion(pkg, "@react-router/dev"));
|
|
246
|
+
const hasVite = Boolean(packageVersion(pkg, "vite") ||
|
|
247
|
+
packageVersion(pkg, "@vitejs/plugin-react"));
|
|
248
|
+
for (const [label, key, required, opt] of [
|
|
249
|
+
[
|
|
250
|
+
"React Router",
|
|
251
|
+
"react-router",
|
|
252
|
+
hasReactRouter || !hasVite,
|
|
253
|
+
!hasReactRouter && hasVite,
|
|
254
|
+
],
|
|
255
|
+
["React", "react", true, false],
|
|
256
|
+
["Vite", "vite", hasVite || !hasReactRouter, false],
|
|
257
|
+
["TypeScript", "typescript", true, false],
|
|
258
|
+
["Biome", "@biomejs/biome", true, false],
|
|
259
|
+
["Vitest", "vitest", true, false],
|
|
260
|
+
])
|
|
261
|
+
diagnostics.push({
|
|
262
|
+
group: "Project",
|
|
263
|
+
name: label,
|
|
264
|
+
healthy: Boolean(packageVersion(pkg, key)),
|
|
265
|
+
value: packageVersion(pkg, key) ?? (opt ? "optional" : undefined),
|
|
266
|
+
required,
|
|
267
|
+
});
|
|
250
268
|
diagnostics.push({
|
|
251
269
|
group: "Project",
|
|
252
|
-
name:
|
|
253
|
-
healthy:
|
|
254
|
-
value:
|
|
255
|
-
required,
|
|
270
|
+
name: "Mozole metadata",
|
|
271
|
+
healthy: !pkgError,
|
|
272
|
+
value: pkgError,
|
|
273
|
+
required: true,
|
|
256
274
|
});
|
|
257
|
-
|
|
258
|
-
group: "Project",
|
|
259
|
-
name: "Mozole metadata",
|
|
260
|
-
healthy: true,
|
|
261
|
-
required: true,
|
|
262
|
-
});
|
|
263
|
-
const admin = await inspectAdminScaffold(root, mozoleConfig);
|
|
264
|
-
diagnostics.push({
|
|
265
|
-
group: "Project",
|
|
266
|
-
name: "Admin runtime",
|
|
267
|
-
healthy: admin.healthy,
|
|
268
|
-
value: admin.detail,
|
|
269
|
-
required: admin.enabled,
|
|
270
|
-
});
|
|
271
|
-
for (const [name, healthy] of [
|
|
272
|
-
["Workspace", antigravityWorkspace.workspace],
|
|
273
|
-
["CCE MCP", antigravityWorkspace.cceMcp],
|
|
274
|
-
["Rule", antigravityWorkspace.rule],
|
|
275
|
-
["Workflows", antigravityWorkspace.workflows],
|
|
276
|
-
])
|
|
275
|
+
const backend = await inspectBackendScaffold(root, mozoleConfig);
|
|
277
276
|
diagnostics.push({
|
|
278
|
-
group: "
|
|
279
|
-
name,
|
|
280
|
-
healthy,
|
|
281
|
-
value:
|
|
282
|
-
|
|
283
|
-
: undefined,
|
|
284
|
-
required: false,
|
|
277
|
+
group: "Project",
|
|
278
|
+
name: "PHP Backend",
|
|
279
|
+
healthy: backend.healthy,
|
|
280
|
+
value: backend.detail,
|
|
281
|
+
required: backend.enabled,
|
|
285
282
|
});
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
[
|
|
302
|
-
"Claude hook",
|
|
303
|
-
[".claude", "settings.json"],
|
|
304
|
-
mozoleConfig.governor.hooks.claude,
|
|
305
|
-
],
|
|
306
|
-
]) {
|
|
307
|
-
let installed = !enabled;
|
|
308
|
-
try {
|
|
309
|
-
installed = (await readFile(path.join(root, ...relative), "utf8")).includes("mozole governor hook");
|
|
310
|
-
}
|
|
311
|
-
catch { }
|
|
283
|
+
for (const [name, healthy] of [
|
|
284
|
+
["Workspace", antigravityWorkspace.workspace],
|
|
285
|
+
["CCE MCP", antigravityWorkspace.cceMcp],
|
|
286
|
+
["Rule", antigravityWorkspace.rule],
|
|
287
|
+
["Workflows", antigravityWorkspace.workflows],
|
|
288
|
+
])
|
|
289
|
+
diagnostics.push({
|
|
290
|
+
group: "Antigravity",
|
|
291
|
+
name,
|
|
292
|
+
healthy,
|
|
293
|
+
value: !healthy && name === "Workspace"
|
|
294
|
+
? antigravityWorkspace.detail
|
|
295
|
+
: undefined,
|
|
296
|
+
required: false,
|
|
297
|
+
});
|
|
312
298
|
diagnostics.push({
|
|
313
299
|
group: "Governor",
|
|
314
|
-
name,
|
|
315
|
-
healthy:
|
|
316
|
-
|
|
300
|
+
name: "State cache",
|
|
301
|
+
healthy: mozoleConfig.governor.enabled,
|
|
302
|
+
value: mozoleConfig.governor.enabled
|
|
303
|
+
? mozoleConfig.governor.mode
|
|
304
|
+
: "disabled",
|
|
305
|
+
required: mozoleConfig.governor.enabled,
|
|
317
306
|
});
|
|
307
|
+
for (const [name, relative, enabled] of [
|
|
308
|
+
[
|
|
309
|
+
"Codex hook",
|
|
310
|
+
[".codex", "hooks.json"],
|
|
311
|
+
mozoleConfig.governor.hooks.codex,
|
|
312
|
+
],
|
|
313
|
+
[
|
|
314
|
+
"Claude hook",
|
|
315
|
+
[".claude", "settings.json"],
|
|
316
|
+
mozoleConfig.governor.hooks.claude,
|
|
317
|
+
],
|
|
318
|
+
]) {
|
|
319
|
+
let installed = !enabled;
|
|
320
|
+
try {
|
|
321
|
+
installed = (await readFile(path.join(root, ...relative), "utf8")).includes("mozole governor hook");
|
|
322
|
+
}
|
|
323
|
+
catch { }
|
|
324
|
+
diagnostics.push({
|
|
325
|
+
group: "Governor",
|
|
326
|
+
name,
|
|
327
|
+
healthy: installed,
|
|
328
|
+
required: enabled,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
318
331
|
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
332
|
+
catch {
|
|
333
|
+
diagnostics.push(cceDiagnostic);
|
|
334
|
+
diagnostics.push({
|
|
335
|
+
group: "Project",
|
|
336
|
+
name: "Mozole project",
|
|
337
|
+
healthy: false,
|
|
338
|
+
value: "not found",
|
|
339
|
+
required: false,
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
let current = "";
|
|
343
|
+
const lines = ["Mozole", ""];
|
|
344
|
+
for (const item of diagnostics) {
|
|
345
|
+
if (item.group !== current) {
|
|
346
|
+
if (current)
|
|
347
|
+
lines.push("");
|
|
348
|
+
current = item.group;
|
|
349
|
+
lines.push(current);
|
|
350
|
+
}
|
|
351
|
+
lines.push(` ${item.name.padEnd(16)} ${item.healthy ? "✓" : "✗"}${item.value ? ` ${item.value}` : ""}`);
|
|
338
352
|
}
|
|
339
|
-
|
|
353
|
+
const healthy = diagnostics
|
|
354
|
+
.filter((item) => item.required)
|
|
355
|
+
.every((item) => item.healthy);
|
|
356
|
+
lines.push("", `Status: ${healthy ? "HEALTHY" : "NEEDS ATTENTION"}`);
|
|
357
|
+
progress.done();
|
|
358
|
+
output.log(lines.join("\n"));
|
|
359
|
+
return healthy ? 0 : 1;
|
|
360
|
+
}
|
|
361
|
+
catch (error) {
|
|
362
|
+
progress.done();
|
|
363
|
+
output.error(`DOCTOR FAIL\n\n${error instanceof Error ? error.message : String(error)}`);
|
|
364
|
+
return 2;
|
|
340
365
|
}
|
|
341
|
-
const healthy = diagnostics
|
|
342
|
-
.filter((item) => item.required)
|
|
343
|
-
.every((item) => item.healthy);
|
|
344
|
-
lines.push("", `Status: ${healthy ? "HEALTHY" : "NEEDS ATTENTION"}`);
|
|
345
|
-
progress.done();
|
|
346
|
-
output.log(lines.join("\n"));
|
|
347
|
-
return healthy ? 0 : 1;
|
|
348
366
|
}
|
|
349
367
|
//# sourceMappingURL=doctor.js.map
|