@dadado/agent-kit-cli 6.22.1 → 6.25.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 (69) hide show
  1. package/README.md +1 -0
  2. package/dashboard/dashboard-data.mjs +126 -5
  3. package/dashboard/dashboard.html +45 -4
  4. package/dashboard/lib/live-refresh.mjs +1 -0
  5. package/dist/{add-YVDIFP4N.js → add-OYLOMCM6.js} +14 -6
  6. package/dist/chunk-2F6NMQOA.js +519 -0
  7. package/dist/chunk-2QYWMSI5.js +193 -0
  8. package/dist/{chunk-B3VR5YBQ.js → chunk-2TW7ENWC.js} +12 -11
  9. package/dist/{chunk-GT5R7W66.js → chunk-2XLI7XEY.js} +1 -1
  10. package/dist/chunk-6M6UKECW.js +176 -0
  11. package/dist/{chunk-YRBRYTM5.js → chunk-7Y74KO7U.js} +45 -16
  12. package/dist/{chunk-DZCLMIAS.js → chunk-AQLBEEPD.js} +236 -2
  13. package/dist/{chunk-R4DUO5DA.js → chunk-AXQMVQ6O.js} +61 -237
  14. package/dist/{chunk-4SEQ76BQ.js → chunk-C7SV7UP5.js} +7 -4
  15. package/dist/{chunk-WS6OX2IG.js → chunk-CGXLR77R.js} +4 -0
  16. package/dist/{chunk-XZQM55BK.js → chunk-CIV42JGT.js} +7 -5
  17. package/dist/{chunk-CQHD6UKB.js → chunk-CXE6ASSX.js} +1 -0
  18. package/dist/{chunk-2FKAKFMH.js → chunk-EO5NGAYV.js} +1 -1
  19. package/dist/{chunk-GV4VKIPO.js → chunk-G5MQRP6M.js} +32 -14
  20. package/dist/chunk-GMG7ZH4E.js +357 -0
  21. package/dist/{chunk-5EBT3V7G.js → chunk-GQSSXDDK.js} +1 -1
  22. package/dist/{chunk-EYNSSL6B.js → chunk-H7RAFRRZ.js} +47 -251
  23. package/dist/{chunk-IESSMKOV.js → chunk-HSIHZWFF.js} +4 -4
  24. package/dist/{chunk-W3ZJVBNY.js → chunk-IFBIO7VT.js} +449 -418
  25. package/dist/{chunk-QWTBYXHN.js → chunk-JFS4GKP7.js} +1 -1
  26. package/dist/{chunk-LDZAK5DU.js → chunk-JG3CNGQM.js} +78 -170
  27. package/dist/{chunk-SDJIMC5S.js → chunk-JGG574RK.js} +3 -3
  28. package/dist/{chunk-SGTTC2JP.js → chunk-KWYF7QNH.js} +1 -1
  29. package/dist/{chunk-5HH3HSUR.js → chunk-M4UL422I.js} +80 -15
  30. package/dist/{chunk-DTSL2RH7.js → chunk-MFKHIWEL.js} +5 -3
  31. package/dist/{chunk-MGIPA6SD.js → chunk-NJ2SUSWX.js} +1 -1
  32. package/dist/{chunk-BCU54M2P.js → chunk-PIMGV3E5.js} +1 -1
  33. package/dist/{chunk-HJWSOZXS.js → chunk-QACMV46U.js} +10 -10
  34. package/dist/{chunk-WHBGJ7IJ.js → chunk-QLTGHJB3.js} +26 -7
  35. package/dist/{chunk-ZJDJCMQO.js → chunk-QX55T4UX.js} +23 -1
  36. package/dist/chunk-SAQ3EE5R.js +138 -0
  37. package/dist/{chunk-C4LCOOL4.js → chunk-TOSAAQ5A.js} +1 -1
  38. package/dist/chunk-WKFE3RUC.js +433 -0
  39. package/dist/{chunk-BGL5DRK2.js → chunk-XGZOU4DS.js} +1 -1
  40. package/dist/{commands-LEBG6DMD.js → commands-UW2C2ZN4.js} +5 -5
  41. package/dist/{conflicts-FJD3IVPQ.js → conflicts-RING6AHV.js} +22 -12
  42. package/dist/{contribute-XPAR2JER.js → contribute-LSY75JZH.js} +6 -5
  43. package/dist/{countdown-25E5C7AR.js → countdown-SZ2P4XHB.js} +267 -23
  44. package/dist/{diff-KFID4SX3.js → diff-NZVBVQSK.js} +14 -6
  45. package/dist/{doctor-J2GJFTSE.js → doctor-TJSXBVGV.js} +104 -18
  46. package/dist/{ground-control-IDCXN5FK.js → ground-control-ZJXPUIQN.js} +3 -3
  47. package/dist/{guard-RJZEEKSL.js → guard-ZO4Z3LLB.js} +47 -9
  48. package/dist/{handoff-5AGE2D3T.js → handoff-2OZSWGTE.js} +2 -0
  49. package/dist/{hook-HV6U3ANI.js → hook-3VPKNSOO.js} +14 -12
  50. package/dist/index.js +27 -26
  51. package/dist/{init-47WA2SCG.js → init-UW2BJBO2.js} +22 -16
  52. package/dist/install-RQSI4CHG.js +41 -0
  53. package/dist/installs-7TR4H4QH.js +222 -0
  54. package/dist/{mission-control-CRMCRZUU.js → mission-control-VSU6NT43.js} +1 -1
  55. package/dist/{queue-OJHKFKK3.js → queue-JHYILLMX.js} +10 -10
  56. package/dist/{run-Z2GHNVBO.js → run-CQF5RM5X.js} +29 -29
  57. package/dist/{run-plan-XA7MYOQ3.js → run-plan-BEOCOJCF.js} +13 -13
  58. package/dist/{scan-K3T5RQLC.js → scan-7D3RMO34.js} +2 -1
  59. package/dist/{session-start-PEVTDMOZ.js → session-start-QV7CEFRX.js} +18 -12
  60. package/dist/{sessions-6IGVH467.js → sessions-AWAAO3DU.js} +3 -3
  61. package/dist/{setup-global-KBJL7QRD.js → setup-global-ST4TT427.js} +9 -8
  62. package/dist/{status-3UGVDIO6.js → status-HUBPBGUU.js} +14 -11
  63. package/dist/update-DD5UZPGG.js +31 -0
  64. package/dist/update-all-YYUTXHGR.js +695 -0
  65. package/package.json +1 -1
  66. package/dist/chunk-HAFRAXGV.js +0 -17
  67. package/dist/chunk-ZNY32NK2.js +0 -52
  68. package/dist/install-Y63HEM4G.js +0 -38
  69. package/dist/update-4UQHGENC.js +0 -283
@@ -1,17 +0,0 @@
1
- import {
2
- writeJson
3
- } from "./chunk-5B4DVO6C.js";
4
-
5
- // src/scanner/snapshot.ts
6
- import path from "path";
7
- var READINESS_SNAPSHOT_RELATIVE_PATH = ".cursor/context/readiness.json";
8
- async function writeReadinessSnapshot(rootDir, report) {
9
- const snapshotPath = path.join(rootDir, READINESS_SNAPSHOT_RELATIVE_PATH);
10
- await writeJson(snapshotPath, report);
11
- return snapshotPath;
12
- }
13
-
14
- export {
15
- READINESS_SNAPSHOT_RELATIVE_PATH,
16
- writeReadinessSnapshot
17
- };
@@ -1,52 +0,0 @@
1
- import {
2
- L0_ARTIFACTS
3
- } from "./chunk-WS6OX2IG.js";
4
- import {
5
- allSkills,
6
- loadPackManifest,
7
- loadRegistry,
8
- packMemberFileTargets,
9
- skillFileTargets
10
- } from "./chunk-LDZAK5DU.js";
11
-
12
- // src/lifecycle/targets.ts
13
- import path from "path";
14
- var toPosix = (rel) => rel.split(path.sep).join("/");
15
- async function managedPairs(registryRoot, manifest, index) {
16
- const pairs = [];
17
- const missingSkills = [];
18
- const push = (sourceRel, targetRel, origin) => {
19
- pairs.push({ sourceRel: toPosix(sourceRel), targetRel: toPosix(targetRel), origin });
20
- };
21
- for (const a of L0_ARTIFACTS) push(a.source, a.target, "l0");
22
- for (const packId of manifest.packs ?? []) {
23
- const pack = await loadPackManifest(registryRoot, packId);
24
- for (const member of pack.members) {
25
- for (const { sourceRel, targetRel } of await packMemberFileTargets(registryRoot, member)) {
26
- push(sourceRel, targetRel, "pack");
27
- }
28
- }
29
- }
30
- if ((manifest.skills ?? []).length > 0) {
31
- const pool = allSkills(index ?? await loadRegistry(registryRoot));
32
- for (const id of manifest.skills ?? []) {
33
- const skill = pool.find((s) => s.id === id);
34
- if (!skill) {
35
- missingSkills.push(id);
36
- continue;
37
- }
38
- for (const { sourceRel, targetRel } of await skillFileTargets(
39
- registryRoot,
40
- skill.path,
41
- skill.id
42
- )) {
43
- push(sourceRel, targetRel, "skill");
44
- }
45
- }
46
- }
47
- return { pairs, missingSkills };
48
- }
49
-
50
- export {
51
- managedPairs
52
- };
@@ -1,38 +0,0 @@
1
- import {
2
- installCommand,
3
- nextStepAfterInstall,
4
- performInstall,
5
- printInstallEpilogue
6
- } from "./chunk-YRBRYTM5.js";
7
- import "./chunk-WHBGJ7IJ.js";
8
- import "./chunk-HS7LVVLO.js";
9
- import "./chunk-BCU54M2P.js";
10
- import "./chunk-XZQM55BK.js";
11
- import "./chunk-HAFRAXGV.js";
12
- import "./chunk-MGIPA6SD.js";
13
- import "./chunk-2FKAKFMH.js";
14
- import "./chunk-WGLPZXNU.js";
15
- import "./chunk-Q35TWISF.js";
16
- import "./chunk-QTON2GQX.js";
17
- import "./chunk-PNFF6OU3.js";
18
- import "./chunk-R4DUO5DA.js";
19
- import "./chunk-F6C3GFKV.js";
20
- import "./chunk-ZB43YMHW.js";
21
- import "./chunk-SDJIMC5S.js";
22
- import "./chunk-B3VR5YBQ.js";
23
- import "./chunk-5HH3HSUR.js";
24
- import "./chunk-PFEUZXVT.js";
25
- import "./chunk-4SEQ76BQ.js";
26
- import "./chunk-ZNY32NK2.js";
27
- import "./chunk-WS6OX2IG.js";
28
- import "./chunk-LDZAK5DU.js";
29
- import "./chunk-ZJDJCMQO.js";
30
- import "./chunk-7HDQEK6T.js";
31
- import "./chunk-C4Q77GGJ.js";
32
- import "./chunk-5B4DVO6C.js";
33
- export {
34
- installCommand,
35
- nextStepAfterInstall,
36
- performInstall,
37
- printInstallEpilogue
38
- };
@@ -1,283 +0,0 @@
1
- import {
2
- NON_INTERACTIVE_ROOT_ARGS,
3
- detectStaleCli,
4
- formatRerunFlags,
5
- formatStaleCliRefusal,
6
- syncFromManifest
7
- } from "./chunk-WHBGJ7IJ.js";
8
- import {
9
- formatSkippedSymlinks,
10
- logApplyStats
11
- } from "./chunk-HS7LVVLO.js";
12
- import {
13
- REGISTRY_CLI_ARGS,
14
- resolveRegistryFromCli
15
- } from "./chunk-BCU54M2P.js";
16
- import {
17
- CLAUDE_SETTINGS_REL,
18
- formatClaudeSettingsDrift,
19
- formatPermissionsChanged,
20
- planClaudeSettingsDrift,
21
- writeClaudeSessionStartHook
22
- } from "./chunk-MGIPA6SD.js";
23
- import {
24
- generateClaudeCommandAdapters
25
- } from "./chunk-2FKAKFMH.js";
26
- import "./chunk-Q35TWISF.js";
27
- import {
28
- withCliProgress
29
- } from "./chunk-QTON2GQX.js";
30
- import {
31
- logger
32
- } from "./chunk-ZB43YMHW.js";
33
- import {
34
- RootRefusedError,
35
- confirmProjectRoot,
36
- isNonInteractive,
37
- syncPathCliToRuntime
38
- } from "./chunk-SDJIMC5S.js";
39
- import "./chunk-B3VR5YBQ.js";
40
- import {
41
- checkForUpdates
42
- } from "./chunk-5HH3HSUR.js";
43
- import "./chunk-PFEUZXVT.js";
44
- import "./chunk-4SEQ76BQ.js";
45
- import "./chunk-ZNY32NK2.js";
46
- import "./chunk-WS6OX2IG.js";
47
- import {
48
- buildManifest,
49
- isProtectedPath,
50
- loadAgentKitManifest,
51
- resolveProtectedGlobs,
52
- saveManifest
53
- } from "./chunk-LDZAK5DU.js";
54
- import {
55
- seedManagedHashLedger
56
- } from "./chunk-ZJDJCMQO.js";
57
- import {
58
- KIT_VERSION
59
- } from "./chunk-7HDQEK6T.js";
60
- import "./chunk-C4Q77GGJ.js";
61
- import "./chunk-5B4DVO6C.js";
62
-
63
- // src/commands/update.ts
64
- import { defineCommand } from "citty";
65
- var UPDATE_RERUN_FLAGS = [
66
- "claude",
67
- "yes",
68
- "force-root",
69
- "seed-overlay",
70
- "cwd",
71
- "registry",
72
- "url",
73
- "ref",
74
- "refresh"
75
- ];
76
- var updateCommand = defineCommand({
77
- meta: {
78
- name: "update",
79
- description: "Re-apply L0/packs/skills from the registry (never overwrites L3). --check = notify-only."
80
- },
81
- args: {
82
- cwd: {
83
- type: "string",
84
- default: process.cwd()
85
- },
86
- check: {
87
- type: "boolean",
88
- description: "Check-only: compare installed version to the resolved registry (public tags, or --registry local checkout); never apply L0 writes",
89
- default: false
90
- },
91
- json: {
92
- type: "boolean",
93
- description: "Print machine-readable JSON (with --check)",
94
- default: false
95
- },
96
- "respect-prefs": {
97
- type: "boolean",
98
- description: "Honor updateCheck.enabled and intervalDays from .cursor/context/config.json (hooks)",
99
- default: false
100
- },
101
- stamp: {
102
- type: "boolean",
103
- description: "Persist updateCheck.lastCheckedAt after a network check",
104
- default: false
105
- },
106
- "seed-overlay": {
107
- type: "boolean",
108
- description: "Seed the managed-hash ledger from current local overlay files before applying (factory/dogfood only; consumers should not use this)",
109
- default: false
110
- },
111
- "allow-stale-cli": {
112
- type: "boolean",
113
- 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)",
114
- default: false
115
- },
116
- claude: {
117
- type: "boolean",
118
- 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",
119
- default: false
120
- },
121
- ...NON_INTERACTIVE_ROOT_ARGS,
122
- ...REGISTRY_CLI_ARGS
123
- },
124
- async run({ args }) {
125
- if (args.check) {
126
- const result = await checkForUpdates(args.cwd, {
127
- respectPrefs: Boolean(args["respect-prefs"]),
128
- stamp: Boolean(args.stamp),
129
- publicRegistryUrl: typeof args.url === "string" && args.url ? args.url : void 0,
130
- registryPath: typeof args.registry === "string" && args.registry ? args.registry : void 0
131
- });
132
- if (args.json) {
133
- console.log(JSON.stringify(result, null, 2));
134
- } else {
135
- const line = `[${result.status}] ${result.message}`;
136
- if (result.status === "error") logger.error(line);
137
- else if (result.status === "update-available") logger.warn(line);
138
- else if (result.status.startsWith("skipped-")) logger.warn(line);
139
- else logger.info(line);
140
- }
141
- if (result.status === "error") process.exitCode = 2;
142
- return;
143
- }
144
- const nonInteractive = args.yes || isNonInteractive();
145
- let projectRoot;
146
- try {
147
- projectRoot = await confirmProjectRoot(args.cwd, {
148
- nonInteractive,
149
- command: "update",
150
- forceRoot: args["force-root"]
151
- });
152
- } catch (err) {
153
- if (err instanceof RootRefusedError) {
154
- logger.error(err.message);
155
- if (err.recovery) console.error(`
156
- ${err.recovery}
157
- `);
158
- process.exitCode = 1;
159
- return;
160
- }
161
- throw err;
162
- }
163
- const existing = await loadAgentKitManifest(projectRoot, { onWarning: logger.warn });
164
- if (!existing) {
165
- logger.warn("No .cursor/agent-kit.json \u2014 run agent-kit install first.");
166
- return;
167
- }
168
- const registry = await resolveRegistryFromCli({
169
- cwd: projectRoot,
170
- registry: args.registry,
171
- url: args.url,
172
- ref: args.ref,
173
- refresh: args.refresh,
174
- manifest: existing
175
- });
176
- try {
177
- logger.info(`Registry: ${registry.root} (${registry.source})`);
178
- const stale = await detectStaleCli(registry.root, { warn: logger.warn });
179
- if (stale && !args["allow-stale-cli"]) {
180
- const refusal = formatStaleCliRefusal({
181
- command: "update",
182
- stale,
183
- rerun: formatRerunFlags(args, UPDATE_RERUN_FLAGS)
184
- });
185
- logger.error(refusal.error);
186
- console.error(refusal.recovery);
187
- process.exitCode = 1;
188
- return;
189
- }
190
- const next = buildManifest({
191
- version: KIT_VERSION,
192
- profile: existing.profile,
193
- packs: existing.packs,
194
- skills: existing.skills,
195
- protected: existing.protected,
196
- // Restamp generatorVersion with the CLI that ran this apply so the two
197
- // version fields in the manifest stop disagreeing after an update. The
198
- // personalization result file itself is not regenerated here.
199
- personalization: existing.personalization ? { ...existing.personalization, generatorVersion: KIT_VERSION } : void 0,
200
- registryUrl: registry.url ?? existing.registry?.url,
201
- registryRef: registry.ref ?? existing.registry?.ref
202
- });
203
- if (existing.overrides?.length) next.overrides = existing.overrides;
204
- if (existing.unknownFields) next.unknownFields = existing.unknownFields;
205
- if (next.version === existing.version && existing.installedAt) {
206
- next.installedAt = existing.installedAt;
207
- }
208
- if (args["seed-overlay"]) {
209
- await seedManagedHashLedger(projectRoot);
210
- logger.info("Seeded managed-hash ledger from current local overlay files.");
211
- }
212
- const stats = await withCliProgress(
213
- "update",
214
- () => syncFromManifest(registry.root, projectRoot, next)
215
- );
216
- if (stats.skippedSymlink.length > 0) {
217
- logApplyStats(stats);
218
- logger.error(formatSkippedSymlinks(stats.skippedSymlink));
219
- process.exitCode = 1;
220
- return;
221
- }
222
- if (args.claude) {
223
- const claude = await writeClaudeSessionStartHook(projectRoot, { authorized: true });
224
- if (claude.status === "skipped-symlink") {
225
- logApplyStats(stats);
226
- logger.error(
227
- `Claude settings not written: ${CLAUDE_SETTINGS_REL}, .claude/ or the ledger resolves outside the project (symlink). Nothing was changed there.`
228
- );
229
- process.exitCode = 1;
230
- return;
231
- }
232
- if (claude.status === "unavailable") {
233
- logger.warn(claude.instructions ?? `${CLAUDE_SETTINGS_REL} could not be merged.`);
234
- } else {
235
- console.log(`Claude settings ${claude.status}: ${claude.relativePath}`);
236
- const changed = formatPermissionsChanged(claude.permissionChanges ?? [], {
237
- mergeAllowWithoutGuard: claude.mergeAllowWithoutGuard ?? []
238
- });
239
- for (const line of changed) console.log(line);
240
- }
241
- const adapters = await generateClaudeCommandAdapters(projectRoot);
242
- const skipped = adapters.filter((a) => a.status === "skipped-symlink");
243
- if (skipped.length > 0) {
244
- logApplyStats(stats);
245
- logger.error(
246
- `Claude command adapters not written for: ${skipped.map((a) => a.relativePath).join(", ")} (symlink outside the project). Nothing was changed there.`
247
- );
248
- process.exitCode = 1;
249
- return;
250
- }
251
- if (adapters.length > 0) console.log(formatClaudeAdapterSummary(adapters));
252
- } else {
253
- const drift = await planClaudeSettingsDrift(projectRoot);
254
- if (drift) {
255
- const protectedPath = isProtectedPath(CLAUDE_SETTINGS_REL, resolveProtectedGlobs(next));
256
- for (const line of formatClaudeSettingsDrift(drift, { protectedPath })) console.log(line);
257
- }
258
- }
259
- await saveManifest(projectRoot, next);
260
- logApplyStats(stats);
261
- const transition = next.version === existing.version ? `unchanged at v${next.version}` : `v${existing.version} \u2192 v${next.version}`;
262
- logger.success(`Update complete: ${transition} (L3 protected paths left untouched).`);
263
- const sync = await syncPathCliToRuntime({ runtimeVersion: KIT_VERSION });
264
- for (const line of sync.lines) console.log(line);
265
- } finally {
266
- await registry.unlock?.();
267
- }
268
- }
269
- });
270
- function formatClaudeAdapterSummary(results) {
271
- const count = (status) => results.filter((r) => r.status === status).length;
272
- const parts = [
273
- `${count("applied")} written`,
274
- `${count("refreshed")} refreshed`,
275
- `${count("unchanged")} unchanged`
276
- ];
277
- const customized = count("preserved-customized");
278
- if (customized > 0) parts.push(`${customized} preserved (customized)`);
279
- return `Claude command adapters: ${parts.join(", ")} (.claude/commands/)`;
280
- }
281
- export {
282
- updateCommand
283
- };