@cortexkit/anthropic-auth-core 2.4.13 → 2.5.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/dist/cachekeep-failure.d.ts +19 -0
- package/dist/cachekeep.d.ts +8 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8119 -6771
- 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/relay.d.ts +3 -0
- package/dist/sticky-routing.d.ts +16 -1
- package/package.json +2 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type CacheKeepFailureStage = 'authorization' | 'send' | 'response';
|
|
2
|
+
declare const ERROR_NAMES: readonly ['AbortError', 'TimeoutError', 'TypeError'];
|
|
3
|
+
declare const NETWORK_CODES: readonly ['ECONNRESET', 'ECONNREFUSED', 'ETIMEDOUT', 'EPIPE', 'ENOTFOUND', 'EAI_AGAIN', 'UND_ERR_CONNECT_TIMEOUT', 'UND_ERR_HEADERS_TIMEOUT', 'UND_ERR_HEADERS_OVERFLOW', 'UND_ERR_BODY_TIMEOUT', 'UND_ERR_RESPONSE_STATUS_CODE', 'UND_ERR_INVALID_ARG', 'UND_ERR_INVALID_RETURN_VALUE', 'UND_ERR_ABORTED', 'UND_ERR_CLIENT_DESTROYED', 'UND_ERR_CLIENT_CLOSED', 'UND_ERR_SOCKET', 'UND_ERR_NOT_SUPPORTED', 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH', 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH', 'UND_ERR_INFO', 'UND_ERR_RES_EXCEEDED_MAX_SIZE', 'UND_ERR_PRX_TLS'];
|
|
4
|
+
declare const CUSTODY_CODES: readonly ["closed", "not-enrolled", "invalid-token", "unavailable", "identity-changed", "identity-unasserted", "insufficient-validity", "invalid-material", "not-active", "route-unavailable", "route-declined", "no-receipt", "unsafe-file", "invalid-state", "wrong-consumer", "roster-busy", "host-slot-login", "host-slot-placeholder", "placeholder-refresh", "invalid-order"];
|
|
5
|
+
declare const REFUSAL_CODES: readonly ['account-policy', 'account-unavailable', 'credential-changed'];
|
|
6
|
+
export type CacheKeepFailureClass = (typeof ERROR_NAMES)[number] | (typeof NETWORK_CODES)[number] | (typeof CUSTODY_CODES)[number] | (typeof REFUSAL_CODES)[number] | number | 'unknown';
|
|
7
|
+
export type CacheKeepFailure = {
|
|
8
|
+
stage: CacheKeepFailureStage;
|
|
9
|
+
class: CacheKeepFailureClass;
|
|
10
|
+
};
|
|
11
|
+
/** Copy only closed codes, never an exception's message, stack, cause or provider text. */
|
|
12
|
+
export declare function classifyCacheKeepFailure(error: unknown, stage: CacheKeepFailureStage, status?: number): CacheKeepFailure;
|
|
13
|
+
/** A host boundary that retains diagnostics but no native credential-bearing error. */
|
|
14
|
+
export declare class CacheKeepPrewarmError extends Error implements CacheKeepFailure {
|
|
15
|
+
readonly stage: CacheKeepFailureStage;
|
|
16
|
+
readonly class: CacheKeepFailureClass;
|
|
17
|
+
constructor(stage: CacheKeepFailureStage, error: unknown, status?: number);
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/dist/cachekeep.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AccountStorage } from './accounts.ts';
|
|
2
|
+
import { type CacheKeepFailure } from './cachekeep-failure.ts';
|
|
2
3
|
import type { CacheKeepTrackedSession } from './cachekeep-registry.ts';
|
|
3
4
|
import { type NativeAccountRefusalReason } from './native-account-refusal.ts';
|
|
4
5
|
import { type ProviderErrorSummary } from './provider-error.ts';
|
|
@@ -13,6 +14,9 @@ export declare const CACHE_KEEP_PREWARM_TIMEOUT_MS = 30000;
|
|
|
13
14
|
export declare const CACHE_KEEP_RETRY_BASE_MS = 60000;
|
|
14
15
|
export declare const CACHE_KEEP_RETRY_MAX_MS: number;
|
|
15
16
|
export declare const CACHE_KEEP_RETRY_JITTER_MAX_MS = 30000;
|
|
17
|
+
export declare const CACHE_KEEP_TRANSIENT_RETRY_STEP_MS = 20000;
|
|
18
|
+
export declare const CACHE_KEEP_TRANSIENT_RETRY_MAX_MS = 60000;
|
|
19
|
+
export declare const CACHE_KEEP_EXPIRY_SAFETY_MS = 5000;
|
|
16
20
|
export type CacheKeepWindow = {
|
|
17
21
|
startHour: number;
|
|
18
22
|
endHour: number;
|
|
@@ -132,6 +136,8 @@ export type CacheKeepPrewarmResult = {
|
|
|
132
136
|
status?: number;
|
|
133
137
|
transient?: true;
|
|
134
138
|
provider_error?: ProviderErrorSummary['provider_error'];
|
|
139
|
+
stage?: CacheKeepFailure['stage'];
|
|
140
|
+
class?: CacheKeepFailure['class'];
|
|
135
141
|
} | {
|
|
136
142
|
/** The warm was refused before any send; the target is removed. */
|
|
137
143
|
ok: false;
|
|
@@ -271,6 +277,8 @@ export declare class CacheKeepManager {
|
|
|
271
277
|
}): Promise<CacheKeepPrewarmResult>;
|
|
272
278
|
tick(): Promise<void>;
|
|
273
279
|
private runTick;
|
|
280
|
+
private lastPrewarmStart;
|
|
281
|
+
private scheduleRetry;
|
|
274
282
|
private sendPrewarm;
|
|
275
283
|
private prewarm;
|
|
276
284
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './accounts.ts';
|
|
|
5
5
|
export * from './auth.ts';
|
|
6
6
|
export * from './cache1h.ts';
|
|
7
7
|
export * from './cachekeep.ts';
|
|
8
|
+
export * from './cachekeep-failure.ts';
|
|
8
9
|
export * from './cachekeep-registry.ts';
|
|
9
10
|
export * from './cch.ts';
|
|
10
11
|
export * from './claude-code.ts';
|
|
@@ -20,6 +21,7 @@ export * from './json.ts';
|
|
|
20
21
|
export * from './killswitch.ts';
|
|
21
22
|
export * from './logger.ts';
|
|
22
23
|
export * from './logging.ts';
|
|
24
|
+
export * from './message-threads.ts';
|
|
23
25
|
export * from './mid-conversation-output-config.ts';
|
|
24
26
|
export type { ClaudeCodeBetaLists, ClaudeModelCapabilities, ClaudeModelCatalogue, ClaudeModelFamily, ClaudeModelPricing, ClaudeRefusalRecoveryFamily, } from './model-capabilities.ts';
|
|
25
27
|
export { CLAUDE_CODE_DEFAULT_BETAS, CLAUDE_MODEL_CAPABILITIES, getClaudeModelCapabilities, getClaudeModelCatalogue, pinsEffortOnEveryRequest, resolveClaudeModelCapabilities, } from './model-capabilities.ts';
|
|
@@ -65,7 +67,7 @@ export type { NativePiAuthSlot, NativePiAuthSlotErrorCode, NativePiAuthSlotInspe
|
|
|
65
67
|
export { disconnectNativeVaultForHost, NativePiAuthSlotError, nativePiAuthSlotPaths, openNativePiAuthSlot, } from './native-vault-connection.ts';
|
|
66
68
|
export { createNativeVaultNoRouteResponse, NativeVaultQuotaPolicyError, } from './native-vault-refusal.ts';
|
|
67
69
|
export type { NativeVaultQuotaPurpose, NativeVaultRuntime, NativeVaultRuntimeOptions, NativeVaultWatch, NativeVaultWatchOptions, } from './native-vault-runtime.ts';
|
|
68
|
-
export { acquireNativeVaultRuntime, createNativeVaultRuntime, discoverNativeVaultInventory, publishNativeVaultRosterSeed, publishNativeVaultRuntimeSeed, } from './native-vault-runtime.ts';
|
|
70
|
+
export { acquireNativeVaultRuntime, createNativeVaultRuntime, discoverNativeVaultInventory, nativeVaultRuntimeKey, publishNativeVaultRosterSeed, publishNativeVaultRuntimeSeed, } from './native-vault-runtime.ts';
|
|
69
71
|
export * from './oauth-origin.ts';
|
|
70
72
|
export * from './oauth-profile.ts';
|
|
71
73
|
export { createWindowsOwnerOnly, ensureWindowsOwnerOnlyDirectory, isOwnerOnly, type OwnerOnlyOptions, readWindowsOwnerOnly, } from './owner-only.ts';
|