@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,315 @@
1
+ // src/commands/harness/options.ts
2
+ var harnessOptions = [
3
+ {
4
+ name: "include-starts",
5
+ describe: "Include pending native starts in recovery inspection",
6
+ boolean: true
7
+ },
8
+ {
9
+ name: "columns",
10
+ describe: "Terminal width in cells",
11
+ placeholder: "<integer>"
12
+ },
13
+ {
14
+ name: "rows",
15
+ describe: "Terminal height including status",
16
+ placeholder: "<integer>"
17
+ },
18
+ {
19
+ name: "generation",
20
+ describe: "Expected group generation for a mutation",
21
+ placeholder: "<id>"
22
+ },
23
+ {
24
+ name: "group-file",
25
+ describe: "Private owned group state",
26
+ placeholder: "<file>"
27
+ },
28
+ {
29
+ name: "input",
30
+ describe: "Group, session, read or watch specification JSON",
31
+ placeholder: "<file>"
32
+ },
33
+ { name: "session", describe: "Owned native session ID", placeholder: "<id>" },
34
+ {
35
+ name: "lease-file",
36
+ describe: "Private writer credential",
37
+ placeholder: "<file>"
38
+ },
39
+ {
40
+ name: "controller",
41
+ describe: "Local controller identity",
42
+ placeholder: "<id>"
43
+ },
44
+ {
45
+ name: "mode",
46
+ describe: "Control cli/native; attachment observe/write",
47
+ placeholder: "<mode>"
48
+ },
49
+ {
50
+ name: "request-id",
51
+ describe: "Explicit input idempotency key",
52
+ placeholder: "<id>"
53
+ },
54
+ {
55
+ name: "text-file",
56
+ describe: "Literal single-line UTF-8 input without submission",
57
+ placeholder: "<file>"
58
+ }
59
+ ];
60
+
61
+ // src/commands/tui/options.ts
62
+ var tuiOptions = [
63
+ {
64
+ name: "json",
65
+ describe: "Print the result as one JSON envelope on stdout.",
66
+ boolean: true
67
+ },
68
+ {
69
+ name: "memory-mb",
70
+ describe: "Worker memory reservation",
71
+ placeholder: "<count>"
72
+ },
73
+ {
74
+ name: "config",
75
+ describe: "A pmcp.toml to read instead of the nearest one.",
76
+ placeholder: "<file>"
77
+ },
78
+ {
79
+ name: "runtime",
80
+ describe: "Native runtime ID for main launch or worker start",
81
+ placeholder: "<runtime>"
82
+ },
83
+ {
84
+ name: "yes",
85
+ describe: "Confirm the first native runtime start",
86
+ boolean: true,
87
+ short: "y"
88
+ },
89
+ {
90
+ name: "new",
91
+ describe: "Create a workspace after the previous group is stopped",
92
+ boolean: true
93
+ }
94
+ ];
95
+
96
+ // src/commands/specs/harness-operations.ts
97
+ var common = ["group-file", "generation"];
98
+ var HARNESS_OPERATIONS = {
99
+ "capabilities:inspect": {
100
+ describe: "Report what this host can run",
101
+ options: []
102
+ },
103
+ "doctor:inspect": { describe: "Check host prerequisites", options: [] },
104
+ "group:create": {
105
+ describe: "Create an owned session group from --input",
106
+ options: ["input"]
107
+ },
108
+ "group:list": { describe: "List owned groups", options: [] },
109
+ "group:inspect": {
110
+ describe: "Show one group",
111
+ options: ["group-file"]
112
+ },
113
+ "group:configure": {
114
+ describe: "Change a group's settings from --input",
115
+ options: [...common, "input"]
116
+ },
117
+ "group:pause": {
118
+ describe: "Pause every session of a group",
119
+ options: common
120
+ },
121
+ "group:resume": { describe: "Resume a paused group", options: common },
122
+ "group:stop": { describe: "Stop a group and its sessions", options: common },
123
+ "session:start": {
124
+ describe: "Start a main or worker session from --input",
125
+ options: [...common, "input"]
126
+ },
127
+ "session:list": {
128
+ describe: "List a group's sessions",
129
+ options: ["group-file"]
130
+ },
131
+ "session:inspect": {
132
+ describe: "Show one session",
133
+ options: ["group-file", "session"]
134
+ },
135
+ "session:read": {
136
+ describe: "Read a session's recent output",
137
+ options: ["group-file", "session", "input"]
138
+ },
139
+ "session:watch": {
140
+ describe: "Follow a session's output",
141
+ options: ["group-file", "session", "input"]
142
+ },
143
+ "session:stop": {
144
+ describe: "Stop one session",
145
+ options: [...common, "session"]
146
+ },
147
+ "control:acquire": {
148
+ describe: "Take the input lease of a session",
149
+ options: [...common, "session", "controller", "mode"]
150
+ },
151
+ "control:renew": {
152
+ describe: "Renew a held input lease",
153
+ options: [...common, "lease-file"]
154
+ },
155
+ "control:release": {
156
+ describe: "Give the input lease back",
157
+ options: [...common, "lease-file"]
158
+ },
159
+ "input:write": {
160
+ describe: "Type text into a session without submitting it",
161
+ options: [...common, "lease-file", "request-id", "text-file"]
162
+ },
163
+ "input:submit": {
164
+ describe: "Submit what was written",
165
+ options: [...common, "lease-file", "request-id"]
166
+ },
167
+ "input:interrupt": {
168
+ describe: "Interrupt the session's current turn",
169
+ options: [...common, "lease-file"]
170
+ },
171
+ "attach:open": {
172
+ describe: "Attach a terminal to a session, read only unless --mode write",
173
+ options: [...common, "session", "mode", "lease-file"]
174
+ },
175
+ "attach:inspect": {
176
+ describe: "Show a session's attachments",
177
+ options: ["group-file", "session"]
178
+ },
179
+ "attach:detach": {
180
+ describe: "Detach from a session",
181
+ options: [...common, "session"]
182
+ },
183
+ "delivery:list": {
184
+ describe: "List input deliveries",
185
+ options: ["group-file"]
186
+ },
187
+ "delivery:inspect": {
188
+ describe: "Show one input delivery",
189
+ options: ["group-file", "request-id"]
190
+ },
191
+ "recovery:inspect": {
192
+ describe: "Find sessions and starts that need recovery",
193
+ options: ["group-file", "include-starts"]
194
+ },
195
+ "recovery:reconcile": {
196
+ describe: "Reconcile recorded state with live processes",
197
+ options: common
198
+ },
199
+ "recovery:replace-main": {
200
+ describe: "Replace a lost main session from --input",
201
+ options: [...common, "input"]
202
+ },
203
+ "recovery:stop-orphan": {
204
+ describe: "Stop a session no group owns",
205
+ options: [...common, "session"]
206
+ },
207
+ "recovery:abort-start": {
208
+ describe: "Abort a session start that never finished",
209
+ options: [...common, "session"]
210
+ }
211
+ };
212
+
213
+ // src/commands/specs/terminal.ts
214
+ var HOST = [
215
+ ["approve", "Record your approval of the projected [host] policy"],
216
+ ["status", "Whether the projected policy is approved"],
217
+ ["up", "Start pmcp-pty and the approved sessions (Linux)"],
218
+ ["down", "Stop the host's sessions"],
219
+ ["unit", "Print a systemd user unit for pmcp-pty (Linux)"]
220
+ ].map(([verb, describe]) => ({
221
+ name: `host ${verb}`,
222
+ describe,
223
+ usage: `pmcp harness host ${verb}`,
224
+ options: [],
225
+ examples: [`pmcp harness host ${verb}`]
226
+ }));
227
+ var FAMILY = Object.entries(
228
+ HARNESS_OPERATIONS
229
+ ).map(([key, operation]) => {
230
+ const name = key.replace(":", " ");
231
+ const flags = operation.options.map((option) => `--${option} <value>`);
232
+ return {
233
+ name,
234
+ describe: operation.describe,
235
+ usage: [`pmcp harness ${name}`, ...flags].join(" "),
236
+ options: operation.options,
237
+ examples: [[`pmcp harness ${name}`, ...flags].join(" ")]
238
+ };
239
+ });
240
+ var harnessSpec = {
241
+ name: "harness",
242
+ protocol: true,
243
+ describe: "Manage optional owned native sessions independently of the MCP server",
244
+ usage: "pmcp harness <subcommand> [options]",
245
+ options: harnessOptions,
246
+ subcommands: [
247
+ {
248
+ name: "layout",
249
+ describe: "Plan the terminal layout for a size",
250
+ usage: "pmcp harness layout [--columns <count>] [--rows <count>]",
251
+ options: ["columns", "rows"],
252
+ examples: ["pmcp harness layout --columns 120 --rows 40"]
253
+ },
254
+ ...HOST,
255
+ {
256
+ name: "mcp",
257
+ describe: "A stdio MCP server for one pmcp-pty socket (PMCP_PTY_SOCKET)",
258
+ usage: "pmcp harness mcp",
259
+ options: [],
260
+ examples: [
261
+ "PMCP_PTY_SOCKET=/run/user/1000/pmcp-pty.sock pmcp harness mcp"
262
+ ]
263
+ },
264
+ ...FAMILY
265
+ ],
266
+ examples: [
267
+ "pmcp harness doctor inspect",
268
+ 'pmcp harness group inspect --group-file "$GROUP_FILE"',
269
+ "pmcp harness host status"
270
+ ]
271
+ };
272
+ var tuiSpec = {
273
+ name: "tui",
274
+ describe: "Open a native terminal workspace with optional configuration",
275
+ usage: "pmcp tui [--config <file>] [--runtime <id>] [-y] [--new] | pmcp tui <subcommand> [options]",
276
+ options: tuiOptions,
277
+ subcommands: [
278
+ {
279
+ name: "plan",
280
+ describe: "What a launch would do, without starting it",
281
+ usage: "pmcp tui plan [--config <file>] [--runtime <id>] [--json]",
282
+ options: ["config", "runtime", "json"],
283
+ examples: ["pmcp tui plan --runtime codex-cli"]
284
+ },
285
+ {
286
+ name: "recovery",
287
+ describe: "What to run when a workspace was left behind",
288
+ usage: "pmcp tui recovery [--config <file>] [--json]",
289
+ options: ["config", "json"],
290
+ examples: ["pmcp tui recovery"]
291
+ },
292
+ {
293
+ name: "doctor",
294
+ describe: "Terminal host prerequisites",
295
+ usage: "pmcp tui doctor [--json]",
296
+ options: ["json"],
297
+ examples: ["pmcp tui doctor --json"]
298
+ },
299
+ {
300
+ name: "start-worker",
301
+ describe: "Start a worker in the dock",
302
+ usage: "pmcp tui start-worker --runtime <id> [--memory-mb <count>] [--config <file>] [--json]",
303
+ options: ["config", "runtime", "memory-mb", "json"],
304
+ examples: ["pmcp tui start-worker --runtime claude-code"]
305
+ }
306
+ ],
307
+ examples: ["pmcp tui", "pmcp tui --runtime codex-cli", "pmcp tui plan"]
308
+ };
309
+
310
+ export {
311
+ HARNESS_OPERATIONS,
312
+ harnessSpec,
313
+ tuiSpec
314
+ };
315
+ //# sourceMappingURL=chunk-QR6A3TYP.js.map
@@ -1,6 +1,7 @@
1
1
  // src/commands/specs/session.ts
2
2
  var loginSpec = {
3
3
  name: "login",
4
+ examples: ["pmcp login"],
4
5
  describe: "Sign in on this machine, to obtain skills this project lacks",
5
6
  usage: "pmcp login [--issuer <url>]",
6
7
  options: [
@@ -13,15 +14,21 @@ var loginSpec = {
13
14
  };
14
15
  var logoutSpec = {
15
16
  name: "logout",
17
+ examples: ["pmcp logout"],
16
18
  describe: "Forget the sign-in on this machine",
17
19
  usage: "pmcp logout"
18
20
  };
19
21
  var whoamiSpec = {
20
22
  name: "whoami",
23
+ examples: ["pmcp whoami", "pmcp whoami --json"],
21
24
  describe: "Whether this machine is signed in, and to what",
22
25
  usage: "pmcp whoami [--json]",
23
26
  options: [
24
- { name: "json", describe: "Print the answer as JSON.", boolean: true }
27
+ {
28
+ name: "json",
29
+ describe: "Print the result as one JSON envelope on stdout.",
30
+ boolean: true
31
+ }
25
32
  ]
26
33
  };
27
34
 
@@ -30,4 +37,4 @@ export {
30
37
  logoutSpec,
31
38
  whoamiSpec
32
39
  };
33
- //# sourceMappingURL=chunk-EIDIVIAD.js.map
40
+ //# sourceMappingURL=chunk-QYLOIM4U.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  configFrom
3
- } from "./chunk-RPCIROW7.js";
3
+ } from "./chunk-7CHUMF3E.js";
4
4
  import {
5
5
  readSpec
6
- } from "./chunk-63RZGEVI.js";
6
+ } from "./chunk-WQBKQTNT.js";
7
7
  import {
8
8
  ArgumentError
9
- } from "./chunk-A4PKLESO.js";
9
+ } from "./chunk-Y6NFETNG.js";
10
10
 
11
11
  // src/commands/mcp/server.ts
12
12
  function serverFrom(context) {
@@ -25,4 +25,4 @@ function serverFrom(context) {
25
25
  export {
26
26
  serverFrom
27
27
  };
28
- //# sourceMappingURL=chunk-MIFPPUWY.js.map
28
+ //# sourceMappingURL=chunk-RRKA3GF5.js.map
@@ -5,11 +5,21 @@ import {
5
5
  readStoreSettings,
6
6
  resolveLeaseFiles,
7
7
  resolvePauseFile
8
- } from "./chunk-7I7O7ZNT.js";
8
+ } from "./chunk-3V37OZQH.js";
9
+ import {
10
+ NO_CONFIG
11
+ } from "./chunk-Y6NFETNG.js";
12
+ import {
13
+ Reader,
14
+ child,
15
+ table
16
+ } from "./chunk-T6C3TSTO.js";
9
17
  import {
10
- expandPath,
11
18
  projectStateDir
12
- } from "./chunk-OEH47H6A.js";
19
+ } from "./chunk-FQLCD4HU.js";
20
+ import {
21
+ expandPath
22
+ } from "./chunk-GUHOEIHP.js";
13
23
  import {
14
24
  ConfigError,
15
25
  findConfig,
@@ -19,95 +29,6 @@ import {
19
29
  // src/git/setup.ts
20
30
  import { dirname, join, resolve } from "path";
21
31
 
22
- // src/git/config/reader.ts
23
- var Reader = class {
24
- constructor(path, name, table2, keys) {
25
- this.path = path;
26
- this.name = name;
27
- this.table = table2;
28
- for (const key of Object.keys(table2)) {
29
- if (!keys.includes(key))
30
- throw new ConfigError(path, `unknown key [${name}] ${key}`);
31
- }
32
- }
33
- path;
34
- name;
35
- table;
36
- fail(key, expected) {
37
- throw new ConfigError(
38
- this.path,
39
- `[${this.name}] ${key} must be ${expected}`
40
- );
41
- }
42
- string(key) {
43
- const value = this.table[key];
44
- if (value === void 0) return void 0;
45
- if (typeof value !== "string" || !value.trim())
46
- this.fail(key, "a non-empty string");
47
- return value;
48
- }
49
- envName(key) {
50
- const value = this.string(key);
51
- if (value !== void 0 && !/^[A-Z_][A-Z0-9_]{0,127}$/u.test(value))
52
- this.fail(key, "an environment variable name (A-Z, 0-9, _)");
53
- return value;
54
- }
55
- oneOf(key, values, fallback) {
56
- const value = this.table[key] ?? fallback;
57
- if (!values.includes(value)) this.fail(key, values.join(" | "));
58
- return value;
59
- }
60
- bool(key, fallback) {
61
- const value = this.table[key] ?? fallback;
62
- if (typeof value !== "boolean") this.fail(key, "a boolean");
63
- return value;
64
- }
65
- int(key, fallback) {
66
- const value = this.table[key] ?? fallback;
67
- if (!Number.isInteger(value) || value < 1)
68
- this.fail(key, "a positive integer");
69
- return value;
70
- }
71
- positive(key) {
72
- const value = this.table[key];
73
- if (value === void 0) return void 0;
74
- if (typeof value !== "number" || !(value > 0))
75
- this.fail(key, "a positive number");
76
- return value;
77
- }
78
- list(key) {
79
- const value = this.table[key] ?? [];
80
- if (!Array.isArray(value) || !value.every((v) => typeof v === "string"))
81
- this.fail(key, "a list of strings");
82
- return value;
83
- }
84
- argv(key) {
85
- const value = this.list(key);
86
- if (value.length === 0) return void 0;
87
- return value;
88
- }
89
- // A table of environment variable names to string values.
90
- envMap(key) {
91
- const value = this.table[key] ?? {};
92
- if (value === null || typeof value !== "object" || Array.isArray(value))
93
- this.fail(key, "a table of variable names to strings");
94
- for (const [name, text] of Object.entries(value)) {
95
- if (!/^[A-Z_][A-Z0-9_]{0,127}$/u.test(name) || typeof text !== "string")
96
- this.fail(key, "a table of variable names (A-Z, 0-9, _) to strings");
97
- }
98
- return value;
99
- }
100
- };
101
- function table(path, name, value) {
102
- if (value === void 0) return void 0;
103
- if (value === null || typeof value !== "object" || Array.isArray(value))
104
- throw new ConfigError(path, `[${name}] must be a table`);
105
- return value;
106
- }
107
- function child(path, parent, name, key) {
108
- return table(path, `${name}.${key}`, parent?.[key]);
109
- }
110
-
111
32
  // src/git/config/tables.ts
112
33
  import { isAbsolute } from "path";
113
34
  function worktrees(path, source) {
@@ -308,7 +229,8 @@ function readGitConfig(config) {
308
229
  "worktrees",
309
230
  "shared_checkout",
310
231
  "submodules",
311
- "umask"
232
+ "umask",
233
+ "affected"
312
234
  ]);
313
235
  const worktreeTable = child(path, root, "git", "worktrees");
314
236
  const named = typeof root["mainline"] === "string";
@@ -350,8 +272,7 @@ function readGitConfig(config) {
350
272
  // src/git/setup.ts
351
273
  function loadGit(cwd, configPath, env) {
352
274
  const path = configPath === void 0 ? findConfig(cwd) : resolve(cwd, configPath);
353
- if (path === null)
354
- return new Error("no pmcp.toml found; the git workflow is opt-in");
275
+ if (path === null) return new Error(NO_CONFIG);
355
276
  const project = readConfig(path);
356
277
  const config = readGitConfig(project);
357
278
  if (config === null)
@@ -392,4 +313,4 @@ export {
392
313
  gateTreePath,
393
314
  leaseSpecs
394
315
  };
395
- //# sourceMappingURL=chunk-7CSUKCU7.js.map
316
+ //# sourceMappingURL=chunk-RZYZILU4.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-34DECPVC.js";
7
7
  import {
8
8
  ptyBinary
9
- } from "./chunk-SPZQRLL5.js";
9
+ } from "./chunk-KYGGQPAH.js";
10
10
 
11
11
  // src/harness/adapters/systemd/admission.ts
12
12
  var nativeHostTools = ["systemctl", "systemd-run"];
@@ -36,4 +36,4 @@ export {
36
36
  nativeHostTools,
37
37
  assertNativeHost
38
38
  };
39
- //# sourceMappingURL=chunk-FODUHLZM.js.map
39
+ //# sourceMappingURL=chunk-SDQYZDHS.js.map
@@ -0,0 +1,86 @@
1
+ import {
2
+ flockAvailable,
3
+ lockFile
4
+ } from "./chunk-DZ2MRTYT.js";
5
+
6
+ // src/git/mainline/lock.ts
7
+ import { spawnSync } from "child_process";
8
+ import {
9
+ closeSync,
10
+ mkdirSync,
11
+ openSync,
12
+ readFileSync,
13
+ rmSync,
14
+ writeFileSync
15
+ } from "fs";
16
+ import { dirname, join } from "path";
17
+ function flock(fd, args) {
18
+ const run = spawnSync("flock", [...args, "3"], {
19
+ stdio: ["ignore", "ignore", "pipe", fd]
20
+ });
21
+ if (run.error !== void 0)
22
+ throw new Error(`flock (util-linux) is required: ${run.error.message}`);
23
+ return run.status ?? 1;
24
+ }
25
+ function acquireHostLock(path, waitSeconds, onWait) {
26
+ mkdirSync(dirname(path), { recursive: true });
27
+ if (!flockAvailable()) {
28
+ const now = lockFile(path, 0);
29
+ if (now) return now;
30
+ onWait?.();
31
+ return lockFile(path, waitSeconds * 1e3);
32
+ }
33
+ const fd = openSync(path, "a");
34
+ try {
35
+ if (flock(fd, ["-n"]) !== 0) {
36
+ onWait?.();
37
+ if (flock(fd, ["-w", String(waitSeconds)]) !== 0) {
38
+ closeSync(fd);
39
+ return null;
40
+ }
41
+ }
42
+ } catch (error) {
43
+ closeSync(fd);
44
+ throw error;
45
+ }
46
+ let open = true;
47
+ return {
48
+ release: () => {
49
+ if (!open) return;
50
+ open = false;
51
+ closeSync(fd);
52
+ }
53
+ };
54
+ }
55
+ function holderFile(lockPath) {
56
+ return join(dirname(lockPath), "holder.json");
57
+ }
58
+ function writeHolder(lockPath, holder) {
59
+ const record = {
60
+ ...holder,
61
+ pid: process.pid,
62
+ startedAt: (/* @__PURE__ */ new Date()).toISOString()
63
+ };
64
+ writeFileSync(holderFile(lockPath), `${JSON.stringify(record)}
65
+ `);
66
+ }
67
+ function removeHolder(lockPath) {
68
+ if (readHolder(lockPath)?.pid === process.pid)
69
+ rmSync(holderFile(lockPath), { force: true });
70
+ }
71
+ function readHolder(lockPath) {
72
+ try {
73
+ return JSON.parse(readFileSync(holderFile(lockPath), "utf8"));
74
+ } catch {
75
+ return null;
76
+ }
77
+ }
78
+
79
+ export {
80
+ flock,
81
+ acquireHostLock,
82
+ writeHolder,
83
+ removeHolder,
84
+ readHolder
85
+ };
86
+ //# sourceMappingURL=chunk-SGFTHKKS.js.map