@modootoday/pmcp 0.25.0 → 0.26.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 (111) 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-IPFJM2KD.js → affected-4FILH743.js} +174 -77
  6. package/dist/{apply-6XLLYLJT.js → apply-7HWNHSQB.js} +17 -15
  7. package/dist/{broadcast-34CEG2NQ.js → broadcast-U7ZYOJWE.js} +4 -4
  8. package/dist/{chunk-2TXVOHRS.js → chunk-2VL3C52Y.js} +4 -4
  9. package/dist/{chunk-UKR64U7J.js → chunk-374AZ4J4.js} +2 -2
  10. package/dist/{chunk-ISWR2XIU.js → chunk-3T7CJS4A.js} +2 -2
  11. package/dist/{chunk-PGZZI42O.js → chunk-5ZP3ABPI.js} +2 -2
  12. package/dist/{chunk-SSQ6EWNA.js → chunk-A7MF7RMO.js} +7 -7
  13. package/dist/{chunk-3P6Y2BAO.js → chunk-BSG74PTY.js} +3 -3
  14. package/dist/{chunk-SRSKCFFS.js → chunk-CJD2HFXF.js} +3 -3
  15. package/dist/chunk-D7IDT7OA.js +21 -0
  16. package/dist/chunk-E272CFPS.js +14 -0
  17. package/dist/{chunk-LZVHFPN6.js → chunk-E7BPELYH.js} +5 -5
  18. package/dist/chunk-EIBKHS74.js +7 -0
  19. package/dist/chunk-FLG7VRTC.js +1 -0
  20. package/dist/{chunk-BG6TONJO.js → chunk-GIK4TROM.js} +2 -2
  21. package/dist/{chunk-ARXCYFFZ.js → chunk-GQRDEIQA.js} +22 -2
  22. package/dist/{chunk-UQHJUTDW.js → chunk-GYL2C2Y5.js} +2 -2
  23. package/dist/{chunk-TOR6SKRB.js → chunk-JDVDA5HW.js} +508 -48
  24. package/dist/chunk-KLIYFD3W.js +32 -0
  25. package/dist/{chunk-5MUD7FHP.js → chunk-KWEW5EBE.js} +2 -2
  26. package/dist/{chunk-PECS47OL.js → chunk-M2XABD33.js} +3 -3
  27. package/dist/{chunk-MBHI2TKQ.js → chunk-MFQAQ4IJ.js} +5 -5
  28. package/dist/{chunk-NAHAESFV.js → chunk-OHCUPXU4.js} +18 -5
  29. package/dist/{chunk-3V37OZQH.js → chunk-PAY6HEEY.js} +2 -2
  30. package/dist/{chunk-DITIXBFB.js → chunk-PZ6D3WKD.js} +65 -1
  31. package/dist/{chunk-QYHM6554.js → chunk-RGTWJWQ7.js} +3 -3
  32. package/dist/{chunk-VYQJPT27.js → chunk-S2FUWBLO.js} +18 -4
  33. package/dist/{chunk-DWHM5BAY.js → chunk-T52AGUO7.js} +2 -2
  34. package/dist/{chunk-OGCJO6HQ.js → chunk-TQRLWO4F.js} +2 -2
  35. package/dist/{chunk-EC5QLEZD.js → chunk-UHKHXS3E.js} +14 -6
  36. package/dist/{chunk-MHKY6TNF.js → chunk-VN34GLGJ.js} +3 -3
  37. package/dist/chunk-WUFNKK3U.js +71 -0
  38. package/dist/chunk-X6W7JIED.js +25 -0
  39. package/dist/{chunk-RF6RDJYH.js → chunk-XPLT6DJC.js} +26 -19
  40. package/dist/{chunk-C3KRMTIZ.js → chunk-YJVSN6UN.js} +2 -2
  41. package/dist/{chunk-EWYLWBKS.js → chunk-YKICVMF7.js} +22 -5
  42. package/dist/{chunk-TJW4DP26.js → chunk-ZT75ACJ2.js} +2 -2
  43. package/dist/{cli-QDQYUHAP.js → cli-FVUHK2NB.js} +6 -6
  44. package/dist/{cli-5G2OYTIL.js → cli-ZOY2274X.js} +8 -8
  45. package/dist/cli.js +9 -14
  46. package/dist/{completion-3GVNPLZY.js → completion-O3KRUSJG.js} +5 -4
  47. package/dist/{diagnostics-2W7QDQNG.js → diagnostics-PB5TKIAL.js} +7 -7
  48. package/dist/{doctor-3TDO5LJ5.js → doctor-JVWINJT5.js} +31 -20
  49. package/dist/{entry-E62DZQJF.js → entry-CY74PLN3.js} +13 -13
  50. package/dist/{exec-mcp-4N7FLY52.js → exec-mcp-HAKUGQZM.js} +14 -12
  51. package/dist/{harness-E2AUZDLV.js → harness-N234LNM7.js} +3 -3
  52. package/dist/harness-launch-gate.js +5 -5
  53. package/dist/harness-worker.js +7 -7
  54. package/dist/{heavy-HZQVFI6P.js → heavy-X3KZ7WBU.js} +186 -99
  55. package/dist/hook-body.js +548 -116
  56. package/dist/{hook-spec-Bd24eo2L.d.ts → hook-spec-u7hnz571.d.ts} +10 -0
  57. package/dist/{hooks-VAEAK2FY.js → hooks-7K624JQC.js} +4 -4
  58. package/dist/{host-I2EMQ7UE.js → host-CCJFOCZJ.js} +16 -14
  59. package/dist/{host-4GJDGTLW.js → host-PT7NRWG6.js} +8 -8
  60. package/dist/{host-run-DDMKD3BU.js → host-run-RRBFTVYW.js} +6 -6
  61. package/dist/http.js +1 -1
  62. package/dist/{import-mcp-TNSAMJXI.js → import-mcp-GCNNSLWH.js} +13 -11
  63. package/dist/index.d.ts +2 -2
  64. package/dist/index.js +17 -15
  65. package/dist/{init-UA7MDNTZ.js → init-A4NLTERR.js} +2 -2
  66. package/dist/{invoke-HW7NBPGP.js → invoke-G4LNWPTL.js} +9 -9
  67. package/dist/{list-A7VQJXE5.js → list-EZYULVDW.js} +16 -14
  68. package/dist/{logout-HNPLUKJY.js → logout-BYO3UJUH.js} +14 -12
  69. package/dist/{logs-2JEMSNSG.js → logs-J4W6GFMK.js} +4 -4
  70. package/dist/{mailbox-MR6TPD3P.js → mailbox-6MHH6CUA.js} +4 -4
  71. package/dist/{mainline-MSLW3UFD.js → mainline-SWZPKA7U.js} +13 -9
  72. package/dist/{mcp-6C23GX2E.js → mcp-CZNYDYTJ.js} +2 -2
  73. package/dist/owners-MPI22SFU.js +63 -0
  74. package/dist/{pause-H6ZYZF7C.js → pause-3IMVYXQQ.js} +4 -4
  75. package/dist/project/hook-adapter.d.ts +1 -1
  76. package/dist/{project-BX6NCGKB.js → project-GLT3SO7Y.js} +4 -4
  77. package/dist/{report-43SFNNCF.js → report-MWXB5XKE.js} +4 -4
  78. package/dist/{resume-2BWGSTCN.js → resume-7LCSV4X3.js} +4 -4
  79. package/dist/{run-2UVAWBAF.js → run-J5O2V3MB.js} +13 -11
  80. package/dist/{run-7TRWZFEZ.js → run-OBQBKBPV.js} +4 -4
  81. package/dist/{serve-4XZ5SKJJ.js → serve-QCG4PCVS.js} +3 -3
  82. package/dist/{setup-GRWLDBVB.js → setup-7JHWLV7K.js} +6 -4
  83. package/dist/{smoke-6X6IXQIQ.js → smoke-GZECLXOJ.js} +3 -3
  84. package/dist/{start-login-AR7ITWNV.js → start-login-LRO3RTHD.js} +14 -12
  85. package/dist/{status-ZY6LDQSF.js → status-BQLT7JRE.js} +14 -12
  86. package/dist/{status-VQCMJFVE.js → status-EZTFSD5S.js} +18 -16
  87. package/dist/{status-2GDYLIR3.js → status-QFMN7IUG.js} +4 -4
  88. package/dist/stdio.js +2 -2
  89. package/dist/{sweep-76BUOGEI.js → sweep-BS7HVSNP.js} +4 -4
  90. package/dist/{test-VWGNFSH5.js → test-O7TN5SBA.js} +25 -15
  91. package/dist/{tui-TUMOQBE7.js → tui-ODLF6QWC.js} +4 -4
  92. package/dist/{unbroadcast-HJHYUHZL.js → unbroadcast-GRGX3F6T.js} +4 -4
  93. package/dist/{worker-NEEPJRVV.js → worker-AK4GLGPZ.js} +11 -11
  94. package/dist/{worktree-sync-MUVKK2CV.js → worktree-sync-BQZD4J73.js} +5 -2
  95. package/docs/commands.md +12 -3
  96. package/docs/git-workflow.md +40 -5
  97. package/docs/hooks.md +69 -14
  98. package/docs/project-configuration.md +63 -4
  99. package/docs/upgrading.md +13 -0
  100. package/gemini-extension.json +2 -2
  101. package/mcp.json +1 -1
  102. package/package.json +5 -5
  103. package/plugin.json +1 -1
  104. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  105. package/plugins/pmcp/.mcp.json +1 -1
  106. package/plugins/pmcp/gemini-extension.json +2 -2
  107. package/plugins/pmcp/mcp.json +1 -1
  108. package/plugins/pmcp/plugin.json +1 -1
  109. package/dist/chunk-7TD53M7L.js +0 -13
  110. package/dist/chunk-FQLCD4HU.js +0 -24
  111. package/dist/chunk-SMBU3QLE.js +0 -7
@@ -0,0 +1,32 @@
1
+ import {
2
+ expandPath
3
+ } from "./chunk-GUHOEIHP.js";
4
+ import {
5
+ gitCommonDir
6
+ } from "./chunk-IJBSOWHK.js";
7
+
8
+ // src/sessions/state-dir.ts
9
+ import { createHash } from "crypto";
10
+ import { realpathSync } from "fs";
11
+ import { homedir } from "os";
12
+ import { join } from "path";
13
+ function stateHome(env) {
14
+ return env["XDG_STATE_HOME"] || join(homedir(), ".local", "state");
15
+ }
16
+ function projectStateId(root) {
17
+ const anchor = gitCommonDir(root) ?? realpathSync(root);
18
+ return createHash("sha256").update(anchor).digest("hex").slice(0, 16);
19
+ }
20
+ function projectStateDir(root, override, env = process.env) {
21
+ if (override) return expandPath(root, override);
22
+ return join(stateHome(env), "pmcp", "projects", projectStateId(root));
23
+ }
24
+ function displacedDir(root, env = process.env) {
25
+ return join(stateHome(env), "pmcp", "displaced", projectStateId(root));
26
+ }
27
+
28
+ export {
29
+ projectStateDir,
30
+ displacedDir
31
+ };
32
+ //# sourceMappingURL=chunk-KLIYFD3W.js.map
@@ -1190,7 +1190,7 @@ function registerReadTool(server, tools) {
1190
1190
 
1191
1191
  // src/mcp.ts
1192
1192
  var SERVER_NAME = "pmcp";
1193
- var SERVER_VERSION = "0.25.0";
1193
+ var SERVER_VERSION = "0.26.1";
1194
1194
  var MAX_TOOL_INPUT_ELEMENTS = 1e4;
1195
1195
  function registerSkillTools(server, tools) {
1196
1196
  registerCatalogTool(server, tools);
@@ -1247,4 +1247,4 @@ export {
1247
1247
  registerSkillTools,
1248
1248
  createSkillServer
1249
1249
  };
1250
- //# sourceMappingURL=chunk-5MUD7FHP.js.map
1250
+ //# sourceMappingURL=chunk-KWEW5EBE.js.map
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-5ZABTVSW.js";
4
4
  import {
5
5
  dependencies
6
- } from "./chunk-PGZZI42O.js";
6
+ } from "./chunk-5ZP3ABPI.js";
7
7
  import {
8
8
  interactiveEntry
9
9
  } from "./chunk-LMT3PPXJ.js";
10
10
  import {
11
11
  assertNativeHost
12
- } from "./chunk-ISWR2XIU.js";
12
+ } from "./chunk-3T7CJS4A.js";
13
13
 
14
14
  // src/tui/startup/host.ts
15
15
  function terminalSupport() {
@@ -42,4 +42,4 @@ export {
42
42
  terminalSupport,
43
43
  requireTerminal
44
44
  };
45
- //# sourceMappingURL=chunk-PECS47OL.js.map
45
+ //# sourceMappingURL=chunk-M2XABD33.js.map
@@ -7,7 +7,7 @@ import {
7
7
  prepare,
8
8
  present,
9
9
  writeNative
10
- } from "./chunk-SRSKCFFS.js";
10
+ } from "./chunk-CJD2HFXF.js";
11
11
  import {
12
12
  ANTIGRAVITY_MCP_PLUGIN,
13
13
  BUNDLE_NATIVE_FILES,
@@ -21,16 +21,16 @@ import {
21
21
  same,
22
22
  splitKeyed,
23
23
  withoutBlock
24
- } from "./chunk-TOR6SKRB.js";
24
+ } from "./chunk-JDVDA5HW.js";
25
25
  import {
26
26
  HOOK_DIRECTORY
27
- } from "./chunk-ARXCYFFZ.js";
27
+ } from "./chunk-GQRDEIQA.js";
28
28
  import {
29
29
  LOCK_FILE,
30
30
  replaceFile,
31
31
  replaceLink,
32
32
  writeLock
33
- } from "./chunk-2TXVOHRS.js";
33
+ } from "./chunk-2VL3C52Y.js";
34
34
  import {
35
35
  RULES_DIR,
36
36
  legacyLinks
@@ -400,4 +400,4 @@ export {
400
400
  unmanagedHooks,
401
401
  describeHookProblem
402
402
  };
403
- //# sourceMappingURL=chunk-MBHI2TKQ.js.map
403
+ //# sourceMappingURL=chunk-MFQAQ4IJ.js.map
@@ -27,10 +27,13 @@ var heavySpec = {
27
27
  },
28
28
  {
29
29
  name: "result",
30
- describe: "The exit code and log of a finished ticket",
31
- usage: "pmcp heavy result <ticket>",
32
- options: ["config", "json"],
33
- examples: ["pmcp heavy result 7f3a"]
30
+ describe: "A job's state and exit code, or with --log its kept output",
31
+ usage: "pmcp heavy result <id> [--log [--tail <n>]] [--json]",
32
+ options: ["log", "tail", "config", "json"],
33
+ examples: [
34
+ "pmcp heavy result 1794239701-482b9b",
35
+ "pmcp heavy result 1794239701-482b9b --log --tail 50"
36
+ ]
34
37
  },
35
38
  {
36
39
  name: "queue",
@@ -115,6 +118,16 @@ var heavySpec = {
115
118
  describe: "stats: only the n commands with the most runs.",
116
119
  placeholder: "<n>"
117
120
  },
121
+ {
122
+ name: "log",
123
+ describe: "result: print the job's kept stdout and stderr instead of its state.",
124
+ boolean: true
125
+ },
126
+ {
127
+ name: "tail",
128
+ describe: "result --log: only the last n lines.",
129
+ placeholder: "<n>"
130
+ },
118
131
  {
119
132
  name: "ticket",
120
133
  describe: "Internal: the submitted ticket this run belongs to.",
@@ -136,4 +149,4 @@ var heavySpec = {
136
149
  export {
137
150
  heavySpec
138
151
  };
139
- //# sourceMappingURL=chunk-NAHAESFV.js.map
152
+ //# sourceMappingURL=chunk-OHCUPXU4.js.map
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-Z6WRFOFT.js";
13
13
  import {
14
14
  projectStateDir
15
- } from "./chunk-FQLCD4HU.js";
15
+ } from "./chunk-KLIYFD3W.js";
16
16
  import {
17
17
  expandPath
18
18
  } from "./chunk-GUHOEIHP.js";
@@ -730,4 +730,4 @@ export {
730
730
  readStoreSettings,
731
731
  openStore
732
732
  };
733
- //# sourceMappingURL=chunk-3V37OZQH.js.map
733
+ //# sourceMappingURL=chunk-PAY6HEEY.js.map
@@ -15,6 +15,59 @@ import {
15
15
  readConfig
16
16
  } from "./chunk-GJXOFDJT.js";
17
17
 
18
+ // src/lease/job-log.ts
19
+ import {
20
+ closeSync,
21
+ existsSync,
22
+ fstatSync,
23
+ openSync,
24
+ readFileSync,
25
+ renameSync,
26
+ writeSync
27
+ } from "fs";
28
+ var DEFAULT_JOB_LOG_BYTES = 4 * 1024 * 1024;
29
+ var JobLog = class {
30
+ constructor(path, cap) {
31
+ this.path = path;
32
+ this.cap = cap;
33
+ this.fd = openSync(path, "a");
34
+ this.size = fstatSync(this.fd).size;
35
+ }
36
+ path;
37
+ cap;
38
+ fd;
39
+ size;
40
+ write(chunk) {
41
+ const bytes = typeof chunk === "string" ? Buffer.from(chunk) : chunk;
42
+ try {
43
+ if (this.size > 0 && this.size + bytes.length > this.cap) {
44
+ closeSync(this.fd);
45
+ renameSync(this.path, `${this.path}.1`);
46
+ this.fd = openSync(this.path, "a");
47
+ this.size = 0;
48
+ }
49
+ const kept = bytes.length > this.cap ? bytes.subarray(bytes.length - this.cap) : bytes;
50
+ writeSync(this.fd, kept);
51
+ this.size += kept.length;
52
+ } catch {
53
+ }
54
+ }
55
+ close() {
56
+ try {
57
+ closeSync(this.fd);
58
+ } catch {
59
+ }
60
+ }
61
+ };
62
+ function readJobLog(path, tail) {
63
+ const parts = [`${path}.1`, path].filter((file) => existsSync(file)).map((file) => readFileSync(file, "utf8"));
64
+ const text = parts.join("");
65
+ if (tail === void 0) return text;
66
+ const lines = text.split("\n");
67
+ if (lines[lines.length - 1] === "") lines.pop();
68
+ return lines.slice(-tail).join("\n") + (lines.length > 0 ? "\n" : "");
69
+ }
70
+
18
71
  // src/lease/config.ts
19
72
  import { availableParallelism } from "os";
20
73
 
@@ -79,6 +132,7 @@ var KEYS = [
79
132
  "guard",
80
133
  "io",
81
134
  "usage_cap",
135
+ "job_log_bytes",
82
136
  "settle_window",
83
137
  "skip_always",
84
138
  "skip_reasons"
@@ -296,6 +350,13 @@ function readLeaseSettings(path, dir, host) {
296
350
  guard: read.oneOf("guard", ["observe", "warn", "deny", "off"], "observe"),
297
351
  io: ioSettings(path, child(path, raw, "host.lease", "io")),
298
352
  usageCap: read.int("usage_cap", 5e6),
353
+ jobLogBytes: whole(
354
+ path,
355
+ "host.lease",
356
+ "job_log_bytes",
357
+ raw["job_log_bytes"],
358
+ DEFAULT_JOB_LOG_BYTES
359
+ ),
299
360
  settleWindow: whole(
300
361
  path,
301
362
  "host.lease",
@@ -313,10 +374,13 @@ function leaseSettingsFor(cwd, configPath) {
313
374
  }
314
375
 
315
376
  export {
377
+ DEFAULT_JOB_LOG_BYTES,
378
+ JobLog,
379
+ readJobLog,
316
380
  DISABLE_ENV,
317
381
  NOW_ENV,
318
382
  BUSY_EXIT,
319
383
  readLeaseSettings,
320
384
  leaseSettingsFor
321
385
  };
322
- //# sourceMappingURL=chunk-DITIXBFB.js.map
386
+ //# sourceMappingURL=chunk-PZ6D3WKD.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  HOST_MANIFEST,
3
3
  HOST_POLICY
4
- } from "./chunk-2TXVOHRS.js";
4
+ } from "./chunk-2VL3C52Y.js";
5
5
  import {
6
6
  projectStateDir
7
- } from "./chunk-FQLCD4HU.js";
7
+ } from "./chunk-KLIYFD3W.js";
8
8
 
9
9
  // src/project/host-approval.ts
10
10
  import { createHash } from "crypto";
@@ -99,4 +99,4 @@ export {
99
99
  hostApprovalDoctor,
100
100
  writeApproval
101
101
  };
102
- //# sourceMappingURL=chunk-QYHM6554.js.map
102
+ //# sourceMappingURL=chunk-RGTWJWQ7.js.map
@@ -16,6 +16,9 @@ import {
16
16
  gitWithInput,
17
17
  runCommand
18
18
  } from "./chunk-23PE3HZB.js";
19
+ import {
20
+ displacedDir
21
+ } from "./chunk-KLIYFD3W.js";
19
22
 
20
23
  // src/git/install.ts
21
24
  import { createHash } from "crypto";
@@ -88,6 +91,7 @@ function installIfStale(root, spec, report) {
88
91
 
89
92
  // src/git/added-submodules.ts
90
93
  import {
94
+ cpSync,
91
95
  existsSync as existsSync2,
92
96
  mkdirSync as mkdirSync2,
93
97
  readdirSync,
@@ -199,11 +203,21 @@ function restoreIgnoreFiles(root, path, from) {
199
203
  return restored;
200
204
  }
201
205
  function displace(root, path) {
202
- const gitDir = gitText(root, ["rev-parse", "--absolute-git-dir"]);
203
206
  const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/gu, "-");
204
- const target = join2(gitDir, "pmcp-displaced", stamp, path);
207
+ const target = join2(displacedDir(root), stamp, path);
205
208
  mkdirSync2(dirname2(target), { recursive: true });
206
- renameSync(join2(root, path), target);
209
+ const source = join2(root, path);
210
+ try {
211
+ renameSync(source, target);
212
+ } catch (error) {
213
+ if (error.code !== "EXDEV") throw error;
214
+ cpSync(source, target, {
215
+ recursive: true,
216
+ verbatimSymlinks: true,
217
+ preserveTimestamps: true
218
+ });
219
+ rmSync(source, { recursive: true, force: true });
220
+ }
207
221
  return target;
208
222
  }
209
223
 
@@ -388,4 +402,4 @@ export {
388
402
  followPins,
389
403
  syncWorktree
390
404
  };
391
- //# sourceMappingURL=chunk-VYQJPT27.js.map
405
+ //# sourceMappingURL=chunk-S2FUWBLO.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-34DECPVC.js";
4
4
  import {
5
5
  ptyBinary
6
- } from "./chunk-2TXVOHRS.js";
6
+ } from "./chunk-2VL3C52Y.js";
7
7
  import {
8
8
  GroupStore,
9
9
  egressPolicy,
@@ -775,4 +775,4 @@ export {
775
775
  prepareBridge,
776
776
  assertBridge
777
777
  };
778
- //# sourceMappingURL=chunk-DWHM5BAY.js.map
778
+ //# sourceMappingURL=chunk-T52AGUO7.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  readFixtures,
6
6
  smoke
7
- } from "./chunk-ARXCYFFZ.js";
7
+ } from "./chunk-GQRDEIQA.js";
8
8
  import {
9
9
  ArgumentError,
10
10
  EXIT,
@@ -51,4 +51,4 @@ export {
51
51
  printSmoke,
52
52
  run
53
53
  };
54
- //# sourceMappingURL=chunk-OGCJO6HQ.js.map
54
+ //# sourceMappingURL=chunk-TQRLWO4F.js.map
@@ -1,14 +1,16 @@
1
1
  import {
2
2
  sourceFor
3
- } from "./chunk-7TD53M7L.js";
3
+ } from "./chunk-E272CFPS.js";
4
4
  import {
5
5
  POLICIES,
6
6
  customMode,
7
- customPolicy
8
- } from "./chunk-TOR6SKRB.js";
7
+ customPolicy,
8
+ externalId,
9
+ externalPolicy
10
+ } from "./chunk-JDVDA5HW.js";
9
11
  import {
10
12
  RUNTIMES
11
- } from "./chunk-ARXCYFFZ.js";
13
+ } from "./chunk-GQRDEIQA.js";
12
14
 
13
15
  // src/hooks/inspection/list.ts
14
16
  function policyRows(compiled) {
@@ -24,7 +26,13 @@ function policyRows(compiled) {
24
26
  options: {},
25
27
  mode: customMode(entry)
26
28
  }));
27
- return [...guards, ...custom].flatMap((entry) => {
29
+ const external = (compiled.external ?? []).map((entry) => ({
30
+ id: externalId(entry),
31
+ policy: externalPolicy(entry),
32
+ options: {},
33
+ mode: entry.mode
34
+ }));
35
+ return [...guards, ...custom, ...external].flatMap((entry) => {
28
36
  const events = entry.policy.eventsFor?.(entry.policy.options(entry.options)) ?? entry.policy.events;
29
37
  return events.filter(
30
38
  (event) => RUNTIMES[runtime].capabilities.events[event] !== "unsupported"
@@ -42,4 +50,4 @@ function policyRows(compiled) {
42
50
  export {
43
51
  policyRows
44
52
  };
45
- //# sourceMappingURL=chunk-EC5QLEZD.js.map
53
+ //# sourceMappingURL=chunk-UHKHXS3E.js.map
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-HQOB7OQS.js";
6
6
  import {
7
7
  readStoreSettings
8
- } from "./chunk-3V37OZQH.js";
8
+ } from "./chunk-PAY6HEEY.js";
9
9
  import {
10
10
  projectStateDir
11
- } from "./chunk-FQLCD4HU.js";
11
+ } from "./chunk-KLIYFD3W.js";
12
12
  import {
13
13
  expandPath
14
14
  } from "./chunk-GUHOEIHP.js";
@@ -154,4 +154,4 @@ export {
154
154
  tail,
155
155
  logLocation
156
156
  };
157
- //# sourceMappingURL=chunk-MHKY6TNF.js.map
157
+ //# sourceMappingURL=chunk-VN34GLGJ.js.map
@@ -0,0 +1,71 @@
1
+ import {
2
+ globPattern
3
+ } from "./chunk-374AZ4J4.js";
4
+
5
+ // src/hooks/owners.ts
6
+ var FIELDS = ["paths", "owner", "note", "mode"];
7
+ function readEntry(value, at) {
8
+ const where = `[[owners]] entry ${at + 1}`;
9
+ if (!value || typeof value !== "object" || Array.isArray(value))
10
+ throw new Error(`${where} must be a table`);
11
+ const entry = value;
12
+ const unknown = Object.keys(entry).find((key) => !FIELDS.includes(key));
13
+ if (unknown) throw new Error(`${where}: unknown key ${unknown}`);
14
+ const paths = entry["paths"];
15
+ if (!Array.isArray(paths) || paths.length === 0 || !paths.every(
16
+ (glob) => typeof glob === "string" && glob !== "" && !glob.startsWith("/") && !glob.split("/").includes("..")
17
+ ))
18
+ throw new Error(
19
+ `${where}: paths must be a nonempty list of globs inside the project`
20
+ );
21
+ const owner = entry["owner"];
22
+ if (typeof owner !== "string" || owner.trim() === "")
23
+ throw new Error(`${where}: owner must be a name`);
24
+ const note = entry["note"];
25
+ if (note !== void 0 && typeof note !== "string")
26
+ throw new Error(`${where}: note must be a string`);
27
+ const mode = entry["mode"] ?? "warn";
28
+ if (mode !== "warn" && mode !== "observe")
29
+ throw new Error(`${where}: mode must be warn or observe`);
30
+ return {
31
+ paths,
32
+ owner,
33
+ ...note !== void 0 && note !== "" ? { note } : {},
34
+ mode
35
+ };
36
+ }
37
+ function readOwners(value) {
38
+ if (value === void 0) return [];
39
+ if (!Array.isArray(value))
40
+ throw new Error("[[owners]] must be an array of tables");
41
+ return value.map(readEntry);
42
+ }
43
+ function ownersOf(entries, path) {
44
+ return entries.filter(
45
+ (entry) => entry.paths.some((glob) => globPattern(glob).test(path))
46
+ );
47
+ }
48
+ function ownerLine(entry, path) {
49
+ return `${path} belongs to ${entry.owner}${entry.note ? `: ${entry.note}` : ""}`;
50
+ }
51
+ function ownerNotices(entries, paths) {
52
+ const hits = /* @__PURE__ */ new Map();
53
+ for (const path of paths)
54
+ for (const entry of ownersOf(entries, path)) {
55
+ if (entry.mode !== "warn") continue;
56
+ hits.set(entry, [...hits.get(entry) ?? [], path]);
57
+ }
58
+ return [...hits].map(([entry, matched]) => {
59
+ const sorted = [...matched].sort();
60
+ const more = sorted.length > 1 ? ` (and ${sorted.length - 1} more)` : "";
61
+ return `${ownerLine(entry, sorted[0])}${more}`;
62
+ });
63
+ }
64
+
65
+ export {
66
+ readOwners,
67
+ ownersOf,
68
+ ownerLine,
69
+ ownerNotices
70
+ };
71
+ //# sourceMappingURL=chunk-WUFNKK3U.js.map
@@ -0,0 +1,25 @@
1
+ // src/cli/pipe.ts
2
+ var holders = 0;
3
+ function holdOnClosedPipe() {
4
+ holders += 1;
5
+ let released = false;
6
+ return () => {
7
+ if (released) return;
8
+ released = true;
9
+ holders -= 1;
10
+ };
11
+ }
12
+ function endQuietlyOnClosedPipe(streams, exit = (code) => process.exit(code)) {
13
+ for (const stream of streams)
14
+ stream.on("error", (error) => {
15
+ if (error.code !== "EPIPE") throw error;
16
+ if (holders > 0) return;
17
+ exit(0);
18
+ });
19
+ }
20
+
21
+ export {
22
+ holdOnClosedPipe,
23
+ endQuietlyOnClosedPipe
24
+ };
25
+ //# sourceMappingURL=chunk-X6W7JIED.js.map
@@ -1,10 +1,10 @@
1
+ import {
2
+ marketplaceSpec
3
+ } from "./chunk-JANBBPKP.js";
1
4
  import {
2
5
  harnessSpec,
3
6
  tuiSpec
4
7
  } from "./chunk-QR6A3TYP.js";
5
- import {
6
- marketplaceSpec
7
- } from "./chunk-JANBBPKP.js";
8
8
  import {
9
9
  mcpSpec
10
10
  } from "./chunk-UVTGY2R3.js";
@@ -16,10 +16,13 @@ import {
16
16
  } from "./chunk-4VVQLWTS.js";
17
17
  import {
18
18
  heavySpec
19
- } from "./chunk-NAHAESFV.js";
19
+ } from "./chunk-OHCUPXU4.js";
20
20
  import {
21
21
  waitSpec
22
22
  } from "./chunk-F3R5HEUB.js";
23
+ import {
24
+ ownersSpec
25
+ } from "./chunk-D7IDT7OA.js";
23
26
  import {
24
27
  sessionsSpec
25
28
  } from "./chunk-A4P3IIPE.js";
@@ -71,11 +74,11 @@ var completionSpec = {
71
74
  var COMMANDS = [
72
75
  {
73
76
  ...statusSpec,
74
- load: async () => (await import("./status-VQCMJFVE.js")).statusCommand
77
+ load: async () => (await import("./status-EZTFSD5S.js")).statusCommand
75
78
  },
76
- { ...initSpec, load: async () => (await import("./init-UA7MDNTZ.js")).initCommand },
77
- { ...hooksSpec, load: async () => (await import("./hooks-VAEAK2FY.js")).hooksCommand },
78
- { ...serveSpec, load: async () => (await import("./serve-4XZ5SKJJ.js")).serveCommand },
79
+ { ...initSpec, load: async () => (await import("./init-A4NLTERR.js")).initCommand },
80
+ { ...hooksSpec, load: async () => (await import("./hooks-7K624JQC.js")).hooksCommand },
81
+ { ...serveSpec, load: async () => (await import("./serve-QCG4PCVS.js")).serveCommand },
79
82
  { ...listSpec, load: async () => (await import("./list-LV5EKCF6.js")).listCommand },
80
83
  {
81
84
  ...indexSpec,
@@ -112,24 +115,28 @@ var COMMANDS = [
112
115
  { ...syncSpec, load: async () => (await import("./install-5JH4DSFF.js")).syncCommand },
113
116
  {
114
117
  ...projectSpec,
115
- load: async () => (await import("./project-BX6NCGKB.js")).projectCommand
118
+ load: async () => (await import("./project-GLT3SO7Y.js")).projectCommand
116
119
  },
117
120
  {
118
121
  ...doctorSpec,
119
- load: async () => (await import("./doctor-3TDO5LJ5.js")).doctorCommand
122
+ load: async () => (await import("./doctor-JVWINJT5.js")).doctorCommand
120
123
  },
121
124
  {
122
125
  ...sessionsSpec,
123
- load: async () => (await import("./cli-5G2OYTIL.js")).sessionsCommand
126
+ load: async () => (await import("./cli-ZOY2274X.js")).sessionsCommand
124
127
  },
125
- { ...logsSpec, load: async () => (await import("./logs-2JEMSNSG.js")).logsCommand },
126
- { ...gitSpec, load: async () => (await import("./cli-QDQYUHAP.js")).gitCommand },
128
+ { ...logsSpec, load: async () => (await import("./logs-J4W6GFMK.js")).logsCommand },
129
+ { ...gitSpec, load: async () => (await import("./cli-FVUHK2NB.js")).gitCommand },
127
130
  {
128
131
  ...heavySpec,
129
- load: async () => (await import("./heavy-HZQVFI6P.js")).heavyCommand
132
+ load: async () => (await import("./heavy-X3KZ7WBU.js")).heavyCommand
130
133
  },
131
134
  { ...waitSpec, load: async () => (await import("./wait-HEODT7KV.js")).waitCommand },
132
- { ...mcpSpec, load: async () => (await import("./mcp-6C23GX2E.js")).mcpCommand },
135
+ {
136
+ ...ownersSpec,
137
+ load: async () => (await import("./owners-MPI22SFU.js")).ownersCommand
138
+ },
139
+ { ...mcpSpec, load: async () => (await import("./mcp-CZNYDYTJ.js")).mcpCommand },
133
140
  {
134
141
  ...validateSpec,
135
142
  load: async () => (await import("./validate-YXR7FJJX.js")).validateCommand
@@ -140,16 +147,16 @@ var COMMANDS = [
140
147
  },
141
148
  {
142
149
  ...harnessSpec,
143
- load: async () => (await import("./harness-E2AUZDLV.js")).harnessCommand
150
+ load: async () => (await import("./harness-N234LNM7.js")).harnessCommand
144
151
  },
145
- { ...tuiSpec, load: async () => (await import("./tui-TUMOQBE7.js")).tuiCommand },
152
+ { ...tuiSpec, load: async () => (await import("./tui-ODLF6QWC.js")).tuiCommand },
146
153
  {
147
154
  ...marketplaceSpec,
148
155
  load: async () => (await import("./marketplace-2X3OOEPW.js")).marketplaceCommand
149
156
  },
150
157
  {
151
158
  ...completionSpec,
152
- load: async () => (await import("./completion-3GVNPLZY.js")).completionCommand
159
+ load: async () => (await import("./completion-O3KRUSJG.js")).completionCommand
153
160
  }
154
161
  ];
155
162
  var PLANNED = [];
@@ -163,4 +170,4 @@ export {
163
170
  PLANNED,
164
171
  commandNamed
165
172
  };
166
- //# sourceMappingURL=chunk-RF6RDJYH.js.map
173
+ //# sourceMappingURL=chunk-XPLT6DJC.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  openStore,
10
10
  readStoreSettings
11
- } from "./chunk-3V37OZQH.js";
11
+ } from "./chunk-PAY6HEEY.js";
12
12
  import {
13
13
  ancestors
14
14
  } from "./chunk-Z6WRFOFT.js";
@@ -98,4 +98,4 @@ export {
98
98
  storeFrom,
99
99
  change
100
100
  };
101
- //# sourceMappingURL=chunk-C3KRMTIZ.js.map
101
+ //# sourceMappingURL=chunk-YJVSN6UN.js.map