@keln.ai/sdk 0.0.0-stage → 0.1.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 +14 -0
- package/LICENSE +202 -0
- package/NOTICE +6 -0
- package/README.md +598 -2
- package/dist/api-promise.d.ts +30 -0
- package/dist/api-promise.js +38 -0
- package/dist/api-promise.js.map +1 -0
- package/dist/api.d.ts +130 -0
- package/dist/api.js +321 -0
- package/dist/api.js.map +1 -0
- package/dist/client.d.ts +27 -0
- package/dist/client.js +42 -0
- package/dist/client.js.map +1 -0
- package/dist/commands.d.ts +78 -0
- package/dist/commands.js +269 -0
- package/dist/commands.js.map +1 -0
- package/dist/errors.d.ts +93 -0
- package/dist/errors.js +173 -0
- package/dist/errors.js.map +1 -0
- package/dist/files.d.ts +33 -0
- package/dist/files.js +130 -0
- package/dist/files.js.map +1 -0
- package/dist/images.d.ts +79 -0
- package/dist/images.js +150 -0
- package/dist/images.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/inference.d.ts +672 -0
- package/dist/inference.js +244 -0
- package/dist/inference.js.map +1 -0
- package/dist/retry.d.ts +10 -0
- package/dist/retry.js +87 -0
- package/dist/retry.js.map +1 -0
- package/dist/sandbox.d.ts +132 -0
- package/dist/sandbox.js +216 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/sse.d.ts +20 -0
- package/dist/sse.js +119 -0
- package/dist/sse.js.map +1 -0
- package/dist/streaming.d.ts +20 -0
- package/dist/streaming.js +77 -0
- package/dist/streaming.js.map +1 -0
- package/dist/terminals.d.ts +75 -0
- package/dist/terminals.js +239 -0
- package/dist/terminals.js.map +1 -0
- package/dist/types.d.ts +226 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/uploads.d.ts +35 -0
- package/dist/uploads.js +154 -0
- package/dist/uploads.js.map +1 -0
- package/dist/util.d.ts +19 -0
- package/dist/util.js +69 -0
- package/dist/util.js.map +1 -0
- package/dist/web.d.ts +66 -0
- package/dist/web.js +44 -0
- package/dist/web.js.map +1 -0
- package/package.json +57 -4
- package/src/api-promise.ts +50 -0
- package/src/api.ts +415 -0
- package/src/client.ts +43 -0
- package/src/commands.ts +325 -0
- package/src/errors.ts +185 -0
- package/src/files.ts +149 -0
- package/src/images.ts +174 -0
- package/src/index.ts +114 -0
- package/src/inference.ts +737 -0
- package/src/retry.ts +77 -0
- package/src/sandbox.ts +281 -0
- package/src/sse.ts +124 -0
- package/src/streaming.ts +79 -0
- package/src/terminals.ts +269 -0
- package/src/types.ts +241 -0
- package/src/uploads.ts +177 -0
- package/src/util.ts +78 -0
- package/src/web.ts +94 -0
package/README.md
CHANGED
|
@@ -1,3 +1,599 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @keln.ai/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Keln SDK for TypeScript. With it you can:
|
|
4
|
+
|
|
5
|
+
- call Keln's models: chat completions, responses, embeddings, rerank, decisions, transcriptions, speech and images;
|
|
6
|
+
- run code in a sandbox: start one, run commands with streamed output, read and write files, open a terminal, save
|
|
7
|
+
the sandbox as an image, and stop it;
|
|
8
|
+
- search the web and read pages.
|
|
9
|
+
|
|
10
|
+
It needs Node.js 22 or newer, and it is published as an ES module. Use it in server-side code, not in a browser: code
|
|
11
|
+
that runs in a browser would expose your API key to everyone who opens the page.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @keln.ai/sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quickstart
|
|
20
|
+
|
|
21
|
+
Set the `KELN_API_KEY` environment variable to your Keln API key.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { Keln } from '@keln.ai/sdk';
|
|
25
|
+
|
|
26
|
+
const keln = new Keln();
|
|
27
|
+
const sandbox = await keln.sandboxes.create({ timeoutS: 600 });
|
|
28
|
+
const result = await sandbox.commands.run('echo hi');
|
|
29
|
+
console.log(result.stdout, result.exitCode);
|
|
30
|
+
await sandbox.delete();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A sandbox declared with `await using` is deleted automatically when its block ends:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
await using sandbox = await keln.sandboxes.create();
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## The client
|
|
40
|
+
|
|
41
|
+
`new Keln(options)` accepts these options:
|
|
42
|
+
|
|
43
|
+
| Option | Default | What it does |
|
|
44
|
+
|---|---|---|
|
|
45
|
+
| `apiKey` | The `KELN_API_KEY` environment variable | Your API key. Without a key, the constructor throws `KelnError`. |
|
|
46
|
+
| `baseUrl` | `KELN_SANDBOX_URL`, then `https://sandbox.keln.ai` | The address of the Sandbox API. It must be an `http` or `https` URL; anything else throws `KelnError`. |
|
|
47
|
+
| `apiUrl` | `KELN_API_URL`, then `https://api.keln.ai` | The address of inference and `keln.web`. It must be an `http` or `https` URL. |
|
|
48
|
+
| `fetch` | The global `fetch` | A `fetch` that every HTTP request goes through. Use it for tests and proxies. Terminal sockets do not use it: they connect to `baseUrl` directly. |
|
|
49
|
+
| `maxRetries` | 2 on api.keln.ai, 5 for sandboxes | How many times a failed call is sent again. See *Retries and streams*. |
|
|
50
|
+
| `streamIdleTimeoutMs` | 45000 | How many milliseconds an event stream may stay silent before the SDK treats it as interrupted. `0` turns the check off. |
|
|
51
|
+
| `maxReattachAttempts` | 5 | How many times in a row the SDK may reattach to a stream and receive nothing before the stream fails. |
|
|
52
|
+
|
|
53
|
+
## Inference
|
|
54
|
+
|
|
55
|
+
Each inference endpoint accepts a request format that existing tools already use, so code written for those tools
|
|
56
|
+
keeps working after you switch to the Keln client:
|
|
57
|
+
|
|
58
|
+
- Chat completions, responses, embeddings, transcriptions, speech and images accept the same request body as the
|
|
59
|
+
OpenAI SDK.
|
|
60
|
+
- Rerank accepts the request format of Cohere's rerank API, which RAG libraries also use.
|
|
61
|
+
- Decisions accept the System One request format, which decision models use. The TypeSafe SDK sends the same format.
|
|
62
|
+
|
|
63
|
+
Any other field you put in the body reaches the API unchanged. The optional second argument of a call takes `signal`,
|
|
64
|
+
`timeout` (milliseconds for the whole call), `headers` and `query`.
|
|
65
|
+
|
|
66
|
+
### Chat completions
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const completion = await keln.chat.completions.create({
|
|
70
|
+
model: 'moonshotai/kimi-k3.1-pro',
|
|
71
|
+
messages: [{ role: 'user', content: 'Capital of France?' }],
|
|
72
|
+
temperature: 0.2,
|
|
73
|
+
});
|
|
74
|
+
console.log(completion.choices[0]?.message.content, completion.usage?.cost, completion._request_id);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
To stream the answer, pass `stream: true` and read the chunks as they arrive:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
const stream = await keln.chat.completions.create({ model: 'moonshotai/kimi-k3.1-pro', messages, stream: true });
|
|
81
|
+
for await (const chunk of stream) process.stdout.write(chunk.choices[0]?.delta.content ?? '');
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Keln adds four fields of its own to chat completions. All four are typed:
|
|
85
|
+
|
|
86
|
+
- `reasoning_effort`: how deeply the model thinks. With `none`, the model answers without thinking.
|
|
87
|
+
- `service_tier`: the mode, `lite` or `standard`.
|
|
88
|
+
- `web_search_options`: turns web search on. `{}` uses the defaults.
|
|
89
|
+
- `code_execution`: the limits of code execution. A `code_interpreter` or `shell` tool in `tools` turns code
|
|
90
|
+
execution on.
|
|
91
|
+
|
|
92
|
+
When a request uses web search or code execution, the answer's `usage` shows what they billed, in
|
|
93
|
+
`web_search_requests` and `code_execution_seconds`.
|
|
94
|
+
|
|
95
|
+
### Responses
|
|
96
|
+
|
|
97
|
+
```ts
|
|
98
|
+
const response = await keln.responses.create({ model: 'moonshotai/kimi-k3.1-pro', input: 'Capital of France?' });
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
On responses, `reasoning: { effort }` and `service_tier` work the same way as `reasoning_effort` and `service_tier`
|
|
102
|
+
do on chat completions.
|
|
103
|
+
|
|
104
|
+
### Embeddings
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
const vectors = await keln.embeddings.create({
|
|
108
|
+
model: 'qwen/qwen3-embedding-8b',
|
|
109
|
+
input: ['first text', 'second text'],
|
|
110
|
+
});
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If you don't pass `encoding_format`, the SDK asks the API for base64, which is a quarter of the size, and gives you
|
|
114
|
+
the embeddings as numbers. The OpenAI SDK does the same. If you do pass `encoding_format`, you get the embeddings in
|
|
115
|
+
the form the API sent them.
|
|
116
|
+
|
|
117
|
+
### Rerank
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
const ranked = await keln.rerank.create({
|
|
121
|
+
model: 'qwen/qwen3-reranker-8b',
|
|
122
|
+
query: 'capital of France',
|
|
123
|
+
documents: ['Berlin is in Germany.', 'Paris is in France.'],
|
|
124
|
+
top_n: 1,
|
|
125
|
+
});
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Decisions
|
|
129
|
+
|
|
130
|
+
A decision model answers typed `questions` about a shared `state`.
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
const decision = await keln.decisions.create({
|
|
134
|
+
model: 'typesafe/jev-1.14',
|
|
135
|
+
state: 'I was charged twice and want a refund.',
|
|
136
|
+
questions: { refund: { type: 'noul', instructions: 'Is the customer asking for money back?' } },
|
|
137
|
+
});
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Transcriptions
|
|
141
|
+
|
|
142
|
+
```ts
|
|
143
|
+
const transcript = await keln.audio.transcriptions.create({
|
|
144
|
+
model: 'microsoft/mai-transcribe-2',
|
|
145
|
+
file: fs.createReadStream('meeting.wav'),
|
|
146
|
+
});
|
|
147
|
+
console.log(transcript.text, transcript.usage?.seconds);
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
To get subtitles, ask for the `srt` format:
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
const subtitles = await keln.audio.transcriptions.create({
|
|
154
|
+
model: 'microsoft/mai-transcribe-2',
|
|
155
|
+
file: await toFile(buffer, 'meeting.wav'),
|
|
156
|
+
response_format: 'srt',
|
|
157
|
+
});
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
`file` can be a `File`, a `Blob`, a fetch `Response` or a stream such as `fs.createReadStream(path)`. `toFile` makes
|
|
161
|
+
a `File` from a `Buffer` or a `Uint8Array`. The SDK sends the file as multipart, the way the OpenAI SDK does, and
|
|
162
|
+
sends an array as repeated `name[]` fields.
|
|
163
|
+
|
|
164
|
+
An answer in the `text`, `srt` or `vtt` format is a string. `diarize: true` adds the speakers to a `verbose_json`
|
|
165
|
+
answer.
|
|
166
|
+
|
|
167
|
+
### Speech
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
const speech = await keln.audio.speech.create({
|
|
171
|
+
model: 'google/gemini-3.8-flash-tts',
|
|
172
|
+
input: 'Hello from Keln.',
|
|
173
|
+
voice: 'Kore',
|
|
174
|
+
});
|
|
175
|
+
await fs.promises.writeFile('hello.mp3', speech.content);
|
|
176
|
+
console.log(speech.usage.seconds, speech.usage.cost);
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
The answer has:
|
|
180
|
+
|
|
181
|
+
- `content`: the audio as a `Uint8Array`. It is MP3 unless `response_format` asks for `opus`, `flac`, `wav` or `pcm`.
|
|
182
|
+
- `arrayBuffer()`: the same method that the OpenAI SDK's answer has.
|
|
183
|
+
- `usage`: taken from the answer's headers, with `prompt_tokens`, `completion_tokens`, `cost` and `seconds`.
|
|
184
|
+
|
|
185
|
+
`voice` is one of the model's own voices, which `GET /v1/models` lists as `supported_voices`. For a conversation,
|
|
186
|
+
`input` can be a list of turns, each with its own `voice` and `instructions`.
|
|
187
|
+
|
|
188
|
+
### Image generation and editing
|
|
189
|
+
|
|
190
|
+
```ts
|
|
191
|
+
const picture = await keln.images.generate({
|
|
192
|
+
model: 'google/gemini-nano-banana-2.1',
|
|
193
|
+
prompt: 'A lighthouse on a cliff at dawn, watercolor.',
|
|
194
|
+
aspect_ratio: '16:9',
|
|
195
|
+
});
|
|
196
|
+
await fs.promises.writeFile('lighthouse.png', Buffer.from(picture.data[0]!.b64_json, 'base64'));
|
|
197
|
+
console.log(picture.size, picture.usage?.cost);
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
To edit, pass one image or an array of images together with a prompt:
|
|
201
|
+
|
|
202
|
+
```ts
|
|
203
|
+
const edited = await keln.images.edit({
|
|
204
|
+
model: 'google/gemini-nano-banana-2.1',
|
|
205
|
+
image: [fs.createReadStream('room.png'), fs.createReadStream('lamp.png')],
|
|
206
|
+
prompt: 'Put the lamp from the second picture on the desk in the first. Keep everything else as it is.',
|
|
207
|
+
});
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
The answer has the same shape as OpenAI's image answer:
|
|
211
|
+
|
|
212
|
+
- `data[0].b64_json` is the picture as base64, with its `media_type`.
|
|
213
|
+
- `size` and `output_format` describe the picture.
|
|
214
|
+
- `usage` has the tokens and the `cost`.
|
|
215
|
+
|
|
216
|
+
To choose a size, pass `size` (as `WIDTHxHEIGHT`, or as a resolution such as `2K`), or pass `aspect_ratio` and
|
|
217
|
+
`resolution`. `GET /v1/models` lists each image model's sizes in `supported_parameters`. An edit with no `size`,
|
|
218
|
+
`aspect_ratio` or `resolution` keeps the shape of your picture.
|
|
219
|
+
|
|
220
|
+
An image you pass to an edit is a file or a string:
|
|
221
|
+
|
|
222
|
+
- A file can be any of the kinds a transcription's `file` accepts. It is sent as multipart, the way the OpenAI SDK
|
|
223
|
+
sends it.
|
|
224
|
+
- A string is a link: an https link or a base64 data URL. An edit that has a link is sent as JSON, and any file next
|
|
225
|
+
to the link is sent as a data URL.
|
|
226
|
+
|
|
227
|
+
With `stream: true`, the answer is a single event with the same fields: `image_generation.completed`, or
|
|
228
|
+
`image_edit.completed` for an edit.
|
|
229
|
+
|
|
230
|
+
If the model's filter blocks a request, the SDK throws `BadRequestError` with the code `moderation_blocked`. The
|
|
231
|
+
error's body says what was blocked: the prompt (`input`) or the picture (`output`). The SDK does not send a blocked
|
|
232
|
+
request again, so change the prompt first.
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
try {
|
|
236
|
+
await keln.images.generate({ model: 'google/gemini-nano-banana-2.1', prompt });
|
|
237
|
+
} catch (error) {
|
|
238
|
+
if (!(error instanceof BadRequestError) || error.code !== 'moderation_blocked') throw error;
|
|
239
|
+
const stage = JSON.parse(error.body).error.moderation_details.moderation_stage;
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### Models
|
|
244
|
+
|
|
245
|
+
```ts
|
|
246
|
+
for await (const model of keln.models.list()) console.log(model.id, model.context_length, model.pricing.prompt);
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
`keln.models.list()` calls `GET /v1/models` and returns every model a request can name. Await it and read `data`, or
|
|
250
|
+
loop over it with `for await`. Each model has an `id`, `context_length`, `pricing`, `input_modalities` and
|
|
251
|
+
`output_modalities`. Some models also have `reasoning`, `supported_voices` or `supported_parameters`.
|
|
252
|
+
|
|
253
|
+
### The request id
|
|
254
|
+
|
|
255
|
+
`_request_id` on an answer is the API's id for the request. Quote it when you contact support. `JSON.stringify`
|
|
256
|
+
leaves it out.
|
|
257
|
+
|
|
258
|
+
### Response headers
|
|
259
|
+
|
|
260
|
+
Every call returns an `ApiPromise`, as the OpenAI SDK does. Await it to get the answer, or call `withResponse()` to
|
|
261
|
+
get the answer together with its HTTP response. The response's headers say how Keln served the call.
|
|
262
|
+
|
|
263
|
+
```ts
|
|
264
|
+
const { data: completion, response } = await keln.chat.completions
|
|
265
|
+
.create({ model: 'moonshotai/kimi-k3.1-pro', messages, service_tier: 'lite' })
|
|
266
|
+
.withResponse();
|
|
267
|
+
console.log(response.headers.get('x-keln-mode'), response.headers.get('x-ratelimit-remaining-requests'));
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
| Header | What it says |
|
|
271
|
+
| --- | --- |
|
|
272
|
+
| `x-keln-mode` | The mode the request ran in: `standard` or `lite` |
|
|
273
|
+
| `x-keln-lite-fallback` | Why a lite request ran in standard mode |
|
|
274
|
+
| `x-keln-inert-params` | The fields Keln accepted and did not act on |
|
|
275
|
+
| `x-ratelimit-limit-requests`, `x-ratelimit-remaining-requests`, `x-ratelimit-reset-requests` | The key's allowance |
|
|
276
|
+
|
|
277
|
+
### Streaming
|
|
278
|
+
|
|
279
|
+
`stream: true` returns a `Stream`. A chat stream gives you chunks. A responses or image stream gives you events. If
|
|
280
|
+
you stop reading early, the connection closes. To close it from outside the loop, call `stream.controller.abort()`.
|
|
281
|
+
|
|
282
|
+
A chat stream that Keln could not finish ends with a `stream_interrupted` chunk. The SDK then throws `KelnApiError`
|
|
283
|
+
with that `code`, after it has given you the text that arrived. Retrying is safe, and only the tokens that were
|
|
284
|
+
delivered are billed.
|
|
285
|
+
|
|
286
|
+
A Responses stream passes its `error` and `response.failed` events through for you to read.
|
|
287
|
+
|
|
288
|
+
## Sandboxes
|
|
289
|
+
|
|
290
|
+
| Call | What it does |
|
|
291
|
+
|---|---|
|
|
292
|
+
| `keln.sandboxes.create(options)` | Starts a sandbox and waits until it is running. The call has no deadline of its own. It takes `template` or `image`, `cpu`, `memoryMb`, `timeoutS`, `env`, `metadata` and `network`. Pass `wait: false` to return at once. Pass `idempotencyKey` to use your own key instead of the generated one. |
|
|
293
|
+
| `keln.sandboxes.get(id)` | Reads a sandbox. This works for a stopped sandbox too. |
|
|
294
|
+
| `keln.sandboxes.list(options)` | Iterates over every page of sandboxes, newest first. It takes `metadata`, `state` and `limit`, which is the page size. |
|
|
295
|
+
| `keln.templates.list()` | Lists the templates with their default sizes. |
|
|
296
|
+
| `sandbox.refresh()` | Reads the sandbox again and updates the object. |
|
|
297
|
+
| `sandbox.update({ network, ports })` | Replaces the network policy, the open ports, or both. |
|
|
298
|
+
| `sandbox.setTimeout(seconds)` | Sets the expiry to `seconds` from now. |
|
|
299
|
+
| `sandbox.pause()` | Pauses the sandbox and keeps its memory, processes and files. Billing stops. |
|
|
300
|
+
| `sandbox.resume({ timeoutS })` | Resumes a paused sandbox and waits until it is running. |
|
|
301
|
+
| `sandbox.snapshot(options)` | Saves the sandbox's files as an image. See *Images*. |
|
|
302
|
+
| `sandbox.delete()` | Stops the sandbox and deletes its contents. Deleting a stopped sandbox changes nothing. |
|
|
303
|
+
|
|
304
|
+
### A sandbox's fields
|
|
305
|
+
|
|
306
|
+
A sandbox has the API's fields in camelCase: `id`, `state`, `image`, `memoryMb`, `expiresAt`, `endReason`, `ports`,
|
|
307
|
+
`portToken` and the rest. `raw` holds the object exactly as the API sent it, so a field that the API adds later is
|
|
308
|
+
available through `raw`. A state that the API adds later arrives as a plain string. `Command`, `Terminal` and
|
|
309
|
+
`SandboxImage` objects work the same way.
|
|
310
|
+
|
|
311
|
+
### When `create` does not finish
|
|
312
|
+
|
|
313
|
+
`create` throws `KelnError` with the code `sandbox_not_running` when the sandbox stops instead of reaching `running`.
|
|
314
|
+
If `create` throws, or you abort it, it stops the sandbox first, because you have no other way to reach that sandbox.
|
|
315
|
+
|
|
316
|
+
## Images
|
|
317
|
+
|
|
318
|
+
An image is a saved copy of a running sandbox's files: its whole disk, but not its memory or its processes. New
|
|
319
|
+
sandboxes can start from an image. Images bill by size per GB-month while they are stored. Sandbox images are at
|
|
320
|
+
`keln.sandboxImages`, because `keln.images` is image generation.
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
await sandbox.commands.run('make setup', { cwd: '/home/user/app' });
|
|
324
|
+
const image = await sandbox.snapshot({ metadata: { app: 'reports' } });
|
|
325
|
+
const copy = await keln.sandboxes.create({ image: image.id });
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
| Call | What it does |
|
|
329
|
+
|---|---|
|
|
330
|
+
| `sandbox.snapshot(options)` | Saves the sandbox's files as an image and waits until the image is `ready` or `failed`. The call has no deadline of its own. It takes `metadata`. Pass `wait: false` to return at once. Pass `idempotencyKey` to use your own key instead of the generated one. |
|
|
331
|
+
| `keln.sandboxImages.create(sandboxId, options)` | Does the same, given the sandbox's id. |
|
|
332
|
+
| `keln.sandboxImages.get(id)` | Reads an image. |
|
|
333
|
+
| `keln.sandboxImages.list(options)` | Iterates over every page of images, newest first. It takes `state` and `limit`, which is the page size. Without `state`, it lists the images that are `creating`, `ready` or `failed`. |
|
|
334
|
+
| `keln.sandboxImages.delete(id)`, `image.delete()` | Deletes an image. Its storage billing ends. Sandboxes that started from it keep running. |
|
|
335
|
+
| `image.refresh()` | Reads the image again and updates the object. |
|
|
336
|
+
| `image.wait()` | Waits until the image leaves `creating`. |
|
|
337
|
+
| `keln.sandboxes.create({ image })` | Starts a sandbox from an image that is `ready`. The sandbox gets the image's size unless you pass `cpu` or `memoryMb`. |
|
|
338
|
+
|
|
339
|
+
### An image's fields
|
|
340
|
+
|
|
341
|
+
An image has the API's fields in camelCase: `id`, `state`, `sandboxId`, `template`, `cpu`, `memoryMb`, `sizeBytes`,
|
|
342
|
+
`readyAt`, `error`, `metadata` and the rest, plus `raw`.
|
|
343
|
+
|
|
344
|
+
A failed image is a result, not an exception. Its `state` is `failed`, and its `error` says why, with a `code` such as
|
|
345
|
+
`snapshot_failed`.
|
|
346
|
+
|
|
347
|
+
If the wait in `snapshot` fails, or you abort it, `snapshot` deletes the image, because the call never returned it to
|
|
348
|
+
you. Nothing is left that bills.
|
|
349
|
+
|
|
350
|
+
### Rules for saving an image
|
|
351
|
+
|
|
352
|
+
- The sandbox keeps running while it is saved, and it bills as usual.
|
|
353
|
+
- Files are saved. Environment variables set through the API are not.
|
|
354
|
+
- A sandbox saves one image at a time. A second save at the same time is a `409 snapshot_in_progress`.
|
|
355
|
+
- A sandbox can't be paused while it is being saved, and a paused sandbox can't be saved: that is a
|
|
356
|
+
`409 sandbox_not_running`.
|
|
357
|
+
- A workspace holds at most 20 images that are `creating` or `ready`. One more is a `429 image_limit`: delete an
|
|
358
|
+
image to make room. The SDK retries this 429 like any other 429, so the call throws once the retries run out.
|
|
359
|
+
- Starting a sandbox from an image that isn't `ready` is a `409 image_not_ready`.
|
|
360
|
+
- After a delete, the image is a `404 image_not_found`. If a delete is sent again because its first answer was lost,
|
|
361
|
+
the second one throws that 404 even though the image is gone.
|
|
362
|
+
|
|
363
|
+
## Commands
|
|
364
|
+
|
|
365
|
+
A command given as a string runs through `bash -lc`. A command given as an array runs the program directly.
|
|
366
|
+
|
|
367
|
+
```ts
|
|
368
|
+
const result = await sandbox.commands.run('make test', {
|
|
369
|
+
cwd: '/home/user/app',
|
|
370
|
+
env: { CI: '1' },
|
|
371
|
+
timeoutS: 300,
|
|
372
|
+
onStdout: (text) => process.stdout.write(text),
|
|
373
|
+
});
|
|
374
|
+
console.log(result.exitCode, result.stderr);
|
|
375
|
+
|
|
376
|
+
await sandbox.commands.run(['ls', '-l', '/tmp']);
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Run a command and wait for it
|
|
380
|
+
|
|
381
|
+
`run` waits for the command to exit and returns `{ id, exitCode, stdout, stderr, exitSignal, oomKilled }`. A non-zero
|
|
382
|
+
exit code is a result, not an exception.
|
|
383
|
+
|
|
384
|
+
### Read a command's events as they arrive
|
|
385
|
+
|
|
386
|
+
```ts
|
|
387
|
+
for await (const event of sandbox.commands.stream('make test')) {
|
|
388
|
+
if (event.type === 'stdout') process.stdout.write(event.data); // bytes
|
|
389
|
+
if (event.type === 'exit') console.log(event.exitCode);
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
The events are `started`, `stdout`, `stderr` and `exit`. An event type that the API adds later also comes through,
|
|
394
|
+
with its name in `type` and its data in `raw`. If you stop iterating, the command keeps running.
|
|
395
|
+
|
|
396
|
+
### Run a command in the background
|
|
397
|
+
|
|
398
|
+
`start` runs a command in the background and returns at once:
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
const command = await sandbox.commands.start('cat', { stdin: true });
|
|
402
|
+
await command.write('hello\n');
|
|
403
|
+
await command.closeStdin();
|
|
404
|
+
const { stdout } = await command.wait();
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### All command calls
|
|
408
|
+
|
|
409
|
+
| Call | What it does |
|
|
410
|
+
|---|---|
|
|
411
|
+
| `sandbox.commands.run(cmd, options)` | Runs a command until it exits. It takes `cwd`, `env`, `user`, `timeoutS`, `stdin`, `idempotencyKey`, `onStdout` and `onStderr`. |
|
|
412
|
+
| `sandbox.commands.stream(cmd, options)` | Runs a command and iterates over its events. |
|
|
413
|
+
| `sandbox.commands.start(cmd, options)` | Starts a command in the background and returns a `Command`. |
|
|
414
|
+
| `sandbox.commands.get(id)`, `.list()` | Finds commands, both running and exited. |
|
|
415
|
+
| `command.wait(options)` | Waits for the command to exit and returns the result. It takes `onStdout` and `onStderr`. |
|
|
416
|
+
| `command.events({ lastEventId })` | Iterates over the events from the start, or from after `lastEventId`. |
|
|
417
|
+
| `command.refresh()` | Reads the command again and updates the object. |
|
|
418
|
+
| `command.kill()`, `command.signal(signal)` | Sends SIGKILL, or sends a signal given by name or number. |
|
|
419
|
+
| `command.write(data)`, `command.closeStdin()` | Writes to the command's stdin, or closes it. |
|
|
420
|
+
|
|
421
|
+
`timeoutS` is enforced by the API: the API kills the command after it has run for that many seconds.
|
|
422
|
+
|
|
423
|
+
The API calls the signal that ended a command `signal`. The SDK calls it `command.exitSignal`, because
|
|
424
|
+
`command.signal()` is the method that sends a signal.
|
|
425
|
+
|
|
426
|
+
## Files
|
|
427
|
+
|
|
428
|
+
All paths are absolute.
|
|
429
|
+
|
|
430
|
+
```ts
|
|
431
|
+
await sandbox.files.write('/home/user/data.bin', bytes);
|
|
432
|
+
await sandbox.files.write('/home/user/note.txt', 'hello');
|
|
433
|
+
await sandbox.files.write('/home/user/big.tar', createReadStream('big.tar'));
|
|
434
|
+
|
|
435
|
+
const bytes = await sandbox.files.read('/home/user/data.bin');
|
|
436
|
+
const text = await sandbox.files.readText('/home/user/note.txt');
|
|
437
|
+
for await (const chunk of sandbox.files.stream('/home/user/big.tar')) process.stdout.write(chunk);
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
| Call | What it does |
|
|
441
|
+
|---|---|
|
|
442
|
+
| `sandbox.files.read(path)`, `.readText(path)` | Returns the file's bytes, or its text decoded as UTF-8. |
|
|
443
|
+
| `sandbox.files.stream(path)` | Iterates over the chunks of a large file. |
|
|
444
|
+
| `sandbox.files.write(path, data)` | Writes a file of any size. `data` can be bytes, text or a stream. If the write fails, the SDK cancels the stream, so a file that the stream reads from is closed. |
|
|
445
|
+
| `sandbox.files.list(path)`, `.stat(path)` | Returns a directory's entries, or the entry at a path. |
|
|
446
|
+
| `sandbox.files.delete(path)` | Deletes a file or a link. Deleting a directory is a `409 is_a_directory`: delete a directory with a command instead. |
|
|
447
|
+
| `sandbox.files.mkdir(path)` | Creates a directory and its parents. |
|
|
448
|
+
| `sandbox.files.move(from, to, { overwrite })` | Moves or renames a file. `to` is the full new path. |
|
|
449
|
+
|
|
450
|
+
## Terminals
|
|
451
|
+
|
|
452
|
+
```ts
|
|
453
|
+
const terminal = await sandbox.terminals.create({ command: 'python3', cols: 100, rows: 30 });
|
|
454
|
+
const socket = await terminal.attach();
|
|
455
|
+
await socket.send('print(6 * 7)\nexit()\n');
|
|
456
|
+
for await (const chunk of socket) process.stdout.write(chunk);
|
|
457
|
+
console.log(socket.exitCode);
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
| Call | What it does |
|
|
461
|
+
|---|---|
|
|
462
|
+
| `sandbox.terminals.create(options)` | Starts a program on a pseudo-terminal. It takes `command`, `argv`, `cwd`, `env`, `cols` and `rows`. Without `command` or `argv`, it runs a login shell. |
|
|
463
|
+
| `sandbox.terminals.list()`, `.get(id)` | Finds terminals. |
|
|
464
|
+
| `terminal.attach()` | Opens a `TerminalSocket`. |
|
|
465
|
+
| `terminal.resize(cols, rows)`, `.refresh()`, `.kill()` | Resizes the terminal, reads it again, or ends its program. |
|
|
466
|
+
| `socket.send(data)`, `socket.resize(cols, rows)` | Sends input, or resizes the terminal. |
|
|
467
|
+
| `for await (const chunk of socket)` | Iterates over the output bytes until the program exits. |
|
|
468
|
+
| `socket.exitCode` | The program's exit code, once the socket has ended. |
|
|
469
|
+
| `socket.close()` | Closes the socket. The program keeps running. |
|
|
470
|
+
|
|
471
|
+
If the socket's connection is lost before the program exits, the iteration throws `KelnConnectionError`. The program
|
|
472
|
+
may still be running, so call `terminal.attach()` again to continue. A socket receives the output written while it is
|
|
473
|
+
attached.
|
|
474
|
+
|
|
475
|
+
## Web
|
|
476
|
+
|
|
477
|
+
`keln.web` searches the web and reads pages directly, without a model. These calls go to `https://api.keln.ai` and
|
|
478
|
+
bill per call.
|
|
479
|
+
|
|
480
|
+
```ts
|
|
481
|
+
const found = await keln.web.search('gpu spot prices', { maxResults: 5, allowedDomains: ['aws.amazon.com'] });
|
|
482
|
+
for (const page of found.results) console.log(page.url, page.published, page.title);
|
|
483
|
+
|
|
484
|
+
const pages = await keln.web.fetch(['https://example.com/a', 'https://example.com/b'], { query: 'pricing table' });
|
|
485
|
+
console.log(pages.results[0]?.content, pages.failed, pages.usage.cost);
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
- `maxAgeHours` on a search keeps only pages the search engine read within that many hours. Use it for data that
|
|
489
|
+
changes. It returns fewer results.
|
|
490
|
+
- `query` on a fetch returns the passages that are relevant to the query, instead of the start of each page.
|
|
491
|
+
- `maxChars` on a fetch cuts each page to that length.
|
|
492
|
+
- A URL that could not be read is listed in `failed`. That is not an error, and a call where every URL failed bills
|
|
493
|
+
nothing.
|
|
494
|
+
|
|
495
|
+
## Errors
|
|
496
|
+
|
|
497
|
+
Every error is a subclass of `KelnError`. To decide what to do with an error, check its `code`. Messages are meant
|
|
498
|
+
for people to read.
|
|
499
|
+
|
|
500
|
+
```ts
|
|
501
|
+
import { KelnApiError } from '@keln.ai/sdk';
|
|
502
|
+
|
|
503
|
+
try {
|
|
504
|
+
await sandbox.files.read('/no/such/file');
|
|
505
|
+
} catch (error) {
|
|
506
|
+
if (error instanceof KelnApiError && error.code === 'file_not_found') {
|
|
507
|
+
// ...
|
|
508
|
+
} else {
|
|
509
|
+
throw error;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### `KelnApiError`
|
|
515
|
+
|
|
516
|
+
The API answered with an error: a non-2xx status, or an error event on a stream. The error has `status`, `code`,
|
|
517
|
+
`type`, `param`, `message`, `retryAfter`, `requestId`, `headers` and `body`, which is the whole body as received. An
|
|
518
|
+
error on a stream has no `status`.
|
|
519
|
+
|
|
520
|
+
A non-2xx answer throws the subclass named for its status, as the OpenAI SDK does:
|
|
521
|
+
|
|
522
|
+
| Status | Error |
|
|
523
|
+
|---|---|
|
|
524
|
+
| 400 | `BadRequestError` |
|
|
525
|
+
| 401 | `AuthenticationError` |
|
|
526
|
+
| 403 | `PermissionDeniedError` |
|
|
527
|
+
| 404 | `NotFoundError` |
|
|
528
|
+
| 409 | `ConflictError` |
|
|
529
|
+
| 422 | `UnprocessableEntityError` |
|
|
530
|
+
| 429 | `RateLimitError` |
|
|
531
|
+
| 5xx | `InternalServerError` |
|
|
532
|
+
|
|
533
|
+
### `KelnConnectionError`
|
|
534
|
+
|
|
535
|
+
The SDK could not reach the API, or an answer ended before it was complete. `cause` holds the underlying error.
|
|
536
|
+
|
|
537
|
+
### `KelnTimeoutError`
|
|
538
|
+
|
|
539
|
+
An inference or web call ran past its `timeout`.
|
|
540
|
+
|
|
541
|
+
The API key never appears in an exception, a log or a `toString`.
|
|
542
|
+
|
|
543
|
+
## Retries and streams
|
|
544
|
+
|
|
545
|
+
### Inference and web calls
|
|
546
|
+
|
|
547
|
+
Calls on api.keln.ai retry exactly as the OpenAI SDK does:
|
|
548
|
+
|
|
549
|
+
- The SDK sends a call again after a transport failure, a `408`, a `409`, a `429` or any `5xx`, up to `maxRetries`
|
|
550
|
+
times. The default is 2.
|
|
551
|
+
- It waits as long as `retry-after-ms` or `Retry-After` asks, when that is up to 60 seconds. Otherwise it waits 0.5
|
|
552
|
+
seconds, doubling up to 8 seconds, minus a random part of up to a quarter.
|
|
553
|
+
- `x-should-retry: true` or `false` from the server overrides everything else.
|
|
554
|
+
- Each try carries its number in `x-keln-retry-count`.
|
|
555
|
+
- A stream is retried until its answer starts, and never after that.
|
|
556
|
+
|
|
557
|
+
### Sandbox calls
|
|
558
|
+
|
|
559
|
+
On the Sandbox API, the SDK retries transport failures, `429`, `502` and `503` with backoff, up to `maxRetries` times
|
|
560
|
+
(default 5), and it waits as long as `Retry-After` says. It retries only calls that are safe to repeat: reads, deletes,
|
|
561
|
+
and every POST that carries an `Idempotency-Key`. Every other failure throws at once.
|
|
562
|
+
|
|
563
|
+
A `409 idempotency_key_in_use` means the first request with that key is still running. The SDK waits for that first
|
|
564
|
+
request to end, for as long as `Retry-After` says or with the same backoff. These waits do not count against
|
|
565
|
+
`maxRetries`.
|
|
566
|
+
|
|
567
|
+
### Idempotency keys
|
|
568
|
+
|
|
569
|
+
`create`, `snapshot`, `run`, `stream` and `start` each send a generated `Idempotency-Key`, so a retry never starts a
|
|
570
|
+
second sandbox, saves a second image or runs a command twice. If you pass your own `idempotencyKey`, the SDK uses it
|
|
571
|
+
instead.
|
|
572
|
+
|
|
573
|
+
### Event streams
|
|
574
|
+
|
|
575
|
+
If an event stream is interrupted, or stays silent longer than `streamIdleTimeoutMs`, the SDK reattaches from the last
|
|
576
|
+
event with `Last-Event-ID`, so no event is lost or repeated. If the SDK reattaches `maxReattachAttempts` times in a
|
|
577
|
+
row and receives nothing at all, not even a ping, it throws `KelnConnectionError`.
|
|
578
|
+
|
|
579
|
+
An `error` event ends the stream and throws. The command itself may still be running. Once the command has an id, an
|
|
580
|
+
error from its stream carries `commandId`, and `sandbox.commands.get(commandId)` reaches the command again.
|
|
581
|
+
|
|
582
|
+
## Cancellation
|
|
583
|
+
|
|
584
|
+
Every call takes an `AbortSignal`. An abort ends the call at once, with the signal's reason.
|
|
585
|
+
|
|
586
|
+
```ts
|
|
587
|
+
await sandbox.commands.run('sleep 1000', { signal: AbortSignal.timeout(5000) });
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
On the Sandbox API, the signal is the only deadline. An inference or web call also takes `timeout`. The SDK sets no
|
|
591
|
+
limit of its own on output, file size or wait time.
|
|
592
|
+
|
|
593
|
+
An abort stops the waiting, not the command. To stop a command, use `sandbox.commands.start()` and `command.kill()`.
|
|
594
|
+
|
|
595
|
+
The signal you pass to `terminal.attach()` stays with the socket, so aborting it later ends the socket.
|
|
596
|
+
|
|
597
|
+
## Licence
|
|
598
|
+
|
|
599
|
+
Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a call on api.keln.ai returns: await it for the answer, or call `withResponse()` for the answer beside the HTTP
|
|
3
|
+
* response it came in.
|
|
4
|
+
*/
|
|
5
|
+
import { requestIdOf } from './errors.js';
|
|
6
|
+
export { requestIdOf };
|
|
7
|
+
/** A call's answer and the HTTP response it came in, its body already read into the answer. */
|
|
8
|
+
export type ApiResult<T> = {
|
|
9
|
+
data: T;
|
|
10
|
+
response: Response;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Await it for the answer. `withResponse()` gives the answer with its HTTP response, whose headers say how Keln served
|
|
14
|
+
* the call: `x-keln-mode` (`standard` or `lite`), `x-keln-lite-fallback` (why a lite request ran in standard mode),
|
|
15
|
+
* `x-keln-inert-params` (the fields Keln accepted and did not act on), and the key's allowance in
|
|
16
|
+
* `x-ratelimit-limit-requests`, `x-ratelimit-remaining-requests` and `x-ratelimit-reset-requests`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ApiPromise<T> extends Promise<T> {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(result: Promise<ApiResult<T>>);
|
|
21
|
+
/** The answer, its HTTP response, and the API's id for the request (`x-keln-request-id`). */
|
|
22
|
+
withResponse(): Promise<{
|
|
23
|
+
data: T;
|
|
24
|
+
response: Response;
|
|
25
|
+
request_id: string | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
then<A = T, B = never>(onfulfilled?: ((value: T) => A | PromiseLike<A>) | null, onrejected?: ((reason: unknown) => B | PromiseLike<B>) | null): Promise<A | B>;
|
|
28
|
+
catch<B = never>(onrejected?: ((reason: unknown) => B | PromiseLike<B>) | null): Promise<T | B>;
|
|
29
|
+
finally(onfinally?: (() => void) | null): Promise<T>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a call on api.keln.ai returns: await it for the answer, or call `withResponse()` for the answer beside the HTTP
|
|
3
|
+
* response it came in.
|
|
4
|
+
*/
|
|
5
|
+
import { requestIdOf } from './errors.js';
|
|
6
|
+
export { requestIdOf };
|
|
7
|
+
/**
|
|
8
|
+
* Await it for the answer. `withResponse()` gives the answer with its HTTP response, whose headers say how Keln served
|
|
9
|
+
* the call: `x-keln-mode` (`standard` or `lite`), `x-keln-lite-fallback` (why a lite request ran in standard mode),
|
|
10
|
+
* `x-keln-inert-params` (the fields Keln accepted and did not act on), and the key's allowance in
|
|
11
|
+
* `x-ratelimit-limit-requests`, `x-ratelimit-remaining-requests` and `x-ratelimit-reset-requests`.
|
|
12
|
+
*/
|
|
13
|
+
export class ApiPromise extends Promise {
|
|
14
|
+
#result;
|
|
15
|
+
constructor(result) {
|
|
16
|
+
// Settled at once with nothing: `then`, `catch` and `finally` read `result` instead, so a failure reaches only the
|
|
17
|
+
// code that awaits it, whichever way it does.
|
|
18
|
+
super((resolve) => {
|
|
19
|
+
resolve(undefined);
|
|
20
|
+
});
|
|
21
|
+
this.#result = result;
|
|
22
|
+
}
|
|
23
|
+
/** The answer, its HTTP response, and the API's id for the request (`x-keln-request-id`). */
|
|
24
|
+
async withResponse() {
|
|
25
|
+
const { data, response } = await this.#result;
|
|
26
|
+
return { data, response, request_id: requestIdOf(response.headers) };
|
|
27
|
+
}
|
|
28
|
+
then(onfulfilled, onrejected) {
|
|
29
|
+
return this.#result.then((result) => result.data).then(onfulfilled, onrejected);
|
|
30
|
+
}
|
|
31
|
+
catch(onrejected) {
|
|
32
|
+
return this.then(undefined, onrejected);
|
|
33
|
+
}
|
|
34
|
+
finally(onfinally) {
|
|
35
|
+
return this.then().finally(onfinally);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=api-promise.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-promise.js","sourceRoot":"","sources":["../src/api-promise.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,CAAC;AAKvB;;;;;GAKG;AACH,MAAM,OAAO,UAAc,SAAQ,OAAU;IAClC,OAAO,CAAwB;IAExC,YAAY,MAA6B;QACvC,mHAAmH;QACnH,8CAA8C;QAC9C,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE;YAChB,OAAO,CAAC,SAAc,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IAED,6FAA6F;IAC7F,KAAK,CAAC,YAAY;QAChB,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC;QAC9C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;IACvE,CAAC;IAEQ,IAAI,CACX,WAAuD,EACvD,UAA6D;QAE7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IAClF,CAAC;IAEQ,KAAK,CAAY,UAA6D;QACrF,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC1C,CAAC;IAEQ,OAAO,CAAC,SAA+B;QAC9C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACxC,CAAC;CACF"}
|