@parcha/agentrun-client 0.0.0-stage → 0.1.0-beta.32
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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +88 -2
- package/dist/client.d.ts +35 -0
- package/dist/client.js +262 -0
- package/dist/errors.d.ts +61 -0
- package/dist/errors.js +88 -0
- package/dist/http.d.ts +35 -0
- package/dist/http.js +40 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3 -0
- package/dist/live.d.ts +26 -0
- package/dist/live.js +236 -0
- package/dist/operations.generated.d.ts +3057 -0
- package/dist/operations.generated.js +323 -0
- package/dist/scrub.d.ts +7 -0
- package/dist/scrub.js +55 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.js +2 -0
- package/package.json +51 -4
|
@@ -0,0 +1,3057 @@
|
|
|
1
|
+
import type { BodyOptions, Call, DownloadOptions, Operation, RawBody, RequestOptions, Tagged } from "./types.js";
|
|
2
|
+
export type AgentCreate = {
|
|
3
|
+
definition: DefinitionInput;
|
|
4
|
+
skills?: SkillFiles;
|
|
5
|
+
note?: string;
|
|
6
|
+
};
|
|
7
|
+
export type DefinitionInput = {
|
|
8
|
+
id?: Id;
|
|
9
|
+
version?: number;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
instructions?: string;
|
|
13
|
+
skills?: Array<string>;
|
|
14
|
+
tools?: Array<string>;
|
|
15
|
+
input_schema?: JsonObject;
|
|
16
|
+
output_schema?: JsonObject;
|
|
17
|
+
workflow?: JsonObject;
|
|
18
|
+
max_cost_usd?: number;
|
|
19
|
+
model?: string;
|
|
20
|
+
thinking?: "low" | "medium" | "high" | "xhigh" | "max";
|
|
21
|
+
harness?: "pi" | "claude-agent" | "codex" | "opencode";
|
|
22
|
+
place?: {
|
|
23
|
+
mode: "runner";
|
|
24
|
+
} | {
|
|
25
|
+
mode: "sandbox";
|
|
26
|
+
box: "bwrap" | "docker" | "modal" | "daytona";
|
|
27
|
+
};
|
|
28
|
+
computer?: {
|
|
29
|
+
kind: "none" | "sandbox" | "desktop" | "phone" | "browser";
|
|
30
|
+
provider?: string;
|
|
31
|
+
};
|
|
32
|
+
tool_settings?: {
|
|
33
|
+
read?: {
|
|
34
|
+
permission?: "allow" | "ask" | "deny";
|
|
35
|
+
};
|
|
36
|
+
write?: {
|
|
37
|
+
permission?: "allow" | "ask" | "deny";
|
|
38
|
+
};
|
|
39
|
+
edit?: {
|
|
40
|
+
permission?: "allow" | "ask" | "deny";
|
|
41
|
+
};
|
|
42
|
+
bash?: {
|
|
43
|
+
permission?: "allow" | "ask" | "deny";
|
|
44
|
+
};
|
|
45
|
+
ask_person?: {
|
|
46
|
+
permission?: "allow" | "deny";
|
|
47
|
+
};
|
|
48
|
+
web_fetch?: {
|
|
49
|
+
provider?: "kernel" | "parallel";
|
|
50
|
+
permission?: "allow" | "ask" | "deny";
|
|
51
|
+
};
|
|
52
|
+
web_search?: {
|
|
53
|
+
provider?: "auto" | "native" | "exa-keyless" | "parallel" | "off";
|
|
54
|
+
permission?: "allow" | "ask" | "deny";
|
|
55
|
+
};
|
|
56
|
+
browser?: {
|
|
57
|
+
provider?: "auto" | "browserbase" | "kernel" | "chrome";
|
|
58
|
+
permission?: "allow" | "deny";
|
|
59
|
+
};
|
|
60
|
+
pdf_pages?: {
|
|
61
|
+
permission?: "allow" | "deny";
|
|
62
|
+
};
|
|
63
|
+
llm?: {
|
|
64
|
+
permission?: "allow" | "deny";
|
|
65
|
+
};
|
|
66
|
+
desktop?: {
|
|
67
|
+
permission?: "allow" | "deny";
|
|
68
|
+
};
|
|
69
|
+
phone?: {
|
|
70
|
+
permission?: "allow" | "deny";
|
|
71
|
+
};
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
};
|
|
74
|
+
approvals?: "ask" | "never";
|
|
75
|
+
learning?: boolean;
|
|
76
|
+
cap_mode?: "expected" | "strict";
|
|
77
|
+
};
|
|
78
|
+
export type Id = string;
|
|
79
|
+
export type JsonObject = Record<string, unknown>;
|
|
80
|
+
export type SkillFiles = Record<string, string>;
|
|
81
|
+
export type Agent = {
|
|
82
|
+
agent_id: Id;
|
|
83
|
+
definition: Definition;
|
|
84
|
+
source: Source | null;
|
|
85
|
+
skills: Array<SkillFileInfo>;
|
|
86
|
+
sign_ins: Array<SignIn>;
|
|
87
|
+
runs: {
|
|
88
|
+
count: number;
|
|
89
|
+
live: number;
|
|
90
|
+
};
|
|
91
|
+
region: string;
|
|
92
|
+
home_etag: string;
|
|
93
|
+
created_at: Timestamp;
|
|
94
|
+
updated_at: Timestamp;
|
|
95
|
+
external?: {
|
|
96
|
+
source: string;
|
|
97
|
+
kind: string;
|
|
98
|
+
id: string;
|
|
99
|
+
version: string;
|
|
100
|
+
};
|
|
101
|
+
console_url?: string;
|
|
102
|
+
tools?: Array<{
|
|
103
|
+
name: string;
|
|
104
|
+
blurb?: string;
|
|
105
|
+
provider?: string;
|
|
106
|
+
provider_from?: "agent" | "server" | "default";
|
|
107
|
+
default_provider?: string;
|
|
108
|
+
resolved?: string;
|
|
109
|
+
permission: "allow" | "ask" | "deny";
|
|
110
|
+
permission_from: "agent" | "server" | "default" | "unattended";
|
|
111
|
+
default_permission: "allow" | "ask" | "deny";
|
|
112
|
+
permissions: Array<"allow" | "ask" | "deny">;
|
|
113
|
+
}>;
|
|
114
|
+
kind?: "agentic" | "workflow" | null;
|
|
115
|
+
revision?: string | null;
|
|
116
|
+
revisions?: number;
|
|
117
|
+
archived_at?: string | null;
|
|
118
|
+
learning?: {
|
|
119
|
+
pending: number;
|
|
120
|
+
};
|
|
121
|
+
warnings?: Array<InputIssue>;
|
|
122
|
+
};
|
|
123
|
+
export type Definition = DefinitionInput;
|
|
124
|
+
export type Source = {
|
|
125
|
+
sha: CommitSha;
|
|
126
|
+
refreshed_at: Timestamp;
|
|
127
|
+
};
|
|
128
|
+
export type CommitSha = string;
|
|
129
|
+
export type Timestamp = string;
|
|
130
|
+
export type SkillFileInfo = {
|
|
131
|
+
path: string;
|
|
132
|
+
sha256: string;
|
|
133
|
+
size_bytes: number;
|
|
134
|
+
};
|
|
135
|
+
export type SignIn = {
|
|
136
|
+
key: string;
|
|
137
|
+
provider: string;
|
|
138
|
+
state: "ready" | "held" | "unreadable";
|
|
139
|
+
held_by: Id | null;
|
|
140
|
+
verified_at?: Timestamp | null;
|
|
141
|
+
secret: SecretMeta;
|
|
142
|
+
};
|
|
143
|
+
export type SecretMeta = {
|
|
144
|
+
name: string;
|
|
145
|
+
set: boolean;
|
|
146
|
+
source: "env" | "console" | "sign-in" | null;
|
|
147
|
+
changed_at: string | null;
|
|
148
|
+
};
|
|
149
|
+
export type InputIssue = {
|
|
150
|
+
field: string;
|
|
151
|
+
reason: "missing" | "wrong_type" | "not_allowed" | "not_an_option" | "too_short" | "too_long" | "too_few" | "too_many" | "bad_format" | "duplicate" | "invalid" | "not_set_up_here" | "redirect" | "not_https" | "too_many_tools" | "tools_too_large" | "reserved" | "expired";
|
|
152
|
+
expected?: string;
|
|
153
|
+
message: string;
|
|
154
|
+
fix?: string;
|
|
155
|
+
code?: string;
|
|
156
|
+
example?: unknown;
|
|
157
|
+
};
|
|
158
|
+
export type AgentList = {
|
|
159
|
+
agents: Array<Agent>;
|
|
160
|
+
next_cursor: string | null;
|
|
161
|
+
};
|
|
162
|
+
export type RunList = {
|
|
163
|
+
runs: Array<RunSummary>;
|
|
164
|
+
next_cursor: string | null;
|
|
165
|
+
};
|
|
166
|
+
export type RunSummary = {
|
|
167
|
+
run_id: Id;
|
|
168
|
+
agent_id: Id;
|
|
169
|
+
agent_version: number;
|
|
170
|
+
sha: CommitSha | null;
|
|
171
|
+
status: RunStatus;
|
|
172
|
+
state: RunState;
|
|
173
|
+
title: string;
|
|
174
|
+
created_at: Timestamp;
|
|
175
|
+
ended_at: Timestamp | null;
|
|
176
|
+
cost: Cost;
|
|
177
|
+
console_url?: string;
|
|
178
|
+
revision: string;
|
|
179
|
+
kind: "agentic" | "workflow";
|
|
180
|
+
archived_at: string | null;
|
|
181
|
+
effort?: Effort;
|
|
182
|
+
error?: RunError | null;
|
|
183
|
+
learning?: {
|
|
184
|
+
state: "seeded" | "reflecting" | "proposed" | "merged" | "dropped";
|
|
185
|
+
reason: "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "empty" | "unparsed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
186
|
+
detail: string | null;
|
|
187
|
+
given?: Array<{
|
|
188
|
+
file: string;
|
|
189
|
+
name: string;
|
|
190
|
+
}>;
|
|
191
|
+
read?: Array<{
|
|
192
|
+
file: string;
|
|
193
|
+
name: string;
|
|
194
|
+
}>;
|
|
195
|
+
learned?: Array<{
|
|
196
|
+
file: string;
|
|
197
|
+
name: string;
|
|
198
|
+
supersedes: Array<string>;
|
|
199
|
+
}>;
|
|
200
|
+
skills?: Array<{
|
|
201
|
+
file: string;
|
|
202
|
+
name: string;
|
|
203
|
+
pending?: true;
|
|
204
|
+
}>;
|
|
205
|
+
workflows?: Array<{
|
|
206
|
+
file: string;
|
|
207
|
+
name: string;
|
|
208
|
+
pending?: true;
|
|
209
|
+
}>;
|
|
210
|
+
pending?: Array<{
|
|
211
|
+
file: string;
|
|
212
|
+
name: string;
|
|
213
|
+
}>;
|
|
214
|
+
} | null;
|
|
215
|
+
review?: {
|
|
216
|
+
kind: string | null;
|
|
217
|
+
node: string | null;
|
|
218
|
+
reason: string;
|
|
219
|
+
at: string;
|
|
220
|
+
} | null;
|
|
221
|
+
pending?: {
|
|
222
|
+
kind: "question";
|
|
223
|
+
question: string;
|
|
224
|
+
asked_at: string;
|
|
225
|
+
} | {
|
|
226
|
+
kind: "approval";
|
|
227
|
+
id: string;
|
|
228
|
+
tool: string;
|
|
229
|
+
call_id: string;
|
|
230
|
+
args_preview: string;
|
|
231
|
+
requested_at: string;
|
|
232
|
+
price?: number | "not metered";
|
|
233
|
+
} | {
|
|
234
|
+
kind: "budget";
|
|
235
|
+
cap_usd: number;
|
|
236
|
+
spent_usd?: number;
|
|
237
|
+
needs_usd?: number;
|
|
238
|
+
least_cap_usd?: number;
|
|
239
|
+
suggested_cap_usd?: number;
|
|
240
|
+
overshoot_bound_usd?: number;
|
|
241
|
+
said: string;
|
|
242
|
+
at: string;
|
|
243
|
+
node?: string | null;
|
|
244
|
+
} | {
|
|
245
|
+
kind: "browser";
|
|
246
|
+
instruction: string;
|
|
247
|
+
completion_condition: string;
|
|
248
|
+
asked_at: string;
|
|
249
|
+
expires_at: string;
|
|
250
|
+
} | {
|
|
251
|
+
kind: "computer";
|
|
252
|
+
computer: "desktop" | "phone";
|
|
253
|
+
instruction: string;
|
|
254
|
+
completion_condition: string;
|
|
255
|
+
asked_at: string;
|
|
256
|
+
expires_at: string;
|
|
257
|
+
} | null;
|
|
258
|
+
imported_from?: {
|
|
259
|
+
source: "claude-code" | "codex" | "pi";
|
|
260
|
+
session: string;
|
|
261
|
+
} | null;
|
|
262
|
+
trigger?: {
|
|
263
|
+
id: string;
|
|
264
|
+
firing_key: string;
|
|
265
|
+
} | null;
|
|
266
|
+
};
|
|
267
|
+
export type RunStatus = "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
|
|
268
|
+
export type RunState = "working" | "waiting" | "idle";
|
|
269
|
+
export type Cost = {
|
|
270
|
+
usd: number | null;
|
|
271
|
+
basis: "charge" | "estimate";
|
|
272
|
+
charge_state?: "held" | "settled" | "released" | null;
|
|
273
|
+
cap_usd?: number | null;
|
|
274
|
+
so_far_usd?: number;
|
|
275
|
+
unpriced?: number;
|
|
276
|
+
overshoot_bound_usd?: number;
|
|
277
|
+
};
|
|
278
|
+
export type Effort = "low" | "medium" | "high";
|
|
279
|
+
export type RunError = {
|
|
280
|
+
code: RunErrorCode;
|
|
281
|
+
message: string;
|
|
282
|
+
retryable: boolean;
|
|
283
|
+
next_action?: NextAction;
|
|
284
|
+
details?: {
|
|
285
|
+
reason: "server_lost_at_launch" | "server_lost_at_setup";
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
export type RunErrorCode = "run_failed" | "moderated" | "agent_not_runnable" | "needs_connection" | "needs_reconnect" | "connection_revoked" | "output_invalid" | "spend_cap_reached" | "wall_clock_timeout" | "input_expired" | "internal";
|
|
289
|
+
export type NextAction = RequestAction | PersonAction;
|
|
290
|
+
export type RequestAction = {
|
|
291
|
+
type: "request";
|
|
292
|
+
method: "GET" | "POST" | "PUT";
|
|
293
|
+
path: string;
|
|
294
|
+
body?: Record<string, unknown>;
|
|
295
|
+
caller_supplies?: Array<string>;
|
|
296
|
+
};
|
|
297
|
+
export type PersonAction = {
|
|
298
|
+
type: "person";
|
|
299
|
+
url: string;
|
|
300
|
+
description: string;
|
|
301
|
+
};
|
|
302
|
+
export type FileCreate = {
|
|
303
|
+
path: FilePathString;
|
|
304
|
+
size_bytes: number;
|
|
305
|
+
content_type?: string;
|
|
306
|
+
sha256?: string;
|
|
307
|
+
};
|
|
308
|
+
export type FilePathString = string;
|
|
309
|
+
export type FileUpload = {
|
|
310
|
+
file: File;
|
|
311
|
+
upload: {
|
|
312
|
+
method: "PUT";
|
|
313
|
+
url: string;
|
|
314
|
+
headers?: Record<string, string>;
|
|
315
|
+
expires_at: Timestamp;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
export type File = {
|
|
319
|
+
file_id: Id;
|
|
320
|
+
path: FilePathString;
|
|
321
|
+
size_bytes: number;
|
|
322
|
+
content_type: string;
|
|
323
|
+
sha256: string | null;
|
|
324
|
+
status: "pending" | "ready";
|
|
325
|
+
created_at: Timestamp;
|
|
326
|
+
expires_at: Timestamp | null;
|
|
327
|
+
};
|
|
328
|
+
export type CancelResult = {
|
|
329
|
+
run_id: Id;
|
|
330
|
+
cancel_requested: boolean;
|
|
331
|
+
already_terminal: boolean;
|
|
332
|
+
status: RunStatus;
|
|
333
|
+
};
|
|
334
|
+
export type RunCreateInline = {
|
|
335
|
+
external: ExternalRef;
|
|
336
|
+
definition: DefinitionInput;
|
|
337
|
+
skills?: SkillFiles;
|
|
338
|
+
note?: string;
|
|
339
|
+
input: Record<string, unknown>;
|
|
340
|
+
file_ids?: Array<Id>;
|
|
341
|
+
effort?: Effort;
|
|
342
|
+
max_cost_usd?: number;
|
|
343
|
+
quote_id?: string;
|
|
344
|
+
cap_mode?: "expected" | "strict";
|
|
345
|
+
};
|
|
346
|
+
export type ExternalRef = {
|
|
347
|
+
source: string;
|
|
348
|
+
kind: string;
|
|
349
|
+
id: string;
|
|
350
|
+
version: string | number;
|
|
351
|
+
};
|
|
352
|
+
export type Run = {
|
|
353
|
+
run_id: Id;
|
|
354
|
+
agent_id: Id;
|
|
355
|
+
agent_version: number;
|
|
356
|
+
sha: CommitSha | null;
|
|
357
|
+
status: RunStatus;
|
|
358
|
+
state: RunState;
|
|
359
|
+
title: string;
|
|
360
|
+
effort?: Effort;
|
|
361
|
+
created_at: Timestamp;
|
|
362
|
+
updated_at: Timestamp;
|
|
363
|
+
ended_at: Timestamp | null;
|
|
364
|
+
result: RunResult | null;
|
|
365
|
+
error: RunError | null;
|
|
366
|
+
cost: Cost;
|
|
367
|
+
poll_after_ms: number;
|
|
368
|
+
console_url?: string;
|
|
369
|
+
revision: string;
|
|
370
|
+
kind: "agentic" | "workflow";
|
|
371
|
+
archived_at: string | null;
|
|
372
|
+
approvals?: "ask" | "never";
|
|
373
|
+
cap_mode?: "expected" | "strict" | null;
|
|
374
|
+
last_progress_at?: string | null;
|
|
375
|
+
claim?: {
|
|
376
|
+
runner: string;
|
|
377
|
+
epoch: number;
|
|
378
|
+
until: string;
|
|
379
|
+
} | null;
|
|
380
|
+
place?: {
|
|
381
|
+
mode: "runner";
|
|
382
|
+
} | {
|
|
383
|
+
mode: "sandbox";
|
|
384
|
+
box: "bwrap" | "docker" | "modal" | "daytona";
|
|
385
|
+
};
|
|
386
|
+
computer?: {
|
|
387
|
+
kind: "sandbox" | "desktop" | "phone" | "browser";
|
|
388
|
+
provider: string;
|
|
389
|
+
state: "starting" | "ready" | "taken_over" | "ended" | "failed";
|
|
390
|
+
why?: string;
|
|
391
|
+
};
|
|
392
|
+
learning?: {
|
|
393
|
+
state: "seeded" | "reflecting" | "proposed" | "merged" | "dropped";
|
|
394
|
+
reason: "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "empty" | "unparsed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
395
|
+
detail: string | null;
|
|
396
|
+
at: string;
|
|
397
|
+
given?: Array<{
|
|
398
|
+
file: string;
|
|
399
|
+
name: string;
|
|
400
|
+
}>;
|
|
401
|
+
read?: Array<{
|
|
402
|
+
file: string;
|
|
403
|
+
name: string;
|
|
404
|
+
}>;
|
|
405
|
+
learned?: Array<{
|
|
406
|
+
file: string;
|
|
407
|
+
name: string;
|
|
408
|
+
supersedes: Array<string>;
|
|
409
|
+
}>;
|
|
410
|
+
skills?: Array<{
|
|
411
|
+
file: string;
|
|
412
|
+
name: string;
|
|
413
|
+
pending?: true;
|
|
414
|
+
}>;
|
|
415
|
+
workflows?: Array<{
|
|
416
|
+
file: string;
|
|
417
|
+
name: string;
|
|
418
|
+
pending?: true;
|
|
419
|
+
}>;
|
|
420
|
+
pending?: Array<{
|
|
421
|
+
file: string;
|
|
422
|
+
name: string;
|
|
423
|
+
}>;
|
|
424
|
+
} | null;
|
|
425
|
+
review?: {
|
|
426
|
+
kind: string | null;
|
|
427
|
+
node: string | null;
|
|
428
|
+
reason: string;
|
|
429
|
+
at: string;
|
|
430
|
+
} | null;
|
|
431
|
+
pending?: {
|
|
432
|
+
kind: "question";
|
|
433
|
+
question: string;
|
|
434
|
+
asked_at: string;
|
|
435
|
+
} | {
|
|
436
|
+
kind: "approval";
|
|
437
|
+
id: string;
|
|
438
|
+
tool: string;
|
|
439
|
+
call_id: string;
|
|
440
|
+
args_preview: string;
|
|
441
|
+
requested_at: string;
|
|
442
|
+
price?: number | "not metered";
|
|
443
|
+
} | {
|
|
444
|
+
kind: "budget";
|
|
445
|
+
cap_usd: number;
|
|
446
|
+
spent_usd?: number;
|
|
447
|
+
needs_usd?: number;
|
|
448
|
+
least_cap_usd?: number;
|
|
449
|
+
suggested_cap_usd?: number;
|
|
450
|
+
overshoot_bound_usd?: number;
|
|
451
|
+
said: string;
|
|
452
|
+
at: string;
|
|
453
|
+
node?: string | null;
|
|
454
|
+
} | {
|
|
455
|
+
kind: "browser";
|
|
456
|
+
instruction: string;
|
|
457
|
+
completion_condition: string;
|
|
458
|
+
asked_at: string;
|
|
459
|
+
expires_at: string;
|
|
460
|
+
} | {
|
|
461
|
+
kind: "computer";
|
|
462
|
+
computer: "desktop" | "phone";
|
|
463
|
+
instruction: string;
|
|
464
|
+
completion_condition: string;
|
|
465
|
+
asked_at: string;
|
|
466
|
+
expires_at: string;
|
|
467
|
+
} | null;
|
|
468
|
+
imported_from?: {
|
|
469
|
+
source: "claude-code" | "codex" | "pi";
|
|
470
|
+
session: string;
|
|
471
|
+
} | null;
|
|
472
|
+
trigger?: {
|
|
473
|
+
id: string;
|
|
474
|
+
firing_key: string;
|
|
475
|
+
} | null;
|
|
476
|
+
};
|
|
477
|
+
export type RunResult = {
|
|
478
|
+
output: unknown;
|
|
479
|
+
final_answer: string | null;
|
|
480
|
+
};
|
|
481
|
+
export type RunFileList = {
|
|
482
|
+
run_id: Id;
|
|
483
|
+
files: Array<RunFile>;
|
|
484
|
+
complete: boolean;
|
|
485
|
+
truncated: boolean;
|
|
486
|
+
};
|
|
487
|
+
export type RunFile = {
|
|
488
|
+
path: string;
|
|
489
|
+
size_bytes: number;
|
|
490
|
+
modified_at: Timestamp;
|
|
491
|
+
content_type?: string | null;
|
|
492
|
+
unreadable?: true;
|
|
493
|
+
};
|
|
494
|
+
export type MessageCreate = {
|
|
495
|
+
content: string;
|
|
496
|
+
};
|
|
497
|
+
export type MessageResult = {
|
|
498
|
+
run_id: Id;
|
|
499
|
+
message_id: Id;
|
|
500
|
+
mode: "steer" | "answer" | "follow_up";
|
|
501
|
+
status: RunStatus;
|
|
502
|
+
state: RunState;
|
|
503
|
+
poll_after_ms: number;
|
|
504
|
+
};
|
|
505
|
+
export type RunCreate = {
|
|
506
|
+
input: Record<string, unknown>;
|
|
507
|
+
file_ids?: Array<Id>;
|
|
508
|
+
effort?: Effort;
|
|
509
|
+
max_cost_usd?: number;
|
|
510
|
+
quote_id?: string;
|
|
511
|
+
cap_mode?: "expected" | "strict";
|
|
512
|
+
};
|
|
513
|
+
export type StopResult = {
|
|
514
|
+
run_id: Id;
|
|
515
|
+
stopped: boolean;
|
|
516
|
+
status: RunStatus;
|
|
517
|
+
state: RunState;
|
|
518
|
+
};
|
|
519
|
+
export type TimelinePage = {
|
|
520
|
+
run_id: Id;
|
|
521
|
+
status: RunStatus;
|
|
522
|
+
state: RunState;
|
|
523
|
+
reset: boolean;
|
|
524
|
+
rows: Array<TimelineRow>;
|
|
525
|
+
drop: Array<string>;
|
|
526
|
+
next_after: number;
|
|
527
|
+
unchanged: boolean;
|
|
528
|
+
has_more: boolean;
|
|
529
|
+
final: boolean;
|
|
530
|
+
cost: Cost;
|
|
531
|
+
poll_after_ms?: number;
|
|
532
|
+
};
|
|
533
|
+
export type TimelineRow = {
|
|
534
|
+
id: string;
|
|
535
|
+
timestamp: Timestamp;
|
|
536
|
+
created_at: Timestamp;
|
|
537
|
+
kind: TimelineKind;
|
|
538
|
+
summary: string | null;
|
|
539
|
+
agent_label: string | null;
|
|
540
|
+
tool_name: string | null;
|
|
541
|
+
tool_use_id: string | null;
|
|
542
|
+
tool_status: "success" | "failed" | null;
|
|
543
|
+
tool_input_preview: string | null;
|
|
544
|
+
tool_result_preview: string | null;
|
|
545
|
+
tool_result_size_bytes: number | null;
|
|
546
|
+
text: string | null;
|
|
547
|
+
seq: number;
|
|
548
|
+
conversation_id?: number;
|
|
549
|
+
round?: number;
|
|
550
|
+
parent_tool_use_id?: string;
|
|
551
|
+
session?: string;
|
|
552
|
+
path?: string;
|
|
553
|
+
usage?: TimelineUsage;
|
|
554
|
+
paused?: true;
|
|
555
|
+
origin?: "server" | "trigger";
|
|
556
|
+
trigger?: {
|
|
557
|
+
id: string;
|
|
558
|
+
source: "schedule" | "webhook" | "slack" | "github";
|
|
559
|
+
owner: boolean;
|
|
560
|
+
name?: string;
|
|
561
|
+
};
|
|
562
|
+
learning?: {
|
|
563
|
+
state: "seeded" | "reflecting" | "proposed" | "merged" | "dropped";
|
|
564
|
+
reason: "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "empty" | "unparsed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
565
|
+
detail: string | null;
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
export type TimelineKind = "thinking" | "text_block" | "tool_use" | "tool_result" | "phase" | "subagent_started" | "subagent_progress" | "subagent_completed" | "final_answer" | "error" | "user_message" | "waiting" | "usage" | "decision" | "tool_approval_requested" | "learning";
|
|
569
|
+
export type TimelineUsage = {
|
|
570
|
+
usd: number | null;
|
|
571
|
+
requests: number;
|
|
572
|
+
so_far_usd?: number;
|
|
573
|
+
unpriced?: number;
|
|
574
|
+
not_metered?: number;
|
|
575
|
+
};
|
|
576
|
+
export type Capabilities = {
|
|
577
|
+
backend: "hosted" | "local";
|
|
578
|
+
contract: string;
|
|
579
|
+
server: {
|
|
580
|
+
name: string;
|
|
581
|
+
version: string;
|
|
582
|
+
platform?: string;
|
|
583
|
+
};
|
|
584
|
+
runtimes: Array<string>;
|
|
585
|
+
models?: {
|
|
586
|
+
source: "managed" | "chatgpt" | "env" | "faux" | "gateway" | "providers";
|
|
587
|
+
default?: string | null;
|
|
588
|
+
fast?: string | null;
|
|
589
|
+
strong?: string | null;
|
|
590
|
+
route_prefix?: string | null;
|
|
591
|
+
ready?: boolean;
|
|
592
|
+
needs?: "key" | "model" | null;
|
|
593
|
+
priced?: boolean | null;
|
|
594
|
+
};
|
|
595
|
+
features: Features;
|
|
596
|
+
regions: Array<Region>;
|
|
597
|
+
limits: Limits;
|
|
598
|
+
learning?: {
|
|
599
|
+
grade_model: string | null;
|
|
600
|
+
pending: true;
|
|
601
|
+
approve: boolean;
|
|
602
|
+
approve_needs?: "password";
|
|
603
|
+
};
|
|
604
|
+
places?: {
|
|
605
|
+
modes: Array<"runner" | "sandbox">;
|
|
606
|
+
boxes: Array<{
|
|
607
|
+
id: "bwrap" | "docker" | "modal" | "daytona";
|
|
608
|
+
available: boolean;
|
|
609
|
+
state: "ready" | "preparing" | "unavailable";
|
|
610
|
+
reason?: string;
|
|
611
|
+
network?: "allowlist" | "none";
|
|
612
|
+
network_reason?: string;
|
|
613
|
+
}>;
|
|
614
|
+
default_place?: {
|
|
615
|
+
mode: "runner";
|
|
616
|
+
} | {
|
|
617
|
+
mode: "sandbox";
|
|
618
|
+
box: "bwrap" | "docker" | "modal" | "daytona";
|
|
619
|
+
};
|
|
620
|
+
default_reason?: string;
|
|
621
|
+
allow: Array<string>;
|
|
622
|
+
};
|
|
623
|
+
harnesses?: Array<{
|
|
624
|
+
id: "pi" | "claude-agent" | "codex" | "opencode";
|
|
625
|
+
available: boolean;
|
|
626
|
+
run_memory_mib: number;
|
|
627
|
+
max_concurrent_runs: number;
|
|
628
|
+
default_model: string | null;
|
|
629
|
+
steer: boolean;
|
|
630
|
+
reason?: string;
|
|
631
|
+
installs?: "on_first_use";
|
|
632
|
+
}>;
|
|
633
|
+
tools?: Array<{
|
|
634
|
+
name: string;
|
|
635
|
+
summary: string;
|
|
636
|
+
blurb?: string;
|
|
637
|
+
nodes: boolean;
|
|
638
|
+
calls: boolean;
|
|
639
|
+
call_only?: boolean;
|
|
640
|
+
sandbox_only?: boolean;
|
|
641
|
+
available: boolean;
|
|
642
|
+
reason?: string;
|
|
643
|
+
missing?: Array<string>;
|
|
644
|
+
harnesses: Array<"pi" | "claude-agent" | "codex" | "opencode">;
|
|
645
|
+
providers?: Array<string>;
|
|
646
|
+
provider?: string;
|
|
647
|
+
default_provider?: string;
|
|
648
|
+
resolves?: {
|
|
649
|
+
pi: string;
|
|
650
|
+
"claude-agent": string;
|
|
651
|
+
codex: string;
|
|
652
|
+
opencode: string;
|
|
653
|
+
};
|
|
654
|
+
why?: {
|
|
655
|
+
pi: string;
|
|
656
|
+
"claude-agent": string;
|
|
657
|
+
codex: string;
|
|
658
|
+
opencode: string;
|
|
659
|
+
};
|
|
660
|
+
permission: "allow" | "ask" | "deny";
|
|
661
|
+
default_permission: "allow" | "ask" | "deny";
|
|
662
|
+
permissions: Array<"allow" | "ask" | "deny">;
|
|
663
|
+
ask_needs?: "password";
|
|
664
|
+
key?: "parallel" | "monid" | "browserbase" | "kernel" | "typesafe" | "anthropic" | "openai" | "openrouter";
|
|
665
|
+
}>;
|
|
666
|
+
workflows?: {
|
|
667
|
+
nodes: Array<string>;
|
|
668
|
+
node_tools: Array<string>;
|
|
669
|
+
adapters: Array<string>;
|
|
670
|
+
decisions: {
|
|
671
|
+
providers: Array<{
|
|
672
|
+
id: "jev" | "parallel" | "openrouter";
|
|
673
|
+
available: boolean;
|
|
674
|
+
reason?: string;
|
|
675
|
+
note?: string;
|
|
676
|
+
route?: "parallel" | "openrouter";
|
|
677
|
+
}>;
|
|
678
|
+
};
|
|
679
|
+
};
|
|
680
|
+
links?: {
|
|
681
|
+
openapi: string;
|
|
682
|
+
};
|
|
683
|
+
home?: {
|
|
684
|
+
disk: "local";
|
|
685
|
+
host_owned: Array<string>;
|
|
686
|
+
max_file_bytes: number;
|
|
687
|
+
writes: boolean;
|
|
688
|
+
};
|
|
689
|
+
secrets?: {
|
|
690
|
+
names: Array<string>;
|
|
691
|
+
handoff: "pipe";
|
|
692
|
+
condition: string;
|
|
693
|
+
limit: string;
|
|
694
|
+
};
|
|
695
|
+
};
|
|
696
|
+
export type Features = {
|
|
697
|
+
agents: {
|
|
698
|
+
create: boolean;
|
|
699
|
+
update: boolean;
|
|
700
|
+
list: boolean;
|
|
701
|
+
revisions?: boolean;
|
|
702
|
+
};
|
|
703
|
+
home: {
|
|
704
|
+
export: boolean;
|
|
705
|
+
import: boolean;
|
|
706
|
+
check: boolean;
|
|
707
|
+
};
|
|
708
|
+
runs: {
|
|
709
|
+
stop: boolean;
|
|
710
|
+
cancel: boolean;
|
|
711
|
+
kill: boolean;
|
|
712
|
+
pause_workflow_runs?: boolean;
|
|
713
|
+
graph?: boolean;
|
|
714
|
+
list?: boolean;
|
|
715
|
+
kinds?: Array<"agentic" | "workflow">;
|
|
716
|
+
};
|
|
717
|
+
messages: {
|
|
718
|
+
steer: boolean;
|
|
719
|
+
answer: boolean;
|
|
720
|
+
follow_up: boolean;
|
|
721
|
+
steer_workflow_runs: boolean;
|
|
722
|
+
};
|
|
723
|
+
timeline: {
|
|
724
|
+
long_poll: boolean;
|
|
725
|
+
sse: boolean;
|
|
726
|
+
live_rows: boolean;
|
|
727
|
+
live_workflow_rows?: boolean;
|
|
728
|
+
};
|
|
729
|
+
files: {
|
|
730
|
+
upload: boolean;
|
|
731
|
+
read: boolean;
|
|
732
|
+
range: boolean;
|
|
733
|
+
during_run: boolean;
|
|
734
|
+
};
|
|
735
|
+
quotes: boolean;
|
|
736
|
+
usage: {
|
|
737
|
+
basis: "charge" | "estimate";
|
|
738
|
+
meters: Array<Meter>;
|
|
739
|
+
};
|
|
740
|
+
efforts: Array<Effort>;
|
|
741
|
+
browser: "browserbase" | "chrome" | "none" | "kernel";
|
|
742
|
+
sign_ins: boolean;
|
|
743
|
+
vault: boolean;
|
|
744
|
+
query: boolean;
|
|
745
|
+
archive?: {
|
|
746
|
+
agents: boolean;
|
|
747
|
+
runs: boolean;
|
|
748
|
+
list_param: string;
|
|
749
|
+
routes: Array<string>;
|
|
750
|
+
};
|
|
751
|
+
thinking?: Array<string>;
|
|
752
|
+
learning?: "on" | "off";
|
|
753
|
+
browser_live?: {
|
|
754
|
+
read_only: boolean;
|
|
755
|
+
take_over: boolean;
|
|
756
|
+
ask: boolean;
|
|
757
|
+
};
|
|
758
|
+
computers?: {
|
|
759
|
+
kinds: Array<"none" | "sandbox" | "desktop" | "phone" | "browser">;
|
|
760
|
+
};
|
|
761
|
+
tool_keys?: {
|
|
762
|
+
routes: boolean;
|
|
763
|
+
at_rest: "sealed";
|
|
764
|
+
};
|
|
765
|
+
mcp_client?: {
|
|
766
|
+
transports: Array<"streamable-http">;
|
|
767
|
+
auth: Array<"none" | "bearer" | "headers" | "oauth" | "github_app">;
|
|
768
|
+
at_rest: "sealed";
|
|
769
|
+
harnesses: Array<string>;
|
|
770
|
+
};
|
|
771
|
+
tool_permissions?: boolean;
|
|
772
|
+
webhooks?: {
|
|
773
|
+
routes: boolean;
|
|
774
|
+
events: Array<"run.needs_input" | "run.ended" | "trigger.failed">;
|
|
775
|
+
signing: "standard-webhooks/v1";
|
|
776
|
+
at_rest: "sealed";
|
|
777
|
+
};
|
|
778
|
+
triggers?: {
|
|
779
|
+
routes: boolean;
|
|
780
|
+
sources: Array<"schedule" | "webhook" | "github">;
|
|
781
|
+
targets: Array<"start_run" | "message_run">;
|
|
782
|
+
min_every_s: number;
|
|
783
|
+
history_kept: number;
|
|
784
|
+
catchup_window_s: number;
|
|
785
|
+
failures_to_pause: number;
|
|
786
|
+
webhook: {
|
|
787
|
+
signing: "standard-webhooks/v1";
|
|
788
|
+
signatures: Array<"standard" | "github">;
|
|
789
|
+
tolerance_s: number;
|
|
790
|
+
max_body_bytes: number;
|
|
791
|
+
payload_kept_bytes: number;
|
|
792
|
+
at_rest: "sealed";
|
|
793
|
+
};
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
export type Meter = "tokens" | "agent_time" | "browser_time" | "disk" | "tools" | "learning";
|
|
797
|
+
export type Region = {
|
|
798
|
+
id: string;
|
|
799
|
+
jurisdiction: string | null;
|
|
800
|
+
state: "live" | "beta" | "planned";
|
|
801
|
+
};
|
|
802
|
+
export type Limits = {
|
|
803
|
+
max_body_bytes: number;
|
|
804
|
+
max_upload_bytes: number | null;
|
|
805
|
+
max_files_per_run: number;
|
|
806
|
+
max_message_chars: number;
|
|
807
|
+
max_concurrent_runs: number | null;
|
|
808
|
+
timeline_max_wait_ms: number;
|
|
809
|
+
timeline_page_rows: number;
|
|
810
|
+
idempotency_ttl_s: number;
|
|
811
|
+
input_wait_s: number | null;
|
|
812
|
+
max_cost_usd: {
|
|
813
|
+
min: Usd;
|
|
814
|
+
max: Usd;
|
|
815
|
+
} | null;
|
|
816
|
+
};
|
|
817
|
+
export type Usd = number;
|
|
818
|
+
export type Usage = {
|
|
819
|
+
from: Timestamp;
|
|
820
|
+
to: Timestamp;
|
|
821
|
+
currency: "USD";
|
|
822
|
+
basis: "charge" | "estimate";
|
|
823
|
+
group_by: "meter" | "agent" | "key" | "day" | "region";
|
|
824
|
+
total_usd: number | null;
|
|
825
|
+
lines: Array<UsageLine>;
|
|
826
|
+
account: {
|
|
827
|
+
monthly_cap_usd: number | null;
|
|
828
|
+
month_to_date_usd: number;
|
|
829
|
+
balance_usd: number | null;
|
|
830
|
+
hard_stop: boolean;
|
|
831
|
+
} | null;
|
|
832
|
+
unpriced_runs?: number;
|
|
833
|
+
};
|
|
834
|
+
export type UsageLine = {
|
|
835
|
+
group: string;
|
|
836
|
+
meter?: Meter;
|
|
837
|
+
quantity?: number;
|
|
838
|
+
unit?: "token" | "second" | "gib_month";
|
|
839
|
+
usd: number | null;
|
|
840
|
+
unpriced_runs?: number;
|
|
841
|
+
not_metered_calls?: number;
|
|
842
|
+
};
|
|
843
|
+
/** Archive the agent: hidden from the lists, kept with its history (POST /agents/{agent_id}/archive). */
|
|
844
|
+
export type ArchiveAgentResponse = Record<string, unknown>;
|
|
845
|
+
/** Create an agent home (POST /agents). */
|
|
846
|
+
export type CreateAgentBody = AgentCreate;
|
|
847
|
+
export interface CreateAgentParams {
|
|
848
|
+
"Idempotency-Key"?: string;
|
|
849
|
+
}
|
|
850
|
+
export type CreateAgentResponse = Agent;
|
|
851
|
+
/** Forget one of the agent's saved sign-ins (DELETE /agents/{agent_id}/sign-ins/{key}). */
|
|
852
|
+
export type ForgetSignInResponse = {
|
|
853
|
+
key: string;
|
|
854
|
+
removed: Array<{
|
|
855
|
+
provider: string;
|
|
856
|
+
at_vendor: "deleted" | "not_deleted";
|
|
857
|
+
message?: string;
|
|
858
|
+
}>;
|
|
859
|
+
};
|
|
860
|
+
/** One agent (GET /agents/{agent_id}). */
|
|
861
|
+
export type GetAgentResponse = Agent & ({
|
|
862
|
+
tools: Array<{
|
|
863
|
+
name: string;
|
|
864
|
+
blurb?: string;
|
|
865
|
+
provider?: string;
|
|
866
|
+
provider_from?: "agent" | "server" | "default";
|
|
867
|
+
default_provider?: string;
|
|
868
|
+
resolved?: string;
|
|
869
|
+
permission: "allow" | "ask" | "deny";
|
|
870
|
+
permission_from: "agent" | "server" | "default" | "unattended";
|
|
871
|
+
default_permission: "allow" | "ask" | "deny";
|
|
872
|
+
permissions: Array<"allow" | "ask" | "deny">;
|
|
873
|
+
}>;
|
|
874
|
+
});
|
|
875
|
+
/** List agents (GET /agents). */
|
|
876
|
+
export interface ListAgentsParams {
|
|
877
|
+
limit?: number;
|
|
878
|
+
cursor?: string;
|
|
879
|
+
archived?: boolean;
|
|
880
|
+
}
|
|
881
|
+
export type ListAgentsResponse = AgentList;
|
|
882
|
+
/** The agent's runs index (GET /agents/{agent_id}/runs). */
|
|
883
|
+
export interface ListRunsParams {
|
|
884
|
+
limit?: number;
|
|
885
|
+
cursor?: string;
|
|
886
|
+
status?: "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
|
|
887
|
+
}
|
|
888
|
+
export type ListRunsResponse = RunList;
|
|
889
|
+
/** Show the archived agent in the lists again (POST /agents/{agent_id}/unarchive). */
|
|
890
|
+
export type UnarchiveAgentResponse = Record<string, unknown>;
|
|
891
|
+
/** Replace the agent's definition (PUT /agents/{agent_id}/definition). */
|
|
892
|
+
export type UpdateDefinitionBody = DefinitionInput | AgentCreate;
|
|
893
|
+
export interface UpdateDefinitionParams {
|
|
894
|
+
"If-Match"?: string;
|
|
895
|
+
}
|
|
896
|
+
export type UpdateDefinitionResponse = Agent;
|
|
897
|
+
/** Reserve an upload (POST /files). */
|
|
898
|
+
export type CreateFileBody = FileCreate;
|
|
899
|
+
export interface CreateFileParams {
|
|
900
|
+
path?: string;
|
|
901
|
+
content_type?: string;
|
|
902
|
+
sha256?: string;
|
|
903
|
+
"Idempotency-Key"?: string;
|
|
904
|
+
}
|
|
905
|
+
export type CreateFileResponse = FileUpload;
|
|
906
|
+
/** Delete an upload (DELETE /files/{file_id}). */
|
|
907
|
+
/** An upload's record (GET /files/{file_id}). */
|
|
908
|
+
export type GetFileResponse = File;
|
|
909
|
+
/** This server's uploads, newest first (GET /files). */
|
|
910
|
+
export interface ListFilesParams {
|
|
911
|
+
limit?: number;
|
|
912
|
+
cursor?: string;
|
|
913
|
+
}
|
|
914
|
+
export type ListFilesResponse = {
|
|
915
|
+
files: Array<File>;
|
|
916
|
+
next_cursor: string | null;
|
|
917
|
+
};
|
|
918
|
+
/** Send a reserved file's bytes (PUT /files/{file_id}). */
|
|
919
|
+
export type UploadFileResponse = File;
|
|
920
|
+
/** Delete one file of the agent's home (DELETE /agents/{agent_id}/home/files/{path}). */
|
|
921
|
+
/** Every file in the agent's home (GET /agents/{agent_id}/home/files). */
|
|
922
|
+
export type ListHomeFilesResponse = {
|
|
923
|
+
agent_id: Id;
|
|
924
|
+
files: Array<{
|
|
925
|
+
path: string;
|
|
926
|
+
size_bytes: number;
|
|
927
|
+
modified_at: Timestamp;
|
|
928
|
+
content_type?: string | null;
|
|
929
|
+
unreadable?: true;
|
|
930
|
+
} | {
|
|
931
|
+
path: string;
|
|
932
|
+
host_owned: true;
|
|
933
|
+
}>;
|
|
934
|
+
complete: boolean;
|
|
935
|
+
truncated: boolean;
|
|
936
|
+
};
|
|
937
|
+
/** One file of the agent's home, raw (GET /agents/{agent_id}/home/files/{path}). */
|
|
938
|
+
export interface ReadHomeFileParams {
|
|
939
|
+
download?: 0 | 1;
|
|
940
|
+
}
|
|
941
|
+
/** Write one file of the agent's home (PUT /agents/{agent_id}/home/files/{path}). */
|
|
942
|
+
export type WriteHomeFileResponse = {
|
|
943
|
+
path: string;
|
|
944
|
+
size_bytes: number;
|
|
945
|
+
modified_at: Timestamp;
|
|
946
|
+
content_type?: string | null;
|
|
947
|
+
unreadable?: true;
|
|
948
|
+
};
|
|
949
|
+
/** What the agent has learned: its index, notes, log of changes and counts (GET /agents/{agent_id}/learning). */
|
|
950
|
+
export type GetAgentLearningResponse = {
|
|
951
|
+
agent: string;
|
|
952
|
+
main: string | null;
|
|
953
|
+
index: string;
|
|
954
|
+
notes: {
|
|
955
|
+
items: Array<{
|
|
956
|
+
file: string;
|
|
957
|
+
name: string;
|
|
958
|
+
description: string;
|
|
959
|
+
type: "user" | "feedback" | "project" | "reference";
|
|
960
|
+
status: "active" | "superseded" | "retired" | "pending";
|
|
961
|
+
origin: "you" | "run";
|
|
962
|
+
superseded_by: string | null;
|
|
963
|
+
text: string;
|
|
964
|
+
etag: string;
|
|
965
|
+
runs: {
|
|
966
|
+
given: number;
|
|
967
|
+
read: number;
|
|
968
|
+
};
|
|
969
|
+
retired?: {
|
|
970
|
+
at: string;
|
|
971
|
+
by: "person" | "run";
|
|
972
|
+
};
|
|
973
|
+
last_change?: {
|
|
974
|
+
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
975
|
+
by: "person" | "run";
|
|
976
|
+
at: string;
|
|
977
|
+
};
|
|
978
|
+
}>;
|
|
979
|
+
total: number;
|
|
980
|
+
next_cursor: string | null;
|
|
981
|
+
};
|
|
982
|
+
skills: Array<{
|
|
983
|
+
name: string;
|
|
984
|
+
file: string;
|
|
985
|
+
description: string;
|
|
986
|
+
status: "active" | "pending" | "retired";
|
|
987
|
+
run: string | null;
|
|
988
|
+
bytes: number;
|
|
989
|
+
etag: string;
|
|
990
|
+
retired?: {
|
|
991
|
+
at: string;
|
|
992
|
+
by: "person" | "run";
|
|
993
|
+
};
|
|
994
|
+
last_change?: {
|
|
995
|
+
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
996
|
+
by: "person" | "run";
|
|
997
|
+
at: string;
|
|
998
|
+
};
|
|
999
|
+
}>;
|
|
1000
|
+
workflows: Array<{
|
|
1001
|
+
name: string;
|
|
1002
|
+
file: string;
|
|
1003
|
+
readme: string;
|
|
1004
|
+
description: string;
|
|
1005
|
+
status: "active" | "pending" | "retired";
|
|
1006
|
+
run: string | null;
|
|
1007
|
+
bytes: number;
|
|
1008
|
+
etag: string;
|
|
1009
|
+
retired?: {
|
|
1010
|
+
at: string;
|
|
1011
|
+
by: "person" | "run";
|
|
1012
|
+
};
|
|
1013
|
+
last_change?: {
|
|
1014
|
+
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
1015
|
+
by: "person" | "run";
|
|
1016
|
+
at: string;
|
|
1017
|
+
};
|
|
1018
|
+
}>;
|
|
1019
|
+
log: {
|
|
1020
|
+
items: Array<{
|
|
1021
|
+
by: {
|
|
1022
|
+
run: string;
|
|
1023
|
+
} | {
|
|
1024
|
+
user: true;
|
|
1025
|
+
via?: string;
|
|
1026
|
+
};
|
|
1027
|
+
commit: string;
|
|
1028
|
+
at: string;
|
|
1029
|
+
reason: string;
|
|
1030
|
+
files: Array<string>;
|
|
1031
|
+
}>;
|
|
1032
|
+
total: number;
|
|
1033
|
+
next_cursor: string | null;
|
|
1034
|
+
};
|
|
1035
|
+
counts: {
|
|
1036
|
+
merged: number;
|
|
1037
|
+
dropped: Record<string, number>;
|
|
1038
|
+
in_progress: number;
|
|
1039
|
+
};
|
|
1040
|
+
impact: {
|
|
1041
|
+
before: {
|
|
1042
|
+
runs: number;
|
|
1043
|
+
median_duration_s: number;
|
|
1044
|
+
median_cost_usd: number | null;
|
|
1045
|
+
cost_runs: number;
|
|
1046
|
+
median_learning_usd: number | null;
|
|
1047
|
+
};
|
|
1048
|
+
after: {
|
|
1049
|
+
runs: number;
|
|
1050
|
+
median_duration_s: number;
|
|
1051
|
+
median_cost_usd: number | null;
|
|
1052
|
+
cost_runs: number;
|
|
1053
|
+
median_learning_usd: number | null;
|
|
1054
|
+
};
|
|
1055
|
+
} | null;
|
|
1056
|
+
};
|
|
1057
|
+
/** A page of the changes on the agent's main, newest first (GET /agents/{agent_id}/learning/log). */
|
|
1058
|
+
export interface ListLearningLogParams {
|
|
1059
|
+
cursor?: string;
|
|
1060
|
+
limit?: number;
|
|
1061
|
+
}
|
|
1062
|
+
export type ListLearningLogResponse = {
|
|
1063
|
+
items: Array<{
|
|
1064
|
+
by: {
|
|
1065
|
+
run: string;
|
|
1066
|
+
} | {
|
|
1067
|
+
user: true;
|
|
1068
|
+
via?: string;
|
|
1069
|
+
};
|
|
1070
|
+
commit: string;
|
|
1071
|
+
at: string;
|
|
1072
|
+
reason: string;
|
|
1073
|
+
files: Array<string>;
|
|
1074
|
+
}>;
|
|
1075
|
+
total: number;
|
|
1076
|
+
next_cursor: string | null;
|
|
1077
|
+
};
|
|
1078
|
+
/** A page of the agent's notes (GET /agents/{agent_id}/learning/notes). */
|
|
1079
|
+
export interface ListLearningNotesParams {
|
|
1080
|
+
cursor?: string;
|
|
1081
|
+
limit?: number;
|
|
1082
|
+
status?: "active" | "superseded" | "retired" | "pending";
|
|
1083
|
+
}
|
|
1084
|
+
export type ListLearningNotesResponse = {
|
|
1085
|
+
items: Array<{
|
|
1086
|
+
file: string;
|
|
1087
|
+
name: string;
|
|
1088
|
+
description: string;
|
|
1089
|
+
type: "user" | "feedback" | "project" | "reference";
|
|
1090
|
+
status: "active" | "superseded" | "retired" | "pending";
|
|
1091
|
+
origin: "you" | "run";
|
|
1092
|
+
superseded_by: string | null;
|
|
1093
|
+
text: string;
|
|
1094
|
+
etag: string;
|
|
1095
|
+
runs: {
|
|
1096
|
+
given: number;
|
|
1097
|
+
read: number;
|
|
1098
|
+
};
|
|
1099
|
+
retired?: {
|
|
1100
|
+
at: string;
|
|
1101
|
+
by: "person" | "run";
|
|
1102
|
+
};
|
|
1103
|
+
last_change?: {
|
|
1104
|
+
kind: "approved" | "edited" | "created" | "retired" | "restored" | "learned" | "superseded";
|
|
1105
|
+
by: "person" | "run";
|
|
1106
|
+
at: string;
|
|
1107
|
+
};
|
|
1108
|
+
}>;
|
|
1109
|
+
total: number;
|
|
1110
|
+
next_cursor: string | null;
|
|
1111
|
+
};
|
|
1112
|
+
/** One note (or MEMORY.md, a skill's SKILL.md or a draft's file) on main, as text, with its ETag (GET /agents/{agent_id}/learning/files/{file}). */
|
|
1113
|
+
export type ReadLearningFileResponse = unknown;
|
|
1114
|
+
/** Retire a note, a skill or a workflow draft: out of every later run, kept in history (POST /agents/{agent_id}/learning/files/{file}/retire). */
|
|
1115
|
+
export interface RetireLearningFileParams {
|
|
1116
|
+
"If-Match"?: string;
|
|
1117
|
+
}
|
|
1118
|
+
/** Edit a note (If-Match) or create one (If-None-Match: *) (PUT /agents/{agent_id}/learning/files/{file}). */
|
|
1119
|
+
export type WriteLearningFileBody = {
|
|
1120
|
+
text: string;
|
|
1121
|
+
};
|
|
1122
|
+
export interface WriteLearningFileParams {
|
|
1123
|
+
"If-Match"?: string;
|
|
1124
|
+
"If-None-Match"?: string;
|
|
1125
|
+
}
|
|
1126
|
+
/** Start Connect GitHub: the app-manifest form the console posts to GitHub (POST /integrations/github/connect). */
|
|
1127
|
+
export type ConnectGitHubBody = {
|
|
1128
|
+
org?: string;
|
|
1129
|
+
};
|
|
1130
|
+
export type ConnectGitHubResponse = {
|
|
1131
|
+
action: string;
|
|
1132
|
+
manifest: Record<string, unknown>;
|
|
1133
|
+
state: string;
|
|
1134
|
+
};
|
|
1135
|
+
/** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
|
|
1136
|
+
export type DeleteWorkspaceArchilResponse = {
|
|
1137
|
+
on: boolean;
|
|
1138
|
+
secret: {
|
|
1139
|
+
name: string;
|
|
1140
|
+
set: boolean;
|
|
1141
|
+
source: "env" | "console" | "sign-in" | null;
|
|
1142
|
+
changed_at: string | null;
|
|
1143
|
+
};
|
|
1144
|
+
diskId?: string;
|
|
1145
|
+
region?: string;
|
|
1146
|
+
s3Url?: string;
|
|
1147
|
+
image?: string;
|
|
1148
|
+
};
|
|
1149
|
+
/** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
|
|
1150
|
+
export type DisconnectGitHubResponse = {
|
|
1151
|
+
disconnected: true;
|
|
1152
|
+
triggers_off: number;
|
|
1153
|
+
note: string;
|
|
1154
|
+
};
|
|
1155
|
+
/** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
|
|
1156
|
+
export type GetGitHubConnectionResponse = {
|
|
1157
|
+
connected: false;
|
|
1158
|
+
} | {
|
|
1159
|
+
connected: true;
|
|
1160
|
+
app_id: string;
|
|
1161
|
+
slug: string;
|
|
1162
|
+
installations: Array<{
|
|
1163
|
+
id: number;
|
|
1164
|
+
account: string;
|
|
1165
|
+
}>;
|
|
1166
|
+
};
|
|
1167
|
+
/** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
|
|
1168
|
+
export type GetWorkspaceArchilResponse = {
|
|
1169
|
+
on: boolean;
|
|
1170
|
+
secret: {
|
|
1171
|
+
name: string;
|
|
1172
|
+
set: boolean;
|
|
1173
|
+
source: "env" | "console" | "sign-in" | null;
|
|
1174
|
+
changed_at: string | null;
|
|
1175
|
+
};
|
|
1176
|
+
diskId?: string;
|
|
1177
|
+
region?: string;
|
|
1178
|
+
s3Url?: string;
|
|
1179
|
+
image?: string;
|
|
1180
|
+
};
|
|
1181
|
+
/** Where GitHub sends the owner's browser back with the new App's code (GET /integrations/github/callback). */
|
|
1182
|
+
export interface GitHubCallbackParams {
|
|
1183
|
+
code?: string;
|
|
1184
|
+
state?: string;
|
|
1185
|
+
}
|
|
1186
|
+
/** Where GitHub sends the browser once the App is installed (GET /integrations/github/installed). */
|
|
1187
|
+
export interface GitHubInstalledParams {
|
|
1188
|
+
installation_id?: string;
|
|
1189
|
+
setup_action?: string;
|
|
1190
|
+
state?: string;
|
|
1191
|
+
}
|
|
1192
|
+
/** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
|
|
1193
|
+
export type ListComputersResponse = {
|
|
1194
|
+
kinds: Array<{
|
|
1195
|
+
kind: "none" | "sandbox" | "desktop" | "phone" | "browser";
|
|
1196
|
+
offered: boolean;
|
|
1197
|
+
groups: Array<string>;
|
|
1198
|
+
tools: Array<string>;
|
|
1199
|
+
providers: Array<{
|
|
1200
|
+
id: string;
|
|
1201
|
+
name: string;
|
|
1202
|
+
metered: boolean;
|
|
1203
|
+
secrets: Array<{
|
|
1204
|
+
name: string;
|
|
1205
|
+
set: boolean;
|
|
1206
|
+
source: "env" | "console" | "sign-in" | null;
|
|
1207
|
+
changed_at: string | null;
|
|
1208
|
+
}>;
|
|
1209
|
+
required: Array<string>;
|
|
1210
|
+
ready: boolean;
|
|
1211
|
+
why?: string;
|
|
1212
|
+
}>;
|
|
1213
|
+
why?: string;
|
|
1214
|
+
}>;
|
|
1215
|
+
};
|
|
1216
|
+
/** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
|
|
1217
|
+
export type PutWorkspaceArchilBody = {
|
|
1218
|
+
diskId: string;
|
|
1219
|
+
region: string;
|
|
1220
|
+
s3Url: string;
|
|
1221
|
+
image?: string;
|
|
1222
|
+
keys?: {
|
|
1223
|
+
ARCHIL_API_KEY?: string | null;
|
|
1224
|
+
};
|
|
1225
|
+
};
|
|
1226
|
+
export type PutWorkspaceArchilResponse = {
|
|
1227
|
+
on: boolean;
|
|
1228
|
+
secret: {
|
|
1229
|
+
name: string;
|
|
1230
|
+
set: boolean;
|
|
1231
|
+
source: "env" | "console" | "sign-in" | null;
|
|
1232
|
+
changed_at: string | null;
|
|
1233
|
+
};
|
|
1234
|
+
diskId?: string;
|
|
1235
|
+
region?: string;
|
|
1236
|
+
s3Url?: string;
|
|
1237
|
+
image?: string;
|
|
1238
|
+
};
|
|
1239
|
+
/** Fire a GitHub trigger: a request it checks, no token (POST /hooks/github). */
|
|
1240
|
+
export type ReceiveHookGithubResponse = {
|
|
1241
|
+
firings: Array<{
|
|
1242
|
+
key: string;
|
|
1243
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
1244
|
+
nominal_at: string;
|
|
1245
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
1246
|
+
at: string;
|
|
1247
|
+
run_id: string | null;
|
|
1248
|
+
reason: string | null;
|
|
1249
|
+
error: {
|
|
1250
|
+
code: string;
|
|
1251
|
+
message: string;
|
|
1252
|
+
} | null;
|
|
1253
|
+
count?: number;
|
|
1254
|
+
attempts?: number;
|
|
1255
|
+
retry_at?: string;
|
|
1256
|
+
catch_up?: true;
|
|
1257
|
+
} | {
|
|
1258
|
+
ok: "duplicate";
|
|
1259
|
+
}>;
|
|
1260
|
+
} | {
|
|
1261
|
+
ok: "ignored";
|
|
1262
|
+
} | Record<string, unknown> | {
|
|
1263
|
+
firings: Array<{
|
|
1264
|
+
key: string;
|
|
1265
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
1266
|
+
nominal_at: string;
|
|
1267
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
1268
|
+
at: string;
|
|
1269
|
+
run_id: string | null;
|
|
1270
|
+
reason: string | null;
|
|
1271
|
+
error: {
|
|
1272
|
+
code: string;
|
|
1273
|
+
message: string;
|
|
1274
|
+
} | null;
|
|
1275
|
+
count?: number;
|
|
1276
|
+
attempts?: number;
|
|
1277
|
+
retry_at?: string;
|
|
1278
|
+
catch_up?: true;
|
|
1279
|
+
} | {
|
|
1280
|
+
ok: "duplicate";
|
|
1281
|
+
}>;
|
|
1282
|
+
};
|
|
1283
|
+
/** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
|
|
1284
|
+
export type SaveComputerKeysBody = Record<string, string | null>;
|
|
1285
|
+
export type SaveComputerKeysResponse = {
|
|
1286
|
+
id: string;
|
|
1287
|
+
name: string;
|
|
1288
|
+
metered: boolean;
|
|
1289
|
+
secrets: Array<{
|
|
1290
|
+
name: string;
|
|
1291
|
+
set: boolean;
|
|
1292
|
+
source: "env" | "console" | "sign-in" | null;
|
|
1293
|
+
changed_at: string | null;
|
|
1294
|
+
}>;
|
|
1295
|
+
required: Array<string>;
|
|
1296
|
+
ready: boolean;
|
|
1297
|
+
why?: string;
|
|
1298
|
+
};
|
|
1299
|
+
/** Start signing in to an MCP server with OAuth: the page the owner opens (POST /settings/mcp-servers/{name}/oauth/start). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
|
|
1300
|
+
export type StartMcpOAuthBody = {
|
|
1301
|
+
url: string;
|
|
1302
|
+
scopes?: Array<string>;
|
|
1303
|
+
client_id?: string;
|
|
1304
|
+
client_secret?: string;
|
|
1305
|
+
};
|
|
1306
|
+
export type StartMcpOAuthResponse = {
|
|
1307
|
+
authorization_url: string;
|
|
1308
|
+
};
|
|
1309
|
+
/** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
|
|
1310
|
+
export type TestComputerResponse = {
|
|
1311
|
+
ok: true;
|
|
1312
|
+
detail: string;
|
|
1313
|
+
} | {
|
|
1314
|
+
ok: false;
|
|
1315
|
+
why: string;
|
|
1316
|
+
};
|
|
1317
|
+
/** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
|
|
1318
|
+
export type TestWorkspaceArchilResponse = {
|
|
1319
|
+
ok: true;
|
|
1320
|
+
detail: string;
|
|
1321
|
+
} | {
|
|
1322
|
+
ok: false;
|
|
1323
|
+
why: string;
|
|
1324
|
+
};
|
|
1325
|
+
/** Forget a saved MCP server and its credential (DELETE /settings/mcp-servers/{name}). */
|
|
1326
|
+
/** One saved MCP server; never its credential (GET /settings/mcp-servers/{name}). */
|
|
1327
|
+
export type GetMcpServerResponse = {
|
|
1328
|
+
name: string;
|
|
1329
|
+
url: string;
|
|
1330
|
+
auth: {
|
|
1331
|
+
type: "none" | "bearer" | "headers" | "oauth" | "github_app";
|
|
1332
|
+
headers?: Array<string>;
|
|
1333
|
+
};
|
|
1334
|
+
credential: "sealed" | "unreadable" | "expired" | null;
|
|
1335
|
+
oauth?: {
|
|
1336
|
+
expires_at?: string;
|
|
1337
|
+
scopes: Array<string>;
|
|
1338
|
+
client_id?: string;
|
|
1339
|
+
client: "pre-registered" | "metadata-document" | "dynamic";
|
|
1340
|
+
};
|
|
1341
|
+
protocol: string;
|
|
1342
|
+
server_info: Record<string, unknown> | null;
|
|
1343
|
+
instructions?: string;
|
|
1344
|
+
tools: Array<{
|
|
1345
|
+
name: string;
|
|
1346
|
+
title?: string;
|
|
1347
|
+
description?: string;
|
|
1348
|
+
input_schema: Record<string, unknown>;
|
|
1349
|
+
output_schema?: Record<string, unknown>;
|
|
1350
|
+
annotations?: Record<string, unknown>;
|
|
1351
|
+
grantable?: false;
|
|
1352
|
+
reason?: string;
|
|
1353
|
+
permission?: "allow" | "ask" | "deny";
|
|
1354
|
+
default_permission?: "allow" | "ask" | "deny";
|
|
1355
|
+
permissions?: Array<"allow" | "ask" | "deny">;
|
|
1356
|
+
}>;
|
|
1357
|
+
prices?: Record<string, number>;
|
|
1358
|
+
not_metered?: Array<string>;
|
|
1359
|
+
listed_at: string;
|
|
1360
|
+
updated_at: string;
|
|
1361
|
+
secret?: SecretMeta;
|
|
1362
|
+
};
|
|
1363
|
+
/** The remote MCP servers saved here, with their tools; never a credential (GET /settings/mcp-servers). */
|
|
1364
|
+
export type ListMcpServersResponse = {
|
|
1365
|
+
servers: Array<{
|
|
1366
|
+
name: string;
|
|
1367
|
+
url: string;
|
|
1368
|
+
auth: {
|
|
1369
|
+
type: "none" | "bearer" | "headers" | "oauth" | "github_app";
|
|
1370
|
+
headers?: Array<string>;
|
|
1371
|
+
};
|
|
1372
|
+
credential: "sealed" | "unreadable" | "expired" | null;
|
|
1373
|
+
oauth?: {
|
|
1374
|
+
expires_at?: string;
|
|
1375
|
+
scopes: Array<string>;
|
|
1376
|
+
client_id?: string;
|
|
1377
|
+
client: "pre-registered" | "metadata-document" | "dynamic";
|
|
1378
|
+
};
|
|
1379
|
+
protocol: string;
|
|
1380
|
+
server_info: Record<string, unknown> | null;
|
|
1381
|
+
instructions?: string;
|
|
1382
|
+
tools: Array<{
|
|
1383
|
+
name: string;
|
|
1384
|
+
title?: string;
|
|
1385
|
+
description?: string;
|
|
1386
|
+
input_schema: Record<string, unknown>;
|
|
1387
|
+
output_schema?: Record<string, unknown>;
|
|
1388
|
+
annotations?: Record<string, unknown>;
|
|
1389
|
+
grantable?: false;
|
|
1390
|
+
reason?: string;
|
|
1391
|
+
permission?: "allow" | "ask" | "deny";
|
|
1392
|
+
default_permission?: "allow" | "ask" | "deny";
|
|
1393
|
+
permissions?: Array<"allow" | "ask" | "deny">;
|
|
1394
|
+
}>;
|
|
1395
|
+
prices?: Record<string, number>;
|
|
1396
|
+
not_metered?: Array<string>;
|
|
1397
|
+
listed_at: string;
|
|
1398
|
+
updated_at: string;
|
|
1399
|
+
secret?: SecretMeta;
|
|
1400
|
+
}>;
|
|
1401
|
+
file_unreadable?: true;
|
|
1402
|
+
};
|
|
1403
|
+
/** This server's OAuth client metadata document (GET /settings/mcp-servers/oauth/client.json). */
|
|
1404
|
+
export type McpOAuthClientResponse = Record<string, unknown>;
|
|
1405
|
+
/** Connect to a remote MCP server and list its tools, storing nothing (POST /settings/mcp-servers/preview). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
|
|
1406
|
+
export type PreviewMcpServerBody = {
|
|
1407
|
+
url: string;
|
|
1408
|
+
auth?: {
|
|
1409
|
+
type: "none" | "bearer" | "headers" | "oauth" | "github_app";
|
|
1410
|
+
token?: string;
|
|
1411
|
+
headers?: Record<string, string>;
|
|
1412
|
+
};
|
|
1413
|
+
} | {
|
|
1414
|
+
name: string;
|
|
1415
|
+
};
|
|
1416
|
+
export type PreviewMcpServerResponse = {
|
|
1417
|
+
protocol: string;
|
|
1418
|
+
server_info: Record<string, unknown> | null;
|
|
1419
|
+
instructions?: string;
|
|
1420
|
+
tools: Array<{
|
|
1421
|
+
name: string;
|
|
1422
|
+
title?: string;
|
|
1423
|
+
description?: string;
|
|
1424
|
+
input_schema: Record<string, unknown>;
|
|
1425
|
+
output_schema?: Record<string, unknown>;
|
|
1426
|
+
annotations?: Record<string, unknown>;
|
|
1427
|
+
grantable?: false;
|
|
1428
|
+
reason?: string;
|
|
1429
|
+
permission?: "allow" | "ask" | "deny";
|
|
1430
|
+
default_permission?: "allow" | "ask" | "deny";
|
|
1431
|
+
permissions?: Array<"allow" | "ask" | "deny">;
|
|
1432
|
+
}>;
|
|
1433
|
+
};
|
|
1434
|
+
/** The private-network hosts an MCP server's authorization server may be on (GET /settings/mcp-servers/oauth/private-hosts). */
|
|
1435
|
+
export type GetMcpPrivateHostsResponse = {
|
|
1436
|
+
hosts: Array<string>;
|
|
1437
|
+
};
|
|
1438
|
+
/** List a saved MCP server's tools again, keep them, and say what changed (POST /settings/mcp-servers/{name}/refresh). */
|
|
1439
|
+
export type RefreshMcpServerResponse = {
|
|
1440
|
+
added: Array<string>;
|
|
1441
|
+
removed: Array<string>;
|
|
1442
|
+
changed: Array<string>;
|
|
1443
|
+
server: {
|
|
1444
|
+
name: string;
|
|
1445
|
+
url: string;
|
|
1446
|
+
auth: {
|
|
1447
|
+
type: "none" | "bearer" | "headers" | "oauth" | "github_app";
|
|
1448
|
+
headers?: Array<string>;
|
|
1449
|
+
};
|
|
1450
|
+
credential: "sealed" | "unreadable" | "expired" | null;
|
|
1451
|
+
oauth?: {
|
|
1452
|
+
expires_at?: string;
|
|
1453
|
+
scopes: Array<string>;
|
|
1454
|
+
client_id?: string;
|
|
1455
|
+
client: "pre-registered" | "metadata-document" | "dynamic";
|
|
1456
|
+
};
|
|
1457
|
+
protocol: string;
|
|
1458
|
+
server_info: Record<string, unknown> | null;
|
|
1459
|
+
instructions?: string;
|
|
1460
|
+
tools: Array<{
|
|
1461
|
+
name: string;
|
|
1462
|
+
title?: string;
|
|
1463
|
+
description?: string;
|
|
1464
|
+
input_schema: Record<string, unknown>;
|
|
1465
|
+
output_schema?: Record<string, unknown>;
|
|
1466
|
+
annotations?: Record<string, unknown>;
|
|
1467
|
+
grantable?: false;
|
|
1468
|
+
reason?: string;
|
|
1469
|
+
permission?: "allow" | "ask" | "deny";
|
|
1470
|
+
default_permission?: "allow" | "ask" | "deny";
|
|
1471
|
+
permissions?: Array<"allow" | "ask" | "deny">;
|
|
1472
|
+
}>;
|
|
1473
|
+
prices?: Record<string, number>;
|
|
1474
|
+
not_metered?: Array<string>;
|
|
1475
|
+
listed_at: string;
|
|
1476
|
+
updated_at: string;
|
|
1477
|
+
secret?: SecretMeta;
|
|
1478
|
+
};
|
|
1479
|
+
};
|
|
1480
|
+
/** Preview a remote MCP server, then save it with the tools listed and its credential sealed (PUT /settings/mcp-servers/{name}). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
|
|
1481
|
+
export type SaveMcpServerBody = {
|
|
1482
|
+
url: string;
|
|
1483
|
+
auth?: {
|
|
1484
|
+
type: "none" | "bearer" | "headers" | "oauth" | "github_app";
|
|
1485
|
+
token?: string;
|
|
1486
|
+
headers?: Record<string, string>;
|
|
1487
|
+
};
|
|
1488
|
+
prices?: Record<string, number>;
|
|
1489
|
+
};
|
|
1490
|
+
export type SaveMcpServerResponse = {
|
|
1491
|
+
name: string;
|
|
1492
|
+
url: string;
|
|
1493
|
+
auth: {
|
|
1494
|
+
type: "none" | "bearer" | "headers" | "oauth" | "github_app";
|
|
1495
|
+
headers?: Array<string>;
|
|
1496
|
+
};
|
|
1497
|
+
credential: "sealed" | "unreadable" | "expired" | null;
|
|
1498
|
+
oauth?: {
|
|
1499
|
+
expires_at?: string;
|
|
1500
|
+
scopes: Array<string>;
|
|
1501
|
+
client_id?: string;
|
|
1502
|
+
client: "pre-registered" | "metadata-document" | "dynamic";
|
|
1503
|
+
};
|
|
1504
|
+
protocol: string;
|
|
1505
|
+
server_info: Record<string, unknown> | null;
|
|
1506
|
+
instructions?: string;
|
|
1507
|
+
tools: Array<{
|
|
1508
|
+
name: string;
|
|
1509
|
+
title?: string;
|
|
1510
|
+
description?: string;
|
|
1511
|
+
input_schema: Record<string, unknown>;
|
|
1512
|
+
output_schema?: Record<string, unknown>;
|
|
1513
|
+
annotations?: Record<string, unknown>;
|
|
1514
|
+
grantable?: false;
|
|
1515
|
+
reason?: string;
|
|
1516
|
+
permission?: "allow" | "ask" | "deny";
|
|
1517
|
+
default_permission?: "allow" | "ask" | "deny";
|
|
1518
|
+
permissions?: Array<"allow" | "ask" | "deny">;
|
|
1519
|
+
}>;
|
|
1520
|
+
prices?: Record<string, number>;
|
|
1521
|
+
not_metered?: Array<string>;
|
|
1522
|
+
listed_at: string;
|
|
1523
|
+
updated_at: string;
|
|
1524
|
+
secret?: SecretMeta;
|
|
1525
|
+
};
|
|
1526
|
+
/** The agent's revisions, newest first (GET /agents/{agent_id}/revisions). */
|
|
1527
|
+
export interface ListRevisionsParams {
|
|
1528
|
+
limit?: number;
|
|
1529
|
+
cursor?: string;
|
|
1530
|
+
}
|
|
1531
|
+
export type ListRevisionsResponse = {
|
|
1532
|
+
revisions: Array<{
|
|
1533
|
+
revision: string;
|
|
1534
|
+
version: number;
|
|
1535
|
+
parent: string | null;
|
|
1536
|
+
kind: "agentic" | "workflow";
|
|
1537
|
+
current: boolean;
|
|
1538
|
+
note: string | null;
|
|
1539
|
+
created_at: Timestamp;
|
|
1540
|
+
definition: Definition;
|
|
1541
|
+
}>;
|
|
1542
|
+
next_cursor: string | null;
|
|
1543
|
+
};
|
|
1544
|
+
/** Make one of the agent's revisions current again (POST /agents/{agent_id}/current). */
|
|
1545
|
+
export type SetCurrentBody = {
|
|
1546
|
+
revision: string;
|
|
1547
|
+
};
|
|
1548
|
+
export type SetCurrentResponse = Agent;
|
|
1549
|
+
/** Archive the run: hidden from the lists, kept with its history (POST /runs/{run_id}/archive). */
|
|
1550
|
+
export type ArchiveRunResponse = Record<string, unknown>;
|
|
1551
|
+
/** End the run (POST /runs/{run_id}/cancel). */
|
|
1552
|
+
export type CancelRunResponse = CancelResult;
|
|
1553
|
+
/** Start a run of an agent another system owns, given inline (POST /runs). */
|
|
1554
|
+
export type CreateInlineRunBody = RunCreateInline;
|
|
1555
|
+
export interface CreateInlineRunParams {
|
|
1556
|
+
"Idempotency-Key"?: string;
|
|
1557
|
+
}
|
|
1558
|
+
export type CreateInlineRunResponse = Run;
|
|
1559
|
+
/** The files the run wrote (GET /runs/{run_id}/files). */
|
|
1560
|
+
export type ListRunFilesResponse = RunFileList;
|
|
1561
|
+
/** One run (GET /runs/{run_id}). */
|
|
1562
|
+
export type GetRunResponse = Run;
|
|
1563
|
+
/** A workflow run's graph, live (GET /runs/{run_id}/graph). */
|
|
1564
|
+
export type GetRunGraphResponse = {
|
|
1565
|
+
read_at: string;
|
|
1566
|
+
run: {
|
|
1567
|
+
id: string;
|
|
1568
|
+
agent: string;
|
|
1569
|
+
revision: string;
|
|
1570
|
+
status: RunStatus;
|
|
1571
|
+
paused: boolean;
|
|
1572
|
+
startedAt: string;
|
|
1573
|
+
endedAt: string | null;
|
|
1574
|
+
};
|
|
1575
|
+
workflow: Record<string, unknown>;
|
|
1576
|
+
graph: Record<string, unknown>;
|
|
1577
|
+
nodes: Record<string, {
|
|
1578
|
+
status: "pending" | "working" | "done" | "failed" | "stopped" | "escalated" | "not_run" | "needs_review";
|
|
1579
|
+
startedAt?: string;
|
|
1580
|
+
endedAt?: string;
|
|
1581
|
+
branch?: string;
|
|
1582
|
+
items?: Array<{
|
|
1583
|
+
index: number;
|
|
1584
|
+
status: "pending" | "working" | "done" | "failed" | "stopped" | "escalated" | "not_run" | "needs_review";
|
|
1585
|
+
executionPath: string;
|
|
1586
|
+
label?: string;
|
|
1587
|
+
branches?: Record<string, string>;
|
|
1588
|
+
}>;
|
|
1589
|
+
}>;
|
|
1590
|
+
decisions: Array<{
|
|
1591
|
+
id: string | null;
|
|
1592
|
+
node: string | null;
|
|
1593
|
+
executionPath: string | null;
|
|
1594
|
+
item: number | null;
|
|
1595
|
+
kind: string | null;
|
|
1596
|
+
provider: string | null;
|
|
1597
|
+
model: string | null;
|
|
1598
|
+
status: string | null;
|
|
1599
|
+
questions: unknown;
|
|
1600
|
+
answers: unknown;
|
|
1601
|
+
evidence: Array<unknown>;
|
|
1602
|
+
rule: unknown;
|
|
1603
|
+
action: unknown;
|
|
1604
|
+
cost_usd: number | null;
|
|
1605
|
+
cost_basis: string | null;
|
|
1606
|
+
latency_ms: number | null;
|
|
1607
|
+
state: unknown;
|
|
1608
|
+
state_truncated: boolean;
|
|
1609
|
+
error: string | null;
|
|
1610
|
+
images: Array<{
|
|
1611
|
+
token: string | null;
|
|
1612
|
+
ref: string | null;
|
|
1613
|
+
url: string | null;
|
|
1614
|
+
}>;
|
|
1615
|
+
}>;
|
|
1616
|
+
effects: Array<{
|
|
1617
|
+
node: string | null;
|
|
1618
|
+
executionPath: string | null;
|
|
1619
|
+
item: number | null;
|
|
1620
|
+
tool: string;
|
|
1621
|
+
status: "working" | "done" | "failed" | "stopped";
|
|
1622
|
+
input: unknown;
|
|
1623
|
+
output: unknown;
|
|
1624
|
+
error: string | null;
|
|
1625
|
+
startedAt: string;
|
|
1626
|
+
endedAt: string | null;
|
|
1627
|
+
}>;
|
|
1628
|
+
totals: {
|
|
1629
|
+
cost_usd: number | null;
|
|
1630
|
+
decisions: number;
|
|
1631
|
+
effects: number;
|
|
1632
|
+
elapsed_ms: number | null;
|
|
1633
|
+
};
|
|
1634
|
+
};
|
|
1635
|
+
/** Hand the run's computer back to the agent, or answer its ask for the owner (POST /runs/{run_id}/computer/hand-back). */
|
|
1636
|
+
export type HandBackRunComputerBody = {
|
|
1637
|
+
outcome?: "done" | "cancelled";
|
|
1638
|
+
};
|
|
1639
|
+
export type HandBackRunComputerResponse = {
|
|
1640
|
+
hold: "agent" | "pending" | "person";
|
|
1641
|
+
outcome?: "done" | "cancelled" | "expired";
|
|
1642
|
+
};
|
|
1643
|
+
/** The run's learning whole: its seed, merge, verdict, problems and cost (GET /runs/{run_id}/learning). */
|
|
1644
|
+
export type GetRunLearningResponse = {
|
|
1645
|
+
run: string;
|
|
1646
|
+
state: "seeded" | "reflecting" | "proposed" | "merged" | "dropped";
|
|
1647
|
+
reason: "seed_failed" | "no_budget" | "unknown_cost" | "cancelled" | "crashed" | "reflect_timeout" | "reflect_failed" | "empty" | "unparsed" | "propose_failed" | "checker" | "grader" | "grade_failed" | null;
|
|
1648
|
+
detail: string | null;
|
|
1649
|
+
at: string;
|
|
1650
|
+
seed: string | null;
|
|
1651
|
+
merged: string | null;
|
|
1652
|
+
pending: Array<{
|
|
1653
|
+
file: string;
|
|
1654
|
+
name: string;
|
|
1655
|
+
}>;
|
|
1656
|
+
verdict: {
|
|
1657
|
+
merge: boolean;
|
|
1658
|
+
reason: string;
|
|
1659
|
+
items: Array<{
|
|
1660
|
+
file: string;
|
|
1661
|
+
keep: boolean;
|
|
1662
|
+
pending?: true;
|
|
1663
|
+
origin?: "you" | "run";
|
|
1664
|
+
question?: string;
|
|
1665
|
+
why: string;
|
|
1666
|
+
}>;
|
|
1667
|
+
} | null;
|
|
1668
|
+
problems: Array<{
|
|
1669
|
+
rule: string;
|
|
1670
|
+
path?: string;
|
|
1671
|
+
detail: string;
|
|
1672
|
+
}>;
|
|
1673
|
+
cost_usd: {
|
|
1674
|
+
grade: number | null;
|
|
1675
|
+
};
|
|
1676
|
+
tokens: {
|
|
1677
|
+
grade: {
|
|
1678
|
+
input: number;
|
|
1679
|
+
cache_read: number;
|
|
1680
|
+
cache_write: number;
|
|
1681
|
+
output: number;
|
|
1682
|
+
} | null;
|
|
1683
|
+
};
|
|
1684
|
+
given?: Array<{
|
|
1685
|
+
file: string;
|
|
1686
|
+
name: string;
|
|
1687
|
+
}>;
|
|
1688
|
+
read?: Array<{
|
|
1689
|
+
file: string;
|
|
1690
|
+
name: string;
|
|
1691
|
+
}>;
|
|
1692
|
+
learned?: Array<{
|
|
1693
|
+
file: string;
|
|
1694
|
+
name: string;
|
|
1695
|
+
supersedes: Array<string>;
|
|
1696
|
+
}>;
|
|
1697
|
+
skills?: Array<{
|
|
1698
|
+
file: string;
|
|
1699
|
+
name: string;
|
|
1700
|
+
pending?: true;
|
|
1701
|
+
}>;
|
|
1702
|
+
workflows?: Array<{
|
|
1703
|
+
file: string;
|
|
1704
|
+
name: string;
|
|
1705
|
+
pending?: true;
|
|
1706
|
+
}>;
|
|
1707
|
+
} | null;
|
|
1708
|
+
/** What the run proposed, file by file (GET /runs/{run_id}/learning/diff). */
|
|
1709
|
+
export type GetRunLearningDiffResponse = {
|
|
1710
|
+
base: string | null;
|
|
1711
|
+
head: string | null;
|
|
1712
|
+
files: Array<{
|
|
1713
|
+
path: string;
|
|
1714
|
+
status: "added" | "modified" | "deleted";
|
|
1715
|
+
patch?: string;
|
|
1716
|
+
withheld?: "too_large" | "secret";
|
|
1717
|
+
}>;
|
|
1718
|
+
};
|
|
1719
|
+
/** Every agent's runs, newest first (GET /runs). */
|
|
1720
|
+
export interface ListAllRunsParams {
|
|
1721
|
+
limit?: number;
|
|
1722
|
+
cursor?: string;
|
|
1723
|
+
agent?: string;
|
|
1724
|
+
revision?: string;
|
|
1725
|
+
status?: "queued" | "working" | "paused" | "input_required" | "completed" | "failed" | "cancelled";
|
|
1726
|
+
archived?: boolean;
|
|
1727
|
+
}
|
|
1728
|
+
export type ListAllRunsResponse = RunList;
|
|
1729
|
+
/** Send the run a message (POST /runs/{run_id}/messages). */
|
|
1730
|
+
export type SendMessageBody = MessageCreate;
|
|
1731
|
+
export interface SendMessageParams {
|
|
1732
|
+
"Idempotency-Key"?: string;
|
|
1733
|
+
}
|
|
1734
|
+
export type SendMessageResponse = MessageResult;
|
|
1735
|
+
/** Pause a workflow run (POST /runs/{run_id}/pause). */
|
|
1736
|
+
export type PauseRunResponse = {
|
|
1737
|
+
run_id: string;
|
|
1738
|
+
paused: boolean;
|
|
1739
|
+
status: RunStatus;
|
|
1740
|
+
};
|
|
1741
|
+
/** Raise a run's spend cap (PATCH /runs/{run_id}). */
|
|
1742
|
+
export type RaiseRunCapBody = {
|
|
1743
|
+
max_cost_usd: number;
|
|
1744
|
+
};
|
|
1745
|
+
export type RaiseRunCapResponse = {
|
|
1746
|
+
run_id: string;
|
|
1747
|
+
max_cost_usd: number;
|
|
1748
|
+
resumed: boolean;
|
|
1749
|
+
message_id?: string;
|
|
1750
|
+
note?: string;
|
|
1751
|
+
status: RunStatus;
|
|
1752
|
+
state: RunState;
|
|
1753
|
+
};
|
|
1754
|
+
/** One file's raw bytes (GET /runs/{run_id}/files/{path}). */
|
|
1755
|
+
export interface ReadRunFileParams {
|
|
1756
|
+
download?: 0 | 1;
|
|
1757
|
+
Range?: string;
|
|
1758
|
+
}
|
|
1759
|
+
/** Resume a paused workflow run (POST /runs/{run_id}/resume). */
|
|
1760
|
+
export type ResumeRunResponse = {
|
|
1761
|
+
run_id: string;
|
|
1762
|
+
paused: boolean;
|
|
1763
|
+
status: RunStatus;
|
|
1764
|
+
};
|
|
1765
|
+
/** Start a run (POST /agents/{agent_id}/runs). */
|
|
1766
|
+
export type CreateRunBody = RunCreate;
|
|
1767
|
+
export interface CreateRunParams {
|
|
1768
|
+
"Idempotency-Key"?: string;
|
|
1769
|
+
}
|
|
1770
|
+
export type CreateRunResponse = Run;
|
|
1771
|
+
/** End the current turn (POST /runs/{run_id}/stop). */
|
|
1772
|
+
export type StopRunResponse = StopResult;
|
|
1773
|
+
/** Take over the run's desktop or phone (POST /runs/{run_id}/computer/take-over). */
|
|
1774
|
+
export type TakeOverRunComputerBody = Record<string, never>;
|
|
1775
|
+
export type TakeOverRunComputerResponse = {
|
|
1776
|
+
hold: "agent" | "pending" | "person";
|
|
1777
|
+
outcome?: "done" | "cancelled" | "expired";
|
|
1778
|
+
};
|
|
1779
|
+
/** The run's timeline, as a page or a stream (GET /runs/{run_id}/timeline). */
|
|
1780
|
+
export interface GetTimelineParams {
|
|
1781
|
+
after?: number;
|
|
1782
|
+
wait_ms?: number;
|
|
1783
|
+
limit?: number;
|
|
1784
|
+
"Last-Event-ID"?: string;
|
|
1785
|
+
}
|
|
1786
|
+
export type GetTimelineResponse = TimelinePage;
|
|
1787
|
+
/** Show the archived run in the lists again (POST /runs/{run_id}/unarchive). */
|
|
1788
|
+
export type UnarchiveRunResponse = Record<string, unknown>;
|
|
1789
|
+
/** What this backend offers (GET /capabilities). */
|
|
1790
|
+
export type GetCapabilitiesResponse = Capabilities;
|
|
1791
|
+
/** Whether this server can serve (GET /health). */
|
|
1792
|
+
export type GetHealthResponse = {
|
|
1793
|
+
status: "ok" | "failing";
|
|
1794
|
+
checks: {
|
|
1795
|
+
store: "ok" | "does_not_open";
|
|
1796
|
+
disk: "ok" | "below_floor" | "cannot_check";
|
|
1797
|
+
};
|
|
1798
|
+
};
|
|
1799
|
+
/** The MCP endpoint: this API's tools, for a coding agent (POST /mcp). */
|
|
1800
|
+
export type CallMcpBody = {
|
|
1801
|
+
jsonrpc: "2.0";
|
|
1802
|
+
id?: string | number;
|
|
1803
|
+
method?: string;
|
|
1804
|
+
params?: Record<string, unknown>;
|
|
1805
|
+
};
|
|
1806
|
+
export type CallMcpResponse = {
|
|
1807
|
+
jsonrpc: "2.0";
|
|
1808
|
+
id: string | number | null;
|
|
1809
|
+
result?: unknown;
|
|
1810
|
+
error?: {
|
|
1811
|
+
code: number;
|
|
1812
|
+
message: string;
|
|
1813
|
+
};
|
|
1814
|
+
};
|
|
1815
|
+
/** This document (GET /openapi.json). */
|
|
1816
|
+
export type GetOpenapiResponse = Record<string, unknown>;
|
|
1817
|
+
/** Counts and cost over every agent and run (GET /stats). */
|
|
1818
|
+
export interface GetStatsParams {
|
|
1819
|
+
from?: string;
|
|
1820
|
+
to?: string;
|
|
1821
|
+
agent?: string;
|
|
1822
|
+
}
|
|
1823
|
+
export type GetStatsResponse = {
|
|
1824
|
+
agents: number;
|
|
1825
|
+
runs: {
|
|
1826
|
+
total: number;
|
|
1827
|
+
active: number;
|
|
1828
|
+
needs_input: number;
|
|
1829
|
+
failed: number;
|
|
1830
|
+
needs_review: number;
|
|
1831
|
+
status_unknown: number;
|
|
1832
|
+
};
|
|
1833
|
+
per_agent: Array<{
|
|
1834
|
+
agent_id: Id;
|
|
1835
|
+
name: string;
|
|
1836
|
+
runs: number;
|
|
1837
|
+
}>;
|
|
1838
|
+
cost: {
|
|
1839
|
+
usd: number | null;
|
|
1840
|
+
basis: "estimate" | null;
|
|
1841
|
+
unknown_runs: number;
|
|
1842
|
+
};
|
|
1843
|
+
archived: {
|
|
1844
|
+
agents: number;
|
|
1845
|
+
runs: number;
|
|
1846
|
+
};
|
|
1847
|
+
analytics: {
|
|
1848
|
+
filter: {
|
|
1849
|
+
from: string | null;
|
|
1850
|
+
to: string | null;
|
|
1851
|
+
agent: string | null;
|
|
1852
|
+
};
|
|
1853
|
+
totals: {
|
|
1854
|
+
runs: number;
|
|
1855
|
+
completed: number;
|
|
1856
|
+
needs_review: number;
|
|
1857
|
+
failed: number;
|
|
1858
|
+
runs_with_metrics: number;
|
|
1859
|
+
tokens: number;
|
|
1860
|
+
cost_usd: number | null;
|
|
1861
|
+
unknown_cost_runs: number;
|
|
1862
|
+
input: number;
|
|
1863
|
+
cache_read: number;
|
|
1864
|
+
cache_write: number;
|
|
1865
|
+
output: number;
|
|
1866
|
+
requests: number;
|
|
1867
|
+
unmetered: number;
|
|
1868
|
+
};
|
|
1869
|
+
time: {
|
|
1870
|
+
ended_runs: number;
|
|
1871
|
+
wall_ms: number;
|
|
1872
|
+
active_runs: number;
|
|
1873
|
+
active_ms: number;
|
|
1874
|
+
};
|
|
1875
|
+
by_harness_effort: Array<{
|
|
1876
|
+
harness: string;
|
|
1877
|
+
effort: string | null;
|
|
1878
|
+
runs: number;
|
|
1879
|
+
completed: number;
|
|
1880
|
+
needs_review: number;
|
|
1881
|
+
failed: number;
|
|
1882
|
+
runs_with_metrics: number;
|
|
1883
|
+
tokens: number;
|
|
1884
|
+
cost_usd: number | null;
|
|
1885
|
+
unknown_cost_runs: number;
|
|
1886
|
+
}>;
|
|
1887
|
+
by_day: Array<{
|
|
1888
|
+
day: string;
|
|
1889
|
+
runs: number;
|
|
1890
|
+
completed: number;
|
|
1891
|
+
needs_review: number;
|
|
1892
|
+
failed: number;
|
|
1893
|
+
runs_with_metrics: number;
|
|
1894
|
+
tokens: number;
|
|
1895
|
+
cost_usd: number | null;
|
|
1896
|
+
unknown_cost_runs: number;
|
|
1897
|
+
}>;
|
|
1898
|
+
by_source: Array<{
|
|
1899
|
+
source: "live" | "claude-code" | "codex" | "pi";
|
|
1900
|
+
runs: number;
|
|
1901
|
+
completed: number;
|
|
1902
|
+
needs_review: number;
|
|
1903
|
+
failed: number;
|
|
1904
|
+
runs_with_metrics: number;
|
|
1905
|
+
tokens: number;
|
|
1906
|
+
cost_usd: number | null;
|
|
1907
|
+
unknown_cost_runs: number;
|
|
1908
|
+
}>;
|
|
1909
|
+
tools: Array<{
|
|
1910
|
+
tool: string;
|
|
1911
|
+
label: string;
|
|
1912
|
+
calls: number;
|
|
1913
|
+
errors: number;
|
|
1914
|
+
}>;
|
|
1915
|
+
};
|
|
1916
|
+
learning: {
|
|
1917
|
+
runs: number;
|
|
1918
|
+
merged: number;
|
|
1919
|
+
dropped: Record<string, number>;
|
|
1920
|
+
in_progress: number;
|
|
1921
|
+
};
|
|
1922
|
+
};
|
|
1923
|
+
/** Apply a template package: make its agent, with its skills, then its triggers (POST /templates/{template}/apply). */
|
|
1924
|
+
export type ApplyTemplateBody = {
|
|
1925
|
+
parameters?: Record<string, unknown>;
|
|
1926
|
+
grants?: Array<string>;
|
|
1927
|
+
overrides?: {
|
|
1928
|
+
model?: string;
|
|
1929
|
+
approvals?: "ask" | "never";
|
|
1930
|
+
};
|
|
1931
|
+
};
|
|
1932
|
+
export interface ApplyTemplateParams {
|
|
1933
|
+
"Idempotency-Key"?: string;
|
|
1934
|
+
}
|
|
1935
|
+
export type ApplyTemplateResponse = {
|
|
1936
|
+
template: string;
|
|
1937
|
+
version: string;
|
|
1938
|
+
agent_id: string;
|
|
1939
|
+
trigger_ids: Array<string>;
|
|
1940
|
+
warnings: Array<InputIssue>;
|
|
1941
|
+
webhook_secrets?: Array<{
|
|
1942
|
+
trigger_id: string;
|
|
1943
|
+
secret: SecretMeta;
|
|
1944
|
+
signing_secret?: string;
|
|
1945
|
+
secret_set?: true;
|
|
1946
|
+
note?: string;
|
|
1947
|
+
}>;
|
|
1948
|
+
};
|
|
1949
|
+
/** The template packages this server ships: each makes an agent, its skills and its triggers (GET /templates). */
|
|
1950
|
+
export type ListTemplatesResponse = {
|
|
1951
|
+
templates: Array<{
|
|
1952
|
+
name: string;
|
|
1953
|
+
display_name: string | null;
|
|
1954
|
+
version: string;
|
|
1955
|
+
description: string;
|
|
1956
|
+
license: string | null;
|
|
1957
|
+
author: {
|
|
1958
|
+
name: string;
|
|
1959
|
+
email?: string;
|
|
1960
|
+
url?: string;
|
|
1961
|
+
} | null;
|
|
1962
|
+
repository: string | null;
|
|
1963
|
+
output: {
|
|
1964
|
+
schema: string;
|
|
1965
|
+
json_schema: Record<string, unknown> | null;
|
|
1966
|
+
} | null;
|
|
1967
|
+
harness: Array<string> | null;
|
|
1968
|
+
model: {
|
|
1969
|
+
tier: "fast" | "balanced" | "strong";
|
|
1970
|
+
prefer?: string;
|
|
1971
|
+
} | null;
|
|
1972
|
+
effort: string | null;
|
|
1973
|
+
tools: Array<string> | null;
|
|
1974
|
+
mcp: Array<{
|
|
1975
|
+
server: string;
|
|
1976
|
+
required: boolean;
|
|
1977
|
+
tools: Array<{
|
|
1978
|
+
name: string;
|
|
1979
|
+
tool: string;
|
|
1980
|
+
asks: "allow" | "ask";
|
|
1981
|
+
pin?: Record<string, string | number | boolean | null | Array<string | number | boolean | null>>;
|
|
1982
|
+
}>;
|
|
1983
|
+
}>;
|
|
1984
|
+
parameters: Record<string, {
|
|
1985
|
+
type: "string" | "number" | "integer" | "boolean";
|
|
1986
|
+
required: boolean;
|
|
1987
|
+
description: string;
|
|
1988
|
+
pattern?: string;
|
|
1989
|
+
enum?: Array<string | number | boolean>;
|
|
1990
|
+
default?: string | number | boolean;
|
|
1991
|
+
}>;
|
|
1992
|
+
secrets: Array<string>;
|
|
1993
|
+
budget: {
|
|
1994
|
+
per_run_usd: number;
|
|
1995
|
+
} | null;
|
|
1996
|
+
learning: boolean;
|
|
1997
|
+
approvals_default: "ask" | "never";
|
|
1998
|
+
triggers: Array<Record<string, unknown>>;
|
|
1999
|
+
skills: Array<string>;
|
|
2000
|
+
evals: Array<string>;
|
|
2001
|
+
}>;
|
|
2002
|
+
};
|
|
2003
|
+
/** Forget a tool key's stored fields (DELETE /settings/tool-keys/{key_id}). */
|
|
2004
|
+
/** The tool keys a person may save, and which are set: names only, never a value (GET /settings/tool-keys). */
|
|
2005
|
+
export type ListToolKeysResponse = {
|
|
2006
|
+
keys: Array<{
|
|
2007
|
+
id: "parallel" | "monid" | "browserbase" | "kernel" | "typesafe" | "anthropic" | "openai" | "openrouter";
|
|
2008
|
+
kind: "tool" | "model";
|
|
2009
|
+
label: string;
|
|
2010
|
+
unlocks: Array<string>;
|
|
2011
|
+
harnesses: Array<"pi" | "claude-agent" | "codex" | "opencode">;
|
|
2012
|
+
fields: Array<{
|
|
2013
|
+
name: string;
|
|
2014
|
+
set: boolean;
|
|
2015
|
+
source: "server" | "stored" | null;
|
|
2016
|
+
stored_unreadable?: true;
|
|
2017
|
+
}>;
|
|
2018
|
+
secrets: Array<SecretMeta>;
|
|
2019
|
+
check: {
|
|
2020
|
+
state: "accepted";
|
|
2021
|
+
at: string;
|
|
2022
|
+
} | {
|
|
2023
|
+
state: "refused";
|
|
2024
|
+
reason: string;
|
|
2025
|
+
at: string;
|
|
2026
|
+
} | {
|
|
2027
|
+
state: "not_checked";
|
|
2028
|
+
reason: string;
|
|
2029
|
+
at?: string;
|
|
2030
|
+
} | null;
|
|
2031
|
+
}>;
|
|
2032
|
+
reenter: {
|
|
2033
|
+
reason: "seal_key_missing" | "seal_key_changed" | "file_unreadable";
|
|
2034
|
+
fields: Array<string>;
|
|
2035
|
+
} | null;
|
|
2036
|
+
};
|
|
2037
|
+
/** Save a tool key's fields, sealed (PUT /settings/tool-keys/{key_id}). Its body's string values are secrets: each copy is cut from the answer, and a refusal keeps only its code. */
|
|
2038
|
+
export type SaveToolKeyBody = {
|
|
2039
|
+
values: Record<string, string>;
|
|
2040
|
+
};
|
|
2041
|
+
/** The server's tool settings (GET /settings/tools). */
|
|
2042
|
+
export type GetToolSettingsResponse = {
|
|
2043
|
+
web_search: {
|
|
2044
|
+
provider: "auto" | "native" | "exa-keyless" | "parallel" | "off";
|
|
2045
|
+
permission?: "allow" | "ask" | "deny";
|
|
2046
|
+
};
|
|
2047
|
+
web_fetch: {
|
|
2048
|
+
provider: "kernel" | "parallel";
|
|
2049
|
+
permission?: "allow" | "ask" | "deny";
|
|
2050
|
+
};
|
|
2051
|
+
browser: {
|
|
2052
|
+
provider: "auto" | "browserbase" | "kernel" | "chrome";
|
|
2053
|
+
permission?: "allow" | "ask" | "deny";
|
|
2054
|
+
};
|
|
2055
|
+
[key: string]: unknown;
|
|
2056
|
+
};
|
|
2057
|
+
/** Set the providers of web_search, web_fetch and browser, and each tool's permission (PUT /settings/tools). */
|
|
2058
|
+
export type PutToolSettingsBody = {
|
|
2059
|
+
read?: {
|
|
2060
|
+
permission?: "allow" | "ask" | "deny";
|
|
2061
|
+
};
|
|
2062
|
+
write?: {
|
|
2063
|
+
permission?: "allow" | "ask" | "deny";
|
|
2064
|
+
};
|
|
2065
|
+
edit?: {
|
|
2066
|
+
permission?: "allow" | "ask" | "deny";
|
|
2067
|
+
};
|
|
2068
|
+
bash?: {
|
|
2069
|
+
permission?: "allow" | "ask" | "deny";
|
|
2070
|
+
};
|
|
2071
|
+
ask_person?: {
|
|
2072
|
+
permission?: "allow" | "deny";
|
|
2073
|
+
};
|
|
2074
|
+
web_fetch?: {
|
|
2075
|
+
provider?: "kernel" | "parallel";
|
|
2076
|
+
permission?: "allow" | "ask" | "deny";
|
|
2077
|
+
};
|
|
2078
|
+
web_search?: {
|
|
2079
|
+
provider?: "auto" | "native" | "exa-keyless" | "parallel" | "off";
|
|
2080
|
+
permission?: "allow" | "ask" | "deny";
|
|
2081
|
+
};
|
|
2082
|
+
browser?: {
|
|
2083
|
+
provider?: "auto" | "browserbase" | "kernel" | "chrome";
|
|
2084
|
+
permission?: "allow" | "deny";
|
|
2085
|
+
};
|
|
2086
|
+
pdf_pages?: {
|
|
2087
|
+
permission?: "allow" | "deny";
|
|
2088
|
+
};
|
|
2089
|
+
llm?: {
|
|
2090
|
+
permission?: "allow" | "deny";
|
|
2091
|
+
};
|
|
2092
|
+
desktop?: {
|
|
2093
|
+
permission?: "allow" | "deny";
|
|
2094
|
+
};
|
|
2095
|
+
phone?: {
|
|
2096
|
+
permission?: "allow" | "deny";
|
|
2097
|
+
};
|
|
2098
|
+
[key: string]: unknown;
|
|
2099
|
+
};
|
|
2100
|
+
export type PutToolSettingsResponse = {
|
|
2101
|
+
web_search: {
|
|
2102
|
+
provider: "auto" | "native" | "exa-keyless" | "parallel" | "off";
|
|
2103
|
+
permission?: "allow" | "ask" | "deny";
|
|
2104
|
+
};
|
|
2105
|
+
web_fetch: {
|
|
2106
|
+
provider: "kernel" | "parallel";
|
|
2107
|
+
permission?: "allow" | "ask" | "deny";
|
|
2108
|
+
};
|
|
2109
|
+
browser: {
|
|
2110
|
+
provider: "auto" | "browserbase" | "kernel" | "chrome";
|
|
2111
|
+
permission?: "allow" | "ask" | "deny";
|
|
2112
|
+
};
|
|
2113
|
+
[key: string]: unknown;
|
|
2114
|
+
};
|
|
2115
|
+
/** Make a trigger: a schedule or a signed webhook that starts a capped run of an agent, or messages a run (POST /triggers). */
|
|
2116
|
+
export type CreateTriggerBody = {
|
|
2117
|
+
name?: string;
|
|
2118
|
+
enabled?: boolean;
|
|
2119
|
+
source: {
|
|
2120
|
+
kind: "schedule";
|
|
2121
|
+
cron: string;
|
|
2122
|
+
timezone?: string;
|
|
2123
|
+
} | {
|
|
2124
|
+
kind: "schedule";
|
|
2125
|
+
at: string;
|
|
2126
|
+
} | {
|
|
2127
|
+
kind: "schedule";
|
|
2128
|
+
every_s: number;
|
|
2129
|
+
start_at?: string;
|
|
2130
|
+
} | {
|
|
2131
|
+
kind: "webhook";
|
|
2132
|
+
signature?: "standard" | "github";
|
|
2133
|
+
accept?: Array<{
|
|
2134
|
+
event: string;
|
|
2135
|
+
actions?: Array<string>;
|
|
2136
|
+
where?: Array<{
|
|
2137
|
+
pointer: string;
|
|
2138
|
+
in: Array<unknown>;
|
|
2139
|
+
} | {
|
|
2140
|
+
pointer: string;
|
|
2141
|
+
exists: boolean;
|
|
2142
|
+
} | {
|
|
2143
|
+
pointer: string;
|
|
2144
|
+
prefix: string;
|
|
2145
|
+
}>;
|
|
2146
|
+
}>;
|
|
2147
|
+
} | {
|
|
2148
|
+
kind: "github";
|
|
2149
|
+
accept: Array<{
|
|
2150
|
+
event: string;
|
|
2151
|
+
actions?: Array<string>;
|
|
2152
|
+
where?: Array<{
|
|
2153
|
+
pointer: string;
|
|
2154
|
+
in: Array<unknown>;
|
|
2155
|
+
} | {
|
|
2156
|
+
pointer: string;
|
|
2157
|
+
exists: boolean;
|
|
2158
|
+
} | {
|
|
2159
|
+
pointer: string;
|
|
2160
|
+
prefix: string;
|
|
2161
|
+
}>;
|
|
2162
|
+
}>;
|
|
2163
|
+
};
|
|
2164
|
+
target: {
|
|
2165
|
+
kind: "start_run";
|
|
2166
|
+
agent_id: string;
|
|
2167
|
+
input: Record<string, unknown>;
|
|
2168
|
+
effort?: Effort;
|
|
2169
|
+
max_cost_usd?: number;
|
|
2170
|
+
} | {
|
|
2171
|
+
kind: "message_run";
|
|
2172
|
+
run_id: string;
|
|
2173
|
+
input: {
|
|
2174
|
+
content: string;
|
|
2175
|
+
};
|
|
2176
|
+
};
|
|
2177
|
+
catchup_window_s?: number;
|
|
2178
|
+
max_active_runs?: number | null;
|
|
2179
|
+
};
|
|
2180
|
+
export interface CreateTriggerParams {
|
|
2181
|
+
"Idempotency-Key"?: string;
|
|
2182
|
+
}
|
|
2183
|
+
export type CreateTriggerResponse = {
|
|
2184
|
+
id: string;
|
|
2185
|
+
name: string;
|
|
2186
|
+
enabled: boolean;
|
|
2187
|
+
source: {
|
|
2188
|
+
kind: "schedule";
|
|
2189
|
+
cron: string;
|
|
2190
|
+
timezone: string;
|
|
2191
|
+
} | {
|
|
2192
|
+
kind: "schedule";
|
|
2193
|
+
at: string;
|
|
2194
|
+
} | {
|
|
2195
|
+
kind: "schedule";
|
|
2196
|
+
every_s: number;
|
|
2197
|
+
start_at: string;
|
|
2198
|
+
} | {
|
|
2199
|
+
kind: "webhook";
|
|
2200
|
+
signature?: "standard" | "github";
|
|
2201
|
+
accept?: Array<{
|
|
2202
|
+
event: string;
|
|
2203
|
+
actions?: Array<string>;
|
|
2204
|
+
where?: Array<{
|
|
2205
|
+
pointer: string;
|
|
2206
|
+
in: Array<unknown>;
|
|
2207
|
+
} | {
|
|
2208
|
+
pointer: string;
|
|
2209
|
+
exists: boolean;
|
|
2210
|
+
} | {
|
|
2211
|
+
pointer: string;
|
|
2212
|
+
prefix: string;
|
|
2213
|
+
}>;
|
|
2214
|
+
}>;
|
|
2215
|
+
} | {
|
|
2216
|
+
kind: "github";
|
|
2217
|
+
accept: Array<{
|
|
2218
|
+
event: string;
|
|
2219
|
+
actions?: Array<string>;
|
|
2220
|
+
where?: Array<{
|
|
2221
|
+
pointer: string;
|
|
2222
|
+
in: Array<unknown>;
|
|
2223
|
+
} | {
|
|
2224
|
+
pointer: string;
|
|
2225
|
+
exists: boolean;
|
|
2226
|
+
} | {
|
|
2227
|
+
pointer: string;
|
|
2228
|
+
prefix: string;
|
|
2229
|
+
}>;
|
|
2230
|
+
}>;
|
|
2231
|
+
};
|
|
2232
|
+
target: {
|
|
2233
|
+
kind: "start_run";
|
|
2234
|
+
agent_id: string;
|
|
2235
|
+
input: Record<string, unknown>;
|
|
2236
|
+
effort?: Effort;
|
|
2237
|
+
max_cost_usd?: number;
|
|
2238
|
+
} | {
|
|
2239
|
+
kind: "message_run";
|
|
2240
|
+
run_id: string;
|
|
2241
|
+
input: {
|
|
2242
|
+
content: string;
|
|
2243
|
+
};
|
|
2244
|
+
};
|
|
2245
|
+
catchup_window_s: number;
|
|
2246
|
+
max_active_runs: number | null;
|
|
2247
|
+
failures_in_a_row: number;
|
|
2248
|
+
disabled: {
|
|
2249
|
+
at: string;
|
|
2250
|
+
reason: "auto_paused";
|
|
2251
|
+
} | {
|
|
2252
|
+
at: string;
|
|
2253
|
+
reason: "source_unreadable";
|
|
2254
|
+
detail: string;
|
|
2255
|
+
} | {
|
|
2256
|
+
at: string;
|
|
2257
|
+
reason: "agent_archived";
|
|
2258
|
+
detail: string;
|
|
2259
|
+
} | {
|
|
2260
|
+
at: string;
|
|
2261
|
+
reason: "connection_lost";
|
|
2262
|
+
detail: string;
|
|
2263
|
+
} | null;
|
|
2264
|
+
next_at: string | null;
|
|
2265
|
+
last_run_id: string | null;
|
|
2266
|
+
created_at: string;
|
|
2267
|
+
updated_at: string;
|
|
2268
|
+
last_firing: {
|
|
2269
|
+
key: string;
|
|
2270
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
2271
|
+
nominal_at: string;
|
|
2272
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
2273
|
+
at: string;
|
|
2274
|
+
run_id: string | null;
|
|
2275
|
+
reason: string | null;
|
|
2276
|
+
error: {
|
|
2277
|
+
code: string;
|
|
2278
|
+
message: string;
|
|
2279
|
+
} | null;
|
|
2280
|
+
count?: number;
|
|
2281
|
+
attempts?: number;
|
|
2282
|
+
retry_at?: string;
|
|
2283
|
+
catch_up?: true;
|
|
2284
|
+
} | null;
|
|
2285
|
+
hook_url?: string;
|
|
2286
|
+
secret?: SecretMeta;
|
|
2287
|
+
signing_secret?: string;
|
|
2288
|
+
secret_set?: true;
|
|
2289
|
+
note?: string;
|
|
2290
|
+
};
|
|
2291
|
+
/** Delete a trigger and its firings; the runs it started stay (DELETE /triggers/{trigger_id}). */
|
|
2292
|
+
/** Run it now: one firing per Idempotency-Key (POST /triggers/{trigger_id}/fire). */
|
|
2293
|
+
export interface FireTriggerParams {
|
|
2294
|
+
"Idempotency-Key": string;
|
|
2295
|
+
}
|
|
2296
|
+
export type FireTriggerResponse = {
|
|
2297
|
+
key: string;
|
|
2298
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
2299
|
+
nominal_at: string;
|
|
2300
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
2301
|
+
at: string;
|
|
2302
|
+
run_id: string | null;
|
|
2303
|
+
reason: string | null;
|
|
2304
|
+
error: {
|
|
2305
|
+
code: string;
|
|
2306
|
+
message: string;
|
|
2307
|
+
} | null;
|
|
2308
|
+
count?: number;
|
|
2309
|
+
attempts?: number;
|
|
2310
|
+
retry_at?: string;
|
|
2311
|
+
catch_up?: true;
|
|
2312
|
+
};
|
|
2313
|
+
/** The trigger's last 200 firings, newest first (GET /triggers/{trigger_id}/firings). */
|
|
2314
|
+
export type ListTriggerFiringsResponse = {
|
|
2315
|
+
firings: Array<{
|
|
2316
|
+
key: string;
|
|
2317
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
2318
|
+
nominal_at: string;
|
|
2319
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
2320
|
+
at: string;
|
|
2321
|
+
run_id: string | null;
|
|
2322
|
+
reason: string | null;
|
|
2323
|
+
error: {
|
|
2324
|
+
code: string;
|
|
2325
|
+
message: string;
|
|
2326
|
+
} | null;
|
|
2327
|
+
count?: number;
|
|
2328
|
+
attempts?: number;
|
|
2329
|
+
retry_at?: string;
|
|
2330
|
+
catch_up?: true;
|
|
2331
|
+
}>;
|
|
2332
|
+
};
|
|
2333
|
+
/** One trigger (GET /triggers/{trigger_id}). */
|
|
2334
|
+
export type GetTriggerResponse = {
|
|
2335
|
+
id: string;
|
|
2336
|
+
name: string;
|
|
2337
|
+
enabled: boolean;
|
|
2338
|
+
source: {
|
|
2339
|
+
kind: "schedule";
|
|
2340
|
+
cron: string;
|
|
2341
|
+
timezone: string;
|
|
2342
|
+
} | {
|
|
2343
|
+
kind: "schedule";
|
|
2344
|
+
at: string;
|
|
2345
|
+
} | {
|
|
2346
|
+
kind: "schedule";
|
|
2347
|
+
every_s: number;
|
|
2348
|
+
start_at: string;
|
|
2349
|
+
} | {
|
|
2350
|
+
kind: "webhook";
|
|
2351
|
+
signature?: "standard" | "github";
|
|
2352
|
+
accept?: Array<{
|
|
2353
|
+
event: string;
|
|
2354
|
+
actions?: Array<string>;
|
|
2355
|
+
where?: Array<{
|
|
2356
|
+
pointer: string;
|
|
2357
|
+
in: Array<unknown>;
|
|
2358
|
+
} | {
|
|
2359
|
+
pointer: string;
|
|
2360
|
+
exists: boolean;
|
|
2361
|
+
} | {
|
|
2362
|
+
pointer: string;
|
|
2363
|
+
prefix: string;
|
|
2364
|
+
}>;
|
|
2365
|
+
}>;
|
|
2366
|
+
} | {
|
|
2367
|
+
kind: "github";
|
|
2368
|
+
accept: Array<{
|
|
2369
|
+
event: string;
|
|
2370
|
+
actions?: Array<string>;
|
|
2371
|
+
where?: Array<{
|
|
2372
|
+
pointer: string;
|
|
2373
|
+
in: Array<unknown>;
|
|
2374
|
+
} | {
|
|
2375
|
+
pointer: string;
|
|
2376
|
+
exists: boolean;
|
|
2377
|
+
} | {
|
|
2378
|
+
pointer: string;
|
|
2379
|
+
prefix: string;
|
|
2380
|
+
}>;
|
|
2381
|
+
}>;
|
|
2382
|
+
};
|
|
2383
|
+
target: {
|
|
2384
|
+
kind: "start_run";
|
|
2385
|
+
agent_id: string;
|
|
2386
|
+
input: Record<string, unknown>;
|
|
2387
|
+
effort?: Effort;
|
|
2388
|
+
max_cost_usd?: number;
|
|
2389
|
+
} | {
|
|
2390
|
+
kind: "message_run";
|
|
2391
|
+
run_id: string;
|
|
2392
|
+
input: {
|
|
2393
|
+
content: string;
|
|
2394
|
+
};
|
|
2395
|
+
};
|
|
2396
|
+
catchup_window_s: number;
|
|
2397
|
+
max_active_runs: number | null;
|
|
2398
|
+
failures_in_a_row: number;
|
|
2399
|
+
disabled: {
|
|
2400
|
+
at: string;
|
|
2401
|
+
reason: "auto_paused";
|
|
2402
|
+
} | {
|
|
2403
|
+
at: string;
|
|
2404
|
+
reason: "source_unreadable";
|
|
2405
|
+
detail: string;
|
|
2406
|
+
} | {
|
|
2407
|
+
at: string;
|
|
2408
|
+
reason: "agent_archived";
|
|
2409
|
+
detail: string;
|
|
2410
|
+
} | {
|
|
2411
|
+
at: string;
|
|
2412
|
+
reason: "connection_lost";
|
|
2413
|
+
detail: string;
|
|
2414
|
+
} | null;
|
|
2415
|
+
next_at: string | null;
|
|
2416
|
+
last_run_id: string | null;
|
|
2417
|
+
created_at: string;
|
|
2418
|
+
updated_at: string;
|
|
2419
|
+
last_firing: {
|
|
2420
|
+
key: string;
|
|
2421
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
2422
|
+
nominal_at: string;
|
|
2423
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
2424
|
+
at: string;
|
|
2425
|
+
run_id: string | null;
|
|
2426
|
+
reason: string | null;
|
|
2427
|
+
error: {
|
|
2428
|
+
code: string;
|
|
2429
|
+
message: string;
|
|
2430
|
+
} | null;
|
|
2431
|
+
count?: number;
|
|
2432
|
+
attempts?: number;
|
|
2433
|
+
retry_at?: string;
|
|
2434
|
+
catch_up?: true;
|
|
2435
|
+
} | null;
|
|
2436
|
+
hook_url?: string;
|
|
2437
|
+
secret?: SecretMeta;
|
|
2438
|
+
note?: string;
|
|
2439
|
+
};
|
|
2440
|
+
/** The triggers: schedules and signed webhooks that start an agent's capped runs or message a run (GET /triggers). */
|
|
2441
|
+
export type ListTriggersResponse = {
|
|
2442
|
+
triggers: Array<{
|
|
2443
|
+
id: string;
|
|
2444
|
+
name: string;
|
|
2445
|
+
enabled: boolean;
|
|
2446
|
+
source: {
|
|
2447
|
+
kind: "schedule";
|
|
2448
|
+
cron: string;
|
|
2449
|
+
timezone: string;
|
|
2450
|
+
} | {
|
|
2451
|
+
kind: "schedule";
|
|
2452
|
+
at: string;
|
|
2453
|
+
} | {
|
|
2454
|
+
kind: "schedule";
|
|
2455
|
+
every_s: number;
|
|
2456
|
+
start_at: string;
|
|
2457
|
+
} | {
|
|
2458
|
+
kind: "webhook";
|
|
2459
|
+
signature?: "standard" | "github";
|
|
2460
|
+
accept?: Array<{
|
|
2461
|
+
event: string;
|
|
2462
|
+
actions?: Array<string>;
|
|
2463
|
+
where?: Array<{
|
|
2464
|
+
pointer: string;
|
|
2465
|
+
in: Array<unknown>;
|
|
2466
|
+
} | {
|
|
2467
|
+
pointer: string;
|
|
2468
|
+
exists: boolean;
|
|
2469
|
+
} | {
|
|
2470
|
+
pointer: string;
|
|
2471
|
+
prefix: string;
|
|
2472
|
+
}>;
|
|
2473
|
+
}>;
|
|
2474
|
+
} | {
|
|
2475
|
+
kind: "github";
|
|
2476
|
+
accept: Array<{
|
|
2477
|
+
event: string;
|
|
2478
|
+
actions?: Array<string>;
|
|
2479
|
+
where?: Array<{
|
|
2480
|
+
pointer: string;
|
|
2481
|
+
in: Array<unknown>;
|
|
2482
|
+
} | {
|
|
2483
|
+
pointer: string;
|
|
2484
|
+
exists: boolean;
|
|
2485
|
+
} | {
|
|
2486
|
+
pointer: string;
|
|
2487
|
+
prefix: string;
|
|
2488
|
+
}>;
|
|
2489
|
+
}>;
|
|
2490
|
+
};
|
|
2491
|
+
target: {
|
|
2492
|
+
kind: "start_run";
|
|
2493
|
+
agent_id: string;
|
|
2494
|
+
input: Record<string, unknown>;
|
|
2495
|
+
effort?: Effort;
|
|
2496
|
+
max_cost_usd?: number;
|
|
2497
|
+
} | {
|
|
2498
|
+
kind: "message_run";
|
|
2499
|
+
run_id: string;
|
|
2500
|
+
input: {
|
|
2501
|
+
content: string;
|
|
2502
|
+
};
|
|
2503
|
+
};
|
|
2504
|
+
catchup_window_s: number;
|
|
2505
|
+
max_active_runs: number | null;
|
|
2506
|
+
failures_in_a_row: number;
|
|
2507
|
+
disabled: {
|
|
2508
|
+
at: string;
|
|
2509
|
+
reason: "auto_paused";
|
|
2510
|
+
} | {
|
|
2511
|
+
at: string;
|
|
2512
|
+
reason: "source_unreadable";
|
|
2513
|
+
detail: string;
|
|
2514
|
+
} | {
|
|
2515
|
+
at: string;
|
|
2516
|
+
reason: "agent_archived";
|
|
2517
|
+
detail: string;
|
|
2518
|
+
} | {
|
|
2519
|
+
at: string;
|
|
2520
|
+
reason: "connection_lost";
|
|
2521
|
+
detail: string;
|
|
2522
|
+
} | null;
|
|
2523
|
+
next_at: string | null;
|
|
2524
|
+
last_run_id: string | null;
|
|
2525
|
+
created_at: string;
|
|
2526
|
+
updated_at: string;
|
|
2527
|
+
last_firing: {
|
|
2528
|
+
key: string;
|
|
2529
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
2530
|
+
nominal_at: string;
|
|
2531
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
2532
|
+
at: string;
|
|
2533
|
+
run_id: string | null;
|
|
2534
|
+
reason: string | null;
|
|
2535
|
+
error: {
|
|
2536
|
+
code: string;
|
|
2537
|
+
message: string;
|
|
2538
|
+
} | null;
|
|
2539
|
+
count?: number;
|
|
2540
|
+
attempts?: number;
|
|
2541
|
+
retry_at?: string;
|
|
2542
|
+
catch_up?: true;
|
|
2543
|
+
} | null;
|
|
2544
|
+
hook_url?: string;
|
|
2545
|
+
secret?: SecretMeta;
|
|
2546
|
+
note?: string;
|
|
2547
|
+
}>;
|
|
2548
|
+
};
|
|
2549
|
+
/** A webhook trigger's new secret, shown once; the old one signs nothing from now on (POST /triggers/{trigger_id}/secret). */
|
|
2550
|
+
export type RotateTriggerSecretResponse = {
|
|
2551
|
+
secret: SecretMeta;
|
|
2552
|
+
signing_secret: string;
|
|
2553
|
+
};
|
|
2554
|
+
/** Change a trigger, or turn it off and on (PATCH /triggers/{trigger_id}). */
|
|
2555
|
+
export type UpdateTriggerBody = {
|
|
2556
|
+
name?: string;
|
|
2557
|
+
enabled?: boolean;
|
|
2558
|
+
source?: {
|
|
2559
|
+
kind: "schedule";
|
|
2560
|
+
cron: string;
|
|
2561
|
+
timezone?: string;
|
|
2562
|
+
} | {
|
|
2563
|
+
kind: "schedule";
|
|
2564
|
+
at: string;
|
|
2565
|
+
} | {
|
|
2566
|
+
kind: "schedule";
|
|
2567
|
+
every_s: number;
|
|
2568
|
+
start_at?: string;
|
|
2569
|
+
} | {
|
|
2570
|
+
kind: "webhook";
|
|
2571
|
+
signature?: "standard" | "github";
|
|
2572
|
+
accept?: Array<{
|
|
2573
|
+
event: string;
|
|
2574
|
+
actions?: Array<string>;
|
|
2575
|
+
where?: Array<{
|
|
2576
|
+
pointer: string;
|
|
2577
|
+
in: Array<unknown>;
|
|
2578
|
+
} | {
|
|
2579
|
+
pointer: string;
|
|
2580
|
+
exists: boolean;
|
|
2581
|
+
} | {
|
|
2582
|
+
pointer: string;
|
|
2583
|
+
prefix: string;
|
|
2584
|
+
}>;
|
|
2585
|
+
}>;
|
|
2586
|
+
} | {
|
|
2587
|
+
kind: "github";
|
|
2588
|
+
accept: Array<{
|
|
2589
|
+
event: string;
|
|
2590
|
+
actions?: Array<string>;
|
|
2591
|
+
where?: Array<{
|
|
2592
|
+
pointer: string;
|
|
2593
|
+
in: Array<unknown>;
|
|
2594
|
+
} | {
|
|
2595
|
+
pointer: string;
|
|
2596
|
+
exists: boolean;
|
|
2597
|
+
} | {
|
|
2598
|
+
pointer: string;
|
|
2599
|
+
prefix: string;
|
|
2600
|
+
}>;
|
|
2601
|
+
}>;
|
|
2602
|
+
};
|
|
2603
|
+
target?: {
|
|
2604
|
+
kind: "start_run";
|
|
2605
|
+
agent_id: string;
|
|
2606
|
+
input: Record<string, unknown>;
|
|
2607
|
+
effort?: Effort;
|
|
2608
|
+
max_cost_usd?: number;
|
|
2609
|
+
} | {
|
|
2610
|
+
kind: "message_run";
|
|
2611
|
+
run_id: string;
|
|
2612
|
+
input: {
|
|
2613
|
+
content: string;
|
|
2614
|
+
};
|
|
2615
|
+
};
|
|
2616
|
+
catchup_window_s?: number;
|
|
2617
|
+
max_active_runs?: number | null;
|
|
2618
|
+
};
|
|
2619
|
+
export type UpdateTriggerResponse = {
|
|
2620
|
+
id: string;
|
|
2621
|
+
name: string;
|
|
2622
|
+
enabled: boolean;
|
|
2623
|
+
source: {
|
|
2624
|
+
kind: "schedule";
|
|
2625
|
+
cron: string;
|
|
2626
|
+
timezone: string;
|
|
2627
|
+
} | {
|
|
2628
|
+
kind: "schedule";
|
|
2629
|
+
at: string;
|
|
2630
|
+
} | {
|
|
2631
|
+
kind: "schedule";
|
|
2632
|
+
every_s: number;
|
|
2633
|
+
start_at: string;
|
|
2634
|
+
} | {
|
|
2635
|
+
kind: "webhook";
|
|
2636
|
+
signature?: "standard" | "github";
|
|
2637
|
+
accept?: Array<{
|
|
2638
|
+
event: string;
|
|
2639
|
+
actions?: Array<string>;
|
|
2640
|
+
where?: Array<{
|
|
2641
|
+
pointer: string;
|
|
2642
|
+
in: Array<unknown>;
|
|
2643
|
+
} | {
|
|
2644
|
+
pointer: string;
|
|
2645
|
+
exists: boolean;
|
|
2646
|
+
} | {
|
|
2647
|
+
pointer: string;
|
|
2648
|
+
prefix: string;
|
|
2649
|
+
}>;
|
|
2650
|
+
}>;
|
|
2651
|
+
} | {
|
|
2652
|
+
kind: "github";
|
|
2653
|
+
accept: Array<{
|
|
2654
|
+
event: string;
|
|
2655
|
+
actions?: Array<string>;
|
|
2656
|
+
where?: Array<{
|
|
2657
|
+
pointer: string;
|
|
2658
|
+
in: Array<unknown>;
|
|
2659
|
+
} | {
|
|
2660
|
+
pointer: string;
|
|
2661
|
+
exists: boolean;
|
|
2662
|
+
} | {
|
|
2663
|
+
pointer: string;
|
|
2664
|
+
prefix: string;
|
|
2665
|
+
}>;
|
|
2666
|
+
}>;
|
|
2667
|
+
};
|
|
2668
|
+
target: {
|
|
2669
|
+
kind: "start_run";
|
|
2670
|
+
agent_id: string;
|
|
2671
|
+
input: Record<string, unknown>;
|
|
2672
|
+
effort?: Effort;
|
|
2673
|
+
max_cost_usd?: number;
|
|
2674
|
+
} | {
|
|
2675
|
+
kind: "message_run";
|
|
2676
|
+
run_id: string;
|
|
2677
|
+
input: {
|
|
2678
|
+
content: string;
|
|
2679
|
+
};
|
|
2680
|
+
};
|
|
2681
|
+
catchup_window_s: number;
|
|
2682
|
+
max_active_runs: number | null;
|
|
2683
|
+
failures_in_a_row: number;
|
|
2684
|
+
disabled: {
|
|
2685
|
+
at: string;
|
|
2686
|
+
reason: "auto_paused";
|
|
2687
|
+
} | {
|
|
2688
|
+
at: string;
|
|
2689
|
+
reason: "source_unreadable";
|
|
2690
|
+
detail: string;
|
|
2691
|
+
} | {
|
|
2692
|
+
at: string;
|
|
2693
|
+
reason: "agent_archived";
|
|
2694
|
+
detail: string;
|
|
2695
|
+
} | {
|
|
2696
|
+
at: string;
|
|
2697
|
+
reason: "connection_lost";
|
|
2698
|
+
detail: string;
|
|
2699
|
+
} | null;
|
|
2700
|
+
next_at: string | null;
|
|
2701
|
+
last_run_id: string | null;
|
|
2702
|
+
created_at: string;
|
|
2703
|
+
updated_at: string;
|
|
2704
|
+
last_firing: {
|
|
2705
|
+
key: string;
|
|
2706
|
+
by: "schedule" | "manual" | "webhook" | "github";
|
|
2707
|
+
nominal_at: string;
|
|
2708
|
+
status: "due" | "started" | "sent" | "skipped" | "failed" | "missed";
|
|
2709
|
+
at: string;
|
|
2710
|
+
run_id: string | null;
|
|
2711
|
+
reason: string | null;
|
|
2712
|
+
error: {
|
|
2713
|
+
code: string;
|
|
2714
|
+
message: string;
|
|
2715
|
+
} | null;
|
|
2716
|
+
count?: number;
|
|
2717
|
+
attempts?: number;
|
|
2718
|
+
retry_at?: string;
|
|
2719
|
+
catch_up?: true;
|
|
2720
|
+
} | null;
|
|
2721
|
+
hook_url?: string;
|
|
2722
|
+
};
|
|
2723
|
+
/** Usage by meter over a period (GET /usage). */
|
|
2724
|
+
export interface GetUsageParams {
|
|
2725
|
+
from?: string;
|
|
2726
|
+
to?: string;
|
|
2727
|
+
group_by?: "meter" | "agent" | "key" | "day" | "region";
|
|
2728
|
+
}
|
|
2729
|
+
export type GetUsageResponse = Usage;
|
|
2730
|
+
/** Remove the webhook; its pending messages are dropped, the log of attempts is kept (DELETE /settings/webhook). */
|
|
2731
|
+
/** The last 50 attempts, newest first (GET /settings/webhook/deliveries). */
|
|
2732
|
+
export type ListWebhookDeliveriesResponse = {
|
|
2733
|
+
attempts: Array<{
|
|
2734
|
+
webhook_id: string;
|
|
2735
|
+
type: "run.needs_input" | "run.ended" | "trigger.failed" | "webhook.test";
|
|
2736
|
+
at: string;
|
|
2737
|
+
status_code: number | null;
|
|
2738
|
+
latency_ms: number;
|
|
2739
|
+
error: string | null;
|
|
2740
|
+
retry_at: string | null;
|
|
2741
|
+
redelivery: boolean;
|
|
2742
|
+
}>;
|
|
2743
|
+
};
|
|
2744
|
+
/** The webhook this server POSTs run notices to, if one is set; never its secret (GET /settings/webhook). */
|
|
2745
|
+
export type GetWebhookResponse = {
|
|
2746
|
+
configured: false;
|
|
2747
|
+
secret: SecretMeta;
|
|
2748
|
+
} | {
|
|
2749
|
+
configured: true;
|
|
2750
|
+
url: string;
|
|
2751
|
+
secret: SecretMeta;
|
|
2752
|
+
signing: "sealed" | "seal_key_missing" | "unreadable";
|
|
2753
|
+
disabled: {
|
|
2754
|
+
at: string;
|
|
2755
|
+
reason: string;
|
|
2756
|
+
} | null;
|
|
2757
|
+
updated_at: string;
|
|
2758
|
+
};
|
|
2759
|
+
/** Send a message of the log again, once now, under the same webhook-id and body (POST /settings/webhook/deliveries/{webhook_id}/redeliver). */
|
|
2760
|
+
export type RedeliverWebhookResponse = {
|
|
2761
|
+
webhook_id: string;
|
|
2762
|
+
type: "run.needs_input" | "run.ended" | "trigger.failed" | "webhook.test";
|
|
2763
|
+
at: string;
|
|
2764
|
+
status_code: number | null;
|
|
2765
|
+
latency_ms: number;
|
|
2766
|
+
error: string | null;
|
|
2767
|
+
retry_at: string | null;
|
|
2768
|
+
redelivery: boolean;
|
|
2769
|
+
};
|
|
2770
|
+
/** Set the webhook's URL (PUT /settings/webhook). */
|
|
2771
|
+
export type SaveWebhookBody = {
|
|
2772
|
+
url: string;
|
|
2773
|
+
};
|
|
2774
|
+
export type SaveWebhookResponse = {
|
|
2775
|
+
configured: true;
|
|
2776
|
+
url: string;
|
|
2777
|
+
secret: SecretMeta;
|
|
2778
|
+
signing: "sealed" | "seal_key_missing" | "unreadable";
|
|
2779
|
+
disabled: {
|
|
2780
|
+
at: string;
|
|
2781
|
+
reason: string;
|
|
2782
|
+
} | null;
|
|
2783
|
+
updated_at: string;
|
|
2784
|
+
} | {
|
|
2785
|
+
configured: true;
|
|
2786
|
+
url: string;
|
|
2787
|
+
secret: SecretMeta;
|
|
2788
|
+
signing: "sealed" | "seal_key_missing" | "unreadable";
|
|
2789
|
+
disabled: {
|
|
2790
|
+
at: string;
|
|
2791
|
+
reason: string;
|
|
2792
|
+
} | null;
|
|
2793
|
+
updated_at: string;
|
|
2794
|
+
signing_secret: string;
|
|
2795
|
+
} | {
|
|
2796
|
+
configured: true;
|
|
2797
|
+
url: string;
|
|
2798
|
+
secret: SecretMeta;
|
|
2799
|
+
signing: "sealed" | "seal_key_missing" | "unreadable";
|
|
2800
|
+
disabled: {
|
|
2801
|
+
at: string;
|
|
2802
|
+
reason: string;
|
|
2803
|
+
} | null;
|
|
2804
|
+
updated_at: string;
|
|
2805
|
+
note: string;
|
|
2806
|
+
};
|
|
2807
|
+
/** Send a `webhook.test` message now, once, and say how it went (POST /settings/webhook/test). */
|
|
2808
|
+
export type TestWebhookResponse = {
|
|
2809
|
+
webhook_id: string;
|
|
2810
|
+
type: "run.needs_input" | "run.ended" | "trigger.failed" | "webhook.test";
|
|
2811
|
+
at: string;
|
|
2812
|
+
status_code: number | null;
|
|
2813
|
+
latency_ms: number;
|
|
2814
|
+
error: string | null;
|
|
2815
|
+
retry_at: string | null;
|
|
2816
|
+
redelivery: boolean;
|
|
2817
|
+
};
|
|
2818
|
+
/** Check a workflow definition without saving it (POST /workflows/validate). */
|
|
2819
|
+
export type ValidateWorkflowBody = {
|
|
2820
|
+
workflow: Record<string, unknown>;
|
|
2821
|
+
tools?: Array<string>;
|
|
2822
|
+
};
|
|
2823
|
+
export type ValidateWorkflowResponse = {
|
|
2824
|
+
ok: boolean;
|
|
2825
|
+
issues: Array<{
|
|
2826
|
+
path: string;
|
|
2827
|
+
code: string;
|
|
2828
|
+
message: string;
|
|
2829
|
+
}>;
|
|
2830
|
+
warnings: Array<string>;
|
|
2831
|
+
};
|
|
2832
|
+
/** Each operation as the runtime sends it, by operationId. */
|
|
2833
|
+
export declare const OPERATIONS: Readonly<Record<string, Operation>>;
|
|
2834
|
+
/** The resource groups, each operation a method that sends it through `call`. */
|
|
2835
|
+
export declare function resources(call: Call): {
|
|
2836
|
+
agents: {
|
|
2837
|
+
/** Archive the agent: hidden from the lists, kept with its history (POST /agents/{agent_id}/archive). */
|
|
2838
|
+
archive: (agentId: string, options?: RequestOptions) => Promise<ArchiveAgentResponse>;
|
|
2839
|
+
/** Create an agent home (POST /agents). */
|
|
2840
|
+
create: (body: CreateAgentBody, params?: CreateAgentParams, options?: RequestOptions) => Promise<CreateAgentResponse>;
|
|
2841
|
+
/** Forget one of the agent's saved sign-ins (DELETE /agents/{agent_id}/sign-ins/{key}). */
|
|
2842
|
+
forgetSignIn: (agentId: string, key: string, options?: RequestOptions) => Promise<ForgetSignInResponse>;
|
|
2843
|
+
/** One agent (GET /agents/{agent_id}). */
|
|
2844
|
+
get: (agentId: string, options?: RequestOptions) => Promise<Tagged<GetAgentResponse>>;
|
|
2845
|
+
/** List agents (GET /agents). */
|
|
2846
|
+
list: (params?: ListAgentsParams, options?: RequestOptions) => Promise<ListAgentsResponse>;
|
|
2847
|
+
/** The agent's runs index (GET /agents/{agent_id}/runs). */
|
|
2848
|
+
runs: (agentId: string, params?: ListRunsParams, options?: RequestOptions) => Promise<ListRunsResponse>;
|
|
2849
|
+
/** Show the archived agent in the lists again (POST /agents/{agent_id}/unarchive). */
|
|
2850
|
+
unarchive: (agentId: string, options?: RequestOptions) => Promise<UnarchiveAgentResponse>;
|
|
2851
|
+
/** Replace the agent's definition (PUT /agents/{agent_id}/definition). */
|
|
2852
|
+
update: (agentId: string, body: UpdateDefinitionBody, params?: UpdateDefinitionParams, options?: RequestOptions) => Promise<Tagged<UpdateDefinitionResponse>>;
|
|
2853
|
+
};
|
|
2854
|
+
files: {
|
|
2855
|
+
/** Reserve an upload (POST /files). */
|
|
2856
|
+
create: (body: CreateFileBody | RawBody, params?: CreateFileParams, options?: BodyOptions) => Promise<CreateFileResponse>;
|
|
2857
|
+
/** Delete an upload (DELETE /files/{file_id}). */
|
|
2858
|
+
delete: (fileId: string, options?: RequestOptions) => Promise<void>;
|
|
2859
|
+
/** An upload's record (GET /files/{file_id}). */
|
|
2860
|
+
get: (fileId: string, options?: RequestOptions) => Promise<GetFileResponse>;
|
|
2861
|
+
/** This server's uploads, newest first (GET /files). */
|
|
2862
|
+
list: (params?: ListFilesParams, options?: RequestOptions) => Promise<ListFilesResponse>;
|
|
2863
|
+
/** Send a reserved file's bytes (PUT /files/{file_id}). */
|
|
2864
|
+
upload: (fileId: string, body: RawBody, options?: BodyOptions) => Promise<UploadFileResponse>;
|
|
2865
|
+
};
|
|
2866
|
+
home: {
|
|
2867
|
+
/** Delete one file of the agent's home (DELETE /agents/{agent_id}/home/files/{path}). */
|
|
2868
|
+
delete: (agentId: string, path: string, options?: RequestOptions) => Promise<void>;
|
|
2869
|
+
/** Every file in the agent's home (GET /agents/{agent_id}/home/files). */
|
|
2870
|
+
list: (agentId: string, options?: RequestOptions) => Promise<ListHomeFilesResponse>;
|
|
2871
|
+
/** One file of the agent's home, raw (GET /agents/{agent_id}/home/files/{path}). */
|
|
2872
|
+
read: <S extends boolean = false>(agentId: string, path: string, params?: ReadHomeFileParams, options?: DownloadOptions<S>) => Promise<S extends true ? Response : Uint8Array>;
|
|
2873
|
+
/** Write one file of the agent's home (PUT /agents/{agent_id}/home/files/{path}). */
|
|
2874
|
+
write: (agentId: string, path: string, body: RawBody, options?: BodyOptions) => Promise<WriteHomeFileResponse>;
|
|
2875
|
+
};
|
|
2876
|
+
learning: {
|
|
2877
|
+
/** What the agent has learned: its index, notes, log of changes and counts (GET /agents/{agent_id}/learning). */
|
|
2878
|
+
get: (agentId: string, options?: RequestOptions) => Promise<GetAgentLearningResponse>;
|
|
2879
|
+
/** A page of the changes on the agent's main, newest first (GET /agents/{agent_id}/learning/log). */
|
|
2880
|
+
log: (agentId: string, params?: ListLearningLogParams, options?: RequestOptions) => Promise<ListLearningLogResponse>;
|
|
2881
|
+
/** A page of the agent's notes (GET /agents/{agent_id}/learning/notes). */
|
|
2882
|
+
notes: (agentId: string, params?: ListLearningNotesParams, options?: RequestOptions) => Promise<ListLearningNotesResponse>;
|
|
2883
|
+
/** One note (or MEMORY.md, a skill's SKILL.md or a draft's file) on main, as text, with its ETag (GET /agents/{agent_id}/learning/files/{file}). */
|
|
2884
|
+
read: (agentId: string, file: string, options?: RequestOptions) => Promise<Tagged<ReadLearningFileResponse | string>>;
|
|
2885
|
+
/** Retire a note, a skill or a workflow draft: out of every later run, kept in history (POST /agents/{agent_id}/learning/files/{file}/retire). */
|
|
2886
|
+
retire: (agentId: string, file: string, params?: RetireLearningFileParams, options?: RequestOptions) => Promise<Tagged<string>>;
|
|
2887
|
+
/** Edit a note (If-Match) or create one (If-None-Match: *) (PUT /agents/{agent_id}/learning/files/{file}). */
|
|
2888
|
+
write: (agentId: string, file: string, body: WriteLearningFileBody | RawBody, params?: WriteLearningFileParams, options?: BodyOptions) => Promise<Tagged<string>>;
|
|
2889
|
+
};
|
|
2890
|
+
local: {
|
|
2891
|
+
/** Start Connect GitHub: the app-manifest form the console posts to GitHub (POST /integrations/github/connect). */
|
|
2892
|
+
connectGitHub: (body?: ConnectGitHubBody, options?: RequestOptions) => Promise<ConnectGitHubResponse>;
|
|
2893
|
+
/** Turn Mode 2 off: run folders on this server's own disk (DELETE /workspace/archil). */
|
|
2894
|
+
deleteWorkspaceArchil: (options?: RequestOptions) => Promise<DeleteWorkspaceArchilResponse>;
|
|
2895
|
+
/** Disconnect GitHub: the App's credentials gone from this server, and every github trigger off (DELETE /integrations/github). */
|
|
2896
|
+
disconnectGitHub: (options?: RequestOptions) => Promise<DisconnectGitHubResponse>;
|
|
2897
|
+
/** Whether a GitHub App is connected, and if so its id, slug and installations, never a secret (GET /integrations/github). */
|
|
2898
|
+
getGitHubConnection: (options?: RequestOptions) => Promise<GetGitHubConnectionResponse>;
|
|
2899
|
+
/** Whether run folders are on an Archil disk (Mode 2), its settings, and whether its keys are saved (GET /workspace/archil). */
|
|
2900
|
+
getWorkspaceArchil: (options?: RequestOptions) => Promise<GetWorkspaceArchilResponse>;
|
|
2901
|
+
/** Where GitHub sends the owner's browser back with the new App's code (GET /integrations/github/callback). */
|
|
2902
|
+
gitHubCallback: (params?: GitHubCallbackParams, options?: RequestOptions) => Promise<void>;
|
|
2903
|
+
/** Where GitHub sends the browser once the App is installed (GET /integrations/github/installed). */
|
|
2904
|
+
gitHubInstalled: (params?: GitHubInstalledParams, options?: RequestOptions) => Promise<void>;
|
|
2905
|
+
/** Settings → Computers: the kinds of computer this server offers, each provider and whether its keys are saved (GET /computers). */
|
|
2906
|
+
listComputers: (options?: RequestOptions) => Promise<ListComputersResponse>;
|
|
2907
|
+
/** Turn Mode 2 on: run folders on this Archil disk (PUT /workspace/archil). */
|
|
2908
|
+
putWorkspaceArchil: (body: PutWorkspaceArchilBody, options?: RequestOptions) => Promise<PutWorkspaceArchilResponse>;
|
|
2909
|
+
/** Fire a GitHub trigger: a request it checks, no token (POST /hooks/github). */
|
|
2910
|
+
receiveHookGithub: (body: RawBody, options?: BodyOptions) => Promise<ReceiveHookGithubResponse>;
|
|
2911
|
+
/** Save a computer provider's keys, sealed (PUT /computers/{provider}/keys). */
|
|
2912
|
+
saveComputerKeys: (provider: string, body: SaveComputerKeysBody, options?: RequestOptions) => Promise<SaveComputerKeysResponse>;
|
|
2913
|
+
/** Start signing in to an MCP server with OAuth: the page the owner opens (POST /settings/mcp-servers/{name}/oauth/start). */
|
|
2914
|
+
startMcpOauth: (name: string, body: StartMcpOAuthBody, options?: RequestOptions) => Promise<StartMcpOAuthResponse>;
|
|
2915
|
+
/** Test a computer provider's account with its saved keys (POST /computers/{provider}/test). */
|
|
2916
|
+
testComputer: (provider: string, options?: RequestOptions) => Promise<TestComputerResponse>;
|
|
2917
|
+
/** Test the Archil disk with its saved account key (POST /workspace/archil/test). */
|
|
2918
|
+
testWorkspaceArchil: (options?: RequestOptions) => Promise<TestWorkspaceArchilResponse>;
|
|
2919
|
+
};
|
|
2920
|
+
mcpServers: {
|
|
2921
|
+
/** Forget a saved MCP server and its credential (DELETE /settings/mcp-servers/{name}). */
|
|
2922
|
+
delete: (name: string, options?: RequestOptions) => Promise<void>;
|
|
2923
|
+
/** One saved MCP server; never its credential (GET /settings/mcp-servers/{name}). */
|
|
2924
|
+
get: (name: string, options?: RequestOptions) => Promise<GetMcpServerResponse>;
|
|
2925
|
+
/** The remote MCP servers saved here, with their tools; never a credential (GET /settings/mcp-servers). */
|
|
2926
|
+
list: (options?: RequestOptions) => Promise<ListMcpServersResponse>;
|
|
2927
|
+
/** This server's OAuth client metadata document (GET /settings/mcp-servers/oauth/client.json). */
|
|
2928
|
+
oauthClient: (options?: RequestOptions) => Promise<McpOAuthClientResponse>;
|
|
2929
|
+
/** Connect to a remote MCP server and list its tools, storing nothing (POST /settings/mcp-servers/preview). */
|
|
2930
|
+
preview: (body: PreviewMcpServerBody, options?: RequestOptions) => Promise<PreviewMcpServerResponse>;
|
|
2931
|
+
/** The private-network hosts an MCP server's authorization server may be on (GET /settings/mcp-servers/oauth/private-hosts). */
|
|
2932
|
+
privateHosts: (options?: RequestOptions) => Promise<GetMcpPrivateHostsResponse>;
|
|
2933
|
+
/** List a saved MCP server's tools again, keep them, and say what changed (POST /settings/mcp-servers/{name}/refresh). */
|
|
2934
|
+
refresh: (name: string, options?: RequestOptions) => Promise<RefreshMcpServerResponse>;
|
|
2935
|
+
/** Preview a remote MCP server, then save it with the tools listed and its credential sealed (PUT /settings/mcp-servers/{name}). */
|
|
2936
|
+
save: (name: string, body: SaveMcpServerBody, options?: RequestOptions) => Promise<SaveMcpServerResponse>;
|
|
2937
|
+
};
|
|
2938
|
+
revisions: {
|
|
2939
|
+
/** The agent's revisions, newest first (GET /agents/{agent_id}/revisions). */
|
|
2940
|
+
list: (agentId: string, params?: ListRevisionsParams, options?: RequestOptions) => Promise<ListRevisionsResponse>;
|
|
2941
|
+
/** Make one of the agent's revisions current again (POST /agents/{agent_id}/current). */
|
|
2942
|
+
setCurrent: (agentId: string, body: SetCurrentBody, options?: RequestOptions) => Promise<SetCurrentResponse>;
|
|
2943
|
+
};
|
|
2944
|
+
runs: {
|
|
2945
|
+
/** Archive the run: hidden from the lists, kept with its history (POST /runs/{run_id}/archive). */
|
|
2946
|
+
archive: (runId: string, options?: RequestOptions) => Promise<ArchiveRunResponse>;
|
|
2947
|
+
/** End the run (POST /runs/{run_id}/cancel). */
|
|
2948
|
+
cancel: (runId: string, options?: RequestOptions) => Promise<CancelRunResponse>;
|
|
2949
|
+
/** Start a run of an agent another system owns, given inline (POST /runs). */
|
|
2950
|
+
createInlineRun: (body: CreateInlineRunBody, params?: CreateInlineRunParams, options?: RequestOptions) => Promise<CreateInlineRunResponse>;
|
|
2951
|
+
/** The files the run wrote (GET /runs/{run_id}/files). */
|
|
2952
|
+
files: (runId: string, options?: RequestOptions) => Promise<ListRunFilesResponse>;
|
|
2953
|
+
/** One run (GET /runs/{run_id}). */
|
|
2954
|
+
get: (runId: string, options?: RequestOptions) => Promise<GetRunResponse>;
|
|
2955
|
+
/** A workflow run's graph, live (GET /runs/{run_id}/graph). */
|
|
2956
|
+
graph: (runId: string, options?: RequestOptions) => Promise<GetRunGraphResponse>;
|
|
2957
|
+
/** Hand the run's computer back to the agent, or answer its ask for the owner (POST /runs/{run_id}/computer/hand-back). */
|
|
2958
|
+
handBackRunComputer: (runId: string, body?: HandBackRunComputerBody, options?: RequestOptions) => Promise<HandBackRunComputerResponse>;
|
|
2959
|
+
/** The run's learning whole: its seed, merge, verdict, problems and cost (GET /runs/{run_id}/learning). */
|
|
2960
|
+
learning: (runId: string, options?: RequestOptions) => Promise<GetRunLearningResponse>;
|
|
2961
|
+
/** What the run proposed, file by file (GET /runs/{run_id}/learning/diff). */
|
|
2962
|
+
learningDiff: (runId: string, options?: RequestOptions) => Promise<GetRunLearningDiffResponse>;
|
|
2963
|
+
/** Every agent's runs, newest first (GET /runs). */
|
|
2964
|
+
list: (params?: ListAllRunsParams, options?: RequestOptions) => Promise<ListAllRunsResponse>;
|
|
2965
|
+
/** Send the run a message (POST /runs/{run_id}/messages). */
|
|
2966
|
+
message: (runId: string, body: SendMessageBody, params?: SendMessageParams, options?: RequestOptions) => Promise<SendMessageResponse>;
|
|
2967
|
+
/** Pause a workflow run (POST /runs/{run_id}/pause). */
|
|
2968
|
+
pause: (runId: string, options?: RequestOptions) => Promise<PauseRunResponse>;
|
|
2969
|
+
/** Raise a run's spend cap (PATCH /runs/{run_id}). */
|
|
2970
|
+
raiseCap: (runId: string, body: RaiseRunCapBody, options?: RequestOptions) => Promise<RaiseRunCapResponse>;
|
|
2971
|
+
/** One file's raw bytes (GET /runs/{run_id}/files/{path}). */
|
|
2972
|
+
readFile: <S extends boolean = false>(runId: string, path: string, params?: ReadRunFileParams, options?: DownloadOptions<S>) => Promise<S extends true ? Response : Uint8Array>;
|
|
2973
|
+
/** Resume a paused workflow run (POST /runs/{run_id}/resume). */
|
|
2974
|
+
resume: (runId: string, options?: RequestOptions) => Promise<ResumeRunResponse>;
|
|
2975
|
+
/** Start a run (POST /agents/{agent_id}/runs). */
|
|
2976
|
+
start: (agentId: string, body: CreateRunBody, params?: CreateRunParams, options?: RequestOptions) => Promise<CreateRunResponse>;
|
|
2977
|
+
/** End the current turn (POST /runs/{run_id}/stop). */
|
|
2978
|
+
stop: (runId: string, options?: RequestOptions) => Promise<StopRunResponse>;
|
|
2979
|
+
/** Take over the run's desktop or phone (POST /runs/{run_id}/computer/take-over). */
|
|
2980
|
+
takeOverRunComputer: (runId: string, body?: TakeOverRunComputerBody, options?: RequestOptions) => Promise<TakeOverRunComputerResponse>;
|
|
2981
|
+
/** The run's timeline, as a page or a stream (GET /runs/{run_id}/timeline). */
|
|
2982
|
+
timeline: (runId: string, params?: GetTimelineParams, options?: RequestOptions) => Promise<GetTimelineResponse>;
|
|
2983
|
+
/** Show the archived run in the lists again (POST /runs/{run_id}/unarchive). */
|
|
2984
|
+
unarchive: (runId: string, options?: RequestOptions) => Promise<UnarchiveRunResponse>;
|
|
2985
|
+
};
|
|
2986
|
+
server: {
|
|
2987
|
+
/** What this backend offers (GET /capabilities). */
|
|
2988
|
+
capabilities: (options?: RequestOptions) => Promise<GetCapabilitiesResponse>;
|
|
2989
|
+
/** Whether this server can serve (GET /health). */
|
|
2990
|
+
health: (options?: RequestOptions) => Promise<GetHealthResponse>;
|
|
2991
|
+
/** The MCP endpoint: this API's tools, for a coding agent (POST /mcp). */
|
|
2992
|
+
mcp: (body: CallMcpBody, options?: RequestOptions) => Promise<CallMcpResponse>;
|
|
2993
|
+
/** This document (GET /openapi.json). */
|
|
2994
|
+
openapi: (options?: RequestOptions) => Promise<GetOpenapiResponse>;
|
|
2995
|
+
};
|
|
2996
|
+
/** Counts and cost over every agent and run (GET /stats). */
|
|
2997
|
+
stats: (params?: GetStatsParams, options?: RequestOptions) => Promise<GetStatsResponse>;
|
|
2998
|
+
/** Usage by meter over a period (GET /usage). */
|
|
2999
|
+
usage: (params?: GetUsageParams, options?: RequestOptions) => Promise<GetUsageResponse>;
|
|
3000
|
+
template: {
|
|
3001
|
+
/** Apply a template package: make its agent, with its skills, then its triggers (POST /templates/{template}/apply). */
|
|
3002
|
+
apply: (template: string, body: ApplyTemplateBody, params?: ApplyTemplateParams, options?: RequestOptions) => Promise<ApplyTemplateResponse>;
|
|
3003
|
+
/** The template packages this server ships: each makes an agent, its skills and its triggers (GET /templates). */
|
|
3004
|
+
list: (options?: RequestOptions) => Promise<ListTemplatesResponse>;
|
|
3005
|
+
};
|
|
3006
|
+
toolKeys: {
|
|
3007
|
+
/** Forget a tool key's stored fields (DELETE /settings/tool-keys/{key_id}). */
|
|
3008
|
+
delete: (keyId: string, options?: RequestOptions) => Promise<void>;
|
|
3009
|
+
/** The tool keys a person may save, and which are set: names only, never a value (GET /settings/tool-keys). */
|
|
3010
|
+
list: (options?: RequestOptions) => Promise<ListToolKeysResponse>;
|
|
3011
|
+
/** Save a tool key's fields, sealed (PUT /settings/tool-keys/{key_id}). */
|
|
3012
|
+
save: (keyId: string, body: SaveToolKeyBody, options?: RequestOptions) => Promise<void>;
|
|
3013
|
+
};
|
|
3014
|
+
toolSettings: {
|
|
3015
|
+
/** The server's tool settings (GET /settings/tools). */
|
|
3016
|
+
get: (options?: RequestOptions) => Promise<GetToolSettingsResponse>;
|
|
3017
|
+
/** Set the providers of web_search, web_fetch and browser, and each tool's permission (PUT /settings/tools). */
|
|
3018
|
+
save: (body: PutToolSettingsBody, options?: RequestOptions) => Promise<PutToolSettingsResponse>;
|
|
3019
|
+
};
|
|
3020
|
+
triggers: {
|
|
3021
|
+
/** Make a trigger: a schedule or a signed webhook that starts a capped run of an agent, or messages a run (POST /triggers). */
|
|
3022
|
+
create: (body: CreateTriggerBody, params?: CreateTriggerParams, options?: RequestOptions) => Promise<CreateTriggerResponse>;
|
|
3023
|
+
/** Delete a trigger and its firings; the runs it started stay (DELETE /triggers/{trigger_id}). */
|
|
3024
|
+
delete: (triggerId: string, options?: RequestOptions) => Promise<void>;
|
|
3025
|
+
/** Run it now: one firing per Idempotency-Key (POST /triggers/{trigger_id}/fire). */
|
|
3026
|
+
fire: (triggerId: string, params: FireTriggerParams, options?: RequestOptions) => Promise<FireTriggerResponse>;
|
|
3027
|
+
/** The trigger's last 200 firings, newest first (GET /triggers/{trigger_id}/firings). */
|
|
3028
|
+
firings: (triggerId: string, options?: RequestOptions) => Promise<ListTriggerFiringsResponse>;
|
|
3029
|
+
/** One trigger (GET /triggers/{trigger_id}). */
|
|
3030
|
+
get: (triggerId: string, options?: RequestOptions) => Promise<GetTriggerResponse>;
|
|
3031
|
+
/** The triggers: schedules and signed webhooks that start an agent's capped runs or message a run (GET /triggers). */
|
|
3032
|
+
list: (options?: RequestOptions) => Promise<ListTriggersResponse>;
|
|
3033
|
+
/** A webhook trigger's new secret, shown once; the old one signs nothing from now on (POST /triggers/{trigger_id}/secret). */
|
|
3034
|
+
rotateSecret: (triggerId: string, options?: RequestOptions) => Promise<RotateTriggerSecretResponse>;
|
|
3035
|
+
/** Change a trigger, or turn it off and on (PATCH /triggers/{trigger_id}). */
|
|
3036
|
+
update: (triggerId: string, body: UpdateTriggerBody, options?: RequestOptions) => Promise<UpdateTriggerResponse>;
|
|
3037
|
+
};
|
|
3038
|
+
webhook: {
|
|
3039
|
+
/** Remove the webhook; its pending messages are dropped, the log of attempts is kept (DELETE /settings/webhook). */
|
|
3040
|
+
delete: (options?: RequestOptions) => Promise<void>;
|
|
3041
|
+
/** The last 50 attempts, newest first (GET /settings/webhook/deliveries). */
|
|
3042
|
+
deliveries: (options?: RequestOptions) => Promise<ListWebhookDeliveriesResponse>;
|
|
3043
|
+
/** The webhook this server POSTs run notices to, if one is set; never its secret (GET /settings/webhook). */
|
|
3044
|
+
get: (options?: RequestOptions) => Promise<GetWebhookResponse>;
|
|
3045
|
+
/** Send a message of the log again, once now, under the same webhook-id and body (POST /settings/webhook/deliveries/{webhook_id}/redeliver). */
|
|
3046
|
+
redeliver: (webhookId: string, options?: RequestOptions) => Promise<RedeliverWebhookResponse>;
|
|
3047
|
+
/** Set the webhook's URL (PUT /settings/webhook). */
|
|
3048
|
+
save: (body: SaveWebhookBody, options?: RequestOptions) => Promise<SaveWebhookResponse>;
|
|
3049
|
+
/** Send a `webhook.test` message now, once, and say how it went (POST /settings/webhook/test). */
|
|
3050
|
+
test: (options?: RequestOptions) => Promise<TestWebhookResponse>;
|
|
3051
|
+
};
|
|
3052
|
+
workflows: {
|
|
3053
|
+
/** Check a workflow definition without saving it (POST /workflows/validate). */
|
|
3054
|
+
validate: (body: ValidateWorkflowBody, options?: RequestOptions) => Promise<ValidateWorkflowResponse>;
|
|
3055
|
+
};
|
|
3056
|
+
};
|
|
3057
|
+
export type Resources = ReturnType<typeof resources>;
|