@openclaw/chutes-provider 2026.6.9-beta.1 → 2026.6.10-beta.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/oauth.js CHANGED
@@ -3,6 +3,7 @@ import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runti
3
3
  import { randomBytes } from "node:crypto";
4
4
  import { resolveExpiresAtMsFromDurationSeconds } from "openclaw/plugin-sdk/number-runtime";
5
5
  import { parseOAuthCallbackInput, waitForLocalOAuthCallback } from "openclaw/plugin-sdk/provider-auth-runtime";
6
+ import { readResponseTextLimited } from "openclaw/plugin-sdk/provider-http";
6
7
  //#region extensions/chutes/oauth.ts
7
8
  /**
8
9
  * Chutes OAuth PKCE login flow.
@@ -10,6 +11,7 @@ import { parseOAuthCallbackInput, waitForLocalOAuthCallback } from "openclaw/plu
10
11
  const CHUTES_AUTHORIZE_ENDPOINT = "https://api.chutes.ai/idp/authorize";
11
12
  const CHUTES_TOKEN_ENDPOINT = "https://api.chutes.ai/idp/token";
12
13
  const CHUTES_USERINFO_ENDPOINT = "https://api.chutes.ai/idp/userinfo";
14
+ const CHUTES_TOKEN_ERROR_BODY_LIMIT_BYTES = 8 * 1024;
13
15
  function parseRedirectUri(redirectUri) {
14
16
  const url = new URL(redirectUri);
15
17
  if (url.protocol !== "http:") throw new Error(`Chutes OAuth redirect URI must be http:// (got ${redirectUri})`);
@@ -70,7 +72,10 @@ async function exchangeChutesCodeForTokens(params) {
70
72
  headers: { "Content-Type": "application/x-www-form-urlencoded" },
71
73
  body
72
74
  });
73
- if (!response.ok) throw new Error(`Chutes token exchange failed: ${await response.text()}`);
75
+ if (!response.ok) {
76
+ const detail = await readResponseTextLimited(response, CHUTES_TOKEN_ERROR_BODY_LIMIT_BYTES).catch(() => "");
77
+ throw new Error(`Chutes token exchange failed: ${detail}`);
78
+ }
74
79
  const data = await response.json();
75
80
  const access = normalizeOptionalString(data.access_token);
76
81
  const refresh = normalizeOptionalString(data.refresh_token);
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@openclaw/chutes-provider",
3
- "version": "2026.6.9-beta.1",
3
+ "version": "2026.6.10-beta.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@openclaw/chutes-provider",
9
- "version": "2026.6.9-beta.1"
9
+ "version": "2026.6.10-beta.1"
10
10
  }
11
11
  }
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/chutes-provider",
3
- "version": "2026.6.9-beta.1",
3
+ "version": "2026.6.10-beta.1",
4
4
  "description": "OpenClaw Chutes.ai provider plugin.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,10 +18,10 @@
18
18
  "minHostVersion": ">=2026.6.8"
19
19
  },
20
20
  "compat": {
21
- "pluginApi": ">=2026.6.9-beta.1"
21
+ "pluginApi": ">=2026.6.10-beta.1"
22
22
  },
23
23
  "build": {
24
- "openclawVersion": "2026.6.9-beta.1",
24
+ "openclawVersion": "2026.6.10-beta.1",
25
25
  "bundledDist": false
26
26
  },
27
27
  "release": {
@@ -39,7 +39,7 @@
39
39
  "README.md"
40
40
  ],
41
41
  "peerDependencies": {
42
- "openclaw": ">=2026.6.9-beta.1"
42
+ "openclaw": ">=2026.6.10-beta.1"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "openclaw": {