opencode-codebase-index 0.22.1 → 0.22.3

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // opencode-codebase-index - Semantic codebase search for OpenCode
1
+ // open-codebase-index - Semantic codebase indexing and search
2
2
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
3
3
  var __create = Object.create;
4
4
  var __defProp = Object.defineProperty;
@@ -7059,7 +7059,7 @@ var identity_catalog_default = {
7059
7059
  current: {
7060
7060
  productName: "opencode-codebase-index",
7061
7061
  packageName: "opencode-codebase-index",
7062
- repository: "https://github.com/Helweg/opencode-codebase-index",
7062
+ repository: "https://github.com/Helweg/open-codebase-index",
7063
7063
  mcpBinary: "opencode-codebase-index-mcp",
7064
7064
  mcpServerName: "opencode-codebase-index"
7065
7065
  },
@@ -16780,6 +16780,8 @@ var GitHeadWatcher = class {
16780
16780
  debounceTimer = null;
16781
16781
  debounceMs = 100;
16782
16782
  // Short debounce for git operations
16783
+ readyPromise = Promise.resolve();
16784
+ resolveReady = null;
16783
16785
  constructor(projectRoot) {
16784
16786
  this.projectRoot = projectRoot;
16785
16787
  }
@@ -16788,8 +16790,12 @@ var GitHeadWatcher = class {
16788
16790
  return;
16789
16791
  }
16790
16792
  if (!isGitRepo(this.projectRoot)) {
16793
+ this.readyPromise = Promise.resolve();
16791
16794
  return;
16792
16795
  }
16796
+ this.readyPromise = new Promise((resolve15) => {
16797
+ this.resolveReady = resolve15;
16798
+ });
16793
16799
  this.onBranchChange = handler;
16794
16800
  this.currentBranch = getCurrentBranch(this.projectRoot);
16795
16801
  const headPath = getHeadPath(this.projectRoot);
@@ -16804,6 +16810,10 @@ var GitHeadWatcher = class {
16804
16810
  });
16805
16811
  this.watcher.on("change", () => this.handleHeadChange());
16806
16812
  this.watcher.on("add", () => this.handleHeadChange());
16813
+ this.watcher.once("ready", () => {
16814
+ this.resolveReady?.();
16815
+ this.resolveReady = null;
16816
+ });
16807
16817
  }
16808
16818
  handleHeadChange() {
16809
16819
  if (this.debounceTimer) {
@@ -16841,10 +16851,16 @@ var GitHeadWatcher = class {
16841
16851
  await watcher.close();
16842
16852
  }
16843
16853
  this.onBranchChange = null;
16854
+ this.resolveReady?.();
16855
+ this.resolveReady = null;
16856
+ this.readyPromise = Promise.resolve();
16844
16857
  }
16845
16858
  isRunning() {
16846
16859
  return this.watcher !== null;
16847
16860
  }
16861
+ async waitUntilReady() {
16862
+ await this.readyPromise;
16863
+ }
16848
16864
  };
16849
16865
 
16850
16866
  // src/watcher/index.ts
@@ -16894,7 +16910,10 @@ function createWatcherWithIndexer(getIndexer, projectRoot, config, host, options
16894
16910
  fileWatcher,
16895
16911
  gitWatcher,
16896
16912
  whenReady() {
16897
- return fileWatcher.waitUntilReady();
16913
+ return Promise.all([
16914
+ fileWatcher.waitUntilReady(),
16915
+ gitWatcher?.waitUntilReady()
16916
+ ]).then(() => void 0);
16898
16917
  },
16899
16918
  async stop() {
16900
16919
  stopped = true;