@modootoday/pmcp 0.20.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) 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-QJ6MGLBX.js → apply-6FLMTJDV.js} +57 -23
  6. package/dist/{available-HYSDAFYH.js → available-BFXLII4A.js} +7 -7
  7. package/dist/{broadcast-LYOA6BEW.js → broadcast-ZALGUJVR.js} +4 -4
  8. package/dist/chunk-2GI5RM3M.js +53 -0
  9. package/dist/{chunk-ICF2JZSN.js → chunk-2MAD4WNZ.js} +2 -2
  10. package/dist/{chunk-YDICIB2A.js → chunk-33KGCJB2.js} +2 -2
  11. package/dist/{chunk-FQAJSNNU.js → chunk-3X5JQYKN.js} +3 -3
  12. package/dist/{chunk-IQD4W53M.js → chunk-57Q75MS4.js} +18 -18
  13. package/dist/{chunk-EKPMVEIA.js → chunk-5FW7A6TG.js} +7 -4
  14. package/dist/chunk-5YCKFU5Q.js +1672 -0
  15. package/dist/{chunk-QYH2NR6G.js → chunk-7FV2LORT.js} +2 -2
  16. package/dist/{chunk-66F3HLW4.js → chunk-DEY23WTH.js} +122 -4
  17. package/dist/chunk-DJZPPCJP.js +274 -0
  18. package/dist/{chunk-MZEMLFFD.js → chunk-G6JXCUSK.js} +2 -2
  19. package/dist/{chunk-T6GOWHK6.js → chunk-GFOQDLPL.js} +6 -1
  20. package/dist/{chunk-OAIQ7A3R.js → chunk-GQP4GWU4.js} +5 -5
  21. package/dist/chunk-H4ZOKIER.js +7 -0
  22. package/dist/{chunk-RBNMNKNN.js → chunk-JQVSDPFL.js} +3 -3
  23. package/dist/{chunk-OG7QR2DP.js → chunk-KEHB4FZP.js} +17 -2
  24. package/dist/chunk-KUBHGVTD.js +126 -0
  25. package/dist/{chunk-IZABPDAO.js → chunk-KVNNVLJR.js} +2 -2
  26. package/dist/chunk-LFFIQBNY.js +115 -0
  27. package/dist/{chunk-PQTM27GU.js → chunk-MR5IBS6L.js} +6 -7
  28. package/dist/{chunk-M2RYXWX2.js → chunk-NHUMPEPV.js} +2 -2
  29. package/dist/{chunk-ONP6JRFZ.js → chunk-OFJIMBTL.js} +2 -2
  30. package/dist/{chunk-J6HNP6HA.js → chunk-OFPNCLG7.js} +2 -2
  31. package/dist/{chunk-FD6VGFYZ.js → chunk-OS5DF3LL.js} +207 -15
  32. package/dist/{chunk-L4MFGGSI.js → chunk-POTI2RJ6.js} +2 -2
  33. package/dist/{chunk-RMHZFWHF.js → chunk-R3MVL67T.js} +33 -33
  34. package/dist/{chunk-YN5GQCHN.js → chunk-RHJEGLYM.js} +6 -1
  35. package/dist/{chunk-4VK5G3SV.js → chunk-TBKVC2TA.js} +3 -5
  36. package/dist/{chunk-K2C3KFGB.js → chunk-UFWQTZDX.js} +29 -17
  37. package/dist/{chunk-JBHGJKSL.js → chunk-VBDDFO2V.js} +2 -2
  38. package/dist/{chunk-QOFSPFJ6.js → chunk-VUM6LO77.js} +3417 -3395
  39. package/dist/{chunk-CQZYQAAV.js → chunk-YLITJLTR.js} +3 -3
  40. package/dist/{chunk-O2JWF7ZM.js → chunk-Z4Q6RYJH.js} +2 -2
  41. package/dist/{chunk-QSIADSMQ.js → chunk-Z6WRFOFT.js} +3 -3
  42. package/dist/{chunk-5JPD6VIH.js → chunk-ZIJ5IUXH.js} +9 -3
  43. package/dist/{claude-GT2BPXEL.js → claude-XVLF4N4S.js} +3 -3
  44. package/dist/{cli-IV5DJCXU.js → cli-6FWRBCWM.js} +8 -8
  45. package/dist/{cli-6HTAJ54L.js → cli-RVPR3MH3.js} +7 -7
  46. package/dist/cli.js +11 -11
  47. package/dist/{completion-PPM7MEI2.js → completion-YTPHEVEW.js} +7 -7
  48. package/dist/{diagnostics-EWU2ROTG.js → diagnostics-IW54MLFK.js} +5 -6
  49. package/dist/{doctor-ZWZQMDKZ.js → doctor-EN4JPSKV.js} +35 -35
  50. package/dist/{entry-NDICBQ2F.js → entry-TQWSDTJ4.js} +14 -15
  51. package/dist/{exec-mcp-AG4G7SG7.js → exec-mcp-KKQ75N5O.js} +15 -13
  52. package/dist/{harness-JABSZCAA.js → harness-EB76F6BG.js} +6 -6
  53. package/dist/harness-launch-gate.js +3 -4
  54. package/dist/harness-worker.js +5 -6
  55. package/dist/hook-body.js +247 -86
  56. package/dist/{hook-spec-C7umArqw.d.ts → hook-spec-hZL4MSgi.d.ts} +8 -3
  57. package/dist/hooks-YWSHUNLM.js +24 -0
  58. package/dist/{host-2SZRMHZX.js → host-LSVITS6M.js} +6 -7
  59. package/dist/{host-BWZ5LA4Q.js → host-OGGADMBT.js} +17 -15
  60. package/dist/{host-run-SXLV4LHI.js → host-run-XO2TS4JC.js} +5 -7
  61. package/dist/http.js +1 -1
  62. package/dist/{import-mcp-2M7SZRVQ.js → import-mcp-BJDJTPVS.js} +14 -11
  63. package/dist/index.d.ts +11 -2
  64. package/dist/index.js +24 -24
  65. package/dist/{init-HOOIFBAD.js → init-773PTQM5.js} +3 -3
  66. package/dist/{install-HF6CROQP.js → install-7V6NIA7W.js} +4 -4
  67. package/dist/{invoke-JP4MILYY.js → invoke-Y7XH5S2L.js} +7 -8
  68. package/dist/{list-UBSBUZKS.js → list-5W65XVES.js} +20 -17
  69. package/dist/{logout-OO3DERRK.js → logout-XO6ALD45.js} +15 -12
  70. package/dist/{logs-K3QXKRD4.js → logs-74JGLQG6.js} +4 -4
  71. package/dist/{mailbox-DAJV6VAI.js → mailbox-VK5AVTHI.js} +7 -7
  72. package/dist/{mainline-6K5BA3WX.js → mainline-M2NSTAGC.js} +70 -24
  73. package/dist/{mcp-JXNTKRJG.js → mcp-R62ZNVGJ.js} +2 -2
  74. package/dist/{pause-GRVTSKOK.js → pause-CZ2OZYLC.js} +4 -4
  75. package/dist/project/hook-adapter.d.ts +1 -1
  76. package/dist/{project-M672MKQH.js → project-W5DQIZA6.js} +5 -5
  77. package/dist/{pty-LHKJKY2E.js → pty-CDLQ4NP2.js} +3 -3
  78. package/dist/report-Z3JV2PCT.js +105 -0
  79. package/dist/{resume-6DMPGG3N.js → resume-DFIHT2RO.js} +4 -4
  80. package/dist/{run-5W566T3V.js → run-OZLGSRHF.js} +14 -11
  81. package/dist/{run-ORBIERI3.js → run-WYJMTLX7.js} +4 -4
  82. package/dist/{serve-73SRPAV4.js → serve-DCQGAGB7.js} +3 -3
  83. package/dist/{session-XM2CR425.js → session-YZVX4NGN.js} +4 -4
  84. package/dist/{setup-ULKDPF5B.js → setup-D3KEJBGO.js} +4 -4
  85. package/dist/smoke-FQQJOQBD.js +16 -0
  86. package/dist/{start-login-BGFAMCZL.js → start-login-EKXM75XQ.js} +15 -12
  87. package/dist/{status-YCW6YJ3S.js → status-23UDIYYP.js} +39 -22
  88. package/dist/{status-YHXEAJ7U.js → status-3RTGDN2K.js} +10 -10
  89. package/dist/{status-73FEFQUQ.js → status-EDSEG32U.js} +15 -12
  90. package/dist/stdio.js +2 -2
  91. package/dist/{sweep-XF2HG3EO.js → sweep-EPJMEZR6.js} +4 -4
  92. package/dist/{test-IMNBXOYW.js → test-TM6PIZTV.js} +30 -20
  93. package/dist/{tui-5GDA22TB.js → tui-EQNJIDN5.js} +4 -4
  94. package/dist/{unbroadcast-XP3OCVN3.js → unbroadcast-NTOC3PY3.js} +4 -4
  95. package/dist/{worker-RV6NGSXT.js → worker-7X6WBPEI.js} +9 -10
  96. package/dist/{worktree-list-4PLE7K6L.js → worktree-list-EMKUMCTQ.js} +2 -2
  97. package/dist/{worktree-sync-GQVYAXGJ.js → worktree-sync-T6C5YEYS.js} +3 -3
  98. package/docs/commands.md +13 -6
  99. package/docs/git-workflow.md +28 -9
  100. package/docs/hooks.md +138 -10
  101. package/docs/project-configuration.md +27 -1
  102. package/docs/upgrading.md +42 -0
  103. package/gemini-extension.json +2 -2
  104. package/mcp.json +1 -1
  105. package/package.json +5 -5
  106. package/plugin.json +1 -1
  107. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  108. package/plugins/pmcp/.mcp.json +1 -1
  109. package/plugins/pmcp/gemini-extension.json +2 -2
  110. package/plugins/pmcp/mcp.json +1 -1
  111. package/plugins/pmcp/mod/sessions/format.ts +2 -2
  112. package/plugins/pmcp/plugin.json +1 -1
  113. package/dist/chunk-7SDOSTW7.js +0 -130
  114. package/dist/chunk-AWZF72SH.js +0 -1025
  115. package/dist/chunk-FGYFA6JY.js +0 -7
  116. package/dist/chunk-ISNRDHSD.js +0 -74
  117. package/dist/chunk-QDY6BWE6.js +0 -396
  118. package/dist/hooks-YVQSDQV3.js +0 -21
@@ -1,38 +1,39 @@
1
- import {
2
- logLocation,
3
- readLogs
4
- } from "./chunk-IQD4W53M.js";
5
1
  import {
6
2
  sessionSnapshot
7
3
  } from "./chunk-JGJ4INEN.js";
4
+ import {
5
+ logLocation,
6
+ readLogs
7
+ } from "./chunk-57Q75MS4.js";
8
8
  import {
9
9
  policyRows
10
- } from "./chunk-EKPMVEIA.js";
10
+ } from "./chunk-5FW7A6TG.js";
11
11
  import "./chunk-7TD53M7L.js";
12
12
  import {
13
13
  configFrom
14
14
  } from "./chunk-RPCIROW7.js";
15
15
  import {
16
16
  checkProject
17
- } from "./chunk-AWZF72SH.js";
18
- import "./chunk-QDY6BWE6.js";
19
- import "./chunk-73AKO4UL.js";
17
+ } from "./chunk-DJZPPCJP.js";
20
18
  import {
19
+ checkBudget,
21
20
  readSpec
22
- } from "./chunk-QOFSPFJ6.js";
23
- import "./chunk-HQOB7OQS.js";
24
- import "./chunk-ICF2JZSN.js";
21
+ } from "./chunk-VUM6LO77.js";
22
+ import "./chunk-2MAD4WNZ.js";
25
23
  import "./chunk-UD3BEEBQ.js";
26
24
  import {
27
25
  distance
28
- } from "./chunk-ISNRDHSD.js";
26
+ } from "./chunk-KUBHGVTD.js";
29
27
  import "./chunk-EATCUWGG.js";
28
+ import "./chunk-OFJIMBTL.js";
30
29
  import "./chunk-NRBQK6UX.js";
31
- import "./chunk-ONP6JRFZ.js";
30
+ import "./chunk-LFFIQBNY.js";
31
+ import "./chunk-HQOB7OQS.js";
32
+ import "./chunk-73AKO4UL.js";
32
33
  import "./chunk-P6LNYYYH.js";
33
34
  import {
34
35
  readGitConfig
35
- } from "./chunk-5JPD6VIH.js";
36
+ } from "./chunk-ZIJ5IUXH.js";
36
37
  import {
37
38
  defaultMainline,
38
39
  defaultRemote
@@ -40,26 +41,26 @@ import {
40
41
  import {
41
42
  openStore,
42
43
  readStoreSettings
43
- } from "./chunk-PQTM27GU.js";
44
- import "./chunk-QSIADSMQ.js";
44
+ } from "./chunk-MR5IBS6L.js";
45
+ import "./chunk-Z6WRFOFT.js";
45
46
  import "./chunk-G7JONWL4.js";
46
47
  import "./chunk-Q5H3L6Y4.js";
48
+ import "./chunk-5YCKFU5Q.js";
47
49
  import {
48
50
  statusSpec
49
- } from "./chunk-OG7QR2DP.js";
51
+ } from "./chunk-KEHB4FZP.js";
50
52
  import "./chunk-XNML2KIC.js";
51
53
  import {
52
54
  ArgumentError
53
55
  } from "./chunk-A4PKLESO.js";
54
56
  import "./chunk-V4NPDK6X.js";
55
- import "./chunk-7SDOSTW7.js";
56
- import "./chunk-66F3HLW4.js";
57
+ import "./chunk-DEY23WTH.js";
57
58
  import "./chunk-OEH47H6A.js";
58
59
  import {
59
60
  checkoutOf,
60
61
  worktreesOf
61
62
  } from "./chunk-IJBSOWHK.js";
62
- import "./chunk-FGYFA6JY.js";
63
+ import "./chunk-H4ZOKIER.js";
63
64
  import "./chunk-GJXOFDJT.js";
64
65
  import "./chunk-PMJG2CXF.js";
65
66
  import "./chunk-J6KL3COD.js";
@@ -210,7 +211,8 @@ async function readStatus(config, env) {
210
211
  const sessions = config.raw.sessions ?? {};
211
212
  const leases = Object.keys(sessions.leases ?? {});
212
213
  const worktrees = desks(config);
213
- const drift = checked.code !== 0 || worktrees.some((row) => (row.behind ?? 0) > 0 || (row.ahead ?? 0) > 0);
214
+ const budget = spec.budget ? checkBudget(spec, spec.budget) : null;
215
+ const drift = checked.code !== 0 || (budget?.problems.length ?? 0) > 0 || worktrees.some((row) => (row.behind ?? 0) > 0 || (row.ahead ?? 0) > 0);
214
216
  return {
215
217
  version: 1,
216
218
  config: config.path,
@@ -221,6 +223,8 @@ async function readStatus(config, env) {
221
223
  outputs: checked.outputs,
222
224
  problems: checked.problems
223
225
  },
226
+ // Only with a [budget] table, so other projects keep the same report.
227
+ ...budget ? { budget } : {},
224
228
  sessions: sessionSnapshot(store, leases),
225
229
  worktrees,
226
230
  mcp: await authPresence(spec, env),
@@ -240,6 +244,19 @@ function renderStatus(context, report) {
240
244
  );
241
245
  for (const problem of report.projection.problems.slice(0, 3))
242
246
  context.ui.line(" " + problem);
247
+ if (report.budget) {
248
+ const worst = /* @__PURE__ */ new Map();
249
+ for (const row of report.budget.rows) {
250
+ const seen = worst.get(row.key);
251
+ if (!seen || row.value - row.limit > seen.value - seen.limit)
252
+ worst.set(row.key, row);
253
+ }
254
+ context.ui.line(
255
+ "Budget: " + (report.budget.problems.length ? report.budget.problems.length + " over" : "within") + ([...worst.values()].map((row) => `; ${row.key} ${row.subject} ${row.value}/${row.limit}`).join("") || "")
256
+ );
257
+ for (const problem of report.budget.problems.slice(0, 3))
258
+ context.ui.line(" " + problem);
259
+ }
243
260
  const state = report.sessions;
244
261
  context.ui.line(
245
262
  "Sessions: " + state.live.length + " live; pause " + (state.pause?.reason ?? "none") + "; " + state.leases.length + " lease(s); " + state.broadcasts.filter((row) => row.unseenBy.length > 0).length + " unseen broadcast(s)"
@@ -278,4 +295,4 @@ var statusCommand = {
278
295
  export {
279
296
  statusCommand
280
297
  };
281
- //# sourceMappingURL=status-YCW6YJ3S.js.map
298
+ //# sourceMappingURL=status-23UDIYYP.js.map
@@ -1,24 +1,24 @@
1
- import {
2
- storeFrom
3
- } from "./chunk-QYH2NR6G.js";
4
1
  import {
5
2
  statusLines
6
3
  } from "./chunk-MVFH26QT.js";
4
+ import {
5
+ storeFrom
6
+ } from "./chunk-7FV2LORT.js";
7
7
  import {
8
8
  sessionSnapshot
9
9
  } from "./chunk-JGJ4INEN.js";
10
10
  import {
11
11
  wakeableBy
12
- } from "./chunk-RBNMNKNN.js";
13
- import "./chunk-M2RYXWX2.js";
14
- import "./chunk-TIA4SPU2.js";
12
+ } from "./chunk-JQVSDPFL.js";
15
13
  import {
16
14
  currentHooks,
17
15
  restartNotes
18
16
  } from "./chunk-VJFEN6DJ.js";
19
- import "./chunk-ONP6JRFZ.js";
20
- import "./chunk-PQTM27GU.js";
21
- import "./chunk-QSIADSMQ.js";
17
+ import "./chunk-NHUMPEPV.js";
18
+ import "./chunk-TIA4SPU2.js";
19
+ import "./chunk-OFJIMBTL.js";
20
+ import "./chunk-MR5IBS6L.js";
21
+ import "./chunk-Z6WRFOFT.js";
22
22
  import "./chunk-A4PKLESO.js";
23
23
  import "./chunk-OEH47H6A.js";
24
24
  import "./chunk-IJBSOWHK.js";
@@ -51,4 +51,4 @@ function status(context) {
51
51
  export {
52
52
  status
53
53
  };
54
- //# sourceMappingURL=status-YHXEAJ7U.js.map
54
+ //# sourceMappingURL=status-3RTGDN2K.js.map
@@ -1,31 +1,34 @@
1
1
  import {
2
2
  serverFrom
3
- } from "./chunk-J6HNP6HA.js";
3
+ } from "./chunk-OFPNCLG7.js";
4
4
  import {
5
5
  status
6
6
  } from "./chunk-UPQTAHUK.js";
7
7
  import "./chunk-RPCIROW7.js";
8
- import "./chunk-QOFSPFJ6.js";
9
- import "./chunk-HQOB7OQS.js";
10
- import "./chunk-ICF2JZSN.js";
8
+ import "./chunk-VUM6LO77.js";
9
+ import "./chunk-2MAD4WNZ.js";
11
10
  import "./chunk-UD3BEEBQ.js";
12
- import "./chunk-ISNRDHSD.js";
11
+ import "./chunk-KUBHGVTD.js";
13
12
  import "./chunk-EATCUWGG.js";
13
+ import "./chunk-OFJIMBTL.js";
14
14
  import "./chunk-NRBQK6UX.js";
15
- import "./chunk-ONP6JRFZ.js";
15
+ import "./chunk-LFFIQBNY.js";
16
+ import "./chunk-HQOB7OQS.js";
17
+ import "./chunk-73AKO4UL.js";
16
18
  import "./chunk-P6LNYYYH.js";
17
- import "./chunk-5JPD6VIH.js";
19
+ import "./chunk-ZIJ5IUXH.js";
18
20
  import "./chunk-2Q6MNGU5.js";
19
- import "./chunk-PQTM27GU.js";
20
- import "./chunk-QSIADSMQ.js";
21
+ import "./chunk-MR5IBS6L.js";
22
+ import "./chunk-Z6WRFOFT.js";
21
23
  import "./chunk-G7JONWL4.js";
22
24
  import "./chunk-Q5H3L6Y4.js";
25
+ import "./chunk-5YCKFU5Q.js";
23
26
  import "./chunk-A4PKLESO.js";
24
27
  import "./chunk-V4NPDK6X.js";
25
- import "./chunk-66F3HLW4.js";
28
+ import "./chunk-DEY23WTH.js";
26
29
  import "./chunk-OEH47H6A.js";
27
30
  import "./chunk-IJBSOWHK.js";
28
- import "./chunk-FGYFA6JY.js";
31
+ import "./chunk-H4ZOKIER.js";
29
32
  import "./chunk-GJXOFDJT.js";
30
33
  import "./chunk-PMJG2CXF.js";
31
34
  import "./chunk-J6KL3COD.js";
@@ -41,4 +44,4 @@ function run(context) {
41
44
  export {
42
45
  run
43
46
  };
44
- //# sourceMappingURL=status-73FEFQUQ.js.map
47
+ //# sourceMappingURL=status-EDSEG32U.js.map
package/dist/stdio.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  resolveRoots,
5
5
  serve,
6
6
  serveWithMailbox
7
- } from "./chunk-MZEMLFFD.js";
8
- import "./chunk-O2JWF7ZM.js";
7
+ } from "./chunk-G6JXCUSK.js";
8
+ import "./chunk-Z4Q6RYJH.js";
9
9
  import "./chunk-6WXMJOMI.js";
10
10
  import "./chunk-4CRRLDDS.js";
11
11
  import "./chunk-YSAWTGNA.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  change
3
- } from "./chunk-QYH2NR6G.js";
4
- import "./chunk-PQTM27GU.js";
5
- import "./chunk-QSIADSMQ.js";
3
+ } from "./chunk-7FV2LORT.js";
4
+ import "./chunk-MR5IBS6L.js";
5
+ import "./chunk-Z6WRFOFT.js";
6
6
  import "./chunk-A4PKLESO.js";
7
7
  import "./chunk-OEH47H6A.js";
8
8
  import "./chunk-IJBSOWHK.js";
@@ -14,4 +14,4 @@ var run = (context) => change(context, "sweep");
14
14
  export {
15
15
  run
16
16
  };
17
- //# sourceMappingURL=sweep-XF2HG3EO.js.map
17
+ //# sourceMappingURL=sweep-EPJMEZR6.js.map
@@ -1,37 +1,37 @@
1
1
  import {
2
2
  specFrom
3
- } from "./chunk-JBHGJKSL.js";
3
+ } from "./chunk-VBDDFO2V.js";
4
4
  import {
5
5
  sourceFor
6
6
  } from "./chunk-7TD53M7L.js";
7
7
  import "./chunk-RPCIROW7.js";
8
8
  import {
9
- NEUTRAL_EVENTS,
10
9
  POLICIES,
11
- RUNTIMES,
12
- RUNTIME_IDS,
13
10
  afterFailure,
14
11
  commandsOf,
12
+ customMode,
15
13
  customPolicy
16
- } from "./chunk-QOFSPFJ6.js";
14
+ } from "./chunk-VUM6LO77.js";
15
+ import "./chunk-2MAD4WNZ.js";
16
+ import "./chunk-UD3BEEBQ.js";
17
+ import "./chunk-KUBHGVTD.js";
18
+ import "./chunk-EATCUWGG.js";
19
+ import "./chunk-OFJIMBTL.js";
20
+ import "./chunk-NRBQK6UX.js";
21
+ import "./chunk-LFFIQBNY.js";
17
22
  import {
18
23
  DEFAULT_LOG_SETTINGS,
19
24
  LEVEL_RANK
20
25
  } from "./chunk-HQOB7OQS.js";
21
- import "./chunk-ICF2JZSN.js";
22
- import "./chunk-UD3BEEBQ.js";
23
- import "./chunk-ISNRDHSD.js";
24
- import "./chunk-EATCUWGG.js";
25
- import "./chunk-NRBQK6UX.js";
26
- import "./chunk-ONP6JRFZ.js";
26
+ import "./chunk-73AKO4UL.js";
27
27
  import "./chunk-P6LNYYYH.js";
28
- import "./chunk-5JPD6VIH.js";
28
+ import "./chunk-ZIJ5IUXH.js";
29
29
  import "./chunk-2Q6MNGU5.js";
30
30
  import {
31
31
  SESSION_ID,
32
32
  createFilesStore,
33
33
  writeJson
34
- } from "./chunk-PQTM27GU.js";
34
+ } from "./chunk-MR5IBS6L.js";
35
35
  import {
36
36
  STATE_FILES,
37
37
  asBroadcast,
@@ -40,15 +40,20 @@ import {
40
40
  asRecord,
41
41
  fieldsOf,
42
42
  leaseFile
43
- } from "./chunk-QSIADSMQ.js";
43
+ } from "./chunk-Z6WRFOFT.js";
44
44
  import "./chunk-G7JONWL4.js";
45
45
  import "./chunk-Q5H3L6Y4.js";
46
+ import {
47
+ NEUTRAL_EVENTS,
48
+ RUNTIMES,
49
+ RUNTIME_IDS
50
+ } from "./chunk-5YCKFU5Q.js";
46
51
  import {
47
52
  ArgumentError,
48
53
  one
49
54
  } from "./chunk-A4PKLESO.js";
50
55
  import "./chunk-V4NPDK6X.js";
51
- import "./chunk-66F3HLW4.js";
56
+ import "./chunk-DEY23WTH.js";
52
57
  import {
53
58
  expandPath
54
59
  } from "./chunk-OEH47H6A.js";
@@ -56,7 +61,7 @@ import {
56
61
  checkoutOf,
57
62
  worktreesOf
58
63
  } from "./chunk-IJBSOWHK.js";
59
- import "./chunk-FGYFA6JY.js";
64
+ import "./chunk-H4ZOKIER.js";
60
65
  import "./chunk-GJXOFDJT.js";
61
66
  import "./chunk-PMJG2CXF.js";
62
67
  import "./chunk-J6KL3COD.js";
@@ -89,8 +94,10 @@ function seedState(store, cwd, path) {
89
94
  const record = asRecord(value2);
90
95
  if (!record || !SESSION_ID.test(record.session))
91
96
  throw new ArgumentError("records need valid session identifiers");
92
- for (const folder of [STATE_FILES.records, STATE_FILES.legacyRecords])
93
- writeJson(join(store.dir, folder, record.session + ".json"), record);
97
+ writeJson(
98
+ join(store.dir, STATE_FILES.records, record.session + ".json"),
99
+ record
100
+ );
94
101
  }
95
102
  if (raw.pause !== void 0 && raw.pause !== null) {
96
103
  const pause = asPause(raw.pause);
@@ -353,7 +360,7 @@ function selectPolicies(compiled, input) {
353
360
  }));
354
361
  const custom = compiled.custom.map((entry) => ({
355
362
  policy: customPolicy(entry),
356
- mode: "deny",
363
+ mode: customMode(entry),
357
364
  options: {}
358
365
  }));
359
366
  return [...guards, ...custom].filter((selected) => listens(selected, input));
@@ -534,6 +541,9 @@ async function simulate(input, compiled, store) {
534
541
 
535
542
  // src/commands/hooks/test.ts
536
543
  async function run(context) {
544
+ const fixtures = one(context.args, "fixtures");
545
+ if (fixtures !== void 0)
546
+ return (await import("./smoke-FQQJOQBD.js")).run(context, fixtures);
537
547
  const runtime = one(context.args, "runtime");
538
548
  if (!RUNTIME_IDS.includes(runtime))
539
549
  throw new ArgumentError("--runtime must be claude or codex");
@@ -597,4 +607,4 @@ async function run(context) {
597
607
  export {
598
608
  run
599
609
  };
600
- //# sourceMappingURL=test-IMNBXOYW.js.map
610
+ //# sourceMappingURL=test-TM6PIZTV.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-EWU2ROTG.js");
115
+ const { inspectTerminalHost } = await import("./diagnostics-IW54MLFK.js");
116
116
  receipt = inspectTerminalHost();
117
117
  } else if (invocation.action === "start-worker") {
118
- const { startWorkspaceWorker } = await import("./worker-RV6NGSXT.js");
118
+ const { startWorkspaceWorker } = await import("./worker-7X6WBPEI.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-NDICBQ2F.js");
131
+ const { launchStartup, planStartup } = await import("./entry-TQWSDTJ4.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-5GDA22TB.js.map
153
+ //# sourceMappingURL=tui-EQNJIDN5.js.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  change
3
- } from "./chunk-QYH2NR6G.js";
4
- import "./chunk-PQTM27GU.js";
5
- import "./chunk-QSIADSMQ.js";
3
+ } from "./chunk-7FV2LORT.js";
4
+ import "./chunk-MR5IBS6L.js";
5
+ import "./chunk-Z6WRFOFT.js";
6
6
  import "./chunk-A4PKLESO.js";
7
7
  import "./chunk-OEH47H6A.js";
8
8
  import "./chunk-IJBSOWHK.js";
@@ -14,4 +14,4 @@ var run = (context) => change(context, "unbroadcast");
14
14
  export {
15
15
  run
16
16
  };
17
- //# sourceMappingURL=unbroadcast-XP3OCVN3.js.map
17
+ //# sourceMappingURL=unbroadcast-NTOC3PY3.js.map
@@ -1,24 +1,23 @@
1
- import {
2
- invoke
3
- } from "./chunk-OAIQ7A3R.js";
4
1
  import {
5
2
  readStartup,
6
3
  startupFile,
7
4
  startupSettings
8
5
  } from "./chunk-C3G75JH7.js";
6
+ import {
7
+ invoke
8
+ } from "./chunk-GQP4GWU4.js";
9
9
  import "./chunk-DZ2MRTYT.js";
10
- import "./chunk-CQZYQAAV.js";
11
- import "./chunk-L4MFGGSI.js";
10
+ import "./chunk-YLITJLTR.js";
11
+ import "./chunk-POTI2RJ6.js";
12
12
  import {
13
13
  locateExecutable
14
14
  } from "./chunk-R2GPCZUX.js";
15
- import "./chunk-YDICIB2A.js";
15
+ import "./chunk-33KGCJB2.js";
16
16
  import "./chunk-34DECPVC.js";
17
- import "./chunk-7SDOSTW7.js";
18
- import "./chunk-66F3HLW4.js";
17
+ import "./chunk-DEY23WTH.js";
19
18
  import "./chunk-OEH47H6A.js";
20
19
  import "./chunk-IJBSOWHK.js";
21
- import "./chunk-FGYFA6JY.js";
20
+ import "./chunk-H4ZOKIER.js";
22
21
  import "./chunk-GJXOFDJT.js";
23
22
  import "./chunk-PMJG2CXF.js";
24
23
  import {
@@ -78,4 +77,4 @@ async function startWorkspaceWorker(request, runtime, memoryMb) {
78
77
  export {
79
78
  startWorkspaceWorker
80
79
  };
81
- //# sourceMappingURL=worker-RV6NGSXT.js.map
80
+ //# sourceMappingURL=worker-7X6WBPEI.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-YIXDHQYE.js";
4
4
  import {
5
5
  distance
6
- } from "./chunk-ISNRDHSD.js";
6
+ } from "./chunk-KUBHGVTD.js";
7
7
  import {
8
8
  listWorktrees
9
9
  } from "./chunk-2Q6MNGU5.js";
@@ -48,4 +48,4 @@ var worktreeList = (setup, context) => {
48
48
  export {
49
49
  worktreeList
50
50
  };
51
- //# sourceMappingURL=worktree-list-4PLE7K6L.js.map
51
+ //# sourceMappingURL=worktree-list-EMKUMCTQ.js.map
@@ -3,11 +3,11 @@ import {
3
3
  } from "./chunk-YIXDHQYE.js";
4
4
  import {
5
5
  syncWorktree
6
- } from "./chunk-ICF2JZSN.js";
6
+ } from "./chunk-2MAD4WNZ.js";
7
7
  import {
8
8
  installSpec
9
9
  } from "./chunk-UD3BEEBQ.js";
10
- import "./chunk-ISNRDHSD.js";
10
+ import "./chunk-KUBHGVTD.js";
11
11
  import "./chunk-P6LNYYYH.js";
12
12
  import "./chunk-G7JONWL4.js";
13
13
 
@@ -28,4 +28,4 @@ var worktreeSync = (setup, _context, report) => {
28
28
  export {
29
29
  worktreeSync
30
30
  };
31
- //# sourceMappingURL=worktree-sync-GQVYAXGJ.js.map
31
+ //# sourceMappingURL=worktree-sync-T6C5YEYS.js.map
package/docs/commands.md CHANGED
@@ -20,7 +20,7 @@ An unrecognised command does not fall through to a server the caller did not ask
20
20
  pmcp status [--config <file>] [--json]
21
21
  ```
22
22
 
23
- Show enabled features and their TOML or auto source, projection drift, live sessions, pause, leases, unseen broadcasts, worktree ahead/behind counts, shared MCP credential presence, and logged errors from the last hour. Reads do not acknowledge broadcasts, refresh credentials, prune logs, fetch or move git refs. Projection uses the same check as `project --check`. Exit 0, or 2 when projection or worktree ahead/behind drift exists. Missing or invalid input follows the normal usage/failure exit contract. Human output is a compact summary on stderr; JSON retains the full details.
23
+ Show enabled features and their TOML or auto source, projection drift, live sessions, pause, leases, unseen broadcasts, worktree ahead/behind counts, shared MCP credential presence, logged errors from the last hour, and, with a [`[budget]`](project-configuration.md#budget) table, each limit beside what it measured. Reads do not acknowledge broadcasts, refresh credentials, prune logs, fetch or move git refs. Projection uses the same check as `project --check`. Exit 0, or 2 when projection or worktree ahead/behind drift exists or a budget limit is exceeded. Missing or invalid input follows the normal usage/failure exit contract. Human output is a compact summary on stderr; JSON retains the full details.
24
24
 
25
25
  ## init
26
26
 
@@ -44,6 +44,13 @@ Session state is isolated in a temporary directory, then removed. Commands and p
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
 
47
+ ```sh
48
+ pmcp hooks report [--since 2d] [--json]
49
+ pmcp hooks report --switch-check shell.heredoc [--since 2d] [--json]
50
+ ```
51
+
52
+ `report` summarises the guard lines the hook bundle writes to the project log at debug level (`[logging] level = "debug"`, or `PMCP_LOG=debug`). For each guard and runtime it counts the runs, what the guard found before its mode (`raw`: allow, deny, ask) and what the call got, the modes seen, the sessions, and the p50, p95 and longest durations. Sessions matching a `[hooks.report] exclude_sessions` regex (replays, smoke runs) are left out and counted. `--since` takes a duration such as `10m`, `2h` or `3d`, or an ISO time. `--switch-check <guard>` lists instead the calls that guard found something in and let through, because it was in `observe` or `warn`: what `deny` would have refused. The log holds no command, prompt or transcript text, so neither does the report. `--json` prints `{version, since?, lines, sessions, excluded, guards}`, or `{version, guard, refused}` with `--switch-check`.
53
+
47
54
  ## Read command JSON schemas
48
55
 
49
56
  These opt-in snapshots write one JSON object and a newline to stdout, with `version: 1`. No color or human summary is mixed into stdout. Errors remain on stderr. Without the flag, existing human output is retained, including MCP status's original unversioned object and logs' JSONL stream. Schemas are named in [schemas.json](https://pmcp.build/commands/schemas.json); each entry under `schemas` uses the shared root `$defs`. Consumers must allow unknown fields inside session, decision and log records. Tokens are never part of an auth status object.
@@ -133,11 +140,11 @@ Credentials and attachment files contain secrets and must stay outside source co
133
140
 
134
141
  ```sh
135
142
  pmcp project
136
- pmcp project --check
143
+ pmcp project --check [--smoke]
137
144
  pmcp project import-mcp --source codex:/path/to/config.toml
138
145
  ```
139
146
 
140
- Generate selected runtimes' native files from `pmcp.toml`. Unmanaged entries and credential references are preserved; conflicts stop the write. `--check` reports drift without writes, and MCP import previews changes by default; `--write` applies them. [Configuration and guard examples](project-configuration.md).
147
+ Generate selected runtimes' native files from `pmcp.toml`. Unmanaged entries and credential references are preserved; conflicts stop the write. `--check` reports drift without writes, and MCP import previews changes by default; `--write` applies them. `--check --smoke` then runs the `[hooks.test] fixtures` file as `pmcp hooks test --fixtures` does, and exits 2 on any finding. [Configuration and guard examples](project-configuration.md).
141
148
 
142
149
  Configuration files and the ownership lock are replaced atomically one file at a time. If projection is interrupted, inspect with `pmcp project --check`, then run `pmcp project` explicitly to repair drift. Projection does not start a runtime or replay terminal input. The complete set of files is not a single transaction.
143
150
 
@@ -173,7 +180,7 @@ Read this project's JSONL logs from the state directory, or the file `[hooks] er
173
180
  pmcp git worktree create review [--base <ref>]
174
181
  pmcp git worktree list
175
182
  pmcp git worktree sync
176
- pmcp git deliver [<commit>...] [--during-pause] [--json]
183
+ pmcp git deliver [<commit>...] [--during-pause] [--no-push] [--json]
177
184
  pmcp git sync
178
185
  ```
179
186
 
@@ -182,7 +189,7 @@ The git workflow configured by [`[git]`](git-workflow.md). Each subcommand needs
182
189
  - `worktree create <alias>` makes a linked worktree under `[git.worktrees] root` on a new branch from the upstream (or `--base`), links the configured files from the main checkout, runs `bootstrap`, and prints the path.
183
190
  - `worktree list` prints alias, branch, behind/ahead and path for the main checkout and each linked worktree.
184
191
  - `worktree sync` moves the current worktree onto the mainline when that loses nothing; exit 1 when it is held back.
185
- - `deliver` fetches, replays the named commits (default: the ones the upstream lacks) onto the mainline, runs the gate in its own tree under a lock, and pushes; it replays again if the mainline moved. A delivery that touches a leased path holds that lease until it has pushed and installed, and it refuses during a pause unless `--during-pause` or `during_pause = "allow"`. Exit 0 delivered or nothing to deliver, 1 refused, gate failed or attempts exhausted, 2 fetch failed.
192
+ - `deliver` fetches, replays the named commits (default: the ones the upstream lacks) onto the mainline, runs the gate in its own tree under a lock, and pushes; it replays again if the mainline moved. A delivery that touches a leased path holds that lease until it has pushed and installed, and it refuses during a pause unless `--during-pause` or `during_pause = "allow"`. `--no-push` replays and runs the gate command, then stops: it takes no lease and pushes, syncs and notifies nothing, and it refuses `gate = "pre-push"`, where the push is the gate. Exit 0 delivered, gated with `--no-push`, or nothing to deliver; 1 refused, gate failed or attempts exhausted; 2 fetch failed or `--no-push` with the pre-push gate.
186
193
  - `sync` moves the main checkout to the mainline, installs when a listed file changed, and follows clean submodule pins. Exit 0 moved or already equal, 1 when local work would be lost, 2 when blocked (undelivered edits) or the fetch failed.
187
194
 
188
195
  ## completion
@@ -212,7 +219,7 @@ pmcp doctor
212
219
  pmcp doctor --memory
213
220
  ```
214
221
 
215
- Inspect native configuration and prerequisites. The optional memory report shows enabled state and paths; it does not read memory contents or synchronize personal memory. [Doctor scope and runtime compatibility](project-configuration.md).
222
+ Inspect native configuration and prerequisites, including [native hook entries pmcp does not own](hooks.md#native-hook-entries-pmcp-does-not-own), which `project --check` also checks. The optional memory report shows enabled state and paths; it does not read memory contents or synchronize personal memory. [Doctor scope and runtime compatibility](project-configuration.md).
216
223
 
217
224
  ## validate
218
225
 
@@ -81,14 +81,22 @@ through delivery), `during_pause` (`"refuse"` default or `"allow"`),
81
81
  `lease_wait_seconds` (default `3600`), `notify` (argv run after a
82
82
  delivery), `gate` and `push_env`.
83
83
 
84
+ A commit is already on the mainline when `git cherry` finds the same patch there,
85
+ or when it only moves submodule pins, each to a commit that the mainline's pin for
86
+ that path equals or contains. Containment is read in the submodule's checkout,
87
+ else in the repository git keeps for it, and without either the commit counts as
88
+ missing. Delivery skips such a commit; `pmcp git sync` and worktree sync move past
89
+ it as a landed duplicate, so another session's newer pin never makes a replay
90
+ conflict or a sync refusal.
91
+
84
92
  The push of a delivery runs the repository's own hooks, so a pre-push hook that
85
93
  gates as well needs one of two set-ups.
86
94
 
87
95
  - `gate = "pre-push"` makes that hook the gate: pmcp takes the lock, replays and
88
96
  retries, runs no `[git.mainline.gate] command` (declaring one is an error),
89
97
  and pushes with `lock_env` set to `1`, so a hook that takes the same lock does
90
- not wait on pmcp. The push output is the gate log, and a refused push is a
91
- failed gate.
98
+ not wait on pmcp. The push output streams to the terminal as it comes and is
99
+ kept as the gate log, and a refused push is a failed gate.
92
100
  - `gate = "command"` (the default) keeps pmcp's command as the gate.
93
101
  `push_env` (a table of variable names to strings, default `{}`) adds variables
94
102
  to the push alone in either mode, so a hook can recognise a delivery that was
@@ -98,19 +106,30 @@ Every delivery push also carries `PMCP_GIT_DELIVER=1`. In command mode the lock
98
106
  variable reaches the push only if `push_env` names it.
99
107
 
100
108
  `pmcp git deliver --json` prints one receipt on stdout when it ends, progress
101
- staying on stderr: `{ok, code, delivered, upstream, attempts, gate, leases,
102
- reason?}`, where `delivered` is the upstream commit it pushed (or `null`), `gate`
103
- is `{exit, log, by}` for the last gate run (or `null`; `by` is `"command"` or
104
- `"pre-push"`), `leases` the leases it took
105
- and `reason` the last refusal or failure. Exit codes: `0` delivered or nothing
106
- to deliver; `1` refused, a lease or the gate lock held too long, a replay
109
+ staying on stderr: `{ok, code, delivered, upstream, attempts, replayed, gate,
110
+ leases, sync, reason?}`, where `delivered` is the upstream commit it pushed (or
111
+ `null`), `replayed` the tip of its last replay onto the upstream (or `null`),
112
+ `gate` is `{exit, log, by}` for the last gate run (or `null`; `by` is
113
+ `"command"` or `"pre-push"`), `leases` the leases it took, `sync` the main
114
+ checkout's sync after the delivery (or `null` when none ran) as
115
+ `{from, to, code, reason?}`: the main checkout's HEAD before and after, the exit
116
+ code `pmcp git sync` would have, and its last warning; and `reason` is the last
117
+ refusal or failure. `--no-push` stops after the gate, so its receipt has
118
+ `replayed` and `gate` but `delivered` and `sync` are `null`.
119
+ Exit codes: `0` delivered or nothing to deliver, even when the sync after it was
120
+ refused; `1` refused, a lease or the gate lock held too long, a replay
107
121
  conflict, the gate failed, the push failed or it gave up after `attempts`; `2`
108
122
  fetch failed or no configuration.
109
123
 
110
124
  `[git.mainline.sync]` enables `pmcp git sync`, which moves the main checkout to
111
125
  the mainline: `install` (argv), `install_when_changed` (paths; when no
112
126
  `[sessions.leases]` are declared, these become an implicit `lockfile` lease),
113
- `keep_identical_files` and `refuse_with_unlanded` (booleans, default `true`).
127
+ `keep_identical_files` and `refuse_with_unlanded` (booleans, default `true`) and
128
+ `after_deliver`. With the table present, a delivery syncs the main checkout once it is
129
+ delivered, holding its leases through the install: `after_deliver = "from_main"`
130
+ (the default) does so only for a delivery run in the main checkout, `"always"`
131
+ also for one run in a linked worktree, and `"off"` never. Every refusal of
132
+ `pmcp git sync` still applies, and a refused sync leaves the delivery a success.
114
133
 
115
134
  After a successful install, sync records the hash it installed in a stamp and
116
135
  installs again only when that hash changes. By default the stamp is pmcp's own,