@great-arrow/cli 0.1.45 → 0.1.46
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 +16 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9399,7 +9399,7 @@ function isNodeError(value) {
|
|
|
9399
9399
|
|
|
9400
9400
|
// src/lib/version.ts
|
|
9401
9401
|
var CLI_PACKAGE_NAME = "@great-arrow/cli";
|
|
9402
|
-
var CLI_VERSION = "0.1.
|
|
9402
|
+
var CLI_VERSION = "0.1.46";
|
|
9403
9403
|
var GAD_INSTALL_VERSION = "2026.08.08";
|
|
9404
9404
|
var GAD_INSTALL_MIN_VERSION = "2026.06.22";
|
|
9405
9405
|
var GAD_INSTALL_HEADER = "X-GAD-Install-Version";
|
|
@@ -16570,6 +16570,18 @@ function firstCommand(argv) {
|
|
|
16570
16570
|
}
|
|
16571
16571
|
return null;
|
|
16572
16572
|
}
|
|
16573
|
+
var PRE_DISPATCH_REFUSALS = /* @__PURE__ */ new Set([
|
|
16574
|
+
"workspace_choice_required"
|
|
16575
|
+
]);
|
|
16576
|
+
function refusedBeforeTool(result) {
|
|
16577
|
+
if (typeof result !== "object" || result === null) return false;
|
|
16578
|
+
const r = result;
|
|
16579
|
+
if (r.isError !== true) return false;
|
|
16580
|
+
const body = parseMcpPayload(r.content);
|
|
16581
|
+
if (typeof body !== "object" || body === null) return false;
|
|
16582
|
+
const code = body.error;
|
|
16583
|
+
return typeof code === "string" && PRE_DISPATCH_REFUSALS.has(code);
|
|
16584
|
+
}
|
|
16573
16585
|
async function fetchGlance(apiUrl, token, includeTip) {
|
|
16574
16586
|
const controller = new AbortController();
|
|
16575
16587
|
const timer = setTimeout(() => controller.abort(), fetchBudgetMs(includeTip));
|
|
@@ -16600,6 +16612,9 @@ async function fetchGlance(apiUrl, token, includeTip) {
|
|
|
16600
16612
|
}
|
|
16601
16613
|
const data = await response.json();
|
|
16602
16614
|
if (data.error) return { payload: null, tipMaybeSpent };
|
|
16615
|
+
if (refusedBeforeTool(data.result)) {
|
|
16616
|
+
return { payload: null, tipMaybeSpent: false };
|
|
16617
|
+
}
|
|
16603
16618
|
return {
|
|
16604
16619
|
payload: normalizeGlance(
|
|
16605
16620
|
parseMcpPayload(data.result?.content ?? data.result)
|