@cortexkit/anthropic-auth-core 2.2.8 → 2.3.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.
@@ -49,6 +49,7 @@ export interface NativeAccountRuntime {
49
49
  readonly onLockEvent?: (event: NativeLockEvent) => void;
50
50
  readonly vault: NativeVaultRuntime;
51
51
  readonly quotaObservations: NativeQuotaObservations;
52
+ /** Waits for pending quota observations, quota submissions, and runtime metadata writes. An accepted pool quota update may not yet be on disk; close() drains the pool's pending quota writes. */
52
53
  drainQuotaPublications(): Promise<void>;
53
54
  drainRoutingPublications(): Promise<void>;
54
55
  /** Fresh private relay authorization for transport only; never include it in a status snapshot. */
@@ -1,5 +1,7 @@
1
1
  import { enrollmentAuthority, readClaustrumEnrollmentStatus } from "./internal-types/claustrum/index.js";
2
2
  import { NativeCustodyError } from './native-custody.ts';
3
+ /** Test-only reset for the once-per-process enrollment mode log. */
4
+ export declare function __resetEnrollmentModeLogForTests(): void;
3
5
  /**
4
6
  * Shown instead of `Native custody refused: invalid-token` when the
5
7
  * enrollment files could not be read because the private-files backend did
@@ -9,11 +9,11 @@ export declare function nativeRuntimeStorageKey(options: {
9
9
  export declare function nativeRuntimeConnectionFile(host: 'opencode' | 'pi', env: NodeJS.ProcessEnv): string;
10
10
  /** A release applies to the runtime entry acquired earlier, not to a later entry created with the same key. */
11
11
  export declare class NativeRuntimeRegistry<T extends {
12
- close(): void;
12
+ close(): void | Promise<void>;
13
13
  }> {
14
14
  private readonly entries;
15
15
  acquire(key: string, create: () => T): {
16
16
  use: () => T;
17
- close: () => void;
17
+ close: () => void | Promise<void>;
18
18
  };
19
19
  }
@@ -116,7 +116,7 @@ export interface NativeVaultRuntime {
116
116
  resetBackoff(receipt: NativeCustodyReceipt, kind?: 'refresh' | 'quota' | 'all'): Promise<boolean>;
117
117
  getOrCreateAuthLineage(receipt: NativeCustodyReceipt): Promise<string | undefined>;
118
118
  incrementPrimeUsage(receipt: NativeCustodyReceipt, delta?: PrimeUsageDelta): Promise<boolean>;
119
- close(): void;
119
+ close(): void | Promise<void>;
120
120
  }
121
121
  /** Publish the initial roster from validated account inventory. A caller importing captured state must fence that state through assertOwned, which runs again at the roster's actual publication. */
122
122
  export declare function publishNativeVaultRosterSeed(paths: Pick<NativeVaultPaths, 'roster'>, input: NativeRosterSeedInput, options?: {
@@ -136,4 +136,4 @@ export declare function nativeVaultRuntimeKey(options: NativeVaultRuntimeOptions
136
136
  /** Each handle owns one reference; disposing it cannot close another host session. */
137
137
  export declare function acquireNativeVaultRuntime(options: NativeVaultRuntimeOptions): NativeVaultRuntime;
138
138
  /** Each account lease wraps the shared vault runtime and tracks its own subscriptions, so releasing the lease removes those subscriptions. */
139
- export declare function leaseNativeVaultRuntime(use: () => NativeVaultRuntime, close: () => void): NativeVaultRuntime;
139
+ export declare function leaseNativeVaultRuntime(use: () => NativeVaultRuntime, close: () => void | Promise<void>): NativeVaultRuntime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cortexkit/anthropic-auth-core",
3
- "version": "2.2.8",
3
+ "version": "2.3.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,7 +30,7 @@
30
30
  "prepublishOnly": "bun run build"
31
31
  },
32
32
  "devDependencies": {
33
- "@cortexkit/common-auth": "0.25.0"
33
+ "@cortexkit/common-auth": "0.27.1"
34
34
  },
35
35
  "dependencies": {
36
36
  "@cortexkit/claustrum-client": "0.12.0",