palbase 0.6.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/index.js +2 -14
- package/dist/backend/engine.js +2 -2
- package/dist/backend/env.js +1 -1
- package/dist/backend/index.js +9 -9
- package/dist/backend/stack.js +1 -1
- package/dist/backend/test.js +2 -2
- package/dist/chunks/5VTGMNPL.js +20 -0
- package/dist/chunks/{SXH5AIQX.js → BO5KR2EQ.js} +2 -2
- package/dist/chunks/{AYY4J3B2.js → BRBCWPR3.js} +1 -1
- package/dist/chunks/DB3SIBKB.js +2 -0
- package/dist/chunks/EGNEXFTZ.js +2 -0
- package/dist/chunks/{VP7V7YRH.js → FZ3MQOVA.js} +2 -2
- package/dist/chunks/{A3CDCPXX.js → JSJVV43D.js} +1 -1
- package/dist/chunks/K6RRNI23.js +4 -0
- package/dist/chunks/{SUX2BJG4.js → KDWDPSL2.js} +1 -1
- package/dist/chunks/P4Z5E6ZI.js +2 -0
- package/dist/chunks/PDOHT46N.js +2 -0
- package/dist/chunks/PGPQGKH2.js +18 -0
- package/dist/chunks/{DRTZ33XF.js → RBA6V3UO.js} +2 -2
- package/dist/chunks/{KLANM6M6.js → RO5Y5YU4.js} +1 -1
- package/dist/chunks/{53FS342F.js → TUGRIOFX.js} +2 -2
- package/dist/chunks/WEI32SAJ.js +13 -0
- package/dist/chunks/{GVFZM4BI.js → WINBISC2.js} +3 -3
- package/dist/chunks/Z5JVQNAZ.js +2 -0
- package/dist/cli.js +140 -139
- package/dist/refuse/ai.js +1 -1
- package/dist/refuse/backend.js +1 -1
- package/dist/refuse/server.js +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/testing.js +2 -2
- package/dist/web/index.js +2 -2
- package/dist/web/palbe.js +2 -2
- package/dist/web/paywall.js +2 -2
- package/dist/web/ssr.js +2 -2
- package/dist/web/vite.js +2 -2
- package/package.json +2 -2
- package/types/ai/src/ai.d.ts +46 -19
- package/types/ai/src/chats.d.ts +478 -18
- package/types/ai/src/index.d.ts +4 -4
- package/types/ai/src/tools.d.ts +161 -29
- package/types/backend/src/bootstrap.d.ts +8 -0
- package/types/backend/src/container.d.ts +11 -2
- package/types/backend/src/database.d.ts +17 -2
- package/types/backend/src/engine.d.ts +3 -4
- package/types/backend/src/gateways.d.ts +269 -0
- package/types/backend/src/index.d.ts +3 -2
- package/types/backend/src/openapi.d.ts +3 -6
- package/types/backend/src/runtime.d.ts +51 -2
- package/types/backend/src/testing/unit.d.ts +3 -1
- package/types/internal/src/chat.d.ts +168 -35
- package/types/internal/src/modules/ai.d.ts +1826 -545
- package/types/internal/src/modules/auth.d.ts +14 -2
- package/types/internal/src/modules/events.d.ts +2 -2
- package/types/internal/src/modules/machines.d.ts +57 -1
- package/types/internal/src/modules/notify.d.ts +6 -6
- package/types/internal/src/modules/purchases.d.ts +357 -13
- package/types/internal/src/modules/realtime.d.ts +45 -1
- package/types/internal/src/modules/stores.d.ts +259 -22
- package/types/internal/src/transport.d.ts +5 -0
- package/types/server/src/auth/jwt.d.ts +1 -6
- package/types/web/src/auth.d.ts +15 -4
- package/types/web/src/backends.d.ts +20 -13
- package/types/web/src/chat.d.ts +329 -0
- package/types/web/src/client.d.ts +28 -3
- package/types/web/src/gateways.d.ts +90 -0
- package/types/web/src/index.d.ts +5 -4
- package/types/web/src/session.d.ts +11 -1
- package/types/web/src/socket.d.ts +18 -2
- package/types/web/src/voice.d.ts +36 -0
- package/dist/chunks/2RG3I7LX.js +0 -6
- package/dist/chunks/A76UZBAF.js +0 -2
- package/dist/chunks/AD5LBZAB.js +0 -4
- package/dist/chunks/DRGYTL6T.js +0 -20
- package/dist/chunks/IVEAUFGE.js +0 -13
- package/dist/chunks/IYCW6PWG.js +0 -2
- package/dist/chunks/KL7FIRII.js +0 -2
- package/dist/chunks/U4OZ4HOF.js +0 -2
- package/types/backend/src/channels.d.ts +0 -81
- package/types/backend/src/rooms.d.ts +0 -178
- package/types/web/src/ai.d.ts +0 -224
- package/types/web/src/rooms.d.ts +0 -61
|
@@ -22,15 +22,23 @@ export type AgentDefinition = {
|
|
|
22
22
|
*/
|
|
23
23
|
backend?: string;
|
|
24
24
|
/**
|
|
25
|
-
* The
|
|
25
|
+
* The window, in tokens, the turn works in (the model's standard one unless said; more is billed as its provider bills it — GET /ai/models, context_window and max_input_tokens).
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
context_window?: number;
|
|
28
|
+
/**
|
|
29
|
+
* How hard the model thinks: none, minimal, low, medium, high, xhigh, max — which rungs a model takes is its catalogue entry's (GET /ai/models, efforts). Left out: the platform's.
|
|
30
|
+
*/
|
|
31
|
+
effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
28
32
|
/**
|
|
29
33
|
* Its instructions.
|
|
30
34
|
*/
|
|
31
35
|
instructions?: string;
|
|
32
36
|
/**
|
|
33
|
-
*
|
|
37
|
+
* The language of the person the turn works for, as a BCP 47 tag (tr, en-GB): the model writes to them in it on every step, and so do its subagents.
|
|
38
|
+
*/
|
|
39
|
+
language?: string;
|
|
40
|
+
/**
|
|
41
|
+
* How many tool calls a turn makes at most (10000: the engine's own bound): past it the agent is told it has no tools left and answers. What a turn spends is its budget's to bound.
|
|
34
42
|
*/
|
|
35
43
|
max_tool_calls?: number;
|
|
36
44
|
/**
|
|
@@ -41,6 +49,10 @@ export type AgentDefinition = {
|
|
|
41
49
|
* Its subagents (16 at most).
|
|
42
50
|
*/
|
|
43
51
|
subagents?: Subagent[];
|
|
52
|
+
/**
|
|
53
|
+
* Whether the model's reasoning is shown in the chat's stream (visible: thinking parts) or not asked for at all (hidden). Left out: the platform's.
|
|
54
|
+
*/
|
|
55
|
+
thinking?: "visible" | "hidden";
|
|
44
56
|
/**
|
|
45
57
|
* Its tools (64 at most, with its MCP servers').
|
|
46
58
|
*/
|
|
@@ -68,9 +80,10 @@ export type Chat = {
|
|
|
68
80
|
*/
|
|
69
81
|
created_at: string;
|
|
70
82
|
/**
|
|
71
|
-
*
|
|
83
|
+
* Null: the project's server started it, as it starts every chat (a user's id: a chat a user started before chats were the server's alone).
|
|
72
84
|
*/
|
|
73
85
|
created_by: string | null;
|
|
86
|
+
forked_from?: ChatFork;
|
|
74
87
|
/**
|
|
75
88
|
* What it keeps of the project's history.
|
|
76
89
|
*/
|
|
@@ -93,21 +106,43 @@ export type Chat = {
|
|
|
93
106
|
* Its title.
|
|
94
107
|
*/
|
|
95
108
|
title: string;
|
|
109
|
+
voice?: VoiceSession;
|
|
96
110
|
workspace?: ChatWorkspace;
|
|
97
111
|
};
|
|
98
112
|
/**
|
|
99
|
-
*
|
|
113
|
+
* Where a forked chat came from.
|
|
114
|
+
*/
|
|
115
|
+
export type ChatFork = {
|
|
116
|
+
/**
|
|
117
|
+
* The message it was cut before.
|
|
118
|
+
*/
|
|
119
|
+
before_message: string;
|
|
120
|
+
/**
|
|
121
|
+
* The chat it was forked from (it may be deleted since).
|
|
122
|
+
*/
|
|
123
|
+
chat_id: string;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Chats, the newest first, a page at a time.
|
|
100
127
|
*/
|
|
101
128
|
export type ChatList = {
|
|
102
129
|
/**
|
|
103
130
|
* The chats.
|
|
104
131
|
*/
|
|
105
132
|
chats: Chat[];
|
|
133
|
+
/**
|
|
134
|
+
* The next page's cursor; absent on the last page.
|
|
135
|
+
*/
|
|
136
|
+
next_cursor?: string;
|
|
106
137
|
};
|
|
107
138
|
/**
|
|
108
139
|
* A member's (or the server's) message.
|
|
109
140
|
*/
|
|
110
141
|
export type ChatMessage = {
|
|
142
|
+
/**
|
|
143
|
+
* The pictures and the files it carries, its images first ([] for none).
|
|
144
|
+
*/
|
|
145
|
+
attachments: MessageAttachment[];
|
|
111
146
|
/**
|
|
112
147
|
* The member who wrote it; null: the server.
|
|
113
148
|
*/
|
|
@@ -140,6 +175,16 @@ export type ChatMessage = {
|
|
|
140
175
|
* Its id.
|
|
141
176
|
*/
|
|
142
177
|
id: string;
|
|
178
|
+
/**
|
|
179
|
+
* text — a message written to the chat — or voice: a line said out loud in its voice, the person's (author, the member) or the voice's own (author null); voice says which.
|
|
180
|
+
*/
|
|
181
|
+
kind: "text" | "voice";
|
|
182
|
+
/**
|
|
183
|
+
* Its writer's labels for it ({} for none).
|
|
184
|
+
*/
|
|
185
|
+
metadata: {
|
|
186
|
+
[key: string]: string;
|
|
187
|
+
};
|
|
143
188
|
/**
|
|
144
189
|
* The turn it started or reached.
|
|
145
190
|
*/
|
|
@@ -152,6 +197,137 @@ export type ChatMessage = {
|
|
|
152
197
|
* What they wrote.
|
|
153
198
|
*/
|
|
154
199
|
text: string;
|
|
200
|
+
voice?: MessageVoice;
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* A text model a turn may name.
|
|
204
|
+
*/
|
|
205
|
+
export type ChatModel = {
|
|
206
|
+
/**
|
|
207
|
+
* The window a turn works in unless its definition asks for more — the largest billed at the standard rate where the price steps with the prompt (0: nobody says).
|
|
208
|
+
*/
|
|
209
|
+
context_window: number;
|
|
210
|
+
/**
|
|
211
|
+
* Whether it is the model a turn that names none runs on.
|
|
212
|
+
*/
|
|
213
|
+
default: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* What it is for.
|
|
216
|
+
*/
|
|
217
|
+
description: string;
|
|
218
|
+
/**
|
|
219
|
+
* Whether anyone says which rungs it takes: false offers none but the provider's own.
|
|
220
|
+
*/
|
|
221
|
+
effort_known: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* The rungs it takes (a definition's effort); empty when nobody says.
|
|
224
|
+
*/
|
|
225
|
+
efforts: string[];
|
|
226
|
+
/**
|
|
227
|
+
* What a definition names it by (provider:model).
|
|
228
|
+
*/
|
|
229
|
+
id: string;
|
|
230
|
+
/**
|
|
231
|
+
* The most it reads (0: nobody says).
|
|
232
|
+
*/
|
|
233
|
+
max_input_tokens: number;
|
|
234
|
+
/**
|
|
235
|
+
* The most it writes (0: nobody says).
|
|
236
|
+
*/
|
|
237
|
+
max_output_tokens: number;
|
|
238
|
+
/**
|
|
239
|
+
* Its name as people read it.
|
|
240
|
+
*/
|
|
241
|
+
name: string;
|
|
242
|
+
price: ChatModelPrice;
|
|
243
|
+
/**
|
|
244
|
+
* The provider connection that serves it.
|
|
245
|
+
*/
|
|
246
|
+
provider: string;
|
|
247
|
+
/**
|
|
248
|
+
* The roles it carries: fast, default, strong.
|
|
249
|
+
*/
|
|
250
|
+
roles: string[];
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* A text model's list price per million tokens.
|
|
254
|
+
*/
|
|
255
|
+
export type ChatModelPrice = {
|
|
256
|
+
/**
|
|
257
|
+
* A cache read.
|
|
258
|
+
*/
|
|
259
|
+
cache_read_usd_per_mtok: number;
|
|
260
|
+
/**
|
|
261
|
+
* A cache write (five minutes).
|
|
262
|
+
*/
|
|
263
|
+
cache_write_usd_per_mtok: number;
|
|
264
|
+
/**
|
|
265
|
+
* Input.
|
|
266
|
+
*/
|
|
267
|
+
input_usd_per_mtok: number;
|
|
268
|
+
long_context?: LongContextPrice;
|
|
269
|
+
/**
|
|
270
|
+
* Output.
|
|
271
|
+
*/
|
|
272
|
+
output_usd_per_mtok: number;
|
|
273
|
+
};
|
|
274
|
+
/**
|
|
275
|
+
* One part of a chat's stream, as its channel carries it.
|
|
276
|
+
*/
|
|
277
|
+
export type ChatPart = {
|
|
278
|
+
/**
|
|
279
|
+
* What the part says, as the stream says it.
|
|
280
|
+
*/
|
|
281
|
+
data: {
|
|
282
|
+
[key: string]: unknown;
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* The journal's sequence it was told at; absent for an answer's text, placed by its offset.
|
|
286
|
+
*/
|
|
287
|
+
id?: number;
|
|
288
|
+
/**
|
|
289
|
+
* The id the channel told it under: the journal's sequence, or an answer's response and offset.
|
|
290
|
+
*/
|
|
291
|
+
part_id: string;
|
|
292
|
+
/**
|
|
293
|
+
* message, turn, text, reset, thinking, tool, agent, goal, voice, transcript — as the stream says them.
|
|
294
|
+
*/
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* A page of a chat's past, in the order its stream told it.
|
|
299
|
+
*/
|
|
300
|
+
export type ChatPartPage = {
|
|
301
|
+
/**
|
|
302
|
+
* Reads the page before this one; absent once the chat's start is in this one.
|
|
303
|
+
*/
|
|
304
|
+
next_cursor?: string;
|
|
305
|
+
/**
|
|
306
|
+
* The parts.
|
|
307
|
+
*/
|
|
308
|
+
parts: ChatPart[];
|
|
309
|
+
};
|
|
310
|
+
/**
|
|
311
|
+
* Where a chat's stream is written.
|
|
312
|
+
*/
|
|
313
|
+
export type ChatPipe = {
|
|
314
|
+
/**
|
|
315
|
+
* A channel of the project's realtime (not one of the platform's: roles:, flags:, purchases:, messaging:, debug:, nor phoenix, realtime's heartbeat).
|
|
316
|
+
*/
|
|
317
|
+
topic: string;
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* A chat's pipe.
|
|
321
|
+
*/
|
|
322
|
+
export type ChatPipeResult = {
|
|
323
|
+
/**
|
|
324
|
+
* The chat's id.
|
|
325
|
+
*/
|
|
326
|
+
chat_id: string;
|
|
327
|
+
/**
|
|
328
|
+
* The channel its stream is written into.
|
|
329
|
+
*/
|
|
330
|
+
topic: string;
|
|
155
331
|
};
|
|
156
332
|
/**
|
|
157
333
|
* One repository of a chat's workspace.
|
|
@@ -167,11 +343,11 @@ export type ChatRepo = {
|
|
|
167
343
|
repo: string;
|
|
168
344
|
};
|
|
169
345
|
/**
|
|
170
|
-
* A chat to start.
|
|
346
|
+
* A chat to start: the project's server's alone.
|
|
171
347
|
*/
|
|
172
348
|
export type ChatRequest = {
|
|
173
349
|
/**
|
|
174
|
-
* The agent it talks to: a named agent of the project's — or,
|
|
350
|
+
* The agent it talks to: a named agent of the project's — or, with a definition of the chat's own, the server's name for it.
|
|
175
351
|
*/
|
|
176
352
|
agent: string;
|
|
177
353
|
definition?: AgentDefinition;
|
|
@@ -185,16 +361,66 @@ export type ChatRequest = {
|
|
|
185
361
|
metadata?: {
|
|
186
362
|
[key: string]: string;
|
|
187
363
|
};
|
|
188
|
-
/**
|
|
189
|
-
* A user who starts a chat is in it as its owner, under this name.
|
|
190
|
-
*/
|
|
191
|
-
name?: string;
|
|
192
364
|
/**
|
|
193
365
|
* Its title (256 bytes at most).
|
|
194
366
|
*/
|
|
195
367
|
title?: string;
|
|
196
368
|
workspace?: ChatWorkspace;
|
|
197
369
|
};
|
|
370
|
+
/**
|
|
371
|
+
* Stops the chat's turn.
|
|
372
|
+
*/
|
|
373
|
+
export type ChatStop = {
|
|
374
|
+
/**
|
|
375
|
+
* The member the server stops it as (the server's alone): a member of the chat (403 not_a_member).
|
|
376
|
+
*/
|
|
377
|
+
as?: string;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* One tool call of a chat, its whole answer: what the chat's stream showed by its end (output, omitted_bytes), read whole — its secret shapes masked, as the stream masks them.
|
|
381
|
+
*/
|
|
382
|
+
export type ChatToolCall = {
|
|
383
|
+
/**
|
|
384
|
+
* The call.
|
|
385
|
+
*/
|
|
386
|
+
call_id: string;
|
|
387
|
+
/**
|
|
388
|
+
* How many pictures it returned.
|
|
389
|
+
*/
|
|
390
|
+
image_count: number;
|
|
391
|
+
/**
|
|
392
|
+
* What the agent called it with; null when its arguments, masked, are no JSON.
|
|
393
|
+
*/
|
|
394
|
+
input: unknown;
|
|
395
|
+
/**
|
|
396
|
+
* The tool failed.
|
|
397
|
+
*/
|
|
398
|
+
is_error: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* The tool.
|
|
401
|
+
*/
|
|
402
|
+
name: string;
|
|
403
|
+
/**
|
|
404
|
+
* Its answer's text, whole; null: none yet.
|
|
405
|
+
*/
|
|
406
|
+
output: string | null;
|
|
407
|
+
/**
|
|
408
|
+
* How long the answer is.
|
|
409
|
+
*/
|
|
410
|
+
output_bytes: number;
|
|
411
|
+
/**
|
|
412
|
+
* The turn — or the subagent's work in it — that made it.
|
|
413
|
+
*/
|
|
414
|
+
response_id: string;
|
|
415
|
+
/**
|
|
416
|
+
* The run that made it: the turn's, or a subagent's.
|
|
417
|
+
*/
|
|
418
|
+
run_id: string;
|
|
419
|
+
/**
|
|
420
|
+
* Where it is, as the engine says it: pending, executing, completed, failed…
|
|
421
|
+
*/
|
|
422
|
+
status: string;
|
|
423
|
+
};
|
|
198
424
|
/**
|
|
199
425
|
* The project's repositories a chat works in, each at a branch: its turns run on a machine of the platform's with them checked out, and what its agent commits is pushed to that branch.
|
|
200
426
|
*/
|
|
@@ -207,6 +433,23 @@ export type ChatWorkspace = {
|
|
|
207
433
|
* 1 to 8 of the project's repositories, each once.
|
|
208
434
|
*/
|
|
209
435
|
repos: ChatRepo[];
|
|
436
|
+
/**
|
|
437
|
+
* What each of its commits carries at its message's end (16 at most): a task, a link back to the conversation, a co-author. The engine writes each commit as the member its turn is for — their name and address — with these trailers; a turn of no member's commits as the platform.
|
|
438
|
+
*/
|
|
439
|
+
trailers?: CommitTrailer[];
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* A git trailer each of the chat's commits carries at its message's end.
|
|
443
|
+
*/
|
|
444
|
+
export type CommitTrailer = {
|
|
445
|
+
/**
|
|
446
|
+
* Its token, as git takes one: letters, digits and -, at most 64 (Co-authored-by, PalCore-Task).
|
|
447
|
+
*/
|
|
448
|
+
key: string;
|
|
449
|
+
/**
|
|
450
|
+
* One line of at most 512 bytes.
|
|
451
|
+
*/
|
|
452
|
+
value: string;
|
|
210
453
|
};
|
|
211
454
|
/**
|
|
212
455
|
* A decision made.
|
|
@@ -229,6 +472,10 @@ export type DecisionRequest = {
|
|
|
229
472
|
* Yes, or no.
|
|
230
473
|
*/
|
|
231
474
|
approve: boolean;
|
|
475
|
+
/**
|
|
476
|
+
* The member the project's server acts as: held to that member's rules — their turn (403 not_your_turn) — and the decision is theirs (the server's alone: a user sending it is answered 400; one who is not a member of the chat, 403 not_a_member). Left out, the server acts as itself.
|
|
477
|
+
*/
|
|
478
|
+
as?: string;
|
|
232
479
|
/**
|
|
233
480
|
* Why (told to the agent; 1024 bytes at most).
|
|
234
481
|
*/
|
|
@@ -395,919 +642,1758 @@ export type ErrorResponse = {
|
|
|
395
642
|
status: number;
|
|
396
643
|
};
|
|
397
644
|
/**
|
|
398
|
-
*
|
|
645
|
+
* Where to fork a chat.
|
|
399
646
|
*/
|
|
400
|
-
export type
|
|
401
|
-
/**
|
|
402
|
-
* When it started.
|
|
403
|
-
*/
|
|
404
|
-
created_at: string;
|
|
405
|
-
error: ImageError;
|
|
647
|
+
export type ForkRequest = {
|
|
406
648
|
/**
|
|
407
|
-
*
|
|
408
|
-
*/
|
|
409
|
-
expires_at: string;
|
|
410
|
-
/**
|
|
411
|
-
* Its pictures, once completed.
|
|
412
|
-
*/
|
|
413
|
-
files: ImageFile[];
|
|
414
|
-
/**
|
|
415
|
-
* The job's id.
|
|
649
|
+
* The message the fork is cut before (a message's id): it, and all that came after it, are not the fork's.
|
|
416
650
|
*/
|
|
417
|
-
|
|
651
|
+
before_message: string;
|
|
418
652
|
/**
|
|
419
|
-
*
|
|
653
|
+
* Who is in the fork (64 at most; left out or null: the chat's members, as they are).
|
|
420
654
|
*/
|
|
421
|
-
|
|
655
|
+
members?: NewMember[] | null;
|
|
422
656
|
/**
|
|
423
|
-
*
|
|
657
|
+
* The fork's title (256 bytes at most; left out: the chat's).
|
|
424
658
|
*/
|
|
425
|
-
|
|
426
|
-
usage: ImageUsage;
|
|
659
|
+
title?: string;
|
|
427
660
|
};
|
|
428
661
|
/**
|
|
429
|
-
*
|
|
662
|
+
* A chat's goal.
|
|
430
663
|
*/
|
|
431
|
-
export type
|
|
664
|
+
export type Goal = {
|
|
432
665
|
/**
|
|
433
|
-
*
|
|
666
|
+
* When it was met; null: not yet.
|
|
434
667
|
*/
|
|
435
|
-
|
|
668
|
+
achieved_at: string | null;
|
|
669
|
+
budget: GoalBudget;
|
|
436
670
|
/**
|
|
437
|
-
*
|
|
671
|
+
* The chat.
|
|
438
672
|
*/
|
|
439
|
-
|
|
440
|
-
}) | null;
|
|
441
|
-
/**
|
|
442
|
-
* A picture of a finished job.
|
|
443
|
-
*/
|
|
444
|
-
export type ImageFile = {
|
|
673
|
+
chat_id: string;
|
|
445
674
|
/**
|
|
446
|
-
*
|
|
675
|
+
* When it was set.
|
|
447
676
|
*/
|
|
448
|
-
|
|
677
|
+
created_at: string;
|
|
449
678
|
/**
|
|
450
|
-
*
|
|
679
|
+
* The goal's id (a new goal, a new id).
|
|
451
680
|
*/
|
|
452
|
-
|
|
681
|
+
id: string;
|
|
453
682
|
/**
|
|
454
|
-
*
|
|
683
|
+
* The most turns it opens; null: no limit.
|
|
455
684
|
*/
|
|
456
|
-
|
|
685
|
+
max_turns: number | null;
|
|
457
686
|
/**
|
|
458
|
-
*
|
|
687
|
+
* What the chat works toward.
|
|
459
688
|
*/
|
|
460
|
-
|
|
461
|
-
};
|
|
462
|
-
/**
|
|
463
|
-
* A picture the caller sends.
|
|
464
|
-
*/
|
|
465
|
-
export type ImageInput = {
|
|
689
|
+
objective: string;
|
|
466
690
|
/**
|
|
467
|
-
*
|
|
691
|
+
* What its next turn is: work, or verify (the check of a completion its agent claimed).
|
|
468
692
|
*/
|
|
469
|
-
|
|
693
|
+
phase: string;
|
|
470
694
|
/**
|
|
471
|
-
*
|
|
695
|
+
* What a claimed completion is checked against.
|
|
472
696
|
*/
|
|
473
|
-
|
|
474
|
-
};
|
|
475
|
-
/**
|
|
476
|
-
* An image model.
|
|
477
|
-
*/
|
|
478
|
-
export type ImageModel = {
|
|
697
|
+
rubric: string;
|
|
479
698
|
/**
|
|
480
|
-
*
|
|
699
|
+
* The member it was set as; null: the server.
|
|
481
700
|
*/
|
|
482
|
-
|
|
701
|
+
set_by: string | null;
|
|
483
702
|
/**
|
|
484
|
-
*
|
|
703
|
+
* active, paused, blocked (it cannot go on without a person), budget_limited, or achieved.
|
|
485
704
|
*/
|
|
486
|
-
|
|
705
|
+
status: string;
|
|
487
706
|
/**
|
|
488
|
-
*
|
|
707
|
+
* Why it last left active, as a stable code (empty while active): paused_by_person, paused_by_client, turn_stopped, turns_failed, no_progress, judge_unreadable, check_unreadable, needs_person, credit_hold, not_admitted, budget_spent, turns_used, time_used, achieved.
|
|
489
708
|
*/
|
|
490
|
-
|
|
709
|
+
stop_code: string;
|
|
491
710
|
/**
|
|
492
|
-
*
|
|
711
|
+
* Why, in a sentence.
|
|
493
712
|
*/
|
|
494
|
-
|
|
713
|
+
stop_reason: string;
|
|
495
714
|
/**
|
|
496
|
-
*
|
|
715
|
+
* When it last changed.
|
|
497
716
|
*/
|
|
498
|
-
|
|
717
|
+
updated_at: string;
|
|
718
|
+
usage: GoalUsage;
|
|
499
719
|
};
|
|
500
720
|
/**
|
|
501
|
-
*
|
|
721
|
+
* What a goal may cost at most, all its turns and their subagents together; null: no limit.
|
|
502
722
|
*/
|
|
503
|
-
export type
|
|
723
|
+
export type GoalBudget = ({
|
|
504
724
|
/**
|
|
505
|
-
*
|
|
725
|
+
* In dollars.
|
|
506
726
|
*/
|
|
507
|
-
|
|
727
|
+
max_cost_usd: number;
|
|
728
|
+
}) | null;
|
|
729
|
+
/**
|
|
730
|
+
* A chat's goal set, its status changed, or cleared.
|
|
731
|
+
*/
|
|
732
|
+
export type GoalEvent = {
|
|
508
733
|
/**
|
|
509
|
-
*
|
|
734
|
+
* The chat.
|
|
510
735
|
*/
|
|
511
|
-
|
|
736
|
+
chat_id: string;
|
|
512
737
|
/**
|
|
513
|
-
*
|
|
738
|
+
* The goal.
|
|
514
739
|
*/
|
|
515
|
-
|
|
516
|
-
mask?: ImageInput;
|
|
740
|
+
goal_id: string;
|
|
517
741
|
/**
|
|
518
|
-
*
|
|
742
|
+
* The chat's labels.
|
|
519
743
|
*/
|
|
520
|
-
|
|
744
|
+
metadata: {
|
|
745
|
+
[key: string]: string;
|
|
746
|
+
};
|
|
521
747
|
/**
|
|
522
|
-
* What
|
|
748
|
+
* What it was; null: no goal.
|
|
523
749
|
*/
|
|
524
|
-
|
|
750
|
+
previous_status: string | null;
|
|
525
751
|
/**
|
|
526
|
-
*
|
|
752
|
+
* The member it was set as; null: the server.
|
|
527
753
|
*/
|
|
528
|
-
|
|
754
|
+
set_by: string | null;
|
|
529
755
|
/**
|
|
530
|
-
*
|
|
756
|
+
* What it is now: active, paused, blocked, budget_limited, achieved — or cleared.
|
|
531
757
|
*/
|
|
532
|
-
|
|
758
|
+
status: string;
|
|
533
759
|
/**
|
|
534
|
-
*
|
|
760
|
+
* Why it left active, as a stable code (empty while active).
|
|
535
761
|
*/
|
|
536
|
-
|
|
537
|
-
};
|
|
538
|
-
/**
|
|
539
|
-
* What a finished job cost; null until then.
|
|
540
|
-
*/
|
|
541
|
-
export type ImageUsage = ({
|
|
762
|
+
stop_code: string;
|
|
542
763
|
/**
|
|
543
|
-
*
|
|
764
|
+
* Why, in a sentence.
|
|
544
765
|
*/
|
|
545
|
-
|
|
766
|
+
stop_reason: string;
|
|
767
|
+
};
|
|
768
|
+
/**
|
|
769
|
+
* What changes of a chat's goal: a field left out is left as it is.
|
|
770
|
+
*/
|
|
771
|
+
export type GoalPatch = {
|
|
546
772
|
/**
|
|
547
|
-
*
|
|
773
|
+
* The member the server changes it as: the one it was set as (403 not_your_turn otherwise).
|
|
548
774
|
*/
|
|
549
|
-
|
|
775
|
+
as?: string;
|
|
776
|
+
budget?: GoalBudget;
|
|
550
777
|
/**
|
|
551
|
-
*
|
|
778
|
+
* The most turns it opens; null: no limit.
|
|
552
779
|
*/
|
|
553
|
-
|
|
780
|
+
max_turns?: number | null;
|
|
554
781
|
/**
|
|
555
|
-
*
|
|
782
|
+
* Its objective, edited.
|
|
556
783
|
*/
|
|
557
|
-
|
|
558
|
-
}) | null;
|
|
559
|
-
/**
|
|
560
|
-
* A picture a question is about: a file of the project's storage (bucket and path), read by the model through a URL signed for the while it is answered, or an https address the model reads it from. Nothing of it is kept by the module.
|
|
561
|
-
*/
|
|
562
|
-
export type InputImage = {
|
|
784
|
+
objective?: string;
|
|
563
785
|
/**
|
|
564
|
-
*
|
|
786
|
+
* Why it is paused, with status paused (500 characters at most): said in its stop_reason and its event.
|
|
565
787
|
*/
|
|
566
|
-
|
|
788
|
+
reason?: string;
|
|
567
789
|
/**
|
|
568
|
-
*
|
|
790
|
+
* Its rubric, edited.
|
|
569
791
|
*/
|
|
570
|
-
|
|
792
|
+
rubric?: string;
|
|
571
793
|
/**
|
|
572
|
-
*
|
|
794
|
+
* paused (the goal waits) or active (it goes on).
|
|
573
795
|
*/
|
|
574
|
-
|
|
796
|
+
status?: "paused" | "active";
|
|
575
797
|
};
|
|
576
798
|
/**
|
|
577
|
-
* A
|
|
799
|
+
* A chat's goal to set.
|
|
578
800
|
*/
|
|
579
|
-
export type
|
|
801
|
+
export type GoalRequest = {
|
|
580
802
|
/**
|
|
581
|
-
*
|
|
803
|
+
* The member the server sets it as: the goal and its turns are theirs (the server's alone: a user sending it is answered 403 server_only; one who is not a member of the chat, 403 not_a_member). Left out, the server's.
|
|
582
804
|
*/
|
|
583
|
-
|
|
805
|
+
as?: string;
|
|
806
|
+
budget?: TurnBudget;
|
|
584
807
|
/**
|
|
585
|
-
* The
|
|
808
|
+
* The most turns it opens (1 to 10000; left out: no limit).
|
|
586
809
|
*/
|
|
587
|
-
|
|
810
|
+
max_turns?: number;
|
|
588
811
|
/**
|
|
589
|
-
*
|
|
812
|
+
* What the chat works toward, in words (4000 characters at most).
|
|
590
813
|
*/
|
|
591
|
-
|
|
814
|
+
objective: string;
|
|
815
|
+
/**
|
|
816
|
+
* What a claimed completion is checked against (8000 characters at most; left out: the objective itself).
|
|
817
|
+
*/
|
|
818
|
+
rubric?: string;
|
|
592
819
|
};
|
|
593
820
|
/**
|
|
594
|
-
*
|
|
821
|
+
* What a goal has used so far.
|
|
595
822
|
*/
|
|
596
|
-
export type
|
|
823
|
+
export type GoalUsage = {
|
|
597
824
|
/**
|
|
598
|
-
*
|
|
825
|
+
* How long it has been at work since it was set or last resumed.
|
|
599
826
|
*/
|
|
600
|
-
|
|
827
|
+
active_seconds: number;
|
|
601
828
|
/**
|
|
602
|
-
*
|
|
829
|
+
* Some of its use has no price yet: it cost at least this.
|
|
603
830
|
*/
|
|
604
|
-
|
|
605
|
-
};
|
|
606
|
-
/**
|
|
607
|
-
* One turn of the conversation so far.
|
|
608
|
-
*/
|
|
609
|
-
export type Message = {
|
|
831
|
+
cost_is_lower_bound: boolean;
|
|
610
832
|
/**
|
|
611
|
-
* What
|
|
833
|
+
* What its turns cost so far, in dollars.
|
|
612
834
|
*/
|
|
613
|
-
|
|
835
|
+
cost_usd: number;
|
|
614
836
|
/**
|
|
615
|
-
*
|
|
837
|
+
* Work turns it opened.
|
|
616
838
|
*/
|
|
617
|
-
|
|
839
|
+
turns: number;
|
|
840
|
+
/**
|
|
841
|
+
* Checks of a claimed completion.
|
|
842
|
+
*/
|
|
843
|
+
verifications: number;
|
|
618
844
|
};
|
|
619
845
|
/**
|
|
620
|
-
* A
|
|
846
|
+
* A picture job.
|
|
621
847
|
*/
|
|
622
|
-
export type
|
|
848
|
+
export type Image = {
|
|
623
849
|
/**
|
|
624
|
-
*
|
|
850
|
+
* When it started.
|
|
625
851
|
*/
|
|
626
|
-
|
|
852
|
+
created_at: string;
|
|
853
|
+
error: ImageError;
|
|
627
854
|
/**
|
|
628
|
-
*
|
|
855
|
+
* When it and its pictures are forgotten.
|
|
629
856
|
*/
|
|
630
|
-
|
|
631
|
-
};
|
|
632
|
-
/**
|
|
633
|
-
* A message for a chat.
|
|
634
|
-
*/
|
|
635
|
-
export type MessageRequest = {
|
|
857
|
+
expires_at: string;
|
|
636
858
|
/**
|
|
637
|
-
*
|
|
859
|
+
* Its pictures, once completed.
|
|
638
860
|
*/
|
|
639
|
-
|
|
640
|
-
budget?: TurnBudget;
|
|
861
|
+
files: ImageFile[];
|
|
641
862
|
/**
|
|
642
|
-
* The
|
|
863
|
+
* The job's id.
|
|
643
864
|
*/
|
|
644
|
-
|
|
865
|
+
id: string;
|
|
645
866
|
/**
|
|
646
|
-
*
|
|
867
|
+
* The model.
|
|
647
868
|
*/
|
|
648
|
-
|
|
869
|
+
model: string;
|
|
649
870
|
/**
|
|
650
|
-
*
|
|
871
|
+
* running, completed or failed.
|
|
651
872
|
*/
|
|
652
|
-
|
|
873
|
+
status: "running" | "completed" | "failed";
|
|
874
|
+
usage: ImageUsage;
|
|
653
875
|
};
|
|
654
876
|
/**
|
|
655
|
-
*
|
|
877
|
+
* Why a job failed; null when it did not.
|
|
656
878
|
*/
|
|
657
|
-
export type
|
|
658
|
-
/**
|
|
659
|
-
* Embedding models, with their list prices.
|
|
660
|
-
*/
|
|
661
|
-
embeddings: EmbeddingModel[];
|
|
879
|
+
export type ImageError = ({
|
|
662
880
|
/**
|
|
663
|
-
*
|
|
881
|
+
* Why, as a stable code.
|
|
664
882
|
*/
|
|
665
|
-
|
|
883
|
+
code: string;
|
|
666
884
|
/**
|
|
667
|
-
*
|
|
885
|
+
* Why, in a sentence.
|
|
668
886
|
*/
|
|
669
|
-
|
|
670
|
-
};
|
|
887
|
+
message: string;
|
|
888
|
+
}) | null;
|
|
671
889
|
/**
|
|
672
|
-
* A
|
|
890
|
+
* A picture of a finished job.
|
|
673
891
|
*/
|
|
674
|
-
export type
|
|
892
|
+
export type ImageFile = {
|
|
675
893
|
/**
|
|
676
|
-
*
|
|
894
|
+
* Its size.
|
|
677
895
|
*/
|
|
678
|
-
|
|
896
|
+
bytes: number;
|
|
679
897
|
/**
|
|
680
|
-
*
|
|
898
|
+
* Its media type.
|
|
681
899
|
*/
|
|
682
|
-
|
|
900
|
+
media_type: string;
|
|
683
901
|
/**
|
|
684
|
-
*
|
|
902
|
+
* Where to read it (GET).
|
|
685
903
|
*/
|
|
686
|
-
|
|
904
|
+
path: string;
|
|
905
|
+
/**
|
|
906
|
+
* Its place in the job, from 0.
|
|
907
|
+
*/
|
|
908
|
+
position: number;
|
|
687
909
|
};
|
|
688
910
|
/**
|
|
689
|
-
* A
|
|
911
|
+
* A picture the caller sends.
|
|
690
912
|
*/
|
|
691
|
-
export type
|
|
913
|
+
export type ImageInput = {
|
|
692
914
|
/**
|
|
693
|
-
* The
|
|
915
|
+
* The picture's bytes, base64-encoded (20 MB at most).
|
|
694
916
|
*/
|
|
695
|
-
|
|
917
|
+
data: string;
|
|
696
918
|
/**
|
|
697
|
-
*
|
|
919
|
+
* image/png, image/jpeg or image/webp (a mask is image/png with an alpha channel).
|
|
698
920
|
*/
|
|
699
|
-
|
|
921
|
+
media_type: "image/png" | "image/jpeg" | "image/webp";
|
|
700
922
|
};
|
|
701
923
|
/**
|
|
702
|
-
*
|
|
924
|
+
* An image model.
|
|
703
925
|
*/
|
|
704
|
-
export type
|
|
926
|
+
export type ImageModel = {
|
|
705
927
|
/**
|
|
706
|
-
*
|
|
928
|
+
* List price of a million reference picture tokens, in US dollars.
|
|
707
929
|
*/
|
|
708
|
-
|
|
709
|
-
};
|
|
710
|
-
/**
|
|
711
|
-
* The project's own provider keys.
|
|
712
|
-
*/
|
|
713
|
-
export type ProviderList = {
|
|
930
|
+
image_input_usd_per_mtok: number;
|
|
714
931
|
/**
|
|
715
|
-
*
|
|
932
|
+
* List price of a million picture tokens, in US dollars.
|
|
716
933
|
*/
|
|
717
|
-
|
|
934
|
+
image_output_usd_per_mtok: number;
|
|
935
|
+
/**
|
|
936
|
+
* The model, as provider:model.
|
|
937
|
+
*/
|
|
938
|
+
model: string;
|
|
939
|
+
/**
|
|
940
|
+
* The role that names it: default, strong, or empty.
|
|
941
|
+
*/
|
|
942
|
+
role: string;
|
|
943
|
+
/**
|
|
944
|
+
* List price of a million prompt tokens, in US dollars.
|
|
945
|
+
*/
|
|
946
|
+
text_input_usd_per_mtok: number;
|
|
718
947
|
};
|
|
719
948
|
/**
|
|
720
|
-
* A
|
|
949
|
+
* A request for pictures.
|
|
721
950
|
*/
|
|
722
|
-
export type
|
|
951
|
+
export type ImageRequest = {
|
|
723
952
|
/**
|
|
724
|
-
*
|
|
953
|
+
* auto, transparent or opaque; transparent needs png or webp.
|
|
725
954
|
*/
|
|
726
|
-
|
|
955
|
+
background?: string;
|
|
727
956
|
/**
|
|
728
|
-
*
|
|
957
|
+
* How many pictures (1–4, default 1).
|
|
729
958
|
*/
|
|
730
|
-
|
|
959
|
+
count?: number;
|
|
731
960
|
/**
|
|
732
|
-
*
|
|
961
|
+
* png (default), jpeg or webp.
|
|
733
962
|
*/
|
|
734
|
-
|
|
963
|
+
format?: string;
|
|
964
|
+
mask?: ImageInput;
|
|
735
965
|
/**
|
|
736
|
-
*
|
|
966
|
+
* default (fast), strong (precise edits), or a catalogue image model as provider:model.
|
|
737
967
|
*/
|
|
738
|
-
|
|
968
|
+
model?: string;
|
|
739
969
|
/**
|
|
740
|
-
*
|
|
970
|
+
* What to make.
|
|
741
971
|
*/
|
|
742
|
-
|
|
743
|
-
};
|
|
744
|
-
/**
|
|
745
|
-
* The project's repositories.
|
|
746
|
-
*/
|
|
747
|
-
export type RepoPage = {
|
|
748
|
-
repos: Repo[];
|
|
749
|
-
};
|
|
750
|
-
/**
|
|
751
|
-
* A repository the project's chats work in.
|
|
752
|
-
*/
|
|
753
|
-
export type RepoRequest = {
|
|
972
|
+
prompt: string;
|
|
754
973
|
/**
|
|
755
|
-
*
|
|
974
|
+
* auto, low, medium, high, xhigh or max.
|
|
756
975
|
*/
|
|
757
|
-
|
|
976
|
+
quality?: string;
|
|
758
977
|
/**
|
|
759
|
-
*
|
|
978
|
+
* Pictures to work from (4 at most, each 8 MiB at most and — with the mask — 24 MiB together, as PNG, JPEG or WebP): with them the job is an edit.
|
|
760
979
|
*/
|
|
761
|
-
|
|
980
|
+
references?: ImageInput[];
|
|
762
981
|
/**
|
|
763
|
-
*
|
|
982
|
+
* auto, 1024x1024, 1536x1024, 1024x1536, or WIDTHxHEIGHT: sides multiples of 16, an aspect between 1:3 and 3:1, 655,360 to 8,294,400 pixels.
|
|
764
983
|
*/
|
|
765
|
-
|
|
984
|
+
size?: string;
|
|
766
985
|
};
|
|
767
986
|
/**
|
|
768
|
-
*
|
|
987
|
+
* What a finished job cost; null until then.
|
|
769
988
|
*/
|
|
770
|
-
export type
|
|
989
|
+
export type ImageUsage = ({
|
|
771
990
|
/**
|
|
772
|
-
*
|
|
991
|
+
* What it cost at the list price, in billionths of a dollar.
|
|
773
992
|
*/
|
|
774
|
-
|
|
775
|
-
error: ResponseError;
|
|
993
|
+
cost_nano_usd: number;
|
|
776
994
|
/**
|
|
777
|
-
*
|
|
995
|
+
* Reference picture tokens.
|
|
778
996
|
*/
|
|
779
|
-
|
|
997
|
+
image_input_tokens: number;
|
|
780
998
|
/**
|
|
781
|
-
*
|
|
999
|
+
* Prompt tokens.
|
|
782
1000
|
*/
|
|
783
|
-
|
|
784
|
-
[key: string]: string;
|
|
785
|
-
};
|
|
1001
|
+
input_tokens: number;
|
|
786
1002
|
/**
|
|
787
|
-
*
|
|
1003
|
+
* Picture tokens.
|
|
788
1004
|
*/
|
|
789
|
-
|
|
1005
|
+
output_tokens: number;
|
|
1006
|
+
}) | null;
|
|
1007
|
+
/**
|
|
1008
|
+
* A picture the question is about: a file of the project's storage (bucket and path), an https address the model reads it from (url), or its bytes (data, base64, of media_type) — a screenshot the caller holds, kept in the project's storage for the while the question is answered. One of the three.
|
|
1009
|
+
*/
|
|
1010
|
+
export type InputImage = {
|
|
790
1011
|
/**
|
|
791
|
-
* The
|
|
1012
|
+
* The project's storage bucket the picture is in (with path).
|
|
792
1013
|
*/
|
|
793
|
-
|
|
1014
|
+
bucket?: string;
|
|
794
1015
|
/**
|
|
795
|
-
*
|
|
1016
|
+
* The picture's bytes, base64: 5 MiB at most, 6 MiB with the question's other pictures given so.
|
|
796
1017
|
*/
|
|
797
|
-
|
|
1018
|
+
data?: string;
|
|
798
1019
|
/**
|
|
799
|
-
* The
|
|
1020
|
+
* The picture's type, with its bytes: image/png, image/jpeg, image/webp or image/gif.
|
|
800
1021
|
*/
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
1022
|
+
media_type?: string;
|
|
1023
|
+
/**
|
|
1024
|
+
* The picture's path in the bucket.
|
|
1025
|
+
*/
|
|
1026
|
+
path?: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* An https address the model reads the picture from (2048 characters at most), instead of bucket and path.
|
|
1029
|
+
*/
|
|
1030
|
+
url?: string;
|
|
1031
|
+
};
|
|
804
1032
|
/**
|
|
805
|
-
*
|
|
1033
|
+
* A model's price past its prompt's step: the whole request pays it.
|
|
806
1034
|
*/
|
|
807
|
-
export type
|
|
1035
|
+
export type LongContextPrice = {
|
|
808
1036
|
/**
|
|
809
|
-
*
|
|
1037
|
+
* The step: a prompt of more tokens.
|
|
810
1038
|
*/
|
|
811
|
-
|
|
1039
|
+
above_prompt_tokens: number;
|
|
812
1040
|
/**
|
|
813
|
-
*
|
|
1041
|
+
* Input.
|
|
814
1042
|
*/
|
|
815
|
-
|
|
816
|
-
|
|
1043
|
+
input_usd_per_mtok: number;
|
|
1044
|
+
/**
|
|
1045
|
+
* Output.
|
|
1046
|
+
*/
|
|
1047
|
+
output_usd_per_mtok: number;
|
|
1048
|
+
};
|
|
817
1049
|
/**
|
|
818
|
-
* A
|
|
1050
|
+
* A user in a chat.
|
|
819
1051
|
*/
|
|
820
|
-
export type
|
|
1052
|
+
export type Member = {
|
|
821
1053
|
/**
|
|
822
|
-
*
|
|
1054
|
+
* How the agent and the others are told who wrote.
|
|
823
1055
|
*/
|
|
824
|
-
|
|
1056
|
+
name: string;
|
|
825
1057
|
/**
|
|
826
|
-
* The
|
|
1058
|
+
* The owner deletes the chat.
|
|
827
1059
|
*/
|
|
828
|
-
|
|
1060
|
+
owner: boolean;
|
|
1061
|
+
/**
|
|
1062
|
+
* The user's id.
|
|
1063
|
+
*/
|
|
1064
|
+
user_id: string;
|
|
1065
|
+
};
|
|
1066
|
+
/**
|
|
1067
|
+
* A user to put in a chat.
|
|
1068
|
+
*/
|
|
1069
|
+
export type MemberRequest = {
|
|
1070
|
+
/**
|
|
1071
|
+
* Their address (none: the one kept, if any): what their turns' commits are written as. Never served.
|
|
1072
|
+
*/
|
|
1073
|
+
email?: string;
|
|
1074
|
+
/**
|
|
1075
|
+
* Their name in it.
|
|
1076
|
+
*/
|
|
1077
|
+
name?: string;
|
|
1078
|
+
/**
|
|
1079
|
+
* Whether they own it.
|
|
1080
|
+
*/
|
|
1081
|
+
owner?: boolean;
|
|
1082
|
+
};
|
|
1083
|
+
/**
|
|
1084
|
+
* One turn of the conversation so far.
|
|
1085
|
+
*/
|
|
1086
|
+
export type Message = {
|
|
1087
|
+
/**
|
|
1088
|
+
* What was said.
|
|
1089
|
+
*/
|
|
1090
|
+
content: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* Who said it.
|
|
1093
|
+
*/
|
|
1094
|
+
role: "user" | "assistant";
|
|
1095
|
+
};
|
|
1096
|
+
/**
|
|
1097
|
+
* A picture or a file a message carries, its images first. Its bytes are read at GET /ai/chats/{chat_id}/messages/{message_id}/attachments/{position}, by the chat's members and its server.
|
|
1098
|
+
*/
|
|
1099
|
+
export type MessageAttachment = {
|
|
1100
|
+
/**
|
|
1101
|
+
* The bucket of the project's storage it was copied from.
|
|
1102
|
+
*/
|
|
1103
|
+
bucket: string;
|
|
1104
|
+
/**
|
|
1105
|
+
* What it is: a picture's type by its bytes (whatever it was labelled), a file's as its message or the project's storage said.
|
|
1106
|
+
*/
|
|
1107
|
+
content_type: string;
|
|
1108
|
+
/**
|
|
1109
|
+
* image: a picture the model is shown with the message; file: a file put in the chat's workspace.
|
|
1110
|
+
*/
|
|
1111
|
+
kind: "image" | "file";
|
|
1112
|
+
/**
|
|
1113
|
+
* What the message calls it: a file's name in the workspace.
|
|
1114
|
+
*/
|
|
1115
|
+
name: string;
|
|
1116
|
+
/**
|
|
1117
|
+
* Its path in that bucket.
|
|
1118
|
+
*/
|
|
1119
|
+
path: string;
|
|
1120
|
+
/**
|
|
1121
|
+
* Its bytes' sha256, hex.
|
|
1122
|
+
*/
|
|
1123
|
+
sha256: string;
|
|
1124
|
+
/**
|
|
1125
|
+
* Its size in bytes.
|
|
1126
|
+
*/
|
|
1127
|
+
size: number;
|
|
1128
|
+
/**
|
|
1129
|
+
* Where a file is in the chat's workspace: .palbase/attachments/<message id>/<name>.
|
|
1130
|
+
*/
|
|
1131
|
+
workspace_path?: string;
|
|
1132
|
+
};
|
|
1133
|
+
/**
|
|
1134
|
+
* A file of the project's storage a message puts in its chat's workspace.
|
|
1135
|
+
*/
|
|
1136
|
+
export type MessageFileRequest = {
|
|
1137
|
+
/**
|
|
1138
|
+
* The bucket it is in: one of the project's own.
|
|
1139
|
+
*/
|
|
1140
|
+
bucket: string;
|
|
1141
|
+
/**
|
|
1142
|
+
* What it is, as the agent is told (a media type: application/pdf; its parameters dropped). None: what the project's storage says.
|
|
1143
|
+
*/
|
|
1144
|
+
content_type?: string;
|
|
1145
|
+
/**
|
|
1146
|
+
* Its name in the workspace, and what the message calls it (its path's last segment when none; a second of a name in one message is numbered, rapor-2.pdf).
|
|
1147
|
+
*/
|
|
1148
|
+
filename?: string;
|
|
1149
|
+
/**
|
|
1150
|
+
* Its path in the bucket.
|
|
1151
|
+
*/
|
|
1152
|
+
path: string;
|
|
1153
|
+
};
|
|
1154
|
+
/**
|
|
1155
|
+
* A picture of the project's storage a message shows the model.
|
|
1156
|
+
*/
|
|
1157
|
+
export type MessageImageRequest = {
|
|
1158
|
+
/**
|
|
1159
|
+
* The bucket it is in: one of the project's own.
|
|
1160
|
+
*/
|
|
1161
|
+
bucket: string;
|
|
1162
|
+
/**
|
|
1163
|
+
* Its path in the bucket.
|
|
1164
|
+
*/
|
|
1165
|
+
path: string;
|
|
1166
|
+
};
|
|
1167
|
+
/**
|
|
1168
|
+
* A page of a chat's messages, the newest first.
|
|
1169
|
+
*/
|
|
1170
|
+
export type MessagePage = {
|
|
1171
|
+
/**
|
|
1172
|
+
* The messages.
|
|
1173
|
+
*/
|
|
1174
|
+
messages: ChatMessage[];
|
|
1175
|
+
/**
|
|
1176
|
+
* Pages on (cursor=); absent on the last page.
|
|
1177
|
+
*/
|
|
1178
|
+
next_cursor?: string;
|
|
1179
|
+
};
|
|
1180
|
+
/**
|
|
1181
|
+
* A message for a chat.
|
|
1182
|
+
*/
|
|
1183
|
+
export type MessageRequest = {
|
|
1184
|
+
/**
|
|
1185
|
+
* The member the server writes as (the server's alone: a user sending it is answered 400; one who is not a member of the chat, 403 not_a_member): the message is theirs, and counts toward their messages a minute (429 too_many_messages, as theirs would).
|
|
1186
|
+
*/
|
|
1187
|
+
as?: string;
|
|
1188
|
+
budget?: TurnBudget;
|
|
1189
|
+
/**
|
|
1190
|
+
* The writer's own id for it: sent again — a retry, a second tab — it is the same message, delivered once.
|
|
1191
|
+
*/
|
|
1192
|
+
client_id: string;
|
|
1193
|
+
/**
|
|
1194
|
+
* What the model reads with the message and no member does (the server's alone: a user sending it is answered 400; 64 KiB at most): a document the agent needs, how to open a file the message names. The agent is told it as the project's own words, apart from the writer's; the chat's stream and its list never show it.
|
|
1195
|
+
*/
|
|
1196
|
+
context?: string;
|
|
1197
|
+
/**
|
|
1198
|
+
* While the agent works on a turn: next gives it the message at its next step (the default), now cuts the step it is in. When no turn runs, a message starts one.
|
|
1199
|
+
*/
|
|
1200
|
+
delivery?: "next" | "now";
|
|
1201
|
+
/**
|
|
1202
|
+
* Files of the project's storage put in the chat's workspace before the agent reads the message, at .palbase/attachments/<message id>/<filename>, and the agent is told where (8 at most, 15 MiB each at most). A chat that works in no workspace takes none (409 no_workspace). Copied for the chat, and who may attach which, as images; an object the message names twice — a picture of it and a file of it too — is read once.
|
|
1203
|
+
*/
|
|
1204
|
+
files?: MessageFileRequest[];
|
|
1205
|
+
/**
|
|
1206
|
+
* Pictures of the project's storage the model is shown with the message (4 at most, as many as the model is shown at once; png, jpeg, webp or gif by their bytes, whatever they are labelled — another is 415 unsupported_image; 5 MiB each at most). Each is copied for the chat as the message is written: what it carried is what the agent reads, whatever becomes of the file, and the copy goes with the chat. The server attaches any file of its storage, writing as a member or not: its decision. A member with their own session attaches a public bucket's files alone — a private bucket's file, their own (owner_id) too, is the server's to attach. Any other is not found (404 attachment_not_found), as one that is not there is. Past the bounds: 413 attachment_too_large; changed while it was attached: 409 attachment_changed.
|
|
1207
|
+
*/
|
|
1208
|
+
images?: MessageImageRequest[];
|
|
1209
|
+
/**
|
|
1210
|
+
* Its writer's own labels for the message (16 at most, snake_case keys, values of 512 bytes at most) — what an app draws it by: the files it names, the kind of row it is, the model its writer chose. Kept with it, shown with it in the chat's stream and its list, and given to the backend that defines the agent of the turn it opens (the agent context's message). Sent again with the same client_id, the first message's stand.
|
|
1211
|
+
*/
|
|
1212
|
+
metadata?: {
|
|
829
1213
|
[key: string]: string;
|
|
830
1214
|
};
|
|
831
1215
|
/**
|
|
832
|
-
* The
|
|
1216
|
+
* The message (64 KiB at most).
|
|
833
1217
|
*/
|
|
834
|
-
|
|
1218
|
+
text: string;
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* The voice a line of kind voice was said in, and by whom.
|
|
1222
|
+
*/
|
|
1223
|
+
export type MessageVoice = {
|
|
835
1224
|
/**
|
|
836
|
-
* The
|
|
1225
|
+
* The voice.
|
|
837
1226
|
*/
|
|
838
|
-
|
|
1227
|
+
id: string;
|
|
839
1228
|
/**
|
|
840
|
-
*
|
|
1229
|
+
* user (the person) or assistant (the voice).
|
|
841
1230
|
*/
|
|
842
|
-
|
|
1231
|
+
role: string;
|
|
843
1232
|
};
|
|
844
1233
|
/**
|
|
845
|
-
*
|
|
1234
|
+
* What a project may name.
|
|
846
1235
|
*/
|
|
847
|
-
export type
|
|
1236
|
+
export type Models = {
|
|
848
1237
|
/**
|
|
849
|
-
*
|
|
1238
|
+
* Every text model a turn may name — a chat's agent, a response — on the project's own provider connections or the platform's, as the engine's catalogue says it: what a model picker offers a person.
|
|
850
1239
|
*/
|
|
851
|
-
|
|
1240
|
+
chat: ChatModel[];
|
|
852
1241
|
/**
|
|
853
|
-
*
|
|
1242
|
+
* Embedding models, with their list prices.
|
|
854
1243
|
*/
|
|
855
|
-
|
|
1244
|
+
embeddings: EmbeddingModel[];
|
|
1245
|
+
/**
|
|
1246
|
+
* Image models, with their list prices.
|
|
1247
|
+
*/
|
|
1248
|
+
images: ImageModel[];
|
|
1249
|
+
/**
|
|
1250
|
+
* The roles a text model is chosen by.
|
|
1251
|
+
*/
|
|
1252
|
+
text: TextModel[];
|
|
1253
|
+
/**
|
|
1254
|
+
* The providers whose models could not be listed just now: their models are missing from chat until they answer.
|
|
1255
|
+
*/
|
|
1256
|
+
unavailable: string[];
|
|
1257
|
+
};
|
|
1258
|
+
/**
|
|
1259
|
+
* A user to put in a chat as it starts.
|
|
1260
|
+
*/
|
|
1261
|
+
export type NewMember = {
|
|
1262
|
+
/**
|
|
1263
|
+
* Their address: what the commits their turns' agent makes in the chat's workspace are written as (with their name). Kept, never served; a member's own session says it again, verified, as they write. None: an address of the platform's that names them and reaches no one.
|
|
1264
|
+
*/
|
|
1265
|
+
email?: string;
|
|
1266
|
+
/**
|
|
1267
|
+
* How the agent and the others are told who wrote.
|
|
1268
|
+
*/
|
|
1269
|
+
name?: string;
|
|
1270
|
+
/**
|
|
1271
|
+
* Whether they own it.
|
|
1272
|
+
*/
|
|
1273
|
+
owner?: boolean;
|
|
1274
|
+
/**
|
|
1275
|
+
* The user's id.
|
|
1276
|
+
*/
|
|
1277
|
+
user_id: string;
|
|
1278
|
+
};
|
|
1279
|
+
/**
|
|
1280
|
+
* A provider the project connected with its own key.
|
|
1281
|
+
*/
|
|
1282
|
+
export type Provider = {
|
|
1283
|
+
/**
|
|
1284
|
+
* The provider.
|
|
1285
|
+
*/
|
|
1286
|
+
name: string;
|
|
1287
|
+
/**
|
|
1288
|
+
* The provider accepted the key when it was connected.
|
|
1289
|
+
*/
|
|
1290
|
+
verified: boolean;
|
|
1291
|
+
};
|
|
1292
|
+
/**
|
|
1293
|
+
* A provider key.
|
|
1294
|
+
*/
|
|
1295
|
+
export type ProviderKey = {
|
|
1296
|
+
/**
|
|
1297
|
+
* The provider's API key. It is never read back.
|
|
1298
|
+
*/
|
|
1299
|
+
key: string;
|
|
1300
|
+
};
|
|
1301
|
+
/**
|
|
1302
|
+
* The project's own provider keys.
|
|
1303
|
+
*/
|
|
1304
|
+
export type ProviderList = {
|
|
1305
|
+
/**
|
|
1306
|
+
* The project's providers.
|
|
1307
|
+
*/
|
|
1308
|
+
providers: Provider[];
|
|
1309
|
+
};
|
|
1310
|
+
/**
|
|
1311
|
+
* A commit a push brought to its branch.
|
|
1312
|
+
*/
|
|
1313
|
+
export type PushedCommit = {
|
|
1314
|
+
/**
|
|
1315
|
+
* Its author's address.
|
|
1316
|
+
*/
|
|
1317
|
+
author_email: string;
|
|
1318
|
+
/**
|
|
1319
|
+
* Its author: the member the turn was for, when the server said who they are.
|
|
1320
|
+
*/
|
|
1321
|
+
author_name: string;
|
|
1322
|
+
/**
|
|
1323
|
+
* The commit.
|
|
1324
|
+
*/
|
|
1325
|
+
sha: string;
|
|
1326
|
+
/**
|
|
1327
|
+
* Its message's first line.
|
|
1328
|
+
*/
|
|
1329
|
+
subject: string;
|
|
1330
|
+
};
|
|
1331
|
+
/**
|
|
1332
|
+
* A GitHub repository the project's chats work in, by the project's name for it; the project's backend gives its tokens (the framework's ai.repo), asked at each clone and each push.
|
|
1333
|
+
*/
|
|
1334
|
+
export type Repo = {
|
|
1335
|
+
/**
|
|
1336
|
+
* The project's machine that gives its tokens.
|
|
1337
|
+
*/
|
|
1338
|
+
backend: string;
|
|
1339
|
+
/**
|
|
1340
|
+
* When it was put first.
|
|
1341
|
+
*/
|
|
1342
|
+
created_at: string;
|
|
1343
|
+
/**
|
|
1344
|
+
* The branch a workspace takes when it names none.
|
|
1345
|
+
*/
|
|
1346
|
+
default_branch: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* The project's name for it.
|
|
1349
|
+
*/
|
|
1350
|
+
name: string;
|
|
1351
|
+
/**
|
|
1352
|
+
* The GitHub repository, owner/name.
|
|
1353
|
+
*/
|
|
1354
|
+
repository: string;
|
|
1355
|
+
};
|
|
1356
|
+
/**
|
|
1357
|
+
* The project's repositories, by name, a page at a time.
|
|
1358
|
+
*/
|
|
1359
|
+
export type RepoPage = {
|
|
1360
|
+
/**
|
|
1361
|
+
* The next page's cursor; absent on the last page.
|
|
1362
|
+
*/
|
|
1363
|
+
next_cursor?: string;
|
|
1364
|
+
repos: Repo[];
|
|
1365
|
+
};
|
|
1366
|
+
/**
|
|
1367
|
+
* A repository the project's chats work in.
|
|
1368
|
+
*/
|
|
1369
|
+
export type RepoRequest = {
|
|
1370
|
+
/**
|
|
1371
|
+
* The project's machine whose framework gives the repository's tokens (backend unless said).
|
|
1372
|
+
*/
|
|
1373
|
+
backend?: string;
|
|
1374
|
+
/**
|
|
1375
|
+
* The branch a workspace takes when it names none (main unless said).
|
|
1376
|
+
*/
|
|
1377
|
+
default_branch?: string;
|
|
1378
|
+
/**
|
|
1379
|
+
* The GitHub repository, owner/name.
|
|
1380
|
+
*/
|
|
1381
|
+
repository: string;
|
|
1382
|
+
};
|
|
1383
|
+
/**
|
|
1384
|
+
* A response.
|
|
1385
|
+
*/
|
|
1386
|
+
export type Response = {
|
|
1387
|
+
/**
|
|
1388
|
+
* When it was admitted.
|
|
1389
|
+
*/
|
|
1390
|
+
created_at: string;
|
|
1391
|
+
error: ResponseError;
|
|
1392
|
+
/**
|
|
1393
|
+
* The response's id.
|
|
1394
|
+
*/
|
|
1395
|
+
id: string;
|
|
1396
|
+
/**
|
|
1397
|
+
* The caller's own labels (16 at most, snake_case keys): returned with the response and its event.
|
|
1398
|
+
*/
|
|
1399
|
+
metadata: {
|
|
1400
|
+
[key: string]: string;
|
|
1401
|
+
};
|
|
1402
|
+
/**
|
|
1403
|
+
* The model that answered.
|
|
1404
|
+
*/
|
|
1405
|
+
model: string;
|
|
1406
|
+
/**
|
|
1407
|
+
* The parsed document of an answer to a schema; null otherwise.
|
|
1408
|
+
*/
|
|
1409
|
+
output: unknown;
|
|
1410
|
+
/**
|
|
1411
|
+
* Where it is: queued, in_progress, then completed, failed, canceled, timed_out or budget_exceeded.
|
|
1412
|
+
*/
|
|
1413
|
+
status: string;
|
|
1414
|
+
/**
|
|
1415
|
+
* The answer as the model wrote it; for a schema's answer, the JSON document.
|
|
1416
|
+
*/
|
|
1417
|
+
text: string | null;
|
|
1418
|
+
usage: ResponseUsage;
|
|
1419
|
+
};
|
|
1420
|
+
/**
|
|
1421
|
+
* Why a response did not complete; null when it did.
|
|
1422
|
+
*/
|
|
1423
|
+
export type ResponseError = ({
|
|
1424
|
+
/**
|
|
1425
|
+
* Why, as a stable code.
|
|
1426
|
+
*/
|
|
1427
|
+
code: string;
|
|
1428
|
+
/**
|
|
1429
|
+
* Why, in a sentence.
|
|
1430
|
+
*/
|
|
1431
|
+
message: string;
|
|
1432
|
+
}) | null;
|
|
1433
|
+
/**
|
|
1434
|
+
* A response started in the background ended, or a chat's turn began or ended: a chat's turn carries the chat's fields besides (chat_id, user_id, message_metadata, goal_id, goal_turn).
|
|
1435
|
+
*/
|
|
1436
|
+
export type ResponseEvent = {
|
|
1437
|
+
/**
|
|
1438
|
+
* A chat's turn: the chat.
|
|
1439
|
+
*/
|
|
1440
|
+
chat_id?: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* What it cost, in billionths of a dollar.
|
|
1443
|
+
*/
|
|
1444
|
+
cost_nano_usd: number;
|
|
1445
|
+
error?: ResponseEventError;
|
|
1446
|
+
/**
|
|
1447
|
+
* A chat's turn: the goal it is a turn of; null: none.
|
|
1448
|
+
*/
|
|
1449
|
+
goal_id?: string | null;
|
|
1450
|
+
/**
|
|
1451
|
+
* A chat's turn: whether it is a turn of the chat's goal.
|
|
1452
|
+
*/
|
|
1453
|
+
goal_turn?: boolean;
|
|
1454
|
+
/**
|
|
1455
|
+
* A chat's turn: the labels of the message that opened it ({}: none, or a turn no message opened).
|
|
1456
|
+
*/
|
|
1457
|
+
message_metadata?: {
|
|
1458
|
+
[key: string]: string;
|
|
1459
|
+
};
|
|
1460
|
+
/**
|
|
1461
|
+
* A background response's: the caller's own labels (16 at most, snake_case keys). A chat's turn's: the chat's labels.
|
|
1462
|
+
*/
|
|
1463
|
+
metadata: {
|
|
1464
|
+
[key: string]: string;
|
|
1465
|
+
};
|
|
1466
|
+
/**
|
|
1467
|
+
* The model that answered.
|
|
1468
|
+
*/
|
|
1469
|
+
model: string;
|
|
1470
|
+
/**
|
|
1471
|
+
* The response.
|
|
1472
|
+
*/
|
|
1473
|
+
response_id: string;
|
|
1474
|
+
/**
|
|
1475
|
+
* How it ended — a background response's as the engine says it (completed, failed, canceled, timed_out, budget_exceeded); a chat's turn's in the chat's words: running (ai.response.started), completed, failed, stopped (a member or the server stopped it, or the chat went), budget_exceeded.
|
|
1476
|
+
*/
|
|
1477
|
+
status: string;
|
|
1478
|
+
/**
|
|
1479
|
+
* A chat's turn: the member it ran for — whose message opened it, or whose goal it is; null: the server's.
|
|
1480
|
+
*/
|
|
1481
|
+
user_id?: string | null;
|
|
1482
|
+
};
|
|
1483
|
+
/**
|
|
1484
|
+
* How a response ended when it did not complete, and was not stopped.
|
|
1485
|
+
*/
|
|
1486
|
+
export type ResponseEventError = {
|
|
1487
|
+
/**
|
|
1488
|
+
* A stable code: internal_error, timed_out, budget_exceeded, or the engine's own.
|
|
1489
|
+
*/
|
|
1490
|
+
code: string;
|
|
1491
|
+
/**
|
|
1492
|
+
* Why, in a sentence.
|
|
1493
|
+
*/
|
|
1494
|
+
message: string;
|
|
1495
|
+
/**
|
|
1496
|
+
* Whether asking again may go otherwise.
|
|
1497
|
+
*/
|
|
1498
|
+
retryable: boolean;
|
|
1499
|
+
};
|
|
1500
|
+
/**
|
|
1501
|
+
* A question for a model: input, or messages.
|
|
1502
|
+
*/
|
|
1503
|
+
export type ResponseRequest = {
|
|
1504
|
+
/**
|
|
1505
|
+
* Answer at once; the response's end is the event ai.response.completed or ai.response.failed.
|
|
1506
|
+
*/
|
|
1507
|
+
background?: boolean;
|
|
1508
|
+
/**
|
|
1509
|
+
* Pictures the question is about, shown to the model with it (4 at most).
|
|
1510
|
+
*/
|
|
1511
|
+
images?: InputImage[];
|
|
1512
|
+
/**
|
|
1513
|
+
* The question (2 MB at most). Give this, or messages.
|
|
1514
|
+
*/
|
|
1515
|
+
input?: string;
|
|
1516
|
+
/**
|
|
1517
|
+
* How the model should answer (256 KB at most).
|
|
1518
|
+
*/
|
|
1519
|
+
instructions?: string;
|
|
1520
|
+
/**
|
|
1521
|
+
* How many tool calls the answer makes at most (10000: the engine's own bound): past it the model is told it has no tools left and answers.
|
|
1522
|
+
*/
|
|
1523
|
+
max_tool_calls?: number;
|
|
1524
|
+
/**
|
|
1525
|
+
* The conversation so far instead of one question (500 turns at most); its last turn is the user's.
|
|
1526
|
+
*/
|
|
1527
|
+
messages?: Message[];
|
|
1528
|
+
/**
|
|
1529
|
+
* The caller's own labels (16 at most, snake_case keys): returned with the response and its event.
|
|
1530
|
+
*/
|
|
1531
|
+
metadata?: {
|
|
1532
|
+
[key: string]: string;
|
|
1533
|
+
};
|
|
1534
|
+
/**
|
|
1535
|
+
* A role — fast, default (the default), strong — or a catalogue model as provider:model. Name a role: when a provider retires a model, the role is bound to another and your code does not change.
|
|
1536
|
+
*/
|
|
1537
|
+
model?: string;
|
|
1538
|
+
/**
|
|
1539
|
+
* A JSON Schema the answer must be a document of. Its keywords are the provider's strict subset: type, properties, required, additionalProperties, items, enum, description, title, minimum, maximum, minLength, maxLength, minItems, maxItems — no $ref, at most 12 levels and 512 properties; every property required (a nullable one may be null). One outside the subset is refused, naming where it is.
|
|
1540
|
+
*/
|
|
1541
|
+
schema?: {
|
|
1542
|
+
[key: string]: unknown;
|
|
1543
|
+
};
|
|
1544
|
+
/**
|
|
1545
|
+
* The schema's name, as the model is told it (letters, digits, _ and -; default answer).
|
|
1546
|
+
*/
|
|
1547
|
+
schema_name?: string;
|
|
1548
|
+
/**
|
|
1549
|
+
* Answer with the response's live view (text/event-stream).
|
|
1550
|
+
*/
|
|
1551
|
+
stream?: boolean;
|
|
1552
|
+
/**
|
|
1553
|
+
* What the model may call to answer: the project's backend's functions, its HTTPS tools and MCP servers (an app's own tools are a chat's).
|
|
1554
|
+
*/
|
|
1555
|
+
tools?: ToolRef[];
|
|
1556
|
+
};
|
|
1557
|
+
/**
|
|
1558
|
+
* What a response used.
|
|
1559
|
+
*/
|
|
1560
|
+
export type ResponseUsage = {
|
|
1561
|
+
/**
|
|
1562
|
+
* Nothing more of its cost can be settled: what it cost is the whole.
|
|
1563
|
+
*/
|
|
1564
|
+
cost_final: boolean;
|
|
1565
|
+
/**
|
|
1566
|
+
* What it cost, in billionths of a dollar, once it ended (0 before).
|
|
1567
|
+
*/
|
|
1568
|
+
cost_nano_usd: number;
|
|
1569
|
+
/**
|
|
1570
|
+
* Tokens read.
|
|
1571
|
+
*/
|
|
1572
|
+
input_tokens: number;
|
|
1573
|
+
/**
|
|
1574
|
+
* Tokens written.
|
|
1575
|
+
*/
|
|
1576
|
+
output_tokens: number;
|
|
1577
|
+
/**
|
|
1578
|
+
* cost_nano_usd in dollars.
|
|
1579
|
+
*/
|
|
1580
|
+
usd: number;
|
|
1581
|
+
};
|
|
1582
|
+
/**
|
|
1583
|
+
* A message a subagent was given.
|
|
1584
|
+
*/
|
|
1585
|
+
export type RunMessageAccepted = {
|
|
1586
|
+
/**
|
|
1587
|
+
* The writer's id for it.
|
|
1588
|
+
*/
|
|
1589
|
+
client_id: string;
|
|
1590
|
+
/**
|
|
1591
|
+
* The subagent's run.
|
|
1592
|
+
*/
|
|
1593
|
+
run_id: string;
|
|
1594
|
+
};
|
|
1595
|
+
/**
|
|
1596
|
+
* A message for a subagent at work.
|
|
1597
|
+
*/
|
|
1598
|
+
export type RunMessageRequest = {
|
|
1599
|
+
/**
|
|
1600
|
+
* The member the project's server acts as: held to that member's rules — their messages a minute (429 too_many_messages) — and the message is theirs (the server's alone: a user sending it is answered 400; one who is not a member of the chat, 403 not_a_member). Left out, the server acts as itself.
|
|
1601
|
+
*/
|
|
1602
|
+
as?: string;
|
|
1603
|
+
/**
|
|
1604
|
+
* The writer's id for it.
|
|
1605
|
+
*/
|
|
1606
|
+
client_id: string;
|
|
1607
|
+
/**
|
|
1608
|
+
* The message.
|
|
1609
|
+
*/
|
|
1610
|
+
text: string;
|
|
1611
|
+
};
|
|
1612
|
+
/**
|
|
1613
|
+
* Who stops a subagent.
|
|
1614
|
+
*/
|
|
1615
|
+
export type RunStopRequest = {
|
|
1616
|
+
/**
|
|
1617
|
+
* The member the project's server stops it as: a member of the chat (the server's alone: a user sending it is answered 400; one who is not a member, 403 not_a_member). Left out, the server stops it as itself.
|
|
1618
|
+
*/
|
|
1619
|
+
as?: string;
|
|
1620
|
+
};
|
|
1621
|
+
/**
|
|
1622
|
+
* A subagent a stop ended.
|
|
1623
|
+
*/
|
|
1624
|
+
export type RunStopped = {
|
|
1625
|
+
/**
|
|
1626
|
+
* Its run.
|
|
1627
|
+
*/
|
|
1628
|
+
run_id: string;
|
|
1629
|
+
};
|
|
1630
|
+
/**
|
|
1631
|
+
* What the project allows its chats.
|
|
1632
|
+
*/
|
|
1633
|
+
export type Settings = {
|
|
1634
|
+
/**
|
|
1635
|
+
* Whether the app's users talk to the project's agents with their own session: read and write to the chats they are in (the project's server starts them).
|
|
1636
|
+
*/
|
|
1637
|
+
clients: boolean;
|
|
1638
|
+
/**
|
|
1639
|
+
* How much it keeps now.
|
|
1640
|
+
*/
|
|
1641
|
+
history_bytes: number;
|
|
1642
|
+
/**
|
|
1643
|
+
* How much chat history the project keeps; a message past it is refused (history_full) until chats are deleted. A free project keeps 500 MiB at most; null: no fixed limit — a project with paid rights keeps all of it, paid by use, unless it says a limit of its own.
|
|
1644
|
+
*/
|
|
1645
|
+
history_limit_bytes: number | null;
|
|
1646
|
+
/**
|
|
1647
|
+
* How many messages one user sends a minute (default 20).
|
|
1648
|
+
*/
|
|
1649
|
+
user_messages_per_minute: number;
|
|
1650
|
+
};
|
|
1651
|
+
/**
|
|
1652
|
+
* A change of what the project allows its chats; a field left out is left as it is.
|
|
1653
|
+
*/
|
|
1654
|
+
export type SettingsRequest = {
|
|
1655
|
+
/**
|
|
1656
|
+
* Let the app's users talk to the project's agents themselves.
|
|
1657
|
+
*/
|
|
1658
|
+
clients?: boolean;
|
|
1659
|
+
/**
|
|
1660
|
+
* A limit of the project's own: a free project at most the plan's 500 MiB (it may keep less, not more), a project with paid rights at most 1 TiB. null clears it: the plan's is kept (free: 500 MiB; with paid rights: none).
|
|
1661
|
+
*/
|
|
1662
|
+
history_limit_bytes?: number | null;
|
|
1663
|
+
/**
|
|
1664
|
+
* 1 to 600.
|
|
1665
|
+
*/
|
|
1666
|
+
user_messages_per_minute?: number;
|
|
1667
|
+
};
|
|
1668
|
+
/**
|
|
1669
|
+
* The turn a stop stopped.
|
|
1670
|
+
*/
|
|
1671
|
+
export type StopResult = {
|
|
1672
|
+
/**
|
|
1673
|
+
* Its response; null: none was running.
|
|
1674
|
+
*/
|
|
1675
|
+
stopped: string | null;
|
|
1676
|
+
};
|
|
1677
|
+
/**
|
|
1678
|
+
* An agent the agent may hand part of a turn to.
|
|
1679
|
+
*/
|
|
1680
|
+
export type Subagent = {
|
|
1681
|
+
/**
|
|
1682
|
+
* The window, in tokens, it works in. Left out: the agent's, when it runs on the agent's model.
|
|
1683
|
+
*/
|
|
1684
|
+
context_window?: number;
|
|
1685
|
+
/**
|
|
1686
|
+
* What it is for: the agent reads it to choose.
|
|
1687
|
+
*/
|
|
1688
|
+
description: string;
|
|
1689
|
+
/**
|
|
1690
|
+
* How hard its model thinks. Left out: the agent's, when it runs on the agent's model.
|
|
1691
|
+
*/
|
|
1692
|
+
effort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
1693
|
+
/**
|
|
1694
|
+
* Its instructions.
|
|
1695
|
+
*/
|
|
1696
|
+
instructions?: string;
|
|
1697
|
+
/**
|
|
1698
|
+
* Its model: a role (fast, default, strong) or a catalogue model.
|
|
1699
|
+
*/
|
|
1700
|
+
model?: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* Its name, unique among the subagents.
|
|
1703
|
+
*/
|
|
1704
|
+
name: string;
|
|
1705
|
+
/**
|
|
1706
|
+
* The turn fails if this subagent's part fails.
|
|
1707
|
+
*/
|
|
1708
|
+
required?: boolean;
|
|
1709
|
+
/**
|
|
1710
|
+
* Whether its model's reasoning is asked for to show (visible) or not at all (hidden). Left out: the agent's.
|
|
1711
|
+
*/
|
|
1712
|
+
thinking?: "visible" | "hidden";
|
|
1713
|
+
/**
|
|
1714
|
+
* Its tools.
|
|
1715
|
+
*/
|
|
1716
|
+
tools?: ToolRef[];
|
|
1717
|
+
};
|
|
1718
|
+
/**
|
|
1719
|
+
* A role a text model is chosen by.
|
|
1720
|
+
*/
|
|
1721
|
+
export type TextModel = {
|
|
1722
|
+
/**
|
|
1723
|
+
* What it is for.
|
|
1724
|
+
*/
|
|
1725
|
+
description: string;
|
|
1726
|
+
/**
|
|
1727
|
+
* The role.
|
|
1728
|
+
*/
|
|
1729
|
+
role: string;
|
|
1730
|
+
};
|
|
1731
|
+
/**
|
|
1732
|
+
* A part of what a tool returned.
|
|
1733
|
+
*/
|
|
1734
|
+
export type ToolContent = {
|
|
1735
|
+
/**
|
|
1736
|
+
* An image as base64 (5 MiB at most).
|
|
1737
|
+
*/
|
|
1738
|
+
data?: string;
|
|
1739
|
+
/**
|
|
1740
|
+
* An image's type: image/png, image/jpeg, image/webp or image/gif.
|
|
1741
|
+
*/
|
|
1742
|
+
media_type?: string;
|
|
1743
|
+
/**
|
|
1744
|
+
* The text.
|
|
1745
|
+
*/
|
|
1746
|
+
text?: string;
|
|
1747
|
+
/**
|
|
1748
|
+
* text or image.
|
|
1749
|
+
*/
|
|
1750
|
+
type: "text" | "image";
|
|
1751
|
+
};
|
|
1752
|
+
/**
|
|
1753
|
+
* What an app's tool returned (1 MiB of text and 4 images at most).
|
|
1754
|
+
*/
|
|
1755
|
+
export type ToolOutput = {
|
|
1756
|
+
/**
|
|
1757
|
+
* The member the project's server acts as: held to that member's rules — their turn (403 not_your_turn) (the server's alone: a user sending it is answered 400; one who is not a member of the chat, 403 not_a_member). Left out, the server acts as itself.
|
|
1758
|
+
*/
|
|
1759
|
+
as?: string;
|
|
1760
|
+
/**
|
|
1761
|
+
* The tool failed; the output says why.
|
|
1762
|
+
*/
|
|
1763
|
+
is_error?: boolean;
|
|
1764
|
+
/**
|
|
1765
|
+
* Text and images: the agent is shown both.
|
|
1766
|
+
*/
|
|
1767
|
+
output: ToolContent[];
|
|
1768
|
+
};
|
|
1769
|
+
/**
|
|
1770
|
+
* An app's answer the turn was given.
|
|
1771
|
+
*/
|
|
1772
|
+
export type ToolOutputAccepted = {
|
|
1773
|
+
/**
|
|
1774
|
+
* The tool call.
|
|
1775
|
+
*/
|
|
1776
|
+
call_id: string;
|
|
1777
|
+
};
|
|
1778
|
+
/**
|
|
1779
|
+
* A tool an agent is given, by where it runs: backend (a function of the project's backend, the framework's ai.tool, on its machine), https (an endpoint the project put), mcp (an MCP server the project put: its tools, or the ones named in only), client (code of the app the chat is open in: the turn waits for its answer), or platform (one of the platform's own, by name: web.search, web.fetch, workspace.fetch_archive — the agent's alone; its subagents work with the agent's).
|
|
1780
|
+
*/
|
|
1781
|
+
export type ToolRef = {
|
|
1782
|
+
/**
|
|
1783
|
+
* A call waits for a person's yes (a member of the chat, or the server); one denied is told to the agent with the reason.
|
|
1784
|
+
*/
|
|
1785
|
+
approval?: boolean;
|
|
1786
|
+
/**
|
|
1787
|
+
* What it does: the agent reads it to choose (backend and client tools; an endpoint says its own).
|
|
1788
|
+
*/
|
|
1789
|
+
description?: string;
|
|
1790
|
+
/**
|
|
1791
|
+
* The machine a backend tool runs on (default backend).
|
|
1792
|
+
*/
|
|
1793
|
+
machine?: string;
|
|
1794
|
+
/**
|
|
1795
|
+
* The tool (backend, client), the endpoint's name (https, mcp), or the platform's tool: web.search (the web searched), web.fetch (a page of it read), workspace.fetch_archive (an archive at a URL unpacked into the chat's workspace).
|
|
1796
|
+
*/
|
|
1797
|
+
name: string;
|
|
1798
|
+
/**
|
|
1799
|
+
* The MCP server's tools to offer (none: all).
|
|
1800
|
+
*/
|
|
1801
|
+
only?: string[];
|
|
1802
|
+
/**
|
|
1803
|
+
* A JSON Schema of type object: what the tool takes.
|
|
1804
|
+
*/
|
|
1805
|
+
parameters?: {
|
|
1806
|
+
[key: string]: unknown;
|
|
1807
|
+
};
|
|
1808
|
+
/**
|
|
1809
|
+
* backend, https, mcp, client or platform.
|
|
1810
|
+
*/
|
|
1811
|
+
source: "backend" | "https" | "mcp" | "client" | "platform";
|
|
1812
|
+
};
|
|
1813
|
+
/**
|
|
1814
|
+
* One artifact a turn's agent published.
|
|
1815
|
+
*/
|
|
1816
|
+
export type TurnArtifact = {
|
|
1817
|
+
/**
|
|
1818
|
+
* Its digest (sha256:<hex>).
|
|
1819
|
+
*/
|
|
1820
|
+
checksum: string;
|
|
1821
|
+
/**
|
|
1822
|
+
* When it was published.
|
|
1823
|
+
*/
|
|
1824
|
+
created_at: string;
|
|
1825
|
+
/**
|
|
1826
|
+
* The artifact.
|
|
1827
|
+
*/
|
|
1828
|
+
id: string;
|
|
1829
|
+
/**
|
|
1830
|
+
* What it is to the engine, when it says.
|
|
1831
|
+
*/
|
|
1832
|
+
logical_type?: string;
|
|
1833
|
+
/**
|
|
1834
|
+
* Its media type, as published.
|
|
1835
|
+
*/
|
|
1836
|
+
media_type: string;
|
|
1837
|
+
/**
|
|
1838
|
+
* Its size.
|
|
1839
|
+
*/
|
|
1840
|
+
size_bytes: number;
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* A turn's artifacts.
|
|
1844
|
+
*/
|
|
1845
|
+
export type TurnArtifacts = {
|
|
1846
|
+
artifacts: TurnArtifact[];
|
|
1847
|
+
};
|
|
1848
|
+
/**
|
|
1849
|
+
* What the turn a message starts may cost at most, its subagents' spend counted (the server's alone): past it the engine stops the turn. A message delivered into a turn already running takes that turn's.
|
|
1850
|
+
*/
|
|
1851
|
+
export type TurnBudget = {
|
|
1852
|
+
/**
|
|
1853
|
+
* US dollars, more than 0 and at most 100000; rounded up to the cent.
|
|
1854
|
+
*/
|
|
1855
|
+
max_cost_usd: number;
|
|
1856
|
+
};
|
|
1857
|
+
/**
|
|
1858
|
+
* What one turn of a chat cost so far: its model calls and its subagents', at the engine's frozen rates.
|
|
1859
|
+
*/
|
|
1860
|
+
export type TurnCost = {
|
|
1861
|
+
/**
|
|
1862
|
+
* The chat.
|
|
1863
|
+
*/
|
|
1864
|
+
chat_id: string;
|
|
1865
|
+
/**
|
|
1866
|
+
* What they cost, in billionths of a US dollar.
|
|
1867
|
+
*/
|
|
1868
|
+
cost_nano_usd: number;
|
|
1869
|
+
/**
|
|
1870
|
+
* Nothing more of the turn's use can be settled: false while it or a subagent of it runs.
|
|
1871
|
+
*/
|
|
1872
|
+
final: boolean;
|
|
1873
|
+
/**
|
|
1874
|
+
* Input tokens of the turn and its subagents.
|
|
1875
|
+
*/
|
|
1876
|
+
input_tokens: number;
|
|
1877
|
+
/**
|
|
1878
|
+
* Output tokens of the turn and its subagents.
|
|
1879
|
+
*/
|
|
1880
|
+
output_tokens: number;
|
|
1881
|
+
/**
|
|
1882
|
+
* The turn.
|
|
1883
|
+
*/
|
|
1884
|
+
response_id: string;
|
|
1885
|
+
/**
|
|
1886
|
+
* The cost run by run — the turn's own and each subagent's, by its name and model — so far: a turn at work is read as it spends.
|
|
1887
|
+
*/
|
|
1888
|
+
runs: TurnRunCost[];
|
|
1889
|
+
/**
|
|
1890
|
+
* A model of the turn has no price: the cost is a lower bound.
|
|
1891
|
+
*/
|
|
1892
|
+
unpriced: boolean;
|
|
856
1893
|
/**
|
|
857
|
-
*
|
|
1894
|
+
* cost_nano_usd in dollars.
|
|
858
1895
|
*/
|
|
859
|
-
|
|
1896
|
+
usd: number;
|
|
1897
|
+
};
|
|
1898
|
+
/**
|
|
1899
|
+
* What one run of a turn — its own, or a subagent's — cost so far.
|
|
1900
|
+
*/
|
|
1901
|
+
export type TurnRunCost = {
|
|
860
1902
|
/**
|
|
861
|
-
*
|
|
1903
|
+
* Tokens read from the provider's cache.
|
|
862
1904
|
*/
|
|
863
|
-
|
|
1905
|
+
cache_read_tokens: number;
|
|
864
1906
|
/**
|
|
865
|
-
*
|
|
1907
|
+
* Tokens written to it.
|
|
866
1908
|
*/
|
|
867
|
-
|
|
1909
|
+
cache_write_tokens: number;
|
|
868
1910
|
/**
|
|
869
|
-
*
|
|
1911
|
+
* Its cost, in billionths of a dollar.
|
|
870
1912
|
*/
|
|
871
|
-
|
|
1913
|
+
cost_nano_usd: number;
|
|
872
1914
|
/**
|
|
873
|
-
*
|
|
1915
|
+
* Tokens read.
|
|
874
1916
|
*/
|
|
875
|
-
|
|
876
|
-
[key: string]: string;
|
|
877
|
-
};
|
|
1917
|
+
input_tokens: number;
|
|
878
1918
|
/**
|
|
879
|
-
*
|
|
1919
|
+
* The model it ran on, as provider:model.
|
|
880
1920
|
*/
|
|
881
|
-
model
|
|
1921
|
+
model: string;
|
|
882
1922
|
/**
|
|
883
|
-
*
|
|
1923
|
+
* Tokens written.
|
|
884
1924
|
*/
|
|
885
|
-
|
|
886
|
-
[key: string]: unknown;
|
|
887
|
-
};
|
|
1925
|
+
output_tokens: number;
|
|
888
1926
|
/**
|
|
889
|
-
* The
|
|
1927
|
+
* The run that started it; absent for the turn's own.
|
|
890
1928
|
*/
|
|
891
|
-
|
|
1929
|
+
parent_run_id?: string;
|
|
892
1930
|
/**
|
|
893
|
-
*
|
|
1931
|
+
* Its response: the turn's, or the subagent's (an agent part's response_id).
|
|
894
1932
|
*/
|
|
895
|
-
|
|
1933
|
+
response_id: string;
|
|
896
1934
|
/**
|
|
897
|
-
*
|
|
1935
|
+
* The run.
|
|
898
1936
|
*/
|
|
899
|
-
|
|
900
|
-
};
|
|
901
|
-
/**
|
|
902
|
-
* What a response used.
|
|
903
|
-
*/
|
|
904
|
-
export type ResponseUsage = {
|
|
1937
|
+
run_id: string;
|
|
905
1938
|
/**
|
|
906
|
-
*
|
|
1939
|
+
* Where it is: running, completed, failed…
|
|
907
1940
|
*/
|
|
908
|
-
|
|
1941
|
+
state: string;
|
|
909
1942
|
/**
|
|
910
|
-
*
|
|
1943
|
+
* The subagent it is; empty for the turn's own run.
|
|
911
1944
|
*/
|
|
912
|
-
|
|
913
|
-
};
|
|
914
|
-
/**
|
|
915
|
-
* A message a subagent was given.
|
|
916
|
-
*/
|
|
917
|
-
export type RunMessageAccepted = {
|
|
1945
|
+
subagent: string;
|
|
918
1946
|
/**
|
|
919
|
-
*
|
|
1947
|
+
* Some of its use had no rate: the cost is a floor.
|
|
920
1948
|
*/
|
|
921
|
-
|
|
1949
|
+
unpriced: boolean;
|
|
922
1950
|
/**
|
|
923
|
-
*
|
|
1951
|
+
* Its cost in dollars.
|
|
924
1952
|
*/
|
|
925
|
-
|
|
1953
|
+
usd: number;
|
|
926
1954
|
};
|
|
927
1955
|
/**
|
|
928
|
-
* A
|
|
1956
|
+
* A tool call of a turn as the engine committed it.
|
|
929
1957
|
*/
|
|
930
|
-
export type
|
|
1958
|
+
export type TurnToolCall = {
|
|
931
1959
|
/**
|
|
932
|
-
*
|
|
1960
|
+
* What the agent called it with, as JSON.
|
|
933
1961
|
*/
|
|
934
|
-
|
|
1962
|
+
arguments: unknown;
|
|
935
1963
|
/**
|
|
936
|
-
* The
|
|
1964
|
+
* The call.
|
|
937
1965
|
*/
|
|
938
|
-
|
|
939
|
-
};
|
|
940
|
-
/**
|
|
941
|
-
* What the project allows its chats.
|
|
942
|
-
*/
|
|
943
|
-
export type Settings = {
|
|
1966
|
+
call_id: string;
|
|
944
1967
|
/**
|
|
945
|
-
*
|
|
1968
|
+
* When it was made.
|
|
946
1969
|
*/
|
|
947
|
-
|
|
1970
|
+
created_at: string;
|
|
948
1971
|
/**
|
|
949
|
-
*
|
|
1972
|
+
* The tool.
|
|
950
1973
|
*/
|
|
951
|
-
|
|
1974
|
+
name: string;
|
|
952
1975
|
/**
|
|
953
|
-
*
|
|
1976
|
+
* What it returned, as the engine committed it: an app's, a backend's or an endpoint's answer as {output: [...], is_error}; a platform tool's own JSON. Absent: nothing yet.
|
|
954
1977
|
*/
|
|
955
|
-
|
|
1978
|
+
result?: unknown;
|
|
956
1979
|
/**
|
|
957
|
-
*
|
|
1980
|
+
* Where it is, as the engine says it.
|
|
958
1981
|
*/
|
|
959
|
-
|
|
1982
|
+
state: string;
|
|
1983
|
+
/**
|
|
1984
|
+
* When it last changed.
|
|
1985
|
+
*/
|
|
1986
|
+
updated_at: string;
|
|
960
1987
|
};
|
|
961
1988
|
/**
|
|
962
|
-
* A
|
|
1989
|
+
* A page of a turn's tool calls, in the order the engine committed them.
|
|
963
1990
|
*/
|
|
964
|
-
export type
|
|
965
|
-
/**
|
|
966
|
-
* Let the app's users talk to the project's agents themselves.
|
|
967
|
-
*/
|
|
968
|
-
clients?: boolean;
|
|
1991
|
+
export type TurnToolCallPage = {
|
|
969
1992
|
/**
|
|
970
|
-
*
|
|
1993
|
+
* Pages on (cursor=); absent on the last page.
|
|
971
1994
|
*/
|
|
972
|
-
|
|
1995
|
+
next_cursor?: string;
|
|
973
1996
|
/**
|
|
974
|
-
*
|
|
1997
|
+
* The calls.
|
|
975
1998
|
*/
|
|
976
|
-
|
|
1999
|
+
tool_calls: TurnToolCall[];
|
|
977
2000
|
};
|
|
978
2001
|
/**
|
|
979
|
-
*
|
|
2002
|
+
* A page of uses.
|
|
980
2003
|
*/
|
|
981
|
-
export type
|
|
2004
|
+
export type UsagePage = {
|
|
982
2005
|
/**
|
|
983
|
-
*
|
|
2006
|
+
* The cursor of the next page; absent on the last.
|
|
984
2007
|
*/
|
|
985
|
-
|
|
2008
|
+
next_cursor?: string;
|
|
2009
|
+
/**
|
|
2010
|
+
* Uses, newest first.
|
|
2011
|
+
*/
|
|
2012
|
+
usage: Use[];
|
|
986
2013
|
};
|
|
987
2014
|
/**
|
|
988
|
-
*
|
|
2015
|
+
* One use of a model.
|
|
989
2016
|
*/
|
|
990
|
-
export type
|
|
2017
|
+
export type Use = {
|
|
991
2018
|
/**
|
|
992
|
-
*
|
|
2019
|
+
* Whose connection paid: platform, or project (the project's own key).
|
|
993
2020
|
*/
|
|
994
|
-
|
|
2021
|
+
connection_owner: "platform" | "project" | "";
|
|
995
2022
|
/**
|
|
996
|
-
*
|
|
2023
|
+
* What it cost at the provider's list price, in billionths of a dollar.
|
|
997
2024
|
*/
|
|
998
|
-
|
|
2025
|
+
cost_nano_usd: number;
|
|
999
2026
|
/**
|
|
1000
|
-
*
|
|
2027
|
+
* When.
|
|
1001
2028
|
*/
|
|
1002
|
-
|
|
2029
|
+
created_at: string;
|
|
1003
2030
|
/**
|
|
1004
|
-
*
|
|
2031
|
+
* The use's id.
|
|
1005
2032
|
*/
|
|
1006
|
-
|
|
2033
|
+
id: string;
|
|
1007
2034
|
/**
|
|
1008
|
-
*
|
|
2035
|
+
* Reference picture tokens.
|
|
1009
2036
|
*/
|
|
1010
|
-
|
|
2037
|
+
image_input_tokens: number;
|
|
1011
2038
|
/**
|
|
1012
|
-
*
|
|
2039
|
+
* Tokens read.
|
|
1013
2040
|
*/
|
|
1014
|
-
|
|
1015
|
-
};
|
|
1016
|
-
/**
|
|
1017
|
-
* A role a text model is chosen by.
|
|
1018
|
-
*/
|
|
1019
|
-
export type TextModel = {
|
|
2041
|
+
input_tokens: number;
|
|
1020
2042
|
/**
|
|
1021
|
-
*
|
|
2043
|
+
* Texts embedded, or pictures made.
|
|
1022
2044
|
*/
|
|
1023
|
-
|
|
2045
|
+
items: number;
|
|
1024
2046
|
/**
|
|
1025
|
-
*
|
|
2047
|
+
* text, embedding or image.
|
|
1026
2048
|
*/
|
|
1027
|
-
|
|
1028
|
-
};
|
|
1029
|
-
/**
|
|
1030
|
-
* A part of what a tool returned.
|
|
1031
|
-
*/
|
|
1032
|
-
export type ToolContent = {
|
|
2049
|
+
kind: "text" | "embedding" | "image";
|
|
1033
2050
|
/**
|
|
1034
|
-
*
|
|
2051
|
+
* What the use is labelled by: its response's caller's labels — a chat's turn's, its chat's, and the chat (chat). {} for none.
|
|
1035
2052
|
*/
|
|
1036
|
-
|
|
2053
|
+
metadata: {
|
|
2054
|
+
[key: string]: string;
|
|
2055
|
+
};
|
|
1037
2056
|
/**
|
|
1038
|
-
*
|
|
2057
|
+
* The model.
|
|
1039
2058
|
*/
|
|
1040
|
-
|
|
2059
|
+
model: string;
|
|
1041
2060
|
/**
|
|
1042
|
-
*
|
|
2061
|
+
* Tokens written.
|
|
1043
2062
|
*/
|
|
1044
|
-
|
|
2063
|
+
output_tokens: number;
|
|
1045
2064
|
/**
|
|
1046
|
-
* text
|
|
2065
|
+
* The response, for a text use.
|
|
1047
2066
|
*/
|
|
1048
|
-
|
|
2067
|
+
response_id: string | null;
|
|
1049
2068
|
};
|
|
1050
2069
|
/**
|
|
1051
|
-
*
|
|
2070
|
+
* Text for the voice.
|
|
1052
2071
|
*/
|
|
1053
|
-
export type
|
|
2072
|
+
export type VoiceCommand = {
|
|
1054
2073
|
/**
|
|
1055
|
-
* The
|
|
2074
|
+
* The voice's member the server tells it as (the server's alone).
|
|
1056
2075
|
*/
|
|
1057
|
-
|
|
2076
|
+
as?: string;
|
|
1058
2077
|
/**
|
|
1059
|
-
*
|
|
2078
|
+
* The delegated voice part this answers (speak).
|
|
1060
2079
|
*/
|
|
1061
|
-
|
|
1062
|
-
};
|
|
1063
|
-
/**
|
|
1064
|
-
* An app's answer the turn was given.
|
|
1065
|
-
*/
|
|
1066
|
-
export type ToolOutputAccepted = {
|
|
2080
|
+
delegation_id?: string;
|
|
1067
2081
|
/**
|
|
1068
|
-
*
|
|
2082
|
+
* speak only: cut what the voice is saying and say the text at once.
|
|
1069
2083
|
*/
|
|
1070
|
-
|
|
2084
|
+
interrupt?: boolean;
|
|
2085
|
+
/**
|
|
2086
|
+
* What it is given (16 KiB at most).
|
|
2087
|
+
*/
|
|
2088
|
+
text: string;
|
|
2089
|
+
/**
|
|
2090
|
+
* speak (say this exactly and nothing else, once what the voice is saying ends; speaks in the order they came), tell (say it in your own words), know (keep it in mind) or instruct (behave so).
|
|
2091
|
+
*/
|
|
2092
|
+
type: "speak" | "tell" | "know" | "instruct";
|
|
1071
2093
|
};
|
|
1072
2094
|
/**
|
|
1073
|
-
*
|
|
2095
|
+
* What a person asked for out loud of a voice of delegation events: for the project's backend to have done, and answer with the voice's speak, naming the delegation.
|
|
1074
2096
|
*/
|
|
1075
|
-
export type
|
|
2097
|
+
export type VoiceDelegatedEvent = {
|
|
1076
2098
|
/**
|
|
1077
|
-
*
|
|
2099
|
+
* The chat.
|
|
1078
2100
|
*/
|
|
1079
|
-
|
|
2101
|
+
chat_id: string;
|
|
1080
2102
|
/**
|
|
1081
|
-
*
|
|
2103
|
+
* The request: a speak naming it answers it.
|
|
1082
2104
|
*/
|
|
1083
|
-
|
|
2105
|
+
delegation_id: string;
|
|
1084
2106
|
/**
|
|
1085
|
-
*
|
|
2107
|
+
* What was said before it that the voice answered itself, in order.
|
|
1086
2108
|
*/
|
|
1087
|
-
|
|
2109
|
+
earlier: VoiceLine[];
|
|
1088
2110
|
/**
|
|
1089
|
-
* The
|
|
2111
|
+
* The chat's labels.
|
|
1090
2112
|
*/
|
|
1091
|
-
|
|
2113
|
+
metadata: {
|
|
2114
|
+
[key: string]: string;
|
|
2115
|
+
};
|
|
1092
2116
|
/**
|
|
1093
|
-
*
|
|
2117
|
+
* What they asked, as the voice heard it.
|
|
1094
2118
|
*/
|
|
1095
|
-
|
|
2119
|
+
text: string;
|
|
1096
2120
|
/**
|
|
1097
|
-
*
|
|
2121
|
+
* The voice's member (null: the server's own).
|
|
1098
2122
|
*/
|
|
1099
|
-
|
|
1100
|
-
[key: string]: unknown;
|
|
1101
|
-
};
|
|
2123
|
+
user_id: string | null;
|
|
1102
2124
|
/**
|
|
1103
|
-
*
|
|
2125
|
+
* The voice.
|
|
1104
2126
|
*/
|
|
1105
|
-
|
|
2127
|
+
voice_id: string;
|
|
1106
2128
|
};
|
|
1107
2129
|
/**
|
|
1108
|
-
*
|
|
2130
|
+
* A chat's voice began, or ended.
|
|
1109
2131
|
*/
|
|
1110
|
-
export type
|
|
2132
|
+
export type VoiceEvent = {
|
|
1111
2133
|
/**
|
|
1112
|
-
*
|
|
2134
|
+
* The chat.
|
|
1113
2135
|
*/
|
|
1114
|
-
|
|
2136
|
+
chat_id: string;
|
|
1115
2137
|
/**
|
|
1116
|
-
*
|
|
2138
|
+
* Why it ended (empty while live).
|
|
1117
2139
|
*/
|
|
1118
|
-
|
|
2140
|
+
close_reason: string;
|
|
1119
2141
|
/**
|
|
1120
|
-
*
|
|
2142
|
+
* chat or events.
|
|
1121
2143
|
*/
|
|
1122
|
-
|
|
2144
|
+
delegation: string;
|
|
1123
2145
|
/**
|
|
1124
|
-
*
|
|
2146
|
+
* The chat's labels.
|
|
1125
2147
|
*/
|
|
1126
|
-
|
|
2148
|
+
metadata: {
|
|
2149
|
+
[key: string]: string;
|
|
2150
|
+
};
|
|
1127
2151
|
/**
|
|
1128
|
-
*
|
|
2152
|
+
* How long it lasted.
|
|
1129
2153
|
*/
|
|
1130
|
-
|
|
2154
|
+
seconds: number;
|
|
1131
2155
|
/**
|
|
1132
|
-
*
|
|
2156
|
+
* active, or closed.
|
|
1133
2157
|
*/
|
|
1134
|
-
|
|
2158
|
+
status: string;
|
|
2159
|
+
/**
|
|
2160
|
+
* Its member (null: the server's own).
|
|
2161
|
+
*/
|
|
2162
|
+
user_id: string | null;
|
|
2163
|
+
/**
|
|
2164
|
+
* The voice.
|
|
2165
|
+
*/
|
|
2166
|
+
voice_id: string;
|
|
1135
2167
|
};
|
|
1136
2168
|
/**
|
|
1137
|
-
* A
|
|
2169
|
+
* A line said in a voice conversation: the person's (user) or the voice's (assistant).
|
|
1138
2170
|
*/
|
|
1139
|
-
export type
|
|
1140
|
-
|
|
2171
|
+
export type VoiceLine = {
|
|
2172
|
+
/**
|
|
2173
|
+
* user or assistant.
|
|
2174
|
+
*/
|
|
2175
|
+
role: string;
|
|
2176
|
+
/**
|
|
2177
|
+
* The line.
|
|
2178
|
+
*/
|
|
2179
|
+
text: string;
|
|
1141
2180
|
};
|
|
1142
2181
|
/**
|
|
1143
|
-
*
|
|
2182
|
+
* Starts the chat's live voice.
|
|
1144
2183
|
*/
|
|
1145
|
-
export type
|
|
2184
|
+
export type VoiceRequest = {
|
|
1146
2185
|
/**
|
|
1147
|
-
*
|
|
2186
|
+
* The member the server starts it for (the server's alone): the voice is theirs, and counts toward their starts.
|
|
1148
2187
|
*/
|
|
1149
|
-
|
|
2188
|
+
as?: string;
|
|
2189
|
+
/**
|
|
2190
|
+
* What becomes of what the person asks for out loud: chat (the default) — a message of the voice's member to the chat's agent, a turn of the chat, whose answer the voice says back; events — the event ai.voice.delegated, for the project's backend to have done and answer with speak (its delegation_id).
|
|
2191
|
+
*/
|
|
2192
|
+
delegation?: "chat" | "events";
|
|
2193
|
+
/**
|
|
2194
|
+
* The app's WebRTC offer (an SDP).
|
|
2195
|
+
*/
|
|
2196
|
+
sdp: string;
|
|
2197
|
+
/**
|
|
2198
|
+
* The voice (the provider's default unless said).
|
|
2199
|
+
*/
|
|
2200
|
+
voice?: string;
|
|
1150
2201
|
};
|
|
1151
2202
|
/**
|
|
1152
|
-
*
|
|
2203
|
+
* A chat's voice.
|
|
1153
2204
|
*/
|
|
1154
|
-
export type
|
|
2205
|
+
export type VoiceSession = {
|
|
1155
2206
|
/**
|
|
1156
2207
|
* The chat.
|
|
1157
2208
|
*/
|
|
1158
2209
|
chat_id: string;
|
|
1159
2210
|
/**
|
|
1160
|
-
*
|
|
2211
|
+
* Why it ended: close_requested, member_removed, chat_deleted, replaced (its member started another), lost (the engine no longer holds it), or the provider's word.
|
|
1161
2212
|
*/
|
|
1162
|
-
|
|
2213
|
+
close_reason?: string;
|
|
1163
2214
|
/**
|
|
1164
|
-
*
|
|
2215
|
+
* When it ended (null: live).
|
|
1165
2216
|
*/
|
|
1166
|
-
|
|
2217
|
+
closed_at: string | null;
|
|
1167
2218
|
/**
|
|
1168
|
-
*
|
|
2219
|
+
* chat or events: what becomes of what the person asks for.
|
|
1169
2220
|
*/
|
|
1170
|
-
|
|
2221
|
+
delegation: string;
|
|
1171
2222
|
/**
|
|
1172
|
-
*
|
|
2223
|
+
* The voice session.
|
|
1173
2224
|
*/
|
|
1174
|
-
|
|
2225
|
+
id: string;
|
|
1175
2226
|
/**
|
|
1176
|
-
* The
|
|
2227
|
+
* The provider's WebRTC answer, for the app's peer connection (on start).
|
|
1177
2228
|
*/
|
|
1178
|
-
|
|
2229
|
+
sdp?: string;
|
|
1179
2230
|
/**
|
|
1180
|
-
*
|
|
2231
|
+
* How long it has lasted.
|
|
1181
2232
|
*/
|
|
1182
|
-
|
|
2233
|
+
seconds: number;
|
|
2234
|
+
/**
|
|
2235
|
+
* When it began.
|
|
2236
|
+
*/
|
|
2237
|
+
started_at: string;
|
|
2238
|
+
/**
|
|
2239
|
+
* active, or closed.
|
|
2240
|
+
*/
|
|
2241
|
+
status: string;
|
|
2242
|
+
/**
|
|
2243
|
+
* The member it is (null: the server's own).
|
|
2244
|
+
*/
|
|
2245
|
+
user_id: string | null;
|
|
1183
2246
|
};
|
|
1184
2247
|
/**
|
|
1185
|
-
* A
|
|
2248
|
+
* A file a published tree changed against the tree it replaced.
|
|
1186
2249
|
*/
|
|
1187
|
-
export type
|
|
2250
|
+
export type WorkspaceChange = {
|
|
1188
2251
|
/**
|
|
1189
|
-
*
|
|
2252
|
+
* added, modified (its bytes or its mode) or removed.
|
|
1190
2253
|
*/
|
|
1191
|
-
|
|
2254
|
+
change: string;
|
|
1192
2255
|
/**
|
|
1193
|
-
*
|
|
2256
|
+
* The file, as the tree names it (repo/output/app/App.zip).
|
|
1194
2257
|
*/
|
|
1195
|
-
|
|
2258
|
+
path: string;
|
|
2259
|
+
/**
|
|
2260
|
+
* Its size in the tree; 0 for one removed.
|
|
2261
|
+
*/
|
|
2262
|
+
size_bytes: number;
|
|
1196
2263
|
};
|
|
1197
2264
|
/**
|
|
1198
|
-
*
|
|
2265
|
+
* A tree the chat's workspace published: its machine publishes whenever the files are quiet for a moment — mid-turn, as a build writes its product — and once more as it lets the workspace go.
|
|
1199
2266
|
*/
|
|
1200
|
-
export type
|
|
2267
|
+
export type WorkspacePublishedEvent = {
|
|
1201
2268
|
/**
|
|
1202
|
-
*
|
|
2269
|
+
* What changed against the tree it replaced, sorted by path: 1000 at most (changed_truncated).
|
|
1203
2270
|
*/
|
|
1204
|
-
|
|
2271
|
+
changed: WorkspaceChange[];
|
|
1205
2272
|
/**
|
|
1206
|
-
*
|
|
2273
|
+
* How many files changed.
|
|
1207
2274
|
*/
|
|
1208
|
-
|
|
2275
|
+
changed_count: number;
|
|
1209
2276
|
/**
|
|
1210
|
-
*
|
|
2277
|
+
* More changed than changed names.
|
|
1211
2278
|
*/
|
|
1212
|
-
|
|
2279
|
+
changed_truncated: boolean;
|
|
1213
2280
|
/**
|
|
1214
|
-
* The
|
|
2281
|
+
* The chat.
|
|
1215
2282
|
*/
|
|
1216
|
-
|
|
2283
|
+
chat_id: string;
|
|
1217
2284
|
/**
|
|
1218
|
-
*
|
|
2285
|
+
* The tree: a file of it is read by it (GET /ai/chats/{chat_id}/workspace/files?manifest=), whatever the workspace published after it.
|
|
1219
2286
|
*/
|
|
1220
|
-
|
|
2287
|
+
manifest_id: string;
|
|
1221
2288
|
/**
|
|
1222
|
-
*
|
|
2289
|
+
* The chat's labels.
|
|
1223
2290
|
*/
|
|
1224
|
-
|
|
2291
|
+
metadata: {
|
|
2292
|
+
[key: string]: string;
|
|
2293
|
+
};
|
|
1225
2294
|
/**
|
|
1226
|
-
*
|
|
2295
|
+
* The tree it replaced; absent for none.
|
|
1227
2296
|
*/
|
|
1228
|
-
|
|
2297
|
+
previous_manifest_id?: string;
|
|
2298
|
+
};
|
|
2299
|
+
/**
|
|
2300
|
+
* A push the chat's agent made: to the chat's branch, the only one a turn's work is pushed to.
|
|
2301
|
+
*/
|
|
2302
|
+
export type WorkspacePushedEvent = {
|
|
1229
2303
|
/**
|
|
1230
|
-
*
|
|
2304
|
+
* The branch it was pushed to.
|
|
1231
2305
|
*/
|
|
1232
|
-
|
|
2306
|
+
branch: string;
|
|
1233
2307
|
/**
|
|
1234
|
-
* The
|
|
2308
|
+
* The chat.
|
|
1235
2309
|
*/
|
|
1236
|
-
|
|
2310
|
+
chat_id: string;
|
|
1237
2311
|
/**
|
|
1238
|
-
*
|
|
2312
|
+
* What the push brought to the branch, the oldest first: 100 at most (commits_truncated); none when the branch was there already.
|
|
1239
2313
|
*/
|
|
1240
|
-
|
|
2314
|
+
commits: PushedCommit[];
|
|
1241
2315
|
/**
|
|
1242
|
-
*
|
|
2316
|
+
* It brought more than commits names.
|
|
1243
2317
|
*/
|
|
1244
|
-
|
|
1245
|
-
};
|
|
1246
|
-
/**
|
|
1247
|
-
* Text for the voice.
|
|
1248
|
-
*/
|
|
1249
|
-
export type VoiceCommand = {
|
|
2318
|
+
commits_truncated: boolean;
|
|
1250
2319
|
/**
|
|
1251
|
-
* The
|
|
2320
|
+
* The commit the branch is at now.
|
|
1252
2321
|
*/
|
|
1253
|
-
|
|
2322
|
+
head_sha: string;
|
|
1254
2323
|
/**
|
|
1255
|
-
*
|
|
2324
|
+
* The chat's labels.
|
|
1256
2325
|
*/
|
|
1257
|
-
|
|
2326
|
+
metadata: {
|
|
2327
|
+
[key: string]: string;
|
|
2328
|
+
};
|
|
2329
|
+
/**
|
|
2330
|
+
* The project's name of the repository (PUT /ai/repos/{name}).
|
|
2331
|
+
*/
|
|
2332
|
+
repo: string;
|
|
2333
|
+
/**
|
|
2334
|
+
* The GitHub repository, owner/name.
|
|
2335
|
+
*/
|
|
2336
|
+
repository: string;
|
|
2337
|
+
/**
|
|
2338
|
+
* The turn — or a subagent's work in it — that pushed.
|
|
2339
|
+
*/
|
|
2340
|
+
response_id: string;
|
|
1258
2341
|
/**
|
|
1259
|
-
*
|
|
2342
|
+
* The member the turn was for; null: the server's.
|
|
1260
2343
|
*/
|
|
1261
|
-
|
|
2344
|
+
user_id: string | null;
|
|
1262
2345
|
};
|
|
1263
2346
|
/**
|
|
1264
|
-
*
|
|
2347
|
+
* A repository put in an open chat's workspace.
|
|
1265
2348
|
*/
|
|
1266
|
-
export type
|
|
2349
|
+
export type WorkspaceRepoRequest = {
|
|
1267
2350
|
/**
|
|
1268
|
-
* The
|
|
2351
|
+
* The branch it is checked out at and pushed to (the repository's default unless said).
|
|
1269
2352
|
*/
|
|
1270
|
-
|
|
2353
|
+
branch?: string;
|
|
1271
2354
|
/**
|
|
1272
|
-
* The
|
|
2355
|
+
* The project's name for the repository (PUT /ai/repos/{name}): one put at work's moment too.
|
|
1273
2356
|
*/
|
|
1274
|
-
|
|
2357
|
+
repo: string;
|
|
1275
2358
|
};
|
|
1276
|
-
/**
|
|
1277
|
-
|
|
1278
|
-
*/
|
|
1279
|
-
export type VoiceSession = {
|
|
2359
|
+
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
2360
|
+
export interface Events {
|
|
1280
2361
|
/**
|
|
1281
|
-
*
|
|
2362
|
+
* ai.goal.updated: a chat's goal was set, its status changed (paused, resumed, blocked, out of budget or turns, achieved), or it was cleared.
|
|
1282
2363
|
*/
|
|
1283
|
-
|
|
2364
|
+
"ai.goal.updated": GoalEvent;
|
|
1284
2365
|
/**
|
|
1285
|
-
*
|
|
2366
|
+
* ai.response.completed: a response started with background: true completed — read its answer by its id — or a chat's turn completed.
|
|
1286
2367
|
*/
|
|
1287
|
-
|
|
2368
|
+
"ai.response.completed": ResponseEvent;
|
|
1288
2369
|
/**
|
|
1289
|
-
*
|
|
2370
|
+
* ai.response.failed: a response started with background: true ended without completing (failed, canceled, timed out, over its budget), or a chat's turn did (failed, stopped, budget_exceeded).
|
|
1290
2371
|
*/
|
|
1291
|
-
|
|
2372
|
+
"ai.response.failed": ResponseEvent;
|
|
1292
2373
|
/**
|
|
1293
|
-
*
|
|
2374
|
+
* ai.response.started: a chat's turn began — a member's message, the server's, the chat's goal, or the late messages of the turn before opened it.
|
|
1294
2375
|
*/
|
|
1295
|
-
|
|
2376
|
+
"ai.response.started": ResponseEvent;
|
|
1296
2377
|
/**
|
|
1297
|
-
*
|
|
2378
|
+
* ai.voice.closed: a chat's voice ended — closed, replaced, its member taken out, its chat deleted, lost — with how long it lasted.
|
|
1298
2379
|
*/
|
|
1299
|
-
|
|
1300
|
-
};
|
|
1301
|
-
/** The events this module sends the project's webhooks (x-palbase-events), by type: each one's payload, the event's data. */
|
|
1302
|
-
export interface Events {
|
|
2380
|
+
"ai.voice.closed": VoiceEvent;
|
|
1303
2381
|
/**
|
|
1304
|
-
* ai.
|
|
2382
|
+
* ai.voice.delegated: a person asked a voice of delegation events for something out loud; the backend answers with the voice's speak, naming the delegation.
|
|
1305
2383
|
*/
|
|
1306
|
-
"ai.
|
|
2384
|
+
"ai.voice.delegated": VoiceDelegatedEvent;
|
|
1307
2385
|
/**
|
|
1308
|
-
* ai.
|
|
2386
|
+
* ai.voice.started: a chat's voice began.
|
|
1309
2387
|
*/
|
|
1310
|
-
"ai.
|
|
2388
|
+
"ai.voice.started": VoiceEvent;
|
|
2389
|
+
/**
|
|
2390
|
+
* ai.workspace.published: a chat's workspace published a tree — what its files are now, with the files it changed; read one of them by the tree (GET /ai/chats/{chat_id}/workspace/files?manifest=).
|
|
2391
|
+
*/
|
|
2392
|
+
"ai.workspace.published": WorkspacePublishedEvent;
|
|
2393
|
+
/**
|
|
2394
|
+
* ai.workspace.pushed: a chat's agent pushed its work to the chat's branch, with the commits it brought.
|
|
2395
|
+
*/
|
|
2396
|
+
"ai.workspace.pushed": WorkspacePushedEvent;
|
|
1311
2397
|
}
|
|
1312
2398
|
/** Palbase ai */
|
|
1313
2399
|
export declare function client(t: Transport): {
|
|
@@ -1322,7 +2408,7 @@ export declare function client(t: Transport): {
|
|
|
1322
2408
|
/**
|
|
1323
2409
|
* Name an agent
|
|
1324
2410
|
*
|
|
1325
|
-
* An agent a chat
|
|
2411
|
+
* An agent a chat the server starts by its name talks to: its definition, or the backend machine that defines it at each turn.
|
|
1326
2412
|
*/
|
|
1327
2413
|
putAgent(input: {
|
|
1328
2414
|
path: {
|
|
@@ -1345,18 +2431,21 @@ export declare function client(t: Transport): {
|
|
|
1345
2431
|
/**
|
|
1346
2432
|
* The chats
|
|
1347
2433
|
*
|
|
1348
|
-
* The server's: every chat, or a member's (member=); a user's: the chats they are in. The newest first,
|
|
2434
|
+
* The server's: every chat, or a member's (member=); a user's: the chats they are in. The newest first, a page at a time (limit, cursor), and only those labelled so when metadata= names labels.
|
|
1349
2435
|
*/
|
|
1350
2436
|
listChats(input?: {
|
|
1351
2437
|
query?: {
|
|
1352
|
-
member?: string;
|
|
2438
|
+
member?: string; /** How many (1 to 100, default 100). */
|
|
2439
|
+
limit?: number; /** next_cursor of the page before. */
|
|
2440
|
+
cursor?: string; /** A label the chats have, key:value (its metadata); given again, every label named: metadata=project_id:p_123. */
|
|
2441
|
+
metadata?: string[];
|
|
1353
2442
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1354
2443
|
signal?: AbortSignal;
|
|
1355
2444
|
}): Promise<Reply<200, ChatList>>;
|
|
1356
2445
|
/**
|
|
1357
2446
|
* Start a chat
|
|
1358
2447
|
*
|
|
1359
|
-
* The server starts a chat with a named agent or a definition of its own, and names its members
|
|
2448
|
+
* The project's server's alone: its backend, with the secret key, starts a chat with a named agent or a definition of its own, and names its members. A signed-in user is answered 403 server_only, whatever the project lets them (settings.clients is what they do in the chats they are in).
|
|
1360
2449
|
*/
|
|
1361
2450
|
createChat(input: {
|
|
1362
2451
|
body: ChatRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
@@ -1387,7 +2476,7 @@ export declare function client(t: Transport): {
|
|
|
1387
2476
|
/**
|
|
1388
2477
|
* Decide a tool call
|
|
1389
2478
|
*
|
|
1390
|
-
* A tool call that waits for a person's yes: approved it is made; denied, the agent is told, with the reason, and goes on.
|
|
2479
|
+
* A tool call that waits for a person's yes: approved it is made; denied, the agent is told, with the reason, and goes on. Decided by the member whose message began the turn (403 not_your_turn for any other) — or by the project's server, for any turn, or as that member (as).
|
|
1391
2480
|
*/
|
|
1392
2481
|
decideChatApproval(input: {
|
|
1393
2482
|
path: {
|
|
@@ -1397,10 +2486,74 @@ export declare function client(t: Transport): {
|
|
|
1397
2486
|
body: DecisionRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1398
2487
|
signal?: AbortSignal;
|
|
1399
2488
|
}): Promise<Reply<200, Decision>>;
|
|
2489
|
+
/**
|
|
2490
|
+
* Fork a chat before a message
|
|
2491
|
+
*
|
|
2492
|
+
* Forks the chat before one of its messages — what a person's "edit this message" makes: a new chat that begins where this one was, without that message and what came after it, for the edited message to be sent into. The project's server's alone, as starting a chat is. The fork talks to the same agent, carries the chat's labels and — unless members says otherwise — its members. What it begins with is the chat's messages and its agent's answers before that message, in the journal's order — its subagents' work left out, a member's message with the context the model read with it: the engine is given them with the fork's first turn, and its pipe writes them first (history parts). A fork of a chat that works in a workspace works in the same one, the files as they are now, on a session of its own; the workspace goes once no chat that works in it is left. A chat whose agent is at work is not forked (409 turn_running); a message that is not one of the chat's, or that its agent was not given, is 400; what came before past 512 KiB is 409 fork_too_large; past the history the project keeps, 409 history_full.
|
|
2493
|
+
*/
|
|
2494
|
+
forkChat(input: {
|
|
2495
|
+
path: {
|
|
2496
|
+
chat_id: string;
|
|
2497
|
+
};
|
|
2498
|
+
body: ForkRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2499
|
+
signal?: AbortSignal;
|
|
2500
|
+
}): Promise<Reply<201, Chat>>;
|
|
2501
|
+
/**
|
|
2502
|
+
* Read the chat's goal
|
|
2503
|
+
*
|
|
2504
|
+
* The chat's goal: its status, why it stopped, what its next turn is (phase), its limits and what it has used so far. The project's server's.
|
|
2505
|
+
*/
|
|
2506
|
+
getChatGoal(input: {
|
|
2507
|
+
path: {
|
|
2508
|
+
chat_id: string;
|
|
2509
|
+
};
|
|
2510
|
+
query?: {
|
|
2511
|
+
as?: string;
|
|
2512
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2513
|
+
signal?: AbortSignal;
|
|
2514
|
+
}): Promise<Reply<200, Goal>>;
|
|
2515
|
+
/**
|
|
2516
|
+
* Set the chat's goal
|
|
2517
|
+
*
|
|
2518
|
+
* Sets the chat's goal — replacing any it had: the engine works the chat toward the objective by itself, a turn at a time — each turn the chat's agent as it is defined now (a backend's agent is asked, told of the goal), judged when it ends, a claimed completion checked against the rubric — until it is met, or max_turns, the budget or a brake (turns that fail, that do nothing) stops it; its first turn opens at once when no turn of the chat is at work. The project's server's alone — as itself, or as a member (as: the goal is then theirs, as their message's turn is: they decide and answer its turns' approvals and app tools, and change and clear it — while they stand where they stood when it was set: in the chat, and, its agent defined for them alone, the chat theirs alone; taken out, or the chat given another member, the goal is paused with a reason saying why and its turn at work stopped). Each of its turns is the chat's: in its stream (a turn part that says the goal's, its role and number), billed, its tools served, stopped by a stop; a member's message goes before its next turn. Its status, each time it changes, is the event ai.goal.updated, and its words are goal parts of the chat's stream.
|
|
2519
|
+
*/
|
|
2520
|
+
setChatGoal(input: {
|
|
2521
|
+
path: {
|
|
2522
|
+
chat_id: string;
|
|
2523
|
+
};
|
|
2524
|
+
body: GoalRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2525
|
+
signal?: AbortSignal;
|
|
2526
|
+
}): Promise<Reply<200, Goal>>;
|
|
2527
|
+
/**
|
|
2528
|
+
* Clear the chat's goal
|
|
2529
|
+
*
|
|
2530
|
+
* Clears the chat's goal: no turn of it opens again, and one at work finishes as an ordinary turn. As the server, or as the member it was set as (as); the event ai.goal.updated says it cleared.
|
|
2531
|
+
*/
|
|
2532
|
+
clearChatGoal(input: {
|
|
2533
|
+
path: {
|
|
2534
|
+
chat_id: string;
|
|
2535
|
+
};
|
|
2536
|
+
query?: {
|
|
2537
|
+
as?: string;
|
|
2538
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2539
|
+
signal?: AbortSignal;
|
|
2540
|
+
}): Promise<Reply<204, undefined>>;
|
|
2541
|
+
/**
|
|
2542
|
+
* Change the chat's goal
|
|
2543
|
+
*
|
|
2544
|
+
* Pauses the goal (with a reason, said in its event) or resumes it — a resumed goal opens its next turn at once when no turn of the chat is at work — edits its objective or rubric, or changes a limit (null: none). As the server, or as the member it was set as (as); another member changes nothing of it (403 not_your_turn). An achieved goal is changed by setting a new one (409 goal_achieved); one set as a member who no longer stands where they stood when it was set — out of the chat, or the chat no longer theirs alone — is not resumed (409 goal_lapsed): it is cleared, or another set for the chat as it is now.
|
|
2545
|
+
*/
|
|
2546
|
+
updateChatGoal(input: {
|
|
2547
|
+
path: {
|
|
2548
|
+
chat_id: string;
|
|
2549
|
+
};
|
|
2550
|
+
body: GoalPatch; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2551
|
+
signal?: AbortSignal;
|
|
2552
|
+
}): Promise<Reply<200, Goal>>;
|
|
1400
2553
|
/**
|
|
1401
2554
|
* Put a user in a chat
|
|
1402
2555
|
*
|
|
1403
|
-
* Who is in a chat is the server's to say.
|
|
2556
|
+
* Who is in a chat is the server's to say. A goal set as the chat's one member, its agent defined for them alone, is paused when another is put in it.
|
|
1404
2557
|
*/
|
|
1405
2558
|
putChatMember(input: {
|
|
1406
2559
|
path: {
|
|
@@ -1413,7 +2566,7 @@ export declare function client(t: Transport): {
|
|
|
1413
2566
|
/**
|
|
1414
2567
|
* Take a user out of a chat
|
|
1415
2568
|
*
|
|
1416
|
-
* The server takes anyone out; a user takes themselves out.
|
|
2569
|
+
* The server takes anyone out; a user takes themselves out. A goal set as the member taken out is paused, and its turn at work stopped.
|
|
1417
2570
|
*/
|
|
1418
2571
|
deleteChatMember(input: {
|
|
1419
2572
|
path: {
|
|
@@ -1440,7 +2593,7 @@ export declare function client(t: Transport): {
|
|
|
1440
2593
|
/**
|
|
1441
2594
|
* Write to a chat
|
|
1442
2595
|
*
|
|
1443
|
-
* A message for the agent: a turn of its own when none runs; while one does, at its next step (next) or cutting the step it is in (now). The same client_id again is the same message. A user sends user_messages_per_minute a minute (429 too_many_messages); past the history the project keeps a message is refused (409 history_full).
|
|
2596
|
+
* A message for the agent: a turn of its own when none runs; while one does, at its next step (next) or cutting the step it is in (now). The same client_id again is the same message. A user sends user_messages_per_minute a minute — and so does the server writing as them (429 too_many_messages); past the history the project keeps a message is refused (409 history_full). It carries pictures of the project's storage the model is shown (images) and, in a chat that works in a workspace, files put in it before the agent reads the message (files), each copied for the chat.
|
|
1444
2597
|
*/
|
|
1445
2598
|
sendChatMessage(input: {
|
|
1446
2599
|
path: {
|
|
@@ -1449,10 +2602,62 @@ export declare function client(t: Transport): {
|
|
|
1449
2602
|
body: MessageRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1450
2603
|
signal?: AbortSignal;
|
|
1451
2604
|
}): Promise<Reply<200, ChatMessage> | Reply<202, ChatMessage>>;
|
|
2605
|
+
/**
|
|
2606
|
+
* A picture or a file a message carries
|
|
2607
|
+
*
|
|
2608
|
+
* The bytes of a picture or a file a message of the chat carries, as it was sent (a download by its name, never a page): to the chat's members and its server. A position the message has nothing at is not found (404 attachment_not_found).
|
|
2609
|
+
*/
|
|
2610
|
+
getChatMessageAttachment(input: {
|
|
2611
|
+
path: {
|
|
2612
|
+
chat_id: string; /** The message. */
|
|
2613
|
+
message_id: string; /** Its place among the message's attachments (its images, then its files), from 0. */
|
|
2614
|
+
position: number;
|
|
2615
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2616
|
+
signal?: AbortSignal;
|
|
2617
|
+
}): Promise<Reply<200, Response>>;
|
|
2618
|
+
/**
|
|
2619
|
+
* The chat's past
|
|
2620
|
+
*
|
|
2621
|
+
* The chat's past as its stream told it, a page at a time from its newest end back: the members' messages, the turns, the answers as text at their offsets, the tools and the subagents, the goal's and the voice's words — each page in the order it was told, each part under the id its channel told it (part_id), so an app holding the channel's parts and a page of these keeps each once. A page reads limit of the chat's events before the cursor, or before the oldest part the app holds of the chat's channel (before: that part's id), so the first page does not read again the day the channel told; with neither, from its newest end. Given both, the call is refused (400). The page that reaches the chat's start begins with where a fork began. A voice's end is under the id its channel told it (vclosed:<voice>); a voice the engine lost, its end said by no journal, has it right after its last part. Reading a page records nothing. A call's answer is by its end, as the stream shows it. Read by the chat's members and the project's server.
|
|
2622
|
+
*/
|
|
2623
|
+
listChatParts(input: {
|
|
2624
|
+
path: {
|
|
2625
|
+
chat_id: string;
|
|
2626
|
+
};
|
|
2627
|
+
query?: {
|
|
2628
|
+
limit?: number; /** A next_cursor: the page before it. Not with before. */
|
|
2629
|
+
cursor?: string; /** The id of the oldest part the app holds of the chat's channel (a part's id: its journal sequence): the first page is the parts told before it. Not with cursor. */
|
|
2630
|
+
before?: number;
|
|
2631
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2632
|
+
signal?: AbortSignal;
|
|
2633
|
+
}): Promise<Reply<200, ChatPartPage>>;
|
|
2634
|
+
/**
|
|
2635
|
+
* Pipe the chat into a channel
|
|
2636
|
+
*
|
|
2637
|
+
* Writes the chat's stream into a channel of the project's realtime from now on — a gateway's, durable — as the platform: the members' messages, the turns, the answer as it is written (gathered into a few writes a second), the tools and subagents, each the channel's event `chat` {type, id?, data}, under an id of its own so a retry is kept once. The types: `message` (a ChatMessage, as the agent got it), `turn` ({response_id, status: running|waiting|completed|failed|canceled|timed_out|budget_exceeded, user_id, solo, goal: {goal_id, role: work|verify, seq} — a turn of the chat's goal, waiting: {reason: approval|tool_output|subagents|message, text_offset, approval_id, tool_call_id, tool_name, input, publication}, end: completed|failed|stopped|budget_exceeded — as the turn's event says it, error: {code, message, retryable}}), `text` ({response_id, offset, text}: the agent's answer as it is written, at its byte offset), `reset` ({response_id, offset}: discard the answer past offset), `thinking` ({response_id, run_id, step_id, text}: the model's reasoning as it thinks, when the agent shows it — thinking: visible), `tool` ({response_id, run_id, call_id, name, status: running|awaiting_output|awaiting_approval|approved|denied|expired|completed|failed|canceled, text_offset, input, output, image_count, is_error, approval_id, agent_response_id, …}), `agent` ({run_id, response_id, parent_response_id, name, required, status, text_offset}: a subagent at work), `goal` ({goal_id, kind: set|updated|turn_started|judged|verified|status_changed|cleared, goal: {objective, rubric, status, stop_code, stop_reason, phase, max_turns, max_cost_usd}, role, seq, response_id, run_id, verdict, reason, missing, from, to, code}: the chat's goal's words), `voice` ({voice_id, user_id, delegation, status: started|closed, seconds, close_reason}: the chat's live voice began or ended), `transcript` ({id, voice_id, role: user|assistant, user_id, author_name, text, final, created_at}: a line it said either way — the chat's history's message of kind voice, by its id), `seen` (the journal moved past what was handed already), and — first, in a fork's channel — `history` ({forked_from: {chat_id, before_message}, part, parts, items: [{role: user|assistant, message_id, client_id, author, author_name, text, metadata, created_at, response_id, text_truncated, attachments}]}: what the fork began with, a few items a part, a long text cut in its part, its id h and the part's place). Every type but text and reset has the journal's sequence as its id; text_offset says where in the answer a tool or subagent part happened. The project's backend is not in the stream: the gateway's members hear the chat from realtime, and one that was away is given what it missed there. Put again with the same channel it goes on where it is — one realtime refused is tried again; with another, from the chat's start, and nothing more is written into the one before. The project's server's alone.
|
|
2638
|
+
*/
|
|
2639
|
+
putChatPipe(input: {
|
|
2640
|
+
path: {
|
|
2641
|
+
chat_id: string;
|
|
2642
|
+
};
|
|
2643
|
+
body: ChatPipe; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2644
|
+
signal?: AbortSignal;
|
|
2645
|
+
}): Promise<Reply<200, ChatPipeResult>>;
|
|
2646
|
+
/**
|
|
2647
|
+
* Take the chat's pipe away
|
|
2648
|
+
*
|
|
2649
|
+
* The chat's stream is written nowhere from now on. The project's server's alone.
|
|
2650
|
+
*/
|
|
2651
|
+
deleteChatPipe(input: {
|
|
2652
|
+
path: {
|
|
2653
|
+
chat_id: string;
|
|
2654
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2655
|
+
signal?: AbortSignal;
|
|
2656
|
+
}): Promise<Reply<204, undefined>>;
|
|
1452
2657
|
/**
|
|
1453
2658
|
* Write to a subagent at work
|
|
1454
2659
|
*
|
|
1455
|
-
* A message for one of the agent's subagents, at its next step.
|
|
2660
|
+
* A message for one of the agent's subagents, at its next step: a message of the chat like any other — its writer's (or the member's the server writes as) messages a minute (429 too_many_messages), the history the project keeps (409 history_full).
|
|
1456
2661
|
*/
|
|
1457
2662
|
sendSubagentMessage(input: {
|
|
1458
2663
|
path: {
|
|
@@ -1462,37 +2667,63 @@ export declare function client(t: Transport): {
|
|
|
1462
2667
|
body: RunMessageRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1463
2668
|
signal?: AbortSignal;
|
|
1464
2669
|
}): Promise<Reply<202, RunMessageAccepted>>;
|
|
2670
|
+
/**
|
|
2671
|
+
* Stop a subagent at work
|
|
2672
|
+
*
|
|
2673
|
+
* Stops one subagent at work — with the subagents it started and its background work: the agent that started it is told a person stopped it, and not to start that work again unless asked, and the rest of the turn goes on. Any member stops it, as any member stops the turn, and the server — as itself, or as a member (as: the server's alone; a user sending it is answered 400; one who is not a member of the chat, 403 not_a_member). Asked again, the same stop answers as it did. A run that is not a subagent at work in this chat — ended, the agent itself, another chat's — is 404.
|
|
2674
|
+
*/
|
|
2675
|
+
stopSubagent(input: {
|
|
2676
|
+
path: {
|
|
2677
|
+
chat_id: string; /** The subagent's run (an agent event's run_id). */
|
|
2678
|
+
run_id: string;
|
|
2679
|
+
};
|
|
2680
|
+
body?: RunStopRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2681
|
+
signal?: AbortSignal;
|
|
2682
|
+
}): Promise<Reply<200, RunStopped>>;
|
|
1465
2683
|
/**
|
|
1466
2684
|
* Stop the agent
|
|
1467
2685
|
*
|
|
1468
|
-
* Stops the turn it is working on: what it wrote stays; a message after starts the next turn.
|
|
2686
|
+
* Stops the turn it is working on: what it wrote stays; a message after starts the next turn. Any member's; the server's as itself, or as a member (as).
|
|
1469
2687
|
*/
|
|
1470
2688
|
stopChat(input: {
|
|
1471
2689
|
path: {
|
|
1472
2690
|
chat_id: string;
|
|
1473
|
-
};
|
|
2691
|
+
};
|
|
2692
|
+
body?: ChatStop; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1474
2693
|
signal?: AbortSignal;
|
|
1475
2694
|
}): Promise<Reply<200, StopResult>>;
|
|
1476
2695
|
/**
|
|
1477
|
-
*
|
|
2696
|
+
* A turn's tool calls
|
|
1478
2697
|
*
|
|
1479
|
-
*
|
|
2698
|
+
* A turn's tool calls as the engine committed them — their arguments and results as they were (what a diff of the files the turn wrote is made of), in their order, a page at a time. The project's server's alone; a subagent's work is read by its response (an agent part's response_id).
|
|
1480
2699
|
*/
|
|
1481
|
-
|
|
2700
|
+
listTurnToolCalls(input: {
|
|
1482
2701
|
path: {
|
|
1483
2702
|
chat_id: string;
|
|
1484
2703
|
};
|
|
1485
|
-
query
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
2704
|
+
query: {
|
|
2705
|
+
turn: string; /** How many calls a page holds (1 to 500; 100). */
|
|
2706
|
+
limit?: number; /** A next_cursor: the page after it. */
|
|
2707
|
+
cursor?: string;
|
|
1489
2708
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1490
2709
|
signal?: AbortSignal;
|
|
1491
|
-
}): Promise<Reply<200,
|
|
2710
|
+
}): Promise<Reply<200, TurnToolCallPage>>;
|
|
2711
|
+
/**
|
|
2712
|
+
* A tool call of the chat, whole
|
|
2713
|
+
*
|
|
2714
|
+
* One tool call of the chat, its whole answer: the chat's stream shows a call's answer by its end (its last 16 KiB, omitted_bytes what it left out) — read here whole, its secret shapes masked as the stream masks them. Read by the chat's members and the project's server; another chat's call is not found.
|
|
2715
|
+
*/
|
|
2716
|
+
getChatToolCall(input: {
|
|
2717
|
+
path: {
|
|
2718
|
+
chat_id: string; /** The call: a tool part's call_id. */
|
|
2719
|
+
call_id: string;
|
|
2720
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2721
|
+
signal?: AbortSignal;
|
|
2722
|
+
}): Promise<Reply<200, ChatToolCall>>;
|
|
1492
2723
|
/**
|
|
1493
2724
|
* Answer an app's tool call
|
|
1494
2725
|
*
|
|
1495
|
-
* The answer of a client tool's call, made by the app's code: the turn waiting for it goes on. The first answer is the one.
|
|
2726
|
+
* The answer of a client tool's call, made by the app's code: the turn waiting for it goes on. The first answer is the one. Given by the app of the member whose message began the turn (403 not_your_turn for any other) — or by the project's server, for any turn, or as that member (as). A call of the project's backend (or an HTTPS tool of its) that answered {"deferred": true} — its work outlasts a call — is answered here too, by the project's server as itself, within the while it named (a minute to a day; an hour), and by no member.
|
|
1496
2727
|
*/
|
|
1497
2728
|
answerChatToolCall(input: {
|
|
1498
2729
|
path: {
|
|
@@ -1542,7 +2773,7 @@ export declare function client(t: Transport): {
|
|
|
1542
2773
|
/**
|
|
1543
2774
|
* Start a chat's voice
|
|
1544
2775
|
*
|
|
1545
|
-
* Starts the chat's live voice: the app's WebRTC offer in, the answer out — the audio then goes between the app and the platform's voice provider.
|
|
2776
|
+
* Starts the chat's live voice: the app's WebRTC offer in, the answer out — the audio then goes between the app and the platform's voice provider. The voice is its member's — the user who starts it, or the member the server starts it for (as): they or the server read, tell and close it, no other member. What the person asks for out loud becomes, by delegation, a turn of the chat as that member whose answer the voice says back (chat, the default), or the event ai.voice.delegated (events). What is said either way is the chat's: transcript parts of its stream and lines of its history (messages of kind voice). One voice talks in a chat at a time: a member's new voice ends the one they left open (closed replaced); another member's live voice is refused (409 voice_active). A user starts at most 5 voices an hour in the project's chats, the server's for them counted as theirs (429 too_many_voices, with Retry-After) — each is the project's spend while it lasts. Its start is the event ai.voice.started.
|
|
1546
2777
|
*/
|
|
1547
2778
|
startChatVoice(input: {
|
|
1548
2779
|
path: {
|
|
@@ -1551,22 +2782,40 @@ export declare function client(t: Transport): {
|
|
|
1551
2782
|
body: VoiceRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1552
2783
|
signal?: AbortSignal;
|
|
1553
2784
|
}): Promise<Reply<201, VoiceSession>>;
|
|
2785
|
+
/**
|
|
2786
|
+
* Read a chat's voice
|
|
2787
|
+
*
|
|
2788
|
+
* The chat's voice: whose it is, whether it is live, how long it has lasted and why it ended — read from the engine while it is live. Its member's, or the server's (403 not_your_voice).
|
|
2789
|
+
*/
|
|
2790
|
+
getChatVoice(input: {
|
|
2791
|
+
path: {
|
|
2792
|
+
chat_id: string; /** The voice session. */
|
|
2793
|
+
voice_id: string;
|
|
2794
|
+
};
|
|
2795
|
+
query?: {
|
|
2796
|
+
as?: string;
|
|
2797
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2798
|
+
signal?: AbortSignal;
|
|
2799
|
+
}): Promise<Reply<200, VoiceSession>>;
|
|
1554
2800
|
/**
|
|
1555
2801
|
* Close a chat's voice
|
|
1556
2802
|
*
|
|
1557
|
-
* Ends the chat's voice; the answer says how long it lasted.
|
|
2803
|
+
* Ends the chat's voice; the answer says how long it lasted and why it ended. Its member's, or the server's (403 not_your_voice). Its end is the event ai.voice.closed — once.
|
|
1558
2804
|
*/
|
|
1559
2805
|
closeChatVoice(input: {
|
|
1560
2806
|
path: {
|
|
1561
2807
|
chat_id: string; /** The voice session. */
|
|
1562
2808
|
voice_id: string;
|
|
2809
|
+
};
|
|
2810
|
+
query?: {
|
|
2811
|
+
as?: string;
|
|
1563
2812
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1564
2813
|
signal?: AbortSignal;
|
|
1565
2814
|
}): Promise<Reply<200, VoiceSession>>;
|
|
1566
2815
|
/**
|
|
1567
2816
|
* Tell a chat's voice
|
|
1568
2817
|
*
|
|
1569
|
-
* The server's alone (a member is answered 403 server_only): a member's words would be the agent's own to every other member of the chat. Gives the chat's voice text: speak says it, know keeps it in mind, instruct changes how it behaves — speak with a delegation_id answers a
|
|
2818
|
+
* The server's alone (a member is answered 403 server_only), as itself or as the voice's member (as; another member 403 not_your_voice): a member's words would be the agent's own to every other member of the chat. Gives the chat's voice text: speak says it, know keeps it in mind, instruct changes how it behaves — speak with a delegation_id answers a request it handed over (ai.voice.delegated). A voice that has ended is 409 voice_closed.
|
|
1570
2819
|
*/
|
|
1571
2820
|
commandChatVoice(input: {
|
|
1572
2821
|
path: {
|
|
@@ -1576,6 +2825,33 @@ export declare function client(t: Transport): {
|
|
|
1576
2825
|
body: VoiceCommand; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1577
2826
|
signal?: AbortSignal;
|
|
1578
2827
|
}): Promise<Reply<202, VoiceSession>>;
|
|
2828
|
+
/**
|
|
2829
|
+
* A file of the chat's workspace
|
|
2830
|
+
*
|
|
2831
|
+
* A file of the chat's workspace, its bytes (an attachment, never a page): from the tree the workspace is at now, or from the one an ai.workspace.published event named (manifest) — a build's product as that publish left it. Read by the chat's members and the project's server, as they read the chat. Served up to 64 MiB (413 file_too_large past it: publish a larger one as the turn's artifact); its digest is Content-Digest. A project reads 4 files at once (429 too_many_reads, Retry-After), and a file is written for no longer than its bytes take at 256 KiB/s and a minute more. A chat that works in no workspace yet, a tree of another workspace, a path its tree does not name: 404 file_not_found.
|
|
2832
|
+
*/
|
|
2833
|
+
getChatWorkspaceFile(input: {
|
|
2834
|
+
path: {
|
|
2835
|
+
chat_id: string;
|
|
2836
|
+
};
|
|
2837
|
+
query: {
|
|
2838
|
+
path: string; /** The tree to read it from: an ai.workspace.published event's manifest_id (none: the tree the workspace is at now). */
|
|
2839
|
+
manifest?: string;
|
|
2840
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2841
|
+
signal?: AbortSignal;
|
|
2842
|
+
}): Promise<Reply<200, Response>>;
|
|
2843
|
+
/**
|
|
2844
|
+
* Put a repository in the chat's workspace
|
|
2845
|
+
*
|
|
2846
|
+
* Puts one more of the project's repositories in the chat's workspace, at a branch, under its name beside the others: the engine clones it and merges it into the workspace's tree before the chat's next turn takes a machine; a chat whose first turn has not opened its workspace has it from that turn. Every chat working in the workspace (a fork works in its chat's) has it. Put again, the same. The project's server's alone; a chat that works in no workspace is refused (409 no_workspace).
|
|
2847
|
+
*/
|
|
2848
|
+
addChatWorkspaceRepo(input: {
|
|
2849
|
+
path: {
|
|
2850
|
+
chat_id: string;
|
|
2851
|
+
};
|
|
2852
|
+
body: WorkspaceRepoRequest; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
2853
|
+
signal?: AbortSignal;
|
|
2854
|
+
}): Promise<Reply<200, Chat>>;
|
|
1579
2855
|
/**
|
|
1580
2856
|
* Turn texts into vectors
|
|
1581
2857
|
*
|
|
@@ -1596,7 +2872,7 @@ export declare function client(t: Transport): {
|
|
|
1596
2872
|
/**
|
|
1597
2873
|
* Put a tool endpoint
|
|
1598
2874
|
*
|
|
1599
|
-
* A tool at an HTTPS address of the project's — called with a signed POST {tool, call_id, input, context} and answered {output, is_error} or plain text — or an MCP server, whose tools an agent may use. The answer says an https tool's signing secret, once.
|
|
2875
|
+
* A tool at an HTTPS address of the project's — called with a signed POST {tool, call_id, input, context: {chat_id, agent, user, metadata, turn_id, run_id, subagent} — the turn, and the run that called: the agent's own, or a subagent's at work (subagent names which, null for the agent)} and answered {output, is_error} or plain text — or an MCP server, whose tools an agent may use. The answer says an https tool's signing secret, once.
|
|
1600
2876
|
*/
|
|
1601
2877
|
putEndpoint(input: {
|
|
1602
2878
|
path: {
|
|
@@ -1693,9 +2969,13 @@ export declare function client(t: Transport): {
|
|
|
1693
2969
|
/**
|
|
1694
2970
|
* The project's repositories
|
|
1695
2971
|
*
|
|
1696
|
-
* The repositories the project's chats work in.
|
|
2972
|
+
* The repositories the project's chats work in, by name, a page at a time (a project puts 10000 at most).
|
|
1697
2973
|
*/
|
|
1698
2974
|
listRepos(input?: {
|
|
2975
|
+
query?: {
|
|
2976
|
+
limit?: number; /** next_cursor of the page before. */
|
|
2977
|
+
cursor?: string;
|
|
2978
|
+
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1699
2979
|
signal?: AbortSignal;
|
|
1700
2980
|
}): Promise<Reply<200, RepoPage>>;
|
|
1701
2981
|
/**
|
|
@@ -1724,7 +3004,7 @@ export declare function client(t: Transport): {
|
|
|
1724
3004
|
/**
|
|
1725
3005
|
* Ask a model
|
|
1726
3006
|
*
|
|
1727
|
-
* Admits a response: an answer to the input, as text or — with a schema — as a JSON document of that shape, validated before it is returned. With stream: true the answer is the response's live view (text/event-stream). With background: true it answers at once and the response's end is the event ai.response.completed (or ai.response.failed). Otherwise it answers at once with the response queued; read it by its id.
|
|
3007
|
+
* Admits a response: an answer to the input, as text or — with a schema — as a JSON document of that shape, validated before it is returned. With stream: true the answer is the response's live view (text/event-stream). With background: true it answers at once and the response's end is the event ai.response.completed (or ai.response.failed). Otherwise it answers at once with the response queued; read it by its id. What the agent is given — its instructions, the conversation, the schema and the tools together — is at most 1 MiB as JSON, what the model service reads (413 request_too_large).
|
|
1728
3008
|
*/
|
|
1729
3009
|
createResponse(input: {
|
|
1730
3010
|
headers: {
|
|
@@ -1795,7 +3075,8 @@ export declare function client(t: Transport): {
|
|
|
1795
3075
|
query?: {
|
|
1796
3076
|
limit?: number; /** The next_cursor of the previous page. */
|
|
1797
3077
|
cursor?: string; /** Only uses of this kind: text, embedding or image. */
|
|
1798
|
-
kind?: "text" | "embedding" | "image";
|
|
3078
|
+
kind?: "text" | "embedding" | "image"; /** Labels each use listed carries, as a JSON object ({"product":"p1"}): a product's spend, a task's. */
|
|
3079
|
+
metadata?: string;
|
|
1799
3080
|
}; /** Stops the call: the request in flight, a wait before a retry, a proof-of-work being solved. */
|
|
1800
3081
|
signal?: AbortSignal;
|
|
1801
3082
|
}): Promise<Reply<200, UsagePage>>;
|