@dadado/agent-kit-cli 5.16.0 → 5.17.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.
- package/dist/{add-7UMSGVWC.js → add-HTYIFKMN.js} +2 -2
- package/dist/{chunk-YGBBHKBE.js → chunk-2RDRMGD3.js} +2 -2
- package/dist/{chunk-VS2JD2XC.js → chunk-AW74INUW.js} +4 -1
- package/dist/{chunk-OZ4QV6LM.js → chunk-B73KQ5KX.js} +42 -148
- package/dist/{chunk-5OXPNVCF.js → chunk-DQA434Y4.js} +2 -2
- package/dist/{chunk-VGZBARQC.js → chunk-F4VMYR7U.js} +2 -2
- package/dist/{chunk-6QV2BFGA.js → chunk-N3HTJVBR.js} +1 -1
- package/dist/{chunk-XWPO3VYQ.js → chunk-PNG7LO2F.js} +1 -1
- package/dist/chunk-S6GMFDKV.js +50 -0
- package/dist/{chunk-XZZAVHH4.js → chunk-SMGFN3Z4.js} +2 -2
- package/dist/{chunk-KI6ZHBPV.js → chunk-STGFBAYT.js} +320 -11
- package/dist/{chunk-CGTE7DHN.js → chunk-W24CMQ32.js} +135 -20
- package/dist/{contribute-YKK6YCSI.js → contribute-C6AW2P6J.js} +3 -3
- package/dist/{diff-YTR7VOAN.js → diff-VHNR62SI.js} +4 -4
- package/dist/doctor-PET2HRRJ.js +236 -0
- package/dist/{hook-MUV6Y7UW.js → hook-DYIMKJYL.js} +4 -4
- package/dist/index.js +10 -10
- package/dist/{init-TTTKGC4C.js → init-Q4LBM6KT.js} +10 -10
- package/dist/{install-ZMFJBPOI.js → install-RHOS3OYZ.js} +10 -10
- package/dist/{setup-global-JUVMJXJ5.js → setup-global-M42GEODI.js} +5 -5
- package/dist/{status-MVCUNCWX.js → status-XPVQVQMX.js} +18 -6
- package/dist/{update-Q4EBIRUB.js → update-FJ2EBZVO.js} +32 -9
- package/package.json +3 -3
- package/dist/doctor-TA2FWREU.js +0 -497
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
REGISTRY_CLI_ARGS,
|
|
7
7
|
resolveRegistryFromCli
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PNG7LO2F.js";
|
|
9
9
|
import {
|
|
10
10
|
logger
|
|
11
11
|
} from "./chunk-ZB43YMHW.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
resolveProtectedGlobs,
|
|
23
23
|
saveManifest,
|
|
24
24
|
upsertIdList
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-AW74INUW.js";
|
|
26
26
|
import "./chunk-5VCOWTTP.js";
|
|
27
27
|
import {
|
|
28
28
|
KIT_VERSION
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
managedPairs
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N3HTJVBR.js";
|
|
4
4
|
import {
|
|
5
5
|
isProtectedPath,
|
|
6
6
|
resolveContained,
|
|
7
7
|
resolveProtectedGlobs
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-AW74INUW.js";
|
|
9
9
|
|
|
10
10
|
// src/lifecycle/diff.ts
|
|
11
11
|
import { readFile } from "fs/promises";
|
|
@@ -678,7 +678,10 @@ var KNOWN_SHIPPED_OVERLAY_HASHES = /* @__PURE__ */ new Set([
|
|
|
678
678
|
"41d3eac7f116ec22535d830149979fe0a8dbf44625dd841bc9785cbd7c5ddc95",
|
|
679
679
|
"80e11549ad3700d1e7345447aff1b3858e532e9347594ee4f028566c8c7b8a6a",
|
|
680
680
|
"1ffbfa48a76d39f78db66f4ea250c451ae335c31d7e45d0fdc4d99bc714bae33",
|
|
681
|
-
"19a5aa359e740fa18d7cc19f0b11243bc53d8d016545bce35837deac7fe2ef7e"
|
|
681
|
+
"19a5aa359e740fa18d7cc19f0b11243bc53d8d016545bce35837deac7fe2ef7e",
|
|
682
|
+
"f1c7beac6a619520d744fd984bc16b322f3d545b9d8490801aee628dabd94aff",
|
|
683
|
+
"14d919d01637aa6b5acc92804dbb4ab56cecc88281aedd5cb7b5dcf8f7da958e",
|
|
684
|
+
"a8decf7b78e2b2c833b0808c3e108322cfb895fadaec159467973a681028d92a"
|
|
682
685
|
]);
|
|
683
686
|
|
|
684
687
|
// src/lifecycle/paths.ts
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
NON_INTERACTIVE_ROOT_ARGS,
|
|
3
3
|
installL0,
|
|
4
4
|
syncFromManifest
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DQA434Y4.js";
|
|
6
6
|
import {
|
|
7
7
|
SkippedSymlinkError,
|
|
8
8
|
formatPersonalizationSkippedSymlinks,
|
|
@@ -11,16 +11,19 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
REGISTRY_CLI_ARGS,
|
|
13
13
|
resolveRegistryFromCli
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PNG7LO2F.js";
|
|
15
15
|
import {
|
|
16
|
+
assessClaudeCommandAdapters,
|
|
16
17
|
executeSafeReadinessFixes
|
|
17
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-STGFBAYT.js";
|
|
18
19
|
import {
|
|
19
20
|
writeReadinessSnapshot
|
|
20
21
|
} from "./chunk-ZXKZBTXE.js";
|
|
21
22
|
import {
|
|
23
|
+
CLAUDE_HITL_FALLBACK,
|
|
24
|
+
generateClaudeCommandAdapters,
|
|
22
25
|
writeClaudeSessionStartHook
|
|
23
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-W24CMQ32.js";
|
|
24
27
|
import {
|
|
25
28
|
shouldUseWelcomeColor,
|
|
26
29
|
withCliProgress
|
|
@@ -47,36 +50,30 @@ import {
|
|
|
47
50
|
npxPinned,
|
|
48
51
|
pathCliStatus,
|
|
49
52
|
syncPathCliToRuntime
|
|
50
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-F4VMYR7U.js";
|
|
51
54
|
import {
|
|
52
55
|
assessEnvironment
|
|
53
56
|
} from "./chunk-4IWG5CVE.js";
|
|
54
57
|
import {
|
|
55
58
|
warnIfRunningCliBehindNpm
|
|
56
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-SMGFN3Z4.js";
|
|
57
60
|
import {
|
|
58
61
|
DOMAIN_PACK_IDS,
|
|
59
62
|
allPacks,
|
|
60
63
|
allSkills,
|
|
61
64
|
buildManifest,
|
|
62
|
-
contentHash,
|
|
63
65
|
emptyStats,
|
|
64
66
|
installPack,
|
|
65
67
|
installSkill,
|
|
66
|
-
isRealWriteTargetContained,
|
|
67
68
|
loadAgentKitManifest,
|
|
68
|
-
loadManagedHashLedger,
|
|
69
69
|
loadPackManifest,
|
|
70
70
|
loadRegistry,
|
|
71
71
|
mergeStats,
|
|
72
72
|
packMemberFileTargets,
|
|
73
|
-
resolveContained,
|
|
74
73
|
resolveProtectedGlobs,
|
|
75
|
-
saveManagedHashLedger,
|
|
76
74
|
saveManifest,
|
|
77
|
-
shouldPreserveCustomizedOverlay,
|
|
78
75
|
skillTargetDir
|
|
79
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-AW74INUW.js";
|
|
80
77
|
import {
|
|
81
78
|
KIT_VERSION,
|
|
82
79
|
pinnedCliSpec
|
|
@@ -88,123 +85,17 @@ import {
|
|
|
88
85
|
} from "./chunk-77V75A7O.js";
|
|
89
86
|
|
|
90
87
|
// src/commands/install.ts
|
|
91
|
-
import
|
|
88
|
+
import path4 from "path";
|
|
92
89
|
import { defineCommand } from "citty";
|
|
93
90
|
import { bold, cyan, green, options as koloristOptions } from "kolorist";
|
|
94
91
|
|
|
95
92
|
// src/generator/personalization.ts
|
|
96
|
-
import { readFile
|
|
97
|
-
import
|
|
98
|
-
|
|
99
|
-
// src/generator/claude-command-adapters.ts
|
|
100
|
-
import { readFile, readdir, writeFile } from "fs/promises";
|
|
101
|
-
import path from "path";
|
|
102
|
-
var CURSOR_COMMANDS_DIR_REL = ".cursor/commands";
|
|
103
|
-
var CLAUDE_COMMANDS_DIR_REL = ".claude/commands";
|
|
104
|
-
var RESERVED_ADAPTER_NAMES = /* @__PURE__ */ new Set(["agent-kit"]);
|
|
105
|
-
function parseCommandFrontmatter(name, raw) {
|
|
106
|
-
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(raw);
|
|
107
|
-
if (!match) return null;
|
|
108
|
-
const body = match[1] ?? "";
|
|
109
|
-
const descMatch = /^description:\s*(.+)$/m.exec(body);
|
|
110
|
-
if (!descMatch) return null;
|
|
111
|
-
const description = (descMatch[1] ?? "").trim();
|
|
112
|
-
if (!description) return null;
|
|
113
|
-
return { name, description };
|
|
114
|
-
}
|
|
115
|
-
var CLAUDE_HITL_FALLBACK = `Cursor "Ask questions" is unavailable here: use AskUserQuestion when possible, else print one line \`HITL_GATE: <ask-id> | <label 1> | <label 2> | ...\` immediately followed by the same labels as one numbered list, one list per message, and WAIT for the answer (ask-id and labels: \`.cursor/skills/core/hitl-gates/SKILL.md\`). A headless reply arrives as \`HITL_REPLY: <ask-id> | operator reply <n> | <label>\`; cite that line as the Ask provenance.`;
|
|
116
|
-
var MODEL_INVOCATION_DISABLED = /* @__PURE__ */ new Set([
|
|
117
|
-
"git-prod",
|
|
118
|
-
"kit-prod",
|
|
119
|
-
"backlog-delete",
|
|
120
|
-
"backlog-cancel",
|
|
121
|
-
"archive-plan",
|
|
122
|
-
"hotfix",
|
|
123
|
-
"run-plan-all"
|
|
124
|
-
]);
|
|
125
|
-
function renderClaudeCommandAdapter(command) {
|
|
126
|
-
const invocation = MODEL_INVOCATION_DISABLED.has(command.name) ? "disable-model-invocation: true\n" : "";
|
|
127
|
-
return `---
|
|
128
|
-
description: ${command.description}
|
|
129
|
-
${invocation}---
|
|
130
|
-
|
|
131
|
-
Read \`.cursor/commands/${command.name}.md\` now and follow that contract exactly \u2014 it is the source of truth for /${command.name}; this file is only a thin adapter for Claude Code.
|
|
132
|
-
|
|
133
|
-
Adapter rules (Claude Code CLI):
|
|
134
|
-
- ${CLAUDE_HITL_FALLBACK}
|
|
135
|
-
- Skip or cancel means stop.
|
|
136
|
-
- Never \`/git-prod\` without an explicit operator yes.
|
|
137
|
-
- Do not clone Cursor hooks or invent behavior beyond the SoT file.
|
|
138
|
-
`;
|
|
139
|
-
}
|
|
140
|
-
async function discoverInstalledCommands(rootDir) {
|
|
141
|
-
const dir = path.join(rootDir, CURSOR_COMMANDS_DIR_REL);
|
|
142
|
-
let entries;
|
|
143
|
-
try {
|
|
144
|
-
entries = (await readdir(dir)).filter((f) => f.endsWith(".md"));
|
|
145
|
-
} catch {
|
|
146
|
-
return [];
|
|
147
|
-
}
|
|
148
|
-
const commands = [];
|
|
149
|
-
for (const file of entries.sort()) {
|
|
150
|
-
const name = file.slice(0, -3);
|
|
151
|
-
if (RESERVED_ADAPTER_NAMES.has(name)) continue;
|
|
152
|
-
try {
|
|
153
|
-
const raw = await readFile(path.join(dir, file), "utf8");
|
|
154
|
-
const parsed = parseCommandFrontmatter(name, raw);
|
|
155
|
-
if (parsed) commands.push(parsed);
|
|
156
|
-
} catch {
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return commands;
|
|
160
|
-
}
|
|
161
|
-
async function generateClaudeCommandAdapters(rootDir) {
|
|
162
|
-
const commands = await discoverInstalledCommands(rootDir);
|
|
163
|
-
if (commands.length === 0) return [];
|
|
164
|
-
const ledger = await loadManagedHashLedger(rootDir);
|
|
165
|
-
const results = [];
|
|
166
|
-
let ledgerDirty = false;
|
|
167
|
-
for (const command of commands) {
|
|
168
|
-
const relPath = path.posix.join(CLAUDE_COMMANDS_DIR_REL, `${command.name}.md`);
|
|
169
|
-
const rendered = renderClaudeCommandAdapter(command);
|
|
170
|
-
const abs = resolveContained(rootDir, relPath);
|
|
171
|
-
if (!await isRealWriteTargetContained(rootDir, abs)) {
|
|
172
|
-
results.push({ relativePath: relPath, status: "skipped-symlink" });
|
|
173
|
-
continue;
|
|
174
|
-
}
|
|
175
|
-
if (!await fileExists(abs)) {
|
|
176
|
-
await ensureDir(path.dirname(abs));
|
|
177
|
-
await writeFile(abs, rendered, "utf8");
|
|
178
|
-
ledger.hashes[relPath] = contentHash(rendered);
|
|
179
|
-
ledgerDirty = true;
|
|
180
|
-
results.push({ relativePath: relPath, status: "applied" });
|
|
181
|
-
continue;
|
|
182
|
-
}
|
|
183
|
-
const localContent = await readFile(abs, "utf8");
|
|
184
|
-
if (localContent === rendered) {
|
|
185
|
-
if (ledger.hashes[relPath] !== contentHash(rendered)) {
|
|
186
|
-
ledger.hashes[relPath] = contentHash(rendered);
|
|
187
|
-
ledgerDirty = true;
|
|
188
|
-
}
|
|
189
|
-
results.push({ relativePath: relPath, status: "unchanged" });
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
if (shouldPreserveCustomizedOverlay(localContent, ledger.hashes[relPath])) {
|
|
193
|
-
results.push({ relativePath: relPath, status: "preserved-customized" });
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
196
|
-
await writeFile(abs, rendered, "utf8");
|
|
197
|
-
ledger.hashes[relPath] = contentHash(rendered);
|
|
198
|
-
ledgerDirty = true;
|
|
199
|
-
results.push({ relativePath: relPath, status: "refreshed" });
|
|
200
|
-
}
|
|
201
|
-
if (ledgerDirty) await saveManagedHashLedger(rootDir, ledger);
|
|
202
|
-
return results;
|
|
203
|
-
}
|
|
93
|
+
import { readFile, writeFile as writeFile3 } from "fs/promises";
|
|
94
|
+
import path3 from "path";
|
|
204
95
|
|
|
205
96
|
// src/generator/claude-kit-load.ts
|
|
206
|
-
import { writeFile
|
|
207
|
-
import
|
|
97
|
+
import { writeFile } from "fs/promises";
|
|
98
|
+
import path from "path";
|
|
208
99
|
var CLAUDE_MD_REL = "CLAUDE.md";
|
|
209
100
|
var AGENT_KIT_COMMAND_REL = ".claude/commands/agent-kit.md";
|
|
210
101
|
function renderClaudeMd() {
|
|
@@ -257,12 +148,12 @@ Non-goals: not audits / \`/plan-external-review\`, not a second tick dialect, no
|
|
|
257
148
|
`;
|
|
258
149
|
}
|
|
259
150
|
async function writeUnlessExists(rootDir, relativePath, content) {
|
|
260
|
-
const target =
|
|
151
|
+
const target = path.join(rootDir, relativePath);
|
|
261
152
|
if (await fileExists(target)) {
|
|
262
153
|
return { relativePath, status: "skipped-customized" };
|
|
263
154
|
}
|
|
264
|
-
await ensureDir(
|
|
265
|
-
await
|
|
155
|
+
await ensureDir(path.dirname(target));
|
|
156
|
+
await writeFile(target, content, "utf8");
|
|
266
157
|
return { relativePath, status: "applied" };
|
|
267
158
|
}
|
|
268
159
|
async function generateClaudeKitLoadArtifacts(rootDir) {
|
|
@@ -273,8 +164,8 @@ async function generateClaudeKitLoadArtifacts(rootDir) {
|
|
|
273
164
|
}
|
|
274
165
|
|
|
275
166
|
// src/generator/vscode.ts
|
|
276
|
-
import { writeFile as
|
|
277
|
-
import
|
|
167
|
+
import { writeFile as writeFile2 } from "fs/promises";
|
|
168
|
+
import path2 from "path";
|
|
278
169
|
|
|
279
170
|
// src/generator/platform.ts
|
|
280
171
|
function gitProviderLabel(profile) {
|
|
@@ -298,14 +189,14 @@ function prTerminology(profile) {
|
|
|
298
189
|
// src/generator/vscode.ts
|
|
299
190
|
async function generateVSCodeArtifacts(profile) {
|
|
300
191
|
const results = [];
|
|
301
|
-
const vscodeDir =
|
|
302
|
-
const githubDir =
|
|
192
|
+
const vscodeDir = path2.join(profile.rootDir, ".vscode");
|
|
193
|
+
const githubDir = path2.join(profile.rootDir, ".github");
|
|
303
194
|
await Promise.all([ensureDir(vscodeDir), ensureDir(githubDir)]);
|
|
304
|
-
const settingsPath =
|
|
195
|
+
const settingsPath = path2.join(vscodeDir, "settings.json");
|
|
305
196
|
if (await fileExists(settingsPath)) {
|
|
306
197
|
results.push({ relativePath: ".vscode/settings.json", status: "skipped-customized" });
|
|
307
198
|
} else {
|
|
308
|
-
await
|
|
199
|
+
await writeFile2(
|
|
309
200
|
settingsPath,
|
|
310
201
|
`${JSON.stringify(
|
|
311
202
|
{
|
|
@@ -325,11 +216,11 @@ async function generateVSCodeArtifacts(profile) {
|
|
|
325
216
|
}
|
|
326
217
|
const provider = gitProviderLabel(profile);
|
|
327
218
|
const prTerm = prTerminology(profile);
|
|
328
|
-
const copilotPath =
|
|
219
|
+
const copilotPath = path2.join(githubDir, "copilot-instructions.md");
|
|
329
220
|
if (await fileExists(copilotPath)) {
|
|
330
221
|
results.push({ relativePath: ".github/copilot-instructions.md", status: "skipped-customized" });
|
|
331
222
|
} else {
|
|
332
|
-
await
|
|
223
|
+
await writeFile2(
|
|
333
224
|
copilotPath,
|
|
334
225
|
`# Copilot Instructions
|
|
335
226
|
|
|
@@ -343,14 +234,14 @@ async function generateVSCodeArtifacts(profile) {
|
|
|
343
234
|
results.push({ relativePath: ".github/copilot-instructions.md", status: "applied" });
|
|
344
235
|
}
|
|
345
236
|
if (profile.ide.plan === "vscode-pro") {
|
|
346
|
-
const securityPath =
|
|
237
|
+
const securityPath = path2.join(vscodeDir, "security-review.agent.md");
|
|
347
238
|
if (await fileExists(securityPath)) {
|
|
348
239
|
results.push({
|
|
349
240
|
relativePath: ".vscode/security-review.agent.md",
|
|
350
241
|
status: "skipped-customized"
|
|
351
242
|
});
|
|
352
243
|
} else {
|
|
353
|
-
await
|
|
244
|
+
await writeFile2(
|
|
354
245
|
securityPath,
|
|
355
246
|
"# Security Review Agent\n\nSpecialized mode for security review.\n",
|
|
356
247
|
"utf8"
|
|
@@ -555,7 +446,7 @@ function renderProjectContext(profile, skillItems = []) {
|
|
|
555
446
|
`;
|
|
556
447
|
}
|
|
557
448
|
async function createOwnedFile(rootDir, relativePath, content, evidence) {
|
|
558
|
-
const target =
|
|
449
|
+
const target = path3.join(rootDir, relativePath);
|
|
559
450
|
if (await fileExists(target)) {
|
|
560
451
|
return {
|
|
561
452
|
kind: "file",
|
|
@@ -565,8 +456,8 @@ async function createOwnedFile(rootDir, relativePath, content, evidence) {
|
|
|
565
456
|
evidence
|
|
566
457
|
};
|
|
567
458
|
}
|
|
568
|
-
await ensureDir(
|
|
569
|
-
await
|
|
459
|
+
await ensureDir(path3.dirname(target));
|
|
460
|
+
await writeFile3(target, content, "utf8");
|
|
570
461
|
return {
|
|
571
462
|
kind: "file",
|
|
572
463
|
id: relativePath,
|
|
@@ -588,7 +479,7 @@ async function packTargets(registryRoot, packId) {
|
|
|
588
479
|
async function existingTargets(projectRoot, targets) {
|
|
589
480
|
const checks = await Promise.all(
|
|
590
481
|
targets.map(
|
|
591
|
-
async (target) => await fileExists(
|
|
482
|
+
async (target) => await fileExists(path3.join(projectRoot, target)) ? target : null
|
|
592
483
|
)
|
|
593
484
|
);
|
|
594
485
|
return checks.filter((target) => target !== null);
|
|
@@ -612,8 +503,8 @@ async function applyPersonalization(input) {
|
|
|
612
503
|
componentResults.push({ ...item, status: "unavailable" });
|
|
613
504
|
continue;
|
|
614
505
|
}
|
|
615
|
-
const target =
|
|
616
|
-
if (await fileExists(
|
|
506
|
+
const target = path3.posix.join(skillTargetDir(skill.path, skill.id), "SKILL.md");
|
|
507
|
+
if (await fileExists(path3.join(input.rootDir, target))) {
|
|
617
508
|
componentResults.push({ ...item, status: "skipped-customized", path: target });
|
|
618
509
|
protectedPaths.add(target);
|
|
619
510
|
continue;
|
|
@@ -779,7 +670,7 @@ async function applyPersonalization(input) {
|
|
|
779
670
|
protectedPaths: [...protectedPaths].sort(),
|
|
780
671
|
...claudeSessionStartInstructions ? { claudeSessionStartInstructions } : {}
|
|
781
672
|
};
|
|
782
|
-
await writeJson(
|
|
673
|
+
await writeJson(path3.join(input.rootDir, RESULT_PATH), result);
|
|
783
674
|
return {
|
|
784
675
|
result,
|
|
785
676
|
stats,
|
|
@@ -799,9 +690,9 @@ async function applyPersonalization(input) {
|
|
|
799
690
|
};
|
|
800
691
|
}
|
|
801
692
|
async function readRepositoryProfile(rootDir) {
|
|
802
|
-
const target =
|
|
693
|
+
const target = path3.join(rootDir, REPOSITORY_PROFILE_REL);
|
|
803
694
|
if (!await fileExists(target)) return null;
|
|
804
|
-
return JSON.parse(await
|
|
695
|
+
return JSON.parse(await readFile(target, "utf8"));
|
|
805
696
|
}
|
|
806
697
|
|
|
807
698
|
// src/commands/install.ts
|
|
@@ -888,7 +779,7 @@ async function printPostInstallSummary(result) {
|
|
|
888
779
|
printInstallEpilogue(sync.env, { runtimeVersion: KIT_VERSION });
|
|
889
780
|
}
|
|
890
781
|
async function performInstall(options) {
|
|
891
|
-
const projectRoot =
|
|
782
|
+
const projectRoot = path4.resolve(options.cwd);
|
|
892
783
|
const packs = parsePackList(options.pack);
|
|
893
784
|
const existing = await loadAgentKitManifest(projectRoot, { onWarning: logger.warn });
|
|
894
785
|
const registry = await resolveRegistryFromCli({
|
|
@@ -951,13 +842,15 @@ async function performInstall(options) {
|
|
|
951
842
|
}
|
|
952
843
|
}
|
|
953
844
|
await writeReadinessSnapshot(projectRoot, readiness);
|
|
845
|
+
const claudeAdapterHint = options.claudeAdapters ? void 0 : (await assessClaudeCommandAdapters(projectRoot))[0];
|
|
954
846
|
return {
|
|
955
847
|
projectRoot,
|
|
956
848
|
manifestPath,
|
|
957
849
|
stats,
|
|
958
850
|
readiness,
|
|
959
851
|
safeChanges: readinessExecution.changes,
|
|
960
|
-
...claudeSessionStartInstructions ? { claudeSessionStartInstructions } : {}
|
|
852
|
+
...claudeSessionStartInstructions ? { claudeSessionStartInstructions } : {},
|
|
853
|
+
...claudeAdapterHint ? { claudeAdapterHint } : {}
|
|
961
854
|
};
|
|
962
855
|
} finally {
|
|
963
856
|
await registry.unlock?.();
|
|
@@ -1046,6 +939,7 @@ ${err.recovery}
|
|
|
1046
939
|
${result.claudeSessionStartInstructions}
|
|
1047
940
|
`);
|
|
1048
941
|
}
|
|
942
|
+
if (result.claudeAdapterHint) logger.info(result.claudeAdapterHint);
|
|
1049
943
|
} catch (err) {
|
|
1050
944
|
if (err instanceof SkippedSymlinkError) {
|
|
1051
945
|
logApplyStats(err.stats);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
L0_ARTIFACTS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N3HTJVBR.js";
|
|
4
4
|
import {
|
|
5
5
|
copyRegistryFile,
|
|
6
6
|
emptyStats,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
recordOutcome,
|
|
13
13
|
resolveProtectedGlobs,
|
|
14
14
|
saveManagedHashLedger
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AW74INUW.js";
|
|
16
16
|
import {
|
|
17
17
|
fileExists
|
|
18
18
|
} from "./chunk-77V75A7O.js";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
compareSemver,
|
|
6
6
|
normalizeSemver
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SMGFN3Z4.js";
|
|
8
8
|
import {
|
|
9
9
|
MANIFEST_RELATIVE_PATH
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AW74INUW.js";
|
|
11
11
|
import {
|
|
12
12
|
KIT_VERSION,
|
|
13
13
|
pinnedCliSpec
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MANIFEST_RELATIVE_PATH
|
|
3
|
+
} from "./chunk-AW74INUW.js";
|
|
4
|
+
import {
|
|
5
|
+
fileExists
|
|
6
|
+
} from "./chunk-77V75A7O.js";
|
|
7
|
+
|
|
8
|
+
// src/scanner/workspace-parent.ts
|
|
9
|
+
import { readdir } from "fs/promises";
|
|
10
|
+
import path from "path";
|
|
11
|
+
var MAX_CHILDREN_INSPECTED = 200;
|
|
12
|
+
var MAX_KIT_PROJECTS_REPORTED = 10;
|
|
13
|
+
async function detectWorkspaceParent(rootDir) {
|
|
14
|
+
try {
|
|
15
|
+
if (await fileExists(path.join(rootDir, MANIFEST_RELATIVE_PATH))) return null;
|
|
16
|
+
const entries = await readdir(rootDir, { withFileTypes: true });
|
|
17
|
+
const children = entries.filter(
|
|
18
|
+
(entry) => entry.isDirectory() && !entry.name.startsWith(".") && entry.name !== "node_modules"
|
|
19
|
+
).map((entry) => entry.name).sort().slice(0, MAX_CHILDREN_INSPECTED);
|
|
20
|
+
const hits = await Promise.all(
|
|
21
|
+
children.map(
|
|
22
|
+
async (name) => await fileExists(path.join(rootDir, name, MANIFEST_RELATIVE_PATH)) ? name : null
|
|
23
|
+
)
|
|
24
|
+
);
|
|
25
|
+
const kitProjects = hits.filter((name) => name !== null).slice(0, MAX_KIT_PROJECTS_REPORTED);
|
|
26
|
+
return kitProjects.length > 0 ? { kitProjects } : null;
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function shellArg(value) {
|
|
32
|
+
return /^[\w@%+=:,./-]+$/.test(value) ? value : `'${value.replace(/'/g, "'\\''")}'`;
|
|
33
|
+
}
|
|
34
|
+
function workspaceParentNextStep(detection, command) {
|
|
35
|
+
return `cd ${shellArg(detection.kitProjects[0] ?? "<project>")} && agent-kit ${command}`;
|
|
36
|
+
}
|
|
37
|
+
function workspaceParentAdvisoryLines(rootDir, detection, command) {
|
|
38
|
+
return [
|
|
39
|
+
`No Agent Kit here: ${rootDir} is a workspace folder, not a kit project.`,
|
|
40
|
+
"Kit projects in its direct subfolders:",
|
|
41
|
+
...detection.kitProjects.map((name) => ` - ${name}`),
|
|
42
|
+
`Run \`agent-kit ${command}\` from inside one of them.`,
|
|
43
|
+
`Next: ${workspaceParentNextStep(detection, command)}`
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
detectWorkspaceParent,
|
|
49
|
+
workspaceParentAdvisoryLines
|
|
50
|
+
};
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
diffAgainstRegistry,
|
|
8
8
|
summarizeDiff
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2RDRMGD3.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_REGISTRY_URL,
|
|
12
12
|
assertSafeRegistrySource,
|
|
13
13
|
loadAgentKitManifest,
|
|
14
14
|
resolveRegistryRoot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AW74INUW.js";
|
|
16
16
|
import {
|
|
17
17
|
KIT_PACKAGE_SPEC,
|
|
18
18
|
KIT_VERSION
|