@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
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
ptyFields,
|
|
14
14
|
ptyRef
|
|
15
15
|
} from "./chunk-OFJIMBTL.js";
|
|
16
|
+
import {
|
|
17
|
+
readOperatorSettings
|
|
18
|
+
} from "./chunk-NQCAKDRY.js";
|
|
16
19
|
import {
|
|
17
20
|
readReportTable
|
|
18
21
|
} from "./chunk-LFFIQBNY.js";
|
|
@@ -69,11 +72,11 @@ import {
|
|
|
69
72
|
readHost,
|
|
70
73
|
readLock,
|
|
71
74
|
readLockFile
|
|
72
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-2TXVOHRS.js";
|
|
73
76
|
import {
|
|
74
77
|
DISABLE_ENV,
|
|
75
78
|
readLeaseSettings
|
|
76
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-DITIXBFB.js";
|
|
77
80
|
import {
|
|
78
81
|
ProjectError,
|
|
79
82
|
RULES_DIR,
|
|
@@ -1151,7 +1154,7 @@ function currentRules(settings, bucket) {
|
|
|
1151
1154
|
return { rules: raw, present: true };
|
|
1152
1155
|
}
|
|
1153
1156
|
function overlaps(settings, declared, owned2) {
|
|
1154
|
-
const
|
|
1157
|
+
const found2 = [];
|
|
1155
1158
|
for (const [bucket, rules2] of Object.entries(declared)) {
|
|
1156
1159
|
for (const other of BUCKETS) {
|
|
1157
1160
|
if (other === bucket) continue;
|
|
@@ -1160,12 +1163,12 @@ function overlaps(settings, declared, owned2) {
|
|
|
1160
1163
|
(rule) => !mine.includes(rule)
|
|
1161
1164
|
);
|
|
1162
1165
|
for (const rule of rules2.filter((item) => native2.includes(item)))
|
|
1163
|
-
|
|
1166
|
+
found2.push(
|
|
1164
1167
|
`overlap: ${SETTINGS}#permissions.${other} has unmanaged ${rule}, declared in ${bucket}`
|
|
1165
1168
|
);
|
|
1166
1169
|
}
|
|
1167
1170
|
}
|
|
1168
|
-
return
|
|
1171
|
+
return found2;
|
|
1169
1172
|
}
|
|
1170
1173
|
function reconcile(settings, bucket, owned2, declared) {
|
|
1171
1174
|
const where = `${SETTINGS}#permissions.${bucket}`;
|
|
@@ -1177,12 +1180,12 @@ function reconcile(settings, bucket, owned2, declared) {
|
|
|
1177
1180
|
}
|
|
1178
1181
|
const rules2 = current.rules;
|
|
1179
1182
|
for (const rule of owned2) {
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1183
|
+
const found2 = count(rules2, rule);
|
|
1184
|
+
if (found2 === 0 && current.present && current.problem === void 0)
|
|
1182
1185
|
conflicts.push(
|
|
1183
1186
|
`conflict: ${where} owned entry edited or removed ${rule}`
|
|
1184
1187
|
);
|
|
1185
|
-
if (
|
|
1188
|
+
if (found2 > 1)
|
|
1186
1189
|
conflicts.push(`conflict: ${where} owned entry is duplicated ${rule}`);
|
|
1187
1190
|
}
|
|
1188
1191
|
const dropped = owned2.filter(
|
|
@@ -1718,14 +1721,14 @@ function checkBudget(spec, settings) {
|
|
|
1718
1721
|
);
|
|
1719
1722
|
for (const glob of settings.forbidPaths) {
|
|
1720
1723
|
const pattern = globPattern(glob);
|
|
1721
|
-
const
|
|
1724
|
+
const found2 = tracked.filter((file) => pattern.test(file));
|
|
1722
1725
|
rows.push({
|
|
1723
1726
|
key: "forbid_paths",
|
|
1724
1727
|
subject: glob,
|
|
1725
|
-
value:
|
|
1728
|
+
value: found2.length,
|
|
1726
1729
|
limit: 0
|
|
1727
1730
|
});
|
|
1728
|
-
for (const file of
|
|
1731
|
+
for (const file of found2)
|
|
1729
1732
|
problems.push(`[budget] forbid_paths: ${file} matches ${glob}`);
|
|
1730
1733
|
}
|
|
1731
1734
|
return { rows, problems };
|
|
@@ -1894,8 +1897,8 @@ var PLUGIN_BINARIES = ["pmcp-browser", "pmcp-desktop"];
|
|
|
1894
1897
|
var isPlugin = (command) => PLUGIN_BINARIES.includes(command);
|
|
1895
1898
|
function resolvePluginCommand(command, from) {
|
|
1896
1899
|
if (!isPlugin(command)) return command;
|
|
1897
|
-
const
|
|
1898
|
-
return "path" in
|
|
1900
|
+
const found2 = packagedBinary(command, from);
|
|
1901
|
+
return "path" in found2 ? found2.path : command;
|
|
1899
1902
|
}
|
|
1900
1903
|
function pluginBinaryDoctor(servers, from) {
|
|
1901
1904
|
const findings = [];
|
|
@@ -1905,20 +1908,20 @@ function pluginBinaryDoctor(servers, from) {
|
|
|
1905
1908
|
const name = command.split("/").pop();
|
|
1906
1909
|
if (!isPlugin(name)) continue;
|
|
1907
1910
|
const check = `[mcp.${alias}] ${name}`;
|
|
1908
|
-
const
|
|
1911
|
+
const found2 = packagedBinary(name, from);
|
|
1909
1912
|
if (isPlugin(command))
|
|
1910
1913
|
findings.push({
|
|
1911
1914
|
tool: "project",
|
|
1912
1915
|
check,
|
|
1913
1916
|
status: "warn",
|
|
1914
|
-
detail: `not resolved: ${"reason" in
|
|
1917
|
+
detail: `not resolved: ${"reason" in found2 ? found2.reason : "unknown"}; runs ${name} from PATH`
|
|
1915
1918
|
});
|
|
1916
1919
|
else
|
|
1917
1920
|
findings.push({
|
|
1918
1921
|
tool: "project",
|
|
1919
1922
|
check,
|
|
1920
1923
|
status: "ok",
|
|
1921
|
-
detail: "path" in
|
|
1924
|
+
detail: "path" in found2 && found2.path === command ? `resolved to ${command} (platform package)` : `explicit command kept: ${command}`
|
|
1922
1925
|
});
|
|
1923
1926
|
}
|
|
1924
1927
|
return findings;
|
|
@@ -2310,7 +2313,7 @@ var Scanner = class _Scanner {
|
|
|
2310
2313
|
// Index just past the )) closing the (( at open, or -1 when a lone ) closes it first.
|
|
2311
2314
|
arithmeticEnd(open, nested) {
|
|
2312
2315
|
const { text } = this;
|
|
2313
|
-
const
|
|
2316
|
+
const found2 = [];
|
|
2314
2317
|
let depth = 0;
|
|
2315
2318
|
let index = open + 2;
|
|
2316
2319
|
while (index < text.length) {
|
|
@@ -2321,7 +2324,7 @@ var Scanner = class _Scanner {
|
|
|
2321
2324
|
}
|
|
2322
2325
|
if (text.startsWith("$(", index) && !text.startsWith("$((", index)) {
|
|
2323
2326
|
const inner = this.nested.at(text, index + 2);
|
|
2324
|
-
|
|
2327
|
+
found2.push(inner.list);
|
|
2325
2328
|
index = inner.end;
|
|
2326
2329
|
continue;
|
|
2327
2330
|
}
|
|
@@ -2329,7 +2332,7 @@ var Scanner = class _Scanner {
|
|
|
2329
2332
|
if (char === ")") {
|
|
2330
2333
|
if (depth === 0) {
|
|
2331
2334
|
if (text[index + 1] !== ")") return -1;
|
|
2332
|
-
nested.push(...
|
|
2335
|
+
nested.push(...found2);
|
|
2333
2336
|
return index + 2;
|
|
2334
2337
|
}
|
|
2335
2338
|
depth -= 1;
|
|
@@ -2565,9 +2568,9 @@ var Parser = class {
|
|
|
2565
2568
|
return token;
|
|
2566
2569
|
}
|
|
2567
2570
|
fail(token, expected) {
|
|
2568
|
-
const
|
|
2571
|
+
const found2 = describe(token);
|
|
2569
2572
|
throw new ShellSyntaxError(
|
|
2570
|
-
expected ? `expected ${expected}, found ${
|
|
2573
|
+
expected ? `expected ${expected}, found ${found2}` : `unexpected ${found2}`,
|
|
2571
2574
|
token.start
|
|
2572
2575
|
);
|
|
2573
2576
|
}
|
|
@@ -2833,7 +2836,7 @@ var Parser = class {
|
|
|
2833
2836
|
return redirect;
|
|
2834
2837
|
}
|
|
2835
2838
|
simple() {
|
|
2836
|
-
const
|
|
2839
|
+
const assigns2 = [];
|
|
2837
2840
|
const words = [];
|
|
2838
2841
|
const redirects = [];
|
|
2839
2842
|
let first = "";
|
|
@@ -2842,29 +2845,29 @@ var Parser = class {
|
|
|
2842
2845
|
const token = this.peek();
|
|
2843
2846
|
if (token.kind === "redirect") {
|
|
2844
2847
|
redirects.push(this.redirect());
|
|
2845
|
-
if (
|
|
2848
|
+
if (assigns2.length > 0) redirectedAfterAssign = true;
|
|
2846
2849
|
continue;
|
|
2847
2850
|
}
|
|
2848
2851
|
if (token.kind !== "word") break;
|
|
2849
2852
|
this.next();
|
|
2850
2853
|
if (words.length === 0 && ASSIGNMENT.test(token.raw)) {
|
|
2851
2854
|
if (redirectedAfterAssign && ARRAY.test(token.raw)) this.fail(token);
|
|
2852
|
-
|
|
2855
|
+
assigns2.push(token.word);
|
|
2853
2856
|
continue;
|
|
2854
2857
|
}
|
|
2855
2858
|
if (ARRAY.test(token.raw) && !DECLARES.has(first)) this.fail(token);
|
|
2856
2859
|
if (words.length === 0) first = token.raw;
|
|
2857
2860
|
words.push(token.word);
|
|
2858
2861
|
const after = this.peek();
|
|
2859
|
-
if (words.length === 1 &&
|
|
2862
|
+
if (words.length === 1 && assigns2.length === 0 && redirects.length === 0 && after.kind === "op" && after.op === "(") {
|
|
2860
2863
|
this.next();
|
|
2861
2864
|
this.op(")");
|
|
2862
2865
|
return { kind: "function", name: token.raw, body: this.functionBody() };
|
|
2863
2866
|
}
|
|
2864
2867
|
}
|
|
2865
|
-
if (
|
|
2868
|
+
if (assigns2.length + words.length + redirects.length === 0)
|
|
2866
2869
|
this.fail(this.peek());
|
|
2867
|
-
return { kind: "simple", assigns, words, redirects };
|
|
2870
|
+
return { kind: "simple", assigns: assigns2, words, redirects };
|
|
2868
2871
|
}
|
|
2869
2872
|
};
|
|
2870
2873
|
|
|
@@ -3010,8 +3013,8 @@ function changeDir(place, target) {
|
|
|
3010
3013
|
if (isAbsolute4(target) || place.dir === "") return target;
|
|
3011
3014
|
return join8(place.dir, target);
|
|
3012
3015
|
}
|
|
3013
|
-
function assign(place,
|
|
3014
|
-
for (const word of
|
|
3016
|
+
function assign(place, assigns2, exporting) {
|
|
3017
|
+
for (const word of assigns2) {
|
|
3015
3018
|
const name = /^([A-Za-z_][A-Za-z0-9_]*)=/u.exec(word.text)?.[1];
|
|
3016
3019
|
if (!name) continue;
|
|
3017
3020
|
if (exporting) place.exported.add(name);
|
|
@@ -3212,8 +3215,8 @@ function touchesLock(words, scripts) {
|
|
|
3212
3215
|
return runsScript(words, scripts);
|
|
3213
3216
|
}
|
|
3214
3217
|
var DEFAULT_MUTATING_COMMANDS = [
|
|
3215
|
-
...[...DOCKER_MUTATING].map((
|
|
3216
|
-
...[...WRANGLER_MUTATING].map((
|
|
3218
|
+
...[...DOCKER_MUTATING].map((verb2) => ["docker", verb2]),
|
|
3219
|
+
...[...WRANGLER_MUTATING].map((verb2) => ["wrangler", verb2])
|
|
3217
3220
|
];
|
|
3218
3221
|
var DEFAULT_MUTATING_SCRIPT_NAMES = [
|
|
3219
3222
|
"^git:",
|
|
@@ -4178,13 +4181,13 @@ function composeArgs(argv) {
|
|
|
4178
4181
|
function teardownReason(argv) {
|
|
4179
4182
|
const args = composeArgs(argv);
|
|
4180
4183
|
if (!args) return null;
|
|
4181
|
-
const { value:
|
|
4182
|
-
if (
|
|
4184
|
+
const { value: verb2, rest } = firstArgument(args, GLOBAL_VALUE_FLAGS);
|
|
4185
|
+
if (verb2 === "down") {
|
|
4183
4186
|
return "docker compose down takes no service argument: it tears down every container and network in the project, including ones this task never touched.";
|
|
4184
4187
|
}
|
|
4185
|
-
if (!
|
|
4186
|
-
if (firstArgument(rest, VERB_VALUE_FLAGS[
|
|
4187
|
-
return `docker compose ${
|
|
4188
|
+
if (!verb2 || !SCOPED_VERBS.has(verb2)) return null;
|
|
4189
|
+
if (firstArgument(rest, VERB_VALUE_FLAGS[verb2]).value) return null;
|
|
4190
|
+
return `docker compose ${verb2} with no service named applies to every service in the project. Name the service you mean.`;
|
|
4188
4191
|
}
|
|
4189
4192
|
var composeTeardown = {
|
|
4190
4193
|
id: "shell.compose_teardown",
|
|
@@ -4639,12 +4642,12 @@ function runsVerb(argv, commands) {
|
|
|
4639
4642
|
if (program(word) !== entry.binary) return false;
|
|
4640
4643
|
const end = argv.indexOf("--", at + 1);
|
|
4641
4644
|
const args = argv.slice(at + 1, end < 0 ? void 0 : end);
|
|
4642
|
-
return entry.verbs.some((
|
|
4645
|
+
return entry.verbs.some((verb2) => {
|
|
4643
4646
|
let from = 0;
|
|
4644
|
-
for (const part of
|
|
4645
|
-
const
|
|
4646
|
-
if (
|
|
4647
|
-
from =
|
|
4647
|
+
for (const part of verb2) {
|
|
4648
|
+
const found2 = args.indexOf(part, from);
|
|
4649
|
+
if (found2 < 0) return false;
|
|
4650
|
+
from = found2 + 1;
|
|
4648
4651
|
}
|
|
4649
4652
|
return true;
|
|
4650
4653
|
});
|
|
@@ -4696,7 +4699,7 @@ function severity(steps, options2) {
|
|
|
4696
4699
|
return wire ? "exfil" : "read";
|
|
4697
4700
|
}
|
|
4698
4701
|
function verbsOf(table3, key) {
|
|
4699
|
-
return (stringList(table3, key) ?? []).map((
|
|
4702
|
+
return (stringList(table3, key) ?? []).map((verb2) => verb2.split(/\s+/u));
|
|
4700
4703
|
}
|
|
4701
4704
|
function commandTables(raw) {
|
|
4702
4705
|
if (raw === void 0) return { value: [], publish: [] };
|
|
@@ -4736,14 +4739,14 @@ var secretExfiltration = {
|
|
|
4736
4739
|
evaluate(input, ctx) {
|
|
4737
4740
|
const call = shellCall(input);
|
|
4738
4741
|
if (!call) return pass;
|
|
4739
|
-
const
|
|
4740
|
-
if (
|
|
4742
|
+
const found2 = severity(call.steps, ctx.options);
|
|
4743
|
+
if (found2 === "exfil") {
|
|
4741
4744
|
return {
|
|
4742
4745
|
verdict: "deny",
|
|
4743
4746
|
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."
|
|
4744
4747
|
};
|
|
4745
4748
|
}
|
|
4746
|
-
if (
|
|
4749
|
+
if (found2 === "read") {
|
|
4747
4750
|
return {
|
|
4748
4751
|
verdict: "ask",
|
|
4749
4752
|
reason: `This prints credential values to stdout, where they enter the transcript and every log that carries it. ${NO_VALUES}`
|
|
@@ -5205,6 +5208,75 @@ var hostLease = {
|
|
|
5205
5208
|
}
|
|
5206
5209
|
};
|
|
5207
5210
|
|
|
5211
|
+
// src/hooks/policies/pmcp/operator-verbs.ts
|
|
5212
|
+
var GLOBAL = /* @__PURE__ */ new Set(["-q", "--quiet", "--color", "--no-color"]);
|
|
5213
|
+
var VARIABLES = ["PMCP_HEAVY_NOW", "PMCP_OPERATOR_TOKEN"];
|
|
5214
|
+
var OPERATOR_SKIP = "PMCP_HEAVY_DISABLE=operator";
|
|
5215
|
+
function launcher(word) {
|
|
5216
|
+
const name = program(word);
|
|
5217
|
+
return name === "pmcp" || name === "cli.js" || /^@modootoday\/pmcp(@|$)/u.test(word);
|
|
5218
|
+
}
|
|
5219
|
+
var RUNNERS2 = /* @__PURE__ */ new Set(["npx", "bunx", "pnpx", "node", "bun", "pnpm", "yarn"]);
|
|
5220
|
+
function pmcpWords(argv) {
|
|
5221
|
+
const reach = RUNNERS2.has(program(argv[0])) ? 4 : 1;
|
|
5222
|
+
const at = argv.slice(0, reach).findIndex(launcher);
|
|
5223
|
+
if (at < 0) return null;
|
|
5224
|
+
const words = argv.slice(at + 1).filter((word) => !GLOBAL.has(word));
|
|
5225
|
+
const cut = words.indexOf("--");
|
|
5226
|
+
return cut < 0 ? words : words.slice(0, cut);
|
|
5227
|
+
}
|
|
5228
|
+
function verb(words) {
|
|
5229
|
+
const [group, sub] = words;
|
|
5230
|
+
const has = (flag2) => words.includes(flag2);
|
|
5231
|
+
if (group === "sessions" && (sub === "pause" || sub === "resume"))
|
|
5232
|
+
return `pmcp sessions ${sub}`;
|
|
5233
|
+
if (group === "heavy" && sub === "promote" && has("--now"))
|
|
5234
|
+
return "pmcp heavy promote --now";
|
|
5235
|
+
if (group === "heavy" && has("--now")) return "pmcp heavy --now";
|
|
5236
|
+
if (group === "heavy" && sub === "cancel" && has("--force"))
|
|
5237
|
+
return "pmcp heavy cancel --force";
|
|
5238
|
+
if (group === "git" && sub === "deliver" && has("--during-pause"))
|
|
5239
|
+
return "pmcp git deliver --during-pause";
|
|
5240
|
+
return null;
|
|
5241
|
+
}
|
|
5242
|
+
function assigns(step) {
|
|
5243
|
+
const name = step.assigned.find((entry) => VARIABLES.includes(entry));
|
|
5244
|
+
if (name) return name;
|
|
5245
|
+
if (program(step.argv[0]) !== "export") return null;
|
|
5246
|
+
return VARIABLES.find(
|
|
5247
|
+
(variable) => step.argv.some((word) => word.split("=")[0] === variable)
|
|
5248
|
+
) ?? null;
|
|
5249
|
+
}
|
|
5250
|
+
function found(step) {
|
|
5251
|
+
const variable = assigns(step);
|
|
5252
|
+
if (variable) return `setting ${variable}`;
|
|
5253
|
+
const skips = step.assigned.includes("PMCP_HEAVY_DISABLE") && step.raw.includes(OPERATOR_SKIP) || program(step.argv[0]) === "export" && step.argv.includes(OPERATOR_SKIP);
|
|
5254
|
+
if (skips) return `the lease skip ${OPERATOR_SKIP}`;
|
|
5255
|
+
const words = pmcpWords(step.argv);
|
|
5256
|
+
return words ? verb(words) : null;
|
|
5257
|
+
}
|
|
5258
|
+
var operatorVerbs = {
|
|
5259
|
+
id: "pmcp.operator_verbs",
|
|
5260
|
+
events: ["before_tool"],
|
|
5261
|
+
tools: ["shell"],
|
|
5262
|
+
fail: "closed",
|
|
5263
|
+
defaultMode: "deny",
|
|
5264
|
+
options: noOptions,
|
|
5265
|
+
evaluate(input) {
|
|
5266
|
+
const call = shellCall(input);
|
|
5267
|
+
if (!call) return pass;
|
|
5268
|
+
for (const step of call.steps) {
|
|
5269
|
+
const what = found(step);
|
|
5270
|
+
if (what)
|
|
5271
|
+
return {
|
|
5272
|
+
verdict: "deny",
|
|
5273
|
+
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.`
|
|
5274
|
+
};
|
|
5275
|
+
}
|
|
5276
|
+
return pass;
|
|
5277
|
+
}
|
|
5278
|
+
};
|
|
5279
|
+
|
|
5208
5280
|
// src/hooks/policies/custom.ts
|
|
5209
5281
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
5210
5282
|
import { createHash as createHash5 } from "crypto";
|
|
@@ -5284,7 +5356,7 @@ function applies(entry, input) {
|
|
|
5284
5356
|
function readFindings(value) {
|
|
5285
5357
|
if (value === void 0) return [];
|
|
5286
5358
|
if (!Array.isArray(value)) return null;
|
|
5287
|
-
const
|
|
5359
|
+
const found2 = [];
|
|
5288
5360
|
for (const item of value) {
|
|
5289
5361
|
if (!item || typeof item !== "object" || Array.isArray(item)) return null;
|
|
5290
5362
|
const { path, line, message, ...rest } = item;
|
|
@@ -5293,13 +5365,13 @@ function readFindings(value) {
|
|
|
5293
5365
|
if (path !== void 0 && typeof path !== "string") return null;
|
|
5294
5366
|
if (line !== void 0 && (!Number.isSafeInteger(line) || line < 1))
|
|
5295
5367
|
return null;
|
|
5296
|
-
|
|
5368
|
+
found2.push({
|
|
5297
5369
|
message,
|
|
5298
5370
|
...path !== void 0 ? { path } : {},
|
|
5299
5371
|
...line !== void 0 ? { line } : {}
|
|
5300
5372
|
});
|
|
5301
5373
|
}
|
|
5302
|
-
return
|
|
5374
|
+
return found2;
|
|
5303
5375
|
}
|
|
5304
5376
|
function findingLine(finding) {
|
|
5305
5377
|
const where = finding.path ? `${finding.path}${finding.line ? `:${finding.line}` : ""}: ` : "";
|
|
@@ -5394,7 +5466,8 @@ var GUARDS = byId([
|
|
|
5394
5466
|
pushWithoutVerify,
|
|
5395
5467
|
forcedBranchMove,
|
|
5396
5468
|
gateBypassEnv,
|
|
5397
|
-
stageAll
|
|
5469
|
+
stageAll,
|
|
5470
|
+
operatorVerbs
|
|
5398
5471
|
]);
|
|
5399
5472
|
var FEATURES = byId([
|
|
5400
5473
|
registry,
|
|
@@ -5615,7 +5688,7 @@ function readCustom(root, hooks, guards) {
|
|
|
5615
5688
|
[guards["custom"], void 0]
|
|
5616
5689
|
];
|
|
5617
5690
|
const names4 = /* @__PURE__ */ new Set();
|
|
5618
|
-
const
|
|
5691
|
+
const found2 = [];
|
|
5619
5692
|
for (const [list2, implied] of sources) {
|
|
5620
5693
|
if (list2 === void 0) continue;
|
|
5621
5694
|
if (!Array.isArray(list2))
|
|
@@ -5625,10 +5698,10 @@ function readCustom(root, hooks, guards) {
|
|
|
5625
5698
|
if (names4.has(entry.name))
|
|
5626
5699
|
throw new Error("shell names must be unique lowercase names");
|
|
5627
5700
|
names4.add(entry.name);
|
|
5628
|
-
if (entry.mode !== "off")
|
|
5701
|
+
if (entry.mode !== "off") found2.push(entry);
|
|
5629
5702
|
}
|
|
5630
5703
|
}
|
|
5631
|
-
return
|
|
5704
|
+
return found2.sort((a, b) => compareIdentifiers(a.name, b.name));
|
|
5632
5705
|
}
|
|
5633
5706
|
|
|
5634
5707
|
// src/hooks/compile/guards.ts
|
|
@@ -5640,7 +5713,7 @@ var MODES2 = [
|
|
|
5640
5713
|
"off",
|
|
5641
5714
|
"graded"
|
|
5642
5715
|
];
|
|
5643
|
-
var GROUPS = ["shell", "git"];
|
|
5716
|
+
var GROUPS = ["shell", "git", "pmcp"];
|
|
5644
5717
|
function readGuard(id, raw) {
|
|
5645
5718
|
const policy = GUARDS[id];
|
|
5646
5719
|
if (!policy) throw new Error(`unknown guard hooks.guards.${id}`);
|
|
@@ -5668,7 +5741,7 @@ function readGuard(id, raw) {
|
|
|
5668
5741
|
return { id, mode, options: options2 };
|
|
5669
5742
|
}
|
|
5670
5743
|
function readGuards(guards) {
|
|
5671
|
-
const
|
|
5744
|
+
const found2 = [];
|
|
5672
5745
|
for (const [group, value] of Object.entries(guards)) {
|
|
5673
5746
|
if (group === "custom") continue;
|
|
5674
5747
|
if (!GROUPS.includes(group))
|
|
@@ -5677,10 +5750,10 @@ function readGuards(guards) {
|
|
|
5677
5750
|
asTable(value, `[hooks.guards.${group}]`)
|
|
5678
5751
|
)) {
|
|
5679
5752
|
const guard2 = readGuard(`${group}.${name}`, raw);
|
|
5680
|
-
if (guard2)
|
|
5753
|
+
if (guard2) found2.push(guard2);
|
|
5681
5754
|
}
|
|
5682
5755
|
}
|
|
5683
|
-
return
|
|
5756
|
+
return found2.sort((a, b) => compareIdentifiers(a.id, b.id));
|
|
5684
5757
|
}
|
|
5685
5758
|
|
|
5686
5759
|
// src/hooks/compile/checks.ts
|
|
@@ -5842,7 +5915,8 @@ var KEYS5 = [
|
|
|
5842
5915
|
"broadcast",
|
|
5843
5916
|
"leases",
|
|
5844
5917
|
"roles",
|
|
5845
|
-
"mailbox"
|
|
5918
|
+
"mailbox",
|
|
5919
|
+
"operator"
|
|
5846
5920
|
];
|
|
5847
5921
|
var MODES3 = ["deny", "ask", "warn", "off"];
|
|
5848
5922
|
function guard(id, options2, mode) {
|
|
@@ -6034,12 +6108,20 @@ function hostGuard(host, guards) {
|
|
|
6034
6108
|
if (shell["host_approval"] !== void 0) return null;
|
|
6035
6109
|
return { id: "shell.host_approval", mode: "deny", options: {} };
|
|
6036
6110
|
}
|
|
6111
|
+
function operatorGuard(declared, guards) {
|
|
6112
|
+
if (!declared) return null;
|
|
6113
|
+
const pmcp = asTable(guards["pmcp"], "[hooks.guards.pmcp]");
|
|
6114
|
+
if (pmcp["operator_verbs"] !== void 0) return null;
|
|
6115
|
+
return { id: "pmcp.operator_verbs", mode: "deny", options: {} };
|
|
6116
|
+
}
|
|
6037
6117
|
function compileHooks(tables, options2) {
|
|
6038
6118
|
const hooks = asTable(tables.hooks, "[hooks]");
|
|
6039
6119
|
const table3 = readHooksTable(hooks, options2.tools);
|
|
6040
6120
|
const guardsTable = asTable(hooks["guards"], "[hooks.guards]");
|
|
6041
6121
|
const entries = readCustom(options2.root, hooks, guardsTable);
|
|
6042
6122
|
const sessions = readSessions(tables.sessions, tables.git);
|
|
6123
|
+
readOperatorSettings(tables.sessions, options2.root);
|
|
6124
|
+
const operator = operatorGuard(sessions.declared, guardsTable);
|
|
6043
6125
|
const workspace = readWorkspace(tables.git, options2.root);
|
|
6044
6126
|
const deskSync = readWorktreeSync(tables, options2.root);
|
|
6045
6127
|
const directPush = readMainlineDeliver(tables, options2.root);
|
|
@@ -6063,6 +6145,7 @@ function compileHooks(tables, options2) {
|
|
|
6063
6145
|
...directPush ? [directPush] : [],
|
|
6064
6146
|
...host ? [host] : [],
|
|
6065
6147
|
...heavy ? [heavy] : [],
|
|
6148
|
+
...operator ? [operator] : [],
|
|
6066
6149
|
...readGuards(guardsTable),
|
|
6067
6150
|
...readChecks(hooks["checks"])
|
|
6068
6151
|
];
|
|
@@ -6367,4 +6450,4 @@ export {
|
|
|
6367
6450
|
checkBudget,
|
|
6368
6451
|
readSpec
|
|
6369
6452
|
};
|
|
6370
|
-
//# sourceMappingURL=chunk-
|
|
6453
|
+
//# sourceMappingURL=chunk-TOR6SKRB.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSkillServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5MUD7FHP.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-UQHJUTDW.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
JSON_VERBS,
|
|
3
3
|
SESSION_VERBS,
|
|
4
4
|
sessionsSpec
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-A4P3IIPE.js";
|
|
6
6
|
import "./chunk-JPYQDOEW.js";
|
|
7
7
|
import {
|
|
8
8
|
ArgumentError,
|
|
@@ -15,26 +15,26 @@ async function run(context) {
|
|
|
15
15
|
if (!SESSION_VERBS.includes(verb))
|
|
16
16
|
throw unknownSubcommand("sessions", verb, SESSION_VERBS);
|
|
17
17
|
if (verb === "status")
|
|
18
|
-
return (await import("./status-
|
|
18
|
+
return (await import("./status-2GDYLIR3.js")).status(context);
|
|
19
19
|
if (context.args.flags.has("json") && !JSON_VERBS.includes(verb))
|
|
20
20
|
throw new ArgumentError(`--json works with ${JSON_VERBS.join(", ")}`);
|
|
21
21
|
if (["send", "inbox", "ack", "reply"].includes(verb)) {
|
|
22
|
-
const mailbox = await import("./mailbox-
|
|
22
|
+
const mailbox = await import("./mailbox-MR6TPD3P.js");
|
|
23
23
|
if (verb === "send") return mailbox.send(context);
|
|
24
24
|
if (verb === "inbox") return mailbox.inbox(context);
|
|
25
25
|
if (verb === "ack") return mailbox.ack(context);
|
|
26
26
|
return mailbox.reply(context);
|
|
27
27
|
}
|
|
28
|
-
if (verb === "pause") return (await import("./pause-
|
|
29
|
-
if (verb === "resume") return (await import("./resume-
|
|
28
|
+
if (verb === "pause") return (await import("./pause-H6ZYZF7C.js")).run(context);
|
|
29
|
+
if (verb === "resume") return (await import("./resume-2BWGSTCN.js")).run(context);
|
|
30
30
|
if (verb === "broadcast")
|
|
31
|
-
return (await import("./broadcast-
|
|
31
|
+
return (await import("./broadcast-34CEG2NQ.js")).run(context);
|
|
32
32
|
if (verb === "unbroadcast")
|
|
33
|
-
return (await import("./unbroadcast-
|
|
34
|
-
return (await import("./sweep-
|
|
33
|
+
return (await import("./unbroadcast-HJHYUHZL.js")).run(context);
|
|
34
|
+
return (await import("./sweep-76BUOGEI.js")).run(context);
|
|
35
35
|
}
|
|
36
36
|
var sessionsCommand = { ...sessionsSpec, run };
|
|
37
37
|
export {
|
|
38
38
|
sessionsCommand
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=cli-
|
|
40
|
+
//# sourceMappingURL=cli-5G2OYTIL.js.map
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
async function action(positional) {
|
|
13
13
|
const [verb, sub] = positional;
|
|
14
14
|
if (verb === "deliver")
|
|
15
|
-
return (await import("./mainline-
|
|
16
|
-
if (verb === "sync") return (await import("./mainline-
|
|
15
|
+
return (await import("./mainline-MSLW3UFD.js")).mainlineDeliver;
|
|
16
|
+
if (verb === "sync") return (await import("./mainline-MSLW3UFD.js")).mainlineSync;
|
|
17
17
|
if (verb !== "worktree")
|
|
18
18
|
throw unknownSubcommand("git", verb, [
|
|
19
19
|
"worktree",
|
|
@@ -24,7 +24,7 @@ async function action(positional) {
|
|
|
24
24
|
if (sub === "create")
|
|
25
25
|
return (await import("./worktree-create-ZQRN5JBD.js")).worktreeCreate;
|
|
26
26
|
if (sub === "list")
|
|
27
|
-
return (await import("./worktree-list-
|
|
27
|
+
return (await import("./worktree-list-WZC75NLF.js")).worktreeList;
|
|
28
28
|
if (sub === "sync")
|
|
29
29
|
return (await import("./worktree-sync-MUVKK2CV.js")).worktreeSync;
|
|
30
30
|
throw unknownSubcommand("git worktree", sub, ["create", "list", "sync"]);
|
|
@@ -57,4 +57,4 @@ var gitCommand = { ...gitSpec, run };
|
|
|
57
57
|
export {
|
|
58
58
|
gitCommand
|
|
59
59
|
};
|
|
60
|
-
//# sourceMappingURL=cli-
|
|
60
|
+
//# sourceMappingURL=cli-QDQYUHAP.js.map
|
package/dist/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
COMMANDS,
|
|
4
4
|
PLANNED,
|
|
5
5
|
commandNamed
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RF6RDJYH.js";
|
|
7
7
|
import {
|
|
8
8
|
entryMode
|
|
9
9
|
} from "./chunk-LMT3PPXJ.js";
|
|
@@ -12,9 +12,9 @@ import "./chunk-JANBBPKP.js";
|
|
|
12
12
|
import "./chunk-UVTGY2R3.js";
|
|
13
13
|
import "./chunk-2HL2MFNI.js";
|
|
14
14
|
import "./chunk-4VVQLWTS.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-NAHAESFV.js";
|
|
16
16
|
import "./chunk-F3R5HEUB.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-A4P3IIPE.js";
|
|
18
18
|
import "./chunk-WZYGM3FR.js";
|
|
19
19
|
import "./chunk-WBPVNCQO.js";
|
|
20
20
|
import "./chunk-HF5D6B2U.js";
|
|
@@ -41,7 +41,16 @@ import {
|
|
|
41
41
|
} from "./chunk-Y6NFETNG.js";
|
|
42
42
|
import {
|
|
43
43
|
VERSION
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-SMBU3QLE.js";
|
|
45
|
+
|
|
46
|
+
// src/cli/pipe.ts
|
|
47
|
+
function endQuietlyOnClosedPipe(streams, exit = (code) => process.exit(code)) {
|
|
48
|
+
for (const stream of streams)
|
|
49
|
+
stream.on("error", (error) => {
|
|
50
|
+
if (error.code === "EPIPE") return exit(0);
|
|
51
|
+
throw error;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
45
54
|
|
|
46
55
|
// src/cli/envelope.ts
|
|
47
56
|
var CODE_NAMES = {
|
|
@@ -102,6 +111,17 @@ function wrap(text, width, indent) {
|
|
|
102
111
|
lines.push(current);
|
|
103
112
|
return lines;
|
|
104
113
|
}
|
|
114
|
+
function fitRecord(record, width, ellipsis = "\u2026") {
|
|
115
|
+
const line = record.replaceAll(" ", " ");
|
|
116
|
+
if (line.length <= width) return [line];
|
|
117
|
+
const lead = line.length - line.trimStart().length;
|
|
118
|
+
const hang = Math.min(lead + 4, Math.floor(width / 2));
|
|
119
|
+
const room = width - hang;
|
|
120
|
+
return wrap(line.trimStart(), room, 0).map((part, at) => {
|
|
121
|
+
const cut = part.length <= room ? part : `${part.slice(0, Math.max(0, room - ellipsis.length))}${ellipsis}`;
|
|
122
|
+
return `${" ".repeat(at === 0 ? lead : hang)}${cut}`;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
105
125
|
var ESC = String.fromCharCode(27);
|
|
106
126
|
var CODES = {
|
|
107
127
|
reset: `${ESC}[0m`,
|
|
@@ -296,6 +316,18 @@ var Ui = class _Ui {
|
|
|
296
316
|
this.line(`${pad}${this.paint(line, "dim")}`);
|
|
297
317
|
}
|
|
298
318
|
}
|
|
319
|
+
// Status records on stdout: fitted to a terminal's width, one whole line each elsewhere so
|
|
320
|
+
// grep and cut see whole records.
|
|
321
|
+
records(lines) {
|
|
322
|
+
const width = this.out.isTTY === true ? this.width("table") : void 0;
|
|
323
|
+
const ellipsis = this.ascii ? "..." : "\u2026";
|
|
324
|
+
for (const record of lines) {
|
|
325
|
+
const line = this.text(record);
|
|
326
|
+
const parts = width === void 0 ? [line] : fitRecord(line, width, ellipsis);
|
|
327
|
+
this.data(`${parts.join("\n")}
|
|
328
|
+
`);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
299
331
|
heading(text) {
|
|
300
332
|
this.wrapped(text, "", "bold");
|
|
301
333
|
}
|
|
@@ -417,7 +449,7 @@ async function defaultEntry(options, context) {
|
|
|
417
449
|
});
|
|
418
450
|
if (mode === "server") return run(required("serve"), [], context);
|
|
419
451
|
if (mode === "terminal") {
|
|
420
|
-
const { terminalSupport } = await import("./host-
|
|
452
|
+
const { terminalSupport } = await import("./host-4GJDGTLW.js");
|
|
421
453
|
const support = terminalSupport();
|
|
422
454
|
if (support.supported) return run(required("tui"), [], context);
|
|
423
455
|
context.ui.info(`Terminal workspace unavailable: ${support.reason}`);
|
|
@@ -481,5 +513,6 @@ function schemaWords(command, words) {
|
|
|
481
513
|
}
|
|
482
514
|
|
|
483
515
|
// src/cli.ts
|
|
516
|
+
endQuietlyOnClosedPipe([process.stdout, process.stderr]);
|
|
484
517
|
process.exitCode = await dispatch(process.argv.slice(2));
|
|
485
518
|
//# sourceMappingURL=cli.js.map
|