@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
@@ -0,0 +1,193 @@
1
+ import {
2
+ fileExists,
3
+ readJson
4
+ } from "./chunk-5B4DVO6C.js";
5
+
6
+ // src/scanner/detect-git.ts
7
+ import { execFile } from "child_process";
8
+ import path from "path";
9
+ import { promisify } from "util";
10
+
11
+ // src/scanner/paths.ts
12
+ var REPOSITORY_PROFILE_REL = ".cursor/agent-kit.config.json";
13
+
14
+ // src/scanner/detect-git.ts
15
+ var exec = promisify(execFile);
16
+ function remoteHostname(remoteUrl) {
17
+ const scpMatch = remoteUrl.match(/^[^@]+@([^:]+):/);
18
+ if (scpMatch?.[1]) return scpMatch[1].toLowerCase();
19
+ try {
20
+ return new URL(remoteUrl).hostname.toLowerCase();
21
+ } catch {
22
+ return void 0;
23
+ }
24
+ }
25
+ function sanitizeRemoteUrl(remoteUrl) {
26
+ try {
27
+ const parsed = new URL(remoteUrl);
28
+ parsed.username = "";
29
+ parsed.password = "";
30
+ return parsed.toString();
31
+ } catch {
32
+ return remoteUrl;
33
+ }
34
+ }
35
+ async function detectProvider(rootDir, remoteUrl) {
36
+ const configuration = await readJson(
37
+ path.join(rootDir, REPOSITORY_PROFILE_REL)
38
+ );
39
+ const configuredProvider = configuration?.git?.provider;
40
+ if (configuredProvider) {
41
+ 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");
42
+ return {
43
+ provider: configuredProvider,
44
+ providerKind: configuredKind,
45
+ confidence: "high",
46
+ evidence: [{ source: "configuration", value: `${REPOSITORY_PROFILE_REL}#git.provider` }]
47
+ };
48
+ }
49
+ if (!remoteUrl) {
50
+ return { providerKind: "unknown", confidence: "low", evidence: [] };
51
+ }
52
+ const hostname = remoteHostname(remoteUrl);
53
+ const remoteEvidence = [{ source: "git", value: `remote:${remoteUrl}` }];
54
+ if (hostname === "github.com") {
55
+ return {
56
+ provider: "github",
57
+ providerKind: "github",
58
+ confidence: "high",
59
+ evidence: remoteEvidence
60
+ };
61
+ }
62
+ if (hostname === "gitlab.com") {
63
+ return {
64
+ provider: "gitlab",
65
+ providerKind: "gitlab-saas",
66
+ confidence: "high",
67
+ evidence: remoteEvidence
68
+ };
69
+ }
70
+ if (hostname === "bitbucket.org") {
71
+ return {
72
+ provider: "bitbucket",
73
+ providerKind: "known-other",
74
+ confidence: "high",
75
+ evidence: remoteEvidence
76
+ };
77
+ }
78
+ if (hostname === "dev.azure.com" || hostname?.endsWith(".visualstudio.com")) {
79
+ return {
80
+ provider: "azure-devops",
81
+ providerKind: "known-other",
82
+ confidence: "high",
83
+ evidence: remoteEvidence
84
+ };
85
+ }
86
+ if (hostname === "codeberg.org") {
87
+ return {
88
+ provider: "gitea",
89
+ providerKind: "known-other",
90
+ confidence: "high",
91
+ evidence: remoteEvidence
92
+ };
93
+ }
94
+ if (await fileExists(path.join(rootDir, ".gitlab-ci.yml"))) {
95
+ return {
96
+ provider: "gitlab",
97
+ providerKind: "gitlab-self-hosted",
98
+ confidence: "medium",
99
+ evidence: [...remoteEvidence, { source: "file", value: ".gitlab-ci.yml" }]
100
+ };
101
+ }
102
+ return {
103
+ provider: "other",
104
+ providerKind: hostname ? "custom" : "unknown",
105
+ confidence: "low",
106
+ evidence: remoteEvidence
107
+ };
108
+ }
109
+ function inferWorkflow(currentBranch, hasLocalStaging, hasRemoteStaging) {
110
+ if (hasLocalStaging || hasRemoteStaging) return "homolog-prod";
111
+ if (!currentBranch) return "unknown";
112
+ if (currentBranch === "main" || currentBranch === "master") return "feature-pr";
113
+ if (currentBranch.includes("develop") || currentBranch.includes("release")) return "gitflow";
114
+ if (currentBranch.includes("staging") || currentBranch.includes("homolog")) return "homolog-prod";
115
+ return "feature-pr";
116
+ }
117
+ var GIT_MAX_BUFFER = 64 * 1024 * 1024;
118
+ async function runGit(args, rootDir) {
119
+ try {
120
+ const { stdout } = await exec("git", args, { cwd: rootDir, maxBuffer: GIT_MAX_BUFFER });
121
+ return stdout.trim();
122
+ } catch {
123
+ return void 0;
124
+ }
125
+ }
126
+ async function listTrackedFiles(rootDir) {
127
+ return (await runGit(["ls-files"], rootDir))?.split("\n").filter(Boolean);
128
+ }
129
+ async function detectGitDirty(rootDir) {
130
+ return Boolean(await runGit(["status", "--porcelain"], rootDir));
131
+ }
132
+ async function detectGit(rootDir) {
133
+ const isGit = await runGit(["rev-parse", "--is-inside-work-tree"], rootDir) === "true";
134
+ if (!isGit) {
135
+ return {
136
+ providerKind: "unknown",
137
+ providerConfidence: "low",
138
+ providerEvidence: [],
139
+ remotes: [],
140
+ mode: "none",
141
+ workflow: "unknown",
142
+ isDirty: false,
143
+ hasLocalStaging: false,
144
+ hasRemoteStaging: false
145
+ };
146
+ }
147
+ const remoteNames = (await runGit(["remote"], rootDir))?.split("\n").filter(Boolean) ?? [];
148
+ const remotes = (await Promise.all(
149
+ remoteNames.map(async (name) => {
150
+ const url = await runGit(["remote", "get-url", name], rootDir);
151
+ return url ? { name, url: sanitizeRemoteUrl(url) } : void 0;
152
+ })
153
+ )).filter((remote) => remote !== void 0);
154
+ const primary = remotes.find((remote) => remote.name === "origin") ?? remotes[0];
155
+ const remoteUrl = primary?.url;
156
+ const [currentBranch, remoteHead, localBranchOutput, remoteBranchOutput, status, provider] = await Promise.all([
157
+ runGit(["branch", "--show-current"], rootDir),
158
+ primary ? runGit(["symbolic-ref", "--short", `refs/remotes/${primary.name}/HEAD`], rootDir) : Promise.resolve(void 0),
159
+ runGit(["for-each-ref", "--format=%(refname:short)", "refs/heads"], rootDir),
160
+ runGit(["for-each-ref", "--format=%(refname:short)", "refs/remotes"], rootDir),
161
+ runGit(["status", "--porcelain"], rootDir),
162
+ detectProvider(rootDir, remoteUrl)
163
+ ]);
164
+ const localBranches = localBranchOutput?.split("\n").filter(Boolean);
165
+ const remoteBranches = remoteBranchOutput?.split("\n").filter(Boolean);
166
+ const defaultBranch = remoteHead?.split("/").slice(1).join("/") || (localBranches?.includes("main") ? "main" : localBranches?.includes("master") ? "master" : void 0);
167
+ const hasLocalStaging = localBranches?.includes("staging") ?? false;
168
+ const hasRemoteStaging = remoteBranches?.some((branch) => remoteNames.some((r) => branch === `${r}/staging`)) ?? false;
169
+ return {
170
+ provider: provider.provider,
171
+ providerKind: provider.providerKind,
172
+ providerConfidence: provider.confidence,
173
+ providerEvidence: provider.evidence,
174
+ remoteUrl,
175
+ remoteName: primary?.name,
176
+ remotes,
177
+ mode: remotes.length > 0 ? "remote-hosted" : "local-only",
178
+ currentBranch,
179
+ defaultBranch,
180
+ isDirty: Boolean(status),
181
+ hasLocalStaging,
182
+ hasRemoteStaging,
183
+ workflow: inferWorkflow(currentBranch, hasLocalStaging, hasRemoteStaging)
184
+ };
185
+ }
186
+
187
+ export {
188
+ REPOSITORY_PROFILE_REL,
189
+ detectProvider,
190
+ listTrackedFiles,
191
+ detectGitDirty,
192
+ detectGit
193
+ };
@@ -5,13 +5,10 @@ import path from "path";
5
5
  var MIN_NODE_MAJOR = 22;
6
6
  var MIN_NODE_MINOR = 12;
7
7
  var MIN_NODE_VERSION_LABEL = `${MIN_NODE_MAJOR}.${MIN_NODE_MINOR}`;
8
- var CLI_PACKAGE_JSON_REL = path.join(
9
- "lib",
10
- "node_modules",
11
- "@dadado",
12
- "agent-kit-cli",
13
- "package.json"
14
- );
8
+ var CLI_PACKAGE_SEGMENTS = [
9
+ ["@dadado", "agent-kit-cli"],
10
+ ["@missionkit", "cli"]
11
+ ];
15
12
  var DIST_INDEX_RE = /(?:\$\{basedir\}|\$basedir)?[^'"\s;]*dist\/index\.js/g;
16
13
  function extractDistIndexFromBinScript(contents) {
17
14
  const found = [];
@@ -49,10 +46,12 @@ async function readBinVersion(binPath, options = {}) {
49
46
  if (path.basename(realBin) === "index.js" && path.basename(path.dirname(realBin)) === "dist") {
50
47
  candidates.push(packageJsonFromDistIndex(realBin));
51
48
  }
52
- candidates.push(
53
- path.join(binDir, "..", CLI_PACKAGE_JSON_REL),
54
- path.join(binDir, "..", "node_modules", "@dadado", "agent-kit-cli", "package.json")
55
- );
49
+ for (const [scope, name] of CLI_PACKAGE_SEGMENTS) {
50
+ candidates.push(
51
+ path.join(binDir, "..", "lib", "node_modules", scope, name, "package.json"),
52
+ path.join(binDir, "..", "node_modules", scope, name, "package.json")
53
+ );
54
+ }
56
55
  try {
57
56
  if ((await stat(realBin)).size < SHIM_MAX_BYTES) {
58
57
  const contents = await readFileImpl(binPath);
@@ -215,5 +214,7 @@ async function assessEnvironment(options = {}) {
215
214
 
216
215
  export {
217
216
  MIN_NODE_VERSION_LABEL,
217
+ readBinVersion,
218
+ resolveBinOnPath,
218
219
  assessEnvironment
219
220
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MANIFEST_RELATIVE_PATH
3
- } from "./chunk-V2H57TFD.js";
3
+ } from "./chunk-6M6UKECW.js";
4
4
  import {
5
5
  fileExists
6
6
  } from "./chunk-5B4DVO6C.js";
@@ -0,0 +1,176 @@
1
+ import {
2
+ HANDOFF_REL
3
+ } from "./chunk-C4Q77GGJ.js";
4
+
5
+ // src/manifest/types.ts
6
+ var MANIFEST_FILENAME = "agent-kit.json";
7
+ var MANIFEST_RELATIVE_PATH = `.cursor/${MANIFEST_FILENAME}`;
8
+ var MANIFEST_SCHEMA_VERSION = 1;
9
+ var DEFAULT_PROTECTED_PATHS = [
10
+ HANDOFF_REL,
11
+ ".cursor/plans/**",
12
+ ".cursor/memory/**",
13
+ ".cursor/context/config.json",
14
+ ".cursor/context/current/**",
15
+ ".cursor/context/backups/**"
16
+ ];
17
+ var LEGACY_CONTEXT_PROTECTED_GLOB = ".cursor/context/**";
18
+ var DOMAIN_PACK_IDS = [
19
+ "cybersec",
20
+ "devops",
21
+ "engineering-architecture",
22
+ "clean-code",
23
+ "project-management",
24
+ "context-management",
25
+ "quality"
26
+ ];
27
+
28
+ // src/utils/dir-lock.ts
29
+ import { randomUUID } from "crypto";
30
+ import { mkdir, readFile, rename, rm, stat, writeFile } from "fs/promises";
31
+ import path from "path";
32
+ var DEFAULT_LOCK_TIMEOUT_MS = 6e4;
33
+ var LOCK_RETRY_MS = 200;
34
+ var LOCK_STALE_MS = 5 * 6e4;
35
+ var LOCK_REFRESH_MS = 1e4;
36
+ function lockOwnerPath(lockDir) {
37
+ return path.join(lockDir, "owner.json");
38
+ }
39
+ function isProcessAlive(pid) {
40
+ try {
41
+ process.kill(pid, 0);
42
+ return true;
43
+ } catch {
44
+ return false;
45
+ }
46
+ }
47
+ async function readLockOwner(lockDir) {
48
+ try {
49
+ const raw = await readFile(lockOwnerPath(lockDir), "utf8");
50
+ const parsed = JSON.parse(raw);
51
+ if (typeof parsed.pid === "number" && typeof parsed.uuid === "string") {
52
+ return parsed;
53
+ }
54
+ } catch {
55
+ }
56
+ return null;
57
+ }
58
+ async function writeLockOwner(lockDir, owner) {
59
+ const finalPath = lockOwnerPath(lockDir);
60
+ const tmpPath = path.join(lockDir, `owner.${owner.uuid}.${randomUUID()}.tmp`);
61
+ await writeFile(tmpPath, JSON.stringify(owner), "utf8");
62
+ await rename(tmpPath, finalPath);
63
+ }
64
+ async function refreshLockOwner(lockDir, uuid) {
65
+ const owner = await readLockOwner(lockDir);
66
+ if (owner && owner.uuid !== uuid) return;
67
+ await writeLockOwner(lockDir, { pid: process.pid, uuid, updatedAt: Date.now() });
68
+ }
69
+ async function releaseDirLock(lockDir, uuid) {
70
+ const claimPath = path.join(lockDir, `releasing.${uuid}`);
71
+ try {
72
+ await rename(lockOwnerPath(lockDir), claimPath);
73
+ } catch {
74
+ return;
75
+ }
76
+ let claimed = null;
77
+ try {
78
+ const raw = await readFile(claimPath, "utf8");
79
+ const parsed = JSON.parse(raw);
80
+ if (typeof parsed.pid === "number" && typeof parsed.uuid === "string") {
81
+ claimed = parsed;
82
+ }
83
+ } catch {
84
+ }
85
+ if (!claimed || claimed.uuid !== uuid) {
86
+ try {
87
+ await rename(claimPath, lockOwnerPath(lockDir));
88
+ } catch {
89
+ }
90
+ return;
91
+ }
92
+ try {
93
+ await rm(lockDir, { recursive: true, force: true });
94
+ } catch {
95
+ }
96
+ }
97
+ async function tryReclaimStaleLock(lockDir) {
98
+ let owner;
99
+ let lockStat;
100
+ try {
101
+ lockStat = await stat(lockDir);
102
+ owner = await readLockOwner(lockDir);
103
+ } catch {
104
+ return false;
105
+ }
106
+ const now = Date.now();
107
+ if (owner) {
108
+ const ownerFresh = now - owner.updatedAt < LOCK_STALE_MS;
109
+ if (isProcessAlive(owner.pid) && ownerFresh) {
110
+ return false;
111
+ }
112
+ }
113
+ if (now - lockStat.mtimeMs > LOCK_STALE_MS) {
114
+ try {
115
+ await rm(lockDir, { recursive: true, force: true });
116
+ return true;
117
+ } catch {
118
+ }
119
+ }
120
+ return false;
121
+ }
122
+ async function acquireDirLock(target, options = {}) {
123
+ const lockDir = `${target}.lock`;
124
+ const deadline = Date.now() + (options.timeoutMs ?? DEFAULT_LOCK_TIMEOUT_MS);
125
+ const uuid = randomUUID();
126
+ const owner = { pid: process.pid, uuid, updatedAt: Date.now() };
127
+ await mkdir(path.dirname(lockDir), { recursive: true });
128
+ let lastErrorCode;
129
+ while (Date.now() < deadline) {
130
+ try {
131
+ await mkdir(lockDir, { recursive: false });
132
+ await writeLockOwner(lockDir, owner);
133
+ let refreshing = false;
134
+ const refreshInterval = setInterval(() => {
135
+ if (refreshing) return;
136
+ refreshing = true;
137
+ refreshLockOwner(lockDir, uuid).catch(() => {
138
+ }).finally(() => {
139
+ refreshing = false;
140
+ });
141
+ }, LOCK_REFRESH_MS);
142
+ return async () => {
143
+ clearInterval(refreshInterval);
144
+ await releaseDirLock(lockDir, uuid);
145
+ };
146
+ } catch (err) {
147
+ const code = err.code;
148
+ lastErrorCode = code;
149
+ if (code === "EEXIST") {
150
+ if (await tryReclaimStaleLock(lockDir)) {
151
+ continue;
152
+ }
153
+ await new Promise((r) => setTimeout(r, LOCK_RETRY_MS + Math.random() * 100));
154
+ continue;
155
+ }
156
+ if (code === "ENOENT") {
157
+ await mkdir(path.dirname(lockDir), { recursive: true });
158
+ await new Promise((r) => setTimeout(r, LOCK_RETRY_MS + Math.random() * 100));
159
+ continue;
160
+ }
161
+ throw err;
162
+ }
163
+ }
164
+ throw new Error(
165
+ lastErrorCode === "ENOENT" ? options.vanishedMessage?.(target) ?? `Timed out acquiring lock on ${target}: the lock parent directory kept vanishing.` : options.timeoutMessage?.(target) ?? `Timed out waiting for lock on ${target}.`
166
+ );
167
+ }
168
+
169
+ export {
170
+ MANIFEST_RELATIVE_PATH,
171
+ MANIFEST_SCHEMA_VERSION,
172
+ DEFAULT_PROTECTED_PATHS,
173
+ LEGACY_CONTEXT_PROTECTED_GLOB,
174
+ DOMAIN_PACK_IDS,
175
+ acquireDirLock
176
+ };
@@ -6,7 +6,7 @@ import {
6
6
  formatStaleCliRefusal,
7
7
  installL0,
8
8
  syncFromManifest
9
- } from "./chunk-5PSV76CQ.js";
9
+ } from "./chunk-QLTGHJB3.js";
10
10
  import {
11
11
  SkippedSymlinkError,
12
12
  formatPersonalizationSkippedSymlinks,
@@ -15,21 +15,25 @@ import {
15
15
  import {
16
16
  REGISTRY_CLI_ARGS,
17
17
  resolveRegistryFromCli
18
- } from "./chunk-DRZFWIBN.js";
18
+ } from "./chunk-PIMGV3E5.js";
19
19
  import {
20
20
  assessClaudeCommandAdapters,
21
21
  executeSafeReadinessFixes
22
- } from "./chunk-F7YAAKYP.js";
22
+ } from "./chunk-CIV42JGT.js";
23
23
  import {
24
+ cachedCliNpmLatest,
24
25
  writeReadinessSnapshot
25
- } from "./chunk-HAFRAXGV.js";
26
+ } from "./chunk-2F6NMQOA.js";
26
27
  import {
27
28
  writeClaudeSessionStartHook
28
- } from "./chunk-AWQ6KRFV.js";
29
+ } from "./chunk-NJ2SUSWX.js";
29
30
  import {
30
31
  CLAUDE_HITL_FALLBACK,
31
32
  generateClaudeCommandAdapters
32
- } from "./chunk-6BEFGKCU.js";
33
+ } from "./chunk-EO5NGAYV.js";
34
+ import {
35
+ feedInstallsRegistry
36
+ } from "./chunk-WKFE3RUC.js";
33
37
  import {
34
38
  shouldUseWelcomeColor,
35
39
  withCliProgress
@@ -38,13 +42,15 @@ import {
38
42
  createReadinessReport
39
43
  } from "./chunk-PNFF6OU3.js";
40
44
  import {
41
- REPOSITORY_PROFILE_REL,
42
45
  detectIde,
43
46
  runScanner
44
- } from "./chunk-R4DUO5DA.js";
47
+ } from "./chunk-AXQMVQ6O.js";
45
48
  import {
46
49
  GIT_PLATFORM_META
47
50
  } from "./chunk-F6C3GFKV.js";
51
+ import {
52
+ REPOSITORY_PROFILE_REL
53
+ } from "./chunk-2QYWMSI5.js";
48
54
  import {
49
55
  logger
50
56
  } from "./chunk-ZB43YMHW.js";
@@ -56,21 +62,24 @@ import {
56
62
  npxPinned,
57
63
  pathCliStatus,
58
64
  syncPathCliToRuntime
59
- } from "./chunk-KDJ4ML7I.js";
65
+ } from "./chunk-JGG574RK.js";
60
66
  import {
61
67
  assessEnvironment
62
- } from "./chunk-B3VR5YBQ.js";
68
+ } from "./chunk-2TW7ENWC.js";
63
69
  import {
64
70
  warnIfRunningCliBehindNpm
65
- } from "./chunk-CVZNSRXV.js";
71
+ } from "./chunk-M4UL422I.js";
66
72
  import {
67
- DOMAIN_PACK_IDS,
73
+ UnknownPackError,
68
74
  allPacks,
69
75
  allSkills,
70
76
  buildManifest,
77
+ canonicalizePackIds,
71
78
  emptyStats,
79
+ formatPackIdRewrite,
72
80
  installPack,
73
81
  installSkill,
82
+ legacyPackIdTarget,
74
83
  loadAgentKitManifest,
75
84
  loadPackManifest,
76
85
  loadRegistry,
@@ -79,7 +88,10 @@ import {
79
88
  resolveProtectedGlobs,
80
89
  saveManifest,
81
90
  skillTargetDir
82
- } from "./chunk-V2H57TFD.js";
91
+ } from "./chunk-JG3CNGQM.js";
92
+ import {
93
+ DOMAIN_PACK_IDS
94
+ } from "./chunk-6M6UKECW.js";
83
95
  import {
84
96
  KIT_VERSION,
85
97
  pinnedCliSpec
@@ -799,10 +811,16 @@ async function performInstall(options) {
799
811
  try {
800
812
  const stale = await detectStaleCli(registry.root, { warn: logger.warn });
801
813
  if (stale && !options.allowStaleCli) throw new StaleCliError(stale);
814
+ const packIds = await canonicalizePackIds(
815
+ registry.root,
816
+ packs.length > 0 ? packs : existing?.packs
817
+ );
818
+ const unknownFlagPack = packs.find((id) => packIds.unknown.includes(id));
819
+ if (unknownFlagPack) throw new UnknownPackError(unknownFlagPack, packIds.knownIds);
802
820
  const draft = buildManifest({
803
821
  version: KIT_VERSION,
804
822
  profile: options.profile ?? existing?.profile ?? "default",
805
- packs: packs.length > 0 ? packs : existing?.packs,
823
+ packs: packIds.packs,
806
824
  skills: existing?.skills,
807
825
  protected: existing?.protected,
808
826
  personalization: existing?.personalization,
@@ -813,6 +831,7 @@ async function performInstall(options) {
813
831
  const stats = (draft.packs?.length ?? 0) > 0 || (draft.skills?.length ?? 0) > 0 ? await syncFromManifest(registry.root, projectRoot, draft) : await installL0(registry.root, projectRoot, resolveProtectedGlobs(draft));
814
832
  if (stats.skippedSymlink.length > 0) throw new SkippedSymlinkError(stats);
815
833
  const manifestPath = await saveManifest(projectRoot, draft);
834
+ for (const rewrite of packIds.rewrites) logger.info(formatPackIdRewrite(rewrite));
816
835
  const readinessExecution = await executeSafeReadinessFixes(projectRoot, {
817
836
  generatorVersion: KIT_VERSION
818
837
  });
@@ -932,10 +951,14 @@ ${err.recovery}
932
951
  }
933
952
  logger.info(`Installing into: ${projectRoot}`);
934
953
  logger.info(`CLI v${KIT_VERSION}`);
935
- await warnIfRunningCliBehindNpm(projectRoot, { warn: (message) => logger.warn(message) });
954
+ await warnIfRunningCliBehindNpm(projectRoot, {
955
+ warn: (message) => logger.warn(message),
956
+ stamp: false,
957
+ fetchLatest: async () => (await cachedCliNpmLatest())?.version ?? null
958
+ });
936
959
  const packs = parsePackList(args.pack);
937
960
  for (const id of packs) {
938
- if (!DOMAIN_PACK_IDS.includes(id)) {
961
+ if (!DOMAIN_PACK_IDS.includes(id) && !legacyPackIdTarget(id)) {
939
962
  logger.warn(`Pack '${id}' is not in the known L1 list; will still try registry.`);
940
963
  }
941
964
  }
@@ -965,6 +988,7 @@ ${result.claudeSessionStartInstructions}
965
988
  `);
966
989
  }
967
990
  if (result.claudeAdapterHint) logger.info(result.claudeAdapterHint);
991
+ await feedInstallsRegistry(result.projectRoot);
968
992
  } catch (err) {
969
993
  if (err instanceof StaleCliError) {
970
994
  const profile = typeof args.profile === "string" && args.profile ? `${args.profile} ` : "";
@@ -978,6 +1002,11 @@ ${result.claudeSessionStartInstructions}
978
1002
  process.exitCode = 1;
979
1003
  return;
980
1004
  }
1005
+ if (err instanceof UnknownPackError) {
1006
+ logger.error(err.message);
1007
+ process.exitCode = 1;
1008
+ return;
1009
+ }
981
1010
  if (err instanceof SkippedSymlinkError) {
982
1011
  logApplyStats(err.stats);
983
1012
  logger.error(err.message);