@great-arrow/cli 0.1.67 → 0.6.5
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/dist/index.js +79 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9373,6 +9373,52 @@ function classifyRequestFailure(error62) {
|
|
|
9373
9373
|
}
|
|
9374
9374
|
return { kind, message, hint: FAILURE_HINTS[kind] };
|
|
9375
9375
|
}
|
|
9376
|
+
var DEFAULT_ORIGIN = "https://www.greatarrow.ai";
|
|
9377
|
+
var LEVEL_WORDS = {
|
|
9378
|
+
passkey: "a passkey",
|
|
9379
|
+
verified: "a verified identity"
|
|
9380
|
+
};
|
|
9381
|
+
function actionLink(url2, apiUrl) {
|
|
9382
|
+
try {
|
|
9383
|
+
return new URL(url2, apiUrl || DEFAULT_ORIGIN).toString();
|
|
9384
|
+
} catch {
|
|
9385
|
+
return url2;
|
|
9386
|
+
}
|
|
9387
|
+
}
|
|
9388
|
+
function policyRefusal(body, apiUrl) {
|
|
9389
|
+
let record2 = body;
|
|
9390
|
+
if (typeof body === "string") {
|
|
9391
|
+
try {
|
|
9392
|
+
record2 = JSON.parse(body);
|
|
9393
|
+
} catch {
|
|
9394
|
+
return null;
|
|
9395
|
+
}
|
|
9396
|
+
}
|
|
9397
|
+
if (typeof record2 !== "object" || record2 === null) return null;
|
|
9398
|
+
let r = record2;
|
|
9399
|
+
if (typeof r.error === "object" && r.error !== null) {
|
|
9400
|
+
const data = r.error.data;
|
|
9401
|
+
if (typeof data !== "object" || data === null) return null;
|
|
9402
|
+
r = data;
|
|
9403
|
+
}
|
|
9404
|
+
const url2 = typeof r.actionUrl === "string" && r.actionUrl ? actionLink(r.actionUrl, apiUrl) : null;
|
|
9405
|
+
if (r.error === "identity_assurance_required") {
|
|
9406
|
+
const need = LEVEL_WORDS[typeof r.required === "string" ? r.required : ""] ?? "a stronger sign-in";
|
|
9407
|
+
return {
|
|
9408
|
+
code: r.error,
|
|
9409
|
+
message: `This workspace requires ${need} on your account.`,
|
|
9410
|
+
hint: url2 ? `Open ${url2} to add it, then try again.` : "Add it under Account \u2192 Security, then try again."
|
|
9411
|
+
};
|
|
9412
|
+
}
|
|
9413
|
+
if (r.error === "owner_approval_required") {
|
|
9414
|
+
return {
|
|
9415
|
+
code: r.error,
|
|
9416
|
+
message: typeof r.message === "string" && r.message ? r.message : "Only the workspace owner can do this.",
|
|
9417
|
+
hint: url2 ? `Open ${url2} to continue.` : "Ask the workspace owner to do it, or to change it on the Access page."
|
|
9418
|
+
};
|
|
9419
|
+
}
|
|
9420
|
+
return null;
|
|
9421
|
+
}
|
|
9376
9422
|
var SERVER_CODE = /^[a-z][a-z0-9_]{0,63}$/;
|
|
9377
9423
|
function withServerCode(error62, body) {
|
|
9378
9424
|
try {
|
|
@@ -9437,7 +9483,7 @@ function isNodeError(value) {
|
|
|
9437
9483
|
|
|
9438
9484
|
// src/lib/version.ts
|
|
9439
9485
|
var CLI_PACKAGE_NAME = "@great-arrow/cli";
|
|
9440
|
-
var CLI_VERSION = "0.
|
|
9486
|
+
var CLI_VERSION = "0.6.5";
|
|
9441
9487
|
var GAD_INSTALL_VERSION = "2026.08.08";
|
|
9442
9488
|
var GAD_INSTALL_MIN_VERSION = "2026.06.22";
|
|
9443
9489
|
var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
|
|
@@ -9625,6 +9671,11 @@ async function getSecretSlot(account) {
|
|
|
9625
9671
|
if (!migrated) {
|
|
9626
9672
|
return null;
|
|
9627
9673
|
}
|
|
9674
|
+
try {
|
|
9675
|
+
await entry2.deletePassword();
|
|
9676
|
+
} catch (err2) {
|
|
9677
|
+
debugSwallow("keychain.getSecretSlot(delete migrated)", err2);
|
|
9678
|
+
}
|
|
9628
9679
|
return trimmed;
|
|
9629
9680
|
}
|
|
9630
9681
|
} catch (err2) {
|
|
@@ -11051,6 +11102,8 @@ var ERROR_ENVELOPE_KEYS = /* @__PURE__ */ new Set([
|
|
|
11051
11102
|
"details",
|
|
11052
11103
|
"error_description",
|
|
11053
11104
|
"reauth_url",
|
|
11105
|
+
"actionUrl",
|
|
11106
|
+
"achieved",
|
|
11054
11107
|
"required",
|
|
11055
11108
|
"ok",
|
|
11056
11109
|
"success",
|
|
@@ -11068,6 +11121,8 @@ function cleanErrorText(text3) {
|
|
|
11068
11121
|
}
|
|
11069
11122
|
function hintFrom(record2) {
|
|
11070
11123
|
if (nonEmpty(record2.hint)) return record2.hint;
|
|
11124
|
+
if (nonEmpty(record2.actionUrl))
|
|
11125
|
+
return `Open ${actionLink(record2.actionUrl, process.env.GAD_API_URL)} to continue.`;
|
|
11071
11126
|
if (nonEmpty(record2.reauth_url))
|
|
11072
11127
|
return `Re-authorize this connection: ${record2.reauth_url}`;
|
|
11073
11128
|
return void 0;
|
|
@@ -11695,6 +11750,13 @@ var GadClient = class {
|
|
|
11695
11750
|
const status = response.status;
|
|
11696
11751
|
const body = await response.text().catch(() => "");
|
|
11697
11752
|
if (status === 403) {
|
|
11753
|
+
const refusal2 = policyRefusal(body, this.apiUrl);
|
|
11754
|
+
if (refusal2) {
|
|
11755
|
+
throw withServerCode(
|
|
11756
|
+
new CliError(refusal2.message, 1 /* AUTH_ERROR */, refusal2.hint),
|
|
11757
|
+
JSON.stringify({ error: refusal2.code })
|
|
11758
|
+
);
|
|
11759
|
+
}
|
|
11698
11760
|
throw withServerCode(
|
|
11699
11761
|
new CliError(
|
|
11700
11762
|
"Permission denied (HTTP 403).",
|
|
@@ -11787,6 +11849,10 @@ var GadClient = class {
|
|
|
11787
11849
|
message: data.error.message
|
|
11788
11850
|
}
|
|
11789
11851
|
});
|
|
11852
|
+
const refusal2 = policyRefusal(data, this.apiUrl);
|
|
11853
|
+
if (refusal2) {
|
|
11854
|
+
throw new CliError(refusal2.message, 1 /* AUTH_ERROR */, refusal2.hint);
|
|
11855
|
+
}
|
|
11790
11856
|
const code = data.error.code === -32001 ? 1 /* AUTH_ERROR */ : 2 /* NETWORK_ERROR */;
|
|
11791
11857
|
throw new CliError(
|
|
11792
11858
|
data.error.message,
|
|
@@ -18683,6 +18749,12 @@ function normalizeGlance(raw) {
|
|
|
18683
18749
|
});
|
|
18684
18750
|
return repos.length > 0 ? { landing: { alertActive: l.alertActive === true, repos } } : {};
|
|
18685
18751
|
})(),
|
|
18752
|
+
...(() => {
|
|
18753
|
+
const raw2 = obj.setup;
|
|
18754
|
+
if (typeof raw2 !== "object" || raw2 === null) return {};
|
|
18755
|
+
const r = raw2;
|
|
18756
|
+
return typeof r.step === "string" && typeof r.line === "string" ? { setup: { step: r.step, line: r.line } } : {};
|
|
18757
|
+
})(),
|
|
18686
18758
|
...Array.isArray(obj.sections) ? { sections: normalizeTodaySections(obj.sections) } : {},
|
|
18687
18759
|
...Array.isArray(obj.degradedSections) ? {
|
|
18688
18760
|
degradedSections: obj.degradedSections.filter(
|
|
@@ -49759,7 +49831,7 @@ function renderStatus2(payload, plain, apiUrl) {
|
|
|
49759
49831
|
lines.push(c.badge(` ${payload.workspace} `));
|
|
49760
49832
|
lines.push("");
|
|
49761
49833
|
}
|
|
49762
|
-
const hasAny = payload.needsYou.length > 0 || payload.topGoal !== null || payload.integrations.length > 0 || payload.agents.length > 0 || Boolean(payload.healthTriage) || Boolean(payload.credentialRotation) || Boolean(payload.keyRotation) || Boolean(payload.landing) || payload.warRoom !== null && payload.warRoom.priorityCount > 0;
|
|
49834
|
+
const hasAny = payload.needsYou.length > 0 || payload.topGoal !== null || payload.integrations.length > 0 || payload.agents.length > 0 || Boolean(payload.healthTriage) || Boolean(payload.credentialRotation) || Boolean(payload.keyRotation) || Boolean(payload.landing) || Boolean(payload.setup) || payload.warRoom !== null && payload.warRoom.priorityCount > 0;
|
|
49763
49835
|
if (!hasAny) {
|
|
49764
49836
|
lines.push(
|
|
49765
49837
|
`${c.green("\u2713")} You're all clear \u2014 nothing needs you right now.`
|
|
@@ -49833,6 +49905,11 @@ function renderStatus2(payload, plain, apiUrl) {
|
|
|
49833
49905
|
if (url2) lines.push(` ${c.dim("\u2192")} ${link("Open rotation", url2)}`);
|
|
49834
49906
|
lines.push("");
|
|
49835
49907
|
}
|
|
49908
|
+
if (payload.setup) {
|
|
49909
|
+
lines.push(c.bold("Setup"));
|
|
49910
|
+
lines.push(` ${payload.setup.line}`);
|
|
49911
|
+
lines.push("");
|
|
49912
|
+
}
|
|
49836
49913
|
if (payload.keyRotation) {
|
|
49837
49914
|
const k = payload.keyRotation;
|
|
49838
49915
|
lines.push(c.bold("Key rotation"));
|