@nylorun/agents 0.23.0-beta → 0.24.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/README.md +136 -105
- package/dist/a2a/handler.d.ts +9 -4
- package/dist/a2a/handler.js +9 -0
- package/dist/ag-ui/handler.d.ts +13 -9
- package/dist/ag-ui/handler.js +8 -5
- package/dist/agent-manifests.d.ts +127 -0
- package/dist/agent-manifests.js +208 -0
- package/dist/agents.d.ts +456 -0
- package/dist/agents.js +331 -0
- package/dist/compose.d.ts +23 -0
- package/dist/compose.js +246 -0
- package/dist/files.d.ts +2 -2
- package/dist/files.js +2 -2
- package/dist/index.d.ts +8 -6
- package/dist/index.js +5 -4
- package/dist/plugins/load.d.ts +10 -0
- package/dist/plugins/load.js +25 -14
- package/dist/plugins/plugin.d.ts +1 -1
- package/dist/plugins/plugin.js +1 -1
- package/dist/reads.d.ts +3 -1
- package/dist/session-client.d.ts +77 -48
- package/dist/session-client.js +22 -72
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/load.d.ts +10 -0
- package/dist/skills/load.js +15 -5
- package/dist/skills/skills.d.ts +2 -2
- package/dist/skills/skills.js +2 -2
- package/package.json +5 -5
- package/dist/environments.d.ts +0 -413
- package/dist/environments.js +0 -299
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agents (protocol 16): `client.agents`. An Agent is the live instance of one version of an agent
|
|
3
|
+
* manifest (`client.agentManifests`): one environment of the manifest's runtime kind (`virtual`,
|
|
4
|
+
* `pod` or `none`), one vault of secrets for its shell, MCP servers and HTTP tools, and the
|
|
5
|
+
* sessions that run on it. It is made only from a saved manifest, `name` (tracking) or `name@n`
|
|
6
|
+
* (pinned), and runs one version of it at a time: `put` with another version moves it, and a save
|
|
7
|
+
* moves every Agent that tracks the manifest (track T3). Its manifest, kind, harness and storage
|
|
8
|
+
* are fixed (`409 agent_fixed_field`): `fork` makes a new Agent to change them. It has
|
|
9
|
+
* its own id and outlives its sessions; whether it serves one person or a project is the app's
|
|
10
|
+
* choice, made by its id:
|
|
11
|
+
*
|
|
12
|
+
* - `agents.put("users/alice/triage", { manifest: "triage", owner: "alice" })`: get-or-create
|
|
13
|
+
* in one call. Write its secrets with `agents.secrets.put(id, name, { value })` and open
|
|
14
|
+
* sessions on it with `createSession({ agent: id, ... })`. Creating it opens no session (D71).
|
|
15
|
+
*
|
|
16
|
+
* Ids may hold `/`; they are sent percent-encoded as one path segment. Secret values are
|
|
17
|
+
* write-only: no call reads one back.
|
|
18
|
+
*
|
|
19
|
+
* Triggers (track T4, D74): what its manifest's `runtime.triggers` declares starts its turns with
|
|
20
|
+
* no client connected. `triggers(id)` lists them with their status and next run, `pauseTrigger`,
|
|
21
|
+
* `resumeTrigger` and `runTrigger` change or run one, `rotateWebhookSecret` makes a webhook
|
|
22
|
+
* trigger's signing secret (D75), and `runs(id)` pages what each fire came to.
|
|
23
|
+
*
|
|
24
|
+
* Memory (track T5, D72): an Agent whose manifest sets `harness.memory` keeps Markdown files under
|
|
25
|
+
* `/memories` across sessions. `agents.memories` lists, reads, writes (to seed it), deletes and
|
|
26
|
+
* pages the versions every change leaves.
|
|
27
|
+
*
|
|
28
|
+
* Disk versions (Host feature `environment-disk-versions`): `snapshot(id)` keeps a version of
|
|
29
|
+
* the Agent's disk between turns, `restore(id, version)` puts one back, and
|
|
30
|
+
* `put(id, { manifest, from: { agent, version } })` creates a new Agent from another's version.
|
|
31
|
+
*/
|
|
32
|
+
import { type AgentDiskVersions, type AgentEvent, type AgentEventType, type AgentForkPlan, type AgentMovePlan, type AgentRestore, type AgentSecretView, type AgentSnapshot, type AgentView, type DeleteAgentResponse, type ForkAgentRequest, type Memory, type MemoryList, type MemoryVersionDetail, type MemoryVersionPage, type PutAgentRequest, type PutAgentSecretRequest, type TriggerRun, type TriggerRunPage, type TriggerView } from "@nylorun/core/contracts";
|
|
33
|
+
import { type Transport } from "./http.js";
|
|
34
|
+
/** What an Agent is made from (`manifest: "name"` or `"name@n"`), and its owner guard, labels and `from`. */
|
|
35
|
+
export type AgentInput = Omit<PutAgentRequest, "requestId">;
|
|
36
|
+
/**
|
|
37
|
+
* One secret of an Agent's vault, as written: typed, or only its value (`{ value }`, or
|
|
38
|
+
* `{ headers }` for a `headers` secret) when its manifest declares the slot (D64).
|
|
39
|
+
*/
|
|
40
|
+
export type AgentSecretInput = PutAgentSecretRequest | {
|
|
41
|
+
readonly value: string;
|
|
42
|
+
} | {
|
|
43
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
44
|
+
};
|
|
45
|
+
/** Which Agents a `list` or `page` answers: those with every label, and the state or manifest given. */
|
|
46
|
+
export interface AgentFilter {
|
|
47
|
+
readonly labels?: Readonly<Record<string, string>>;
|
|
48
|
+
/** `working`, `sleeping`, `input_required`, `failing` or `paused`. */
|
|
49
|
+
readonly state?: string;
|
|
50
|
+
/** The agent manifest's name. */
|
|
51
|
+
readonly manifest?: string;
|
|
52
|
+
/** `true`: only Agents moving to another version of their manifest (track T3); `false`: the others. */
|
|
53
|
+
readonly outdated?: boolean;
|
|
54
|
+
}
|
|
55
|
+
/** The bytes of files by hash, by `sha256:<hex>` (`runtimeFiles(...).bytes`). */
|
|
56
|
+
export type RuntimeFileBytes = Readonly<Record<string, Uint8Array>>;
|
|
57
|
+
/**
|
|
58
|
+
* A runtime section's `files` entry by content hash (Q6): `contents` (each file's path under
|
|
59
|
+
* `path` and its bytes or text) hashed, as `entry` for the manifest's `runtime.files` and `bytes`
|
|
60
|
+
* for `agentManifests.save`'s `files`, which uploads them. Each file holds at most 2 GiB.
|
|
61
|
+
*/
|
|
62
|
+
export declare function runtimeFiles(path: string, contents: Readonly<Record<string, Uint8Array | string>>): Promise<{
|
|
63
|
+
entry: {
|
|
64
|
+
path: string;
|
|
65
|
+
files: Record<string, string>;
|
|
66
|
+
};
|
|
67
|
+
bytes: Record<string, Uint8Array>;
|
|
68
|
+
}>;
|
|
69
|
+
/** An Agent's secrets: `client.agents.secrets`. */
|
|
70
|
+
export declare class AgentSecretsClient {
|
|
71
|
+
private readonly transport;
|
|
72
|
+
private readonly path;
|
|
73
|
+
constructor(transport: Transport, path: (agentId: string) => string);
|
|
74
|
+
/**
|
|
75
|
+
* Creates or replaces secret `name` (`PUT /v1/agents/{id}/secrets/{name}`): for
|
|
76
|
+
* `environment_secret` and `environment_variable` the name is the variable's. A second
|
|
77
|
+
* credential for a host or a URL is a 409 `credential_conflict`. When the Agent's manifest
|
|
78
|
+
* declares the secret's slot (D64), send only `{ value }` (or `{ headers }`); a name it does
|
|
79
|
+
* not declare is `409 secret_not_in_manifest`.
|
|
80
|
+
*/
|
|
81
|
+
put(agentId: string, name: string, secret: AgentSecretInput, options?: {
|
|
82
|
+
signal?: AbortSignal;
|
|
83
|
+
}): Promise<AgentSecretView>;
|
|
84
|
+
/** The secrets' names, types and bindings; never a value. */
|
|
85
|
+
list(agentId: string, options?: {
|
|
86
|
+
signal?: AbortSignal;
|
|
87
|
+
}): Promise<AgentSecretView[]>;
|
|
88
|
+
get(agentId: string, name: string, options?: {
|
|
89
|
+
signal?: AbortSignal;
|
|
90
|
+
}): Promise<AgentSecretView>;
|
|
91
|
+
delete(agentId: string, name: string, options?: {
|
|
92
|
+
signal?: AbortSignal;
|
|
93
|
+
}): Promise<{
|
|
94
|
+
id: string;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* An Agent's memories (track T5, D72): `client.agents.memories`. A path is a memory's path under
|
|
99
|
+
* `/memories` (`conventions/release.md` or `/memories/conventions/release.md`).
|
|
100
|
+
*/
|
|
101
|
+
export declare class AgentMemoriesClient {
|
|
102
|
+
private readonly transport;
|
|
103
|
+
private readonly path;
|
|
104
|
+
constructor(transport: Transport, path: (agentId: string) => string);
|
|
105
|
+
private memoryPath;
|
|
106
|
+
/** The Agent's memories by path; `pathPrefix` keeps one folder's. */
|
|
107
|
+
list(agentId: string, options?: {
|
|
108
|
+
pathPrefix?: string;
|
|
109
|
+
limit?: number;
|
|
110
|
+
cursor?: string;
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
}): Promise<MemoryList>;
|
|
113
|
+
/** One memory with its content. */
|
|
114
|
+
get(agentId: string, path: string, options?: {
|
|
115
|
+
signal?: AbortSignal;
|
|
116
|
+
}): Promise<Memory>;
|
|
117
|
+
/**
|
|
118
|
+
* Writes the memory whole, creating or replacing it: how an app seeds an Agent's memory. With
|
|
119
|
+
* `contentSha256` the write applies only while the memory still has that content (`""`: only
|
|
120
|
+
* while there is none); otherwise `409 memory_conflict`.
|
|
121
|
+
*/
|
|
122
|
+
put(agentId: string, path: string, content: string, options?: {
|
|
123
|
+
contentSha256?: string;
|
|
124
|
+
signal?: AbortSignal;
|
|
125
|
+
}): Promise<Memory>;
|
|
126
|
+
/** Deletes a memory, or every memory in a folder. */
|
|
127
|
+
delete(agentId: string, path: string, options?: {
|
|
128
|
+
signal?: AbortSignal;
|
|
129
|
+
}): Promise<{
|
|
130
|
+
path: string;
|
|
131
|
+
deleted: number;
|
|
132
|
+
}>;
|
|
133
|
+
/** Every change to the Agent's memories, newest first; `path` keeps one memory's. */
|
|
134
|
+
versions(agentId: string, options?: {
|
|
135
|
+
path?: string;
|
|
136
|
+
limit?: number;
|
|
137
|
+
cursor?: string;
|
|
138
|
+
signal?: AbortSignal;
|
|
139
|
+
}): Promise<MemoryVersionPage>;
|
|
140
|
+
/** One version with the content it left (`null` for a delete). */
|
|
141
|
+
version(agentId: string, versionId: string, options?: {
|
|
142
|
+
signal?: AbortSignal;
|
|
143
|
+
}): Promise<MemoryVersionDetail>;
|
|
144
|
+
}
|
|
145
|
+
/** The Tenant's Agents: `client.agents`. */
|
|
146
|
+
export declare class AgentInstancesClient {
|
|
147
|
+
private readonly transport;
|
|
148
|
+
constructor(transport: Transport);
|
|
149
|
+
private path;
|
|
150
|
+
/** The Agent's secrets. */
|
|
151
|
+
get secrets(): AgentSecretsClient;
|
|
152
|
+
/** The Agent's memories (track T5). */
|
|
153
|
+
get memories(): AgentMemoriesClient;
|
|
154
|
+
/**
|
|
155
|
+
* Creates the Agent, its vault and its compute from a saved agent manifest, or finds the one
|
|
156
|
+
* with this id (`PUT /v1/agents/{id}`): `{ manifest: "name" }` tracks the manifest (its latest
|
|
157
|
+
* version when the Agent is made), `"name@n"` pins version n. On an existing Agent, labels
|
|
158
|
+
* replace, `owner` sets or clears the owner guard, and `manifest` moves it to that version of
|
|
159
|
+
* its manifest (track T3): at once, at its pod's next start for a runtime change (`targetVersion`,
|
|
160
|
+
* `waitingFor: "start"`), or once a required secret the version adds is set. Another manifest,
|
|
161
|
+
* kind, harness or storage is `409 agent_fixed_field` (fork it instead).
|
|
162
|
+
*/
|
|
163
|
+
put(agentId: string, input: AgentInput, options?: {
|
|
164
|
+
signal?: AbortSignal;
|
|
165
|
+
}): Promise<AgentView>;
|
|
166
|
+
/**
|
|
167
|
+
* What `put` would do to the existing Agent (`PUT /v1/agents/{id}?dryRun=true`, track T3): the
|
|
168
|
+
* version it runs and the one `input.manifest` names, when that applies (`now`, `next_start`,
|
|
169
|
+
* `secrets`, or `refused` with each fixed field), the changes, and the secrets it would wait
|
|
170
|
+
* for or leave unused. Nothing changes.
|
|
171
|
+
*/
|
|
172
|
+
plan(agentId: string, input: AgentInput, options?: {
|
|
173
|
+
signal?: AbortSignal;
|
|
174
|
+
}): Promise<AgentMovePlan>;
|
|
175
|
+
get(agentId: string, options?: {
|
|
176
|
+
signal?: AbortSignal;
|
|
177
|
+
}): Promise<AgentView>;
|
|
178
|
+
/** The Agents this client reaches with every label in `labels`, and the `state` or `manifest` given. */
|
|
179
|
+
list(options?: AgentFilter & {
|
|
180
|
+
signal?: AbortSignal;
|
|
181
|
+
}): Promise<AgentView[]>;
|
|
182
|
+
/** One page of `list` (Host feature `session-reads`). */
|
|
183
|
+
page(options?: AgentFilter & {
|
|
184
|
+
limit?: number;
|
|
185
|
+
cursor?: string;
|
|
186
|
+
signal?: AbortSignal;
|
|
187
|
+
}): Promise<{
|
|
188
|
+
agents: {
|
|
189
|
+
id: string;
|
|
190
|
+
manifest: string;
|
|
191
|
+
resolvedVersion: number;
|
|
192
|
+
manifestHash: string;
|
|
193
|
+
tracking: "pinned" | "tracking";
|
|
194
|
+
targetVersion: number | null;
|
|
195
|
+
waitingFor: "secrets" | "start" | null;
|
|
196
|
+
failedVersion: number | null;
|
|
197
|
+
startCheck: {
|
|
198
|
+
from: number;
|
|
199
|
+
startedAt: string;
|
|
200
|
+
} | null;
|
|
201
|
+
kind: "none" | "pod" | "virtual";
|
|
202
|
+
harness: string;
|
|
203
|
+
owner: string | null;
|
|
204
|
+
labels: Record<string, string>;
|
|
205
|
+
state: string;
|
|
206
|
+
attention: {
|
|
207
|
+
state: "failing" | "input_required" | "paused" | "sleeping" | "working";
|
|
208
|
+
sessionId?: string | undefined;
|
|
209
|
+
reason: string;
|
|
210
|
+
}[];
|
|
211
|
+
desired: "off" | "on";
|
|
212
|
+
nextWakeAt: string | null;
|
|
213
|
+
compute: {
|
|
214
|
+
state: string;
|
|
215
|
+
pod?: {
|
|
216
|
+
desired: "deleted" | "running" | "suspended";
|
|
217
|
+
observed: "creating" | "deleting" | "failed" | "lost" | "running" | "suspended";
|
|
218
|
+
volumeGeneration: number;
|
|
219
|
+
hostEpoch: number;
|
|
220
|
+
reason?: string | undefined;
|
|
221
|
+
imageDigest?: string | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
};
|
|
224
|
+
runtime: {
|
|
225
|
+
image?: string | undefined;
|
|
226
|
+
resources?: {
|
|
227
|
+
cpus: number;
|
|
228
|
+
memory: string;
|
|
229
|
+
} | undefined;
|
|
230
|
+
storage?: string | undefined;
|
|
231
|
+
network?: {
|
|
232
|
+
allowedHosts: string[];
|
|
233
|
+
} | undefined;
|
|
234
|
+
harness: string;
|
|
235
|
+
lifecycle: {
|
|
236
|
+
idle?: string | undefined;
|
|
237
|
+
deleteAfter?: string | undefined;
|
|
238
|
+
};
|
|
239
|
+
setup?: {
|
|
240
|
+
command: string;
|
|
241
|
+
cwd?: string | undefined;
|
|
242
|
+
timeout?: string | undefined;
|
|
243
|
+
}[] | undefined;
|
|
244
|
+
files?: ({
|
|
245
|
+
artifactId: string;
|
|
246
|
+
version: number;
|
|
247
|
+
path: string;
|
|
248
|
+
} | {
|
|
249
|
+
path: string;
|
|
250
|
+
files: Record<string, string>;
|
|
251
|
+
})[] | undefined;
|
|
252
|
+
limits?: {
|
|
253
|
+
artifacts?: {
|
|
254
|
+
fileBytes?: number | undefined;
|
|
255
|
+
totalBytes?: number | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
skills?: {
|
|
258
|
+
totalBytes?: number | undefined;
|
|
259
|
+
} | undefined;
|
|
260
|
+
disk?: {
|
|
261
|
+
versionBytes?: number | undefined;
|
|
262
|
+
versionEntries?: number | undefined;
|
|
263
|
+
} | undefined;
|
|
264
|
+
} | undefined;
|
|
265
|
+
secrets?: Record<string, {
|
|
266
|
+
required?: boolean | undefined;
|
|
267
|
+
description?: string | undefined;
|
|
268
|
+
type: "environment_secret";
|
|
269
|
+
allowedHosts: string[];
|
|
270
|
+
inject?: {
|
|
271
|
+
header: string;
|
|
272
|
+
format: string;
|
|
273
|
+
} | undefined;
|
|
274
|
+
} | {
|
|
275
|
+
required?: boolean | undefined;
|
|
276
|
+
description?: string | undefined;
|
|
277
|
+
type: "environment_variable";
|
|
278
|
+
} | {
|
|
279
|
+
via?: string | undefined;
|
|
280
|
+
identity?: {
|
|
281
|
+
header: string;
|
|
282
|
+
} | undefined;
|
|
283
|
+
required?: boolean | undefined;
|
|
284
|
+
description?: string | undefined;
|
|
285
|
+
type: "bearer";
|
|
286
|
+
url: string;
|
|
287
|
+
} | {
|
|
288
|
+
via?: string | undefined;
|
|
289
|
+
identity?: {
|
|
290
|
+
header: string;
|
|
291
|
+
} | undefined;
|
|
292
|
+
required?: boolean | undefined;
|
|
293
|
+
description?: string | undefined;
|
|
294
|
+
type: "headers";
|
|
295
|
+
url: string;
|
|
296
|
+
}> | undefined;
|
|
297
|
+
};
|
|
298
|
+
limits: {
|
|
299
|
+
artifacts: {
|
|
300
|
+
fileBytes: number;
|
|
301
|
+
totalBytes: number;
|
|
302
|
+
};
|
|
303
|
+
skills: {
|
|
304
|
+
totalBytes: number;
|
|
305
|
+
};
|
|
306
|
+
disk: {
|
|
307
|
+
versionBytes: number;
|
|
308
|
+
versionEntries: number;
|
|
309
|
+
};
|
|
310
|
+
};
|
|
311
|
+
sessions: {
|
|
312
|
+
id: string;
|
|
313
|
+
ownerUserId: string;
|
|
314
|
+
status: string;
|
|
315
|
+
activeTurnId: string | null;
|
|
316
|
+
}[];
|
|
317
|
+
slots: {
|
|
318
|
+
name: string;
|
|
319
|
+
type: string;
|
|
320
|
+
required: boolean;
|
|
321
|
+
set: boolean;
|
|
322
|
+
}[];
|
|
323
|
+
disk?: {
|
|
324
|
+
latestVersion: number | null;
|
|
325
|
+
operation: {
|
|
326
|
+
kind: "restore" | "seed" | "snapshot";
|
|
327
|
+
version?: number | undefined;
|
|
328
|
+
startedAt: string;
|
|
329
|
+
} | null;
|
|
330
|
+
} | undefined;
|
|
331
|
+
forkedFrom: {
|
|
332
|
+
agent: string;
|
|
333
|
+
disk: number | null;
|
|
334
|
+
} | null;
|
|
335
|
+
lastUsedAt: string;
|
|
336
|
+
createdAt: string;
|
|
337
|
+
updatedAt: string;
|
|
338
|
+
}[];
|
|
339
|
+
nextCursor: string | null;
|
|
340
|
+
}>;
|
|
341
|
+
/** Stops a pod Agent's compute: its volume is kept, and the next turn starts it again. */
|
|
342
|
+
stop(agentId: string, options?: {
|
|
343
|
+
signal?: AbortSignal;
|
|
344
|
+
}): Promise<AgentView>;
|
|
345
|
+
/**
|
|
346
|
+
* Applies a version the Agent waits to apply (`POST /v1/agents/{id}/restart`, track T3): a
|
|
347
|
+
* running pod stops, so the next turn starts it on the version; a stopped one starts at once.
|
|
348
|
+
* `retry` first moves it to the version that failed to start again. Refused during a turn.
|
|
349
|
+
*/
|
|
350
|
+
restart(agentId: string, options?: {
|
|
351
|
+
retry?: boolean;
|
|
352
|
+
signal?: AbortSignal;
|
|
353
|
+
}): Promise<AgentView>;
|
|
354
|
+
/** Resets a pod Agent: a new pod on a new, empty volume, with its runtime section applied. */
|
|
355
|
+
reset(agentId: string, options?: {
|
|
356
|
+
signal?: AbortSignal;
|
|
357
|
+
}): Promise<AgentView>;
|
|
358
|
+
/**
|
|
359
|
+
* Keeps a version of the Agent's disk (`POST /v1/agents/{id}/snapshot`), between turns;
|
|
360
|
+
* `unchanged` when the disk is as the latest version has it.
|
|
361
|
+
*/
|
|
362
|
+
snapshot(agentId: string, options?: {
|
|
363
|
+
signal?: AbortSignal;
|
|
364
|
+
}): Promise<AgentSnapshot>;
|
|
365
|
+
/**
|
|
366
|
+
* Puts disk version `version` back: at once for a virtual Agent (`done`), on a new volume
|
|
367
|
+
* seeded before the next turn for a pod (`pending`).
|
|
368
|
+
*/
|
|
369
|
+
restore(agentId: string, version: number | "latest", options?: {
|
|
370
|
+
signal?: AbortSignal;
|
|
371
|
+
}): Promise<AgentRestore>;
|
|
372
|
+
/**
|
|
373
|
+
* Forks the Agent into a new one, `options.id` (Q15): how an Agent changes what is fixed for its
|
|
374
|
+
* life (its manifest, kind, harness or storage). It is made from `options.manifest` (default the source's manifest,
|
|
375
|
+
* tracking), its disk starts from `options.disk` (`latest`, the default, snapshots first; a
|
|
376
|
+
* version; or `empty`) and the secrets the new manifest declares are copied
|
|
377
|
+
* (`options.secrets: "none"` copies none). The source keeps what it runs, its disk and its
|
|
378
|
+
* sessions. Answers the new Agent and the plan it ran.
|
|
379
|
+
*/
|
|
380
|
+
fork(agentId: string, options: Omit<ForkAgentRequest, "requestId" | "dryRun"> & {
|
|
381
|
+
signal?: AbortSignal;
|
|
382
|
+
}): Promise<{
|
|
383
|
+
agent: AgentView;
|
|
384
|
+
plan: AgentForkPlan;
|
|
385
|
+
}>;
|
|
386
|
+
/** What `fork` would do (the disk, the secrets copied and left behind, the changes), making nothing. */
|
|
387
|
+
planFork(agentId: string, options: Omit<ForkAgentRequest, "requestId" | "dryRun"> & {
|
|
388
|
+
signal?: AbortSignal;
|
|
389
|
+
}): Promise<AgentForkPlan>;
|
|
390
|
+
/** The Agent's disk versions, newest first. */
|
|
391
|
+
versions(agentId: string, options?: {
|
|
392
|
+
signal?: AbortSignal;
|
|
393
|
+
}): Promise<AgentDiskVersions>;
|
|
394
|
+
/** Deletes disk version `version`; `deleted` is false when there was none. */
|
|
395
|
+
deleteVersion(agentId: string, version: number, options?: {
|
|
396
|
+
signal?: AbortSignal;
|
|
397
|
+
}): Promise<{
|
|
398
|
+
agentId: string;
|
|
399
|
+
version: number;
|
|
400
|
+
deleted: boolean;
|
|
401
|
+
}>;
|
|
402
|
+
/** Deletes the Agent, its vault and its files; `deleted` is false when there was none. */
|
|
403
|
+
delete(agentId: string, options?: {
|
|
404
|
+
signal?: AbortSignal;
|
|
405
|
+
}): Promise<DeleteAgentResponse>;
|
|
406
|
+
/**
|
|
407
|
+
* The Agent's events, from `from` on: its lifecycle, and `agent.egress` for every connection
|
|
408
|
+
* its sandbox opens (with the turns that were running). `types` keeps only those types;
|
|
409
|
+
* `since` and `until` keep events recorded in that window (ISO times or `Date`s).
|
|
410
|
+
*/
|
|
411
|
+
events(agentId: string, options?: {
|
|
412
|
+
from?: number;
|
|
413
|
+
types?: readonly AgentEventType[];
|
|
414
|
+
since?: string | Date;
|
|
415
|
+
until?: string | Date;
|
|
416
|
+
signal?: AbortSignal;
|
|
417
|
+
}): Promise<AgentEvent[]>;
|
|
418
|
+
/** The Agent's triggers: each one's status (`active`, `paused`, `completed`), next and last run. */
|
|
419
|
+
triggers(agentId: string, options?: {
|
|
420
|
+
signal?: AbortSignal;
|
|
421
|
+
}): Promise<TriggerView[]>;
|
|
422
|
+
/** Pauses trigger `triggerId`: it stops firing until it is resumed. Answers the Agent's triggers. */
|
|
423
|
+
pauseTrigger(agentId: string, triggerId: string, options?: {
|
|
424
|
+
signal?: AbortSignal;
|
|
425
|
+
}): Promise<TriggerView[]>;
|
|
426
|
+
/** Resumes trigger `triggerId` from its next time after now. Answers the Agent's triggers. */
|
|
427
|
+
resumeTrigger(agentId: string, triggerId: string, options?: {
|
|
428
|
+
signal?: AbortSignal;
|
|
429
|
+
}): Promise<TriggerView[]>;
|
|
430
|
+
/**
|
|
431
|
+
* Runs trigger `triggerId` once now, as if it fired: `idempotencyKey` (default a new one) makes a
|
|
432
|
+
* retried call answer the same run.
|
|
433
|
+
*/
|
|
434
|
+
runTrigger(agentId: string, triggerId: string, options?: {
|
|
435
|
+
idempotencyKey?: string;
|
|
436
|
+
signal?: AbortSignal;
|
|
437
|
+
}): Promise<TriggerRun>;
|
|
438
|
+
/**
|
|
439
|
+
* A new Standard Webhooks signing secret for webhook trigger `triggerId` (`whsec_…`), shown this
|
|
440
|
+
* once with the trigger's `webhookUrl`; the one before stops working at once.
|
|
441
|
+
*/
|
|
442
|
+
rotateWebhookSecret(agentId: string, triggerId: string, options?: {
|
|
443
|
+
signal?: AbortSignal;
|
|
444
|
+
}): Promise<{
|
|
445
|
+
triggerId: string;
|
|
446
|
+
webhookUrl: string;
|
|
447
|
+
secret: string;
|
|
448
|
+
}>;
|
|
449
|
+
/** The Agent's runs, newest first; `triggerId` keeps one trigger's. */
|
|
450
|
+
runs(agentId: string, options?: {
|
|
451
|
+
triggerId?: string;
|
|
452
|
+
limit?: number;
|
|
453
|
+
cursor?: string;
|
|
454
|
+
signal?: AbortSignal;
|
|
455
|
+
}): Promise<TriggerRunPage>;
|
|
456
|
+
}
|