@posthog/agent 2.3.398 → 2.3.401
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/agent.js +1 -1
- package/dist/agent.js.map +1 -1
- package/dist/handoff-checkpoint.d.ts +1 -0
- package/dist/handoff-checkpoint.js +17 -1
- package/dist/handoff-checkpoint.js.map +1 -1
- package/dist/posthog-api.js +1 -1
- package/dist/posthog-api.js.map +1 -1
- package/dist/server/agent-server.js +146 -99
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +136 -96
- package/dist/server/bin.cjs.map +1 -1
- package/dist/tree-tracker.js +128 -97
- package/dist/tree-tracker.js.map +1 -1
- package/package.json +3 -3
- package/src/handoff-checkpoint.test.ts +1 -0
- package/src/handoff-checkpoint.ts +17 -1
- package/src/sagas/apply-snapshot-saga.test.ts +1 -0
- package/src/sagas/apply-snapshot-saga.ts +68 -54
- package/src/sagas/capture-tree-saga.test.ts +18 -0
- package/src/sagas/capture-tree-saga.ts +64 -49
|
@@ -897,7 +897,14 @@ var require_dist2 = __commonJS({
|
|
|
897
897
|
});
|
|
898
898
|
|
|
899
899
|
// src/handoff-checkpoint.ts
|
|
900
|
-
import {
|
|
900
|
+
import {
|
|
901
|
+
mkdir as mkdir3,
|
|
902
|
+
readdir,
|
|
903
|
+
readFile as readFile2,
|
|
904
|
+
rm as rm3,
|
|
905
|
+
rmdir,
|
|
906
|
+
writeFile
|
|
907
|
+
} from "fs/promises";
|
|
901
908
|
import { join as join2 } from "path";
|
|
902
909
|
|
|
903
910
|
// ../git/dist/handoff.js
|
|
@@ -6519,6 +6526,7 @@ var HandoffCheckpointTracker = class {
|
|
|
6519
6526
|
} finally {
|
|
6520
6527
|
await this.removeIfPresent(packPath);
|
|
6521
6528
|
await this.removeIfPresent(indexPath);
|
|
6529
|
+
await this.removeTmpDirIfEmpty(tmpDir);
|
|
6522
6530
|
}
|
|
6523
6531
|
}
|
|
6524
6532
|
toGitCheckpoint(checkpoint) {
|
|
@@ -6677,6 +6685,14 @@ var HandoffCheckpointTracker = class {
|
|
|
6677
6685
|
await rm3(filePath, { force: true }).catch(() => {
|
|
6678
6686
|
});
|
|
6679
6687
|
}
|
|
6688
|
+
async removeTmpDirIfEmpty(tmpDir) {
|
|
6689
|
+
const entries = await readdir(tmpDir).catch(() => null);
|
|
6690
|
+
if (!entries || entries.length > 0) {
|
|
6691
|
+
return;
|
|
6692
|
+
}
|
|
6693
|
+
await rmdir(tmpDir).catch(() => {
|
|
6694
|
+
});
|
|
6695
|
+
}
|
|
6680
6696
|
};
|
|
6681
6697
|
export {
|
|
6682
6698
|
HandoffCheckpointTracker
|