velocious 1.0.643 → 1.0.644

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.
Files changed (48) hide show
  1. package/README.md +10 -1
  2. package/build/src/sync/assets/cache.d.ts +288 -0
  3. package/build/src/sync/assets/cache.d.ts.map +1 -0
  4. package/build/src/sync/assets/cache.js +883 -0
  5. package/build/src/sync/assets/types.d.ts +199 -0
  6. package/build/src/sync/assets/types.d.ts.map +1 -0
  7. package/build/src/sync/assets/types.js +56 -0
  8. package/build/src/testing/test-runner.d.ts +8 -0
  9. package/build/src/testing/test-runner.d.ts.map +1 -1
  10. package/build/src/testing/test-runner.js +49 -548
  11. package/build/src/testing/velocious-attempt-executor.d.ts +69 -0
  12. package/build/src/testing/velocious-attempt-executor.d.ts.map +1 -0
  13. package/build/src/testing/velocious-attempt-executor.js +402 -0
  14. package/build/src/testing/velocious-runner-reporter.d.ts +72 -0
  15. package/build/src/testing/velocious-runner-reporter.d.ts.map +1 -0
  16. package/build/src/testing/velocious-runner-reporter.js +152 -0
  17. package/build/src/testing/velocious-suite-hook-executor.d.ts +37 -0
  18. package/build/src/testing/velocious-suite-hook-executor.d.ts.map +1 -0
  19. package/build/src/testing/velocious-suite-hook-executor.js +66 -0
  20. package/build/src/testing/velocious-test-arguments.d.ts +34 -0
  21. package/build/src/testing/velocious-test-arguments.d.ts.map +1 -0
  22. package/build/src/testing/velocious-test-arguments.js +47 -0
  23. package/build/src/utils/sha256-bytes-hex.d.ts +7 -0
  24. package/build/src/utils/sha256-bytes-hex.d.ts.map +1 -0
  25. package/build/src/utils/sha256-bytes-hex.js +117 -0
  26. package/build/src/utils/sha256-hex.d.ts +2 -4
  27. package/build/src/utils/sha256-hex.d.ts.map +1 -1
  28. package/build/src/utils/sha256-hex.js +6 -120
  29. package/build/sync/assets/cache.js +998 -0
  30. package/build/sync/assets/types.js +62 -0
  31. package/build/testing/test-runner.js +46 -584
  32. package/build/testing/velocious-attempt-executor.js +431 -0
  33. package/build/testing/velocious-runner-reporter.js +166 -0
  34. package/build/testing/velocious-suite-hook-executor.js +71 -0
  35. package/build/testing/velocious-test-arguments.js +55 -0
  36. package/build/tsconfig.tsbuildinfo +1 -1
  37. package/build/utils/sha256-bytes-hex.js +132 -0
  38. package/build/utils/sha256-hex.js +7 -135
  39. package/package.json +1 -1
  40. package/src/sync/assets/cache.js +998 -0
  41. package/src/sync/assets/types.js +62 -0
  42. package/src/testing/test-runner.js +46 -584
  43. package/src/testing/velocious-attempt-executor.js +431 -0
  44. package/src/testing/velocious-runner-reporter.js +166 -0
  45. package/src/testing/velocious-suite-hook-executor.js +71 -0
  46. package/src/testing/velocious-test-arguments.js +55 -0
  47. package/src/utils/sha256-bytes-hex.js +132 -0
  48. package/src/utils/sha256-hex.js +7 -135
@@ -0,0 +1,62 @@
1
+ // @ts-check
2
+
3
+ /**
4
+ * Immutable attachment descriptor synchronized separately from its bytes.
5
+ * @typedef {object} SynchronizedAssetCacheDescriptor
6
+ * @property {number} byteSize - Expected byte count.
7
+ * @property {string | null} contentType - Media type.
8
+ * @property {string} digest - Expected `sha256-<hex>` content digest.
9
+ * @property {"eager" | "on-demand"} fetch - Download timing policy.
10
+ * @property {string} filename - Original filename.
11
+ * @property {string} id - Immutable attachment id.
12
+ * @property {string} name - Attachment declaration name.
13
+ * @property {"optional" | "required"} offlineRequirement - Whether offline readiness requires the bytes.
14
+ * @property {string} recordId - Owner record id.
15
+ * @property {string} recordType - Owner model name.
16
+ * @property {"durable" | "evictable"} retention - Storage-pressure policy.
17
+ */
18
+
19
+ /**
20
+ * Persisted state for one synchronized attachment descriptor.
21
+ * @typedef {object} SynchronizedAssetCacheEntry
22
+ * @property {number} attempts - Consecutive failed download count.
23
+ * @property {SynchronizedAssetCacheDescriptor} descriptor - Current immutable descriptor.
24
+ * @property {number} lastAccessedAt - Millisecond LRU timestamp.
25
+ * @property {number | null} nextRetryAt - Earliest automatic retry time.
26
+ * @property {string[]} scopeKeys - Synchronized scopes referencing the descriptor.
27
+ * @property {"cached" | "downloading" | "failed" | "missing"} status - Local byte state.
28
+ */
29
+
30
+ /**
31
+ * Versioned persistent cache metadata owned by a platform adapter.
32
+ * @typedef {object} SynchronizedAssetCacheState
33
+ * @property {SynchronizedAssetCacheEntry[]} assets - Descriptor entries.
34
+ * @property {string[]} pendingDeletionDigests - Unreferenced blobs awaiting confirmed deletion.
35
+ * @property {1} version - State schema version.
36
+ */
37
+
38
+ /**
39
+ * Platform storage adapter. `writeBlob` must make bytes visible atomically.
40
+ * @typedef {object} SynchronizedAssetCacheAdapter
41
+ * @property {(args: {accountId: string, digest: string}) => Promise<string | null>} blobUri - Resolves a locally stored blob URI.
42
+ * @property {(args: {accountId: string, digest: string}) => Promise<void>} deleteBlob - Deletes one local blob.
43
+ * @property {(args: {accountId: string}) => Promise<SynchronizedAssetCacheState | null>} loadState - Loads account-scoped metadata.
44
+ * @property {(args: {accountId: string, state: SynchronizedAssetCacheState}) => Promise<void>} saveState - Atomically saves account-scoped metadata.
45
+ * @property {(args: {accountId: string, bytes: Uint8Array, contentType: string | null, digest: string}) => Promise<string>} writeBlob - Atomically stores verified bytes.
46
+ */
47
+
48
+ /**
49
+ * Failed asset result surfaced to the sync coordinator.
50
+ * @typedef {object} SynchronizedAssetCacheFailure
51
+ * @property {string} assetId - Descriptor id.
52
+ * @property {Error} error - Download or verification error.
53
+ */
54
+
55
+ /**
56
+ * Descriptor reconciliation result.
57
+ * @typedef {object} SynchronizedAssetCacheSynchronizationResult
58
+ * @property {SynchronizedAssetCacheFailure[]} failures - Failed eligible eager downloads.
59
+ * @property {string[]} missingRequiredAssetIds - Required descriptors without cached bytes.
60
+ */
61
+
62
+ export {}