@indigoai-us/hq-cli 5.119.11 → 5.119.12

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [5.119.12] — 2026-09-18
6
+
7
+ ### Fixed
8
+
9
+ - `hq files cat … --company prs_<person-uid>` now reads the file instead of
10
+ refusing with "No company found for slug". Reading a DM attachment needs the
11
+ sender's vault as the scope, and `cat` resolved that value as a company slug
12
+ of its own, after the same fix landed on the presign path.
13
+
5
14
  ## [5.119.11] — 2026-09-18
6
15
 
7
16
  ### Added
@@ -43,7 +43,7 @@ import { S3Client, ListObjectsV2Command, GetObjectCommand, } from "@aws-sdk/clie
43
43
  import { VaultClient, grantPathToPrefix, } from "@indigoai-us/hq-cloud";
44
44
  import { DEFAULT_HQ_ROOT, DEFAULT_COGNITO, buildVaultConfig, } from "../utils/cognito-session.js";
45
45
  import { resolveVaultCredential } from "../utils/resolve-vault-credential.js";
46
- import { getCompanyUid, looksLikeCompanyUid, vaultApiFetch, } from "../utils/vault-api.js";
46
+ import { getCompanyUid, looksLikeCompanyUid, looksLikePersonVaultUid, vaultApiFetch, } from "../utils/vault-api.js";
47
47
  import { resolveCanonicalPersonUid } from "./cloud.js";
48
48
  // ── Pure helpers ────────────────────────────────────────────────────────────
49
49
  /**
@@ -306,18 +306,37 @@ export async function runCat(input) {
306
306
  }
307
307
  else {
308
308
  const slug = input.companySlug ?? parseCompanySlugFromPath(key);
309
- const entity = await vaultClient.entity.findInMyNamespace("company", slug);
310
- if (!entity) {
311
- throw new Error(`No company found for slug '${slug}' in your namespace. Confirm you have an active membership.`);
309
+ if (looksLikePersonVaultUid(slug)) {
310
+ // A `prs_` scope names a PERSON'S vault, which is where a DM attachment
311
+ // lives (`chat/attachments/dm/<uidA>--<uidB>/…`). There is no company
312
+ // entity to look up — `findInMyNamespace("company", …)` can only ever
313
+ // find a company, so it refuses the one scope the server accepts
314
+ // (hq-pro #3571 authorizes either member of the pair; hq-cli #644 made
315
+ // the presign path carry the ref). Go straight to the presign path and
316
+ // let the vault API's per-key gate decide.
317
+ //
318
+ // The key is already bucket-relative: a person vault has no
319
+ // `companies/<slug>/` anchor to strip. `Bucket` is inert on this path —
320
+ // the browse-vend company client presigns by companyUid + key and never
321
+ // reads it — so the scope ref is carried through for error messages.
322
+ bucket = slug;
323
+ s3Key = key;
324
+ s3 = requireCompanyClient(input.companyClient)({ companyUid: slug });
312
325
  }
313
- if (!entity.bucketName) {
314
- throw new Error(`Company '${slug}' (${entity.uid}) has no provisioned bucket.`);
326
+ else {
327
+ const entity = await vaultClient.entity.findInMyNamespace("company", slug);
328
+ if (!entity) {
329
+ throw new Error(`No company found for slug '${slug}' in your namespace. Confirm you have an active membership.`);
330
+ }
331
+ if (!entity.bucketName) {
332
+ throw new Error(`Company '${slug}' (${entity.uid}) has no provisioned bucket.`);
333
+ }
334
+ bucket = entity.bucketName;
335
+ // Translate the anchored CLI key into the company-relative bucket key.
336
+ s3Key = toBucketRelative(key, slug);
337
+ // COMPANY mode (HQ-59): GetObject → presign GET. No STS vend, no direct S3.
338
+ s3 = requireCompanyClient(input.companyClient)({ companyUid: entity.uid });
315
339
  }
316
- bucket = entity.bucketName;
317
- // Translate the anchored CLI key into the company-relative bucket key.
318
- s3Key = toBucketRelative(key, slug);
319
- // COMPANY mode (HQ-59): GetObject → presign GET. No STS vend, no direct S3.
320
- s3 = requireCompanyClient(input.companyClient)({ companyUid: entity.uid });
321
340
  }
322
341
  // HQ-CLI-5: when writing to --out, create the parent directory BEFORE issuing
323
342
  // the presigned GET, so no synchronous filesystem call sits between receiving
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.119.11",
3
+ "version": "5.119.12",
4
4
  "description": "HQ by Indigo management CLI \u2014 modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {