@zebeqo/vendy 0.1.3 → 0.1.4

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 (2) hide show
  1. package/dist/main.mjs +24 -6
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -32609,6 +32609,21 @@ const isReference = (value) => /(?:^|[\s"'/\\])vendy-[a-z]+-gate\.mjs(?:$|[\s"']
32609
32609
  const mayReference = (text) => /vendy-[a-z]+-gate\.mjs/.test(text);
32610
32610
  const gateDenyReason = "Blocked: check the vendored catalog before editing. If a use governs this file, read its evidence, then retry the edit.";
32611
32611
  const runnerText = `// How vendy is found and recognised; see HookRunner in @vendy/core.
32612
+ function findProjectRoot(dir, manifestFileName, io) {
32613
+ let candidate = dir;
32614
+ let previous;
32615
+ while (candidate !== previous) {
32616
+ if (
32617
+ io.existsSync(io.join(candidate, ".git")) ||
32618
+ io.existsSync(io.join(candidate, manifestFileName))
32619
+ )
32620
+ return candidate;
32621
+ previous = candidate;
32622
+ candidate = io.dirname(candidate);
32623
+ }
32624
+ return undefined;
32625
+ }
32626
+
32612
32627
  function findLocalCli(root, packageName, executable, io) {
32613
32628
  let dir = root;
32614
32629
  let previous;
@@ -32696,6 +32711,7 @@ ${[
32696
32711
  constant("AGENT", JSON.stringify(agent)),
32697
32712
  constant("PACKAGE_NAME", JSON.stringify(packageName$1)),
32698
32713
  constant("EXECUTABLE", JSON.stringify(executable)),
32714
+ constant("MANIFEST_FILE_NAME", JSON.stringify(manifestFileName)),
32699
32715
  constant("CATALOG_EVENTS", `new Set(${stringArray(catalogEvents)})`),
32700
32716
  constant("EDIT_TOOLS", `new Set(${stringArray([...editTools].sort())})`),
32701
32717
  constant("GATE_DENY_REASON", JSON.stringify(gateDenyReason)),
@@ -32715,11 +32731,12 @@ function main() {
32715
32731
  const event = parseEvent(input);
32716
32732
  if (AGENT !== "cursor" && typeof event.cursor_version === "string") return;
32717
32733
  const name = event.hook_event_name ?? event.hookEventName;
32718
- const stateFile = stateFileFor(event);
32734
+ const root = rootFor(event);
32735
+ const stateFile = stateFileFor(root, event);
32719
32736
 
32720
32737
  if (CATALOG_EVENTS.has(name)) {
32721
32738
  observe(stateFile, "catalog");
32722
- const output = readCatalog(rootFor(event), name, input);
32739
+ const output = readCatalog(root, name, input);
32723
32740
  if (output) process.stdout.write(output);
32724
32741
  return;
32725
32742
  }
@@ -32749,7 +32766,8 @@ function parseEvent(input) {
32749
32766
  }
32750
32767
 
32751
32768
  function rootFor(event) {
32752
- return typeof event.cwd === "string" && event.cwd ? event.cwd : process.cwd();
32769
+ const cwd = typeof event.cwd === "string" && event.cwd ? event.cwd : process.cwd();
32770
+ return findProjectRoot(cwd, MANIFEST_FILE_NAME, io) ?? cwd;
32753
32771
  }
32754
32772
 
32755
32773
  function readCatalog(root, name, input) {
@@ -32786,10 +32804,10 @@ function isCatalogCommand(event) {
32786
32804
  }
32787
32805
  }
32788
32806
 
32789
- function stateFileFor(event) {
32807
+ function stateFileFor(root, event) {
32790
32808
  const session = typeof event.session_id === "string" ? event.session_id : "unknown";
32791
32809
  const key = createHash("sha256")
32792
- .update(AGENT + "\\0" + rootFor(event) + "\\0" + session)
32810
+ .update(AGENT + "\\0" + root + "\\0" + session)
32793
32811
  .digest("hex");
32794
32812
  return join(tmpdir(), "vendy-hooks", key + ".jsonl");
32795
32813
  }
@@ -46212,7 +46230,7 @@ const withGitSeparator = (args) => {
46212
46230
  const run = (args, config) => runWith(vendy, config)(withGitSeparator(args)).pipe(provideService(Blocking, (description) => error(`waiting for file lock on ${description}`)), provideService(runner, invocation(process.cwd())), provideService(CliConfig, cliConfig), provideService(Formatter, formatter));
46213
46231
  //#endregion
46214
46232
  //#region src/main.ts
46215
- const version = "0.1.3";
46233
+ const version = "0.1.4";
46216
46234
  const isSqliteExperimentalWarning = (warning) => warning.name === "ExperimentalWarning" && warning.message.startsWith("SQLite ");
46217
46235
  for (const printWarning of process.listeners("warning")) {
46218
46236
  process.off("warning", printWarning);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zebeqo/vendy",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Let your coding agent choose, build with, and maintain vendored repos, and keep your code in step as upstream moves",
5
5
  "license": "MIT",
6
6
  "repository": {