@marcusrbrown/infra 0.26.2 → 0.26.3
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/cli.js +42 -5
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6950,7 +6950,7 @@ import { goke } from "goke";
|
|
|
6950
6950
|
// package.json
|
|
6951
6951
|
var package_default = {
|
|
6952
6952
|
name: "@marcusrbrown/infra",
|
|
6953
|
-
version: "0.26.
|
|
6953
|
+
version: "0.26.3",
|
|
6954
6954
|
description: "Infrastructure management CLI \u2014 deploy automation, health checks, and MCP bridge",
|
|
6955
6955
|
keywords: [
|
|
6956
6956
|
"infra",
|
|
@@ -10670,6 +10670,32 @@ async function checkRunningVersion(host, spawn = defaultSpawn) {
|
|
|
10670
10670
|
}
|
|
10671
10671
|
}
|
|
10672
10672
|
var DEFAULT_PROVIDER_MODEL = "claude-sonnet-4-6";
|
|
10673
|
+
async function readBodyText(response) {
|
|
10674
|
+
try {
|
|
10675
|
+
return await response.text();
|
|
10676
|
+
} catch {
|
|
10677
|
+
return "";
|
|
10678
|
+
}
|
|
10679
|
+
}
|
|
10680
|
+
var PROVIDER_MISSING_MESSAGE = /unknown provider for model/i;
|
|
10681
|
+
function isProviderMissingBody(bodyText) {
|
|
10682
|
+
let parsed;
|
|
10683
|
+
try {
|
|
10684
|
+
parsed = JSON.parse(bodyText);
|
|
10685
|
+
} catch {
|
|
10686
|
+
return PROVIDER_MISSING_MESSAGE.test(bodyText);
|
|
10687
|
+
}
|
|
10688
|
+
if (typeof parsed === "object" && parsed !== null && "error" in parsed) {
|
|
10689
|
+
const { error } = parsed;
|
|
10690
|
+
if (typeof error === "object" && error !== null) {
|
|
10691
|
+
if ("code" in error && error.code === "model_not_found")
|
|
10692
|
+
return true;
|
|
10693
|
+
if ("message" in error && typeof error.message === "string")
|
|
10694
|
+
return PROVIDER_MISSING_MESSAGE.test(error.message);
|
|
10695
|
+
}
|
|
10696
|
+
}
|
|
10697
|
+
return PROVIDER_MISSING_MESSAGE.test(bodyText);
|
|
10698
|
+
}
|
|
10673
10699
|
async function runProviderAuthProbe(baseUrl, apiKey, options) {
|
|
10674
10700
|
const model = options?.model ?? DEFAULT_PROVIDER_MODEL;
|
|
10675
10701
|
const verbose = options?.verbose === true;
|
|
@@ -10716,11 +10742,22 @@ async function runProviderAuthProbe(baseUrl, apiKey, options) {
|
|
|
10716
10742
|
}
|
|
10717
10743
|
};
|
|
10718
10744
|
}
|
|
10745
|
+
if (response.status === 400) {
|
|
10746
|
+
const bodyText = await readBodyText(response);
|
|
10747
|
+
if (isProviderMissingBody(bodyText)) {
|
|
10748
|
+
return {
|
|
10749
|
+
classification: { state: "dead", reason: "provider-missing" },
|
|
10750
|
+
human: {
|
|
10751
|
+
title: "Upstream provider auth (anthropic)",
|
|
10752
|
+
level: "error",
|
|
10753
|
+
summary: `Anthropic provider not registered for ${model} (HTTP ${response.status}) \u2014 check /v1/models; run: cliproxy login claude`,
|
|
10754
|
+
details: details.length > 0 ? details : undefined
|
|
10755
|
+
}
|
|
10756
|
+
};
|
|
10757
|
+
}
|
|
10758
|
+
}
|
|
10719
10759
|
if (response.status === 503) {
|
|
10720
|
-
|
|
10721
|
-
try {
|
|
10722
|
-
bodyText = await response.text();
|
|
10723
|
-
} catch {}
|
|
10760
|
+
const bodyText = await readBodyText(response);
|
|
10724
10761
|
const isAuthUnavailable = /auth_unavailable|no auth available|providers=claude/i.test(bodyText);
|
|
10725
10762
|
if (isAuthUnavailable) {
|
|
10726
10763
|
return {
|