@dadado/agent-kit-cli 6.23.0 → 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 (65) 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-RKZQX6ZK.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-2IP4OO6R.js → chunk-2XLI7XEY.js} +1 -1
  10. package/dist/chunk-6M6UKECW.js +176 -0
  11. package/dist/{chunk-UJCATSYO.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-7TYA3GMI.js → chunk-C7SV7UP5.js} +7 -4
  15. package/dist/{chunk-F7YAAKYP.js → chunk-CIV42JGT.js} +7 -5
  16. package/dist/{chunk-CQHD6UKB.js → chunk-CXE6ASSX.js} +1 -0
  17. package/dist/{chunk-6BEFGKCU.js → chunk-EO5NGAYV.js} +1 -1
  18. package/dist/{chunk-MJJBIOSY.js → chunk-G5MQRP6M.js} +31 -13
  19. package/dist/chunk-GMG7ZH4E.js +357 -0
  20. package/dist/{chunk-5EBT3V7G.js → chunk-GQSSXDDK.js} +1 -1
  21. package/dist/{chunk-5LNHRL5E.js → chunk-H7RAFRRZ.js} +41 -245
  22. package/dist/{chunk-IESSMKOV.js → chunk-HSIHZWFF.js} +4 -4
  23. package/dist/{chunk-W3ZJVBNY.js → chunk-IFBIO7VT.js} +449 -418
  24. package/dist/{chunk-V2H57TFD.js → chunk-JG3CNGQM.js} +78 -170
  25. package/dist/{chunk-KDJ4ML7I.js → chunk-JGG574RK.js} +3 -3
  26. package/dist/{chunk-SGTTC2JP.js → chunk-KWYF7QNH.js} +1 -1
  27. package/dist/{chunk-CVZNSRXV.js → chunk-M4UL422I.js} +80 -15
  28. package/dist/{chunk-AWQ6KRFV.js → chunk-NJ2SUSWX.js} +1 -1
  29. package/dist/{chunk-DRZFWIBN.js → chunk-PIMGV3E5.js} +1 -1
  30. package/dist/{chunk-QNISTPPZ.js → chunk-QACMV46U.js} +3 -3
  31. package/dist/{chunk-5PSV76CQ.js → chunk-QLTGHJB3.js} +25 -6
  32. package/dist/{chunk-OYFCBYMP.js → chunk-QX55T4UX.js} +13 -1
  33. package/dist/chunk-SAQ3EE5R.js +138 -0
  34. package/dist/{chunk-C4LCOOL4.js → chunk-TOSAAQ5A.js} +1 -1
  35. package/dist/chunk-WKFE3RUC.js +433 -0
  36. package/dist/{chunk-BGL5DRK2.js → chunk-XGZOU4DS.js} +1 -1
  37. package/dist/{commands-SAQEEE6V.js → commands-UW2C2ZN4.js} +4 -4
  38. package/dist/{conflicts-5JOP4GX2.js → conflicts-RING6AHV.js} +6 -6
  39. package/dist/{contribute-BQKRT5GN.js → contribute-LSY75JZH.js} +5 -4
  40. package/dist/{countdown-25E5C7AR.js → countdown-SZ2P4XHB.js} +267 -23
  41. package/dist/{diff-6JSXBVSX.js → diff-NZVBVQSK.js} +13 -5
  42. package/dist/{doctor-I3MTHS7F.js → doctor-TJSXBVGV.js} +103 -17
  43. package/dist/{ground-control-IDCXN5FK.js → ground-control-ZJXPUIQN.js} +3 -3
  44. package/dist/{guard-RJZEEKSL.js → guard-ZO4Z3LLB.js} +47 -9
  45. package/dist/{handoff-5AGE2D3T.js → handoff-2OZSWGTE.js} +2 -0
  46. package/dist/{hook-WNA42CXE.js → hook-3VPKNSOO.js} +12 -10
  47. package/dist/index.js +27 -26
  48. package/dist/{init-FZ2UFPO7.js → init-UW2BJBO2.js} +21 -15
  49. package/dist/{install-CTLT3TSI.js → install-RQSI4CHG.js} +18 -15
  50. package/dist/installs-7TR4H4QH.js +222 -0
  51. package/dist/{mission-control-CRMCRZUU.js → mission-control-VSU6NT43.js} +1 -1
  52. package/dist/{queue-JW4VR33H.js → queue-JHYILLMX.js} +9 -9
  53. package/dist/{run-X2WOONTB.js → run-CQF5RM5X.js} +21 -21
  54. package/dist/{run-plan-4MOLLIES.js → run-plan-BEOCOJCF.js} +13 -13
  55. package/dist/{scan-K3T5RQLC.js → scan-7D3RMO34.js} +2 -1
  56. package/dist/{session-start-MV7A4263.js → session-start-QV7CEFRX.js} +16 -10
  57. package/dist/{sessions-UPFDWDMB.js → sessions-AWAAO3DU.js} +1 -1
  58. package/dist/{setup-global-VNADNTQ2.js → setup-global-ST4TT427.js} +8 -7
  59. package/dist/{status-SXA3OK5E.js → status-HUBPBGUU.js} +13 -10
  60. package/dist/update-DD5UZPGG.js +31 -0
  61. package/dist/update-all-YYUTXHGR.js +695 -0
  62. package/package.json +1 -1
  63. package/dist/chunk-4MR4QXMF.js +0 -52
  64. package/dist/chunk-HAFRAXGV.js +0 -17
  65. package/dist/update-RMAWXMCV.js +0 -304
@@ -1,6 +1,11 @@
1
1
  import {
2
2
  CI_PLATFORM_FILES
3
3
  } from "./chunk-F6C3GFKV.js";
4
+ import {
5
+ REPOSITORY_PROFILE_REL,
6
+ detectGit,
7
+ listTrackedFiles
8
+ } from "./chunk-2QYWMSI5.js";
4
9
  import {
5
10
  fileExists,
6
11
  listDirectory,
@@ -8,195 +13,14 @@ import {
8
13
  } from "./chunk-5B4DVO6C.js";
9
14
 
10
15
  // src/scanner/scan.ts
11
- import path7 from "path";
12
-
13
- // src/scanner/detect-git.ts
14
- import { execFile } from "child_process";
15
- import path from "path";
16
- import { promisify } from "util";
17
-
18
- // src/scanner/paths.ts
19
- var REPOSITORY_PROFILE_REL = ".cursor/agent-kit.config.json";
20
-
21
- // src/scanner/detect-git.ts
22
- var exec = promisify(execFile);
23
- function remoteHostname(remoteUrl) {
24
- const scpMatch = remoteUrl.match(/^[^@]+@([^:]+):/);
25
- if (scpMatch?.[1]) return scpMatch[1].toLowerCase();
26
- try {
27
- return new URL(remoteUrl).hostname.toLowerCase();
28
- } catch {
29
- return void 0;
30
- }
31
- }
32
- function sanitizeRemoteUrl(remoteUrl) {
33
- try {
34
- const parsed = new URL(remoteUrl);
35
- parsed.username = "";
36
- parsed.password = "";
37
- return parsed.toString();
38
- } catch {
39
- return remoteUrl;
40
- }
41
- }
42
- async function detectProvider(rootDir, remoteUrl) {
43
- const configuration = await readJson(
44
- path.join(rootDir, REPOSITORY_PROFILE_REL)
45
- );
46
- const configuredProvider = configuration?.git?.provider;
47
- if (configuredProvider) {
48
- const configuredKind = configuration.git?.providerKind ?? (configuredProvider === "github" ? "github" : configuredProvider === "gitlab" ? remoteUrl && remoteHostname(remoteUrl) === "gitlab.com" ? "gitlab-saas" : "gitlab-self-hosted" : configuredProvider === "other" ? "custom" : "known-other");
49
- return {
50
- provider: configuredProvider,
51
- providerKind: configuredKind,
52
- confidence: "high",
53
- evidence: [{ source: "configuration", value: `${REPOSITORY_PROFILE_REL}#git.provider` }]
54
- };
55
- }
56
- if (!remoteUrl) {
57
- return { providerKind: "unknown", confidence: "low", evidence: [] };
58
- }
59
- const hostname = remoteHostname(remoteUrl);
60
- const remoteEvidence = [{ source: "git", value: `remote:${remoteUrl}` }];
61
- if (hostname === "github.com") {
62
- return {
63
- provider: "github",
64
- providerKind: "github",
65
- confidence: "high",
66
- evidence: remoteEvidence
67
- };
68
- }
69
- if (hostname === "gitlab.com") {
70
- return {
71
- provider: "gitlab",
72
- providerKind: "gitlab-saas",
73
- confidence: "high",
74
- evidence: remoteEvidence
75
- };
76
- }
77
- if (hostname === "bitbucket.org") {
78
- return {
79
- provider: "bitbucket",
80
- providerKind: "known-other",
81
- confidence: "high",
82
- evidence: remoteEvidence
83
- };
84
- }
85
- if (hostname === "dev.azure.com" || hostname?.endsWith(".visualstudio.com")) {
86
- return {
87
- provider: "azure-devops",
88
- providerKind: "known-other",
89
- confidence: "high",
90
- evidence: remoteEvidence
91
- };
92
- }
93
- if (hostname === "codeberg.org") {
94
- return {
95
- provider: "gitea",
96
- providerKind: "known-other",
97
- confidence: "high",
98
- evidence: remoteEvidence
99
- };
100
- }
101
- if (await fileExists(path.join(rootDir, ".gitlab-ci.yml"))) {
102
- return {
103
- provider: "gitlab",
104
- providerKind: "gitlab-self-hosted",
105
- confidence: "medium",
106
- evidence: [...remoteEvidence, { source: "file", value: ".gitlab-ci.yml" }]
107
- };
108
- }
109
- return {
110
- provider: "other",
111
- providerKind: hostname ? "custom" : "unknown",
112
- confidence: "low",
113
- evidence: remoteEvidence
114
- };
115
- }
116
- function inferWorkflow(currentBranch, hasLocalStaging, hasRemoteStaging) {
117
- if (hasLocalStaging || hasRemoteStaging) return "homolog-prod";
118
- if (!currentBranch) return "unknown";
119
- if (currentBranch === "main" || currentBranch === "master") return "feature-pr";
120
- if (currentBranch.includes("develop") || currentBranch.includes("release")) return "gitflow";
121
- if (currentBranch.includes("staging") || currentBranch.includes("homolog")) return "homolog-prod";
122
- return "feature-pr";
123
- }
124
- var GIT_MAX_BUFFER = 64 * 1024 * 1024;
125
- async function runGit(args, rootDir) {
126
- try {
127
- const { stdout } = await exec("git", args, { cwd: rootDir, maxBuffer: GIT_MAX_BUFFER });
128
- return stdout.trim();
129
- } catch {
130
- return void 0;
131
- }
132
- }
133
- async function listTrackedFiles(rootDir) {
134
- return (await runGit(["ls-files"], rootDir))?.split("\n").filter(Boolean);
135
- }
136
- async function detectGitDirty(rootDir) {
137
- return Boolean(await runGit(["status", "--porcelain"], rootDir));
138
- }
139
- async function detectGit(rootDir) {
140
- const isGit = await runGit(["rev-parse", "--is-inside-work-tree"], rootDir) === "true";
141
- if (!isGit) {
142
- return {
143
- providerKind: "unknown",
144
- providerConfidence: "low",
145
- providerEvidence: [],
146
- remotes: [],
147
- mode: "none",
148
- workflow: "unknown",
149
- isDirty: false,
150
- hasLocalStaging: false,
151
- hasRemoteStaging: false
152
- };
153
- }
154
- const remoteNames = (await runGit(["remote"], rootDir))?.split("\n").filter(Boolean) ?? [];
155
- const remotes = (await Promise.all(
156
- remoteNames.map(async (name) => {
157
- const url = await runGit(["remote", "get-url", name], rootDir);
158
- return url ? { name, url: sanitizeRemoteUrl(url) } : void 0;
159
- })
160
- )).filter((remote) => remote !== void 0);
161
- const primary = remotes.find((remote) => remote.name === "origin") ?? remotes[0];
162
- const remoteUrl = primary?.url;
163
- const [currentBranch, remoteHead, localBranchOutput, remoteBranchOutput, status, provider] = await Promise.all([
164
- runGit(["branch", "--show-current"], rootDir),
165
- primary ? runGit(["symbolic-ref", "--short", `refs/remotes/${primary.name}/HEAD`], rootDir) : Promise.resolve(void 0),
166
- runGit(["for-each-ref", "--format=%(refname:short)", "refs/heads"], rootDir),
167
- runGit(["for-each-ref", "--format=%(refname:short)", "refs/remotes"], rootDir),
168
- runGit(["status", "--porcelain"], rootDir),
169
- detectProvider(rootDir, remoteUrl)
170
- ]);
171
- const localBranches = localBranchOutput?.split("\n").filter(Boolean);
172
- const remoteBranches = remoteBranchOutput?.split("\n").filter(Boolean);
173
- const defaultBranch = remoteHead?.split("/").slice(1).join("/") || (localBranches?.includes("main") ? "main" : localBranches?.includes("master") ? "master" : void 0);
174
- const hasLocalStaging = localBranches?.includes("staging") ?? false;
175
- const hasRemoteStaging = remoteBranches?.some((branch) => remoteNames.some((r) => branch === `${r}/staging`)) ?? false;
176
- return {
177
- provider: provider.provider,
178
- providerKind: provider.providerKind,
179
- providerConfidence: provider.confidence,
180
- providerEvidence: provider.evidence,
181
- remoteUrl,
182
- remoteName: primary?.name,
183
- remotes,
184
- mode: remotes.length > 0 ? "remote-hosted" : "local-only",
185
- currentBranch,
186
- defaultBranch,
187
- isDirty: Boolean(status),
188
- hasLocalStaging,
189
- hasRemoteStaging,
190
- workflow: inferWorkflow(currentBranch, hasLocalStaging, hasRemoteStaging)
191
- };
192
- }
16
+ import path6 from "path";
193
17
 
194
18
  // src/scanner/detect-ide.ts
195
- import path2 from "path";
19
+ import path from "path";
196
20
  async function detectIde(rootDir) {
197
- const hasCursor = await fileExists(path2.join(rootDir, ".cursor"));
198
- const hasVSCode = await fileExists(path2.join(rootDir, ".vscode"));
199
- const hasWindsurf = await fileExists(path2.join(rootDir, ".windsurfrules"));
21
+ const hasCursor = await fileExists(path.join(rootDir, ".cursor"));
22
+ const hasVSCode = await fileExists(path.join(rootDir, ".vscode"));
23
+ const hasWindsurf = await fileExists(path.join(rootDir, ".windsurfrules"));
200
24
  if (hasCursor) return { ide: "cursor", plan: "cursor-pro" };
201
25
  if (hasVSCode) return { ide: "vscode", plan: "vscode-pro" };
202
26
  if (hasWindsurf) return { ide: "windsurf", plan: "windsurf" };
@@ -205,7 +29,7 @@ async function detectIde(rootDir) {
205
29
 
206
30
  // src/scanner/detect-infra.ts
207
31
  import { readdir, readFile } from "fs/promises";
208
- import path3 from "path";
32
+ import path2 from "path";
209
33
  function extractRunCommands(yaml) {
210
34
  const lines = yaml.split(/\r?\n/);
211
35
  const commands = [];
@@ -231,7 +55,7 @@ function extractRunCommands(yaml) {
231
55
  return Array.from(new Set(commands));
232
56
  }
233
57
  async function detectCiRunCommands(rootDir) {
234
- const workflowsDir = path3.join(rootDir, ".github", "workflows");
58
+ const workflowsDir = path2.join(rootDir, ".github", "workflows");
235
59
  if (!await fileExists(workflowsDir)) return [];
236
60
  let entries;
237
61
  try {
@@ -243,7 +67,7 @@ async function detectCiRunCommands(rootDir) {
243
67
  const perFile = await Promise.all(
244
68
  workflowFiles.map(async (name) => {
245
69
  try {
246
- return extractRunCommands(await readFile(path3.join(workflowsDir, name), "utf8"));
70
+ return extractRunCommands(await readFile(path2.join(workflowsDir, name), "utf8"));
247
71
  } catch {
248
72
  return [];
249
73
  }
@@ -252,12 +76,12 @@ async function detectCiRunCommands(rootDir) {
252
76
  return Array.from(new Set(perFile.flat()));
253
77
  }
254
78
  async function detectInfra(rootDir) {
255
- const docker = await fileExists(path3.join(rootDir, "Dockerfile")) || await fileExists(path3.join(rootDir, "docker-compose.yml")) || await fileExists(path3.join(rootDir, "docker-compose.yaml"));
256
- const kubernetes = await fileExists(path3.join(rootDir, "k8s")) || await fileExists(path3.join(rootDir, "kubernetes"));
79
+ const docker = await fileExists(path2.join(rootDir, "Dockerfile")) || await fileExists(path2.join(rootDir, "docker-compose.yml")) || await fileExists(path2.join(rootDir, "docker-compose.yaml"));
80
+ const kubernetes = await fileExists(path2.join(rootDir, "k8s")) || await fileExists(path2.join(rootDir, "kubernetes"));
257
81
  let ci = "none";
258
82
  const ciFiles = [];
259
83
  for (const [platform, filePath] of Object.entries(CI_PLATFORM_FILES)) {
260
- if (await fileExists(path3.join(rootDir, filePath))) {
84
+ if (await fileExists(path2.join(rootDir, filePath))) {
261
85
  if (ci === "none") ci = platform;
262
86
  ciFiles.push(filePath);
263
87
  }
@@ -282,12 +106,12 @@ async function detectInfra(rootDir) {
282
106
  ];
283
107
  const infrastructureFiles = (await Promise.all(
284
108
  infrastructureCandidates.map(
285
- async (file) => await fileExists(path3.join(rootDir, file)) ? file : void 0
109
+ async (file) => await fileExists(path2.join(rootDir, file)) ? file : void 0
286
110
  )
287
111
  )).filter((file) => file !== void 0);
288
112
  const deploymentFiles = (await Promise.all(
289
113
  deploymentCandidates.map(
290
- async (file) => await fileExists(path3.join(rootDir, file)) ? file : void 0
114
+ async (file) => await fileExists(path2.join(rootDir, file)) ? file : void 0
291
115
  )
292
116
  )).filter((file) => file !== void 0);
293
117
  const ciRunCommands = ci === "github-actions" ? await detectCiRunCommands(rootDir) : [];
@@ -296,7 +120,7 @@ async function detectInfra(rootDir) {
296
120
 
297
121
  // src/scanner/detect-repository.ts
298
122
  import { readFile as readFile2 } from "fs/promises";
299
- import path4 from "path";
123
+ import path3 from "path";
300
124
  var CONTEXT_PATHS = [
301
125
  ["README.md", "README"],
302
126
  ["README", "README"],
@@ -315,7 +139,7 @@ var CONTEXT_PATHS = [
315
139
  async function existingEvidence(rootDir, candidates) {
316
140
  const evidence = await Promise.all(
317
141
  candidates.map(
318
- async ([relativePath, label]) => await fileExists(path4.join(rootDir, relativePath)) ? { source: "file", value: `${relativePath}:${label}` } : void 0
142
+ async ([relativePath, label]) => await fileExists(path3.join(rootDir, relativePath)) ? { source: "file", value: `${relativePath}:${label}` } : void 0
319
143
  )
320
144
  );
321
145
  return evidence.flatMap((item) => item ? [item] : []);
@@ -349,7 +173,7 @@ function isRepositoryPurpose(value) {
349
173
  }
350
174
  async function readConfirmedPurpose(rootDir) {
351
175
  const configuration = await readJson(
352
- path4.join(rootDir, REPOSITORY_PROFILE_REL)
176
+ path3.join(rootDir, REPOSITORY_PROFILE_REL)
353
177
  );
354
178
  const configuredPurpose = configuration?.purpose;
355
179
  if (!configuredPurpose || !isRepositoryPurpose(configuredPurpose.value) || configuredPurpose.value === "unknown") {
@@ -369,7 +193,7 @@ async function detectPurpose(rootDir, stack) {
369
193
  if (confirmed) return confirmed;
370
194
  const entries = await listDirectory(rootDir);
371
195
  const lowerEntries = entries.map((entry) => entry.toLowerCase());
372
- const packageJson = await readJson(path4.join(rootDir, "package.json"));
196
+ const packageJson = await readJson(path3.join(rootDir, "package.json"));
373
197
  const categories = [];
374
198
  const evidence = [];
375
199
  const add = (category, value2) => {
@@ -409,16 +233,16 @@ async function detectPurpose(rootDir, stack) {
409
233
  }
410
234
  async function detectAgentKit(rootDir) {
411
235
  const manifestRelativePath = ".cursor/agent-kit.json";
412
- const manifestPath = path4.join(rootDir, manifestRelativePath);
236
+ const manifestPath = path3.join(rootDir, manifestRelativePath);
413
237
  const installed = await fileExists(manifestPath);
414
238
  const manifest = installed ? await readJson(manifestPath) : null;
415
239
  return {
416
240
  installed,
417
241
  manifestPath: installed ? manifestRelativePath : void 0,
418
242
  version: manifest?.version,
419
- hasPlans: await fileExists(path4.join(rootDir, ".cursor/plans")),
420
- hasHandoff: await fileExists(path4.join(rootDir, ".cursor/HANDOFF.md")),
421
- hasMemory: await fileExists(path4.join(rootDir, ".cursor/memory"))
243
+ hasPlans: await fileExists(path3.join(rootDir, ".cursor/plans")),
244
+ hasHandoff: await fileExists(path3.join(rootDir, ".cursor/HANDOFF.md")),
245
+ hasMemory: await fileExists(path3.join(rootDir, ".cursor/memory"))
422
246
  };
423
247
  }
424
248
  var REQUIRED_SECRET_PATTERNS = [
@@ -435,12 +259,14 @@ var KIT_OWNED_IGNORE_PATTERNS = [
435
259
  ".cursor/HANDOFF.md",
436
260
  ".cursor/dogfood/",
437
261
  ".cursor/context/readiness.json",
262
+ ".cursor/context/install-health.json",
438
263
  ".cursor/context/flight-log.json",
439
264
  ".cursor/context/mission-timing.json",
440
265
  ".cursor/context/outcome-ledger.json",
441
266
  ".cursor/context/test-results.json",
442
267
  ".cursor/context/gate-exit.json",
443
268
  ".cursor/context/review-ledger.json",
269
+ ".cursor/context/cost-ledger.ndjson",
444
270
  ".cursor/context/plan-index.json",
445
271
  ".cursor/context/run-plan-all.lock",
446
272
  ".cursor/loop-logs/"
@@ -457,7 +283,7 @@ function isTrackedSecretFile(file) {
457
283
  return SECRET_FILE_MATCHERS.some((matcher) => matcher.test(base));
458
284
  }
459
285
  async function detectSafety(rootDir, trackedFiles) {
460
- const gitignorePath = path4.join(rootDir, ".gitignore");
286
+ const gitignorePath = path3.join(rootDir, ".gitignore");
461
287
  const hasGitignore = await fileExists(gitignorePath);
462
288
  const gitignore = hasGitignore ? await readFile2(gitignorePath, "utf8") : "";
463
289
  const lines = gitignore.split(/\r?\n/).map((line) => line.trim()).filter((line) => line && !line.startsWith("#"));
@@ -466,7 +292,7 @@ async function detectSafety(rootDir, trackedFiles) {
466
292
  );
467
293
  const trackedSensitiveFiles = (trackedFiles ?? []).filter(isTrackedSecretFile);
468
294
  const hookPaths = [".husky", ".git/hooks/pre-commit", "git-hooks/pre-commit"];
469
- const hasHooks = (await Promise.all(hookPaths.map((item) => fileExists(path4.join(rootDir, item))))).some(Boolean);
295
+ const hasHooks = (await Promise.all(hookPaths.map((item) => fileExists(path3.join(rootDir, item))))).some(Boolean);
470
296
  const guardCandidates = [
471
297
  ".husky/pre-commit",
472
298
  ".husky/pre-push",
@@ -475,7 +301,7 @@ async function detectSafety(rootDir, trackedFiles) {
475
301
  ];
476
302
  const guardContents = await Promise.all(
477
303
  guardCandidates.map(
478
- async (item) => await fileExists(path4.join(rootDir, item)) ? readFile2(path4.join(rootDir, item), "utf8") : ""
304
+ async (item) => await fileExists(path3.join(rootDir, item)) ? readFile2(path3.join(rootDir, item), "utf8") : ""
479
305
  )
480
306
  );
481
307
  return {
@@ -495,12 +321,12 @@ async function detectSafety(rootDir, trackedFiles) {
495
321
 
496
322
  // src/scanner/detect-services.ts
497
323
  import { readFile as readFile3 } from "fs/promises";
498
- import path5 from "path";
324
+ import path4 from "path";
499
325
  async function detectProjectManagement(rootDir) {
500
326
  const tools = [];
501
327
  const mcpConfigPaths = [
502
- path5.join(rootDir, ".cursor", "mcp.json"),
503
- path5.join(rootDir, "mcp.json")
328
+ path4.join(rootDir, ".cursor", "mcp.json"),
329
+ path4.join(rootDir, "mcp.json")
504
330
  ];
505
331
  for (const configPath of mcpConfigPaths) {
506
332
  if (!await fileExists(configPath)) continue;
@@ -516,20 +342,20 @@ async function detectProjectManagement(rootDir) {
516
342
  } catch {
517
343
  }
518
344
  }
519
- if (await fileExists(path5.join(rootDir, ".github", "ISSUE_TEMPLATE"))) {
345
+ if (await fileExists(path4.join(rootDir, ".github", "ISSUE_TEMPLATE"))) {
520
346
  tools.push("github-issues");
521
347
  }
522
- if (await fileExists(path5.join(rootDir, ".github", "projects"))) {
348
+ if (await fileExists(path4.join(rootDir, ".github", "projects"))) {
523
349
  tools.push("github-projects");
524
350
  }
525
351
  return [...new Set(tools)];
526
352
  }
527
353
  async function detectServices(rootDir) {
528
- const hasPrisma = await fileExists(path5.join(rootDir, "prisma/schema.prisma"));
529
- const hasSequelize = await fileExists(path5.join(rootDir, "sequelize"));
530
- const hasDrizzle = await fileExists(path5.join(rootDir, "drizzle.config.ts"));
531
- const hasKnex = await fileExists(path5.join(rootDir, "knexfile.ts"));
532
- const hasTypeorm = await fileExists(path5.join(rootDir, "ormconfig.json"));
354
+ const hasPrisma = await fileExists(path4.join(rootDir, "prisma/schema.prisma"));
355
+ const hasSequelize = await fileExists(path4.join(rootDir, "sequelize"));
356
+ const hasDrizzle = await fileExists(path4.join(rootDir, "drizzle.config.ts"));
357
+ const hasKnex = await fileExists(path4.join(rootDir, "knexfile.ts"));
358
+ const hasTypeorm = await fileExists(path4.join(rootDir, "ormconfig.json"));
533
359
  const database = hasPrisma || hasSequelize || hasDrizzle || hasKnex || hasTypeorm ? "postgresql" : void 0;
534
360
  const orm = hasPrisma ? "prisma" : hasDrizzle ? "drizzle" : hasSequelize ? "sequelize" : hasKnex ? "knex" : hasTypeorm ? "typeorm" : void 0;
535
361
  const projectManagement = await detectProjectManagement(rootDir);
@@ -542,7 +368,7 @@ async function detectServices(rootDir) {
542
368
 
543
369
  // src/scanner/detect-stack.ts
544
370
  import { readdir as readdir2, readFile as readFile4 } from "fs/promises";
545
- import path6 from "path";
371
+ import path5 from "path";
546
372
  var PROJECT_MARKERS = [
547
373
  "package.json",
548
374
  "requirements.txt",
@@ -568,7 +394,7 @@ async function scanSubdirectoryMarkers(rootDir) {
568
394
  const candidates = dirs.flatMap((dir) => PROJECT_MARKERS.map((marker) => ({ dir, marker })));
569
395
  const found = await Promise.all(
570
396
  candidates.map(async (candidate) => {
571
- const exists = await fileExists(path6.join(rootDir, candidate.dir, candidate.marker));
397
+ const exists = await fileExists(path5.join(rootDir, candidate.dir, candidate.marker));
572
398
  return exists ? candidate : null;
573
399
  })
574
400
  );
@@ -584,7 +410,7 @@ var DART_VALIDATION_COMMANDS = [
584
410
  async function detectDartFlavor(pubspecDir) {
585
411
  let content = "";
586
412
  try {
587
- content = await readFile4(path6.join(pubspecDir, "pubspec.yaml"), "utf8");
413
+ content = await readFile4(path5.join(pubspecDir, "pubspec.yaml"), "utf8");
588
414
  } catch {
589
415
  }
590
416
  return { isFlutter: isFlutterPubspec(content) };
@@ -597,7 +423,7 @@ async function detectStackFromSubdirHits(rootDir, hits) {
597
423
  const dartHits = hits.filter((hit) => hit.marker === "pubspec.yaml");
598
424
  if (dartHits.length > 0) {
599
425
  const flavors = await Promise.all(
600
- dartHits.map((hit) => detectDartFlavor(path6.join(rootDir, hit.dir)))
426
+ dartHits.map((hit) => detectDartFlavor(path5.join(rootDir, hit.dir)))
601
427
  );
602
428
  const testCommands = Array.from(
603
429
  new Set(flavors.map((flavor) => flavor.isFlutter ? "flutter test" : "dart test"))
@@ -614,8 +440,8 @@ async function detectStackFromSubdirHits(rootDir, hits) {
614
440
  }
615
441
  const nodeHit = hits.find((hit) => hit.marker === "package.json");
616
442
  if (nodeHit) {
617
- const subRoot = path6.join(rootDir, nodeHit.dir);
618
- const packageJson = await readJson(path6.join(subRoot, "package.json")) ?? {};
443
+ const subRoot = path5.join(rootDir, nodeHit.dir);
444
+ const packageJson = await readJson(path5.join(subRoot, "package.json")) ?? {};
619
445
  const scripts = packageJson.scripts ?? {};
620
446
  const packageManager = await detectPackageManager(subRoot, packageJson);
621
447
  const commands = commandsForScripts(scripts, packageManager.packageManager);
@@ -672,7 +498,7 @@ function isDetectionEvidenceArray(value) {
672
498
  }
673
499
  async function readConfirmedStack(rootDir) {
674
500
  const configuration = await readJson(
675
- path6.join(rootDir, REPOSITORY_PROFILE_REL)
501
+ path5.join(rootDir, REPOSITORY_PROFILE_REL)
676
502
  );
677
503
  const configured = configuration?.stack;
678
504
  const language = configured?.language;
@@ -715,7 +541,7 @@ async function detectPackageManager(rootDir, packageJson) {
715
541
  };
716
542
  }
717
543
  for (const [lockfile, packageManager] of LOCKFILES) {
718
- if (await fileExists(path6.join(rootDir, lockfile))) {
544
+ if (await fileExists(path5.join(rootDir, lockfile))) {
719
545
  return {
720
546
  packageManager,
721
547
  evidence: [{ source: "file", value: lockfile }]
@@ -734,33 +560,33 @@ function commandsForScripts(scripts, packageManager) {
734
560
  async function detectStack(rootDir) {
735
561
  const confirmed = await readConfirmedStack(rootDir);
736
562
  if (confirmed) return confirmed;
737
- const hasAnyProjectMarker = (await Promise.all(PROJECT_MARKERS.map((item) => fileExists(path6.join(rootDir, item))))).some(Boolean);
563
+ const hasAnyProjectMarker = (await Promise.all(PROJECT_MARKERS.map((item) => fileExists(path5.join(rootDir, item))))).some(Boolean);
738
564
  if (!hasAnyProjectMarker) {
739
565
  const subdirHits = await scanSubdirectoryMarkers(rootDir);
740
566
  if (subdirHits.length > 0) {
741
567
  return detectStackFromSubdirHits(rootDir, subdirHits);
742
568
  }
743
569
  }
744
- const hasPackageJson = await fileExists(path6.join(rootDir, "package.json"));
570
+ const hasPackageJson = await fileExists(path5.join(rootDir, "package.json"));
745
571
  if (hasPackageJson) {
746
- const packageJson = await readJson(path6.join(rootDir, "package.json")) ?? {};
572
+ const packageJson = await readJson(path5.join(rootDir, "package.json")) ?? {};
747
573
  const scripts = packageJson.scripts ?? {};
748
574
  const packageManager = await detectPackageManager(rootDir, packageJson);
749
575
  const commands = commandsForScripts(scripts, packageManager.packageManager);
750
- const hasNextConfig = await fileExists(path6.join(rootDir, "next.config.js")) || await fileExists(path6.join(rootDir, "next.config.mjs")) || await fileExists(path6.join(rootDir, "next.config.ts"));
751
- const hasNestConfig = await fileExists(path6.join(rootDir, "nest-cli.json"));
576
+ const hasNextConfig = await fileExists(path5.join(rootDir, "next.config.js")) || await fileExists(path5.join(rootDir, "next.config.mjs")) || await fileExists(path5.join(rootDir, "next.config.ts"));
577
+ const hasNestConfig = await fileExists(path5.join(rootDir, "nest-cli.json"));
752
578
  return {
753
579
  language: "node",
754
580
  framework: hasNextConfig ? "nextjs" : hasNestConfig ? "nestjs" : "node",
755
581
  packageManager: packageManager.packageManager,
756
582
  packageManagerEvidence: packageManager.evidence,
757
583
  scripts,
758
- workspaces: packageJson.workspaces !== void 0 || await fileExists(path6.join(rootDir, "pnpm-workspace.yaml")),
584
+ workspaces: packageJson.workspaces !== void 0 || await fileExists(path5.join(rootDir, "pnpm-workspace.yaml")),
759
585
  ...commands,
760
586
  hasProjectFiles: hasAnyProjectMarker
761
587
  };
762
588
  }
763
- if (await fileExists(path6.join(rootDir, "pyproject.toml"))) {
589
+ if (await fileExists(path5.join(rootDir, "pyproject.toml"))) {
764
590
  return {
765
591
  language: "python",
766
592
  framework: "python",
@@ -770,7 +596,7 @@ async function detectStack(rootDir) {
770
596
  hasProjectFiles: hasAnyProjectMarker
771
597
  };
772
598
  }
773
- if (await fileExists(path6.join(rootDir, "go.mod"))) {
599
+ if (await fileExists(path5.join(rootDir, "go.mod"))) {
774
600
  return {
775
601
  language: "go",
776
602
  framework: "go",
@@ -780,7 +606,7 @@ async function detectStack(rootDir) {
780
606
  hasProjectFiles: hasAnyProjectMarker
781
607
  };
782
608
  }
783
- if (await fileExists(path6.join(rootDir, "Cargo.toml"))) {
609
+ if (await fileExists(path5.join(rootDir, "Cargo.toml"))) {
784
610
  return {
785
611
  language: "rust",
786
612
  framework: "rust",
@@ -790,7 +616,7 @@ async function detectStack(rootDir) {
790
616
  hasProjectFiles: hasAnyProjectMarker
791
617
  };
792
618
  }
793
- if (await fileExists(path6.join(rootDir, "composer.json"))) {
619
+ if (await fileExists(path5.join(rootDir, "composer.json"))) {
794
620
  return {
795
621
  language: "php",
796
622
  framework: "php",
@@ -800,7 +626,7 @@ async function detectStack(rootDir) {
800
626
  hasProjectFiles: hasAnyProjectMarker
801
627
  };
802
628
  }
803
- if (await fileExists(path6.join(rootDir, "pubspec.yaml"))) {
629
+ if (await fileExists(path5.join(rootDir, "pubspec.yaml"))) {
804
630
  const { isFlutter } = await detectDartFlavor(rootDir);
805
631
  return {
806
632
  language: "dart",
@@ -834,7 +660,7 @@ function isGreenfieldByEntries(entries) {
834
660
  return meaningful.length === 0;
835
661
  }
836
662
  async function runScanner(rootDir) {
837
- const normalizedRoot = path7.resolve(rootDir);
663
+ const normalizedRoot = path6.resolve(rootDir);
838
664
  const entries = await listDirectory(normalizedRoot);
839
665
  const stack = await detectStack(normalizedRoot);
840
666
  const purpose = await detectPurpose(normalizedRoot, stack);
@@ -873,8 +699,6 @@ async function runScanner(rootDir) {
873
699
 
874
700
  export {
875
701
  detectIde,
876
- REPOSITORY_PROFILE_REL,
877
- detectGitDirty,
878
702
  REQUIRED_SECRET_PATTERNS,
879
703
  KIT_OWNED_IGNORE_PATTERNS,
880
704
  runScanner
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  managedPairs
3
- } from "./chunk-4MR4QXMF.js";
3
+ } from "./chunk-SAQ3EE5R.js";
4
4
  import {
5
5
  isProtectedPath,
6
6
  resolveProtectedGlobs
7
- } from "./chunk-V2H57TFD.js";
7
+ } from "./chunk-JG3CNGQM.js";
8
8
  import {
9
9
  resolveContained
10
- } from "./chunk-OYFCBYMP.js";
10
+ } from "./chunk-QX55T4UX.js";
11
11
 
12
12
  // src/lifecycle/diff.ts
13
13
  import { readFile } from "fs/promises";
@@ -57,10 +57,13 @@ async function diffAgainstRegistry(registryRoot, projectRoot, manifest) {
57
57
  await comparePair(registryRoot, projectRoot, sourceRel, targetRel, protectedGlobs)
58
58
  );
59
59
  };
60
- const { pairs, missingSkills } = await managedPairs(registryRoot, manifest);
60
+ const { pairs, missingSkills, missingPacks } = await managedPairs(registryRoot, manifest);
61
61
  for (const { sourceRel, targetRel } of pairs) {
62
62
  await pushUnique(sourceRel, targetRel);
63
63
  }
64
+ for (const id of missingPacks) {
65
+ entries.push({ path: `pack:${id}`, status: "missing-registry" });
66
+ }
64
67
  for (const id of missingSkills) {
65
68
  entries.push({ path: `skill:${id}`, status: "missing-registry" });
66
69
  }
@@ -4,11 +4,11 @@ import {
4
4
  RESOLVE_AGENT_KIT_REL,
5
5
  SESSION_START_HOOK_MARKER,
6
6
  mergeAllowRowsWithoutGuard
7
- } from "./chunk-AWQ6KRFV.js";
7
+ } from "./chunk-NJ2SUSWX.js";
8
8
  import {
9
9
  CLAUDE_COMMANDS_DIR_REL,
10
10
  discoverInstalledCommands
11
- } from "./chunk-6BEFGKCU.js";
11
+ } from "./chunk-EO5NGAYV.js";
12
12
  import {
13
13
  findOnPath
14
14
  } from "./chunk-WGLPZXNU.js";
@@ -17,11 +17,13 @@ import {
17
17
  } from "./chunk-PNFF6OU3.js";
18
18
  import {
19
19
  KIT_OWNED_IGNORE_PATTERNS,
20
- REPOSITORY_PROFILE_REL,
21
20
  REQUIRED_SECRET_PATTERNS,
22
- detectGitDirty,
23
21
  runScanner
24
- } from "./chunk-R4DUO5DA.js";
22
+ } from "./chunk-AXQMVQ6O.js";
23
+ import {
24
+ REPOSITORY_PROFILE_REL,
25
+ detectGitDirty
26
+ } from "./chunk-2QYWMSI5.js";
25
27
  import {
26
28
  CONTEXT_CONFIG_REL,
27
29
  contextConfigPath
@@ -38,6 +38,7 @@ var SNAPSHOT_REPO_SOURCE_RELS = Object.freeze([
38
38
  ".cursor/context/config.json",
39
39
  ".cursor/context/current",
40
40
  ".cursor/context/readiness.json",
41
+ ".cursor/context/install-health.json",
41
42
  ".cursor/context/field-report-dismissals.json",
42
43
  ".cursor/context/field-report-plan-verdicts.json",
43
44
  ".cursor/context/mission-timing.json",
@@ -5,7 +5,7 @@ import {
5
5
  resolveContained,
6
6
  saveManagedHashLedger,
7
7
  shouldPreserveCustomizedOverlay
8
- } from "./chunk-OYFCBYMP.js";
8
+ } from "./chunk-QX55T4UX.js";
9
9
  import {
10
10
  ensureDir,
11
11
  fileExists