tinfoil 2.0.0-rc.4 → 2.0.0-rc.6
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/README.md +153 -26
- package/dist/ai-sdk.d.ts +1 -1
- package/dist/ai-sdk.d.ts.map +1 -1
- package/dist/ai-sdk.js.map +1 -1
- package/dist/enclave-client.d.ts +69 -27
- package/dist/enclave-client.d.ts.map +1 -1
- package/dist/enclave-client.js +160 -80
- package/dist/enclave-client.js.map +1 -1
- package/dist/errors.d.ts +35 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +57 -4
- package/dist/errors.js.map +1 -1
- package/dist/fetchers.d.ts +41 -0
- package/dist/fetchers.d.ts.map +1 -0
- package/dist/fetchers.js +67 -0
- package/dist/fetchers.js.map +1 -0
- package/dist/gateway-client.d.ts +60 -17
- package/dist/gateway-client.d.ts.map +1 -1
- package/dist/gateway-client.js +64 -20
- package/dist/gateway-client.js.map +1 -1
- package/dist/index.browser.d.ts +8 -6
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.js +8 -6
- package/dist/index.browser.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/ai-sdk.d.ts +33 -16
- package/dist/internal/ai-sdk.d.ts.map +1 -1
- package/dist/internal/ai-sdk.js +26 -8
- package/dist/internal/ai-sdk.js.map +1 -1
- package/dist/internal/api-path.js +89 -0
- package/dist/internal/api-path.js.map +1 -0
- package/dist/internal/cachesecret.js +15 -16
- package/dist/internal/cachesecret.js.map +1 -1
- package/dist/internal/enclave.js +81 -22
- package/dist/internal/enclave.js.map +1 -1
- package/dist/internal/fetch.js +70 -15
- package/dist/internal/fetch.js.map +1 -1
- package/dist/internal/gateway/catalog.js +11 -11
- package/dist/internal/gateway/catalog.js.map +1 -1
- package/dist/internal/gateway/policy.js +58 -45
- package/dist/internal/gateway/policy.js.map +1 -1
- package/dist/internal/gateway/transport.js +69 -32
- package/dist/internal/gateway/transport.js.map +1 -1
- package/dist/internal/platform.browser.js +2 -2
- package/dist/internal/platform.browser.js.map +1 -1
- package/dist/internal/platform.js +3 -3
- package/dist/internal/platform.js.map +1 -1
- package/dist/internal/router.js +57 -16
- package/dist/internal/router.js.map +1 -1
- package/dist/internal/transport/base-url.js +18 -16
- package/dist/internal/transport/base-url.js.map +1 -1
- package/dist/internal/transport/ehbp.js.map +1 -1
- package/dist/internal/transport/tls.js.map +1 -1
- package/dist/internal/transport/transport.js +13 -9
- package/dist/internal/transport/transport.js.map +1 -1
- package/dist/internal/transport/ws.browser.js +0 -3
- package/dist/internal/transport/ws.browser.js.map +1 -1
- package/dist/internal/transport/ws.js +6 -36
- package/dist/internal/transport/ws.js.map +1 -1
- package/dist/internal/verified.js +97 -23
- package/dist/internal/verified.js.map +1 -1
- package/dist/internal/websocket.js +4 -2
- package/dist/internal/websocket.js.map +1 -1
- package/dist/internal/ws-options.js +68 -0
- package/dist/internal/ws-options.js.map +1 -0
- package/dist/openai-client.d.ts +89 -108
- package/dist/openai-client.d.ts.map +1 -1
- package/dist/openai-client.js +102 -191
- package/dist/openai-client.js.map +1 -1
- package/dist/openai.d.ts +14 -0
- package/dist/openai.d.ts.map +1 -0
- package/dist/openai.js +13 -0
- package/dist/openai.js.map +1 -0
- package/dist/options.d.ts +289 -97
- package/dist/options.d.ts.map +1 -1
- package/dist/realtime.browser.js.map +1 -1
- package/dist/realtime.d.ts +6 -4
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +7 -3
- package/dist/realtime.js.map +1 -1
- package/dist/router-client.d.ts +31 -14
- package/dist/router-client.d.ts.map +1 -1
- package/dist/router-client.js +47 -30
- package/dist/router-client.js.map +1 -1
- package/dist/surface.d.ts +28 -8
- package/dist/surface.d.ts.map +1 -1
- package/dist/surface.js +24 -8
- package/dist/surface.js.map +1 -1
- package/dist/trust.d.ts +89 -0
- package/dist/trust.d.ts.map +1 -0
- package/dist/trust.js +62 -0
- package/dist/trust.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +13 -9
- package/dist/http.d.ts +0 -13
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -12
- package/dist/http.js.map +0 -1
package/README.md
CHANGED
|
@@ -18,15 +18,16 @@ What to install depends on the entry point that you import:
|
|
|
18
18
|
|
|
19
19
|
| Entry point | Install |
|
|
20
20
|
|---|---|
|
|
21
|
-
| `tinfoil` (the
|
|
21
|
+
| `tinfoil` (the attested HTTP clients and pinned WebSockets) and `tinfoil/unsafe` | `npm install tinfoil@next` |
|
|
22
|
+
| `tinfoil/openai` (the OpenAI client) | `npm install tinfoil@next openai` |
|
|
22
23
|
| `tinfoil/ai-sdk` (the Vercel AI SDK provider) | `npm install tinfoil@next ai @ai-sdk/openai-compatible` |
|
|
23
24
|
|
|
24
|
-
`ai` and `@ai-sdk/openai-compatible` are optional peer dependencies, so installing `tinfoil` doesn't install them. `tinfoil/ai-sdk` imports `@ai-sdk/openai-compatible`; `ai` is what your own code calls with the provider. Importing
|
|
25
|
+
`openai`, `ai` and `@ai-sdk/openai-compatible` are optional peer dependencies, so installing `tinfoil` doesn't install them. `tinfoil/openai` imports `openai`, and `tinfoil/ai-sdk` imports `@ai-sdk/openai-compatible`; `ai` is what your own code calls with the provider. Importing either entry without its package fails with a module-not-found error that names the package.
|
|
25
26
|
|
|
26
27
|
## Quick Start
|
|
27
28
|
|
|
28
29
|
```typescript
|
|
29
|
-
import { createClient } from "tinfoil";
|
|
30
|
+
import { createClient } from "tinfoil/openai";
|
|
30
31
|
|
|
31
32
|
// Discovers Tinfoil's inference router and verifies it before returning.
|
|
32
33
|
const client = await createClient({ apiKey: "<YOUR_API_KEY>" });
|
|
@@ -37,40 +38,112 @@ const completion = await client.chat.completions.create({
|
|
|
37
38
|
});
|
|
38
39
|
```
|
|
39
40
|
|
|
40
|
-
Router and enclave clients are async factories that verify before returning, and they verify again by themselves when the verification expires or the enclave's key changes. Gateway clients are async factories too, but verify a model's replica before its first request. `createClient` takes the OpenAI client's own options (except `baseURL` and `fetch`, which the attested transport owns) plus `bearerToken`, and returns
|
|
41
|
+
Router and enclave clients are async factories that verify before returning, and they verify again by themselves when the verification expires or the enclave's key changes. Gateway clients are async factories too, but verify a model's replica before its first request. `createClient` takes the OpenAI client's own options (except `baseURL` and `fetch`, which the attested transport owns) plus `bearerToken`, and returns an `OpenAIClient` with the same API as `new OpenAI(...)`, over a `RouterHTTPClient` created with the default options. For anything about the route itself, create the HTTP client and then an `OpenAIClient` over it:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { EnclaveHTTPClient, GatewayHTTPClient, RouterHTTPClient } from "tinfoil";
|
|
45
|
+
import { OpenAIClient } from "tinfoil/openai";
|
|
46
|
+
|
|
47
|
+
// One enclave, verified against a GitHub repository.
|
|
48
|
+
const enclave = await EnclaveHTTPClient.create("enclave.example.com", { kind: "repoPin", repo: "owner/name" });
|
|
49
|
+
const client = new OpenAIClient(enclave, { apiKey: "<YOUR_API_KEY>" });
|
|
50
|
+
|
|
51
|
+
// The discovered router, with a verification policy of your own.
|
|
52
|
+
const router = await RouterHTTPClient.create({ policy: { freshnessMaxAgeMs: 24 * 60 * 60 * 1000 } });
|
|
53
|
+
|
|
54
|
+
// Tinfoil's gateway, which serves only the models that are pinned.
|
|
55
|
+
const gateway = await GatewayHTTPClient.create({
|
|
56
|
+
modelPins: new Map([["deepseek-v4-1-flash", { repo: "tinfoilsh/confidential-deepseek-v4-1-flash" }]]),
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`new OpenAIClient(httpClient, options?)` takes an `EnclaveHTTPClient`, `RouterHTTPClient` or `GatewayHTTPClient` and does no network I/O. `options` are the OpenAI client's own options, with `bearerToken` and `apiPath` beside them, as in `new OpenAIClient(httpClient, { apiKey, apiPath: "/openai/v1/" })`; the client takes `apiPath` out before the rest reach the OpenAI client. It sets the OpenAI base URL itself, after your OpenAI options, so a `baseURL`, `OPENAI_BASE_URL` in the environment and `dataResidency` have no effect: the base URL is `apiPath` (`/v1/` when you leave it out; an empty `apiPath` is a `ConfigurationError`) joined under the HTTP client's `baseURL`: the EHBP proxy or the enclave's origin, or the gateway's `url`, which is the gateway's origin (`https://inference-gateway.tinfoil.sh/` by default) or the URL that it is mounted under, never the API path. A gateway mounted under a path serves its catalog and its attestation relay under that path too. An HTTP client's `close()` releases its pooled connections and refuses further use, and both kinds of client support `await using` (an OpenAI client closes the HTTP client under it).
|
|
61
|
+
|
|
62
|
+
### Trust, policy and transport
|
|
63
|
+
|
|
64
|
+
`EnclaveHTTPClient.create(host, trust, options?)` takes a required `trust`, which names who vouches for the config that the enclave runs, as one object told apart by `kind`:
|
|
65
|
+
|
|
66
|
+
| `trust` | Accepts |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `{ kind: "repoPin", repo }` | v2 collateral for a GitHub repository `owner/name[@tag][@sha256:digest]` |
|
|
69
|
+
| `{ kind: "projectPin", project, registryIDs? }` | v3 collateral for a config registry project `org/project[@revision][@sha256:digest]`, endorsed by the public registry, or by exactly the `registryIDs` given (list `PUBLIC_REGISTRY_ID` from `@tinfoilsh/verifier` to keep it); an empty list is a `ConfigurationError` |
|
|
70
|
+
| `{ kind: "signedBy", keys, project? }` | v3 configs that your PEM-encoded P-256 `keys` sign, optionally for one `project` |
|
|
71
|
+
| `{ kind: "authorizedBy", authorize }` | v3 configs that your `authorize` callback accepts |
|
|
72
|
+
| `{ kind: "embeddedConfig", bytes, name? }` | v3 collateral for exactly these config bytes, which must be a JSON config |
|
|
73
|
+
| `{ kind: "eitherPin", repo, project }` | either of `repoPin` and `projectPin`, for the migration from v2 to v3 collateral |
|
|
74
|
+
|
|
75
|
+
The router's trust is fixed to its repository, and the gateway client takes `modelPins` instead, which maps each model name to a `tinfoilsh/` repository and an optional `policy`. A gateway client serves only the models that it has pins for, so it requires at least one pin, and a request or `ensureVerified` for any other model, including one that a later catalog adds, fails with a `ConfigurationError` without contacting a replica. Every HTTP client takes `policy`, the verifier's policy as plain data: `pinnedRegisters`, `freshnessMaxAgeMs` and `artifacts` (`{ kind: "endorsedArtifacts", freshnessKeys? }` or `{ kind: "embeddedArtifacts", runtime?, platform?, freshnessKeys? }`). The enclave and router clients take `transport`: `{ kind: "tls" }`, which pins each connection to the attested key, or `{ kind: "ehbp", proxyURL?, fetch? }`, which seals request and response bodies to the attested key so that they stay private through a proxy. The default depends on the platform:
|
|
76
|
+
|
|
77
|
+
| Platform | Default `transport` | `{ kind: "tls" }` |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| Node; Bun 1.4.0 or later; Deno 2.8.0 or later | TLS | accepted |
|
|
80
|
+
| Browsers; Bun before 1.4.0; Deno before 2.8.0 | EHBP | a `ConfigurationError`, since the platform can't pin the connection |
|
|
81
|
+
|
|
82
|
+
The trust, the policy and the options are checked before any network I/O: an invalid value, or an unknown `kind`, is a `ConfigurationError`.
|
|
41
83
|
|
|
42
84
|
Never put `apiKey` in browser code: the OpenAI clients and the AI SDK provider refuse it outside Node and Bun, `dangerouslyAllowBrowser` or not. Route browser requests through a [proxy server](https://docs.tinfoil.sh/guides/proxy-server) that adds the key, and authenticate the browser with a token of your own:
|
|
43
85
|
|
|
44
86
|
```typescript
|
|
45
|
-
import {
|
|
87
|
+
import { RouterHTTPClient } from "tinfoil";
|
|
88
|
+
import { OpenAIClient } from "tinfoil/openai";
|
|
46
89
|
|
|
47
|
-
const
|
|
90
|
+
const router = await RouterHTTPClient.create({ transport: { kind: "ehbp", proxyURL: "https://proxy.example.com/" } });
|
|
91
|
+
const client = new OpenAIClient(router, { bearerToken: "<SESSION_TOKEN>" });
|
|
48
92
|
```
|
|
49
93
|
|
|
50
|
-
|
|
94
|
+
### A page that contacts only your own origin
|
|
95
|
+
|
|
96
|
+
By default a client also fetches each enclave's attestation document directly from the enclave, and the router client fetches its list of candidate routers from `https://atc.tinfoil.sh/routers`. A page under a strict content security policy, or one that shouldn't reveal its users' IP addresses to enclaves, can send all three kinds of request to your own origin instead:
|
|
51
97
|
|
|
52
|
-
|
|
98
|
+
```typescript
|
|
99
|
+
import { attestationRelay, RouterHTTPClient, routerListRelay } from "tinfoil";
|
|
100
|
+
import { OpenAIClient } from "tinfoil/openai";
|
|
101
|
+
|
|
102
|
+
const router = await RouterHTTPClient.create({
|
|
103
|
+
// Requests, with bodies sealed to the verified router's key.
|
|
104
|
+
transport: { kind: "ehbp", proxyURL: "https://app.example/tinfoil/proxy" },
|
|
105
|
+
// GET /tinfoil/.well-known/tinfoil-attestation?nonce=…&enclave=…
|
|
106
|
+
fetchAttestation: attestationRelay("https://app.example/tinfoil"),
|
|
107
|
+
// GET /tinfoil/routers
|
|
108
|
+
fetchRouterList: routerListRelay("https://app.example/tinfoil"),
|
|
109
|
+
});
|
|
110
|
+
const client = new OpenAIClient(router, { bearerToken: "<SESSION_TOKEN>" });
|
|
111
|
+
```
|
|
53
112
|
|
|
54
|
-
|
|
113
|
+
Your server implements three endpoints:
|
|
114
|
+
|
|
115
|
+
| Endpoint | Forwards to |
|
|
116
|
+
|---|---|
|
|
117
|
+
| The proxy (`proxyURL`) | The router named in the `X-Tinfoil-Enclave-Url` header, adding your API key. Forward only to the router hosts that you expect (those of Tinfoil's router list and `inference.tinfoil.sh`), since the header comes from the page and your API key goes wherever it names. Request and response bodies stay sealed |
|
|
118
|
+
| `{relay}/.well-known/tinfoil-attestation?nonce={hex}&enclave={host}` | `https://{host}/.well-known/tinfoil-attestation?nonce={hex}`, returning the body unchanged. Forward only to the enclave hosts that you expect, so that the relay isn't an open proxy |
|
|
119
|
+
| `{relay}/routers` | `https://atc.tinfoil.sh/routers`, returning the body unchanged |
|
|
120
|
+
|
|
121
|
+
The relays aren't trusted with anything: the client verifies every document that the relay returns, as it verifies one that it fetched itself: the document must answer the client's fresh nonce and pass the router's trust and policy. The router list only proposes candidates: discovery still verifies each one, and falls back to `inference.tinfoil.sh` when none passes. The proxy is trusted with what EHBP leaves unsealed: it sees the method, URL and headers of each request, including the page's bearer token, and adds your API key, so it is part of your own trusted server. One residual trust in the router list remains: a document doesn't name the host that served it, so the list's source is trusted not to name a host that relays another router's attestation, which would then receive the request headers, including the bearer token, although not the sealed bodies. Relay URLs follow the proxy URL's rules: HTTPS, or HTTP only to localhost or a loopback address, with no user information, query or fragment; `attestationRelay` and `routerListRelay` throw a `ConfigurationError` for a bad one when they are called. `fetchAttestation` and `fetchRouterList` also take a function of your own: `(host, nonce, { signal }) => Promise<Uint8Array>` and `({ signal }) => Promise<string[]>`. An `EnclaveHTTPClient` takes `fetchAttestation` too.
|
|
122
|
+
|
|
123
|
+
Browsers use the EHBP transport, the default and the only one available there. The package's type declarations are shared with the Node build, so a browser project type-checks a few names that throw a `ConfigurationError` when called: `createWebSocket` and `pinnedWebSocketOptions` (a verified WebSocket pins the server certificate, which browsers don't expose to scripts), `createRealtimeWebSocket` (a realtime session runs over such a WebSocket), and `transport: { kind: "tls" }` (the TLS transport pins the server certificate too; EHBP seals request and response bodies to the enclave's key instead).
|
|
124
|
+
|
|
125
|
+
Bun pins the TLS connection from Bun 1.4.0, the first release whose `fetch` checks the server certificate before it sends the request; on an older Bun the default transport is EHBP and `transport: { kind: "tls" }` is refused with a `ConfigurationError`. `createWebSocket` needs Bun 1.4.4 or later, the first release whose WebSocket runs the certificate check at all, and is refused on an older Bun before anything is sent. Bun's WebSocket takes none of the `ws` client's settings, so a non-empty `wsOptions` is a `ConfigurationError` there. `pinnedWebSocketOptions` and `createRealtimeWebSocket` hand settings to the `ws` library, which Bun replaces with its own WebSocket, so they are available on Node only.
|
|
126
|
+
|
|
127
|
+
Deno pins the TLS connection from Deno 2.8.0, the first release whose Node compatibility layer runs the certificate check for both requests and WebSockets; on an older Deno the default transport is EHBP, and `transport: { kind: "tls" }` and `createWebSocket` are refused with a `ConfigurationError`.
|
|
55
128
|
|
|
56
129
|
**WebSockets from the `openai` package aren't pinned.** The `openai` package's WebSocket classes (`ResponsesWS`, `LiveWS` and its sideband and forks, `OpenAIRealtimeWS`, `OpenAIRealtimeWebSocket` and `OpenAIRealtimeTranslationWS`) take an OpenAI client and open their own WebSocket. Given a Tinfoil client, they connect to its base URL with its API key or bearer token, but without the TLS pin, so the connection isn't bound to the verified enclave. With an enclave or router client:
|
|
57
130
|
|
|
58
|
-
- For a realtime session, use `createRealtimeWebSocket` instead of `OpenAIRealtimeWS`. It always connects to the verified enclave, even when the client sends its requests through
|
|
59
|
-
- For a WebSocket that you drive yourself, `createWebSocket` opens a raw pinned WebSocket to a path on the verified enclave.
|
|
60
|
-
- `ResponsesWS`, `LiveWS` and its sideband and forks, and `OpenAIRealtimeTranslationWS` have no Tinfoil replacement. On Node, pass them the pinned settings, for example `new ResponsesWS(client, await pinnedWebSocketOptions(client.httpClient))`. That pins the connection only when the client has no
|
|
131
|
+
- For a realtime session, use `createRealtimeWebSocket` instead of `OpenAIRealtimeWS`. It always connects to the verified enclave, even when the client sends its requests through an EHBP proxy.
|
|
132
|
+
- For a WebSocket that you drive yourself, `createWebSocket` opens a raw pinned WebSocket to a path on the verified enclave. Pass the handshake's headers, such as `Authorization` or `Origin`, in its `headers` option and its subprotocols in `protocols`. Its `wsOptions` (and those of `createRealtimeWebSocket`) take the `ws` client's other settings, such as `perMessageDeflate` or `maxPayload`; a setting that the pinned connection owns (`headers`, `origin`, `auth`, `protocol`, `finishRequest`, and those that choose the peer or check its certificate, such as `agent` or `ca`) is a `ConfigurationError` that names it, raised before anything is sent.
|
|
133
|
+
- `ResponsesWS`, `LiveWS` and its sideband and forks, and `OpenAIRealtimeTranslationWS` have no Tinfoil replacement. On Node, pass them the pinned settings, for example `new ResponsesWS(client, await pinnedWebSocketOptions(client.httpClient))`. That pins the connection only when the HTTP client has no EHBP proxy, because the class connects to the client's base URL: then it connects to the enclave itself over `wss://`. Behind a proxy, the pinned handshake fails, because the proxy doesn't hold the enclave's key, and over an `http://` proxy there is no TLS to pin at all.
|
|
61
134
|
|
|
62
135
|
`OpenAIRealtimeWebSocket` uses the runtime's built-in WebSocket and can't be pinned. The gateway client offers no pinned WebSocket, so don't give it to any of these classes.
|
|
63
136
|
|
|
64
|
-
The request body is still encrypted to the verified enclave's key; the proxy only forwards it. `
|
|
137
|
+
The request body is still encrypted to the verified enclave's key; the proxy only forwards it, to the enclave named in the `X-Tinfoil-Enclave-Url` header. A `proxyURL`'s path is where the proxy is mounted, not the API path: an `OpenAIClient` joins its `apiPath` (`/v1/` by default) under it, so `https://proxy.example.com/relay` and `https://proxy.example.com/relay/` both give `https://proxy.example.com/relay/v1/`. Multi-user services must scope prompt caches to each end user with the router client's `userCacheSecret` or a per-request `user_cache_secret`; an enclave client never adds one. See [Prompt caching](https://docs.tinfoil.sh/sdk/prompt-caching).
|
|
65
138
|
|
|
66
|
-
### HTTP
|
|
139
|
+
### HTTP clients and lazy imports
|
|
67
140
|
|
|
68
|
-
If you supply your own API client and need only the verified HTTP transport, import from `tinfoil
|
|
141
|
+
If you supply your own API client and need only the verified HTTP transport, import from `tinfoil`. Its root entry exports the `RouterHTTPClient`, `EnclaveHTTPClient` and `GatewayHTTPClient` classes, their options, Tinfoil errors, catalog and session-recovery helpers, and the pinned WebSockets, and imports neither the OpenAI client nor the AI SDK. The package's browser mappings select the browser transport.
|
|
69
142
|
|
|
70
143
|
```typescript
|
|
71
|
-
import { RouterHTTPClient, type RouterOptions } from "tinfoil
|
|
144
|
+
import { RouterHTTPClient, type RouterOptions } from "tinfoil";
|
|
72
145
|
|
|
73
|
-
const options: RouterOptions = {
|
|
146
|
+
const options: RouterOptions = { transport: { kind: "ehbp" } };
|
|
74
147
|
const client = await RouterHTTPClient.create(options);
|
|
75
148
|
// Pass client.fetch to your API client, and close it when finished.
|
|
76
149
|
```
|
|
@@ -78,33 +151,87 @@ const client = await RouterHTTPClient.create(options);
|
|
|
78
151
|
To defer downloading and evaluating the transport until a user needs it, dynamically import the same entry inside that action:
|
|
79
152
|
|
|
80
153
|
```typescript
|
|
81
|
-
const { RouterHTTPClient } = await import("tinfoil
|
|
82
|
-
const client = await RouterHTTPClient.create({
|
|
154
|
+
const { RouterHTTPClient } = await import("tinfoil");
|
|
155
|
+
const client = await RouterHTTPClient.create({ transport: { kind: "ehbp" } });
|
|
83
156
|
```
|
|
84
157
|
|
|
85
|
-
A bundler can put this dynamic import in a separate chunk, provided the transport isn't also imported eagerly elsewhere in the application.
|
|
158
|
+
A bundler can put this dynamic import in a separate chunk, provided the transport isn't also imported eagerly elsewhere in the application. `tinfoil/openai` is the OpenAI client's entry, and `tinfoil/ai-sdk` the AI SDK's.
|
|
86
159
|
|
|
87
160
|
### Custom network transport
|
|
88
161
|
|
|
89
|
-
|
|
162
|
+
The EHBP transport of `RouterHTTPClient.create` and `EnclaveHTTPClient.create` takes a `fetch`: a fetch-compatible network implementation that carries their sealed requests, for a native HTTP bridge (such as Tauri's) or a trusted relay. `GatewayHTTPClient.create`, which always uses EHBP, takes it as its `fetch` option, and the AI SDK provider's `createTinfoil` takes it in its `transport`. `createClient` takes only the OpenAI options, so it doesn't take it; build an `OpenAIClient` over an HTTP client instead.
|
|
90
163
|
|
|
91
164
|
```typescript
|
|
92
|
-
import { RouterHTTPClient } from "tinfoil
|
|
165
|
+
import { RouterHTTPClient } from "tinfoil";
|
|
93
166
|
|
|
94
167
|
// nativeFetch: a fetch-compatible function that sends the sealed requests.
|
|
95
|
-
const client = await RouterHTTPClient.create({
|
|
168
|
+
const client = await RouterHTTPClient.create({ transport: { kind: "ehbp", fetch: nativeFetch } });
|
|
96
169
|
```
|
|
97
170
|
|
|
98
|
-
The client verifies the enclave and seals each request body before calling it, and opens the response that it returns; attestation documents
|
|
171
|
+
The client verifies the enclave and seals each request body before calling it, and opens the response that it returns; attestation documents and the router list are still fetched with the runtime's fetch, unless `fetchAttestation` or `fetchRouterList` is set, and the gateway catalog is always fetched with it. The function must return a standard `Response` and honour the request's signal, and a relay must pass the sealed body and the protocol headers through unchanged. The method, URL and headers aren't sealed, so a relay sees the API key: use only a relay that you trust, over HTTPS. A request without a body passes through it unsealed, as EHBP leaves it. The TLS transport has no `fetch`, since it pins the connection itself.
|
|
99
172
|
|
|
100
173
|
## Errors
|
|
101
174
|
|
|
102
|
-
The clients throw three error classes, each a `TinfoilError` with a `category`, and with the underlying failure as `cause` when there is one: `ConfigurationError` (invalid options, or a closed client), `NetworkError` (the enclave or its attestation couldn't be reached) and `AttestationError` (the enclave couldn't be trusted: when verification rejected the document, `cause` is the verifier's `VerificationError` whose `layer` names the rejecting check; a key that doesn't match the attested one, or one the enclave no longer holds after rotation, is an `AttestationError` too). Switch on `category` (`"configuration"`, `"network"` or `"attestation"`), which is the stable discriminant; each error's `name` matches its class, for logs and stack traces. The factories, `ensureVerified()`, `reverify()` and an HTTP client's `fetch` throw them directly. A call through the OpenAI API surface, such as `client.chat.completions.create(...)`, goes through the OpenAI client's request loop, which catches whatever the attested `fetch` throws, retries the request `maxRetries` times (2 by default, with backoff; only a request whose body is a stream isn't retried) and then throws `APIConnectionError` with the client's error as its `cause`. So an enclave that fails to verify again on a request surfaces as an `APIConnectionError` whose `cause` is an `AttestationError`, after three verification attempts; pass `maxRetries: 0` to the client or the request to see the first failure.
|
|
175
|
+
The clients throw three error classes, each a `TinfoilError` with a `category`, and with the underlying failure as `cause` when there is one: `ConfigurationError` (invalid options, or a closed client), `NetworkError` (the enclave or its attestation couldn't be reached) and `AttestationError` (the enclave couldn't be trusted: when verification rejected the document, `cause` is the verifier's `VerificationError`, exported from `tinfoil`, whose `layer` names the rejecting check and whose `report` shows the step that failed and what the steps before it established; a key that doesn't match the attested one, or one the enclave no longer holds after rotation, is an `AttestationError` too). Switch on `category` (`"configuration"`, `"network"` or `"attestation"`), which is the stable discriminant; each error's `name` matches its class, for logs and stack traces. The factories, `ensureVerified()`, `reverify()` and an HTTP client's `fetch` throw them directly. A call through the OpenAI API surface, such as `client.chat.completions.create(...)`, goes through the OpenAI client's request loop, which catches whatever the attested `fetch` throws, retries the request `maxRetries` times (2 by default, with backoff; only a request whose body is a stream isn't retried) and then throws `APIConnectionError` with the client's error as its `cause`. So an enclave that fails to verify again on a request surfaces as an `APIConnectionError` whose `cause` is an `AttestationError`, after three verification attempts; pass `maxRetries: 0` to the client or the request to see the first failure. `findTinfoilError(err)` from `tinfoil` follows `cause` and returns the SDK error behind an OpenAI error, or undefined when there is none, as for an error from the API itself:
|
|
176
|
+
|
|
177
|
+
```typescript
|
|
178
|
+
import { findTinfoilError } from "tinfoil";
|
|
179
|
+
|
|
180
|
+
try {
|
|
181
|
+
await client.chat.completions.create({ model: "gpt-oss-120b", messages });
|
|
182
|
+
} catch (err) {
|
|
183
|
+
const sdkError = findTinfoilError(err);
|
|
184
|
+
if (sdkError?.category === "attestation") {
|
|
185
|
+
// The enclave couldn't be trusted: don't send it more data.
|
|
186
|
+
}
|
|
187
|
+
throw err;
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
Errors from the API itself (`AuthenticationError`, `RateLimitError` and the rest) keep the OpenAI client's types; all of them are re-exported from `tinfoil/openai`.
|
|
191
|
+
|
|
192
|
+
## Verification reports
|
|
193
|
+
|
|
194
|
+
A router or enclave client's `ensureVerified()` returns the report of a verification that admits requests now, verifying first if needed, and `reverify()` verifies again and returns the new report: a `VerificationReport`, whose `steps` show each layer's outcome (`passed`, or `skipped` for a layer that had nothing to check) and whose `verifiedFacts` hold what the enclave proved, such as `codeDigest`, `enclaveMeasurement` and `tlsPublicKeyFP`. Without network I/O, `currentVerification()` returns the report of the verification that the client's requests are bound to now, or `undefined`, and `lastVerificationAttempt()` returns the most recent attempt: `{ report }` if it passed, or `{ error }` with the error that the client reported if it failed, so that a later failure replaces an earlier success. When the verifier rejected the document, that error is an `AttestationError` whose `cause` is the verifier's `VerificationError`, and its `report` shows the step that failed and the partial facts, such as the expected and measured registers side by side; a failed fetch is a `NetworkError` with no report. The `onVerificationAttempt(host, attempt)` option is called once for every attempt, including the retry, a re-verification after an expiry or a key rotation, each router that discovery tries (though a probe that discovery abandons when its time budget or the caller's signal runs out, and that then passes, has no outcome and isn't reported), and each gateway replica. `attempt` is the same `{ report }` or `{ error }` that `lastVerificationAttempt()` returns, so that checking one narrows the other, and a callback can store or forward the attempt as it is:
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { RouterHTTPClient, VerificationError } from "tinfoil";
|
|
198
|
+
|
|
199
|
+
const client = await RouterHTTPClient.create({
|
|
200
|
+
onVerificationAttempt: (host, attempt) => {
|
|
201
|
+
if (attempt.report !== undefined) console.log(host, attempt.report.steps);
|
|
202
|
+
else if (attempt.error.cause instanceof VerificationError) console.log(host, attempt.error.cause.report.failedStep());
|
|
203
|
+
else console.log(host, attempt.error);
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
const last = client.lastVerificationAttempt();
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
The clients separate the verification in use from the attempts that produced it:
|
|
210
|
+
|
|
211
|
+
| Call | Network I/O | Returns |
|
|
212
|
+
|---|---|---|
|
|
213
|
+
| `ensureVerified()` | Only if needed | The report of a verification that is valid now, verifying first if the cached one has expired or been discarded |
|
|
214
|
+
| `reverify()` | Always | The report of a new verification, or rejects with its error |
|
|
215
|
+
| `currentVerification()` | None | The report of the verification that requests are bound to now: fresh and not discarded. `undefined` before the first success, after an `AttestationError` or a key rejection discarded it, and once it has expired |
|
|
216
|
+
| `lastVerificationAttempt()` | None | The most recent attempt: `{ report }` if it passed, `{ error }` if it failed |
|
|
217
|
+
| `onVerificationAttempt` option | Push | Each attempt as it is decided, failed attempts included |
|
|
218
|
+
|
|
219
|
+
The two getters differ after a `reverify()` that fails for a reason other than attestation, such as a `NetworkError`: `lastVerificationAttempt()` returns the error, while `currentVerification()` still returns the cached report, under which requests still go through until it expires. A `reverify()` that fails with an `AttestationError` discards the cached verification, so `currentVerification()` returns `undefined` and the next request verifies again.
|
|
220
|
+
|
|
221
|
+
- Health and readiness checks call `ensureVerified()`. It returns at once while the cached verification is valid, and verifies when it isn't. Clients don't verify again in the background, so `currentVerification()` is `undefined` between the expiry of a verification and the next request; don't treat that as a failure.
|
|
222
|
+
- Status displays show `currentVerification()` for the verification in use, and `lastVerificationAttempt()` for the outcome of the latest attempt, which may be a failure.
|
|
223
|
+
- Live status and logging use `onVerificationAttempt`, which sees every attempt, including retries that `lastVerificationAttempt()` has already moved past.
|
|
224
|
+
|
|
225
|
+
`tinfoil` exports the verifier's `VerificationError` and `REPORT_SCHEMA_VERSION`, and the types that a report holds: `VerificationReport`, `VerifiedFacts`, `PartialFacts`, `ExpectedFacts`, `MeasuredFacts`, `CPUEvidence`, `Step`, `StepStatus`, `Layer`, `VerificationMetadata`, the measurement and reference types that they name, and the JSON form's `VerificationReportJSON` and the `*JSON` types within it. Import them from `tinfoil` rather than from `@tinfoilsh/verifier`, so that an app needs no direct dependency on the verifier to show a verification. `tinfoil` pins an exact verifier version, and a direct dependency on any other version installs a second copy: `instanceof VerificationError` is then false for the errors that a client throws, and that copy's `VerificationReport` isn't the type that a client returns.
|
|
226
|
+
|
|
227
|
+
The gateway client verifies each model's replicas separately. Its `ensureVerified(model)` and `reverify(model)` take the model, and `reverify(model)` verifies again the replica that `ensureVerified(model)` would return. When that replica fails with an `AttestationError`, its verification is discarded and `reverify` moves on to the next replica, as `ensureVerified` then does; when no replica passes or keeps a valid verification, it rejects with the last failure. `replicas()` returns an entry for each replica that the client has tried to verify, with its `host`, the `models` requested through it, its `reference` and `pinnedModel`, `current`, which follows `currentVerification()`'s rule for that replica, and `lastAttempt`, the replica's last attempt as `{ report }` or `{ error }`. A gateway client's `policy` applies to the pins that set none; a pin's own `policy` replaces it entirely. A `verificationCheck` receives only the verified facts of a verification that passed.
|
|
228
|
+
|
|
229
|
+
`JSON.stringify(report)` writes a report in the JSON form that every Tinfoil SDK exports, to show it or to pass it on, for example to a browser; the [verifier's README](packages/verifier/README.md#the-json-form) describes the form. A report that a client hands out names the host that the client contacted in `metadata.host`: the enclave, even when requests go through an EHBP proxy, the router that the client chose, or the gateway replica, so that a proxy that passes a report on needn't add the host itself. The host is what the client connected to, not an attested fact. A report from the verifier itself has no host; `report.withHost(host)` returns a copy with one. The JSON authorizes nothing: nothing reads it back into a report, and a client never binds a channel to a key read from it.
|
|
103
230
|
|
|
104
231
|
## Documentation
|
|
105
232
|
|
|
106
233
|
- [JavaScript SDK documentation](https://docs.tinfoil.sh/sdk/javascript-sdk), which describes the 1.x API until 2.0 is released; for 2.0, use this README and the migration guide below.
|
|
107
|
-
- Realtime transcription over WebSockets uses `createRealtimeWebSocket(client, { model })`, which opens a session over a WebSocket pinned to the attested key.
|
|
234
|
+
- Realtime transcription over WebSockets uses `createRealtimeWebSocket(client, { model })` from `tinfoil/openai`, which opens a session over a WebSocket pinned to the attested key.
|
|
108
235
|
- [Examples](packages/tinfoil/examples/), including the Vercel AI SDK provider (`createTinfoil` from `tinfoil/ai-sdk`) on the server and in React.
|
|
109
236
|
- [Migrating from 1.x to 2.0](https://github.com/tinfoilsh/tinfoil-js/blob/main/MIGRATION.md).
|
|
110
237
|
- The resources a client exposes, such as `chat`, `responses`, `embeddings`, and `audio`, keep the OpenAI methods and types; see the [OpenAI Node client documentation](https://github.com/openai/openai-node).
|
package/dist/ai-sdk.d.ts
CHANGED
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
* map: a bundler substitutes the internal modules that the browser field
|
|
9
9
|
* lists, so neither entry needs a browser build of its own.
|
|
10
10
|
*/
|
|
11
|
-
export { createTinfoil, type TinfoilProvider, type TinfoilProviderOptions, type TinfoilProviderEnclave } from "./internal/ai-sdk.js";
|
|
11
|
+
export { createTinfoil, type TinfoilProvider, type TinfoilProviderOptions, type TinfoilProviderBaseOptions, type TinfoilProviderEnclave } from "./internal/ai-sdk.js";
|
|
12
12
|
//# sourceMappingURL=ai-sdk.d.ts.map
|
package/dist/ai-sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-sdk.d.ts","sourceRoot":"","sources":["../src/ai-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"ai-sdk.d.ts","sourceRoot":"","sources":["../src/ai-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,eAAe,EAAE,KAAK,sBAAsB,EAAE,KAAK,0BAA0B,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/ai-sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-sdk.js","sourceRoot":"","sources":["../src/ai-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"ai-sdk.js","sourceRoot":"","sources":["../src/ai-sdk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAmH,MAAM,sBAAsB,CAAC"}
|
package/dist/enclave-client.d.ts
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* when the verification expires or is rejected, and refuses requests to any
|
|
5
5
|
* origin other than the one it is bound to.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import { type VerificationReport } from "@tinfoilsh/verifier";
|
|
8
8
|
import { asyncDispose } from "./internal/dispose.js";
|
|
9
|
-
import type { CallOptions, EnclaveOptions, Fetch } from "./options.js";
|
|
9
|
+
import type { CallOptions, EnclaveOptions, Fetch, VerificationAttempt } from "./options.js";
|
|
10
|
+
import { type Trust } from "./trust.js";
|
|
10
11
|
/**
|
|
11
12
|
* An HTTP client bound to one attested enclave; see the module header. The
|
|
12
13
|
* constructor is private: type-checked code cannot call it, and a call from
|
|
13
14
|
* untyped code is refused at runtime. Clients come from
|
|
14
|
-
* {@link EnclaveHTTPClient.create}, and from the
|
|
15
|
-
*
|
|
16
|
-
* option.
|
|
15
|
+
* {@link EnclaveHTTPClient.create}, and from the AI SDK provider's `enclave`
|
|
16
|
+
* option. An `OpenAIClient` from `tinfoil/openai` can be built over one.
|
|
17
17
|
*/
|
|
18
18
|
export declare class EnclaveHTTPClient {
|
|
19
19
|
#private;
|
|
@@ -23,39 +23,81 @@ export declare class EnclaveHTTPClient {
|
|
|
23
23
|
* {@link ConfigurationError}.
|
|
24
24
|
*/
|
|
25
25
|
readonly fetch: Fetch;
|
|
26
|
-
/** Where requests go: the
|
|
26
|
+
/** Where requests go: the EHBP proxy, or the enclave's own origin. Always ends with `/`, so a relative path resolves against it with `new URL(path, client.baseURL)`. */
|
|
27
27
|
readonly baseURL: string;
|
|
28
28
|
/** The host of the verified enclave, even when `baseURL` is a proxy. */
|
|
29
29
|
readonly enclave: string;
|
|
30
|
-
/** The pin the enclave is verified against; an unset part is "". */
|
|
31
|
-
readonly pin: Required<Pin>;
|
|
32
30
|
private constructor();
|
|
33
31
|
/**
|
|
34
|
-
* A client for the enclave at `host`, verified
|
|
35
|
-
*
|
|
36
|
-
* checked before any network I/O
|
|
37
|
-
* is returned.
|
|
32
|
+
* A client for the enclave at `host`, verified under `trust`, which names
|
|
33
|
+
* who vouches for the enclave's config, and the `policy` option. The trust
|
|
34
|
+
* and the options are checked before any network I/O, and the enclave is
|
|
35
|
+
* verified before the client is returned.
|
|
38
36
|
*/
|
|
39
|
-
static create(host: string,
|
|
40
|
-
/**
|
|
41
|
-
get
|
|
37
|
+
static create(host: string, trust: Trust, options?: EnclaveOptions): Promise<EnclaveHTTPClient>;
|
|
38
|
+
/** A copy of the trust that the enclave is verified under; changing the copy has no effect on the client. */
|
|
39
|
+
get trust(): Trust;
|
|
42
40
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
41
|
+
* The report of the verification that the client's requests are bound to
|
|
42
|
+
* now, without network I/O: the latest successful verification while it
|
|
43
|
+
* is fresh, before its verified facts' freshness deadline, and has not been
|
|
44
|
+
* discarded. It is undefined before the first successful verification,
|
|
45
|
+
* after a failure discarded the verification (a `reverify` or a
|
|
46
|
+
* re-verification that failed with an {@link AttestationError}, or a key
|
|
47
|
+
* rejection), once the verification has expired, and after `close`. A
|
|
48
|
+
* re-verification that fails in any other way, such as with a
|
|
49
|
+
* {@link NetworkError}, leaves it unchanged while it is fresh, though
|
|
50
|
+
* {@link lastVerificationAttempt} then returns the failure.
|
|
51
|
+
*
|
|
52
|
+
* The client doesn't verify again in the background, so after expiry it is
|
|
53
|
+
* undefined until the next request or `ensureVerified` verifies again; a
|
|
54
|
+
* readiness check calls {@link ensureVerified} instead. Its answer holds at
|
|
55
|
+
* the time of the call: the verification can expire right after. Each call
|
|
56
|
+
* returns a new copy.
|
|
45
57
|
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
58
|
+
currentVerification(): VerificationReport | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* The outcome of the most recent attempt to verify the enclave, without
|
|
61
|
+
* network I/O, or undefined before the first: `{ report }` if it passed,
|
|
62
|
+
* or `{ error }` with the error that the client reported if it failed,
|
|
63
|
+
* from which the verifier's `VerificationError` and its report are
|
|
64
|
+
* reachable through `cause` when the verifier rejected the document. Every
|
|
65
|
+
* attempt counts: the first verification, its retry, a re-verification
|
|
66
|
+
* after an expiry or a key rotation, and `reverify`. A later failure
|
|
67
|
+
* replaces an earlier success. A report is not checked again: it may have
|
|
68
|
+
* expired or been discarded since; {@link currentVerification} returns the
|
|
69
|
+
* verification that requests are bound to now. Each call returns a new
|
|
70
|
+
* copy.
|
|
71
|
+
*/
|
|
72
|
+
lastVerificationAttempt(): VerificationAttempt | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* The report of a verification valid now, verifying first only if the
|
|
75
|
+
* cached one has expired or been rejected. Success means requests can be
|
|
76
|
+
* sent; its verified facts are what they are sent under.
|
|
77
|
+
*/
|
|
78
|
+
ensureVerified(options?: CallOptions): Promise<VerificationReport>;
|
|
79
|
+
/**
|
|
80
|
+
* Verifies again even if the cached verification is still valid. A failure
|
|
81
|
+
* rejects the promise. When the failure is an {@link AttestationError},
|
|
82
|
+
* the cached verification is discarded even if it is still fresh: no
|
|
83
|
+
* request is sent under it again, its pooled connections aren't reused,
|
|
84
|
+
* and the next request or `ensureVerified` verifies again, failing if the
|
|
85
|
+
* problem persists and recovering if it doesn't. Any other failure, such
|
|
86
|
+
* as a {@link NetworkError} or a {@link ConfigurationError}, keeps a
|
|
87
|
+
* cached verification that is still valid in use. When the signal aborts,
|
|
88
|
+
* the call stops waiting, but the verification that it started still
|
|
89
|
+
* finishes, and its outcome is handled in the same way.
|
|
90
|
+
*/
|
|
91
|
+
reverify(options?: CallOptions): Promise<VerificationReport>;
|
|
49
92
|
/**
|
|
50
93
|
* Releases what the client holds and refuses further use. On Node, the
|
|
51
|
-
*
|
|
52
|
-
* request still in flight on them with a {@link NetworkError}; the
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* completes. No verification runs again. Afterwards `fetch`, `ensureVerified`,
|
|
94
|
+
* TLS transport's pooled connections are closed, which also ends any
|
|
95
|
+
* request still in flight on them with a {@link NetworkError}; the EHBP
|
|
96
|
+
* transport sends through the runtime's fetch, or its own `fetch`, and
|
|
97
|
+
* holds no connections of its own, so a request in flight completes. No verification runs again. Afterwards `fetch`, `ensureVerified`,
|
|
56
98
|
* `reverify` and the WebSocket functions reject with a
|
|
57
|
-
* {@link ConfigurationError}; `
|
|
58
|
-
*
|
|
99
|
+
* {@link ConfigurationError}; `lastVerificationAttempt` still reports the last
|
|
100
|
+
* attempt, and `currentVerification` returns undefined. Closing again does nothing.
|
|
59
101
|
*/
|
|
60
102
|
close(): Promise<void>;
|
|
61
103
|
/** Closes the client at the end of an `await using` block; see {@link close}. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enclave-client.d.ts","sourceRoot":"","sources":["../src/enclave-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"enclave-client.d.ts","sourceRoot":"","sources":["../src/enclave-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA2C,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAIvG,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAWrD,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,EAAa,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACvG,OAAO,EAA8B,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AA2JpE;;;;;;GAMG;AACH,qBAAa,iBAAiB;;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,yKAAyK;IACzK,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAIzB,OAAO;IAgBP;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI/F,6GAA6G;IAC7G,IAAI,KAAK,IAAI,KAAK,CAEjB;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,IAAI,kBAAkB,GAAG,SAAS;IAIrD;;;;;;;;;;;;OAYG;IACH,uBAAuB,IAAI,mBAAmB,GAAG,SAAS;IAI1D;;;;OAIG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIlE;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI5D;;;;;;;;;OASG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5B,iFAAiF;IACjF,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
|