@yagni-app/code-staging 1.0.9-staging.1293.1 → 1.0.9-staging.1306.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.
|
@@ -52,9 +52,9 @@ export interface ResilientFetchOpts {
|
|
|
52
52
|
export declare function resilientFetch(url: string, init: RequestInit, opts?: ResilientFetchOpts): Promise<Response>;
|
|
53
53
|
/**
|
|
54
54
|
* Map a non-ok response to a friendly, body-truncated message for a tool's throw.
|
|
55
|
-
*
|
|
56
|
-
* status plus a capped slice of the body so a giant
|
|
57
|
-
* agent. No em-dashes (house copy rule).
|
|
55
|
+
* Authentication failures get a re-login hint; permission denials stay distinct.
|
|
56
|
+
* Other failures carry the status plus a capped slice of the body so a giant
|
|
57
|
+
* HTML error never floods the agent. No em-dashes (house copy rule).
|
|
58
58
|
*/
|
|
59
59
|
export declare function friendlyFetchError(label: string, res: Response): Promise<string>;
|
|
60
60
|
//# sourceMappingURL=resilientFetch.d.ts.map
|
|
@@ -105,9 +105,9 @@ export async function resilientFetch(url, init, opts = {}) {
|
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* Map a non-ok response to a friendly, body-truncated message for a tool's throw.
|
|
108
|
-
*
|
|
109
|
-
* status plus a capped slice of the body so a giant
|
|
110
|
-
* agent. No em-dashes (house copy rule).
|
|
108
|
+
* Authentication failures get a re-login hint; permission denials stay distinct.
|
|
109
|
+
* Other failures carry the status plus a capped slice of the body so a giant
|
|
110
|
+
* HTML error never floods the agent. No em-dashes (house copy rule).
|
|
111
111
|
*/
|
|
112
112
|
export async function friendlyFetchError(label, res) {
|
|
113
113
|
let body = "";
|
|
@@ -119,9 +119,12 @@ export async function friendlyFetchError(label, res) {
|
|
|
119
119
|
}
|
|
120
120
|
if (body.length > MAX_ERROR_BODY)
|
|
121
121
|
body = `${body.slice(0, MAX_ERROR_BODY)} ...`;
|
|
122
|
-
if (res.status === 401
|
|
122
|
+
if (res.status === 401) {
|
|
123
123
|
return `${label} is not authorized (HTTP ${res.status}). Run \`yagni login\` to re-authenticate.`;
|
|
124
124
|
}
|
|
125
|
+
if (res.status === 403) {
|
|
126
|
+
return `${label} does not have permission (HTTP 403). Report the permission limitation if it blocks the task.`;
|
|
127
|
+
}
|
|
125
128
|
if (res.status === 429) {
|
|
126
129
|
return `${label} was rate limited (HTTP 429). Try again in a moment.`;
|
|
127
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.0.9-staging.
|
|
3
|
+
"version": "1.0.9-staging.1306.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": "b15d63d89acab434f4e2c9f20d60337cffb4a0c3"
|
|
62
62
|
}
|