@indigoai-us/hq-cli 5.130.0 → 5.132.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/CHANGELOG.md +155 -1
- package/contracts/preflight/v1/fixtures.json +87 -0
- package/contracts/preflight/v1/schema.json +58 -0
- package/dist/command-catalog.generated.d.ts +39 -0
- package/dist/command-catalog.generated.js +50 -0
- package/dist/commands/dm.d.ts +2 -0
- package/dist/commands/dm.js +1 -1
- package/dist/commands/files.js +137 -9
- package/dist/commands/lanes.d.ts +13 -2
- package/dist/commands/lanes.js +394 -42
- package/dist/commands/mesh.js +66 -13
- package/dist/commands/update.js +1 -1
- package/dist/lib/bot/paths.d.ts +7 -5
- package/dist/lib/bot/paths.js +8 -1
- package/dist/lib/bot/prompt.d.ts +0 -2
- package/dist/lib/bot/prompt.js +5 -11
- package/dist/lib/bot/room-policy.d.ts +1 -24
- package/dist/lib/bot/room-policy.js +2 -35
- package/dist/lib/bot/run.d.ts +7 -8
- package/dist/lib/bot/run.js +21 -33
- package/dist/lib/bot/session.d.ts +1 -1
- package/dist/lib/bot/session.js +1 -1
- package/dist/lib/lanes/accounts.d.ts +6 -0
- package/dist/lib/lanes/accounts.js +2 -1
- package/dist/lib/lanes/config.d.ts +4 -0
- package/dist/lib/lanes/config.js +9 -0
- package/dist/lib/lanes/index.d.ts +10 -3
- package/dist/lib/lanes/index.js +5 -1
- package/dist/lib/lanes/mesh-events.js +4 -0
- package/dist/lib/lanes/models.d.ts +78 -0
- package/dist/lib/lanes/models.js +205 -0
- package/dist/lib/lanes/move-account.d.ts +56 -0
- package/dist/lib/lanes/move-account.js +193 -0
- package/dist/lib/lanes/provider-rejection.d.ts +86 -0
- package/dist/lib/lanes/provider-rejection.js +258 -0
- package/dist/lib/lanes/quota.d.ts +17 -0
- package/dist/lib/lanes/quota.js +24 -0
- package/dist/lib/lanes/reconcile-install.d.ts +24 -3
- package/dist/lib/lanes/reconcile-install.js +48 -12
- package/dist/lib/lanes/reconcile.js +41 -11
- package/dist/lib/lanes/spawn.js +26 -5
- package/dist/lib/lanes/store.js +10 -0
- package/dist/lib/lanes/types.d.ts +49 -2
- package/dist/lib/lanes/types.js +4 -3
- package/dist/lib/lanes/watcher.d.ts +27 -0
- package/dist/lib/lanes/watcher.js +68 -5
- package/dist/lib/mesh/api.d.ts +2 -0
- package/dist/lib/mesh/api.js +15 -2
- package/dist/lib/mesh/live/backfill-held.d.ts +4 -3
- package/dist/lib/mesh/live/backfill-held.js +37 -14
- package/dist/lib/mesh/live/daemon/doctor.d.ts +4 -0
- package/dist/lib/mesh/live/daemon/doctor.js +15 -4
- package/dist/lib/mesh/live/daemon/install.d.ts +5 -0
- package/dist/lib/mesh/live/daemon/install.js +84 -1
- package/dist/lib/mesh/live/daemon/run.d.ts +5 -0
- package/dist/lib/mesh/live/daemon/run.js +17 -4
- package/dist/lib/mesh/live/emit-client.d.ts +2 -0
- package/dist/lib/mesh/live/emit-client.js +15 -8
- package/dist/lib/mesh/live/emit-evidence.d.ts +19 -0
- package/dist/lib/mesh/live/emit-evidence.js +20 -2
- package/dist/lib/mesh/live/emit.d.ts +9 -0
- package/dist/lib/mesh/live/emit.js +28 -2
- package/dist/lib/mesh/live/flush.js +9 -3
- package/dist/lib/search-index/index.js +22 -3
- package/dist/lib/work-context/company.d.ts +16 -0
- package/dist/lib/work-context/company.js +46 -14
- package/dist/lib/work-context/preflight-contract.d.ts +28 -0
- package/dist/lib/work-context/preflight-contract.js +85 -0
- package/dist/main.js +11 -1
- package/dist/utils/cognito-session.d.ts +39 -0
- package/dist/utils/cognito-session.js +119 -3
- package/dist/utils/environmental-error.d.ts +18 -0
- package/dist/utils/environmental-error.js +240 -7
- package/dist/utils/expected-cli-error.d.ts +2 -0
- package/dist/utils/expected-cli-error.js +4 -0
- package/dist/utils/self-update.js +4 -1
- package/dist/utils/vault-api.d.ts +1 -0
- package/dist/utils/vault-api.js +11 -3
- package/package.json +3 -2
package/dist/utils/vault-api.js
CHANGED
|
@@ -6,6 +6,8 @@ import { CompanySelectionError } from './company-selection-error.js';
|
|
|
6
6
|
import { recordPlanLimitStatus } from '../lib/plan-limit-nag.js';
|
|
7
7
|
import { networkTransportErrorCode } from './network-transport-error.js';
|
|
8
8
|
import { planGateErrorFromResponse } from './plan-gate-error.js';
|
|
9
|
+
import { markExpectedUserError } from './expected-cli-error.js';
|
|
10
|
+
import { redactErrorText } from './redact-error-text.js';
|
|
9
11
|
/**
|
|
10
12
|
* Identity / company resolution lookups must never hang forever. These small
|
|
11
13
|
* GETs run BEFORE a command does its real work (e.g. `hq secrets env` resolves
|
|
@@ -193,6 +195,7 @@ export async function vaultApiFetch(opts) {
|
|
|
193
195
|
// skew on EVERY authenticated request, not only health heartbeats.
|
|
194
196
|
// Fixed build constant, never caller-supplied; attribution only.
|
|
195
197
|
'x-hq-client-version': CLI_VERSION,
|
|
198
|
+
...opts.headers,
|
|
196
199
|
},
|
|
197
200
|
body: opts.body ? JSON.stringify(opts.body) : undefined,
|
|
198
201
|
signal: opts.signal,
|
|
@@ -342,6 +345,9 @@ function formatSlugLookupReason(res, body) {
|
|
|
342
345
|
return fromStatus;
|
|
343
346
|
return `HTTP ${res.status}`;
|
|
344
347
|
}
|
|
348
|
+
function redactedSlugLookupMessage(message) {
|
|
349
|
+
return redactErrorText(message) || 'Company lookup failed.';
|
|
350
|
+
}
|
|
345
351
|
function isTransientSlugLookupStatus(status) {
|
|
346
352
|
return status === 408 || status === 425 || status === 429 || status >= 500;
|
|
347
353
|
}
|
|
@@ -475,14 +481,15 @@ async function resolveCompanyUid(token, ref) {
|
|
|
475
481
|
// failure — treating it as not-found sent owners to check a slug that
|
|
476
482
|
// was fine (Shepherd #2306).
|
|
477
483
|
if (res.status === 404 && mine.kind === "miss") {
|
|
478
|
-
throw Object.assign(new Error(`Company slug '${ref}' was not found. Check the slug or run \`hq companies list\`.`), { expected: true });
|
|
484
|
+
throw Object.assign(new Error(redactedSlugLookupMessage(`Company slug '${ref}' was not found. Check the slug or run \`hq companies list\`.`)), { expected: true });
|
|
479
485
|
}
|
|
480
486
|
const reason = formatSlugLookupReason(res, body);
|
|
481
487
|
const retryable = mine.kind === "transient" || isTransientSlugLookupStatus(res.status);
|
|
482
488
|
const hint = retryable
|
|
483
489
|
? " This is a temporary lookup failure, not a missing company. Retry the command."
|
|
484
490
|
: "";
|
|
485
|
-
|
|
491
|
+
const error = new Error(redactedSlugLookupMessage(`Failed to resolve company slug '${ref}': ${reason}.${hint}`));
|
|
492
|
+
throw retryable ? error : markExpectedUserError(error);
|
|
486
493
|
}
|
|
487
494
|
const data = (await res.json());
|
|
488
495
|
return data.entity.uid;
|
|
@@ -494,7 +501,8 @@ async function resolveCompanyFromMemberships(token) {
|
|
|
494
501
|
signal: AbortSignal.timeout(identityLookupTimeoutMs()),
|
|
495
502
|
});
|
|
496
503
|
if (!res.ok) {
|
|
497
|
-
|
|
504
|
+
const error = new Error("Failed to fetch memberships — run `hq login` and try again");
|
|
505
|
+
throw res.status === 401 ? markExpectedUserError(error) : error;
|
|
498
506
|
}
|
|
499
507
|
const data = (await res.json());
|
|
500
508
|
const active = data.memberships.filter((m) => m.status === 'active');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indigoai-us/hq-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.132.0",
|
|
4
4
|
"description": "HQ by Indigo management CLI \u2014 modules and cloud sync",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"assets/lanes-hooks",
|
|
18
18
|
"templates",
|
|
19
19
|
"CHANGELOG.md",
|
|
20
|
-
"README.md"
|
|
20
|
+
"README.md",
|
|
21
|
+
"contracts"
|
|
21
22
|
],
|
|
22
23
|
"scripts": {
|
|
23
24
|
"build": "node scripts/generate-dsn.mjs && tsc && node scripts/generate-command-catalog.mjs --check && node scripts/copy-schemas.mjs && node scripts/chmod-bins.mjs",
|