@modootoday/pmcp 0.30.1 → 0.31.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 (72) 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-P2POBHIU.js → apply-O36MB3Q5.js} +7 -7
  6. package/dist/{chunk-YP55H3V6.js → chunk-2UKP5A7F.js} +3 -3
  7. package/dist/chunk-3QW5KA52.js +7 -0
  8. package/dist/{chunk-ADIAVEVZ.js → chunk-54FOQB2E.js} +2 -2
  9. package/dist/{chunk-MWEE5HCH.js → chunk-5SMF2OKY.js} +2 -2
  10. package/dist/{chunk-NHQ5BWMO.js → chunk-6FOP5S63.js} +4 -4
  11. package/dist/{chunk-RC7JRUM5.js → chunk-KFIKI44F.js} +2 -2
  12. package/dist/{chunk-I5BKHSVY.js → chunk-NPLTVGBP.js} +5 -5
  13. package/dist/{chunk-E5OBYCMP.js → chunk-NZTZHTW3.js} +3 -3
  14. package/dist/{chunk-N5RB4HU6.js → chunk-O7OYOL64.js} +3 -3
  15. package/dist/{chunk-7YBS5S3F.js → chunk-OF42VZRG.js} +2 -2
  16. package/dist/{chunk-LESRSUYY.js → chunk-PTD3YQIT.js} +5 -5
  17. package/dist/{chunk-XMCP4SGT.js → chunk-QEH7WOBC.js} +2 -2
  18. package/dist/{chunk-UCTZ7LB2.js → chunk-RQQHZEVM.js} +2 -2
  19. package/dist/{chunk-CO5DP2RP.js → chunk-RQWJGNS6.js} +2 -2
  20. package/dist/{chunk-EINSPZVE.js → chunk-S6QMSCFS.js} +2 -2
  21. package/dist/{chunk-G5OL7NQS.js → chunk-SLWE4SGW.js} +108 -27
  22. package/dist/{chunk-HV43X72U.js → chunk-V5ZOISWG.js} +2 -2
  23. package/dist/{chunk-5GFNEL6I.js → chunk-VEXPKCAC.js} +12 -12
  24. package/dist/{chunk-4NR6F2G5.js → chunk-VLY6AGVN.js} +2 -2
  25. package/dist/cli.js +3 -3
  26. package/dist/{completion-NLC6EB7Q.js → completion-7QNGLW4X.js} +2 -2
  27. package/dist/{diagnostics-5JG4WLRI.js → diagnostics-4FUIW53N.js} +5 -5
  28. package/dist/{doctor-RLSWHJ2A.js → doctor-3XJJBENL.js} +9 -9
  29. package/dist/{entry-FAVK7RKI.js → entry-E65VAN5N.js} +9 -9
  30. package/dist/{exec-mcp-7RZP3J3L.js → exec-mcp-VYS4FTKF.js} +5 -5
  31. package/dist/{harness-BB6DSAVZ.js → harness-2MCF2ZWN.js} +3 -3
  32. package/dist/harness-launch-gate.js +3 -3
  33. package/dist/harness-worker.js +5 -5
  34. package/dist/hook-body.js +131 -50
  35. package/dist/{hooks-Y22ODBFZ.js → hooks-SEC6WIP5.js} +3 -3
  36. package/dist/{host-5PO6OXNR.js → host-2CKQ6H6W.js} +2 -2
  37. package/dist/{host-HG5BH2G6.js → host-33YTCKQK.js} +7 -7
  38. package/dist/{host-RO54NJCQ.js → host-VPSNIHRO.js} +6 -6
  39. package/dist/{host-run-6NMZUNPQ.js → host-run-AVJRPDL6.js} +4 -4
  40. package/dist/http.js +1 -1
  41. package/dist/{import-mcp-QV3QQA7S.js → import-mcp-NCOFK75O.js} +4 -4
  42. package/dist/index.d.ts +1 -1
  43. package/dist/index.js +8 -8
  44. package/dist/{init-7YCITJBT.js → init-VHCYXPTG.js} +2 -2
  45. package/dist/{invoke-PWCH3QTK.js → invoke-XY5FIQZB.js} +7 -7
  46. package/dist/{list-ZBIXGLKJ.js → list-M6MMCCNY.js} +6 -6
  47. package/dist/{logout-NWOB6FYU.js → logout-WJDFPQCF.js} +5 -5
  48. package/dist/{mcp-6I5I6VGZ.js → mcp-DGNTEMHQ.js} +2 -2
  49. package/dist/{measure-XD5UDZMJ.js → measure-BR6R5ZGJ.js} +2 -2
  50. package/dist/{project-IKIRR3ZN.js → project-UQQLPD4K.js} +4 -4
  51. package/dist/{run-VWETBSCC.js → run-I7425NVX.js} +4 -4
  52. package/dist/{run-U2NQLEEM.js → run-UKTQKE5X.js} +4 -4
  53. package/dist/{serve-EYRBNRYW.js → serve-EAYEISOY.js} +3 -3
  54. package/dist/{start-login-S7TSV6U7.js → start-login-OYS26DEB.js} +5 -5
  55. package/dist/{status-PXSKFHAJ.js → status-K5SO4Q5K.js} +5 -5
  56. package/dist/{status-FL3BR362.js → status-NI4TJ56E.js} +6 -6
  57. package/dist/stdio.js +2 -2
  58. package/dist/{test-PWBXC2D5.js → test-72IQFIXF.js} +5 -5
  59. package/dist/{tui-BNBDMV2M.js → tui-O6AP46M3.js} +4 -4
  60. package/dist/{worker-6OGOG6E4.js → worker-UUYKNLVW.js} +7 -7
  61. package/docs/hooks.md +2 -1
  62. package/docs/project-configuration.md +2 -0
  63. package/gemini-extension.json +2 -2
  64. package/mcp.json +1 -1
  65. package/package.json +5 -5
  66. package/plugin.json +1 -1
  67. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  68. package/plugins/pmcp/.mcp.json +1 -1
  69. package/plugins/pmcp/gemini-extension.json +2 -2
  70. package/plugins/pmcp/mcp.json +1 -1
  71. package/plugins/pmcp/plugin.json +1 -1
  72. package/dist/chunk-YPK3ZMDX.js +0 -7
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  runOperation
3
- } from "./chunk-N5RB4HU6.js";
4
- import "./chunk-XMCP4SGT.js";
3
+ } from "./chunk-O7OYOL64.js";
4
+ import "./chunk-QEH7WOBC.js";
5
5
  import "./chunk-R2GPCZUX.js";
6
- import "./chunk-EINSPZVE.js";
6
+ import "./chunk-S6QMSCFS.js";
7
7
  import "./chunk-34DECPVC.js";
8
- import "./chunk-RC7JRUM5.js";
8
+ import "./chunk-KFIKI44F.js";
9
9
  import "./chunk-LVCASOV4.js";
10
10
  import "./chunk-N7ANFMA5.js";
11
11
  import "./chunk-TYY5TYHF.js";
@@ -14,7 +14,7 @@ import "./chunk-KLIYFD3W.js";
14
14
  import "./chunk-GUHOEIHP.js";
15
15
  import "./chunk-IJBSOWHK.js";
16
16
  import "./chunk-XWLMZKH2.js";
17
- import "./chunk-YPK3ZMDX.js";
17
+ import "./chunk-3QW5KA52.js";
18
18
  import "./chunk-GJXOFDJT.js";
19
19
  import "./chunk-PMJG2CXF.js";
20
20
  import {
package/dist/hook-body.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/hooks/entry.ts
2
- import { dirname as dirname13, resolve as resolve22 } from "node:path";
2
+ import { dirname as dirname13, resolve as resolve23 } from "node:path";
3
3
 
4
4
  // src/hooks/contract.ts
5
5
  var NEUTRAL_EVENTS = [
@@ -1692,7 +1692,7 @@ async function runPolicy(selected, input, deps) {
1692
1692
  }
1693
1693
  }
1694
1694
 
1695
- // src/hooks/policies/git/forced-branch-move.ts
1695
+ // src/hooks/policies/git/discard-work.ts
1696
1696
  import { resolve as resolve5 } from "node:path";
1697
1697
 
1698
1698
  // src/hooks/policies/types.ts
@@ -1715,7 +1715,87 @@ function onlyKeys(raw, keys) {
1715
1715
  if (unknown) throw new Error(`unknown option ${unknown}`);
1716
1716
  }
1717
1717
 
1718
+ // src/hooks/policies/git/discard-work.ts
1719
+ var STASH_READS = /* @__PURE__ */ new Set(["list", "show"]);
1720
+ var STASH_SHARED = ", and the stash is shared by every worktree of this repository";
1721
+ function shortFlag(args, letter) {
1722
+ return args.some((arg) => /^-[a-zA-Z]+$/u.test(arg) && arg.includes(letter));
1723
+ }
1724
+ function checkoutDiscards(args) {
1725
+ if (args.includes("-f") || args.includes("--force")) return true;
1726
+ const paths = args.indexOf("--");
1727
+ if (paths >= 0) return paths < args.length - 1;
1728
+ return args.filter((arg) => !arg.startsWith("-")).includes(".");
1729
+ }
1730
+ function restoreDiscards(args) {
1731
+ const staged = args.includes("--staged") || shortFlag(args, "S");
1732
+ const worktree = args.includes("--worktree") || shortFlag(args, "W");
1733
+ return worktree || !staged;
1734
+ }
1735
+ function discardingCommand(argv) {
1736
+ if (program(argv[0]) !== "git") return null;
1737
+ const call = gitCall(argv);
1738
+ const args = argv.slice(call.at + 1);
1739
+ const named = (command6) => ({ command: command6, dir: call.dir });
1740
+ if (call.sub === "reset" && args.includes("--hard"))
1741
+ return named("git reset --hard");
1742
+ if (call.sub === "checkout" && checkoutDiscards(args))
1743
+ return named("git checkout of paths");
1744
+ if (call.sub === "restore" && restoreDiscards(args))
1745
+ return named("git restore of the working tree");
1746
+ if (call.sub === "clean" && (args.includes("--force") || shortFlag(args, "f")))
1747
+ return named("git clean -f");
1748
+ if (call.sub === "stash" && !STASH_READS.has(call.next))
1749
+ return named("git stash");
1750
+ return null;
1751
+ }
1752
+ function placeOf(git2, sessionCwd, target) {
1753
+ const top = git2.toplevel(target);
1754
+ if (!top) return null;
1755
+ const trees = git2.worktrees(target);
1756
+ if (trees.length < 2) return "own";
1757
+ if (top === trees[0]?.path) return "shared";
1758
+ return top === git2.toplevel(sessionCwd) ? "own" : "other";
1759
+ }
1760
+ var WHERE = {
1761
+ shared: "the shared checkout, which other sessions read and land from",
1762
+ other: "another session's worktree"
1763
+ };
1764
+ var discardWork = {
1765
+ id: "git.discard_work",
1766
+ events: ["before_tool"],
1767
+ tools: ["shell"],
1768
+ fail: "closed",
1769
+ defaultMode: "graded",
1770
+ options: noOptions,
1771
+ evaluate(input, ctx) {
1772
+ const call = shellCall(input);
1773
+ if (!call) return pass;
1774
+ for (const step of realSteps(call.steps)) {
1775
+ const found2 = discardingCommand(step.argv);
1776
+ if (!found2) continue;
1777
+ const target = resolve5(input.cwd, step.dir, found2.dir);
1778
+ const place = placeOf(ctx.git, input.cwd, target);
1779
+ if (!place) continue;
1780
+ if (place === "own") {
1781
+ const shared2 = found2.command === "git stash" ? STASH_SHARED : "";
1782
+ return {
1783
+ context: [
1784
+ `pmcp git.discard_work: ${found2.command} throws away uncommitted work in this worktree; commit it first, or name the paths you mean${shared2}.`
1785
+ ]
1786
+ };
1787
+ }
1788
+ return {
1789
+ verdict: "deny",
1790
+ reason: `${found2.command} in ${WHERE[place]} throws away work that is not yours. Work in your own worktree, or ask its owner.`
1791
+ };
1792
+ }
1793
+ return pass;
1794
+ }
1795
+ };
1796
+
1718
1797
  // src/hooks/policies/git/forced-branch-move.ts
1798
+ import { resolve as resolve6 } from "node:path";
1719
1799
  var FORCE = /* @__PURE__ */ new Set(["-f", "-M", "--force"]);
1720
1800
  function forcedTarget(argv) {
1721
1801
  if (program(argv[0]) !== "git") return null;
@@ -1744,7 +1824,7 @@ var forcedBranchMove = {
1744
1824
  for (const step of realSteps(call.steps)) {
1745
1825
  const target = forcedTarget(step.argv);
1746
1826
  if (!target) continue;
1747
- const cwd = resolve5(input.cwd, step.dir, target.dir);
1827
+ const cwd = resolve6(input.cwd, step.dir, target.dir);
1748
1828
  if (!checkedOutElsewhere(ctx.git, cwd, target.branch)) continue;
1749
1829
  return {
1750
1830
  verdict: "deny",
@@ -1967,7 +2047,7 @@ function stopOptions(raw) {
1967
2047
  }
1968
2048
 
1969
2049
  // src/hooks/checks/validators.ts
1970
- import { dirname as dirname3, isAbsolute as isAbsolute5, relative as relative3, resolve as resolve6, sep } from "node:path";
2050
+ import { dirname as dirname3, isAbsolute as isAbsolute5, relative as relative3, resolve as resolve7, sep } from "node:path";
1971
2051
  function contains(root, target) {
1972
2052
  const rest = relative3(root, target);
1973
2053
  return !isAbsolute5(rest) && rest !== ".." && !rest.startsWith(`..${sep}`);
@@ -1979,14 +2059,14 @@ function owner(validator) {
1979
2059
  }
1980
2060
  function validators(root, pattern, paths) {
1981
2061
  const realRoot = realpathSync(root);
1982
- const edits = paths.map((path) => resolve6(path)).filter((path) => contains(root, path));
2062
+ const edits = paths.map((path) => resolve7(path)).filter((path) => contains(root, path));
1983
2063
  if (edits.length === 0) return [];
1984
2064
  const candidates = [
1985
2065
  ...globSync(pattern, {
1986
2066
  cwd: root,
1987
2067
  exclude: ["**/node_modules/**", "**/.git/**"]
1988
2068
  })
1989
- ].map((path) => resolve6(root, path)).filter((path) => {
2069
+ ].map((path) => resolve7(root, path)).filter((path) => {
1990
2070
  if (!contains(realRoot, realpathSync(path)) || !statSync(path).isFile())
1991
2071
  return false;
1992
2072
  return edits.some((edit) => contains(owner(path), edit));
@@ -2364,7 +2444,7 @@ function noticeOf(fresh, earlier, limit, session, pmcp = "pmcp") {
2364
2444
  }
2365
2445
 
2366
2446
  // src/sessions/mailbox/select.ts
2367
- import { basename as basename2, resolve as resolve7 } from "node:path";
2447
+ import { basename as basename2, resolve as resolve8 } from "node:path";
2368
2448
  var isWorktree = (kind) => kind === "worktree" || kind === "desk";
2369
2449
  function splitSelector(selector) {
2370
2450
  const at = selector.indexOf(":");
@@ -3609,12 +3689,12 @@ function claimantNotice(root, names4) {
3609
3689
  }
3610
3690
 
3611
3691
  // src/hooks/policies/workspace/leftovers.ts
3612
- import { isAbsolute as isAbsolute6, relative as relative5, resolve as resolve8 } from "node:path";
3692
+ import { isAbsolute as isAbsolute6, relative as relative5, resolve as resolve9 } from "node:path";
3613
3693
  var TOUCHED_KEPT = 50;
3614
3694
  function addTouched(touched, root, target) {
3615
3695
  const path = relative5(
3616
3696
  root,
3617
- isAbsolute6(target) ? target : resolve8(root, target)
3697
+ isAbsolute6(target) ? target : resolve9(root, target)
3618
3698
  );
3619
3699
  if (!path || path.startsWith("..") || touched.some((entry) => entry.path === path))
3620
3700
  return [...touched];
@@ -3753,10 +3833,10 @@ var sharedCheckout = {
3753
3833
  };
3754
3834
 
3755
3835
  // src/hooks/policies/workspace/mainline-deliver.ts
3756
- import { resolve as resolve10 } from "node:path";
3836
+ import { resolve as resolve11 } from "node:path";
3757
3837
 
3758
3838
  // src/git/detect.ts
3759
- import { dirname as dirname5, resolve as resolve9 } from "node:path";
3839
+ import { dirname as dirname5, resolve as resolve10 } from "node:path";
3760
3840
 
3761
3841
  // src/git/exec.ts
3762
3842
  var LOCAL_ENV = [
@@ -3847,11 +3927,11 @@ function detect(cwd, prefs = {}) {
3847
3927
  const remote = defaultRemote(root, prefs.remote);
3848
3928
  const mainline = defaultMainline(root, remote, prefs.mainline);
3849
3929
  return {
3850
- root: resolve9(root),
3851
- gitDir: resolve9(gitDir),
3852
- commonDir: resolve9(commonDir),
3853
- mainRoot: dirname5(resolve9(commonDir)),
3854
- linked: resolve9(gitDir) !== resolve9(commonDir),
3930
+ root: resolve10(root),
3931
+ gitDir: resolve10(gitDir),
3932
+ commonDir: resolve10(commonDir),
3933
+ mainRoot: dirname5(resolve10(commonDir)),
3934
+ linked: resolve10(gitDir) !== resolve10(commonDir),
3855
3935
  remote,
3856
3936
  mainline,
3857
3937
  upstream: `${remote}/${mainline}`,
@@ -3961,7 +4041,7 @@ var mainlineDeliver = {
3961
4041
  if (program(step.argv[0]) !== "git") continue;
3962
4042
  const git2 = gitCall(step.argv);
3963
4043
  if (git2.sub !== "push") continue;
3964
- const dir = resolve10(input.cwd, step.dir, git2.dir);
4044
+ const dir = resolve11(input.cwd, step.dir, git2.dir);
3965
4045
  if (!sameRepository(dir, project6.commonDir)) continue;
3966
4046
  if (movesMainline(dir, step.argv.slice(git2.at + 1), ctx.options))
3967
4047
  return {
@@ -3974,7 +4054,7 @@ var mainlineDeliver = {
3974
4054
  };
3975
4055
 
3976
4056
  // src/hooks/policies/workspace/worktree-sync.ts
3977
- import { relative as relative6, resolve as resolve11 } from "node:path";
4057
+ import { relative as relative6, resolve as resolve12 } from "node:path";
3978
4058
 
3979
4059
  // src/git/modes.ts
3980
4060
  import { join as join7 } from "node:path";
@@ -4512,7 +4592,7 @@ function options(raw) {
4512
4592
  function desk(input, opts) {
4513
4593
  const checkout = checkoutOf(input.cwd);
4514
4594
  if (!checkout || checkout.main) return null;
4515
- const desks = resolve11(checkout.commonDir, "..", opts.root);
4595
+ const desks = resolve12(checkout.commonDir, "..", opts.root);
4516
4596
  const inside2 = relative6(desks, checkout.root);
4517
4597
  if (!inside2 || inside2.startsWith("..")) return null;
4518
4598
  return detect(checkout.root, {
@@ -4612,7 +4692,7 @@ var worktreeSync = {
4612
4692
  };
4613
4693
 
4614
4694
  // src/hooks/policies/workspace/owners.ts
4615
- import { isAbsolute as isAbsolute7, relative as relative7, resolve as resolve12 } from "node:path";
4695
+ import { isAbsolute as isAbsolute7, relative as relative7, resolve as resolve13 } from "node:path";
4616
4696
 
4617
4697
  // src/hooks/glob.ts
4618
4698
  function globPattern(glob2, below = true) {
@@ -4681,7 +4761,7 @@ function ownerLine(entry, path) {
4681
4761
  function projectPaths(input) {
4682
4762
  const found2 = [];
4683
4763
  for (const path of input.tool?.paths ?? []) {
4684
- const rest = relative7(input.projectRoot, resolve12(input.cwd, path));
4764
+ const rest = relative7(input.projectRoot, resolve13(input.cwd, path));
4685
4765
  if (rest === "" || rest.startsWith("..") || isAbsolute7(rest)) continue;
4686
4766
  found2.push(rest.split("\\").join("/"));
4687
4767
  }
@@ -4845,7 +4925,7 @@ var operatorVerbs = {
4845
4925
  };
4846
4926
 
4847
4927
  // src/hooks/policies/custom.ts
4848
- import { isAbsolute as isAbsolute8, relative as relative8, resolve as resolve13 } from "node:path";
4928
+ import { isAbsolute as isAbsolute8, relative as relative8, resolve as resolve14 } from "node:path";
4849
4929
  var FAILED = "Guard failed validation or execution";
4850
4930
  var GUARD_PROTOCOL = "pmcp.guard.v1";
4851
4931
  var MAX_FINDINGS = 20;
@@ -4872,12 +4952,12 @@ function guardScript(root, command6) {
4872
4952
  "Hook command must execute a script under .agents/guards/, or name an installed program with version"
4873
4953
  );
4874
4954
  }
4875
- const base = resolve13(root, ".agents/guards");
4876
- if (!inside(base, resolve13(root, script)))
4955
+ const base = resolve14(root, ".agents/guards");
4956
+ if (!inside(base, resolve14(root, script)))
4877
4957
  throw new Error("Hook guard must stay under .agents/guards/");
4878
- if (!existsSync(resolve13(root, script)))
4958
+ if (!existsSync(resolve14(root, script)))
4879
4959
  throw new Error("Hook guard script must exist");
4880
- const real4 = realpathSync(resolve13(root, script));
4960
+ const real4 = realpathSync(resolve14(root, script));
4881
4961
  if (!inside(realpathSync(base), real4))
4882
4962
  throw new Error("Hook guard cannot resolve outside .agents/guards/");
4883
4963
  return real4;
@@ -4938,7 +5018,7 @@ function run2(entry, input, log) {
4938
5018
  };
4939
5019
  }
4940
5020
  const args = entry.command.map(
4941
- (part) => part.startsWith(".agents/guards/") ? resolve13(root, part) : part
5021
+ (part) => part.startsWith(".agents/guards/") ? resolve14(root, part) : part
4942
5022
  );
4943
5023
  const result = spawnSync(args[0], args.slice(1), {
4944
5024
  cwd: root,
@@ -4991,7 +5071,7 @@ function customPolicy(entry) {
4991
5071
  }
4992
5072
 
4993
5073
  // src/hooks/policies/external.ts
4994
- import { isAbsolute as isAbsolute9, relative as relative9, resolve as resolve14 } from "node:path";
5074
+ import { isAbsolute as isAbsolute9, relative as relative9, resolve as resolve15 } from "node:path";
4995
5075
  var MAX_LINES = 20;
4996
5076
  var MAX_REASON2 = 2e3;
4997
5077
  var MAX_OUTPUT = 1 << 20;
@@ -4999,7 +5079,7 @@ function externalId(entry) {
4999
5079
  return `external.${entry.name}`;
5000
5080
  }
5001
5081
  function inProject(input, path) {
5002
- const rest = relative9(input.projectRoot, resolve14(input.cwd, path));
5082
+ const rest = relative9(input.projectRoot, resolve15(input.cwd, path));
5003
5083
  if (rest === "" || rest.startsWith("..") || isAbsolute9(rest)) return null;
5004
5084
  return rest.split("\\").join("/");
5005
5085
  }
@@ -5018,7 +5098,7 @@ function previewText(edit, cwd) {
5018
5098
  if (!edit.replacements) return null;
5019
5099
  let text9;
5020
5100
  try {
5021
- text9 = readFileSync(resolve14(cwd, edit.path), "utf8");
5101
+ text9 = readFileSync(resolve15(cwd, edit.path), "utf8");
5022
5102
  } catch {
5023
5103
  return null;
5024
5104
  }
@@ -5087,7 +5167,7 @@ function bodies(entry, input, paths) {
5087
5167
  continue;
5088
5168
  }
5089
5169
  try {
5090
- found2.set(path, readFileSync(resolve14(input.projectRoot, path), "utf8"));
5170
+ found2.set(path, readFileSync(resolve15(input.projectRoot, path), "utf8"));
5091
5171
  } catch {
5092
5172
  }
5093
5173
  }
@@ -5167,6 +5247,7 @@ var GUARDS = byId([
5167
5247
  selfMatchingWait,
5168
5248
  pushWithoutVerify,
5169
5249
  forcedBranchMove,
5250
+ discardWork,
5170
5251
  gateBypassEnv,
5171
5252
  stageAll,
5172
5253
  operatorVerbs
@@ -5336,7 +5417,7 @@ function verdict(stdout) {
5336
5417
  }
5337
5418
 
5338
5419
  // src/hooks/runtimes/antigravity/payload.ts
5339
- import { isAbsolute as isAbsolute10, resolve as resolve15 } from "node:path";
5420
+ import { isAbsolute as isAbsolute10, resolve as resolve16 } from "node:path";
5340
5421
  function object(value) {
5341
5422
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
5342
5423
  }
@@ -5362,7 +5443,7 @@ function normalize(nativeEvent, payload, projectRoot) {
5362
5443
  const name = text3(call["name"]);
5363
5444
  const kind = name ? toolKind(name) : void 0;
5364
5445
  const target = text3(args["TargetFile"]);
5365
- const paths = target ? [isAbsolute10(target) ? target : resolve15(cwd, target)] : [];
5446
+ const paths = target ? [isAbsolute10(target) ? target : resolve16(cwd, target)] : [];
5366
5447
  return {
5367
5448
  contract: 2,
5368
5449
  runtime: "antigravity",
@@ -5567,7 +5648,7 @@ function verdict2(stdout) {
5567
5648
  }
5568
5649
 
5569
5650
  // src/hooks/runtimes/claude/payload.ts
5570
- import { isAbsolute as isAbsolute11, resolve as resolve16 } from "node:path";
5651
+ import { isAbsolute as isAbsolute11, resolve as resolve17 } from "node:path";
5571
5652
  function object2(value) {
5572
5653
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
5573
5654
  }
@@ -5584,7 +5665,7 @@ function normalize2(nativeEvent, payload, projectRoot) {
5584
5665
  toolInput["file_path"],
5585
5666
  toolInput["notebook_path"],
5586
5667
  kind === "read" ? toolInput["path"] : void 0
5587
- ].filter((value) => typeof value === "string" && !!value).map((path) => isAbsolute11(path) ? path : resolve16(cwd, path));
5668
+ ].filter((value) => typeof value === "string" && !!value).map((path) => isAbsolute11(path) ? path : resolve17(cwd, path));
5588
5669
  const agentType = text4(raw["agent_type"]);
5589
5670
  const turnId = text4(raw["prompt_id"]);
5590
5671
  const lastMessage = text4(raw["last_assistant_message"]);
@@ -5845,7 +5926,7 @@ function verdict3(stdout) {
5845
5926
  }
5846
5927
 
5847
5928
  // src/hooks/runtimes/codex/payload.ts
5848
- import { isAbsolute as isAbsolute12, resolve as resolve17 } from "node:path";
5929
+ import { isAbsolute as isAbsolute12, resolve as resolve18 } from "node:path";
5849
5930
  var PATCH_HEADER = /^\*\*\* (?:Update File|Add File|Delete File|Move to): (.+)$/gmu;
5850
5931
  function object3(value) {
5851
5932
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
@@ -5863,7 +5944,7 @@ function normalize3(nativeEvent, payload, projectRoot) {
5863
5944
  const toolInput = object3(raw["tool_input"]);
5864
5945
  const kind = name ? toolKind3(name) : void 0;
5865
5946
  const body = text5(toolInput["command"]) ?? "";
5866
- const paths = (kind === "edit" ? patchPaths(body) : []).filter(Boolean).map((path) => isAbsolute12(path) ? path : resolve17(cwd, path));
5947
+ const paths = (kind === "edit" ? patchPaths(body) : []).filter(Boolean).map((path) => isAbsolute12(path) ? path : resolve18(cwd, path));
5867
5948
  const turnId = text5(raw["turn_id"]);
5868
5949
  const lastMessage = text5(raw["last_assistant_message"]);
5869
5950
  const prompt = text5(raw["prompt"]);
@@ -6062,7 +6143,7 @@ function verdict4(stdout) {
6062
6143
  }
6063
6144
 
6064
6145
  // src/hooks/runtimes/gemini/payload.ts
6065
- import { isAbsolute as isAbsolute13, resolve as resolve18 } from "node:path";
6146
+ import { isAbsolute as isAbsolute13, resolve as resolve19 } from "node:path";
6066
6147
  function object4(value) {
6067
6148
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
6068
6149
  }
@@ -6075,7 +6156,7 @@ function normalize4(nativeEvent, payload, projectRoot) {
6075
6156
  const name = text6(raw["tool_name"]);
6076
6157
  const input = object4(raw["tool_input"]);
6077
6158
  const kind = name ? toolKind4(name) : void 0;
6078
- const paths = [input["file_path"], input["absolute_path"], input["path"]].filter((value) => typeof value === "string" && !!value).map((path) => isAbsolute13(path) ? path : resolve18(cwd, path));
6159
+ const paths = [input["file_path"], input["absolute_path"], input["path"]].filter((value) => typeof value === "string" && !!value).map((path) => isAbsolute13(path) ? path : resolve19(cwd, path));
6079
6160
  const prompt = text6(raw["prompt"]);
6080
6161
  const lastMessage = text6(raw["prompt_response"]);
6081
6162
  return {
@@ -6261,7 +6342,7 @@ function verdict5(stdout) {
6261
6342
  }
6262
6343
 
6263
6344
  // src/hooks/runtimes/grok/payload.ts
6264
- import { isAbsolute as isAbsolute14, resolve as resolve19 } from "node:path";
6345
+ import { isAbsolute as isAbsolute14, resolve as resolve20 } from "node:path";
6265
6346
  function object5(value) {
6266
6347
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
6267
6348
  }
@@ -6279,7 +6360,7 @@ function normalize5(nativeEvent, payload, projectRoot) {
6279
6360
  const input = object5(raw["toolInput"] ?? raw["tool_input"]);
6280
6361
  const kind = name ? toolKind5(name) : void 0;
6281
6362
  const path = text7(input["file_path"]);
6282
- const paths = path ? [isAbsolute14(path) ? path : resolve19(cwd, path)] : [];
6363
+ const paths = path ? [isAbsolute14(path) ? path : resolve20(cwd, path)] : [];
6283
6364
  const turnId = text7(raw["promptId"]);
6284
6365
  const prompt = text7(raw["prompt"]);
6285
6366
  const lastMessage = text7(raw["lastAssistantMessage"]);
@@ -6461,7 +6542,7 @@ function verdict6(stdout) {
6461
6542
  }
6462
6543
 
6463
6544
  // src/hooks/runtimes/opencode/payload.ts
6464
- import { isAbsolute as isAbsolute15, resolve as resolve20 } from "node:path";
6545
+ import { isAbsolute as isAbsolute15, resolve as resolve21 } from "node:path";
6465
6546
  function object6(value) {
6466
6547
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
6467
6548
  }
@@ -6477,7 +6558,7 @@ function normalize6(nativeEvent, payload, projectRoot) {
6477
6558
  const args = object6(raw["args"] ?? input["args"]);
6478
6559
  const kind = name ? toolKind6(name) : void 0;
6479
6560
  const path = text8(args["filePath"]);
6480
- const paths = path ? [isAbsolute15(path) ? path : resolve20(cwd, path)] : [];
6561
+ const paths = path ? [isAbsolute15(path) ? path : resolve21(cwd, path)] : [];
6481
6562
  const session = text8(input["sessionID"]) ?? text8(properties["sessionID"]) ?? "";
6482
6563
  return {
6483
6564
  contract: 2,
@@ -6842,7 +6923,7 @@ function failClosed(adapter, event, root, error, stated = false) {
6842
6923
  }
6843
6924
 
6844
6925
  // src/hooks/entry/lock-repair.ts
6845
- import { join as join17, resolve as resolve21 } from "node:path";
6926
+ import { join as join17, resolve as resolve22 } from "node:path";
6846
6927
  var REV = /^[\w./~^@{}][\w./~^@{}-]*$/u;
6847
6928
  var LOCK_PATHS = /* @__PURE__ */ new Set([LOCK_FILE, `./${LOCK_FILE}`]);
6848
6929
  var RESTORE_OPTIONS = /* @__PURE__ */ new Set([
@@ -6887,7 +6968,7 @@ function repairsLock(input, root) {
6887
6968
  if (tool.kind === "read") return true;
6888
6969
  if (tool.kind === "edit") {
6889
6970
  const lock = join17(root, LOCK_FILE);
6890
- return tool.paths.length > 0 && tool.paths.every((path) => resolve21(input.cwd, path) === lock);
6971
+ return tool.paths.length > 0 && tool.paths.every((path) => resolve22(input.cwd, path) === lock);
6891
6972
  }
6892
6973
  if (tool.kind === "shell") return restoresLock(tool.command ?? "");
6893
6974
  return false;
@@ -7122,11 +7203,11 @@ function resolvePauseFile(file2, gateDir) {
7122
7203
  return file2 === void 0 ? void 0 : atGateDir(file2, gateDir);
7123
7204
  }
7124
7205
  function resolveLeaseFiles(files2, gateDir) {
7125
- const resolve23 = (path) => path === void 0 ? void 0 : atGateDir(path, gateDir);
7206
+ const resolve24 = (path) => path === void 0 ? void 0 : atGateDir(path, gateDir);
7126
7207
  return Object.fromEntries(
7127
7208
  Object.entries(files2 ?? {}).map(([name, f]) => {
7128
- const file2 = resolve23(f.file);
7129
- const events2 = resolve23(f.events);
7209
+ const file2 = resolve24(f.file);
7210
+ const events2 = resolve24(f.events);
7130
7211
  return [
7131
7212
  name,
7132
7213
  { ...file2 ? { file: file2 } : {}, ...events2 ? { events: events2 } : {} }
@@ -7693,10 +7774,10 @@ async function main(argv, root) {
7693
7774
  }
7694
7775
  }
7695
7776
  var self = import.meta.filename;
7696
- if (process.argv[1] && resolve22(process.argv[1]) === self) {
7777
+ if (process.argv[1] && resolve23(process.argv[1]) === self) {
7697
7778
  process.exitCode = await main(
7698
7779
  process.argv.slice(2),
7699
- resolve22(dirname13(self), "../..")
7780
+ resolve23(dirname13(self), "../..")
7700
7781
  );
7701
7782
  }
7702
7783
  export {
@@ -13,12 +13,12 @@ async function run(context) {
13
13
  const [verb = "list", ...extra] = context.args.positional;
14
14
  if (!VERBS.includes(verb)) throw unknownSubcommand("hooks", verb, VERBS);
15
15
  if (extra.length) throw new ArgumentError(`unexpected ${extra.join(" ")}`);
16
- if (verb === "list") return (await import("./list-ZBIXGLKJ.js")).run(context);
17
- if (verb === "test") return (await import("./test-PWBXC2D5.js")).run(context);
16
+ if (verb === "list") return (await import("./list-M6MMCCNY.js")).run(context);
17
+ if (verb === "test") return (await import("./test-72IQFIXF.js")).run(context);
18
18
  return (await import("./report-MWXB5XKE.js")).run(context);
19
19
  }
20
20
  var hooksCommand = { ...hooksSpec, run };
21
21
  export {
22
22
  hooksCommand
23
23
  };
24
- //# sourceMappingURL=hooks-Y22ODBFZ.js.map
24
+ //# sourceMappingURL=hooks-SEC6WIP5.js.map
@@ -20,7 +20,7 @@ async function run(context) {
20
20
  throw unknownSubcommand("host io", verb, verbs);
21
21
  if (extra !== void 0) throw new ArgumentError(`unexpected ${extra}`);
22
22
  if (verb === "measure")
23
- return (await import("./measure-XD5UDZMJ.js")).ioMeasure(context);
23
+ return (await import("./measure-BR6R5ZGJ.js")).ioMeasure(context);
24
24
  if (verb === "plan")
25
25
  return (await import("./plan-KGGJRUY5.js")).ioPlanCommand(context);
26
26
  return (await import("./doctor-T647TNS5.js")).ioDoctor(context);
@@ -29,4 +29,4 @@ var hostCommand = { ...hostSpec, run };
29
29
  export {
30
30
  hostCommand
31
31
  };
32
- //# sourceMappingURL=host-5PO6OXNR.js.map
32
+ //# sourceMappingURL=host-2CKQ6H6W.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-F5XMGOOX.js";
5
5
  import {
6
6
  specFrom
7
- } from "./chunk-7YBS5S3F.js";
7
+ } from "./chunk-OF42VZRG.js";
8
8
  import "./chunk-7CHUMF3E.js";
9
9
  import {
10
10
  approvalDir,
@@ -12,8 +12,8 @@ import {
12
12
  hostDigest,
13
13
  projectedFiles,
14
14
  writeApproval
15
- } from "./chunk-CO5DP2RP.js";
16
- import "./chunk-G5OL7NQS.js";
15
+ } from "./chunk-RQWJGNS6.js";
16
+ import "./chunk-SLWE4SGW.js";
17
17
  import "./chunk-YEO6I6XN.js";
18
18
  import "./chunk-FLG7VRTC.js";
19
19
  import "./chunk-2GD7PQ7J.js";
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-Y6NFETNG.js";
43
43
  import {
44
44
  hostDoctor
45
- } from "./chunk-RC7JRUM5.js";
45
+ } from "./chunk-KFIKI44F.js";
46
46
  import "./chunk-LVCASOV4.js";
47
47
  import "./chunk-N7ANFMA5.js";
48
48
  import "./chunk-TYY5TYHF.js";
@@ -51,7 +51,7 @@ import "./chunk-KLIYFD3W.js";
51
51
  import "./chunk-GUHOEIHP.js";
52
52
  import "./chunk-IJBSOWHK.js";
53
53
  import "./chunk-XWLMZKH2.js";
54
- import "./chunk-YPK3ZMDX.js";
54
+ import "./chunk-3QW5KA52.js";
55
55
  import "./chunk-GJXOFDJT.js";
56
56
  import "./chunk-PMJG2CXF.js";
57
57
  import "./chunk-J6KL3COD.js";
@@ -145,7 +145,7 @@ async function runHost(context) {
145
145
  return 1;
146
146
  }
147
147
  if (verb === "up" || verb === "down" || verb === "unit") {
148
- const { runHostVerb } = await import("./host-run-6NMZUNPQ.js");
148
+ const { runHostVerb } = await import("./host-run-AVJRPDL6.js");
149
149
  return runHostVerb(verb, spec, context);
150
150
  }
151
151
  if (verb === "status") {
@@ -173,4 +173,4 @@ async function runHost(context) {
173
173
  export {
174
174
  runHost
175
175
  };
176
- //# sourceMappingURL=host-HG5BH2G6.js.map
176
+ //# sourceMappingURL=host-33YTCKQK.js.map
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  requireTerminal,
3
3
  terminalSupport
4
- } from "./chunk-YP55H3V6.js";
4
+ } from "./chunk-2UKP5A7F.js";
5
5
  import "./chunk-5ZABTVSW.js";
6
- import "./chunk-UCTZ7LB2.js";
6
+ import "./chunk-RQQHZEVM.js";
7
7
  import "./chunk-LMT3PPXJ.js";
8
- import "./chunk-XMCP4SGT.js";
8
+ import "./chunk-QEH7WOBC.js";
9
9
  import "./chunk-R2GPCZUX.js";
10
10
  import "./chunk-34DECPVC.js";
11
- import "./chunk-RC7JRUM5.js";
11
+ import "./chunk-KFIKI44F.js";
12
12
  import "./chunk-LVCASOV4.js";
13
13
  import "./chunk-N7ANFMA5.js";
14
14
  import "./chunk-TYY5TYHF.js";
@@ -17,7 +17,7 @@ import "./chunk-KLIYFD3W.js";
17
17
  import "./chunk-GUHOEIHP.js";
18
18
  import "./chunk-IJBSOWHK.js";
19
19
  import "./chunk-XWLMZKH2.js";
20
- import "./chunk-YPK3ZMDX.js";
20
+ import "./chunk-3QW5KA52.js";
21
21
  import "./chunk-GJXOFDJT.js";
22
22
  import "./chunk-PMJG2CXF.js";
23
23
  import "./chunk-J6KL3COD.js";
@@ -25,4 +25,4 @@ export {
25
25
  requireTerminal,
26
26
  terminalSupport
27
27
  };
28
- //# sourceMappingURL=host-RO54NJCQ.js.map
28
+ //# sourceMappingURL=host-VPSNIHRO.js.map
@@ -5,14 +5,14 @@ import {
5
5
  import {
6
6
  approvalDir,
7
7
  approvalState
8
- } from "./chunk-CO5DP2RP.js";
8
+ } from "./chunk-RQWJGNS6.js";
9
9
  import {
10
10
  ArgumentError
11
11
  } from "./chunk-Y6NFETNG.js";
12
12
  import {
13
13
  missingBinary,
14
14
  ptyBinary
15
- } from "./chunk-RC7JRUM5.js";
15
+ } from "./chunk-KFIKI44F.js";
16
16
  import "./chunk-LVCASOV4.js";
17
17
  import "./chunk-N7ANFMA5.js";
18
18
  import "./chunk-TYY5TYHF.js";
@@ -25,7 +25,7 @@ import "./chunk-IJBSOWHK.js";
25
25
  import "./chunk-XWLMZKH2.js";
26
26
  import {
27
27
  VERSION
28
- } from "./chunk-YPK3ZMDX.js";
28
+ } from "./chunk-3QW5KA52.js";
29
29
  import "./chunk-GJXOFDJT.js";
30
30
  import "./chunk-PMJG2CXF.js";
31
31
  import {
@@ -333,4 +333,4 @@ async function runHostVerb(verb, spec, context) {
333
333
  export {
334
334
  runHostVerb
335
335
  };
336
- //# sourceMappingURL=host-run-6NMZUNPQ.js.map
336
+ //# sourceMappingURL=host-run-AVJRPDL6.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-HV43X72U.js";
7
+ } from "./chunk-V5ZOISWG.js";
8
8
  import "./chunk-6WXMJOMI.js";
9
9
  import {
10
10
  readCatalog