@tensorcost/sdk 1.4.0 → 1.5.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/CHANGELOG.md +210 -0
- package/README.md +34 -16
- package/dist/admit-client.d.ts +17 -9
- package/dist/admit-client.d.ts.map +1 -1
- package/dist/admit-client.js +85 -30
- package/dist/admit-client.js.map +1 -1
- package/dist/applied.d.ts +114 -0
- package/dist/applied.d.ts.map +1 -1
- package/dist/applied.js +40 -50
- package/dist/applied.js.map +1 -1
- package/dist/errors.d.ts +155 -27
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +137 -27
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/provider-errors.d.ts +15 -0
- package/dist/provider-errors.d.ts.map +1 -0
- package/dist/provider-errors.js +69 -0
- package/dist/provider-errors.js.map +1 -0
- package/dist/providers/anthropic.d.ts +54 -0
- package/dist/providers/anthropic.d.ts.map +1 -1
- package/dist/providers/anthropic.js +57 -18
- package/dist/providers/anthropic.js.map +1 -1
- package/dist/providers/bedrock.d.ts +4 -1
- package/dist/providers/bedrock.d.ts.map +1 -1
- package/dist/providers/bedrock.js +3 -2
- package/dist/providers/bedrock.js.map +1 -1
- package/dist/providers/detect.d.ts.map +1 -1
- package/dist/providers/detect.js +9 -6
- package/dist/providers/detect.js.map +1 -1
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/providers/openai.js +21 -47
- package/dist/providers/openai.js.map +1 -1
- package/dist/providers/vertex.d.ts +17 -0
- package/dist/providers/vertex.d.ts.map +1 -1
- package/dist/providers/vertex.js +5 -2
- package/dist/providers/vertex.js.map +1 -1
- package/dist/proxy-client.d.ts +157 -0
- package/dist/proxy-client.d.ts.map +1 -1
- package/dist/proxy-client.js +188 -201
- package/dist/proxy-client.js.map +1 -1
- package/dist/refusal.d.ts +43 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +154 -0
- package/dist/refusal.js.map +1 -0
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +45 -13
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +15 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrap-overhead.d.ts +43 -0
- package/dist/wrap-overhead.d.ts.map +1 -1
- package/dist/wrap-overhead.js +28 -1
- package/dist/wrap-overhead.js.map +1 -1
- package/dist/wrap.d.ts +25 -0
- package/dist/wrap.d.ts.map +1 -1
- package/dist/wrap.js +51 -8
- package/dist/wrap.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applied-mode wiring — Layer 2.
|
|
3
|
+
*
|
|
4
|
+
* When the customer opts into applied mode, the SDK routes every inference
|
|
5
|
+
* request through the TensorCost inference-proxy instead of directly to the
|
|
6
|
+
* upstream AI provider. The proxy decides per-request whether to re-route
|
|
7
|
+
* or pass through unchanged; the SDK doesn't make that call.
|
|
8
|
+
*
|
|
9
|
+
* The mechanism is straightforward: at `wrap()` time we read the
|
|
10
|
+
* provider's original baseURL and auth from the client, permanently
|
|
11
|
+
* redirect the client's baseURL to the proxy endpoint, and inject two
|
|
12
|
+
* custom headers the proxy expects:
|
|
13
|
+
*
|
|
14
|
+
* x-tc-provider-url — the original provider base URL
|
|
15
|
+
* x-tc-provider-auth — the auth header value to forward upstream
|
|
16
|
+
*
|
|
17
|
+
* Both the OpenAI SDK and the Anthropic SDK expose `baseURL` and
|
|
18
|
+
* `defaultHeaders` as first-class properties, so we can set them
|
|
19
|
+
* without monkey-patching the HTTP layer.
|
|
20
|
+
*
|
|
21
|
+
* Bedrock is not supported in v1. The AWS SDK uses SigV4 signing on
|
|
22
|
+
* regional endpoints and doesn't expose baseURL / defaultHeaders in
|
|
23
|
+
* the same shape. Passing a Bedrock-shaped client with appliedMode=true
|
|
24
|
+
* throws `TensorCostConfigError` at wrap time.
|
|
25
|
+
*
|
|
26
|
+
* Observe-only telemetry (the 0.2.x substrate) continues to fire
|
|
27
|
+
* after every call regardless of this setting.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Client shapes we understand. All detection is duck-typed; no import
|
|
31
|
+
* of the actual openai or @anthropic-ai/sdk packages.
|
|
32
|
+
*/
|
|
33
|
+
/** Header value the proxy expects for OpenAI + Azure OpenAI. */
|
|
34
|
+
declare function bearerAuth(apiKey: string): string;
|
|
35
|
+
/** Header value the proxy expects for Anthropic. */
|
|
36
|
+
declare function anthropicAuth(apiKey: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Read the original baseURL from a duck-typed client. Both the OpenAI
|
|
39
|
+
* and Anthropic SDKs expose a `baseURL` string property on the client
|
|
40
|
+
* instance (the actual HTTP origin, e.g. "https://api.openai.com/v1").
|
|
41
|
+
* Returns null when the property is absent or not a string.
|
|
42
|
+
*/
|
|
43
|
+
declare function readBaseUrl(client: Record<string, unknown>): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Read the API key from the client. OpenAI SDK exposes `client.apiKey`;
|
|
46
|
+
* Anthropic SDK exposes `client.apiKey` too. Returns null when absent.
|
|
47
|
+
*/
|
|
48
|
+
declare function readApiKey(client: Record<string, unknown>): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Detect whether this client looks like an Azure OpenAI client (the
|
|
51
|
+
* openai package's `AzureOpenAI` subclass). Azure uses `api-key` header
|
|
52
|
+
* auth and a custom endpoint URL, so the auth value we forward differs
|
|
53
|
+
* from vanilla OpenAI.
|
|
54
|
+
*
|
|
55
|
+
* Detection: Azure clients have an `azure` property set to true, OR
|
|
56
|
+
* their baseURL contains `.openai.azure.com`.
|
|
57
|
+
*/
|
|
58
|
+
declare function isAzureOpenAI(client: Record<string, unknown>): boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Azure OpenAI uses an `api-key` header rather than `Authorization: Bearer`.
|
|
61
|
+
* The proxy forwards `x-tc-provider-auth` verbatim as the upstream auth
|
|
62
|
+
* header, so we need to format it as the proxy expects: "api-key <value>".
|
|
63
|
+
*
|
|
64
|
+
* Note: The proxy currently only supports `Authorization` and `api-key`
|
|
65
|
+
* style headers. This value is forwarded in the `x-tc-provider-auth`
|
|
66
|
+
* header and then sent by the proxy as the upstream Authorization.
|
|
67
|
+
*/
|
|
68
|
+
declare function azureAuth(apiKey: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* Check a client can be used in applied mode. Called once by `wrap()`.
|
|
71
|
+
*
|
|
72
|
+
* Since 1.5.0 it changes nothing on the client (see the note at the end);
|
|
73
|
+
* the wrapper sends the proxied call itself with the values from
|
|
74
|
+
* `providerTarget()`.
|
|
75
|
+
*
|
|
76
|
+
* @param client - The customer's AI SDK client (duck-typed).
|
|
77
|
+
* @param proxyUrl - The TensorCost proxy base URL (already stripped of trailing slash).
|
|
78
|
+
* @param provider - "openai" | "anthropic", as detected by detectProvider().
|
|
79
|
+
*
|
|
80
|
+
* @throws TensorCostConfigError
|
|
81
|
+
* - If the client doesn't expose `baseURL` (can't determine the original
|
|
82
|
+
* provider URL to forward in `x-tc-provider-url`).
|
|
83
|
+
* - If the client doesn't expose `apiKey` (can't build `x-tc-provider-auth`).
|
|
84
|
+
* - If the provider is "bedrock" (not yet supported in v1).
|
|
85
|
+
*/
|
|
86
|
+
export declare function installAppliedMode(client: unknown, proxyUrl: string, provider: "openai" | "anthropic", scope?: {
|
|
87
|
+
application?: string | null;
|
|
88
|
+
tags?: string[];
|
|
89
|
+
customer?: string | null;
|
|
90
|
+
feature?: string | null;
|
|
91
|
+
teamId?: string | null;
|
|
92
|
+
}): void;
|
|
93
|
+
/**
|
|
94
|
+
* Where the proxy should forward this client's call: the client's own base
|
|
95
|
+
* URL and its auth, formatted for `x-tc-provider-url` / `x-tc-provider-auth`.
|
|
96
|
+
*
|
|
97
|
+
* A client that already carries those as plain `defaultHeaders` entries
|
|
98
|
+
* (callers who set them by hand) keeps them.
|
|
99
|
+
*/
|
|
100
|
+
export declare function providerTarget(client: unknown, provider: "openai" | "anthropic", defaultUrl: string): {
|
|
101
|
+
providerUrl: string;
|
|
102
|
+
providerAuth: string;
|
|
103
|
+
};
|
|
104
|
+
export declare const PROXY_PATH_SUFFIX = "/api/inference-proxy/v1/chat/completions";
|
|
105
|
+
export declare const __test__: {
|
|
106
|
+
readBaseUrl: typeof readBaseUrl;
|
|
107
|
+
readApiKey: typeof readApiKey;
|
|
108
|
+
isAzureOpenAI: typeof isAzureOpenAI;
|
|
109
|
+
bearerAuth: typeof bearerAuth;
|
|
110
|
+
anthropicAuth: typeof anthropicAuth;
|
|
111
|
+
azureAuth: typeof azureAuth;
|
|
112
|
+
};
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=applied.d.ts.map
|
package/dist/applied.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applied.d.ts","sourceRoot":"","sources":["../src/applied.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAOH;;;GAGG;AAEH,gEAAgE;AAChE,iBAAS,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE1C;AAED,oDAAoD;AACpD,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE7C;AAED;;;;;GAKG;AACH,iBAAS,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAMnE;AAED;;;GAGG;AACH,iBAAS,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAGlE;AAED;;;;;;;;GAQG;AACH,iBAAS,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAI/D;AAED;;;;;;;;GAQG;AACH,iBAAS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5B,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,QAAQ,GAAG,WAAW,EAChC,UAAU,EAAE,MAAM,GACjB;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAa/C;AAED,eAAO,MAAM,iBAAiB,6CAAa,CAAC;AAE5C,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAC"}
|
package/dist/applied.js
CHANGED
|
@@ -90,12 +90,11 @@ function azureAuth(apiKey) {
|
|
|
90
90
|
return `api-key ${apiKey}`;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Check a client can be used in applied mode. Called once by `wrap()`.
|
|
94
94
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* request automatically carries them.
|
|
95
|
+
* Since 1.5.0 it changes nothing on the client (see the note at the end);
|
|
96
|
+
* the wrapper sends the proxied call itself with the values from
|
|
97
|
+
* `providerTarget()`.
|
|
99
98
|
*
|
|
100
99
|
* @param client - The customer's AI SDK client (duck-typed).
|
|
101
100
|
* @param proxyUrl - The TensorCost proxy base URL (already stripped of trailing slash).
|
|
@@ -131,51 +130,42 @@ export function installAppliedMode(client, proxyUrl, provider, scope) {
|
|
|
131
130
|
"property to forward provider auth. The client passed to wrap() does " +
|
|
132
131
|
"not expose one.");
|
|
133
132
|
}
|
|
134
|
-
//
|
|
135
|
-
//
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
headers["x-tc-customer"] = scope.customer;
|
|
171
|
-
}
|
|
172
|
-
if (scope?.feature) {
|
|
173
|
-
headers["x-tc-feature"] = scope.feature;
|
|
174
|
-
}
|
|
175
|
-
if (scope?.teamId) {
|
|
176
|
-
headers["x-tc-team-id"] = scope.teamId;
|
|
177
|
-
}
|
|
178
|
-
c["defaultHeaders"] = headers;
|
|
133
|
+
// Nothing on the client is changed. Until 1.5.0 this rewrote
|
|
134
|
+
// `client.baseURL` to the proxy and replaced `client.defaultHeaders` with
|
|
135
|
+
// a plain object. openai@4 has `defaultHeaders()` as a method, so every
|
|
136
|
+
// call that reached the client's own request path (the fail-open
|
|
137
|
+
// fallback, and every call below steer) died with "this.defaultHeaders is
|
|
138
|
+
// not a function"; and the fallback, when it worked, went to the proxy
|
|
139
|
+
// URL rather than the provider. The SDK sends the proxied call itself, so
|
|
140
|
+
// the client only needs to be read, and `providerTarget()` reads it per
|
|
141
|
+
// call so a rotated key is picked up.
|
|
142
|
+
void scope;
|
|
143
|
+
}
|
|
144
|
+
function providerAuthFor(c, provider, apiKey) {
|
|
145
|
+
if (provider === "anthropic")
|
|
146
|
+
return anthropicAuth(apiKey);
|
|
147
|
+
if (isAzureOpenAI(c))
|
|
148
|
+
return azureAuth(apiKey);
|
|
149
|
+
return bearerAuth(apiKey);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Where the proxy should forward this client's call: the client's own base
|
|
153
|
+
* URL and its auth, formatted for `x-tc-provider-url` / `x-tc-provider-auth`.
|
|
154
|
+
*
|
|
155
|
+
* A client that already carries those as plain `defaultHeaders` entries
|
|
156
|
+
* (callers who set them by hand) keeps them.
|
|
157
|
+
*/
|
|
158
|
+
export function providerTarget(client, provider, defaultUrl) {
|
|
159
|
+
const c = (client && typeof client === "object" ? client : {});
|
|
160
|
+
const dh = c["defaultHeaders"];
|
|
161
|
+
const manual = dh && typeof dh === "object" && !Array.isArray(dh) ? dh : {};
|
|
162
|
+
const manualUrl = typeof manual["x-tc-provider-url"] === "string" ? manual["x-tc-provider-url"] : null;
|
|
163
|
+
const manualAuth = typeof manual["x-tc-provider-auth"] === "string" ? manual["x-tc-provider-auth"] : null;
|
|
164
|
+
const apiKey = readApiKey(c);
|
|
165
|
+
return {
|
|
166
|
+
providerUrl: manualUrl ?? readBaseUrl(c) ?? defaultUrl,
|
|
167
|
+
providerAuth: manualAuth ?? (apiKey ? providerAuthFor(c, provider, apiKey) : ""),
|
|
168
|
+
};
|
|
179
169
|
}
|
|
180
170
|
export const PROXY_PATH_SUFFIX = PROXY_PATH;
|
|
181
171
|
export const __test__ = {
|
package/dist/applied.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applied.js","sourceRoot":"","sources":["../src/applied.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,iDAAiD;AACjD,MAAM,UAAU,GAAG,0CAA0C,CAAC;AAE9D;;;GAGG;AAEH,gEAAgE;AAChE,SAAS,UAAU,CAAC,MAAc;IAChC,OAAO,UAAU,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED,oDAAoD;AACpD,SAAS,aAAa,CAAC,MAAc;IACnC,OAAO,aAAa,MAAM,EAAE,CAAC;AAC/B,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,MAA+B;IAClD,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC9B,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;A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KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACzF,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO;QACL,WAAW,EAAE,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC,IAAI,UAAU;QACtD,YAAY,EAAE,UAAU,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACjF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE5C,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,WAAW;IACX,UAAU;IACV,aAAa;IACb,UAAU;IACV,aAAa;IACb,SAAS;CACV,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -8,11 +8,27 @@
|
|
|
8
8
|
* Hierarchy:
|
|
9
9
|
*
|
|
10
10
|
* TensorCostError (base)
|
|
11
|
-
* ├── TensorCostNetworkError couldn't reach the proxy at all
|
|
12
|
-
* ├── TensorCostTimeoutError request or idle window exceeded limit
|
|
13
|
-
* ├── TensorCostProxyError proxy responded with 5xx
|
|
14
|
-
* ├── TensorCostQuotaError proxy
|
|
15
|
-
*
|
|
11
|
+
* ├── TensorCostNetworkError couldn't reach the proxy at all ┐
|
|
12
|
+
* ├── TensorCostTimeoutError request or idle window exceeded limit │ outages: the only
|
|
13
|
+
* ├── TensorCostProxyError proxy responded with 5xx │ errors that may fall
|
|
14
|
+
* ├── TensorCostQuotaError proxy 429, or 402 plan ceiling ┘ back to the provider
|
|
15
|
+
* ├── TensorCostProviderError proxy relayed an upstream provider 4xx
|
|
16
|
+
* │ (rethrown as the provider SDK's own error
|
|
17
|
+
* │ type when the client can build one)
|
|
18
|
+
* ├── TensorCostGatewayRejectedError non-JSON 4xx from in front of TensorCost
|
|
19
|
+
* ├── TensorCostKeyRejectedError token exchange rejected the API key
|
|
20
|
+
* └── TensorCostRefusedError TensorCost refused the call (terminal)
|
|
21
|
+
* ├── TensorCostRunBudgetExceededError
|
|
22
|
+
* ├── TensorCostRunStoppedError
|
|
23
|
+
* ├── TensorCostPeriodBudgetExceededError
|
|
24
|
+
* │ └── TensorCostBudgetHardCapError
|
|
25
|
+
* ├── TensorCostModelGovernanceDeniedError
|
|
26
|
+
* ├── TensorCostGuardrailHardStopError
|
|
27
|
+
* ├── TensorCostComplianceDeniedError
|
|
28
|
+
* └── TensorCostComplianceTeamMismatchError
|
|
29
|
+
*
|
|
30
|
+
* A refusal code this SDK version doesn't model still arrives as a plain
|
|
31
|
+
* TensorCostRefusedError with its `code`, `reason` and message intact.
|
|
16
32
|
*
|
|
17
33
|
* All subclasses carry:
|
|
18
34
|
* - `rootCause` the underlying Error, if any (avoids clash with ES2022 Error.cause)
|
|
@@ -49,7 +65,9 @@ export declare class TensorCostProxyError extends TensorCostError {
|
|
|
49
65
|
constructor(message: string, opts?: TensorCostErrorOptions);
|
|
50
66
|
}
|
|
51
67
|
/**
|
|
52
|
-
* The proxy returned 429 Too Many Requests
|
|
68
|
+
* The proxy returned 429 Too Many Requests (TensorCost's own rate limit),
|
|
69
|
+
* or 402 with no refusal body (the plan's monthly proxy-request ceiling;
|
|
70
|
+
* `status` says which). Neither carries a refusal, so both may fall back.
|
|
53
71
|
* `retryAfterMs` is set when the response included a `Retry-After` header.
|
|
54
72
|
*/
|
|
55
73
|
export declare class TensorCostQuotaError extends TensorCostError {
|
|
@@ -57,12 +75,63 @@ export declare class TensorCostQuotaError extends TensorCostError {
|
|
|
57
75
|
constructor(message: string, retryAfterMs: number | null, opts?: TensorCostErrorOptions);
|
|
58
76
|
}
|
|
59
77
|
/**
|
|
60
|
-
* The proxy
|
|
61
|
-
*
|
|
62
|
-
*
|
|
78
|
+
* The proxy reached the upstream provider and relayed the provider's own
|
|
79
|
+
* 4xx (OpenAI 400 invalid request, Anthropic 401, and so on). `status` is
|
|
80
|
+
* the provider's status and `body` is what the provider sent, parsed as
|
|
81
|
+
* JSON when it was JSON. Never falls back: the provider would only answer
|
|
82
|
+
* the same way again.
|
|
63
83
|
*/
|
|
64
84
|
export declare class TensorCostProviderError extends TensorCostError {
|
|
65
|
-
|
|
85
|
+
readonly body: unknown;
|
|
86
|
+
/** Response headers of the relayed error, lower-cased. */
|
|
87
|
+
readonly headers: Record<string, string>;
|
|
88
|
+
constructor(message: string, opts?: TensorCostErrorOptions & {
|
|
89
|
+
body?: unknown;
|
|
90
|
+
headers?: Record<string, string>;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Something in front of TensorCost turned the request away: a 4xx whose
|
|
95
|
+
* body isn't JSON (an HTML page from a firewall or load balancer, or
|
|
96
|
+
* nothing at all). Neither TensorCost nor the provider saw the call.
|
|
97
|
+
* Terminal: going around it would mean going around whatever put the
|
|
98
|
+
* firewall there, and the next call would most likely meet it too.
|
|
99
|
+
*/
|
|
100
|
+
export declare class TensorCostGatewayRejectedError extends TensorCostError {
|
|
101
|
+
/** The first 500 characters of what came back, if anything did. */
|
|
102
|
+
readonly bodyText: string | null;
|
|
103
|
+
constructor(status: number, bodyText: string | null, opts?: TensorCostErrorOptions);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The token exchange rejected the TensorCost API key (401 or 403): revoked,
|
|
107
|
+
* mistyped, or issued for a different tenant than the one configured. Not
|
|
108
|
+
* an outage, so it never fails open.
|
|
109
|
+
*/
|
|
110
|
+
export declare class TensorCostKeyRejectedError extends TensorCostError {
|
|
111
|
+
constructor(status: number, opts?: TensorCostErrorOptions);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* TensorCost answered and the answer is no: a budget, a stop, a policy.
|
|
115
|
+
*
|
|
116
|
+
* Every refusal is terminal. It never retries and never falls back to the
|
|
117
|
+
* provider, because the proxy that sent it is healthy and the refusal is
|
|
118
|
+
* the product. `code` is the server's refusal code (null when the server
|
|
119
|
+
* refused without naming one), `reason` its optional sub-reason, and
|
|
120
|
+
* `detail` the refusal object as the server sent it.
|
|
121
|
+
*
|
|
122
|
+
* Subclasses cover the codes this SDK version models. Anything else, a
|
|
123
|
+
* code added on the server after this release included, is thrown as this
|
|
124
|
+
* class directly so it is still terminal.
|
|
125
|
+
*/
|
|
126
|
+
export declare class TensorCostRefusedError extends TensorCostError {
|
|
127
|
+
readonly code: string | null;
|
|
128
|
+
readonly reason: string | null;
|
|
129
|
+
readonly detail: Record<string, unknown> | null;
|
|
130
|
+
constructor(message: string, refusal?: {
|
|
131
|
+
code?: string | null;
|
|
132
|
+
reason?: string | null;
|
|
133
|
+
detail?: Record<string, unknown> | null;
|
|
134
|
+
}, opts?: TensorCostErrorOptions);
|
|
66
135
|
}
|
|
67
136
|
/**
|
|
68
137
|
* The agent run this call belongs to has hit its spend cap, and the proxy
|
|
@@ -76,13 +145,16 @@ export declare class TensorCostProviderError extends TensorCostError {
|
|
|
76
145
|
* anyway, bill the customer, and reduce the cap to a suggestion.
|
|
77
146
|
*
|
|
78
147
|
* See `shouldFallBackToProvider()` in proxy-client.ts, which is the single
|
|
79
|
-
* predicate every provider wrapper consults before falling back.
|
|
148
|
+
* predicate every provider wrapper consults before falling back. Since
|
|
149
|
+
* 1.5.0 it is an allow-list of outages, so a refusal can't slip past it.
|
|
80
150
|
*/
|
|
81
|
-
export declare class TensorCostRunBudgetExceededError extends
|
|
151
|
+
export declare class TensorCostRunBudgetExceededError extends TensorCostRefusedError {
|
|
82
152
|
readonly workflowId: string | null;
|
|
83
153
|
readonly capCents: number | null;
|
|
84
154
|
readonly spentCents: number | null;
|
|
85
|
-
constructor(message: string, workflowId: string | null, capCents: number | null, spentCents: number | null, opts?: TensorCostErrorOptions
|
|
155
|
+
constructor(message: string, workflowId: string | null, capCents: number | null, spentCents: number | null, opts?: TensorCostErrorOptions & {
|
|
156
|
+
detail?: Record<string, unknown> | null;
|
|
157
|
+
});
|
|
86
158
|
}
|
|
87
159
|
/**
|
|
88
160
|
* An operator stopped the agent run this call belongs to, and the proxy
|
|
@@ -92,7 +164,7 @@ export declare class TensorCostRunBudgetExceededError extends TensorCostError {
|
|
|
92
164
|
* from a healthy proxy, so falling back to the provider would simply undo
|
|
93
165
|
* it. Carries the who / when / why the proxy recorded.
|
|
94
166
|
*/
|
|
95
|
-
export declare class TensorCostRunStoppedError extends
|
|
167
|
+
export declare class TensorCostRunStoppedError extends TensorCostRefusedError {
|
|
96
168
|
/**
|
|
97
169
|
* Build the error from the proxy's 403 `error` object. Shared by the
|
|
98
170
|
* chat-completions client and the govern-layer admit client, which both
|
|
@@ -103,53 +175,109 @@ export declare class TensorCostRunStoppedError extends TensorCostError {
|
|
|
103
175
|
readonly workflowId: string | null;
|
|
104
176
|
readonly stoppedBy: string | null;
|
|
105
177
|
readonly stoppedAt: string | null;
|
|
106
|
-
readonly reason: string | null;
|
|
107
178
|
constructor(message: string, detail?: {
|
|
108
179
|
workflowId?: string | null;
|
|
109
180
|
stoppedBy?: string | null;
|
|
110
181
|
stoppedAt?: string | null;
|
|
111
182
|
reason?: string | null;
|
|
112
|
-
}, opts?: TensorCostErrorOptions
|
|
183
|
+
}, opts?: TensorCostErrorOptions & {
|
|
184
|
+
detail?: Record<string, unknown> | null;
|
|
185
|
+
});
|
|
113
186
|
}
|
|
114
187
|
/**
|
|
115
188
|
* Daily or monthly agent/team spend cap exceeded (HTTP 403,
|
|
116
189
|
* `code: "PERIOD_BUDGET_EXCEEDED"`). Terminal — must not fall back to the
|
|
117
190
|
* provider or the cap becomes a suggestion.
|
|
118
191
|
*/
|
|
119
|
-
export declare class TensorCostPeriodBudgetExceededError extends
|
|
192
|
+
export declare class TensorCostPeriodBudgetExceededError extends TensorCostRefusedError {
|
|
120
193
|
readonly scope: string | null;
|
|
121
194
|
readonly period: string | null;
|
|
122
195
|
readonly capCents: number | null;
|
|
123
196
|
readonly spentCents: number | null;
|
|
124
|
-
constructor(message: string, scope: string | null, period: string | null, capCents: number | null, spentCents: number | null, opts?: TensorCostErrorOptions
|
|
197
|
+
constructor(message: string, scope: string | null, period: string | null, capCents: number | null, spentCents: number | null, opts?: TensorCostErrorOptions & {
|
|
198
|
+
code?: string | null;
|
|
199
|
+
reason?: string | null;
|
|
200
|
+
detail?: Record<string, unknown> | null;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* A money budget's hard cap refused the call (HTTP 403).
|
|
205
|
+
*
|
|
206
|
+
* The server sends `error.code: "PERIOD_BUDGET_EXCEEDED"` with
|
|
207
|
+
* `error.budget_code: "BUDGET_HARD_CAP"` (that code is what made 1.4.0
|
|
208
|
+
* treat it as terminal), and older servers sent `error.code:
|
|
209
|
+
* "BUDGET_HARD_CAP"`. Both map here. `code` keeps whichever the server
|
|
210
|
+
* sent; `budgetCode` is always "BUDGET_HARD_CAP".
|
|
211
|
+
*
|
|
212
|
+
* It extends TensorCostPeriodBudgetExceededError because 1.4.0 already
|
|
213
|
+
* raised that class for the current wire shape, so an existing `catch` for
|
|
214
|
+
* it keeps working, and scope / period / capCents / spentCents are filled
|
|
215
|
+
* the same way.
|
|
216
|
+
*
|
|
217
|
+
* `reason: "spend_not_known_yet"` (with `retryable: true` on the wire)
|
|
218
|
+
* means the budget hasn't been counted yet, usually for a few seconds after
|
|
219
|
+
* it is created or its scope changes, so the cap holds calls until the
|
|
220
|
+
* first count lands. That case is `retryable`, and `retryAfterSeconds`
|
|
221
|
+
* comes from the Retry-After header or the body's `retry_after_seconds`.
|
|
222
|
+
* The SDK does not retry on its own.
|
|
223
|
+
*/
|
|
224
|
+
export declare class TensorCostBudgetHardCapError extends TensorCostPeriodBudgetExceededError {
|
|
225
|
+
readonly budgetCode = "BUDGET_HARD_CAP";
|
|
226
|
+
readonly budgetId: string | null;
|
|
227
|
+
readonly budgetName: string | null;
|
|
228
|
+
readonly burnPct: number | null;
|
|
229
|
+
readonly retryable: boolean;
|
|
230
|
+
readonly retryAfterSeconds: number | null;
|
|
231
|
+
constructor(message: string, fields?: {
|
|
232
|
+
code?: string | null;
|
|
233
|
+
budgetId?: string | null;
|
|
234
|
+
budgetName?: string | null;
|
|
235
|
+
burnPct?: number | null;
|
|
236
|
+
scope?: string | null;
|
|
237
|
+
period?: string | null;
|
|
238
|
+
capCents?: number | null;
|
|
239
|
+
spentCents?: number | null;
|
|
240
|
+
reason?: string | null;
|
|
241
|
+
retryable?: boolean | null;
|
|
242
|
+
retryAfterSeconds?: number | null;
|
|
243
|
+
detail?: Record<string, unknown> | null;
|
|
244
|
+
}, opts?: TensorCostErrorOptions);
|
|
125
245
|
}
|
|
126
246
|
/**
|
|
127
247
|
* Tenant model governance refused this model (HTTP 403,
|
|
128
248
|
* `code: "MODEL_GOVERNANCE_DENIED"`). Terminal — must not fall back to the
|
|
129
249
|
* provider, or Enforce would become a suggestion.
|
|
130
250
|
*/
|
|
131
|
-
export declare class TensorCostModelGovernanceDeniedError extends
|
|
251
|
+
export declare class TensorCostModelGovernanceDeniedError extends TensorCostRefusedError {
|
|
132
252
|
readonly provider: string | null;
|
|
133
253
|
readonly model: string | null;
|
|
134
254
|
readonly governanceStatus: string | null;
|
|
135
|
-
constructor(message: string, provider: string | null, model: string | null, governanceStatus: string | null, opts?: TensorCostErrorOptions
|
|
255
|
+
constructor(message: string, provider: string | null, model: string | null, governanceStatus: string | null, opts?: TensorCostErrorOptions & {
|
|
256
|
+
detail?: Record<string, unknown> | null;
|
|
257
|
+
});
|
|
136
258
|
}
|
|
137
259
|
/**
|
|
138
260
|
* Guardrail hard_stop refused this call (HTTP 403,
|
|
139
261
|
* `code: "GUARDRAIL_HARD_STOP"`). Terminal — same fail-closed contract as
|
|
140
262
|
* run-budget and model governance denials.
|
|
141
263
|
*/
|
|
142
|
-
export declare class TensorCostGuardrailHardStopError extends
|
|
264
|
+
export declare class TensorCostGuardrailHardStopError extends TensorCostRefusedError {
|
|
143
265
|
readonly policyId: string | null;
|
|
144
|
-
constructor(message: string, policyId: string | null, opts?: TensorCostErrorOptions
|
|
266
|
+
constructor(message: string, policyId: string | null, opts?: TensorCostErrorOptions & {
|
|
267
|
+
reason?: string | null;
|
|
268
|
+
detail?: Record<string, unknown> | null;
|
|
269
|
+
});
|
|
145
270
|
}
|
|
146
271
|
/** Compliance policy refused this call (metadata or in-process DLP). */
|
|
147
|
-
export declare class TensorCostComplianceDeniedError extends
|
|
148
|
-
|
|
149
|
-
|
|
272
|
+
export declare class TensorCostComplianceDeniedError extends TensorCostRefusedError {
|
|
273
|
+
constructor(message: string, reason: string | null, opts?: TensorCostErrorOptions & {
|
|
274
|
+
detail?: Record<string, unknown> | null;
|
|
275
|
+
});
|
|
150
276
|
}
|
|
151
277
|
/** Client team_id does not match token-bound team scope. */
|
|
152
|
-
export declare class TensorCostComplianceTeamMismatchError extends
|
|
153
|
-
constructor(message: string, opts?: TensorCostErrorOptions
|
|
278
|
+
export declare class TensorCostComplianceTeamMismatchError extends TensorCostRefusedError {
|
|
279
|
+
constructor(message: string, opts?: TensorCostErrorOptions & {
|
|
280
|
+
detail?: Record<string, unknown> | null;
|
|
281
|
+
});
|
|
154
282
|
}
|
|
155
283
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,8BAAsB,eAAgB,S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