@modootoday/pmcp 0.22.3 → 0.22.6
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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/dist/{apply-CYVC5LDG.js → apply-IQU3K5TB.js} +13 -13
- package/dist/{chunk-WPX4ONFT.js → chunk-3HEYCZFZ.js} +5 -5
- package/dist/{chunk-KUBHGVTD.js → chunk-42SO7KYX.js} +17 -11
- package/dist/chunk-4EQIZQX2.js +7 -0
- package/dist/{chunk-7LUYI7QM.js → chunk-5JWCGSZD.js} +2 -2
- package/dist/{chunk-FE7WOHZM.js → chunk-7CSUKCU7.js} +2 -2
- package/dist/{chunk-CALWIRAI.js → chunk-AOHHCYRF.js} +12 -12
- package/dist/{chunk-G7JONWL4.js → chunk-B3OZ4GGO.js} +13 -1
- package/dist/{chunk-RZZZHQCE.js → chunk-CLE6VHO6.js} +2 -2
- package/dist/{chunk-ICZH4NFR.js → chunk-E4X6GSNI.js} +5 -5
- package/dist/{chunk-PR2RBEXI.js → chunk-G6QFWOLV.js} +2 -2
- package/dist/{chunk-7Q3AIS4Q.js → chunk-GSU22DYJ.js} +2 -2
- package/dist/{chunk-MZF7VOQA.js → chunk-H4Z2AIXM.js} +2 -2
- package/dist/{chunk-UQNRGU3V.js → chunk-JN7TRPFB.js} +2 -2
- package/dist/{chunk-HV52EUSL.js → chunk-JUEMDWWJ.js} +4 -4
- package/dist/{chunk-ONYZIC2F.js → chunk-KFMHTOSI.js} +3 -3
- package/dist/{chunk-ULFV3EIZ.js → chunk-KTANZVAJ.js} +2 -2
- package/dist/{chunk-P6LNYYYH.js → chunk-M6X6HVQK.js} +2 -2
- package/dist/{chunk-XZ2TDH3J.js → chunk-PCSE36BM.js} +97 -14
- package/dist/{chunk-ESCOMAPX.js → chunk-PX4FWUEN.js} +3 -3
- package/dist/{chunk-MQMWVJZB.js → chunk-RZNZKI5A.js} +2 -2
- package/dist/{chunk-JUG4W7RF.js → chunk-SLL5FSDI.js} +2 -2
- package/dist/{chunk-2Q6MNGU5.js → chunk-SUDG7B6S.js} +2 -2
- package/dist/{chunk-V7LZTVWS.js → chunk-TBVQ7SM7.js} +2 -2
- package/dist/{chunk-NQFULJZC.js → chunk-TPTKRLI7.js} +3 -3
- package/dist/{chunk-MLGXDSHZ.js → chunk-WV3YP35O.js} +124 -37
- package/dist/{cli-A6HKRICM.js → cli-DYVNJYZ7.js} +8 -8
- package/dist/cli.js +3 -3
- package/dist/{completion-FDLVWLAC.js → completion-ORGJMKIY.js} +2 -2
- package/dist/{diagnostics-DYLW7WYV.js → diagnostics-TLKMQGMH.js} +5 -5
- package/dist/{doctor-FRQ5H5FU.js → doctor-27ZFI6JY.js} +15 -15
- package/dist/{entry-XPZZNQ4L.js → entry-T3HFGNC2.js} +9 -9
- package/dist/{exec-mcp-HOM2ZANM.js → exec-mcp-IZYZI2KM.js} +11 -11
- package/dist/{harness-WIGJRE5P.js → harness-DSB275UL.js} +3 -3
- package/dist/harness-launch-gate.js +3 -3
- package/dist/harness-worker.js +5 -5
- package/dist/hook-body.js +312 -131
- package/dist/{hooks-MIF3FONJ.js → hooks-UN4LMHZW.js} +3 -3
- package/dist/{host-JKZLOCZS.js → host-5M4RWFKB.js} +6 -6
- package/dist/{host-CE5TW5SC.js → host-X4WU2J3Z.js} +13 -13
- package/dist/{host-run-MJGJ7NVE.js → host-run-A64IXBGN.js} +4 -4
- package/dist/http.js +1 -1
- package/dist/{import-mcp-T3GZYEE5.js → import-mcp-PYX5OKQQ.js} +10 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -14
- package/dist/{init-D5VPDF2B.js → init-QUN7QS2K.js} +2 -2
- package/dist/{invoke-HEAOQLFQ.js → invoke-FGOUHWVB.js} +7 -7
- package/dist/{list-PCLCFG2J.js → list-5YUAOTM7.js} +12 -12
- package/dist/{logout-3ZXFXKHB.js → logout-PAODLQ5M.js} +11 -11
- package/dist/{mainline-6CTSVOWP.js → mainline-CRL5B3X3.js} +44 -12
- package/dist/{mcp-T6PYHRUL.js → mcp-WUUKG3JV.js} +2 -2
- package/dist/{modes-COBVV7RA.js → modes-SEINLLMK.js} +3 -3
- package/dist/{project-H4R3Q3QO.js → project-HY6O6DZQ.js} +4 -4
- package/dist/{run-V74M7PZK.js → run-55L6MVBR.js} +10 -10
- package/dist/{run-FMTHUOAZ.js → run-ZLIZZC2I.js} +4 -4
- package/dist/{serve-JKNEC4AX.js → serve-HKBA6OSF.js} +3 -3
- package/dist/{setup-HYEYYVDU.js → setup-SOUBEZ3H.js} +4 -4
- package/dist/{start-login-JRMVLK5J.js → start-login-VRH4OLKM.js} +11 -11
- package/dist/{status-6273XFHT.js → status-6JX7PKQ3.js} +11 -11
- package/dist/{status-RG2GFDQU.js → status-CZG6ZPUG.js} +12 -12
- package/dist/stdio.js +2 -2
- package/dist/{test-M365FK5N.js → test-22FIZGYO.js} +11 -11
- package/dist/{tui-PKPYE76A.js → tui-JUEU727K.js} +4 -4
- package/dist/{worker-C23EAPCY.js → worker-T7ERD4L7.js} +7 -7
- package/dist/{worktree-create-NO4UOOEP.js → worktree-create-KMXPQXIQ.js} +2 -2
- package/dist/{worktree-list-EMKUMCTQ.js → worktree-list-WH6OX6U7.js} +4 -4
- package/dist/{worktree-sync-A277AF4M.js → worktree-sync-VWNOJD63.js} +5 -5
- package/docs/git-workflow.md +13 -2
- package/gemini-extension.json +2 -2
- package/mcp.json +1 -1
- package/package.json +5 -5
- package/plugin.json +1 -1
- package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
- package/plugins/pmcp/.mcp.json +1 -1
- package/plugins/pmcp/gemini-extension.json +2 -2
- package/plugins/pmcp/mcp.json +1 -1
- package/plugins/pmcp/plugin.json +1 -1
- package/dist/chunk-JTRFZQTB.js +0 -7
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
|
+
GitReadError,
|
|
2
3
|
cherry,
|
|
3
4
|
distance
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-42SO7KYX.js";
|
|
5
6
|
import {
|
|
6
7
|
reportModes,
|
|
7
8
|
restoreModes,
|
|
8
9
|
restoreSubmoduleModes,
|
|
9
10
|
withUmask
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-M6X6HVQK.js";
|
|
11
12
|
import {
|
|
12
13
|
git,
|
|
13
14
|
gitOk,
|
|
14
15
|
gitText,
|
|
16
|
+
gitWithInput,
|
|
15
17
|
runCommand
|
|
16
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-B3OZ4GGO.js";
|
|
17
19
|
|
|
18
20
|
// src/git/install.ts
|
|
19
21
|
import { createHash } from "crypto";
|
|
@@ -84,9 +86,77 @@ function installIfStale(root, spec, report) {
|
|
|
84
86
|
return 0;
|
|
85
87
|
}
|
|
86
88
|
|
|
89
|
+
// src/git/added-submodules.ts
|
|
90
|
+
import { existsSync as existsSync2, mkdirSync as mkdirSync2, readdirSync, renameSync } from "fs";
|
|
91
|
+
import { dirname as dirname2, join as join2 } from "path";
|
|
92
|
+
var ADDED_GITLINK = /^:\d{6} 160000 [0-9a-f]{40} ([0-9a-f]{40}) [AT]\t(.+)$/u;
|
|
93
|
+
function initAddedSubmodules(root, from, to) {
|
|
94
|
+
const raw = gitText(root, [
|
|
95
|
+
"diff",
|
|
96
|
+
"--raw",
|
|
97
|
+
"--abbrev=40",
|
|
98
|
+
"--no-renames",
|
|
99
|
+
from,
|
|
100
|
+
to
|
|
101
|
+
]);
|
|
102
|
+
const lines = [];
|
|
103
|
+
for (const entry of raw.split("\n")) {
|
|
104
|
+
const added = ADDED_GITLINK.exec(entry);
|
|
105
|
+
if (!added) continue;
|
|
106
|
+
const [, pin = "", path = ""] = added;
|
|
107
|
+
lines.push(`${path}: ${initOne(root, path, pin)}`);
|
|
108
|
+
}
|
|
109
|
+
return lines;
|
|
110
|
+
}
|
|
111
|
+
function initOne(root, path, pin) {
|
|
112
|
+
const dir = join2(root, path);
|
|
113
|
+
if (existsSync2(join2(dir, ".git"))) return "already checked out";
|
|
114
|
+
let displaced = "";
|
|
115
|
+
if (existsSync2(dir) && readdirSync(dir).length > 0) {
|
|
116
|
+
if (unignoredFiles(root, path).length > 0)
|
|
117
|
+
return `new submodule not checked out: ${path} holds files git does not ignore; move them aside, then git submodule update --init ${path}`;
|
|
118
|
+
displaced = displace(root, path);
|
|
119
|
+
}
|
|
120
|
+
const done = git(root, ["submodule", "update", "--init", "-q", "--", path]);
|
|
121
|
+
const aside = displaced ? `; its ignored files from before are in ${displaced}, so run the install again` : "";
|
|
122
|
+
if (done.status !== 0)
|
|
123
|
+
return `new submodule not checked out: ${done.stderr.trim()}${aside}`;
|
|
124
|
+
return `new submodule checked out at ${pin.slice(0, 10)}${aside}`;
|
|
125
|
+
}
|
|
126
|
+
function unignoredFiles(root, path) {
|
|
127
|
+
const kept = [];
|
|
128
|
+
let level = [path];
|
|
129
|
+
while (level.length > 0) {
|
|
130
|
+
const entries = level.flatMap(
|
|
131
|
+
(dir) => readdirSync(join2(root, dir), { withFileTypes: true }).map((entry) => ({
|
|
132
|
+
path: `${dir}/${entry.name}`,
|
|
133
|
+
dir: entry.isDirectory()
|
|
134
|
+
}))
|
|
135
|
+
);
|
|
136
|
+
const checked = gitWithInput(
|
|
137
|
+
root,
|
|
138
|
+
["check-ignore", "--no-index", "--stdin", "-z"],
|
|
139
|
+
entries.map((entry) => `${entry.path}\0`).join("")
|
|
140
|
+
);
|
|
141
|
+
const ignored = new Set(checked.stdout.split("\0").filter(Boolean));
|
|
142
|
+
const open = entries.filter((entry) => !ignored.has(entry.path));
|
|
143
|
+
kept.push(...open.filter((entry) => !entry.dir).map((entry) => entry.path));
|
|
144
|
+
level = open.filter((entry) => entry.dir).map((entry) => entry.path);
|
|
145
|
+
}
|
|
146
|
+
return kept;
|
|
147
|
+
}
|
|
148
|
+
function displace(root, path) {
|
|
149
|
+
const gitDir = gitText(root, ["rev-parse", "--absolute-git-dir"]);
|
|
150
|
+
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/gu, "-");
|
|
151
|
+
const target = join2(gitDir, "pmcp-displaced", stamp, path);
|
|
152
|
+
mkdirSync2(dirname2(target), { recursive: true });
|
|
153
|
+
renameSync(join2(root, path), target);
|
|
154
|
+
return target;
|
|
155
|
+
}
|
|
156
|
+
|
|
87
157
|
// src/git/submodules.ts
|
|
88
|
-
import { existsSync as
|
|
89
|
-
import { join as
|
|
158
|
+
import { existsSync as existsSync3 } from "fs";
|
|
159
|
+
import { join as join3 } from "path";
|
|
90
160
|
var GITLINK = /^:160000 160000 ([0-9a-f]{40}) ([0-9a-f]{40}) M\t(.+)$/u;
|
|
91
161
|
function clean(dir) {
|
|
92
162
|
return git(dir, ["status", "--porcelain"]).stdout.trim() === "";
|
|
@@ -103,7 +173,7 @@ function blocking(dir, head, pin) {
|
|
|
103
173
|
}
|
|
104
174
|
function followOne(dir, oldPin, newPin, shared) {
|
|
105
175
|
const short = newPin.slice(0, 10);
|
|
106
|
-
if (!
|
|
176
|
+
if (!existsSync3(join3(dir, ".git"))) return "not checked out, left alone";
|
|
107
177
|
const head = gitText(dir, ["rev-parse", "HEAD"]);
|
|
108
178
|
if (head === newPin) return `already at ${short}`;
|
|
109
179
|
if (head !== oldPin)
|
|
@@ -136,7 +206,7 @@ function followPins(root, from, to, shared = []) {
|
|
|
136
206
|
if (!match) continue;
|
|
137
207
|
const [, oldPin = "", newPin = "", path = ""] = match;
|
|
138
208
|
lines.push(
|
|
139
|
-
`${path}: ${followOne(
|
|
209
|
+
`${path}: ${followOne(join3(root, path), oldPin, newPin, shared.includes(path))}`
|
|
140
210
|
);
|
|
141
211
|
}
|
|
142
212
|
return lines;
|
|
@@ -144,8 +214,8 @@ function followPins(root, from, to, shared = []) {
|
|
|
144
214
|
function movableSubmodules(root) {
|
|
145
215
|
const listed = git(root, ["submodule", "status"]).stdout;
|
|
146
216
|
return listed.split("\n").filter((line) => /^[ +]/u.test(line)).map((line) => line.trim().split(/\s+/u)[1] ?? "").filter((path) => {
|
|
147
|
-
const dir =
|
|
148
|
-
if (!path || !
|
|
217
|
+
const dir = join3(root, path);
|
|
218
|
+
if (!path || !existsSync3(join3(dir, ".git"))) return false;
|
|
149
219
|
const local = gitText(dir, [
|
|
150
220
|
"rev-list",
|
|
151
221
|
"--count",
|
|
@@ -160,7 +230,7 @@ function updateToPins(root, paths) {
|
|
|
160
230
|
const lines = [];
|
|
161
231
|
for (const path of paths) {
|
|
162
232
|
const pin = gitText(root, ["rev-parse", `HEAD:${path}`]);
|
|
163
|
-
const dir =
|
|
233
|
+
const dir = join3(root, path);
|
|
164
234
|
if (!pin || !hasCommit(dir, pin)) {
|
|
165
235
|
lines.push(
|
|
166
236
|
`${path}: left alone, ${pin.slice(0, 10) || "its pin"} is not in its checkout`
|
|
@@ -178,15 +248,23 @@ function updateToPins(root, paths) {
|
|
|
178
248
|
|
|
179
249
|
// src/git/worktrees/sync.ts
|
|
180
250
|
function heldBy(root, upstream, ahead) {
|
|
181
|
-
const
|
|
251
|
+
const status = git(root, [
|
|
182
252
|
"status",
|
|
183
253
|
"--porcelain",
|
|
184
254
|
"--untracked-files=no",
|
|
185
255
|
"--ignore-submodules=all"
|
|
186
256
|
]);
|
|
187
|
-
if (
|
|
257
|
+
if (status.status !== 0)
|
|
258
|
+
return `git status failed (exit ${status.status}): ${status.stderr.trim()}`;
|
|
259
|
+
if (status.stdout.trim()) return "uncommitted changes";
|
|
188
260
|
if (ahead === 0) return null;
|
|
189
|
-
|
|
261
|
+
let own;
|
|
262
|
+
try {
|
|
263
|
+
own = cherry(root, upstream).missing.length;
|
|
264
|
+
} catch (error) {
|
|
265
|
+
if (error instanceof GitReadError) return error.message;
|
|
266
|
+
throw error;
|
|
267
|
+
}
|
|
190
268
|
if (own > 0) return `${own} unlanded commit(s)`;
|
|
191
269
|
return null;
|
|
192
270
|
}
|
|
@@ -234,6 +312,10 @@ function syncOnce(options) {
|
|
|
234
312
|
`moved ${before.slice(0, 10)} -> ${after.slice(0, 10)}, ${counted.behind} commit(s)`
|
|
235
313
|
);
|
|
236
314
|
for (const line of updateToPins(ctx.root, submodules)) report.info(line);
|
|
315
|
+
if (options.followSubmodules) {
|
|
316
|
+
for (const line of initAddedSubmodules(ctx.root, before, after))
|
|
317
|
+
report.info(line);
|
|
318
|
+
}
|
|
237
319
|
if (options.umask !== void 0)
|
|
238
320
|
reportModes(report, [
|
|
239
321
|
...restoreModes(ctx.root, before, after),
|
|
@@ -249,7 +331,8 @@ export {
|
|
|
249
331
|
lockHash,
|
|
250
332
|
installState,
|
|
251
333
|
installIfStale,
|
|
334
|
+
initAddedSubmodules,
|
|
252
335
|
followPins,
|
|
253
336
|
syncWorktree
|
|
254
337
|
};
|
|
255
|
-
//# sourceMappingURL=chunk-
|
|
338
|
+
//# sourceMappingURL=chunk-PCSE36BM.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-5ZABTVSW.js";
|
|
4
4
|
import {
|
|
5
5
|
dependencies
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CLE6VHO6.js";
|
|
7
7
|
import {
|
|
8
8
|
interactiveEntry
|
|
9
9
|
} from "./chunk-LMT3PPXJ.js";
|
|
10
10
|
import {
|
|
11
11
|
assertNativeHost
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-GSU22DYJ.js";
|
|
13
13
|
|
|
14
14
|
// src/tui/startup/host.ts
|
|
15
15
|
function terminalSupport() {
|
|
@@ -42,4 +42,4 @@ export {
|
|
|
42
42
|
terminalSupport,
|
|
43
43
|
requireTerminal
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-PX4FWUEN.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
POLICIES,
|
|
6
6
|
customMode,
|
|
7
7
|
customPolicy
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WV3YP35O.js";
|
|
9
9
|
import {
|
|
10
10
|
RUNTIMES
|
|
11
11
|
} from "./chunk-7DYWCQVB.js";
|
|
@@ -42,4 +42,4 @@ function policyRows(compiled) {
|
|
|
42
42
|
export {
|
|
43
43
|
policyRows
|
|
44
44
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-RZNZKI5A.js.map
|
|
@@ -1190,7 +1190,7 @@ function registerReadTool(server, tools) {
|
|
|
1190
1190
|
|
|
1191
1191
|
// src/mcp.ts
|
|
1192
1192
|
var SERVER_NAME = "pmcp";
|
|
1193
|
-
var SERVER_VERSION = "0.22.
|
|
1193
|
+
var SERVER_VERSION = "0.22.6";
|
|
1194
1194
|
var MAX_TOOL_INPUT_ELEMENTS = 1e4;
|
|
1195
1195
|
function registerSkillTools(server, tools) {
|
|
1196
1196
|
registerCatalogTool(server, tools);
|
|
@@ -1247,4 +1247,4 @@ export {
|
|
|
1247
1247
|
registerSkillTools,
|
|
1248
1248
|
createSkillServer
|
|
1249
1249
|
};
|
|
1250
|
-
//# sourceMappingURL=chunk-
|
|
1250
|
+
//# sourceMappingURL=chunk-SLL5FSDI.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
git,
|
|
3
3
|
gitText
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-B3OZ4GGO.js";
|
|
5
5
|
|
|
6
6
|
// src/git/detect.ts
|
|
7
7
|
import { createHash } from "crypto";
|
|
@@ -81,4 +81,4 @@ export {
|
|
|
81
81
|
detect,
|
|
82
82
|
listWorktrees
|
|
83
83
|
};
|
|
84
|
-
//# sourceMappingURL=chunk-
|
|
84
|
+
//# sourceMappingURL=chunk-SUDG7B6S.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSkillServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SLL5FSDI.js";
|
|
4
4
|
import {
|
|
5
5
|
attachMailbox
|
|
6
6
|
} from "./chunk-JZKAJUVT.js";
|
|
@@ -84,4 +84,4 @@ export {
|
|
|
84
84
|
serveWithMailbox,
|
|
85
85
|
main
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
87
|
+
//# sourceMappingURL=chunk-TBVQ7SM7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertNativeHost
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GSU22DYJ.js";
|
|
4
4
|
import {
|
|
5
5
|
locateExecutable
|
|
6
6
|
} from "./chunk-R2GPCZUX.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
resourceClaim,
|
|
34
34
|
resourceRunning,
|
|
35
35
|
runtimeUnit
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JN7TRPFB.js";
|
|
37
37
|
import {
|
|
38
38
|
command
|
|
39
39
|
} from "./chunk-34DECPVC.js";
|
|
@@ -1981,4 +1981,4 @@ export {
|
|
|
1981
1981
|
isReadOnly,
|
|
1982
1982
|
runOperation
|
|
1983
1983
|
};
|
|
1984
|
-
//# sourceMappingURL=chunk-
|
|
1984
|
+
//# sourceMappingURL=chunk-TPTKRLI7.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-UKR64U7J.js";
|
|
4
4
|
import {
|
|
5
5
|
syncWorktree
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PCSE36BM.js";
|
|
7
7
|
import {
|
|
8
8
|
localCli,
|
|
9
9
|
pmcpCommand,
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
} from "./chunk-73AKO4UL.js";
|
|
25
25
|
import {
|
|
26
26
|
withUmask
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-M6X6HVQK.js";
|
|
28
28
|
import {
|
|
29
29
|
leaseSpecs,
|
|
30
30
|
readGitConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7CSUKCU7.js";
|
|
32
32
|
import {
|
|
33
33
|
detect
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-SUDG7B6S.js";
|
|
35
35
|
import {
|
|
36
36
|
inboxKey,
|
|
37
37
|
noticeOf,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
} from "./chunk-Z6WRFOFT.js";
|
|
44
44
|
import {
|
|
45
45
|
gitText
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-B3OZ4GGO.js";
|
|
47
47
|
import {
|
|
48
48
|
safeEndpoint
|
|
49
49
|
} from "./chunk-Q5H3L6Y4.js";
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
readHost,
|
|
69
69
|
readLock,
|
|
70
70
|
readLockFile
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-KTANZVAJ.js";
|
|
72
72
|
import {
|
|
73
73
|
ProjectError,
|
|
74
74
|
RULES_DIR,
|
|
@@ -167,7 +167,7 @@ function shellWord(text) {
|
|
|
167
167
|
return pieces.join("");
|
|
168
168
|
}
|
|
169
169
|
function forwardedVariables(server) {
|
|
170
|
-
const
|
|
170
|
+
const names3 = new Set(server.envVars ?? []);
|
|
171
171
|
const words = [
|
|
172
172
|
server.command ?? "",
|
|
173
173
|
...server.args,
|
|
@@ -177,11 +177,11 @@ function forwardedVariables(server) {
|
|
|
177
177
|
for (const word of words) {
|
|
178
178
|
for (const match of word.matchAll(VARIABLE)) {
|
|
179
179
|
if (match[1] !== "PROJECT_ROOT") {
|
|
180
|
-
|
|
180
|
+
names3.add(match[1]);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
return [...
|
|
184
|
+
return [...names3].sort();
|
|
185
185
|
}
|
|
186
186
|
function launch(spec) {
|
|
187
187
|
if (spec.command === void 0) {
|
|
@@ -969,9 +969,9 @@ function hookOutputs(spec) {
|
|
|
969
969
|
}
|
|
970
970
|
|
|
971
971
|
// src/project/adapters/opencode-skills.ts
|
|
972
|
-
function opencodeSkillOutputs(spec,
|
|
972
|
+
function opencodeSkillOutputs(spec, names3) {
|
|
973
973
|
if (!spec.tools.has("opencode")) return [];
|
|
974
|
-
return
|
|
974
|
+
return names3.filter((name) => spec.skills[name]?.invocation === "user").map(
|
|
975
975
|
(name) => jsonOutput(OPENCODE_CONFIG, ["permission", "skill", name], "deny")
|
|
976
976
|
);
|
|
977
977
|
}
|
|
@@ -1478,9 +1478,9 @@ function agentNames(root) {
|
|
|
1478
1478
|
);
|
|
1479
1479
|
}
|
|
1480
1480
|
function skillOutputs(spec) {
|
|
1481
|
-
const
|
|
1482
|
-
const outputs = opencodeSkillOutputs(spec,
|
|
1483
|
-
for (const name of
|
|
1481
|
+
const names3 = skillNames(spec.root);
|
|
1482
|
+
const outputs = opencodeSkillOutputs(spec, names3);
|
|
1483
|
+
for (const name of names3) {
|
|
1484
1484
|
const target = `../../.agents/skills/${name}`;
|
|
1485
1485
|
if (spec.tools.has("claude")) {
|
|
1486
1486
|
outputs.push({ kind: "link", path: `.claude/skills/${name}`, target });
|
|
@@ -1694,11 +1694,11 @@ function checkBudget(spec, settings) {
|
|
|
1694
1694
|
}
|
|
1695
1695
|
const tracked = settings.packageBytes !== void 0 || settings.forbidPaths.length > 0 ? trackedFiles(spec.root) : [];
|
|
1696
1696
|
if (settings.packageBytes !== void 0) {
|
|
1697
|
-
const
|
|
1697
|
+
const names3 = new Set(
|
|
1698
1698
|
["AGENTS.md", spec.packageRules?.file].filter(Boolean)
|
|
1699
1699
|
);
|
|
1700
1700
|
for (const file of tracked) {
|
|
1701
|
-
if (!file.includes("/") || !
|
|
1701
|
+
if (!file.includes("/") || !names3.has(basename(file))) continue;
|
|
1702
1702
|
const path = join7(spec.root, file);
|
|
1703
1703
|
if (regularFile(path))
|
|
1704
1704
|
row("package_bytes", file, measure(path).bytes, settings.packageBytes);
|
|
@@ -2482,10 +2482,10 @@ function bypasses(step, options2) {
|
|
|
2482
2482
|
return options2.noVerify && name === "git" && step.argv.includes("--no-verify");
|
|
2483
2483
|
}
|
|
2484
2484
|
function fallback(command, options2) {
|
|
2485
|
-
const
|
|
2486
|
-
if (options2.noVerify)
|
|
2487
|
-
if (
|
|
2488
|
-
return new RegExp(`(?:^|[^\\w-])(?:${
|
|
2485
|
+
const names3 = options2.variables.map(escape);
|
|
2486
|
+
if (options2.noVerify) names3.push("--no-verify");
|
|
2487
|
+
if (names3.length === 0) return false;
|
|
2488
|
+
return new RegExp(`(?:^|[^\\w-])(?:${names3.join("|")})\\b`, "u").test(
|
|
2489
2489
|
command
|
|
2490
2490
|
);
|
|
2491
2491
|
}
|
|
@@ -4000,8 +4000,8 @@ function claimants(store, session, root) {
|
|
|
4000
4000
|
(record) => record.live && record.session !== session && record.worktree === root
|
|
4001
4001
|
).map((record) => record.alias || record.session.slice(0, 8));
|
|
4002
4002
|
}
|
|
4003
|
-
function claimantNotice(root,
|
|
4004
|
-
return `Another live session works in ${root}: ${
|
|
4003
|
+
function claimantNotice(root, names3) {
|
|
4004
|
+
return `Another live session works in ${root}: ${names3.join(", ")}. Edit only files that are yours, and name every path when you commit.`;
|
|
4005
4005
|
}
|
|
4006
4006
|
|
|
4007
4007
|
// src/hooks/policies/workspace/leftovers.ts
|
|
@@ -4150,12 +4150,84 @@ var sharedCheckout = {
|
|
|
4150
4150
|
};
|
|
4151
4151
|
|
|
4152
4152
|
// src/hooks/policies/workspace/mainline-deliver.ts
|
|
4153
|
+
import { spawnSync as spawnSync5 } from "child_process";
|
|
4153
4154
|
import { resolve as resolve6 } from "path";
|
|
4154
4155
|
var PUSH = /\bgit\b[^|;&\n]*\spush\b/u;
|
|
4155
|
-
var REASON7 = "This repository's mainline moves only through pmcp git deliver, which replays, gates and pushes one delivery at a time. Commit, then run pmcp git deliver; other repositories push
|
|
4156
|
+
var REASON7 = "This repository's mainline moves only through pmcp git deliver, which replays, gates and pushes one delivery at a time. Commit, then run pmcp git deliver; other branches, other remotes and other repositories push as usual.";
|
|
4157
|
+
var VALUE_OPTIONS = /* @__PURE__ */ new Set([
|
|
4158
|
+
"--repo",
|
|
4159
|
+
"--receive-pack",
|
|
4160
|
+
"--exec",
|
|
4161
|
+
"-o",
|
|
4162
|
+
"--push-option"
|
|
4163
|
+
]);
|
|
4164
|
+
var EVERY_BRANCH = /* @__PURE__ */ new Set(["--all", "--branches", "--mirror"]);
|
|
4156
4165
|
function sameRepository(dir, commonDir) {
|
|
4157
4166
|
return checkoutOf(dir)?.commonDir === commonDir;
|
|
4158
4167
|
}
|
|
4168
|
+
function gitText2(dir, args) {
|
|
4169
|
+
const run3 = spawnSync5("git", ["-C", dir, ...args], {
|
|
4170
|
+
encoding: "utf8",
|
|
4171
|
+
timeout: 5e3
|
|
4172
|
+
});
|
|
4173
|
+
return run3.status === 0 ? run3.stdout.trim() : "";
|
|
4174
|
+
}
|
|
4175
|
+
function names2(ref, branch) {
|
|
4176
|
+
if (ref.includes("*")) return true;
|
|
4177
|
+
return [branch, `heads/${branch}`, `refs/heads/${branch}`].includes(ref);
|
|
4178
|
+
}
|
|
4179
|
+
function movesMainline(dir, args, options2) {
|
|
4180
|
+
const positional = [];
|
|
4181
|
+
let repo = "";
|
|
4182
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
4183
|
+
const word = args[index];
|
|
4184
|
+
if (word === "--") {
|
|
4185
|
+
positional.push(...args.slice(index + 1));
|
|
4186
|
+
break;
|
|
4187
|
+
}
|
|
4188
|
+
if (!word.startsWith("-") || word === "-") {
|
|
4189
|
+
positional.push(word);
|
|
4190
|
+
continue;
|
|
4191
|
+
}
|
|
4192
|
+
const option = word.split("=")[0];
|
|
4193
|
+
if (option === "-n" || option === "--dry-run") return false;
|
|
4194
|
+
if (/^-[a-zA-Z]+$/u.test(word) && word.includes("n")) return false;
|
|
4195
|
+
if (EVERY_BRANCH.has(option)) return true;
|
|
4196
|
+
if (VALUE_OPTIONS.has(option) && !word.includes("=")) {
|
|
4197
|
+
if (option === "--repo") repo = args[index + 1] ?? "";
|
|
4198
|
+
index += 1;
|
|
4199
|
+
continue;
|
|
4200
|
+
}
|
|
4201
|
+
if (option === "--repo") repo = word.slice("--repo=".length);
|
|
4202
|
+
}
|
|
4203
|
+
const ctx = detect(dir, {
|
|
4204
|
+
...options2.remote ? { remote: options2.remote } : {},
|
|
4205
|
+
...options2.branch ? { mainline: options2.branch } : {}
|
|
4206
|
+
});
|
|
4207
|
+
const remote = options2.remote ?? ctx?.remote ?? "origin";
|
|
4208
|
+
const branch = options2.branch ?? ctx?.mainline ?? "main";
|
|
4209
|
+
const target = positional[0] ?? repo;
|
|
4210
|
+
if (target && target !== remote && /^[\w.-]+$/u.test(target)) return false;
|
|
4211
|
+
const current = gitText2(dir, ["symbolic-ref", "--short", "-q", "HEAD"]);
|
|
4212
|
+
const refspecs = positional.slice(1);
|
|
4213
|
+
if (refspecs.length === 0) {
|
|
4214
|
+
if (!current) return false;
|
|
4215
|
+
const upstream = gitText2(dir, [
|
|
4216
|
+
"rev-parse",
|
|
4217
|
+
"--abbrev-ref",
|
|
4218
|
+
"--symbolic-full-name",
|
|
4219
|
+
"@{upstream}"
|
|
4220
|
+
]);
|
|
4221
|
+
return current === branch || upstream === `${remote}/${branch}`;
|
|
4222
|
+
}
|
|
4223
|
+
return refspecs.some((spec) => {
|
|
4224
|
+
const plain = spec.replace(/^\+/u, "");
|
|
4225
|
+
const colon = plain.indexOf(":");
|
|
4226
|
+
let dst = colon < 0 ? plain : plain.slice(colon + 1) || plain.slice(0, colon);
|
|
4227
|
+
if (dst === "HEAD" || dst === "@") dst = current;
|
|
4228
|
+
return dst !== "" && names2(dst, branch);
|
|
4229
|
+
});
|
|
4230
|
+
}
|
|
4159
4231
|
var mainlineDeliver = {
|
|
4160
4232
|
id: "git.mainline.deliver",
|
|
4161
4233
|
events: ["before_tool"],
|
|
@@ -4163,10 +4235,17 @@ var mainlineDeliver = {
|
|
|
4163
4235
|
fail: "closed",
|
|
4164
4236
|
defaultMode: "deny",
|
|
4165
4237
|
options(raw) {
|
|
4166
|
-
onlyKeys(raw, []);
|
|
4167
|
-
|
|
4238
|
+
onlyKeys(raw, ["remote", "branch"]);
|
|
4239
|
+
const text = (key) => {
|
|
4240
|
+
const value = raw[key];
|
|
4241
|
+
if (value === void 0) return {};
|
|
4242
|
+
if (typeof value !== "string" || value === "")
|
|
4243
|
+
throw new Error(`${key} must be a name`);
|
|
4244
|
+
return { [key]: value };
|
|
4245
|
+
};
|
|
4246
|
+
return { ...text("remote"), ...text("branch") };
|
|
4168
4247
|
},
|
|
4169
|
-
evaluate(input) {
|
|
4248
|
+
evaluate(input, ctx) {
|
|
4170
4249
|
const call = shellCall(input);
|
|
4171
4250
|
const project = checkoutOf(input.projectRoot);
|
|
4172
4251
|
if (!call || !project) return pass;
|
|
@@ -4179,7 +4258,8 @@ var mainlineDeliver = {
|
|
|
4179
4258
|
const git = gitCall(step.argv);
|
|
4180
4259
|
if (git.sub !== "push") continue;
|
|
4181
4260
|
const dir = resolve6(input.cwd, step.dir, git.dir);
|
|
4182
|
-
if (sameRepository(dir, project.commonDir))
|
|
4261
|
+
if (!sameRepository(dir, project.commonDir)) continue;
|
|
4262
|
+
if (movesMainline(dir, step.argv.slice(git.at + 1), ctx.options))
|
|
4183
4263
|
return { verdict: "deny", reason: REASON7 };
|
|
4184
4264
|
}
|
|
4185
4265
|
return pass;
|
|
@@ -4296,7 +4376,7 @@ var worktreeSync = {
|
|
|
4296
4376
|
};
|
|
4297
4377
|
|
|
4298
4378
|
// src/hooks/policies/custom.ts
|
|
4299
|
-
import { spawnSync as
|
|
4379
|
+
import { spawnSync as spawnSync6 } from "child_process";
|
|
4300
4380
|
import { createHash as createHash5 } from "crypto";
|
|
4301
4381
|
import { existsSync as existsSync9, readFileSync as readFileSync9, realpathSync as realpathSync3 } from "fs";
|
|
4302
4382
|
import { isAbsolute as isAbsolute7, relative as relative8, resolve as resolve8 } from "path";
|
|
@@ -4348,7 +4428,7 @@ function guardHash(root, command) {
|
|
|
4348
4428
|
return createHash5("sha256").update(readFileSync9(guardScript(root, command))).digest("hex");
|
|
4349
4429
|
}
|
|
4350
4430
|
function programVersion(program2, root, env = process.env) {
|
|
4351
|
-
const run3 =
|
|
4431
|
+
const run3 = spawnSync6(program2, ["--version"], {
|
|
4352
4432
|
cwd: root,
|
|
4353
4433
|
env: { PATH: env["PATH"], LANG: "C.UTF-8" },
|
|
4354
4434
|
encoding: "utf8",
|
|
@@ -4418,7 +4498,7 @@ function run2(entry, input, log) {
|
|
|
4418
4498
|
const args = entry.command.map(
|
|
4419
4499
|
(part) => part.startsWith(".agents/guards/") ? resolve8(root, part) : part
|
|
4420
4500
|
);
|
|
4421
|
-
const result =
|
|
4501
|
+
const result = spawnSync6(args[0], args.slice(1), {
|
|
4422
4502
|
cwd: root,
|
|
4423
4503
|
env: { PATH: process.env["PATH"], LANG: "C.UTF-8" },
|
|
4424
4504
|
input: request(entry, input),
|
|
@@ -4700,7 +4780,7 @@ function readCustom(root, hooks, guards) {
|
|
|
4700
4780
|
[hooks["edit"], "after_edit"],
|
|
4701
4781
|
[guards["custom"], void 0]
|
|
4702
4782
|
];
|
|
4703
|
-
const
|
|
4783
|
+
const names3 = /* @__PURE__ */ new Set();
|
|
4704
4784
|
const found = [];
|
|
4705
4785
|
for (const [list2, implied] of sources) {
|
|
4706
4786
|
if (list2 === void 0) continue;
|
|
@@ -4708,9 +4788,9 @@ function readCustom(root, hooks, guards) {
|
|
|
4708
4788
|
throw new Error("custom guards must be arrays of tables");
|
|
4709
4789
|
for (const value of list2) {
|
|
4710
4790
|
const entry = readEntry(root, value, implied);
|
|
4711
|
-
if (
|
|
4791
|
+
if (names3.has(entry.name))
|
|
4712
4792
|
throw new Error("shell names must be unique lowercase names");
|
|
4713
|
-
|
|
4793
|
+
names3.add(entry.name);
|
|
4714
4794
|
if (entry.mode !== "off") found.push(entry);
|
|
4715
4795
|
}
|
|
4716
4796
|
}
|
|
@@ -5084,9 +5164,16 @@ function readMainlineDeliver(tables, root) {
|
|
|
5084
5164
|
dir: root,
|
|
5085
5165
|
raw: { git: tables.git, sessions: tables.sessions }
|
|
5086
5166
|
};
|
|
5087
|
-
const
|
|
5088
|
-
if (!deliver?.refuseDirectPush) return null;
|
|
5089
|
-
return {
|
|
5167
|
+
const git = readGitConfig(config);
|
|
5168
|
+
if (!git?.deliver?.refuseDirectPush) return null;
|
|
5169
|
+
return {
|
|
5170
|
+
id: "git.mainline.deliver",
|
|
5171
|
+
mode: "deny",
|
|
5172
|
+
options: {
|
|
5173
|
+
...git.remote ? { remote: git.remote } : {},
|
|
5174
|
+
...git.mainline ? { branch: git.mainline } : {}
|
|
5175
|
+
}
|
|
5176
|
+
};
|
|
5090
5177
|
}
|
|
5091
5178
|
|
|
5092
5179
|
// src/hooks/compile.ts
|
|
@@ -5426,4 +5513,4 @@ export {
|
|
|
5426
5513
|
checkBudget,
|
|
5427
5514
|
readSpec
|
|
5428
5515
|
};
|
|
5429
|
-
//# sourceMappingURL=chunk-
|
|
5516
|
+
//# sourceMappingURL=chunk-WV3YP35O.js.map
|
|
@@ -11,16 +11,16 @@ import {
|
|
|
11
11
|
async function action(positional) {
|
|
12
12
|
const [verb, sub] = positional;
|
|
13
13
|
if (verb === "deliver")
|
|
14
|
-
return (await import("./mainline-
|
|
15
|
-
if (verb === "sync") return (await import("./mainline-
|
|
14
|
+
return (await import("./mainline-CRL5B3X3.js")).mainlineDeliver;
|
|
15
|
+
if (verb === "sync") return (await import("./mainline-CRL5B3X3.js")).mainlineSync;
|
|
16
16
|
if (verb !== "worktree")
|
|
17
17
|
throw new ArgumentError("Use worktree, deliver or sync");
|
|
18
18
|
if (sub === "create")
|
|
19
|
-
return (await import("./worktree-create-
|
|
19
|
+
return (await import("./worktree-create-KMXPQXIQ.js")).worktreeCreate;
|
|
20
20
|
if (sub === "list")
|
|
21
|
-
return (await import("./worktree-list-
|
|
21
|
+
return (await import("./worktree-list-WH6OX6U7.js")).worktreeList;
|
|
22
22
|
if (sub === "sync")
|
|
23
|
-
return (await import("./worktree-sync-
|
|
23
|
+
return (await import("./worktree-sync-VWNOJD63.js")).worktreeSync;
|
|
24
24
|
throw new ArgumentError("Use worktree create, list or sync");
|
|
25
25
|
}
|
|
26
26
|
async function run(context) {
|
|
@@ -28,7 +28,7 @@ async function run(context) {
|
|
|
28
28
|
if (context.args.flags.has("json") && !(verb === "worktree" && sub === "list") && verb !== "deliver")
|
|
29
29
|
throw new ArgumentError("--json requires git worktree list or git deliver");
|
|
30
30
|
const act = await action(context.args.positional);
|
|
31
|
-
const { loadGit } = await import("./setup-
|
|
31
|
+
const { loadGit } = await import("./setup-SOUBEZ3H.js");
|
|
32
32
|
const setup = loadGit(context.cwd, one(context.args, "config"), context.env);
|
|
33
33
|
if (setup instanceof Error) {
|
|
34
34
|
context.ui.error(setup.message);
|
|
@@ -38,11 +38,11 @@ async function run(context) {
|
|
|
38
38
|
info: (line) => context.ui.info(line),
|
|
39
39
|
warn: (line) => context.ui.warn(line)
|
|
40
40
|
};
|
|
41
|
-
const { withUmask } = await import("./modes-
|
|
41
|
+
const { withUmask } = await import("./modes-SEINLLMK.js");
|
|
42
42
|
return withUmask(setup.config.umask, () => act(setup, context, report));
|
|
43
43
|
}
|
|
44
44
|
var gitCommand = { ...gitSpec, run };
|
|
45
45
|
export {
|
|
46
46
|
gitCommand
|
|
47
47
|
};
|
|
48
|
-
//# sourceMappingURL=cli-
|
|
48
|
+
//# sourceMappingURL=cli-DYVNJYZ7.js.map
|