@dadado/agent-kit-cli 6.22.0 → 6.22.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.
@@ -171,7 +171,7 @@ function redactTerminalOutput(text) {
171
171
 
172
172
  const SNAPSHOT = {
173
173
  _schema: {
174
- version: "1.12.0",
174
+ version: "1.13.0",
175
175
  description: "Mission Control dashboard data model",
176
176
  fields: {
177
177
  generatedAt: "ISO-8601 timestamp of snapshot generation",
@@ -204,12 +204,13 @@ const SNAPSHOT = {
204
204
  processes:
205
205
  "Running process snapshots (node, serve.mjs, git operations) with elapsed time and a generated narration per process",
206
206
  skills: "Available skills discovered in .cursor/skills/",
207
- health: "Aggregated health status with per-check results",
207
+ health:
208
+ "Aggregated health: status ok|warning|degraded|not-initialized (error only on the serve empty-checks path) and the fixed seven checks[] ({id, label, ok, severity: ok|warning|degraded|not-initialized, detail}); ok means severity === ok; not-initialized marks a fresh workspace (no plans, no HANDOFF, no memory entries); Commands, Config and Agents also read a Mission Kit Cursor or Claude Code plugin install (1.13.0)",
208
209
  missionControl: "Normalized now/activity/attention/plans view model (source-backed; bounded)",
209
210
  },
210
211
  },
211
212
  generatedAt: new Date().toISOString(),
212
- dashboardDataVersion: "1.12.0",
213
+ dashboardDataVersion: "1.13.0",
213
214
  plans: [],
214
215
  system: {
215
216
  repoRoot: ROOT,
@@ -1326,29 +1327,331 @@ try {
1326
1327
  SNAPSHOT.system.detachedAuditSessions = null;
1327
1328
  }
1328
1329
 
1329
- // 10. Health checks (originally)
1330
+ // 10. Health checks (ADR 2026-07-29 mc-health-healthcenter, Amend 2026-11-19 first run).
1331
+ // Each check carries `severity` (ok | warning | degraded | not-initialized) and a
1332
+ // one-line `detail`; the boolean `ok` stays and means severity === "ok".
1333
+ const HEALTH_HOME = process.env.HOME || "";
1334
+ const HEALTH_BROADCAST = resolveBroadcastAuth(process.env).broadcast !== false;
1335
+ const HEALTH_MAX_ENTRIES = 64; // directory entries read per plugin root level
1336
+ const HEALTH_MAX_FILES = 500; // command / agent files listed per source
1337
+
1338
+ /** Home-relative path for a check detail (`~/...`). */
1339
+ function healthHomeRel(p) {
1340
+ if (HEALTH_HOME && (p === HEALTH_HOME || p.startsWith(`${HEALTH_HOME}/`))) {
1341
+ return `~${p.slice(HEALTH_HOME.length)}`;
1342
+ }
1343
+ return p;
1344
+ }
1345
+
1346
+ /** Bounded, fail-open directory listing (names only). */
1347
+ function healthReaddir(dir, cap = HEALTH_MAX_ENTRIES) {
1348
+ try {
1349
+ return readdirSync(dir).slice(0, cap);
1350
+ } catch {
1351
+ return [];
1352
+ }
1353
+ }
1354
+
1355
+ /** `*.md` files of one directory (bounded, fail-open). */
1356
+ function healthMdFiles(dir) {
1357
+ return healthReaddir(dir, HEALTH_MAX_FILES).filter((f) => f.endsWith(".md"));
1358
+ }
1359
+
1360
+ function healthReadJson(path) {
1361
+ try {
1362
+ return JSON.parse(readFileSync(path, "utf-8"));
1363
+ } catch {
1364
+ return null;
1365
+ }
1366
+ }
1367
+
1368
+ /** Manifest component path(s) resolved under the plugin root, else `<root>/<fallback>`. */
1369
+ function healthPluginPaths(root, manifest, key, fallback) {
1370
+ const raw = manifest ? manifest[key] : undefined;
1371
+ const list = (Array.isArray(raw) ? raw : [raw]).filter(
1372
+ (v) => typeof v === "string" && v.trim() !== "",
1373
+ );
1374
+ const paths = (list.length ? list : [fallback])
1375
+ .map((v) => resolve(root, v))
1376
+ .filter((p) => p === root || p.startsWith(`${root}/`));
1377
+ return paths.length ? paths : [join(root, fallback)];
1378
+ }
1379
+
1380
+ /** One Mission Kit plugin install, or null when `root` is not one. */
1381
+ function healthKitPlugin(kind, root, manifestRel) {
1382
+ const manifest = healthReadJson(join(root, manifestRel));
1383
+ if (manifest?.name !== "agent-kit") return null;
1384
+ return {
1385
+ kind,
1386
+ root,
1387
+ version: typeof manifest.version === "string" ? manifest.version : "",
1388
+ commandDirs: healthPluginPaths(root, manifest, "commands", "commands"),
1389
+ agentDirs: healthPluginPaths(root, manifest, "agents", "agents"),
1390
+ };
1391
+ }
1392
+
1393
+ /**
1394
+ * Mission Kit plugins installed for this user: Cursor local plugins, Cursor's
1395
+ * plugin cache (a revision with `.cache-complete`, newest wins) and Claude Code's
1396
+ * installed_plugins.json entries (read at their installPath). Read-only, one
1397
+ * directory level per root, fail-open.
1398
+ */
1399
+ function findKitPlugins() {
1400
+ const found = [];
1401
+ if (!HEALTH_HOME) return found;
1402
+ const cursorPlugins = join(HEALTH_HOME, ".cursor", "plugins");
1403
+ const cursorLocal = join(cursorPlugins, "local");
1404
+ for (const dir of healthReaddir(cursorLocal)) {
1405
+ const plugin = healthKitPlugin("cursor", join(cursorLocal, dir), ".cursor-plugin/plugin.json");
1406
+ if (plugin) found.push(plugin);
1407
+ }
1408
+ const cursorCache = join(cursorPlugins, "cache");
1409
+ for (const marketplace of healthReaddir(cursorCache)) {
1410
+ for (const dir of healthReaddir(join(cursorCache, marketplace))) {
1411
+ const base = join(cursorCache, marketplace, dir);
1412
+ let newest = null;
1413
+ for (const revision of healthReaddir(base)) {
1414
+ let mtimeMs = 0;
1415
+ try {
1416
+ mtimeMs = statSync(join(base, revision, ".cache-complete")).mtimeMs;
1417
+ } catch {
1418
+ continue;
1419
+ }
1420
+ if (!newest || mtimeMs > newest.mtimeMs) newest = { revision, mtimeMs };
1421
+ }
1422
+ if (!newest) continue;
1423
+ const plugin = healthKitPlugin(
1424
+ "cursor",
1425
+ join(base, newest.revision),
1426
+ ".cursor-plugin/plugin.json",
1427
+ );
1428
+ if (plugin) found.push(plugin);
1429
+ }
1430
+ }
1431
+ const installed = healthReadJson(
1432
+ join(HEALTH_HOME, ".claude", "plugins", "installed_plugins.json"),
1433
+ );
1434
+ const entries = installed && typeof installed.plugins === "object" ? installed.plugins : null;
1435
+ if (entries) {
1436
+ for (const [key, value] of Object.entries(entries).slice(0, HEALTH_MAX_ENTRIES)) {
1437
+ if (!key.startsWith("agent-kit@")) continue;
1438
+ for (const entry of (Array.isArray(value) ? value : [value]).slice(0, 8)) {
1439
+ const installPath = entry && typeof entry.installPath === "string" ? entry.installPath : "";
1440
+ if (!installPath) continue;
1441
+ const plugin = healthKitPlugin("claude", installPath, ".claude-plugin/plugin.json");
1442
+ if (plugin) {
1443
+ found.push(plugin);
1444
+ break;
1445
+ }
1446
+ }
1447
+ }
1448
+ }
1449
+ return found;
1450
+ }
1451
+
1452
+ function healthPluginName(plugin) {
1453
+ const host = plugin.kind === "claude" ? "Claude Code" : "Cursor";
1454
+ return `the ${host} plugin agent-kit${plugin.version ? ` ${plugin.version}` : ""}`;
1455
+ }
1456
+
1457
+ function healthPluginSource(plugin) {
1458
+ return HEALTH_BROADCAST
1459
+ ? healthPluginName(plugin)
1460
+ : `${healthPluginName(plugin)} (${healthHomeRel(plugin.root)})`;
1461
+ }
1462
+
1463
+ function healthCheck(id, label, severity, detail) {
1464
+ return { id, label, ok: severity === "ok", severity, detail };
1465
+ }
1466
+
1467
+ const kitPlugins = findKitPlugins();
1468
+
1469
+ // Fresh workspace: no plan files, no HANDOFF, zero memory entries (index files excluded).
1470
+ const healthPlanFiles = healthReaddir(plansDir, HEALTH_MAX_FILES).filter((f) =>
1471
+ f.endsWith(".plan.md"),
1472
+ ).length;
1473
+ const healthMemoryEntries = [memoryErrorsDir, memoryDecisionsDir].reduce(
1474
+ (n, dir) => n + healthMdFiles(dir).filter((f) => !f.startsWith("_")).length,
1475
+ 0,
1476
+ );
1477
+ const healthHandoffExists = existsSync(handoffPath);
1478
+ const workspaceFresh = healthPlanFiles === 0 && !healthHandoffExists && healthMemoryEntries === 0;
1479
+ const NOT_STARTED = "Nothing yet: this workspace has not started a plan.";
1480
+
1481
+ // Plans / HANDOFF / Memory: not-initialized on a fresh workspace, else on their own.
1482
+ const plansCheck = workspaceFresh
1483
+ ? healthCheck("plans", "Plans directory", "not-initialized", NOT_STARTED)
1484
+ : SNAPSHOT.plans.length > 0
1485
+ ? healthCheck(
1486
+ "plans",
1487
+ "Plans directory",
1488
+ "ok",
1489
+ `${SNAPSHOT.plans.length} plan${SNAPSHOT.plans.length === 1 ? "" : "s"} under .cursor/plans/`,
1490
+ )
1491
+ : healthCheck("plans", "Plans directory", "warning", "No plan files under .cursor/plans/");
1492
+ const handoffCheck = workspaceFresh
1493
+ ? healthCheck("handoff", "HANDOFF.md", "not-initialized", NOT_STARTED)
1494
+ : SNAPSHOT.system.handoff
1495
+ ? healthCheck("handoff", "HANDOFF.md", "ok", ".cursor/HANDOFF.md is present and parseable")
1496
+ : healthCheck(
1497
+ "handoff",
1498
+ "HANDOFF.md",
1499
+ "warning",
1500
+ healthHandoffExists ? ".cursor/HANDOFF.md does not parse" : "No .cursor/HANDOFF.md",
1501
+ );
1502
+ const memoryCount = (SNAPSHOT.memory.errors || 0) + (SNAPSHOT.memory.decisions || 0);
1503
+ const memoryCheck = workspaceFresh
1504
+ ? healthCheck("memory", "Memory (errors + decisions)", "not-initialized", NOT_STARTED)
1505
+ : healthMemoryEntries > 0
1506
+ ? healthCheck(
1507
+ "memory",
1508
+ "Memory (errors + decisions)",
1509
+ "ok",
1510
+ `${SNAPSHOT.memory.errors || 0} errors, ${SNAPSHOT.memory.decisions || 0} decisions`,
1511
+ )
1512
+ : healthCheck(
1513
+ "memory",
1514
+ "Memory (errors + decisions)",
1515
+ "warning",
1516
+ memoryCount > 0
1517
+ ? "Only index files under .cursor/memory/"
1518
+ : "No errors or decisions under .cursor/memory/",
1519
+ );
1520
+
1521
+ // Commands: workspace .cursor/commands, workspace .claude/commands, or a plugin install.
1522
+ const commandSources = [];
1523
+ if (SNAPSHOT.commands.length > 0) {
1524
+ commandSources.push({ count: SNAPSHOT.commands.length, label: ".cursor/commands/" });
1525
+ }
1526
+ const claudeCommandCount = healthMdFiles(join(ROOT, ".claude", "commands")).length;
1527
+ if (claudeCommandCount > 0) {
1528
+ commandSources.push({ count: claudeCommandCount, label: ".claude/commands/" });
1529
+ }
1530
+ for (const plugin of kitPlugins) {
1531
+ const count = plugin.commandDirs.reduce((n, dir) => n + healthMdFiles(dir).length, 0);
1532
+ if (count > 0) commandSources.push({ count, label: healthPluginSource(plugin) });
1533
+ }
1534
+ const commandsCheck = commandSources.length
1535
+ ? healthCheck(
1536
+ "commands",
1537
+ "Commands",
1538
+ "ok",
1539
+ commandSources
1540
+ .map((s) => `${s.count} command${s.count === 1 ? "" : "s"} from ${s.label}`)
1541
+ .join("; "),
1542
+ )
1543
+ : healthCheck(
1544
+ "commands",
1545
+ "Commands",
1546
+ "degraded",
1547
+ "No commands in .cursor/commands/, .claude/commands/ or a Mission Kit plugin install",
1548
+ );
1549
+
1550
+ // Agents: optional in L0; warning names files without name + description frontmatter.
1551
+ const agentFiles = [];
1552
+ for (const rel of [".cursor/agents", ".claude/agents"]) {
1553
+ for (const f of healthMdFiles(join(ROOT, rel))) {
1554
+ agentFiles.push({ full: join(ROOT, rel, f), shown: `${rel}/${f}` });
1555
+ }
1556
+ }
1557
+ for (const plugin of kitPlugins) {
1558
+ for (const dir of plugin.agentDirs) {
1559
+ for (const f of healthMdFiles(dir)) {
1560
+ agentFiles.push({
1561
+ full: join(dir, f),
1562
+ shown: HEALTH_BROADCAST ? `${healthPluginName(plugin)}: ${f}` : healthHomeRel(join(dir, f)),
1563
+ });
1564
+ }
1565
+ }
1566
+ }
1567
+ const agentsWithoutFrontmatter = agentFiles
1568
+ .filter(({ full }) => {
1569
+ let head = "";
1570
+ try {
1571
+ head = readFileSync(full, "utf-8").slice(0, 4096);
1572
+ } catch {
1573
+ return false;
1574
+ }
1575
+ const fm = head.match(/^---\r?\n([\s\S]*?)\r?\n---/);
1576
+ return !fm || !/^name:\s*\S/m.test(fm[1]) || !/^description:\s*\S/m.test(fm[1]);
1577
+ })
1578
+ .map((a) => a.shown);
1579
+ const agentsCheck =
1580
+ agentFiles.length === 0
1581
+ ? healthCheck("agents", "Agents", "ok", "None installed; workers run as general-purpose")
1582
+ : agentsWithoutFrontmatter.length === 0
1583
+ ? healthCheck(
1584
+ "agents",
1585
+ "Agents",
1586
+ "ok",
1587
+ `${agentFiles.length} agent file${agentFiles.length === 1 ? "" : "s"} with name and description`,
1588
+ )
1589
+ : healthCheck(
1590
+ "agents",
1591
+ "Agents",
1592
+ "warning",
1593
+ `Missing name or description frontmatter (not loaded by the IDE): ${agentsWithoutFrontmatter.slice(0, 5).join(", ")}${agentsWithoutFrontmatter.length > 5 ? ` and ${agentsWithoutFrontmatter.length - 5} more` : ""}`,
1594
+ );
1595
+
1596
+ // Git: unborn HEAD is a warning; the extra reads run only after rev-parse failed.
1597
+ let gitCheck;
1598
+ if (SNAPSHOT.git.branch) {
1599
+ gitCheck = healthCheck("git", "Git repository", "ok", `On ${SNAPSHOT.git.branch}`);
1600
+ } else {
1601
+ const gitRead = (args) => {
1602
+ try {
1603
+ return {
1604
+ ok: true,
1605
+ out: execFileSync("git", args, {
1606
+ cwd: ROOT,
1607
+ encoding: "utf-8",
1608
+ timeout: 5000,
1609
+ stdio: ["ignore", "pipe", "ignore"],
1610
+ }).trim(),
1611
+ };
1612
+ } catch {
1613
+ return { ok: false, out: "" };
1614
+ }
1615
+ };
1616
+ const unbornBranch = gitRead(["symbolic-ref", "--short", "HEAD"]);
1617
+ gitCheck =
1618
+ unbornBranch.ok && unbornBranch.out && !gitRead(["rev-parse", "--verify", "-q", "HEAD"]).ok
1619
+ ? healthCheck("git", "Git repository", "warning", `No commits on ${unbornBranch.out}`)
1620
+ : healthCheck("git", "Git repository", "degraded", "Not a git repository");
1621
+ }
1622
+
1623
+ // Config: a missing config.json means defaults; only an unparseable file is degraded.
1624
+ const configCheck = !existsSync(configPath)
1625
+ ? healthCheck(
1626
+ "config",
1627
+ "Config",
1628
+ "ok",
1629
+ kitPlugins.length
1630
+ ? `Defaults (no config.json); ${healthPluginName(kitPlugins[0])} found`
1631
+ : "Defaults (no config.json)",
1632
+ )
1633
+ : SNAPSHOT.system.config && !SNAPSHOT.system.config.error
1634
+ ? healthCheck("config", "Config", "ok", ".cursor/context/config.json parses")
1635
+ : healthCheck("config", "Config", "degraded", ".cursor/context/config.json does not parse");
1636
+
1330
1637
  const checks = [
1331
- { id: "plans", label: "Plans directory", ok: existsSync(plansDir) && SNAPSHOT.plans.length > 0 },
1332
- // Present + parseable HANDOFF is healthy even when Plan is none/null (idle).
1333
- { id: "handoff", label: "HANDOFF.md", ok: !!SNAPSHOT.system.handoff },
1334
- // L0-optional: empty .cursor/agents/ is healthy (packs/skills may add agents later).
1335
- { id: "agents", label: "Agents", ok: true },
1336
- { id: "commands", label: "Commands", ok: SNAPSHOT.commands.length > 0 },
1337
- {
1338
- id: "memory",
1339
- label: "Memory (errors + decisions)",
1340
- ok: (SNAPSHOT.memory.errors || 0) + (SNAPSHOT.memory.decisions || 0) > 0,
1341
- },
1342
- { id: "git", label: "Git repository", ok: !!SNAPSHOT.git.branch },
1343
- { id: "config", label: "Config", ok: !!SNAPSHOT.system.config },
1638
+ plansCheck,
1639
+ handoffCheck,
1640
+ agentsCheck,
1641
+ commandsCheck,
1642
+ memoryCheck,
1643
+ gitCheck,
1644
+ configCheck,
1344
1645
  ];
1345
1646
 
1346
1647
  SNAPSHOT.health.checks = checks;
1347
- SNAPSHOT.health.status = checks.every((c) => c.ok)
1348
- ? "ok"
1349
- : checks.filter((c) => !c.ok).length <= 2
1350
- ? "warning"
1351
- : "degraded";
1648
+ SNAPSHOT.health.status = checks.some((c) => c.severity === "degraded")
1649
+ ? "degraded"
1650
+ : workspaceFresh
1651
+ ? "not-initialized"
1652
+ : checks.some((c) => c.severity !== "ok")
1653
+ ? "warning"
1654
+ : "ok";
1352
1655
 
1353
1656
  /**
1354
1657
  * Agent-prompt detection contract (fs half).
@@ -1055,6 +1055,7 @@ body.mc-fullscreen .top-tabs-row {
1055
1055
  }
1056
1056
  .health-vital-card[data-state="pass"] .health-vital-state { color: var(--green); }
1057
1057
  .health-vital-card[data-state="attention"] .health-vital-state { color: var(--red); }
1058
+ .health-vital-card[data-state="not-started"] .health-vital-state { color: var(--blue); }
1058
1059
  .health-group {
1059
1060
  display: flex;
1060
1061
  flex-direction: column;
@@ -1116,6 +1117,7 @@ body.mc-fullscreen .top-tabs-row {
1116
1117
  .health-item-sev[data-sev="ok"] { color: var(--green); }
1117
1118
  .health-item-sev[data-sev="warning"] { color: var(--yellow); }
1118
1119
  .health-item-sev[data-sev="degraded"] { color: var(--orange); }
1120
+ .health-item-sev[data-sev="not-initialized"] { color: var(--blue); }
1119
1121
  .health-item-chevron {
1120
1122
  color: var(--text-muted);
1121
1123
  font-size: 10px;
@@ -6714,13 +6716,13 @@ const HEALTH_CHECK_META = {
6714
6716
  },
6715
6717
  agents: {
6716
6718
  okDetail: 'Agents are optional in L0; empty .cursor/agents/ is healthy. Cataloged agents (if any) are listed in Agents.',
6717
- // Intentionally unreachable: dashboard-data keeps agents.ok constant-true (L0-optional).
6718
- failDetail: 'Intentionally unreachable (agents ok is constant-true; L0-optional inventory).',
6719
+ // Never degraded: warning names agent files without name + description frontmatter.
6720
+ failDetail: 'Some agent files have no name or description frontmatter, so the IDE does not load them.',
6719
6721
  autofix: null,
6720
6722
  },
6721
6723
  commands: {
6722
- okDetail: 'Slash commands are available under .cursor/commands/.',
6723
- failDetail: 'No commands under .cursor/commands/.',
6724
+ okDetail: 'Slash commands are available (workspace or Mission Kit plugin install).',
6725
+ failDetail: 'No commands under .cursor/commands/, .claude/commands/ or a Mission Kit plugin install.',
6724
6726
  autofix: { text: '.cursor/commands/', subject: 'path .cursor/commands/', destination: 'filePicker', label: 'Copy path' },
6725
6727
  },
6726
6728
  memory: {
@@ -6731,8 +6733,11 @@ const HEALTH_CHECK_META = {
6731
6733
  git: {
6732
6734
  okDetail: 'Git branch signal is available.',
6733
6735
  failDetail: 'Git repository signal missing (no branch).',
6734
- // Covers not-a-repo and git-init-but-zero-commits (rev-parse HEAD fails until first commit).
6736
+ // Not a repository (degraded). A repository without commits is a warning with its own fix.
6735
6737
  autofix: { text: 'git init && git commit --allow-empty -m "init"', subject: 'git init && git commit --allow-empty -m "init"', destination: 'terminal', label: 'Autofix' },
6738
+ autofixBySeverity: {
6739
+ warning: { text: 'git commit --allow-empty -m "chore: initial commit"', subject: 'git commit --allow-empty -m "chore: initial commit"', destination: 'terminal', label: 'Autofix' },
6740
+ },
6736
6741
  },
6737
6742
  config: {
6738
6743
  okDetail: 'Workspace config is loaded.',
@@ -6749,10 +6754,16 @@ const HEALTH_VITAL_GROUPS = [
6749
6754
  { label: 'Workspace', checks: ['git', 'config'] },
6750
6755
  ];
6751
6756
 
6757
+ /** Per-check severities a producer may send (Amend 2026-11-19: explicit `severity` field). */
6758
+ const HEALTH_CHECK_SEVERITIES = ['ok', 'warning', 'degraded', 'not-initialized'];
6759
+
6752
6760
  function healthCheckSeverity(check, aggregateStatus) {
6753
- // Per-check levels are ok | warning | degraded only. Aggregate snapshot/serve
6754
- // `error` is empty-checks (presence + empty state); producers never emit
6755
- // status:error with checks present, so do not invent a per-check error sev.
6761
+ // Per-check levels are ok | warning | degraded | not-initialized. An explicit
6762
+ // `severity` wins over `ok`; older snapshots without it keep the ok mapping.
6763
+ // Aggregate snapshot/serve `error` is empty-checks (presence + empty state);
6764
+ // producers never emit status:error with checks present, so do not invent a
6765
+ // per-check error sev.
6766
+ if (check && HEALTH_CHECK_SEVERITIES.includes(check.severity)) return check.severity;
6756
6767
  if (check && check.ok) return 'ok';
6757
6768
  if (aggregateStatus === 'degraded') return 'degraded';
6758
6769
  return 'warning';
@@ -6767,6 +6778,7 @@ const HEALTH_SEVERITY_CHROME = {
6767
6778
  ok: { tone: 'green', label: 'ok' },
6768
6779
  warning: { tone: 'yellow', label: 'warn' },
6769
6780
  degraded: { tone: 'orange', label: 'degraded' },
6781
+ 'not-initialized': { tone: 'blue', label: 'not started' },
6770
6782
  error: { tone: 'red', label: 'error' },
6771
6783
  };
6772
6784
 
@@ -7367,10 +7379,13 @@ function updateTransportChrome() {
7367
7379
  statusDot.className = 'dot dot-yellow';
7368
7380
  statusLabel.textContent = 'Catching up';
7369
7381
  } else if (sseMode === 'live') {
7370
- // Steady dot while healthy; pulse only when health is not ok
7382
+ // Steady dot while healthy; pulse only when health is not ok. A fresh
7383
+ // workspace (not-initialized) is not a fault: steady dot, label "Not started".
7371
7384
  statusDot.className = healthStatus === 'ok'
7372
7385
  ? 'dot dot-green'
7373
- : `dot dot-${healthTone} dot-pulse`;
7386
+ : healthStatus === 'not-initialized'
7387
+ ? `dot dot-${healthTone}`
7388
+ : `dot dot-${healthTone} dot-pulse`;
7374
7389
  statusLabel.textContent = healthStatus === 'ok'
7375
7390
  ? 'Live'
7376
7391
  : healthChrome.label.charAt(0).toUpperCase() + healthChrome.label.slice(1);
@@ -9431,7 +9446,8 @@ function renderUnsafe() {
9431
9446
  const isSnapshotError = healthStatus === 'error' && checks.length === 0;
9432
9447
  const isOffline = !isSnapshotError && checks.length === 0;
9433
9448
  const presenceTone = healthSeverityChrome(healthStatus).tone;
9434
- const presencePulse = healthStatus !== 'ok' ? ' dot-pulse' : '';
9449
+ const healthCalm = healthStatus === 'ok' || healthStatus === 'not-initialized';
9450
+ const presencePulse = healthCalm ? '' : ' dot-pulse';
9435
9451
  const presenceLabel = isSnapshotError
9436
9452
  ? 'Snapshot error'
9437
9453
  : isOffline
@@ -9442,7 +9458,9 @@ function renderUnsafe() {
9442
9458
  ? 'Warning'
9443
9459
  : healthStatus === 'degraded'
9444
9460
  ? 'Degraded'
9445
- : 'Error';
9461
+ : healthStatus === 'not-initialized'
9462
+ ? 'Not started'
9463
+ : 'Error';
9446
9464
  const subtitle = isSnapshotError
9447
9465
  ? 'Snapshot unavailable'
9448
9466
  : isOffline
@@ -9487,15 +9505,21 @@ function renderUnsafe() {
9487
9505
  autofix: null,
9488
9506
  };
9489
9507
  const sev = healthCheckSeverity(c, healthStatus);
9490
- const detail = c.ok ? meta.okDetail : meta.failDetail;
9491
- const autofix = !c.ok && meta.autofix ? meta.autofix : null;
9508
+ const notStarted = sev === 'not-initialized';
9509
+ const detail = (typeof c.detail === 'string' && c.detail) || (c.ok ? meta.okDetail : meta.failDetail);
9510
+ const autofix = c.ok || notStarted
9511
+ ? null
9512
+ : (meta.autofixBySeverity && meta.autofixBySeverity[sev]) || meta.autofix || null;
9492
9513
  const fixPrompt = [`Fix this failing health check: ${c.label || id}`, detail].join('\n');
9493
9514
  const fixBtn = `<button type="button" class="health-autofix-btn" data-focus-key="health-fix-${escapeAttr(id)}" onclick="event.stopPropagation();${copyForPasteHandler(fixPrompt, 'fix prompt', 'chatInput')}" title="${escapeAttr(copyActionTitle('fix prompt', 'chatInput'))}">Copy fix prompt</button>`;
9494
9515
  const autofixBtn = autofix
9495
9516
  ? `<button type="button" class="health-autofix-btn" data-focus-key="health-autofix-${escapeAttr(id)}" onclick="event.stopPropagation();${copyForPasteHandler(autofix.text, autofix.subject, autofix.destination)}" title="${escapeAttr(copyActionTitle(autofix.subject, autofix.destination))}">${escapeHtml(autofix.label || 'Autofix')}</button>`
9496
9517
  : '';
9497
- const actions = c.ok
9498
- ? `<span class="health-detail-copy" style="margin:0">No action needed.</span>`
9518
+ const actionNote = c.ok
9519
+ ? 'No action needed.'
9520
+ : notStarted ? 'Starts with your first plan: /start-project.' : '';
9521
+ const actions = actionNote
9522
+ ? `<span class="health-detail-copy" style="margin:0">${escapeHtml(actionNote)}</span>`
9499
9523
  : `${fixBtn}${autofixBtn}`;
9500
9524
  return `
9501
9525
  <div class="health-card" role="listitem" id="health-card-${escapeAttr(id)}" data-check-id="${escapeAttr(id)}" data-severity="${escapeAttr(sev)}">
@@ -9523,16 +9547,34 @@ function renderUnsafe() {
9523
9547
  ${grouped.map(g => {
9524
9548
  const total = g.items.length;
9525
9549
  const okCount = g.items.filter(c => c.ok).length;
9526
- const state = okCount === total ? 'pass' : 'attention';
9550
+ const waiting = g.items.filter(c => healthCheckSeverity(c, healthStatus) === 'not-initialized').length;
9551
+ const state = okCount === total ? 'pass' : okCount + waiting === total ? 'not-started' : 'attention';
9552
+ const stateDot = state === 'pass' ? 'dot-green' : state === 'not-started' ? 'dot-blue' : 'dot-red';
9553
+ const stateLabel = state === 'pass' ? 'Pass' : state === 'not-started' ? 'Not started' : 'Attention';
9527
9554
  return `
9528
9555
  <div class="health-vital-card" role="listitem" data-state="${state}">
9529
9556
  <span class="health-vital-name">${escapeHtml(g.label)}</span>
9530
9557
  <span class="health-vital-score">${okCount}/${total} passing</span>
9531
- <span class="health-vital-state"><span class="dot ${state === 'pass' ? 'dot-green' : 'dot-red'}"></span>${state === 'pass' ? 'Pass' : 'Attention'}</span>
9558
+ <span class="health-vital-state"><span class="dot ${stateDot}"></span>${stateLabel}</span>
9532
9559
  </div>`;
9533
9560
  }).join('')}
9534
9561
  </div>`;
9535
- healthBody = `${vitalsStrip}
9562
+ // Fresh workspace (Amend 2026-11-19): lead with the first-run call to action.
9563
+ const firstRunCta = healthStatus === 'not-initialized'
9564
+ ? renderEmptyStateCta({
9565
+ headline: 'No plan yet',
9566
+ support: 'This workspace has not started: no plan, no HANDOFF, no memory. Start a plan and Health follows it.',
9567
+ iconKind: 'health',
9568
+ cta: {
9569
+ text: '/start-project',
9570
+ subject: '/start-project',
9571
+ destination: 'chatInput',
9572
+ label: 'Copy /start-project',
9573
+ focusKey: 'cta-health-start-project',
9574
+ },
9575
+ })
9576
+ : '';
9577
+ healthBody = `${firstRunCta}${vitalsStrip}
9536
9578
  ${grouped.map(g => `
9537
9579
  <section class="health-group" aria-label="${escapeAttr(g.label)}">
9538
9580
  <div class="health-group-title">${escapeHtml(g.label)}</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dadado/agent-kit-cli",
3
- "version": "6.22.0",
3
+ "version": "6.22.1",
4
4
  "description": "Agent Kit CLI: HITL framework install and tooling for AI-assisted IDEs (rules, skills, plan/handoff, context).",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://agent.missionkit.io/",