@modootoday/pmcp 0.19.2 → 0.19.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 (85) 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-YM2NR2QA.js → apply-JJNM7B46.js} +16 -15
  6. package/dist/{chunk-NDR7HEMH.js → chunk-4KAXYSBV.js} +2 -2
  7. package/dist/{chunk-LREOXJ4I.js → chunk-4MFXXSUH.js} +2 -2
  8. package/dist/{chunk-74TP72AP.js → chunk-5O63Z4R4.js} +5 -5
  9. package/dist/{chunk-J5XQW2CM.js → chunk-7B2KRL2H.js} +14 -3
  10. package/dist/{chunk-ASGTJ35M.js → chunk-AC76MDRM.js} +23 -23
  11. package/dist/{chunk-SYCK2YYV.js → chunk-BAW4TVUG.js} +8 -8
  12. package/dist/{chunk-CIU5Q55A.js → chunk-D2LYCDF6.js} +2 -2
  13. package/dist/{chunk-JJBSYUSQ.js → chunk-DXJZ2ZCX.js} +2 -2
  14. package/dist/{chunk-3MPPORSM.js → chunk-GH2Y6TKB.js} +2 -2
  15. package/dist/{chunk-ONQJCG2X.js → chunk-H3NMLKS6.js} +3 -3
  16. package/dist/{chunk-DZV7EQ5Q.js → chunk-HU2P5Q4D.js} +2 -2
  17. package/dist/{chunk-D5D3V6RU.js → chunk-ICF2JZSN.js} +15 -1
  18. package/dist/{chunk-EB7XLUSW.js → chunk-IWASBYQS.js} +3 -3
  19. package/dist/{chunk-GPPGCZKP.js → chunk-JIBAK4CL.js} +8 -8
  20. package/dist/{chunk-YGJNZ47K.js → chunk-KDUQ5LBP.js} +2 -2
  21. package/dist/{chunk-NNKLVEQZ.js → chunk-M73BQJOO.js} +2 -2
  22. package/dist/{chunk-5OVHW7AG.js → chunk-OGP3MGDZ.js} +3 -3
  23. package/dist/chunk-P6LNYYYH.js +95 -0
  24. package/dist/chunk-QJEOFF2R.js +7 -0
  25. package/dist/{chunk-NNOATTGX.js → chunk-THSG4SFC.js} +3 -3
  26. package/dist/{chunk-QXZLFIY2.js → chunk-TPE2RY7R.js} +2 -2
  27. package/dist/{chunk-WIW772I3.js → chunk-XLXDXJY2.js} +4 -4
  28. package/dist/{chunk-YMNVZMI3.js → chunk-XMAHSADU.js} +2 -2
  29. package/dist/{chunk-BR4B2KU2.js → chunk-XOI2EVAW.js} +2 -2
  30. package/dist/{chunk-DXK67PX7.js → chunk-Y46SCPYN.js} +5 -5
  31. package/dist/{chunk-LLBPVZXM.js → chunk-YN5GQCHN.js} +4 -4
  32. package/dist/{chunk-DFZESOWW.js → chunk-YN5XSC7M.js} +24 -16
  33. package/dist/{cli-T5LHBUY2.js → cli-BTPTJWCC.js} +3 -3
  34. package/dist/{cli-MUP2NSXT.js → cli-UFCFDIVI.js} +7 -6
  35. package/dist/cli.js +7 -7
  36. package/dist/{completion-52AM4CCB.js → completion-DZ6XCNBD.js} +6 -6
  37. package/dist/{diagnostics-2NXDRCS3.js → diagnostics-ISHOCTY3.js} +6 -6
  38. package/dist/{doctor-SBQHIZA4.js → doctor-A3JYYHRU.js} +20 -19
  39. package/dist/{entry-PZUG7UVZ.js → entry-LXEVG3E7.js} +10 -10
  40. package/dist/{exec-mcp-UMHU5Q6Y.js → exec-mcp-GZSLIL3H.js} +10 -9
  41. package/dist/{harness-46QFLNJE.js → harness-EJTLUOX2.js} +3 -3
  42. package/dist/harness-launch-gate.js +4 -4
  43. package/dist/harness-worker.js +6 -6
  44. package/dist/hook-body.js +149 -54
  45. package/dist/{hooks-JROFOE6Y.js → hooks-JGYIF2AI.js} +3 -3
  46. package/dist/{host-MAVWRD5G.js → host-EGUDTIDS.js} +12 -11
  47. package/dist/{host-FPTPSHL2.js → host-T43WUL2C.js} +7 -7
  48. package/dist/{host-run-DMNF3PWU.js → host-run-CAL5DG4Z.js} +5 -5
  49. package/dist/http.js +1 -1
  50. package/dist/{import-mcp-YGX7Q3CT.js → import-mcp-AYGM4TCW.js} +8 -7
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +17 -16
  53. package/dist/{init-3QZPCMPA.js → init-YP5TFYLT.js} +2 -2
  54. package/dist/{invoke-TMDQXMY4.js → invoke-H434JWPS.js} +8 -8
  55. package/dist/{list-T6JWLS6W.js → list-DNEAYNRB.js} +10 -9
  56. package/dist/{logout-I3YZFAHR.js → logout-FULZ7IM7.js} +9 -8
  57. package/dist/{mailbox-O3MX6QPF.js → mailbox-UECKDZ3Q.js} +1 -1
  58. package/dist/{mainline-DG75NLBS.js → mainline-FPK4HWFF.js} +47 -14
  59. package/dist/{mcp-TQBBPB3O.js → mcp-7HCTPBUX.js} +2 -2
  60. package/dist/modes-COBVV7RA.js +14 -0
  61. package/dist/{project-SJ3ZPUAA.js → project-EX4A7WQO.js} +6 -6
  62. package/dist/{run-LVSY22QZ.js → run-AZIIJPHX.js} +8 -7
  63. package/dist/{run-3YQWI6PN.js → run-MOAIY42Y.js} +4 -4
  64. package/dist/{serve-NOPGIM4N.js → serve-DQMI4IPA.js} +6 -6
  65. package/dist/{setup-T6T2PFC4.js → setup-63E3TVJK.js} +4 -4
  66. package/dist/{start-login-ULBUS65R.js → start-login-NX45I5Q3.js} +9 -8
  67. package/dist/{status-PBYIVK3R.js → status-2J6MH4AS.js} +13 -12
  68. package/dist/{status-GPSLH4VO.js → status-CM753VKY.js} +3 -3
  69. package/dist/{status-JI6MWSVS.js → status-RTVEWD42.js} +9 -8
  70. package/dist/stdio.js +2 -2
  71. package/dist/{test-B7KRCCL7.js → test-EZLVHD77.js} +9 -8
  72. package/dist/{tui-2SKEYYUR.js → tui-4KUCMZKH.js} +4 -4
  73. package/dist/{worker-WWNHOUBS.js → worker-AWHTJSDL.js} +8 -8
  74. package/dist/{worktree-sync-W4BDDLRO.js → worktree-sync-GQVYAXGJ.js} +4 -2
  75. package/docs/git-workflow.md +6 -5
  76. package/gemini-extension.json +2 -2
  77. package/mcp.json +1 -1
  78. package/package.json +5 -5
  79. package/plugin.json +1 -1
  80. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  81. package/plugins/pmcp/.mcp.json +1 -1
  82. package/plugins/pmcp/gemini-extension.json +2 -2
  83. package/plugins/pmcp/mcp.json +1 -1
  84. package/plugins/pmcp/plugin.json +1 -1
  85. package/dist/chunk-V4K6Q3GF.js +0 -7
@@ -8,19 +8,18 @@ import {
8
8
  } from "./chunk-UPQTAHUK.js";
9
9
  import {
10
10
  specFrom
11
- } from "./chunk-QXZLFIY2.js";
11
+ } from "./chunk-TPE2RY7R.js";
12
12
  import "./chunk-7DLZC73N.js";
13
13
  import {
14
14
  launch
15
- } from "./chunk-NDR7HEMH.js";
16
- import "./chunk-DFZESOWW.js";
15
+ } from "./chunk-4KAXYSBV.js";
16
+ import "./chunk-YN5XSC7M.js";
17
17
  import "./chunk-HQOB7OQS.js";
18
- import "./chunk-J5XQW2CM.js";
18
+ import "./chunk-7B2KRL2H.js";
19
19
  import "./chunk-2Q6MNGU5.js";
20
- import "./chunk-D5D3V6RU.js";
20
+ import "./chunk-ICF2JZSN.js";
21
21
  import "./chunk-UD3BEEBQ.js";
22
22
  import "./chunk-ISNRDHSD.js";
23
- import "./chunk-G7JONWL4.js";
24
23
  import "./chunk-EATCUWGG.js";
25
24
  import {
26
25
  ProjectError
@@ -28,15 +27,17 @@ import {
28
27
  import "./chunk-3PW4FI7U.js";
29
28
  import "./chunk-DHAPQUEF.js";
30
29
  import "./chunk-C4NHQGHL.js";
30
+ import "./chunk-P6LNYYYH.js";
31
+ import "./chunk-G7JONWL4.js";
31
32
  import {
32
33
  McpAuthError
33
34
  } from "./chunk-Q5H3L6Y4.js";
34
35
  import "./chunk-A4PKLESO.js";
35
36
  import "./chunk-V4NPDK6X.js";
36
- import "./chunk-DZV7EQ5Q.js";
37
+ import "./chunk-HU2P5Q4D.js";
37
38
  import "./chunk-OEH47H6A.js";
38
39
  import "./chunk-IJBSOWHK.js";
39
- import "./chunk-V4K6Q3GF.js";
40
+ import "./chunk-QJEOFF2R.js";
40
41
  import "./chunk-QPL7E2HW.js";
41
42
  import "./chunk-PMJG2CXF.js";
42
43
  import "./chunk-J6KL3COD.js";
@@ -362,4 +363,4 @@ function runExecMcp(context, name) {
362
363
  export {
363
364
  runExecMcp
364
365
  };
365
- //# sourceMappingURL=exec-mcp-UMHU5Q6Y.js.map
366
+ //# sourceMappingURL=exec-mcp-GZSLIL3H.js.map
@@ -151,12 +151,12 @@ var harnessCommand = {
151
151
  return runPtyMcp(context);
152
152
  }
153
153
  if (context.args.positional[0] === "host") {
154
- const { runHost } = await import("./host-MAVWRD5G.js");
154
+ const { runHost } = await import("./host-EGUDTIDS.js");
155
155
  return runHost(context);
156
156
  }
157
157
  try {
158
158
  const operation = parseInvocation(context);
159
- const { invoke } = await import("./invoke-TMDQXMY4.js");
159
+ const { invoke } = await import("./invoke-H434JWPS.js");
160
160
  const receipt = await invoke(operation);
161
161
  context.ui.data(`${JSON.stringify(receipt)}
162
162
  `);
@@ -174,4 +174,4 @@ var harnessCommand = {
174
174
  export {
175
175
  harnessCommand
176
176
  };
177
- //# sourceMappingURL=harness-46QFLNJE.js.map
177
+ //# sourceMappingURL=harness-EJTLUOX2.js.map
@@ -7,13 +7,13 @@ import {
7
7
  assertProof,
8
8
  assertResourceFresh,
9
9
  createProof
10
- } from "./chunk-CIU5Q55A.js";
10
+ } from "./chunk-D2LYCDF6.js";
11
11
  import "./chunk-34DECPVC.js";
12
- import "./chunk-ONQJCG2X.js";
13
- import "./chunk-DZV7EQ5Q.js";
12
+ import "./chunk-H3NMLKS6.js";
13
+ import "./chunk-HU2P5Q4D.js";
14
14
  import "./chunk-OEH47H6A.js";
15
15
  import "./chunk-IJBSOWHK.js";
16
- import "./chunk-V4K6Q3GF.js";
16
+ import "./chunk-QJEOFF2R.js";
17
17
  import "./chunk-QPL7E2HW.js";
18
18
  import "./chunk-PMJG2CXF.js";
19
19
  import {
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  runOperation
3
- } from "./chunk-EB7XLUSW.js";
4
- import "./chunk-NNKLVEQZ.js";
3
+ } from "./chunk-IWASBYQS.js";
4
+ import "./chunk-M73BQJOO.js";
5
5
  import "./chunk-R2GPCZUX.js";
6
- import "./chunk-CIU5Q55A.js";
6
+ import "./chunk-D2LYCDF6.js";
7
7
  import "./chunk-34DECPVC.js";
8
- import "./chunk-ONQJCG2X.js";
9
- import "./chunk-DZV7EQ5Q.js";
8
+ import "./chunk-H3NMLKS6.js";
9
+ import "./chunk-HU2P5Q4D.js";
10
10
  import "./chunk-OEH47H6A.js";
11
11
  import "./chunk-IJBSOWHK.js";
12
- import "./chunk-V4K6Q3GF.js";
12
+ import "./chunk-QJEOFF2R.js";
13
13
  import "./chunk-QPL7E2HW.js";
14
14
  import "./chunk-PMJG2CXF.js";
15
15
  import {
package/dist/hook-body.js CHANGED
@@ -2707,13 +2707,96 @@ function detect(cwd, prefs = {}) {
2707
2707
  };
2708
2708
  }
2709
2709
 
2710
+ // src/git/modes.ts
2711
+ import { join as join6 } from "node:path";
2712
+ function withUmask(mask, run3) {
2713
+ if (mask === void 0) return run3();
2714
+ let before2;
2715
+ try {
2716
+ before2 = process.umask(mask);
2717
+ } catch {
2718
+ return run3();
2719
+ }
2720
+ try {
2721
+ return run3();
2722
+ } finally {
2723
+ process.umask(before2);
2724
+ }
2725
+ }
2726
+ var INDEX_MODES = {
2727
+ "100644": 420,
2728
+ "100755": 493
2729
+ };
2730
+ function restoreModes(root, from, to) {
2731
+ const paths = from === null ? null : gitText(root, ["diff", "--name-only", "--no-renames", "-z", from, to]).split("\0").filter(Boolean);
2732
+ if (paths !== null && paths.length === 0) return [];
2733
+ const listed = gitText(root, [
2734
+ "ls-files",
2735
+ "-s",
2736
+ "-z",
2737
+ ...paths === null ? [] : ["--", ...paths]
2738
+ ]);
2739
+ const fixed = [];
2740
+ for (const entry of listed.split("\0")) {
2741
+ const tab = entry.indexOf(" ");
2742
+ if (tab < 0) continue;
2743
+ const want = INDEX_MODES[entry.slice(0, 6)];
2744
+ if (want === void 0) continue;
2745
+ const path = entry.slice(tab + 1);
2746
+ const file2 = join6(root, path);
2747
+ let mode;
2748
+ try {
2749
+ const stat3 = lstatSync(file2);
2750
+ if (!stat3.isFile()) continue;
2751
+ mode = stat3.mode & 511;
2752
+ } catch {
2753
+ continue;
2754
+ }
2755
+ if (mode === want) continue;
2756
+ chmodSync(file2, want);
2757
+ fixed.push(path);
2758
+ }
2759
+ return fixed;
2760
+ }
2761
+ var GITLINK = /^:(?:160000|000000) 160000 ([0-9a-f]{40}) ([0-9a-f]{40}) [AM]\t(.+)$/u;
2762
+ function restoreSubmoduleModes(root, from, to) {
2763
+ const raw = gitText(root, [
2764
+ "diff",
2765
+ "--raw",
2766
+ "--abbrev=40",
2767
+ "--no-renames",
2768
+ from,
2769
+ to
2770
+ ]);
2771
+ const fixed = [];
2772
+ for (const line of raw.split("\n")) {
2773
+ const match = GITLINK.exec(line);
2774
+ if (!match) continue;
2775
+ const [, before2, after, path] = match;
2776
+ const dir = join6(root, path);
2777
+ if (gitText(dir, ["rev-parse", "HEAD"]) !== after) continue;
2778
+ const old = /^0+$/u.test(before2) ? null : before2;
2779
+ for (const file2 of restoreModes(dir, old, after))
2780
+ fixed.push(`${path}/${file2}`);
2781
+ }
2782
+ return fixed;
2783
+ }
2784
+ function reportModes(report2, fixed) {
2785
+ if (fixed.length === 0) return;
2786
+ const shown = fixed.slice(0, 5).join(", ");
2787
+ const more = fixed.length > 5 ? `, and ${fixed.length - 5} more` : "";
2788
+ report2.info(
2789
+ `gave ${fixed.length} rewritten tracked file(s) their index mode back: ${shown}${more}`
2790
+ );
2791
+ }
2792
+
2710
2793
  // src/git/install.ts
2711
- import { dirname as dirname6, join as join6 } from "node:path";
2794
+ import { dirname as dirname6, join as join7 } from "node:path";
2712
2795
  function lockHash(root, paths) {
2713
2796
  const hash = createHash("sha256");
2714
2797
  let found = false;
2715
2798
  for (const path of paths) {
2716
- const file2 = join6(root, path);
2799
+ const file2 = join7(root, path);
2717
2800
  if (!existsSync(file2)) continue;
2718
2801
  found = true;
2719
2802
  hash.update(`${path}\0`).update(readFileSync(file2));
@@ -2723,7 +2806,7 @@ function lockHash(root, paths) {
2723
2806
  }
2724
2807
  function installedHash(root, spec) {
2725
2808
  if (spec.stamp?.hash !== "plain") return lockHash(root, spec.when);
2726
- const file2 = join6(root, spec.when[0] ?? "");
2809
+ const file2 = join7(root, spec.when[0] ?? "");
2727
2810
  if (!existsSync(file2)) return null;
2728
2811
  return createHash("sha256").update(readFileSync(file2)).digest("hex");
2729
2812
  }
@@ -2733,7 +2816,7 @@ function stampFile(root, spec) {
2733
2816
  return spec.stamp.path.replace("${git_dir}", gitDir);
2734
2817
  }
2735
2818
  const key = createHash("sha256").update([root, ...spec.when].join("\0")).digest("hex");
2736
- return join6(spec.stateDir, "installed", key);
2819
+ return join7(spec.stateDir, "installed", key);
2737
2820
  }
2738
2821
  function readStamp(path) {
2739
2822
  if (!existsSync(path)) return null;
@@ -2781,7 +2864,7 @@ function distance(cwd, upstream) {
2781
2864
  }
2782
2865
 
2783
2866
  // src/git/submodules.ts
2784
- import { join as join7 } from "node:path";
2867
+ import { join as join8 } from "node:path";
2785
2868
  function clean(dir) {
2786
2869
  return git(dir, ["status", "--porcelain"]).stdout.trim() === "";
2787
2870
  }
@@ -2791,8 +2874,8 @@ function hasCommit(dir, sha) {
2791
2874
  function movableSubmodules(root) {
2792
2875
  const listed = git(root, ["submodule", "status"]).stdout;
2793
2876
  return listed.split("\n").filter((line) => /^[ +]/u.test(line)).map((line) => line.trim().split(/\s+/u)[1] ?? "").filter((path) => {
2794
- const dir = join7(root, path);
2795
- if (!path || !existsSync(join7(dir, ".git"))) return false;
2877
+ const dir = join8(root, path);
2878
+ if (!path || !existsSync(join8(dir, ".git"))) return false;
2796
2879
  const local = gitText(dir, [
2797
2880
  "rev-list",
2798
2881
  "--count",
@@ -2807,7 +2890,7 @@ function updateToPins(root, paths) {
2807
2890
  const lines = [];
2808
2891
  for (const path of paths) {
2809
2892
  const pin = gitText(root, ["rev-parse", `HEAD:${path}`]);
2810
- const dir = join7(root, path);
2893
+ const dir = join8(root, path);
2811
2894
  if (!pin || !hasCommit(dir, pin)) {
2812
2895
  lines.push(
2813
2896
  `${path}: left alone, ${pin.slice(0, 10) || "its pin"} is not in its checkout`
@@ -2838,6 +2921,9 @@ function heldBy(root, upstream, ahead) {
2838
2921
  return null;
2839
2922
  }
2840
2923
  function syncWorktree(options2) {
2924
+ return withUmask(options2.umask, () => syncOnce(options2));
2925
+ }
2926
+ function syncOnce(options2) {
2841
2927
  const { ctx, report: report2 } = options2;
2842
2928
  if (!ctx.linked)
2843
2929
  throw new Error(
@@ -2878,6 +2964,11 @@ function syncWorktree(options2) {
2878
2964
  `moved ${before2.slice(0, 10)} -> ${after.slice(0, 10)}, ${counted.behind} commit(s)`
2879
2965
  );
2880
2966
  for (const line of updateToPins(ctx.root, submodules)) report2.info(line);
2967
+ if (options2.umask !== void 0)
2968
+ reportModes(report2, [
2969
+ ...restoreModes(ctx.root, before2, after),
2970
+ ...restoreSubmoduleModes(ctx.root, before2, after)
2971
+ ]);
2881
2972
  if (options2.install !== void 0)
2882
2973
  installIfStale(ctx.root, options2.install, report2);
2883
2974
  return "moved";
@@ -2910,12 +3001,15 @@ function changed(root, from, paths, to = "HEAD") {
2910
3001
  if (paths.length === 0) return [];
2911
3002
  return gitText(root, ["diff", "--name-only", from, to, "--", ...paths]).split("\n").filter(Boolean);
2912
3003
  }
2913
- function backgroundInstall(root, command6) {
2914
- const child = spawn(command6[0], command6.slice(1), {
2915
- cwd: root,
2916
- detached: true,
2917
- stdio: "ignore"
2918
- });
3004
+ function backgroundInstall(root, command6, umask) {
3005
+ const child = withUmask(
3006
+ umask,
3007
+ () => spawn(command6[0], command6.slice(1), {
3008
+ cwd: root,
3009
+ detached: true,
3010
+ stdio: "ignore"
3011
+ })
3012
+ );
2919
3013
  child.on("error", () => void 0);
2920
3014
  child.unref();
2921
3015
  }
@@ -2945,13 +3039,14 @@ function move(input, ctx, git2) {
2945
3039
  followSubmodules: opts.followSubmodules,
2946
3040
  fetch,
2947
3041
  report: report2,
2948
- ...install
3042
+ ...install,
3043
+ ...opts.umask !== void 0 ? { umask: opts.umask } : {}
2949
3044
  });
2950
3045
  if (result === "current") return [];
2951
3046
  if (result === "held")
2952
3047
  return lines.map((line) => `Desk ${git2.root}: ${line}`);
2953
3048
  if (opts.install && opts.installAfterMove === "background" && changed(git2.root, before2, opts.installWhen).length > 0) {
2954
- backgroundInstall(git2.root, opts.install);
3049
+ backgroundInstall(git2.root, opts.install, opts.umask);
2955
3050
  lines.push(`installing in the background: ${opts.install.join(" ")}`);
2956
3051
  }
2957
3052
  const rules = changed(git2.root, before2, opts.noticePaths);
@@ -4529,18 +4624,18 @@ async function dispatch(raw, compiled, deps) {
4529
4624
  }
4530
4625
 
4531
4626
  // src/hooks/entry/fail-closed.ts
4532
- import { join as join10 } from "node:path";
4627
+ import { join as join11 } from "node:path";
4533
4628
 
4534
4629
  // src/hooks/compiled.ts
4535
- import { join as join9 } from "node:path";
4630
+ import { join as join10 } from "node:path";
4536
4631
 
4537
4632
  // src/hooks/integrity-cache.ts
4538
4633
  import { homedir as homedir2 } from "node:os";
4539
- import { dirname as dirname7, join as join8 } from "node:path";
4634
+ import { dirname as dirname7, join as join9 } from "node:path";
4540
4635
  var LIMIT = 64;
4541
4636
  function cacheFile() {
4542
- const base = process.env["XDG_CACHE_HOME"] || join8(homedir2(), ".cache");
4543
- return join8(base, "pmcp", "hook-verified.json");
4637
+ const base = process.env["XDG_CACHE_HOME"] || join9(homedir2(), ".cache");
4638
+ return join9(base, "pmcp", "hook-verified.json");
4544
4639
  }
4545
4640
  function readCache() {
4546
4641
  try {
@@ -4592,8 +4687,8 @@ var PolicyIntegrityError = class extends Error {
4592
4687
  };
4593
4688
  var MISMATCH = "policy.json does not match pmcp.lock; review the change and run pmcp project";
4594
4689
  function readCompiled(root) {
4595
- const policyPath = join9(root, POLICY_FILE);
4596
- const files2 = [policyPath, join9(root, LOCK_FILE)];
4690
+ const policyPath = join10(root, POLICY_FILE);
4691
+ const files2 = [policyPath, join10(root, LOCK_FILE)];
4597
4692
  const before2 = stampOf(files2);
4598
4693
  const text9 = readFileSync(policyPath, "utf8");
4599
4694
  const lock = JSON.parse(readFileSync(files2[1], "utf8"));
@@ -4616,7 +4711,7 @@ function readCompiled(root) {
4616
4711
  var FAILED_CLOSED = "pmcp hook could not evaluate this call and refused it";
4617
4712
  function rawFailure(root) {
4618
4713
  try {
4619
- const raw = JSON.parse(readFileSync(join10(root, POLICY_FILE), "utf8"))["failure"];
4714
+ const raw = JSON.parse(readFileSync(join11(root, POLICY_FILE), "utf8"))["failure"];
4620
4715
  if (!raw || typeof raw.timeoutMs !== "number" || typeof raw.retry !== "number" || !Array.isArray(raw.pass) || !raw.pass.every(
4621
4716
  (kind) => PASS_KINDS.includes(kind)
4622
4717
  ))
@@ -4651,7 +4746,7 @@ function failClosed(adapter, event, root, error, stated = false) {
4651
4746
  }
4652
4747
 
4653
4748
  // src/hooks/entry/logger.ts
4654
- import { dirname as dirname8, join as join13 } from "node:path";
4749
+ import { dirname as dirname8, join as join14 } from "node:path";
4655
4750
 
4656
4751
  // src/logging/levels.ts
4657
4752
  var LEVEL_RANK = {
@@ -4775,11 +4870,11 @@ var silentLogger = createLogger(() => {
4775
4870
  });
4776
4871
 
4777
4872
  // src/logging/sinks/file.ts
4778
- import { join as join11 } from "node:path";
4873
+ import { join as join12 } from "node:path";
4779
4874
  var FILE = /^pmcp-(\d{8})(?:\.\d+)?\.jsonl$/u;
4780
4875
  function dailyLogFile(dir, now = /* @__PURE__ */ new Date()) {
4781
4876
  const day = now.toISOString().slice(0, 10).replaceAll("-", "");
4782
- return join11(dir, `pmcp-${day}.jsonl`);
4877
+ return join12(dir, `pmcp-${day}.jsonl`);
4783
4878
  }
4784
4879
  function roll(file2) {
4785
4880
  let index = 1;
@@ -4810,7 +4905,7 @@ function logFiles(dir) {
4810
4905
  const part = (name) => Number(/\.(\d+)\.jsonl$/u.exec(name)?.[1] ?? Number.MAX_SAFE_INTEGER);
4811
4906
  return names2.sort(
4812
4907
  (a, b) => a.slice(5, 13).localeCompare(b.slice(5, 13)) || part(a) - part(b)
4813
- ).map((name) => join11(dir, name));
4908
+ ).map((name) => join12(dir, name));
4814
4909
  }
4815
4910
  function pruneLogs(dir, keepDays, now = /* @__PURE__ */ new Date()) {
4816
4911
  const cutoff = new Date(now.getTime() - keepDays * 864e5).toISOString().slice(0, 10).replaceAll("-", "");
@@ -4826,13 +4921,13 @@ function pruneLogs(dir, keepDays, now = /* @__PURE__ */ new Date()) {
4826
4921
 
4827
4922
  // src/sessions/state-dir.ts
4828
4923
  import { homedir as homedir3 } from "node:os";
4829
- import { join as join12 } from "node:path";
4924
+ import { join as join13 } from "node:path";
4830
4925
  function projectStateDir(root, override, env = process.env) {
4831
4926
  if (override) return expandPath(root, override);
4832
4927
  const anchor = gitCommonDir(root) ?? realpathSync(root);
4833
4928
  const id = createHash("sha256").update(anchor).digest("hex").slice(0, 16);
4834
- const base = env["XDG_STATE_HOME"] || join12(homedir3(), ".local", "state");
4835
- return join12(base, "pmcp", "projects", id);
4929
+ const base = env["XDG_STATE_HOME"] || join13(homedir3(), ".local", "state");
4930
+ return join13(base, "pmcp", "projects", id);
4836
4931
  }
4837
4932
 
4838
4933
  // src/hooks/entry/logger.ts
@@ -4847,7 +4942,7 @@ function hookLogger(root, compiled, runtime2, event) {
4847
4942
  process.env["PMCP_LOG"]
4848
4943
  );
4849
4944
  const file2 = compiled?.logFile ? expandPath(root, compiled.logFile) : void 0;
4850
- const dir = file2 ? dirname8(file2) : join13(projectStateDir(root, compiled?.stateDir), "logs");
4945
+ const dir = file2 ? dirname8(file2) : join14(projectStateDir(root, compiled?.stateDir), "logs");
4851
4946
  const sink = fileSink({
4852
4947
  dir,
4853
4948
  ...file2 ? { file: file2 } : {},
@@ -4907,7 +5002,7 @@ var gitProbe = {
4907
5002
  };
4908
5003
 
4909
5004
  // src/sessions/files/broadcast.ts
4910
- import { join as join14 } from "node:path";
5005
+ import { join as join15 } from "node:path";
4911
5006
 
4912
5007
  // src/sessions/files/json.ts
4913
5008
  import { dirname as dirname9 } from "node:path";
@@ -4954,8 +5049,8 @@ function writeLines(path, values) {
4954
5049
 
4955
5050
  // src/sessions/files/broadcast.ts
4956
5051
  function filesBroadcast(dir, keep, registry2) {
4957
- const latestPath = join14(dir, STATE_FILES.broadcast);
4958
- const historyPath = join14(dir, STATE_FILES.history);
5052
+ const latestPath = join15(dir, STATE_FILES.broadcast);
5053
+ const historyPath = join15(dir, STATE_FILES.history);
4959
5054
  const list = () => {
4960
5055
  const latest = asBroadcast(readJson3(latestPath));
4961
5056
  if (!latest) return [];
@@ -4999,9 +5094,9 @@ function filesBroadcast(dir, keep, registry2) {
4999
5094
  }
5000
5095
 
5001
5096
  // src/sessions/files/leases.ts
5002
- import { dirname as dirname10, join as join15 } from "node:path";
5097
+ import { dirname as dirname10, join as join16 } from "node:path";
5003
5098
  function filesLeases(dir, files2 = {}) {
5004
- const leasePath = (name) => files2[name]?.file ?? join15(dir, leaseFile(name));
5099
+ const leasePath = (name) => files2[name]?.file ?? join16(dir, leaseFile(name));
5005
5100
  const read3 = (name) => {
5006
5101
  const lease = asLease(readJson3(leasePath(name)));
5007
5102
  if (!lease || !alive(lease.pid)) return null;
@@ -5051,28 +5146,28 @@ function filesLeases(dir, files2 = {}) {
5051
5146
  }
5052
5147
 
5053
5148
  // src/sessions/files/mailbox.ts
5054
- import { join as join16 } from "node:path";
5149
+ import { join as join17 } from "node:path";
5055
5150
  var ID = /^\d{13}-[0-9a-f]{8}$/u;
5056
5151
  var SAFE_KEY = /^@?[\w.-]+$/u;
5057
5152
  function filesMailbox(dir, settings) {
5058
- const messages = join16(dir, "messages");
5059
- const inbox = join16(dir, "inbox");
5060
- const pathOf = (id) => join16(messages, `${id}.json`);
5153
+ const messages = join17(dir, "messages");
5154
+ const inbox = join17(dir, "inbox");
5155
+ const pathOf = (id) => join17(messages, `${id}.json`);
5061
5156
  const marker = (key, id, kind) => {
5062
5157
  if (!SAFE_KEY.test(key) || !ID.test(id))
5063
5158
  throw new Error(`invalid mailbox key ${key} or id ${id}`);
5064
- return join16(inbox, key, `${id}.${kind}`);
5159
+ return join17(inbox, key, `${id}.${kind}`);
5065
5160
  };
5066
5161
  const audit = (event, fields2) => {
5067
5162
  if (!settings.audit) return;
5068
5163
  const line = { at: (/* @__PURE__ */ new Date()).toISOString(), event, ...fields2 };
5069
- appendFileSync(join16(dir, "messages.jsonl"), `${JSON.stringify(line)}
5164
+ appendFileSync(join17(dir, "messages.jsonl"), `${JSON.stringify(line)}
5070
5165
  `, {
5071
5166
  mode: 384
5072
5167
  });
5073
5168
  };
5074
5169
  const touch = (path) => {
5075
- mkdirSync(join16(path, ".."), { recursive: true, mode: 448 });
5170
+ mkdirSync(join17(path, ".."), { recursive: true, mode: 448 });
5076
5171
  try {
5077
5172
  writeFileSync(path, "", { flag: "wx", mode: 384 });
5078
5173
  return true;
@@ -5089,7 +5184,7 @@ function filesMailbox(dir, settings) {
5089
5184
  if (existsSync(inbox))
5090
5185
  for (const key of readdirSync(inbox))
5091
5186
  for (const kind of ["ack", "delivered"])
5092
- rmSync(join16(inbox, key, `${message.id}.${kind}`), { force: true });
5187
+ rmSync(join17(inbox, key, `${message.id}.${kind}`), { force: true });
5093
5188
  audit(event, { id: message.id });
5094
5189
  };
5095
5190
  return {
@@ -5165,9 +5260,9 @@ function filesMailbox(dir, settings) {
5165
5260
  }
5166
5261
 
5167
5262
  // src/sessions/files/pause.ts
5168
- import { join as join17 } from "node:path";
5263
+ import { join as join18 } from "node:path";
5169
5264
  function filesPause(dir) {
5170
- const path = join17(dir, STATE_FILES.pause);
5265
+ const path = join18(dir, STATE_FILES.pause);
5171
5266
  return {
5172
5267
  read: () => asPause(readJson3(path)),
5173
5268
  write(pause2) {
@@ -5185,11 +5280,11 @@ function filesPause(dir) {
5185
5280
  }
5186
5281
 
5187
5282
  // src/sessions/files/registry.ts
5188
- import { join as join18 } from "node:path";
5283
+ import { join as join19 } from "node:path";
5189
5284
  var SESSION_ID = /^[A-Za-z0-9_-]{8,64}$/u;
5190
5285
  function filesRegistry(dir, staleMs) {
5191
- const fleetDir = join18(dir, STATE_FILES.records);
5192
- const pathOf = (session) => join18(fleetDir, `${session}.json`);
5286
+ const fleetDir = join19(dir, STATE_FILES.records);
5287
+ const pathOf = (session) => join19(fleetDir, `${session}.json`);
5193
5288
  const get = (session) => SESSION_ID.test(session) ? asRecord(readJson3(pathOf(session))) : null;
5194
5289
  const list = (now = Date.now()) => {
5195
5290
  let names2 = [];
@@ -5198,7 +5293,7 @@ function filesRegistry(dir, staleMs) {
5198
5293
  } catch {
5199
5294
  return [];
5200
5295
  }
5201
- return names2.map((name) => asRecord(readJson3(join18(fleetDir, name)))).filter((record) => record !== null).map((record) => ({ ...record, live: isLive(record, now, staleMs) }));
5296
+ return names2.map((name) => asRecord(readJson3(join19(fleetDir, name)))).filter((record) => record !== null).map((record) => ({ ...record, live: isLive(record, now, staleMs) }));
5202
5297
  };
5203
5298
  const remove = (session) => {
5204
5299
  if (SESSION_ID.test(session)) rmSync(pathOf(session), { force: true });
@@ -5272,15 +5367,15 @@ function createFilesStore(dir, options2 = {}) {
5272
5367
  }
5273
5368
 
5274
5369
  // src/sessions/lease-files.ts
5275
- import { dirname as dirname11, isAbsolute as isAbsolute13, join as join19 } from "node:path";
5370
+ import { dirname as dirname11, isAbsolute as isAbsolute13, join as join20 } from "node:path";
5276
5371
  var GATE_DIR = "${gate_dir}/";
5277
5372
  function gateTree(root, stateDir, gate, env) {
5278
5373
  const override = gate.treeEnv ? env[gate.treeEnv] : void 0;
5279
5374
  if (override) return override;
5280
- return gate.tree ? expandPath(root, gate.tree) : join19(stateDir, "gate", "tree");
5375
+ return gate.tree ? expandPath(root, gate.tree) : join20(stateDir, "gate", "tree");
5281
5376
  }
5282
5377
  function resolveLeaseFiles(files2, gateDir) {
5283
- const resolve20 = (path) => path?.startsWith(GATE_DIR) ? join19(gateDir, path.slice(GATE_DIR.length)) : path;
5378
+ const resolve20 = (path) => path?.startsWith(GATE_DIR) ? join20(gateDir, path.slice(GATE_DIR.length)) : path;
5284
5379
  return Object.fromEntries(
5285
5380
  Object.entries(files2 ?? {}).map(([name, f]) => {
5286
5381
  const file2 = resolve20(f.file);
@@ -10,12 +10,12 @@ import {
10
10
  async function run(context) {
11
11
  const [verb = "list", ...extra] = context.args.positional;
12
12
  if (extra.length) throw new ArgumentError("Use hooks list or hooks test");
13
- if (verb === "list") return (await import("./list-T6JWLS6W.js")).run(context);
14
- if (verb === "test") return (await import("./test-B7KRCCL7.js")).run(context);
13
+ if (verb === "list") return (await import("./list-DNEAYNRB.js")).run(context);
14
+ if (verb === "test") return (await import("./test-EZLVHD77.js")).run(context);
15
15
  throw new ArgumentError("Use hooks list or hooks test");
16
16
  }
17
17
  var hooksCommand = { ...hooksSpec, run };
18
18
  export {
19
19
  hooksCommand
20
20
  };
21
- //# sourceMappingURL=hooks-JROFOE6Y.js.map
21
+ //# sourceMappingURL=hooks-JGYIF2AI.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-F5XMGOOX.js";
5
5
  import {
6
6
  specFrom
7
- } from "./chunk-QXZLFIY2.js";
7
+ } from "./chunk-TPE2RY7R.js";
8
8
  import "./chunk-7DLZC73N.js";
9
9
  import {
10
10
  approvalDir,
@@ -12,15 +12,14 @@ import {
12
12
  hostDigest,
13
13
  projectedFiles,
14
14
  writeApproval
15
- } from "./chunk-LREOXJ4I.js";
16
- import "./chunk-DFZESOWW.js";
15
+ } from "./chunk-4MFXXSUH.js";
16
+ import "./chunk-YN5XSC7M.js";
17
17
  import "./chunk-HQOB7OQS.js";
18
- import "./chunk-J5XQW2CM.js";
18
+ import "./chunk-7B2KRL2H.js";
19
19
  import "./chunk-2Q6MNGU5.js";
20
- import "./chunk-D5D3V6RU.js";
20
+ import "./chunk-ICF2JZSN.js";
21
21
  import "./chunk-UD3BEEBQ.js";
22
22
  import "./chunk-ISNRDHSD.js";
23
- import "./chunk-G7JONWL4.js";
24
23
  import "./chunk-EATCUWGG.js";
25
24
  import "./chunk-NRBQK6UX.js";
26
25
  import "./chunk-3PW4FI7U.js";
@@ -28,6 +27,8 @@ import "./chunk-DHAPQUEF.js";
28
27
  import {
29
28
  ancestors
30
29
  } from "./chunk-C4NHQGHL.js";
30
+ import "./chunk-P6LNYYYH.js";
31
+ import "./chunk-G7JONWL4.js";
31
32
  import "./chunk-Q5H3L6Y4.js";
32
33
  import {
33
34
  ArgumentError
@@ -35,11 +36,11 @@ import {
35
36
  import "./chunk-V4NPDK6X.js";
36
37
  import {
37
38
  hostDoctor
38
- } from "./chunk-ONQJCG2X.js";
39
- import "./chunk-DZV7EQ5Q.js";
39
+ } from "./chunk-H3NMLKS6.js";
40
+ import "./chunk-HU2P5Q4D.js";
40
41
  import "./chunk-OEH47H6A.js";
41
42
  import "./chunk-IJBSOWHK.js";
42
- import "./chunk-V4K6Q3GF.js";
43
+ import "./chunk-QJEOFF2R.js";
43
44
  import "./chunk-QPL7E2HW.js";
44
45
  import "./chunk-PMJG2CXF.js";
45
46
  import "./chunk-J6KL3COD.js";
@@ -179,7 +180,7 @@ async function runHost(context) {
179
180
  return 1;
180
181
  }
181
182
  if (verb === "up" || verb === "down" || verb === "unit") {
182
- const { runHostVerb } = await import("./host-run-DMNF3PWU.js");
183
+ const { runHostVerb } = await import("./host-run-CAL5DG4Z.js");
183
184
  return runHostVerb(verb, spec, context);
184
185
  }
185
186
  if (verb === "status") {
@@ -207,4 +208,4 @@ async function runHost(context) {
207
208
  export {
208
209
  runHost
209
210
  };
210
- //# sourceMappingURL=host-MAVWRD5G.js.map
211
+ //# sourceMappingURL=host-EGUDTIDS.js.map
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  requireTerminal,
3
3
  terminalSupport
4
- } from "./chunk-5OVHW7AG.js";
4
+ } from "./chunk-OGP3MGDZ.js";
5
5
  import "./chunk-5ZABTVSW.js";
6
- import "./chunk-NNOATTGX.js";
6
+ import "./chunk-THSG4SFC.js";
7
7
  import "./chunk-LMT3PPXJ.js";
8
- import "./chunk-NNKLVEQZ.js";
8
+ import "./chunk-M73BQJOO.js";
9
9
  import "./chunk-R2GPCZUX.js";
10
10
  import "./chunk-34DECPVC.js";
11
- import "./chunk-ONQJCG2X.js";
12
- import "./chunk-DZV7EQ5Q.js";
11
+ import "./chunk-H3NMLKS6.js";
12
+ import "./chunk-HU2P5Q4D.js";
13
13
  import "./chunk-OEH47H6A.js";
14
14
  import "./chunk-IJBSOWHK.js";
15
- import "./chunk-V4K6Q3GF.js";
15
+ import "./chunk-QJEOFF2R.js";
16
16
  import "./chunk-QPL7E2HW.js";
17
17
  import "./chunk-PMJG2CXF.js";
18
18
  import "./chunk-J6KL3COD.js";
@@ -20,4 +20,4 @@ export {
20
20
  requireTerminal,
21
21
  terminalSupport
22
22
  };
23
- //# sourceMappingURL=host-FPTPSHL2.js.map
23
+ //# sourceMappingURL=host-T43WUL2C.js.map