opencode-anthropic-fix 0.0.28 → 0.0.29
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/index.mjs +10 -9
- package/lib/oauth.mjs +1 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -2875,18 +2875,19 @@ process.once("beforeExit", () => {
|
|
|
2875
2875
|
// Request building helpers (extracted from original fetch interceptor)
|
|
2876
2876
|
// ---------------------------------------------------------------------------
|
|
2877
2877
|
|
|
2878
|
-
const FALLBACK_CLAUDE_CLI_VERSION = "2.1.
|
|
2878
|
+
const FALLBACK_CLAUDE_CLI_VERSION = "2.1.83";
|
|
2879
2879
|
const CLAUDE_CODE_NPM_LATEST_URL = "https://registry.npmjs.org/@anthropic-ai/claude-code/latest";
|
|
2880
2880
|
|
|
2881
|
-
// The @anthropic-ai/sdk version bundled with Claude Code v2.1.
|
|
2881
|
+
// The @anthropic-ai/sdk version bundled with Claude Code v2.1.83.
|
|
2882
2882
|
// This is distinct from the CLI version and goes in X-Stainless-Package-Version.
|
|
2883
|
-
|
|
2883
|
+
// Verified by extracting VERSION="0.208.0" from the bundled cli.js of v2.1.80/2.1.81/2.1.83.
|
|
2884
|
+
const ANTHROPIC_SDK_VERSION = "0.208.0";
|
|
2884
2885
|
|
|
2885
2886
|
// Map of CLI version → bundled SDK version (update when CLI version changes)
|
|
2886
2887
|
const CLI_TO_SDK_VERSION = new Map([
|
|
2887
|
-
["2.1.
|
|
2888
|
-
["2.1.
|
|
2889
|
-
["2.1.
|
|
2888
|
+
["2.1.83", "0.208.0"],
|
|
2889
|
+
["2.1.81", "0.208.0"],
|
|
2890
|
+
["2.1.80", "0.208.0"],
|
|
2890
2891
|
]);
|
|
2891
2892
|
|
|
2892
2893
|
/**
|
|
@@ -3334,9 +3335,9 @@ function buildRequestMetadata(input) {
|
|
|
3334
3335
|
|
|
3335
3336
|
/**
|
|
3336
3337
|
* Build the billing header block for Claude Code system prompt injection.
|
|
3337
|
-
* Claude Code v2.1.81
|
|
3338
|
+
* Claude Code v2.1.81+: cch computed via NP1() from first user message, cc_version includes model ID.
|
|
3338
3339
|
*
|
|
3339
|
-
* @param {string} version - CLI version (e.g., "2.1.
|
|
3340
|
+
* @param {string} version - CLI version (e.g., "2.1.83")
|
|
3340
3341
|
* @param {string} [modelId] - Model ID to append (e.g., "claude-opus-4-6")
|
|
3341
3342
|
* @param {string} [firstUserMessage] - First user message text for cch hash computation
|
|
3342
3343
|
* @returns {string}
|
|
@@ -3659,7 +3660,7 @@ function buildAnthropicBetaHeader(
|
|
|
3659
3660
|
const haiku = isHaikuModel(model);
|
|
3660
3661
|
const isRoundRobin = strategy === "round-robin";
|
|
3661
3662
|
|
|
3662
|
-
// === ALWAYS-ON BETAS (Claude Code v2.1.
|
|
3663
|
+
// === ALWAYS-ON BETAS (Claude Code v2.1.83 base set) ===
|
|
3663
3664
|
// These are ALWAYS included regardless of env vars or feature flags.
|
|
3664
3665
|
if (!haiku) {
|
|
3665
3666
|
betas.push(CLAUDE_CODE_BETA_FLAG); // "claude-code-20250219"
|
package/lib/oauth.mjs
CHANGED
|
@@ -13,7 +13,7 @@ const OAUTH_TOKEN_URL = `https://${OAUTH_CONSOLE_HOST}/v1/oauth/token`;
|
|
|
13
13
|
const OAUTH_REVOKE_URL = `https://${OAUTH_CONSOLE_HOST}/v1/oauth/revoke`;
|
|
14
14
|
// Real Claude Code uses axios 1.13.6 for OAuth calls — axios sets User-Agent
|
|
15
15
|
// automatically and adds Accept header. We must match this fingerprint exactly.
|
|
16
|
-
// CLI version profile: 2.1.
|
|
16
|
+
// CLI version profile: 2.1.83 (for reference; not sent on OAuth calls)
|
|
17
17
|
const OAUTH_AXIOS_VERSION = "1.13.6";
|
|
18
18
|
const OAUTH_USER_AGENT = `axios/${OAUTH_AXIOS_VERSION}`;
|
|
19
19
|
const OAUTH_ACCEPT = "application/json, text/plain, */*";
|