@modootoday/pmcp 0.19.9 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.mcp.json +1 -1
  5. package/dist/{apply-TM6B2Y3G.js → apply-6FLMTJDV.js} +57 -23
  6. package/dist/{attachment-D84OGI6n.d.ts → attachment-ms6s8Aow.d.ts} +1 -1
  7. package/dist/{available-HYSDAFYH.js → available-BFXLII4A.js} +7 -7
  8. package/dist/{broadcast-DSCHWUMB.js → broadcast-ZALGUJVR.js} +4 -4
  9. package/dist/chunk-2GI5RM3M.js +53 -0
  10. package/dist/{chunk-ICF2JZSN.js → chunk-2MAD4WNZ.js} +2 -2
  11. package/dist/{chunk-QYQGPDBE.js → chunk-33KGCJB2.js} +2 -2
  12. package/dist/{chunk-XNPOHPMJ.js → chunk-3X5JQYKN.js} +3 -3
  13. package/dist/{chunk-4XNAKVSO.js → chunk-57Q75MS4.js} +18 -18
  14. package/dist/{chunk-2S44RDO4.js → chunk-5FW7A6TG.js} +7 -4
  15. package/dist/chunk-5YCKFU5Q.js +1672 -0
  16. package/dist/{chunk-MCYGYZVZ.js → chunk-7FV2LORT.js} +2 -2
  17. package/dist/{chunk-57FHYW74.js → chunk-DEY23WTH.js} +122 -4
  18. package/dist/chunk-DJZPPCJP.js +274 -0
  19. package/dist/{chunk-4XWVLC23.js → chunk-G6JXCUSK.js} +2 -2
  20. package/dist/{chunk-T6GOWHK6.js → chunk-GFOQDLPL.js} +6 -1
  21. package/dist/{chunk-PG42KALG.js → chunk-GQP4GWU4.js} +5 -5
  22. package/dist/chunk-H4ZOKIER.js +7 -0
  23. package/dist/{chunk-XPWIJOZT.js → chunk-JQVSDPFL.js} +3 -3
  24. package/dist/{chunk-OG7QR2DP.js → chunk-KEHB4FZP.js} +17 -2
  25. package/dist/chunk-KUBHGVTD.js +126 -0
  26. package/dist/{chunk-SPUCY4AG.js → chunk-KVNNVLJR.js} +2 -2
  27. package/dist/chunk-LFFIQBNY.js +115 -0
  28. package/dist/{chunk-V7HG3STC.js → chunk-MR5IBS6L.js} +31 -15
  29. package/dist/{chunk-W5RLIUNC.js → chunk-NHUMPEPV.js} +2 -2
  30. package/dist/{chunk-I4DLMIN5.js → chunk-OFJIMBTL.js} +2 -2
  31. package/dist/{chunk-A6TM4NTI.js → chunk-OFPNCLG7.js} +2 -2
  32. package/dist/{chunk-3UOFHLY4.js → chunk-OS5DF3LL.js} +207 -15
  33. package/dist/{chunk-BZ2RXI5I.js → chunk-POTI2RJ6.js} +2 -2
  34. package/dist/{chunk-QTKD7JEL.js → chunk-R3MVL67T.js} +34 -34
  35. package/dist/{chunk-YN5GQCHN.js → chunk-RHJEGLYM.js} +6 -1
  36. package/dist/{chunk-YKU7KHJO.js → chunk-TBKVC2TA.js} +3 -5
  37. package/dist/{chunk-YYG3GUQW.js → chunk-UFWQTZDX.js} +29 -17
  38. package/dist/{chunk-PBDPWE5J.js → chunk-VBDDFO2V.js} +2 -2
  39. package/dist/{chunk-BRSESCGX.js → chunk-VUM6LO77.js} +4717 -4694
  40. package/dist/{chunk-FR6JHNLC.js → chunk-YLITJLTR.js} +3 -3
  41. package/dist/{chunk-CJ6OFTS3.js → chunk-YOWIYFIV.js} +6 -37
  42. package/dist/{chunk-VDBUZKXC.js → chunk-Z4Q6RYJH.js} +2 -2
  43. package/dist/{chunk-RRKGSYQ4.js → chunk-Z6WRFOFT.js} +13 -2
  44. package/dist/{chunk-YXAPCHXJ.js → chunk-ZIJ5IUXH.js} +31 -5
  45. package/dist/{claude-2C5L2HQL.js → claude-XVLF4N4S.js} +3 -3
  46. package/dist/{cli-BVRPAI23.js → cli-6FWRBCWM.js} +8 -8
  47. package/dist/{cli-YV6SFE4D.js → cli-RVPR3MH3.js} +7 -7
  48. package/dist/cli.js +11 -11
  49. package/dist/{completion-B3UT3GVI.js → completion-YTPHEVEW.js} +7 -7
  50. package/dist/{diagnostics-ONIAKCA3.js → diagnostics-IW54MLFK.js} +5 -6
  51. package/dist/{doctor-MJFU5L6R.js → doctor-EN4JPSKV.js} +35 -35
  52. package/dist/{entry-DZGKCL4G.js → entry-TQWSDTJ4.js} +14 -15
  53. package/dist/{exec-mcp-QK2VC6RX.js → exec-mcp-KKQ75N5O.js} +15 -13
  54. package/dist/{harness-GTED4GLK.js → harness-EB76F6BG.js} +6 -6
  55. package/dist/harness-launch-gate.js +3 -4
  56. package/dist/harness-worker.js +5 -6
  57. package/dist/hook-body.js +281 -98
  58. package/dist/{hook-spec-C7umArqw.d.ts → hook-spec-hZL4MSgi.d.ts} +8 -3
  59. package/dist/hooks-YWSHUNLM.js +24 -0
  60. package/dist/{host-AGNF2AQH.js → host-LSVITS6M.js} +6 -7
  61. package/dist/{host-3HTCZNVJ.js → host-OGGADMBT.js} +17 -15
  62. package/dist/{host-run-2OQZVQID.js → host-run-XO2TS4JC.js} +5 -7
  63. package/dist/http.d.ts +1 -1
  64. package/dist/http.js +1 -1
  65. package/dist/{import-mcp-7KEPR2B6.js → import-mcp-BJDJTPVS.js} +14 -11
  66. package/dist/index.d.ts +12 -3
  67. package/dist/index.js +25 -25
  68. package/dist/{init-BHGCF7JL.js → init-773PTQM5.js} +3 -3
  69. package/dist/{install-HF6CROQP.js → install-7V6NIA7W.js} +4 -4
  70. package/dist/{invoke-CVHF6PEK.js → invoke-Y7XH5S2L.js} +7 -8
  71. package/dist/{list-6XGQ3FR3.js → list-5W65XVES.js} +20 -17
  72. package/dist/{logout-6RJLG2KG.js → logout-XO6ALD45.js} +15 -12
  73. package/dist/{logs-VTW7S2LR.js → logs-74JGLQG6.js} +4 -4
  74. package/dist/mailbox/index.d.ts +3 -3
  75. package/dist/{mailbox-CNAONXN7.js → mailbox-VK5AVTHI.js} +9 -9
  76. package/dist/{mainline-JSG4MUKH.js → mainline-M2NSTAGC.js} +105 -36
  77. package/dist/{mcp-P55VLQLR.js → mcp-R62ZNVGJ.js} +2 -2
  78. package/dist/{pause-V5VCNOSH.js → pause-CZ2OZYLC.js} +4 -4
  79. package/dist/project/hook-adapter.d.ts +1 -1
  80. package/dist/{project-B57IQPDK.js → project-W5DQIZA6.js} +5 -5
  81. package/dist/{pty-FD4JGBZL.js → pty-CDLQ4NP2.js} +3 -3
  82. package/dist/report-Z3JV2PCT.js +105 -0
  83. package/dist/{resume-7S4K3R4X.js → resume-DFIHT2RO.js} +4 -4
  84. package/dist/{run-MC2BPLOE.js → run-OZLGSRHF.js} +14 -11
  85. package/dist/{run-LFJXONLW.js → run-WYJMTLX7.js} +4 -4
  86. package/dist/{serve-TFAEVXX3.js → serve-DCQGAGB7.js} +3 -3
  87. package/dist/{session-XM2CR425.js → session-YZVX4NGN.js} +4 -4
  88. package/dist/{setup-FHFQZJY6.js → setup-D3KEJBGO.js} +4 -4
  89. package/dist/smoke-FQQJOQBD.js +16 -0
  90. package/dist/{start-login-KXOHCR5A.js → start-login-EKXM75XQ.js} +15 -12
  91. package/dist/{status-YXOIEVOJ.js → status-23UDIYYP.js} +39 -22
  92. package/dist/{status-OYRB3KL5.js → status-3RTGDN2K.js} +10 -10
  93. package/dist/{status-AW7DOW7A.js → status-EDSEG32U.js} +15 -12
  94. package/dist/stdio.d.ts +2 -2
  95. package/dist/stdio.js +2 -2
  96. package/dist/{sweep-ZSYG6FNR.js → sweep-EPJMEZR6.js} +4 -4
  97. package/dist/{test-2HTOY4PJ.js → test-TM6PIZTV.js} +26 -18
  98. package/dist/{tui-DQFXYQ4H.js → tui-EQNJIDN5.js} +4 -4
  99. package/dist/{unbroadcast-FONZJWEW.js → unbroadcast-NTOC3PY3.js} +4 -4
  100. package/dist/{validate-WOFI7TMT.js → validate-KFBCUFI4.js} +2 -2
  101. package/dist/{worker-UXPGXAV2.js → worker-7X6WBPEI.js} +9 -10
  102. package/dist/{worktree-list-4PLE7K6L.js → worktree-list-EMKUMCTQ.js} +2 -2
  103. package/dist/{worktree-sync-GQVYAXGJ.js → worktree-sync-T6C5YEYS.js} +3 -3
  104. package/docs/commands.md +13 -6
  105. package/docs/git-workflow.md +46 -10
  106. package/docs/hooks.md +139 -12
  107. package/docs/project-configuration.md +34 -6
  108. package/docs/upgrading.md +94 -0
  109. package/gemini-extension.json +2 -2
  110. package/mcp.json +1 -1
  111. package/package.json +5 -5
  112. package/plugin.json +1 -1
  113. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  114. package/plugins/pmcp/.mcp.json +1 -1
  115. package/plugins/pmcp/gemini-extension.json +2 -2
  116. package/plugins/pmcp/mcp.json +1 -1
  117. package/plugins/pmcp/mod/reader/read.ts +14 -4
  118. package/plugins/pmcp/mod/sessions/format.ts +16 -1
  119. package/plugins/pmcp/mod/sessions/types.ts +1 -1
  120. package/plugins/pmcp/plugin.json +1 -1
  121. package/schema/catalog-v1.json +1 -7
  122. package/dist/chunk-EONAJAMJ.js +0 -130
  123. package/dist/chunk-IACJDHFQ.js +0 -1025
  124. package/dist/chunk-ISNRDHSD.js +0 -74
  125. package/dist/chunk-YGTJQVCK.js +0 -7
  126. package/dist/chunk-YLPXTJJM.js +0 -396
  127. package/dist/hooks-FRZ4SUNJ.js +0 -21
  128. package/dist/{core-C1LPjxK6.d.ts → core-Sug_rZrx.d.ts} +1 -1
@@ -4,6 +4,7 @@ import {
4
4
  asPause,
5
5
  asRecord,
6
6
  isLeaseFile,
7
+ latestRecord,
7
8
  recordLive,
8
9
  STATE_FILES,
9
10
  } from "../sessions/format";
@@ -49,11 +50,20 @@ export async function readRecords(
49
50
  files: StateFiles,
50
51
  options: ReadOptions,
51
52
  ): Promise<SessionRecord[]> {
52
- const directory = `${options.stateDir}/${STATE_PATHS.records}`;
53
- const names = await files.list(directory).catch(() => [] as string[]);
53
+ // sessions/ and the deprecated fleet/: each session once, the copy updated last.
54
+ const found = new Map<string, (SessionRecord | null)[]>();
55
+ for (const folder of [STATE_PATHS.records, STATE_FILES.legacyRecords]) {
56
+ const directory = `${options.stateDir}/${folder}`;
57
+ const names = await files.list(directory).catch(() => [] as string[]);
58
+ for (const name of names.filter((item) => item.endsWith(".json")))
59
+ found.set(name, [
60
+ ...(found.get(name) ?? []),
61
+ asRecord(await readJson(files, `${directory}/${name}`)),
62
+ ]);
63
+ }
54
64
  const records: SessionRecord[] = [];
55
- for (const name of names.filter((item) => item.endsWith(".json")).sort()) {
56
- const record = asRecord(await readJson(files, `${directory}/${name}`));
65
+ for (const name of [...found.keys()].sort()) {
66
+ const record = latestRecord(found.get(name)!);
57
67
  if (!record) continue;
58
68
  const pidAlive = await isAlive(files, record.pid);
59
69
  if (recordLive(record, options.now, pidAlive)) records.push(record);
@@ -3,7 +3,10 @@
3
3
  import type { Broadcast, Lease, Pause, SessionRecord } from "./types";
4
4
 
5
5
  export const STATE_FILES = {
6
- records: "fleet",
6
+ records: "sessions",
7
+ // The records' former directory. Deprecated: read beside sessions/ but no longer written; a
8
+ // pmcp before 0.20 sharing the state directory still writes there.
9
+ legacyRecords: "fleet",
7
10
  pause: "pause.json",
8
11
  broadcast: "broadcast.json",
9
12
  history: "broadcast-history.jsonl",
@@ -11,6 +14,18 @@ export const STATE_FILES = {
11
14
 
12
15
  export const STALE_MS = 30 * 60 * 1000;
13
16
 
17
+ // Of a session's copies (sessions/ and fleet/), the one updated last; the first wins a tie.
18
+ export function latestRecord(
19
+ copies: readonly (SessionRecord | null)[],
20
+ ): SessionRecord | null {
21
+ const time = (record: SessionRecord) =>
22
+ Date.parse(record.updatedAt ?? record.startedAt ?? "") || 0;
23
+ let latest: SessionRecord | null = null;
24
+ for (const copy of copies)
25
+ if (copy && (!latest || time(copy) > time(latest))) latest = copy;
26
+ return latest;
27
+ }
28
+
14
29
  const LEASE_NAME = /^[a-z0-9][a-z0-9_-]*$/u;
15
30
 
16
31
  // The lease file name is part of the shared formats (docs/git-workflow.md); never change it.
@@ -118,7 +118,7 @@ export interface Recipient {
118
118
  readonly session?: string;
119
119
  readonly alias?: string;
120
120
  readonly roles?: readonly string[];
121
- readonly desk?: string;
121
+ readonly worktree?: string;
122
122
  // When the session started: a broadcast to all sent before then is not for it.
123
123
  readonly since?: string;
124
124
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "pmcp",
4
- "version": "0.19.9",
4
+ "version": "0.21.0",
5
5
  "description": "Find package skills and use native runtime project configuration.",
6
6
  "author": { "name": "modootoday" },
7
7
  "license": "Elastic-2.0",
@@ -153,13 +153,7 @@
153
153
  "type": "array",
154
154
  "items": {
155
155
  "type": "string",
156
- "enum": [
157
- "job_estimate",
158
- "job_submit",
159
- "job_status",
160
- "job_result",
161
- "job_cancel"
162
- ]
156
+ "minLength": 1
163
157
  }
164
158
  }
165
159
  },
@@ -1,130 +0,0 @@
1
- import {
2
- missingBinary,
3
- nativeBinary,
4
- readLock
5
- } from "./chunk-57FHYW74.js";
6
- import {
7
- VERSION
8
- } from "./chunk-YGTJQVCK.js";
9
- import {
10
- pickEnv
11
- } from "./chunk-J6KL3COD.js";
12
-
13
- // src/project/host.ts
14
- import { createHash } from "crypto";
15
- import { existsSync, readFileSync } from "fs";
16
- import { join } from "path";
17
- var HOST_DIRECTORY = ".agents/pmcp-pty";
18
- var HOST_MANIFEST = `${HOST_DIRECTORY}/host.json`;
19
- var HOST_POLICY = `${HOST_DIRECTORY}/policy.json`;
20
- function hostPolicy(host) {
21
- const browser = host.browser.allowPrivate;
22
- const launch = host.desktop.launch;
23
- return {
24
- version: 1,
25
- mcp_write: host.mcpWrite,
26
- roots: host.roots,
27
- allow: host.answers.map((a) => ({
28
- profile: a.runtime,
29
- dialog: a.dialog,
30
- options: a.options
31
- })),
32
- ...browser.length > 0 ? { browser: { allow_private: browser } } : {},
33
- ...launch.length > 0 ? { desktop: { launch } } : {}
34
- };
35
- }
36
- function hostManifest(host) {
37
- return {
38
- version: 1,
39
- sessions: host.sessions.map((s) => ({
40
- name: s.name,
41
- profile: s.runtime,
42
- cwd: s.cwd,
43
- argv: s.argv,
44
- labels: { ...s.labels, "pmcp.host": s.name },
45
- restart: s.restart,
46
- max_restarts: s.maxRestarts,
47
- delivery_setup: true,
48
- // Only when declared, so an approval made before env existed stays valid.
49
- ...s.env.length > 0 ? { env: s.env } : {}
50
- }))
51
- };
52
- }
53
- var json = (value) => `${JSON.stringify(value, null, 2)}
54
- `;
55
- function hostOutputs(spec) {
56
- if (!spec.host) return [];
57
- return [
58
- {
59
- kind: "file",
60
- path: HOST_MANIFEST,
61
- content: json(hostManifest(spec.host))
62
- },
63
- { kind: "file", path: HOST_POLICY, content: json(hostPolicy(spec.host)) }
64
- ];
65
- }
66
- function ptyBinary(env) {
67
- return nativeBinary("pmcp-pty", "PMCP_PTY_BIN", env);
68
- }
69
- function ptyBinaryDoctor(env) {
70
- const found = ptyBinary(env);
71
- return found ? { tool: "project", check: "pmcp-pty binary", status: "ok", detail: found } : {
72
- tool: "project",
73
- check: "pmcp-pty binary",
74
- status: "warn",
75
- detail: missingBinary("pmcp-pty", "PMCP_PTY_BIN", VERSION)
76
- };
77
- }
78
- function hostEnvDoctor(spec, env) {
79
- return (spec.host?.sessions ?? []).filter((s) => s.env.length > 0).map((s) => {
80
- const { missing } = pickEnv(s.env, env);
81
- return missing.length === 0 ? {
82
- tool: "project",
83
- check: `host env (${s.name})`,
84
- status: "ok",
85
- detail: `set: ${s.env.join(", ")}`
86
- } : {
87
- tool: "project",
88
- check: `host env (${s.name})`,
89
- status: "warn",
90
- detail: `not set: ${missing.join(", ")}; host up refuses ${s.name} until they are`
91
- };
92
- });
93
- }
94
- var sha256 = (text) => createHash("sha256").update(text).digest("hex");
95
- function hostDoctor(spec) {
96
- if (!spec.host) return [];
97
- const lock = new Map(readLock(spec.root).map((e) => [e.path, e]));
98
- const bad = [HOST_MANIFEST, HOST_POLICY].filter((path) => {
99
- const file = join(spec.root, path);
100
- if (!existsSync(file)) return true;
101
- const entry = lock.get(path);
102
- return entry?.sha256 !== sha256(readFileSync(file, "utf8"));
103
- });
104
- const { sessions, answers, mcpWrite } = spec.host;
105
- const summary = `${sessions.length} session(s), ${answers.length} answer rule(s), mcp_write ${mcpWrite}`;
106
- return [
107
- bad.length === 0 ? {
108
- tool: "project",
109
- check: "pmcp-pty host projected",
110
- status: "ok",
111
- detail: summary
112
- } : {
113
- tool: "project",
114
- check: "pmcp-pty host projected",
115
- status: "fail",
116
- detail: `run pmcp project: ${bad.join(", ")}`
117
- }
118
- ];
119
- }
120
-
121
- export {
122
- HOST_MANIFEST,
123
- HOST_POLICY,
124
- hostOutputs,
125
- ptyBinary,
126
- ptyBinaryDoctor,
127
- hostEnvDoctor,
128
- hostDoctor
129
- };
130
- //# sourceMappingURL=chunk-EONAJAMJ.js.map