@cortexkit/anthropic-auth-core 2.4.12 → 2.5.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.d.ts +23 -12
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1588 -234
- package/dist/internal-types/claustrum/consumer.d.ts +12 -0
- package/dist/internal-types/claustrum/custody.d.ts +16 -4
- package/dist/internal-types/claustrum/hub.d.ts +3 -2
- package/dist/internal-types/claustrum/index.d.ts +1 -0
- package/dist/internal-types/claustrum/roster.d.ts +2 -0
- package/dist/internal-types/claustrum/usage.d.ts +41 -0
- package/dist/internal-types/commands/builtins.d.ts +5 -0
- package/dist/internal-types/fs/private-files.d.ts +5 -0
- package/dist/internal-types/routing/admission.d.ts +7 -2
- package/dist/internal-types/routing-accessor/index.d.ts +13 -3
- package/dist/internal-types/store/errors.d.ts +1 -1
- package/dist/internal-types/store/hooks.d.ts +5 -1
- package/dist/internal-types/store/index.d.ts +1 -0
- package/dist/internal-types/store/limits-namespace.d.ts +7 -0
- package/dist/internal-types/store/pool.d.ts +10 -1
- package/dist/internal-types/store/settings.d.ts +2 -0
- package/dist/message-threads.d.ts +82 -0
- package/dist/native-menu-executor.d.ts +4 -1
- package/dist/native-menu-model.d.ts +4 -3
- package/dist/native-vault-refusal.d.ts +3 -2
- package/dist/quota-refusal.d.ts +6 -0
- package/dist/relay.d.ts +3 -0
- package/dist/routing.d.ts +6 -0
- package/dist/session-cache-activity.d.ts +16 -0
- package/dist/sticky-routing.d.ts +22 -2
- package/package.json +2 -2
package/dist/accounts.d.ts
CHANGED
|
@@ -180,6 +180,7 @@ export type AccountStorage = {
|
|
|
180
180
|
};
|
|
181
181
|
routing?: {
|
|
182
182
|
mode?: RoutingMode;
|
|
183
|
+
maxSameAccountWait?: import('./routing.ts').MaxSameAccountWait;
|
|
183
184
|
};
|
|
184
185
|
fallbackOn?: number[];
|
|
185
186
|
refresh?: {
|
|
@@ -420,19 +421,29 @@ export declare function getKillswitchThresholdsForAccount(storage: AccountStorag
|
|
|
420
421
|
* 5h/7d check. A model with no matching scoped window is unaffected.
|
|
421
422
|
*/
|
|
422
423
|
export declare function killswitchPassesPolicy(quota: OAuthQuotaSnapshot | undefined, storage: AccountStorage | null, accountId?: string, modelId?: string): boolean;
|
|
423
|
-
|
|
424
|
-
* Find the earliest reset time across all accounts' quota windows.
|
|
425
|
-
* Returns seconds from `now` until that reset, or 300 as a fallback.
|
|
426
|
-
*
|
|
427
|
-
* When `scopedModelId` is provided, ONLY the matched scoped window's
|
|
428
|
-
* `resetsAt` is considered — the 5h/7d resets are intentionally ignored
|
|
429
|
-
* so the retry hint reflects the weekly reset, not the sooner 5h reset
|
|
430
|
-
* (which would cause a retry-storm against a block that won't clear for
|
|
431
|
-
* days). With `scopedModelId` undefined, the 5h/7d behavior is unchanged.
|
|
432
|
-
*/
|
|
433
|
-
export declare function killswitchRetryAfterSeconds(mainQuota: OAuthQuotaSnapshot | undefined, fallbackAccounts: Array<{
|
|
424
|
+
export type QuotaResetEvidence = {
|
|
434
425
|
quota?: OAuthQuotaSnapshot;
|
|
435
|
-
|
|
426
|
+
accountIdentity?: string;
|
|
427
|
+
accountId?: string;
|
|
428
|
+
};
|
|
429
|
+
/** Only current, identity-bound readings can justify waiting for a stored reset. */
|
|
430
|
+
export declare function quotaRefusalTiming(input: {
|
|
431
|
+
readings: readonly QuotaResetEvidence[];
|
|
432
|
+
storage?: AccountStorage | null;
|
|
433
|
+
scopedModelId?: string;
|
|
434
|
+
modelId?: string;
|
|
435
|
+
sessionTtlMs?: number;
|
|
436
|
+
now?: number;
|
|
437
|
+
}): {
|
|
438
|
+
resetAt: number | undefined;
|
|
439
|
+
retryAfterSeconds: number | undefined;
|
|
440
|
+
};
|
|
441
|
+
/** Compatibility accessor for callers that need only the capped retry delay. */
|
|
442
|
+
export declare function killswitchRetryAfterSeconds(mainQuota: OAuthQuotaSnapshot | undefined, fallbackAccounts: Array<QuotaResetEvidence>, now: number, scopedModelId?: string, options?: {
|
|
443
|
+
storage?: AccountStorage | null;
|
|
444
|
+
mainAccountIdentity?: string;
|
|
445
|
+
sessionTtlMs?: number;
|
|
446
|
+
}): number;
|
|
436
447
|
export declare function getKillswitchConfig(storage: AccountStorage | null): KillswitchConfig;
|
|
437
448
|
export declare function getQuotaNextRefreshAt(quota: OAuthQuotaSnapshot | undefined, storage: AccountStorage | null, now: number): number;
|
|
438
449
|
export declare function fetchOAuthQuotaSnapshot(input: {
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export * from './json.ts';
|
|
|
20
20
|
export * from './killswitch.ts';
|
|
21
21
|
export * from './logger.ts';
|
|
22
22
|
export * from './logging.ts';
|
|
23
|
+
export * from './message-threads.ts';
|
|
23
24
|
export * from './mid-conversation-output-config.ts';
|
|
24
25
|
export type { ClaudeCodeBetaLists, ClaudeModelCapabilities, ClaudeModelCatalogue, ClaudeModelFamily, ClaudeModelPricing, ClaudeRefusalRecoveryFamily, } from './model-capabilities.ts';
|
|
25
26
|
export { CLAUDE_CODE_DEFAULT_BETAS, CLAUDE_MODEL_CAPABILITIES, getClaudeModelCapabilities, getClaudeModelCatalogue, pinsEffortOnEveryRequest, resolveClaudeModelCapabilities, } from './model-capabilities.ts';
|
|
@@ -65,7 +66,7 @@ export type { NativePiAuthSlot, NativePiAuthSlotErrorCode, NativePiAuthSlotInspe
|
|
|
65
66
|
export { disconnectNativeVaultForHost, NativePiAuthSlotError, nativePiAuthSlotPaths, openNativePiAuthSlot, } from './native-vault-connection.ts';
|
|
66
67
|
export { createNativeVaultNoRouteResponse, NativeVaultQuotaPolicyError, } from './native-vault-refusal.ts';
|
|
67
68
|
export type { NativeVaultQuotaPurpose, NativeVaultRuntime, NativeVaultRuntimeOptions, NativeVaultWatch, NativeVaultWatchOptions, } from './native-vault-runtime.ts';
|
|
68
|
-
export { acquireNativeVaultRuntime, createNativeVaultRuntime, discoverNativeVaultInventory, publishNativeVaultRosterSeed, publishNativeVaultRuntimeSeed, } from './native-vault-runtime.ts';
|
|
69
|
+
export { acquireNativeVaultRuntime, createNativeVaultRuntime, discoverNativeVaultInventory, nativeVaultRuntimeKey, publishNativeVaultRosterSeed, publishNativeVaultRuntimeSeed, } from './native-vault-runtime.ts';
|
|
69
70
|
export * from './oauth-origin.ts';
|
|
70
71
|
export * from './oauth-profile.ts';
|
|
71
72
|
export { createWindowsOwnerOnly, ensureWindowsOwnerOnlyDirectory, isOwnerOnly, type OwnerOnlyOptions, readWindowsOwnerOnly, } from './owner-only.ts';
|
|
@@ -84,6 +85,7 @@ export { renameWithWindowsSharingRetry } from './publication-rename.ts';
|
|
|
84
85
|
export * from './quota-header-feed.ts';
|
|
85
86
|
export * from './quota-headers.ts';
|
|
86
87
|
export * from './quota-manager.ts';
|
|
88
|
+
export * from './quota-refusal.ts';
|
|
87
89
|
export * from './quotas.ts';
|
|
88
90
|
export * from './relay.ts';
|
|
89
91
|
export * from './relocation-guard.ts';
|
|
@@ -91,6 +93,7 @@ export * from './request-abort.ts';
|
|
|
91
93
|
export * from './request-gzip.ts';
|
|
92
94
|
export * from './request-history.ts';
|
|
93
95
|
export * from './routing.ts';
|
|
96
|
+
export * from './session-cache-activity.ts';
|
|
94
97
|
export type { SseEvent, SseFramer, SseFramerOptions } from './sse.ts';
|
|
95
98
|
export { createSseFramer, DEFAULT_SSE_MAX_FRAME_BYTES, decodeSseFrame, isSseCandidateFrame, isTerminatedSseFrame, parseSseFrame, SseFrameTooLargeError, } from './sse.ts';
|
|
96
99
|
export * from './start.ts';
|