@modootoday/pmcp 0.24.0 → 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.
Files changed (105) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.mcp.json +1 -1
  5. package/dist/{affected-D6FRJPPI.js → affected-IPFJM2KD.js} +484 -140
  6. package/dist/{apply-6JVJ7FDZ.js → apply-6XLLYLJT.js} +15 -14
  7. package/dist/{broadcast-VKZY7WSD.js → broadcast-34CEG2NQ.js} +5 -2
  8. package/dist/{chunk-B3OZ4GGO.js → chunk-23PE3HZB.js} +16 -1
  9. package/dist/{chunk-42SO7KYX.js → chunk-2GD7PQ7J.js} +2 -2
  10. package/dist/{chunk-7A6QIROT.js → chunk-2TXVOHRS.js} +3 -3
  11. package/dist/{chunk-QR4GXET7.js → chunk-3P6Y2BAO.js} +3 -3
  12. package/dist/{chunk-5QBOGEVE.js → chunk-5MUD7FHP.js} +2 -2
  13. package/dist/{chunk-2GZKA33O.js → chunk-A4P3IIPE.js} +2 -2
  14. package/dist/{chunk-UFWW4H6V.js → chunk-BG6TONJO.js} +2 -2
  15. package/dist/{chunk-HES44LTA.js → chunk-C3KRMTIZ.js} +28 -4
  16. package/dist/{chunk-QY2P54Z2.js → chunk-DITIXBFB.js} +61 -8
  17. package/dist/{chunk-6UGHVU5B.js → chunk-DWHM5BAY.js} +2 -2
  18. package/dist/{chunk-TIH7JFPJ.js → chunk-EC5QLEZD.js} +2 -2
  19. package/dist/{chunk-RZYZILU4.js → chunk-EWYLWBKS.js} +2 -2
  20. package/dist/{chunk-LI3BII4F.js → chunk-ISWR2XIU.js} +2 -2
  21. package/dist/{chunk-WNP2BXR7.js → chunk-LZVHFPN6.js} +5 -5
  22. package/dist/{chunk-K6ATERWS.js → chunk-MBHI2TKQ.js} +4 -4
  23. package/dist/{chunk-43MXRTKH.js → chunk-NAHAESFV.js} +9 -4
  24. package/dist/chunk-NQCAKDRY.js +156 -0
  25. package/dist/chunk-OIKT4SYO.js +42 -0
  26. package/dist/{chunk-D2MHB5EF.js → chunk-PECS47OL.js} +3 -3
  27. package/dist/{chunk-62BC3K4Z.js → chunk-PGZZI42O.js} +2 -2
  28. package/dist/{chunk-S6G7YWNE.js → chunk-QYHM6554.js} +2 -2
  29. package/dist/{chunk-2W2F5BWF.js → chunk-RF6RDJYH.js} +16 -16
  30. package/dist/{chunk-SUDG7B6S.js → chunk-SDFJJJB5.js} +2 -2
  31. package/dist/chunk-SMBU3QLE.js +7 -0
  32. package/dist/{chunk-644GNYMB.js → chunk-SRSKCFFS.js} +3 -3
  33. package/dist/{chunk-LB2WXBPA.js → chunk-SSQ6EWNA.js} +5 -5
  34. package/dist/{chunk-56VBB3H7.js → chunk-TJW4DP26.js} +2 -2
  35. package/dist/{chunk-25M2YWBH.js → chunk-TOR6SKRB.js} +146 -63
  36. package/dist/{chunk-ISGHJHVH.js → chunk-UQHJUTDW.js} +2 -2
  37. package/dist/{chunk-M6X6HVQK.js → chunk-VQBXWMLT.js} +2 -2
  38. package/dist/{chunk-UYBWUOLR.js → chunk-VYQJPT27.js} +4 -4
  39. package/dist/{cli-GFDT4YXM.js → cli-5G2OYTIL.js} +9 -9
  40. package/dist/{cli-WWNTQJPV.js → cli-QDQYUHAP.js} +9 -9
  41. package/dist/cli.js +38 -5
  42. package/dist/{completion-I63UIDZ7.js → completion-3GVNPLZY.js} +4 -4
  43. package/dist/{diagnostics-RUJZBPNZ.js → diagnostics-2W7QDQNG.js} +6 -6
  44. package/dist/{doctor-CLUFTEFO.js → doctor-3TDO5LJ5.js} +17 -16
  45. package/dist/{entry-QSJCFI5Z.js → entry-E62DZQJF.js} +10 -10
  46. package/dist/{exec-mcp-AFPUJTN7.js → exec-mcp-4N7FLY52.js} +13 -12
  47. package/dist/{harness-PPM32AI5.js → harness-E2AUZDLV.js} +3 -3
  48. package/dist/harness-launch-gate.js +4 -4
  49. package/dist/harness-worker.js +6 -6
  50. package/dist/{heavy-TEHP5PHT.js → heavy-HZQVFI6P.js} +182 -52
  51. package/dist/hook-body.js +116 -45
  52. package/dist/{hooks-L4PXVEGR.js → hooks-VAEAK2FY.js} +4 -4
  53. package/dist/{host-MU2GRH57.js → host-4GJDGTLW.js} +7 -7
  54. package/dist/{host-LBTL47X7.js → host-I2EMQ7UE.js} +18 -65
  55. package/dist/{host-run-IRSAQA5Z.js → host-run-DDMKD3BU.js} +5 -5
  56. package/dist/http.js +1 -1
  57. package/dist/{import-mcp-QVPW6A2Q.js → import-mcp-TNSAMJXI.js} +12 -11
  58. package/dist/index.d.ts +1 -1
  59. package/dist/index.js +16 -15
  60. package/dist/{init-46STH6FP.js → init-UA7MDNTZ.js} +2 -2
  61. package/dist/{invoke-I6C6UT6Q.js → invoke-HW7NBPGP.js} +8 -8
  62. package/dist/{list-HXG6EB7V.js → list-A7VQJXE5.js} +14 -13
  63. package/dist/{logout-SSUXJ6SE.js → logout-HNPLUKJY.js} +13 -12
  64. package/dist/{mailbox-5FVFMQ2J.js → mailbox-MR6TPD3P.js} +20 -6
  65. package/dist/{mainline-4XP6ZORU.js → mainline-MSLW3UFD.js} +14 -8
  66. package/dist/{mcp-L6X45IOS.js → mcp-6C23GX2E.js} +2 -2
  67. package/dist/{modes-SEINLLMK.js → modes-7OY7R73T.js} +3 -3
  68. package/dist/{pause-CMZOIHTJ.js → pause-H6ZYZF7C.js} +5 -2
  69. package/dist/{project-4JPKU2D7.js → project-BX6NCGKB.js} +4 -4
  70. package/dist/{report-UB7MXAUB.js → report-43SFNNCF.js} +2 -2
  71. package/dist/{resume-PAKIT4TT.js → resume-2BWGSTCN.js} +5 -2
  72. package/dist/{run-PMASXIGY.js → run-2UVAWBAF.js} +12 -11
  73. package/dist/{run-OW7436TY.js → run-7TRWZFEZ.js} +4 -4
  74. package/dist/{serve-P3HJN6AF.js → serve-4XZ5SKJJ.js} +3 -3
  75. package/dist/{setup-6AQUOWOH.js → setup-GRWLDBVB.js} +4 -4
  76. package/dist/{start-login-P7YDRTA3.js → start-login-AR7ITWNV.js} +13 -12
  77. package/dist/{status-4PYPTYUB.js → status-2GDYLIR3.js} +6 -3
  78. package/dist/{status-DAXQKT35.js → status-VQCMJFVE.js} +31 -28
  79. package/dist/{status-DLGZDYEP.js → status-ZY6LDQSF.js} +13 -12
  80. package/dist/stdio.js +2 -2
  81. package/dist/{sweep-VURZU6DI.js → sweep-76BUOGEI.js} +5 -2
  82. package/dist/{test-H243OTSK.js → test-VWGNFSH5.js} +15 -13
  83. package/dist/{tui-P6XTSTQO.js → tui-TUMOQBE7.js} +4 -4
  84. package/dist/{unbroadcast-7AMLURCG.js → unbroadcast-HJHYUHZL.js} +5 -2
  85. package/dist/{worker-5YJLIGTU.js → worker-NEEPJRVV.js} +8 -8
  86. package/dist/{worktree-create-FTSLMZWS.js → worktree-create-ZQRN5JBD.js} +2 -2
  87. package/dist/{worktree-list-WH6OX6U7.js → worktree-list-WZC75NLF.js} +11 -12
  88. package/dist/{worktree-sync-DGNHSQ64.js → worktree-sync-MUVKK2CV.js} +5 -5
  89. package/docs/commands.md +9 -7
  90. package/docs/git-workflow.md +7 -1
  91. package/docs/glossary.md +1 -1
  92. package/docs/hooks.md +20 -16
  93. package/docs/project-configuration.md +76 -37
  94. package/docs/sessions.md +9 -2
  95. package/docs/upgrading.md +58 -0
  96. package/gemini-extension.json +2 -2
  97. package/mcp.json +1 -1
  98. package/package.json +5 -5
  99. package/plugin.json +1 -1
  100. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  101. package/plugins/pmcp/.mcp.json +1 -1
  102. package/plugins/pmcp/gemini-extension.json +2 -2
  103. package/plugins/pmcp/mcp.json +1 -1
  104. package/plugins/pmcp/plugin.json +1 -1
  105. package/dist/chunk-LTMHE5VL.js +0 -7
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  syncWorktree
3
- } from "./chunk-UYBWUOLR.js";
3
+ } from "./chunk-VYQJPT27.js";
4
4
  import {
5
5
  globPattern
6
6
  } from "./chunk-UKR64U7J.js";
@@ -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";
@@ -24,14 +27,14 @@ import {
24
27
  } from "./chunk-73AKO4UL.js";
25
28
  import {
26
29
  withUmask
27
- } from "./chunk-M6X6HVQK.js";
30
+ } from "./chunk-VQBXWMLT.js";
28
31
  import {
29
32
  leaseSpecs,
30
33
  readGitConfig
31
- } from "./chunk-RZYZILU4.js";
34
+ } from "./chunk-EWYLWBKS.js";
32
35
  import {
33
36
  detect
34
- } from "./chunk-SUDG7B6S.js";
37
+ } from "./chunk-SDFJJJB5.js";
35
38
  import {
36
39
  inboxKey,
37
40
  noticeOf,
@@ -43,7 +46,7 @@ import {
43
46
  } from "./chunk-Z6WRFOFT.js";
44
47
  import {
45
48
  gitText
46
- } from "./chunk-B3OZ4GGO.js";
49
+ } from "./chunk-23PE3HZB.js";
47
50
  import {
48
51
  safeEndpoint
49
52
  } from "./chunk-Q5H3L6Y4.js";
@@ -69,11 +72,11 @@ import {
69
72
  readHost,
70
73
  readLock,
71
74
  readLockFile
72
- } from "./chunk-7A6QIROT.js";
75
+ } from "./chunk-2TXVOHRS.js";
73
76
  import {
74
77
  DISABLE_ENV,
75
78
  readLeaseSettings
76
- } from "./chunk-QY2P54Z2.js";
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 found = [];
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
- found.push(
1166
+ found2.push(
1164
1167
  `overlap: ${SETTINGS}#permissions.${other} has unmanaged ${rule}, declared in ${bucket}`
1165
1168
  );
1166
1169
  }
1167
1170
  }
1168
- return found;
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 found = count(rules2, rule);
1181
- if (found === 0 && current.present && current.problem === void 0)
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 (found > 1)
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 found = tracked.filter((file) => pattern.test(file));
1724
+ const found2 = tracked.filter((file) => pattern.test(file));
1722
1725
  rows.push({
1723
1726
  key: "forbid_paths",
1724
1727
  subject: glob,
1725
- value: found.length,
1728
+ value: found2.length,
1726
1729
  limit: 0
1727
1730
  });
1728
- for (const file of found)
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 found = packagedBinary(command, from);
1898
- return "path" in found ? found.path : command;
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 found = packagedBinary(name, from);
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 found ? found.reason : "unknown"}; runs ${name} from PATH`
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 found && found.path === command ? `resolved to ${command} (platform package)` : `explicit command kept: ${command}`
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 found = [];
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
- found.push(inner.list);
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(...found);
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 found = describe(token);
2571
+ const found2 = describe(token);
2569
2572
  throw new ShellSyntaxError(
2570
- expected ? `expected ${expected}, found ${found}` : `unexpected ${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 assigns = [];
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 (assigns.length > 0) redirectedAfterAssign = true;
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
- assigns.push(token.word);
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 && assigns.length === 0 && redirects.length === 0 && after.kind === "op" && after.op === "(") {
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 (assigns.length + words.length + redirects.length === 0)
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, assigns, exporting) {
3014
- for (const word of assigns) {
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((verb) => ["docker", verb]),
3216
- ...[...WRANGLER_MUTATING].map((verb) => ["wrangler", verb])
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: verb, rest } = firstArgument(args, GLOBAL_VALUE_FLAGS);
4182
- if (verb === "down") {
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 (!verb || !SCOPED_VERBS.has(verb)) return null;
4186
- if (firstArgument(rest, VERB_VALUE_FLAGS[verb]).value) return null;
4187
- return `docker compose ${verb} with no service named applies to every service in the project. Name the service you mean.`;
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((verb) => {
4645
+ return entry.verbs.some((verb2) => {
4643
4646
  let from = 0;
4644
- for (const part of verb) {
4645
- const found = args.indexOf(part, from);
4646
- if (found < 0) return false;
4647
- from = found + 1;
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((verb) => verb.split(/\s+/u));
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 found = severity(call.steps, ctx.options);
4740
- if (found === "exfil") {
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 (found === "read") {
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 found = [];
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
- found.push({
5368
+ found2.push({
5297
5369
  message,
5298
5370
  ...path !== void 0 ? { path } : {},
5299
5371
  ...line !== void 0 ? { line } : {}
5300
5372
  });
5301
5373
  }
5302
- return found;
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 found = [];
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") found.push(entry);
5701
+ if (entry.mode !== "off") found2.push(entry);
5629
5702
  }
5630
5703
  }
5631
- return found.sort((a, b) => compareIdentifiers(a.name, b.name));
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 found = [];
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) found.push(guard2);
5753
+ if (guard2) found2.push(guard2);
5681
5754
  }
5682
5755
  }
5683
- return found.sort((a, b) => compareIdentifiers(a.id, b.id));
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-25M2YWBH.js.map
6453
+ //# sourceMappingURL=chunk-TOR6SKRB.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSkillServer
3
- } from "./chunk-5QBOGEVE.js";
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-ISGHJHVH.js.map
87
+ //# sourceMappingURL=chunk-UQHJUTDW.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  gitText
3
- } from "./chunk-B3OZ4GGO.js";
3
+ } from "./chunk-23PE3HZB.js";
4
4
 
5
5
  // src/git/modes.ts
6
6
  import { chmodSync, lstatSync } from "fs";
@@ -92,4 +92,4 @@ export {
92
92
  restoreSubmoduleModes,
93
93
  reportModes
94
94
  };
95
- //# sourceMappingURL=chunk-M6X6HVQK.js.map
95
+ //# sourceMappingURL=chunk-VQBXWMLT.js.map
@@ -2,20 +2,20 @@ import {
2
2
  GitReadError,
3
3
  cherry,
4
4
  distance
5
- } from "./chunk-42SO7KYX.js";
5
+ } from "./chunk-2GD7PQ7J.js";
6
6
  import {
7
7
  reportModes,
8
8
  restoreModes,
9
9
  restoreSubmoduleModes,
10
10
  withUmask
11
- } from "./chunk-M6X6HVQK.js";
11
+ } from "./chunk-VQBXWMLT.js";
12
12
  import {
13
13
  git,
14
14
  gitOk,
15
15
  gitText,
16
16
  gitWithInput,
17
17
  runCommand
18
- } from "./chunk-B3OZ4GGO.js";
18
+ } from "./chunk-23PE3HZB.js";
19
19
 
20
20
  // src/git/install.ts
21
21
  import { createHash } from "crypto";
@@ -388,4 +388,4 @@ export {
388
388
  followPins,
389
389
  syncWorktree
390
390
  };
391
- //# sourceMappingURL=chunk-UYBWUOLR.js.map
391
+ //# sourceMappingURL=chunk-VYQJPT27.js.map
@@ -2,7 +2,7 @@ import {
2
2
  JSON_VERBS,
3
3
  SESSION_VERBS,
4
4
  sessionsSpec
5
- } from "./chunk-2GZKA33O.js";
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-4PYPTYUB.js")).status(context);
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-5FVFMQ2J.js");
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-CMZOIHTJ.js")).run(context);
29
- if (verb === "resume") return (await import("./resume-PAKIT4TT.js")).run(context);
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-VKZY7WSD.js")).run(context);
31
+ return (await import("./broadcast-34CEG2NQ.js")).run(context);
32
32
  if (verb === "unbroadcast")
33
- return (await import("./unbroadcast-7AMLURCG.js")).run(context);
34
- return (await import("./sweep-VURZU6DI.js")).run(context);
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-GFDT4YXM.js.map
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-4XP6ZORU.js")).mainlineDeliver;
16
- if (verb === "sync") return (await import("./mainline-4XP6ZORU.js")).mainlineSync;
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",
@@ -22,17 +22,17 @@ async function action(positional) {
22
22
  "affected"
23
23
  ]);
24
24
  if (sub === "create")
25
- return (await import("./worktree-create-FTSLMZWS.js")).worktreeCreate;
25
+ return (await import("./worktree-create-ZQRN5JBD.js")).worktreeCreate;
26
26
  if (sub === "list")
27
- return (await import("./worktree-list-WH6OX6U7.js")).worktreeList;
27
+ return (await import("./worktree-list-WZC75NLF.js")).worktreeList;
28
28
  if (sub === "sync")
29
- return (await import("./worktree-sync-DGNHSQ64.js")).worktreeSync;
29
+ return (await import("./worktree-sync-MUVKK2CV.js")).worktreeSync;
30
30
  throw unknownSubcommand("git worktree", sub, ["create", "list", "sync"]);
31
31
  }
32
32
  async function run(context) {
33
33
  const [verb, sub] = context.args.positional;
34
34
  if (verb === "affected")
35
- return (await import("./affected-D6FRJPPI.js")).gitAffected(context);
35
+ return (await import("./affected-IPFJM2KD.js")).gitAffected(context);
36
36
  if (context.args.flags.has("tests-only") || context.args.options.has("head"))
37
37
  throw new ArgumentError("--tests-only and --head require git affected");
38
38
  if (context.args.flags.has("json") && !(verb === "worktree" && sub === "list") && verb !== "deliver")
@@ -40,7 +40,7 @@ async function run(context) {
40
40
  "--json requires git worktree list, git deliver or git affected"
41
41
  );
42
42
  const act = await action(context.args.positional);
43
- const { loadGit } = await import("./setup-6AQUOWOH.js");
43
+ const { loadGit } = await import("./setup-GRWLDBVB.js");
44
44
  const setup = loadGit(context.cwd, one(context.args, "config"), context.env);
45
45
  if (setup instanceof Error) {
46
46
  context.ui.error(setup.message);
@@ -50,11 +50,11 @@ async function run(context) {
50
50
  info: (line) => context.ui.info(line),
51
51
  warn: (line) => context.ui.warn(line)
52
52
  };
53
- const { withUmask } = await import("./modes-SEINLLMK.js");
53
+ const { withUmask } = await import("./modes-7OY7R73T.js");
54
54
  return withUmask(setup.config.umask, () => act(setup, context, report));
55
55
  }
56
56
  var gitCommand = { ...gitSpec, run };
57
57
  export {
58
58
  gitCommand
59
59
  };
60
- //# sourceMappingURL=cli-WWNTQJPV.js.map
60
+ //# sourceMappingURL=cli-QDQYUHAP.js.map