@a-company/paradigm 3.23.2 → 3.24.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.
Files changed (30) hide show
  1. package/dist/{accept-orchestration-ORQRKKGR.js → accept-orchestration-AAYFKS74.js} +5 -5
  2. package/dist/chunk-4UC6AQOC.js +631 -0
  3. package/dist/{chunk-YOFP72IB.js → chunk-6EQRU7WC.js} +4 -4
  4. package/dist/{chunk-K34C7NAN.js → chunk-6UV47VRD.js} +1 -1
  5. package/dist/{chunk-Z42FOOVT.js → chunk-GC6X3YM7.js} +6 -6
  6. package/dist/{chunk-C3BK3E23.js → chunk-OXG5GVDJ.js} +1 -1
  7. package/dist/{chunk-XKAFTZOZ.js → chunk-VHSTF72C.js} +1 -1
  8. package/dist/{chunk-UI3XXVJ6.js → chunk-W4VFKZVF.js} +58 -1
  9. package/dist/{graph-5VSRBRKZ.js → chunk-Z7W7HNRG.js} +2 -1
  10. package/dist/context-audit-RI4R2WRH.js +549 -0
  11. package/dist/{diff-4XJZN4OB.js → diff-QC7PWIPF.js} +5 -5
  12. package/dist/{doctor-FINKMI66.js → doctor-RVODPMHJ.js} +1 -1
  13. package/dist/graph-ERNQQQ7C.js +12 -0
  14. package/dist/index.js +64 -30
  15. package/dist/mcp.js +841 -17
  16. package/dist/{orchestrate-6XGEA655.js → orchestrate-NNNWNELP.js} +8 -8
  17. package/dist/pipeline-3G2FRAKM.js +263 -0
  18. package/dist/{probe-T77FFIAG.js → probe-SN4BNXOC.js} +2 -1
  19. package/dist/{providers-VIBWDN5D.js → providers-NKGY36QF.js} +1 -1
  20. package/dist/{shift-SW3GSODO.js → shift-G42AEUHE.js} +15 -14
  21. package/dist/{spawn-JSV2HST3.js → spawn-52PASJJL.js} +3 -3
  22. package/dist/sweep-5POCF2E4.js +934 -0
  23. package/dist/{team-YIYA4ZLX.js → team-JZHIH7H5.js} +6 -6
  24. package/dist/university-content/courses/.purpose +307 -0
  25. package/dist/university-content/plsat/.purpose +131 -0
  26. package/dist/{workspace-S5Q5LVA6.js → workspace-L27RR5MF.js} +3 -2
  27. package/package.json +1 -1
  28. package/dist/chunk-ZMN3RAIT.js +0 -564
  29. package/dist/{chunk-XNUWLW73.js → chunk-7WTOOH23.js} +0 -0
  30. package/dist/{flow-UFMPVOEM.js → flow-KZKMMXJC.js} +1 -1
@@ -1,17 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  BackgroundOrchestrator
4
- } from "./chunk-Z42FOOVT.js";
4
+ } from "./chunk-GC6X3YM7.js";
5
5
  import "./chunk-6QC3YGB6.js";
6
- import "./chunk-YOFP72IB.js";
7
- import "./chunk-XNUWLW73.js";
8
- import "./chunk-PMXRGPRQ.js";
6
+ import "./chunk-6EQRU7WC.js";
9
7
  import "./chunk-PBHIFAL4.js";
8
+ import "./chunk-7WTOOH23.js";
9
+ import "./chunk-PMXRGPRQ.js";
10
+ import "./chunk-5JGJACDU.js";
10
11
  import "./chunk-6P4IFIK2.js";
11
12
  import "./chunk-MRENOFTR.js";
12
13
  import "./chunk-IRKUEJVW.js";
13
14
  import "./chunk-MW5DMGBB.js";
14
- import "./chunk-5JGJACDU.js";
15
15
  import "./chunk-ZXMDA7VB.js";
16
16
 
17
17
  // src/commands/team/accept-orchestration.ts
@@ -0,0 +1,631 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ detectIDE,
4
+ getAdapter
5
+ } from "./chunk-KB4XJWE3.js";
6
+ import {
7
+ parseParadigmConfig
8
+ } from "./chunk-YO6DVTL7.js";
9
+ import {
10
+ log
11
+ } from "./chunk-4NCFWYGG.js";
12
+
13
+ // src/commands/doctor/index.ts
14
+ import * as fs from "fs";
15
+ import * as path from "path";
16
+ import chalk from "chalk";
17
+ async function doctorCommand(options = {}) {
18
+ const cwd = options.rootDir || process.cwd();
19
+ const results = [];
20
+ const quiet = options.quiet;
21
+ const contextOnly = options.context;
22
+ if (!quiet) {
23
+ console.log(chalk.blue("\n\u{1FA7A} Paradigm Doctor\n"));
24
+ if (contextOnly) {
25
+ console.log(chalk.gray("Running context audit checks...\n"));
26
+ } else {
27
+ console.log(chalk.gray("Checking Paradigm setup...\n"));
28
+ }
29
+ }
30
+ const tracker = log.command("doctor").start("Running health checks");
31
+ if (!contextOnly) {
32
+ let findPurposeFilesRecursive2 = function(dir) {
33
+ const found = [];
34
+ try {
35
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
36
+ for (const entry of entries) {
37
+ if (entry.name === "node_modules" || entry.name === "dist" || entry.name === ".git") continue;
38
+ const fullPath = path.join(dir, entry.name);
39
+ if (entry.isDirectory()) {
40
+ found.push(...findPurposeFilesRecursive2(fullPath));
41
+ } else if (entry.name === ".purpose") {
42
+ found.push(fullPath);
43
+ }
44
+ }
45
+ } catch {
46
+ }
47
+ return found;
48
+ };
49
+ var findPurposeFilesRecursive = findPurposeFilesRecursive2;
50
+ const paradigmDir = path.join(cwd, ".paradigm");
51
+ if (fs.existsSync(paradigmDir)) {
52
+ const stat = fs.statSync(paradigmDir);
53
+ if (stat.isFile()) {
54
+ results.push({
55
+ name: ".paradigm",
56
+ status: "warn",
57
+ message: "Legacy file format (should be directory)",
58
+ fix: "paradigm upgrade --all"
59
+ });
60
+ } else {
61
+ results.push({
62
+ name: ".paradigm/",
63
+ status: "ok",
64
+ message: "Directory exists"
65
+ });
66
+ const configPath2 = path.join(paradigmDir, "config.yaml");
67
+ if (fs.existsSync(configPath2)) {
68
+ try {
69
+ const content = fs.readFileSync(configPath2, "utf8");
70
+ parseParadigmConfig(content);
71
+ results.push({
72
+ name: ".paradigm/config.yaml",
73
+ status: "ok",
74
+ message: "Valid YAML"
75
+ });
76
+ } catch (e) {
77
+ results.push({
78
+ name: ".paradigm/config.yaml",
79
+ status: "error",
80
+ message: `Invalid YAML: ${e.message}`,
81
+ fix: "Check YAML syntax"
82
+ });
83
+ }
84
+ } else {
85
+ results.push({
86
+ name: ".paradigm/config.yaml",
87
+ status: "missing",
88
+ message: "Config file not found",
89
+ fix: "paradigm init --force"
90
+ });
91
+ }
92
+ const specs = ["logger.md", "scan.md", "symbols.md"];
93
+ const specsDir = path.join(paradigmDir, "specs");
94
+ if (fs.existsSync(specsDir)) {
95
+ for (const spec of specs) {
96
+ const specPath = path.join(specsDir, spec);
97
+ if (fs.existsSync(specPath)) {
98
+ results.push({
99
+ name: `.paradigm/specs/${spec}`,
100
+ status: "ok",
101
+ message: "Present"
102
+ });
103
+ } else {
104
+ results.push({
105
+ name: `.paradigm/specs/${spec}`,
106
+ status: "missing",
107
+ message: "Spec file not found",
108
+ fix: "paradigm upgrade --all"
109
+ });
110
+ }
111
+ }
112
+ } else {
113
+ results.push({
114
+ name: ".paradigm/specs/",
115
+ status: "missing",
116
+ message: "Specs directory not found",
117
+ fix: "paradigm upgrade --all"
118
+ });
119
+ }
120
+ const docsDir = path.join(paradigmDir, "docs");
121
+ if (fs.existsSync(docsDir)) {
122
+ results.push({
123
+ name: ".paradigm/docs/",
124
+ status: "ok",
125
+ message: "Directory exists"
126
+ });
127
+ } else {
128
+ results.push({
129
+ name: ".paradigm/docs/",
130
+ status: "missing",
131
+ message: "Docs directory not found",
132
+ fix: "paradigm upgrade --all"
133
+ });
134
+ }
135
+ const promptsDir = path.join(paradigmDir, "prompts");
136
+ if (fs.existsSync(promptsDir)) {
137
+ results.push({
138
+ name: ".paradigm/prompts/",
139
+ status: "ok",
140
+ message: "Directory exists"
141
+ });
142
+ } else {
143
+ results.push({
144
+ name: ".paradigm/prompts/",
145
+ status: "missing",
146
+ message: "Prompts directory not found",
147
+ fix: "paradigm upgrade --all"
148
+ });
149
+ }
150
+ const scanIndexPath = path.join(paradigmDir, "scan-index.json");
151
+ const legacyScanIndex = path.join(cwd, ".paradigm-scan-index.json");
152
+ if (fs.existsSync(scanIndexPath)) {
153
+ const stat2 = fs.statSync(scanIndexPath);
154
+ const ageMs = Date.now() - stat2.mtime.getTime();
155
+ const ageHours = Math.floor(ageMs / (1e3 * 60 * 60));
156
+ if (ageHours > 24) {
157
+ results.push({
158
+ name: ".paradigm/scan-index.json",
159
+ status: "warn",
160
+ message: `Stale (${ageHours} hours old)`,
161
+ fix: "paradigm index"
162
+ });
163
+ } else {
164
+ results.push({
165
+ name: ".paradigm/scan-index.json",
166
+ status: "ok",
167
+ message: ageHours > 0 ? `${ageHours} hours old` : "Fresh"
168
+ });
169
+ }
170
+ } else if (fs.existsSync(legacyScanIndex)) {
171
+ results.push({
172
+ name: "scan-index",
173
+ status: "warn",
174
+ message: "Using legacy location",
175
+ fix: "paradigm index"
176
+ });
177
+ } else {
178
+ results.push({
179
+ name: ".paradigm/scan-index.json",
180
+ status: "missing",
181
+ message: "Not generated",
182
+ fix: "paradigm index"
183
+ });
184
+ }
185
+ }
186
+ } else {
187
+ results.push({
188
+ name: ".paradigm/",
189
+ status: "missing",
190
+ message: "Not initialized",
191
+ fix: "paradigm init"
192
+ });
193
+ }
194
+ const detection = detectIDE(cwd);
195
+ if (detection.detected) {
196
+ const adapter = getAdapter(detection.detected);
197
+ if (adapter) {
198
+ const idePath = path.join(cwd, adapter.outputPath);
199
+ if (fs.existsSync(idePath)) {
200
+ results.push({
201
+ name: adapter.outputPath,
202
+ status: "ok",
203
+ message: `Present (${detection.detected})`
204
+ });
205
+ } else {
206
+ results.push({
207
+ name: adapter.outputPath,
208
+ status: "missing",
209
+ message: `Not generated for ${detection.detected}`,
210
+ fix: "paradigm sync"
211
+ });
212
+ }
213
+ }
214
+ }
215
+ const premisePath = path.join(cwd, ".premise");
216
+ if (fs.existsSync(premisePath)) {
217
+ results.push({
218
+ name: ".premise",
219
+ status: "ok",
220
+ message: "Present"
221
+ });
222
+ } else {
223
+ results.push({
224
+ name: ".premise",
225
+ status: "missing",
226
+ message: "Not found (optional)"
227
+ });
228
+ }
229
+ const purposePath = path.join(cwd, ".purpose");
230
+ if (fs.existsSync(purposePath)) {
231
+ results.push({
232
+ name: ".purpose",
233
+ status: "ok",
234
+ message: "Present"
235
+ });
236
+ } else {
237
+ results.push({
238
+ name: ".purpose",
239
+ status: "warn",
240
+ message: "Root .purpose not found",
241
+ fix: "paradigm init"
242
+ });
243
+ }
244
+ const configPath = path.join(cwd, ".paradigm", "config.yaml");
245
+ if (fs.existsSync(configPath)) {
246
+ try {
247
+ const configContent = fs.readFileSync(configPath, "utf8");
248
+ const { parse } = await import("./dist-PSF5CP4I.js");
249
+ const config = parse(configContent);
250
+ const purposeRequired = config?.["purpose-required"];
251
+ if (purposeRequired && Array.isArray(purposeRequired)) {
252
+ const missingDirs = [];
253
+ for (const entry of purposeRequired) {
254
+ if (!entry.pattern) continue;
255
+ const { glob } = await import("glob");
256
+ const matches = await glob(entry.pattern, { cwd, nodir: false });
257
+ for (const match of matches) {
258
+ const fullPath = path.join(cwd, match);
259
+ try {
260
+ const stat = fs.statSync(fullPath);
261
+ if (stat.isDirectory() && !fs.existsSync(path.join(fullPath, ".purpose"))) {
262
+ missingDirs.push(match);
263
+ }
264
+ } catch {
265
+ }
266
+ }
267
+ }
268
+ if (missingDirs.length > 0) {
269
+ results.push({
270
+ name: "Purpose-required",
271
+ status: "warn",
272
+ message: `${missingDirs.length} director${missingDirs.length === 1 ? "y" : "ies"} missing .purpose: ${missingDirs.join(", ")}`,
273
+ fix: "Create .purpose files with paradigm_purpose_init + paradigm_purpose_add_component"
274
+ });
275
+ } else {
276
+ results.push({
277
+ name: "Purpose-required",
278
+ status: "ok",
279
+ message: "All required directories have .purpose files"
280
+ });
281
+ }
282
+ }
283
+ } catch {
284
+ }
285
+ }
286
+ const clarificationMarkerRegex = /\[NEEDS CLARIFICATION:\s*[^\]]+\]/gi;
287
+ let clarificationCount = 0;
288
+ const purposeFiles = findPurposeFilesRecursive2(cwd);
289
+ for (const pf of purposeFiles) {
290
+ try {
291
+ const content = fs.readFileSync(pf, "utf8");
292
+ const matches = content.match(clarificationMarkerRegex);
293
+ if (matches) {
294
+ clarificationCount += matches.length;
295
+ }
296
+ } catch {
297
+ }
298
+ }
299
+ if (clarificationCount > 0) {
300
+ results.push({
301
+ name: "Clarification markers",
302
+ status: "warn",
303
+ message: `${clarificationCount} [NEEDS CLARIFICATION] marker${clarificationCount > 1 ? "s" : ""} found in .purpose files`,
304
+ fix: "Resolve open clarification markers before shipping"
305
+ });
306
+ } else if (purposeFiles.length > 0) {
307
+ results.push({
308
+ name: "Clarification markers",
309
+ status: "ok",
310
+ message: "No unresolved markers"
311
+ });
312
+ }
313
+ const portalPath = path.join(cwd, "portal.yaml");
314
+ if (fs.existsSync(portalPath)) {
315
+ try {
316
+ const portalContent = fs.readFileSync(portalPath, "utf8");
317
+ const { parse } = await import("./dist-PSF5CP4I.js");
318
+ const portal = parse(portalContent);
319
+ if (portal?.version && portal?.gates) {
320
+ const gateCount = Object.keys(portal.gates || {}).length;
321
+ const routeCount = Object.keys(portal.routes || {}).length;
322
+ results.push({
323
+ name: "portal.yaml",
324
+ status: "ok",
325
+ message: `Valid (${gateCount} gates, ${routeCount} routes)`
326
+ });
327
+ } else {
328
+ results.push({
329
+ name: "portal.yaml",
330
+ status: "warn",
331
+ message: "Missing version or gates section",
332
+ fix: 'Add version: "1.0" and gates: {} to portal.yaml'
333
+ });
334
+ }
335
+ } catch (e) {
336
+ results.push({
337
+ name: "portal.yaml",
338
+ status: "error",
339
+ message: `Invalid YAML: ${e.message}`,
340
+ fix: "Check YAML syntax in portal.yaml"
341
+ });
342
+ }
343
+ }
344
+ if (fs.existsSync(portalPath)) {
345
+ try {
346
+ const { checkPortalCompliance, getComplianceSummary } = await import("./portal-compliance-VU4NIFEN.js");
347
+ const complianceReport = await checkPortalCompliance(cwd);
348
+ const summary = getComplianceSummary(complianceReport);
349
+ results.push({
350
+ name: "Portal compliance",
351
+ status: summary.status,
352
+ message: summary.message,
353
+ fix: summary.status !== "ok" ? "paradigm portal check" : void 0
354
+ });
355
+ } catch {
356
+ }
357
+ }
358
+ const flowsPath = path.join(cwd, ".paradigm", "flows.yaml");
359
+ if (fs.existsSync(flowsPath)) {
360
+ try {
361
+ const flowsContent = fs.readFileSync(flowsPath, "utf8");
362
+ const { parse } = await import("./dist-PSF5CP4I.js");
363
+ const flows = parse(flowsContent);
364
+ if (flows?.version && flows?.flows) {
365
+ const flowCount = Object.keys(flows.flows || {}).length;
366
+ const emptyFlows = Object.entries(flows.flows || {}).filter(
367
+ ([, f]) => !f?.steps || (f.steps?.length ?? 0) === 0
368
+ );
369
+ if (emptyFlows.length > 0) {
370
+ results.push({
371
+ name: ".paradigm/flows.yaml",
372
+ status: "warn",
373
+ message: `${flowCount} flows defined, ${emptyFlows.length} have no steps`,
374
+ fix: "Add steps to empty flow definitions"
375
+ });
376
+ } else {
377
+ results.push({
378
+ name: ".paradigm/flows.yaml",
379
+ status: "ok",
380
+ message: `Valid (${flowCount} flows)`
381
+ });
382
+ }
383
+ } else {
384
+ results.push({
385
+ name: ".paradigm/flows.yaml",
386
+ status: "warn",
387
+ message: "Missing version or flows section",
388
+ fix: 'Ensure flows.yaml has version: "1.0" and flows: {}'
389
+ });
390
+ }
391
+ } catch (e) {
392
+ results.push({
393
+ name: ".paradigm/flows.yaml",
394
+ status: "error",
395
+ message: `Invalid YAML: ${e.message}`,
396
+ fix: "Check YAML syntax in flows.yaml"
397
+ });
398
+ }
399
+ }
400
+ const loreDir = path.join(cwd, ".paradigm", "lore");
401
+ if (fs.existsSync(loreDir)) {
402
+ try {
403
+ const loreFiles = fs.readdirSync(loreDir).filter((f) => f.endsWith(".yaml"));
404
+ if (loreFiles.length === 0) {
405
+ results.push({
406
+ name: "Lore entries",
407
+ status: "warn",
408
+ message: "Lore directory exists but no entries found",
409
+ fix: "Record a lore entry: paradigm lore record"
410
+ });
411
+ } else {
412
+ results.push({
413
+ name: "Lore entries",
414
+ status: "ok",
415
+ message: `${loreFiles.length} lore file${loreFiles.length > 1 ? "s" : ""}`
416
+ });
417
+ }
418
+ } catch {
419
+ results.push({
420
+ name: "Lore entries",
421
+ status: "warn",
422
+ message: "Could not read lore directory"
423
+ });
424
+ }
425
+ }
426
+ const hooksJsonPath = path.join(cwd, ".claude", "hooks.json");
427
+ const pluginHooksPath = path.join(cwd, "plugins", "paradigm", "hooks.json");
428
+ if (fs.existsSync(hooksJsonPath)) {
429
+ const stat = fs.statSync(hooksJsonPath);
430
+ const ageMs = Date.now() - stat.mtime.getTime();
431
+ const ageDays = Math.floor(ageMs / (1e3 * 60 * 60 * 24));
432
+ if (ageDays > 30) {
433
+ results.push({
434
+ name: "Claude Code hooks",
435
+ status: "warn",
436
+ message: `Hooks are ${ageDays} days old \u2014 may be outdated`,
437
+ fix: "paradigm hooks install"
438
+ });
439
+ } else {
440
+ results.push({
441
+ name: "Claude Code hooks",
442
+ status: "ok",
443
+ message: ageDays > 0 ? `${ageDays} days old` : "Fresh"
444
+ });
445
+ }
446
+ } else if (fs.existsSync(pluginHooksPath)) {
447
+ results.push({
448
+ name: "Claude Code hooks",
449
+ status: "ok",
450
+ message: "Using plugin hooks"
451
+ });
452
+ } else {
453
+ results.push({
454
+ name: "Claude Code hooks",
455
+ status: "missing",
456
+ message: "No hooks installed",
457
+ fix: "paradigm hooks install"
458
+ });
459
+ }
460
+ const habitsPath = path.join(cwd, ".paradigm", "habits.yaml");
461
+ if (fs.existsSync(habitsPath)) {
462
+ try {
463
+ const habitsContent = fs.readFileSync(habitsPath, "utf8");
464
+ const { parse } = await import("./dist-PSF5CP4I.js");
465
+ const habits = parse(habitsContent);
466
+ if (habits?.version && Array.isArray(habits?.habits)) {
467
+ const enabled = habits.habits.filter((h) => h.enabled !== false).length;
468
+ results.push({
469
+ name: "Habits config",
470
+ status: "ok",
471
+ message: `Valid (${enabled}/${habits.habits.length} enabled)`
472
+ });
473
+ } else {
474
+ results.push({
475
+ name: "Habits config",
476
+ status: "warn",
477
+ message: "Missing version or habits array",
478
+ fix: "Regenerate habits.yaml with paradigm habits init"
479
+ });
480
+ }
481
+ } catch (e) {
482
+ results.push({
483
+ name: "Habits config",
484
+ status: "error",
485
+ message: `Invalid YAML: ${e.message}`,
486
+ fix: "Check YAML syntax in habits.yaml"
487
+ });
488
+ }
489
+ }
490
+ const agentsMdPath = path.join(cwd, "AGENTS.md");
491
+ if (fs.existsSync(agentsMdPath)) {
492
+ const stat = fs.statSync(agentsMdPath);
493
+ const ageMs = Date.now() - stat.mtime.getTime();
494
+ const ageDays = Math.floor(ageMs / (1e3 * 60 * 60 * 24));
495
+ if (ageDays > 60) {
496
+ results.push({
497
+ name: "AGENTS.md",
498
+ status: "warn",
499
+ message: `${ageDays} days since last update \u2014 may be stale`,
500
+ fix: "paradigm sync"
501
+ });
502
+ } else {
503
+ results.push({
504
+ name: "AGENTS.md",
505
+ status: "ok",
506
+ message: ageDays > 0 ? `Updated ${ageDays} days ago` : "Fresh"
507
+ });
508
+ }
509
+ }
510
+ }
511
+ let errorCount = 0;
512
+ let warnCount = 0;
513
+ let missingCount = 0;
514
+ for (const result of results) {
515
+ let icon;
516
+ let color;
517
+ switch (result.status) {
518
+ case "ok":
519
+ icon = "\u2713";
520
+ color = chalk.green;
521
+ break;
522
+ case "warn":
523
+ icon = "\u26A0";
524
+ color = chalk.yellow;
525
+ warnCount++;
526
+ break;
527
+ case "error":
528
+ icon = "\u2717";
529
+ color = chalk.red;
530
+ errorCount++;
531
+ break;
532
+ case "missing":
533
+ icon = "\u25CB";
534
+ color = chalk.gray;
535
+ missingCount++;
536
+ break;
537
+ }
538
+ if (!quiet) {
539
+ const namePadded = result.name.padEnd(30);
540
+ console.log(` ${color(icon)} ${namePadded} ${color(result.message)}`);
541
+ if (result.fix) {
542
+ console.log(chalk.gray(` \u2514\u2500 Fix: ${result.fix}`));
543
+ }
544
+ }
545
+ }
546
+ const { runContextAudit } = await import("./context-audit-RI4R2WRH.js");
547
+ const contextResults = await runContextAudit(cwd, { quiet });
548
+ let contextErrorCount = 0;
549
+ let contextWarnCount = 0;
550
+ let contextAdvisoryCount = 0;
551
+ if (!quiet && contextResults.length > 0) {
552
+ console.log("");
553
+ console.log(chalk.blue(" Context Audit"));
554
+ console.log(chalk.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
555
+ }
556
+ for (const result of contextResults) {
557
+ let icon;
558
+ let color;
559
+ switch (result.status) {
560
+ case "ok":
561
+ icon = "\u2713";
562
+ color = chalk.green;
563
+ break;
564
+ case "warn":
565
+ icon = "\u26A0";
566
+ color = chalk.yellow;
567
+ contextWarnCount++;
568
+ break;
569
+ case "error":
570
+ icon = "\u2717";
571
+ color = chalk.red;
572
+ contextErrorCount++;
573
+ break;
574
+ case "advisory":
575
+ icon = "\u2139";
576
+ color = chalk.cyan;
577
+ contextAdvisoryCount++;
578
+ break;
579
+ }
580
+ if (!quiet) {
581
+ const namePadded = result.check.padEnd(30);
582
+ console.log(` ${color(icon)} ${namePadded} ${color(result.message)}`);
583
+ if (result.details && result.details.length > 0) {
584
+ const shown = result.details.slice(0, 5);
585
+ for (const detail of shown) {
586
+ console.log(chalk.gray(` \u2502 ${detail}`));
587
+ }
588
+ if (result.details.length > 5) {
589
+ console.log(chalk.gray(` \u2502 ... and ${result.details.length - 5} more`));
590
+ }
591
+ }
592
+ if (result.fix) {
593
+ console.log(chalk.gray(` \u2514\u2500 Fix: ${result.fix}`));
594
+ }
595
+ }
596
+ }
597
+ const totalErrors = errorCount + contextErrorCount;
598
+ const totalWarns = warnCount + contextWarnCount;
599
+ const issueCount = totalErrors + totalWarns + missingCount;
600
+ const healthy = issueCount === 0;
601
+ if (!quiet) {
602
+ console.log("");
603
+ if (healthy) {
604
+ console.log(chalk.green("\u2728 All checks passed!\n"));
605
+ } else {
606
+ const parts = [];
607
+ if (totalErrors > 0) parts.push(chalk.red(`${totalErrors} error${totalErrors > 1 ? "s" : ""}`));
608
+ if (totalWarns > 0) parts.push(chalk.yellow(`${totalWarns} warning${totalWarns > 1 ? "s" : ""}`));
609
+ if (missingCount > 0) parts.push(chalk.gray(`${missingCount} missing`));
610
+ if (contextAdvisoryCount > 0) parts.push(chalk.cyan(`${contextAdvisoryCount} advisor${contextAdvisoryCount > 1 ? "ies" : "y"}`));
611
+ console.log(`${parts.join(", ")} found.
612
+ `);
613
+ console.log(chalk.gray("Run the suggested commands to fix issues.\n"));
614
+ }
615
+ }
616
+ if (healthy) {
617
+ tracker.success("All health checks passed", { total: results.length + contextResults.length });
618
+ } else {
619
+ tracker.error("Health checks found issues", {
620
+ errors: totalErrors,
621
+ warnings: totalWarns,
622
+ missing: missingCount,
623
+ advisories: contextAdvisoryCount
624
+ });
625
+ }
626
+ return healthy;
627
+ }
628
+
629
+ export {
630
+ doctorCommand
631
+ };
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ AuditLogger
4
+ } from "./chunk-PBHIFAL4.js";
2
5
  import {
3
6
  getProvider,
4
7
  initializeProviders
5
- } from "./chunk-XNUWLW73.js";
8
+ } from "./chunk-7WTOOH23.js";
6
9
  import {
7
10
  loadAgentsManifest
8
11
  } from "./chunk-PMXRGPRQ.js";
9
- import {
10
- AuditLogger
11
- } from "./chunk-PBHIFAL4.js";
12
12
  import {
13
13
  calculateCost,
14
14
  formatCost,
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-CHSHON3O.js";
6
6
  import {
7
7
  indexCommand
8
- } from "./chunk-UI3XXVJ6.js";
8
+ } from "./chunk-W4VFKZVF.js";
9
9
  import {
10
10
  getDefaultPremiseContent
11
11
  } from "./chunk-6P4IFIK2.js";