@kaddo/cli 3.27.2 → 3.27.3
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/README.md +1 -0
- package/dist/index.js +45 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -520,6 +520,7 @@ create --from roadmap → owners → guard → explain`.
|
|
|
520
520
|
| v3.27 | Codex adapter: `kaddo adapters install codex` (alias `kaddo export codex`) generates a compact `AGENTS.md` projection (`--dry-run`/`--force`) |
|
|
521
521
|
| v3.27.1 | Codex adapter command fallbacks: AGENTS.md tells Codex to try `corepack pnpm exec` / `pnpm exec` / `npx` kaddo when the global binary isn't on PATH |
|
|
522
522
|
| v3.27.2 | Codex adapter safe merge: `kaddo adapters install codex --inject` adds/updates only a delimited Kaddo block in an existing AGENTS.md, preserving team content |
|
|
523
|
+
| v3.27.3 | Codex adapter reference stabilization: package-manager-aware command fallbacks (lockfile detection) + Adapter Contract & Custom Adapters docs (reference for future adapters) |
|
|
523
524
|
|
|
524
525
|
**Optional modules (installed with `kaddo add`):**
|
|
525
526
|
|
package/dist/index.js
CHANGED
|
@@ -12337,6 +12337,7 @@ function buildCodexAdapterContext(dir) {
|
|
|
12337
12337
|
projectName: config?.project.name,
|
|
12338
12338
|
projectType: config?.project.state,
|
|
12339
12339
|
language: config ? config.project.language : void 0,
|
|
12340
|
+
packageManager: detectPackageManager2(dir),
|
|
12340
12341
|
hasAgents: agents.length > 0,
|
|
12341
12342
|
agents,
|
|
12342
12343
|
hasSkills: skills.length > 0,
|
|
@@ -12346,6 +12347,48 @@ function buildCodexAdapterContext(dir) {
|
|
|
12346
12347
|
generatedPaths: GENERATED_PATHS
|
|
12347
12348
|
};
|
|
12348
12349
|
}
|
|
12350
|
+
function detectPackageManager2(dir) {
|
|
12351
|
+
if (exists(join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
12352
|
+
if (exists(join(dir, "yarn.lock"))) return "yarn";
|
|
12353
|
+
if (exists(join(dir, "bun.lockb")) || exists(join(dir, "bun.lock"))) return "bun";
|
|
12354
|
+
if (exists(join(dir, "package-lock.json"))) return "npm";
|
|
12355
|
+
return void 0;
|
|
12356
|
+
}
|
|
12357
|
+
function commandFallbacks(pm) {
|
|
12358
|
+
switch (pm) {
|
|
12359
|
+
case "pnpm":
|
|
12360
|
+
return ["corepack pnpm exec kaddo <command>", "pnpm exec kaddo <command>", "npx kaddo <command>"];
|
|
12361
|
+
case "yarn":
|
|
12362
|
+
return ["yarn kaddo <command>", "yarn dlx kaddo <command>", "npx kaddo <command>"];
|
|
12363
|
+
case "bun":
|
|
12364
|
+
return ["bunx kaddo <command>", "npx kaddo <command>"];
|
|
12365
|
+
case "npm":
|
|
12366
|
+
return ["npm exec kaddo <command>", "npx kaddo <command>"];
|
|
12367
|
+
default:
|
|
12368
|
+
return ["corepack pnpm exec kaddo <command>", "pnpm exec kaddo <command>", "npm exec kaddo <command>", "npx kaddo <command>"];
|
|
12369
|
+
}
|
|
12370
|
+
}
|
|
12371
|
+
function commandFallbackSection(pm, heading) {
|
|
12372
|
+
const L = [];
|
|
12373
|
+
const pmNote = pm ? ` (detected package manager: \`${pm}\`)` : " (no package manager detected \u2014 generic options)";
|
|
12374
|
+
L.push(`${heading}Command fallback`, "");
|
|
12375
|
+
L.push(`Prefer the global \`kaddo\` command when available:`, "");
|
|
12376
|
+
L.push("```bash");
|
|
12377
|
+
L.push("kaddo <command>");
|
|
12378
|
+
L.push("```");
|
|
12379
|
+
L.push("");
|
|
12380
|
+
L.push(`If \`kaddo\` is not available in \`PATH\`, try the local project runner${pmNote} before`);
|
|
12381
|
+
L.push("reporting that Kaddo is unavailable:", "");
|
|
12382
|
+
L.push("```bash");
|
|
12383
|
+
for (const f of commandFallbacks(pm)) L.push(f);
|
|
12384
|
+
L.push("```");
|
|
12385
|
+
L.push("");
|
|
12386
|
+
L.push("Do not fail immediately just because the global `kaddo` binary is missing. When you use a");
|
|
12387
|
+
L.push('fallback, mention it briefly (e.g. "the global `kaddo` was not available, so I used the local');
|
|
12388
|
+
L.push('runner").');
|
|
12389
|
+
L.push("");
|
|
12390
|
+
return L;
|
|
12391
|
+
}
|
|
12349
12392
|
function detectMcpHint(dir) {
|
|
12350
12393
|
for (const f of [".mcp.json", "mcp.json", ".cursor/mcp.json"]) {
|
|
12351
12394
|
if (exists(join(dir, f))) return true;
|
|
@@ -12441,32 +12484,7 @@ function renderAgentsMd(ctx) {
|
|
|
12441
12484
|
}
|
|
12442
12485
|
L.push("");
|
|
12443
12486
|
}
|
|
12444
|
-
|
|
12445
|
-
L.push("Prefer the direct command when available:", "");
|
|
12446
|
-
L.push("```bash");
|
|
12447
|
-
L.push("kaddo <command>");
|
|
12448
|
-
L.push("```");
|
|
12449
|
-
L.push("");
|
|
12450
|
-
L.push("If the global `kaddo` command is not available in `PATH`, try the local project runner");
|
|
12451
|
-
L.push("before reporting that Kaddo is unavailable:", "");
|
|
12452
|
-
L.push("```bash");
|
|
12453
|
-
L.push("corepack pnpm exec kaddo <command>");
|
|
12454
|
-
L.push("```");
|
|
12455
|
-
L.push("");
|
|
12456
|
-
L.push("If that is not available, try:", "");
|
|
12457
|
-
L.push("```bash");
|
|
12458
|
-
L.push("pnpm exec kaddo <command>");
|
|
12459
|
-
L.push("```");
|
|
12460
|
-
L.push("");
|
|
12461
|
-
L.push("As a last resort (may resolve/download the package):", "");
|
|
12462
|
-
L.push("```bash");
|
|
12463
|
-
L.push("npx kaddo <command>");
|
|
12464
|
-
L.push("```");
|
|
12465
|
-
L.push("");
|
|
12466
|
-
L.push("Do not assume Kaddo is unavailable until these local fallbacks have been attempted. When you");
|
|
12467
|
-
L.push('use a fallback, mention it briefly (e.g. "the global `kaddo` was not available, so I used');
|
|
12468
|
-
L.push('`corepack pnpm exec kaddo`").');
|
|
12469
|
-
L.push("");
|
|
12487
|
+
for (const line of commandFallbackSection(ctx.packageManager, "## ")) L.push(line);
|
|
12470
12488
|
L.push("## Useful Kaddo commands", "");
|
|
12471
12489
|
L.push("```bash");
|
|
12472
12490
|
for (const c of ["kaddo context", "kaddo understand", "kaddo explain", "kaddo graph export", "kaddo questions", "kaddo guard", "kaddo impact", "kaddo savings", "kaddo drift"]) {
|
|
@@ -12528,16 +12546,7 @@ function renderKaddoBlock(ctx) {
|
|
|
12528
12546
|
L.push("- Do not modify `.kaddo/` manually; it is generated output.");
|
|
12529
12547
|
L.push("- Do not commit without user confirmation.");
|
|
12530
12548
|
L.push("");
|
|
12531
|
-
|
|
12532
|
-
L.push("Prefer `kaddo <command>`. If the global `kaddo` is not on `PATH`, try the local runner");
|
|
12533
|
-
L.push("before reporting Kaddo is unavailable:");
|
|
12534
|
-
L.push("```bash");
|
|
12535
|
-
L.push("corepack pnpm exec kaddo <command>");
|
|
12536
|
-
L.push("pnpm exec kaddo <command>");
|
|
12537
|
-
L.push("npx kaddo <command>");
|
|
12538
|
-
L.push("```");
|
|
12539
|
-
L.push("Do not assume Kaddo is unavailable until these fallbacks have been attempted.");
|
|
12540
|
-
L.push("");
|
|
12549
|
+
for (const line of commandFallbackSection(ctx.packageManager, "### ")) L.push(line);
|
|
12541
12550
|
L.push("### Before roadmap work", "");
|
|
12542
12551
|
L.push("Check open-questions readiness first. If blocking open questions exist, ask the user to");
|
|
12543
12552
|
L.push("resolve, assume or defer them before generating the roadmap.");
|