@dadado/agent-kit-cli 4.2.2 → 4.2.4
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/index.js +36 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2393,11 +2393,16 @@ var initCommand = defineCommand5({
|
|
|
2393
2393
|
"Registry unavailable in this directory: use agent-kit install / agent-kit add <id> with --registry or remote cache."
|
|
2394
2394
|
);
|
|
2395
2395
|
}
|
|
2396
|
+
console.log("\nNext:");
|
|
2397
|
+
console.log(` Open this folder in Cursor: ${scan.rootDir}`);
|
|
2398
|
+
console.log(" Run /start-project in chat");
|
|
2399
|
+
console.log(" Optional: agent-kit status");
|
|
2396
2400
|
outro("Setup completed.");
|
|
2397
2401
|
}
|
|
2398
2402
|
});
|
|
2399
2403
|
|
|
2400
2404
|
// src/commands/install.ts
|
|
2405
|
+
import path24 from "path";
|
|
2401
2406
|
import { defineCommand as defineCommand6 } from "citty";
|
|
2402
2407
|
|
|
2403
2408
|
// src/lifecycle/sync.ts
|
|
@@ -2442,6 +2447,12 @@ function parsePackList(raw) {
|
|
|
2442
2447
|
)
|
|
2443
2448
|
];
|
|
2444
2449
|
}
|
|
2450
|
+
function printInstallNextSteps(projectRoot) {
|
|
2451
|
+
console.log("\nNext:");
|
|
2452
|
+
console.log(` Open this folder in Cursor: ${projectRoot}`);
|
|
2453
|
+
console.log(" Run /start-project in chat");
|
|
2454
|
+
console.log(" Optional: agent-kit status");
|
|
2455
|
+
}
|
|
2445
2456
|
var installCommand = defineCommand6({
|
|
2446
2457
|
meta: {
|
|
2447
2458
|
name: "install",
|
|
@@ -2464,15 +2475,17 @@ var installCommand = defineCommand6({
|
|
|
2464
2475
|
...REGISTRY_CLI_ARGS
|
|
2465
2476
|
},
|
|
2466
2477
|
async run({ args }) {
|
|
2478
|
+
const projectRoot = path24.resolve(args.cwd);
|
|
2479
|
+
logger.info(`Installing into: ${projectRoot}`);
|
|
2467
2480
|
const packs = parsePackList(args.pack);
|
|
2468
2481
|
for (const id of packs) {
|
|
2469
2482
|
if (!DOMAIN_PACK_IDS.includes(id)) {
|
|
2470
2483
|
logger.warn(`Pack '${id}' is not in the known L1 list \u2014 will still try registry.`);
|
|
2471
2484
|
}
|
|
2472
2485
|
}
|
|
2473
|
-
const existing = await loadAgentKitManifest(
|
|
2486
|
+
const existing = await loadAgentKitManifest(projectRoot);
|
|
2474
2487
|
const registry = await resolveRegistryFromCli({
|
|
2475
|
-
cwd:
|
|
2488
|
+
cwd: projectRoot,
|
|
2476
2489
|
registry: args.registry,
|
|
2477
2490
|
url: args.url,
|
|
2478
2491
|
ref: args.ref,
|
|
@@ -2491,19 +2504,20 @@ var installCommand = defineCommand6({
|
|
|
2491
2504
|
});
|
|
2492
2505
|
let stats;
|
|
2493
2506
|
if ((draft.packs?.length ?? 0) > 0 || (draft.skills?.length ?? 0) > 0) {
|
|
2494
|
-
stats = await syncFromManifest(registry.root,
|
|
2507
|
+
stats = await syncFromManifest(registry.root, projectRoot, draft);
|
|
2495
2508
|
} else {
|
|
2496
2509
|
const protectedGlobs = resolveProtectedGlobs(draft);
|
|
2497
|
-
stats = await installL0(registry.root,
|
|
2510
|
+
stats = await installL0(registry.root, projectRoot, protectedGlobs);
|
|
2498
2511
|
}
|
|
2499
|
-
const manifestPath = await saveManifest(
|
|
2512
|
+
const manifestPath = await saveManifest(projectRoot, draft);
|
|
2500
2513
|
logApplyStats(stats);
|
|
2501
2514
|
logger.success(`Manifest written: ${manifestPath}`);
|
|
2515
|
+
printInstallNextSteps(projectRoot);
|
|
2502
2516
|
}
|
|
2503
2517
|
});
|
|
2504
2518
|
|
|
2505
2519
|
// src/commands/run-plan.ts
|
|
2506
|
-
import
|
|
2520
|
+
import path28 from "path";
|
|
2507
2521
|
import { defineCommand as defineCommand7 } from "citty";
|
|
2508
2522
|
|
|
2509
2523
|
// src/plan-loop/backends.ts
|
|
@@ -2589,12 +2603,12 @@ function listBackendIds() {
|
|
|
2589
2603
|
|
|
2590
2604
|
// src/plan-loop/run-loop.ts
|
|
2591
2605
|
import { mkdir as mkdir4, readFile as readFile10, rm, unlink } from "fs/promises";
|
|
2592
|
-
import
|
|
2606
|
+
import path27 from "path";
|
|
2593
2607
|
|
|
2594
2608
|
// src/plan-loop/external-review.ts
|
|
2595
2609
|
import { spawn as spawn3 } from "child_process";
|
|
2596
|
-
import
|
|
2597
|
-
var SCRIPT_REL =
|
|
2610
|
+
import path25 from "path";
|
|
2611
|
+
var SCRIPT_REL = path25.join("scripts", "plan-external-review.sh");
|
|
2598
2612
|
function isPlanExhaustedReason(reason) {
|
|
2599
2613
|
const r = reason.trim().toLowerCase();
|
|
2600
2614
|
if (!r) return false;
|
|
@@ -2615,7 +2629,7 @@ async function armExternalPlanReview(root, deps = {}) {
|
|
|
2615
2629
|
const spawnFn = deps.spawnFn ?? spawn3;
|
|
2616
2630
|
const existsFn = deps.existsFn ?? fileExists;
|
|
2617
2631
|
const log = deps.log ?? ((line) => console.log(line));
|
|
2618
|
-
const scriptPath =
|
|
2632
|
+
const scriptPath = path25.join(root, SCRIPT_REL);
|
|
2619
2633
|
if (!await existsFn(scriptPath)) {
|
|
2620
2634
|
log(
|
|
2621
2635
|
`tip: ${SCRIPT_REL} missing. Manual: /plan-external-review (enable externalPlanReview in .cursor/context/config.json).`
|
|
@@ -2659,7 +2673,7 @@ async function armExternalPlanReview(root, deps = {}) {
|
|
|
2659
2673
|
|
|
2660
2674
|
// src/plan-loop/plan-state.ts
|
|
2661
2675
|
import { readFile as readFile8, readdir as readdir3 } from "fs/promises";
|
|
2662
|
-
import
|
|
2676
|
+
import path26 from "path";
|
|
2663
2677
|
function countPendingTodos(raw) {
|
|
2664
2678
|
const lines = raw.split(/\r?\n/);
|
|
2665
2679
|
let inFront = 0;
|
|
@@ -2687,7 +2701,7 @@ function countPendingTodos(raw) {
|
|
|
2687
2701
|
async function findActivePlanFile(plansDir) {
|
|
2688
2702
|
if (!await fileExists(plansDir)) return null;
|
|
2689
2703
|
const files = (await readdir3(plansDir)).filter((f) => f.endsWith(".plan.md")).sort();
|
|
2690
|
-
return files[0] ?
|
|
2704
|
+
return files[0] ? path26.join(plansDir, files[0]) : null;
|
|
2691
2705
|
}
|
|
2692
2706
|
async function readPlan(planPath) {
|
|
2693
2707
|
return readFile8(planPath, "utf8");
|
|
@@ -2764,9 +2778,9 @@ function sleep(ms) {
|
|
|
2764
2778
|
return new Promise((r) => setTimeout(r, ms));
|
|
2765
2779
|
}
|
|
2766
2780
|
async function runPlanLoop(opts) {
|
|
2767
|
-
const plansDir =
|
|
2768
|
-
const stopFile =
|
|
2769
|
-
const logDir =
|
|
2781
|
+
const plansDir = path27.join(opts.root, ".cursor", "plans");
|
|
2782
|
+
const stopFile = path27.join(opts.root, ".cursor", "loop.stop");
|
|
2783
|
+
const logDir = path27.join(opts.root, ".cursor", "loop-logs");
|
|
2770
2784
|
const planPath = await findActivePlanFile(plansDir);
|
|
2771
2785
|
if (!planPath) {
|
|
2772
2786
|
logger.error("No active plan in .cursor/plans/");
|
|
@@ -2785,7 +2799,7 @@ async function runPlanLoop(opts) {
|
|
|
2785
2799
|
};
|
|
2786
2800
|
process.on("SIGINT", onSigInt);
|
|
2787
2801
|
try {
|
|
2788
|
-
console.log(`Active plan: ${
|
|
2802
|
+
console.log(`Active plan: ${path27.basename(planPath)}`);
|
|
2789
2803
|
console.log(`Pending to-dos: ${await pending()} | max ticks: ${opts.maxTicks}`);
|
|
2790
2804
|
console.log(`Backend: ${opts.backend.id}`);
|
|
2791
2805
|
if (opts.dryRun) {
|
|
@@ -2821,8 +2835,8 @@ async function runPlanLoop(opts) {
|
|
|
2821
2835
|
planExhausted = true;
|
|
2822
2836
|
break;
|
|
2823
2837
|
}
|
|
2824
|
-
const logPath =
|
|
2825
|
-
const relLog =
|
|
2838
|
+
const logPath = path27.join(logDir, `tick-${stamp()}.log`);
|
|
2839
|
+
const relLog = path27.relative(opts.root, logPath);
|
|
2826
2840
|
console.log("");
|
|
2827
2841
|
console.log(`=== tick ${tick}/${opts.maxTicks} - pending: ${before} - log: ${relLog} ===`);
|
|
2828
2842
|
let agentExit = 0;
|
|
@@ -2886,7 +2900,7 @@ async function runPlanLoop(opts) {
|
|
|
2886
2900
|
const pendingNow = await pending();
|
|
2887
2901
|
console.log("");
|
|
2888
2902
|
console.log(
|
|
2889
|
-
`Loop finished after ${tick} tick(s). Pending now: ${pendingNow}. Logs in ${
|
|
2903
|
+
`Loop finished after ${tick} tick(s). Pending now: ${pendingNow}. Logs in ${path27.relative(opts.root, logDir)}/`
|
|
2890
2904
|
);
|
|
2891
2905
|
if (planExhausted || shouldArmExternalPlanReview({ pending: pendingNow, stopReason })) {
|
|
2892
2906
|
await armExternalPlanReview(opts.root);
|
|
@@ -2957,7 +2971,7 @@ var runPlanCommand = defineCommand7({
|
|
|
2957
2971
|
return;
|
|
2958
2972
|
}
|
|
2959
2973
|
const code = await runPlanLoop({
|
|
2960
|
-
root:
|
|
2974
|
+
root: path28.resolve(args.cwd),
|
|
2961
2975
|
maxTicks,
|
|
2962
2976
|
sleepSeconds,
|
|
2963
2977
|
model: args.model ? String(args.model) : void 0,
|
|
@@ -2991,7 +3005,7 @@ var scanCommand = defineCommand8({
|
|
|
2991
3005
|
});
|
|
2992
3006
|
|
|
2993
3007
|
// src/commands/status.ts
|
|
2994
|
-
import
|
|
3008
|
+
import path29 from "path";
|
|
2995
3009
|
import { defineCommand as defineCommand9 } from "citty";
|
|
2996
3010
|
var statusCommand = defineCommand9({
|
|
2997
3011
|
meta: {
|
|
@@ -3011,7 +3025,7 @@ var statusCommand = defineCommand9({
|
|
|
3011
3025
|
},
|
|
3012
3026
|
async run({ args }) {
|
|
3013
3027
|
const manifest = await loadAgentKitManifest(args.cwd);
|
|
3014
|
-
const profilePath =
|
|
3028
|
+
const profilePath = path29.join(args.cwd, ".cursor", "agent-kit.config.json");
|
|
3015
3029
|
const profile = await readJson(profilePath);
|
|
3016
3030
|
if (args.json) {
|
|
3017
3031
|
console.log(
|