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