@druumen/sessions-db 0.1.0
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 +249 -0
- package/LICENSE +201 -0
- package/NOTICE +10 -0
- package/README.md +250 -0
- package/cli/_write-helpers.mjs +99 -0
- package/cli/alias.mjs +115 -0
- package/cli/argparse.mjs +296 -0
- package/cli/close.mjs +116 -0
- package/cli/find.mjs +185 -0
- package/cli/format.mjs +277 -0
- package/cli/link-parent.mjs +133 -0
- package/cli/link.mjs +132 -0
- package/cli/rebuild.mjs +98 -0
- package/cli/sessions-db-session-start-main.mjs +454 -0
- package/cli/sessions-db-session-start.mjs +56 -0
- package/cli/sessions-db.mjs +119 -0
- package/cli/sweep.mjs +171 -0
- package/cli/tree.mjs +127 -0
- package/lib/git-context.mjs +479 -0
- package/lib/identity.mjs +616 -0
- package/lib/index.mjs +145 -0
- package/lib/init.mjs +185 -0
- package/lib/lock.mjs +86 -0
- package/lib/operations.mjs +490 -0
- package/lib/paths.mjs +199 -0
- package/lib/projection.mjs +496 -0
- package/lib/sanitize.mjs +131 -0
- package/lib/storage.mjs +759 -0
- package/lib/sweep.mjs +209 -0
- package/lib/transcript.mjs +230 -0
- package/lib/types.mjs +276 -0
- package/lib/uuid.mjs +116 -0
- package/lib/watch.mjs +217 -0
- package/package.json +53 -0
- package/types/git-context.d.mts +98 -0
- package/types/identity.d.mts +658 -0
- package/types/index.d.mts +10 -0
- package/types/index.d.ts +127 -0
- package/types/init.d.mts +53 -0
- package/types/lock.d.mts +18 -0
- package/types/operations.d.mts +204 -0
- package/types/paths.d.mts +54 -0
- package/types/projection.d.mts +79 -0
- package/types/sanitize.d.mts +39 -0
- package/types/storage.d.mts +276 -0
- package/types/sweep.d.mts +58 -0
- package/types/transcript.d.mts +59 -0
- package/types/types.d.mts +255 -0
- package/types/uuid.d.mts +17 -0
- package/types/watch.d.mts +33 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Watch the projection file at `rootPath` and invoke `listener` on change.
|
|
3
|
+
*
|
|
4
|
+
* Path resolution (Day 4 — symmetric with storage.mjs):
|
|
5
|
+
*
|
|
6
|
+
* - If `opts.paths.projectionJson` is provided, that's the file watched
|
|
7
|
+
* (anchored on `rootPath` if relative). Backward-compat with Day 1-3.
|
|
8
|
+
*
|
|
9
|
+
* - Otherwise `rootPath` is treated as a Day 4 storage root and we
|
|
10
|
+
* delegate to `resolveStoragePaths({ rootPath })` so the canonical
|
|
11
|
+
* filename + cross-platform path normalization apply uniformly.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} rootPath
|
|
14
|
+
* @param {(event: { type: 'change' | 'rename' | 'poll', path: string }) => void} listener
|
|
15
|
+
* @param {{
|
|
16
|
+
* paths?: { projectionJson?: string },
|
|
17
|
+
* pollIntervalMs?: number,
|
|
18
|
+
* debounceMs?: number,
|
|
19
|
+
* }} [opts]
|
|
20
|
+
* @returns {{ dispose: () => void }}
|
|
21
|
+
*/
|
|
22
|
+
export function watchProjection(rootPath: string, listener: (event: {
|
|
23
|
+
type: "change" | "rename" | "poll";
|
|
24
|
+
path: string;
|
|
25
|
+
}) => void, opts?: {
|
|
26
|
+
paths?: {
|
|
27
|
+
projectionJson?: string;
|
|
28
|
+
};
|
|
29
|
+
pollIntervalMs?: number;
|
|
30
|
+
debounceMs?: number;
|
|
31
|
+
}): {
|
|
32
|
+
dispose: () => void;
|
|
33
|
+
};
|