@cortexkit/anthropic-auth-core 2.5.4 → 2.5.6

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.
@@ -0,0 +1,48 @@
1
+ import { type CacheKeepTarget } from './cachekeep.ts';
2
+ import { type OwnerOnlyOptions } from './owner-only.ts';
3
+ declare const RECORD_FORMAT_VERSION = 1;
4
+ export declare function cacheKeepStoreDirectory(storageId: string, root?: string, host?: 'pi'): string;
5
+ export declare function legacyCacheKeepStoreDirectory(storageId: string, root?: string): string;
6
+ export type SavedCacheKeepTarget = Pick<CacheKeepTarget, 'id' | 'bodyText' | 'url' | 'cacheExpiresAt' | 'nextPrewarmAt' | 'oauthAccountIdentity' | 'isSubagent' | 'ttlMs' | 'lastTouchAt' | 'lastTouchKind'> & {
7
+ v: typeof RECORD_FORMAT_VERSION;
8
+ pluginVersion: string;
9
+ };
10
+ type Acceptance = boolean | 'foreign-identity' | 'account-gone' | 'invalid' | undefined;
11
+ export interface CacheKeepStoreOptions {
12
+ storageId: string;
13
+ pluginVersion: string;
14
+ /** OpenCode retains its original namespace; Pi never reads its records. */
15
+ host?: 'pi';
16
+ /** Test seam for the data home; never the host's config. */
17
+ root?: string;
18
+ /** Test seam for the pre-2.5.4 temp-root migration. */
19
+ legacyRoot?: string;
20
+ ownerOnly?: OwnerOnlyOptions;
21
+ now?: () => number;
22
+ setTimeoutImpl?: typeof globalThis.setTimeout;
23
+ clearTimeoutImpl?: typeof globalThis.clearTimeout;
24
+ }
25
+ /** Best-effort restart storage. No caller of changed() waits for disk or zlib. */
26
+ export declare class CacheKeepStore {
27
+ private readonly options;
28
+ readonly directory: string;
29
+ private disabled;
30
+ private legacyLoadAttempted;
31
+ private chain;
32
+ private readonly pending;
33
+ private readonly timers;
34
+ private readonly lastWrite;
35
+ private readonly latest;
36
+ constructor(options: CacheKeepStoreOptions, previous?: CacheKeepStore);
37
+ private refuse;
38
+ private directoryReady;
39
+ private enqueue;
40
+ load(now: number, accept: (entry: SavedCacheKeepTarget) => Acceptance, claim?: (sessionHash: string) => Promise<(() => Promise<void>) | undefined>): Promise<void>;
41
+ changed(target: Readonly<CacheKeepTarget>): void;
42
+ private flush;
43
+ private writeEntry;
44
+ removed(id: string): void;
45
+ clear(): void;
46
+ drain(): Promise<void>;
47
+ }
48
+ export {};
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './cache1h.ts';
7
7
  export * from './cachekeep.ts';
8
8
  export * from './cachekeep-failure.ts';
9
9
  export * from './cachekeep-registry.ts';
10
+ export * from './cachekeep-store.ts';
10
11
  export * from './cch.ts';
11
12
  export * from './claude-code.ts';
12
13
  export * from './claustrum.ts';
@@ -47,6 +48,7 @@ export type { NativeLocalAttributedFailure, NativeLocalCredentialService, Native
47
48
  export { createNativeLocalCredentialService } from './native-local-credential-service.ts';
48
49
  export type { NativeLocalExternalPolicy } from './native-local-runtime-readers.ts';
49
50
  export type { NativeLockEvent } from './native-lock-observer.ts';
51
+ export { withNativeLock } from './native-lock-observer.ts';
50
52
  export type { NativeMenuActionValues, NativeMenuCapabilityOutcome, NativeMenuDispatch, NativeMenuDispatchActionId, NativeMenuDispatchOptions, NativeMenuDispatchRequest, NativeMenuDispatchValues, NativeMenuExecutionContext, NativeMenuExecutionResult, NativeMenuExecutor, NativeMenuExecutorOptions, NativeMenuExecutorRefusalCode, NativeMenuKillswitchEntry, NativeMenuNoValues, NativeMenuRequest, NativeMenuSessionActionId, } from './native-menu-executor.ts';
51
53
  export { createNativeMenuExecutor } from './native-menu-executor.ts';
52
54
  export type { NativeMenuAction, NativeMenuActionId, NativeMenuCacheMode, NativeMenuChoiceParameter, NativeMenuCommandId, NativeMenuCustodyMode, NativeMenuGroup, NativeMenuGroupId, NativeMenuHost, NativeMenuLogLevel, NativeMenuModel, NativeMenuParameter, NativeMenuParameterId, NativeMenuRefusalCode, NativeMenuRoutingMode, NativeMenuStatus, } from './native-menu-model.ts';