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