@cortexkit/anthropic-auth-core 2.11.2 → 2.11.3

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.
Files changed (43) hide show
  1. package/dist/accounts.d.ts +30 -16
  2. package/dist/cachekeep.d.ts +8 -5
  3. package/dist/index.d.ts +17 -1
  4. package/dist/index.js +6180 -1938
  5. package/dist/internal-types/claustrum/custody.d.ts +4 -0
  6. package/dist/internal-types/claustrum/index.d.ts +1 -1
  7. package/dist/internal-types/routing-accessor/index.d.ts +34 -9
  8. package/dist/internal-types/settings/define.d.ts +35 -0
  9. package/dist/internal-types/settings/descriptors.d.ts +97 -0
  10. package/dist/internal-types/settings/edit.d.ts +24 -0
  11. package/dist/internal-types/settings/handle.d.ts +30 -0
  12. package/dist/internal-types/settings/index.d.ts +10 -0
  13. package/dist/internal-types/settings/move.d.ts +76 -0
  14. package/dist/internal-types/settings/parse.d.ts +24 -0
  15. package/dist/internal-types/settings/paths.d.ts +12 -0
  16. package/dist/internal-types/settings/refusal.d.ts +7 -0
  17. package/dist/internal-types/settings/resolve.d.ts +15 -0
  18. package/dist/internal-types/settings/schema.d.ts +29 -0
  19. package/dist/internal-types/settings/snapshot.d.ts +24 -0
  20. package/dist/native-account-runtime.d.ts +22 -8
  21. package/dist/native-runtime-settings.d.ts +41 -0
  22. package/dist/native-settings-write.d.ts +19 -0
  23. package/dist/path-options.d.ts +16 -0
  24. package/dist/pool-paths.d.ts +2 -1
  25. package/dist/routing-relay.d.ts +6 -1
  26. package/dist/routing-wait.d.ts +14 -0
  27. package/dist/routing.d.ts +2 -2
  28. package/dist/settings-definition.d.ts +621 -0
  29. package/dist/settings-mode.d.ts +22 -0
  30. package/dist/settings-move-fence.d.ts +44 -0
  31. package/dist/settings-move-map.d.ts +7 -0
  32. package/dist/settings-move-run.d.ts +29 -0
  33. package/dist/settings-move-source.d.ts +50 -0
  34. package/dist/settings-move-sources.d.ts +35 -0
  35. package/dist/settings-paths.d.ts +30 -0
  36. package/dist/settings-protection-copy.d.ts +12 -0
  37. package/dist/settings-protection-legacy.d.ts +22 -0
  38. package/dist/settings-record.d.ts +8 -0
  39. package/dist/settings-service.d.ts +99 -0
  40. package/dist/settings-three-way.d.ts +5 -0
  41. package/dist/sticky-routing.d.ts +14 -0
  42. package/package.json +3 -2
  43. package/schema/anthropic-auth.schema.json +1081 -0
@@ -0,0 +1,16 @@
1
+ import { realpath } from 'node:fs/promises';
2
+ import { posix } from 'node:path';
3
+ /** Pass one process's inputs through every settings path decision. */
4
+ export interface PathResolutionOptions {
5
+ env?: Readonly<Record<string, string | undefined>>;
6
+ home?: string;
7
+ platform?: NodeJS.Platform;
8
+ realpath?: (path: string) => Promise<string>;
9
+ }
10
+ export declare function resolvePathOptions(options?: PathResolutionOptions): {
11
+ env: Readonly<Record<string, string | undefined>>;
12
+ home: string;
13
+ platform: NodeJS.Platform;
14
+ realpath: ((path: string) => Promise<string>) | typeof realpath;
15
+ paths: typeof posix;
16
+ };
@@ -1,3 +1,4 @@
1
+ import { type PathResolutionOptions } from './path-options.ts';
1
2
  import { type StateLayout } from './state-layout-paths.ts';
2
3
  export interface NativePoolPaths {
3
4
  legacyConfig: string;
@@ -22,7 +23,7 @@ export declare function resolveLocalRoutingDestination(host: 'opencode' | 'pi',
22
23
  * This can follow a leaf symlink, so it does not establish configured-leaf safety.
23
24
  * Source capture and recheck must retain the configured path for the lstat guard.
24
25
  */
25
- export declare function canonicalPath(path: string): Promise<string>;
26
+ export declare function canonicalPath(path: string, options?: PathResolutionOptions): Promise<string>;
26
27
  /**
27
28
  * Separate runtime authority from import inputs so a stale legacy writer cannot
28
29
  * rewrite a stamped credential. Both independently configured paths matter.
@@ -16,6 +16,11 @@ type RoutingSubject = {
16
16
  };
17
17
  /** Routing owns quota reserves, including unknown readings and the minimum remaining quota set by the killswitch. Offer only subscription credentials the host may use. */
18
18
  export declare function routingCandidates(accounts: readonly NativeAccountView[]): NativeAccountView[];
19
+ /** Hint only the still-servable vault credential behind the session's own pin. */
20
+ export declare function routingWarmCredential(accounts: readonly NativeAccountView[], assignment: {
21
+ accountId: string;
22
+ accountIdentity?: string;
23
+ } | undefined): string | undefined;
19
24
  export declare function routingChoiceMatches(choice: RoutingChoice, account: RoutingSubject): boolean;
20
25
  /** Fixed text avoids exposing router internals and is not a host auto-retry signal. */
21
26
  export declare class RoutingRefusalError extends Error {
@@ -30,7 +35,7 @@ export declare function createRoutingRelay(quotaFor?: (subject: RoutingSubject)
30
35
  shouldReport(sessionId: string): boolean;
31
36
  admitted(sessionId: string, subject: RoutingSubject): boolean;
32
37
  policy(sessionId: string, account: NativeAccountView, snapshot: NativeAccountSnapshot, modelId?: string): import("./native-account-runtime.ts").NativeAccountPolicy;
33
- accountFor(sessionId: string, modelId: string, candidates: readonly RoutingSubject[]): Promise<RoutingChoice | null>;
38
+ accountFor(sessionId: string, modelId: string, candidates: readonly RoutingSubject[], warmCredentialId?: string): Promise<RoutingChoice | null>;
34
39
  report(sessionId: string, subject: RoutingSubject, headers: Headers, status: number, modelId?: string, served?: boolean): void;
35
40
  };
36
41
  export {};
@@ -0,0 +1,14 @@
1
+ import { type PluginWaitReason } from "./internal-types/routing-accessor/index.js";
2
+ type WaitReason = Extract<PluginWaitReason, 'account_limit' | 'account_free' | 'rate_limited' | 'routing_hold'>;
3
+ type WaitOutcome = 'resumed' | 'cancelled' | 'abandoned';
4
+ /** Report a real delay without calling reportRouting on the request path.
5
+ * Call the returned callback when the wait ends. When the app owns the delay,
6
+ * the plugin cannot observe completion and reports only its start. */
7
+ export declare function startRoutingWait(input: {
8
+ sessionId?: string;
9
+ reason: WaitReason;
10
+ delayMs: number;
11
+ nextMs?: number;
12
+ attempt?: number;
13
+ }): ((outcome: WaitOutcome) => void) | undefined;
14
+ export {};
package/dist/routing.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import type { AccountStorage, RoutingMode } from './accounts.ts';
1
+ import type { AccountSettingsReaderInput, AccountStorage, RoutingMode } from './accounts.ts';
2
2
  export declare const CLAUDE_ROUTING_COMMAND_NAME = "claude-routing";
3
3
  export declare const ROUTING_MODES: readonly ['main-first', 'fallback-first', 'sticky-balanced'];
4
4
  export declare const DEFAULT_ROUTING_MODE: RoutingMode;
5
5
  export declare const MAX_SAME_ACCOUNT_WAITS: readonly ['0', '15', 'max'];
6
6
  export type MaxSameAccountWait = (typeof MAX_SAME_ACCOUNT_WAITS)[number];
7
7
  export declare const DEFAULT_MAX_SAME_ACCOUNT_WAIT: MaxSameAccountWait;
8
- export declare function getMaxSameAccountWait(storage: AccountStorage | null): MaxSameAccountWait;
8
+ export declare function getMaxSameAccountWait(storage: AccountSettingsReaderInput | null): MaxSameAccountWait;
9
9
  type RoutingCommandAction = {
10
10
  type: 'status';
11
11
  } | {