@modootoday/pmcp 0.24.1 → 0.25.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/.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-CDJQJAZH.js → apply-6XLLYLJT.js} +9 -8
- package/dist/{broadcast-VKZY7WSD.js → broadcast-34CEG2NQ.js} +5 -2
- package/dist/{chunk-264DIB5U.js → chunk-2TXVOHRS.js} +3 -3
- package/dist/{chunk-X3RUXLAV.js → chunk-3P6Y2BAO.js} +3 -3
- package/dist/{chunk-7CGGDX7X.js → chunk-5MUD7FHP.js} +2 -2
- package/dist/{chunk-2GZKA33O.js → chunk-A4P3IIPE.js} +2 -2
- package/dist/{chunk-GEDRPMBH.js → chunk-BG6TONJO.js} +2 -2
- package/dist/{chunk-HES44LTA.js → chunk-C3KRMTIZ.js} +28 -4
- package/dist/{chunk-QY2P54Z2.js → chunk-DITIXBFB.js} +61 -8
- package/dist/{chunk-LNKAR3IS.js → chunk-DWHM5BAY.js} +2 -2
- package/dist/{chunk-VBWB2T3C.js → chunk-EC5QLEZD.js} +2 -2
- package/dist/{chunk-MZ52S4YJ.js → chunk-ISWR2XIU.js} +2 -2
- package/dist/{chunk-D4FIBB2G.js → chunk-LZVHFPN6.js} +5 -5
- package/dist/{chunk-3SEJNT6F.js → chunk-MBHI2TKQ.js} +4 -4
- package/dist/{chunk-43MXRTKH.js → chunk-NAHAESFV.js} +9 -4
- package/dist/chunk-NQCAKDRY.js +156 -0
- package/dist/chunk-OIKT4SYO.js +42 -0
- package/dist/{chunk-3O3JZTUU.js → chunk-PECS47OL.js} +3 -3
- package/dist/{chunk-AQM2JZMB.js → chunk-PGZZI42O.js} +2 -2
- package/dist/{chunk-5NQZGNKT.js → chunk-QYHM6554.js} +2 -2
- package/dist/{chunk-DLIO2D7S.js → chunk-RF6RDJYH.js} +16 -16
- package/dist/chunk-SMBU3QLE.js +7 -0
- package/dist/{chunk-V5PXMLLL.js → chunk-SRSKCFFS.js} +3 -3
- package/dist/{chunk-DGXZBQCA.js → chunk-SSQ6EWNA.js} +5 -5
- package/dist/{chunk-MOKZPZZO.js → chunk-TJW4DP26.js} +2 -2
- package/dist/{chunk-2ZH77O2D.js → chunk-TOR6SKRB.js} +141 -58
- package/dist/{chunk-PG62GOPU.js → chunk-UQHJUTDW.js} +2 -2
- package/dist/{cli-GFDT4YXM.js → cli-5G2OYTIL.js} +9 -9
- package/dist/{cli-OV5LSSGE.js → cli-QDQYUHAP.js} +4 -4
- package/dist/cli.js +38 -5
- package/dist/{completion-QNDCU4MF.js → completion-3GVNPLZY.js} +4 -4
- package/dist/{diagnostics-TPK3VC5F.js → diagnostics-2W7QDQNG.js} +6 -6
- package/dist/{doctor-K2LADSW2.js → doctor-3TDO5LJ5.js} +11 -10
- package/dist/{entry-HFQHKL5L.js → entry-E62DZQJF.js} +10 -10
- package/dist/{exec-mcp-I2YGGWY4.js → exec-mcp-4N7FLY52.js} +7 -6
- package/dist/{harness-BMWGAXCF.js → harness-E2AUZDLV.js} +3 -3
- package/dist/harness-launch-gate.js +4 -4
- package/dist/harness-worker.js +6 -6
- package/dist/{heavy-G6CYQQ7O.js → heavy-HZQVFI6P.js} +150 -36
- package/dist/hook-body.js +116 -45
- package/dist/{hooks-R7AYQXHY.js → hooks-VAEAK2FY.js} +4 -4
- package/dist/{host-PLE2T55E.js → host-4GJDGTLW.js} +7 -7
- package/dist/{host-EUD6GLWV.js → host-I2EMQ7UE.js} +12 -59
- package/dist/{host-run-QFNGIDL5.js → host-run-DDMKD3BU.js} +5 -5
- package/dist/http.js +1 -1
- package/dist/{import-mcp-DVKJOEOE.js → import-mcp-TNSAMJXI.js} +6 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -9
- package/dist/{init-DKWNL62M.js → init-UA7MDNTZ.js} +2 -2
- package/dist/{invoke-U6JTPTXT.js → invoke-HW7NBPGP.js} +8 -8
- package/dist/{list-YKQFJN3G.js → list-A7VQJXE5.js} +8 -7
- package/dist/{logout-5YSKC46N.js → logout-HNPLUKJY.js} +7 -6
- package/dist/{mailbox-5FVFMQ2J.js → mailbox-MR6TPD3P.js} +20 -6
- package/dist/{mainline-D3PSR6AJ.js → mainline-MSLW3UFD.js} +8 -2
- package/dist/{mcp-CHKKXHBB.js → mcp-6C23GX2E.js} +2 -2
- package/dist/{pause-CMZOIHTJ.js → pause-H6ZYZF7C.js} +5 -2
- package/dist/{project-QEYXISHC.js → project-BX6NCGKB.js} +4 -4
- package/dist/{report-UB7MXAUB.js → report-43SFNNCF.js} +2 -2
- package/dist/{resume-PAKIT4TT.js → resume-2BWGSTCN.js} +5 -2
- package/dist/{run-HKMYYEZJ.js → run-2UVAWBAF.js} +6 -5
- package/dist/{run-FYKDIW4C.js → run-7TRWZFEZ.js} +4 -4
- package/dist/{serve-QZNG5UUV.js → serve-4XZ5SKJJ.js} +3 -3
- package/dist/{start-login-4GPM32RA.js → start-login-AR7ITWNV.js} +7 -6
- package/dist/{status-4PYPTYUB.js → status-2GDYLIR3.js} +6 -3
- package/dist/{status-55CD352M.js → status-VQCMJFVE.js} +25 -22
- package/dist/{status-W6SCF2GF.js → status-ZY6LDQSF.js} +7 -6
- package/dist/stdio.js +2 -2
- package/dist/{sweep-VURZU6DI.js → sweep-76BUOGEI.js} +5 -2
- package/dist/{test-XYEMYZ2P.js → test-VWGNFSH5.js} +9 -7
- package/dist/{tui-FXSWN2PV.js → tui-TUMOQBE7.js} +4 -4
- package/dist/{unbroadcast-7AMLURCG.js → unbroadcast-HJHYUHZL.js} +5 -2
- package/dist/{worker-Q4I4EIAJ.js → worker-NEEPJRVV.js} +8 -8
- package/dist/{worktree-list-2HV6ODBS.js → worktree-list-WZC75NLF.js} +8 -9
- package/docs/commands.md +8 -6
- package/docs/glossary.md +1 -1
- package/docs/hooks.md +20 -16
- package/docs/project-configuration.md +73 -36
- package/docs/sessions.md +9 -2
- package/docs/upgrading.md +58 -0
- 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-65H4PN33.js +0 -7
package/dist/hook-body.js
CHANGED
|
@@ -256,24 +256,24 @@ function gitCommonDir(root) {
|
|
|
256
256
|
return checkoutOf(root)?.commonDir ?? null;
|
|
257
257
|
}
|
|
258
258
|
function worktreesOf(checkout) {
|
|
259
|
-
const
|
|
259
|
+
const found2 = [
|
|
260
260
|
{ path: dirname(checkout.commonDir), branch: branchOf(checkout.commonDir) }
|
|
261
261
|
];
|
|
262
262
|
let names4 = [];
|
|
263
263
|
try {
|
|
264
264
|
names4 = readdirSync(join2(checkout.commonDir, "worktrees"));
|
|
265
265
|
} catch {
|
|
266
|
-
return
|
|
266
|
+
return found2;
|
|
267
267
|
}
|
|
268
268
|
for (const name of names4) {
|
|
269
269
|
const admin = join2(checkout.commonDir, "worktrees", name);
|
|
270
270
|
try {
|
|
271
271
|
const dotGit = readFileSync(join2(admin, "gitdir"), "utf8").trim();
|
|
272
|
-
|
|
272
|
+
found2.push({ path: dirname(dotGit), branch: branchOf(admin) });
|
|
273
273
|
} catch {
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
return
|
|
276
|
+
return found2;
|
|
277
277
|
}
|
|
278
278
|
function hasLinkedWorktrees(checkout) {
|
|
279
279
|
try {
|
|
@@ -575,7 +575,7 @@ var Scanner = class _Scanner {
|
|
|
575
575
|
// Index just past the )) closing the (( at open, or -1 when a lone ) closes it first.
|
|
576
576
|
arithmeticEnd(open2, nested) {
|
|
577
577
|
const { text: text9 } = this;
|
|
578
|
-
const
|
|
578
|
+
const found2 = [];
|
|
579
579
|
let depth = 0;
|
|
580
580
|
let index = open2 + 2;
|
|
581
581
|
while (index < text9.length) {
|
|
@@ -586,7 +586,7 @@ var Scanner = class _Scanner {
|
|
|
586
586
|
}
|
|
587
587
|
if (text9.startsWith("$(", index) && !text9.startsWith("$((", index)) {
|
|
588
588
|
const inner = this.nested.at(text9, index + 2);
|
|
589
|
-
|
|
589
|
+
found2.push(inner.list);
|
|
590
590
|
index = inner.end;
|
|
591
591
|
continue;
|
|
592
592
|
}
|
|
@@ -594,7 +594,7 @@ var Scanner = class _Scanner {
|
|
|
594
594
|
if (char === ")") {
|
|
595
595
|
if (depth === 0) {
|
|
596
596
|
if (text9[index + 1] !== ")") return -1;
|
|
597
|
-
nested.push(...
|
|
597
|
+
nested.push(...found2);
|
|
598
598
|
return index + 2;
|
|
599
599
|
}
|
|
600
600
|
depth -= 1;
|
|
@@ -830,9 +830,9 @@ var Parser = class {
|
|
|
830
830
|
return token;
|
|
831
831
|
}
|
|
832
832
|
fail(token, expected) {
|
|
833
|
-
const
|
|
833
|
+
const found2 = describe(token);
|
|
834
834
|
throw new ShellSyntaxError(
|
|
835
|
-
expected ? `expected ${expected}, found ${
|
|
835
|
+
expected ? `expected ${expected}, found ${found2}` : `unexpected ${found2}`,
|
|
836
836
|
token.start
|
|
837
837
|
);
|
|
838
838
|
}
|
|
@@ -1098,7 +1098,7 @@ var Parser = class {
|
|
|
1098
1098
|
return redirect;
|
|
1099
1099
|
}
|
|
1100
1100
|
simple() {
|
|
1101
|
-
const
|
|
1101
|
+
const assigns2 = [];
|
|
1102
1102
|
const words = [];
|
|
1103
1103
|
const redirects = [];
|
|
1104
1104
|
let first = "";
|
|
@@ -1107,29 +1107,29 @@ var Parser = class {
|
|
|
1107
1107
|
const token = this.peek();
|
|
1108
1108
|
if (token.kind === "redirect") {
|
|
1109
1109
|
redirects.push(this.redirect());
|
|
1110
|
-
if (
|
|
1110
|
+
if (assigns2.length > 0) redirectedAfterAssign = true;
|
|
1111
1111
|
continue;
|
|
1112
1112
|
}
|
|
1113
1113
|
if (token.kind !== "word") break;
|
|
1114
1114
|
this.next();
|
|
1115
1115
|
if (words.length === 0 && ASSIGNMENT.test(token.raw)) {
|
|
1116
1116
|
if (redirectedAfterAssign && ARRAY.test(token.raw)) this.fail(token);
|
|
1117
|
-
|
|
1117
|
+
assigns2.push(token.word);
|
|
1118
1118
|
continue;
|
|
1119
1119
|
}
|
|
1120
1120
|
if (ARRAY.test(token.raw) && !DECLARES.has(first)) this.fail(token);
|
|
1121
1121
|
if (words.length === 0) first = token.raw;
|
|
1122
1122
|
words.push(token.word);
|
|
1123
1123
|
const after = this.peek();
|
|
1124
|
-
if (words.length === 1 &&
|
|
1124
|
+
if (words.length === 1 && assigns2.length === 0 && redirects.length === 0 && after.kind === "op" && after.op === "(") {
|
|
1125
1125
|
this.next();
|
|
1126
1126
|
this.op(")");
|
|
1127
1127
|
return { kind: "function", name: token.raw, body: this.functionBody() };
|
|
1128
1128
|
}
|
|
1129
1129
|
}
|
|
1130
|
-
if (
|
|
1130
|
+
if (assigns2.length + words.length + redirects.length === 0)
|
|
1131
1131
|
this.fail(this.peek());
|
|
1132
|
-
return { kind: "simple", assigns, words, redirects };
|
|
1132
|
+
return { kind: "simple", assigns: assigns2, words, redirects };
|
|
1133
1133
|
}
|
|
1134
1134
|
};
|
|
1135
1135
|
|
|
@@ -1275,8 +1275,8 @@ function changeDir(place, target) {
|
|
|
1275
1275
|
if (isAbsolute2(target) || place.dir === "") return target;
|
|
1276
1276
|
return join4(place.dir, target);
|
|
1277
1277
|
}
|
|
1278
|
-
function assign(place,
|
|
1279
|
-
for (const word of
|
|
1278
|
+
function assign(place, assigns2, exporting) {
|
|
1279
|
+
for (const word of assigns2) {
|
|
1280
1280
|
const name = /^([A-Za-z_][A-Za-z0-9_]*)=/u.exec(word.text)?.[1];
|
|
1281
1281
|
if (!name) continue;
|
|
1282
1282
|
if (exporting) place.exported.add(name);
|
|
@@ -1477,8 +1477,8 @@ function touchesLock(words, scripts) {
|
|
|
1477
1477
|
return runsScript(words, scripts);
|
|
1478
1478
|
}
|
|
1479
1479
|
var DEFAULT_MUTATING_COMMANDS = [
|
|
1480
|
-
...[...DOCKER_MUTATING].map((
|
|
1481
|
-
...[...WRANGLER_MUTATING].map((
|
|
1480
|
+
...[...DOCKER_MUTATING].map((verb2) => ["docker", verb2]),
|
|
1481
|
+
...[...WRANGLER_MUTATING].map((verb2) => ["wrangler", verb2])
|
|
1482
1482
|
];
|
|
1483
1483
|
var DEFAULT_MUTATING_SCRIPT_NAMES = [
|
|
1484
1484
|
"^git:",
|
|
@@ -1667,7 +1667,8 @@ async function runPolicy(selected, input, deps) {
|
|
|
1667
1667
|
}
|
|
1668
1668
|
}
|
|
1669
1669
|
const decision = applyMode(policy.id, raw, mode);
|
|
1670
|
-
|
|
1670
|
+
const letThrough = (raw.verdict ?? "allow") !== "allow" && decision.verdict !== "deny" && decision.verdict !== raw.verdict;
|
|
1671
|
+
log[letThrough ? "info" : "debug"]("policy", {
|
|
1671
1672
|
raw: raw.verdict ?? "allow",
|
|
1672
1673
|
mode,
|
|
1673
1674
|
verdict: decision.verdict ?? "allow",
|
|
@@ -2894,13 +2895,13 @@ function composeArgs(argv) {
|
|
|
2894
2895
|
function teardownReason(argv) {
|
|
2895
2896
|
const args = composeArgs(argv);
|
|
2896
2897
|
if (!args) return null;
|
|
2897
|
-
const { value:
|
|
2898
|
-
if (
|
|
2898
|
+
const { value: verb2, rest } = firstArgument(args, GLOBAL_VALUE_FLAGS);
|
|
2899
|
+
if (verb2 === "down") {
|
|
2899
2900
|
return "docker compose down takes no service argument: it tears down every container and network in the project, including ones this task never touched.";
|
|
2900
2901
|
}
|
|
2901
|
-
if (!
|
|
2902
|
-
if (firstArgument(rest, VERB_VALUE_FLAGS[
|
|
2903
|
-
return `docker compose ${
|
|
2902
|
+
if (!verb2 || !SCOPED_VERBS.has(verb2)) return null;
|
|
2903
|
+
if (firstArgument(rest, VERB_VALUE_FLAGS[verb2]).value) return null;
|
|
2904
|
+
return `docker compose ${verb2} with no service named applies to every service in the project. Name the service you mean.`;
|
|
2904
2905
|
}
|
|
2905
2906
|
var composeTeardown = {
|
|
2906
2907
|
id: "shell.compose_teardown",
|
|
@@ -3355,12 +3356,12 @@ function runsVerb(argv, commands) {
|
|
|
3355
3356
|
if (program(word) !== entry.binary) return false;
|
|
3356
3357
|
const end = argv.indexOf("--", at + 1);
|
|
3357
3358
|
const args = argv.slice(at + 1, end < 0 ? void 0 : end);
|
|
3358
|
-
return entry.verbs.some((
|
|
3359
|
+
return entry.verbs.some((verb2) => {
|
|
3359
3360
|
let from = 0;
|
|
3360
|
-
for (const part of
|
|
3361
|
-
const
|
|
3362
|
-
if (
|
|
3363
|
-
from =
|
|
3361
|
+
for (const part of verb2) {
|
|
3362
|
+
const found2 = args.indexOf(part, from);
|
|
3363
|
+
if (found2 < 0) return false;
|
|
3364
|
+
from = found2 + 1;
|
|
3364
3365
|
}
|
|
3365
3366
|
return true;
|
|
3366
3367
|
});
|
|
@@ -3412,7 +3413,7 @@ function severity(steps, options2) {
|
|
|
3412
3413
|
return wire ? "exfil" : "read";
|
|
3413
3414
|
}
|
|
3414
3415
|
function verbsOf(table, key) {
|
|
3415
|
-
return (stringList(table, key) ?? []).map((
|
|
3416
|
+
return (stringList(table, key) ?? []).map((verb2) => verb2.split(/\s+/u));
|
|
3416
3417
|
}
|
|
3417
3418
|
function commandTables(raw) {
|
|
3418
3419
|
if (raw === void 0) return { value: [], publish: [] };
|
|
@@ -3452,14 +3453,14 @@ var secretExfiltration = {
|
|
|
3452
3453
|
evaluate(input, ctx) {
|
|
3453
3454
|
const call = shellCall(input);
|
|
3454
3455
|
if (!call) return pass;
|
|
3455
|
-
const
|
|
3456
|
-
if (
|
|
3456
|
+
const found2 = severity(call.steps, ctx.options);
|
|
3457
|
+
if (found2 === "exfil") {
|
|
3457
3458
|
return {
|
|
3458
3459
|
verdict: "deny",
|
|
3459
3460
|
reason: "This sends a credential, or changes a live one, over the network. Credential values must not leave the host; send a reference, never the material."
|
|
3460
3461
|
};
|
|
3461
3462
|
}
|
|
3462
|
-
if (
|
|
3463
|
+
if (found2 === "read") {
|
|
3463
3464
|
return {
|
|
3464
3465
|
verdict: "ask",
|
|
3465
3466
|
reason: `This prints credential values to stdout, where they enter the transcript and every log that carries it. ${NO_VALUES}`
|
|
@@ -3965,14 +3966,14 @@ function reportModes(report2, fixed) {
|
|
|
3965
3966
|
import { dirname as dirname6, join as join8 } from "node:path";
|
|
3966
3967
|
function lockHash(root, paths) {
|
|
3967
3968
|
const hash = createHash("sha256");
|
|
3968
|
-
let
|
|
3969
|
+
let found2 = false;
|
|
3969
3970
|
for (const path of paths) {
|
|
3970
3971
|
const file2 = join8(root, path);
|
|
3971
3972
|
if (!existsSync(file2)) continue;
|
|
3972
|
-
|
|
3973
|
+
found2 = true;
|
|
3973
3974
|
hash.update(`${path}\0`).update(readFileSync(file2));
|
|
3974
3975
|
}
|
|
3975
|
-
if (!
|
|
3976
|
+
if (!found2) return null;
|
|
3976
3977
|
return hash.digest("hex");
|
|
3977
3978
|
}
|
|
3978
3979
|
function installedHash(root, spec) {
|
|
@@ -4478,6 +4479,75 @@ var hostLease = {
|
|
|
4478
4479
|
}
|
|
4479
4480
|
};
|
|
4480
4481
|
|
|
4482
|
+
// src/hooks/policies/pmcp/operator-verbs.ts
|
|
4483
|
+
var GLOBAL = /* @__PURE__ */ new Set(["-q", "--quiet", "--color", "--no-color"]);
|
|
4484
|
+
var VARIABLES = ["PMCP_HEAVY_NOW", "PMCP_OPERATOR_TOKEN"];
|
|
4485
|
+
var OPERATOR_SKIP = "PMCP_HEAVY_DISABLE=operator";
|
|
4486
|
+
function launcher(word) {
|
|
4487
|
+
const name = program(word);
|
|
4488
|
+
return name === "pmcp" || name === "cli.js" || /^@modootoday\/pmcp(@|$)/u.test(word);
|
|
4489
|
+
}
|
|
4490
|
+
var RUNNERS2 = /* @__PURE__ */ new Set(["npx", "bunx", "pnpx", "node", "bun", "pnpm", "yarn"]);
|
|
4491
|
+
function pmcpWords(argv) {
|
|
4492
|
+
const reach = RUNNERS2.has(program(argv[0])) ? 4 : 1;
|
|
4493
|
+
const at = argv.slice(0, reach).findIndex(launcher);
|
|
4494
|
+
if (at < 0) return null;
|
|
4495
|
+
const words = argv.slice(at + 1).filter((word) => !GLOBAL.has(word));
|
|
4496
|
+
const cut = words.indexOf("--");
|
|
4497
|
+
return cut < 0 ? words : words.slice(0, cut);
|
|
4498
|
+
}
|
|
4499
|
+
function verb(words) {
|
|
4500
|
+
const [group, sub] = words;
|
|
4501
|
+
const has = (flag2) => words.includes(flag2);
|
|
4502
|
+
if (group === "sessions" && (sub === "pause" || sub === "resume"))
|
|
4503
|
+
return `pmcp sessions ${sub}`;
|
|
4504
|
+
if (group === "heavy" && sub === "promote" && has("--now"))
|
|
4505
|
+
return "pmcp heavy promote --now";
|
|
4506
|
+
if (group === "heavy" && has("--now")) return "pmcp heavy --now";
|
|
4507
|
+
if (group === "heavy" && sub === "cancel" && has("--force"))
|
|
4508
|
+
return "pmcp heavy cancel --force";
|
|
4509
|
+
if (group === "git" && sub === "deliver" && has("--during-pause"))
|
|
4510
|
+
return "pmcp git deliver --during-pause";
|
|
4511
|
+
return null;
|
|
4512
|
+
}
|
|
4513
|
+
function assigns(step) {
|
|
4514
|
+
const name = step.assigned.find((entry) => VARIABLES.includes(entry));
|
|
4515
|
+
if (name) return name;
|
|
4516
|
+
if (program(step.argv[0]) !== "export") return null;
|
|
4517
|
+
return VARIABLES.find(
|
|
4518
|
+
(variable) => step.argv.some((word) => word.split("=")[0] === variable)
|
|
4519
|
+
) ?? null;
|
|
4520
|
+
}
|
|
4521
|
+
function found(step) {
|
|
4522
|
+
const variable = assigns(step);
|
|
4523
|
+
if (variable) return `setting ${variable}`;
|
|
4524
|
+
const skips = step.assigned.includes("PMCP_HEAVY_DISABLE") && step.raw.includes(OPERATOR_SKIP) || program(step.argv[0]) === "export" && step.argv.includes(OPERATOR_SKIP);
|
|
4525
|
+
if (skips) return `the lease skip ${OPERATOR_SKIP}`;
|
|
4526
|
+
const words = pmcpWords(step.argv);
|
|
4527
|
+
return words ? verb(words) : null;
|
|
4528
|
+
}
|
|
4529
|
+
var operatorVerbs = {
|
|
4530
|
+
id: "pmcp.operator_verbs",
|
|
4531
|
+
events: ["before_tool"],
|
|
4532
|
+
tools: ["shell"],
|
|
4533
|
+
fail: "closed",
|
|
4534
|
+
defaultMode: "deny",
|
|
4535
|
+
options: noOptions,
|
|
4536
|
+
evaluate(input) {
|
|
4537
|
+
const call = shellCall(input);
|
|
4538
|
+
if (!call) return pass;
|
|
4539
|
+
for (const step of call.steps) {
|
|
4540
|
+
const what = found(step);
|
|
4541
|
+
if (what)
|
|
4542
|
+
return {
|
|
4543
|
+
verdict: "deny",
|
|
4544
|
+
reason: `${what} is the operator's to run, not an agent session's. Ask the operator to run it from their own terminal, and say why.`
|
|
4545
|
+
};
|
|
4546
|
+
}
|
|
4547
|
+
return pass;
|
|
4548
|
+
}
|
|
4549
|
+
};
|
|
4550
|
+
|
|
4481
4551
|
// src/hooks/policies/custom.ts
|
|
4482
4552
|
import { isAbsolute as isAbsolute7, relative as relative7, resolve as resolve12 } from "node:path";
|
|
4483
4553
|
var FAILED = "Guard failed validation or execution";
|
|
@@ -4527,7 +4597,7 @@ function applies(entry, input) {
|
|
|
4527
4597
|
function readFindings(value) {
|
|
4528
4598
|
if (value === void 0) return [];
|
|
4529
4599
|
if (!Array.isArray(value)) return null;
|
|
4530
|
-
const
|
|
4600
|
+
const found2 = [];
|
|
4531
4601
|
for (const item of value) {
|
|
4532
4602
|
if (!item || typeof item !== "object" || Array.isArray(item)) return null;
|
|
4533
4603
|
const { path, line, message, ...rest } = item;
|
|
@@ -4536,13 +4606,13 @@ function readFindings(value) {
|
|
|
4536
4606
|
if (path !== void 0 && typeof path !== "string") return null;
|
|
4537
4607
|
if (line !== void 0 && (!Number.isSafeInteger(line) || line < 1))
|
|
4538
4608
|
return null;
|
|
4539
|
-
|
|
4609
|
+
found2.push({
|
|
4540
4610
|
message,
|
|
4541
4611
|
...path !== void 0 ? { path } : {},
|
|
4542
4612
|
...line !== void 0 ? { line } : {}
|
|
4543
4613
|
});
|
|
4544
4614
|
}
|
|
4545
|
-
return
|
|
4615
|
+
return found2;
|
|
4546
4616
|
}
|
|
4547
4617
|
function findingLine(finding) {
|
|
4548
4618
|
const where = finding.path ? `${finding.path}${finding.line ? `:${finding.line}` : ""}: ` : "";
|
|
@@ -4637,7 +4707,8 @@ var GUARDS = byId([
|
|
|
4637
4707
|
pushWithoutVerify,
|
|
4638
4708
|
forcedBranchMove,
|
|
4639
4709
|
gateBypassEnv,
|
|
4640
|
-
stageAll
|
|
4710
|
+
stageAll,
|
|
4711
|
+
operatorVerbs
|
|
4641
4712
|
]);
|
|
4642
4713
|
var FEATURES = byId([
|
|
4643
4714
|
registry,
|
|
@@ -6951,7 +7022,7 @@ function filesRegistry(dir, staleMs) {
|
|
|
6951
7022
|
);
|
|
6952
7023
|
};
|
|
6953
7024
|
const list = (now = Date.now()) => {
|
|
6954
|
-
const
|
|
7025
|
+
const found2 = /* @__PURE__ */ new Map();
|
|
6955
7026
|
for (const folder of dirs) {
|
|
6956
7027
|
let names4 = [];
|
|
6957
7028
|
try {
|
|
@@ -6960,12 +7031,12 @@ function filesRegistry(dir, staleMs) {
|
|
|
6960
7031
|
continue;
|
|
6961
7032
|
}
|
|
6962
7033
|
for (const name of names4)
|
|
6963
|
-
|
|
6964
|
-
...
|
|
7034
|
+
found2.set(name, [
|
|
7035
|
+
...found2.get(name) ?? [],
|
|
6965
7036
|
asRecord(readJson3(join25(folder, name)))
|
|
6966
7037
|
]);
|
|
6967
7038
|
}
|
|
6968
|
-
return [...
|
|
7039
|
+
return [...found2.values()].map(latestRecord).filter((record) => record !== null).map((record) => ({ ...record, live: isLive(record, now, staleMs) }));
|
|
6969
7040
|
};
|
|
6970
7041
|
const remove = (session) => {
|
|
6971
7042
|
if (!SESSION_ID.test(session)) return;
|
|
@@ -13,12 +13,12 @@ async function run(context) {
|
|
|
13
13
|
const [verb = "list", ...extra] = context.args.positional;
|
|
14
14
|
if (!VERBS.includes(verb)) throw unknownSubcommand("hooks", verb, VERBS);
|
|
15
15
|
if (extra.length) throw new ArgumentError(`unexpected ${extra.join(" ")}`);
|
|
16
|
-
if (verb === "list") return (await import("./list-
|
|
17
|
-
if (verb === "test") return (await import("./test-
|
|
18
|
-
return (await import("./report-
|
|
16
|
+
if (verb === "list") return (await import("./list-A7VQJXE5.js")).run(context);
|
|
17
|
+
if (verb === "test") return (await import("./test-VWGNFSH5.js")).run(context);
|
|
18
|
+
return (await import("./report-43SFNNCF.js")).run(context);
|
|
19
19
|
}
|
|
20
20
|
var hooksCommand = { ...hooksSpec, run };
|
|
21
21
|
export {
|
|
22
22
|
hooksCommand
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=hooks-
|
|
24
|
+
//# sourceMappingURL=hooks-VAEAK2FY.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireTerminal,
|
|
3
3
|
terminalSupport
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PECS47OL.js";
|
|
5
5
|
import "./chunk-5ZABTVSW.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-PGZZI42O.js";
|
|
7
7
|
import "./chunk-LMT3PPXJ.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-ISWR2XIU.js";
|
|
9
9
|
import "./chunk-R2GPCZUX.js";
|
|
10
10
|
import "./chunk-34DECPVC.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-2TXVOHRS.js";
|
|
12
|
+
import "./chunk-DITIXBFB.js";
|
|
13
13
|
import "./chunk-N7ANFMA5.js";
|
|
14
14
|
import "./chunk-TYY5TYHF.js";
|
|
15
15
|
import "./chunk-T6C3TSTO.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-FQLCD4HU.js";
|
|
|
17
17
|
import "./chunk-GUHOEIHP.js";
|
|
18
18
|
import "./chunk-IJBSOWHK.js";
|
|
19
19
|
import "./chunk-XWLMZKH2.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-SMBU3QLE.js";
|
|
21
21
|
import "./chunk-GJXOFDJT.js";
|
|
22
22
|
import "./chunk-PMJG2CXF.js";
|
|
23
23
|
import "./chunk-J6KL3COD.js";
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
requireTerminal,
|
|
26
26
|
terminalSupport
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=host-
|
|
28
|
+
//# sourceMappingURL=host-4GJDGTLW.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-F5XMGOOX.js";
|
|
5
5
|
import {
|
|
6
6
|
specFrom
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BG6TONJO.js";
|
|
8
8
|
import "./chunk-7CHUMF3E.js";
|
|
9
9
|
import {
|
|
10
10
|
approvalDir,
|
|
@@ -12,13 +12,16 @@ import {
|
|
|
12
12
|
hostDigest,
|
|
13
13
|
projectedFiles,
|
|
14
14
|
writeApproval
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-QYHM6554.js";
|
|
16
|
+
import "./chunk-TOR6SKRB.js";
|
|
17
17
|
import "./chunk-VYQJPT27.js";
|
|
18
18
|
import "./chunk-UKR64U7J.js";
|
|
19
19
|
import "./chunk-2GD7PQ7J.js";
|
|
20
20
|
import "./chunk-EATCUWGG.js";
|
|
21
21
|
import "./chunk-OFJIMBTL.js";
|
|
22
|
+
import {
|
|
23
|
+
agentContext
|
|
24
|
+
} from "./chunk-NQCAKDRY.js";
|
|
22
25
|
import "./chunk-LFFIQBNY.js";
|
|
23
26
|
import "./chunk-HQOB7OQS.js";
|
|
24
27
|
import "./chunk-73AKO4UL.js";
|
|
@@ -26,9 +29,7 @@ import "./chunk-VQBXWMLT.js";
|
|
|
26
29
|
import "./chunk-EWYLWBKS.js";
|
|
27
30
|
import "./chunk-SDFJJJB5.js";
|
|
28
31
|
import "./chunk-3V37OZQH.js";
|
|
29
|
-
import
|
|
30
|
-
ancestors
|
|
31
|
-
} from "./chunk-Z6WRFOFT.js";
|
|
32
|
+
import "./chunk-Z6WRFOFT.js";
|
|
32
33
|
import "./chunk-23PE3HZB.js";
|
|
33
34
|
import "./chunk-Q5H3L6Y4.js";
|
|
34
35
|
import "./chunk-ARXCYFFZ.js";
|
|
@@ -39,8 +40,8 @@ import {
|
|
|
39
40
|
} from "./chunk-Y6NFETNG.js";
|
|
40
41
|
import {
|
|
41
42
|
hostDoctor
|
|
42
|
-
} from "./chunk-
|
|
43
|
-
import "./chunk-
|
|
43
|
+
} from "./chunk-2TXVOHRS.js";
|
|
44
|
+
import "./chunk-DITIXBFB.js";
|
|
44
45
|
import "./chunk-N7ANFMA5.js";
|
|
45
46
|
import "./chunk-TYY5TYHF.js";
|
|
46
47
|
import "./chunk-T6C3TSTO.js";
|
|
@@ -48,7 +49,7 @@ import "./chunk-FQLCD4HU.js";
|
|
|
48
49
|
import "./chunk-GUHOEIHP.js";
|
|
49
50
|
import "./chunk-IJBSOWHK.js";
|
|
50
51
|
import "./chunk-XWLMZKH2.js";
|
|
51
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-SMBU3QLE.js";
|
|
52
53
|
import "./chunk-GJXOFDJT.js";
|
|
53
54
|
import "./chunk-PMJG2CXF.js";
|
|
54
55
|
import "./chunk-J6KL3COD.js";
|
|
@@ -56,54 +57,6 @@ import "./chunk-J6KL3COD.js";
|
|
|
56
57
|
// src/commands/harness/host.ts
|
|
57
58
|
import { createInterface } from "readline/promises";
|
|
58
59
|
|
|
59
|
-
// src/harness/host/operator.ts
|
|
60
|
-
import { readFileSync } from "fs";
|
|
61
|
-
var ENV_MARKERS = [
|
|
62
|
-
"PMCP_PTY_SOCKET",
|
|
63
|
-
"PMCP_PTY_SESSION",
|
|
64
|
-
"CLAUDECODE",
|
|
65
|
-
"CLAUDE_CODE_ENTRYPOINT",
|
|
66
|
-
"CODEX_THREAD_ID",
|
|
67
|
-
"CODEX_SANDBOX",
|
|
68
|
-
"GEMINI_CLI",
|
|
69
|
-
"GROK_SESSION_ID",
|
|
70
|
-
"AI_AGENT"
|
|
71
|
-
];
|
|
72
|
-
var RUNTIMES = /* @__PURE__ */ new Set([
|
|
73
|
-
"claude",
|
|
74
|
-
"codex",
|
|
75
|
-
"gemini",
|
|
76
|
-
"grok",
|
|
77
|
-
"opencode",
|
|
78
|
-
"agy",
|
|
79
|
-
"pmcp-pty"
|
|
80
|
-
]);
|
|
81
|
-
var PACKAGES = /@openai\/codex|@google\/gemini-cli|opencode-ai|@anthropic-ai\/claude-code/u;
|
|
82
|
-
function view(pid) {
|
|
83
|
-
try {
|
|
84
|
-
const stat = readFileSync(`/proc/${pid}/stat`, "utf8");
|
|
85
|
-
const name = stat.slice(stat.indexOf("(") + 1, stat.lastIndexOf(")"));
|
|
86
|
-
const cmdline = readFileSync(`/proc/${pid}/cmdline`, "utf8").replaceAll(
|
|
87
|
-
"\0",
|
|
88
|
-
" "
|
|
89
|
-
);
|
|
90
|
-
return { name, cmdline };
|
|
91
|
-
} catch {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function agentProcess(p) {
|
|
96
|
-
const first = p.cmdline.split(" ")[0] ?? "";
|
|
97
|
-
const base = first.slice(first.lastIndexOf("/") + 1);
|
|
98
|
-
return RUNTIMES.has(p.name) || RUNTIMES.has(base) || PACKAGES.test(p.cmdline);
|
|
99
|
-
}
|
|
100
|
-
function agentContext(env, chain = ancestors().flatMap((pid) => view(pid) ?? [])) {
|
|
101
|
-
const marker = ENV_MARKERS.find((name) => env[name] !== void 0);
|
|
102
|
-
if (marker) return `${marker} is set`;
|
|
103
|
-
const agent = chain.find(agentProcess);
|
|
104
|
-
return agent ? `it runs under ${agent.name}` : null;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
60
|
// src/harness/host/approve.ts
|
|
108
61
|
function summary(host) {
|
|
109
62
|
const lines = [`mcp_write ${host.mcpWrite}; roots ${host.roots.join(", ")}`];
|
|
@@ -190,7 +143,7 @@ async function runHost(context) {
|
|
|
190
143
|
return 1;
|
|
191
144
|
}
|
|
192
145
|
if (verb === "up" || verb === "down" || verb === "unit") {
|
|
193
|
-
const { runHostVerb } = await import("./host-run-
|
|
146
|
+
const { runHostVerb } = await import("./host-run-DDMKD3BU.js");
|
|
194
147
|
return runHostVerb(verb, spec, context);
|
|
195
148
|
}
|
|
196
149
|
if (verb === "status") {
|
|
@@ -218,4 +171,4 @@ async function runHost(context) {
|
|
|
218
171
|
export {
|
|
219
172
|
runHost
|
|
220
173
|
};
|
|
221
|
-
//# sourceMappingURL=host-
|
|
174
|
+
//# sourceMappingURL=host-I2EMQ7UE.js.map
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
approvalDir,
|
|
7
7
|
approvalState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QYHM6554.js";
|
|
9
9
|
import {
|
|
10
10
|
ArgumentError
|
|
11
11
|
} from "./chunk-Y6NFETNG.js";
|
|
12
12
|
import {
|
|
13
13
|
missingBinary,
|
|
14
14
|
ptyBinary
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-2TXVOHRS.js";
|
|
16
|
+
import "./chunk-DITIXBFB.js";
|
|
17
17
|
import "./chunk-N7ANFMA5.js";
|
|
18
18
|
import "./chunk-TYY5TYHF.js";
|
|
19
19
|
import "./chunk-T6C3TSTO.js";
|
|
@@ -25,7 +25,7 @@ import "./chunk-IJBSOWHK.js";
|
|
|
25
25
|
import "./chunk-XWLMZKH2.js";
|
|
26
26
|
import {
|
|
27
27
|
VERSION
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-SMBU3QLE.js";
|
|
29
29
|
import "./chunk-GJXOFDJT.js";
|
|
30
30
|
import "./chunk-PMJG2CXF.js";
|
|
31
31
|
import {
|
|
@@ -333,4 +333,4 @@ async function runHostVerb(verb, spec, context) {
|
|
|
333
333
|
export {
|
|
334
334
|
runHostVerb
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=host-run-
|
|
336
|
+
//# sourceMappingURL=host-run-DDMKD3BU.js.map
|
package/dist/http.js
CHANGED
|
@@ -6,12 +6,13 @@ import {
|
|
|
6
6
|
} from "./chunk-ANJMLKBR.js";
|
|
7
7
|
import {
|
|
8
8
|
readMcp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TOR6SKRB.js";
|
|
10
10
|
import "./chunk-VYQJPT27.js";
|
|
11
11
|
import "./chunk-UKR64U7J.js";
|
|
12
12
|
import "./chunk-2GD7PQ7J.js";
|
|
13
13
|
import "./chunk-EATCUWGG.js";
|
|
14
14
|
import "./chunk-OFJIMBTL.js";
|
|
15
|
+
import "./chunk-NQCAKDRY.js";
|
|
15
16
|
import "./chunk-LFFIQBNY.js";
|
|
16
17
|
import "./chunk-HQOB7OQS.js";
|
|
17
18
|
import "./chunk-73AKO4UL.js";
|
|
@@ -30,8 +31,8 @@ import {
|
|
|
30
31
|
ArgumentError,
|
|
31
32
|
many
|
|
32
33
|
} from "./chunk-Y6NFETNG.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
34
|
+
import "./chunk-2TXVOHRS.js";
|
|
35
|
+
import "./chunk-DITIXBFB.js";
|
|
35
36
|
import "./chunk-N7ANFMA5.js";
|
|
36
37
|
import {
|
|
37
38
|
ProjectError
|
|
@@ -41,7 +42,7 @@ import "./chunk-FQLCD4HU.js";
|
|
|
41
42
|
import "./chunk-GUHOEIHP.js";
|
|
42
43
|
import "./chunk-IJBSOWHK.js";
|
|
43
44
|
import "./chunk-XWLMZKH2.js";
|
|
44
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-SMBU3QLE.js";
|
|
45
46
|
import "./chunk-GJXOFDJT.js";
|
|
46
47
|
import "./chunk-PMJG2CXF.js";
|
|
47
48
|
import "./chunk-J6KL3COD.js";
|
|
@@ -406,4 +407,4 @@ function importMcp(context) {
|
|
|
406
407
|
export {
|
|
407
408
|
importMcp
|
|
408
409
|
};
|
|
409
|
-
//# sourceMappingURL=import-mcp-
|
|
410
|
+
//# sourceMappingURL=import-mcp-TNSAMJXI.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -304,7 +304,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
|
|
|
304
304
|
} | null;
|
|
305
305
|
|
|
306
306
|
declare const SERVER_NAME = "pmcp";
|
|
307
|
-
declare const SERVER_VERSION = "0.
|
|
307
|
+
declare const SERVER_VERSION = "0.25.0";
|
|
308
308
|
declare function registerSkillTools(server: McpServer, tools: SkillTools): McpServer;
|
|
309
309
|
interface SkillMcpOptions extends SkillServerOptions {
|
|
310
310
|
readonly mailbox?: MailboxService;
|