@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/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