@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
@@ -0,0 +1,99 @@
1
+ import {
2
+ ConfigError
3
+ } from "./chunk-GJXOFDJT.js";
4
+
5
+ // src/git/config/reader.ts
6
+ var Reader = class {
7
+ constructor(path, name, table2, keys) {
8
+ this.path = path;
9
+ this.name = name;
10
+ this.table = table2;
11
+ for (const key of Object.keys(table2)) {
12
+ if (!keys.includes(key))
13
+ throw new ConfigError(path, `unknown key [${name}] ${key}`);
14
+ }
15
+ }
16
+ path;
17
+ name;
18
+ table;
19
+ fail(key, expected) {
20
+ throw new ConfigError(
21
+ this.path,
22
+ `[${this.name}] ${key} must be ${expected}`
23
+ );
24
+ }
25
+ string(key) {
26
+ const value = this.table[key];
27
+ if (value === void 0) return void 0;
28
+ if (typeof value !== "string" || !value.trim())
29
+ this.fail(key, "a non-empty string");
30
+ return value;
31
+ }
32
+ envName(key) {
33
+ const value = this.string(key);
34
+ if (value !== void 0 && !/^[A-Z_][A-Z0-9_]{0,127}$/u.test(value))
35
+ this.fail(key, "an environment variable name (A-Z, 0-9, _)");
36
+ return value;
37
+ }
38
+ oneOf(key, values, fallback) {
39
+ const value = this.table[key] ?? fallback;
40
+ if (!values.includes(value)) this.fail(key, values.join(" | "));
41
+ return value;
42
+ }
43
+ bool(key, fallback) {
44
+ const value = this.table[key] ?? fallback;
45
+ if (typeof value !== "boolean") this.fail(key, "a boolean");
46
+ return value;
47
+ }
48
+ int(key, fallback) {
49
+ const value = this.table[key] ?? fallback;
50
+ if (!Number.isInteger(value) || value < 1)
51
+ this.fail(key, "a positive integer");
52
+ return value;
53
+ }
54
+ positive(key) {
55
+ const value = this.table[key];
56
+ if (value === void 0) return void 0;
57
+ if (typeof value !== "number" || !(value > 0))
58
+ this.fail(key, "a positive number");
59
+ return value;
60
+ }
61
+ list(key) {
62
+ const value = this.table[key] ?? [];
63
+ if (!Array.isArray(value) || !value.every((v) => typeof v === "string"))
64
+ this.fail(key, "a list of strings");
65
+ return value;
66
+ }
67
+ argv(key) {
68
+ const value = this.list(key);
69
+ if (value.length === 0) return void 0;
70
+ return value;
71
+ }
72
+ // A table of environment variable names to string values.
73
+ envMap(key) {
74
+ const value = this.table[key] ?? {};
75
+ if (value === null || typeof value !== "object" || Array.isArray(value))
76
+ this.fail(key, "a table of variable names to strings");
77
+ for (const [name, text] of Object.entries(value)) {
78
+ if (!/^[A-Z_][A-Z0-9_]{0,127}$/u.test(name) || typeof text !== "string")
79
+ this.fail(key, "a table of variable names (A-Z, 0-9, _) to strings");
80
+ }
81
+ return value;
82
+ }
83
+ };
84
+ function table(path, name, value) {
85
+ if (value === void 0) return void 0;
86
+ if (value === null || typeof value !== "object" || Array.isArray(value))
87
+ throw new ConfigError(path, `[${name}] must be a table`);
88
+ return value;
89
+ }
90
+ function child(path, parent, name, key) {
91
+ return table(path, `${name}.${key}`, parent?.[key]);
92
+ }
93
+
94
+ export {
95
+ Reader,
96
+ table,
97
+ child
98
+ };
99
+ //# sourceMappingURL=chunk-T6C3TSTO.js.map
@@ -0,0 +1,78 @@
1
+ import {
2
+ jsonOption
3
+ } from "./chunk-JPYQDOEW.js";
4
+
5
+ // src/commands/specs/mcp.ts
6
+ var mcpSpec = {
7
+ name: "mcp",
8
+ examples: [
9
+ "pmcp mcp login remote --no-wait",
10
+ "pmcp mcp status remote --json"
11
+ ],
12
+ subcommands: [
13
+ {
14
+ name: "login",
15
+ describe: "Sign a shared remote MCP server in",
16
+ usage: "pmcp mcp login <name> [--no-wait | --code <callback-or-code>] [--port <port>] [--client-id <id>] [--bearer-env <name>]",
17
+ options: ["code", "no-wait", "port", "client-id", "bearer-env", "config"],
18
+ examples: [
19
+ "pmcp mcp login remote --no-wait",
20
+ "pmcp mcp login remote --code 'http://127.0.0.1:8976/callback?code=...'"
21
+ ]
22
+ },
23
+ {
24
+ name: "logout",
25
+ describe: "Clear its stored credentials",
26
+ usage: "pmcp mcp logout <name>",
27
+ options: ["config"],
28
+ examples: ["pmcp mcp logout remote"]
29
+ },
30
+ {
31
+ name: "status",
32
+ describe: "Presence, UTC expiry and scopes; never tokens",
33
+ usage: "pmcp mcp status <name> [--json]",
34
+ options: ["config", "json"],
35
+ examples: ["pmcp mcp status remote"]
36
+ }
37
+ ],
38
+ describe: "Manage the project's shared remote MCP authentication",
39
+ usage: "pmcp mcp <subcommand> <name> [options]",
40
+ options: [
41
+ jsonOption,
42
+ {
43
+ name: "config",
44
+ describe: "A pmcp.toml to read instead of the nearest one.",
45
+ placeholder: "<file>"
46
+ },
47
+ {
48
+ name: "code",
49
+ describe: "Complete a pending login with a callback URL or authorization code.",
50
+ placeholder: "<callback-or-code>"
51
+ },
52
+ {
53
+ name: "no-wait",
54
+ describe: "Print the authorization URL and save a pending login for later completion.",
55
+ boolean: true
56
+ },
57
+ {
58
+ name: "port",
59
+ describe: "Loopback callback port; zero chooses an available port.",
60
+ placeholder: "<port>"
61
+ },
62
+ {
63
+ name: "client-id",
64
+ describe: "Use a pre-registered OAuth client identifier.",
65
+ placeholder: "<id>"
66
+ },
67
+ {
68
+ name: "bearer-env",
69
+ describe: "Store a bearer session from this environment variable without printing it.",
70
+ placeholder: "<name>"
71
+ }
72
+ ]
73
+ };
74
+
75
+ export {
76
+ mcpSpec
77
+ };
78
+ //# sourceMappingURL=chunk-UVTGY2R3.js.map
@@ -1,13 +1,17 @@
1
1
  import {
2
2
  EMBEDDING_OPTIONS
3
- } from "./chunk-INT7QLEU.js";
3
+ } from "./chunk-7DJQASH3.js";
4
4
  import {
5
5
  CATALOG_OPTIONS
6
- } from "./chunk-JEL35P7S.js";
6
+ } from "./chunk-5NDUWEMW.js";
7
7
 
8
8
  // src/commands/specs/serve.ts
9
9
  var serveSpec = {
10
10
  name: "serve",
11
+ examples: [
12
+ "pmcp serve --root ./node_modules",
13
+ "pmcp serve --lexical --prompts"
14
+ ],
11
15
  describe: "Run the MCP server on stdio (also the default for piped launches)",
12
16
  usage: "pmcp serve [--root <dir>] [--scope <prefix>] [--marketplace <dir>] [--package <dir>] [--workspace <dir>] [--config <file> | --no-config] [--prompts]",
13
17
  options: [
@@ -54,4 +58,4 @@ var serveSpec = {
54
58
  export {
55
59
  serveSpec
56
60
  };
57
- //# sourceMappingURL=chunk-LLT5FQBE.js.map
61
+ //# sourceMappingURL=chunk-VBVNOLRR.js.map
@@ -16,18 +16,27 @@ var REMOTE_OPTIONS = [
16
16
  describe: "Use a saved catalog response without network access.",
17
17
  placeholder: "<file>"
18
18
  },
19
- { name: "json", describe: "Print machine-readable results.", boolean: true }
19
+ {
20
+ name: "json",
21
+ describe: "Print the result as one JSON envelope on stdout.",
22
+ boolean: true
23
+ }
20
24
  ];
21
25
 
22
26
  // src/commands/specs/remote.ts
23
27
  var availableSpec = {
24
28
  name: "available",
29
+ examples: [
30
+ "pmcp available",
31
+ "pmcp available --catalog saved-catalog.json --json"
32
+ ],
25
33
  describe: "Find provided skills matching this project's installed dependencies",
26
34
  usage: "pmcp available [--project <dir>] [--catalog <file>] [--json]",
27
35
  options: REMOTE_OPTIONS
28
36
  };
29
37
  var previewSpec = {
30
38
  name: "preview",
39
+ examples: ["pmcp preview @modootoday/skill-react"],
31
40
  describe: "Show a skill's contents and a complete example",
32
41
  usage: "pmcp preview <skill-package> [--json]",
33
42
  options: REMOTE_OPTIONS
@@ -42,13 +51,18 @@ var MANAGE_OPTIONS = [
42
51
  {
43
52
  name: "yes",
44
53
  describe: "Approve the displayed project and lockfile changes.",
45
- boolean: true
54
+ boolean: true,
55
+ short: "y"
46
56
  }
47
57
  ];
48
58
  var installSpec = {
49
59
  name: "install",
60
+ examples: [
61
+ "pmcp install --all --dry-run",
62
+ "pmcp install @modootoday/skill-react -y"
63
+ ],
50
64
  describe: "Install matching skill npm packages with the project's package manager",
51
- usage: "pmcp install <skill-package>... | --all [--dry-run | --yes]",
65
+ usage: "pmcp install <skill-package>... | --all [--dry-run | -y]",
52
66
  options: [
53
67
  ...MANAGE_OPTIONS,
54
68
  {
@@ -60,8 +74,9 @@ var installSpec = {
60
74
  };
61
75
  var syncSpec = {
62
76
  name: "sync",
77
+ examples: ["pmcp sync --dry-run", "pmcp sync -y"],
63
78
  describe: "Update declared skill packages without removing other dependencies",
64
- usage: "pmcp sync [--project <dir>] [--dry-run | --yes]",
79
+ usage: "pmcp sync [--project <dir>] [--dry-run | -y]",
65
80
  options: MANAGE_OPTIONS
66
81
  };
67
82
 
@@ -71,4 +86,4 @@ export {
71
86
  installSpec,
72
87
  syncSpec
73
88
  };
74
- //# sourceMappingURL=chunk-ABTJQ4QV.js.map
89
+ //# sourceMappingURL=chunk-WBPVNCQO.js.map
@@ -1,9 +1,9 @@
1
- import {
2
- globPattern
3
- } from "./chunk-UKR64U7J.js";
4
1
  import {
5
2
  syncWorktree
6
3
  } from "./chunk-UYBWUOLR.js";
4
+ import {
5
+ globPattern
6
+ } from "./chunk-UKR64U7J.js";
7
7
  import {
8
8
  localCli,
9
9
  pmcpCommand,
@@ -28,7 +28,7 @@ import {
28
28
  import {
29
29
  leaseSpecs,
30
30
  readGitConfig
31
- } from "./chunk-7CSUKCU7.js";
31
+ } from "./chunk-RZYZILU4.js";
32
32
  import {
33
33
  detect
34
34
  } from "./chunk-SUDG7B6S.js";
@@ -36,7 +36,7 @@ import {
36
36
  inboxKey,
37
37
  noticeOf,
38
38
  readStoreSettings
39
- } from "./chunk-7I7O7ZNT.js";
39
+ } from "./chunk-3V37OZQH.js";
40
40
  import {
41
41
  STATE_FILES,
42
42
  runtimePid
@@ -63,12 +63,17 @@ import {
63
63
  TOOLS
64
64
  } from "./chunk-V4NPDK6X.js";
65
65
  import {
66
+ declaresPtyHost,
66
67
  hostOutputs,
67
68
  packagedBinary,
68
69
  readHost,
69
70
  readLock,
70
71
  readLockFile
71
- } from "./chunk-SPZQRLL5.js";
72
+ } from "./chunk-KYGGQPAH.js";
73
+ import {
74
+ DISABLE_ENV,
75
+ readLeaseSettings
76
+ } from "./chunk-FOLA4EUJ.js";
72
77
  import {
73
78
  ProjectError,
74
79
  RULES_DIR,
@@ -167,7 +172,7 @@ function shellWord(text) {
167
172
  return pieces.join("");
168
173
  }
169
174
  function forwardedVariables(server) {
170
- const names3 = new Set(server.envVars ?? []);
175
+ const names4 = new Set(server.envVars ?? []);
171
176
  const words = [
172
177
  server.command ?? "",
173
178
  ...server.args,
@@ -177,11 +182,11 @@ function forwardedVariables(server) {
177
182
  for (const word of words) {
178
183
  for (const match of word.matchAll(VARIABLE)) {
179
184
  if (match[1] !== "PROJECT_ROOT") {
180
- names3.add(match[1]);
185
+ names4.add(match[1]);
181
186
  }
182
187
  }
183
188
  }
184
- return [...names3].sort();
189
+ return [...names4].sort();
185
190
  }
186
191
  function launch(spec) {
187
192
  if (spec.command === void 0) {
@@ -969,9 +974,9 @@ function hookOutputs(spec) {
969
974
  }
970
975
 
971
976
  // src/project/adapters/opencode-skills.ts
972
- function opencodeSkillOutputs(spec, names3) {
977
+ function opencodeSkillOutputs(spec, names4) {
973
978
  if (!spec.tools.has("opencode")) return [];
974
- return names3.filter((name) => spec.skills[name]?.invocation === "user").map(
979
+ return names4.filter((name) => spec.skills[name]?.invocation === "user").map(
975
980
  (name) => jsonOutput(OPENCODE_CONFIG, ["permission", "skill", name], "deny")
976
981
  );
977
982
  }
@@ -1478,9 +1483,9 @@ function agentNames(root) {
1478
1483
  );
1479
1484
  }
1480
1485
  function skillOutputs(spec) {
1481
- const names3 = skillNames(spec.root);
1482
- const outputs = opencodeSkillOutputs(spec, names3);
1483
- for (const name of names3) {
1486
+ const names4 = skillNames(spec.root);
1487
+ const outputs = opencodeSkillOutputs(spec, names4);
1488
+ for (const name of names4) {
1484
1489
  const target = `../../.agents/skills/${name}`;
1485
1490
  if (spec.tools.has("claude")) {
1486
1491
  outputs.push({ kind: "link", path: `.claude/skills/${name}`, target });
@@ -1694,11 +1699,11 @@ function checkBudget(spec, settings) {
1694
1699
  }
1695
1700
  const tracked = settings.packageBytes !== void 0 || settings.forbidPaths.length > 0 ? trackedFiles(spec.root) : [];
1696
1701
  if (settings.packageBytes !== void 0) {
1697
- const names3 = new Set(
1702
+ const names4 = new Set(
1698
1703
  ["AGENTS.md", spec.packageRules?.file].filter(Boolean)
1699
1704
  );
1700
1705
  for (const file of tracked) {
1701
- if (!file.includes("/") || !names3.has(basename(file))) continue;
1706
+ if (!file.includes("/") || !names4.has(basename(file))) continue;
1702
1707
  const path = join7(spec.root, file);
1703
1708
  if (regularFile(path))
1704
1709
  row("package_bytes", file, measure(path).bytes, settings.packageBytes);
@@ -3781,9 +3786,15 @@ function argvList(value, where) {
3781
3786
  function startsWith(argv, prefix) {
3782
3787
  if (argv.length < prefix.length) return false;
3783
3788
  return prefix.every(
3784
- (word, at) => at === 0 ? program(argv[0]) === word : argv[at] === word
3789
+ (word, at) => at === 0 ? program(argv[0]) === word : argWord(argv[at], word)
3785
3790
  );
3786
3791
  }
3792
+ var SCRIPT = /(?:\/|\.[A-Za-z0-9]{1,8}$)/u;
3793
+ function argWord(arg, word) {
3794
+ if (arg === void 0) return false;
3795
+ if (arg === word) return true;
3796
+ return SCRIPT.test(word) && arg.endsWith(`/${word.replace(/^\.\//u, "")}`);
3797
+ }
3787
3798
  function blocked(steps, rule) {
3788
3799
  return realSteps(steps).some(
3789
3800
  (step) => rule.blocks.some((prefix) => startsWith(step.argv, prefix))
@@ -4779,8 +4790,8 @@ function claimants(store, session, root) {
4779
4790
  (record) => record.live && record.session !== session && record.worktree === root
4780
4791
  ).map((record) => record.alias || record.session.slice(0, 8));
4781
4792
  }
4782
- function claimantNotice(root, names3) {
4783
- return `Another live session works in ${root}: ${names3.join(", ")}. Edit only files that are yours, and name every path when you commit.`;
4793
+ function claimantNotice(root, names4) {
4794
+ return `Another live session works in ${root}: ${names4.join(", ")}. Edit only files that are yours, and name every path when you commit.`;
4784
4795
  }
4785
4796
 
4786
4797
  // src/hooks/policies/workspace/leftovers.ts
@@ -5153,6 +5164,47 @@ var worktreeSync = {
5153
5164
  }
5154
5165
  };
5155
5166
 
5167
+ // src/hooks/policies/host/lease.ts
5168
+ function argvList2(value) {
5169
+ const valid = Array.isArray(value) && value.every(
5170
+ (item) => Array.isArray(item) && item.length > 0 && item.every((word) => typeof word === "string" && word !== "")
5171
+ );
5172
+ if (!valid) throw new Error("heavy must be a list of argv prefixes");
5173
+ return value;
5174
+ }
5175
+ function names3(value) {
5176
+ if (value === void 0) return [];
5177
+ if (!Array.isArray(value) || !value.every((v) => typeof v === "string"))
5178
+ throw new Error("skip_env must be a list of names");
5179
+ return value;
5180
+ }
5181
+ var hostLease = {
5182
+ id: "host.lease",
5183
+ events: ["before_tool"],
5184
+ tools: ["shell"],
5185
+ fail: "open",
5186
+ defaultMode: "observe",
5187
+ options(raw) {
5188
+ onlyKeys(raw, ["heavy", "skip_env"]);
5189
+ return { heavy: argvList2(raw["heavy"]), skipEnv: names3(raw["skip_env"]) };
5190
+ },
5191
+ evaluate(input, ctx) {
5192
+ const call = shellCall(input);
5193
+ if (!call) return pass;
5194
+ for (const step of realSteps(call.steps)) {
5195
+ if (!ctx.options.heavy.some((prefix) => startsWith(step.argv, prefix)))
5196
+ continue;
5197
+ if (step.assigned.some((name) => ctx.options.skipEnv.includes(name)))
5198
+ continue;
5199
+ return {
5200
+ verdict: "deny",
5201
+ reason: `${step.argv.join(" ")} is a heavy command ([host.lease] heavy) and runs outside the host lease. Run it as: pmcp heavy -- ${step.argv.join(" ")}`
5202
+ };
5203
+ }
5204
+ return pass;
5205
+ }
5206
+ };
5207
+
5156
5208
  // src/hooks/policies/custom.ts
5157
5209
  import { spawnSync as spawnSync6 } from "child_process";
5158
5210
  import { createHash as createHash5 } from "crypto";
@@ -5353,7 +5405,8 @@ var FEATURES = byId([
5353
5405
  roles,
5354
5406
  sharedCheckout,
5355
5407
  worktreeSync,
5356
- mainlineDeliver
5408
+ mainlineDeliver,
5409
+ hostLease
5357
5410
  ]);
5358
5411
  var POLICIES = {
5359
5412
  ...FEATURES,
@@ -5561,7 +5614,7 @@ function readCustom(root, hooks, guards) {
5561
5614
  [hooks["edit"], "after_edit"],
5562
5615
  [guards["custom"], void 0]
5563
5616
  ];
5564
- const names3 = /* @__PURE__ */ new Set();
5617
+ const names4 = /* @__PURE__ */ new Set();
5565
5618
  const found = [];
5566
5619
  for (const [list2, implied] of sources) {
5567
5620
  if (list2 === void 0) continue;
@@ -5569,9 +5622,9 @@ function readCustom(root, hooks, guards) {
5569
5622
  throw new Error("custom guards must be arrays of tables");
5570
5623
  for (const value of list2) {
5571
5624
  const entry = readEntry(root, value, implied);
5572
- if (names3.has(entry.name))
5625
+ if (names4.has(entry.name))
5573
5626
  throw new Error("shell names must be unique lowercase names");
5574
- names3.add(entry.name);
5627
+ names4.add(entry.name);
5575
5628
  if (entry.mode !== "off") found.push(entry);
5576
5629
  }
5577
5630
  }
@@ -5762,6 +5815,23 @@ function readHooksTable(table3, tools) {
5762
5815
  };
5763
5816
  }
5764
5817
 
5818
+ // src/hooks/compile/host-lease.ts
5819
+ function readHostLease(host, root) {
5820
+ if (host === void 0) return null;
5821
+ const settings = readLeaseSettings("pmcp.toml", root, host);
5822
+ if (!settings.enabled || settings.guard === "off") return null;
5823
+ if (settings.heavy.length === 0) return null;
5824
+ const options2 = {
5825
+ heavy: settings.heavy,
5826
+ skip_env: [
5827
+ DISABLE_ENV,
5828
+ ...settings.legacySkipEnv ? [settings.legacySkipEnv] : []
5829
+ ]
5830
+ };
5831
+ FEATURES["host.lease"].options(options2);
5832
+ return { id: "host.lease", mode: settings.guard, options: options2 };
5833
+ }
5834
+
5765
5835
  // src/hooks/compile/sessions.ts
5766
5836
  var KEYS5 = [
5767
5837
  "store",
@@ -5959,7 +6029,7 @@ function readMainlineDeliver(tables, root) {
5959
6029
 
5960
6030
  // src/hooks/compile.ts
5961
6031
  function hostGuard(host, guards) {
5962
- if (host === void 0) return null;
6032
+ if (!declaresPtyHost(host)) return null;
5963
6033
  const shell = asTable(guards["shell"], "[hooks.guards.shell]");
5964
6034
  if (shell["host_approval"] !== void 0) return null;
5965
6035
  return { id: "shell.host_approval", mode: "deny", options: {} };
@@ -5974,7 +6044,8 @@ function compileHooks(tables, options2) {
5974
6044
  const deskSync = readWorktreeSync(tables, options2.root);
5975
6045
  const directPush = readMainlineDeliver(tables, options2.root);
5976
6046
  const host = hostGuard(tables.host, guardsTable);
5977
- const enabled = table3.enabled || host !== null || sessions.declared || workspace.declared || !!deskSync || !!directPush;
6047
+ const heavy = readHostLease(tables.host, options2.root);
6048
+ const enabled = table3.enabled || host !== null || heavy !== null || sessions.declared || workspace.declared || !!deskSync || !!directPush;
5978
6049
  const legacy = legacyEntries(entries, enabled, table3.targets);
5979
6050
  if (!enabled)
5980
6051
  return {
@@ -5991,6 +6062,7 @@ function compileHooks(tables, options2) {
5991
6062
  ...deskSync ? [deskSync] : [],
5992
6063
  ...directPush ? [directPush] : [],
5993
6064
  ...host ? [host] : [],
6065
+ ...heavy ? [heavy] : [],
5994
6066
  ...readGuards(guardsTable),
5995
6067
  ...readChecks(hooks["checks"])
5996
6068
  ];
@@ -6295,4 +6367,4 @@ export {
6295
6367
  checkBudget,
6296
6368
  readSpec
6297
6369
  };
6298
- //# sourceMappingURL=chunk-63RZGEVI.js.map
6370
+ //# sourceMappingURL=chunk-WQBKQTNT.js.map
@@ -1,11 +1,15 @@
1
1
  import {
2
2
  jsonOption,
3
3
  nearestConfigOption
4
- } from "./chunk-XNML2KIC.js";
4
+ } from "./chunk-JPYQDOEW.js";
5
5
 
6
6
  // src/commands/specs/logs.ts
7
7
  var logsSpec = {
8
8
  name: "logs",
9
+ examples: [
10
+ "pmcp logs --since 10m --level warn --pretty",
11
+ "pmcp logs --trace 7cef825e8fbd8c3f --json"
12
+ ],
9
13
  describe: "Read this project's pmcp JSONL logs, filtered by session, trace, component, level or time",
10
14
  usage: "pmcp logs [--session <id>] [--trace <id>] [--component <name>] [--level <level>] [--since <10m|ISO>] [--follow] [--pretty]",
11
15
  options: [
@@ -48,4 +52,4 @@ var logsSpec = {
48
52
  export {
49
53
  logsSpec
50
54
  };
51
- //# sourceMappingURL=chunk-YGOWIJPE.js.map
55
+ //# sourceMappingURL=chunk-WZYGM3FR.js.map