@cortexkit/anthropic-auth-core 2.4.2 → 2.4.4
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.d.ts +82 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7835 -7472
- package/dist/internal-types/fs/refresh-file-lock.d.ts +13 -0
- package/dist/native-account-refusal.d.ts +11 -0
- package/dist/owner-only.d.ts +1 -1
- package/dist/state-layout-io.d.ts +6 -1
- package/package.json +3 -3
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
export declare function isLostMarkerRaceError(error: unknown): boolean;
|
|
2
|
+
/** Test-only fault injection between marker mkdir and owner.json write. */
|
|
3
|
+
export interface EvictionMarkerTestHooks {
|
|
4
|
+
/** Runs after the exclusive mkdir (and identity capture) before owner write. */
|
|
5
|
+
beforeOwnerWrite?: (evictPath: string, ownerPath: string) => Promise<void> | void;
|
|
6
|
+
/** Throw to fail the owner write; return an error to throw it. */
|
|
7
|
+
failOwnerWrite?: (evictPath: string, ownerPath: string) => Promise<unknown> | unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tests only: inject a failure or a directory replacement between the
|
|
11
|
+
* eviction-marker mkdir and its owner.json write. Production never sets this.
|
|
12
|
+
* Not exported from the fs entry point, so it is not part of the public API.
|
|
13
|
+
*/
|
|
14
|
+
export declare function setEvictionMarkerTestHooksForTest(hooks?: EvictionMarkerTestHooks): void;
|
|
2
15
|
export interface LockLoss {
|
|
3
16
|
readonly reason: 'taken-over' | 'expired' | 'unreadable' | 'renewal-failed' | 'marker-lost';
|
|
4
17
|
readonly expectedOwnerId: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { NativeRefreshResult } from './native-refresh-coordinator.ts';
|
|
2
|
+
export type NativeAccountRefusalReason = 'account-policy' | 'account-unavailable' | 'credential-changed';
|
|
3
|
+
/** A closed, credential-free refusal that retrying a background send cannot fix. */
|
|
4
|
+
export declare class NativeAccountRefusal extends Error {
|
|
5
|
+
readonly reason: NativeAccountRefusalReason;
|
|
6
|
+
constructor(reason: NativeAccountRefusalReason);
|
|
7
|
+
}
|
|
8
|
+
/** Unknown failures and vault outages retain the caller's existing retry policy. */
|
|
9
|
+
export declare function nativeAccountRefusal(error: unknown): NativeAccountRefusal | undefined;
|
|
10
|
+
/** Refresh/validation backoff and failed I/O are not permanent account refusals. */
|
|
11
|
+
export declare function nativeLocalAccountRefusal(result: NativeRefreshResult): NativeAccountRefusal | undefined;
|
package/dist/owner-only.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare function readWindowsOwnerOnly(path: string, options?: OwnerOnlyOp
|
|
|
11
11
|
/** Ancestors protect directory entries; they need not themselves be private. */
|
|
12
12
|
export declare function isSafeWindowsParent(path: string, options?: OwnerOnlyOptions): Promise<boolean | undefined>;
|
|
13
13
|
/** Native creation establishes a protected DACL before any bytes are written. */
|
|
14
|
-
export declare function createWindowsOwnerOnly(path: string, bytes: string, options?: OwnerOnlyOptions): Promise<boolean>;
|
|
14
|
+
export declare function createWindowsOwnerOnly(path: string, bytes: string | Uint8Array, options?: OwnerOnlyOptions): Promise<boolean>;
|
|
15
15
|
/**
|
|
16
16
|
* Create only missing Windows directories; never tighten an existing shared directory.
|
|
17
17
|
* Returns false off Windows so callers retain their POSIX directory policy.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { open } from 'node:fs/promises';
|
|
1
2
|
import { type NativeLockEvent } from './native-lock-observer.ts';
|
|
3
|
+
import { type OwnerOnlyOptions } from './owner-only.ts';
|
|
2
4
|
/**
|
|
3
5
|
* The filesystem calls a layout transition makes, so tests can fail one, drop
|
|
4
6
|
* one, or record their order. Production uses `node:fs`.
|
|
@@ -51,7 +53,10 @@ export declare function fileSha256(path: string): Promise<string | null>;
|
|
|
51
53
|
* protected owner-only DACL before any byte is written. The file never exists
|
|
52
54
|
* with wider permissions, so no later `chmod` is needed.
|
|
53
55
|
*/
|
|
54
|
-
export declare function writeOwnerOnlyExclusive(path: string, bytes: Uint8Array, platform: NodeJS.Platform
|
|
56
|
+
export declare function writeOwnerOnlyExclusive(path: string, bytes: Uint8Array, platform: NodeJS.Platform, options?: {
|
|
57
|
+
ownership?: OwnerOnlyOptions;
|
|
58
|
+
open?: typeof open;
|
|
59
|
+
}): Promise<void>;
|
|
55
60
|
/** A target changed between the check before a destructive step and the step. */
|
|
56
61
|
export declare class StateLayoutOwnershipError extends Error {
|
|
57
62
|
readonly path: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/anthropic-auth-core",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"prepublishOnly": "bun run build"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@cortexkit/common-auth": "0.
|
|
33
|
+
"@cortexkit/common-auth": "0.29.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@cortexkit/claustrum-client": "0.13.0",
|
|
37
|
-
"@cortexkit/private-files": "0.2.
|
|
37
|
+
"@cortexkit/private-files": "0.2.2",
|
|
38
38
|
"@cortexkit/subc-client": "^0.22.10",
|
|
39
39
|
"jsonc-parser": "^3.3.1",
|
|
40
40
|
"xxhash-wasm": "^1.1.0"
|