@indigoai-us/hq-cloud 6.11.4 → 6.11.6

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 (88) hide show
  1. package/dist/bin/sync-runner.d.ts +16 -16
  2. package/dist/bin/sync-runner.d.ts.map +1 -1
  3. package/dist/bin/sync-runner.js +50 -41
  4. package/dist/bin/sync-runner.js.map +1 -1
  5. package/dist/bin/sync-runner.test.js +107 -33
  6. package/dist/bin/sync-runner.test.js.map +1 -1
  7. package/dist/context.d.ts +6 -0
  8. package/dist/context.d.ts.map +1 -1
  9. package/dist/context.js +57 -17
  10. package/dist/context.js.map +1 -1
  11. package/dist/context.test.js +113 -1
  12. package/dist/context.test.js.map +1 -1
  13. package/dist/entity-resolver.test.js +3 -3
  14. package/dist/entity-resolver.test.js.map +1 -1
  15. package/dist/object-io.d.ts.map +1 -1
  16. package/dist/object-io.js +10 -0
  17. package/dist/object-io.js.map +1 -1
  18. package/dist/personal-vault-exclusions.d.ts.map +1 -1
  19. package/dist/personal-vault-exclusions.js +11 -0
  20. package/dist/personal-vault-exclusions.js.map +1 -1
  21. package/dist/personal-vault-exclusions.test.js +5 -0
  22. package/dist/personal-vault-exclusions.test.js.map +1 -1
  23. package/dist/signals/get.d.ts.map +1 -1
  24. package/dist/signals/get.js +7 -11
  25. package/dist/signals/get.js.map +1 -1
  26. package/dist/signals/get.test.js +65 -1
  27. package/dist/signals/get.test.js.map +1 -1
  28. package/dist/signals/internals.d.ts +47 -3
  29. package/dist/signals/internals.d.ts.map +1 -1
  30. package/dist/signals/internals.js +110 -4
  31. package/dist/signals/internals.js.map +1 -1
  32. package/dist/signals/list.d.ts.map +1 -1
  33. package/dist/signals/list.js +16 -23
  34. package/dist/signals/list.js.map +1 -1
  35. package/dist/signals/list.test.js +84 -1
  36. package/dist/signals/list.test.js.map +1 -1
  37. package/dist/signals/types.d.ts +18 -1
  38. package/dist/signals/types.d.ts.map +1 -1
  39. package/dist/sources/get.d.ts.map +1 -1
  40. package/dist/sources/get.js +10 -22
  41. package/dist/sources/get.js.map +1 -1
  42. package/dist/sources/get.test.js +85 -1
  43. package/dist/sources/get.test.js.map +1 -1
  44. package/dist/sources/internals.d.ts +50 -3
  45. package/dist/sources/internals.d.ts.map +1 -1
  46. package/dist/sources/internals.js +113 -4
  47. package/dist/sources/internals.js.map +1 -1
  48. package/dist/sources/list.d.ts.map +1 -1
  49. package/dist/sources/list.js +16 -23
  50. package/dist/sources/list.js.map +1 -1
  51. package/dist/sources/list.test.js +101 -1
  52. package/dist/sources/list.test.js.map +1 -1
  53. package/dist/sources/types.d.ts +18 -1
  54. package/dist/sources/types.d.ts.map +1 -1
  55. package/dist/sync/event-sync.d.ts +6 -7
  56. package/dist/sync/event-sync.d.ts.map +1 -1
  57. package/dist/sync/event-sync.js +6 -7
  58. package/dist/sync/event-sync.js.map +1 -1
  59. package/dist/types.d.ts +33 -3
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/version.d.ts +14 -0
  62. package/dist/version.d.ts.map +1 -0
  63. package/dist/version.js +20 -0
  64. package/dist/version.js.map +1 -0
  65. package/package.json +1 -1
  66. package/src/bin/sync-runner.test.ts +130 -41
  67. package/src/bin/sync-runner.ts +55 -48
  68. package/src/context.test.ts +139 -1
  69. package/src/context.ts +59 -17
  70. package/src/entity-resolver.test.ts +3 -3
  71. package/src/object-io.ts +12 -0
  72. package/src/personal-vault-exclusions.test.ts +5 -0
  73. package/src/personal-vault-exclusions.ts +11 -0
  74. package/src/signals/get.test.ts +83 -1
  75. package/src/signals/get.ts +9 -13
  76. package/src/signals/internals.ts +153 -4
  77. package/src/signals/list.test.ts +114 -1
  78. package/src/signals/list.ts +16 -29
  79. package/src/signals/types.ts +18 -1
  80. package/src/sources/get.test.ts +104 -1
  81. package/src/sources/get.ts +12 -24
  82. package/src/sources/internals.ts +156 -4
  83. package/src/sources/list.test.ts +132 -1
  84. package/src/sources/list.ts +16 -29
  85. package/src/sources/types.ts +18 -1
  86. package/src/sync/event-sync.ts +6 -7
  87. package/src/types.ts +33 -3
  88. package/src/version.ts +24 -0
package/src/types.ts CHANGED
@@ -155,9 +155,26 @@ export interface EntityContext {
155
155
  bucketName: string;
156
156
  /** AWS region */
157
157
  region: string;
158
- /** STS-scoped credentials */
159
- credentials: VaultCredentials;
160
- /** When the credentials expire (ISO 8601) */
158
+ /**
159
+ * STS-scoped credentials.
160
+ *
161
+ * Absent for presign-only COMPANY contexts (HQ-59): when a run uses the
162
+ * presigned-URL transport for company vaults (`companyVaultUsesPresign`),
163
+ * `resolveEntityContext` skips the `POST /sts/vend` call entirely — the
164
+ * presign transport authorizes each object server-side and never reads these
165
+ * creds, and a compliant sync-runner must NOT hit the company vend route
166
+ * (the route-presence signal the hq-pro min-version gate keys on). The only
167
+ * reader of these creds is the direct-S3 (`S3SdkObjectIO`) path, which is
168
+ * used for personal vaults (`prs_*`, still vended) and pre-presign clients —
169
+ * never for a `cmp_*` context built on the presign path. That path throws
170
+ * loudly if it ever receives a credential-less context.
171
+ */
172
+ credentials?: VaultCredentials;
173
+ /**
174
+ * When the credentials expire (ISO 8601). For a presign-only company context
175
+ * (no STS vend) this is a far-future sentinel so `isExpiringSoon` is always
176
+ * false and no auto-refresh ever re-vends the skipped company route.
177
+ */
161
178
  expiresAt: string;
162
179
  }
163
180
 
@@ -209,6 +226,19 @@ export interface VaultServiceConfig {
209
226
  * Optional for back-compat, but all first-party clients should pass it.
210
227
  */
211
228
  clientInfo?: ClientInfo;
229
+ /**
230
+ * When true, COMPANY vaults (`cmp_*`) use the presigned-URL transport, so
231
+ * `resolveEntityContext` SKIPS `POST /sts/vend` for them and returns a
232
+ * credential-less context with a far-future `expiresAt` (HQ-59). Set by the
233
+ * sync-runner exactly when it installs the presign transport factory, so the
234
+ * vend-skip and the transport choice can never diverge. Personal vaults
235
+ * (`prs_*`) are unaffected — they always vend self via `/sts/vend-self`.
236
+ *
237
+ * Leaving this unset (the default) preserves the historical behavior: every
238
+ * context vends STS creds. Non-runner callers (standalone `hq sync`, hq-cli)
239
+ * that keep the direct-S3 path for company vaults must NOT set this.
240
+ */
241
+ companyVaultUsesPresign?: boolean;
212
242
  }
213
243
 
214
244
  // ── Conflict index (consumed by /resolve-conflicts) ─────────────────────────
package/src/version.ts ADDED
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The hq-cloud package version, read once at module load.
3
+ *
4
+ * Mirrors hq-cli's `cli-version.ts` pattern: resolve the version from the
5
+ * package.json at runtime via `import.meta.url` (rootDir-safe — no JSON import
6
+ * that would trip `tsc`'s rootDir, and resolves correctly from both `src/`
7
+ * during tests and `dist/` at runtime). Used to stamp `clientInfo.version` on
8
+ * the sync-runner's vault requests so the company-vend min-version gate (HQ-59,
9
+ * hq-pro) can tell a compliant (>= 6.11.6) sync-runner from a pre-6.11.6
10
+ * straggler. This is the hq-cloud package version — the version the gate
11
+ * compares against its floor — NOT the hq-sync desktop app version.
12
+ */
13
+
14
+ import { readFileSync } from "node:fs";
15
+ import { fileURLToPath } from "node:url";
16
+ import path from "node:path";
17
+
18
+ const here = path.dirname(fileURLToPath(import.meta.url));
19
+ // src/version.ts → dist/version.js; one level up from either is the package root.
20
+ const pkg = JSON.parse(
21
+ readFileSync(path.resolve(here, "..", "package.json"), "utf-8"),
22
+ ) as { name: string; version: string };
23
+
24
+ export const HQ_CLOUD_VERSION: string = pkg.version;