@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
@@ -1,304 +0,0 @@
1
- import {
2
- formatQueueLeaseRefusal,
3
- inspectQueueLease
4
- } from "./chunk-MFKHIWEL.js";
5
- import {
6
- NON_INTERACTIVE_ROOT_ARGS,
7
- detectStaleCli,
8
- formatRerunFlags,
9
- formatStaleCliRefusal,
10
- syncFromManifest
11
- } from "./chunk-5PSV76CQ.js";
12
- import {
13
- formatSkippedSymlinks,
14
- logApplyStats
15
- } from "./chunk-HS7LVVLO.js";
16
- import {
17
- REGISTRY_CLI_ARGS,
18
- resolveRegistryFromCli
19
- } from "./chunk-DRZFWIBN.js";
20
- import {
21
- CLAUDE_SETTINGS_REL,
22
- formatClaudeSettingsDrift,
23
- formatPermissionsChanged,
24
- planClaudeSettingsDrift,
25
- writeClaudeSessionStartHook
26
- } from "./chunk-AWQ6KRFV.js";
27
- import {
28
- generateClaudeCommandAdapters
29
- } from "./chunk-6BEFGKCU.js";
30
- import "./chunk-Q35TWISF.js";
31
- import {
32
- withCliProgress
33
- } from "./chunk-QTON2GQX.js";
34
- import {
35
- logger
36
- } from "./chunk-ZB43YMHW.js";
37
- import {
38
- RootRefusedError,
39
- confirmProjectRoot,
40
- isNonInteractive,
41
- syncPathCliToRuntime
42
- } from "./chunk-KDJ4ML7I.js";
43
- import "./chunk-B3VR5YBQ.js";
44
- import {
45
- checkForUpdates
46
- } from "./chunk-CVZNSRXV.js";
47
- import "./chunk-PFEUZXVT.js";
48
- import "./chunk-7TYA3GMI.js";
49
- import "./chunk-4MR4QXMF.js";
50
- import "./chunk-CGXLR77R.js";
51
- import {
52
- buildManifest,
53
- isProtectedPath,
54
- loadAgentKitManifest,
55
- resolveProtectedGlobs,
56
- saveManifest
57
- } from "./chunk-V2H57TFD.js";
58
- import {
59
- seedManagedHashLedger
60
- } from "./chunk-OYFCBYMP.js";
61
- import {
62
- KIT_VERSION
63
- } from "./chunk-7HDQEK6T.js";
64
- import "./chunk-C4Q77GGJ.js";
65
- import "./chunk-5B4DVO6C.js";
66
-
67
- // src/commands/update.ts
68
- import { defineCommand } from "citty";
69
- var UPDATE_RERUN_FLAGS = [
70
- "claude",
71
- "yes",
72
- "force-root",
73
- "force",
74
- "seed-overlay",
75
- "cwd",
76
- "registry",
77
- "url",
78
- "ref",
79
- "refresh"
80
- ];
81
- var updateCommand = defineCommand({
82
- meta: {
83
- name: "update",
84
- description: "Re-apply L0/packs/skills from the registry (never overwrites L3). --check = notify-only."
85
- },
86
- args: {
87
- cwd: {
88
- type: "string",
89
- default: process.cwd()
90
- },
91
- check: {
92
- type: "boolean",
93
- description: "Check-only: compare installed version to the resolved registry (public tags, or --registry local checkout); never apply L0 writes",
94
- default: false
95
- },
96
- json: {
97
- type: "boolean",
98
- description: "Print machine-readable JSON (with --check)",
99
- default: false
100
- },
101
- "respect-prefs": {
102
- type: "boolean",
103
- description: "Honor updateCheck.enabled and intervalDays from .cursor/context/config.json (hooks)",
104
- default: false
105
- },
106
- stamp: {
107
- type: "boolean",
108
- description: "Persist updateCheck.lastCheckedAt after a network check",
109
- default: false
110
- },
111
- "seed-overlay": {
112
- type: "boolean",
113
- description: "Seed the managed-hash ledger from current local overlay files before applying (factory/dogfood only; consumers should not use this)",
114
- default: false
115
- },
116
- "allow-stale-cli": {
117
- type: "boolean",
118
- description: "Apply even when this CLI is older than the registry it is syncing from; the manifest is then stamped with this CLI's version, not the registry's (factory/dev only)",
119
- default: false
120
- },
121
- force: {
122
- type: "boolean",
123
- description: "Apply even while another live writer holds the queue lease (.cursor/context/run-plan-all.lock); an operator choice, never a default",
124
- default: false
125
- },
126
- claude: {
127
- type: "boolean",
128
- description: "Also apply the ledger-aware Claude settings merge (.claude/settings.json + ledger) and generate the .claude/commands/* pointer adapters with install --claude authority; operator opt-in, never from hooks or plan-loop",
129
- default: false
130
- },
131
- ...NON_INTERACTIVE_ROOT_ARGS,
132
- ...REGISTRY_CLI_ARGS
133
- },
134
- async run({ args }) {
135
- if (args.check) {
136
- const result = await checkForUpdates(args.cwd, {
137
- respectPrefs: Boolean(args["respect-prefs"]),
138
- stamp: Boolean(args.stamp),
139
- publicRegistryUrl: typeof args.url === "string" && args.url ? args.url : void 0,
140
- registryPath: typeof args.registry === "string" && args.registry ? args.registry : void 0
141
- });
142
- if (args.json) {
143
- console.log(JSON.stringify(result, null, 2));
144
- } else {
145
- const line = `[${result.status}] ${result.message}`;
146
- if (result.status === "error") logger.error(line);
147
- else if (result.status === "update-available") logger.warn(line);
148
- else if (result.status.startsWith("skipped-")) logger.warn(line);
149
- else logger.info(line);
150
- }
151
- if (result.status === "error") process.exitCode = 2;
152
- return;
153
- }
154
- const nonInteractive = args.yes || isNonInteractive();
155
- let projectRoot;
156
- try {
157
- projectRoot = await confirmProjectRoot(args.cwd, {
158
- nonInteractive,
159
- command: "update",
160
- forceRoot: args["force-root"]
161
- });
162
- } catch (err) {
163
- if (err instanceof RootRefusedError) {
164
- logger.error(err.message);
165
- if (err.recovery) console.error(`
166
- ${err.recovery}
167
- `);
168
- process.exitCode = 1;
169
- return;
170
- }
171
- throw err;
172
- }
173
- const existing = await loadAgentKitManifest(projectRoot, { onWarning: logger.warn });
174
- if (!existing) {
175
- logger.warn("No .cursor/agent-kit.json \u2014 run agent-kit install first.");
176
- return;
177
- }
178
- const lease = inspectQueueLease(projectRoot);
179
- if (lease.kind === "held" && !args.force) {
180
- logger.error(
181
- formatQueueLeaseRefusal(lease, {
182
- what: "another live session writes this workspace, so update will not rewrite L0",
183
- next: "run agent-kit update again (--force applies anyway; operator choice)"
184
- })
185
- );
186
- process.exitCode = 1;
187
- return;
188
- }
189
- const registry = await resolveRegistryFromCli({
190
- cwd: projectRoot,
191
- registry: args.registry,
192
- url: args.url,
193
- ref: args.ref,
194
- refresh: args.refresh,
195
- manifest: existing
196
- });
197
- try {
198
- logger.info(`Registry: ${registry.root} (${registry.source})`);
199
- const stale = await detectStaleCli(registry.root, { warn: logger.warn });
200
- if (stale && !args["allow-stale-cli"]) {
201
- const refusal = formatStaleCliRefusal({
202
- command: "update",
203
- stale,
204
- rerun: formatRerunFlags(args, UPDATE_RERUN_FLAGS)
205
- });
206
- logger.error(refusal.error);
207
- console.error(refusal.recovery);
208
- process.exitCode = 1;
209
- return;
210
- }
211
- const next = buildManifest({
212
- version: KIT_VERSION,
213
- profile: existing.profile,
214
- packs: existing.packs,
215
- skills: existing.skills,
216
- protected: existing.protected,
217
- // Restamp generatorVersion with the CLI that ran this apply so the two
218
- // version fields in the manifest stop disagreeing after an update. The
219
- // personalization result file itself is not regenerated here.
220
- personalization: existing.personalization ? { ...existing.personalization, generatorVersion: KIT_VERSION } : void 0,
221
- registryUrl: registry.url ?? existing.registry?.url,
222
- registryRef: registry.ref ?? existing.registry?.ref
223
- });
224
- if (existing.overrides?.length) next.overrides = existing.overrides;
225
- if (existing.unknownFields) next.unknownFields = existing.unknownFields;
226
- if (next.version === existing.version && existing.installedAt) {
227
- next.installedAt = existing.installedAt;
228
- }
229
- if (args["seed-overlay"]) {
230
- await seedManagedHashLedger(projectRoot);
231
- logger.info("Seeded managed-hash ledger from current local overlay files.");
232
- }
233
- const stats = await withCliProgress(
234
- "update",
235
- () => syncFromManifest(registry.root, projectRoot, next)
236
- );
237
- if (stats.skippedSymlink.length > 0) {
238
- logApplyStats(stats);
239
- logger.error(formatSkippedSymlinks(stats.skippedSymlink));
240
- process.exitCode = 1;
241
- return;
242
- }
243
- if (args.claude) {
244
- const claude = await writeClaudeSessionStartHook(projectRoot, { authorized: true });
245
- if (claude.status === "skipped-symlink") {
246
- logApplyStats(stats);
247
- logger.error(
248
- `Claude settings not written: ${CLAUDE_SETTINGS_REL}, .claude/ or the ledger resolves outside the project (symlink). Nothing was changed there.`
249
- );
250
- process.exitCode = 1;
251
- return;
252
- }
253
- if (claude.status === "unavailable") {
254
- logger.warn(claude.instructions ?? `${CLAUDE_SETTINGS_REL} could not be merged.`);
255
- } else {
256
- console.log(`Claude settings ${claude.status}: ${claude.relativePath}`);
257
- const changed = formatPermissionsChanged(claude.permissionChanges ?? [], {
258
- mergeAllowWithoutGuard: claude.mergeAllowWithoutGuard ?? []
259
- });
260
- for (const line of changed) console.log(line);
261
- }
262
- const adapters = await generateClaudeCommandAdapters(projectRoot);
263
- const skipped = adapters.filter((a) => a.status === "skipped-symlink");
264
- if (skipped.length > 0) {
265
- logApplyStats(stats);
266
- logger.error(
267
- `Claude command adapters not written for: ${skipped.map((a) => a.relativePath).join(", ")} (symlink outside the project). Nothing was changed there.`
268
- );
269
- process.exitCode = 1;
270
- return;
271
- }
272
- if (adapters.length > 0) console.log(formatClaudeAdapterSummary(adapters));
273
- } else {
274
- const drift = await planClaudeSettingsDrift(projectRoot);
275
- if (drift) {
276
- const protectedPath = isProtectedPath(CLAUDE_SETTINGS_REL, resolveProtectedGlobs(next));
277
- for (const line of formatClaudeSettingsDrift(drift, { protectedPath })) console.log(line);
278
- }
279
- }
280
- await saveManifest(projectRoot, next);
281
- logApplyStats(stats);
282
- const transition = next.version === existing.version ? `unchanged at v${next.version}` : `v${existing.version} \u2192 v${next.version}`;
283
- logger.success(`Update complete: ${transition} (L3 protected paths left untouched).`);
284
- const sync = await syncPathCliToRuntime({ runtimeVersion: KIT_VERSION });
285
- for (const line of sync.lines) console.log(line);
286
- } finally {
287
- await registry.unlock?.();
288
- }
289
- }
290
- });
291
- function formatClaudeAdapterSummary(results) {
292
- const count = (status) => results.filter((r) => r.status === status).length;
293
- const parts = [
294
- `${count("applied")} written`,
295
- `${count("refreshed")} refreshed`,
296
- `${count("unchanged")} unchanged`
297
- ];
298
- const customized = count("preserved-customized");
299
- if (customized > 0) parts.push(`${customized} preserved (customized)`);
300
- return `Claude command adapters: ${parts.join(", ")} (.claude/commands/)`;
301
- }
302
- export {
303
- updateCommand
304
- };