@yagni-app/code-staging 1.2.15-staging.2596.1 → 1.2.15-staging.2655.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/dist/extension/config.js +14 -1
- package/package.json +2 -2
package/dist/extension/config.js
CHANGED
|
@@ -74,6 +74,16 @@ export function tokenExpiryNotice(expiresAt, nowMs, thresholdMs = EXPIRY_NOTICE_
|
|
|
74
74
|
}
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
|
+
/** The `message` a refusal's JSON body carries, or null when it has none. */
|
|
78
|
+
async function serverMessage(res) {
|
|
79
|
+
try {
|
|
80
|
+
const body = (await res.json());
|
|
81
|
+
return typeof body.message === "string" && body.message.trim() ? body.message : null;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
77
87
|
/**
|
|
78
88
|
* Fetch the YAGNI model catalog at startup.
|
|
79
89
|
*
|
|
@@ -83,7 +93,10 @@ export function tokenExpiryNotice(expiresAt, nowMs, thresholdMs = EXPIRY_NOTICE_
|
|
|
83
93
|
export async function fetchCatalog(opts) {
|
|
84
94
|
const res = await resilientFetch(`${opts.baseUrl}/api/yagni-code/models`, { method: "GET", headers: { authorization: `Bearer ${opts.getToken() ?? ""}` } }, { fetchImpl: opts.fetchImpl });
|
|
85
95
|
if (!res.ok) {
|
|
86
|
-
|
|
96
|
+
// A 409 is the workspace's settings, not the login: say the server's words.
|
|
97
|
+
const conflict = res.status === 409 ? await serverMessage(res) : null;
|
|
98
|
+
throw new Error(conflict ??
|
|
99
|
+
`Failed to fetch YAGNI model catalog (HTTP ${res.status}). Run \`yagni login\` to re-authenticate.`);
|
|
87
100
|
}
|
|
88
101
|
const data = (await res.json());
|
|
89
102
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.2.15-staging.
|
|
3
|
+
"version": "1.2.15-staging.2655.1",
|
|
4
4
|
"description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"turndown": "^7.2.4",
|
|
59
59
|
"typebox": "^1.3.15"
|
|
60
60
|
},
|
|
61
|
-
"yagniSourceSha": "
|
|
61
|
+
"yagniSourceSha": "665a57fe6cd088a644c836db98d805b8e91d6b84"
|
|
62
62
|
}
|