@dadado/agent-kit-cli 6.3.0 → 6.5.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/dashboard/dashboard-data.mjs +14 -2
- package/dashboard/dashboard.html +190 -32
- package/dashboard/lib/chat-sessions.d.mts +63 -0
- package/dashboard/lib/chat-sessions.mjs +430 -0
- package/dashboard/{logo-cursor.svg → logo-bare-metal.svg} +1 -1
- package/dashboard/logo-marketplace.svg +1 -1
- package/dashboard/serve.mjs +5 -1
- package/dashboard/social-preview.svg +2 -2
- package/dist/{add-VA2W7I6P.js → add-IT6XFPKT.js} +2 -2
- package/dist/{chunk-NNKOWUWM.js → chunk-236IYK6L.js} +64 -28
- package/dist/{chunk-YRFSTHR5.js → chunk-2OIPMQHA.js} +13 -219
- package/dist/{chunk-JEI6HACW.js → chunk-2TCRKQHD.js} +35 -379
- package/dist/{chunk-U26MRIWN.js → chunk-34BBPQKI.js} +1 -1
- package/dist/{chunk-GUQYNUV4.js → chunk-4XZXM2ZA.js} +1 -1
- package/dist/{chunk-Z7RYIHHX.js → chunk-5LQP4JGH.js} +3 -3
- package/dist/{chunk-6KUSG7BJ.js → chunk-5WSFO35Y.js} +4 -1
- package/dist/{chunk-MAPOQEA2.js → chunk-6RRG3WOE.js} +8 -1
- package/dist/{chunk-OWWFKGKS.js → chunk-EI3VQ7FU.js} +2 -2
- package/dist/{chunk-QTBTKEXK.js → chunk-FM32XR7A.js} +1 -1
- package/dist/{chunk-KVY425NM.js → chunk-GIZNM73K.js} +4 -2
- package/dist/{chunk-MO63KZBP.js → chunk-HKYJG2FJ.js} +8 -6
- package/dist/{chunk-SV2BR2LZ.js → chunk-I2D75F4I.js} +7 -7
- package/dist/{chunk-25J2SMJQ.js → chunk-IN4MQ3P3.js} +1 -1
- package/dist/{chunk-OVOXRH5W.js → chunk-MEZUW3LL.js} +1 -1
- package/dist/chunk-MTLQN57O.js +380 -0
- package/dist/chunk-R6WH5P7R.js +223 -0
- package/dist/{chunk-VQBI3JVS.js → chunk-TNO7GTAJ.js} +2 -2
- package/dist/{chunk-Z7ABX5QI.js → chunk-U7XOLYDG.js} +4 -2
- package/dist/{chunk-WMVMBPCR.js → chunk-WOGBBJCX.js} +1 -1
- package/dist/{chunk-6GYKOHIL.js → chunk-YIOTJQHL.js} +2 -2
- package/dist/{contribute-NLM2BN6Z.js → contribute-V7PV5UMK.js} +3 -3
- package/dist/{countdown-QXJD6TDB.js → countdown-YONBTSJ2.js} +10 -8
- package/dist/{diff-HHG4JEDE.js → diff-GWIHGH65.js} +4 -4
- package/dist/{doctor-TWF2M3S3.js → doctor-FLIQCVFN.js} +8 -8
- package/dist/engine-info-UQNVNOA2.js +89 -0
- package/dist/{ground-control-NMYYIVCV.js → ground-control-6W2AKTKI.js} +5 -4
- package/dist/{guard-EHXF76ID.js → guard-ZZRQW3DJ.js} +107 -8
- package/dist/{hook-VP7FHRSZ.js → hook-2SX2V2T6.js} +10 -4
- package/dist/index.js +26 -22
- package/dist/{init-UOTV4ASJ.js → init-4B2IRH27.js} +11 -11
- package/dist/{install-VCHPXQV3.js → install-3JVTG35O.js} +11 -11
- package/dist/{run-R66G276Q.js → run-AYT6CRHI.js} +12 -9
- package/dist/{run-plan-24Z5K4P3.js → run-plan-5XIISG3W.js} +11 -7
- package/dist/sessions-O7MYEMCT.js +343 -0
- package/dist/{setup-global-M6LKGJHQ.js → setup-global-6JM5XTAT.js} +5 -5
- package/dist/{status-5UKVIKOI.js → status-PMAI7NH3.js} +6 -6
- package/dist/{update-VQBGEUWS.js → update-3PLY4FZA.js} +9 -9
- package/package.json +1 -1
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
diffAgainstRegistry,
|
|
8
8
|
summarizeDiff
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TNO7GTAJ.js";
|
|
10
10
|
import {
|
|
11
11
|
DEFAULT_REGISTRY_URL,
|
|
12
12
|
assertSafeRegistrySource,
|
|
13
13
|
loadAgentKitManifest,
|
|
14
14
|
resolveRegistryRoot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5WSFO35Y.js";
|
|
16
16
|
import {
|
|
17
17
|
KIT_PACKAGE_SPEC,
|
|
18
18
|
KIT_VERSION
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REGISTRY_CLI_ARGS,
|
|
3
3
|
resolveRegistryFromCli
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-34BBPQKI.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-IN4MQ3P3.js";
|
|
11
11
|
import {
|
|
12
12
|
loadAgentKitManifest,
|
|
13
13
|
normalizeRelPath,
|
|
14
14
|
resolveContained
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5WSFO35Y.js";
|
|
16
16
|
import "./chunk-C4Q77GGJ.js";
|
|
17
17
|
import "./chunk-5B4DVO6C.js";
|
|
18
18
|
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
REVIEW_PACK_SLASH,
|
|
5
5
|
parseReviewPackMaxBytes,
|
|
6
6
|
reviewBackendMessage
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HKYJG2FJ.js";
|
|
8
8
|
import {
|
|
9
9
|
detectAgentBackend,
|
|
10
10
|
listDetectBackendIds
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-4XZXM2ZA.js";
|
|
12
|
+
import "./chunk-FM32XR7A.js";
|
|
13
13
|
import {
|
|
14
14
|
GATE_EXIT_MARKER_RELPATH,
|
|
15
15
|
defaultExec,
|
|
@@ -20,23 +20,25 @@ import {
|
|
|
20
20
|
readGateExitMarker,
|
|
21
21
|
resolveGateExitRefs,
|
|
22
22
|
writeGateExitMarker
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GIZNM73K.js";
|
|
24
24
|
import "./chunk-MUTTNRX4.js";
|
|
25
25
|
import {
|
|
26
26
|
classifySlash,
|
|
27
27
|
normalizeSlashName,
|
|
28
28
|
promoteBlockedMessage,
|
|
29
29
|
unknownSlashMessage
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-U7XOLYDG.js";
|
|
31
31
|
import {
|
|
32
32
|
CLAUDE_MAX_BUDGET_USD_ENV,
|
|
33
33
|
CLAUDE_MAX_TURNS_ENV,
|
|
34
|
-
HITL_UNANSWERED_EXIT_CODE,
|
|
35
34
|
RedactingStreamBuffer,
|
|
36
35
|
redactSecrets
|
|
37
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-2TCRKQHD.js";
|
|
37
|
+
import {
|
|
38
|
+
HITL_UNANSWERED_EXIT_CODE
|
|
39
|
+
} from "./chunk-MTLQN57O.js";
|
|
38
40
|
import "./chunk-WGLPZXNU.js";
|
|
39
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-6RRG3WOE.js";
|
|
40
42
|
import "./chunk-QTON2GQX.js";
|
|
41
43
|
import {
|
|
42
44
|
logger
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
REGISTRY_CLI_ARGS,
|
|
3
3
|
resolveRegistryFromCli
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-34BBPQKI.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-TNO7GTAJ.js";
|
|
12
|
+
import "./chunk-IN4MQ3P3.js";
|
|
13
13
|
import {
|
|
14
14
|
loadAgentKitManifest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5WSFO35Y.js";
|
|
16
16
|
import "./chunk-C4Q77GGJ.js";
|
|
17
17
|
import "./chunk-5B4DVO6C.js";
|
|
18
18
|
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
assessHooksHealth,
|
|
3
3
|
executeSafeReadinessFixes,
|
|
4
4
|
refreshRepositoryProfile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WOGBBJCX.js";
|
|
6
6
|
import {
|
|
7
7
|
writeReadinessSnapshot
|
|
8
8
|
} from "./chunk-HAFRAXGV.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-236IYK6L.js";
|
|
10
10
|
import "./chunk-WGLPZXNU.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-6RRG3WOE.js";
|
|
12
12
|
import {
|
|
13
13
|
withCliProgress
|
|
14
14
|
} from "./chunk-QTON2GQX.js";
|
|
15
15
|
import {
|
|
16
16
|
detectWorkspaceParent,
|
|
17
17
|
workspaceParentAdvisoryLines
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MEZUW3LL.js";
|
|
19
19
|
import {
|
|
20
20
|
createReadinessReport
|
|
21
21
|
} from "./chunk-PNFF6OU3.js";
|
|
@@ -32,11 +32,11 @@ import {
|
|
|
32
32
|
} from "./chunk-B3VR5YBQ.js";
|
|
33
33
|
import {
|
|
34
34
|
warnIfRunningCliBehindNpm
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YIOTJQHL.js";
|
|
36
36
|
import "./chunk-PFEUZXVT.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-TNO7GTAJ.js";
|
|
38
|
+
import "./chunk-IN4MQ3P3.js";
|
|
39
|
+
import "./chunk-5WSFO35Y.js";
|
|
40
40
|
import {
|
|
41
41
|
KIT_VERSION
|
|
42
42
|
} from "./chunk-7HDQEK6T.js";
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DRIVER_PROTOCOL_VERSION
|
|
3
|
+
} from "./chunk-R6WH5P7R.js";
|
|
4
|
+
import {
|
|
5
|
+
bundledDashboardCandidates
|
|
6
|
+
} from "./chunk-XDCCYBCJ.js";
|
|
7
|
+
import "./chunk-MTLQN57O.js";
|
|
8
|
+
import "./chunk-ZB43YMHW.js";
|
|
9
|
+
|
|
10
|
+
// src/commands/engine-info.ts
|
|
11
|
+
import { defineCommand } from "citty";
|
|
12
|
+
|
|
13
|
+
// src/lifecycle/engine-info.ts
|
|
14
|
+
import { readFileSync } from "fs";
|
|
15
|
+
import { createRequire } from "module";
|
|
16
|
+
var require2 = createRequire(import.meta.url);
|
|
17
|
+
function loadPackageMetadata() {
|
|
18
|
+
for (const packagePath of ["../package.json", "../../package.json"]) {
|
|
19
|
+
try {
|
|
20
|
+
const metadata = require2(packagePath);
|
|
21
|
+
if (typeof metadata.version === "string" && metadata.name === "@dadado/agent-kit-cli") {
|
|
22
|
+
return metadata;
|
|
23
|
+
}
|
|
24
|
+
} catch {
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
throw new Error("Unable to resolve the Agent Kit CLI package.json");
|
|
28
|
+
}
|
|
29
|
+
var DATA_VERSION_RE = /^\s*dashboardDataVersion:\s*["'](\d+\.\d+\.\d+)["']/m;
|
|
30
|
+
function parseDashboardDataVersion(source) {
|
|
31
|
+
return DATA_VERSION_RE.exec(source)?.[1] ?? null;
|
|
32
|
+
}
|
|
33
|
+
function readDashboardDataVersion(candidates) {
|
|
34
|
+
for (const candidate of candidates) {
|
|
35
|
+
try {
|
|
36
|
+
const found = parseDashboardDataVersion(readFileSync(candidate, "utf8"));
|
|
37
|
+
if (found) return found;
|
|
38
|
+
} catch {
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
function buildEngineManifest(opts = {}) {
|
|
44
|
+
const metadata = opts.metadata ?? loadPackageMetadata();
|
|
45
|
+
const candidates = opts.dashboardCandidates ?? bundledDashboardCandidates("dashboard-data.mjs");
|
|
46
|
+
const node = metadata.engines?.node;
|
|
47
|
+
return {
|
|
48
|
+
manifestVersion: 1,
|
|
49
|
+
name: String(metadata.name),
|
|
50
|
+
version: String(metadata.version),
|
|
51
|
+
node: typeof node === "string" ? node : "",
|
|
52
|
+
driverProtocol: DRIVER_PROTOCOL_VERSION,
|
|
53
|
+
dashboardDataVersion: readDashboardDataVersion(candidates),
|
|
54
|
+
entry: "dist/index.js",
|
|
55
|
+
dashboardServe: "dashboard/serve.mjs"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function renderEngineManifest(m) {
|
|
59
|
+
return [
|
|
60
|
+
`${m.name} ${m.version}`,
|
|
61
|
+
`node ${m.node || "(unspecified)"}`,
|
|
62
|
+
`driver protocol ${m.driverProtocol}`,
|
|
63
|
+
`dashboard data ${m.dashboardDataVersion ?? "(no dashboard found)"}`,
|
|
64
|
+
`entry ${m.entry}`,
|
|
65
|
+
`dashboard server ${m.dashboardServe}`
|
|
66
|
+
].join("\n");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// src/commands/engine-info.ts
|
|
70
|
+
var engineInfoCommand = defineCommand({
|
|
71
|
+
meta: {
|
|
72
|
+
name: "engine-info",
|
|
73
|
+
description: "Print the engine manifest: version, Node range, driver protocol, snapshot schema"
|
|
74
|
+
},
|
|
75
|
+
args: {
|
|
76
|
+
json: { type: "boolean", description: "Print the manifest as JSON", default: false }
|
|
77
|
+
},
|
|
78
|
+
run({ args }) {
|
|
79
|
+
const manifest = buildEngineManifest();
|
|
80
|
+
process.stdout.write(
|
|
81
|
+
args.json ? `${JSON.stringify(manifest, null, 2)}
|
|
82
|
+
` : `${renderEngineManifest(manifest)}
|
|
83
|
+
`
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
engineInfoCommand
|
|
89
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
blobId,
|
|
3
3
|
isTicketMerged
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FM32XR7A.js";
|
|
5
5
|
import {
|
|
6
6
|
GATE_EXIT_BRANCH_PREFIX,
|
|
7
7
|
GATE_EXIT_MARKER_RELPATH,
|
|
@@ -16,15 +16,16 @@ import {
|
|
|
16
16
|
readGateExitMarker,
|
|
17
17
|
resolveGateExitRefs,
|
|
18
18
|
writeGateExitMarker
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GIZNM73K.js";
|
|
20
20
|
import "./chunk-MUTTNRX4.js";
|
|
21
21
|
import {
|
|
22
22
|
redactSecrets
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2TCRKQHD.js";
|
|
24
|
+
import "./chunk-MTLQN57O.js";
|
|
24
25
|
import {
|
|
25
26
|
findOnPath
|
|
26
27
|
} from "./chunk-WGLPZXNU.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-6RRG3WOE.js";
|
|
28
29
|
import "./chunk-QTON2GQX.js";
|
|
29
30
|
import {
|
|
30
31
|
logger
|
|
@@ -272,6 +272,55 @@ function ghTargetsPublicRepo(head) {
|
|
|
272
272
|
if (!/^(?:[\w./-]+\/)?gh\s+pr\s+(?:create|merge)\b/.test(head)) return false;
|
|
273
273
|
return PUBLIC_REPO_RE.test(head);
|
|
274
274
|
}
|
|
275
|
+
var PR_MERGE_HEAD_RE = /^(?:[\w./-]+\/)?(gh\s+pr|glab\s+mr)\s+merge\b/;
|
|
276
|
+
var PR_MERGE_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
277
|
+
"-R",
|
|
278
|
+
"--repo",
|
|
279
|
+
"-t",
|
|
280
|
+
"--subject",
|
|
281
|
+
"-b",
|
|
282
|
+
"--body",
|
|
283
|
+
"-F",
|
|
284
|
+
"--body-file",
|
|
285
|
+
"-A",
|
|
286
|
+
"--author-email",
|
|
287
|
+
"--match-head-commit",
|
|
288
|
+
"-m",
|
|
289
|
+
"--message",
|
|
290
|
+
"--squash-message",
|
|
291
|
+
"--sha"
|
|
292
|
+
]);
|
|
293
|
+
function parsePrMergeHead(head) {
|
|
294
|
+
const m = PR_MERGE_HEAD_RE.exec(head);
|
|
295
|
+
if (!m?.[1]) return null;
|
|
296
|
+
const forge = m[1].startsWith("gh") ? "github" : "gitlab";
|
|
297
|
+
const tokens = head.slice(m[0].length).trim().split(/\s+/).filter(Boolean);
|
|
298
|
+
let selector = null;
|
|
299
|
+
let repo = null;
|
|
300
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
301
|
+
const t = tokens[i];
|
|
302
|
+
const inline = /^(--?[\w-]+)=(.*)$/.exec(t);
|
|
303
|
+
if (inline) {
|
|
304
|
+
if (inline[1] === "-R" || inline[1] === "--repo") repo = inline[2] || null;
|
|
305
|
+
continue;
|
|
306
|
+
}
|
|
307
|
+
if (t.startsWith("-")) {
|
|
308
|
+
if (PR_MERGE_VALUE_FLAGS.has(t)) {
|
|
309
|
+
if ((t === "-R" || t === "--repo") && tokens[i + 1]) repo = tokens[i + 1];
|
|
310
|
+
i++;
|
|
311
|
+
}
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (selector === null) selector = t;
|
|
315
|
+
}
|
|
316
|
+
return { forge, selector, repo };
|
|
317
|
+
}
|
|
318
|
+
function prMergeKey(target) {
|
|
319
|
+
return `${target.forge}\0${target.repo ?? ""}\0${target.selector ?? ""}`;
|
|
320
|
+
}
|
|
321
|
+
function prMergeTargets(command) {
|
|
322
|
+
return shellSegments(command).map((segment) => parsePrMergeHead(canonicalGitHead(segment))).filter((t) => t !== null);
|
|
323
|
+
}
|
|
275
324
|
function anyHeadMatches(command, re) {
|
|
276
325
|
return shellInvocationHeads(command).some((head) => re.test(head));
|
|
277
326
|
}
|
|
@@ -377,6 +426,23 @@ var SHELL_DENY_RULES = [
|
|
|
377
426
|
}
|
|
378
427
|
return false;
|
|
379
428
|
})
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
// Claude settings allow `gh pr merge` / `glab mr merge` so the /git-staging merge
|
|
432
|
+
// skips the auto-mode classifier; this rule keeps that allowance to non-protected bases.
|
|
433
|
+
id: "pr-merge-protected-base",
|
|
434
|
+
description: "merging a PR/MR into main/master/prod bypasses /git-prod; an unresolved base (gh/glab could not read the PR/MR: not logged in, wrong selector, or no such PR) is denied too",
|
|
435
|
+
test: (cmd, opts) => {
|
|
436
|
+
const bases = opts?.prMergeBases;
|
|
437
|
+
if (!bases) return false;
|
|
438
|
+
return shellSegments(cmd).some((segment) => {
|
|
439
|
+
if (segmentHasAllowMainPushEnv(segment)) return false;
|
|
440
|
+
const target = parsePrMergeHead(canonicalGitHead(segment));
|
|
441
|
+
if (!target) return false;
|
|
442
|
+
const base = bases[prMergeKey(target)];
|
|
443
|
+
return typeof base !== "string" || isProtectedBranch(base);
|
|
444
|
+
});
|
|
445
|
+
}
|
|
380
446
|
}
|
|
381
447
|
];
|
|
382
448
|
function evaluateShellCommand(command, opts = {}) {
|
|
@@ -425,15 +491,47 @@ async function detectRemotes(cwd) {
|
|
|
425
491
|
return void 0;
|
|
426
492
|
}
|
|
427
493
|
}
|
|
428
|
-
var
|
|
429
|
-
|
|
494
|
+
var PR_BASE_TIMEOUT_MS = 3e3;
|
|
495
|
+
async function resolvePrBase(target, cwd) {
|
|
496
|
+
const selector = target.selector ? [target.selector] : [];
|
|
497
|
+
try {
|
|
498
|
+
if (target.forge === "github") {
|
|
499
|
+
const repo2 = target.repo ? ["--repo", target.repo] : [];
|
|
500
|
+
const { stdout: stdout2 } = await execFileAsync(
|
|
501
|
+
"gh",
|
|
502
|
+
["pr", "view", ...selector, ...repo2, "--json", "baseRefName", "-q", ".baseRefName"],
|
|
503
|
+
{ encoding: "utf8", cwd, timeout: PR_BASE_TIMEOUT_MS }
|
|
504
|
+
);
|
|
505
|
+
return stdout2.trim() || null;
|
|
506
|
+
}
|
|
507
|
+
const repo = target.repo ? ["-R", target.repo] : [];
|
|
508
|
+
const { stdout } = await execFileAsync(
|
|
509
|
+
"glab",
|
|
510
|
+
["mr", "view", ...selector, ...repo, "-F", "json"],
|
|
511
|
+
{
|
|
512
|
+
encoding: "utf8",
|
|
513
|
+
cwd,
|
|
514
|
+
timeout: PR_BASE_TIMEOUT_MS
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
const base = JSON.parse(stdout).target_branch;
|
|
518
|
+
return typeof base === "string" && base ? base : null;
|
|
519
|
+
} catch {
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
var defaultGuardShellDeps = { detectCurrentBranch, detectRemotes, resolvePrBase };
|
|
524
|
+
var GIT_OR_FORGE_RE = /\b(git|gh|glab)\b/;
|
|
430
525
|
async function evaluateGuardShell(command, cwd = process.cwd(), deps = defaultGuardShellDeps) {
|
|
431
|
-
if (!
|
|
432
|
-
const
|
|
526
|
+
if (!GIT_OR_FORGE_RE.test(command)) return evaluateShellCommand(command);
|
|
527
|
+
const targets = prMergeTargets(command);
|
|
528
|
+
const [currentBranch, remotes, bases] = await Promise.all([
|
|
433
529
|
deps.detectCurrentBranch(cwd),
|
|
434
|
-
deps.detectRemotes(cwd)
|
|
530
|
+
deps.detectRemotes(cwd),
|
|
531
|
+
Promise.all(targets.map((t) => deps.resolvePrBase(t, cwd)))
|
|
435
532
|
]);
|
|
436
|
-
|
|
533
|
+
const prMergeBases = targets.length > 0 ? Object.fromEntries(targets.map((t, i) => [prMergeKey(t), bases[i] ?? null])) : void 0;
|
|
534
|
+
return evaluateShellCommand(command, { currentBranch, remotes, prMergeBases });
|
|
437
535
|
}
|
|
438
536
|
async function runGuardShellHook(formatArg, deps = {}) {
|
|
439
537
|
const format = resolveGuardShellFormat(formatArg);
|
|
@@ -448,7 +546,8 @@ async function runGuardShellHook(formatArg, deps = {}) {
|
|
|
448
546
|
}
|
|
449
547
|
const result = await evaluateGuardShell(command, cwd, {
|
|
450
548
|
detectCurrentBranch: deps.detectCurrentBranch ?? defaultGuardShellDeps.detectCurrentBranch,
|
|
451
|
-
detectRemotes: deps.detectRemotes ?? defaultGuardShellDeps.detectRemotes
|
|
549
|
+
detectRemotes: deps.detectRemotes ?? defaultGuardShellDeps.detectRemotes,
|
|
550
|
+
resolvePrBase: deps.resolvePrBase ?? defaultGuardShellDeps.resolvePrBase
|
|
452
551
|
});
|
|
453
552
|
return formatGuardShellOutput(result, format);
|
|
454
553
|
};
|
|
@@ -468,7 +567,7 @@ var guardCommand = defineCommand({
|
|
|
468
567
|
shell: defineCommand({
|
|
469
568
|
meta: {
|
|
470
569
|
name: "shell",
|
|
471
|
-
description: "Evaluate a shell command against the git-workflow / protected-branch deny-list (git checkout|restore|reset --hard|clean -fd + pushes to main/master/prod + direct git push/gh pr create|merge against the public repo). Not a general destructive-command guard: rm -rf, chmod, dd are allowed."
|
|
570
|
+
description: "Evaluate a shell command against the git-workflow / protected-branch deny-list (git checkout|restore|reset --hard|clean -fd + pushes to main/master/prod + gh pr merge / glab mr merge into main/master/prod or an unresolved base + direct git push/gh pr create|merge against the public repo). Not a general destructive-command guard: rm -rf, chmod, dd are allowed."
|
|
472
571
|
},
|
|
473
572
|
args: {
|
|
474
573
|
json: {
|
|
@@ -23,15 +23,15 @@ import {
|
|
|
23
23
|
} from "./chunk-HAFRAXGV.js";
|
|
24
24
|
import {
|
|
25
25
|
stampLastCheckedAt
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-YIOTJQHL.js";
|
|
27
27
|
import {
|
|
28
28
|
loadContextConfig
|
|
29
29
|
} from "./chunk-PFEUZXVT.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-TNO7GTAJ.js";
|
|
31
|
+
import "./chunk-IN4MQ3P3.js";
|
|
32
32
|
import {
|
|
33
33
|
MANIFEST_RELATIVE_PATH
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-5WSFO35Y.js";
|
|
35
35
|
import "./chunk-7HDQEK6T.js";
|
|
36
36
|
import {
|
|
37
37
|
HANDOFF_REL
|
|
@@ -330,6 +330,7 @@ var HARD_RULES = `# Agent Kit session hard rules (manual mode default)
|
|
|
330
330
|
var DOGFOOD_INBOX_HINT = `## Dogfood inbox
|
|
331
331
|
|
|
332
332
|
Unprocessed files are listed under \`dogfood/README.md\` (factory) or \`.cursor/dogfood/README.md\` (consumer). To file a new note, use \`/dogfood <topic> [summary]\`. Follow the ingest ritual (detect \u2192 analyze \u2192 memory WRITE \u2192 triage). Do not auto-start analysis unless the user asks.`;
|
|
333
|
+
var COLONY_HOST_HINT = '**Colony host:** git/forge actions you may not run yourself (merge a PR, rerun failed checks, push a branch) go through `"$COLONY_HOST_CLI" request merge-pr <N> | rerun-checks <run-id>|--pr <N> | push-branch [<branch>] [--reason "..."]`; it waits for the operator\'s click in Colony (exit 0 done, 2 denied: final, 3 failed, 4 timeout).';
|
|
333
334
|
var UPDATE_CHECK_NUDGE = `## Agent Kit update available
|
|
334
335
|
|
|
335
336
|
Installed **v{installed}**; latest public **v{latest}**.
|
|
@@ -503,6 +504,9 @@ async function dogfoodInboxSection(root) {
|
|
|
503
504
|
}
|
|
504
505
|
return null;
|
|
505
506
|
}
|
|
507
|
+
function colonyHostSection(env = process.env) {
|
|
508
|
+
return env.COLONY_HOST_CLI?.trim() ? COLONY_HOST_HINT : null;
|
|
509
|
+
}
|
|
506
510
|
async function loadUpdateCheckPrefs(root) {
|
|
507
511
|
const data = await loadContextConfig(root);
|
|
508
512
|
if (!data) return null;
|
|
@@ -930,6 +934,8 @@ async function buildSessionStartAdditionalContext(rootDir, _payload = {}, deps =
|
|
|
930
934
|
}
|
|
931
935
|
const dogfood = await dogfoodInboxSection(root);
|
|
932
936
|
if (dogfood) parts.push(dogfood);
|
|
937
|
+
const colonyHost = colonyHostSection();
|
|
938
|
+
if (colonyHost) parts.push(colonyHost);
|
|
933
939
|
const deadlineMs = deps.deadlineMs ?? SESSION_START_SECTION_DEADLINE_MS;
|
|
934
940
|
const newAttempt = () => ({ spawned: false, timedOut: false, result: null });
|
|
935
941
|
const updateAttempt = newAttempt();
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
rewriteRootArgvToRun
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-U7XOLYDG.js";
|
|
5
|
+
import "./chunk-2TCRKQHD.js";
|
|
6
|
+
import "./chunk-MTLQN57O.js";
|
|
6
7
|
import "./chunk-WGLPZXNU.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-6RRG3WOE.js";
|
|
8
9
|
import {
|
|
9
10
|
HELMET_OUTLINE,
|
|
10
11
|
SPACE_MARKS,
|
|
@@ -131,7 +132,7 @@ var CLI_HELP_GROUPS = [
|
|
|
131
132
|
{
|
|
132
133
|
id: "dashboard",
|
|
133
134
|
title: "DASHBOARD",
|
|
134
|
-
commands: ["dashboard", "dashboard-broadcast", "mission-control", "monitors"]
|
|
135
|
+
commands: ["dashboard", "dashboard-broadcast", "mission-control", "monitors", "sessions"]
|
|
135
136
|
},
|
|
136
137
|
{
|
|
137
138
|
id: "integrity",
|
|
@@ -145,7 +146,8 @@ var CLI_HELP_GROUPS = [
|
|
|
145
146
|
"remote-issues",
|
|
146
147
|
"dogfood",
|
|
147
148
|
"diff",
|
|
148
|
-
"contribute"
|
|
149
|
+
"contribute",
|
|
150
|
+
"engine-info"
|
|
149
151
|
]
|
|
150
152
|
}
|
|
151
153
|
];
|
|
@@ -221,34 +223,36 @@ var main = defineCommand({
|
|
|
221
223
|
version: KIT_VERSION
|
|
222
224
|
},
|
|
223
225
|
subCommands: {
|
|
224
|
-
init: () => import("./init-
|
|
225
|
-
install: () => import("./install-
|
|
226
|
+
init: () => import("./init-4B2IRH27.js").then((m) => m.initCommand),
|
|
227
|
+
install: () => import("./install-3JVTG35O.js").then((m) => m.installCommand),
|
|
226
228
|
scan: () => import("./scan-UX4HARMJ.js").then((m) => m.scanCommand),
|
|
227
|
-
add: () => import("./add-
|
|
228
|
-
doctor: () => import("./doctor-
|
|
229
|
-
"setup-global": () => import("./setup-global-
|
|
230
|
-
status: () => import("./status-
|
|
231
|
-
update: () => import("./update-
|
|
229
|
+
add: () => import("./add-IT6XFPKT.js").then((m) => m.addCommand),
|
|
230
|
+
doctor: () => import("./doctor-FLIQCVFN.js").then((m) => m.doctorCommand),
|
|
231
|
+
"setup-global": () => import("./setup-global-6JM5XTAT.js").then((m) => m.setupGlobalCommand),
|
|
232
|
+
status: () => import("./status-PMAI7NH3.js").then((m) => m.statusCommand),
|
|
233
|
+
update: () => import("./update-3PLY4FZA.js").then((m) => m.updateCommand),
|
|
232
234
|
"cursor-awareness": () => import("./cursor-awareness-TN5JXD2C.js").then((m) => m.cursorAwarenessCommand),
|
|
233
235
|
"public-inbound-radar": () => import("./public-inbound-radar-5U4JMBRU.js").then((m) => m.publicInboundRadarCommand),
|
|
234
236
|
"remote-issues": () => import("./remote-issues-APYOMIJC.js").then((m) => m.remoteIssuesCommand),
|
|
235
237
|
dogfood: () => import("./dogfood-2JAHSYQA.js").then((m) => m.dogfoodCommand),
|
|
236
|
-
diff: () => import("./diff-
|
|
237
|
-
contribute: () => import("./contribute-
|
|
238
|
+
diff: () => import("./diff-GWIHGH65.js").then((m) => m.diffCommand),
|
|
239
|
+
contribute: () => import("./contribute-V7PV5UMK.js").then((m) => m.contributeCommand),
|
|
238
240
|
handoff: () => import("./handoff-5AGE2D3T.js").then((m) => m.handoffCommand),
|
|
239
241
|
"plan-index": () => import("./plan-index-BNLUU6T5.js").then((m) => m.planIndexCommand),
|
|
240
|
-
run: () => import("./run-
|
|
241
|
-
"run-plan": () => import("./run-plan-
|
|
242
|
-
"run-plan-all": () => import("./run-
|
|
243
|
-
countdown: () => import("./countdown-
|
|
244
|
-
"ground-control": () => import("./ground-control-
|
|
242
|
+
run: () => import("./run-AYT6CRHI.js").then((m) => m.runCommand),
|
|
243
|
+
"run-plan": () => import("./run-plan-5XIISG3W.js").then((m) => m.runPlanCommand),
|
|
244
|
+
"run-plan-all": () => import("./run-AYT6CRHI.js").then((m) => m.runPlanAllCommand),
|
|
245
|
+
countdown: () => import("./countdown-YONBTSJ2.js").then((m) => m.countdownCommand),
|
|
246
|
+
"ground-control": () => import("./ground-control-6W2AKTKI.js").then((m) => m.groundControlCommand),
|
|
245
247
|
dashboard: () => import("./dashboard-YNCFISNO.js").then((m) => m.dashboardCommand),
|
|
246
248
|
"dashboard-broadcast": () => import("./dashboard-broadcast-NK7PU72L.js").then((m) => m.dashboardBroadcastCommand),
|
|
247
249
|
"mission-control": () => import("./mission-control-MHQU73XC.js").then((m) => m.missionControlCommand),
|
|
248
|
-
hook: () => import("./hook-
|
|
249
|
-
guard: () => import("./guard-
|
|
250
|
+
hook: () => import("./hook-2SX2V2T6.js").then((m) => m.hookCommand),
|
|
251
|
+
guard: () => import("./guard-ZZRQW3DJ.js").then((m) => m.guardCommand),
|
|
250
252
|
monitors: () => import("./monitors-PDXBLB3U.js").then((m) => m.monitorsCommand),
|
|
251
|
-
|
|
253
|
+
sessions: () => import("./sessions-O7MYEMCT.js").then((m) => m.sessionsCommand),
|
|
254
|
+
validate: () => import("./validate-V2CW7J4B.js").then((m) => m.validateCommand),
|
|
255
|
+
"engine-info": () => import("./engine-info-UQNVNOA2.js").then((m) => m.engineInfoCommand)
|
|
252
256
|
},
|
|
253
257
|
async run({ rawArgs }) {
|
|
254
258
|
if (hasCliSubcommand(rawArgs)) return;
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
nextStepAfterInstall,
|
|
3
3
|
performInstall,
|
|
4
4
|
printInstallEpilogue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-I2D75F4I.js";
|
|
6
6
|
import {
|
|
7
7
|
NON_INTERACTIVE_ROOT_ARGS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5LQP4JGH.js";
|
|
9
9
|
import {
|
|
10
10
|
SkippedSymlinkError,
|
|
11
11
|
logApplyStats
|
|
12
12
|
} from "./chunk-HS7LVVLO.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-34BBPQKI.js";
|
|
14
|
+
import "./chunk-WOGBBJCX.js";
|
|
15
15
|
import "./chunk-HAFRAXGV.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-236IYK6L.js";
|
|
17
17
|
import "./chunk-WGLPZXNU.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-6RRG3WOE.js";
|
|
19
19
|
import {
|
|
20
20
|
withCliProgress
|
|
21
21
|
} from "./chunk-QTON2GQX.js";
|
|
@@ -31,15 +31,15 @@ import {
|
|
|
31
31
|
confirmProjectRoot,
|
|
32
32
|
isNonInteractive,
|
|
33
33
|
syncPathCliToRuntime
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-EI3VQ7FU.js";
|
|
35
35
|
import {
|
|
36
36
|
assessEnvironment
|
|
37
37
|
} from "./chunk-B3VR5YBQ.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-YIOTJQHL.js";
|
|
39
39
|
import "./chunk-PFEUZXVT.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-TNO7GTAJ.js";
|
|
41
|
+
import "./chunk-IN4MQ3P3.js";
|
|
42
|
+
import "./chunk-5WSFO35Y.js";
|
|
43
43
|
import {
|
|
44
44
|
KIT_VERSION
|
|
45
45
|
} from "./chunk-7HDQEK6T.js";
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
nextStepAfterInstall,
|
|
4
4
|
performInstall,
|
|
5
5
|
printInstallEpilogue
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-I2D75F4I.js";
|
|
7
|
+
import "./chunk-5LQP4JGH.js";
|
|
8
8
|
import "./chunk-HS7LVVLO.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-34BBPQKI.js";
|
|
10
|
+
import "./chunk-WOGBBJCX.js";
|
|
11
11
|
import "./chunk-HAFRAXGV.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-236IYK6L.js";
|
|
13
13
|
import "./chunk-WGLPZXNU.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-6RRG3WOE.js";
|
|
15
15
|
import "./chunk-QTON2GQX.js";
|
|
16
16
|
import "./chunk-PNFF6OU3.js";
|
|
17
17
|
import "./chunk-GO3K752H.js";
|
|
18
18
|
import "./chunk-F6C3GFKV.js";
|
|
19
19
|
import "./chunk-ZB43YMHW.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-EI3VQ7FU.js";
|
|
21
21
|
import "./chunk-B3VR5YBQ.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-YIOTJQHL.js";
|
|
23
23
|
import "./chunk-PFEUZXVT.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-TNO7GTAJ.js";
|
|
25
|
+
import "./chunk-IN4MQ3P3.js";
|
|
26
|
+
import "./chunk-5WSFO35Y.js";
|
|
27
27
|
import "./chunk-7HDQEK6T.js";
|
|
28
28
|
import "./chunk-C4Q77GGJ.js";
|
|
29
29
|
import "./chunk-5B4DVO6C.js";
|