opencode-codebase-index 0.22.2 → 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.
@@ -10,7 +10,7 @@
10
10
  "name": "codebase-index",
11
11
  "description": "Semantic code search and codebase graph tools for Claude Code",
12
12
  "source": "./",
13
- "version": "0.22.2"
13
+ "version": "0.22.3"
14
14
  }
15
15
  ]
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-index",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "description": "Semantic code search and codebase graph tools for Claude Code",
5
5
  "displayName": "Codebase Index",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-index",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "description": "Semantic code search and codebase graph tools for Codex",
5
5
  "author": {
6
6
  "name": "Kenneth",
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // opencode-codebase-index - Semantic codebase search for OpenCode
2
+ // open-codebase-index - Semantic codebase indexing and search
3
3
  "use strict";
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -19598,6 +19598,8 @@ var GitHeadWatcher = class {
19598
19598
  debounceTimer = null;
19599
19599
  debounceMs = 100;
19600
19600
  // Short debounce for git operations
19601
+ readyPromise = Promise.resolve();
19602
+ resolveReady = null;
19601
19603
  constructor(projectRoot) {
19602
19604
  this.projectRoot = projectRoot;
19603
19605
  }
@@ -19606,8 +19608,12 @@ var GitHeadWatcher = class {
19606
19608
  return;
19607
19609
  }
19608
19610
  if (!isGitRepo(this.projectRoot)) {
19611
+ this.readyPromise = Promise.resolve();
19609
19612
  return;
19610
19613
  }
19614
+ this.readyPromise = new Promise((resolve18) => {
19615
+ this.resolveReady = resolve18;
19616
+ });
19611
19617
  this.onBranchChange = handler;
19612
19618
  this.currentBranch = getCurrentBranch(this.projectRoot);
19613
19619
  const headPath = getHeadPath(this.projectRoot);
@@ -19622,6 +19628,10 @@ var GitHeadWatcher = class {
19622
19628
  });
19623
19629
  this.watcher.on("change", () => this.handleHeadChange());
19624
19630
  this.watcher.on("add", () => this.handleHeadChange());
19631
+ this.watcher.once("ready", () => {
19632
+ this.resolveReady?.();
19633
+ this.resolveReady = null;
19634
+ });
19625
19635
  }
19626
19636
  handleHeadChange() {
19627
19637
  if (this.debounceTimer) {
@@ -19659,10 +19669,16 @@ var GitHeadWatcher = class {
19659
19669
  await watcher.close();
19660
19670
  }
19661
19671
  this.onBranchChange = null;
19672
+ this.resolveReady?.();
19673
+ this.resolveReady = null;
19674
+ this.readyPromise = Promise.resolve();
19662
19675
  }
19663
19676
  isRunning() {
19664
19677
  return this.watcher !== null;
19665
19678
  }
19679
+ async waitUntilReady() {
19680
+ await this.readyPromise;
19681
+ }
19666
19682
  };
19667
19683
 
19668
19684
  // src/watcher/index.ts
@@ -19712,7 +19728,10 @@ function createWatcherWithIndexer(getIndexer, projectRoot, config, host, options
19712
19728
  fileWatcher,
19713
19729
  gitWatcher,
19714
19730
  whenReady() {
19715
- return fileWatcher.waitUntilReady();
19731
+ return Promise.all([
19732
+ fileWatcher.waitUntilReady(),
19733
+ gitWatcher?.waitUntilReady()
19734
+ ]).then(() => void 0);
19716
19735
  },
19717
19736
  async stop() {
19718
19737
  stopped = true;