@dadado/agent-kit-cli 6.23.0 → 6.26.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 (86) hide show
  1. package/README.md +1 -0
  2. package/dashboard/dashboard-data.mjs +126 -5
  3. package/dashboard/dashboard.html +48 -7
  4. package/dashboard/lib/guards.mjs +1 -0
  5. package/dashboard/lib/live-refresh.mjs +1 -0
  6. package/dist/{add-RKZQX6ZK.js → add-G7KEZLWP.js} +17 -8
  7. package/dist/{chunk-7HDQEK6T.js → chunk-2G4K4ZI5.js} +7 -3
  8. package/dist/{chunk-5PSV76CQ.js → chunk-2GXN7HVG.js} +26 -7
  9. package/dist/chunk-2QYWMSI5.js +193 -0
  10. package/dist/{chunk-B3VR5YBQ.js → chunk-2TW7ENWC.js} +12 -11
  11. package/dist/{chunk-IESSMKOV.js → chunk-5A72LTR3.js} +7 -7
  12. package/dist/{chunk-R4DUO5DA.js → chunk-AXQMVQ6O.js} +61 -237
  13. package/dist/{chunk-6WUKLS4D.js → chunk-BIFTTL2O.js} +1 -1
  14. package/dist/{chunk-AWQ6KRFV.js → chunk-BVZDPVUL.js} +1 -1
  15. package/dist/{chunk-QNISTPPZ.js → chunk-ENRXS5O6.js} +19 -12
  16. package/dist/chunk-FB6G6OD6.js +519 -0
  17. package/dist/{chunk-MFKHIWEL.js → chunk-FOVHFMSH.js} +1 -1
  18. package/dist/{chunk-6BEFGKCU.js → chunk-FUSNEYGU.js} +29 -3
  19. package/dist/chunk-H7KAXI5R.js +357 -0
  20. package/dist/chunk-HGB4DHXV.js +138 -0
  21. package/dist/{chunk-W3ZJVBNY.js → chunk-HXV6VQD4.js} +2374 -983
  22. package/dist/{chunk-BGL5DRK2.js → chunk-I3FGWNU5.js} +4 -4
  23. package/dist/chunk-IHVJTGYR.js +144 -0
  24. package/dist/{chunk-5LNHRL5E.js → chunk-IUY24WPE.js} +93 -263
  25. package/dist/chunk-JG5MKMOM.js +248 -0
  26. package/dist/{chunk-SGTTC2JP.js → chunk-JWIJHO67.js} +17 -2
  27. package/dist/chunk-KMK4T4ZM.js +34 -0
  28. package/dist/{chunk-ZMYV6PRE.js → chunk-LEVNLHH3.js} +2 -1
  29. package/dist/{chunk-2IP4OO6R.js → chunk-MGVV6YC4.js} +1 -1
  30. package/dist/{chunk-7TYA3GMI.js → chunk-MWRYQLEG.js} +7 -4
  31. package/dist/chunk-NHJ4IAVN.js +435 -0
  32. package/dist/{chunk-C4Q77GGJ.js → chunk-O7VMHCNN.js} +6 -0
  33. package/dist/{chunk-5EBT3V7G.js → chunk-OVRGTHZD.js} +1 -1
  34. package/dist/{chunk-F7YAAKYP.js → chunk-PCIYXGB3.js} +7 -5
  35. package/dist/{chunk-UJCATSYO.js → chunk-PLLXFSN2.js} +46 -17
  36. package/dist/{chunk-OYFCBYMP.js → chunk-RJP47EGS.js} +18 -1
  37. package/dist/{chunk-KDJ4ML7I.js → chunk-RRJVC35Y.js} +4 -4
  38. package/dist/{chunk-DRZFWIBN.js → chunk-SWJJW624.js} +1 -1
  39. package/dist/{chunk-MJJBIOSY.js → chunk-SYRJ5TTK.js} +34 -12
  40. package/dist/{chunk-L5V3W3DY.js → chunk-TTUFIE26.js} +60 -14
  41. package/dist/{chunk-JFS4GKP7.js → chunk-XXPI4H4D.js} +2 -2
  42. package/dist/{chunk-CVZNSRXV.js → chunk-Y5526WCN.js} +84 -19
  43. package/dist/{chunk-CQHD6UKB.js → chunk-Y575INEC.js} +2 -1
  44. package/dist/{chunk-V2H57TFD.js → chunk-ZNZHDPS3.js} +80 -170
  45. package/dist/{commands-SAQEEE6V.js → commands-K4HSDML5.js} +8 -6
  46. package/dist/{conflicts-5JOP4GX2.js → conflicts-4SUWIPWP.js} +9 -10
  47. package/dist/{contribute-BQKRT5GN.js → contribute-HE4WCBRY.js} +7 -5
  48. package/dist/{countdown-25E5C7AR.js → countdown-TYQHVAIX.js} +305 -32
  49. package/dist/{dashboard-P65XHYCU.js → dashboard-6V6PCNYF.js} +1 -1
  50. package/dist/{dashboard-broadcast-GYK34QYL.js → dashboard-broadcast-PMVQ7PXU.js} +1 -1
  51. package/dist/{diff-6JSXBVSX.js → diff-3XUZM7ZT.js} +15 -6
  52. package/dist/{doctor-I3MTHS7F.js → doctor-KGUWU5SN.js} +106 -19
  53. package/dist/{engine-info-BBI5QO5Y.js → engine-info-VM4VPGQM.js} +2 -2
  54. package/dist/{ground-control-IDCXN5FK.js → ground-control-ZIDHEOPW.js} +7 -4
  55. package/dist/{guard-RJZEEKSL.js → guard-ZO4Z3LLB.js} +47 -9
  56. package/dist/{handoff-5AGE2D3T.js → handoff-LLT4CI6H.js} +4 -3
  57. package/dist/{hook-WNA42CXE.js → hook-UPZ3CPYS.js} +22 -20
  58. package/dist/index.js +51 -33
  59. package/dist/{init-FZ2UFPO7.js → init-ZHLVXEVT.js} +25 -18
  60. package/dist/install-XWOG64W3.js +42 -0
  61. package/dist/installs-2ROXPO6M.js +223 -0
  62. package/dist/{mission-control-CRMCRZUU.js → mission-control-IGOI3WHS.js} +2 -2
  63. package/dist/models-5BDXREWM.js +45 -0
  64. package/dist/paths-JTPV6SXH.js +107 -0
  65. package/dist/pi-DCMDOY65.js +248 -0
  66. package/dist/{plan-index-BNLUU6T5.js → plan-index-5QZJK4AG.js} +2 -3
  67. package/dist/{queue-JW4VR33H.js → queue-Z5VNNHM6.js} +10 -12
  68. package/dist/{run-X2WOONTB.js → run-QURAXAR2.js} +27 -33
  69. package/dist/{run-plan-4MOLLIES.js → run-plan-4MMHVCTS.js} +35 -23
  70. package/dist/{scan-K3T5RQLC.js → scan-7D3RMO34.js} +2 -1
  71. package/dist/{session-start-MV7A4263.js → session-start-NC2HE5X5.js} +20 -14
  72. package/dist/{sessions-UPFDWDMB.js → sessions-WWWLYPW6.js} +4 -4
  73. package/dist/{setup-global-VNADNTQ2.js → setup-global-WDMARD4Z.js} +12 -10
  74. package/dist/{status-SXA3OK5E.js → status-2WNJL7PP.js} +17 -13
  75. package/dist/update-YSVOYYK5.js +32 -0
  76. package/dist/update-all-5XLTCHPX.js +697 -0
  77. package/package.json +14 -4
  78. package/pi/agent-kit.ts +224 -0
  79. package/dist/chunk-4MR4QXMF.js +0 -52
  80. package/dist/chunk-7ABY6DYH.js +0 -89
  81. package/dist/chunk-C4LCOOL4.js +0 -71
  82. package/dist/chunk-DZCLMIAS.js +0 -391
  83. package/dist/chunk-HAFRAXGV.js +0 -17
  84. package/dist/chunk-MUTTNRX4.js +0 -53
  85. package/dist/install-CTLT3TSI.js +0 -38
  86. package/dist/update-RMAWXMCV.js +0 -304
package/README.md CHANGED
@@ -75,6 +75,7 @@ On an interactive TTY, long-running commands (`init`, `install`, `doctor`, `upda
75
75
  | `agent-kit doctor` | Diagnose repository readiness (`--json` includes an `env` pillar: bin-on-PATH, npm prefix writability, Node version, shell profile) |
76
76
  | `agent-kit setup-global` | Self-heal a root-owned npm global prefix (relocate to `~/.npm-global`, fix `PATH`, reinstall) |
77
77
  | `agent-kit update` | Re-apply L0/packs/skills from the registry |
78
+ | `agent-kit installs` | List the kit installs recorded on this machine (`scan [--root <dir>]...` to find them, `prune` to drop gone ones) |
78
79
  | `agent-kit dashboard` | Start Mission Control for this workspace (browser panel) |
79
80
  | `agent-kit mission-control` | ASCII Mission Control TUI (`--once` for one frame) |
80
81
  | `agent-kit add <id>` | Install a skill or L1 pack |
@@ -6,7 +6,8 @@
6
6
 
7
7
  import { execFile, execFileSync } from "node:child_process";
8
8
  import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
9
- import { dirname, join, resolve } from "node:path";
9
+ import { homedir } from "node:os";
10
+ import { dirname, isAbsolute, join, resolve } from "node:path";
10
11
  import { collectChats } from "./lib/chat-sessions.mjs";
11
12
  import { collectGateExitTickets } from "./lib/gate-exit-tickets.mjs";
12
13
  import {
@@ -171,7 +172,7 @@ function redactTerminalOutput(text) {
171
172
 
172
173
  const SNAPSHOT = {
173
174
  _schema: {
174
- version: "1.13.0",
175
+ version: "1.15.0",
175
176
  description: "Mission Control dashboard data model",
176
177
  fields: {
177
178
  generatedAt: "ISO-8601 timestamp of snapshot generation",
@@ -205,12 +206,12 @@ const SNAPSHOT = {
205
206
  "Running process snapshots (node, serve.mjs, git operations) with elapsed time and a generated narration per process",
206
207
  skills: "Available skills discovered in .cursor/skills/",
207
208
  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)",
209
+ "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); install ({generatedAt, status ok|warning, checks[] ({id: global-cli|node-manager|home-install|registry-pin, label, ok, severity: ok|warning, detail, fix|null})}|null) is the machine install health that `agent-kit doctor` last wrote to .cursor/context/install-health.json, read-only and outside checks[] and status; null when doctor has not run; broadcast keeps no paths and no fix (1.14.0); updateNotice ({generatedAt, cliVersion, npmLatest|null, cliBehind, installsBehind, oldest {kitVersion, path|null}|null, label, severity: warning, detail, fix|null}|null) is the machine update notice the sessionStart hook last wrote beside ~/.config/agent-kit/installs.json: registered repo/home installs behind the CLI and the CLI behind npm; check-only, null when current or off (CI, AGENT_KIT_NO_UPDATE_CHECK, NO_UPDATE_NOTIFIER, updateCheck.enabled false); broadcast keeps no path and no fix (1.15.0)",
209
210
  missionControl: "Normalized now/activity/attention/plans view model (source-backed; bounded)",
210
211
  },
211
212
  },
212
213
  generatedAt: new Date().toISOString(),
213
- dashboardDataVersion: "1.13.0",
214
+ dashboardDataVersion: "1.15.0",
214
215
  plans: [],
215
216
  system: {
216
217
  repoRoot: ROOT,
@@ -228,7 +229,7 @@ const SNAPSHOT = {
228
229
  outcomeLedger: emptyOutcomeLedgerSummary(),
229
230
  processes: [],
230
231
  skills: [],
231
- health: { status: "ok", checks: [] },
232
+ health: { status: "ok", checks: [], install: null },
232
233
  missionControl: null,
233
234
  };
234
235
 
@@ -1645,6 +1646,126 @@ const checks = [
1645
1646
  ];
1646
1647
 
1647
1648
  SNAPSHOT.health.checks = checks;
1649
+
1650
+ // Install health (c2): written by `agent-kit doctor`, read here fail-open. A
1651
+ // sibling of checks[] so the fixed seven ids and the aggregate stay unchanged.
1652
+ const INSTALL_HEALTH_IDS = new Set(["global-cli", "node-manager", "home-install", "registry-pin"]);
1653
+ function readInstallHealth() {
1654
+ const raw = healthReadJson(join(ROOT, ".cursor", "context", "install-health.json"));
1655
+ if (!raw || typeof raw !== "object" || !Array.isArray(raw.checks)) return null;
1656
+ const items = raw.checks
1657
+ .filter((c) => c && typeof c === "object" && INSTALL_HEALTH_IDS.has(c.id))
1658
+ .map((c) => {
1659
+ const severity = c.severity === "warning" ? "warning" : "ok";
1660
+ const label = truncateStr(typeof c.label === "string" ? c.label : c.id, 80);
1661
+ const rawFix = typeof c.fix === "string" && c.fix ? c.fix : null;
1662
+ // Only a ready-to-run command becomes a terminal copy; a config line (the
1663
+ // mise tool entry) or a template with a placeholder rides in the detail.
1664
+ const fix = rawFix && c.fixKind === "command" ? rawFix : null;
1665
+ const baseDetail = typeof c.detail === "string" ? c.detail : "";
1666
+ const fullDetail =
1667
+ rawFix && !fix
1668
+ ? `${baseDetail} (${c.fixKind === "config-line" ? "add" : "fix"}: ${rawFix})`
1669
+ : baseDetail;
1670
+ return {
1671
+ id: c.id,
1672
+ label,
1673
+ ok: severity === "ok",
1674
+ severity,
1675
+ // Paths are home-relative on disk; a broadcast snapshot carries none.
1676
+ detail: HEALTH_BROADCAST
1677
+ ? severity === "ok"
1678
+ ? "No action needed"
1679
+ : "Needs attention: run agent-kit doctor on this machine"
1680
+ : truncateStr(fullDetail, 800),
1681
+ fix: HEALTH_BROADCAST ? null : fix && truncateStr(fix, 300),
1682
+ };
1683
+ });
1684
+ return {
1685
+ generatedAt: typeof raw.generatedAt === "string" ? raw.generatedAt : null,
1686
+ status: items.some((c) => c.severity === "warning") ? "warning" : "ok",
1687
+ checks: items,
1688
+ };
1689
+ }
1690
+ SNAPSHOT.health.install = readInstallHealth();
1691
+
1692
+ // Update notice (c4): `agent-kit hook session-start` writes the computed notice
1693
+ // into the machine cache beside installs.json; read here fail-open, never
1694
+ // computed (no semver or install-kind logic in the dashboard). Same gates as the
1695
+ // CLI: off under CI, the env opt-out and `updateCheck.enabled: false`.
1696
+ function updateNoticeFile(env) {
1697
+ const override =
1698
+ typeof env.AGENT_KIT_INSTALLS_FILE === "string" ? env.AGENT_KIT_INSTALLS_FILE.trim() : "";
1699
+ if (override) return join(dirname(resolve(override)), "update-notice.json");
1700
+ const xdg = typeof env.XDG_CONFIG_HOME === "string" ? env.XDG_CONFIG_HOME.trim() : "";
1701
+ const configDir = xdg && isAbsolute(xdg) ? xdg : join(homedir(), ".config");
1702
+ return join(configDir, "agent-kit", "update-notice.json");
1703
+ }
1704
+ function envFlagOn(value) {
1705
+ if (typeof value !== "string") return false;
1706
+ const v = value.trim().toLowerCase();
1707
+ return v !== "" && v !== "0" && v !== "false";
1708
+ }
1709
+ function readUpdateNotice() {
1710
+ const env = process.env;
1711
+ if (
1712
+ envFlagOn(env.CI) ||
1713
+ envFlagOn(env.AGENT_KIT_NO_UPDATE_CHECK) ||
1714
+ envFlagOn(env.NO_UPDATE_NOTIFIER)
1715
+ ) {
1716
+ return null;
1717
+ }
1718
+ const cfg = healthReadJson(join(ROOT, ".cursor", "context", "config.json"));
1719
+ if (cfg && typeof cfg === "object" && cfg.updateCheck && cfg.updateCheck.enabled === false)
1720
+ return null;
1721
+ const raw = healthReadJson(updateNoticeFile(env));
1722
+ const n = raw && typeof raw === "object" ? raw.notice : null;
1723
+ if (!n || typeof n !== "object" || typeof n.line !== "string" || !n.line) return null;
1724
+ const count = Number.isInteger(n.installsBehind) && n.installsBehind > 0 ? n.installsBehind : 0;
1725
+ const cliBehind = n.cliBehind === true;
1726
+ if (!count && !cliBehind) return null;
1727
+ const cliVersion = typeof n.cliVersion === "string" ? truncateStr(n.cliVersion, 32) : null;
1728
+ const npmVersion =
1729
+ n.npmLatest && typeof n.npmLatest.version === "string"
1730
+ ? truncateStr(n.npmLatest.version, 32)
1731
+ : null;
1732
+ const oldest =
1733
+ count && n.oldest && typeof n.oldest === "object" && typeof n.oldest.kitVersion === "string"
1734
+ ? {
1735
+ kitVersion: truncateStr(n.oldest.kitVersion, 32),
1736
+ // Home-relative on disk; a broadcast snapshot carries no path.
1737
+ path:
1738
+ HEALTH_BROADCAST || typeof n.oldest.path !== "string"
1739
+ ? null
1740
+ : truncateStr(n.oldest.path, 300),
1741
+ }
1742
+ : null;
1743
+ const parts = [];
1744
+ if (cliBehind && npmVersion) parts.push(`CLI ${cliVersion} is behind npm ${npmVersion}`);
1745
+ if (count) {
1746
+ const where = oldest?.path ? ` at ${oldest.path}` : "";
1747
+ parts.push(
1748
+ `${count} ${count === 1 ? "install" : "installs"} behind CLI ${cliVersion}${oldest ? `, oldest v${oldest.kitVersion}${where}` : ""}`,
1749
+ );
1750
+ }
1751
+ const cliCommand =
1752
+ typeof n.cliCommand === "string" && n.cliCommand ? truncateStr(n.cliCommand, 200) : null;
1753
+ // The CLI first: `update --all` stamps the CLI version, so an old CLI cannot reach npm latest.
1754
+ const fix = cliBehind && cliCommand ? cliCommand : count ? "agent-kit update --all" : null;
1755
+ return {
1756
+ generatedAt: typeof n.generatedAt === "string" ? n.generatedAt : null,
1757
+ cliVersion,
1758
+ npmLatest: npmVersion,
1759
+ cliBehind,
1760
+ installsBehind: count,
1761
+ oldest,
1762
+ label: count ? `${count} ${count === 1 ? "install" : "installs"} behind` : "CLI behind npm",
1763
+ severity: "warning",
1764
+ detail: `${parts.join("; ")}. Check-only: nothing is applied.`,
1765
+ fix: HEALTH_BROADCAST ? null : fix,
1766
+ };
1767
+ }
1768
+ SNAPSHOT.health.updateNotice = readUpdateNotice();
1648
1769
  SNAPSHOT.health.status = checks.some((c) => c.severity === "degraded")
1649
1770
  ? "degraded"
1650
1771
  : workspaceFresh
@@ -6252,7 +6252,7 @@ function personaOptionHtml(selected) {
6252
6252
 
6253
6253
  /* Model roles (roles key; docs/model-roles-capability-matrix.md). Empty = not set:
6254
6254
  the field is cleared and the command default or the Audits section applies. */
6255
- const ROLE_WORKER_BACKEND_OPTIONS = ['auto', 'claude', 'cursor-agent', 'codex', 'openrouter', 'cursor-acp'];
6255
+ const ROLE_WORKER_BACKEND_OPTIONS = ['auto', 'claude', 'cursor-agent', 'codex', 'openrouter', 'cursor-acp', 'local'];
6256
6256
  const ROLE_REVIEWER_BACKEND_OPTIONS = ['auto', 'claude', 'cursor-agent'];
6257
6257
  const ROLE_REVIEWER_SCOPE_OPTIONS = ['off', 'tick', 'plan'];
6258
6258
  const ROLE_MODEL_SUGGESTIONS = [
@@ -6315,12 +6315,12 @@ function renderRolesFieldset(cfg) {
6315
6315
  <select id="config-role-worker-backend" name="roleWorkerBackend" data-focus-key="config-role-worker-backend">
6316
6316
  ${roleSelectHtml(ROLE_WORKER_BACKEND_OPTIONS, worker.backend, 'Not set (command default)')}
6317
6317
  </select>
6318
- <span class="config-hint">codex, openrouter and cursor-acp bill their own accounts and never fall back to another backend.</span>
6318
+ <span class="config-hint">codex, openrouter and cursor-acp bill their own accounts and never fall back to another backend. local runs a model on this machine (pi) and never falls back to a paid one.</span>
6319
6319
  </div>
6320
6320
  <div class="config-row">
6321
6321
  <label for="config-role-worker-model">Worker model</label>
6322
6322
  <input type="text" id="config-role-worker-model" name="roleWorkerModel" list="config-role-model-suggestions" value="${escapeAttr(worker.model || '')}" maxlength="128" placeholder="backend default" data-focus-key="config-role-worker-model" />
6323
- <span class="config-hint">Alias or full id for the worker backend. cursor-acp cannot select a model.</span>
6323
+ <span class="config-hint">Alias or full id for the worker backend. cursor-acp cannot select a model. local takes &lt;source&gt;:&lt;id&gt; from agent-kit models.</span>
6324
6324
  </div>
6325
6325
  <div class="config-row">
6326
6326
  <label for="config-role-subworker-model">Subworker model</label>
@@ -6409,7 +6409,8 @@ function renderConfigSection(d) {
6409
6409
  ? frc.tickThreshold
6410
6410
  : 3;
6411
6411
  const uc = cfg.updateCheck || {};
6412
- const updateCheckEnabled = !!uc.enabled;
6412
+ // On by default (check-only); only an explicit false turns it off.
6413
+ const updateCheckEnabled = uc.enabled !== false;
6413
6414
  const updateCheckInterval =
6414
6415
  typeof uc.intervalDays === 'number' && Number.isFinite(uc.intervalDays) ? uc.intervalDays : 7;
6415
6416
  const modeRows = CONFIG_PERSONA_MODES.map((mode) => {
@@ -6463,7 +6464,7 @@ function renderConfigSection(d) {
6463
6464
  <button type="button" class="btn-config-copy" data-focus-key="config-copy-dogfood" onclick="return copyStaticConfigSnippet('dogfood')" title="Copy-only; never writable via this tab">Copy dogfood.factoryRoot snippet</button>
6464
6465
  </fieldset>
6465
6466
  <fieldset class="config-fieldset">
6466
- <legend>Update check (opt-in)</legend>
6467
+ <legend>Update check (on by default, notify only)</legend>
6467
6468
  <div class="config-row config-row-inline">
6468
6469
  <input type="checkbox" id="config-updateCheck-enabled" name="updateCheckEnabled" ${updateCheckEnabled ? 'checked' : ''} data-focus-key="config-updateCheck-enabled" />
6469
6470
  <label for="config-updateCheck-enabled">Advise when a newer public release is available</label>
@@ -6746,6 +6747,42 @@ const HEALTH_CHECK_META = {
6746
6747
  },
6747
6748
  };
6748
6749
 
6750
+ /**
6751
+ * Machine install health (`health.install`, written by `agent-kit doctor`):
6752
+ * a separate group outside the fixed seven checks and the aggregate status.
6753
+ * Absent until doctor has run on this workspace.
6754
+ */
6755
+ /**
6756
+ * Machine update notice (`health.updateNotice`): one card with the count of
6757
+ * registered installs behind the CLI and the oldest one, or the CLI behind
6758
+ * npm. Null when everything is current or the check is off.
6759
+ */
6760
+ function renderUpdateNoticeGroup(notice, renderCard) {
6761
+ if (!notice || typeof notice !== 'object' || !notice.label) return '';
6762
+ return `
6763
+ <section class="health-group" aria-label="Updates">
6764
+ <div class="health-group-title">Updates (check-only, at most daily)</div>
6765
+ <div class="health-grid" role="list">
6766
+ ${renderCard({ id: 'update-notice', label: notice.label, ok: false, severity: 'warning', detail: notice.detail, fix: notice.fix })}
6767
+ </div>
6768
+ </section>`;
6769
+ }
6770
+
6771
+ function renderInstallHealthGroup(install, renderCard) {
6772
+ const items = install && Array.isArray(install.checks) ? install.checks : [];
6773
+ if (items.length === 0) return '';
6774
+ const title = install.generatedAt
6775
+ ? `Install (agent-kit doctor, ${install.generatedAt.slice(0, 10)})`
6776
+ : 'Install (agent-kit doctor)';
6777
+ return `
6778
+ <section class="health-group" aria-label="Install">
6779
+ <div class="health-group-title">${escapeHtml(title)}</div>
6780
+ <div class="health-grid" role="list">
6781
+ ${items.map(renderCard).join('')}
6782
+ </div>
6783
+ </section>`;
6784
+ }
6785
+
6749
6786
  /** Vitals grouping: checks grouped into vital systems for the diagnosis dashboard. */
6750
6787
  const HEALTH_VITAL_GROUPS = [
6751
6788
  { label: 'Planning spine', checks: ['plans', 'handoff'] },
@@ -9507,9 +9544,13 @@ function renderUnsafe() {
9507
9544
  const sev = healthCheckSeverity(c, healthStatus);
9508
9545
  const notStarted = sev === 'not-initialized';
9509
9546
  const detail = (typeof c.detail === 'string' && c.detail) || (c.ok ? meta.okDetail : meta.failDetail);
9547
+ // Install checks (health.install) carry their own terminal fix line.
9548
+ const ownFix = typeof c.fix === 'string' && c.fix
9549
+ ? { text: c.fix, subject: c.fix, destination: 'terminal', label: 'Copy fix' }
9550
+ : null;
9510
9551
  const autofix = c.ok || notStarted
9511
9552
  ? null
9512
- : (meta.autofixBySeverity && meta.autofixBySeverity[sev]) || meta.autofix || null;
9553
+ : ownFix || (meta.autofixBySeverity && meta.autofixBySeverity[sev]) || meta.autofix || null;
9513
9554
  const fixPrompt = [`Fix this failing health check: ${c.label || id}`, detail].join('\n');
9514
9555
  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>`;
9515
9556
  const autofixBtn = autofix
@@ -9581,7 +9622,7 @@ function renderUnsafe() {
9581
9622
  <div class="health-grid" role="list">
9582
9623
  ${g.items.map(renderCheckCard).join('')}
9583
9624
  </div>
9584
- </section>`).join('')}`;
9625
+ </section>`).join('')}${renderUpdateNoticeGroup(health.updateNotice, renderCheckCard)}${renderInstallHealthGroup(health.install, renderCheckCard)}`;
9585
9626
  }
9586
9627
 
9587
9628
  parts.push(`
@@ -595,6 +595,7 @@ export const ROLE_CAPABILITIES = Object.freeze({
595
595
  codex: Object.freeze({ workerModel: true, subworkerModel: false, reviewer: false }),
596
596
  openrouter: Object.freeze({ workerModel: true, subworkerModel: false, reviewer: false }),
597
597
  "cursor-acp": Object.freeze({ workerModel: false, subworkerModel: false, reviewer: false }),
598
+ local: Object.freeze({ workerModel: true, subworkerModel: false, reviewer: false }),
598
599
  });
599
600
 
600
601
  /** roles.worker.backend values: auto plus every kit backend id. */
@@ -35,6 +35,7 @@ export const SNAPSHOT_REPO_SOURCE_RELS = Object.freeze([
35
35
  ".cursor/context/config.json",
36
36
  ".cursor/context/current",
37
37
  ".cursor/context/readiness.json",
38
+ ".cursor/context/install-health.json",
38
39
  ".cursor/context/field-report-dismissals.json",
39
40
  ".cursor/context/field-report-plan-verdicts.json",
40
41
  ".cursor/context/mission-timing.json",
@@ -5,12 +5,12 @@ import {
5
5
  import {
6
6
  REGISTRY_CLI_ARGS,
7
7
  resolveRegistryFromCli
8
- } from "./chunk-DRZFWIBN.js";
8
+ } from "./chunk-SWJJW624.js";
9
9
  import {
10
10
  logger
11
11
  } from "./chunk-ZB43YMHW.js";
12
12
  import {
13
- allPacks,
13
+ UnknownPackError,
14
14
  allSkills,
15
15
  buildManifest,
16
16
  findPack,
@@ -19,15 +19,18 @@ import {
19
19
  installSkill,
20
20
  loadAgentKitManifest,
21
21
  loadRegistry,
22
+ resolvePackSummary,
22
23
  resolveProtectedGlobs,
23
24
  saveManifest,
24
25
  upsertIdList
25
- } from "./chunk-V2H57TFD.js";
26
- import "./chunk-OYFCBYMP.js";
26
+ } from "./chunk-ZNZHDPS3.js";
27
+ import "./chunk-RJP47EGS.js";
28
+ import "./chunk-IHVJTGYR.js";
29
+ import "./chunk-KMK4T4ZM.js";
27
30
  import {
28
31
  KIT_VERSION
29
- } from "./chunk-7HDQEK6T.js";
30
- import "./chunk-C4Q77GGJ.js";
32
+ } from "./chunk-2G4K4ZI5.js";
33
+ import "./chunk-O7VMHCNN.js";
31
34
  import "./chunk-5B4DVO6C.js";
32
35
 
33
36
  // src/commands/add.ts
@@ -76,7 +79,7 @@ var addCommand = defineCommand({
76
79
  const protectedGlobs = resolveProtectedGlobs(existing);
77
80
  const index = await loadRegistry(registry.root);
78
81
  const asSkill = allSkills(index).find((s) => s.id === args.id);
79
- const asPack = allPacks(index).find((p) => p.id === args.id);
82
+ const asPack = resolvePackSummary(index, args.id);
80
83
  const base = existing ? { ...existing } : buildManifest({
81
84
  version: KIT_VERSION,
82
85
  profile: "default",
@@ -111,7 +114,13 @@ var addCommand = defineCommand({
111
114
  return;
112
115
  }
113
116
  if (args.pack) {
114
- const pack = await findPack(registry.root, args.id);
117
+ const pack = await findPack(registry.root, args.id).catch((err) => {
118
+ if (!(err instanceof UnknownPackError)) throw err;
119
+ logger.error(err.message);
120
+ process.exitCode = 1;
121
+ return null;
122
+ });
123
+ if (!pack) return;
115
124
  const stats = await installPack(registry.root, args.cwd, pack.id, { protectedGlobs });
116
125
  logApplyStats(stats);
117
126
  if (skipped(stats)) return;
@@ -1,19 +1,22 @@
1
1
  // src/lifecycle/version.ts
2
2
  import { createRequire } from "module";
3
3
  var require2 = createRequire(import.meta.url);
4
- function loadPackageVersion() {
4
+ function loadPackageMetadata() {
5
5
  for (const packagePath of ["../package.json", "../../package.json"]) {
6
6
  try {
7
7
  const metadata = require2(packagePath);
8
8
  if (typeof metadata.version === "string" && metadata.version.length > 0) {
9
- return metadata.version;
9
+ const name = typeof metadata.name === "string" ? metadata.name : "";
10
+ return { name, version: metadata.version };
10
11
  }
11
12
  } catch {
12
13
  }
13
14
  }
14
15
  throw new Error("Unable to resolve the Agent Kit CLI package version");
15
16
  }
16
- var KIT_VERSION = loadPackageVersion();
17
+ var PACKAGE_METADATA = loadPackageMetadata();
18
+ var KIT_VERSION = PACKAGE_METADATA.version;
19
+ var KIT_PACKAGE_NAME = PACKAGE_METADATA.name;
17
20
  var KIT_PACKAGE_SPEC = "@dadado/agent-kit-cli";
18
21
  function pinnedCliSpec(version = KIT_VERSION) {
19
22
  return `${KIT_PACKAGE_SPEC}@${version}`;
@@ -21,6 +24,7 @@ function pinnedCliSpec(version = KIT_VERSION) {
21
24
 
22
25
  export {
23
26
  KIT_VERSION,
27
+ KIT_PACKAGE_NAME,
24
28
  KIT_PACKAGE_SPEC,
25
29
  pinnedCliSpec
26
30
  };
@@ -1,12 +1,20 @@
1
+ import {
2
+ logger
3
+ } from "./chunk-ZB43YMHW.js";
1
4
  import {
2
5
  compareSemver,
3
6
  normalizeSemver,
4
7
  readLocalKitVersion
5
- } from "./chunk-CVZNSRXV.js";
8
+ } from "./chunk-Y5526WCN.js";
9
+ import {
10
+ isRetiredSkillId,
11
+ retireManagedFiles
12
+ } from "./chunk-HGB4DHXV.js";
6
13
  import {
7
14
  L0_ARTIFACTS
8
15
  } from "./chunk-CGXLR77R.js";
9
16
  import {
17
+ UnknownPackError,
10
18
  copyRegistryFile,
11
19
  emptyStats,
12
20
  installPack,
@@ -15,15 +23,15 @@ import {
15
23
  mergeStats,
16
24
  recordOutcome,
17
25
  resolveProtectedGlobs
18
- } from "./chunk-V2H57TFD.js";
26
+ } from "./chunk-ZNZHDPS3.js";
19
27
  import {
20
28
  loadManagedHashLedger,
21
29
  saveManagedHashLedger
22
- } from "./chunk-OYFCBYMP.js";
30
+ } from "./chunk-RJP47EGS.js";
23
31
  import {
24
32
  KIT_PACKAGE_SPEC,
25
33
  KIT_VERSION
26
- } from "./chunk-7HDQEK6T.js";
34
+ } from "./chunk-2G4K4ZI5.js";
27
35
  import {
28
36
  fileExists
29
37
  } from "./chunk-5B4DVO6C.js";
@@ -137,6 +145,10 @@ async function installL0(registryRoot, projectRoot, protectedGlobs, ledger) {
137
145
  );
138
146
  recordOutcome(stats, artifact.target, outcome);
139
147
  }
148
+ for (const retired of await retireManagedFiles(projectRoot, protectedGlobs, managedHashes)) {
149
+ if (retired.outcome === "removed") stats.removed.push(retired.path);
150
+ else if (retired.outcome === "preserved-customized") stats.collisions.push(retired.path);
151
+ }
140
152
  if (!ledger) await saveManagedHashLedger(projectRoot, managedHashes);
141
153
  const migration = await migrateLegacyOnboardCommand(projectRoot);
142
154
  if (migration === "removed-managed") {
@@ -146,7 +158,8 @@ async function installL0(registryRoot, projectRoot, protectedGlobs, ledger) {
146
158
  }
147
159
  return stats;
148
160
  }
149
- async function syncFromManifest(registryRoot, projectRoot, manifest) {
161
+ async function syncFromManifest(registryRoot, projectRoot, manifest, options = {}) {
162
+ const onWarning = options.onWarning ?? ((message) => logger.warn(message));
150
163
  const protectedGlobs = resolveProtectedGlobs(manifest);
151
164
  const stats = emptyStats();
152
165
  const managedHashes = await loadManagedHashLedger(projectRoot);
@@ -154,9 +167,15 @@ async function syncFromManifest(registryRoot, projectRoot, manifest) {
154
167
  try {
155
168
  mergeStats(stats, await installL0(registryRoot, projectRoot, protectedGlobs, managedHashes));
156
169
  for (const packId of manifest.packs ?? []) {
157
- mergeStats(stats, await installPack(registryRoot, projectRoot, packId, installOpts));
170
+ try {
171
+ mergeStats(stats, await installPack(registryRoot, projectRoot, packId, installOpts));
172
+ } catch (err) {
173
+ if (!(err instanceof UnknownPackError)) throw err;
174
+ onWarning(err.message);
175
+ stats.missing.push(`pack:${packId}`);
176
+ }
158
177
  }
159
- const skillIds = manifest.skills ?? [];
178
+ const skillIds = (manifest.skills ?? []).filter((id) => !isRetiredSkillId(id));
160
179
  if (skillIds.length > 0) {
161
180
  await loadRegistry(registryRoot);
162
181
  mergeStats(stats, await installSkillsByIds(registryRoot, projectRoot, skillIds, installOpts));