@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.
Files changed (86) hide show
  1. package/README.md +1 -0
  2. package/dashboard/dashboard-data.mjs +126 -5
  3. package/dashboard/dashboard.html +48 -7
  4. package/dashboard/lib/guards.mjs +1 -0
  5. package/dashboard/lib/live-refresh.mjs +1 -0
  6. package/dist/{add-RKZQX6ZK.js → add-G7KEZLWP.js} +17 -8
  7. package/dist/{chunk-7HDQEK6T.js → chunk-2G4K4ZI5.js} +7 -3
  8. package/dist/{chunk-5PSV76CQ.js → chunk-2GXN7HVG.js} +26 -7
  9. package/dist/chunk-2QYWMSI5.js +193 -0
  10. package/dist/{chunk-B3VR5YBQ.js → chunk-2TW7ENWC.js} +12 -11
  11. package/dist/{chunk-IESSMKOV.js → chunk-5A72LTR3.js} +7 -7
  12. package/dist/{chunk-R4DUO5DA.js → chunk-AXQMVQ6O.js} +61 -237
  13. package/dist/{chunk-6WUKLS4D.js → chunk-BIFTTL2O.js} +1 -1
  14. package/dist/{chunk-AWQ6KRFV.js → chunk-BVZDPVUL.js} +1 -1
  15. package/dist/{chunk-QNISTPPZ.js → chunk-ENRXS5O6.js} +19 -12
  16. package/dist/chunk-FB6G6OD6.js +519 -0
  17. package/dist/{chunk-MFKHIWEL.js → chunk-FOVHFMSH.js} +1 -1
  18. package/dist/{chunk-6BEFGKCU.js → chunk-FUSNEYGU.js} +29 -3
  19. package/dist/chunk-H7KAXI5R.js +357 -0
  20. package/dist/chunk-HGB4DHXV.js +138 -0
  21. package/dist/{chunk-W3ZJVBNY.js → chunk-HXV6VQD4.js} +2374 -983
  22. package/dist/{chunk-BGL5DRK2.js → chunk-I3FGWNU5.js} +4 -4
  23. package/dist/chunk-IHVJTGYR.js +144 -0
  24. package/dist/{chunk-5LNHRL5E.js → chunk-IUY24WPE.js} +93 -263
  25. package/dist/chunk-JG5MKMOM.js +248 -0
  26. package/dist/{chunk-SGTTC2JP.js → chunk-JWIJHO67.js} +17 -2
  27. package/dist/chunk-KMK4T4ZM.js +34 -0
  28. package/dist/{chunk-ZMYV6PRE.js → chunk-LEVNLHH3.js} +2 -1
  29. package/dist/{chunk-2IP4OO6R.js → chunk-MGVV6YC4.js} +1 -1
  30. package/dist/{chunk-7TYA3GMI.js → chunk-MWRYQLEG.js} +7 -4
  31. package/dist/chunk-NHJ4IAVN.js +435 -0
  32. package/dist/{chunk-C4Q77GGJ.js → chunk-O7VMHCNN.js} +6 -0
  33. package/dist/{chunk-5EBT3V7G.js → chunk-OVRGTHZD.js} +1 -1
  34. package/dist/{chunk-F7YAAKYP.js → chunk-PCIYXGB3.js} +7 -5
  35. package/dist/{chunk-UJCATSYO.js → chunk-PLLXFSN2.js} +46 -17
  36. package/dist/{chunk-OYFCBYMP.js → chunk-RJP47EGS.js} +18 -1
  37. package/dist/{chunk-KDJ4ML7I.js → chunk-RRJVC35Y.js} +4 -4
  38. package/dist/{chunk-DRZFWIBN.js → chunk-SWJJW624.js} +1 -1
  39. package/dist/{chunk-MJJBIOSY.js → chunk-SYRJ5TTK.js} +34 -12
  40. package/dist/{chunk-L5V3W3DY.js → chunk-TTUFIE26.js} +60 -14
  41. package/dist/{chunk-JFS4GKP7.js → chunk-XXPI4H4D.js} +2 -2
  42. package/dist/{chunk-CVZNSRXV.js → chunk-Y5526WCN.js} +84 -19
  43. package/dist/{chunk-CQHD6UKB.js → chunk-Y575INEC.js} +2 -1
  44. package/dist/{chunk-V2H57TFD.js → chunk-ZNZHDPS3.js} +80 -170
  45. package/dist/{commands-SAQEEE6V.js → commands-K4HSDML5.js} +8 -6
  46. package/dist/{conflicts-5JOP4GX2.js → conflicts-4SUWIPWP.js} +9 -10
  47. package/dist/{contribute-BQKRT5GN.js → contribute-HE4WCBRY.js} +7 -5
  48. package/dist/{countdown-25E5C7AR.js → countdown-TYQHVAIX.js} +305 -32
  49. package/dist/{dashboard-P65XHYCU.js → dashboard-6V6PCNYF.js} +1 -1
  50. package/dist/{dashboard-broadcast-GYK34QYL.js → dashboard-broadcast-PMVQ7PXU.js} +1 -1
  51. package/dist/{diff-6JSXBVSX.js → diff-3XUZM7ZT.js} +15 -6
  52. package/dist/{doctor-I3MTHS7F.js → doctor-KGUWU5SN.js} +106 -19
  53. package/dist/{engine-info-BBI5QO5Y.js → engine-info-VM4VPGQM.js} +2 -2
  54. package/dist/{ground-control-IDCXN5FK.js → ground-control-ZIDHEOPW.js} +7 -4
  55. package/dist/{guard-RJZEEKSL.js → guard-ZO4Z3LLB.js} +47 -9
  56. package/dist/{handoff-5AGE2D3T.js → handoff-LLT4CI6H.js} +4 -3
  57. package/dist/{hook-WNA42CXE.js → hook-UPZ3CPYS.js} +22 -20
  58. package/dist/index.js +51 -33
  59. package/dist/{init-FZ2UFPO7.js → init-ZHLVXEVT.js} +25 -18
  60. package/dist/install-XWOG64W3.js +42 -0
  61. package/dist/installs-2ROXPO6M.js +223 -0
  62. package/dist/{mission-control-CRMCRZUU.js → mission-control-IGOI3WHS.js} +2 -2
  63. package/dist/models-5BDXREWM.js +45 -0
  64. package/dist/paths-JTPV6SXH.js +107 -0
  65. package/dist/pi-DCMDOY65.js +248 -0
  66. package/dist/{plan-index-BNLUU6T5.js → plan-index-5QZJK4AG.js} +2 -3
  67. package/dist/{queue-JW4VR33H.js → queue-Z5VNNHM6.js} +10 -12
  68. package/dist/{run-X2WOONTB.js → run-QURAXAR2.js} +27 -33
  69. package/dist/{run-plan-4MOLLIES.js → run-plan-4MMHVCTS.js} +35 -23
  70. package/dist/{scan-K3T5RQLC.js → scan-7D3RMO34.js} +2 -1
  71. package/dist/{session-start-MV7A4263.js → session-start-NC2HE5X5.js} +20 -14
  72. package/dist/{sessions-UPFDWDMB.js → sessions-WWWLYPW6.js} +4 -4
  73. package/dist/{setup-global-VNADNTQ2.js → setup-global-WDMARD4Z.js} +12 -10
  74. package/dist/{status-SXA3OK5E.js → status-2WNJL7PP.js} +17 -13
  75. package/dist/update-YSVOYYK5.js +32 -0
  76. package/dist/update-all-5XLTCHPX.js +697 -0
  77. package/package.json +14 -4
  78. package/pi/agent-kit.ts +224 -0
  79. package/dist/chunk-4MR4QXMF.js +0 -52
  80. package/dist/chunk-7ABY6DYH.js +0 -89
  81. package/dist/chunk-C4LCOOL4.js +0 -71
  82. package/dist/chunk-DZCLMIAS.js +0 -391
  83. package/dist/chunk-HAFRAXGV.js +0 -17
  84. package/dist/chunk-MUTTNRX4.js +0 -53
  85. package/dist/install-CTLT3TSI.js +0 -38
  86. package/dist/update-RMAWXMCV.js +0 -304
@@ -0,0 +1,193 @@
1
+ import {
2
+ fileExists,
3
+ readJson
4
+ } from "./chunk-5B4DVO6C.js";
5
+
6
+ // src/scanner/detect-git.ts
7
+ import { execFile } from "child_process";
8
+ import path from "path";
9
+ import { promisify } from "util";
10
+
11
+ // src/scanner/paths.ts
12
+ var REPOSITORY_PROFILE_REL = ".cursor/agent-kit.config.json";
13
+
14
+ // src/scanner/detect-git.ts
15
+ var exec = promisify(execFile);
16
+ function remoteHostname(remoteUrl) {
17
+ const scpMatch = remoteUrl.match(/^[^@]+@([^:]+):/);
18
+ if (scpMatch?.[1]) return scpMatch[1].toLowerCase();
19
+ try {
20
+ return new URL(remoteUrl).hostname.toLowerCase();
21
+ } catch {
22
+ return void 0;
23
+ }
24
+ }
25
+ function sanitizeRemoteUrl(remoteUrl) {
26
+ try {
27
+ const parsed = new URL(remoteUrl);
28
+ parsed.username = "";
29
+ parsed.password = "";
30
+ return parsed.toString();
31
+ } catch {
32
+ return remoteUrl;
33
+ }
34
+ }
35
+ async function detectProvider(rootDir, remoteUrl) {
36
+ const configuration = await readJson(
37
+ path.join(rootDir, REPOSITORY_PROFILE_REL)
38
+ );
39
+ const configuredProvider = configuration?.git?.provider;
40
+ if (configuredProvider) {
41
+ const configuredKind = configuration.git?.providerKind ?? (configuredProvider === "github" ? "github" : configuredProvider === "gitlab" ? remoteUrl && remoteHostname(remoteUrl) === "gitlab.com" ? "gitlab-saas" : "gitlab-self-hosted" : configuredProvider === "other" ? "custom" : "known-other");
42
+ return {
43
+ provider: configuredProvider,
44
+ providerKind: configuredKind,
45
+ confidence: "high",
46
+ evidence: [{ source: "configuration", value: `${REPOSITORY_PROFILE_REL}#git.provider` }]
47
+ };
48
+ }
49
+ if (!remoteUrl) {
50
+ return { providerKind: "unknown", confidence: "low", evidence: [] };
51
+ }
52
+ const hostname = remoteHostname(remoteUrl);
53
+ const remoteEvidence = [{ source: "git", value: `remote:${remoteUrl}` }];
54
+ if (hostname === "github.com") {
55
+ return {
56
+ provider: "github",
57
+ providerKind: "github",
58
+ confidence: "high",
59
+ evidence: remoteEvidence
60
+ };
61
+ }
62
+ if (hostname === "gitlab.com") {
63
+ return {
64
+ provider: "gitlab",
65
+ providerKind: "gitlab-saas",
66
+ confidence: "high",
67
+ evidence: remoteEvidence
68
+ };
69
+ }
70
+ if (hostname === "bitbucket.org") {
71
+ return {
72
+ provider: "bitbucket",
73
+ providerKind: "known-other",
74
+ confidence: "high",
75
+ evidence: remoteEvidence
76
+ };
77
+ }
78
+ if (hostname === "dev.azure.com" || hostname?.endsWith(".visualstudio.com")) {
79
+ return {
80
+ provider: "azure-devops",
81
+ providerKind: "known-other",
82
+ confidence: "high",
83
+ evidence: remoteEvidence
84
+ };
85
+ }
86
+ if (hostname === "codeberg.org") {
87
+ return {
88
+ provider: "gitea",
89
+ providerKind: "known-other",
90
+ confidence: "high",
91
+ evidence: remoteEvidence
92
+ };
93
+ }
94
+ if (await fileExists(path.join(rootDir, ".gitlab-ci.yml"))) {
95
+ return {
96
+ provider: "gitlab",
97
+ providerKind: "gitlab-self-hosted",
98
+ confidence: "medium",
99
+ evidence: [...remoteEvidence, { source: "file", value: ".gitlab-ci.yml" }]
100
+ };
101
+ }
102
+ return {
103
+ provider: "other",
104
+ providerKind: hostname ? "custom" : "unknown",
105
+ confidence: "low",
106
+ evidence: remoteEvidence
107
+ };
108
+ }
109
+ function inferWorkflow(currentBranch, hasLocalStaging, hasRemoteStaging) {
110
+ if (hasLocalStaging || hasRemoteStaging) return "homolog-prod";
111
+ if (!currentBranch) return "unknown";
112
+ if (currentBranch === "main" || currentBranch === "master") return "feature-pr";
113
+ if (currentBranch.includes("develop") || currentBranch.includes("release")) return "gitflow";
114
+ if (currentBranch.includes("staging") || currentBranch.includes("homolog")) return "homolog-prod";
115
+ return "feature-pr";
116
+ }
117
+ var GIT_MAX_BUFFER = 64 * 1024 * 1024;
118
+ async function runGit(args, rootDir) {
119
+ try {
120
+ const { stdout } = await exec("git", args, { cwd: rootDir, maxBuffer: GIT_MAX_BUFFER });
121
+ return stdout.trim();
122
+ } catch {
123
+ return void 0;
124
+ }
125
+ }
126
+ async function listTrackedFiles(rootDir) {
127
+ return (await runGit(["ls-files"], rootDir))?.split("\n").filter(Boolean);
128
+ }
129
+ async function detectGitDirty(rootDir) {
130
+ return Boolean(await runGit(["status", "--porcelain"], rootDir));
131
+ }
132
+ async function detectGit(rootDir) {
133
+ const isGit = await runGit(["rev-parse", "--is-inside-work-tree"], rootDir) === "true";
134
+ if (!isGit) {
135
+ return {
136
+ providerKind: "unknown",
137
+ providerConfidence: "low",
138
+ providerEvidence: [],
139
+ remotes: [],
140
+ mode: "none",
141
+ workflow: "unknown",
142
+ isDirty: false,
143
+ hasLocalStaging: false,
144
+ hasRemoteStaging: false
145
+ };
146
+ }
147
+ const remoteNames = (await runGit(["remote"], rootDir))?.split("\n").filter(Boolean) ?? [];
148
+ const remotes = (await Promise.all(
149
+ remoteNames.map(async (name) => {
150
+ const url = await runGit(["remote", "get-url", name], rootDir);
151
+ return url ? { name, url: sanitizeRemoteUrl(url) } : void 0;
152
+ })
153
+ )).filter((remote) => remote !== void 0);
154
+ const primary = remotes.find((remote) => remote.name === "origin") ?? remotes[0];
155
+ const remoteUrl = primary?.url;
156
+ const [currentBranch, remoteHead, localBranchOutput, remoteBranchOutput, status, provider] = await Promise.all([
157
+ runGit(["branch", "--show-current"], rootDir),
158
+ primary ? runGit(["symbolic-ref", "--short", `refs/remotes/${primary.name}/HEAD`], rootDir) : Promise.resolve(void 0),
159
+ runGit(["for-each-ref", "--format=%(refname:short)", "refs/heads"], rootDir),
160
+ runGit(["for-each-ref", "--format=%(refname:short)", "refs/remotes"], rootDir),
161
+ runGit(["status", "--porcelain"], rootDir),
162
+ detectProvider(rootDir, remoteUrl)
163
+ ]);
164
+ const localBranches = localBranchOutput?.split("\n").filter(Boolean);
165
+ const remoteBranches = remoteBranchOutput?.split("\n").filter(Boolean);
166
+ const defaultBranch = remoteHead?.split("/").slice(1).join("/") || (localBranches?.includes("main") ? "main" : localBranches?.includes("master") ? "master" : void 0);
167
+ const hasLocalStaging = localBranches?.includes("staging") ?? false;
168
+ const hasRemoteStaging = remoteBranches?.some((branch) => remoteNames.some((r) => branch === `${r}/staging`)) ?? false;
169
+ return {
170
+ provider: provider.provider,
171
+ providerKind: provider.providerKind,
172
+ providerConfidence: provider.confidence,
173
+ providerEvidence: provider.evidence,
174
+ remoteUrl,
175
+ remoteName: primary?.name,
176
+ remotes,
177
+ mode: remotes.length > 0 ? "remote-hosted" : "local-only",
178
+ currentBranch,
179
+ defaultBranch,
180
+ isDirty: Boolean(status),
181
+ hasLocalStaging,
182
+ hasRemoteStaging,
183
+ workflow: inferWorkflow(currentBranch, hasLocalStaging, hasRemoteStaging)
184
+ };
185
+ }
186
+
187
+ export {
188
+ REPOSITORY_PROFILE_REL,
189
+ detectProvider,
190
+ listTrackedFiles,
191
+ detectGitDirty,
192
+ detectGit
193
+ };
@@ -5,13 +5,10 @@ import path from "path";
5
5
  var MIN_NODE_MAJOR = 22;
6
6
  var MIN_NODE_MINOR = 12;
7
7
  var MIN_NODE_VERSION_LABEL = `${MIN_NODE_MAJOR}.${MIN_NODE_MINOR}`;
8
- var CLI_PACKAGE_JSON_REL = path.join(
9
- "lib",
10
- "node_modules",
11
- "@dadado",
12
- "agent-kit-cli",
13
- "package.json"
14
- );
8
+ var CLI_PACKAGE_SEGMENTS = [
9
+ ["@dadado", "agent-kit-cli"],
10
+ ["@missionkit", "cli"]
11
+ ];
15
12
  var DIST_INDEX_RE = /(?:\$\{basedir\}|\$basedir)?[^'"\s;]*dist\/index\.js/g;
16
13
  function extractDistIndexFromBinScript(contents) {
17
14
  const found = [];
@@ -49,10 +46,12 @@ async function readBinVersion(binPath, options = {}) {
49
46
  if (path.basename(realBin) === "index.js" && path.basename(path.dirname(realBin)) === "dist") {
50
47
  candidates.push(packageJsonFromDistIndex(realBin));
51
48
  }
52
- candidates.push(
53
- path.join(binDir, "..", CLI_PACKAGE_JSON_REL),
54
- path.join(binDir, "..", "node_modules", "@dadado", "agent-kit-cli", "package.json")
55
- );
49
+ for (const [scope, name] of CLI_PACKAGE_SEGMENTS) {
50
+ candidates.push(
51
+ path.join(binDir, "..", "lib", "node_modules", scope, name, "package.json"),
52
+ path.join(binDir, "..", "node_modules", scope, name, "package.json")
53
+ );
54
+ }
56
55
  try {
57
56
  if ((await stat(realBin)).size < SHIM_MAX_BYTES) {
58
57
  const contents = await readFileImpl(binPath);
@@ -215,5 +214,7 @@ async function assessEnvironment(options = {}) {
215
214
 
216
215
  export {
217
216
  MIN_NODE_VERSION_LABEL,
217
+ readBinVersion,
218
+ resolveBinOnPath,
218
219
  assessEnvironment
219
220
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isBranchInBase
3
- } from "./chunk-5EBT3V7G.js";
3
+ } from "./chunk-OVRGTHZD.js";
4
4
  import {
5
5
  GATE_EXIT_BRANCH_PREFIX,
6
6
  GATE_EXIT_NOTE_DIR,
@@ -11,22 +11,22 @@ import {
11
11
  isSafeBaseRef,
12
12
  landGateExit,
13
13
  resolveGateExitRefs
14
- } from "./chunk-BGL5DRK2.js";
15
- import {
16
- ensurePathIgnored
17
- } from "./chunk-MUTTNRX4.js";
14
+ } from "./chunk-I3FGWNU5.js";
18
15
  import {
19
16
  ensureDispatchLogPath,
20
17
  readCommandFile,
21
18
  runHeadlessDispatch
22
- } from "./chunk-SGTTC2JP.js";
19
+ } from "./chunk-JWIJHO67.js";
23
20
  import {
24
21
  redactSecrets
25
- } from "./chunk-W3ZJVBNY.js";
22
+ } from "./chunk-HXV6VQD4.js";
26
23
  import {
27
24
  formatHitlSummary,
28
25
  hitlExitCode
29
26
  } from "./chunk-P7732A25.js";
27
+ import {
28
+ ensurePathIgnored
29
+ } from "./chunk-TTUFIE26.js";
30
30
 
31
31
  // src/plan-loop/review-job.ts
32
32
  import { randomBytes } from "crypto";