@dadado/agent-kit-cli 6.29.0 → 6.30.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/cursor-audit/cursor-3-features.md +57 -0
- package/cursor-audit/cursor-native-audit.md +292 -0
- package/dist/{add-PBOH2ILP.js → add-CMQ3S2GH.js} +3 -3
- package/dist/build-stamp.json +2 -2
- package/dist/{chunk-XD4MLX7N.js → chunk-2JKKO7FF.js} +4 -4
- package/dist/{chunk-CHYROVQB.js → chunk-2PKJOMTI.js} +1 -1
- package/dist/{chunk-3AE6JBUC.js → chunk-37INM5QP.js} +3 -3
- package/dist/{chunk-AQRUIICR.js → chunk-7HPYWUC7.js} +3 -3
- package/dist/{chunk-COKUFSJH.js → chunk-BM5RR7LT.js} +1 -1
- package/dist/{chunk-JSQRWJ3W.js → chunk-CY4TDI4S.js} +9 -9
- package/dist/{chunk-SOSU22LZ.js → chunk-DQD6KPWJ.js} +1 -1
- package/dist/{chunk-WMMFTZ6O.js → chunk-EJJET3CA.js} +6 -1
- package/dist/{chunk-HSDIVA4N.js → chunk-GSVUCEMH.js} +1 -1
- package/dist/{chunk-D7L7PG7E.js → chunk-GSZ2WZYY.js} +2 -2
- package/dist/{chunk-RE27AEF7.js → chunk-HO7VEYAD.js} +1 -1
- package/dist/{chunk-QDYYJ6ZP.js → chunk-KNEVGAOO.js} +3 -3
- package/dist/{chunk-KAC3UOLE.js → chunk-N7L4ARYK.js} +1 -1
- package/dist/{chunk-ZO62NYU5.js → chunk-O3OEYLXW.js} +10 -10
- package/dist/{chunk-MCH3E46V.js → chunk-RPJA7Q2F.js} +94 -35
- package/dist/{chunk-TADT7EHS.js → chunk-SXMGHRLU.js} +2 -2
- package/dist/{commands-6LJACZME.js → commands-WGCC5YOR.js} +2 -2
- package/dist/{contribute-E7FP5DT4.js → contribute-E5HOW57P.js} +4 -4
- package/dist/{cursor-awareness-TN5JXD2C.js → cursor-awareness-ANT44WHK.js} +1 -1
- package/dist/{diff-XPRA5NX2.js → diff-D3S7D6RK.js} +5 -5
- package/dist/{doctor-M6E6MQAR.js → doctor-QAWK3NHG.js} +9 -9
- package/dist/{dogfood-2JAHSYQA.js → dogfood-2SYGZFTJ.js} +49 -2
- package/dist/{hook-5LVP2C7Q.js → hook-DKX7CH6S.js} +8 -8
- package/dist/index.js +16 -16
- package/dist/{init-P2ZCWU3J.js → init-ZQ56SONI.js} +13 -13
- package/dist/{install-ITPM24YI.js → install-FY7337TL.js} +13 -13
- package/dist/{paths-PSG64N6P.js → paths-YV6O6JFK.js} +2 -2
- package/dist/{promote-H5MIMVEB.js → promote-MAQ44EMD.js} +100 -9
- package/dist/{session-start-CCFPULEK.js → session-start-WNVFNJFF.js} +8 -8
- package/dist/{sessions-UGUQWLBS.js → sessions-OCJOE6HR.js} +1 -1
- package/dist/{setup-global-22YT6RTN.js → setup-global-ZYLEOFLF.js} +6 -6
- package/dist/{status-EBLELUSZ.js → status-6OEQTXJE.js} +6 -6
- package/dist/{update-WRI4HLY7.js → update-DJG3GR24.js} +11 -11
- package/dist/{update-all-KOJPSDAJ.js → update-all-TSF6GZFZ.js} +11 -11
- package/package.json +4 -3
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
formatRerunFlags,
|
|
9
9
|
formatStaleCliRefusal,
|
|
10
10
|
syncFromManifest
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2JKKO7FF.js";
|
|
12
12
|
import {
|
|
13
13
|
formatSkippedSymlinks,
|
|
14
14
|
logApplyStats
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
REGISTRY_CLI_ARGS,
|
|
18
18
|
resolveRegistryFromCli
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BM5RR7LT.js";
|
|
20
20
|
import {
|
|
21
21
|
CLAUDE_SETTINGS_REL,
|
|
22
22
|
formatClaudeSettingsDrift,
|
|
23
23
|
formatPermissionsChanged,
|
|
24
24
|
planClaudeSettingsDrift,
|
|
25
25
|
writeClaudeSessionStartHook
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DQD6KPWJ.js";
|
|
27
27
|
import {
|
|
28
28
|
generateClaudeCommandAdapters
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2PKJOMTI.js";
|
|
30
30
|
import {
|
|
31
31
|
feedInstallsRegistry
|
|
32
32
|
} from "./chunk-NHJ4IAVN.js";
|
|
@@ -41,14 +41,14 @@ import {
|
|
|
41
41
|
confirmProjectRoot,
|
|
42
42
|
isNonInteractive,
|
|
43
43
|
syncPathCliToRuntime
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-N7L4ARYK.js";
|
|
45
45
|
import {
|
|
46
46
|
checkForUpdates
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-GSZ2WZYY.js";
|
|
48
48
|
import {
|
|
49
49
|
dropRetiredSkillIds,
|
|
50
50
|
formatRetiredSkillDrop
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-SXMGHRLU.js";
|
|
52
52
|
import {
|
|
53
53
|
buildManifest,
|
|
54
54
|
canonicalizePackIds,
|
|
@@ -57,10 +57,10 @@ import {
|
|
|
57
57
|
loadAgentKitManifest,
|
|
58
58
|
resolveProtectedGlobs,
|
|
59
59
|
saveManifest
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-GSVUCEMH.js";
|
|
61
61
|
import {
|
|
62
62
|
seedManagedHashLedger
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-EJJET3CA.js";
|
|
64
64
|
import {
|
|
65
65
|
KIT_VERSION
|
|
66
66
|
} from "./chunk-2G4K4ZI5.js";
|
|
@@ -151,7 +151,7 @@ var updateCommand = defineCommand({
|
|
|
151
151
|
process.exitCode = 1;
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
const { runUpdateAll } = await import("./update-all-
|
|
154
|
+
const { runUpdateAll } = await import("./update-all-TSF6GZFZ.js");
|
|
155
155
|
const result2 = await runUpdateAll({
|
|
156
156
|
includeWorktrees: args["include-worktrees"],
|
|
157
157
|
applyOptions: {
|
|
@@ -11,28 +11,68 @@ import {
|
|
|
11
11
|
// src/lifecycle/cursor-update-awareness.ts
|
|
12
12
|
import { access, readFile } from "fs/promises";
|
|
13
13
|
import path from "path";
|
|
14
|
+
import { fileURLToPath } from "url";
|
|
14
15
|
var DEFAULT_CURSOR_CHANGELOG_URL = "https://cursor.com/changelog";
|
|
15
16
|
var CHANGELOG_FETCH_TIMEOUT_MS = 15e3;
|
|
16
17
|
var CURSOR_VERSION_MAJOR_MAX = 20;
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
var INVENTORY_FILE = "cursor-native-audit.md";
|
|
19
|
+
var FEATURES_FILE = "cursor-3-features.md";
|
|
20
|
+
var INVENTORY_REL = path.join("docs", INVENTORY_FILE);
|
|
21
|
+
var FEATURES_REL = path.join("docs", FEATURES_FILE);
|
|
22
|
+
var CURSOR_AUDIT_PACKAGE_DIR = "cursor-audit";
|
|
23
|
+
async function walkInventory(cwd) {
|
|
24
|
+
const start = path.resolve(cwd);
|
|
25
|
+
let dir = start;
|
|
21
26
|
for (; ; ) {
|
|
22
27
|
try {
|
|
23
28
|
await access(path.join(dir, INVENTORY_REL));
|
|
24
|
-
return dir;
|
|
29
|
+
return { hit: dir, configRoot: dir };
|
|
25
30
|
} catch {
|
|
26
31
|
}
|
|
27
|
-
if (await fileExists(path.join(dir, ".git")))
|
|
32
|
+
if (await fileExists(path.join(dir, ".git"))) return { hit: null, configRoot: dir };
|
|
28
33
|
const parent = path.dirname(dir);
|
|
29
|
-
if (parent === dir)
|
|
34
|
+
if (parent === dir) return { hit: null, configRoot: start };
|
|
30
35
|
dir = parent;
|
|
31
36
|
}
|
|
37
|
+
}
|
|
38
|
+
async function resolveInventoryRoot(cwd) {
|
|
39
|
+
return (await walkInventory(cwd)).hit;
|
|
40
|
+
}
|
|
41
|
+
function bundledInventoryDirs(moduleUrl = import.meta.url) {
|
|
42
|
+
const here = path.dirname(fileURLToPath(moduleUrl));
|
|
43
|
+
return [
|
|
44
|
+
path.join(here, "..", CURSOR_AUDIT_PACKAGE_DIR),
|
|
45
|
+
path.join(here, "..", "..", CURSOR_AUDIT_PACKAGE_DIR)
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
async function firstBundledInventoryDir(dirs) {
|
|
49
|
+
for (const dir of dirs) {
|
|
50
|
+
if (await fileExists(path.join(dir, INVENTORY_FILE))) return path.resolve(dir);
|
|
51
|
+
}
|
|
32
52
|
return null;
|
|
33
53
|
}
|
|
54
|
+
async function resolveInventory(cwd, bundledDirs) {
|
|
55
|
+
const walk = await walkInventory(cwd);
|
|
56
|
+
if (walk.hit) {
|
|
57
|
+
return {
|
|
58
|
+
source: "repo",
|
|
59
|
+
root: walk.hit,
|
|
60
|
+
inventoryRel: INVENTORY_REL,
|
|
61
|
+
featuresRel: FEATURES_REL,
|
|
62
|
+
configRoot: walk.configRoot
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const bundled = await firstBundledInventoryDir(bundledDirs);
|
|
66
|
+
return {
|
|
67
|
+
source: bundled ? "package" : null,
|
|
68
|
+
root: bundled,
|
|
69
|
+
inventoryRel: bundled ? INVENTORY_FILE : INVENTORY_REL,
|
|
70
|
+
featuresRel: bundled ? FEATURES_FILE : FEATURES_REL,
|
|
71
|
+
configRoot: walk.configRoot
|
|
72
|
+
};
|
|
73
|
+
}
|
|
34
74
|
function missingInventoryMessage() {
|
|
35
|
-
return `Missing inventory
|
|
75
|
+
return `Missing inventory: no ${INVENTORY_REL} in this checkout and no copy bundled with the CLI package. Reinstall or update @dadado/agent-kit-cli, or pass --cwd <path> to a checkout that carries ${INVENTORY_REL}.`;
|
|
36
76
|
}
|
|
37
77
|
var DEFAULT_PREFS = {
|
|
38
78
|
enabled: false,
|
|
@@ -278,18 +318,26 @@ function baseResult(partial) {
|
|
|
278
318
|
};
|
|
279
319
|
}
|
|
280
320
|
async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
|
|
321
|
+
const resolved = await resolveInventory(
|
|
322
|
+
cwd,
|
|
323
|
+
options.bundledInventoryDirs ?? bundledInventoryDirs()
|
|
284
324
|
);
|
|
325
|
+
const { configRoot } = resolved;
|
|
326
|
+
const inventoryRoot = resolved.root;
|
|
327
|
+
const inventorySource = resolved.source;
|
|
328
|
+
const inventoryRel = resolved.inventoryRel;
|
|
329
|
+
const featuresRel = resolved.featuresRel;
|
|
330
|
+
const prefs = readCursorUpdateCheckPrefs(await loadContextConfig(configRoot));
|
|
285
331
|
const changelogUrl = options.changelogUrl ?? prefs.changelogUrl;
|
|
286
332
|
if (options.respectPrefs) {
|
|
287
333
|
if (!prefs.enabled) {
|
|
288
334
|
return baseResult({
|
|
289
335
|
status: "skipped-disabled",
|
|
290
336
|
inventoryRoot,
|
|
291
|
-
|
|
292
|
-
|
|
337
|
+
inventorySource,
|
|
338
|
+
configRoot,
|
|
339
|
+
inventoryPath: inventoryRel,
|
|
340
|
+
featuresPath: featuresRel,
|
|
293
341
|
changelogUrl,
|
|
294
342
|
latestCursorVersion: null,
|
|
295
343
|
lastSeenCursorVersion: prefs.lastSeenCursorVersion,
|
|
@@ -303,8 +351,10 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
303
351
|
return baseResult({
|
|
304
352
|
status: "skipped-interval",
|
|
305
353
|
inventoryRoot,
|
|
306
|
-
|
|
307
|
-
|
|
354
|
+
inventorySource,
|
|
355
|
+
configRoot,
|
|
356
|
+
inventoryPath: inventoryRel,
|
|
357
|
+
featuresPath: featuresRel,
|
|
308
358
|
changelogUrl,
|
|
309
359
|
latestCursorVersion: null,
|
|
310
360
|
lastSeenCursorVersion: prefs.lastSeenCursorVersion,
|
|
@@ -319,8 +369,10 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
319
369
|
return baseResult({
|
|
320
370
|
status: "error",
|
|
321
371
|
inventoryRoot: null,
|
|
322
|
-
|
|
323
|
-
|
|
372
|
+
inventorySource: null,
|
|
373
|
+
configRoot,
|
|
374
|
+
inventoryPath: inventoryRel,
|
|
375
|
+
featuresPath: featuresRel,
|
|
324
376
|
changelogUrl,
|
|
325
377
|
latestCursorVersion: null,
|
|
326
378
|
lastSeenCursorVersion: prefs.lastSeenCursorVersion,
|
|
@@ -330,8 +382,8 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
330
382
|
message: missingInventoryMessage()
|
|
331
383
|
});
|
|
332
384
|
}
|
|
333
|
-
const inventoryPath = path.join(inventoryRoot,
|
|
334
|
-
const featuresPath = path.join(inventoryRoot,
|
|
385
|
+
const inventoryPath = path.join(inventoryRoot, inventoryRel);
|
|
386
|
+
const featuresPath = path.join(inventoryRoot, featuresRel);
|
|
335
387
|
let inventoryMd;
|
|
336
388
|
try {
|
|
337
389
|
inventoryMd = await readFile(inventoryPath, "utf8");
|
|
@@ -339,8 +391,10 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
339
391
|
return baseResult({
|
|
340
392
|
status: "error",
|
|
341
393
|
inventoryRoot,
|
|
342
|
-
|
|
343
|
-
|
|
394
|
+
inventorySource,
|
|
395
|
+
configRoot,
|
|
396
|
+
inventoryPath: inventoryRel,
|
|
397
|
+
featuresPath: featuresRel,
|
|
344
398
|
changelogUrl,
|
|
345
399
|
latestCursorVersion: null,
|
|
346
400
|
lastSeenCursorVersion: prefs.lastSeenCursorVersion,
|
|
@@ -354,13 +408,14 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
354
408
|
const openActionIds = parseOpenActionIds(inventoryMd);
|
|
355
409
|
const gaps = [];
|
|
356
410
|
let featuresMd = "";
|
|
411
|
+
const kitOwned = inventorySource === "package";
|
|
357
412
|
for (const id of openActionIds) {
|
|
358
413
|
gaps.push({
|
|
359
414
|
id: `open-action-${id}`,
|
|
360
|
-
severity: "advisory",
|
|
361
|
-
path:
|
|
362
|
-
evidence: `Action item ${id} is Open in the native-audit inventory`,
|
|
363
|
-
suggestedRoute: "backlog-add"
|
|
415
|
+
severity: kitOwned ? "info" : "advisory",
|
|
416
|
+
path: inventoryRel,
|
|
417
|
+
evidence: kitOwned ? `Action item ${id} is Open in the Agent Kit native-audit inventory (kit-owned)` : `Action item ${id} is Open in the native-audit inventory`,
|
|
418
|
+
suggestedRoute: kitOwned ? "none" : "backlog-add"
|
|
364
419
|
});
|
|
365
420
|
}
|
|
366
421
|
if (inventoryRefreshed) {
|
|
@@ -371,7 +426,7 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
371
426
|
gaps.push({
|
|
372
427
|
id: "inventory-stale",
|
|
373
428
|
severity: "stale",
|
|
374
|
-
path:
|
|
429
|
+
path: inventoryRel,
|
|
375
430
|
evidence: `Inventory last refreshed ${inventoryRefreshed} (>45 days). Version-prose refresh owned by parked Marketplace plan; awareness reports only.`,
|
|
376
431
|
suggestedRoute: "none"
|
|
377
432
|
});
|
|
@@ -384,7 +439,7 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
384
439
|
gaps.push({
|
|
385
440
|
id: "features-map-empty",
|
|
386
441
|
severity: "info",
|
|
387
|
-
path:
|
|
442
|
+
path: featuresRel,
|
|
388
443
|
evidence: "Secondary feature map has no Feature table rows",
|
|
389
444
|
suggestedRoute: "none"
|
|
390
445
|
});
|
|
@@ -393,7 +448,7 @@ async function checkCursorUpdateAwareness(cwd, options = {}) {
|
|
|
393
448
|
gaps.push({
|
|
394
449
|
id: "features-map-missing",
|
|
395
450
|
severity: "info",
|
|
396
|
-
path:
|
|
451
|
+
path: featuresRel,
|
|
397
452
|
evidence: "Secondary feature map missing; changelog/inventory check continues",
|
|
398
453
|
suggestedRoute: "none"
|
|
399
454
|
});
|
|
@@ -415,7 +470,7 @@ ${featuresMd}`;
|
|
|
415
470
|
gaps.push({
|
|
416
471
|
id: `feature-keyword-miss:${slug}`,
|
|
417
472
|
severity: "advisory",
|
|
418
|
-
path:
|
|
473
|
+
path: featuresRel,
|
|
419
474
|
evidence: `Changelog names "${keyword}" which is not listed in native-audit or cursor-3-features`,
|
|
420
475
|
suggestedRoute: "backlog-add"
|
|
421
476
|
});
|
|
@@ -442,8 +497,10 @@ ${featuresMd}`;
|
|
|
442
497
|
return baseResult({
|
|
443
498
|
status: "error",
|
|
444
499
|
inventoryRoot,
|
|
445
|
-
|
|
446
|
-
|
|
500
|
+
inventorySource,
|
|
501
|
+
configRoot,
|
|
502
|
+
inventoryPath: inventoryRel,
|
|
503
|
+
featuresPath: featuresRel,
|
|
447
504
|
changelogUrl,
|
|
448
505
|
latestCursorVersion: null,
|
|
449
506
|
lastSeenCursorVersion: prefs.lastSeenCursorVersion,
|
|
@@ -454,8 +511,8 @@ ${featuresMd}`;
|
|
|
454
511
|
});
|
|
455
512
|
}
|
|
456
513
|
}
|
|
457
|
-
if (options.stamp
|
|
458
|
-
await stampCursorUpdateCheck(
|
|
514
|
+
if (options.stamp) {
|
|
515
|
+
await stampCursorUpdateCheck(configRoot, {
|
|
459
516
|
lastSeenCursorVersion: latestCursorVersion ?? prefs.lastSeenCursorVersion
|
|
460
517
|
});
|
|
461
518
|
}
|
|
@@ -464,8 +521,10 @@ ${featuresMd}`;
|
|
|
464
521
|
return baseResult({
|
|
465
522
|
status,
|
|
466
523
|
inventoryRoot,
|
|
467
|
-
|
|
468
|
-
|
|
524
|
+
inventorySource,
|
|
525
|
+
configRoot,
|
|
526
|
+
inventoryPath: inventoryRel,
|
|
527
|
+
featuresPath: featuresRel,
|
|
469
528
|
changelogUrl: options.offline ? null : changelogUrl,
|
|
470
529
|
latestCursorVersion,
|
|
471
530
|
lastSeenCursorVersion: prefs.lastSeenCursorVersion,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
loadRegistry,
|
|
10
10
|
packMemberFileTargets,
|
|
11
11
|
skillFileTargets
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GSVUCEMH.js";
|
|
13
13
|
import {
|
|
14
14
|
contentHash,
|
|
15
15
|
resolveContained
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EJJET3CA.js";
|
|
17
17
|
import {
|
|
18
18
|
MANIFEST_RELATIVE_PATH
|
|
19
19
|
} from "./chunk-KMK4T4ZM.js";
|
|
@@ -8,7 +8,7 @@ import "./chunk-TTUFIE26.js";
|
|
|
8
8
|
import {
|
|
9
9
|
CURSOR_COMMANDS_DIR_REL,
|
|
10
10
|
discoverInstalledCommands
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2PKJOMTI.js";
|
|
12
12
|
import "./chunk-WGLPZXNU.js";
|
|
13
13
|
import "./chunk-Q35TWISF.js";
|
|
14
14
|
import "./chunk-QTON2GQX.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
L0_ARTIFACTS
|
|
17
17
|
} from "./chunk-CGXLR77R.js";
|
|
18
18
|
import "./chunk-PFEUZXVT.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-EJJET3CA.js";
|
|
20
20
|
import {
|
|
21
21
|
KIT_VERSION
|
|
22
22
|
} from "./chunk-2G4K4ZI5.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REGISTRY_CLI_ARGS,
|
|
3
3
|
resolveRegistryFromCli
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BM5RR7LT.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-ZB43YMHW.js";
|
|
8
8
|
import {
|
|
9
9
|
managedPairs
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SXMGHRLU.js";
|
|
11
11
|
import "./chunk-CGXLR77R.js";
|
|
12
12
|
import {
|
|
13
13
|
loadAgentKitManifest,
|
|
14
14
|
normalizeRelPath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GSVUCEMH.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveContained
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EJJET3CA.js";
|
|
19
19
|
import "./chunk-IHVJTGYR.js";
|
|
20
20
|
import "./chunk-KMK4T4ZM.js";
|
|
21
21
|
import "./chunk-O7VMHCNN.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REGISTRY_CLI_ARGS,
|
|
3
3
|
resolveRegistryFromCli
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BM5RR7LT.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-ZB43YMHW.js";
|
|
8
8
|
import {
|
|
9
9
|
diffAgainstRegistry,
|
|
10
10
|
summarizeDiff
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-37INM5QP.js";
|
|
12
|
+
import "./chunk-SXMGHRLU.js";
|
|
13
13
|
import "./chunk-CGXLR77R.js";
|
|
14
14
|
import {
|
|
15
15
|
canonicalizePackIds,
|
|
16
16
|
formatUnknownPack,
|
|
17
17
|
loadAgentKitManifest
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
18
|
+
} from "./chunk-GSVUCEMH.js";
|
|
19
|
+
import "./chunk-EJJET3CA.js";
|
|
20
20
|
import "./chunk-IHVJTGYR.js";
|
|
21
21
|
import "./chunk-KMK4T4ZM.js";
|
|
22
22
|
import "./chunk-O7VMHCNN.js";
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
assessHooksHealth,
|
|
3
3
|
executeSafeReadinessFixes,
|
|
4
4
|
refreshRepositoryProfile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KNEVGAOO.js";
|
|
6
6
|
import {
|
|
7
7
|
assessInstallHealth,
|
|
8
8
|
cachedCliNpmLatest,
|
|
9
9
|
npmLatestCheckAllowed,
|
|
10
10
|
writeInstallHealthSnapshot,
|
|
11
11
|
writeReadinessSnapshot
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-HO7VEYAD.js";
|
|
13
|
+
import "./chunk-DQD6KPWJ.js";
|
|
14
|
+
import "./chunk-2PKJOMTI.js";
|
|
15
15
|
import {
|
|
16
16
|
feedInstallsRegistry
|
|
17
17
|
} from "./chunk-NHJ4IAVN.js";
|
|
@@ -45,17 +45,17 @@ import {
|
|
|
45
45
|
CLI_NPM_PACKAGES,
|
|
46
46
|
fetchLatestCliNpmVersion,
|
|
47
47
|
warnIfRunningCliBehindNpm
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-GSZ2WZYY.js";
|
|
49
|
+
import "./chunk-37INM5QP.js";
|
|
50
|
+
import "./chunk-SXMGHRLU.js";
|
|
51
51
|
import "./chunk-CGXLR77R.js";
|
|
52
52
|
import {
|
|
53
53
|
loadContextConfig
|
|
54
54
|
} from "./chunk-PFEUZXVT.js";
|
|
55
55
|
import {
|
|
56
56
|
loadAgentKitManifest
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import "./chunk-
|
|
57
|
+
} from "./chunk-GSVUCEMH.js";
|
|
58
|
+
import "./chunk-EJJET3CA.js";
|
|
59
59
|
import "./chunk-IHVJTGYR.js";
|
|
60
60
|
import "./chunk-KMK4T4ZM.js";
|
|
61
61
|
import {
|
|
@@ -16,6 +16,7 @@ import { defineCommand } from "citty";
|
|
|
16
16
|
|
|
17
17
|
// src/lifecycle/dogfood-file.ts
|
|
18
18
|
import { execFile } from "child_process";
|
|
19
|
+
import { constants as fsConstants } from "fs";
|
|
19
20
|
import { access, mkdir, readFile, writeFile } from "fs/promises";
|
|
20
21
|
import path from "path";
|
|
21
22
|
import { promisify } from "util";
|
|
@@ -104,6 +105,26 @@ async function defaultGetRemoteUrl(cwd, name) {
|
|
|
104
105
|
return null;
|
|
105
106
|
}
|
|
106
107
|
}
|
|
108
|
+
async function defaultGetPushUrls(cwd, name) {
|
|
109
|
+
try {
|
|
110
|
+
const { stdout } = await execFileAsync(
|
|
111
|
+
"git",
|
|
112
|
+
["config", "--get-all", `remote.${name}.pushurl`],
|
|
113
|
+
{ cwd, encoding: "utf8", timeout: 5e3 }
|
|
114
|
+
);
|
|
115
|
+
return stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
116
|
+
} catch {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function defaultIsWritable(target) {
|
|
121
|
+
try {
|
|
122
|
+
await access(target, fsConstants.W_OK);
|
|
123
|
+
return true;
|
|
124
|
+
} catch {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
107
128
|
async function defaultRunCli(bin, args, options) {
|
|
108
129
|
const { stdout } = await execFileAsync(bin, args, {
|
|
109
130
|
cwd: options?.cwd,
|
|
@@ -113,14 +134,32 @@ async function defaultRunCli(bin, args, options) {
|
|
|
113
134
|
});
|
|
114
135
|
return stdout;
|
|
115
136
|
}
|
|
137
|
+
async function detectForeignCheckout(root, deps = {}) {
|
|
138
|
+
const getPushUrls = deps.getPushUrls ?? defaultGetPushUrls;
|
|
139
|
+
const isWritable = deps.isWritable ?? defaultIsWritable;
|
|
140
|
+
const pushUrls = await getPushUrls(root, "origin");
|
|
141
|
+
if (pushUrls.some((url) => /^no-push/i.test(url))) return "no-push-pushurl";
|
|
142
|
+
for (const target of [
|
|
143
|
+
root,
|
|
144
|
+
path.join(root, "dogfood"),
|
|
145
|
+
path.join(root, "dogfood", "README.md")
|
|
146
|
+
]) {
|
|
147
|
+
if (await exists(target) && !await isWritable(target)) return "read-only-tree";
|
|
148
|
+
}
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
116
151
|
async function detectDogfoodLane(root, deps = {}) {
|
|
117
152
|
const getRemoteUrl = deps.getRemoteUrl ?? defaultGetRemoteUrl;
|
|
118
153
|
const origin = await getRemoteUrl(root, "origin");
|
|
119
|
-
|
|
120
|
-
if (await
|
|
154
|
+
const factoryLike = origin !== null && /agent-kit-dev/i.test(origin) || await exists(path.join(root, "dogfood", "README.md"));
|
|
155
|
+
if (factoryLike) return await detectForeignCheckout(root, deps) ? "foreign" : "factory";
|
|
121
156
|
if (await exists(path.join(root, ".cursor", "agent-kit.json"))) return "consumer";
|
|
122
157
|
return null;
|
|
123
158
|
}
|
|
159
|
+
function foreignMessage(reason) {
|
|
160
|
+
const why = reason === "no-push-pushurl" ? "origin pushurl is a no-push sentinel" : "the checkout is not writable";
|
|
161
|
+
return `Factory lane refused: ${why}, so another system owns this checkout. Nothing written; run /dogfood from the operator's factory checkout or ask the operator.`;
|
|
162
|
+
}
|
|
124
163
|
function inboxDir(root, lane) {
|
|
125
164
|
return lane === "factory" ? path.join(root, "dogfood") : path.join(root, ".cursor", "dogfood");
|
|
126
165
|
}
|
|
@@ -150,6 +189,10 @@ ${tail}` : ""}`;
|
|
|
150
189
|
async function addDogfoodNote(root, input, deps = {}) {
|
|
151
190
|
const lane = await detectDogfoodLane(root, deps);
|
|
152
191
|
if (!lane) return { status: "unknown-lane" };
|
|
192
|
+
if (lane === "foreign") {
|
|
193
|
+
const reason = await detectForeignCheckout(root, deps) ?? "read-only-tree";
|
|
194
|
+
return { status: "refused-foreign-checkout", reason, message: foreignMessage(reason) };
|
|
195
|
+
}
|
|
153
196
|
const now = deps.now?.() ?? /* @__PURE__ */ new Date();
|
|
154
197
|
const topic = hygieneStrip(input.topic);
|
|
155
198
|
const observation = hygieneStrip(input.summary ?? input.topic);
|
|
@@ -232,6 +275,10 @@ async function fileDogfoodIssue(root, input, deps = {}) {
|
|
|
232
275
|
const lane = await detectDogfoodLane(root, deps);
|
|
233
276
|
if (!lane)
|
|
234
277
|
return stop("refused-unknown-lane", "Lane unknown: not the factory nor a kit install.");
|
|
278
|
+
if (lane === "foreign") {
|
|
279
|
+
const reason = await detectForeignCheckout(root, deps) ?? "read-only-tree";
|
|
280
|
+
return stop("refused-foreign-checkout", foreignMessage(reason));
|
|
281
|
+
}
|
|
235
282
|
let target;
|
|
236
283
|
if (input.visibility === "public") {
|
|
237
284
|
if (lane !== "factory") {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildSessionStartAdditionalContext,
|
|
3
3
|
resolveSessionRoot
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7HPYWUC7.js";
|
|
5
5
|
import "./chunk-XXPI4H4D.js";
|
|
6
6
|
import "./chunk-2YU2H7I6.js";
|
|
7
7
|
import {
|
|
8
8
|
readStdinJson
|
|
9
9
|
} from "./chunk-DE3LQFSJ.js";
|
|
10
10
|
import "./chunk-FOVHFMSH.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-RPJA7Q2F.js";
|
|
12
12
|
import "./chunk-4CRBUEJ6.js";
|
|
13
13
|
import "./chunk-TTUFIE26.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-HO7VEYAD.js";
|
|
15
15
|
import "./chunk-NHJ4IAVN.js";
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-GSZ2WZYY.js";
|
|
17
|
+
import "./chunk-37INM5QP.js";
|
|
18
|
+
import "./chunk-SXMGHRLU.js";
|
|
19
19
|
import "./chunk-CGXLR77R.js";
|
|
20
20
|
import "./chunk-PFEUZXVT.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-GSVUCEMH.js";
|
|
22
|
+
import "./chunk-EJJET3CA.js";
|
|
23
23
|
import "./chunk-IHVJTGYR.js";
|
|
24
24
|
import "./chunk-KMK4T4ZM.js";
|
|
25
25
|
import "./chunk-2G4K4ZI5.js";
|
package/dist/index.js
CHANGED
|
@@ -251,43 +251,43 @@ var main = defineCommand({
|
|
|
251
251
|
version: KIT_VERSION
|
|
252
252
|
},
|
|
253
253
|
subCommands: {
|
|
254
|
-
init: () => import("./init-
|
|
255
|
-
install: () => import("./install-
|
|
254
|
+
init: () => import("./init-ZQ56SONI.js").then((m) => m.initCommand),
|
|
255
|
+
install: () => import("./install-FY7337TL.js").then((m) => m.installCommand),
|
|
256
256
|
scan: () => import("./scan-7D3RMO34.js").then((m) => m.scanCommand),
|
|
257
|
-
add: () => import("./add-
|
|
258
|
-
doctor: () => import("./doctor-
|
|
259
|
-
"setup-global": () => import("./setup-global-
|
|
260
|
-
status: () => import("./status-
|
|
261
|
-
update: () => import("./update-
|
|
257
|
+
add: () => import("./add-CMQ3S2GH.js").then((m) => m.addCommand),
|
|
258
|
+
doctor: () => import("./doctor-QAWK3NHG.js").then((m) => m.doctorCommand),
|
|
259
|
+
"setup-global": () => import("./setup-global-ZYLEOFLF.js").then((m) => m.setupGlobalCommand),
|
|
260
|
+
status: () => import("./status-6OEQTXJE.js").then((m) => m.statusCommand),
|
|
261
|
+
update: () => import("./update-DJG3GR24.js").then((m) => m.updateCommand),
|
|
262
262
|
installs: () => import("./installs-2ROXPO6M.js").then((m) => m.installsCommand),
|
|
263
|
-
"cursor-awareness": () => import("./cursor-awareness-
|
|
263
|
+
"cursor-awareness": () => import("./cursor-awareness-ANT44WHK.js").then((m) => m.cursorAwarenessCommand),
|
|
264
264
|
"public-inbound-radar": () => import("./public-inbound-radar-5U4JMBRU.js").then((m) => m.publicInboundRadarCommand),
|
|
265
265
|
"remote-issues": () => import("./remote-issues-APYOMIJC.js").then((m) => m.remoteIssuesCommand),
|
|
266
|
-
dogfood: () => import("./dogfood-
|
|
267
|
-
diff: () => import("./diff-
|
|
268
|
-
contribute: () => import("./contribute-
|
|
266
|
+
dogfood: () => import("./dogfood-2SYGZFTJ.js").then((m) => m.dogfoodCommand),
|
|
267
|
+
diff: () => import("./diff-D3S7D6RK.js").then((m) => m.diffCommand),
|
|
268
|
+
contribute: () => import("./contribute-E5HOW57P.js").then((m) => m.contributeCommand),
|
|
269
269
|
handoff: () => import("./handoff-LLT4CI6H.js").then((m) => m.handoffCommand),
|
|
270
270
|
"plan-index": () => import("./plan-index-5QZJK4AG.js").then((m) => m.planIndexCommand),
|
|
271
271
|
run: () => import("./run-2MN2HRUC.js").then((m) => m.runCommand),
|
|
272
272
|
"run-plan": () => import("./run-plan-MYAVTBY4.js").then((m) => m.runPlanCommand),
|
|
273
273
|
"run-plan-all": () => import("./run-2MN2HRUC.js").then((m) => m.runPlanAllCommand),
|
|
274
274
|
queue: () => import("./queue-HDR5ER25.js").then((m) => m.queueCommand),
|
|
275
|
-
promote: () => import("./promote-
|
|
275
|
+
promote: () => import("./promote-MAQ44EMD.js").then((m) => m.promoteCommand),
|
|
276
276
|
countdown: () => import("./countdown-VXOFV23S.js").then((m) => m.countdownCommand),
|
|
277
277
|
"ground-control": () => import("./ground-control-J4AMA4S4.js").then((m) => m.groundControlCommand),
|
|
278
278
|
conflicts: () => import("./conflicts-4GLQOMJF.js").then((m) => m.conflictsCommand),
|
|
279
279
|
dashboard: () => import("./dashboard-3RBOYKZW.js").then((m) => m.dashboardCommand),
|
|
280
280
|
"dashboard-broadcast": () => import("./dashboard-broadcast-K3PAGFBO.js").then((m) => m.dashboardBroadcastCommand),
|
|
281
281
|
"mission-control": () => import("./mission-control-3D46DA2Z.js").then((m) => m.missionControlCommand),
|
|
282
|
-
hook: () => import("./hook-
|
|
282
|
+
hook: () => import("./hook-DKX7CH6S.js").then((m) => m.hookCommand),
|
|
283
283
|
guard: () => import("./guard-SSDUD7CH.js").then((m) => m.guardCommand),
|
|
284
284
|
monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
|
|
285
|
-
sessions: () => import("./sessions-
|
|
285
|
+
sessions: () => import("./sessions-OCJOE6HR.js").then((m) => m.sessionsCommand),
|
|
286
286
|
"outcome-ledger": () => import("./outcome-ledger-XLWHWPVQ.js").then((m) => m.outcomeLedgerCommand),
|
|
287
287
|
validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
|
|
288
288
|
"engine-info": () => import("./engine-info-OTYCQUQB.js").then((m) => m.engineInfoCommand),
|
|
289
|
-
commands: () => import("./commands-
|
|
290
|
-
paths: () => import("./paths-
|
|
289
|
+
commands: () => import("./commands-WGCC5YOR.js").then((m) => m.commandsCommand),
|
|
290
|
+
paths: () => import("./paths-YV6O6JFK.js").then((m) => m.pathsCommand),
|
|
291
291
|
pi: () => import("./pi-DCMDOY65.js").then((m) => m.piCommand),
|
|
292
292
|
models: () => import("./models-SNB5Q3YU.js").then((m) => m.modelsCommand)
|
|
293
293
|
},
|