@dadado/agent-kit-cli 6.23.0 → 6.26.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/README.md +1 -0
- package/dashboard/dashboard-data.mjs +126 -5
- package/dashboard/dashboard.html +48 -7
- package/dashboard/lib/guards.mjs +1 -0
- package/dashboard/lib/live-refresh.mjs +1 -0
- package/dist/{add-RKZQX6ZK.js → add-G7KEZLWP.js} +17 -8
- package/dist/{chunk-7HDQEK6T.js → chunk-2G4K4ZI5.js} +7 -3
- package/dist/{chunk-5PSV76CQ.js → chunk-2GXN7HVG.js} +26 -7
- package/dist/chunk-2QYWMSI5.js +193 -0
- package/dist/{chunk-B3VR5YBQ.js → chunk-2TW7ENWC.js} +12 -11
- package/dist/{chunk-IESSMKOV.js → chunk-5A72LTR3.js} +7 -7
- package/dist/{chunk-R4DUO5DA.js → chunk-AXQMVQ6O.js} +61 -237
- package/dist/{chunk-6WUKLS4D.js → chunk-BIFTTL2O.js} +1 -1
- package/dist/{chunk-AWQ6KRFV.js → chunk-BVZDPVUL.js} +1 -1
- package/dist/{chunk-QNISTPPZ.js → chunk-ENRXS5O6.js} +19 -12
- package/dist/chunk-FB6G6OD6.js +519 -0
- package/dist/{chunk-MFKHIWEL.js → chunk-FOVHFMSH.js} +1 -1
- package/dist/{chunk-6BEFGKCU.js → chunk-FUSNEYGU.js} +29 -3
- package/dist/chunk-H7KAXI5R.js +357 -0
- package/dist/chunk-HGB4DHXV.js +138 -0
- package/dist/{chunk-W3ZJVBNY.js → chunk-HXV6VQD4.js} +2374 -983
- package/dist/{chunk-BGL5DRK2.js → chunk-I3FGWNU5.js} +4 -4
- package/dist/chunk-IHVJTGYR.js +144 -0
- package/dist/{chunk-5LNHRL5E.js → chunk-IUY24WPE.js} +93 -263
- package/dist/chunk-JG5MKMOM.js +248 -0
- package/dist/{chunk-SGTTC2JP.js → chunk-JWIJHO67.js} +17 -2
- package/dist/chunk-KMK4T4ZM.js +34 -0
- package/dist/{chunk-ZMYV6PRE.js → chunk-LEVNLHH3.js} +2 -1
- package/dist/{chunk-2IP4OO6R.js → chunk-MGVV6YC4.js} +1 -1
- package/dist/{chunk-7TYA3GMI.js → chunk-MWRYQLEG.js} +7 -4
- package/dist/chunk-NHJ4IAVN.js +435 -0
- package/dist/{chunk-C4Q77GGJ.js → chunk-O7VMHCNN.js} +6 -0
- package/dist/{chunk-5EBT3V7G.js → chunk-OVRGTHZD.js} +1 -1
- package/dist/{chunk-F7YAAKYP.js → chunk-PCIYXGB3.js} +7 -5
- package/dist/{chunk-UJCATSYO.js → chunk-PLLXFSN2.js} +46 -17
- package/dist/{chunk-OYFCBYMP.js → chunk-RJP47EGS.js} +18 -1
- package/dist/{chunk-KDJ4ML7I.js → chunk-RRJVC35Y.js} +4 -4
- package/dist/{chunk-DRZFWIBN.js → chunk-SWJJW624.js} +1 -1
- package/dist/{chunk-MJJBIOSY.js → chunk-SYRJ5TTK.js} +34 -12
- package/dist/{chunk-L5V3W3DY.js → chunk-TTUFIE26.js} +60 -14
- package/dist/{chunk-JFS4GKP7.js → chunk-XXPI4H4D.js} +2 -2
- package/dist/{chunk-CVZNSRXV.js → chunk-Y5526WCN.js} +84 -19
- package/dist/{chunk-CQHD6UKB.js → chunk-Y575INEC.js} +2 -1
- package/dist/{chunk-V2H57TFD.js → chunk-ZNZHDPS3.js} +80 -170
- package/dist/{commands-SAQEEE6V.js → commands-K4HSDML5.js} +8 -6
- package/dist/{conflicts-5JOP4GX2.js → conflicts-4SUWIPWP.js} +9 -10
- package/dist/{contribute-BQKRT5GN.js → contribute-HE4WCBRY.js} +7 -5
- package/dist/{countdown-25E5C7AR.js → countdown-TYQHVAIX.js} +305 -32
- package/dist/{dashboard-P65XHYCU.js → dashboard-6V6PCNYF.js} +1 -1
- package/dist/{dashboard-broadcast-GYK34QYL.js → dashboard-broadcast-PMVQ7PXU.js} +1 -1
- package/dist/{diff-6JSXBVSX.js → diff-3XUZM7ZT.js} +15 -6
- package/dist/{doctor-I3MTHS7F.js → doctor-KGUWU5SN.js} +106 -19
- package/dist/{engine-info-BBI5QO5Y.js → engine-info-VM4VPGQM.js} +2 -2
- package/dist/{ground-control-IDCXN5FK.js → ground-control-ZIDHEOPW.js} +7 -4
- package/dist/{guard-RJZEEKSL.js → guard-ZO4Z3LLB.js} +47 -9
- package/dist/{handoff-5AGE2D3T.js → handoff-LLT4CI6H.js} +4 -3
- package/dist/{hook-WNA42CXE.js → hook-UPZ3CPYS.js} +22 -20
- package/dist/index.js +51 -33
- package/dist/{init-FZ2UFPO7.js → init-ZHLVXEVT.js} +25 -18
- package/dist/install-XWOG64W3.js +42 -0
- package/dist/installs-2ROXPO6M.js +223 -0
- package/dist/{mission-control-CRMCRZUU.js → mission-control-IGOI3WHS.js} +2 -2
- package/dist/models-5BDXREWM.js +45 -0
- package/dist/paths-JTPV6SXH.js +107 -0
- package/dist/pi-DCMDOY65.js +248 -0
- package/dist/{plan-index-BNLUU6T5.js → plan-index-5QZJK4AG.js} +2 -3
- package/dist/{queue-JW4VR33H.js → queue-Z5VNNHM6.js} +10 -12
- package/dist/{run-X2WOONTB.js → run-QURAXAR2.js} +27 -33
- package/dist/{run-plan-4MOLLIES.js → run-plan-4MMHVCTS.js} +35 -23
- package/dist/{scan-K3T5RQLC.js → scan-7D3RMO34.js} +2 -1
- package/dist/{session-start-MV7A4263.js → session-start-NC2HE5X5.js} +20 -14
- package/dist/{sessions-UPFDWDMB.js → sessions-WWWLYPW6.js} +4 -4
- package/dist/{setup-global-VNADNTQ2.js → setup-global-WDMARD4Z.js} +12 -10
- package/dist/{status-SXA3OK5E.js → status-2WNJL7PP.js} +17 -13
- package/dist/update-YSVOYYK5.js +32 -0
- package/dist/update-all-5XLTCHPX.js +697 -0
- package/package.json +14 -4
- package/pi/agent-kit.ts +224 -0
- package/dist/chunk-4MR4QXMF.js +0 -52
- package/dist/chunk-7ABY6DYH.js +0 -89
- package/dist/chunk-C4LCOOL4.js +0 -71
- package/dist/chunk-DZCLMIAS.js +0 -391
- package/dist/chunk-HAFRAXGV.js +0 -17
- package/dist/chunk-MUTTNRX4.js +0 -53
- package/dist/install-CTLT3TSI.js +0 -38
- package/dist/update-RMAWXMCV.js +0 -304
|
@@ -2,27 +2,31 @@ import {
|
|
|
2
2
|
nextStepAfterInstall,
|
|
3
3
|
performInstall,
|
|
4
4
|
printInstallEpilogue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PLLXFSN2.js";
|
|
6
6
|
import {
|
|
7
7
|
NON_INTERACTIVE_ROOT_ARGS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2GXN7HVG.js";
|
|
9
9
|
import {
|
|
10
10
|
SkippedSymlinkError,
|
|
11
11
|
logApplyStats
|
|
12
12
|
} from "./chunk-HS7LVVLO.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-SWJJW624.js";
|
|
14
|
+
import "./chunk-PCIYXGB3.js";
|
|
15
|
+
import "./chunk-FB6G6OD6.js";
|
|
16
|
+
import "./chunk-BVZDPVUL.js";
|
|
17
|
+
import "./chunk-FUSNEYGU.js";
|
|
18
|
+
import {
|
|
19
|
+
feedInstallsRegistry
|
|
20
|
+
} from "./chunk-NHJ4IAVN.js";
|
|
18
21
|
import "./chunk-WGLPZXNU.js";
|
|
19
22
|
import "./chunk-Q35TWISF.js";
|
|
20
23
|
import {
|
|
21
24
|
withCliProgress
|
|
22
25
|
} from "./chunk-QTON2GQX.js";
|
|
23
26
|
import "./chunk-PNFF6OU3.js";
|
|
24
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-AXQMVQ6O.js";
|
|
25
28
|
import "./chunk-F6C3GFKV.js";
|
|
29
|
+
import "./chunk-2QYWMSI5.js";
|
|
26
30
|
import {
|
|
27
31
|
logger
|
|
28
32
|
} from "./chunk-ZB43YMHW.js";
|
|
@@ -32,21 +36,23 @@ import {
|
|
|
32
36
|
confirmProjectRoot,
|
|
33
37
|
isNonInteractive,
|
|
34
38
|
syncPathCliToRuntime
|
|
35
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-RRJVC35Y.js";
|
|
36
40
|
import {
|
|
37
41
|
assessEnvironment
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-4MR4QXMF.js";
|
|
42
|
+
} from "./chunk-2TW7ENWC.js";
|
|
43
|
+
import "./chunk-Y5526WCN.js";
|
|
44
|
+
import "./chunk-MWRYQLEG.js";
|
|
45
|
+
import "./chunk-HGB4DHXV.js";
|
|
43
46
|
import "./chunk-CGXLR77R.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-PFEUZXVT.js";
|
|
48
|
+
import "./chunk-ZNZHDPS3.js";
|
|
49
|
+
import "./chunk-RJP47EGS.js";
|
|
50
|
+
import "./chunk-IHVJTGYR.js";
|
|
51
|
+
import "./chunk-KMK4T4ZM.js";
|
|
46
52
|
import {
|
|
47
53
|
KIT_VERSION
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
54
|
+
} from "./chunk-2G4K4ZI5.js";
|
|
55
|
+
import "./chunk-O7VMHCNN.js";
|
|
50
56
|
import "./chunk-5B4DVO6C.js";
|
|
51
57
|
|
|
52
58
|
// src/commands/init.ts
|
|
@@ -98,6 +104,7 @@ ${err.recovery}
|
|
|
98
104
|
const result = await withCliProgress("init", () => runInitCompatibility(projectRoot));
|
|
99
105
|
const pending = result.readiness.pendingActions.length;
|
|
100
106
|
logger.success(`L0 and readiness prepared in ${result.projectRoot}`);
|
|
107
|
+
await feedInstallsRegistry(result.projectRoot);
|
|
101
108
|
const nextStep = nextStepAfterInstall(pending);
|
|
102
109
|
const env = await assessEnvironment();
|
|
103
110
|
const sync = await syncPathCliToRuntime({ runtimeVersion: KIT_VERSION, env });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
installCommand,
|
|
3
|
+
nextStepAfterInstall,
|
|
4
|
+
performInstall,
|
|
5
|
+
printInstallEpilogue
|
|
6
|
+
} from "./chunk-PLLXFSN2.js";
|
|
7
|
+
import "./chunk-2GXN7HVG.js";
|
|
8
|
+
import "./chunk-HS7LVVLO.js";
|
|
9
|
+
import "./chunk-SWJJW624.js";
|
|
10
|
+
import "./chunk-PCIYXGB3.js";
|
|
11
|
+
import "./chunk-FB6G6OD6.js";
|
|
12
|
+
import "./chunk-BVZDPVUL.js";
|
|
13
|
+
import "./chunk-FUSNEYGU.js";
|
|
14
|
+
import "./chunk-NHJ4IAVN.js";
|
|
15
|
+
import "./chunk-WGLPZXNU.js";
|
|
16
|
+
import "./chunk-Q35TWISF.js";
|
|
17
|
+
import "./chunk-QTON2GQX.js";
|
|
18
|
+
import "./chunk-PNFF6OU3.js";
|
|
19
|
+
import "./chunk-AXQMVQ6O.js";
|
|
20
|
+
import "./chunk-F6C3GFKV.js";
|
|
21
|
+
import "./chunk-2QYWMSI5.js";
|
|
22
|
+
import "./chunk-ZB43YMHW.js";
|
|
23
|
+
import "./chunk-RRJVC35Y.js";
|
|
24
|
+
import "./chunk-2TW7ENWC.js";
|
|
25
|
+
import "./chunk-Y5526WCN.js";
|
|
26
|
+
import "./chunk-MWRYQLEG.js";
|
|
27
|
+
import "./chunk-HGB4DHXV.js";
|
|
28
|
+
import "./chunk-CGXLR77R.js";
|
|
29
|
+
import "./chunk-PFEUZXVT.js";
|
|
30
|
+
import "./chunk-ZNZHDPS3.js";
|
|
31
|
+
import "./chunk-RJP47EGS.js";
|
|
32
|
+
import "./chunk-IHVJTGYR.js";
|
|
33
|
+
import "./chunk-KMK4T4ZM.js";
|
|
34
|
+
import "./chunk-2G4K4ZI5.js";
|
|
35
|
+
import "./chunk-O7VMHCNN.js";
|
|
36
|
+
import "./chunk-5B4DVO6C.js";
|
|
37
|
+
export {
|
|
38
|
+
installCommand,
|
|
39
|
+
nextStepAfterInstall,
|
|
40
|
+
performInstall,
|
|
41
|
+
printInstallEpilogue
|
|
42
|
+
};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_SCAN_DEPTH,
|
|
3
|
+
DEFAULT_SCAN_MAX_DIRS,
|
|
4
|
+
InstallsRegistryError,
|
|
5
|
+
listInstalls,
|
|
6
|
+
pruneMissingInstalls,
|
|
7
|
+
recordInstalls,
|
|
8
|
+
resolveInstallsFile,
|
|
9
|
+
scanForInstalls
|
|
10
|
+
} from "./chunk-NHJ4IAVN.js";
|
|
11
|
+
import {
|
|
12
|
+
logger
|
|
13
|
+
} from "./chunk-ZB43YMHW.js";
|
|
14
|
+
import "./chunk-IHVJTGYR.js";
|
|
15
|
+
import "./chunk-KMK4T4ZM.js";
|
|
16
|
+
import "./chunk-2G4K4ZI5.js";
|
|
17
|
+
import "./chunk-O7VMHCNN.js";
|
|
18
|
+
import "./chunk-5B4DVO6C.js";
|
|
19
|
+
|
|
20
|
+
// src/commands/installs.ts
|
|
21
|
+
import { homedir } from "os";
|
|
22
|
+
import path from "path";
|
|
23
|
+
import { defineCommand } from "citty";
|
|
24
|
+
function collectRepeatedFlag(rawArgs, flag) {
|
|
25
|
+
const values = [];
|
|
26
|
+
const long = `--${flag}`;
|
|
27
|
+
for (let i = 0; i < rawArgs.length; i += 1) {
|
|
28
|
+
const arg = rawArgs[i];
|
|
29
|
+
if (arg === long) {
|
|
30
|
+
const value = rawArgs[i + 1];
|
|
31
|
+
if (value !== void 0 && !value.startsWith("--")) {
|
|
32
|
+
values.push(value);
|
|
33
|
+
i += 1;
|
|
34
|
+
}
|
|
35
|
+
} else if (arg.startsWith(`${long}=`)) {
|
|
36
|
+
values.push(arg.slice(long.length + 1));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return values.filter((v) => v.trim() !== "");
|
|
40
|
+
}
|
|
41
|
+
function parsePositiveInt(value, fallback, name) {
|
|
42
|
+
if (value === void 0 || value === "") return fallback;
|
|
43
|
+
const n = Number(value);
|
|
44
|
+
if (!Number.isInteger(n) || n < 0) {
|
|
45
|
+
throw new Error(`--${name} must be a non-negative integer (got ${String(value)})`);
|
|
46
|
+
}
|
|
47
|
+
return n;
|
|
48
|
+
}
|
|
49
|
+
var EMPTY_LIST = "No installs recorded yet. Run `agent-kit installs scan` or any install, update or doctor.";
|
|
50
|
+
function renderInstallsTable(entries, home = homedir(), empty = EMPTY_LIST) {
|
|
51
|
+
if (entries.length === 0) return empty;
|
|
52
|
+
const display = (p) => p === home ? "~" : p.startsWith(`${home}${path.sep}`) ? `~${p.slice(home.length)}` : p;
|
|
53
|
+
const rows = entries.map((e) => [
|
|
54
|
+
e.kind,
|
|
55
|
+
e.kitVersion ?? "?",
|
|
56
|
+
display(e.path),
|
|
57
|
+
e.remote ?? "(no remote)",
|
|
58
|
+
e.lastSeen.slice(0, 10)
|
|
59
|
+
]);
|
|
60
|
+
const header = ["KIND", "KIT", "PATH", "REMOTE", "SEEN"];
|
|
61
|
+
const widths = header.map((h, i) => Math.max(h.length, ...rows.map((r) => (r[i] ?? "").length)));
|
|
62
|
+
const fmt = (r) => r.map((c, i) => i === r.length - 1 ? c : c.padEnd(widths[i] ?? 0)).join(" ").trimEnd();
|
|
63
|
+
return [fmt(header), ...rows.map(fmt)].join("\n");
|
|
64
|
+
}
|
|
65
|
+
function reportRegistryError(err) {
|
|
66
|
+
if (err instanceof InstallsRegistryError) {
|
|
67
|
+
logger.error(err.message);
|
|
68
|
+
process.exitCode = 1;
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
async function printInstallsList(json) {
|
|
74
|
+
let entries;
|
|
75
|
+
try {
|
|
76
|
+
entries = await listInstalls();
|
|
77
|
+
} catch (err) {
|
|
78
|
+
if (reportRegistryError(err)) return;
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
if (json) {
|
|
82
|
+
process.stdout.write(
|
|
83
|
+
`${JSON.stringify({ file: resolveInstallsFile(), installs: entries }, null, 2)}
|
|
84
|
+
`
|
|
85
|
+
);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
process.stdout.write(`${renderInstallsTable(entries)}
|
|
89
|
+
`);
|
|
90
|
+
}
|
|
91
|
+
var listCommand = defineCommand({
|
|
92
|
+
meta: { name: "list", description: "List the installs recorded on this machine (default)" },
|
|
93
|
+
args: {
|
|
94
|
+
json: { type: "boolean", description: "Print the rows as JSON", default: false }
|
|
95
|
+
},
|
|
96
|
+
run({ args }) {
|
|
97
|
+
return printInstallsList(args.json);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
var scanCommand = defineCommand({
|
|
101
|
+
meta: {
|
|
102
|
+
name: "scan",
|
|
103
|
+
description: "Find kit installs (.cursor/agent-kit.json) under bounded roots and record them (default root: $HOME)"
|
|
104
|
+
},
|
|
105
|
+
args: {
|
|
106
|
+
root: {
|
|
107
|
+
type: "string",
|
|
108
|
+
description: "Directory to walk; repeat for several roots (default: $HOME)"
|
|
109
|
+
},
|
|
110
|
+
depth: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: `Maximum directory depth below each root (default ${DEFAULT_SCAN_DEPTH})`
|
|
113
|
+
},
|
|
114
|
+
"max-dirs": {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: `Stop after visiting this many directories (default ${DEFAULT_SCAN_MAX_DIRS})`
|
|
117
|
+
},
|
|
118
|
+
json: { type: "boolean", description: "Print the result as JSON", default: false }
|
|
119
|
+
},
|
|
120
|
+
async run({ args, rawArgs }) {
|
|
121
|
+
const roots = collectRepeatedFlag(rawArgs, "root");
|
|
122
|
+
const scanRoots = roots.length > 0 ? roots.map((r) => path.resolve(r)) : [homedir()];
|
|
123
|
+
let maxDepth;
|
|
124
|
+
let maxDirs;
|
|
125
|
+
try {
|
|
126
|
+
maxDepth = parsePositiveInt(args.depth, DEFAULT_SCAN_DEPTH, "depth");
|
|
127
|
+
maxDirs = parsePositiveInt(args["max-dirs"], DEFAULT_SCAN_MAX_DIRS, "max-dirs");
|
|
128
|
+
} catch (err) {
|
|
129
|
+
logger.error(err.message);
|
|
130
|
+
process.exitCode = 2;
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const scan = await scanForInstalls(scanRoots, { maxDepth, maxDirs });
|
|
134
|
+
let written;
|
|
135
|
+
try {
|
|
136
|
+
written = await recordInstalls(scan.found);
|
|
137
|
+
} catch (err) {
|
|
138
|
+
if (reportRegistryError(err)) return;
|
|
139
|
+
throw err;
|
|
140
|
+
}
|
|
141
|
+
if (args.json) {
|
|
142
|
+
process.stdout.write(
|
|
143
|
+
`${JSON.stringify(
|
|
144
|
+
{
|
|
145
|
+
roots: scanRoots,
|
|
146
|
+
visited: scan.visited,
|
|
147
|
+
truncated: scan.truncated,
|
|
148
|
+
recorded: written
|
|
149
|
+
},
|
|
150
|
+
null,
|
|
151
|
+
2
|
|
152
|
+
)}
|
|
153
|
+
`
|
|
154
|
+
);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
process.stdout.write(
|
|
158
|
+
`${renderInstallsTable(written, homedir(), "No kit installs (.cursor/agent-kit.json) found.")}
|
|
159
|
+
`
|
|
160
|
+
);
|
|
161
|
+
logger.info(
|
|
162
|
+
`Scanned ${scan.visited} directories under ${scanRoots.join(", ")} (depth ${maxDepth}); recorded ${written.length} install(s) in ${resolveInstallsFile()}.`
|
|
163
|
+
);
|
|
164
|
+
if (scan.truncated) {
|
|
165
|
+
logger.warn(
|
|
166
|
+
`Stopped at ${maxDirs} directories; pass --root for a narrower folder or --max-dirs to raise the cap.`
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
var pruneCommand = defineCommand({
|
|
172
|
+
meta: {
|
|
173
|
+
name: "prune",
|
|
174
|
+
description: "Remove recorded installs whose folder or .cursor/agent-kit.json is gone"
|
|
175
|
+
},
|
|
176
|
+
args: {
|
|
177
|
+
json: { type: "boolean", description: "Print the removed rows as JSON", default: false }
|
|
178
|
+
},
|
|
179
|
+
async run({ args }) {
|
|
180
|
+
let removed;
|
|
181
|
+
try {
|
|
182
|
+
removed = await pruneMissingInstalls();
|
|
183
|
+
} catch (err) {
|
|
184
|
+
if (reportRegistryError(err)) return;
|
|
185
|
+
throw err;
|
|
186
|
+
}
|
|
187
|
+
if (args.json) {
|
|
188
|
+
process.stdout.write(`${JSON.stringify({ removed }, null, 2)}
|
|
189
|
+
`);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
if (removed.length === 0) {
|
|
193
|
+
logger.info("Nothing to prune: every recorded install still exists.");
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
for (const entry of removed) console.log(`pruned ${entry.path}`);
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
var SUBCOMMANDS = /* @__PURE__ */ new Set(["list", "scan", "prune"]);
|
|
200
|
+
var installsCommand = defineCommand({
|
|
201
|
+
meta: {
|
|
202
|
+
name: "installs",
|
|
203
|
+
description: "List, scan and prune the kit installs recorded on this machine (~/.config/agent-kit/installs.json)"
|
|
204
|
+
},
|
|
205
|
+
args: {
|
|
206
|
+
json: { type: "boolean", description: "Print the rows as JSON", default: false }
|
|
207
|
+
},
|
|
208
|
+
subCommands: {
|
|
209
|
+
list: listCommand,
|
|
210
|
+
scan: scanCommand,
|
|
211
|
+
prune: pruneCommand
|
|
212
|
+
},
|
|
213
|
+
async run({ args, rawArgs }) {
|
|
214
|
+
const first = rawArgs.find((a) => !a.startsWith("-"));
|
|
215
|
+
if (first && SUBCOMMANDS.has(first)) return;
|
|
216
|
+
await printInstallsList(args.json);
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
export {
|
|
220
|
+
collectRepeatedFlag,
|
|
221
|
+
installsCommand,
|
|
222
|
+
renderInstallsTable
|
|
223
|
+
};
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
findDashboardDataScript,
|
|
4
4
|
loadDashboardSnapshot,
|
|
5
5
|
runMcTuiLoop
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y575INEC.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveDashboardSnapshotRoot
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-LEVNLHH3.js";
|
|
10
10
|
import "./chunk-QTON2GQX.js";
|
|
11
11
|
import {
|
|
12
12
|
logger
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
discoverLocalModels,
|
|
3
|
+
renderLocalModels
|
|
4
|
+
} from "./chunk-HXV6VQD4.js";
|
|
5
|
+
import "./chunk-P7732A25.js";
|
|
6
|
+
import "./chunk-TTUFIE26.js";
|
|
7
|
+
import "./chunk-WGLPZXNU.js";
|
|
8
|
+
import "./chunk-Q35TWISF.js";
|
|
9
|
+
import "./chunk-QTON2GQX.js";
|
|
10
|
+
import "./chunk-PFEUZXVT.js";
|
|
11
|
+
import "./chunk-O7VMHCNN.js";
|
|
12
|
+
import "./chunk-5B4DVO6C.js";
|
|
13
|
+
|
|
14
|
+
// src/commands/models.ts
|
|
15
|
+
import { defineCommand } from "citty";
|
|
16
|
+
async function runModelsCommand(json, deps = {}) {
|
|
17
|
+
const report = await discoverLocalModels(deps);
|
|
18
|
+
return {
|
|
19
|
+
exitCode: 0,
|
|
20
|
+
stdout: json ? JSON.stringify(report, null, 2) : renderLocalModels(report)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
var modelsCommand = defineCommand({
|
|
24
|
+
meta: {
|
|
25
|
+
name: "models",
|
|
26
|
+
description: "List local text models (Omarchy, Ollama, LM Studio, llama.cpp; read-only, loopback only; --json)"
|
|
27
|
+
},
|
|
28
|
+
args: {
|
|
29
|
+
json: {
|
|
30
|
+
type: "boolean",
|
|
31
|
+
default: false,
|
|
32
|
+
description: "Print { schemaVersion, models, sources, pi } as JSON"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async run({ args }) {
|
|
36
|
+
const result = await runModelsCommand(args.json === true);
|
|
37
|
+
process.stdout.write(`${result.stdout}
|
|
38
|
+
`);
|
|
39
|
+
process.exitCode = result.exitCode;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export {
|
|
43
|
+
modelsCommand,
|
|
44
|
+
runModelsCommand
|
|
45
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CURSOR_COMMANDS_DIR_REL
|
|
3
|
+
} from "./chunk-FUSNEYGU.js";
|
|
4
|
+
import "./chunk-RJP47EGS.js";
|
|
5
|
+
import {
|
|
6
|
+
MANIFEST_RELATIVE_PATH
|
|
7
|
+
} from "./chunk-KMK4T4ZM.js";
|
|
8
|
+
import {
|
|
9
|
+
KIT_VERSION
|
|
10
|
+
} from "./chunk-2G4K4ZI5.js";
|
|
11
|
+
import {
|
|
12
|
+
SKILL_DIRS_REL
|
|
13
|
+
} from "./chunk-O7VMHCNN.js";
|
|
14
|
+
import {
|
|
15
|
+
fileExists
|
|
16
|
+
} from "./chunk-5B4DVO6C.js";
|
|
17
|
+
|
|
18
|
+
// src/commands/paths.ts
|
|
19
|
+
import { defineCommand } from "citty";
|
|
20
|
+
|
|
21
|
+
// src/lifecycle/kit-surface-paths.ts
|
|
22
|
+
import { stat } from "fs/promises";
|
|
23
|
+
import path from "path";
|
|
24
|
+
var KIT_SURFACE_PATHS_SCHEMA_VERSION = 1;
|
|
25
|
+
async function isDirectory(target) {
|
|
26
|
+
try {
|
|
27
|
+
return (await stat(target)).isDirectory();
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
async function resolveKitRoot(cwd) {
|
|
33
|
+
let dir = path.resolve(cwd);
|
|
34
|
+
for (; ; ) {
|
|
35
|
+
if (await fileExists(path.join(dir, MANIFEST_RELATIVE_PATH))) return dir;
|
|
36
|
+
if (await fileExists(path.join(dir, ".git"))) return null;
|
|
37
|
+
const parent = path.dirname(dir);
|
|
38
|
+
if (parent === dir) return null;
|
|
39
|
+
dir = parent;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function resolveKitSurfacePaths(cwd) {
|
|
43
|
+
const root = await resolveKitRoot(cwd);
|
|
44
|
+
if (!root) return null;
|
|
45
|
+
const commandsDir = path.join(root, CURSOR_COMMANDS_DIR_REL);
|
|
46
|
+
const skillDirs = SKILL_DIRS_REL.map((rel) => path.join(root, rel));
|
|
47
|
+
const present = await Promise.all(skillDirs.map(isDirectory));
|
|
48
|
+
return {
|
|
49
|
+
schemaVersion: KIT_SURFACE_PATHS_SCHEMA_VERSION,
|
|
50
|
+
kitVersion: KIT_VERSION,
|
|
51
|
+
root,
|
|
52
|
+
commands: await isDirectory(commandsDir) ? commandsDir : null,
|
|
53
|
+
skills: skillDirs.filter((_, i) => present[i])
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function noKitRootMessage(cwd) {
|
|
57
|
+
return `No Agent Kit here: no ${MANIFEST_RELATIVE_PATH} in ${path.resolve(cwd)} or its parents (up to the git root). Run from inside a kit project or pass --cwd <path>.`;
|
|
58
|
+
}
|
|
59
|
+
function renderKitSurfacePaths(paths) {
|
|
60
|
+
return [
|
|
61
|
+
`root: ${paths.root}`,
|
|
62
|
+
`commands: ${paths.commands ?? "(none)"}`,
|
|
63
|
+
`skills: ${paths.skills.length > 0 ? paths.skills.join(", ") : "(none)"}`
|
|
64
|
+
].join("\n");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// src/commands/paths.ts
|
|
68
|
+
async function runPathsCommand(cwd, json) {
|
|
69
|
+
const paths = await resolveKitSurfacePaths(cwd);
|
|
70
|
+
if (!paths) return { exitCode: 1, stdout: "", stderr: noKitRootMessage(cwd) };
|
|
71
|
+
return {
|
|
72
|
+
exitCode: 0,
|
|
73
|
+
stdout: json ? JSON.stringify(paths, null, 2) : renderKitSurfacePaths(paths),
|
|
74
|
+
stderr: ""
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
var pathsCommand = defineCommand({
|
|
78
|
+
meta: {
|
|
79
|
+
name: "paths",
|
|
80
|
+
description: "Print the kit root and its command and skill directories (read-only; --json)"
|
|
81
|
+
},
|
|
82
|
+
args: {
|
|
83
|
+
cwd: {
|
|
84
|
+
type: "string",
|
|
85
|
+
default: process.cwd(),
|
|
86
|
+
description: "Directory to resolve the kit root from (walks up to the git root)"
|
|
87
|
+
},
|
|
88
|
+
json: {
|
|
89
|
+
type: "boolean",
|
|
90
|
+
default: false,
|
|
91
|
+
description: "Print { schemaVersion, kitVersion, root, commands, skills } as JSON"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
async run({ args }) {
|
|
95
|
+
const cwd = typeof args.cwd === "string" ? args.cwd : process.cwd();
|
|
96
|
+
const result = await runPathsCommand(cwd, args.json === true);
|
|
97
|
+
if (result.stdout) process.stdout.write(`${result.stdout}
|
|
98
|
+
`);
|
|
99
|
+
if (result.stderr) process.stderr.write(`${result.stderr}
|
|
100
|
+
`);
|
|
101
|
+
process.exitCode = result.exitCode;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
export {
|
|
105
|
+
pathsCommand,
|
|
106
|
+
runPathsCommand
|
|
107
|
+
};
|