@modootoday/pmcp 0.22.12 → 0.23.1

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 (154) 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/affected-D6FRJPPI.js +836 -0
  6. package/dist/{apply-LPKZZ6EL.js → apply-3PWUO4J5.js} +27 -22
  7. package/dist/{available-BFXLII4A.js → available-74CMIBPD.js} +9 -9
  8. package/dist/{broadcast-DZGMSZRG.js → broadcast-VKZY7WSD.js} +6 -5
  9. package/dist/chunk-2GZKA33O.js +173 -0
  10. package/dist/chunk-2HL2MFNI.js +159 -0
  11. package/dist/{chunk-OAX6MIOZ.js → chunk-2K4WYN4C.js} +2 -2
  12. package/dist/{chunk-PEMMV5YQ.js → chunk-2MX5C7B2.js} +3 -3
  13. package/dist/{chunk-7I7O7ZNT.js → chunk-3V37OZQH.js} +5 -3
  14. package/dist/chunk-43MXRTKH.js +134 -0
  15. package/dist/chunk-4VVQLWTS.js +93 -0
  16. package/dist/{chunk-DYZVHO2L.js → chunk-5HNLHI5F.js} +2 -2
  17. package/dist/{chunk-JEL35P7S.js → chunk-5NDUWEMW.js} +2 -2
  18. package/dist/chunk-65BW7Y6O.js +40 -0
  19. package/dist/{chunk-HUBJWC7T.js → chunk-6NRLBSEG.js} +7 -7
  20. package/dist/chunk-6QJ3F445.js +166 -0
  21. package/dist/{chunk-2OOWAGBE.js → chunk-72V6U7CZ.js} +3 -3
  22. package/dist/{chunk-RPCIROW7.js → chunk-7CHUMF3E.js} +2 -2
  23. package/dist/{chunk-INT7QLEU.js → chunk-7DJQASH3.js} +25 -6
  24. package/dist/chunk-7IRXUPM2.js +7 -0
  25. package/dist/{chunk-UDVYVRGJ.js → chunk-DNSHJIS4.js} +2 -2
  26. package/dist/{chunk-UMQLIRSU.js → chunk-DZTSCJOZ.js} +3 -3
  27. package/dist/{chunk-KEHB4FZP.js → chunk-E2E4HIEN.js} +49 -3
  28. package/dist/{chunk-SUJCVEBM.js → chunk-EQF64INS.js} +3 -3
  29. package/dist/chunk-F3R5HEUB.js +39 -0
  30. package/dist/chunk-FOLA4EUJ.js +261 -0
  31. package/dist/chunk-FQLCD4HU.js +24 -0
  32. package/dist/{chunk-OEH47H6A.js → chunk-GUHOEIHP.js} +3 -20
  33. package/dist/{chunk-B2WRYGHJ.js → chunk-HES44LTA.js} +5 -5
  34. package/dist/{chunk-RHJEGLYM.js → chunk-HF5D6B2U.js} +45 -6
  35. package/dist/{chunk-R5MT42JS.js → chunk-HYXOJYVR.js} +2 -2
  36. package/dist/chunk-JANBBPKP.js +50 -0
  37. package/dist/{chunk-ITOTOC6Y.js → chunk-JJFPSFDU.js} +3 -3
  38. package/dist/{chunk-XNML2KIC.js → chunk-JPYQDOEW.js} +3 -3
  39. package/dist/{chunk-SPZQRLL5.js → chunk-KYGGQPAH.js} +18 -6
  40. package/dist/{chunk-EX4YXPVW.js → chunk-LGRFYN5T.js} +2 -2
  41. package/dist/{chunk-DP326AER.js → chunk-LO54UUDE.js} +2 -2
  42. package/dist/{chunk-5QKXEWDB.js → chunk-MHKY6TNF.js} +6 -4
  43. package/dist/chunk-N7ANFMA5.js +171 -0
  44. package/dist/{chunk-KPKMEUUH.js → chunk-OGCJO6HQ.js} +9 -8
  45. package/dist/{chunk-N63QCJHX.js → chunk-P25V6NEX.js} +5 -5
  46. package/dist/{chunk-PUIWESU3.js → chunk-Q6V274OB.js} +8 -6
  47. package/dist/chunk-QR6A3TYP.js +315 -0
  48. package/dist/{chunk-EIDIVIAD.js → chunk-QYLOIM4U.js} +9 -2
  49. package/dist/{chunk-MIFPPUWY.js → chunk-RRKA3GF5.js} +4 -4
  50. package/dist/{chunk-7CSUKCU7.js → chunk-RZYZILU4.js} +17 -96
  51. package/dist/{chunk-FODUHLZM.js → chunk-SDQYZDHS.js} +2 -2
  52. package/dist/chunk-SGFTHKKS.js +86 -0
  53. package/dist/chunk-T6C3TSTO.js +99 -0
  54. package/dist/chunk-UVTGY2R3.js +78 -0
  55. package/dist/{chunk-LLT5FQBE.js → chunk-VBVNOLRR.js} +7 -3
  56. package/dist/{chunk-ABTJQ4QV.js → chunk-WBPVNCQO.js} +20 -5
  57. package/dist/{chunk-63RZGEVI.js → chunk-WQBKQTNT.js} +98 -26
  58. package/dist/{chunk-YGOWIJPE.js → chunk-WZYGM3FR.js} +6 -2
  59. package/dist/chunk-Y6NFETNG.js +232 -0
  60. package/dist/{chunk-D5MIZM6L.js → chunk-YRNFMPZB.js} +7 -8
  61. package/dist/{chunk-2GRECE6B.js → chunk-ZXMECZBI.js} +4 -4
  62. package/dist/{cli-34EDFXJA.js → cli-GFDT4YXM.js} +14 -15
  63. package/dist/{cli-JXPJFHUA.js → cli-YWV7FLYO.js} +24 -12
  64. package/dist/cli.js +317 -51
  65. package/dist/{completion-KTECNPVY.js → completion-OKGNN7DE.js} +25 -21
  66. package/dist/{diagnostics-I5VZHK42.js → diagnostics-N4XRRCQG.js} +10 -6
  67. package/dist/{doctor-JJ2VUNHT.js → doctor-3H6UYNEA.js} +27 -23
  68. package/dist/{entry-OT7BN3ID.js → entry-KDLLG6ED.js} +19 -15
  69. package/dist/{exec-mcp-3E4SRJUY.js → exec-mcp-AENALAHJ.js} +15 -11
  70. package/dist/{harness-Q236VJSU.js → harness-GRYTNUF2.js} +26 -44
  71. package/dist/harness-launch-gate.js +8 -4
  72. package/dist/harness-worker.js +10 -6
  73. package/dist/heavy-BGXKJKYB.js +1965 -0
  74. package/dist/hook-body.js +69 -21
  75. package/dist/hooks-V25ANQ4Q.js +24 -0
  76. package/dist/{host-LT5JMUFJ.js → host-4EGPADOJ.js} +11 -7
  77. package/dist/{host-UDC4HVX3.js → host-MLSWY7D7.js} +24 -17
  78. package/dist/{host-run-LD63JGN7.js → host-run-VI52IUKF.js} +10 -6
  79. package/dist/http.js +1 -1
  80. package/dist/{import-mcp-URVONIZ3.js → import-mcp-FIXFLUDM.js} +18 -14
  81. package/dist/index.d.ts +1 -1
  82. package/dist/index.js +17 -12
  83. package/dist/init-ALTBFUPP.js +14 -0
  84. package/dist/{install-7V6NIA7W.js → install-5JH4DSFF.js} +10 -10
  85. package/dist/{invoke-JW5OC2HO.js → invoke-7T7UY57O.js} +12 -8
  86. package/dist/{list-UM4DYJRL.js → list-JFZ7UZLV.js} +18 -14
  87. package/dist/{list-WK2IYUK7.js → list-LV5EKCF6.js} +11 -7
  88. package/dist/{logout-H5X4D26I.js → logout-7CNBO76Z.js} +15 -11
  89. package/dist/{logs-UHJM7ZCL.js → logs-2JEMSNSG.js} +11 -10
  90. package/dist/{mailbox-NIMBOQPA.js → mailbox-5FVFMQ2J.js} +12 -44
  91. package/dist/{mailbox-YN6PG66A.js → mailbox-ZHZWZMAY.js} +14 -21
  92. package/dist/{mainline-74WCH4T4.js → mainline-6PBT3VNR.js} +75 -126
  93. package/dist/{marketplace-G4VQET5W.js → marketplace-2X3OOEPW.js} +10 -9
  94. package/dist/{mcp-6P3MVT4V.js → mcp-MVQVMAKJ.js} +4 -4
  95. package/dist/{mcp-AXHV547W.js → mcp-PBTQ5SJW.js} +2 -2
  96. package/dist/{models-ISU4DCMA.js → models-XSF45MCD.js} +9 -5
  97. package/dist/{pause-CBZ3BTJL.js → pause-CMZOIHTJ.js} +6 -5
  98. package/dist/{preview-DT7DWG5F.js → preview-465CQJBQ.js} +4 -4
  99. package/dist/{project-6QUIC73W.js → project-FZGJRG2U.js} +14 -12
  100. package/dist/{reindex-I7RYWCUR.js → reindex-D62HQAN2.js} +7 -7
  101. package/dist/{report-ZHOHQ4PZ.js → report-UB7MXAUB.js} +14 -13
  102. package/dist/{resume-UJEWQ66P.js → resume-PAKIT4TT.js} +6 -5
  103. package/dist/{run-HQTB7N2R.js → run-TOP37ZQC.js} +14 -10
  104. package/dist/run-VGJDMA2O.js +23 -0
  105. package/dist/{serve-APEVIJD2.js → serve-LR7SJHNH.js} +13 -13
  106. package/dist/{session-YZVX4NGN.js → session-3YVVO2GR.js} +6 -6
  107. package/dist/{setup-SOUBEZ3H.js → setup-6AQUOWOH.js} +7 -4
  108. package/dist/{smoke-2FI5D74B.js → smoke-6X6IXQIQ.js} +4 -4
  109. package/dist/{start-login-ER7DEGYN.js → start-login-X37KGCCB.js} +16 -12
  110. package/dist/{status-KN2ZE64O.js → status-4PYPTYUB.js} +7 -6
  111. package/dist/{status-7NYXRZ3R.js → status-E4AFUOQO.js} +24 -13
  112. package/dist/{status-OGABWCPO.js → status-LBRK37GA.js} +35 -30
  113. package/dist/stdio.js +2 -2
  114. package/dist/{sweep-EPZCW63Q.js → sweep-VURZU6DI.js} +6 -5
  115. package/dist/{test-WRZQERYC.js → test-D2EEFUN2.js} +18 -14
  116. package/dist/{tui-YUHQ36FC.js → tui-D7E3MD3X.js} +45 -19
  117. package/dist/{unbroadcast-N6LXHAMT.js → unbroadcast-7AMLURCG.js} +6 -5
  118. package/dist/{validate-KFBCUFI4.js → validate-YXR7FJJX.js} +11 -9
  119. package/dist/wait-HEODT7KV.js +141 -0
  120. package/dist/{worker-OKBJNDEI.js → worker-WTBC6VYO.js} +12 -8
  121. package/dist/{worktree-create-KMXPQXIQ.js → worktree-create-FTSLMZWS.js} +2 -2
  122. package/docs/commands.md +108 -36
  123. package/docs/git-workflow.md +51 -0
  124. package/docs/hooks.md +11 -4
  125. package/docs/project-configuration.md +136 -20
  126. package/docs/terminal-workspace.md +2 -0
  127. package/docs/upgrading.md +54 -0
  128. package/gemini-extension.json +2 -2
  129. package/mcp.json +1 -1
  130. package/package.json +5 -5
  131. package/plugin.json +1 -1
  132. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  133. package/plugins/pmcp/.mcp.json +1 -1
  134. package/plugins/pmcp/gemini-extension.json +2 -2
  135. package/plugins/pmcp/mcp.json +1 -1
  136. package/plugins/pmcp/plugin.json +1 -1
  137. package/plugins/pmcp/skills/headless-agents-ci-scaffold/SKILL.md +1 -1
  138. package/plugins/pmcp/skills/pmcp-project-init/SKILL.md +1 -1
  139. package/plugins/pmcp/skills/pmcp-sessions-and-git/SKILL.md +3 -2
  140. package/skills/headless-agents-ci-scaffold/SKILL.md +1 -1
  141. package/skills/pmcp-project-init/SKILL.md +1 -1
  142. package/skills/pmcp-sessions-and-git/SKILL.md +3 -2
  143. package/dist/chunk-2P4Z2NUX.js +0 -28
  144. package/dist/chunk-3C5FVHQ3.js +0 -7
  145. package/dist/chunk-3Y3HDMHA.js +0 -108
  146. package/dist/chunk-A4PKLESO.js +0 -112
  147. package/dist/chunk-E3DQB5LS.js +0 -48
  148. package/dist/chunk-GFOQDLPL.js +0 -35
  149. package/dist/chunk-JWRZDYB5.js +0 -59
  150. package/dist/chunk-LMUBBIE2.js +0 -83
  151. package/dist/chunk-SMZPYJQI.js +0 -151
  152. package/dist/hooks-PABOEQO6.js +0 -24
  153. package/dist/init-4O24ZNUQ.js +0 -14
  154. package/dist/run-GZK3XJ62.js +0 -19
@@ -1,17 +1,19 @@
1
1
  import {
2
2
  configOption,
3
3
  jsonOption
4
- } from "./chunk-XNML2KIC.js";
4
+ } from "./chunk-JPYQDOEW.js";
5
5
 
6
6
  // src/commands/specs/inspection.ts
7
7
  var statusSpec = {
8
8
  name: "status",
9
+ examples: ["pmcp status", "pmcp status --json | jq .data.projection"],
9
10
  describe: "Show enabled features, projection drift and live workspace state",
10
11
  usage: "pmcp status [--config <file>] [--json]",
11
12
  options: [configOption, jsonOption]
12
13
  };
13
14
  var initSpec = {
14
15
  name: "init",
16
+ examples: ["pmcp init", "pmcp init --preset multi-session"],
15
17
  describe: "Create a starting pmcp.toml using this checkout's git detection",
16
18
  usage: "pmcp init [--preset solo|multi-session] [--force]",
17
19
  options: [
@@ -29,8 +31,52 @@ var initSpec = {
29
31
  };
30
32
  var hooksSpec = {
31
33
  name: "hooks",
34
+ examples: [
35
+ "pmcp hooks list --runtime claude",
36
+ 'pmcp hooks test --runtime codex --event before_tool --command "git add -A"'
37
+ ],
38
+ subcommands: [
39
+ {
40
+ name: "list",
41
+ describe: "List compiled policies per runtime and event",
42
+ usage: "pmcp hooks list [--runtime claude|codex] [--config <file>] [--json]",
43
+ options: ["runtime", "config", "json"],
44
+ examples: ["pmcp hooks list --runtime claude --json"]
45
+ },
46
+ {
47
+ name: "test",
48
+ describe: "Simulate one native hook call, or run a fixtures file",
49
+ usage: "pmcp hooks test --runtime claude|codex --event <event> [--command <text> | --path <path> | --tool <name>] [--session-state <file>] [--json] | pmcp hooks test --fixtures <file> [--json]",
50
+ options: [
51
+ "runtime",
52
+ "event",
53
+ "command",
54
+ "path",
55
+ "tool",
56
+ "session-state",
57
+ "fixtures",
58
+ "config",
59
+ "json"
60
+ ],
61
+ examples: [
62
+ 'pmcp hooks test --runtime claude --event before_tool --command "git add -A"',
63
+ "pmcp hooks test --fixtures hooks.fixtures.json"
64
+ ]
65
+ },
66
+ {
67
+ name: "report",
68
+ describe: "Summarise the guard lines in the project log",
69
+ usage: "pmcp hooks report [--since <when>] [--switch-check <guard>] [--json]",
70
+ options: ["since", "switch-check", "config", "json"],
71
+ examples: [
72
+ "pmcp hooks report --since 2d",
73
+ "pmcp hooks report --switch-check shell.heredoc"
74
+ ]
75
+ }
76
+ ],
77
+ defaultSubcommand: "list",
32
78
  describe: "List compiled policies or simulate a native hook without a runtime",
33
- usage: "pmcp hooks list | test --runtime claude|codex --event <event> [--command <text> | --path <path> | --tool <name>] [--session-state <file>] [--json] | test --fixtures <file> [--json] | report [--since <when>] [--switch-check <guard>] [--json]",
79
+ usage: "pmcp hooks [<subcommand>] [options]",
34
80
  options: [
35
81
  configOption,
36
82
  jsonOption,
@@ -87,4 +133,4 @@ export {
87
133
  initSpec,
88
134
  hooksSpec
89
135
  };
90
- //# sourceMappingURL=chunk-KEHB4FZP.js.map
136
+ //# sourceMappingURL=chunk-E2E4HIEN.js.map
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-5ZABTVSW.js";
4
4
  import {
5
5
  dependencies
6
- } from "./chunk-EX4YXPVW.js";
6
+ } from "./chunk-LGRFYN5T.js";
7
7
  import {
8
8
  interactiveEntry
9
9
  } from "./chunk-LMT3PPXJ.js";
10
10
  import {
11
11
  assertNativeHost
12
- } from "./chunk-FODUHLZM.js";
12
+ } from "./chunk-SDQYZDHS.js";
13
13
 
14
14
  // src/tui/startup/host.ts
15
15
  function terminalSupport() {
@@ -42,4 +42,4 @@ export {
42
42
  terminalSupport,
43
43
  requireTerminal
44
44
  };
45
- //# sourceMappingURL=chunk-SUJCVEBM.js.map
45
+ //# sourceMappingURL=chunk-EQF64INS.js.map
@@ -0,0 +1,39 @@
1
+ // src/commands/specs/wait.ts
2
+ var waitSpec = {
3
+ name: "wait",
4
+ examples: [
5
+ "pmcp wait --pid 4242",
6
+ "pmcp wait --until gone:/tmp/build.lock --until load-below:6 --timeout 900"
7
+ ],
8
+ describe: "Sleep until a process exits or a condition holds, never matching itself",
9
+ usage: "pmcp wait --pid <pid>... | --until <exists:<path>|gone:<path>|load-below:<n>|no-process:<text>>... [--timeout <s>] [--interval <s>]",
10
+ options: [
11
+ {
12
+ name: "pid",
13
+ describe: "Wait until this process has exited; repeatable.",
14
+ placeholder: "<pid>",
15
+ repeat: true
16
+ },
17
+ {
18
+ name: "until",
19
+ describe: "Wait until this holds: exists:<path>, gone:<path>, load-below:<n>, no-process:<text>; repeatable, all must hold.",
20
+ placeholder: "<condition>",
21
+ repeat: true
22
+ },
23
+ {
24
+ name: "timeout",
25
+ describe: "Give up after this many seconds and exit 75 (default 3600).",
26
+ placeholder: "<s>"
27
+ },
28
+ {
29
+ name: "interval",
30
+ describe: "Seconds between checks (default 5).",
31
+ placeholder: "<s>"
32
+ }
33
+ ]
34
+ };
35
+
36
+ export {
37
+ waitSpec
38
+ };
39
+ //# sourceMappingURL=chunk-F3R5HEUB.js.map
@@ -0,0 +1,261 @@
1
+ import {
2
+ LANES
3
+ } from "./chunk-N7ANFMA5.js";
4
+ import {
5
+ Reader,
6
+ child,
7
+ table
8
+ } from "./chunk-T6C3TSTO.js";
9
+ import {
10
+ expandPath
11
+ } from "./chunk-GUHOEIHP.js";
12
+ import {
13
+ ConfigError,
14
+ findConfig,
15
+ readConfig
16
+ } from "./chunk-GJXOFDJT.js";
17
+
18
+ // src/lease/config.ts
19
+ import { availableParallelism } from "os";
20
+ var DISABLE_ENV = "PMCP_HEAVY_DISABLE";
21
+ var NOW_ENV = "PMCP_HEAVY_NOW";
22
+ var BUSY_EXIT = 75;
23
+ var KEYS = [
24
+ "enabled",
25
+ "dir",
26
+ "marker_env",
27
+ "legacy_marker_env",
28
+ "legacy_skip_env",
29
+ "max_load",
30
+ "max_io",
31
+ "io_window",
32
+ "hard_factor",
33
+ "max_wait",
34
+ "load_grace",
35
+ "hold_warn",
36
+ "hold_max",
37
+ "heartbeat",
38
+ "poll",
39
+ "memory_max",
40
+ "budget",
41
+ "lanes",
42
+ "weights",
43
+ "commands",
44
+ "tiny",
45
+ "per_session",
46
+ "profiles",
47
+ "heavy",
48
+ "guard",
49
+ "io",
50
+ "usage_cap",
51
+ "settle_window"
52
+ ];
53
+ var SIZE = /^[1-9]\d*[KMGT]$/u;
54
+ function fail(path, message) {
55
+ throw new ConfigError(path, message);
56
+ }
57
+ function memory(path, where, value) {
58
+ if (value === void 0) return void 0;
59
+ if (typeof value !== "string" || !SIZE.test(value))
60
+ fail(path, `[${where}] memory_max must be a size such as "6G" or "512M"`);
61
+ return value;
62
+ }
63
+ function whole(path, where, key, value, fallback) {
64
+ if (value === void 0) return fallback;
65
+ if (!Number.isInteger(value) || value < 0)
66
+ fail(path, `[${where}] ${key} must be a whole number`);
67
+ return value;
68
+ }
69
+ function argvList(path, value) {
70
+ if (value === void 0) return [];
71
+ const valid = Array.isArray(value) && value.every(
72
+ (item) => Array.isArray(item) && item.length > 0 && item.every((word) => typeof word === "string" && word !== "")
73
+ );
74
+ if (!valid)
75
+ fail(
76
+ path,
77
+ '[host.lease] heavy must be a list of argv prefixes, such as [["npm", "install"]]'
78
+ );
79
+ return value;
80
+ }
81
+ function perLane(path, where, raw, defaults, least) {
82
+ const found = { ...defaults };
83
+ for (const [key, value] of Object.entries(raw ?? {})) {
84
+ if (!LANES.includes(key))
85
+ fail(path, `unknown key [${where}] ${key}`);
86
+ const number = whole(path, where, key, value, 0);
87
+ if (number < least)
88
+ fail(path, `[${where}] ${key} must be at least ${least}`);
89
+ found[key] = number;
90
+ }
91
+ return found;
92
+ }
93
+ function commands(path, value) {
94
+ if (value === void 0) return [];
95
+ if (!Array.isArray(value))
96
+ fail(path, "[host.lease] commands must be a list of tables");
97
+ return value.map((item, at) => {
98
+ const where = `host.lease.commands[${at}]`;
99
+ const entry = table(path, where, item) ?? {};
100
+ new Reader(path, where, entry, ["argv", "lane", "weight"]);
101
+ const [argv] = argvList(path, [entry["argv"]]);
102
+ const lane = entry["lane"];
103
+ if (lane !== void 0 && !LANES.includes(lane))
104
+ fail(path, `[${where}] lane must be ${LANES.join(" | ")}`);
105
+ const weight = entry["weight"];
106
+ if (weight !== void 0 && !(Number.isInteger(weight) && weight >= 0))
107
+ fail(path, `[${where}] weight must be a whole number`);
108
+ return {
109
+ argv,
110
+ ...lane ? { lane } : {},
111
+ ...weight !== void 0 ? { weight } : {}
112
+ };
113
+ });
114
+ }
115
+ function profile(path, name, raw, base) {
116
+ const where = `host.lease.profiles.${name}`;
117
+ const read = new Reader(path, where, raw, [
118
+ "max_wait",
119
+ "load_grace",
120
+ "memory_max"
121
+ ]);
122
+ const memoryMax = memory(path, where, raw["memory_max"]) ?? base.memoryMax;
123
+ return {
124
+ maxWait: read.int("max_wait", base.maxWait),
125
+ loadGrace: whole(
126
+ path,
127
+ where,
128
+ "load_grace",
129
+ raw["load_grace"],
130
+ base.loadGrace
131
+ ),
132
+ ...memoryMax ? { memoryMax } : {}
133
+ };
134
+ }
135
+ function profiles(path, raw, base) {
136
+ const named = {
137
+ default: base,
138
+ gate: { ...base, maxWait: 2700, loadGrace: 600 },
139
+ // Commit-hook work is short: a brief host check, then it runs unless the host is severe.
140
+ hook: { ...base, maxWait: 900, loadGrace: 30 }
141
+ };
142
+ for (const [name, value] of Object.entries(raw ?? {})) {
143
+ if (!/^[a-z][a-z0-9_-]{0,31}$/u.test(name))
144
+ fail(path, `[host.lease.profiles] bad name ${name}`);
145
+ const inner = table(path, `host.lease.profiles.${name}`, value) ?? {};
146
+ named[name] = profile(path, name, inner, named[name] ?? base);
147
+ }
148
+ return named;
149
+ }
150
+ function ioSettings(path, raw) {
151
+ const table2 = raw ?? {};
152
+ new Reader(path, "host.lease.io", table2, ["enabled", "weights", "max"]);
153
+ const enabled = table2["enabled"] ?? "auto";
154
+ if (enabled !== "auto" && typeof enabled !== "boolean")
155
+ fail(path, '[host.lease.io] enabled must be "auto", true or false');
156
+ const weights = perLane(
157
+ path,
158
+ "host.lease.io.weights",
159
+ child(path, table2, "host.lease.io", "weights"),
160
+ { gate: 500, hook: 300, interactive: 100, bulk: 25 },
161
+ 1
162
+ );
163
+ if (Object.values(weights).some((weight) => weight > 1e4))
164
+ fail(path, "[host.lease.io.weights] a weight is at most 10000");
165
+ const max = {};
166
+ for (const [lane, line] of Object.entries(
167
+ child(path, table2, "host.lease.io", "max") ?? {}
168
+ )) {
169
+ if (!LANES.includes(lane))
170
+ fail(path, `unknown key [host.lease.io.max] ${lane}`);
171
+ if (typeof line !== "string" || !/^\d+:\d+( [a-z]+=(\d+|max))+$/u.test(line))
172
+ fail(
173
+ path,
174
+ `[host.lease.io.max] ${lane} must be an io.max line such as "8:0 wbps=50000000"`
175
+ );
176
+ max[lane] = line;
177
+ }
178
+ return { enabled, weights, max };
179
+ }
180
+ function hardFactor(path, value) {
181
+ if (value === void 0) return 2;
182
+ if (typeof value !== "number" || !(value >= 1))
183
+ fail(path, "[host.lease] hard_factor must be a number of at least 1");
184
+ return value;
185
+ }
186
+ function readLeaseSettings(path, dir, host) {
187
+ const root = table(path, "host", host) ?? {};
188
+ const raw = child(path, root, "host", "lease") ?? {};
189
+ const read = new Reader(path, "host.lease", raw, KEYS);
190
+ const memoryMax = memory(path, "host.lease", raw["memory_max"]);
191
+ const base = {
192
+ maxWait: read.int("max_wait", 3600),
193
+ loadGrace: whole(path, "host.lease", "load_grace", raw["load_grace"], 900),
194
+ ...memoryMax ? { memoryMax } : {}
195
+ };
196
+ const holdMax = read.positive("hold_max");
197
+ const legacyMarkerEnv = read.envName("legacy_marker_env");
198
+ const legacySkipEnv = read.envName("legacy_skip_env");
199
+ const lanes = child(path, raw, "host.lease", "lanes");
200
+ const weights = child(path, raw, "host.lease", "weights");
201
+ return {
202
+ enabled: read.bool("enabled", true),
203
+ dir: expandPath(dir, read.string("dir") ?? "~/.cache/pmcp/host"),
204
+ markerEnv: read.envName("marker_env") ?? "PMCP_HEAVY_LEASE",
205
+ ...legacyMarkerEnv ? { legacyMarkerEnv } : {},
206
+ ...legacySkipEnv ? { legacySkipEnv } : {},
207
+ maxLoad: read.positive("max_load") ?? availableParallelism(),
208
+ maxIo: read.positive("max_io") ?? 8,
209
+ ioWindow: read.oneOf("io_window", ["avg10", "avg60", "avg300"], "avg60"),
210
+ hardFactor: hardFactor(path, raw["hard_factor"]),
211
+ holdWarn: read.int("hold_warn", 1800),
212
+ ...holdMax ? { holdMax } : {},
213
+ heartbeat: read.int("heartbeat", 60),
214
+ poll: read.int("poll", 15),
215
+ budget: read.int("budget", 4),
216
+ slots: perLane(
217
+ path,
218
+ "host.lease.lanes",
219
+ lanes,
220
+ { gate: 1, hook: 1, interactive: 2, bulk: 1 },
221
+ 0
222
+ ),
223
+ weights: perLane(
224
+ path,
225
+ "host.lease.weights",
226
+ weights,
227
+ { gate: 1, hook: 1, interactive: 2, bulk: 3 },
228
+ 1
229
+ ),
230
+ commands: commands(path, raw["commands"]),
231
+ tiny: argvList(path, raw["tiny"]),
232
+ perSession: whole(path, "host.lease", "per_session", raw["per_session"], 1),
233
+ profiles: profiles(path, child(path, raw, "host.lease", "profiles"), base),
234
+ heavy: argvList(path, raw["heavy"]),
235
+ guard: read.oneOf("guard", ["observe", "warn", "deny", "off"], "observe"),
236
+ io: ioSettings(path, child(path, raw, "host.lease", "io")),
237
+ usageCap: read.int("usage_cap", 5e6),
238
+ settleWindow: whole(
239
+ path,
240
+ "host.lease",
241
+ "settle_window",
242
+ raw["settle_window"],
243
+ 60
244
+ )
245
+ };
246
+ }
247
+ function leaseSettingsFor(cwd, configPath) {
248
+ const path = configPath ?? findConfig(cwd);
249
+ if (path === null) return readLeaseSettings("pmcp.toml", cwd, void 0);
250
+ const config = readConfig(path);
251
+ return readLeaseSettings(config.path, config.dir, config.raw["host"]);
252
+ }
253
+
254
+ export {
255
+ DISABLE_ENV,
256
+ NOW_ENV,
257
+ BUSY_EXIT,
258
+ readLeaseSettings,
259
+ leaseSettingsFor
260
+ };
261
+ //# sourceMappingURL=chunk-FOLA4EUJ.js.map
@@ -0,0 +1,24 @@
1
+ import {
2
+ expandPath
3
+ } from "./chunk-GUHOEIHP.js";
4
+ import {
5
+ gitCommonDir
6
+ } from "./chunk-IJBSOWHK.js";
7
+
8
+ // src/sessions/state-dir.ts
9
+ import { createHash } from "crypto";
10
+ import { realpathSync } from "fs";
11
+ import { homedir } from "os";
12
+ import { join } from "path";
13
+ function projectStateDir(root, override, env = process.env) {
14
+ if (override) return expandPath(root, override);
15
+ const anchor = gitCommonDir(root) ?? realpathSync(root);
16
+ const id = createHash("sha256").update(anchor).digest("hex").slice(0, 16);
17
+ const base = env["XDG_STATE_HOME"] || join(homedir(), ".local", "state");
18
+ return join(base, "pmcp", "projects", id);
19
+ }
20
+
21
+ export {
22
+ projectStateDir
23
+ };
24
+ //# sourceMappingURL=chunk-FQLCD4HU.js.map
@@ -1,14 +1,7 @@
1
1
  import {
2
- checkoutOf,
3
- gitCommonDir
2
+ checkoutOf
4
3
  } from "./chunk-IJBSOWHK.js";
5
4
 
6
- // src/sessions/state-dir.ts
7
- import { createHash } from "crypto";
8
- import { realpathSync } from "fs";
9
- import { homedir as homedir2 } from "os";
10
- import { join as join2 } from "path";
11
-
12
5
  // src/sessions/paths.ts
13
6
  import { homedir } from "os";
14
7
  import {
@@ -32,17 +25,7 @@ function expandPath(base, path) {
32
25
  return isAbsolute(path) ? path : resolve(mainCheckoutBase(base), path);
33
26
  }
34
27
 
35
- // src/sessions/state-dir.ts
36
- function projectStateDir(root, override, env = process.env) {
37
- if (override) return expandPath(root, override);
38
- const anchor = gitCommonDir(root) ?? realpathSync(root);
39
- const id = createHash("sha256").update(anchor).digest("hex").slice(0, 16);
40
- const base = env["XDG_STATE_HOME"] || join2(homedir2(), ".local", "state");
41
- return join2(base, "pmcp", "projects", id);
42
- }
43
-
44
28
  export {
45
- expandPath,
46
- projectStateDir
29
+ expandPath
47
30
  };
48
- //# sourceMappingURL=chunk-OEH47H6A.js.map
31
+ //# sourceMappingURL=chunk-GUHOEIHP.js.map
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  openStore,
3
3
  readStoreSettings
4
- } from "./chunk-7I7O7ZNT.js";
4
+ } from "./chunk-3V37OZQH.js";
5
5
  import {
6
6
  ArgumentError,
7
+ noConfig,
7
8
  one
8
- } from "./chunk-A4PKLESO.js";
9
+ } from "./chunk-Y6NFETNG.js";
9
10
  import {
10
11
  findConfig,
11
12
  readConfig
@@ -14,8 +15,7 @@ import {
14
15
  // src/sessions/cli/verbs.ts
15
16
  function storeFrom(context) {
16
17
  const path = one(context.args, "config") ?? findConfig(context.cwd);
17
- if (!path)
18
- throw new ArgumentError("no pmcp.toml here or above; pass --config");
18
+ if (!path) throw noConfig();
19
19
  const config = readConfig(path);
20
20
  const sessions = config.raw["sessions"] ?? {};
21
21
  const leases = Object.keys(sessions["leases"] ?? {});
@@ -74,4 +74,4 @@ export {
74
74
  storeFrom,
75
75
  change
76
76
  };
77
- //# sourceMappingURL=chunk-B2WRYGHJ.js.map
77
+ //# sourceMappingURL=chunk-HES44LTA.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  CATALOG_OPTIONS
3
- } from "./chunk-JEL35P7S.js";
3
+ } from "./chunk-5NDUWEMW.js";
4
4
  import {
5
5
  nearestConfigOption
6
- } from "./chunk-XNML2KIC.js";
6
+ } from "./chunk-JPYQDOEW.js";
7
7
  import {
8
8
  TOOLS
9
9
  } from "./chunk-V4NPDK6X.js";
@@ -11,8 +11,42 @@ import {
11
11
  // src/commands/specs/project.ts
12
12
  var projectSpec = {
13
13
  name: "project",
14
+ examples: ["pmcp project", "pmcp project --check --smoke"],
15
+ subcommands: [
16
+ {
17
+ name: "add",
18
+ describe: "Add a skill or agent under .agents/ and project",
19
+ usage: "pmcp project add <skill|agent>",
20
+ options: [],
21
+ examples: ["pmcp project add review-checklist"]
22
+ },
23
+ {
24
+ name: "remove",
25
+ describe: "Remove an asset and project",
26
+ usage: "pmcp project remove <name>",
27
+ options: [],
28
+ examples: ["pmcp project remove review-checklist"]
29
+ },
30
+ {
31
+ name: "import-mcp",
32
+ describe: "Import MCP servers from a native config; --write applies",
33
+ usage: "pmcp project import-mcp --source <tool>:<file> [--name <alias>] [--write]",
34
+ options: ["source", "name", "write", "config"],
35
+ examples: [
36
+ "pmcp project import-mcp --source codex:~/.codex/config.toml",
37
+ "pmcp project import-mcp --source claude:.mcp.json --name github --write"
38
+ ]
39
+ },
40
+ {
41
+ name: "exec-mcp",
42
+ describe: "Start a declared MCP server; projected native entries run this",
43
+ usage: "pmcp project exec-mcp <alias>",
44
+ options: ["config"],
45
+ examples: ["pmcp project exec-mcp remote"]
46
+ }
47
+ ],
14
48
  describe: "Write each agent tool's native files from .agents/ and pmcp.toml",
15
- usage: "pmcp project [--check] | pmcp project add <skill|agent> | pmcp project remove <name> | pmcp project import-mcp --source <tool>:<file> [--name <alias>] [--write]",
49
+ usage: "pmcp project [--check [--smoke]] | pmcp project <subcommand> [options]",
16
50
  options: [
17
51
  ...CATALOG_OPTIONS,
18
52
  {
@@ -34,7 +68,7 @@ var projectSpec = {
34
68
  },
35
69
  {
36
70
  name: "check",
37
- describe: "Write nothing; exit 2 when an output drifted, went stale or is undeclared.",
71
+ describe: "Write nothing; exit 4 when an output drifted, went stale or is undeclared.",
38
72
  boolean: true
39
73
  },
40
74
  {
@@ -46,6 +80,7 @@ var projectSpec = {
46
80
  };
47
81
  var doctorSpec = {
48
82
  name: "doctor",
83
+ examples: ["pmcp doctor", "pmcp doctor --tool claude --json"],
49
84
  describe: "Ask each agent tool, through its own listing commands, whether it loads this project's assets",
50
85
  usage: "pmcp doctor [--tool <name>] [--json] [--memory]",
51
86
  options: [
@@ -56,7 +91,11 @@ var doctorSpec = {
56
91
  repeat: true,
57
92
  placeholder: "<name>"
58
93
  },
59
- { name: "json", describe: "Emit JSON rather than a table.", boolean: true },
94
+ {
95
+ name: "json",
96
+ describe: "Print the result as one JSON envelope on stdout.",
97
+ boolean: true
98
+ },
60
99
  {
61
100
  name: "memory",
62
101
  describe: "Report native memory configuration metadata only; do not read memory bodies or check MCP connections.",
@@ -69,4 +108,4 @@ export {
69
108
  projectSpec,
70
109
  doctorSpec
71
110
  };
72
- //# sourceMappingURL=chunk-RHJEGLYM.js.map
111
+ //# sourceMappingURL=chunk-HF5D6B2U.js.map
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  ArgumentError,
9
9
  one
10
- } from "./chunk-A4PKLESO.js";
10
+ } from "./chunk-Y6NFETNG.js";
11
11
 
12
12
  // src/commands/remote-options.ts
13
13
  import { dirname, join as join2, resolve } from "path";
@@ -281,4 +281,4 @@ export {
281
281
  apiOrigin,
282
282
  remoteCatalog
283
283
  };
284
- //# sourceMappingURL=chunk-R5MT42JS.js.map
284
+ //# sourceMappingURL=chunk-HYXOJYVR.js.map
@@ -0,0 +1,50 @@
1
+ // src/commands/specs/marketplace.ts
2
+ var marketplaceSpec = {
3
+ name: "marketplace",
4
+ examples: [
5
+ "pmcp marketplace list",
6
+ "pmcp marketplace export typescript-5 --runtime agy --output ./typescript-plugin"
7
+ ],
8
+ subcommands: [
9
+ {
10
+ name: "list",
11
+ describe: "The bundled free plugins",
12
+ usage: "pmcp marketplace list [--json]",
13
+ options: ["json"],
14
+ examples: ["pmcp marketplace list --json"]
15
+ },
16
+ {
17
+ name: "export",
18
+ describe: "Write one plugin in a runtime's native format",
19
+ usage: "pmcp marketplace export <plugin> --runtime <runtime> --output <directory> [--json]",
20
+ options: ["runtime", "output", "json"],
21
+ examples: [
22
+ "pmcp marketplace export typescript-5 --runtime claude --output ./ts-plugin"
23
+ ]
24
+ }
25
+ ],
26
+ describe: "List free public plugins or export a selected native plugin",
27
+ usage: "pmcp marketplace <subcommand> [options]",
28
+ options: [
29
+ {
30
+ name: "runtime",
31
+ describe: "Native plugin format: claude, codex, gemini, grok or agy.",
32
+ placeholder: "<runtime>"
33
+ },
34
+ {
35
+ name: "output",
36
+ describe: "New directory for the selected plugin; existing paths are preserved.",
37
+ placeholder: "<directory>"
38
+ },
39
+ {
40
+ name: "json",
41
+ describe: "Print the result as one JSON envelope on stdout.",
42
+ boolean: true
43
+ }
44
+ ]
45
+ };
46
+
47
+ export {
48
+ marketplaceSpec
49
+ };
50
+ //# sourceMappingURL=chunk-JANBBPKP.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  HOST_MANIFEST,
3
3
  HOST_POLICY
4
- } from "./chunk-SPZQRLL5.js";
4
+ } from "./chunk-KYGGQPAH.js";
5
5
  import {
6
6
  projectStateDir
7
- } from "./chunk-OEH47H6A.js";
7
+ } from "./chunk-FQLCD4HU.js";
8
8
 
9
9
  // src/project/host-approval.ts
10
10
  import { createHash } from "crypto";
@@ -99,4 +99,4 @@ export {
99
99
  hostApprovalDoctor,
100
100
  writeApproval
101
101
  };
102
- //# sourceMappingURL=chunk-ITOTOC6Y.js.map
102
+ //# sourceMappingURL=chunk-JJFPSFDU.js.map