@rulvar/anthropic 1.21.0 → 1.23.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/index.d.ts +13 -6
- package/dist/index.js +13 -6
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -90,17 +90,24 @@ interface AnthropicAdapterOptions {
|
|
|
90
90
|
* Creates the first-class Anthropic adapter (id 'anthropic'). SDK
|
|
91
91
|
* autoretries are disabled (max_retries 0): the core owns retries and
|
|
92
92
|
* wall-clock. With no auth option at all, the underlying SDK resolves
|
|
93
|
-
* credentials itself: `ANTHROPIC_API_KEY
|
|
94
|
-
* `ANTHROPIC_AUTH_TOKEN
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
93
|
+
* credentials itself: it reads `ANTHROPIC_API_KEY` and
|
|
94
|
+
* `ANTHROPIC_AUTH_TOKEN` as INDEPENDENT credentials, never a
|
|
95
|
+
* precedence chain between the two; requests carry `x-api-key` for the
|
|
96
|
+
* key, bearer `Authorization` for the token, and BOTH headers when
|
|
97
|
+
* both are set (the server decides). The SDK's config-file credential
|
|
98
|
+
* chain (`credentials`, else `config`, else `profile`) is consulted
|
|
99
|
+
* ONLY when apiKey and authToken are both null; either one set, an
|
|
100
|
+
* env-read one included, means a configured token provider is never
|
|
101
|
+
* even built. When `sdkOptions` carries structured auth and no
|
|
102
|
+
* `apiKey`/`authToken` is set to a string anywhere, ambient
|
|
103
|
+
* environment credentials are suppressed (explicit
|
|
98
104
|
* `apiKey: null, authToken: null` are passed to the SDK), so the
|
|
99
105
|
* configured provider is the one that authenticates; the SDK itself
|
|
100
106
|
* would otherwise let an environment `ANTHROPIC_API_KEY` or
|
|
101
107
|
* `ANTHROPIC_AUTH_TOKEN` win over the provider. An explicit
|
|
102
108
|
* `apiKey: null` or `authToken: null` counts as absence for this rule,
|
|
103
|
-
* never as a chosen credential.
|
|
109
|
+
* never as a chosen credential. The full matrix lives in the providers
|
|
110
|
+
* guide under anthropic-credential-precedence.
|
|
104
111
|
*/
|
|
105
112
|
declare function anthropic(options?: AnthropicAdapterOptions): ProviderAdapter;
|
|
106
113
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -691,17 +691,24 @@ function resolveAnthropicClient(options) {
|
|
|
691
691
|
* Creates the first-class Anthropic adapter (id 'anthropic'). SDK
|
|
692
692
|
* autoretries are disabled (max_retries 0): the core owns retries and
|
|
693
693
|
* wall-clock. With no auth option at all, the underlying SDK resolves
|
|
694
|
-
* credentials itself: `ANTHROPIC_API_KEY
|
|
695
|
-
* `ANTHROPIC_AUTH_TOKEN
|
|
696
|
-
*
|
|
697
|
-
*
|
|
698
|
-
*
|
|
694
|
+
* credentials itself: it reads `ANTHROPIC_API_KEY` and
|
|
695
|
+
* `ANTHROPIC_AUTH_TOKEN` as INDEPENDENT credentials, never a
|
|
696
|
+
* precedence chain between the two; requests carry `x-api-key` for the
|
|
697
|
+
* key, bearer `Authorization` for the token, and BOTH headers when
|
|
698
|
+
* both are set (the server decides). The SDK's config-file credential
|
|
699
|
+
* chain (`credentials`, else `config`, else `profile`) is consulted
|
|
700
|
+
* ONLY when apiKey and authToken are both null; either one set, an
|
|
701
|
+
* env-read one included, means a configured token provider is never
|
|
702
|
+
* even built. When `sdkOptions` carries structured auth and no
|
|
703
|
+
* `apiKey`/`authToken` is set to a string anywhere, ambient
|
|
704
|
+
* environment credentials are suppressed (explicit
|
|
699
705
|
* `apiKey: null, authToken: null` are passed to the SDK), so the
|
|
700
706
|
* configured provider is the one that authenticates; the SDK itself
|
|
701
707
|
* would otherwise let an environment `ANTHROPIC_API_KEY` or
|
|
702
708
|
* `ANTHROPIC_AUTH_TOKEN` win over the provider. An explicit
|
|
703
709
|
* `apiKey: null` or `authToken: null` counts as absence for this rule,
|
|
704
|
-
* never as a chosen credential.
|
|
710
|
+
* never as a chosen credential. The full matrix lives in the providers
|
|
711
|
+
* guide under anthropic-credential-precedence.
|
|
705
712
|
*/
|
|
706
713
|
function anthropic(options = {}) {
|
|
707
714
|
const client = resolveAnthropicClient(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rulvar/anthropic",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.23.0",
|
|
4
4
|
"description": "Rulvar first-class provider adapter over @anthropic-ai/sdk.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@anthropic-ai/sdk": "^0.110.0",
|
|
26
|
-
"@rulvar/core": "1.
|
|
26
|
+
"@rulvar/core": "1.23.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.20.0",
|
|
30
30
|
"tsdown": "^0.22.3",
|
|
31
31
|
"typescript": "~6.0.3",
|
|
32
|
-
"@rulvar/testing": "1.
|
|
32
|
+
"@rulvar/testing": "1.23.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|