@cortexkit/anthropic-auth-core 2.7.3 → 2.8.0

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.
@@ -46,5 +46,7 @@ export declare function applyClaudeCodeHeaders(headers: Headers, accessToken: st
46
46
  */
47
47
  requestClass?: ClaudeCodeRequestClass;
48
48
  }): Headers;
49
- export declare function orderClaudeCodeBody<T extends Record<string, unknown>>(body: T): T;
49
+ export declare function orderClaudeCodeBody<T extends Record<string, unknown>>(body: T, options?: {
50
+ isOAuth?: boolean;
51
+ }): T;
50
52
  export declare function claudeCodeEntrypoint(): string;
package/dist/index.js CHANGED
@@ -9069,6 +9069,18 @@ var FABLE_MYTHOS_5_1_CATALOGUE = {
9069
9069
  cacheWrite1h: 20
9070
9070
  }
9071
9071
  };
9072
+ var FABLE_5_2_CATALOGUE = {
9073
+ releaseDate: "2026-11-09",
9074
+ contextWindow: 1e6,
9075
+ maxOutputTokens: 128000,
9076
+ pricing: {
9077
+ input: 8,
9078
+ output: 40,
9079
+ cacheRead: 0.2,
9080
+ cacheWrite5m: 10,
9081
+ cacheWrite1h: 16
9082
+ }
9083
+ };
9072
9084
  var CLAUDE_MODEL_CAPABILITIES = [
9073
9085
  {
9074
9086
  id: "claude-fable-5",
@@ -9142,6 +9154,24 @@ var CLAUDE_MODEL_CAPABILITIES = [
9142
9154
  scopedQuota: "mythos",
9143
9155
  fastMode: false
9144
9156
  },
9157
+ {
9158
+ id: "claude-fable-5-2",
9159
+ name: "Claude Fable 5.2",
9160
+ family: "fable",
9161
+ idSuffixes: "any",
9162
+ catalogue: FABLE_5_2_CATALOGUE,
9163
+ thinkingModes: ["adaptive"],
9164
+ rejectsForcedToolChoice: true,
9165
+ efforts: { variants: ALL_ADAPTIVE_EFFORTS, default: "medium" },
9166
+ effortMarkers: "always",
9167
+ turnEndNote: true,
9168
+ thinkingBindingControls: true,
9169
+ claudeCodeBetas: claudeCodeBetaLists({ perTurnControl: true }),
9170
+ serverSideFallback: true,
9171
+ refusalRecoveryFamily: "fable-5-2",
9172
+ scopedQuota: "fable",
9173
+ fastMode: false
9174
+ },
9145
9175
  {
9146
9176
  id: "claude-opus-5",
9147
9177
  name: "Claude Opus 5",
@@ -13911,13 +13941,15 @@ var BODY_FIELD_ORDER = [
13911
13941
  "stream",
13912
13942
  "speed"
13913
13943
  ];
13914
- function orderClaudeCodeBody(body) {
13944
+ function orderClaudeCodeBody(body, options = {}) {
13915
13945
  const ordered = {};
13916
13946
  for (const key of BODY_FIELD_ORDER) {
13917
13947
  if (Object.hasOwn(body, key))
13918
13948
  ordered[key] = body[key];
13919
13949
  }
13920
13950
  for (const [key, value] of Object.entries(body)) {
13951
+ if (options.isOAuth && key === "service_tier")
13952
+ continue;
13921
13953
  if (!Object.hasOwn(ordered, key))
13922
13954
  ordered[key] = value;
13923
13955
  }
@@ -14615,6 +14647,7 @@ async function dumpResponseArtifact(handle, input) {
14615
14647
  var CLAUDE_FABLE_5_MODEL_ID = "claude-fable-5";
14616
14648
  var CLAUDE_MYTHOS_5_MODEL_ID = "claude-mythos-5";
14617
14649
  var CLAUDE_FABLE_5_1_MODEL_ID = "claude-fable-5-1";
14650
+ var CLAUDE_FABLE_5_2_MODEL_ID = "claude-fable-5-2";
14618
14651
  var CLAUDE_MYTHOS_5_1_MODEL_ID = "claude-mythos-5-1";
14619
14652
  var CLAUDE_HAIKU_4_5_MODEL_ID = "claude-haiku-4-5";
14620
14653
  var CLAUDE_HAIKU_4_5_PRICING = {
@@ -14628,7 +14661,8 @@ var CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS = [
14628
14661
  var CLAUDE_FABLE_MYTHOS_5_MODEL_IDS = [
14629
14662
  CLAUDE_FABLE_5_MODEL_ID,
14630
14663
  CLAUDE_MYTHOS_5_MODEL_ID,
14631
- ...CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS
14664
+ ...CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS,
14665
+ CLAUDE_FABLE_5_2_MODEL_ID
14632
14666
  ];
14633
14667
  var CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING = {
14634
14668
  type: "adaptive",
@@ -14636,8 +14670,11 @@ var CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING = {
14636
14670
  };
14637
14671
  var FABLE_5_CATALOGUE = getClaudeModelCatalogue(CLAUDE_FABLE_5_MODEL_ID);
14638
14672
  var FABLE_5_1_CATALOGUE = getClaudeModelCatalogue(CLAUDE_FABLE_5_1_MODEL_ID);
14673
+ var FABLE_5_2_CATALOGUE2 = getClaudeModelCatalogue(CLAUDE_FABLE_5_2_MODEL_ID);
14639
14674
  var CLAUDE_FABLE_MYTHOS_5_PRICING = FABLE_5_CATALOGUE.pricing;
14640
14675
  var CLAUDE_FABLE_MYTHOS_5_1_PRICING = FABLE_5_1_CATALOGUE.pricing;
14676
+ var CLAUDE_FABLE_5_2_PRICING = FABLE_5_2_CATALOGUE2.pricing;
14677
+ var CLAUDE_FABLE_5_2_RELEASE_DATE = FABLE_5_2_CATALOGUE2.releaseDate;
14641
14678
  var CLAUDE_FABLE_MYTHOS_5_CONTEXT_WINDOW = FABLE_5_CATALOGUE.contextWindow;
14642
14679
  var CLAUDE_FABLE_MYTHOS_5_MAX_OUTPUT_TOKENS = FABLE_5_CATALOGUE.maxOutputTokens;
14643
14680
  var CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE = FABLE_5_CATALOGUE.releaseDate;
@@ -14670,7 +14707,8 @@ function isClaudeFable51Model(model) {
14670
14707
  return resolvedModelId(model) === CLAUDE_FABLE_5_1_MODEL_ID;
14671
14708
  }
14672
14709
  function getClaudeFableMythos5ReleaseDate(model) {
14673
- return isClaudeFableOrMythos51Model(model) ? CLAUDE_FABLE_MYTHOS_5_1_RELEASE_DATE : CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE;
14710
+ const row = resolveClaudeModelCapabilities(model);
14711
+ return isFableOrMythosRow(row) && row?.catalogue?.releaseDate || CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE;
14674
14712
  }
14675
14713
  var CLAUDE_SONNET_5_MODEL_ID = "claude-sonnet-5";
14676
14714
  var CLAUDE_SONNET_5_ADAPTIVE_THINKING = CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING;
@@ -16634,7 +16672,7 @@ async function buildCacheKeepPrewarmBody(bodyText, options = {}) {
16634
16672
  if (toolChoice?.type === "tool" || toolChoice?.type === "any") {
16635
16673
  delete warm.tool_choice;
16636
16674
  }
16637
- const signedBodyText = await signRequestBody(JSON.stringify(orderClaudeCodeBody(warm)));
16675
+ const signedBodyText = await signRequestBody(JSON.stringify(orderClaudeCodeBody(warm, { isOAuth: true })));
16638
16676
  return { ok: true, bodyText: signedBodyText };
16639
16677
  }
16640
16678
  function updateAcceptedUsage(target, bodyText, usage) {
@@ -44592,6 +44630,9 @@ export {
44592
44630
  CLAUDE_FABLE_MYTHOS_5_1_MODEL_SPECS,
44593
44631
  CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS,
44594
44632
  CLAUDE_FABLE_5_MODEL_ID,
44633
+ CLAUDE_FABLE_5_2_RELEASE_DATE,
44634
+ CLAUDE_FABLE_5_2_PRICING,
44635
+ CLAUDE_FABLE_5_2_MODEL_ID,
44595
44636
  CLAUDE_FABLE_5_1_MODEL_ID,
44596
44637
  CLAUDE_DUMP_COMMAND_NAME,
44597
44638
  CLAUDE_CODE_VERSION,
@@ -21,7 +21,7 @@ export declare function normalizeAdaptiveEffort(value: unknown): AdaptiveEffort
21
21
  export declare function usesPerTurnControl(model: unknown): boolean;
22
22
  /**
23
23
  * Models whose OAuth requests carry `PER_TURN_CONTROL_BETA`: those whose
24
- * Claude Code main beta list includes it (Opus 5.5, Sonnet 5.5, Fable 5.1 and
24
+ * Claude Code main beta list includes it (Opus 5.5, Sonnet 5.5, Fable 5.1/5.2 and
25
25
  * Haiku 5.5 in Claude Code 2.1.302). Sending the beta does not by itself make
26
26
  * a model eligible for effort markers; `supportsPerMessageEffort` decides that.
27
27
  */
@@ -29,7 +29,7 @@ export declare function sendsPerTurnControlBeta(model: unknown): boolean;
29
29
  /**
30
30
  * Whether a request may move effort changes into empty system messages.
31
31
  *
32
- * Models with `effortMarkers: "always"` (Fable 5.1) are always eligible,
32
+ * Models with `effortMarkers: "always"` (Fable 5.1/5.2) are always eligible,
33
33
  * whatever the thinking field says. Models with `"with-adaptive-thinking"`
34
34
  * (Opus 5.5, Sonnet 5.5) qualify only with adaptive thinking: Anthropic
35
35
  * rejects a differing per-message effort with HTTP 400 on Sonnet 5.5
@@ -55,7 +55,7 @@ export type ClaudeModelCatalogue = {
55
55
  };
56
56
  };
57
57
  /** Source-model keys for content-filter recovery to Opus 4.8 in OpenCode. */
58
- export type ClaudeRefusalRecoveryFamily = 'fable-5' | 'fable-5-1' | 'opus-5' | 'opus-5-5';
58
+ export type ClaudeRefusalRecoveryFamily = 'fable-5' | 'fable-5-1' | 'fable-5-2' | 'opus-5' | 'opus-5-5';
59
59
  export type ClaudeModelCapabilities = {
60
60
  /** Exact Anthropic model id. */
61
61
  id: string;
package/dist/models.d.ts CHANGED
@@ -3,6 +3,7 @@ export { normalizeAnthropicModelId };
3
3
  export declare const CLAUDE_FABLE_5_MODEL_ID = "claude-fable-5";
4
4
  export declare const CLAUDE_MYTHOS_5_MODEL_ID = "claude-mythos-5";
5
5
  export declare const CLAUDE_FABLE_5_1_MODEL_ID = "claude-fable-5-1";
6
+ export declare const CLAUDE_FABLE_5_2_MODEL_ID = "claude-fable-5-2";
6
7
  export declare const CLAUDE_MYTHOS_5_1_MODEL_ID = "claude-mythos-5-1";
7
8
  /**
8
9
  * Haiku 4.5 model identifier used by `/claude-prime` to start each OAuth
@@ -21,7 +22,7 @@ export declare const CLAUDE_HAIKU_4_5_PRICING: {
21
22
  readonly output: 5;
22
23
  };
23
24
  export declare const CLAUDE_FABLE_MYTHOS_5_1_MODEL_IDS: readonly ["claude-fable-5-1", "claude-mythos-5-1"];
24
- export declare const CLAUDE_FABLE_MYTHOS_5_MODEL_IDS: readonly ["claude-fable-5", "claude-mythos-5", "claude-fable-5-1", "claude-mythos-5-1"];
25
+ export declare const CLAUDE_FABLE_MYTHOS_5_MODEL_IDS: readonly ["claude-fable-5", "claude-mythos-5", "claude-fable-5-1", "claude-mythos-5-1", "claude-fable-5-2"];
25
26
  export type ClaudeFableMythos5ModelId = (typeof CLAUDE_FABLE_MYTHOS_5_MODEL_IDS)[number];
26
27
  export declare const CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING: {
27
28
  readonly type: 'adaptive';
@@ -29,6 +30,8 @@ export declare const CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING: {
29
30
  };
30
31
  export declare const CLAUDE_FABLE_MYTHOS_5_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
31
32
  export declare const CLAUDE_FABLE_MYTHOS_5_1_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
33
+ export declare const CLAUDE_FABLE_5_2_PRICING: import("./model-capabilities.ts").ClaudeModelPricing;
34
+ export declare const CLAUDE_FABLE_5_2_RELEASE_DATE: string;
32
35
  export declare const CLAUDE_FABLE_MYTHOS_5_CONTEXT_WINDOW: number;
33
36
  export declare const CLAUDE_FABLE_MYTHOS_5_MAX_OUTPUT_TOKENS: number;
34
37
  export declare const CLAUDE_FABLE_MYTHOS_5_RELEASE_DATE: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/anthropic-auth-core",
3
- "version": "2.7.3",
3
+ "version": "2.8.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",