@indigoai-us/hq-cli 5.108.0 → 5.108.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.
- package/CHANGELOG.md +2 -0
- package/dist/commands/cloud.d.ts +6 -0
- package/dist/commands/cloud.js +26 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/commands/cloud.d.ts
CHANGED
|
@@ -30,6 +30,12 @@ export declare class SyncExitError extends Error {
|
|
|
30
30
|
readonly code: number;
|
|
31
31
|
constructor(code: number);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Preserve the vault's typed write-scope refusal at the CLI boundary. This is
|
|
35
|
+
* deliberately duck-typed so hq-cli remains compatible while hq-cloud and the
|
|
36
|
+
* CLI are released independently.
|
|
37
|
+
*/
|
|
38
|
+
export declare function formatSyncFailure(err: unknown): string;
|
|
33
39
|
/**
|
|
34
40
|
* US-003: run one sync fanout under a client-health attempt/outcome report.
|
|
35
41
|
* The report is best-effort, bounded, and swallowed — it can only append a
|
package/dist/commands/cloud.js
CHANGED
|
@@ -38,6 +38,29 @@ export class SyncExitError extends Error {
|
|
|
38
38
|
this.name = "SyncExitError";
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Preserve the vault's typed write-scope refusal at the CLI boundary. This is
|
|
43
|
+
* deliberately duck-typed so hq-cli remains compatible while hq-cloud and the
|
|
44
|
+
* CLI are released independently.
|
|
45
|
+
*/
|
|
46
|
+
export function formatSyncFailure(err) {
|
|
47
|
+
if (typeof err === "object" && err !== null) {
|
|
48
|
+
const diagnostic = err;
|
|
49
|
+
if (diagnostic.code === "POLICY_WRITE_SCOPE_TRUNCATED") {
|
|
50
|
+
const dropped = Array.isArray(diagnostic.droppedWriteGrantPrefixes)
|
|
51
|
+
? diagnostic.droppedWriteGrantPrefixes.filter((prefix) => typeof prefix === "string")
|
|
52
|
+
: [];
|
|
53
|
+
const retained = Array.isArray(diagnostic.retainedGrantPrefixes)
|
|
54
|
+
? diagnostic.retainedGrantPrefixes.filter((prefix) => typeof prefix === "string")
|
|
55
|
+
: [];
|
|
56
|
+
return ("Vault credentials were refused because the requested write scope could not be represented exactly. " +
|
|
57
|
+
`Dropped write prefixes: ${dropped.length > 0 ? dropped.join(", ") : "unknown"}. ` +
|
|
58
|
+
`Retained prefixes: ${retained.length > 0 ? retained.join(", ") : "none"}. ` +
|
|
59
|
+
"No files were uploaded. Narrow or consolidate the grants, then retry.");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return err instanceof Error ? err.message : String(err);
|
|
63
|
+
}
|
|
41
64
|
/**
|
|
42
65
|
* US-003: run one sync fanout under a client-health attempt/outcome report.
|
|
43
66
|
* The report is best-effort, bounded, and swallowed — it can only append a
|
|
@@ -324,7 +347,7 @@ export async function pullAll(options, deps) {
|
|
|
324
347
|
}
|
|
325
348
|
}
|
|
326
349
|
catch (err) {
|
|
327
|
-
const message =
|
|
350
|
+
const message = formatSyncFailure(err);
|
|
328
351
|
result.errors.push({ company: entry.slug, message });
|
|
329
352
|
result.perCompany.push({ slug: entry.slug, error: message });
|
|
330
353
|
}
|
|
@@ -416,7 +439,7 @@ export async function pushAll(options, deps) {
|
|
|
416
439
|
result.perCompany.push({ slug: entry.slug, result: r });
|
|
417
440
|
}
|
|
418
441
|
catch (err) {
|
|
419
|
-
const message =
|
|
442
|
+
const message = formatSyncFailure(err);
|
|
420
443
|
result.errors.push({ company: entry.slug, message });
|
|
421
444
|
result.perCompany.push({ slug: entry.slug, error: message });
|
|
422
445
|
}
|
|
@@ -810,7 +833,7 @@ export function registerCloudCommands(program) {
|
|
|
810
833
|
catch (err) {
|
|
811
834
|
if (syncHealth)
|
|
812
835
|
await syncHealth.failed();
|
|
813
|
-
const message =
|
|
836
|
+
const message = formatSyncFailure(err);
|
|
814
837
|
if (jsonMode) {
|
|
815
838
|
// In JSON mode, the parent process is parsing stderr for ndjson —
|
|
816
839
|
// human-formatted error lines would corrupt the stream. Emit a
|