@theokit/sdk 4.23.0 → 4.24.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.
- package/dist/auth/index.cjs +29 -5
- package/dist/auth/index.cjs.map +1 -1
- package/dist/auth/index.js +29 -5
- package/dist/auth/index.js.map +1 -1
- package/dist/cron.cjs +6 -5
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.js +6 -5
- package/dist/cron.js.map +1 -1
- package/dist/eval.cjs +6 -5
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +6 -5
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/auth/credential-store.d.ts +20 -3
- package/dist/models.cjs +11 -5
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +11 -5
- package/dist/models.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
import { AuthenticationError } from "../../errors.js";
|
|
1
2
|
/** The store directory, honoring an optional `homeEnvVar` override. */
|
|
2
3
|
export declare function credentialHome(config: CredentialStoreConfig, env?: Record<string, string | undefined>): string;
|
|
3
4
|
/** The credential file path inside the (possibly overridden) store directory. */
|
|
4
5
|
export declare function authFilePath(config: CredentialStoreConfig, env?: Record<string, string | undefined>): string;
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* A credential problem the caller can act on. Never carries the key value.
|
|
8
|
+
*
|
|
9
|
+
* M78 — this used to extend bare `Error`, which quietly disabled classification for the entire auth
|
|
10
|
+
* path: `isTransientError` is `err instanceof TheokitAgentError && err.isRetryable === true`
|
|
11
|
+
* (`errors.ts:443`), so a credential failure could never be judged transient OR permanent. The
|
|
12
|
+
* predicate was not "forgotten" downstream — it was unusable there by construction.
|
|
13
|
+
*
|
|
14
|
+
* Extending `AuthenticationError` is ADDITIVE: the class still exists, still reports
|
|
15
|
+
* `name: "CredentialError"`, and every existing `instanceof CredentialError` stays true. It only
|
|
16
|
+
* gains ancestors. `AuthenticationError` pins `isRetryable: false`, so gaining the ability to be
|
|
17
|
+
* classified does NOT turn a revoked credential into a retry loop.
|
|
18
|
+
*
|
|
19
|
+
* The single reference does the same thing with one root type: Codex routes every domain failure
|
|
20
|
+
* through `CodexErr` with `is_retryable()` as a method (`protocol/src/error.rs:176`), rather than
|
|
21
|
+
* parallel classes extending the language's `Error`.
|
|
22
|
+
*/
|
|
23
|
+
export declare class CredentialError extends AuthenticationError {
|
|
24
|
+
readonly name: string;
|
|
8
25
|
}
|
|
9
26
|
export declare function readAuthFile(config: CredentialStoreConfig, env?: Record<string, string | undefined>): StoredCredential | undefined;
|
|
10
27
|
/**
|
package/dist/models.cjs
CHANGED
|
@@ -295,6 +295,12 @@ var TheokitAgentError = class extends Error {
|
|
|
295
295
|
if (options.metadata !== void 0) this.metadata = options.metadata;
|
|
296
296
|
}
|
|
297
297
|
};
|
|
298
|
+
var AuthenticationError = class extends TheokitAgentError {
|
|
299
|
+
name = "AuthenticationError";
|
|
300
|
+
constructor(message, options = {}) {
|
|
301
|
+
super(message, { ...options, isRetryable: false });
|
|
302
|
+
}
|
|
303
|
+
};
|
|
298
304
|
var ConfigurationError = class extends TheokitAgentError {
|
|
299
305
|
name = "ConfigurationError";
|
|
300
306
|
constructor(message, options = {}) {
|
|
@@ -535,11 +541,11 @@ function credentialHome(config, env = {}) {
|
|
|
535
541
|
function authFilePath(config, env = {}) {
|
|
536
542
|
return path.join(credentialHome(config, env), config.fileName);
|
|
537
543
|
}
|
|
538
|
-
var CredentialError = class extends
|
|
539
|
-
constructor
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
544
|
+
var CredentialError = class extends AuthenticationError {
|
|
545
|
+
// Field, not an assignment in the constructor: `AuthenticationError.name` is `override readonly`
|
|
546
|
+
// (`errors.ts:174`), so `this.name = …` does not compile. Caught by `tsc`, not by vitest — the
|
|
547
|
+
// suite was green with the broken assignment because the transpiler strips the type.
|
|
548
|
+
name = "CredentialError";
|
|
543
549
|
};
|
|
544
550
|
var apiFileSchema = zod.z.object({
|
|
545
551
|
type: zod.z.literal("api").optional(),
|