@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
@@ -4,23 +4,23 @@ import {
4
4
  import {
5
5
  logLocation,
6
6
  readLogs
7
- } from "./chunk-5QKXEWDB.js";
7
+ } from "./chunk-MHKY6TNF.js";
8
8
  import {
9
9
  policyRows
10
- } from "./chunk-DYZVHO2L.js";
10
+ } from "./chunk-5HNLHI5F.js";
11
11
  import "./chunk-7TD53M7L.js";
12
12
  import {
13
13
  configFrom
14
- } from "./chunk-RPCIROW7.js";
14
+ } from "./chunk-7CHUMF3E.js";
15
15
  import {
16
16
  checkProject
17
- } from "./chunk-2OOWAGBE.js";
17
+ } from "./chunk-72V6U7CZ.js";
18
18
  import {
19
19
  checkBudget,
20
20
  readSpec
21
- } from "./chunk-63RZGEVI.js";
22
- import "./chunk-UKR64U7J.js";
21
+ } from "./chunk-WQBKQTNT.js";
23
22
  import "./chunk-UYBWUOLR.js";
23
+ import "./chunk-UKR64U7J.js";
24
24
  import {
25
25
  distance
26
26
  } from "./chunk-42SO7KYX.js";
@@ -32,7 +32,7 @@ import "./chunk-73AKO4UL.js";
32
32
  import "./chunk-M6X6HVQK.js";
33
33
  import {
34
34
  readGitConfig
35
- } from "./chunk-7CSUKCU7.js";
35
+ } from "./chunk-RZYZILU4.js";
36
36
  import {
37
37
  defaultMainline,
38
38
  defaultRemote
@@ -40,28 +40,34 @@ import {
40
40
  import {
41
41
  openStore,
42
42
  readStoreSettings
43
- } from "./chunk-7I7O7ZNT.js";
43
+ } from "./chunk-3V37OZQH.js";
44
44
  import "./chunk-Z6WRFOFT.js";
45
45
  import "./chunk-B3OZ4GGO.js";
46
46
  import "./chunk-Q5H3L6Y4.js";
47
47
  import "./chunk-ARXCYFFZ.js";
48
48
  import {
49
49
  statusSpec
50
- } from "./chunk-KEHB4FZP.js";
51
- import "./chunk-XNML2KIC.js";
52
- import {
53
- ArgumentError
54
- } from "./chunk-A4PKLESO.js";
50
+ } from "./chunk-E2E4HIEN.js";
51
+ import "./chunk-JPYQDOEW.js";
55
52
  import "./chunk-V4NPDK6X.js";
56
- import "./chunk-SPZQRLL5.js";
53
+ import {
54
+ ArgumentError,
55
+ EXIT,
56
+ noConfig
57
+ } from "./chunk-Y6NFETNG.js";
58
+ import "./chunk-KYGGQPAH.js";
59
+ import "./chunk-FOLA4EUJ.js";
60
+ import "./chunk-N7ANFMA5.js";
57
61
  import "./chunk-TYY5TYHF.js";
58
- import "./chunk-OEH47H6A.js";
62
+ import "./chunk-T6C3TSTO.js";
63
+ import "./chunk-FQLCD4HU.js";
64
+ import "./chunk-GUHOEIHP.js";
59
65
  import {
60
66
  checkoutOf,
61
67
  worktreesOf
62
68
  } from "./chunk-IJBSOWHK.js";
63
69
  import "./chunk-XWLMZKH2.js";
64
- import "./chunk-3C5FVHQ3.js";
70
+ import "./chunk-7IRXUPM2.js";
65
71
  import "./chunk-GJXOFDJT.js";
66
72
  import "./chunk-PMJG2CXF.js";
67
73
  import "./chunk-J6KL3COD.js";
@@ -235,16 +241,16 @@ async function readStatus(config, env) {
235
241
 
236
242
  // src/status/render.ts
237
243
  function renderStatus(context, report) {
238
- context.ui.line("pmcp status: " + report.config);
244
+ context.ui.results.line("pmcp status: " + report.config);
239
245
  const enabled = report.features.filter((row) => row.enabled);
240
- context.ui.line(
246
+ context.ui.results.line(
241
247
  "Features: " + (enabled.map((row) => row.feature + " [" + row.source + "]").join(", ") || "none")
242
248
  );
243
- context.ui.line(
249
+ context.ui.results.line(
244
250
  "Projection: " + (report.projection.drift ? report.projection.problems.length + " drift(s)" : "matches") + " (" + report.projection.outputs + " outputs)"
245
251
  );
246
252
  for (const problem of report.projection.problems.slice(0, 3))
247
- context.ui.line(" " + problem);
253
+ context.ui.results.line(" " + problem);
248
254
  if (report.budget) {
249
255
  const worst = /* @__PURE__ */ new Map();
250
256
  for (const row of report.budget.rows) {
@@ -252,26 +258,26 @@ function renderStatus(context, report) {
252
258
  if (!seen || row.value - row.limit > seen.value - seen.limit)
253
259
  worst.set(row.key, row);
254
260
  }
255
- context.ui.line(
261
+ context.ui.results.line(
256
262
  "Budget: " + (report.budget.problems.length ? report.budget.problems.length + " over" : "within") + ([...worst.values()].map((row) => `; ${row.key} ${row.subject} ${row.value}/${row.limit}`).join("") || "")
257
263
  );
258
264
  for (const problem of report.budget.problems.slice(0, 3))
259
- context.ui.line(" " + problem);
265
+ context.ui.results.line(" " + problem);
260
266
  }
261
267
  const state = report.sessions;
262
- context.ui.line(
268
+ context.ui.results.line(
263
269
  "Sessions: " + state.live.length + " live; pause " + (state.pause?.reason ?? "none") + "; " + state.leases.length + " lease(s); " + state.broadcasts.filter((row) => row.unseenBy.length > 0).length + " unseen broadcast(s)"
264
270
  );
265
271
  const drifted = report.worktrees.filter(
266
272
  (row) => (row.behind ?? 0) > 0 || (row.ahead ?? 0) > 0
267
273
  );
268
- context.ui.line(
274
+ context.ui.results.line(
269
275
  "Linked worktrees: " + report.worktrees.length + "; " + drifted.length + " ahead/behind"
270
276
  );
271
- context.ui.line(
277
+ context.ui.results.line(
272
278
  "MCP auth: " + (report.mcp.map((row) => row.name + "=" + (row.present ? "present" : "absent")).join(", ") || "no pmcp-auth servers")
273
279
  );
274
- context.ui.line("Errors (last hour): " + report.errors.length);
280
+ context.ui.results.line("Errors (last hour): " + report.errors.length);
275
281
  }
276
282
 
277
283
  // src/status/run.ts
@@ -279,13 +285,12 @@ async function run(context) {
279
285
  if (context.args.positional.length)
280
286
  throw new ArgumentError("Use status [--json]");
281
287
  const config = configFrom(context);
282
- if (!config)
283
- throw new ArgumentError("no pmcp.toml here or above; run pmcp init");
288
+ if (!config) throw noConfig();
284
289
  const report = await readStatus(config, context.env);
285
290
  if (context.args.flags.has("json"))
286
291
  context.ui.data(JSON.stringify(report) + "\n");
287
292
  if (!context.args.flags.has("json")) renderStatus(context, report);
288
- return report.drift ? 2 : 0;
293
+ return report.drift ? EXIT.differences : EXIT.ok;
289
294
  }
290
295
 
291
296
  // src/commands/status.ts
@@ -296,4 +301,4 @@ var statusCommand = {
296
301
  export {
297
302
  statusCommand
298
303
  };
299
- //# sourceMappingURL=status-OGABWCPO.js.map
304
+ //# sourceMappingURL=status-LBRK37GA.js.map
package/dist/stdio.js CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  resolveRoots,
5
5
  serve,
6
6
  serveWithMailbox
7
- } from "./chunk-UDVYVRGJ.js";
8
- import "./chunk-OAX6MIOZ.js";
7
+ } from "./chunk-DNSHJIS4.js";
8
+ import "./chunk-2K4WYN4C.js";
9
9
  import "./chunk-6WXMJOMI.js";
10
10
  import "./chunk-4CRRLDDS.js";
11
11
  import "./chunk-YSAWTGNA.js";
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  change
3
- } from "./chunk-B2WRYGHJ.js";
4
- import "./chunk-7I7O7ZNT.js";
3
+ } from "./chunk-HES44LTA.js";
4
+ import "./chunk-3V37OZQH.js";
5
5
  import "./chunk-Z6WRFOFT.js";
6
- import "./chunk-A4PKLESO.js";
7
- import "./chunk-OEH47H6A.js";
6
+ import "./chunk-Y6NFETNG.js";
7
+ import "./chunk-FQLCD4HU.js";
8
+ import "./chunk-GUHOEIHP.js";
8
9
  import "./chunk-IJBSOWHK.js";
9
10
  import "./chunk-GJXOFDJT.js";
10
11
  import "./chunk-PMJG2CXF.js";
@@ -14,4 +15,4 @@ var run = (context) => change(context, "sweep");
14
15
  export {
15
16
  run
16
17
  };
17
- //# sourceMappingURL=sweep-EPZCW63Q.js.map
18
+ //# sourceMappingURL=sweep-VURZU6DI.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  specFrom
3
- } from "./chunk-D5MIZM6L.js";
3
+ } from "./chunk-YRNFMPZB.js";
4
4
  import {
5
5
  sourceFor
6
6
  } from "./chunk-7TD53M7L.js";
7
- import "./chunk-RPCIROW7.js";
7
+ import "./chunk-7CHUMF3E.js";
8
8
  import {
9
9
  POLICIES,
10
10
  UnreadableCommand,
@@ -12,9 +12,9 @@ import {
12
12
  customMode,
13
13
  customPolicy,
14
14
  readScript
15
- } from "./chunk-63RZGEVI.js";
16
- import "./chunk-UKR64U7J.js";
15
+ } from "./chunk-WQBKQTNT.js";
17
16
  import "./chunk-UYBWUOLR.js";
17
+ import "./chunk-UKR64U7J.js";
18
18
  import "./chunk-42SO7KYX.js";
19
19
  import "./chunk-EATCUWGG.js";
20
20
  import "./chunk-OFJIMBTL.js";
@@ -25,13 +25,13 @@ import {
25
25
  } from "./chunk-HQOB7OQS.js";
26
26
  import "./chunk-73AKO4UL.js";
27
27
  import "./chunk-M6X6HVQK.js";
28
- import "./chunk-7CSUKCU7.js";
28
+ import "./chunk-RZYZILU4.js";
29
29
  import "./chunk-SUDG7B6S.js";
30
30
  import {
31
31
  SESSION_ID,
32
32
  createFilesStore,
33
33
  writeJson
34
- } from "./chunk-7I7O7ZNT.js";
34
+ } from "./chunk-3V37OZQH.js";
35
35
  import {
36
36
  STATE_FILES,
37
37
  asBroadcast,
@@ -48,22 +48,26 @@ import {
48
48
  RUNTIMES,
49
49
  RUNTIME_IDS
50
50
  } from "./chunk-ARXCYFFZ.js";
51
+ import "./chunk-V4NPDK6X.js";
51
52
  import {
52
53
  ArgumentError,
53
54
  one
54
- } from "./chunk-A4PKLESO.js";
55
- import "./chunk-V4NPDK6X.js";
56
- import "./chunk-SPZQRLL5.js";
55
+ } from "./chunk-Y6NFETNG.js";
56
+ import "./chunk-KYGGQPAH.js";
57
+ import "./chunk-FOLA4EUJ.js";
58
+ import "./chunk-N7ANFMA5.js";
57
59
  import "./chunk-TYY5TYHF.js";
60
+ import "./chunk-T6C3TSTO.js";
61
+ import "./chunk-FQLCD4HU.js";
58
62
  import {
59
63
  expandPath
60
- } from "./chunk-OEH47H6A.js";
64
+ } from "./chunk-GUHOEIHP.js";
61
65
  import {
62
66
  checkoutOf,
63
67
  worktreesOf
64
68
  } from "./chunk-IJBSOWHK.js";
65
69
  import "./chunk-XWLMZKH2.js";
66
- import "./chunk-3C5FVHQ3.js";
70
+ import "./chunk-7IRXUPM2.js";
67
71
  import "./chunk-GJXOFDJT.js";
68
72
  import "./chunk-PMJG2CXF.js";
69
73
  import "./chunk-J6KL3COD.js";
@@ -557,7 +561,7 @@ async function simulate(input, compiled, store) {
557
561
  async function run(context) {
558
562
  const fixtures = one(context.args, "fixtures");
559
563
  if (fixtures !== void 0)
560
- return (await import("./smoke-2FI5D74B.js")).run(context, fixtures);
564
+ return (await import("./smoke-6X6IXQIQ.js")).run(context, fixtures);
561
565
  const runtime = one(context.args, "runtime");
562
566
  if (!RUNTIME_IDS.includes(runtime))
563
567
  throw new ArgumentError("--runtime must be claude or codex");
@@ -607,7 +611,7 @@ async function run(context) {
607
611
  context.ui.data(JSON.stringify(result) + "\n");
608
612
  if (!context.args.flags.has("json")) {
609
613
  for (const row of report.policies)
610
- context.ui.line(
614
+ context.ui.results.line(
611
615
  row.policy + ": " + row.verdict + " " + row.durationMs + "ms" + (row.skipped ? " (external effects skipped)" : "") + (row.reason ? " " + row.reason : "") + // A guard in observe, warn or graded mode: what it found, before its mode.
612
616
  (row.raw && row.raw.verdict !== row.verdict ? ` (${row.mode}; found ${row.raw.verdict}` + (row.raw.reason && row.raw.reason !== row.reason ? `: ${row.raw.reason}` : "") + ")" : "")
613
617
  );
@@ -623,4 +627,4 @@ async function run(context) {
623
627
  export {
624
628
  run
625
629
  };
626
- //# sourceMappingURL=test-WRZQERYC.js.map
630
+ //# sourceMappingURL=test-D2EEFUN2.js.map
@@ -4,11 +4,12 @@ import {
4
4
  } from "./chunk-F5XMGOOX.js";
5
5
  import {
6
6
  tuiSpec
7
- } from "./chunk-3Y3HDMHA.js";
7
+ } from "./chunk-QR6A3TYP.js";
8
8
  import {
9
9
  ArgumentError,
10
- one
11
- } from "./chunk-A4PKLESO.js";
10
+ one,
11
+ unknownSubcommand
12
+ } from "./chunk-Y6NFETNG.js";
12
13
  import {
13
14
  ConfigError
14
15
  } from "./chunk-GJXOFDJT.js";
@@ -17,10 +18,10 @@ import "./chunk-PMJG2CXF.js";
17
18
  // src/commands/tui/invocation.ts
18
19
  var allowed = {
19
20
  launch: ["config", "runtime", "yes", "new"],
20
- plan: ["config", "runtime"],
21
- recovery: ["config"],
22
- "start-worker": ["config", "runtime", "memory-mb"],
23
- doctor: []
21
+ plan: ["config", "runtime", "json"],
22
+ recovery: ["config", "json"],
23
+ "start-worker": ["config", "runtime", "memory-mb", "json"],
24
+ doctor: ["json"]
24
25
  };
25
26
  var REMOVED = /* @__PURE__ */ new Set([
26
27
  "create",
@@ -49,8 +50,11 @@ function parseTui(args) {
49
50
  `tui ${action} was a tmux view operation and is removed; run pmcp tui, which opens pmcp-tui on the group's pmcp-pty host`
50
51
  );
51
52
  const options = allowed[action];
52
- if (!options || extra.length)
53
- throw new ArgumentError("Provide one supported TUI operation");
53
+ if (!options) {
54
+ const verbs = Object.keys(allowed).filter((verb) => verb !== "launch");
55
+ throw unknownSubcommand("tui", action, verbs);
56
+ }
57
+ if (extra.length) throw new ArgumentError(`unexpected ${extra.join(" ")}`);
54
58
  for (const key of [...args.options.keys(), ...args.flags])
55
59
  if (!options.includes(key))
56
60
  throw new ArgumentError(`--${key} is not supported by tui ${action}`);
@@ -87,6 +91,23 @@ function parseTui(args) {
87
91
  };
88
92
  }
89
93
 
94
+ // src/commands/tui/render.ts
95
+ function renderReceipt(ui, receipt, indent = "") {
96
+ if (receipt === null || typeof receipt !== "object") {
97
+ ui.line(`${indent}${String(receipt)}`);
98
+ return;
99
+ }
100
+ const entries = Array.isArray(receipt) ? receipt.map((value, index) => [String(index + 1), value]) : Object.entries(receipt);
101
+ for (const [key, value] of entries) {
102
+ if (value !== null && typeof value === "object") {
103
+ ui.line(`${indent}${key}:`);
104
+ renderReceipt(ui, value, `${indent} `);
105
+ continue;
106
+ }
107
+ ui.line(`${indent}${key}: ${String(value)}`);
108
+ }
109
+ }
110
+
90
111
  // src/commands/tui.ts
91
112
  function failed(error) {
92
113
  const message = error instanceof Error ? error.message : "tui_failed";
@@ -99,23 +120,30 @@ function failed(error) {
99
120
  inputReplayed: false
100
121
  };
101
122
  }
123
+ function printReceipt(context, receipt) {
124
+ if (context.args.flags.has("json")) {
125
+ context.ui.data(`${JSON.stringify(receipt)}
126
+ `);
127
+ return;
128
+ }
129
+ renderReceipt(context.ui.results, receipt);
130
+ }
102
131
  var tuiCommand = {
103
132
  ...tuiSpec,
104
133
  async run(context) {
105
134
  const invocation = parseTui(context.args);
106
135
  const unsupported = unsupportedHost();
107
136
  if (unsupported) {
108
- context.ui.data(`${JSON.stringify(unsupportedReceipt(unsupported))}
109
- `);
137
+ printReceipt(context, unsupportedReceipt(unsupported));
110
138
  return 1;
111
139
  }
112
140
  try {
113
141
  let receipt;
114
142
  if (invocation.action === "doctor") {
115
- const { inspectTerminalHost } = await import("./diagnostics-I5VZHK42.js");
143
+ const { inspectTerminalHost } = await import("./diagnostics-N4XRRCQG.js");
116
144
  receipt = inspectTerminalHost();
117
145
  } else if (invocation.action === "start-worker") {
118
- const { startWorkspaceWorker } = await import("./worker-OKBJNDEI.js");
146
+ const { startWorkspaceWorker } = await import("./worker-WTBC6VYO.js");
119
147
  receipt = await startWorkspaceWorker(
120
148
  { config: invocation.startup?.config, cwd: context.cwd },
121
149
  invocation.startup.runtime,
@@ -128,7 +156,7 @@ var tuiCommand = {
128
156
  cwd: context.cwd
129
157
  });
130
158
  } else {
131
- const { launchStartup, planStartup } = await import("./entry-OT7BN3ID.js");
159
+ const { launchStartup, planStartup } = await import("./entry-KDLLG6ED.js");
132
160
  const request = { ...invocation.startup, cwd: context.cwd };
133
161
  receipt = invocation.action === "plan" ? planStartup(request) : await launchStartup(
134
162
  request,
@@ -136,13 +164,11 @@ var tuiCommand = {
136
164
  );
137
165
  }
138
166
  if (invocation.action !== "launch" || receipt.ok !== true)
139
- context.ui.data(`${JSON.stringify(receipt)}
140
- `);
167
+ printReceipt(context, receipt);
141
168
  return receipt.ok === true ? 0 : 1;
142
169
  } catch (error) {
143
170
  if (error instanceof ConfigError) throw new ArgumentError(error.message);
144
- context.ui.data(`${JSON.stringify(failed(error))}
145
- `);
171
+ printReceipt(context, failed(error));
146
172
  return 1;
147
173
  }
148
174
  }
@@ -150,4 +176,4 @@ var tuiCommand = {
150
176
  export {
151
177
  tuiCommand
152
178
  };
153
- //# sourceMappingURL=tui-YUHQ36FC.js.map
179
+ //# sourceMappingURL=tui-D7E3MD3X.js.map
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  change
3
- } from "./chunk-B2WRYGHJ.js";
4
- import "./chunk-7I7O7ZNT.js";
3
+ } from "./chunk-HES44LTA.js";
4
+ import "./chunk-3V37OZQH.js";
5
5
  import "./chunk-Z6WRFOFT.js";
6
- import "./chunk-A4PKLESO.js";
7
- import "./chunk-OEH47H6A.js";
6
+ import "./chunk-Y6NFETNG.js";
7
+ import "./chunk-FQLCD4HU.js";
8
+ import "./chunk-GUHOEIHP.js";
8
9
  import "./chunk-IJBSOWHK.js";
9
10
  import "./chunk-GJXOFDJT.js";
10
11
  import "./chunk-PMJG2CXF.js";
@@ -14,4 +15,4 @@ var run = (context) => change(context, "unbroadcast");
14
15
  export {
15
16
  run
16
17
  };
17
- //# sourceMappingURL=unbroadcast-N6LXHAMT.js.map
18
+ //# sourceMappingURL=unbroadcast-7AMLURCG.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  catalogOptionsFrom
3
- } from "./chunk-PEMMV5YQ.js";
3
+ } from "./chunk-2MX5C7B2.js";
4
4
  import {
5
5
  configFrom
6
- } from "./chunk-RPCIROW7.js";
6
+ } from "./chunk-7CHUMF3E.js";
7
7
  import {
8
8
  validateCatalog,
9
9
  validateSkillDir
@@ -11,9 +11,9 @@ import {
11
11
  import "./chunk-73AKO4UL.js";
12
12
  import {
13
13
  validateSpec
14
- } from "./chunk-INT7QLEU.js";
15
- import "./chunk-JEL35P7S.js";
16
- import "./chunk-A4PKLESO.js";
14
+ } from "./chunk-7DJQASH3.js";
15
+ import "./chunk-5NDUWEMW.js";
16
+ import "./chunk-Y6NFETNG.js";
17
17
  import "./chunk-4CRRLDDS.js";
18
18
  import "./chunk-YSAWTGNA.js";
19
19
  import "./chunk-GJXOFDJT.js";
@@ -33,14 +33,16 @@ var validateCommand = {
33
33
  return errors > 0 ? 1 : 0;
34
34
  }
35
35
  for (const finding of findings) {
36
- const report = finding.level === "error" ? context.ui.error : context.ui.warn;
37
- report.call(context.ui, finding.reason, finding.path);
36
+ const out = context.ui.results;
37
+ const report = finding.level === "error" ? out.error : out.warn;
38
+ report.call(out, finding.reason, finding.path);
38
39
  }
39
- if (findings.length === 0) context.ui.success("every skill is valid");
40
+ if (findings.length === 0)
41
+ context.ui.results.success("every skill is valid");
40
42
  return errors > 0 ? 1 : 0;
41
43
  }
42
44
  };
43
45
  export {
44
46
  validateCommand
45
47
  };
46
- //# sourceMappingURL=validate-KFBCUFI4.js.map
48
+ //# sourceMappingURL=validate-YXR7FJJX.js.map
@@ -0,0 +1,141 @@
1
+ import {
2
+ waitSpec
3
+ } from "./chunk-F3R5HEUB.js";
4
+ import {
5
+ ArgumentError,
6
+ EXIT,
7
+ many,
8
+ one
9
+ } from "./chunk-Y6NFETNG.js";
10
+ import {
11
+ pidAlive
12
+ } from "./chunk-N7ANFMA5.js";
13
+
14
+ // src/lease/wait.ts
15
+ import { existsSync, readFileSync, readdirSync } from "fs";
16
+ var CONDITION_FORMS = "exists:<path> | gone:<path> | load-below:<n> | no-process:<text>";
17
+ function parseCondition(text) {
18
+ const at = text.indexOf(":");
19
+ if (at <= 0) return null;
20
+ const kind = text.slice(0, at);
21
+ const value = text.slice(at + 1);
22
+ if (value === "") return null;
23
+ if (kind === "exists" || kind === "gone") return { kind, path: value };
24
+ if (kind === "no-process") return { kind, text: value };
25
+ if (kind === "load-below") {
26
+ const max = Number(value);
27
+ return max > 0 ? { kind, max } : null;
28
+ }
29
+ return null;
30
+ }
31
+ function ancestors(proc) {
32
+ const found = /* @__PURE__ */ new Set();
33
+ for (let pid = process.pid, hops = 0; pid > 1 && hops < 64; hops += 1) {
34
+ found.add(pid);
35
+ try {
36
+ const stat = readFileSync(`${proc}/${pid}/stat`, "utf8");
37
+ pid = Number(stat.slice(stat.lastIndexOf(")") + 2).split(" ")[1]);
38
+ } catch {
39
+ break;
40
+ }
41
+ }
42
+ return found;
43
+ }
44
+ function processMatching(text, proc = "/proc") {
45
+ const own = ancestors(proc);
46
+ let names;
47
+ try {
48
+ names = readdirSync(proc);
49
+ } catch {
50
+ return null;
51
+ }
52
+ for (const name of names) {
53
+ if (!/^\d+$/u.test(name) || own.has(Number(name))) continue;
54
+ try {
55
+ const line = readFileSync(`${proc}/${name}/cmdline`, "utf8");
56
+ if (line.split("\0").join(" ").includes(text)) return Number(name);
57
+ } catch {
58
+ }
59
+ }
60
+ return null;
61
+ }
62
+ function load1(file) {
63
+ try {
64
+ return Number(readFileSync(file, "utf8").split(" ")[0]);
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+ function met(condition, loadavg = "/proc/loadavg") {
70
+ switch (condition.kind) {
71
+ case "pid":
72
+ return condition.pid === process.pid || !pidAlive(condition.pid);
73
+ case "exists":
74
+ return existsSync(condition.path);
75
+ case "gone":
76
+ return !existsSync(condition.path);
77
+ case "load-below": {
78
+ const load = load1(loadavg);
79
+ return load === null || load < condition.max;
80
+ }
81
+ case "no-process":
82
+ return processMatching(condition.text) === null;
83
+ }
84
+ }
85
+ async function waitFor(options) {
86
+ const deadline = Date.now() + options.timeout * 1e3;
87
+ for (; ; ) {
88
+ if (options.conditions.every((c) => met(c, options.loadavg))) return true;
89
+ const left = deadline - Date.now();
90
+ if (left <= 0) return false;
91
+ const step = Math.min(options.interval * 1e3, left);
92
+ await new Promise((resolve) => setTimeout(resolve, step));
93
+ }
94
+ }
95
+
96
+ // src/commands/wait.ts
97
+ function seconds(context, name, fallback) {
98
+ const text = one(context.args, name);
99
+ if (text === void 0) return fallback;
100
+ const value = Number(text);
101
+ if (!(value > 0))
102
+ throw new ArgumentError(`--${name} must be a positive number`);
103
+ return value;
104
+ }
105
+ function conditions(context) {
106
+ const found = [];
107
+ for (const text of many(context.args, "pid")) {
108
+ const pid = Number(text);
109
+ if (!Number.isInteger(pid) || pid <= 0)
110
+ throw new ArgumentError(`--pid ${text} is not a process id`);
111
+ found.push({ kind: "pid", pid });
112
+ }
113
+ for (const text of many(context.args, "until")) {
114
+ const condition = parseCondition(text);
115
+ if (condition === null)
116
+ throw new ArgumentError(`--until ${text}: use ${CONDITION_FORMS}`);
117
+ found.push(condition);
118
+ }
119
+ if (found.length === 0) throw new ArgumentError("name --pid or --until");
120
+ if (context.args.positional.length > 0)
121
+ throw new ArgumentError(`unexpected ${context.args.positional[0]}`);
122
+ return found;
123
+ }
124
+ async function run(context) {
125
+ const timeout = seconds(context, "timeout", 3600);
126
+ const met2 = await waitFor({
127
+ conditions: conditions(context),
128
+ timeout,
129
+ interval: seconds(context, "interval", 5),
130
+ ...context.env["PMCP_HEAVY_LOADAVG_FILE"] ? { loadavg: context.env["PMCP_HEAVY_LOADAVG_FILE"] } : {},
131
+ say: (line) => context.ui.info(line)
132
+ });
133
+ if (met2) return EXIT.ok;
134
+ context.ui.error(`not met within ${timeout}s`);
135
+ return EXIT.busy;
136
+ }
137
+ var waitCommand = { ...waitSpec, run };
138
+ export {
139
+ waitCommand
140
+ };
141
+ //# sourceMappingURL=wait-HEODT7KV.js.map
@@ -5,21 +5,25 @@ import {
5
5
  } from "./chunk-C3G75JH7.js";
6
6
  import {
7
7
  invoke
8
- } from "./chunk-N63QCJHX.js";
8
+ } from "./chunk-P25V6NEX.js";
9
9
  import "./chunk-DZ2MRTYT.js";
10
- import "./chunk-UMQLIRSU.js";
11
- import "./chunk-FODUHLZM.js";
10
+ import "./chunk-DZTSCJOZ.js";
11
+ import "./chunk-SDQYZDHS.js";
12
12
  import {
13
13
  locateExecutable
14
14
  } from "./chunk-R2GPCZUX.js";
15
- import "./chunk-DP326AER.js";
15
+ import "./chunk-LO54UUDE.js";
16
16
  import "./chunk-34DECPVC.js";
17
- import "./chunk-SPZQRLL5.js";
17
+ import "./chunk-KYGGQPAH.js";
18
+ import "./chunk-FOLA4EUJ.js";
19
+ import "./chunk-N7ANFMA5.js";
18
20
  import "./chunk-TYY5TYHF.js";
19
- import "./chunk-OEH47H6A.js";
21
+ import "./chunk-T6C3TSTO.js";
22
+ import "./chunk-FQLCD4HU.js";
23
+ import "./chunk-GUHOEIHP.js";
20
24
  import "./chunk-IJBSOWHK.js";
21
25
  import "./chunk-XWLMZKH2.js";
22
- import "./chunk-3C5FVHQ3.js";
26
+ import "./chunk-7IRXUPM2.js";
23
27
  import "./chunk-GJXOFDJT.js";
24
28
  import "./chunk-PMJG2CXF.js";
25
29
  import {
@@ -79,4 +83,4 @@ async function startWorkspaceWorker(request, runtime, memoryMb) {
79
83
  export {
80
84
  startWorkspaceWorker
81
85
  };
82
- //# sourceMappingURL=worker-OKBJNDEI.js.map
86
+ //# sourceMappingURL=worker-WTBC6VYO.js.map