@modootoday/pmcp 0.22.3 → 0.22.4

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 (75) 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/{apply-CYVC5LDG.js → apply-D2VIRMFY.js} +9 -9
  6. package/dist/{chunk-XZ2TDH3J.js → chunk-2A3F7ID4.js} +14 -5
  7. package/dist/{chunk-7LUYI7QM.js → chunk-3IX5TBRW.js} +2 -2
  8. package/dist/{chunk-V7LZTVWS.js → chunk-5KA3RS5Y.js} +2 -2
  9. package/dist/{chunk-ESCOMAPX.js → chunk-7XK2KWLJ.js} +3 -3
  10. package/dist/{chunk-WPX4ONFT.js → chunk-CPFJ7J4G.js} +5 -5
  11. package/dist/{chunk-ULFV3EIZ.js → chunk-F34XIDXT.js} +2 -2
  12. package/dist/{chunk-MLGXDSHZ.js → chunk-FFCDSSKA.js} +120 -33
  13. package/dist/{chunk-UQNRGU3V.js → chunk-H45C5W2P.js} +2 -2
  14. package/dist/chunk-HOTGJQIV.js +7 -0
  15. package/dist/{chunk-JUG4W7RF.js → chunk-JJT5XRMV.js} +2 -2
  16. package/dist/{chunk-ICZH4NFR.js → chunk-JONJ75SF.js} +5 -5
  17. package/dist/{chunk-NQFULJZC.js → chunk-KR6PFEWU.js} +3 -3
  18. package/dist/{chunk-MZF7VOQA.js → chunk-MIIGZRVC.js} +2 -2
  19. package/dist/{chunk-ONYZIC2F.js → chunk-MTVRKWQI.js} +3 -3
  20. package/dist/{chunk-CALWIRAI.js → chunk-NDY3T7Z4.js} +12 -12
  21. package/dist/{chunk-RZZZHQCE.js → chunk-PFHSFYQB.js} +2 -2
  22. package/dist/{chunk-HV52EUSL.js → chunk-QUBU3ETR.js} +4 -4
  23. package/dist/{chunk-KUBHGVTD.js → chunk-RRPNPZ6I.js} +16 -10
  24. package/dist/{chunk-MQMWVJZB.js → chunk-T7SLHAHQ.js} +2 -2
  25. package/dist/{chunk-PR2RBEXI.js → chunk-TAVFL3YB.js} +2 -2
  26. package/dist/{chunk-7Q3AIS4Q.js → chunk-W4W3EHQP.js} +2 -2
  27. package/dist/{cli-A6HKRICM.js → cli-VCKKTXUU.js} +5 -5
  28. package/dist/cli.js +3 -3
  29. package/dist/{completion-FDLVWLAC.js → completion-AAEBLVVB.js} +2 -2
  30. package/dist/{diagnostics-DYLW7WYV.js → diagnostics-3XI6SJXF.js} +5 -5
  31. package/dist/{doctor-FRQ5H5FU.js → doctor-GAJKPOKS.js} +11 -11
  32. package/dist/{entry-XPZZNQ4L.js → entry-GZCLQTIN.js} +9 -9
  33. package/dist/{exec-mcp-HOM2ZANM.js → exec-mcp-3V34UNPH.js} +7 -7
  34. package/dist/{harness-WIGJRE5P.js → harness-YH6U6MNV.js} +3 -3
  35. package/dist/harness-launch-gate.js +3 -3
  36. package/dist/harness-worker.js +5 -5
  37. package/dist/hook-body.js +173 -74
  38. package/dist/{hooks-MIF3FONJ.js → hooks-JWB7D4ZB.js} +3 -3
  39. package/dist/{host-JKZLOCZS.js → host-DLBXM72V.js} +6 -6
  40. package/dist/{host-CE5TW5SC.js → host-LNH3TUR5.js} +9 -9
  41. package/dist/{host-run-MJGJ7NVE.js → host-run-FVO5PZK2.js} +4 -4
  42. package/dist/http.js +1 -1
  43. package/dist/{import-mcp-T3GZYEE5.js → import-mcp-O553FGF3.js} +6 -6
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.js +10 -10
  46. package/dist/{init-D5VPDF2B.js → init-A6AAIGJU.js} +2 -2
  47. package/dist/{invoke-HEAOQLFQ.js → invoke-GDELKQCE.js} +7 -7
  48. package/dist/{list-PCLCFG2J.js → list-CQ4CPNWI.js} +8 -8
  49. package/dist/{logout-3ZXFXKHB.js → logout-TG32MVMB.js} +7 -7
  50. package/dist/{mainline-6CTSVOWP.js → mainline-FMZ44NFC.js} +22 -8
  51. package/dist/{mcp-T6PYHRUL.js → mcp-UYQVTWEF.js} +2 -2
  52. package/dist/{project-H4R3Q3QO.js → project-NOTN6SMK.js} +4 -4
  53. package/dist/{run-V74M7PZK.js → run-77MDEDAX.js} +6 -6
  54. package/dist/{run-FMTHUOAZ.js → run-S5M6ZUUH.js} +4 -4
  55. package/dist/{serve-JKNEC4AX.js → serve-YNHUW5PQ.js} +3 -3
  56. package/dist/{start-login-JRMVLK5J.js → start-login-SWQVPQG3.js} +7 -7
  57. package/dist/{status-RG2GFDQU.js → status-NGO7AC3U.js} +8 -8
  58. package/dist/{status-6273XFHT.js → status-YPFUSE7K.js} +7 -7
  59. package/dist/stdio.js +2 -2
  60. package/dist/{test-M365FK5N.js → test-2UYV4LSU.js} +7 -7
  61. package/dist/{tui-PKPYE76A.js → tui-ZKP3D5JM.js} +4 -4
  62. package/dist/{worker-C23EAPCY.js → worker-7OBOBMWM.js} +7 -7
  63. package/dist/{worktree-list-EMKUMCTQ.js → worktree-list-6CCHXXOZ.js} +2 -2
  64. package/dist/{worktree-sync-A277AF4M.js → worktree-sync-5ZVA5PUC.js} +3 -3
  65. package/docs/git-workflow.md +6 -2
  66. package/gemini-extension.json +2 -2
  67. package/mcp.json +1 -1
  68. package/package.json +5 -5
  69. package/plugin.json +1 -1
  70. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  71. package/plugins/pmcp/.mcp.json +1 -1
  72. package/plugins/pmcp/gemini-extension.json +2 -2
  73. package/plugins/pmcp/mcp.json +1 -1
  74. package/plugins/pmcp/plugin.json +1 -1
  75. package/dist/chunk-JTRFZQTB.js +0 -7
package/dist/hook-body.js CHANGED
@@ -259,13 +259,13 @@ function worktreesOf(checkout) {
259
259
  const found = [
260
260
  { path: dirname(checkout.commonDir), branch: branchOf(checkout.commonDir) }
261
261
  ];
262
- let names2 = [];
262
+ let names3 = [];
263
263
  try {
264
- names2 = readdirSync(join2(checkout.commonDir, "worktrees"));
264
+ names3 = readdirSync(join2(checkout.commonDir, "worktrees"));
265
265
  } catch {
266
266
  return found;
267
267
  }
268
- for (const name of names2) {
268
+ for (const name of names3) {
269
269
  const admin = join2(checkout.commonDir, "worktrees", name);
270
270
  try {
271
271
  const dotGit = readFileSync(join2(admin, "gitdir"), "utf8").trim();
@@ -324,12 +324,12 @@ function protectOffFile(input, file2) {
324
324
  if (!tool.steps) {
325
325
  return (tool.command ?? "").includes(file2) ? { verdict: "deny", reason: REASON } : {};
326
326
  }
327
- const names2 = tool.steps.some(
327
+ const names3 = tool.steps.some(
328
328
  (step) => !READ_ONLY.has(step.argv[0] ?? "") && step.raw.some(
329
329
  (word) => word === file2 || expandPath(resolve3(input.cwd, step.dir), word) === target
330
330
  )
331
331
  );
332
- return names2 ? { verdict: "deny", reason: REASON } : {};
332
+ return names3 ? { verdict: "deny", reason: REASON } : {};
333
333
  }
334
334
 
335
335
  // src/hooks/shell/tokenize.ts
@@ -907,10 +907,10 @@ function bypasses(step, options2) {
907
907
  return options2.noVerify && name === "git" && step.argv.includes("--no-verify");
908
908
  }
909
909
  function fallback(command6, options2) {
910
- const names2 = options2.variables.map(escape);
911
- if (options2.noVerify) names2.push("--no-verify");
912
- if (names2.length === 0) return false;
913
- return new RegExp(`(?:^|[^\\w-])(?:${names2.join("|")})\\b`, "u").test(
910
+ const names3 = options2.variables.map(escape);
911
+ if (options2.noVerify) names3.push("--no-verify");
912
+ if (names3.length === 0) return false;
913
+ return new RegExp(`(?:^|[^\\w-])(?:${names3.join("|")})\\b`, "u").test(
914
914
  command6
915
915
  );
916
916
  }
@@ -2718,8 +2718,8 @@ function claimants(store, session, root) {
2718
2718
  (record) => record.live && record.session !== session && record.worktree === root
2719
2719
  ).map((record) => record.alias || record.session.slice(0, 8));
2720
2720
  }
2721
- function claimantNotice(root, names2) {
2722
- return `Another live session works in ${root}: ${names2.join(", ")}. Edit only files that are yours, and name every path when you commit.`;
2721
+ function claimantNotice(root, names3) {
2722
+ return `Another live session works in ${root}: ${names3.join(", ")}. Edit only files that are yours, and name every path when you commit.`;
2723
2723
  }
2724
2724
 
2725
2725
  // src/hooks/policies/workspace/leftovers.ts
@@ -2867,47 +2867,10 @@ var sharedCheckout = {
2867
2867
  };
2868
2868
 
2869
2869
  // src/hooks/policies/workspace/mainline-deliver.ts
2870
- import { resolve as resolve9 } from "node:path";
2871
- var PUSH = /\bgit\b[^|;&\n]*\spush\b/u;
2872
- var REASON8 = "This repository's mainline moves only through pmcp git deliver, which replays, gates and pushes one delivery at a time. Commit, then run pmcp git deliver; other repositories push from their own directory.";
2873
- function sameRepository(dir, commonDir) {
2874
- return checkoutOf(dir)?.commonDir === commonDir;
2875
- }
2876
- var mainlineDeliver = {
2877
- id: "git.mainline.deliver",
2878
- events: ["before_tool"],
2879
- tools: ["shell"],
2880
- fail: "closed",
2881
- defaultMode: "deny",
2882
- options(raw) {
2883
- onlyKeys(raw, []);
2884
- return {};
2885
- },
2886
- evaluate(input) {
2887
- const call = shellCall(input);
2888
- const project6 = checkoutOf(input.projectRoot);
2889
- if (!call || !project6) return pass;
2890
- if (!call.steps) {
2891
- const hit2 = PUSH.test(call.command) && sameRepository(input.cwd, project6.commonDir);
2892
- return hit2 ? { verdict: "deny", reason: REASON8 } : pass;
2893
- }
2894
- for (const step of realSteps(call.steps)) {
2895
- if (program(step.argv[0]) !== "git") continue;
2896
- const git2 = gitCall(step.argv);
2897
- if (git2.sub !== "push") continue;
2898
- const dir = resolve9(input.cwd, step.dir, git2.dir);
2899
- if (sameRepository(dir, project6.commonDir))
2900
- return { verdict: "deny", reason: REASON8 };
2901
- }
2902
- return pass;
2903
- }
2904
- };
2905
-
2906
- // src/hooks/policies/workspace/worktree-sync.ts
2907
- import { relative as relative6, resolve as resolve11 } from "node:path";
2870
+ import { resolve as resolve10 } from "node:path";
2908
2871
 
2909
2872
  // src/git/detect.ts
2910
- import { dirname as dirname5, resolve as resolve10 } from "node:path";
2873
+ import { dirname as dirname5, resolve as resolve9 } from "node:path";
2911
2874
 
2912
2875
  // src/git/exec.ts
2913
2876
  var LOCAL_ENV = [
@@ -2987,11 +2950,11 @@ function detect(cwd, prefs = {}) {
2987
2950
  const remote = defaultRemote(root, prefs.remote);
2988
2951
  const mainline = defaultMainline(root, remote, prefs.mainline);
2989
2952
  return {
2990
- root: resolve10(root),
2991
- gitDir: resolve10(gitDir),
2992
- commonDir: resolve10(commonDir),
2993
- mainRoot: dirname5(resolve10(commonDir)),
2994
- linked: resolve10(gitDir) !== resolve10(commonDir),
2953
+ root: resolve9(root),
2954
+ gitDir: resolve9(gitDir),
2955
+ commonDir: resolve9(commonDir),
2956
+ mainRoot: dirname5(resolve9(commonDir)),
2957
+ linked: resolve9(gitDir) !== resolve9(commonDir),
2995
2958
  remote,
2996
2959
  mainline,
2997
2960
  upstream: `${remote}/${mainline}`,
@@ -2999,6 +2962,124 @@ function detect(cwd, prefs = {}) {
2999
2962
  };
3000
2963
  }
3001
2964
 
2965
+ // src/hooks/policies/workspace/mainline-deliver.ts
2966
+ var PUSH = /\bgit\b[^|;&\n]*\spush\b/u;
2967
+ var REASON8 = "This repository's mainline moves only through pmcp git deliver, which replays, gates and pushes one delivery at a time. Commit, then run pmcp git deliver; other branches, other remotes and other repositories push as usual.";
2968
+ var VALUE_OPTIONS = /* @__PURE__ */ new Set([
2969
+ "--repo",
2970
+ "--receive-pack",
2971
+ "--exec",
2972
+ "-o",
2973
+ "--push-option"
2974
+ ]);
2975
+ var EVERY_BRANCH = /* @__PURE__ */ new Set(["--all", "--branches", "--mirror"]);
2976
+ function sameRepository(dir, commonDir) {
2977
+ return checkoutOf(dir)?.commonDir === commonDir;
2978
+ }
2979
+ function gitText2(dir, args) {
2980
+ const run3 = spawnSync("git", ["-C", dir, ...args], {
2981
+ encoding: "utf8",
2982
+ timeout: 5e3
2983
+ });
2984
+ return run3.status === 0 ? run3.stdout.trim() : "";
2985
+ }
2986
+ function names2(ref, branch) {
2987
+ if (ref.includes("*")) return true;
2988
+ return [branch, `heads/${branch}`, `refs/heads/${branch}`].includes(ref);
2989
+ }
2990
+ function movesMainline(dir, args, options2) {
2991
+ const positional = [];
2992
+ let repo = "";
2993
+ for (let index = 0; index < args.length; index += 1) {
2994
+ const word = args[index];
2995
+ if (word === "--") {
2996
+ positional.push(...args.slice(index + 1));
2997
+ break;
2998
+ }
2999
+ if (!word.startsWith("-") || word === "-") {
3000
+ positional.push(word);
3001
+ continue;
3002
+ }
3003
+ const option = word.split("=")[0];
3004
+ if (option === "-n" || option === "--dry-run") return false;
3005
+ if (/^-[a-zA-Z]+$/u.test(word) && word.includes("n")) return false;
3006
+ if (EVERY_BRANCH.has(option)) return true;
3007
+ if (VALUE_OPTIONS.has(option) && !word.includes("=")) {
3008
+ if (option === "--repo") repo = args[index + 1] ?? "";
3009
+ index += 1;
3010
+ continue;
3011
+ }
3012
+ if (option === "--repo") repo = word.slice("--repo=".length);
3013
+ }
3014
+ const ctx = detect(dir, {
3015
+ ...options2.remote ? { remote: options2.remote } : {},
3016
+ ...options2.branch ? { mainline: options2.branch } : {}
3017
+ });
3018
+ const remote = options2.remote ?? ctx?.remote ?? "origin";
3019
+ const branch = options2.branch ?? ctx?.mainline ?? "main";
3020
+ const target = positional[0] ?? repo;
3021
+ if (target && target !== remote && /^[\w.-]+$/u.test(target)) return false;
3022
+ const current = gitText2(dir, ["symbolic-ref", "--short", "-q", "HEAD"]);
3023
+ const refspecs = positional.slice(1);
3024
+ if (refspecs.length === 0) {
3025
+ if (!current) return false;
3026
+ const upstream = gitText2(dir, [
3027
+ "rev-parse",
3028
+ "--abbrev-ref",
3029
+ "--symbolic-full-name",
3030
+ "@{upstream}"
3031
+ ]);
3032
+ return current === branch || upstream === `${remote}/${branch}`;
3033
+ }
3034
+ return refspecs.some((spec) => {
3035
+ const plain = spec.replace(/^\+/u, "");
3036
+ const colon = plain.indexOf(":");
3037
+ let dst = colon < 0 ? plain : plain.slice(colon + 1) || plain.slice(0, colon);
3038
+ if (dst === "HEAD" || dst === "@") dst = current;
3039
+ return dst !== "" && names2(dst, branch);
3040
+ });
3041
+ }
3042
+ var mainlineDeliver = {
3043
+ id: "git.mainline.deliver",
3044
+ events: ["before_tool"],
3045
+ tools: ["shell"],
3046
+ fail: "closed",
3047
+ defaultMode: "deny",
3048
+ options(raw) {
3049
+ onlyKeys(raw, ["remote", "branch"]);
3050
+ const text9 = (key) => {
3051
+ const value = raw[key];
3052
+ if (value === void 0) return {};
3053
+ if (typeof value !== "string" || value === "")
3054
+ throw new Error(`${key} must be a name`);
3055
+ return { [key]: value };
3056
+ };
3057
+ return { ...text9("remote"), ...text9("branch") };
3058
+ },
3059
+ evaluate(input, ctx) {
3060
+ const call = shellCall(input);
3061
+ const project6 = checkoutOf(input.projectRoot);
3062
+ if (!call || !project6) return pass;
3063
+ if (!call.steps) {
3064
+ const hit2 = PUSH.test(call.command) && sameRepository(input.cwd, project6.commonDir);
3065
+ return hit2 ? { verdict: "deny", reason: REASON8 } : pass;
3066
+ }
3067
+ for (const step of realSteps(call.steps)) {
3068
+ if (program(step.argv[0]) !== "git") continue;
3069
+ const git2 = gitCall(step.argv);
3070
+ if (git2.sub !== "push") continue;
3071
+ const dir = resolve10(input.cwd, step.dir, git2.dir);
3072
+ if (!sameRepository(dir, project6.commonDir)) continue;
3073
+ if (movesMainline(dir, step.argv.slice(git2.at + 1), ctx.options))
3074
+ return { verdict: "deny", reason: REASON8 };
3075
+ }
3076
+ return pass;
3077
+ }
3078
+ };
3079
+
3080
+ // src/hooks/policies/workspace/worktree-sync.ts
3081
+ import { relative as relative6, resolve as resolve11 } from "node:path";
3082
+
3002
3083
  // src/git/modes.ts
3003
3084
  import { join as join6 } from "node:path";
3004
3085
  function withUmask(mask, run3) {
@@ -3180,8 +3261,18 @@ function pinsSuperseded(cwd, upstream, sha) {
3180
3261
  }
3181
3262
 
3182
3263
  // src/git/landed.ts
3264
+ var GitReadError = class extends Error {
3265
+ };
3266
+ function read3(cwd, args) {
3267
+ const run3 = git(cwd, args);
3268
+ if (run3.status !== 0)
3269
+ throw new GitReadError(
3270
+ `git ${args.join(" ")} failed (exit ${run3.status}); nothing was chosen: ${run3.stderr.trim()}`
3271
+ );
3272
+ return run3.stdout;
3273
+ }
3183
3274
  function cherry(cwd, upstream, head = "HEAD") {
3184
- const listed = git(cwd, ["cherry", "-v", upstream, head]).stdout;
3275
+ const listed = read3(cwd, ["cherry", "-v", upstream, head]);
3185
3276
  const carried = [];
3186
3277
  const missing = [];
3187
3278
  for (const line of listed.split("\n")) {
@@ -3250,15 +3341,23 @@ function updateToPins(root, paths) {
3250
3341
 
3251
3342
  // src/git/worktrees/sync.ts
3252
3343
  function heldBy(root, upstream, ahead) {
3253
- const dirty = gitText(root, [
3344
+ const status = git(root, [
3254
3345
  "status",
3255
3346
  "--porcelain",
3256
3347
  "--untracked-files=no",
3257
3348
  "--ignore-submodules=all"
3258
3349
  ]);
3259
- if (dirty) return "uncommitted changes";
3350
+ if (status.status !== 0)
3351
+ return `git status failed (exit ${status.status}): ${status.stderr.trim()}`;
3352
+ if (status.stdout.trim()) return "uncommitted changes";
3260
3353
  if (ahead === 0) return null;
3261
- const own = cherry(root, upstream).missing.length;
3354
+ let own;
3355
+ try {
3356
+ own = cherry(root, upstream).missing.length;
3357
+ } catch (error) {
3358
+ if (error instanceof GitReadError) return error.message;
3359
+ throw error;
3360
+ }
3262
3361
  if (own > 0) return `${own} unlanded commit(s)`;
3263
3362
  return null;
3264
3363
  }
@@ -3909,8 +4008,8 @@ function toolKind2(name) {
3909
4008
  }
3910
4009
  function matcherFor(tools) {
3911
4010
  if (tools.includes("other")) return void 0;
3912
- const names2 = Object.entries(TOOL_KINDS2).filter(([, kind]) => tools.includes(kind)).map(([name]) => name);
3913
- return names2.length > 0 ? names2.join("|") : void 0;
4011
+ const names3 = Object.entries(TOOL_KINDS2).filter(([, kind]) => tools.includes(kind)).map(([name]) => name);
4012
+ return names3.length > 0 ? names3.join("|") : void 0;
3914
4013
  }
3915
4014
 
3916
4015
  // src/hooks/runtimes/claude/output.ts
@@ -4166,8 +4265,8 @@ function toolKind3(name) {
4166
4265
  }
4167
4266
  function matcherFor2(tools) {
4168
4267
  if (tools.includes("other")) return void 0;
4169
- const names2 = Object.entries(TOOL_KINDS3).filter(([, kind]) => tools.includes(kind)).map(([name]) => name);
4170
- return names2.length > 0 ? names2.join("|") : void 0;
4268
+ const names3 = Object.entries(TOOL_KINDS3).filter(([, kind]) => tools.includes(kind)).map(([name]) => name);
4269
+ return names3.length > 0 ? names3.join("|") : void 0;
4171
4270
  }
4172
4271
 
4173
4272
  // src/hooks/runtimes/codex/output.ts
@@ -4407,8 +4506,8 @@ function toolKind4(name) {
4407
4506
  }
4408
4507
  function matcherFor3(tools) {
4409
4508
  if (tools.includes("other")) return void 0;
4410
- const names2 = Object.entries(TOOL_KINDS4).filter(([, kind]) => tools.includes(kind)).map(([name]) => name);
4411
- return names2.length > 0 ? `^(${names2.join("|")})$` : void 0;
4509
+ const names3 = Object.entries(TOOL_KINDS4).filter(([, kind]) => tools.includes(kind)).map(([name]) => name);
4510
+ return names3.length > 0 ? `^(${names3.join("|")})$` : void 0;
4412
4511
  }
4413
4512
 
4414
4513
  // src/hooks/runtimes/gemini/output.ts
@@ -5413,14 +5512,14 @@ function fileSink(target) {
5413
5512
  };
5414
5513
  }
5415
5514
  function logFiles(dir) {
5416
- let names2 = [];
5515
+ let names3 = [];
5417
5516
  try {
5418
- names2 = readdirSync(dir).filter((name) => FILE.test(name));
5517
+ names3 = readdirSync(dir).filter((name) => FILE.test(name));
5419
5518
  } catch {
5420
5519
  return [];
5421
5520
  }
5422
5521
  const part = (name) => Number(/\.(\d+)\.jsonl$/u.exec(name)?.[1] ?? Number.MAX_SAFE_INTEGER);
5423
- return names2.sort(
5522
+ return names3.sort(
5424
5523
  (a, b) => a.slice(5, 13).localeCompare(b.slice(5, 13)) || part(a) - part(b)
5425
5524
  ).map((name) => join14(dir, name));
5426
5525
  }
@@ -5674,13 +5773,13 @@ function filesBroadcast(dir, keep, registry2) {
5674
5773
  import { dirname as dirname11, join as join20 } from "node:path";
5675
5774
  function filesLeases(dir, files2 = {}) {
5676
5775
  const leasePath = (name) => files2[name]?.file ?? join20(dir, leaseFile(name));
5677
- const read3 = (name) => {
5776
+ const read4 = (name) => {
5678
5777
  const lease = asLease(readJson3(leasePath(name)));
5679
5778
  if (!lease || !alive(lease.pid)) return null;
5680
5779
  return lease;
5681
5780
  };
5682
5781
  return {
5683
- read: read3,
5782
+ read: read4,
5684
5783
  // Atomic against another process taking the same file (another tool may share it): the
5685
5784
  // record is linked into place, and a dead holder's record is replaced and then re-read, so
5686
5785
  // of two takers replacing it at once only the one whose record stays holds the lease.
@@ -5704,7 +5803,7 @@ function filesLeases(dir, files2 = {}) {
5704
5803
  } catch (error) {
5705
5804
  if (error.code !== "EEXIST") throw error;
5706
5805
  }
5707
- const held = read3(name);
5806
+ const held = read4(name);
5708
5807
  if (held && held.pid !== pid) return false;
5709
5808
  renameSync(temp, path);
5710
5809
  return asLease(readJson3(path))?.pid === pid;
@@ -5872,13 +5971,13 @@ function filesRegistry(dir, staleMs) {
5872
5971
  const list = (now = Date.now()) => {
5873
5972
  const found = /* @__PURE__ */ new Map();
5874
5973
  for (const folder of dirs) {
5875
- let names2 = [];
5974
+ let names3 = [];
5876
5975
  try {
5877
- names2 = readdirSync(folder).filter((name) => name.endsWith(".json"));
5976
+ names3 = readdirSync(folder).filter((name) => name.endsWith(".json"));
5878
5977
  } catch {
5879
5978
  continue;
5880
5979
  }
5881
- for (const name of names2)
5980
+ for (const name of names3)
5882
5981
  found.set(name, [
5883
5982
  ...found.get(name) ?? [],
5884
5983
  asRecord(readJson3(join23(folder, name)))
@@ -11,8 +11,8 @@ async function run(context) {
11
11
  const [verb = "list", ...extra] = context.args.positional;
12
12
  const usage = "Use hooks list, hooks test or hooks report";
13
13
  if (extra.length) throw new ArgumentError(usage);
14
- if (verb === "list") return (await import("./list-PCLCFG2J.js")).run(context);
15
- if (verb === "test") return (await import("./test-M365FK5N.js")).run(context);
14
+ if (verb === "list") return (await import("./list-CQ4CPNWI.js")).run(context);
15
+ if (verb === "test") return (await import("./test-2UYV4LSU.js")).run(context);
16
16
  if (verb === "report")
17
17
  return (await import("./report-ZHOHQ4PZ.js")).run(context);
18
18
  throw new ArgumentError(usage);
@@ -21,4 +21,4 @@ var hooksCommand = { ...hooksSpec, run };
21
21
  export {
22
22
  hooksCommand
23
23
  };
24
- //# sourceMappingURL=hooks-MIF3FONJ.js.map
24
+ //# sourceMappingURL=hooks-JWB7D4ZB.js.map
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  requireTerminal,
3
3
  terminalSupport
4
- } from "./chunk-ESCOMAPX.js";
4
+ } from "./chunk-7XK2KWLJ.js";
5
5
  import "./chunk-5ZABTVSW.js";
6
- import "./chunk-RZZZHQCE.js";
6
+ import "./chunk-PFHSFYQB.js";
7
7
  import "./chunk-LMT3PPXJ.js";
8
- import "./chunk-7Q3AIS4Q.js";
8
+ import "./chunk-W4W3EHQP.js";
9
9
  import "./chunk-R2GPCZUX.js";
10
10
  import "./chunk-34DECPVC.js";
11
- import "./chunk-ULFV3EIZ.js";
11
+ import "./chunk-F34XIDXT.js";
12
12
  import "./chunk-NRBQK6UX.js";
13
13
  import "./chunk-OEH47H6A.js";
14
14
  import "./chunk-IJBSOWHK.js";
15
15
  import "./chunk-XWLMZKH2.js";
16
- import "./chunk-JTRFZQTB.js";
16
+ import "./chunk-HOTGJQIV.js";
17
17
  import "./chunk-GJXOFDJT.js";
18
18
  import "./chunk-PMJG2CXF.js";
19
19
  import "./chunk-J6KL3COD.js";
@@ -21,4 +21,4 @@ export {
21
21
  requireTerminal,
22
22
  terminalSupport
23
23
  };
24
- //# sourceMappingURL=host-JKZLOCZS.js.map
24
+ //# sourceMappingURL=host-DLBXM72V.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-F5XMGOOX.js";
5
5
  import {
6
6
  specFrom
7
- } from "./chunk-PR2RBEXI.js";
7
+ } from "./chunk-TAVFL3YB.js";
8
8
  import "./chunk-RPCIROW7.js";
9
9
  import {
10
10
  approvalDir,
@@ -12,11 +12,11 @@ import {
12
12
  hostDigest,
13
13
  projectedFiles,
14
14
  writeApproval
15
- } from "./chunk-7LUYI7QM.js";
16
- import "./chunk-MLGXDSHZ.js";
15
+ } from "./chunk-3IX5TBRW.js";
16
+ import "./chunk-FFCDSSKA.js";
17
17
  import "./chunk-UKR64U7J.js";
18
- import "./chunk-XZ2TDH3J.js";
19
- import "./chunk-KUBHGVTD.js";
18
+ import "./chunk-2A3F7ID4.js";
19
+ import "./chunk-RRPNPZ6I.js";
20
20
  import "./chunk-EATCUWGG.js";
21
21
  import "./chunk-OFJIMBTL.js";
22
22
  import "./chunk-LFFIQBNY.js";
@@ -38,12 +38,12 @@ import {
38
38
  import "./chunk-V4NPDK6X.js";
39
39
  import {
40
40
  hostDoctor
41
- } from "./chunk-ULFV3EIZ.js";
41
+ } from "./chunk-F34XIDXT.js";
42
42
  import "./chunk-NRBQK6UX.js";
43
43
  import "./chunk-OEH47H6A.js";
44
44
  import "./chunk-IJBSOWHK.js";
45
45
  import "./chunk-XWLMZKH2.js";
46
- import "./chunk-JTRFZQTB.js";
46
+ import "./chunk-HOTGJQIV.js";
47
47
  import "./chunk-GJXOFDJT.js";
48
48
  import "./chunk-PMJG2CXF.js";
49
49
  import "./chunk-J6KL3COD.js";
@@ -183,7 +183,7 @@ async function runHost(context) {
183
183
  return 1;
184
184
  }
185
185
  if (verb === "up" || verb === "down" || verb === "unit") {
186
- const { runHostVerb } = await import("./host-run-MJGJ7NVE.js");
186
+ const { runHostVerb } = await import("./host-run-FVO5PZK2.js");
187
187
  return runHostVerb(verb, spec, context);
188
188
  }
189
189
  if (verb === "status") {
@@ -211,4 +211,4 @@ async function runHost(context) {
211
211
  export {
212
212
  runHost
213
213
  };
214
- //# sourceMappingURL=host-CE5TW5SC.js.map
214
+ //# sourceMappingURL=host-LNH3TUR5.js.map
@@ -5,14 +5,14 @@ import {
5
5
  import {
6
6
  approvalDir,
7
7
  approvalState
8
- } from "./chunk-7LUYI7QM.js";
8
+ } from "./chunk-3IX5TBRW.js";
9
9
  import {
10
10
  ArgumentError
11
11
  } from "./chunk-A4PKLESO.js";
12
12
  import {
13
13
  missingBinary,
14
14
  ptyBinary
15
- } from "./chunk-ULFV3EIZ.js";
15
+ } from "./chunk-F34XIDXT.js";
16
16
  import "./chunk-NRBQK6UX.js";
17
17
  import {
18
18
  projectStateDir
@@ -21,7 +21,7 @@ import "./chunk-IJBSOWHK.js";
21
21
  import "./chunk-XWLMZKH2.js";
22
22
  import {
23
23
  VERSION
24
- } from "./chunk-JTRFZQTB.js";
24
+ } from "./chunk-HOTGJQIV.js";
25
25
  import "./chunk-GJXOFDJT.js";
26
26
  import "./chunk-PMJG2CXF.js";
27
27
  import {
@@ -329,4 +329,4 @@ async function runHostVerb(verb, spec, context) {
329
329
  export {
330
330
  runHostVerb
331
331
  };
332
- //# sourceMappingURL=host-run-MJGJ7NVE.js.map
332
+ //# sourceMappingURL=host-run-FVO5PZK2.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-JUG4W7RF.js";
7
+ } from "./chunk-JJT5XRMV.js";
8
8
  import "./chunk-6WXMJOMI.js";
9
9
  import {
10
10
  readCatalog
@@ -6,10 +6,10 @@ import {
6
6
  } from "./chunk-P4N7DBD5.js";
7
7
  import {
8
8
  readMcp
9
- } from "./chunk-MLGXDSHZ.js";
9
+ } from "./chunk-FFCDSSKA.js";
10
10
  import "./chunk-UKR64U7J.js";
11
- import "./chunk-XZ2TDH3J.js";
12
- import "./chunk-KUBHGVTD.js";
11
+ import "./chunk-2A3F7ID4.js";
12
+ import "./chunk-RRPNPZ6I.js";
13
13
  import "./chunk-EATCUWGG.js";
14
14
  import "./chunk-OFJIMBTL.js";
15
15
  import "./chunk-LFFIQBNY.js";
@@ -30,14 +30,14 @@ import {
30
30
  import {
31
31
  TOOLS
32
32
  } from "./chunk-V4NPDK6X.js";
33
- import "./chunk-ULFV3EIZ.js";
33
+ import "./chunk-F34XIDXT.js";
34
34
  import {
35
35
  ProjectError
36
36
  } from "./chunk-NRBQK6UX.js";
37
37
  import "./chunk-OEH47H6A.js";
38
38
  import "./chunk-IJBSOWHK.js";
39
39
  import "./chunk-XWLMZKH2.js";
40
- import "./chunk-JTRFZQTB.js";
40
+ import "./chunk-HOTGJQIV.js";
41
41
  import "./chunk-GJXOFDJT.js";
42
42
  import "./chunk-PMJG2CXF.js";
43
43
  import "./chunk-J6KL3COD.js";
@@ -402,4 +402,4 @@ function importMcp(context) {
402
402
  export {
403
403
  importMcp
404
404
  };
405
- //# sourceMappingURL=import-mcp-T3GZYEE5.js.map
405
+ //# sourceMappingURL=import-mcp-O553FGF3.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.22.3";
307
+ declare const SERVER_VERSION = "0.22.4";
308
308
  declare function registerSkillTools(server: McpServer, tools: SkillTools): McpServer;
309
309
  interface SkillMcpOptions extends SkillServerOptions {
310
310
  readonly mailbox?: MailboxService;
package/dist/index.js CHANGED
@@ -4,29 +4,29 @@ import {
4
4
  } from "./chunk-YOWIYFIV.js";
5
5
  import {
6
6
  doctor
7
- } from "./chunk-WPX4ONFT.js";
8
- import "./chunk-7LUYI7QM.js";
7
+ } from "./chunk-CPFJ7J4G.js";
8
+ import "./chunk-3IX5TBRW.js";
9
9
  import "./chunk-JQVSDPFL.js";
10
10
  import "./chunk-VJFEN6DJ.js";
11
11
  import "./chunk-NHUMPEPV.js";
12
12
  import "./chunk-TIA4SPU2.js";
13
13
  import {
14
14
  project
15
- } from "./chunk-HV52EUSL.js";
15
+ } from "./chunk-QUBU3ETR.js";
16
16
  import "./chunk-P4N7DBD5.js";
17
17
  import {
18
18
  prepareSearch
19
19
  } from "./chunk-NLHLA2N5.js";
20
20
  import {
21
21
  deadGlobs
22
- } from "./chunk-ONYZIC2F.js";
22
+ } from "./chunk-MTVRKWQI.js";
23
23
  import {
24
24
  plan,
25
25
  readSpec
26
- } from "./chunk-MLGXDSHZ.js";
26
+ } from "./chunk-FFCDSSKA.js";
27
27
  import "./chunk-UKR64U7J.js";
28
- import "./chunk-XZ2TDH3J.js";
29
- import "./chunk-KUBHGVTD.js";
28
+ import "./chunk-2A3F7ID4.js";
29
+ import "./chunk-RRPNPZ6I.js";
30
30
  import "./chunk-EATCUWGG.js";
31
31
  import "./chunk-OFJIMBTL.js";
32
32
  import "./chunk-LFFIQBNY.js";
@@ -82,7 +82,7 @@ import {
82
82
  registerSkillsExtension,
83
83
  resolveSkillFileUri,
84
84
  skillFileUri
85
- } from "./chunk-JUG4W7RF.js";
85
+ } from "./chunk-JJT5XRMV.js";
86
86
  import {
87
87
  normaliseIntent
88
88
  } from "./chunk-6WXMJOMI.js";
@@ -117,7 +117,7 @@ import {
117
117
  import "./chunk-6STKGOCW.js";
118
118
  import {
119
119
  LOCK_FILE
120
- } from "./chunk-ULFV3EIZ.js";
120
+ } from "./chunk-F34XIDXT.js";
121
121
  import {
122
122
  ProjectError,
123
123
  deriveName
@@ -125,7 +125,7 @@ import {
125
125
  import "./chunk-OEH47H6A.js";
126
126
  import "./chunk-IJBSOWHK.js";
127
127
  import "./chunk-XWLMZKH2.js";
128
- import "./chunk-JTRFZQTB.js";
128
+ import "./chunk-HOTGJQIV.js";
129
129
  import {
130
130
  CONFIG_FILE,
131
131
  ConfigError,
@@ -6,9 +6,9 @@ import "./chunk-XNML2KIC.js";
6
6
  // src/commands/init.ts
7
7
  var initCommand = {
8
8
  ...initSpec,
9
- run: async (context) => (await import("./run-V74M7PZK.js")).run(context)
9
+ run: async (context) => (await import("./run-77MDEDAX.js")).run(context)
10
10
  };
11
11
  export {
12
12
  initCommand
13
13
  };
14
- //# sourceMappingURL=init-D5VPDF2B.js.map
14
+ //# sourceMappingURL=init-A6AAIGJU.js.map