@nylorun/agents 0.23.0-beta → 0.25.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 +52 -0
- package/README.md +137 -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 +132 -0
- package/dist/agent-manifests.js +229 -0
- package/dist/agents.d.ts +456 -0
- package/dist/agents.js +331 -0
- package/dist/artifacts.d.ts +1 -1
- package/dist/artifacts.js +1 -1
- package/dist/compose.d.ts +23 -0
- package/dist/compose.js +257 -0
- package/dist/files.d.ts +3 -3
- package/dist/files.js +3 -3
- 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 +96 -50
- package/dist/session-client.js +24 -74
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/load.d.ts +20 -2
- package/dist/skills/load.js +37 -11
- package/dist/skills/skills.d.ts +8 -6
- package/dist/skills/skills.js +9 -5
- package/package.json +5 -5
- package/dist/environments.d.ts +0 -413
- package/dist/environments.js +0 -299
package/dist/environments.d.ts
DELETED
|
@@ -1,413 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Environments (protocol 11, D55, D56): `client.environments`. An Environment is one sandbox
|
|
3
|
-
* (kind `virtual`, `pod` or `none`) made from an environment manifest's version or from inline
|
|
4
|
-
* fields, and one vault of secrets for its shell, MCP servers and HTTP tools. It never changes
|
|
5
|
-
* what it runs after it is made (protocol 14, D63): a new version reaches an agent through a new
|
|
6
|
-
* Environment. It has its own id and outlives the sessions that name it; whether it serves one
|
|
7
|
-
* session, one person or a project is the app's choice, made here:
|
|
8
|
-
*
|
|
9
|
-
* - `environments.forSession(...)`: one Environment for one session. It creates the
|
|
10
|
-
* Environment, opens the session on it, and `release()` deletes the Environment (and its
|
|
11
|
-
* vault) when the session is done.
|
|
12
|
-
* - `environments.put(id, { manifest: "analyst-box" })` (or inline fields): one Environment per
|
|
13
|
-
* person or per project, by a deterministic id (`users/alice/web`); get-or-create in one call.
|
|
14
|
-
* Write its secrets with `environments.secrets.put(id, name, { value })` and open sessions on
|
|
15
|
-
* it with `createSession({ environment: id })`.
|
|
16
|
-
* - `environments.manifests.save(manifest)`: save an environment manifest's next version, like
|
|
17
|
-
* `saveAgent`; `plan(manifest)` answers what a save would do and saves nothing.
|
|
18
|
-
*
|
|
19
|
-
* Ids may hold `/`; they are sent percent-encoded as one path segment. Secret values are
|
|
20
|
-
* write-only: no call reads one back.
|
|
21
|
-
*
|
|
22
|
-
* Disk versions (Host feature `environment-disk-versions`): `snapshot(id)` keeps a version of
|
|
23
|
-
* the Environment's disk between turns, `restore(id, version)` puts one back, and
|
|
24
|
-
* `put(id, { from: { environment, version } })` creates a new Environment from another's version.
|
|
25
|
-
*
|
|
26
|
-
* `fork(id, { id: next })` is how an Environment gets a new manifest version (Q15): a new
|
|
27
|
-
* Environment made from it, with the source's disk and secrets; `planFork` answers what it would do.
|
|
28
|
-
*/
|
|
29
|
-
import { ENVIRONMENT_MANIFEST_SCHEMA_VERSION, type DeleteEnvironmentManifestResponse, type EnvironmentManifest, type EnvironmentManifestPlan, type EnvironmentManifestVersions, type EnvironmentForkPlan, type EnvironmentManifestView, type ForkEnvironmentRequest, type SaveEnvironmentManifestResponse, type DeleteEnvironmentResponse, type EnvironmentEvent, type EnvironmentEventType, type EnvironmentRestore, type EnvironmentSecretView, type EnvironmentSnapshot, type EnvironmentVersions, type EnvironmentView, type PutEnvironmentRequest, type PutEnvironmentSecretRequest } from "@nylorun/core/contracts";
|
|
30
|
-
import { type Transport } from "./http.js";
|
|
31
|
-
import type { CreateSessionOptions, SessionClient } from "./session-client.js";
|
|
32
|
-
/**
|
|
33
|
-
* What an Environment is made from: an environment manifest (`manifest: "name"` or `"name@n"`)
|
|
34
|
-
* or the inline fields, and its labels, owner guard and `from`.
|
|
35
|
-
*/
|
|
36
|
-
export type EnvironmentInput = Omit<PutEnvironmentRequest, "requestId">;
|
|
37
|
-
/**
|
|
38
|
-
* One secret of an Environment's vault, as written: typed, or only its value (`{ value }`, or
|
|
39
|
-
* `{ headers }` for a `headers` secret) when what the Environment runs declares its slot (D64).
|
|
40
|
-
*/
|
|
41
|
-
export type EnvironmentSecretInput = PutEnvironmentSecretRequest | {
|
|
42
|
-
readonly value: string;
|
|
43
|
-
} | {
|
|
44
|
-
readonly headers: Readonly<Record<string, string>>;
|
|
45
|
-
};
|
|
46
|
-
/** An environment manifest as authored: `manifestSchemaVersion` may be left out. */
|
|
47
|
-
export type EnvironmentManifestInput = Omit<EnvironmentManifest, "manifestSchemaVersion"> & {
|
|
48
|
-
readonly manifestSchemaVersion?: typeof ENVIRONMENT_MANIFEST_SCHEMA_VERSION;
|
|
49
|
-
/** For editors; dropped here, as the CLI drops it. */
|
|
50
|
-
readonly $schema?: string;
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* An environment manifest (protocol 14, D63): checked now against the schema the Runtime
|
|
54
|
-
* enforces, with `manifestSchemaVersion` filled in and `$schema` dropped. Save it with
|
|
55
|
-
* `client.environments.manifests.save()`, or make an Environment from it inline.
|
|
56
|
-
*/
|
|
57
|
-
export declare function environmentManifest(input: EnvironmentManifestInput): EnvironmentManifest;
|
|
58
|
-
/** A session opened on an Environment of its own (`environments.forSession`). */
|
|
59
|
-
export interface SessionEnvironmentHandle {
|
|
60
|
-
readonly session: SessionClient;
|
|
61
|
-
readonly environment: EnvironmentView;
|
|
62
|
-
/** Deletes the Environment, its vault and its files; call it when the session is done. */
|
|
63
|
-
release(options?: {
|
|
64
|
-
signal?: AbortSignal;
|
|
65
|
-
}): Promise<DeleteEnvironmentResponse>;
|
|
66
|
-
}
|
|
67
|
-
export interface ForSessionOptions {
|
|
68
|
-
/** The session to open, as `createSession` takes it, without `environment`. */
|
|
69
|
-
readonly session: Omit<CreateSessionOptions, "environment">;
|
|
70
|
-
/**
|
|
71
|
-
* What the Environment is made from (a `manifest` or inline fields) and its labels. Default: a
|
|
72
|
-
* virtual one within the Tenant's defaults.
|
|
73
|
-
*/
|
|
74
|
-
readonly recipe?: EnvironmentInput;
|
|
75
|
-
/** Secrets to write before the session opens, by name. */
|
|
76
|
-
readonly secrets?: Readonly<Record<string, EnvironmentSecretInput>>;
|
|
77
|
-
/** The Environment's id. Default: `sessions/<session id>`. */
|
|
78
|
-
readonly environmentId?: string;
|
|
79
|
-
readonly signal?: AbortSignal;
|
|
80
|
-
}
|
|
81
|
-
/** An Environment's secrets: `client.environments.secrets`. */
|
|
82
|
-
export declare class EnvironmentSecretsClient {
|
|
83
|
-
private readonly transport;
|
|
84
|
-
private readonly path;
|
|
85
|
-
constructor(transport: Transport, path: (environmentId: string) => string);
|
|
86
|
-
/**
|
|
87
|
-
* Creates or replaces secret `name` (`PUT /v1/environments/{id}/secrets/{name}`): for
|
|
88
|
-
* `environment_secret` and `environment_variable` the name is the variable's. A second
|
|
89
|
-
* credential for a host or a URL is a 409 `credential_conflict`. When what the Environment
|
|
90
|
-
* runs declares the secret's slot (D64), send only `{ value }` (or `{ headers }`); a name it
|
|
91
|
-
* does not declare is `409 secret_not_in_manifest`.
|
|
92
|
-
*/
|
|
93
|
-
put(environmentId: string, name: string, secret: EnvironmentSecretInput, options?: {
|
|
94
|
-
signal?: AbortSignal;
|
|
95
|
-
}): Promise<EnvironmentSecretView>;
|
|
96
|
-
/** The secrets' names, types and bindings; never a value. */
|
|
97
|
-
list(environmentId: string, options?: {
|
|
98
|
-
signal?: AbortSignal;
|
|
99
|
-
}): Promise<EnvironmentSecretView[]>;
|
|
100
|
-
get(environmentId: string, name: string, options?: {
|
|
101
|
-
signal?: AbortSignal;
|
|
102
|
-
}): Promise<EnvironmentSecretView>;
|
|
103
|
-
delete(environmentId: string, name: string, options?: {
|
|
104
|
-
signal?: AbortSignal;
|
|
105
|
-
}): Promise<{
|
|
106
|
-
id: string;
|
|
107
|
-
}>;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Environment manifests (protocol 14, D63): `client.environments.manifests`. A save writes the
|
|
111
|
-
* manifest's next version, or answers the latest unchanged, and changes no Environment: an
|
|
112
|
-
* Environment keeps the version it was made from.
|
|
113
|
-
*/
|
|
114
|
-
/** The bytes of files by hash, by `sha256:<hex>` (`environmentFiles(...).bytes`). */
|
|
115
|
-
export type EnvironmentFileBytes = Readonly<Record<string, Uint8Array>>;
|
|
116
|
-
/**
|
|
117
|
-
* A manifest `files` entry by content hash (Q6): `contents` (each file's path under `path` and
|
|
118
|
-
* its bytes or text) hashed, as `entry` for the manifest and `bytes` for `manifests.save`'s
|
|
119
|
-
* `files`, which uploads them. Each file holds at most 2 GiB.
|
|
120
|
-
*/
|
|
121
|
-
export declare function environmentFiles(path: string, contents: Readonly<Record<string, Uint8Array | string>>): Promise<{
|
|
122
|
-
entry: {
|
|
123
|
-
path: string;
|
|
124
|
-
files: Record<string, string>;
|
|
125
|
-
};
|
|
126
|
-
bytes: Record<string, Uint8Array>;
|
|
127
|
-
}>;
|
|
128
|
-
export declare class EnvironmentManifestsClient {
|
|
129
|
-
private readonly transport;
|
|
130
|
-
constructor(transport: Transport);
|
|
131
|
-
private path;
|
|
132
|
-
private send;
|
|
133
|
-
/**
|
|
134
|
-
* Saves `manifest` (`PUT /v1/environment-manifests/{name}`). `ifMatch`: the version you read
|
|
135
|
-
* (`0` for none yet); a save over a newer one is `412 manifest_changed`. `files`: the bytes of
|
|
136
|
-
* its files by hash (`environmentFiles(...).bytes`), uploaded first when the Runtime lacks them.
|
|
137
|
-
*/
|
|
138
|
-
save(manifest: EnvironmentManifestInput, options?: {
|
|
139
|
-
ifMatch?: number;
|
|
140
|
-
files?: EnvironmentFileBytes;
|
|
141
|
-
signal?: AbortSignal;
|
|
142
|
-
}): Promise<SaveEnvironmentManifestResponse>;
|
|
143
|
-
/** What saving `manifest` would do (`?dryRun=true`): changes, errors, warnings, and the Environments behind. */
|
|
144
|
-
plan(manifest: EnvironmentManifestInput, options?: {
|
|
145
|
-
ifMatch?: number;
|
|
146
|
-
files?: EnvironmentFileBytes;
|
|
147
|
-
signal?: AbortSignal;
|
|
148
|
-
}): Promise<EnvironmentManifestPlan>;
|
|
149
|
-
/** The latest version of manifest `name`, or version `version`. */
|
|
150
|
-
get(name: string, options?: {
|
|
151
|
-
version?: number;
|
|
152
|
-
signal?: AbortSignal;
|
|
153
|
-
}): Promise<EnvironmentManifestView>;
|
|
154
|
-
/** Each manifest's latest version. */
|
|
155
|
-
list(options?: {
|
|
156
|
-
signal?: AbortSignal;
|
|
157
|
-
}): Promise<EnvironmentManifestView[]>;
|
|
158
|
-
/** Every version of manifest `name`, newest first. */
|
|
159
|
-
versions(name: string, options?: {
|
|
160
|
-
signal?: AbortSignal;
|
|
161
|
-
}): Promise<EnvironmentManifestVersions>;
|
|
162
|
-
/** Deletes every version; refused while an Environment was made from one (`409 manifest_in_use`). */
|
|
163
|
-
delete(name: string, options?: {
|
|
164
|
-
signal?: AbortSignal;
|
|
165
|
-
}): Promise<DeleteEnvironmentManifestResponse>;
|
|
166
|
-
}
|
|
167
|
-
export declare class EnvironmentsClient {
|
|
168
|
-
private readonly transport;
|
|
169
|
-
/** `AgentsClient.createSession`, bound. */
|
|
170
|
-
private readonly createSession;
|
|
171
|
-
constructor(transport: Transport,
|
|
172
|
-
/** `AgentsClient.createSession`, bound. */
|
|
173
|
-
createSession: (options: CreateSessionOptions) => Promise<SessionClient>);
|
|
174
|
-
private path;
|
|
175
|
-
/** The Environment's secrets. */
|
|
176
|
-
get secrets(): EnvironmentSecretsClient;
|
|
177
|
-
/** Environment manifests (protocol 14, D63): named, versioned definitions of a kind of Environment. */
|
|
178
|
-
get manifests(): EnvironmentManifestsClient;
|
|
179
|
-
/**
|
|
180
|
-
* Creates the Environment and its vault, or finds the one with this id
|
|
181
|
-
* (`PUT /v1/environments/{id}`), from an environment manifest (`{ manifest: "name" }` takes
|
|
182
|
-
* the latest version, `"name@n"` version n) or from inline fields. It never changes what it
|
|
183
|
-
* runs after that (protocol 14): on an existing one, labels replace and `ownerUserId` sets or
|
|
184
|
-
* clears the owner guard, fields that match are accepted, and anything else is
|
|
185
|
-
* `409 environment_immutable`.
|
|
186
|
-
*/
|
|
187
|
-
put(environmentId: string, recipe?: EnvironmentInput, options?: {
|
|
188
|
-
signal?: AbortSignal;
|
|
189
|
-
}): Promise<EnvironmentView>;
|
|
190
|
-
get(environmentId: string, options?: {
|
|
191
|
-
signal?: AbortSignal;
|
|
192
|
-
}): Promise<EnvironmentView>;
|
|
193
|
-
/** The Environments with every label in `labels` that this client reaches. */
|
|
194
|
-
list(options?: {
|
|
195
|
-
labels?: Readonly<Record<string, string>>;
|
|
196
|
-
signal?: AbortSignal;
|
|
197
|
-
}): Promise<EnvironmentView[]>;
|
|
198
|
-
page(options?: {
|
|
199
|
-
labels?: Readonly<Record<string, string>>;
|
|
200
|
-
limit?: number;
|
|
201
|
-
cursor?: string;
|
|
202
|
-
signal?: AbortSignal;
|
|
203
|
-
}): Promise<{
|
|
204
|
-
environments: {
|
|
205
|
-
id: string;
|
|
206
|
-
kind: "none" | "pod" | "virtual";
|
|
207
|
-
labels: Record<string, string>;
|
|
208
|
-
manifest: {
|
|
209
|
-
image?: string | undefined;
|
|
210
|
-
resources?: {
|
|
211
|
-
cpus: number;
|
|
212
|
-
memory: string;
|
|
213
|
-
} | undefined;
|
|
214
|
-
storage?: string | undefined;
|
|
215
|
-
network?: {
|
|
216
|
-
allowedHosts: string[];
|
|
217
|
-
} | undefined;
|
|
218
|
-
harness: string;
|
|
219
|
-
lifecycle: {
|
|
220
|
-
idle?: string | undefined;
|
|
221
|
-
deleteAfter?: string | undefined;
|
|
222
|
-
};
|
|
223
|
-
setup?: {
|
|
224
|
-
command: string;
|
|
225
|
-
cwd?: string | undefined;
|
|
226
|
-
timeout?: string | undefined;
|
|
227
|
-
}[] | undefined;
|
|
228
|
-
files?: ({
|
|
229
|
-
artifactId: string;
|
|
230
|
-
version: number;
|
|
231
|
-
path: string;
|
|
232
|
-
} | {
|
|
233
|
-
path: string;
|
|
234
|
-
files: Record<string, string>;
|
|
235
|
-
})[] | undefined;
|
|
236
|
-
limits?: {
|
|
237
|
-
artifacts?: {
|
|
238
|
-
fileBytes?: number | undefined;
|
|
239
|
-
totalBytes?: number | undefined;
|
|
240
|
-
} | undefined;
|
|
241
|
-
skills?: {
|
|
242
|
-
totalBytes?: number | undefined;
|
|
243
|
-
} | undefined;
|
|
244
|
-
disk?: {
|
|
245
|
-
versionBytes?: number | undefined;
|
|
246
|
-
versionEntries?: number | undefined;
|
|
247
|
-
} | undefined;
|
|
248
|
-
} | undefined;
|
|
249
|
-
secrets?: Record<string, {
|
|
250
|
-
required?: boolean | undefined;
|
|
251
|
-
description?: string | undefined;
|
|
252
|
-
type: "environment_secret";
|
|
253
|
-
allowedHosts: string[];
|
|
254
|
-
inject?: {
|
|
255
|
-
header: string;
|
|
256
|
-
format: string;
|
|
257
|
-
} | undefined;
|
|
258
|
-
} | {
|
|
259
|
-
required?: boolean | undefined;
|
|
260
|
-
description?: string | undefined;
|
|
261
|
-
type: "environment_variable";
|
|
262
|
-
} | {
|
|
263
|
-
via?: string | undefined;
|
|
264
|
-
identity?: {
|
|
265
|
-
header: string;
|
|
266
|
-
} | undefined;
|
|
267
|
-
required?: boolean | undefined;
|
|
268
|
-
description?: string | undefined;
|
|
269
|
-
type: "bearer";
|
|
270
|
-
url: string;
|
|
271
|
-
} | {
|
|
272
|
-
via?: string | undefined;
|
|
273
|
-
identity?: {
|
|
274
|
-
header: string;
|
|
275
|
-
} | undefined;
|
|
276
|
-
required?: boolean | undefined;
|
|
277
|
-
description?: string | undefined;
|
|
278
|
-
type: "headers";
|
|
279
|
-
url: string;
|
|
280
|
-
}> | undefined;
|
|
281
|
-
};
|
|
282
|
-
manifestName?: string | undefined;
|
|
283
|
-
manifestVersion?: number | undefined;
|
|
284
|
-
manifestHash?: string | undefined;
|
|
285
|
-
limits: {
|
|
286
|
-
artifacts: {
|
|
287
|
-
fileBytes: number;
|
|
288
|
-
totalBytes: number;
|
|
289
|
-
};
|
|
290
|
-
skills: {
|
|
291
|
-
totalBytes: number;
|
|
292
|
-
};
|
|
293
|
-
disk: {
|
|
294
|
-
versionBytes: number;
|
|
295
|
-
versionEntries: number;
|
|
296
|
-
};
|
|
297
|
-
};
|
|
298
|
-
forkedFrom?: {
|
|
299
|
-
environment: string;
|
|
300
|
-
disk: number | null;
|
|
301
|
-
} | undefined;
|
|
302
|
-
slots?: {
|
|
303
|
-
name: string;
|
|
304
|
-
type: string;
|
|
305
|
-
required: boolean;
|
|
306
|
-
set: boolean;
|
|
307
|
-
}[] | undefined;
|
|
308
|
-
version: number;
|
|
309
|
-
appliedVersion: number;
|
|
310
|
-
ownerUserId: string | null;
|
|
311
|
-
state: string;
|
|
312
|
-
pod?: {
|
|
313
|
-
desired: "deleted" | "running" | "suspended";
|
|
314
|
-
observed: "creating" | "deleting" | "failed" | "lost" | "running" | "suspended";
|
|
315
|
-
volumeGeneration: number;
|
|
316
|
-
hostEpoch: number;
|
|
317
|
-
reason?: string | undefined;
|
|
318
|
-
imageDigest?: string | undefined;
|
|
319
|
-
} | undefined;
|
|
320
|
-
lastUsedAt: string;
|
|
321
|
-
disk?: {
|
|
322
|
-
latestVersion: number | null;
|
|
323
|
-
operation?: {
|
|
324
|
-
kind: "restore" | "seed" | "snapshot";
|
|
325
|
-
version?: number | undefined;
|
|
326
|
-
startedAt: string;
|
|
327
|
-
} | undefined;
|
|
328
|
-
} | undefined;
|
|
329
|
-
sessions: {
|
|
330
|
-
id: string;
|
|
331
|
-
activeTurnId: string | null;
|
|
332
|
-
}[];
|
|
333
|
-
createdAt: string;
|
|
334
|
-
updatedAt: string;
|
|
335
|
-
}[];
|
|
336
|
-
nextCursor: string | null;
|
|
337
|
-
}>;
|
|
338
|
-
/** Stops a pod Environment: its volume is kept, and the next turn starts it again. */
|
|
339
|
-
stop(environmentId: string, options?: {
|
|
340
|
-
signal?: AbortSignal;
|
|
341
|
-
}): Promise<EnvironmentView>;
|
|
342
|
-
/** Resets a pod Environment: a new pod on a new, empty volume, with its recipe applied. */
|
|
343
|
-
reset(environmentId: string, options?: {
|
|
344
|
-
signal?: AbortSignal;
|
|
345
|
-
}): Promise<EnvironmentView>;
|
|
346
|
-
/**
|
|
347
|
-
* Keeps a version of the Environment's disk (`POST /v1/environments/{id}/snapshot`), between
|
|
348
|
-
* turns; `unchanged` when the disk is as the latest version has it.
|
|
349
|
-
*/
|
|
350
|
-
snapshot(environmentId: string, options?: {
|
|
351
|
-
signal?: AbortSignal;
|
|
352
|
-
}): Promise<EnvironmentSnapshot>;
|
|
353
|
-
/**
|
|
354
|
-
* Puts disk version `version` back: at once for a virtual Environment (`done`), on a new volume
|
|
355
|
-
* seeded before the next turn for a pod (`pending`).
|
|
356
|
-
*/
|
|
357
|
-
restore(environmentId: string, version: number | "latest", options?: {
|
|
358
|
-
signal?: AbortSignal;
|
|
359
|
-
}): Promise<EnvironmentRestore>;
|
|
360
|
-
/**
|
|
361
|
-
* Forks the Environment into a new one, `options.id` (Q15): how an Environment gets a new
|
|
362
|
-
* manifest version, since none ever changes what it runs. It is made from `options.manifest`
|
|
363
|
-
* (default the source's manifest at its latest version), its disk starts from `options.disk`
|
|
364
|
-
* (`latest`, the default, snapshots first; a version; or `empty`) and the secrets the new
|
|
365
|
-
* manifest declares are copied (`options.secrets: "none"` copies none). The source keeps what
|
|
366
|
-
* it runs, its disk and its sessions. Answers the new Environment and the plan it ran.
|
|
367
|
-
*/
|
|
368
|
-
fork(environmentId: string, options: Omit<ForkEnvironmentRequest, "requestId" | "dryRun"> & {
|
|
369
|
-
signal?: AbortSignal;
|
|
370
|
-
}): Promise<{
|
|
371
|
-
environment: EnvironmentView;
|
|
372
|
-
plan: EnvironmentForkPlan;
|
|
373
|
-
}>;
|
|
374
|
-
/** What `fork` would do (the disk, the secrets copied and left behind, the changes), making nothing. */
|
|
375
|
-
planFork(environmentId: string, options: Omit<ForkEnvironmentRequest, "requestId" | "dryRun"> & {
|
|
376
|
-
signal?: AbortSignal;
|
|
377
|
-
}): Promise<EnvironmentForkPlan>;
|
|
378
|
-
/** The Environment's disk versions, newest first. */
|
|
379
|
-
versions(environmentId: string, options?: {
|
|
380
|
-
signal?: AbortSignal;
|
|
381
|
-
}): Promise<EnvironmentVersions>;
|
|
382
|
-
/** Deletes disk version `version`; `deleted` is false when there was none. */
|
|
383
|
-
deleteVersion(environmentId: string, version: number, options?: {
|
|
384
|
-
signal?: AbortSignal;
|
|
385
|
-
}): Promise<{
|
|
386
|
-
environmentId: string;
|
|
387
|
-
version: number;
|
|
388
|
-
deleted: boolean;
|
|
389
|
-
}>;
|
|
390
|
-
/** Deletes the Environment, its vault and its files; `deleted` is false when there was none. */
|
|
391
|
-
delete(environmentId: string, options?: {
|
|
392
|
-
signal?: AbortSignal;
|
|
393
|
-
}): Promise<DeleteEnvironmentResponse>;
|
|
394
|
-
/**
|
|
395
|
-
* The Environment's events, from `from` on: its lifecycle, and `environment.egress` for every
|
|
396
|
-
* connection its sandbox opens (with the turns that were running). `types` keeps only those
|
|
397
|
-
* types; `since` and `until` keep events recorded in that window (ISO times or `Date`s).
|
|
398
|
-
*/
|
|
399
|
-
events(environmentId: string, options?: {
|
|
400
|
-
from?: number;
|
|
401
|
-
types?: readonly EnvironmentEventType[];
|
|
402
|
-
since?: string | Date;
|
|
403
|
-
until?: string | Date;
|
|
404
|
-
signal?: AbortSignal;
|
|
405
|
-
}): Promise<EnvironmentEvent[]>;
|
|
406
|
-
/**
|
|
407
|
-
* One Environment for one session: creates the Environment (`sessions/<session id>` unless
|
|
408
|
-
* `environmentId` names another), writes `secrets`, opens the session on it, and returns both
|
|
409
|
-
* with `release()`, which deletes the Environment. If the session cannot be opened, the
|
|
410
|
-
* Environment is deleted again.
|
|
411
|
-
*/
|
|
412
|
-
forSession(options: ForSessionOptions): Promise<SessionEnvironmentHandle>;
|
|
413
|
-
}
|