@modootoday/pmcp 0.24.1 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) 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-CDJQJAZH.js → apply-6XLLYLJT.js} +9 -8
  6. package/dist/{broadcast-VKZY7WSD.js → broadcast-34CEG2NQ.js} +5 -2
  7. package/dist/{chunk-264DIB5U.js → chunk-2TXVOHRS.js} +3 -3
  8. package/dist/{chunk-X3RUXLAV.js → chunk-3P6Y2BAO.js} +3 -3
  9. package/dist/{chunk-7CGGDX7X.js → chunk-5MUD7FHP.js} +2 -2
  10. package/dist/{chunk-2GZKA33O.js → chunk-A4P3IIPE.js} +2 -2
  11. package/dist/{chunk-GEDRPMBH.js → chunk-BG6TONJO.js} +2 -2
  12. package/dist/{chunk-HES44LTA.js → chunk-C3KRMTIZ.js} +28 -4
  13. package/dist/{chunk-QY2P54Z2.js → chunk-DITIXBFB.js} +61 -8
  14. package/dist/{chunk-LNKAR3IS.js → chunk-DWHM5BAY.js} +2 -2
  15. package/dist/{chunk-VBWB2T3C.js → chunk-EC5QLEZD.js} +2 -2
  16. package/dist/{chunk-MZ52S4YJ.js → chunk-ISWR2XIU.js} +2 -2
  17. package/dist/{chunk-D4FIBB2G.js → chunk-LZVHFPN6.js} +5 -5
  18. package/dist/{chunk-3SEJNT6F.js → chunk-MBHI2TKQ.js} +4 -4
  19. package/dist/{chunk-43MXRTKH.js → chunk-NAHAESFV.js} +9 -4
  20. package/dist/chunk-NQCAKDRY.js +156 -0
  21. package/dist/chunk-OIKT4SYO.js +42 -0
  22. package/dist/{chunk-3O3JZTUU.js → chunk-PECS47OL.js} +3 -3
  23. package/dist/{chunk-AQM2JZMB.js → chunk-PGZZI42O.js} +2 -2
  24. package/dist/{chunk-5NQZGNKT.js → chunk-QYHM6554.js} +2 -2
  25. package/dist/{chunk-DLIO2D7S.js → chunk-RF6RDJYH.js} +16 -16
  26. package/dist/chunk-SMBU3QLE.js +7 -0
  27. package/dist/{chunk-V5PXMLLL.js → chunk-SRSKCFFS.js} +3 -3
  28. package/dist/{chunk-DGXZBQCA.js → chunk-SSQ6EWNA.js} +5 -5
  29. package/dist/{chunk-MOKZPZZO.js → chunk-TJW4DP26.js} +2 -2
  30. package/dist/{chunk-2ZH77O2D.js → chunk-TOR6SKRB.js} +141 -58
  31. package/dist/{chunk-PG62GOPU.js → chunk-UQHJUTDW.js} +2 -2
  32. package/dist/{cli-GFDT4YXM.js → cli-5G2OYTIL.js} +9 -9
  33. package/dist/{cli-OV5LSSGE.js → cli-QDQYUHAP.js} +4 -4
  34. package/dist/cli.js +38 -5
  35. package/dist/{completion-QNDCU4MF.js → completion-3GVNPLZY.js} +4 -4
  36. package/dist/{diagnostics-TPK3VC5F.js → diagnostics-2W7QDQNG.js} +6 -6
  37. package/dist/{doctor-K2LADSW2.js → doctor-3TDO5LJ5.js} +11 -10
  38. package/dist/{entry-HFQHKL5L.js → entry-E62DZQJF.js} +10 -10
  39. package/dist/{exec-mcp-I2YGGWY4.js → exec-mcp-4N7FLY52.js} +7 -6
  40. package/dist/{harness-BMWGAXCF.js → harness-E2AUZDLV.js} +3 -3
  41. package/dist/harness-launch-gate.js +4 -4
  42. package/dist/harness-worker.js +6 -6
  43. package/dist/{heavy-G6CYQQ7O.js → heavy-HZQVFI6P.js} +150 -36
  44. package/dist/hook-body.js +116 -45
  45. package/dist/{hooks-R7AYQXHY.js → hooks-VAEAK2FY.js} +4 -4
  46. package/dist/{host-PLE2T55E.js → host-4GJDGTLW.js} +7 -7
  47. package/dist/{host-EUD6GLWV.js → host-I2EMQ7UE.js} +12 -59
  48. package/dist/{host-run-QFNGIDL5.js → host-run-DDMKD3BU.js} +5 -5
  49. package/dist/http.js +1 -1
  50. package/dist/{import-mcp-DVKJOEOE.js → import-mcp-TNSAMJXI.js} +6 -5
  51. package/dist/index.d.ts +1 -1
  52. package/dist/index.js +10 -9
  53. package/dist/{init-DKWNL62M.js → init-UA7MDNTZ.js} +2 -2
  54. package/dist/{invoke-U6JTPTXT.js → invoke-HW7NBPGP.js} +8 -8
  55. package/dist/{list-YKQFJN3G.js → list-A7VQJXE5.js} +8 -7
  56. package/dist/{logout-5YSKC46N.js → logout-HNPLUKJY.js} +7 -6
  57. package/dist/{mailbox-5FVFMQ2J.js → mailbox-MR6TPD3P.js} +20 -6
  58. package/dist/{mainline-D3PSR6AJ.js → mainline-MSLW3UFD.js} +8 -2
  59. package/dist/{mcp-CHKKXHBB.js → mcp-6C23GX2E.js} +2 -2
  60. package/dist/{pause-CMZOIHTJ.js → pause-H6ZYZF7C.js} +5 -2
  61. package/dist/{project-QEYXISHC.js → project-BX6NCGKB.js} +4 -4
  62. package/dist/{report-UB7MXAUB.js → report-43SFNNCF.js} +2 -2
  63. package/dist/{resume-PAKIT4TT.js → resume-2BWGSTCN.js} +5 -2
  64. package/dist/{run-HKMYYEZJ.js → run-2UVAWBAF.js} +6 -5
  65. package/dist/{run-FYKDIW4C.js → run-7TRWZFEZ.js} +4 -4
  66. package/dist/{serve-QZNG5UUV.js → serve-4XZ5SKJJ.js} +3 -3
  67. package/dist/{start-login-4GPM32RA.js → start-login-AR7ITWNV.js} +7 -6
  68. package/dist/{status-4PYPTYUB.js → status-2GDYLIR3.js} +6 -3
  69. package/dist/{status-55CD352M.js → status-VQCMJFVE.js} +25 -22
  70. package/dist/{status-W6SCF2GF.js → status-ZY6LDQSF.js} +7 -6
  71. package/dist/stdio.js +2 -2
  72. package/dist/{sweep-VURZU6DI.js → sweep-76BUOGEI.js} +5 -2
  73. package/dist/{test-XYEMYZ2P.js → test-VWGNFSH5.js} +9 -7
  74. package/dist/{tui-FXSWN2PV.js → tui-TUMOQBE7.js} +4 -4
  75. package/dist/{unbroadcast-7AMLURCG.js → unbroadcast-HJHYUHZL.js} +5 -2
  76. package/dist/{worker-Q4I4EIAJ.js → worker-NEEPJRVV.js} +8 -8
  77. package/dist/{worktree-list-2HV6ODBS.js → worktree-list-WZC75NLF.js} +8 -9
  78. package/docs/commands.md +8 -6
  79. package/docs/glossary.md +1 -1
  80. package/docs/hooks.md +20 -16
  81. package/docs/project-configuration.md +73 -36
  82. package/docs/sessions.md +9 -2
  83. package/docs/upgrading.md +58 -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/plugin.json +1 -1
  93. package/dist/chunk-65H4PN33.js +0 -7
@@ -61,7 +61,7 @@ ignored.
61
61
  | `[hooks]`, `[hooks.guards.*]`, `[[hooks.guards.custom]]`, `[hooks.checks.*]`, `[hooks.failure]`, `[hooks.report]`, `[hooks.test]` | [Hooks](hooks.md) |
62
62
  | `[budget]` | [Budget](#budget) |
63
63
  | `[[hooks.shell]]`, `[[hooks.edit]]` | [Deprecated shell guards](hooks.md#deprecated-shell-guards) |
64
- | `[sessions]`, `[sessions.registry]`, `[sessions.pause]`, `[sessions.broadcast]`, `[sessions.mailbox]`, `[sessions.leases.<name>]`, `[sessions.roles.<name>]` | [Sessions](#sessions) |
64
+ | `[sessions]`, `[sessions.registry]`, `[sessions.pause]`, `[sessions.broadcast]`, `[sessions.mailbox]`, `[sessions.leases.<name>]`, `[sessions.roles.<name>]`, `[sessions.operator]` | [Sessions](#sessions) |
65
65
  | `[git]`, `[git.shared_checkout]`, `[git.worktrees]`, `[git.worktrees.sync]`, `[git.mainline]`, `[git.mainline.gate]`, `[git.mainline.deliver]`, `[git.mainline.sync]`, `[git.submodules]` | [Git workflow](git-workflow.md) |
66
66
  | `[logging]`, `[logging.components]` | [Logging](#logging) |
67
67
  | `[permissions.claude]` | [Claude permission rules](#claude-permission-rules) |
@@ -276,8 +276,9 @@ max_io = 8
276
276
  budget = 4
277
277
  hold_warn = 1800
278
278
  hold_max = 3600
279
- heavy = [["npm", "install"], ["npm", "test"], ["cargo", "build"]]
279
+ heavy = ["default", ["make", "all"]]
280
280
  guard = "deny"
281
+ skip_reasons = ["ci"]
281
282
 
282
283
  [host.lease.lanes]
283
284
  interactive = 2
@@ -292,38 +293,39 @@ max_wait = 2700
292
293
  load_grace = 600
293
294
  ```
294
295
 
295
- | Key | Type | Default | Meaning |
296
- | ------------------- | ------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
297
- | `enabled` | boolean | `true` | `false` runs every `pmcp heavy` command at once, gates without the lease and turns the guard off. |
298
- | `dir` | path | `~/.cache/pmcp/host` | Where the lock file (`heavy.lock`), the admission lock, the `running/` and `waiters/` records, the holder record and `heavy.log` live. Every tool sharing the lease names the same directory. |
299
- | `budget` | integer | `4` | The most weight that runs at once. `1` is one job at a time. |
300
- | `lanes.<lane>` | integer | gate 1, hook 1, interactive 2, bulk 1 | How many jobs of a lane run at once; `0` closes the lane. |
301
- | `weights.<lane>` | integer | gate 1, hook 1, interactive 2, bulk 3 | A job's weight when neither `--weight` nor a `commands` entry names one. A weight above the budget counts as the budget. |
302
- | `commands` | tables | none | `argv` prefix, `lane` and `weight` for commands run without `--lane` or `--weight`; the first match wins. |
303
- | `tiny` | argv lists | none | Commands so short (a few seconds) that they take no slot and no budget (weight 0, also `--weight 0`); only the hard ceiling holds them back, and the log still records them. |
304
- | `per_session` | integer | `1` | How many jobs one agent session may have queued in the interactive lane, and in the bulk lane; the next one waits outside the queue holding no place. `0` is no cap. Gate and hook are exempt. |
305
- | `marker_env` | name | `PMCP_HEAVY_LEASE` | Set to the job's pid for the leased command; a nested `pmcp heavy` whose marker names a running job runs at once. |
306
- | `legacy_marker_env` | name | none | A second marker, set and honoured like `marker_env`, for a shell wrapper that shares `dir`. |
307
- | `legacy_skip_env` | name | none | A second skip variable, honoured like `PMCP_HEAVY_DISABLE`, and set for the leased command so a nested shell wrapper runs at once. |
308
- | `skip_always` | list of reasons | `[]` | Skip reasons honoured even for a bulk job, for callers that must never wait on the lease (a commit hook). A skip with any other reason does not cover a bulk job. |
309
- | `max_load` | number | the CPU count | A job starts only while the 1-minute load average is below this. |
310
- | `max_io` | number | `8` | And while IO pressure (`some`, the `io_window` average) is below this. A host without pressure files checks load only; one without a load average checks neither. |
311
- | `io_window` | string | `avg60` | Which pressure average the check reads: `avg10` follows spikes, `avg60` and `avg300` smooth them so the queue does not stall on a burst. |
312
- | `max_wait` | seconds | `3600` | How long the `default` profile waits; then nothing runs and the exit is 75. |
313
- | `load_grace` | seconds | `900` | After this long waiting on the host, a job may start into moderate overload, but only while no leased job runs, so a grace never starts two jobs together. `0` is no grace. |
314
- | `hard_factor` | number | `2` | Never start, grace or not, while load or IO is at this many times its limit; such a job waits until `max_wait`, then exits 75. |
315
- | `hold_warn` | seconds | `1800` | A job running past this prints one warning, and `pmcp heavy status` marks it. |
316
- | `hold_max` | seconds | none | `pmcp heavy status` flags a job past this as over the limit. Nothing is killed. |
317
- | `memory_max` | size | none | Runs each command in `systemd-run --user --scope -p MemoryMax=<size> -p MemorySwapMax=0` where that is available, so a runaway job is killed alone. Without a reachable user manager (no `XDG_RUNTIME_DIR`, or no manager socket in it, as under `env -i` or cron) the command runs without the scope and one line on stderr says why; if `systemd-run` still cannot reach the bus, the command runs once more without it. A missing scope never fails the command. |
318
- | `heartbeat`, `poll` | seconds | `60`, `15` | How often a waiter prints that it is still waiting, and how often the host is reread. |
319
- | `profiles.<name>` | table | gate 2700/600, hook 900/30 | `max_wait`, `load_grace` and `memory_max` for `pmcp heavy --profile <name>`. The `gate` and `hook` profiles also choose their lane. Any other profile starts from the top-level values. |
320
- | `heavy` | argv lists | none | The commands the `host.lease` guard expects under the lease, as argv prefixes. Empty, the guard is off. pmcp lists none of its own. |
321
- | `guard` | string | `observe` | The `host.lease` guard's mode: `observe` logs only, `warn` tells the agent, `deny` refuses with the command to run instead (`pmcp heavy -- <command>`), `off`. A command already wrapped passes. |
322
- | `io.enabled` | `"auto"` or boolean | `"auto"` | Each leased job runs in its own `systemd-run --user` scope and gets its lane's `io.weight` where the cgroup v2 io controller reaches the user manager; elsewhere nothing changes. `true` also says when it could not; `false` never. |
323
- | `io.weights.<lane>` | integer | gate 500, hook 300, interactive 100, bulk 25 | The scope's `io.weight` per lane (1 to 10000). |
324
- | `io.max.<lane>` | string | none | An `io.max` line for the lane's scopes, such as `"259:0 wbps=50000000"`; the device is this host's to name. |
325
- | `settle_window` | seconds | `60` | After a leased job ends, its own leftover IO may hold the queue only this long: then a waiter starts on a moderately busy host (below `hard_factor`). `0` turns it off. |
326
- | `usage_cap` | bytes | `5000000` | `usage.jsonl` (one record per run) moves to `usage.jsonl.1` past this size. |
296
+ | Key | Type | Default | Meaning |
297
+ | ------------------- | -------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
298
+ | `enabled` | boolean | `true` | `false` runs every `pmcp heavy` command at once, gates without the lease and turns the guard off. |
299
+ | `dir` | path | `~/.cache/pmcp/host` | Where the lock file (`heavy.lock`), the admission lock, the `running/` and `waiters/` records, the holder record and `heavy.log` live. Every tool sharing the lease names the same directory. |
300
+ | `budget` | integer | `4` | The most weight that runs at once. `1` is one job at a time. |
301
+ | `lanes.<lane>` | integer | gate 1, hook 1, interactive 2, bulk 1 | How many jobs of a lane run at once; `0` closes the lane. |
302
+ | `weights.<lane>` | integer | gate 1, hook 1, interactive 2, bulk 3 | A job's weight when neither `--weight` nor a `commands` entry names one. A weight above the budget counts as the budget. |
303
+ | `commands` | tables | none | `argv` prefix, `lane` and `weight` for commands run without `--lane` or `--weight`; the first match wins. |
304
+ | `tiny` | argv lists | none | Commands so short (a few seconds) that they take no slot and no budget (weight 0, also `--weight 0`); only the hard ceiling holds them back, and the log still records them. |
305
+ | `per_session` | integer | `1` | How many jobs one agent session may have queued in the interactive lane, and in the bulk lane; the next one waits outside the queue holding no place. `0` is no cap. Gate and hook are exempt. |
306
+ | `marker_env` | name | `PMCP_HEAVY_LEASE` | Set to the job's pid for the leased command; a nested `pmcp heavy` whose marker names a running job runs at once. |
307
+ | `legacy_marker_env` | name | none | A second marker, set and honoured like `marker_env`, for a shell wrapper that shares `dir`. |
308
+ | `legacy_skip_env` | name | none | A second skip variable, honoured like `PMCP_HEAVY_DISABLE`, and set for the leased command so a nested shell wrapper runs at once. |
309
+ | `skip_always` | list of reasons | `[]` | Skip reasons honoured even for a bulk job, for callers that must never wait on the lease (a commit hook). They are allowed skip reasons too. |
310
+ | `skip_reasons` | list of reasons | `[]` | The further reasons `PMCP_HEAVY_DISABLE` may carry for an ordinary command, beside the built-in `nested` and `operator`. Lower-case words (`a-z`, digits, `-`, `_`, `.`, `:`). |
311
+ | `max_load` | number | the CPU count | A job starts only while the 1-minute load average is below this. |
312
+ | `max_io` | number | `8` | And while IO pressure (`some`, the `io_window` average) is below this. A host without pressure files checks load only; one without a load average checks neither. |
313
+ | `io_window` | string | `avg60` | Which pressure average the check reads: `avg10` follows spikes, `avg60` and `avg300` smooth them so the queue does not stall on a burst. |
314
+ | `max_wait` | seconds | `3600` | How long the `default` profile waits; then nothing runs and the exit is 75. |
315
+ | `load_grace` | seconds | `900` | After this long waiting on the host, a job may start into moderate overload, but only while no leased job runs, so a grace never starts two jobs together. `0` is no grace. |
316
+ | `hard_factor` | number | `2` | Never start, grace or not, while load or IO is at this many times its limit; such a job waits until `max_wait`, then exits 75. |
317
+ | `hold_warn` | seconds | `1800` | A job running past this prints one warning, and `pmcp heavy status` marks it. |
318
+ | `hold_max` | seconds | none | `pmcp heavy status` flags a job past this as over the limit. Nothing is killed. |
319
+ | `memory_max` | size | none | Runs each command in `systemd-run --user --scope -p MemoryMax=<size> -p MemorySwapMax=0` where that is available, so a runaway job is killed alone. Without a reachable user manager (no `XDG_RUNTIME_DIR`, or no manager socket in it, as under `env -i` or cron) the command runs without the scope and one line on stderr says why; if `systemd-run` still cannot reach the bus, the command runs once more without it. A missing scope never fails the command. |
320
+ | `heartbeat`, `poll` | seconds | `60`, `15` | How often a waiter prints that it is still waiting, and how often the host is reread. |
321
+ | `profiles.<name>` | table | gate 2700/600, hook 900/30 | `max_wait`, `load_grace` and `memory_max` for `pmcp heavy --profile <name>`. The `gate` and `hook` profiles also choose their lane. Any other profile starts from the top-level values. |
322
+ | `heavy` | argv lists, or `"default"` | `"default"` with the table, none without | The commands the `host.lease` guard expects under the lease, as argv prefixes. `"default"`, alone or as an item of the list, names pmcp's preset: `install` (and `i`, `ci`), `test`, `build` and `typecheck` for npm, pnpm, yarn and bun (`<manager> run <script>` too), and `cargo build`, `test` and `check`. An empty list turns the guard off. |
323
+ | `guard` | string | `observe` | The `host.lease` guard's mode: `observe` logs what it would have refused (at info, so `pmcp hooks report --switch-check host.lease` reads it at the default log level), `warn` tells the agent, `deny` refuses with the command to run instead (`pmcp heavy -- <command>`), `off`. A command already wrapped passes. Run a week in `observe`, read the report, then set `deny`. |
324
+ | `io.enabled` | `"auto"` or boolean | `"auto"` | Each leased job runs in its own `systemd-run --user` scope and gets its lane's `io.weight` where the cgroup v2 io controller reaches the user manager; elsewhere nothing changes. `true` also says when it could not; `false` never. |
325
+ | `io.weights.<lane>` | integer | gate 500, hook 300, interactive 100, bulk 25 | The scope's `io.weight` per lane (1 to 10000). |
326
+ | `io.max.<lane>` | string | none | An `io.max` line for the lane's scopes, such as `"259:0 wbps=50000000"`; the device is this host's to name. |
327
+ | `settle_window` | seconds | `60` | After a leased job ends, its own leftover IO may hold the queue only this long: then a waiter starts on a moderately busy host (below `hard_factor`). `0` turns it off. |
328
+ | `usage_cap` | bytes | `5000000` | `usage.jsonl` (one record per run) moves to `usage.jsonl.1` past this size. |
327
329
 
328
330
  Lanes, in the order a short budget goes to them: `gate` (a land's gate),
329
331
  `hook` (commit-hook work, a short slot that skips the host wait unless the host
@@ -337,7 +339,7 @@ on every admission, so running weight never exceeds the budget and a crashed
337
339
  job frees its share.
338
340
 
339
341
  `pmcp heavy --now --reason <text>` (or `PMCP_HEAVY_NOW=<reason>` in a script) is
340
- the emergency bypass: the command starts at once, outside the lanes, the budget
342
+ the operator's emergency bypass ([the operator](#the-operator)): the command starts at once, outside the lanes, the budget
341
343
  and the host check, and never exits 75, but it needs a reason, is logged as a
342
344
  `bypass` line, shows as `bypass running` in status and counts its weight, so the
343
345
  other jobs' admission sees its load. It is not the off switch below.
@@ -355,7 +357,13 @@ the configured ones.
355
357
  `PMCP_HEAVY_DISABLE=<reason>` (or the `legacy_skip_env` variable) skips the
356
358
  lease for an ordinary command: `pmcp heavy` runs it at once, logs the reason,
357
359
  and keeps it as `skip` in the command's usage record, and the guard lets a
358
- command that sets it pass. The skip is bounded: a bulk job (an install, a
360
+ command that sets it pass. The reason is one of a closed set: `nested`, which
361
+ pmcp sets itself for a wrapper inside a leased job and honours only while a
362
+ leased job encloses the command; `operator`, honoured only for
363
+ [the operator](#the-operator); and the names in `skip_reasons` or `skip_always`.
364
+ Any other reason runs nothing: `pmcp heavy` exits 2 naming the allowed reasons,
365
+ logs a `skip-invalid` line and records `skip_invalid`, so the share of skipped
366
+ runs reads by reason in `pmcp heavy stats`. The skip is bounded: a bulk job (an install, a
359
367
  whole test suite, a full build), put in the `bulk` lane by `--lane bulk` or by
360
368
  a `commands` entry, still queues in that lane, with a line on standard error
361
369
  saying the skip was not honoured and `skip_refused` in its usage record. The
@@ -373,6 +381,7 @@ that must never wait on the lease, such as a commit hook:
373
381
  ```toml
374
382
  [host.lease]
375
383
  skip_always = ["git-hook"] # PMCP_HEAVY_DISABLE=git-hook runs even a bulk job at once
384
+ skip_reasons = ["ci"] # PMCP_HEAVY_DISABLE=ci runs an ordinary command at once
376
385
  ```
377
386
 
378
387
  The files extend those of a shell wrapper that takes the same lock with
@@ -628,6 +637,34 @@ lives in one directory shared by every checkout of the repository.
628
637
  These tables have no `mode`, except pause. Without `[sessions.registry]` no
629
638
  session is recorded, and `[ui.claude]` refuses to project.
630
639
 
640
+ ### The operator
641
+
642
+ The operator is you: the person who governs the agent sessions. A few verbs are yours alone,
643
+ because an agent running them would govern the others: `pmcp sessions pause` and `resume`,
644
+ `pmcp heavy --now` (and `PMCP_HEAVY_NOW`), `pmcp heavy promote --now`,
645
+ `pmcp heavy cancel --force` on another session's job, and `pmcp git deliver --during-pause`.
646
+ Signing a broadcast or a message as `operator` is yours too. `[sessions.operator]` says how
647
+ pmcp recognises you:
648
+
649
+ | Key | Type | Default | Meaning |
650
+ | ------------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
651
+ | `via` | string | `"tty"` | `"tty"`: an interactive terminal (standard input) with no agent runtime among the command's parent processes and no agent's environment markers. `"token"`: `PMCP_OPERATOR_TOKEN` equals the contents of `token_file`, wherever the command runs (a script, cron). |
652
+ | `token_file` | path | none | With `via = "token"`: absolute or `~/…`, outside the project, readable by its owner only (mode 600); pmcp refuses a file others can read. |
653
+
654
+ ```toml
655
+ [sessions.operator]
656
+ via = "token"
657
+ token_file = "~/.config/pmcp/operator-token"
658
+ ```
659
+
660
+ Run from an agent session, an operator verb exits 1 with
661
+ `<verb> is the operator's to run: <why>. Ask the operator to run it from their own terminal`,
662
+ and changes nothing; the agent relays the request to you. With any session feature declared,
663
+ the `pmcp.operator_verbs` guard ([Hooks](hooks.md)) also refuses these command lines in the
664
+ agent's runtime, before they run. Every session runs as the same user, so this stops
665
+ instructed agents and accidents rather than a determined process: for a hard boundary run the
666
+ agents under another user, where a token file only you can read keeps them out.
667
+
631
668
  ### `[sessions.mailbox]`
632
669
 
633
670
  Addressed messages between sessions, and between you and them. A missing table leaves
package/docs/sessions.md CHANGED
@@ -33,8 +33,15 @@ pmcp sessions sweep # drop records whose process is gone
33
33
 
34
34
  While paused, every other session's edits and mutating commands are refused; reading and
35
35
  planning continue. A broadcast reaches each running session once, as context. `--by <name>`
36
- names who pauses or broadcasts; that session is exempt, and without it the sender is
37
- `operator`.
36
+ names who pauses or broadcasts; that session is exempt. Without it a broadcast is signed by
37
+ the agent session it runs in, or by `operator` from your own terminal.
38
+
39
+ Pause and resume are [operator verbs](project-configuration.md#the-operator): pmcp runs them
40
+ only from your terminal (or with your operator token), refuses them inside an agent session
41
+ with a line telling the agent to ask you, and the `pmcp.operator_verbs` guard refuses them in
42
+ the agent's runtime before they start. The same holds for `pmcp heavy --now`,
43
+ `pmcp heavy promote --now`, `pmcp heavy cancel --force` on another session's job and
44
+ `pmcp git deliver --during-pause`.
38
45
 
39
46
  ## Send a message to one session
40
47
 
package/docs/upgrading.md CHANGED
@@ -5,6 +5,64 @@
5
5
  What to do when a release changes something you rely on. Each release's notes on GitHub
6
6
  Releases list its breaking changes and link here.
7
7
 
8
+ ## From 0.24 to 0.25
9
+
10
+ **`pmcp status` exits 4 only for projection drift or a budget overrun.** A linked worktree
11
+ ahead of or behind the mainline no longer sets `drift` or the exit code; it is counted in
12
+ the summary line and in the new `data.lagging` field. A script that relied on exit 4 to
13
+ notice worktree lag reads `lagging` from `pmcp status --json` instead.
14
+
15
+ **Operator verbs run only as the operator.** `pmcp sessions pause` and `resume`,
16
+ `pmcp heavy --now` (and `PMCP_HEAVY_NOW`), `pmcp heavy promote --now`,
17
+ `pmcp heavy cancel --force` on another session's job and `pmcp git deliver --during-pause`
18
+ now exit 1 inside an agent session, with a line telling the agent to ask you. From your own
19
+ terminal nothing changes. A script or cron job that runs one of them has no terminal: give
20
+ it an operator token,
21
+
22
+ ```toml
23
+ [sessions.operator]
24
+ via = "token"
25
+ token_file = "~/.config/pmcp/operator-token" # outside the project, chmod 600
26
+ ```
27
+
28
+ and run it with `PMCP_OPERATOR_TOKEN` set to the file's contents. A gate or hook that ran
29
+ `pmcp heavy --now` for its own stages should use the `gate` or `hook` profile, or a reason
30
+ in `[host.lease] skip_always`, instead.
31
+
32
+ **`--by` no longer defaults to `operator`.** `pmcp sessions broadcast`, `send` and `reply`
33
+ sign with the agent session they run in, or with `operator` only from the operator's
34
+ terminal; `--by operator` anywhere else exits 2. A command run inside a runtime whose
35
+ session pmcp cannot find (Gemini CLI, OpenCode) now exits 2 asking for `--session <id>` or
36
+ `--by <name>` instead of acting as the operator.
37
+
38
+ **The `pmcp.operator_verbs` guard is on with any session feature.** A project that declares
39
+ `[sessions.registry]`, `[sessions.pause]` or another session table gets it in deny mode;
40
+ run `pmcp project` once so the hook policy carries it (`pmcp project --check` reports the
41
+ drift until then). Turn it off with
42
+ `[hooks.guards.pmcp.operator_verbs]` `mode = "off"`.
43
+
44
+ **Lease skip reasons are a closed set.** `PMCP_HEAVY_DISABLE=<reason>` (and the
45
+ `legacy_skip_env` variable) is honoured only for `nested` (set by pmcp inside a leased job,
46
+ and honoured only there), `operator` (only for the operator) and the names you list:
47
+
48
+ ```toml
49
+ [host.lease]
50
+ skip_reasons = ["ci", "subagent-no-lease"] # ordinary commands
51
+ skip_always = ["git-hook", "gate-light"] # also bulk jobs; allowed as reasons too
52
+ ```
53
+
54
+ Any other reason runs nothing and `pmcp heavy` exits 2 with the allowed list. A wrapper
55
+ that read the old nested value `inside pmcp heavy <pid>` now sees `nested`; the old
56
+ value is still read as `nested` until 0.26. Reasons are lower-case words, so a
57
+ `skip_always` entry with spaces or capitals is now a configuration error.
58
+
59
+ **A declared `[host.lease]` turns the `host.lease` guard on in observe.** Without a
60
+ `heavy` list, the table now gets pmcp's `"default"` preset (install, test, build and
61
+ typecheck for npm, pnpm, yarn, bun and cargo), so the guard logs what it would refuse.
62
+ Run `pmcp project` to project it; set `heavy = []` to keep the guard off. A finding an
63
+ `observe` or `warn` guard let through is now logged at info: after a week,
64
+ `pmcp hooks report --switch-check host.lease` shows what `guard = "deny"` would refuse.
65
+
8
66
  ## From 0.23 to 0.24
9
67
 
10
68
  **A lease skip no longer covers a bulk job.** `PMCP_HEAVY_DISABLE=<reason>` (or the
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "mcpServers": {
5
5
  "pmcp": {
6
6
  "type": "stdio",
7
7
  "command": "npx",
8
- "args": ["-y", "@modootoday/pmcp@0.24.1", "serve"]
8
+ "args": ["-y", "@modootoday/pmcp@0.25.0", "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.24.1", "serve"]
7
+ "args": ["-y", "@modootoday/pmcp@0.25.0", "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.24.1",
3
+ "version": "0.25.0",
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.24.1",
140
- "@modootoday/pmcp-linux-arm64": "0.24.1",
141
- "@modootoday/pmcp-darwin-x64": "0.24.1",
142
- "@modootoday/pmcp-darwin-arm64": "0.24.1"
139
+ "@modootoday/pmcp-linux-x64": "0.25.0",
140
+ "@modootoday/pmcp-linux-arm64": "0.25.0",
141
+ "@modootoday/pmcp-darwin-x64": "0.25.0",
142
+ "@modootoday/pmcp-darwin-arm64": "0.25.0"
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.24.1",
4
+ "version": "0.25.0",
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.24.1",
3
+ "version": "0.25.0",
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.24.1", "serve"]
6
+ "args": ["-y", "@modootoday/pmcp@0.25.0", "serve"]
7
7
  }
8
8
  }
9
9
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "mcpServers": {
5
5
  "pmcp": {
6
6
  "type": "stdio",
7
7
  "command": "npx",
8
- "args": ["-y", "@modootoday/pmcp@0.24.1", "serve"]
8
+ "args": ["-y", "@modootoday/pmcp@0.25.0", "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.24.1", "serve"]
7
+ "args": ["-y", "@modootoday/pmcp@0.25.0", "serve"]
8
8
  }
9
9
  }
10
10
  }
@@ -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.24.1",
4
+ "version": "0.25.0",
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.24.1";
3
-
4
- export {
5
- VERSION
6
- };
7
- //# sourceMappingURL=chunk-65H4PN33.js.map