@modootoday/pmcp 0.22.0 → 0.22.2

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 (81) 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-3PR4UOES.js → apply-AWZ32Z66.js} +14 -13
  6. package/dist/{chunk-TCW2H47H.js → chunk-4Z6NPSWX.js} +49 -16
  7. package/dist/{chunk-3LADLKAI.js → chunk-5A7QRZP6.js} +9 -9
  8. package/dist/{chunk-SEM6WD7J.js → chunk-5F7TL3V7.js} +23 -6
  9. package/dist/{chunk-E6YP2PMO.js → chunk-BUD3WS4Y.js} +2 -2
  10. package/dist/{chunk-S4Y44CCC.js → chunk-D2DDM5VZ.js} +2 -2
  11. package/dist/{chunk-RNC7PGW2.js → chunk-FOIQUPIQ.js} +2 -2
  12. package/dist/chunk-FWKQA6TX.js +7 -0
  13. package/dist/{chunk-LVNGMGOM.js → chunk-G25LCRIG.js} +2 -2
  14. package/dist/{chunk-SLCNCAWY.js → chunk-GE2PHR35.js} +3 -3
  15. package/dist/{chunk-73IDLWRI.js → chunk-GZQH3RJA.js} +3 -3
  16. package/dist/{chunk-5ZUDBC3P.js → chunk-JP27V2H4.js} +2 -2
  17. package/dist/{chunk-2QJGUR23.js → chunk-KLWZZTUQ.js} +7 -7
  18. package/dist/{chunk-XB363ZXT.js → chunk-NAXUAC5S.js} +27 -7
  19. package/dist/{chunk-GBKRDRMZ.js → chunk-NFJ44OE2.js} +5 -2
  20. package/dist/{chunk-5YCKFU5Q.js → chunk-OMIIXLMO.js} +1 -1
  21. package/dist/{chunk-NDED2O5B.js → chunk-SKOP4ZST.js} +5 -5
  22. package/dist/{chunk-SPZ42EWE.js → chunk-T6MQPVLH.js} +2 -2
  23. package/dist/{chunk-RNE4WPBS.js → chunk-U2NWTZQP.js} +2 -2
  24. package/dist/{chunk-TPGJXENR.js → chunk-U3IHGG7X.js} +3 -3
  25. package/dist/{chunk-EPNTYTDZ.js → chunk-VGW3N3HC.js} +12 -12
  26. package/dist/{chunk-2GI5RM3M.js → chunk-W6GA5RAW.js} +2 -2
  27. package/dist/chunk-XWLMZKH2.js +12 -0
  28. package/dist/{chunk-3OBJVG5R.js → chunk-ZYLJUABY.js} +2 -2
  29. package/dist/{cli-BEEDAD4E.js → cli-BOSY6VFP.js} +4 -4
  30. package/dist/cli.js +3 -3
  31. package/dist/{completion-LHYNCQ3N.js → completion-V756JVX6.js} +2 -2
  32. package/dist/{diagnostics-ABTJUYZQ.js → diagnostics-R7S3DNXD.js} +7 -5
  33. package/dist/{doctor-GPPO5L4F.js → doctor-44S5EWK5.js} +20 -13
  34. package/dist/{entry-ARGY5CKA.js → entry-GSGCMXE5.js} +11 -9
  35. package/dist/{exec-mcp-JEF74XVP.js → exec-mcp-3COXHDYT.js} +11 -10
  36. package/dist/{harness-OCXW6YE4.js → harness-K4WL2NSH.js} +3 -3
  37. package/dist/harness-launch-gate.js +5 -3
  38. package/dist/harness-worker.js +7 -5
  39. package/dist/hook-body.js +107 -38
  40. package/dist/{hooks-JHXUN5MD.js → hooks-HQOLXR3A.js} +3 -3
  41. package/dist/{host-VI4ZFCZP.js → host-4W3JUQAO.js} +11 -10
  42. package/dist/{host-OBRHBDRE.js → host-N5UILUK7.js} +8 -6
  43. package/dist/{host-run-H7AITG7C.js → host-run-CVYRZB7R.js} +6 -4
  44. package/dist/http.js +1 -1
  45. package/dist/{import-mcp-3Y33CUHF.js → import-mcp-IAGC3LJU.js} +10 -9
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +15 -14
  48. package/dist/{init-WZJHMWNJ.js → init-HPEVKKMU.js} +2 -2
  49. package/dist/{invoke-GWWTXQLO.js → invoke-TD5YR2G7.js} +9 -7
  50. package/dist/{list-Y6UPLGNF.js → list-YUHJ5CTT.js} +10 -9
  51. package/dist/{logout-KAUW4JZZ.js → logout-JQ5UPC5W.js} +9 -8
  52. package/dist/{mainline-Q42M2GJ2.js → mainline-7HO7RCQH.js} +55 -24
  53. package/dist/{mcp-IDEUIY2F.js → mcp-B6SYBT3X.js} +2 -2
  54. package/dist/{project-GVVWLDOJ.js → project-GOW2MEFY.js} +7 -7
  55. package/dist/{run-RRWB7U2Q.js → run-7UNRLLYD.js} +8 -7
  56. package/dist/{run-HVNKQHVU.js → run-ZOSIKNDX.js} +4 -4
  57. package/dist/{serve-KJSOU3BR.js → serve-VRBL67KO.js} +3 -3
  58. package/dist/{setup-3GET6K3J.js → setup-QMYAW3MB.js} +2 -2
  59. package/dist/{smoke-FQQJOQBD.js → smoke-EXPR7HLD.js} +4 -3
  60. package/dist/{start-login-RNHSEX5P.js → start-login-NRD323LK.js} +9 -8
  61. package/dist/{status-RR4VZARJ.js → status-JN2GT5UM.js} +10 -9
  62. package/dist/{status-Y25ONHA5.js → status-ZY5B7V6R.js} +9 -8
  63. package/dist/stdio.js +2 -2
  64. package/dist/{test-7NYPQ6YU.js → test-VGJXKCQT.js} +10 -9
  65. package/dist/{tui-H5RPSF4B.js → tui-GORRJIMA.js} +4 -4
  66. package/dist/{worker-YWFTWIBP.js → worker-LJG2NDMK.js} +9 -7
  67. package/docs/compatibility.md +11 -10
  68. package/docs/git-workflow.md +20 -12
  69. package/docs/hooks.md +7 -1
  70. package/docs/project-configuration.md +22 -1
  71. package/docs/upgrading.md +28 -0
  72. package/gemini-extension.json +2 -2
  73. package/mcp.json +1 -1
  74. package/package.json +5 -5
  75. package/plugin.json +1 -1
  76. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  77. package/plugins/pmcp/.mcp.json +1 -1
  78. package/plugins/pmcp/gemini-extension.json +2 -2
  79. package/plugins/pmcp/mcp.json +1 -1
  80. package/plugins/pmcp/plugin.json +1 -1
  81. package/dist/chunk-L42U5XKC.js +0 -7
package/dist/hook-body.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/hooks/entry.ts
2
- import { dirname as dirname12, resolve as resolve19 } from "node:path";
2
+ import { dirname as dirname12, resolve as resolve20 } from "node:path";
3
3
 
4
4
  // src/hooks/contract.ts
5
5
  var NEUTRAL_EVENTS = [
@@ -5132,6 +5132,14 @@ function rememberVerified(key, stamp, sha) {
5132
5132
  }
5133
5133
  }
5134
5134
 
5135
+ // src/hooks/lock-text.ts
5136
+ var MARKER = /^(?:<{7}|={7}|>{7})(?: |$)/mu;
5137
+ function lockProblem(text9) {
5138
+ const at = text9.split("\n").findIndex((line) => MARKER.test(line));
5139
+ const what = at >= 0 ? `pmcp.lock holds git conflict markers (line ${at + 1})` : "pmcp.lock is not valid JSON";
5140
+ return `${what}; restore it with git checkout <rev> -- pmcp.lock or git show <rev>:pmcp.lock > pmcp.lock, then run pmcp project`;
5141
+ }
5142
+
5135
5143
  // src/hooks/compiled.ts
5136
5144
  var HOOK_DIRECTORY = ".agents/pmcp-hooks";
5137
5145
  var POLICY_FILE = `${HOOK_DIRECTORY}/policy.json`;
@@ -5143,13 +5151,23 @@ function sha256(text9) {
5143
5151
  }
5144
5152
  var PolicyIntegrityError = class extends Error {
5145
5153
  };
5154
+ var LockUnreadableError = class extends PolicyIntegrityError {
5155
+ };
5146
5156
  var MISMATCH = "policy.json does not match pmcp.lock; review the change and run pmcp project";
5157
+ function readLockFile(path) {
5158
+ const text9 = readFileSync(path, "utf8");
5159
+ try {
5160
+ return JSON.parse(text9);
5161
+ } catch {
5162
+ throw new LockUnreadableError(lockProblem(text9));
5163
+ }
5164
+ }
5147
5165
  function readCompiled(root) {
5148
5166
  const policyPath = join11(root, POLICY_FILE);
5149
5167
  const files2 = [policyPath, join11(root, LOCK_FILE)];
5150
5168
  const before2 = stampOf(files2);
5151
5169
  const text9 = readFileSync(policyPath, "utf8");
5152
- const lock = JSON.parse(readFileSync(files2[1], "utf8"));
5170
+ const lock = readLockFile(files2[1]);
5153
5171
  const entry = lock.outputs?.find((output) => output.path === POLICY_FILE);
5154
5172
  const expected = typeof entry?.sha256 === "string" ? entry.sha256 : null;
5155
5173
  if (expected === null) throw new PolicyIntegrityError(MISMATCH);
@@ -5203,8 +5221,48 @@ function failClosed(adapter, event, root, error, stated = false) {
5203
5221
  return adapter.render(input, { verdict: "deny", reason: reason2 }).stdout;
5204
5222
  }
5205
5223
 
5224
+ // src/hooks/entry/lock-repair.ts
5225
+ import { join as join13, resolve as resolve19 } from "node:path";
5226
+ var REV = String.raw`[\w./~^@{}-]+`;
5227
+ var LOCK = String.raw`(?:\./)?pmcp\.lock`;
5228
+ var REPAIRS = [
5229
+ new RegExp(String.raw`^git show ${REV}:${LOCK} > ${LOCK}$`, "u"),
5230
+ new RegExp(
5231
+ String.raw`^git checkout (?:(?:--ours|--theirs|${REV}) )?(?:-- )?${LOCK}$`,
5232
+ "u"
5233
+ ),
5234
+ new RegExp(
5235
+ String.raw`^git restore (?:(?:--source=${REV}|--staged|--worktree|--ours|--theirs|-[SW]+) )*(?:-- )?${LOCK}$`,
5236
+ "u"
5237
+ )
5238
+ ];
5239
+ function repairsLock(input, root) {
5240
+ const tool = input.tool;
5241
+ if (!tool) return false;
5242
+ if (tool.kind === "read") return true;
5243
+ if (tool.kind === "edit") {
5244
+ const lock = join13(root, LOCK_FILE);
5245
+ return tool.paths.length > 0 && tool.paths.every((path) => resolve19(input.cwd, path) === lock);
5246
+ }
5247
+ if (tool.kind === "shell") {
5248
+ const command6 = (tool.command ?? "").trim().replace(/\s+/gu, " ");
5249
+ return REPAIRS.some((pattern) => pattern.test(command6));
5250
+ }
5251
+ return false;
5252
+ }
5253
+ function lockRepair(adapter, event, root, input, error) {
5254
+ if (event !== "before_tool") return "";
5255
+ if (input && repairsLock(input, root))
5256
+ return adapter.render(input, {
5257
+ context: [
5258
+ `pmcp hooks: ${error.message}; this call repairs it, so it passes`
5259
+ ]
5260
+ }).stdout;
5261
+ return failClosed(adapter, event, root, error);
5262
+ }
5263
+
5206
5264
  // src/hooks/entry/logger.ts
5207
- import { dirname as dirname8, join as join15 } from "node:path";
5265
+ import { dirname as dirname8, join as join16 } from "node:path";
5208
5266
 
5209
5267
  // src/logging/levels.ts
5210
5268
  var LEVEL_RANK = {
@@ -5328,11 +5386,11 @@ var silentLogger = createLogger(() => {
5328
5386
  });
5329
5387
 
5330
5388
  // src/logging/sinks/file.ts
5331
- import { join as join13 } from "node:path";
5389
+ import { join as join14 } from "node:path";
5332
5390
  var FILE = /^pmcp-(\d{8})(?:\.\d+)?\.jsonl$/u;
5333
5391
  function dailyLogFile(dir, now = /* @__PURE__ */ new Date()) {
5334
5392
  const day = now.toISOString().slice(0, 10).replaceAll("-", "");
5335
- return join13(dir, `pmcp-${day}.jsonl`);
5393
+ return join14(dir, `pmcp-${day}.jsonl`);
5336
5394
  }
5337
5395
  function roll(file2) {
5338
5396
  let index = 1;
@@ -5363,7 +5421,7 @@ function logFiles(dir) {
5363
5421
  const part = (name) => Number(/\.(\d+)\.jsonl$/u.exec(name)?.[1] ?? Number.MAX_SAFE_INTEGER);
5364
5422
  return names2.sort(
5365
5423
  (a, b) => a.slice(5, 13).localeCompare(b.slice(5, 13)) || part(a) - part(b)
5366
- ).map((name) => join13(dir, name));
5424
+ ).map((name) => join14(dir, name));
5367
5425
  }
5368
5426
  function pruneLogs(dir, keepDays, now = /* @__PURE__ */ new Date()) {
5369
5427
  const cutoff = new Date(now.getTime() - keepDays * 864e5).toISOString().slice(0, 10).replaceAll("-", "");
@@ -5379,13 +5437,13 @@ function pruneLogs(dir, keepDays, now = /* @__PURE__ */ new Date()) {
5379
5437
 
5380
5438
  // src/sessions/state-dir.ts
5381
5439
  import { homedir as homedir3 } from "node:os";
5382
- import { join as join14 } from "node:path";
5440
+ import { join as join15 } from "node:path";
5383
5441
  function projectStateDir(root, override, env = process.env) {
5384
5442
  if (override) return expandPath(root, override);
5385
5443
  const anchor = gitCommonDir(root) ?? realpathSync(root);
5386
5444
  const id = createHash("sha256").update(anchor).digest("hex").slice(0, 16);
5387
- const base = env["XDG_STATE_HOME"] || join14(homedir3(), ".local", "state");
5388
- return join14(base, "pmcp", "projects", id);
5445
+ const base = env["XDG_STATE_HOME"] || join15(homedir3(), ".local", "state");
5446
+ return join15(base, "pmcp", "projects", id);
5389
5447
  }
5390
5448
 
5391
5449
  // src/hooks/entry/logger.ts
@@ -5400,7 +5458,7 @@ function hookLogger(root, compiled, runtime2, event) {
5400
5458
  process.env["PMCP_LOG"]
5401
5459
  );
5402
5460
  const file2 = compiled?.logFile ? expandPath(root, compiled.logFile) : void 0;
5403
- const dir = file2 ? dirname8(file2) : join15(projectStateDir(root, compiled?.stateDir), "logs");
5461
+ const dir = file2 ? dirname8(file2) : join16(projectStateDir(root, compiled?.stateDir), "logs");
5404
5462
  const sink = fileSink({
5405
5463
  dir,
5406
5464
  ...file2 ? { file: file2 } : {},
@@ -5460,7 +5518,7 @@ var gitProbe = {
5460
5518
  };
5461
5519
 
5462
5520
  // src/sessions/files/broadcast.ts
5463
- import { join as join16 } from "node:path";
5521
+ import { join as join17 } from "node:path";
5464
5522
 
5465
5523
  // src/sessions/files/json.ts
5466
5524
  import { dirname as dirname9 } from "node:path";
@@ -5507,8 +5565,8 @@ function writeLines(path, values) {
5507
5565
 
5508
5566
  // src/sessions/files/broadcast.ts
5509
5567
  function filesBroadcast(dir, keep, registry2) {
5510
- const latestPath = join16(dir, STATE_FILES.broadcast);
5511
- const historyPath = join16(dir, STATE_FILES.history);
5568
+ const latestPath = join17(dir, STATE_FILES.broadcast);
5569
+ const historyPath = join17(dir, STATE_FILES.history);
5512
5570
  const list = () => {
5513
5571
  const latest = asBroadcast(readJson3(latestPath));
5514
5572
  if (!latest) return [];
@@ -5552,9 +5610,9 @@ function filesBroadcast(dir, keep, registry2) {
5552
5610
  }
5553
5611
 
5554
5612
  // src/sessions/files/leases.ts
5555
- import { dirname as dirname10, join as join17 } from "node:path";
5613
+ import { dirname as dirname10, join as join18 } from "node:path";
5556
5614
  function filesLeases(dir, files2 = {}) {
5557
- const leasePath = (name) => files2[name]?.file ?? join17(dir, leaseFile(name));
5615
+ const leasePath = (name) => files2[name]?.file ?? join18(dir, leaseFile(name));
5558
5616
  const read3 = (name) => {
5559
5617
  const lease = asLease(readJson3(leasePath(name)));
5560
5618
  if (!lease || !alive(lease.pid)) return null;
@@ -5604,28 +5662,28 @@ function filesLeases(dir, files2 = {}) {
5604
5662
  }
5605
5663
 
5606
5664
  // src/sessions/files/mailbox.ts
5607
- import { join as join18 } from "node:path";
5665
+ import { join as join19 } from "node:path";
5608
5666
  var ID = /^\d{13}-[0-9a-f]{8}$/u;
5609
5667
  var SAFE_KEY = /^@?[\w.-]+$/u;
5610
5668
  function filesMailbox(dir, settings) {
5611
- const messages = join18(dir, "messages");
5612
- const inbox = join18(dir, "inbox");
5613
- const pathOf = (id) => join18(messages, `${id}.json`);
5669
+ const messages = join19(dir, "messages");
5670
+ const inbox = join19(dir, "inbox");
5671
+ const pathOf = (id) => join19(messages, `${id}.json`);
5614
5672
  const marker = (key, id, kind) => {
5615
5673
  if (!SAFE_KEY.test(key) || !ID.test(id))
5616
5674
  throw new Error(`invalid mailbox key ${key} or id ${id}`);
5617
- return join18(inbox, key, `${id}.${kind}`);
5675
+ return join19(inbox, key, `${id}.${kind}`);
5618
5676
  };
5619
5677
  const audit = (event, fields2) => {
5620
5678
  if (!settings.audit) return;
5621
5679
  const line = { at: (/* @__PURE__ */ new Date()).toISOString(), event, ...fields2 };
5622
- appendFileSync(join18(dir, "messages.jsonl"), `${JSON.stringify(line)}
5680
+ appendFileSync(join19(dir, "messages.jsonl"), `${JSON.stringify(line)}
5623
5681
  `, {
5624
5682
  mode: 384
5625
5683
  });
5626
5684
  };
5627
5685
  const touch = (path) => {
5628
- mkdirSync(join18(path, ".."), { recursive: true, mode: 448 });
5686
+ mkdirSync(join19(path, ".."), { recursive: true, mode: 448 });
5629
5687
  try {
5630
5688
  writeFileSync(path, "", { flag: "wx", mode: 384 });
5631
5689
  return true;
@@ -5642,7 +5700,7 @@ function filesMailbox(dir, settings) {
5642
5700
  if (existsSync(inbox))
5643
5701
  for (const key of readdirSync(inbox))
5644
5702
  for (const kind of ["ack", "delivered"])
5645
- rmSync(join18(inbox, key, `${message.id}.${kind}`), { force: true });
5703
+ rmSync(join19(inbox, key, `${message.id}.${kind}`), { force: true });
5646
5704
  audit(event, { id: message.id });
5647
5705
  };
5648
5706
  return {
@@ -5718,9 +5776,9 @@ function filesMailbox(dir, settings) {
5718
5776
  }
5719
5777
 
5720
5778
  // src/sessions/files/pause.ts
5721
- import { join as join19 } from "node:path";
5779
+ import { join as join20 } from "node:path";
5722
5780
  function filesPause(dir) {
5723
- const path = join19(dir, STATE_FILES.pause);
5781
+ const path = join20(dir, STATE_FILES.pause);
5724
5782
  return {
5725
5783
  read: () => asPause(readJson3(path)),
5726
5784
  write(pause2) {
@@ -5738,12 +5796,12 @@ function filesPause(dir) {
5738
5796
  }
5739
5797
 
5740
5798
  // src/sessions/files/registry.ts
5741
- import { join as join20 } from "node:path";
5799
+ import { join as join21 } from "node:path";
5742
5800
  var SESSION_ID = /^[A-Za-z0-9_-]{8,64}$/u;
5743
5801
  function filesRegistry(dir, staleMs) {
5744
- const records = join20(dir, STATE_FILES.records);
5745
- const dirs = [records, join20(dir, STATE_FILES.legacyRecords)];
5746
- const pathsOf = (session) => dirs.map((records2) => join20(records2, `${session}.json`));
5802
+ const records = join21(dir, STATE_FILES.records);
5803
+ const dirs = [records, join21(dir, STATE_FILES.legacyRecords)];
5804
+ const pathsOf = (session) => dirs.map((records2) => join21(records2, `${session}.json`));
5747
5805
  const get = (session) => {
5748
5806
  if (!SESSION_ID.test(session)) return null;
5749
5807
  return latestRecord(
@@ -5762,7 +5820,7 @@ function filesRegistry(dir, staleMs) {
5762
5820
  for (const name of names2)
5763
5821
  found.set(name, [
5764
5822
  ...found.get(name) ?? [],
5765
- asRecord(readJson3(join20(folder, name)))
5823
+ asRecord(readJson3(join21(folder, name)))
5766
5824
  ]);
5767
5825
  }
5768
5826
  return [...found.values()].map(latestRecord).filter((record) => record !== null).map((record) => ({ ...record, live: isLive(record, now, staleMs) }));
@@ -5789,7 +5847,7 @@ function filesRegistry(dir, staleMs) {
5789
5847
  next["worktree"] = checkout?.root ?? "";
5790
5848
  next["branch"] = checkout?.branch ?? "";
5791
5849
  }
5792
- writeJson(join20(records, `${session}.json`), next);
5850
+ writeJson(join21(records, `${session}.json`), next);
5793
5851
  return next;
5794
5852
  },
5795
5853
  sweep(now = Date.now()) {
@@ -5840,19 +5898,19 @@ function createFilesStore(dir, options2 = {}) {
5840
5898
  }
5841
5899
 
5842
5900
  // src/sessions/lease-files.ts
5843
- import { dirname as dirname11, isAbsolute as isAbsolute13, join as join21 } from "node:path";
5901
+ import { dirname as dirname11, isAbsolute as isAbsolute13, join as join22 } from "node:path";
5844
5902
  var GATE_DIR = "${gate_dir}/";
5845
5903
  function gateTree(root, stateDir, gate, env) {
5846
5904
  const override = gate.treeEnv ? env[gate.treeEnv] : void 0;
5847
5905
  if (override) return override;
5848
- return gate.tree ? expandPath(root, gate.tree) : join21(stateDir, "gate", "tree");
5906
+ return gate.tree ? expandPath(root, gate.tree) : join22(stateDir, "gate", "tree");
5849
5907
  }
5850
5908
  function resolveLeaseFiles(files2, gateDir) {
5851
- const resolve20 = (path) => path?.startsWith(GATE_DIR) ? join21(gateDir, path.slice(GATE_DIR.length)) : path;
5909
+ const resolve21 = (path) => path?.startsWith(GATE_DIR) ? join22(gateDir, path.slice(GATE_DIR.length)) : path;
5852
5910
  return Object.fromEntries(
5853
5911
  Object.entries(files2 ?? {}).map(([name, f]) => {
5854
- const file2 = resolve20(f.file);
5855
- const events2 = resolve20(f.events);
5912
+ const file2 = resolve21(f.file);
5913
+ const events2 = resolve21(f.events);
5856
5914
  return [
5857
5915
  name,
5858
5916
  { ...file2 ? { file: file2 } : {}, ...events2 ? { events: events2 } : {} }
@@ -5932,6 +5990,17 @@ async function main(argv, root) {
5932
5990
  log.error("hook failed", {
5933
5991
  error: error instanceof Error ? error.message : String(error)
5934
5992
  });
5993
+ if (error instanceof LockUnreadableError) {
5994
+ try {
5995
+ payload ??= JSON.parse(readStdin() || "{}");
5996
+ const native = adapter.nativeEvent(event);
5997
+ input = native ? adapter.normalize(native, payload, root) : null;
5998
+ } catch {
5999
+ input = null;
6000
+ }
6001
+ writeStdout(lockRepair(adapter, event, root, input, error));
6002
+ return 0;
6003
+ }
5935
6004
  const failure = error instanceof PolicyIntegrityError ? void 0 : compiled?.failure ?? rawFailure(root);
5936
6005
  if (failure) {
5937
6006
  if (!input && payload !== null) {
@@ -5950,10 +6019,10 @@ async function main(argv, root) {
5950
6019
  }
5951
6020
  }
5952
6021
  var self = import.meta.filename;
5953
- if (process.argv[1] && resolve19(process.argv[1]) === self) {
6022
+ if (process.argv[1] && resolve20(process.argv[1]) === self) {
5954
6023
  process.exitCode = await main(
5955
6024
  process.argv.slice(2),
5956
- resolve19(dirname12(self), "../..")
6025
+ resolve20(dirname12(self), "../..")
5957
6026
  );
5958
6027
  }
5959
6028
  export {
@@ -11,8 +11,8 @@ async function run(context) {
11
11
  const [verb = "list", ...extra] = context.args.positional;
12
12
  const usage = "Use hooks list, hooks test or hooks report";
13
13
  if (extra.length) throw new ArgumentError(usage);
14
- if (verb === "list") return (await import("./list-Y6UPLGNF.js")).run(context);
15
- if (verb === "test") return (await import("./test-7NYPQ6YU.js")).run(context);
14
+ if (verb === "list") return (await import("./list-YUHJ5CTT.js")).run(context);
15
+ if (verb === "test") return (await import("./test-VGJXKCQT.js")).run(context);
16
16
  if (verb === "report")
17
17
  return (await import("./report-Z3JV2PCT.js")).run(context);
18
18
  throw new ArgumentError(usage);
@@ -21,4 +21,4 @@ var hooksCommand = { ...hooksSpec, run };
21
21
  export {
22
22
  hooksCommand
23
23
  };
24
- //# sourceMappingURL=hooks-JHXUN5MD.js.map
24
+ //# sourceMappingURL=hooks-HQOLXR3A.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-F5XMGOOX.js";
5
5
  import {
6
6
  specFrom
7
- } from "./chunk-RNC7PGW2.js";
7
+ } from "./chunk-FOIQUPIQ.js";
8
8
  import "./chunk-RPCIROW7.js";
9
9
  import {
10
10
  approvalDir,
@@ -12,19 +12,18 @@ import {
12
12
  hostDigest,
13
13
  projectedFiles,
14
14
  writeApproval
15
- } from "./chunk-5ZUDBC3P.js";
16
- import "./chunk-TCW2H47H.js";
15
+ } from "./chunk-JP27V2H4.js";
16
+ import "./chunk-4Z6NPSWX.js";
17
17
  import "./chunk-UKR64U7J.js";
18
18
  import "./chunk-XZ2TDH3J.js";
19
19
  import "./chunk-KUBHGVTD.js";
20
20
  import "./chunk-EATCUWGG.js";
21
21
  import "./chunk-OFJIMBTL.js";
22
- import "./chunk-NRBQK6UX.js";
23
22
  import "./chunk-LFFIQBNY.js";
24
23
  import "./chunk-HQOB7OQS.js";
25
24
  import "./chunk-73AKO4UL.js";
26
25
  import "./chunk-P6LNYYYH.js";
27
- import "./chunk-GBKRDRMZ.js";
26
+ import "./chunk-NFJ44OE2.js";
28
27
  import "./chunk-2Q6MNGU5.js";
29
28
  import "./chunk-MR5IBS6L.js";
30
29
  import {
@@ -32,17 +31,19 @@ import {
32
31
  } from "./chunk-Z6WRFOFT.js";
33
32
  import "./chunk-G7JONWL4.js";
34
33
  import "./chunk-Q5H3L6Y4.js";
35
- import "./chunk-5YCKFU5Q.js";
34
+ import "./chunk-OMIIXLMO.js";
36
35
  import {
37
36
  ArgumentError
38
37
  } from "./chunk-A4PKLESO.js";
39
38
  import "./chunk-V4NPDK6X.js";
40
39
  import {
41
40
  hostDoctor
42
- } from "./chunk-XB363ZXT.js";
41
+ } from "./chunk-NAXUAC5S.js";
42
+ import "./chunk-NRBQK6UX.js";
43
43
  import "./chunk-OEH47H6A.js";
44
44
  import "./chunk-IJBSOWHK.js";
45
- import "./chunk-L42U5XKC.js";
45
+ import "./chunk-XWLMZKH2.js";
46
+ import "./chunk-FWKQA6TX.js";
46
47
  import "./chunk-GJXOFDJT.js";
47
48
  import "./chunk-PMJG2CXF.js";
48
49
  import "./chunk-J6KL3COD.js";
@@ -182,7 +183,7 @@ async function runHost(context) {
182
183
  return 1;
183
184
  }
184
185
  if (verb === "up" || verb === "down" || verb === "unit") {
185
- const { runHostVerb } = await import("./host-run-H7AITG7C.js");
186
+ const { runHostVerb } = await import("./host-run-CVYRZB7R.js");
186
187
  return runHostVerb(verb, spec, context);
187
188
  }
188
189
  if (verb === "status") {
@@ -210,4 +211,4 @@ async function runHost(context) {
210
211
  export {
211
212
  runHost
212
213
  };
213
- //# sourceMappingURL=host-VI4ZFCZP.js.map
214
+ //# sourceMappingURL=host-4W3JUQAO.js.map
@@ -1,17 +1,19 @@
1
1
  import {
2
2
  requireTerminal,
3
3
  terminalSupport
4
- } from "./chunk-TPGJXENR.js";
4
+ } from "./chunk-U3IHGG7X.js";
5
5
  import "./chunk-5ZABTVSW.js";
6
- import "./chunk-E6YP2PMO.js";
6
+ import "./chunk-BUD3WS4Y.js";
7
7
  import "./chunk-LMT3PPXJ.js";
8
- import "./chunk-SPZ42EWE.js";
8
+ import "./chunk-T6MQPVLH.js";
9
9
  import "./chunk-R2GPCZUX.js";
10
10
  import "./chunk-34DECPVC.js";
11
- import "./chunk-XB363ZXT.js";
11
+ import "./chunk-NAXUAC5S.js";
12
+ import "./chunk-NRBQK6UX.js";
12
13
  import "./chunk-OEH47H6A.js";
13
14
  import "./chunk-IJBSOWHK.js";
14
- import "./chunk-L42U5XKC.js";
15
+ import "./chunk-XWLMZKH2.js";
16
+ import "./chunk-FWKQA6TX.js";
15
17
  import "./chunk-GJXOFDJT.js";
16
18
  import "./chunk-PMJG2CXF.js";
17
19
  import "./chunk-J6KL3COD.js";
@@ -19,4 +21,4 @@ export {
19
21
  requireTerminal,
20
22
  terminalSupport
21
23
  };
22
- //# sourceMappingURL=host-OBRHBDRE.js.map
24
+ //# sourceMappingURL=host-N5UILUK7.js.map
@@ -5,21 +5,23 @@ import {
5
5
  import {
6
6
  approvalDir,
7
7
  approvalState
8
- } from "./chunk-5ZUDBC3P.js";
8
+ } from "./chunk-JP27V2H4.js";
9
9
  import {
10
10
  ArgumentError
11
11
  } from "./chunk-A4PKLESO.js";
12
12
  import {
13
13
  missingBinary,
14
14
  ptyBinary
15
- } from "./chunk-XB363ZXT.js";
15
+ } from "./chunk-NAXUAC5S.js";
16
+ import "./chunk-NRBQK6UX.js";
16
17
  import {
17
18
  projectStateDir
18
19
  } from "./chunk-OEH47H6A.js";
19
20
  import "./chunk-IJBSOWHK.js";
21
+ import "./chunk-XWLMZKH2.js";
20
22
  import {
21
23
  VERSION
22
- } from "./chunk-L42U5XKC.js";
24
+ } from "./chunk-FWKQA6TX.js";
23
25
  import "./chunk-GJXOFDJT.js";
24
26
  import "./chunk-PMJG2CXF.js";
25
27
  import {
@@ -327,4 +329,4 @@ async function runHostVerb(verb, spec, context) {
327
329
  export {
328
330
  runHostVerb
329
331
  };
330
- //# sourceMappingURL=host-run-H7AITG7C.js.map
332
+ //# sourceMappingURL=host-run-CVYRZB7R.js.map
package/dist/http.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-ISZOLR3D.js";
5
5
  import {
6
6
  createSkillServer
7
- } from "./chunk-LVNGMGOM.js";
7
+ } from "./chunk-G25LCRIG.js";
8
8
  import "./chunk-6WXMJOMI.js";
9
9
  import {
10
10
  readCatalog
@@ -6,26 +6,23 @@ import {
6
6
  } from "./chunk-P4N7DBD5.js";
7
7
  import {
8
8
  readMcp
9
- } from "./chunk-TCW2H47H.js";
9
+ } from "./chunk-4Z6NPSWX.js";
10
10
  import "./chunk-UKR64U7J.js";
11
11
  import "./chunk-XZ2TDH3J.js";
12
12
  import "./chunk-KUBHGVTD.js";
13
13
  import "./chunk-EATCUWGG.js";
14
14
  import "./chunk-OFJIMBTL.js";
15
- import {
16
- ProjectError
17
- } from "./chunk-NRBQK6UX.js";
18
15
  import "./chunk-LFFIQBNY.js";
19
16
  import "./chunk-HQOB7OQS.js";
20
17
  import "./chunk-73AKO4UL.js";
21
18
  import "./chunk-P6LNYYYH.js";
22
- import "./chunk-GBKRDRMZ.js";
19
+ import "./chunk-NFJ44OE2.js";
23
20
  import "./chunk-2Q6MNGU5.js";
24
21
  import "./chunk-MR5IBS6L.js";
25
22
  import "./chunk-Z6WRFOFT.js";
26
23
  import "./chunk-G7JONWL4.js";
27
24
  import "./chunk-Q5H3L6Y4.js";
28
- import "./chunk-5YCKFU5Q.js";
25
+ import "./chunk-OMIIXLMO.js";
29
26
  import {
30
27
  ArgumentError,
31
28
  many
@@ -33,10 +30,14 @@ import {
33
30
  import {
34
31
  TOOLS
35
32
  } from "./chunk-V4NPDK6X.js";
36
- import "./chunk-XB363ZXT.js";
33
+ import "./chunk-NAXUAC5S.js";
34
+ import {
35
+ ProjectError
36
+ } from "./chunk-NRBQK6UX.js";
37
37
  import "./chunk-OEH47H6A.js";
38
38
  import "./chunk-IJBSOWHK.js";
39
- import "./chunk-L42U5XKC.js";
39
+ import "./chunk-XWLMZKH2.js";
40
+ import "./chunk-FWKQA6TX.js";
40
41
  import "./chunk-GJXOFDJT.js";
41
42
  import "./chunk-PMJG2CXF.js";
42
43
  import "./chunk-J6KL3COD.js";
@@ -401,4 +402,4 @@ function importMcp(context) {
401
402
  export {
402
403
  importMcp
403
404
  };
404
- //# sourceMappingURL=import-mcp-3Y33CUHF.js.map
405
+ //# sourceMappingURL=import-mcp-IAGC3LJU.js.map
package/dist/index.d.ts CHANGED
@@ -304,7 +304,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
304
304
  } | null;
305
305
 
306
306
  declare const SERVER_NAME = "pmcp";
307
- declare const SERVER_VERSION = "0.22.0";
307
+ declare const SERVER_VERSION = "0.22.2";
308
308
  declare function registerSkillTools(server: McpServer, tools: SkillTools): McpServer;
309
309
  interface SkillMcpOptions extends SkillServerOptions {
310
310
  readonly mailbox?: MailboxService;
package/dist/index.js CHANGED
@@ -4,46 +4,42 @@ import {
4
4
  } from "./chunk-YOWIYFIV.js";
5
5
  import {
6
6
  doctor
7
- } from "./chunk-SEM6WD7J.js";
8
- import "./chunk-5ZUDBC3P.js";
7
+ } from "./chunk-5F7TL3V7.js";
8
+ import "./chunk-JP27V2H4.js";
9
9
  import "./chunk-JQVSDPFL.js";
10
10
  import "./chunk-VJFEN6DJ.js";
11
11
  import "./chunk-NHUMPEPV.js";
12
12
  import "./chunk-TIA4SPU2.js";
13
13
  import {
14
14
  project
15
- } from "./chunk-3LADLKAI.js";
15
+ } from "./chunk-5A7QRZP6.js";
16
16
  import "./chunk-P4N7DBD5.js";
17
17
  import {
18
18
  prepareSearch
19
19
  } from "./chunk-NLHLA2N5.js";
20
20
  import {
21
21
  deadGlobs
22
- } from "./chunk-2QJGUR23.js";
22
+ } from "./chunk-KLWZZTUQ.js";
23
23
  import {
24
24
  plan,
25
25
  readSpec
26
- } from "./chunk-TCW2H47H.js";
26
+ } from "./chunk-4Z6NPSWX.js";
27
27
  import "./chunk-UKR64U7J.js";
28
28
  import "./chunk-XZ2TDH3J.js";
29
29
  import "./chunk-KUBHGVTD.js";
30
30
  import "./chunk-EATCUWGG.js";
31
31
  import "./chunk-OFJIMBTL.js";
32
- import {
33
- ProjectError,
34
- deriveName
35
- } from "./chunk-NRBQK6UX.js";
36
32
  import "./chunk-LFFIQBNY.js";
37
33
  import "./chunk-HQOB7OQS.js";
38
34
  import "./chunk-73AKO4UL.js";
39
35
  import "./chunk-P6LNYYYH.js";
40
- import "./chunk-GBKRDRMZ.js";
36
+ import "./chunk-NFJ44OE2.js";
41
37
  import "./chunk-2Q6MNGU5.js";
42
38
  import "./chunk-MR5IBS6L.js";
43
39
  import "./chunk-Z6WRFOFT.js";
44
40
  import "./chunk-G7JONWL4.js";
45
41
  import "./chunk-Q5H3L6Y4.js";
46
- import "./chunk-5YCKFU5Q.js";
42
+ import "./chunk-OMIIXLMO.js";
47
43
  import {
48
44
  TOOLS
49
45
  } from "./chunk-V4NPDK6X.js";
@@ -86,7 +82,7 @@ import {
86
82
  registerSkillsExtension,
87
83
  resolveSkillFileUri,
88
84
  skillFileUri
89
- } from "./chunk-LVNGMGOM.js";
85
+ } from "./chunk-G25LCRIG.js";
90
86
  import {
91
87
  normaliseIntent
92
88
  } from "./chunk-6WXMJOMI.js";
@@ -121,10 +117,15 @@ import {
121
117
  import "./chunk-6STKGOCW.js";
122
118
  import {
123
119
  LOCK_FILE
124
- } from "./chunk-XB363ZXT.js";
120
+ } from "./chunk-NAXUAC5S.js";
121
+ import {
122
+ ProjectError,
123
+ deriveName
124
+ } from "./chunk-NRBQK6UX.js";
125
125
  import "./chunk-OEH47H6A.js";
126
126
  import "./chunk-IJBSOWHK.js";
127
- import "./chunk-L42U5XKC.js";
127
+ import "./chunk-XWLMZKH2.js";
128
+ import "./chunk-FWKQA6TX.js";
128
129
  import {
129
130
  CONFIG_FILE,
130
131
  ConfigError,
@@ -6,9 +6,9 @@ import "./chunk-XNML2KIC.js";
6
6
  // src/commands/init.ts
7
7
  var initCommand = {
8
8
  ...initSpec,
9
- run: async (context) => (await import("./run-RRWB7U2Q.js")).run(context)
9
+ run: async (context) => (await import("./run-7UNRLLYD.js")).run(context)
10
10
  };
11
11
  export {
12
12
  initCommand
13
13
  };
14
- //# sourceMappingURL=init-WZJHMWNJ.js.map
14
+ //# sourceMappingURL=init-HPEVKKMU.js.map
@@ -1,16 +1,18 @@
1
1
  import {
2
2
  invoke
3
- } from "./chunk-NDED2O5B.js";
3
+ } from "./chunk-SKOP4ZST.js";
4
4
  import "./chunk-DZ2MRTYT.js";
5
- import "./chunk-SLCNCAWY.js";
6
- import "./chunk-SPZ42EWE.js";
5
+ import "./chunk-GE2PHR35.js";
6
+ import "./chunk-T6MQPVLH.js";
7
7
  import "./chunk-R2GPCZUX.js";
8
- import "./chunk-S4Y44CCC.js";
8
+ import "./chunk-D2DDM5VZ.js";
9
9
  import "./chunk-34DECPVC.js";
10
- import "./chunk-XB363ZXT.js";
10
+ import "./chunk-NAXUAC5S.js";
11
+ import "./chunk-NRBQK6UX.js";
11
12
  import "./chunk-OEH47H6A.js";
12
13
  import "./chunk-IJBSOWHK.js";
13
- import "./chunk-L42U5XKC.js";
14
+ import "./chunk-XWLMZKH2.js";
15
+ import "./chunk-FWKQA6TX.js";
14
16
  import "./chunk-GJXOFDJT.js";
15
17
  import "./chunk-PMJG2CXF.js";
16
18
  import "./chunk-ITDJ2EXN.js";
@@ -20,4 +22,4 @@ import "./chunk-J6KL3COD.js";
20
22
  export {
21
23
  invoke
22
24
  };
23
- //# sourceMappingURL=invoke-GWWTXQLO.js.map
25
+ //# sourceMappingURL=invoke-TD5YR2G7.js.map