@cortexkit/anthropic-auth-core 1.17.0 → 1.18.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.
- package/dist/accounts.js +5 -1
- package/dist/constants.js +2 -1
- package/dist/fast.js +1 -1
- package/dist/models.d.ts +14 -0
- package/dist/models.js +15 -0
- package/package.json +1 -1
package/dist/accounts.js
CHANGED
|
@@ -1072,7 +1072,11 @@ export async function acquireRefreshFileLock(options) {
|
|
|
1072
1072
|
await writeFile(evictOwnerPath, `${JSON.stringify({ ownerId: evictOwnerId, createdAt: now() })}\n`, { encoding: 'utf8', mode: 0o600, flag: 'wx' });
|
|
1073
1073
|
}
|
|
1074
1074
|
catch (error) {
|
|
1075
|
-
|
|
1075
|
+
const code = error.code;
|
|
1076
|
+
// Another contender can rename the marker directory between mkdir and
|
|
1077
|
+
// this exclusive create. Darwin/Bun reports that lost-parent race as
|
|
1078
|
+
// either ENOENT or EINVAL; both mean this contender lost the marker.
|
|
1079
|
+
if (code === 'ENOENT' || code === 'EINVAL')
|
|
1076
1080
|
return false;
|
|
1077
1081
|
await releaseEvictionMarker();
|
|
1078
1082
|
throw error;
|
package/dist/constants.js
CHANGED
|
@@ -32,7 +32,8 @@ export function isFastModeSupportedModel(model) {
|
|
|
32
32
|
return (typeof model === 'string' &&
|
|
33
33
|
(model.startsWith('claude-opus-4-6') ||
|
|
34
34
|
model.startsWith('claude-opus-4-7') ||
|
|
35
|
-
model.startsWith('claude-opus-4-8')
|
|
35
|
+
model.startsWith('claude-opus-4-8') ||
|
|
36
|
+
model.startsWith('claude-opus-5')));
|
|
36
37
|
}
|
|
37
38
|
export const OPENCODE_IDENTITY_PREFIX = 'You are OpenCode';
|
|
38
39
|
export const CLAUDE_CODE_IDENTITY = "You are Claude Code, Anthropic's official CLI for Claude.";
|
package/dist/fast.js
CHANGED
|
@@ -32,7 +32,7 @@ export function buildFastModeStatusSummary(input) {
|
|
|
32
32
|
`- Enabled: ${enabled ? 'enabled' : 'disabled'}`,
|
|
33
33
|
'- Persisted: ~/.config/opencode/anthropic-auth.json',
|
|
34
34
|
'- Scope: adds Anthropic fast mode to supported Opus requests',
|
|
35
|
-
'- Supported models: claude-opus-4-6, claude-opus-4-7,
|
|
35
|
+
'- Supported models: claude-opus-4-6, claude-opus-4-7, claude-opus-4-8, and claude-opus-5',
|
|
36
36
|
'- Request changes: adds `speed: "fast"` and the `fast-mode-2026-02-01` beta header',
|
|
37
37
|
'- Note: fast and standard speeds do not share prompt-cache prefixes',
|
|
38
38
|
].join('\n');
|
package/dist/models.d.ts
CHANGED
|
@@ -34,4 +34,18 @@ export declare const CLAUDE_SONNET_5_ADAPTIVE_THINKING: {
|
|
|
34
34
|
readonly display: "summarized";
|
|
35
35
|
};
|
|
36
36
|
export declare function isClaudeSonnet5Model(model: unknown): boolean;
|
|
37
|
+
export declare const CLAUDE_OPUS_5_MODEL_ID = "claude-opus-5";
|
|
38
|
+
/**
|
|
39
|
+
* Opus 5 has the same adaptive-thinking-by-default + `display: "omitted"`
|
|
40
|
+
* shape as Sonnet 5, so the injected thinking must also be summarized to be
|
|
41
|
+
* visible. Kept as its own constant per the PR #100 lesson — hook callers
|
|
42
|
+
* should reference the per-family name (`CLAUDE_OPUS_5_ADAPTIVE_THINKING`,
|
|
43
|
+
* not the Fable/Mythos alias) so a future divergence between the families
|
|
44
|
+
* only changes this re-export, not every call site.
|
|
45
|
+
*/
|
|
46
|
+
export declare const CLAUDE_OPUS_5_ADAPTIVE_THINKING: {
|
|
47
|
+
readonly type: "adaptive";
|
|
48
|
+
readonly display: "summarized";
|
|
49
|
+
};
|
|
50
|
+
export declare function isClaudeOpus5Model(model: unknown): boolean;
|
|
37
51
|
export declare function isOpenAIReasoningSignature(value: unknown): boolean;
|
package/dist/models.js
CHANGED
|
@@ -46,6 +46,21 @@ export function isClaudeSonnet5Model(model) {
|
|
|
46
46
|
(model === CLAUDE_SONNET_5_MODEL_ID ||
|
|
47
47
|
model.startsWith(`${CLAUDE_SONNET_5_MODEL_ID}-`)));
|
|
48
48
|
}
|
|
49
|
+
export const CLAUDE_OPUS_5_MODEL_ID = 'claude-opus-5';
|
|
50
|
+
/**
|
|
51
|
+
* Opus 5 has the same adaptive-thinking-by-default + `display: "omitted"`
|
|
52
|
+
* shape as Sonnet 5, so the injected thinking must also be summarized to be
|
|
53
|
+
* visible. Kept as its own constant per the PR #100 lesson — hook callers
|
|
54
|
+
* should reference the per-family name (`CLAUDE_OPUS_5_ADAPTIVE_THINKING`,
|
|
55
|
+
* not the Fable/Mythos alias) so a future divergence between the families
|
|
56
|
+
* only changes this re-export, not every call site.
|
|
57
|
+
*/
|
|
58
|
+
export const CLAUDE_OPUS_5_ADAPTIVE_THINKING = CLAUDE_FABLE_MYTHOS_5_SUMMARIZED_THINKING;
|
|
59
|
+
export function isClaudeOpus5Model(model) {
|
|
60
|
+
return (typeof model === 'string' &&
|
|
61
|
+
(model === CLAUDE_OPUS_5_MODEL_ID ||
|
|
62
|
+
model.startsWith(`${CLAUDE_OPUS_5_MODEL_ID}-`)));
|
|
63
|
+
}
|
|
49
64
|
export function isOpenAIReasoningSignature(value) {
|
|
50
65
|
if (typeof value !== 'string')
|
|
51
66
|
return false;
|