@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.
Files changed (68) hide show
  1. package/README.md +7 -17
  2. package/dist/cli.d.ts.map +1 -1
  3. package/dist/cli.js +26 -43
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/adopt.js +1 -1
  6. package/dist/commands/adopt.js.map +1 -1
  7. package/dist/commands/doctor.d.ts.map +1 -1
  8. package/dist/commands/doctor.js +289 -271
  9. package/dist/commands/doctor.js.map +1 -1
  10. package/dist/commands/logs.d.ts.map +1 -1
  11. package/dist/commands/logs.js +10 -3
  12. package/dist/commands/logs.js.map +1 -1
  13. package/dist/commands/new.d.ts +7 -4
  14. package/dist/commands/new.d.ts.map +1 -1
  15. package/dist/commands/new.js +25 -23
  16. package/dist/commands/new.js.map +1 -1
  17. package/dist/config/project.d.ts +5 -4
  18. package/dist/config/project.d.ts.map +1 -1
  19. package/dist/config/project.js +28 -14
  20. package/dist/config/project.js.map +1 -1
  21. package/dist/context/cce.d.ts +0 -7
  22. package/dist/context/cce.d.ts.map +1 -1
  23. package/dist/context/cce.js +12 -43
  24. package/dist/context/cce.js.map +1 -1
  25. package/dist/governor/fingerprint.d.ts.map +1 -1
  26. package/dist/governor/fingerprint.js +36 -20
  27. package/dist/governor/fingerprint.js.map +1 -1
  28. package/dist/governor/hook.d.ts +1 -1
  29. package/dist/governor/hook.d.ts.map +1 -1
  30. package/dist/governor/hook.js +2 -2
  31. package/dist/governor/hook.js.map +1 -1
  32. package/dist/platform/executable.d.ts.map +1 -1
  33. package/dist/platform/executable.js +12 -4
  34. package/dist/platform/executable.js.map +1 -1
  35. package/dist/platform/process.d.ts.map +1 -1
  36. package/dist/platform/process.js +46 -66
  37. package/dist/platform/process.js.map +1 -1
  38. package/dist/qa/diff.d.ts +3 -3
  39. package/dist/qa/diff.d.ts.map +1 -1
  40. package/dist/qa/diff.js +13 -1
  41. package/dist/qa/diff.js.map +1 -1
  42. package/dist/qa/runner.d.ts +9 -9
  43. package/dist/qa/runner.d.ts.map +1 -1
  44. package/dist/qa/runner.js +45 -22
  45. package/dist/qa/runner.js.map +1 -1
  46. package/dist/qa/server.d.ts.map +1 -1
  47. package/dist/qa/server.js +6 -1
  48. package/dist/qa/server.js.map +1 -1
  49. package/dist/scaffold/backend.d.ts +9 -0
  50. package/dist/scaffold/backend.d.ts.map +1 -0
  51. package/dist/scaffold/backend.js +178 -0
  52. package/dist/scaffold/backend.js.map +1 -0
  53. package/dist/scaffold/templates.d.ts +1 -1
  54. package/dist/scaffold/templates.d.ts.map +1 -1
  55. package/dist/scaffold/templates.js +62 -72
  56. package/dist/scaffold/templates.js.map +1 -1
  57. package/dist/telemetry/store.js +7 -3
  58. package/dist/telemetry/store.js.map +1 -1
  59. package/dist/verify/runner.d.ts.map +1 -1
  60. package/dist/verify/runner.js +13 -13
  61. package/dist/verify/runner.js.map +1 -1
  62. package/dist/version.d.ts +2 -2
  63. package/dist/version.js +1 -1
  64. package/package.json +4 -1
  65. package/dist/scaffold/admin.d.ts +0 -8
  66. package/dist/scaffold/admin.d.ts.map +0 -1
  67. package/dist/scaffold/admin.js +0 -45
  68. package/dist/scaffold/admin.js.map +0 -1
@@ -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 { inspectAdminScaffold } from "../scaffold/admin.js";
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
- progress.step("Probing platform & runtime executables", "Node, npm, Git");
53
- const node = await executable("node", ["--version"], true);
54
- const nodeMajor = Number(node.value?.match(/\d+/)?.[0] ?? 0);
55
- node.healthy = node.healthy && nodeMajor >= 22;
56
- const npm = await executable("npm", ["--version"], true);
57
- const git = await executable("git");
58
- progress.logVerbose(`Node: ${node.value}, npm: ${npm.value}, git: ${git.value}`);
59
- progress.step("Probing AI agent toolchains", "Codex, Claude Code, Antigravity");
60
- const codex = await executable("codex");
61
- const claude = await executable("claude");
62
- const antigravityPath = await detectAntigravityRuntime();
63
- let antigravity = {
64
- group: "Agents",
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: result.exitCode === 0,
79
- value: (result.stdout || result.stderr).trim().split(/\r?\n/)[0],
67
+ healthy: false,
68
+ value: "optional runtime not found",
80
69
  required: false,
81
70
  };
82
- }
83
- progress.logVerbose(`Agents: Codex=${codex.healthy}, Claude=${claude.healthy}, Antigravity=${antigravity.healthy}`);
84
- progress.step("Verifying headless browser environment", "Chromium");
85
- progress.logVerbose("Checking Playwright Chromium executable");
86
- const cceInspection = await inspectCceRuntime(resolveExecutable, cwd);
87
- const cceRuntime = cceInspection.runtime;
88
- const cceDiagnostic = {
89
- group: "Context",
90
- name: "CCE runtime",
91
- healthy: cceInspection.healthy,
92
- value: cceInspection.value,
93
- required: false,
94
- };
95
- const diagnostics = [
96
- {
97
- group: "Platform",
98
- name: "OS",
99
- healthy: true,
100
- value: os.platform(),
101
- required: true,
102
- },
103
- {
104
- group: "Platform",
105
- name: "Architecture",
106
- healthy: true,
107
- value: os.arch(),
108
- required: true,
109
- },
110
- { ...node, group: "Runtime", name: "Node" },
111
- { ...npm, group: "Runtime", name: "npm" },
112
- { ...git, group: "Runtime", name: "Git" },
113
- { ...codex, group: "Agents", name: "Codex", required: false },
114
- { ...claude, group: "Agents", name: "Claude Code", required: false },
115
- antigravity,
116
- ];
117
- try {
118
- await access(chromium.executablePath());
119
- diagnostics.push({
120
- group: "Browser",
121
- name: "Chromium",
122
- healthy: true,
123
- required: true,
124
- });
125
- }
126
- catch {
127
- diagnostics.push({
128
- group: "Browser",
129
- name: "Chromium",
130
- healthy: false,
131
- required: true,
132
- });
133
- }
134
- try {
135
- progress.step("Inspecting project structure & dependencies", "package.json, configs");
136
- const root = await findProjectRoot(cwd);
137
- const mozoleConfig = await readConfig(root);
138
- const antigravityWorkspace = await inspectAntigravityWorkspace(root);
139
- progress.logVerbose(`Found project root: ${root}`);
140
- progress.step("Testing context retrieval & workspace integration", "CCE index, MCP & retrieval probe");
141
- const cceRequired = mozoleConfig.cce.enabled;
142
- let indexHealthy = !mozoleConfig.cce.enabled;
143
- let indexValue;
144
- if (mozoleConfig.cce.enabled) {
145
- if (cceDiagnostic.healthy && cceRuntime) {
146
- progress.logVerbose("Checking CCE status");
147
- const status = await run(cceRuntime.command, [...cceRuntime.prefix, "status"], { cwd: root, timeoutMs: 5_000 });
148
- if (status.signal === "SIGTERM" || status.signal === "SIGKILL") {
149
- indexHealthy = false;
150
- indexValue = "timed out";
151
- }
152
- else {
153
- const statusText = `${status.stdout}\n${status.stderr}`;
154
- if (isBrokenUvTrampoline(statusText)) {
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 = "uv trampoline broken";
151
+ indexValue = "timed out";
157
152
  }
158
153
  else {
159
- indexHealthy =
160
- status.exitCode === 0 &&
161
- !statusText.includes("Project not indexed yet") &&
162
- !statusText.includes("Not indexed yet") &&
163
- mozoleConfig.cce.initialized;
164
- if (!indexHealthy) {
165
- indexValue = "not indexed";
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
- else {
171
- indexHealthy = false;
172
- indexValue = cceInspection.brokenTrampoline
173
- ? "uv trampoline broken"
174
- : "cce unavailable";
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
- let mcpHealthy = !mozoleConfig.cce.enabled;
178
- let mcpValue;
179
- if (mozoleConfig.cce.enabled) {
180
- mcpHealthy = antigravityWorkspace.cceMcp;
181
- if (!mcpHealthy)
182
- mcpValue = "not configured";
183
- }
184
- let retrievalHealthy = !mozoleConfig.cce.enabled;
185
- let retrievalValue;
186
- if (mozoleConfig.cce.enabled) {
187
- if (!cceDiagnostic.healthy || !cceRuntime) {
188
- retrievalHealthy = false;
189
- retrievalValue = cceInspection.brokenTrampoline
190
- ? "uv trampoline broken"
191
- : "cce unavailable";
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
- else if (!indexHealthy) {
194
- retrievalHealthy = false;
195
- retrievalValue = indexValue ?? "not indexed";
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
- else {
198
- progress.logVerbose("Probing CCE retrieval");
199
- const probe = await probeCceRetrieval(root, cceRuntime, 5_000);
200
- retrievalHealthy = probe.healthy;
201
- retrievalValue = probe.value;
238
+ catch (error) {
239
+ pkgError =
240
+ error instanceof SyntaxError
241
+ ? "invalid package.json"
242
+ : "missing package.json";
202
243
  }
203
- }
204
- diagnostics.push({
205
- group: "Context",
206
- name: "CCE runtime",
207
- healthy: cceDiagnostic.healthy,
208
- value: cceDiagnostic.value,
209
- required: cceRequired,
210
- });
211
- diagnostics.push({
212
- group: "Context",
213
- name: "CCE index",
214
- healthy: indexHealthy,
215
- value: indexValue,
216
- required: cceRequired,
217
- });
218
- diagnostics.push({
219
- group: "Context",
220
- name: "CCE MCP",
221
- healthy: mcpHealthy,
222
- value: mcpValue,
223
- required: cceRequired,
224
- });
225
- diagnostics.push({
226
- group: "Context",
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: label,
253
- healthy: Boolean(packageVersion(pkg, key)),
254
- value: packageVersion(pkg, key) ?? (opt ? "optional" : undefined),
255
- required,
270
+ name: "Mozole metadata",
271
+ healthy: !pkgError,
272
+ value: pkgError,
273
+ required: true,
256
274
  });
257
- diagnostics.push({
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: "Antigravity",
279
- name,
280
- healthy,
281
- value: !healthy && name === "Workspace"
282
- ? antigravityWorkspace.detail
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
- diagnostics.push({
287
- group: "Governor",
288
- name: "State cache",
289
- healthy: mozoleConfig.governor.enabled,
290
- value: mozoleConfig.governor.enabled
291
- ? mozoleConfig.governor.mode
292
- : "disabled",
293
- required: mozoleConfig.governor.enabled,
294
- });
295
- for (const [name, relative, enabled] of [
296
- [
297
- "Codex hook",
298
- [".codex", "hooks.json"],
299
- mozoleConfig.governor.hooks.codex,
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: installed,
316
- required: enabled,
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
- catch {
321
- diagnostics.push(cceDiagnostic);
322
- diagnostics.push({
323
- group: "Project",
324
- name: "Mozole project",
325
- healthy: false,
326
- value: "not found",
327
- required: false,
328
- });
329
- }
330
- let current = "";
331
- const lines = ["Mozole", ""];
332
- for (const item of diagnostics) {
333
- if (item.group !== current) {
334
- if (current)
335
- lines.push("");
336
- current = item.group;
337
- lines.push(current);
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
- lines.push(` ${item.name.padEnd(16)} ${item.healthy ? "✓" : "✗"}${item.value ? ` ${item.value}` : ""}`);
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