@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
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 found = [
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 found;
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
- found.push({ path: dirname(dotGit), branch: branchOf(admin) });
272
+ found2.push({ path: dirname(dotGit), branch: branchOf(admin) });
273
273
  } catch {
274
274
  }
275
275
  }
276
- return found;
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 found = [];
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
- found.push(inner.list);
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(...found);
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 found = describe(token);
833
+ const found2 = describe(token);
834
834
  throw new ShellSyntaxError(
835
- expected ? `expected ${expected}, found ${found}` : `unexpected ${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 assigns = [];
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 (assigns.length > 0) redirectedAfterAssign = true;
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
- assigns.push(token.word);
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 && assigns.length === 0 && redirects.length === 0 && after.kind === "op" && after.op === "(") {
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 (assigns.length + words.length + redirects.length === 0)
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, assigns, exporting) {
1279
- for (const word of assigns) {
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((verb) => ["docker", verb]),
1481
- ...[...WRANGLER_MUTATING].map((verb) => ["wrangler", verb])
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
- log.debug("policy", {
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: verb, rest } = firstArgument(args, GLOBAL_VALUE_FLAGS);
2898
- if (verb === "down") {
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 (!verb || !SCOPED_VERBS.has(verb)) return null;
2902
- if (firstArgument(rest, VERB_VALUE_FLAGS[verb]).value) return null;
2903
- return `docker compose ${verb} with no service named applies to every service in the project. Name the service you mean.`;
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((verb) => {
3359
+ return entry.verbs.some((verb2) => {
3359
3360
  let from = 0;
3360
- for (const part of verb) {
3361
- const found = args.indexOf(part, from);
3362
- if (found < 0) return false;
3363
- from = found + 1;
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((verb) => verb.split(/\s+/u));
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 found = severity(call.steps, ctx.options);
3456
- if (found === "exfil") {
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 (found === "read") {
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 found = false;
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
- found = true;
3973
+ found2 = true;
3973
3974
  hash.update(`${path}\0`).update(readFileSync(file2));
3974
3975
  }
3975
- if (!found) return null;
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 found = [];
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
- found.push({
4609
+ found2.push({
4540
4610
  message,
4541
4611
  ...path !== void 0 ? { path } : {},
4542
4612
  ...line !== void 0 ? { line } : {}
4543
4613
  });
4544
4614
  }
4545
- return found;
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 found = /* @__PURE__ */ new Map();
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
- found.set(name, [
6964
- ...found.get(name) ?? [],
7034
+ found2.set(name, [
7035
+ ...found2.get(name) ?? [],
6965
7036
  asRecord(readJson3(join25(folder, name)))
6966
7037
  ]);
6967
7038
  }
6968
- return [...found.values()].map(latestRecord).filter((record) => record !== null).map((record) => ({ ...record, live: isLive(record, now, staleMs) }));
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-HXG6EB7V.js")).run(context);
17
- if (verb === "test") return (await import("./test-H243OTSK.js")).run(context);
18
- return (await import("./report-UB7MXAUB.js")).run(context);
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-L4PXVEGR.js.map
24
+ //# sourceMappingURL=hooks-VAEAK2FY.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  requireTerminal,
3
3
  terminalSupport
4
- } from "./chunk-D2MHB5EF.js";
4
+ } from "./chunk-PECS47OL.js";
5
5
  import "./chunk-5ZABTVSW.js";
6
- import "./chunk-62BC3K4Z.js";
6
+ import "./chunk-PGZZI42O.js";
7
7
  import "./chunk-LMT3PPXJ.js";
8
- import "./chunk-LI3BII4F.js";
8
+ import "./chunk-ISWR2XIU.js";
9
9
  import "./chunk-R2GPCZUX.js";
10
10
  import "./chunk-34DECPVC.js";
11
- import "./chunk-7A6QIROT.js";
12
- import "./chunk-QY2P54Z2.js";
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-LTMHE5VL.js";
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-MU2GRH57.js.map
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-UFWW4H6V.js";
7
+ } from "./chunk-BG6TONJO.js";
8
8
  import "./chunk-7CHUMF3E.js";
9
9
  import {
10
10
  approvalDir,
@@ -12,24 +12,25 @@ import {
12
12
  hostDigest,
13
13
  projectedFiles,
14
14
  writeApproval
15
- } from "./chunk-S6G7YWNE.js";
16
- import "./chunk-25M2YWBH.js";
17
- import "./chunk-UYBWUOLR.js";
15
+ } from "./chunk-QYHM6554.js";
16
+ import "./chunk-TOR6SKRB.js";
17
+ import "./chunk-VYQJPT27.js";
18
18
  import "./chunk-UKR64U7J.js";
19
- import "./chunk-42SO7KYX.js";
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";
25
- import "./chunk-M6X6HVQK.js";
26
- import "./chunk-RZYZILU4.js";
27
- import "./chunk-SUDG7B6S.js";
28
+ import "./chunk-VQBXWMLT.js";
29
+ import "./chunk-EWYLWBKS.js";
30
+ import "./chunk-SDFJJJB5.js";
28
31
  import "./chunk-3V37OZQH.js";
29
- import {
30
- ancestors
31
- } from "./chunk-Z6WRFOFT.js";
32
- import "./chunk-B3OZ4GGO.js";
32
+ import "./chunk-Z6WRFOFT.js";
33
+ import "./chunk-23PE3HZB.js";
33
34
  import "./chunk-Q5H3L6Y4.js";
34
35
  import "./chunk-ARXCYFFZ.js";
35
36
  import "./chunk-V4NPDK6X.js";
@@ -39,8 +40,8 @@ import {
39
40
  } from "./chunk-Y6NFETNG.js";
40
41
  import {
41
42
  hostDoctor
42
- } from "./chunk-7A6QIROT.js";
43
- import "./chunk-QY2P54Z2.js";
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-LTMHE5VL.js";
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-IRSAQA5Z.js");
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-LBTL47X7.js.map
174
+ //# sourceMappingURL=host-I2EMQ7UE.js.map
@@ -5,15 +5,15 @@ import {
5
5
  import {
6
6
  approvalDir,
7
7
  approvalState
8
- } from "./chunk-S6G7YWNE.js";
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-7A6QIROT.js";
16
- import "./chunk-QY2P54Z2.js";
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-LTMHE5VL.js";
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-IRSAQA5Z.js.map
336
+ //# sourceMappingURL=host-run-DDMKD3BU.js.map
package/dist/http.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-ISZOLR3D.js";
5
5
  import {
6
6
  createSkillServer
7
- } from "./chunk-5QBOGEVE.js";
7
+ } from "./chunk-5MUD7FHP.js";
8
8
  import "./chunk-6WXMJOMI.js";
9
9
  import {
10
10
  readCatalog
@@ -6,21 +6,22 @@ import {
6
6
  } from "./chunk-ANJMLKBR.js";
7
7
  import {
8
8
  readMcp
9
- } from "./chunk-25M2YWBH.js";
10
- import "./chunk-UYBWUOLR.js";
9
+ } from "./chunk-TOR6SKRB.js";
10
+ import "./chunk-VYQJPT27.js";
11
11
  import "./chunk-UKR64U7J.js";
12
- import "./chunk-42SO7KYX.js";
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";
18
- import "./chunk-M6X6HVQK.js";
19
- import "./chunk-RZYZILU4.js";
20
- import "./chunk-SUDG7B6S.js";
19
+ import "./chunk-VQBXWMLT.js";
20
+ import "./chunk-EWYLWBKS.js";
21
+ import "./chunk-SDFJJJB5.js";
21
22
  import "./chunk-3V37OZQH.js";
22
23
  import "./chunk-Z6WRFOFT.js";
23
- import "./chunk-B3OZ4GGO.js";
24
+ import "./chunk-23PE3HZB.js";
24
25
  import "./chunk-Q5H3L6Y4.js";
25
26
  import "./chunk-ARXCYFFZ.js";
26
27
  import {
@@ -30,8 +31,8 @@ import {
30
31
  ArgumentError,
31
32
  many
32
33
  } from "./chunk-Y6NFETNG.js";
33
- import "./chunk-7A6QIROT.js";
34
- import "./chunk-QY2P54Z2.js";
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-LTMHE5VL.js";
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-QVPW6A2Q.js.map
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.24.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;