@cortexkit/anthropic-auth-core 1.23.0 → 2.0.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/README.md +18 -1
- package/dist/accounts.d.ts +4 -163
- package/dist/cachekeep.d.ts +9 -0
- package/dist/claude-code.d.ts +16 -0
- package/dist/claustrum-enrollment.d.ts +2 -0
- package/dist/claustrum.d.ts +0 -209
- package/dist/commands/account.d.ts +2 -3
- package/dist/index.d.ts +45 -4
- package/dist/index.js +27569 -38
- package/dist/internal-types/LICENSE +21 -0
- package/dist/internal-types/commands/builtins.d.ts +71 -0
- package/dist/internal-types/commands/index.d.ts +10 -0
- package/dist/internal-types/commands/menu.d.ts +61 -0
- package/dist/internal-types/commands/model.d.ts +238 -0
- package/dist/internal-types/commands/pi.d.ts +23 -0
- package/dist/internal-types/commands/seam.d.ts +72 -0
- package/dist/internal-types/fs/refresh-file-lock.d.ts +33 -0
- package/dist/internal-types/logger/capture-sink.d.ts +14 -0
- package/dist/internal-types/logger/engine.d.ts +98 -0
- package/dist/internal-types/logger/index.d.ts +6 -0
- package/dist/internal-types/logger/redact.d.ts +11 -0
- package/dist/internal-types/pi-slot/index.d.ts +3 -0
- package/dist/internal-types/pi-slot/slot.d.ts +51 -0
- package/dist/internal-types/quota/codec.d.ts +11 -0
- package/dist/internal-types/quota/format.d.ts +46 -0
- package/dist/internal-types/quota/index.d.ts +10 -0
- package/dist/internal-types/quota/map.d.ts +63 -0
- package/dist/internal-types/quota/merge.d.ts +48 -0
- package/dist/internal-types/quota/projection.d.ts +64 -0
- package/dist/internal-types/store/attribution.d.ts +28 -0
- package/dist/internal-types/store/errors.d.ts +55 -0
- package/dist/internal-types/store/hooks.d.ts +12 -0
- package/dist/internal-types/store/identity.d.ts +39 -0
- package/dist/internal-types/store/index.d.ts +21 -0
- package/dist/internal-types/store/mutate.d.ts +189 -0
- package/dist/internal-types/store/pool.d.ts +197 -0
- package/dist/internal-types/store/provider-state.d.ts +131 -0
- package/dist/internal-types/store/publication.d.ts +47 -0
- package/dist/internal-types/store/pull.d.ts +36 -0
- package/dist/internal-types/store/refresh-lock.d.ts +67 -0
- package/dist/internal-types/store/refresh.d.ts +72 -0
- package/dist/internal-types/store/rows.d.ts +313 -0
- package/dist/internal-types/store/runtime.d.ts +36 -0
- package/dist/internal-types/store/schema.d.ts +443 -0
- package/dist/internal-types/store/settings.d.ts +63 -0
- package/dist/internal-types/store/torn.d.ts +78 -0
- package/dist/migration-source.d.ts +33 -0
- package/dist/models.d.ts +41 -0
- package/dist/native-account-runtime.d.ts +121 -0
- package/dist/native-account-view.d.ts +126 -0
- package/dist/native-command-effects.d.ts +59 -0
- package/dist/native-credential-validation.d.ts +42 -0
- package/dist/native-custody-activation.d.ts +45 -0
- package/dist/native-custody.d.ts +114 -0
- package/dist/native-enrollment-authority.d.ts +2 -0
- package/dist/native-host-auth-read.d.ts +3 -0
- package/dist/native-host-auth-write.d.ts +51 -0
- package/dist/native-host-auth.d.ts +12 -0
- package/dist/native-local-credential-service.d.ts +76 -0
- package/dist/native-local-runtime-readers.d.ts +22 -0
- package/dist/native-lock-observer.d.ts +12 -0
- package/dist/native-menu-executor.d.ts +243 -0
- package/dist/native-menu-model.d.ts +142 -0
- package/dist/native-migration-proof.d.ts +28 -0
- package/dist/native-migration-source.d.ts +47 -0
- package/dist/native-migration.d.ts +66 -0
- package/dist/native-quota-codec.d.ts +32 -0
- package/dist/native-refresh-coordinator.d.ts +240 -0
- package/dist/native-roster-seed.d.ts +115 -0
- package/dist/native-runtime-registry.d.ts +19 -0
- package/dist/native-runtime.d.ts +204 -0
- package/dist/native-settings.d.ts +6 -0
- package/dist/native-transient-account.d.ts +38 -0
- package/dist/native-ui.d.ts +45 -0
- package/dist/native-usage-publication.d.ts +12 -0
- package/dist/native-vault-admission.d.ts +8 -0
- package/dist/native-vault-connection.d.ts +33 -0
- package/dist/native-vault-paths.d.ts +13 -0
- package/dist/native-vault-runtime.d.ts +102 -0
- package/dist/native-vault-seed.d.ts +16 -0
- package/dist/pool-authority.d.ts +159 -0
- package/dist/pool-binding.d.ts +32 -0
- package/dist/pool-paths.d.ts +21 -0
- package/dist/pool-store.d.ts +32 -0
- package/dist/provider-error.d.ts +139 -0
- package/dist/quota-manager.d.ts +18 -7
- package/dist/relay.d.ts +14 -1
- package/dist/request-history.d.ts +34 -0
- package/dist/routing.d.ts +1 -2
- package/dist/sse.d.ts +81 -0
- package/dist/sticky-routing.d.ts +28 -0
- package/package.json +10 -4
- package/dist/accounts.js +0 -3881
- package/dist/auth.js +0 -185
- package/dist/cache1h.js +0 -97
- package/dist/cachekeep-registry.js +0 -124
- package/dist/cachekeep.js +0 -604
- package/dist/cch.js +0 -172
- package/dist/claude-code.js +0 -403
- package/dist/claustrum-enrollment-registry.d.ts +0 -17
- package/dist/claustrum-enrollment-registry.js +0 -194
- package/dist/claustrum-enrollment.js +0 -485
- package/dist/claustrum-scoped-roster.d.ts +0 -23
- package/dist/claustrum-scoped-roster.js +0 -194
- package/dist/claustrum-scoped-runtime.d.ts +0 -28
- package/dist/claustrum-scoped-runtime.js +0 -230
- package/dist/claustrum-scoped.d.ts +0 -39
- package/dist/claustrum-scoped.js +0 -193
- package/dist/claustrum.js +0 -1471
- package/dist/commands/account.js +0 -368
- package/dist/constants.js +0 -83
- package/dist/custom-headers.js +0 -102
- package/dist/dump.js +0 -616
- package/dist/fast.js +0 -66
- package/dist/json.js +0 -10
- package/dist/killswitch.js +0 -132
- package/dist/logger.js +0 -288
- package/dist/logging.js +0 -59
- package/dist/mid-conversation-output-config.js +0 -89
- package/dist/model-remap.js +0 -72
- package/dist/models.js +0 -177
- package/dist/network-errors.js +0 -27
- package/dist/oauth-profile.js +0 -60
- package/dist/pkce.js +0 -17
- package/dist/prime.js +0 -841
- package/dist/provider.js +0 -0
- package/dist/quota-header-feed.js +0 -331
- package/dist/quota-headers.js +0 -121
- package/dist/quota-manager.js +0 -856
- package/dist/quotas.js +0 -141
- package/dist/relay.js +0 -1303
- package/dist/routing.js +0 -94
- package/dist/start.js +0 -29
- package/dist/sticky-routing.js +0 -541
- package/dist/thinking-binding.js +0 -54
- package/dist/token-fingerprint.js +0 -8
package/dist/thinking-binding.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { isClaudeFable51Model } from './models.js';
|
|
2
|
-
export const THINKING_BINDING_CONTROLS_BETA = 'thinking-binding-controls-2026-08-01';
|
|
3
|
-
function isRecord(value) {
|
|
4
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
5
|
-
}
|
|
6
|
-
function isReplayableThinkingBlock(block) {
|
|
7
|
-
if (!isRecord(block))
|
|
8
|
-
return false;
|
|
9
|
-
if (block.type === 'thinking') {
|
|
10
|
-
return typeof block.signature === 'string' && block.signature.length > 0;
|
|
11
|
-
}
|
|
12
|
-
if (block.type === 'redacted_thinking') {
|
|
13
|
-
return typeof block.data === 'string' && block.data.length > 0;
|
|
14
|
-
}
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
export function getThinkingPrefixMismatchBehavior(storage) {
|
|
18
|
-
const behavior = storage?.thinkingBinding?.prefixMismatchBehavior;
|
|
19
|
-
return behavior === 'error' || behavior === 'drop_block'
|
|
20
|
-
? behavior
|
|
21
|
-
: 'account-default';
|
|
22
|
-
}
|
|
23
|
-
export function hasReplayableThinkingBlocks(body) {
|
|
24
|
-
if (!Array.isArray(body.messages))
|
|
25
|
-
return false;
|
|
26
|
-
return body.messages.some((message) => {
|
|
27
|
-
if (!isRecord(message) || message.role !== 'assistant')
|
|
28
|
-
return false;
|
|
29
|
-
return (Array.isArray(message.content) &&
|
|
30
|
-
message.content.some(isReplayableThinkingBlock));
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
export function applyThinkingBindingControls(body, behavior = 'account-default') {
|
|
34
|
-
if (behavior === 'account-default')
|
|
35
|
-
return false;
|
|
36
|
-
if (!isClaudeFable51Model(body.model))
|
|
37
|
-
return false;
|
|
38
|
-
if (!hasReplayableThinkingBlocks(body))
|
|
39
|
-
return false;
|
|
40
|
-
if (!isRecord(body.thinking) || body.thinking.type === 'disabled')
|
|
41
|
-
return false;
|
|
42
|
-
body.thinking.block_binding = {
|
|
43
|
-
prefix_mismatch_behavior: behavior,
|
|
44
|
-
};
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
export function hasThinkingBindingControls(body) {
|
|
48
|
-
if (!isRecord(body.thinking))
|
|
49
|
-
return false;
|
|
50
|
-
if (!isRecord(body.thinking.block_binding))
|
|
51
|
-
return false;
|
|
52
|
-
const behavior = body.thinking.block_binding.prefix_mismatch_behavior;
|
|
53
|
-
return behavior === 'error' || behavior === 'drop_block';
|
|
54
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
/**
|
|
3
|
-
* Stable, non-reversible fingerprint used to bind persisted state to an access
|
|
4
|
-
* token without storing another copy of the credential.
|
|
5
|
-
*/
|
|
6
|
-
export function tokenFingerprint(token) {
|
|
7
|
-
return createHash('sha256').update(token).digest('hex').slice(0, 16);
|
|
8
|
-
}
|