@modootoday/pmcp 0.22.2 → 0.22.3

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 (100) 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-AWZ32Z66.js → apply-CYVC5LDG.js} +11 -11
  6. package/dist/{broadcast-ZALGUJVR.js → broadcast-DZGMSZRG.js} +3 -3
  7. package/dist/{chunk-57Q75MS4.js → chunk-5QKXEWDB.js} +2 -2
  8. package/dist/{chunk-OMIIXLMO.js → chunk-7DYWCQVB.js} +1 -1
  9. package/dist/{chunk-MR5IBS6L.js → chunk-7I7O7ZNT.js} +41 -10
  10. package/dist/{chunk-JP27V2H4.js → chunk-7LUYI7QM.js} +2 -2
  11. package/dist/{chunk-T6MQPVLH.js → chunk-7Q3AIS4Q.js} +2 -2
  12. package/dist/{chunk-7FV2LORT.js → chunk-B2WRYGHJ.js} +4 -3
  13. package/dist/{chunk-VGW3N3HC.js → chunk-CALWIRAI.js} +14 -14
  14. package/dist/{chunk-W6GA5RAW.js → chunk-CILQCERV.js} +2 -2
  15. package/dist/{chunk-U3IHGG7X.js → chunk-ESCOMAPX.js} +3 -3
  16. package/dist/{chunk-NFJ44OE2.js → chunk-FE7WOHZM.js} +13 -4
  17. package/dist/{chunk-5A7QRZP6.js → chunk-HV52EUSL.js} +5 -5
  18. package/dist/{chunk-SKOP4ZST.js → chunk-ICZH4NFR.js} +5 -5
  19. package/dist/chunk-JTRFZQTB.js +7 -0
  20. package/dist/{chunk-G25LCRIG.js → chunk-JUG4W7RF.js} +2 -2
  21. package/dist/{chunk-4Z6NPSWX.js → chunk-MLGXDSHZ.js} +8 -6
  22. package/dist/{chunk-GZQH3RJA.js → chunk-MQMWVJZB.js} +3 -3
  23. package/dist/{chunk-U2NWTZQP.js → chunk-MZF7VOQA.js} +2 -2
  24. package/dist/{chunk-GE2PHR35.js → chunk-NQFULJZC.js} +3 -3
  25. package/dist/{chunk-KLWZZTUQ.js → chunk-ONYZIC2F.js} +3 -3
  26. package/dist/{chunk-FOIQUPIQ.js → chunk-PR2RBEXI.js} +2 -2
  27. package/dist/{chunk-BUD3WS4Y.js → chunk-RZZZHQCE.js} +2 -2
  28. package/dist/{chunk-NAXUAC5S.js → chunk-ULFV3EIZ.js} +2 -2
  29. package/dist/{chunk-D2DDM5VZ.js → chunk-UQNRGU3V.js} +2 -2
  30. package/dist/{chunk-ZYLJUABY.js → chunk-V7LZTVWS.js} +2 -2
  31. package/dist/{chunk-5F7TL3V7.js → chunk-WPX4ONFT.js} +6 -6
  32. package/dist/{cli-6FWRBCWM.js → cli-34EDFXJA.js} +8 -8
  33. package/dist/{cli-BOSY6VFP.js → cli-A6HKRICM.js} +4 -4
  34. package/dist/cli.js +3 -3
  35. package/dist/{completion-V756JVX6.js → completion-FDLVWLAC.js} +2 -2
  36. package/dist/{diagnostics-R7S3DNXD.js → diagnostics-DYLW7WYV.js} +5 -5
  37. package/dist/{doctor-44S5EWK5.js → doctor-FRQ5H5FU.js} +12 -12
  38. package/dist/{entry-GSGCMXE5.js → entry-XPZZNQ4L.js} +9 -9
  39. package/dist/{exec-mcp-3COXHDYT.js → exec-mcp-HOM2ZANM.js} +8 -8
  40. package/dist/{harness-K4WL2NSH.js → harness-WIGJRE5P.js} +3 -3
  41. package/dist/harness-launch-gate.js +3 -3
  42. package/dist/harness-worker.js +5 -5
  43. package/dist/hook-body.js +108 -64
  44. package/dist/{hook-spec-hZL4MSgi.d.ts → hook-spec-Bd24eo2L.d.ts} +1 -0
  45. package/dist/{hooks-HQOLXR3A.js → hooks-MIF3FONJ.js} +4 -4
  46. package/dist/{host-4W3JUQAO.js → host-CE5TW5SC.js} +10 -10
  47. package/dist/{host-N5UILUK7.js → host-JKZLOCZS.js} +6 -6
  48. package/dist/{host-run-CVYRZB7R.js → host-run-MJGJ7NVE.js} +4 -4
  49. package/dist/http.js +1 -1
  50. package/dist/{import-mcp-IAGC3LJU.js → import-mcp-T3GZYEE5.js} +7 -7
  51. package/dist/index.d.ts +2 -2
  52. package/dist/index.js +11 -11
  53. package/dist/{init-HPEVKKMU.js → init-D5VPDF2B.js} +2 -2
  54. package/dist/{invoke-TD5YR2G7.js → invoke-HEAOQLFQ.js} +7 -7
  55. package/dist/{list-YUHJ5CTT.js → list-PCLCFG2J.js} +9 -9
  56. package/dist/{logout-JQ5UPC5W.js → logout-3ZXFXKHB.js} +8 -8
  57. package/dist/{logs-74JGLQG6.js → logs-UHJM7ZCL.js} +3 -3
  58. package/dist/{mailbox-VK5AVTHI.js → mailbox-NIMBOQPA.js} +3 -3
  59. package/dist/{mainline-7HO7RCQH.js → mainline-6CTSVOWP.js} +10 -7
  60. package/dist/{mcp-B6SYBT3X.js → mcp-T6PYHRUL.js} +2 -2
  61. package/dist/{pause-CZ2OZYLC.js → pause-CBZ3BTJL.js} +3 -3
  62. package/dist/project/hook-adapter.d.ts +1 -1
  63. package/dist/{project-GOW2MEFY.js → project-H4R3Q3QO.js} +4 -4
  64. package/dist/{report-Z3JV2PCT.js → report-ZHOHQ4PZ.js} +3 -3
  65. package/dist/{resume-DFIHT2RO.js → resume-UJEWQ66P.js} +3 -3
  66. package/dist/{run-ZOSIKNDX.js → run-FMTHUOAZ.js} +4 -4
  67. package/dist/{run-7UNRLLYD.js → run-V74M7PZK.js} +7 -7
  68. package/dist/{serve-VRBL67KO.js → serve-JKNEC4AX.js} +3 -3
  69. package/dist/{setup-QMYAW3MB.js → setup-HYEYYVDU.js} +3 -3
  70. package/dist/{smoke-EXPR7HLD.js → smoke-UA7VVDKD.js} +3 -3
  71. package/dist/{start-login-NRD323LK.js → start-login-JRMVLK5J.js} +8 -8
  72. package/dist/{status-ZY5B7V6R.js → status-6273XFHT.js} +8 -8
  73. package/dist/{status-3RTGDN2K.js → status-KN2ZE64O.js} +3 -3
  74. package/dist/{status-JN2GT5UM.js → status-RG2GFDQU.js} +10 -10
  75. package/dist/stdio.js +2 -2
  76. package/dist/{sweep-EPJMEZR6.js → sweep-EPZCW63Q.js} +3 -3
  77. package/dist/{test-VGJXKCQT.js → test-M365FK5N.js} +21 -14
  78. package/dist/{tui-GORRJIMA.js → tui-PKPYE76A.js} +4 -4
  79. package/dist/{unbroadcast-NTOC3PY3.js → unbroadcast-N6LXHAMT.js} +3 -3
  80. package/dist/{worker-LJG2NDMK.js → worker-C23EAPCY.js} +7 -7
  81. package/docs/commands.md +1 -1
  82. package/docs/git-workflow.md +1 -0
  83. package/docs/project-configuration.md +1 -0
  84. package/gemini-extension.json +2 -2
  85. package/mcp.json +1 -1
  86. package/package.json +5 -5
  87. package/plugin.json +1 -1
  88. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  89. package/plugins/pmcp/.mcp.json +1 -1
  90. package/plugins/pmcp/gemini-extension.json +2 -2
  91. package/plugins/pmcp/mcp.json +1 -1
  92. package/plugins/pmcp/mod/commands.ts +10 -4
  93. package/plugins/pmcp/mod/host.ts +17 -1
  94. package/plugins/pmcp/mod/reader/read.ts +3 -1
  95. package/plugins/pmcp/mod/reader/types.ts +2 -0
  96. package/plugins/pmcp/mod/register.tsx +2 -1
  97. package/plugins/pmcp/mod/snapshot.ts +1 -0
  98. package/plugins/pmcp/mod/state.ts +1 -0
  99. package/plugins/pmcp/plugin.json +1 -1
  100. package/dist/chunk-FWKQA6TX.js +0 -7
package/dist/stdio.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  resolveRoots,
5
5
  serve,
6
6
  serveWithMailbox
7
- } from "./chunk-ZYLJUABY.js";
8
- import "./chunk-G25LCRIG.js";
7
+ } from "./chunk-V7LZTVWS.js";
8
+ import "./chunk-JUG4W7RF.js";
9
9
  import "./chunk-6WXMJOMI.js";
10
10
  import "./chunk-4CRRLDDS.js";
11
11
  import "./chunk-YSAWTGNA.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  change
3
- } from "./chunk-7FV2LORT.js";
4
- import "./chunk-MR5IBS6L.js";
3
+ } from "./chunk-B2WRYGHJ.js";
4
+ import "./chunk-7I7O7ZNT.js";
5
5
  import "./chunk-Z6WRFOFT.js";
6
6
  import "./chunk-A4PKLESO.js";
7
7
  import "./chunk-OEH47H6A.js";
@@ -14,4 +14,4 @@ var run = (context) => change(context, "sweep");
14
14
  export {
15
15
  run
16
16
  };
17
- //# sourceMappingURL=sweep-EPJMEZR6.js.map
17
+ //# sourceMappingURL=sweep-EPZCW63Q.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  specFrom
3
- } from "./chunk-FOIQUPIQ.js";
3
+ } from "./chunk-PR2RBEXI.js";
4
4
  import {
5
5
  sourceFor
6
6
  } from "./chunk-7TD53M7L.js";
@@ -11,7 +11,7 @@ import {
11
11
  commandsOf,
12
12
  customMode,
13
13
  customPolicy
14
- } from "./chunk-4Z6NPSWX.js";
14
+ } from "./chunk-MLGXDSHZ.js";
15
15
  import "./chunk-UKR64U7J.js";
16
16
  import "./chunk-XZ2TDH3J.js";
17
17
  import "./chunk-KUBHGVTD.js";
@@ -24,13 +24,13 @@ import {
24
24
  } from "./chunk-HQOB7OQS.js";
25
25
  import "./chunk-73AKO4UL.js";
26
26
  import "./chunk-P6LNYYYH.js";
27
- import "./chunk-NFJ44OE2.js";
27
+ import "./chunk-FE7WOHZM.js";
28
28
  import "./chunk-2Q6MNGU5.js";
29
29
  import {
30
30
  SESSION_ID,
31
31
  createFilesStore,
32
32
  writeJson
33
- } from "./chunk-MR5IBS6L.js";
33
+ } from "./chunk-7I7O7ZNT.js";
34
34
  import {
35
35
  STATE_FILES,
36
36
  asBroadcast,
@@ -46,13 +46,13 @@ import {
46
46
  NEUTRAL_EVENTS,
47
47
  RUNTIMES,
48
48
  RUNTIME_IDS
49
- } from "./chunk-OMIIXLMO.js";
49
+ } from "./chunk-7DYWCQVB.js";
50
50
  import {
51
51
  ArgumentError,
52
52
  one
53
53
  } from "./chunk-A4PKLESO.js";
54
54
  import "./chunk-V4NPDK6X.js";
55
- import "./chunk-NAXUAC5S.js";
55
+ import "./chunk-ULFV3EIZ.js";
56
56
  import "./chunk-NRBQK6UX.js";
57
57
  import {
58
58
  expandPath
@@ -62,7 +62,7 @@ import {
62
62
  worktreesOf
63
63
  } from "./chunk-IJBSOWHK.js";
64
64
  import "./chunk-XWLMZKH2.js";
65
- import "./chunk-FWKQA6TX.js";
65
+ import "./chunk-JTRFZQTB.js";
66
66
  import "./chunk-GJXOFDJT.js";
67
67
  import "./chunk-PMJG2CXF.js";
68
68
  import "./chunk-J6KL3COD.js";
@@ -264,11 +264,12 @@ async function runPolicy(selected, input, deps) {
264
264
  const { policy, mode } = selected;
265
265
  const log = deps.log.child({ policy: policy.id });
266
266
  const started = deps.now();
267
- const finish = (decision) => {
267
+ const finish = (decision, raw) => {
268
268
  deps.onPolicy?.({
269
269
  policy: policy.id,
270
270
  mode,
271
271
  decision,
272
+ ...raw ? { raw } : {},
272
273
  durationMs: deps.now() - started
273
274
  });
274
275
  return decision;
@@ -308,7 +309,7 @@ async function runPolicy(selected, input, deps) {
308
309
  ...input.tool ? { tool: input.tool.kind, native: input.tool.native } : {},
309
310
  duration_ms: deps.now() - started
310
311
  });
311
- return finish(decision);
312
+ return finish(decision, raw);
312
313
  } catch (error) {
313
314
  log.error("policy failed", {
314
315
  error: error instanceof Error ? error.message : String(error)
@@ -533,7 +534,11 @@ async function simulate(input, compiled, store) {
533
534
  source: sourceFor(result.policy),
534
535
  skipped: skipped.has(result.policy),
535
536
  verdict: result.decision.verdict ?? "allow",
536
- reason: result.decision.reason ?? result.decision.context?.join("\n") ?? null
537
+ reason: result.decision.reason ?? result.decision.context?.join("\n") ?? null,
538
+ raw: result.raw ? {
539
+ verdict: result.raw.verdict ?? "allow",
540
+ reason: result.raw.reason ?? result.raw.context?.join("\n") ?? null
541
+ } : null
537
542
  });
538
543
  }
539
544
  });
@@ -544,7 +549,7 @@ async function simulate(input, compiled, store) {
544
549
  async function run(context) {
545
550
  const fixtures = one(context.args, "fixtures");
546
551
  if (fixtures !== void 0)
547
- return (await import("./smoke-EXPR7HLD.js")).run(context, fixtures);
552
+ return (await import("./smoke-UA7VVDKD.js")).run(context, fixtures);
548
553
  const runtime = one(context.args, "runtime");
549
554
  if (!RUNTIME_IDS.includes(runtime))
550
555
  throw new ArgumentError("--runtime must be claude or codex");
@@ -577,7 +582,8 @@ async function run(context) {
577
582
  throw new ArgumentError("Tool selectors require before_tool or after_tool");
578
583
  const scratch = mkdtempSync(join3(tmpdir(), "pmcp-hooks-test-"));
579
584
  try {
580
- const store = createFilesStore(scratch, compiled.sessions);
585
+ const { pauseFile: _project, ...sessions } = compiled.sessions;
586
+ const store = createFilesStore(scratch, sessions);
581
587
  seedState(store, context.cwd, one(context.args, "session-state"));
582
588
  const report = await simulate(input, compiled, store);
583
589
  const rendered = adapter.render(input, report.decision);
@@ -594,7 +600,8 @@ async function run(context) {
594
600
  if (!context.args.flags.has("json")) {
595
601
  for (const row of report.policies)
596
602
  context.ui.line(
597
- row.policy + ": " + row.verdict + " " + row.durationMs + "ms" + (row.skipped ? " (external effects skipped)" : "") + (row.reason ? " " + row.reason : "")
603
+ row.policy + ": " + row.verdict + " " + row.durationMs + "ms" + (row.skipped ? " (external effects skipped)" : "") + (row.reason ? " " + row.reason : "") + // A guard in observe, warn or graded mode: what it found, before its mode.
604
+ (row.raw && row.raw.verdict !== row.verdict ? ` (${row.mode}; found ${row.raw.verdict}` + (row.raw.reason && row.raw.reason !== row.reason ? `: ${row.raw.reason}` : "") + ")" : "")
598
605
  );
599
606
  context.ui.data(
600
607
  "Rendered (exit " + rendered.exitCode + "):\n" + rendered.stdout + "\n"
@@ -608,4 +615,4 @@ async function run(context) {
608
615
  export {
609
616
  run
610
617
  };
611
- //# sourceMappingURL=test-VGJXKCQT.js.map
618
+ //# sourceMappingURL=test-M365FK5N.js.map
@@ -112,10 +112,10 @@ var tuiCommand = {
112
112
  try {
113
113
  let receipt;
114
114
  if (invocation.action === "doctor") {
115
- const { inspectTerminalHost } = await import("./diagnostics-R7S3DNXD.js");
115
+ const { inspectTerminalHost } = await import("./diagnostics-DYLW7WYV.js");
116
116
  receipt = inspectTerminalHost();
117
117
  } else if (invocation.action === "start-worker") {
118
- const { startWorkspaceWorker } = await import("./worker-LJG2NDMK.js");
118
+ const { startWorkspaceWorker } = await import("./worker-C23EAPCY.js");
119
119
  receipt = await startWorkspaceWorker(
120
120
  { config: invocation.startup?.config, cwd: context.cwd },
121
121
  invocation.startup.runtime,
@@ -128,7 +128,7 @@ var tuiCommand = {
128
128
  cwd: context.cwd
129
129
  });
130
130
  } else {
131
- const { launchStartup, planStartup } = await import("./entry-GSGCMXE5.js");
131
+ const { launchStartup, planStartup } = await import("./entry-XPZZNQ4L.js");
132
132
  const request = { ...invocation.startup, cwd: context.cwd };
133
133
  receipt = invocation.action === "plan" ? planStartup(request) : await launchStartup(
134
134
  request,
@@ -150,4 +150,4 @@ var tuiCommand = {
150
150
  export {
151
151
  tuiCommand
152
152
  };
153
- //# sourceMappingURL=tui-GORRJIMA.js.map
153
+ //# sourceMappingURL=tui-PKPYE76A.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  change
3
- } from "./chunk-7FV2LORT.js";
4
- import "./chunk-MR5IBS6L.js";
3
+ } from "./chunk-B2WRYGHJ.js";
4
+ import "./chunk-7I7O7ZNT.js";
5
5
  import "./chunk-Z6WRFOFT.js";
6
6
  import "./chunk-A4PKLESO.js";
7
7
  import "./chunk-OEH47H6A.js";
@@ -14,4 +14,4 @@ var run = (context) => change(context, "unbroadcast");
14
14
  export {
15
15
  run
16
16
  };
17
- //# sourceMappingURL=unbroadcast-NTOC3PY3.js.map
17
+ //# sourceMappingURL=unbroadcast-N6LXHAMT.js.map
@@ -5,21 +5,21 @@ import {
5
5
  } from "./chunk-C3G75JH7.js";
6
6
  import {
7
7
  invoke
8
- } from "./chunk-SKOP4ZST.js";
8
+ } from "./chunk-ICZH4NFR.js";
9
9
  import "./chunk-DZ2MRTYT.js";
10
- import "./chunk-GE2PHR35.js";
11
- import "./chunk-T6MQPVLH.js";
10
+ import "./chunk-NQFULJZC.js";
11
+ import "./chunk-7Q3AIS4Q.js";
12
12
  import {
13
13
  locateExecutable
14
14
  } from "./chunk-R2GPCZUX.js";
15
- import "./chunk-D2DDM5VZ.js";
15
+ import "./chunk-UQNRGU3V.js";
16
16
  import "./chunk-34DECPVC.js";
17
- import "./chunk-NAXUAC5S.js";
17
+ import "./chunk-ULFV3EIZ.js";
18
18
  import "./chunk-NRBQK6UX.js";
19
19
  import "./chunk-OEH47H6A.js";
20
20
  import "./chunk-IJBSOWHK.js";
21
21
  import "./chunk-XWLMZKH2.js";
22
- import "./chunk-FWKQA6TX.js";
22
+ import "./chunk-JTRFZQTB.js";
23
23
  import "./chunk-GJXOFDJT.js";
24
24
  import "./chunk-PMJG2CXF.js";
25
25
  import {
@@ -79,4 +79,4 @@ async function startWorkspaceWorker(request, runtime, memoryMb) {
79
79
  export {
80
80
  startWorkspaceWorker
81
81
  };
82
- //# sourceMappingURL=worker-LJG2NDMK.js.map
82
+ //# sourceMappingURL=worker-C23EAPCY.js.map
package/docs/commands.md CHANGED
@@ -40,7 +40,7 @@ pmcp hooks test --runtime claude --event before_tool --path fixture.txt --sessio
40
40
 
41
41
  List compiled policies per runtime and neutral event, including mode and source table. Test constructs a synthetic payload in that runtime's recorded shape, normalizes it, runs policy selection and composition, lowers unsupported asks, and renders the native response. The event accepts a neutral name or a supported native name. Choose at most one of `--command`, `--path` and `--tool`; these selectors require a tool event. Tool accepts a native name or shell, edit, read or other, subject to that runtime's tool vocabulary. No native runtime or model call is needed.
42
42
 
43
- Session state is isolated in a temporary directory, then removed. Commands and patches are classified, never executed. External custom guards, validators, Stop projection subprocesses and worktree synchronization are explicitly marked skipped. Their simulated context reports this limitation; the command does not claim a full live result. Exit 0 means the simulation completed, even when the rendered decision denies; invalid input exits 2. Per-policy timings and reasons precede the rendered output in human mode.
43
+ Session state is isolated in a temporary directory, then removed. Commands and patches are classified, never executed. External custom guards, validators, Stop projection subprocesses and worktree synchronization are explicitly marked skipped. Their simulated context reports this limitation; the command does not claim a full live result. Exit 0 means the simulation completed, even when the rendered decision denies; invalid input exits 2. Per-policy timings and reasons precede the rendered output in human mode. Each policy row also gives `raw`, `{verdict, reason}` as the guard found it before its mode, so a guard in `observe`, `warn` or `graded` mode shows what `deny` would have done; human mode adds it as `(observe; found deny: …)` where it differs.
44
44
 
45
45
  `--session-state` accepts a JSON object with optional `records` (session records with valid 8–64 character IDs), `pause` (by, reason, since), `leases` (name to pid, subject, since, optional cwd), and `broadcast` (id, by, text, since). Pause and broadcast may be null. Existing liveness and unseen-broadcast rules apply. This file and the real session store remain unchanged.
46
46
 
@@ -197,6 +197,7 @@ strings, and JSON files are written whole through a rename.
197
197
  | `lock` | beside the gate tree | Empty; held with `flock -x` for the whole of one delivery's gate. |
198
198
  | `holder.json` | beside `lock` | `{tip, subject, checkout, pid, startedAt}`: the commit being gated (full hash), its subject, the checkout delivering it, the holding process and when it took the lock. Removed by its writer before the lock is released, and only when `pid` is its own. |
199
199
  | gate logs | `[git.mainline.gate] log_dir`, else `<state dir>/gate-logs` | `<tip>/<UTC time>-<run>.log` per gate run of a replayed tip (full hash), the output as it streamed; `<tip>/latest` holds the newest file's name. The newest `log_keep` tip directories are kept. |
200
+ | `pause.json` | the state directory, or `[sessions] pause_file` | `{by, reason, since}`, all strings: who paused (a session id or a name), why, and when. Present means paused, for every session but `by`; a file missing a field or not JSON reads as no pause. Removed on resume. |
200
201
  | `<name>-lease.json` | the state directory, or `[sessions.leases.<name>] file` | `{pid, subject, since, cwd?}`. A lease whose `pid` is not alive is free; whoever takes it next replaces the file. |
201
202
  | lease events | `[sessions.leases.<name>] events` | JSON Lines, one per delivery that changed the leased paths: `{at, subject, commit, hash, installed, lease}`, with `commit` the delivered upstream (10 characters), `hash` the leased files' hash in the main checkout after sync, and `installed` whether sync's install ran for that hash. |
202
203
  | install stamp | `[git.mainline.sync] stamp`, else pmcp's state directory | One line: the hash last installed. With `stamp_hash = "plain"` it is the sha256 hex of the single `install_when_changed` file's bytes; with `"pmcp"`, a hash of every listed path and its name. |
@@ -482,6 +482,7 @@ lives in one directory shared by every checkout of the repository.
482
482
  | ---------------- | ------ | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
483
483
  | `store` | string | `"files"` | The only store. |
484
484
  | `state_dir` | path | `$XDG_STATE_HOME/pmcp/projects/<id>` (`~/.local/state/...`) | `<id>` is the first 16 hex digits of the sha256 of the git common directory. `~`, `~/` and `$HOME/` expand to the home directory and a relative path is relative to the main checkout: the directory holding `pmcp.toml`, taken in the worktree of the git common directory, so the main checkout and every linked worktree share one state. Outside git it is relative to the directory holding `pmcp.toml`. The hooks, the Claude Code session panes and the git commands resolve it the same way; so does `[git.mainline.gate] tree`. |
485
+ | `pause_file` | path | `<state dir>/pause.json` | Where the pause lives: absolute, `~/…`, `$HOME/…`, or `${gate_dir}/…` for the directory of the gate tree (so it follows `[git.mainline.gate] tree_env`). Point it at the file another tool already pauses the same work with; `pmcp sessions pause` and `resume`, `/pmcp pause`, the `[sessions.pause]` guard, `pmcp git deliver` (`--during-pause` still overrides) and `pmcp git sync` then all read and write that file. Its format is in [Shared file formats](git-workflow.md#shared-file-formats). |
485
486
 
486
487
  `store` and `state_dir` alone enable nothing; each feature has its own table:
487
488
 
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "mcpServers": {
5
5
  "pmcp": {
6
6
  "type": "stdio",
7
7
  "command": "npx",
8
- "args": ["-y", "@modootoday/pmcp@0.22.2", "serve"]
8
+ "args": ["-y", "@modootoday/pmcp@0.22.3", "serve"]
9
9
  }
10
10
  }
11
11
  }
package/mcp.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "pmcp": {
5
5
  "type": "stdio",
6
6
  "command": "npx",
7
- "args": ["-y", "@modootoday/pmcp@0.22.2", "serve"]
7
+ "args": ["-y", "@modootoday/pmcp@0.22.3", "serve"]
8
8
  }
9
9
  }
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modootoday/pmcp",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "license": "Elastic-2.0",
5
5
  "author": "modootoday",
6
6
  "description": "Use the skills your packages already ship, and keep your AI tools' project configuration in one place.",
@@ -136,9 +136,9 @@
136
136
  "bun": ">=1.3.0"
137
137
  },
138
138
  "optionalDependencies": {
139
- "@modootoday/pmcp-linux-x64": "0.22.2",
140
- "@modootoday/pmcp-linux-arm64": "0.22.2",
141
- "@modootoday/pmcp-darwin-x64": "0.22.2",
142
- "@modootoday/pmcp-darwin-arm64": "0.22.2"
139
+ "@modootoday/pmcp-linux-x64": "0.22.3",
140
+ "@modootoday/pmcp-linux-arm64": "0.22.3",
141
+ "@modootoday/pmcp-darwin-x64": "0.22.3",
142
+ "@modootoday/pmcp-darwin-arm64": "0.22.3"
143
143
  }
144
144
  }
package/plugin.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pmcp",
4
- "version": "0.22.2",
4
+ "version": "0.22.3",
5
5
  "description": "Find package skills and use native runtime project configuration.",
6
6
  "author": { "name": "modootoday" },
7
7
  "license": "Elastic-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "description": "Find package skills and use native runtime project configuration.",
5
5
  "author": { "name": "modootoday" },
6
6
  "license": "Elastic-2.0",
@@ -3,7 +3,7 @@
3
3
  "pmcp": {
4
4
  "type": "stdio",
5
5
  "command": "npx",
6
- "args": ["-y", "@modootoday/pmcp@0.22.2", "serve"]
6
+ "args": ["-y", "@modootoday/pmcp@0.22.3", "serve"]
7
7
  }
8
8
  }
9
9
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "mcpServers": {
5
5
  "pmcp": {
6
6
  "type": "stdio",
7
7
  "command": "npx",
8
- "args": ["-y", "@modootoday/pmcp@0.22.2", "serve"]
8
+ "args": ["-y", "@modootoday/pmcp@0.22.3", "serve"]
9
9
  }
10
10
  }
11
11
  }
@@ -4,7 +4,7 @@
4
4
  "pmcp": {
5
5
  "type": "stdio",
6
6
  "command": "npx",
7
- "args": ["-y", "@modootoday/pmcp@0.22.2", "serve"]
7
+ "args": ["-y", "@modootoday/pmcp@0.22.3", "serve"]
8
8
  }
9
9
  }
10
10
  }
@@ -2,14 +2,20 @@ import { STATE_PATHS } from "./reader/index";
2
2
  import { refresh } from "./snapshot";
3
3
  import { PANE_ID, state } from "./state";
4
4
 
5
+ // The pause may live outside the state dir ([sessions] pause_file); the rest never does.
6
+ function statePath(name: string): string {
7
+ if (name === STATE_PATHS.pause && state.pauseFile) return state.pauseFile;
8
+ return `${state.stateDir}/${name}`;
9
+ }
10
+
5
11
  async function writeState($: any, name: string, value: object): Promise<void> {
6
- const dir = state.stateDir;
7
- await $.process.run(["mkdir", "-p", dir]);
8
- await $.fs.write(`${dir}/${name}`, `${JSON.stringify(value, null, 2)}\n`);
12
+ const path = statePath(name);
13
+ await $.process.run(["mkdir", "-p", path.slice(0, path.lastIndexOf("/"))]);
14
+ await $.fs.write(path, `${JSON.stringify(value, null, 2)}\n`);
9
15
  }
10
16
 
11
17
  async function removeState($: any, name: string): Promise<void> {
12
- await $.process.run(["rm", "-f", `${state.stateDir}/${name}`]);
18
+ await $.process.run(["rm", "-f", statePath(name)]);
13
19
  }
14
20
 
15
21
  async function togglePane($: any): Promise<{ text: string }> {
@@ -1,4 +1,4 @@
1
- import { parseUiSettings, UI_SETTINGS_FILE } from "./reader/index";
1
+ import { parseUiSettings, STATE_PATHS, UI_SETTINGS_FILE } from "./reader/index";
2
2
  import type { StateFiles, UiSettings } from "./reader/index";
3
3
 
4
4
  export function hostFiles($: any): StateFiles {
@@ -28,6 +28,22 @@ export async function resolveStateDir(
28
28
  return String(run.stdout).trim();
29
29
  }
30
30
 
31
+ // The pause the hooks read ([sessions] pause_file); a hook too old to answer keeps the state dir's.
32
+ export async function resolvePauseFile(
33
+ $: any,
34
+ root: string,
35
+ stateDir: string,
36
+ ): Promise<string> {
37
+ const fallback = `${stateDir}/${STATE_PATHS.pause}`;
38
+ const hook = `${root}/.agents/pmcp-hooks/hook.mjs`;
39
+ if (!(await $.fs.exists(hook))) return fallback;
40
+ const run = await $.process
41
+ .run(["node", hook, "--pause-file"])
42
+ .catch(() => null);
43
+ const answer = run && run.exitCode === 0 ? String(run.stdout).trim() : "";
44
+ return answer.startsWith("/") ? answer : fallback;
45
+ }
46
+
31
47
  export async function findSettings(
32
48
  $: any,
33
49
  cwd: string,
@@ -94,7 +94,9 @@ export async function readSessionState(
94
94
  const at = (name: string) => `${options.stateDir}/${name}`;
95
95
  return {
96
96
  records: await readRecords(files, options),
97
- pause: asPause(await readJson(files, at(STATE_PATHS.pause))),
97
+ pause: asPause(
98
+ await readJson(files, options.pauseFile ?? at(STATE_PATHS.pause)),
99
+ ),
98
100
  lease: await readLease(files, options),
99
101
  broadcast: asBroadcast(await readJson(files, at(STATE_PATHS.broadcast))),
100
102
  };
@@ -26,6 +26,8 @@ export interface StateFiles {
26
26
 
27
27
  export interface ReadOptions {
28
28
  readonly stateDir: string;
29
+ // [sessions] pause_file as the hook resolves it; absent means pause.json in stateDir.
30
+ readonly pauseFile?: string;
29
31
  readonly now: number;
30
32
  }
31
33
 
@@ -3,7 +3,7 @@ import { atom, read, type On } from "claude-code";
3
3
  import { runCommand } from "./commands";
4
4
  import { drawBand, drawPane } from "./draw";
5
5
  import { holdForeignEdit } from "./guard";
6
- import { findSettings, resolveStateDir } from "./host";
6
+ import { findSettings, resolvePauseFile, resolveStateDir } from "./host";
7
7
  import { refresh } from "./snapshot";
8
8
  import { EDITS, PANE_ID, POLL_MS, state, type Kept } from "./state";
9
9
 
@@ -23,6 +23,7 @@ async function start($: any, e: any): Promise<void> {
23
23
  state.root = found.root;
24
24
  state.settings = found.settings;
25
25
  state.stateDir = stateDir;
26
+ state.pauseFile = await resolvePauseFile($, found.root, stateDir);
26
27
  const saved = await read($, kept);
27
28
  if (saved) {
28
29
  state.snapshot = saved.snapshot;
@@ -58,6 +58,7 @@ export async function refresh($: any): Promise<void> {
58
58
  state.now = Number(await $.clock.now());
59
59
  const read = await readSessionState(hostFiles($), {
60
60
  stateDir: state.stateDir,
61
+ ...(state.pauseFile ? { pauseFile: state.pauseFile } : {}),
61
62
  now: state.now,
62
63
  });
63
64
  const next = { ...read, records: [...read.records].sort(byKind) };
@@ -20,6 +20,7 @@ export const state = {
20
20
  root: "",
21
21
 
22
22
  stateDir: "",
23
+ pauseFile: "",
23
24
  settings: null as UiSettings | null,
24
25
  isOpen: false,
25
26
  signature: "",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pmcp",
4
- "version": "0.22.2",
4
+ "version": "0.22.3",
5
5
  "description": "Find package skills and use native runtime project configuration.",
6
6
  "author": { "name": "modootoday" },
7
7
  "license": "Elastic-2.0",
@@ -1,7 +0,0 @@
1
- // src/commands/version.ts
2
- var VERSION = "0.22.2";
3
-
4
- export {
5
- VERSION
6
- };
7
- //# sourceMappingURL=chunk-FWKQA6TX.js.map