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 +4 -0
- package/assets/agents.md +1 -1
- package/lib/uninstall.js +22 -9
- package/package.json +1 -1
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
package/lib/uninstall.js
CHANGED
|
@@ -627,15 +627,27 @@ function removeClientConfigs() {
|
|
|
627
627
|
}
|
|
628
628
|
}
|
|
629
629
|
|
|
630
|
-
function
|
|
631
|
-
const
|
|
632
|
-
if (!
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
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
|
};
|