@indigoai-us/hq-cloud 5.34.0 → 5.36.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/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +196 -27
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +532 -0
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +182 -49
- package/dist/cli/sync.js.map +1 -1
- package/dist/ignore.d.ts.map +1 -1
- package/dist/ignore.js +13 -0
- package/dist/ignore.js.map +1 -1
- package/dist/ignore.test.js +28 -0
- package/dist/ignore.test.js.map +1 -1
- package/dist/journal.d.ts +1 -1
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +4 -1
- package/dist/journal.js.map +1 -1
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/share.test.ts +594 -0
- package/src/cli/share.ts +201 -27
- package/src/cli/sync.ts +200 -48
- package/src/ignore.test.ts +37 -0
- package/src/ignore.ts +14 -0
- package/src/journal.ts +4 -0
- package/src/types.ts +16 -0
package/src/journal.ts
CHANGED
|
@@ -210,6 +210,7 @@ export function updateEntry(
|
|
|
210
210
|
size: number,
|
|
211
211
|
direction: "up" | "down",
|
|
212
212
|
remoteEtag?: string,
|
|
213
|
+
mtimeMs?: number,
|
|
213
214
|
): void {
|
|
214
215
|
const entry: JournalEntry = {
|
|
215
216
|
hash,
|
|
@@ -220,6 +221,9 @@ export function updateEntry(
|
|
|
220
221
|
if (remoteEtag !== undefined && remoteEtag !== "") {
|
|
221
222
|
entry.remoteEtag = normalizeEtag(remoteEtag);
|
|
222
223
|
}
|
|
224
|
+
if (mtimeMs !== undefined) {
|
|
225
|
+
entry.mtimeMs = mtimeMs;
|
|
226
|
+
}
|
|
223
227
|
journal.files[relativePath] = entry;
|
|
224
228
|
journal.lastSync = new Date().toISOString();
|
|
225
229
|
}
|
package/src/types.ts
CHANGED
|
@@ -34,6 +34,22 @@ export interface JournalEntry {
|
|
|
34
34
|
* against `syncedAt`.
|
|
35
35
|
*/
|
|
36
36
|
remoteEtag?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Local mtime (epoch ms) of the file at the moment we last synced it. Used
|
|
39
|
+
* by the push planner as the fast-path "is this file unchanged?" check:
|
|
40
|
+
* when `lstat.size === entry.size && lstat.mtimeMs === entry.mtimeMs`,
|
|
41
|
+
* the SHA256 is skipped and the file is classified `unchanged` without
|
|
42
|
+
* reading its bytes. Same trade-off rsync/gitignore use — a same-length
|
|
43
|
+
* edit that doesn't bump mtime will be missed, but that's vanishingly
|
|
44
|
+
* rare in practice and the speedup on no-op syncs (~5–10×) is the goal.
|
|
45
|
+
*
|
|
46
|
+
* Optional for backwards compatibility: entries written before this field
|
|
47
|
+
* existed (or symlink entries, where lstat.mtimeMs is the link's own
|
|
48
|
+
* mtime and the prefixed-hash check is already cheap) fall through to
|
|
49
|
+
* `hashFile()` on the first post-upgrade sync; the next `updateEntry`
|
|
50
|
+
* stamps the field so subsequent syncs use the fast-path.
|
|
51
|
+
*/
|
|
52
|
+
mtimeMs?: number;
|
|
37
53
|
/**
|
|
38
54
|
* Tombstone marker (Journal v2, US-005). When set, this entry represents
|
|
39
55
|
* a file that was pruned by a scope shrink — either implicitly (next pull
|