docdex 0.2.52 → 0.2.53

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.53
4
+ - Add a per-project actual cost savings table to `docdexd delegation savings --all`.
5
+ - Include optional per-project `projects` telemetry entries for `/v1/telemetry/delegation?all=true`, resolving persisted repo telemetry to canonical project paths with live mounted-repo fallback.
6
+
3
7
  ## 0.2.52
4
8
  - Persist delegation savings telemetry across daemon restarts and reinstalls, including packaged daemon-global `--all` totals and repo-scoped counters.
5
9
  - Store daemon-global delegation savings under `~/.docdex/state/telemetry/delegation.json` and repo totals under `~/.docdex/state/repos/<state_key>/delegation_telemetry.json`.
package/assets/agents.md CHANGED
@@ -1,4 +1,4 @@
1
- ---- START OF DOCDEX INFO V0.2.52 ----
1
+ ---- START OF DOCDEX INFO V0.2.53 ----
2
2
  Docdex URL: http://127.0.0.1:28491
3
3
  Use this base URL for Docdex HTTP endpoints.
4
4
  Health check endpoint: `GET /healthz` (not `/v1/health`).
package/lib/uninstall.js CHANGED
@@ -627,15 +627,27 @@ function removeClientConfigs() {
627
627
  }
628
628
  }
629
629
 
630
- function removeDocdexRoot() {
631
- const root = docdexRootPath();
632
- if (!fs.existsSync(root)) return false;
633
- const resolvedRoot = path.resolve(root);
634
- const resolvedHome = path.resolve(os.homedir());
635
- const expectedRoot = path.join(resolvedHome, ".docdex");
630
+ function removeDocdexRootIfEmpty({ fsModule = fs, osModule = os, pathModule = path } = {}) {
631
+ const home = typeof osModule?.homedir === "function" ? osModule.homedir() : os.homedir();
632
+ if (!home) return false;
633
+ const root = pathModule.join(home, ".docdex");
634
+ if (!fsModule.existsSync(root)) return false;
635
+ const resolvedRoot = pathModule.resolve(root);
636
+ const expectedRoot = pathModule.join(pathModule.resolve(home), ".docdex");
636
637
  if (resolvedRoot !== expectedRoot) return false;
638
+ let entries = [];
637
639
  try {
638
- fs.rmSync(resolvedRoot, { recursive: true, force: true });
640
+ entries = fsModule.readdirSync(resolvedRoot);
641
+ } catch {
642
+ return false;
643
+ }
644
+ if (entries.length > 0) return false;
645
+ try {
646
+ if (typeof fsModule.rmdirSync === "function") {
647
+ fsModule.rmdirSync(resolvedRoot);
648
+ } else {
649
+ fsModule.rmSync(resolvedRoot, { recursive: true, force: true });
650
+ }
639
651
  return true;
640
652
  } catch {
641
653
  return false;
@@ -738,7 +750,7 @@ async function main() {
738
750
  removeClientConfigs();
739
751
  clearStartupFailure();
740
752
  removeDaemonRootNotice();
741
- removeDocdexRoot();
753
+ removeDocdexRootIfEmpty();
742
754
  purgeExternalInstalls();
743
755
  }
744
756
 
@@ -753,5 +765,6 @@ module.exports = {
753
765
  stopDaemonFromLock,
754
766
  stopDaemonByName,
755
767
  unregisterStartup,
756
- removeClientConfigs
768
+ removeClientConfigs,
769
+ removeDocdexRootIfEmpty
757
770
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docdex",
3
- "version": "0.2.52",
3
+ "version": "0.2.53",
4
4
  "mcpName": "io.github.bekirdag/docdex",
5
5
  "description": "Local-first documentation and code indexer with HTTP/MCP search, AST, and agent memory.",
6
6
  "bin": {