@indigoai-us/hq-cloud 5.46.0 → 5.47.1

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 (52) hide show
  1. package/dist/bin/sync-runner.d.ts +12 -0
  2. package/dist/bin/sync-runner.d.ts.map +1 -1
  3. package/dist/bin/sync-runner.js +39 -0
  4. package/dist/bin/sync-runner.js.map +1 -1
  5. package/dist/bin/sync-runner.test.js +27 -1
  6. package/dist/bin/sync-runner.test.js.map +1 -1
  7. package/dist/cli/share.d.ts.map +1 -1
  8. package/dist/cli/share.js +17 -2
  9. package/dist/cli/share.js.map +1 -1
  10. package/dist/cli/share.test.js +2 -0
  11. package/dist/cli/share.test.js.map +1 -1
  12. package/dist/cli/sync-scope.test.js +1 -0
  13. package/dist/cli/sync-scope.test.js.map +1 -1
  14. package/dist/cli/sync.d.ts.map +1 -1
  15. package/dist/cli/sync.js +11 -1
  16. package/dist/cli/sync.js.map +1 -1
  17. package/dist/cli/sync.test.js +1 -0
  18. package/dist/cli/sync.test.js.map +1 -1
  19. package/dist/object-io.d.ts +218 -0
  20. package/dist/object-io.d.ts.map +1 -0
  21. package/dist/object-io.js +588 -0
  22. package/dist/object-io.js.map +1 -0
  23. package/dist/object-io.test.d.ts +11 -0
  24. package/dist/object-io.test.d.ts.map +1 -0
  25. package/dist/object-io.test.js +568 -0
  26. package/dist/object-io.test.js.map +1 -0
  27. package/dist/s3.d.ts +37 -0
  28. package/dist/s3.d.ts.map +1 -1
  29. package/dist/s3.js +225 -201
  30. package/dist/s3.js.map +1 -1
  31. package/dist/s3.test.js +21 -0
  32. package/dist/s3.test.js.map +1 -1
  33. package/dist/vault-client.d.ts +68 -0
  34. package/dist/vault-client.d.ts.map +1 -1
  35. package/dist/vault-client.js +35 -0
  36. package/dist/vault-client.js.map +1 -1
  37. package/package.json +1 -1
  38. package/scripts/presign-transport-e2e.mjs +203 -0
  39. package/scripts/vault-rebaseline.sh +275 -0
  40. package/scripts/vault-rescue.sh +8 -0
  41. package/src/bin/sync-runner.test.ts +41 -0
  42. package/src/bin/sync-runner.ts +52 -0
  43. package/src/cli/share.test.ts +2 -0
  44. package/src/cli/share.ts +29 -2
  45. package/src/cli/sync-scope.test.ts +1 -0
  46. package/src/cli/sync.test.ts +1 -0
  47. package/src/cli/sync.ts +22 -1
  48. package/src/object-io.test.ts +663 -0
  49. package/src/object-io.ts +782 -0
  50. package/src/s3.test.ts +24 -0
  51. package/src/s3.ts +277 -237
  52. package/src/vault-client.ts +101 -0
@@ -58,6 +58,7 @@ vi.mock("../s3.js", async () => {
58
58
  const hit = REMOTE.current.find((r) => r.key === key);
59
59
  return hit ? { metadata: {}, size: hit.size, etag: hit.etag } : null;
60
60
  }),
61
+ primeObjectTransport: innerVi.fn().mockResolvedValue(undefined),
61
62
  };
62
63
  });
63
64
 
@@ -31,6 +31,7 @@ vi.mock("../s3.js", async () => {
31
31
  listRemoteFiles: innerVi.fn().mockResolvedValue(remoteFiles),
32
32
  deleteRemoteFile: innerVi.fn().mockResolvedValue(undefined),
33
33
  headRemoteFile: innerVi.fn().mockResolvedValue(null),
34
+ primeObjectTransport: innerVi.fn().mockResolvedValue(undefined),
34
35
  };
35
36
  });
36
37
 
package/src/cli/sync.ts CHANGED
@@ -10,7 +10,12 @@ import * as path from "path";
10
10
  import type { VaultServiceConfig, SyncJournal } from "../types.js";
11
11
  import type { SyncMode } from "../vault-client.js";
12
12
  import { resolveEntityContext, isExpiringSoon, refreshEntityContext } from "../context.js";
13
- import { downloadFile, listRemoteFiles, headRemoteFile } from "../s3.js";
13
+ import {
14
+ downloadFile,
15
+ listRemoteFiles,
16
+ headRemoteFile,
17
+ primeObjectTransport,
18
+ } from "../s3.js";
14
19
  import type { RemoteFile } from "../s3.js";
15
20
  import {
16
21
  readJournal,
@@ -834,6 +839,18 @@ export async function sync(options: SyncOptions): Promise<SyncResult> {
834
839
  // (inside the wrapper), so cross-file interleave is expected and the
835
840
  // menubar's stream parser already handles it.
836
841
  if (downloadItems.length > 0) {
842
+ // Batch pre-mint GET URLs for every download in one shot (chunked server-
843
+ // side) so the pool below — and the new-files HEAD enrichment that follows,
844
+ // which re-reads the same keys — reuse them instead of presigning per file.
845
+ // On a large initial pull this is the difference between ~ceil(N/100)
846
+ // presign calls and N (which would 429 past the 100-req/hr limit). No-op
847
+ // on the S3 SDK transport; best-effort (failure falls back to per-file).
848
+ await primeObjectTransport(
849
+ ctx,
850
+ "get",
851
+ downloadItems.map((d) => d.remoteFile.key),
852
+ );
853
+
837
854
  const queue = [...downloadItems];
838
855
  const inFlight: Set<Promise<unknown>> = new Set();
839
856
 
@@ -1022,6 +1039,10 @@ export async function sync(options: SyncOptions): Promise<SyncResult> {
1022
1039
  // - HEAD throws transient → defensive skip + emit error.
1023
1040
  // Bounded concurrency mirrors the new-files attribution pass above.
1024
1041
  if (plan.tombstones.length > 0) {
1042
+ // Pre-mint GET URLs for the tombstone HEAD-verify probes below (headRemote
1043
+ // File presigns a GET), so a large delete set doesn't add N presign calls.
1044
+ await primeObjectTransport(ctx, "get", plan.tombstones);
1045
+
1025
1046
  const HEAD_VERIFY_CONCURRENCY = 5;
1026
1047
  const verified: string[] = [];
1027
1048
  for (let i = 0; i < plan.tombstones.length; i += HEAD_VERIFY_CONCURRENCY) {