agent-neckbeard 1.1.29 → 1.1.30
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 +7 -0
- package/README.md +25 -27
- package/dist/archil.d.ts +73 -0
- package/dist/archil.js +673 -0
- package/dist/build.cjs +129 -5315
- package/dist/build.d.cts +9 -5
- package/dist/build.d.ts +9 -5
- package/dist/build.js +4 -6
- package/dist/{chunk-BPXEIXPM.js → chunk-FHNQ5DNA.js} +3264 -564
- package/dist/{chunk-FSBTLBB5.js → chunk-I5GIWADK.js} +29 -7
- package/dist/chunk-I5NULOJP.js +129 -0
- package/dist/chunk-PKUGXECR.js +13 -0
- package/dist/chunk-QA4L7ZI2.js +72 -0
- package/dist/{chunk-KG6SJM74.js → chunk-VHBDBB3N.js} +8 -5
- package/dist/cli.cjs +124 -5309
- package/dist/cli.js +7 -8
- package/dist/define-gdmBe9RA.d.ts +227 -0
- package/dist/durable.d.ts +53 -0
- package/dist/durable.js +92 -0
- package/dist/index.cjs +720 -988
- package/dist/index.d.cts +139 -87
- package/dist/index.d.ts +139 -87
- package/dist/index.js +12 -11
- package/dist/inside.d.ts +15 -0
- package/dist/inside.js +530 -0
- package/dist/{invoke-client-P2CPBYTF.js → invoke-client-QB2NTZ3L.js} +1 -2
- package/dist/pi-watch-legacy.d.ts +4503 -0
- package/dist/serve.cjs +9 -439
- package/dist/serve.d.cts +14 -1
- package/dist/serve.d.ts +14 -1
- package/dist/serve.js +3 -5
- package/docs/AGENT.md +81 -77
- package/docs/DAYTONA.md +2 -0
- package/docs/DOCKER.md +0 -1
- package/docs/E2B.md +1 -1
- package/docs/LEGACY.md +1 -8
- package/docs/MODAL.md +1 -1
- package/package.json +57 -23
- package/types/pi-watch.d.cts +68 -0
- package/dist/chunk-33IXN6MM.js +0 -21
- package/dist/chunk-6P5I7ZCH.js +0 -2552
- package/dist/chunk-YFG4EKZM.js +0 -508
- package/dist/sandbox-capabilities-CFjnZ_kB.d.cts +0 -77
- package/dist/sandbox-capabilities-CFjnZ_kB.d.ts +0 -77
- package/dist/serve-Du2NCz9_.d.cts +0 -111
- package/dist/serve-Du2NCz9_.d.ts +0 -111
- package/dist/supervisor.cjs +0 -5731
- package/dist/supervisor.d.cts +0 -482
- package/dist/supervisor.d.ts +0 -482
- package/dist/supervisor.js +0 -3187
- package/docs/SUPERVISOR.md +0 -258
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
import { Buffer } from 'node:buffer';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
2
|
+
import * as agent_neckbeard_pi_watch from 'agent-neckbeard/pi-watch';
|
|
3
|
+
import { HostStartOptions, Context, HostSession } from 'agent-neckbeard/pi-watch';
|
|
4
|
+
export { HostExecutionFactory, HostSession, HostStartOptions, PiWatchEvent, RemoteConversation, RemoteInput } from 'agent-neckbeard/pi-watch';
|
|
5
|
+
import { ServeHandle } from './serve.cjs';
|
|
6
|
+
|
|
7
|
+
/** File content accepted by the public sandbox client. */
|
|
8
|
+
type SandboxFileContent$1 = string | ArrayBuffer | Uint8Array;
|
|
9
|
+
interface SandboxCommandOptions {
|
|
10
|
+
cwd?: string;
|
|
11
|
+
envs?: Record<string, string>;
|
|
12
|
+
timeoutMs: number;
|
|
13
|
+
onStdout?: (data: string) => void;
|
|
14
|
+
onStderr?: (data: string) => void;
|
|
15
|
+
}
|
|
16
|
+
/** Result from running a sandbox command with captured output. */
|
|
17
|
+
interface SandboxCommandResult {
|
|
18
|
+
exitCode: number;
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
}
|
|
22
|
+
interface SandboxDetachedCommandOptions {
|
|
23
|
+
cwd?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Environment applied only when the requested payload is spawned. Detached
|
|
26
|
+
* lifecycle preparation and its persistent reaper use a fixed clean
|
|
27
|
+
* environment.
|
|
28
|
+
*/
|
|
29
|
+
envs?: Record<string, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Stable semantic identity for this launch. Providers hash this value before
|
|
32
|
+
* using it in sandbox paths so retries can adopt an already-prepared process
|
|
33
|
+
* without exposing the raw identity.
|
|
34
|
+
*/
|
|
35
|
+
launchId?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Runs after the provider has captured a birth-fenced process identity but
|
|
38
|
+
* before the sandbox process is allowed to execute the requested command.
|
|
39
|
+
*/
|
|
40
|
+
beforeRelease?: (command: SandboxDetachedCommand) => void | Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
interface SandboxDetachedCommand {
|
|
43
|
+
/**
|
|
44
|
+
* Provider-owned opaque session identity. Pass the complete handle to
|
|
45
|
+
* follow-up APIs instead of separating this value from `commandId`.
|
|
46
|
+
*/
|
|
47
|
+
readonly sessionId: string;
|
|
48
|
+
/** Provider-owned command identity, when the underlying provider has one. */
|
|
49
|
+
readonly commandId?: string;
|
|
50
|
+
}
|
|
5
51
|
|
|
6
52
|
/** Sandbox providers supported by the public and in-sandbox runtimes. */
|
|
7
53
|
type SandboxProvider = 'e2b' | 'daytona' | 'modal' | 'docker';
|
|
@@ -19,9 +65,7 @@ interface SandboxContext {
|
|
|
19
65
|
interface CreateAttachedSessionOptions {
|
|
20
66
|
/**
|
|
21
67
|
* Attached sessions are owned by this client process and stop when their
|
|
22
|
-
* active request is cancelled.
|
|
23
|
-
* deprecated `agent-neckbeard/supervisor` entrypoint because their control
|
|
24
|
-
* plane must outlive this object.
|
|
68
|
+
* active request is cancelled.
|
|
25
69
|
*/
|
|
26
70
|
durability?: 'attached';
|
|
27
71
|
/** Existing sandbox runtime to reconnect to. Defaults to the deployed sandbox. */
|
|
@@ -104,6 +148,24 @@ type ModalSandboxConnectOptions = ModalClientCredentials & {
|
|
|
104
148
|
sandboxId: string;
|
|
105
149
|
};
|
|
106
150
|
|
|
151
|
+
/**
|
|
152
|
+
* The image tag a host should run: `NECKBEARD_IMAGE_TAG`, else the commit its platform deployed,
|
|
153
|
+
* which is the commit CI tagged the image with.
|
|
154
|
+
*/
|
|
155
|
+
declare function resolveImageTag(env?: NodeJS.ProcessEnv): string | undefined;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Wire contract between `Agent` on the host and `serve()` in the sandbox. See docs/AGENT.md.
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
declare const TURN_PROTOCOL_VERSION = 6;
|
|
162
|
+
interface TurnHealth {
|
|
163
|
+
ok: true;
|
|
164
|
+
protocolVersion: number;
|
|
165
|
+
busy: boolean;
|
|
166
|
+
turnId: string | null;
|
|
167
|
+
}
|
|
168
|
+
|
|
107
169
|
type DaytonaCreateOptions = Extract<SandboxClientCreateOptions, {
|
|
108
170
|
provider: 'daytona';
|
|
109
171
|
}>;
|
|
@@ -143,40 +205,28 @@ interface AgentOptions {
|
|
|
143
205
|
/** Port `serve()` listens on, passed to it as `NECKBEARD_PORT`. Defaults to 8080. */
|
|
144
206
|
port?: number;
|
|
145
207
|
/** Environment of every sandbox. Secrets go here or in `start()`, never in the image. */
|
|
146
|
-
|
|
208
|
+
env?: Record<string, string | undefined>;
|
|
147
209
|
/** How long `start()` waits for the runtime to answer. Defaults to two minutes. */
|
|
148
210
|
startTimeoutMs?: number;
|
|
149
211
|
/** How long `prepare()` waits for a Daytona snapshot or E2B template build. Defaults to 30 minutes. */
|
|
150
212
|
prepareTimeoutMs?: number;
|
|
151
213
|
}
|
|
214
|
+
interface SandboxSession {
|
|
215
|
+
sandboxId: string;
|
|
216
|
+
conversation: agent_neckbeard_pi_watch.RemoteConversation;
|
|
217
|
+
}
|
|
152
218
|
interface StartOptions {
|
|
153
|
-
|
|
219
|
+
env?: Record<string, string | undefined>;
|
|
154
220
|
/** Names the conversation a persisted Pi session keeps, given to the runtime as `NECKBEARD_SESSION_ID`. */
|
|
155
221
|
sessionId?: string;
|
|
156
222
|
signal?: AbortSignal;
|
|
157
223
|
}
|
|
158
|
-
interface RunOptions<TEvent> extends Omit<TurnStreamOptions, 'after'> {
|
|
159
|
-
/** Receives each record as it streams, for example to store or show it, keyed by `seq`. */
|
|
160
|
-
onRecord?: (record: TurnRecord<TEvent>) => void | Promise<void>;
|
|
161
|
-
}
|
|
162
|
-
interface TurnStreamOptions {
|
|
163
|
-
/** Stops reading the stream; the turn keeps running. Use `abort()` to stop the turn. */
|
|
164
|
-
signal?: AbortSignal;
|
|
165
|
-
/** Resume after this record's `seq`. Defaults to -1, the start of the turn. */
|
|
166
|
-
after?: number;
|
|
167
|
-
/**
|
|
168
|
-
* How long to keep reconnecting without a healthy connection. Defaults to two minutes. A
|
|
169
|
-
* connection that sends nothing, not even the runtime's heartbeat every 15 seconds, for this long
|
|
170
|
-
* is abandoned, so keep it above 15 seconds.
|
|
171
|
-
*/
|
|
172
|
-
reconnectTimeoutMs?: number;
|
|
173
|
-
}
|
|
174
224
|
/**
|
|
175
225
|
* Runs a Pi agent from a prebuilt image whose main process is `serve()` from
|
|
176
226
|
* `agent-neckbeard/serve`. Every method takes the sandbox ID, so any host process can drive a
|
|
177
227
|
* sandbox another one started.
|
|
178
228
|
*/
|
|
179
|
-
declare class Agent
|
|
229
|
+
declare class Agent {
|
|
180
230
|
private readonly options;
|
|
181
231
|
readonly name: string;
|
|
182
232
|
readonly image: string;
|
|
@@ -203,34 +253,16 @@ declare class Agent<TEvent = unknown> {
|
|
|
203
253
|
onLog?: (line: string) => void;
|
|
204
254
|
refresh?: boolean;
|
|
205
255
|
}): Promise<void>;
|
|
206
|
-
/**
|
|
207
|
-
start(options?: StartOptions): Promise<
|
|
208
|
-
/**
|
|
209
|
-
* Starts a turn and streams its records until its `end` record. Starting a turn whose
|
|
210
|
-
* `turnId` the runtime already has resumes it instead of running it again.
|
|
211
|
-
*/
|
|
212
|
-
prompt(sandboxId: string, turn: StartTurnRequest, options?: TurnStreamOptions): AsyncGenerator<TurnRecord<TEvent>>;
|
|
213
|
-
/**
|
|
214
|
-
* Runs a Pi turn to its end and returns its final assistant text, or null when it had none.
|
|
215
|
-
* Throws `ExecutionError` when the turn did not complete or its model did not stop on its own.
|
|
216
|
-
* Running a turn again with the same `turnId` replays its records from the start.
|
|
217
|
-
*/
|
|
218
|
-
run(sandboxId: string, turn: StartTurnRequest, options?: RunOptions<TEvent>): Promise<string | null>;
|
|
219
|
-
/**
|
|
220
|
-
* Streams a turn's records after `options.after` until its `end` record, reconnecting when
|
|
221
|
-
* the connection drops. Throws `TurnLostError` when the runtime no longer has the turn.
|
|
222
|
-
*/
|
|
223
|
-
events(sandboxId: string, turnId: string, options?: TurnStreamOptions): AsyncGenerator<TurnRecord<TEvent>>;
|
|
224
|
-
/** Asks the runtime to stop the turn; its stream then ends with an `aborted` record. */
|
|
225
|
-
abort(sandboxId: string, turnId: string, signal?: AbortSignal): Promise<void>;
|
|
256
|
+
/** Launches a sandbox. To reconnect to one, call `attach()`. */
|
|
257
|
+
start(options?: StartOptions): Promise<SandboxSession>;
|
|
226
258
|
/**
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* record's `undeliveredSteerIds`. Resolves to false when the turn can no longer take it, or the
|
|
230
|
-
* runtime no longer has it, so the caller can send the message as a turn of its own. Throws when
|
|
231
|
-
* queueing failed or the request did; calling again with the same `steerId` never queues it twice.
|
|
259
|
+
* Reconnects to a running sandbox by its provider ID, including while it is busy. Never creates,
|
|
260
|
+
* starts or kills a sandbox, and admits no input.
|
|
232
261
|
*/
|
|
233
|
-
|
|
262
|
+
attach(sandboxId: string, options?: {
|
|
263
|
+
signal?: AbortSignal;
|
|
264
|
+
}): Promise<SandboxSession>;
|
|
265
|
+
private handle;
|
|
234
266
|
health(sandboxId: string, signal?: AbortSignal): Promise<TurnHealth>;
|
|
235
267
|
/** Waits until no turn runs, for example before reading files a turn writes. */
|
|
236
268
|
waitForIdle(sandboxId: string, options?: {
|
|
@@ -242,8 +274,9 @@ declare class Agent<TEvent = unknown> {
|
|
|
242
274
|
* failure throws, so cleanup can be retried, since a Daytona sandbox need not expire on its own.
|
|
243
275
|
*/
|
|
244
276
|
kill(sandboxId: string): Promise<void>;
|
|
245
|
-
/** File and command access to a sandbox, for staging inputs and reading results. */
|
|
277
|
+
/** File and command access to a sandbox, for staging inputs and reading results. Starts a stopped Daytona sandbox and resumes a paused E2B one. */
|
|
246
278
|
sandbox(sandboxId: string): Promise<SandboxClient>;
|
|
279
|
+
private connect;
|
|
247
280
|
/**
|
|
248
281
|
* Deletes this agent's Daytona snapshots or E2B templates except the newest `keep` and the
|
|
249
282
|
* current one. Returns the names it deleted.
|
|
@@ -254,9 +287,12 @@ declare class Agent<TEvent = unknown> {
|
|
|
254
287
|
}): Promise<string[]>;
|
|
255
288
|
private createSandbox;
|
|
256
289
|
private startE2bRuntime;
|
|
290
|
+
private requireProtocol;
|
|
257
291
|
private waitForRuntime;
|
|
258
292
|
private endpoint;
|
|
259
293
|
private request;
|
|
294
|
+
private throwIfGone;
|
|
295
|
+
private lookup;
|
|
260
296
|
private prepareDaytonaSnapshot;
|
|
261
297
|
private prepareE2bTemplate;
|
|
262
298
|
private listDaytonaSnapshots;
|
|
@@ -266,11 +302,6 @@ declare class Agent<TEvent = unknown> {
|
|
|
266
302
|
|
|
267
303
|
/** Where `neckbeard build` installs an agent's skills in its image. */
|
|
268
304
|
declare const SKILLS_DIR = "/app/.agents/skills";
|
|
269
|
-
/**
|
|
270
|
-
* The image tag a host should run: `NECKBEARD_IMAGE_TAG`, else the commit its platform deployed,
|
|
271
|
-
* which is the commit CI tagged the image with.
|
|
272
|
-
*/
|
|
273
|
-
declare function resolveImageTag(env?: NodeJS.ProcessEnv): string | undefined;
|
|
274
305
|
type ThinkingLevel = 'off' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
275
306
|
/** A Pi session for `defineAgent()` to create in the sandbox. */
|
|
276
307
|
interface PiSessionConfig {
|
|
@@ -294,6 +325,7 @@ interface PiSessionConfig {
|
|
|
294
325
|
}
|
|
295
326
|
/** An agent: its image, sandbox, and either a Pi session config or its own session factory. */
|
|
296
327
|
interface AgentDefinition {
|
|
328
|
+
mode: 'harness-inside-sandbox' | 'harness-outside-sandbox';
|
|
297
329
|
/** Names the image and the provider's snapshots or templates; lowercase letters, digits, and dashes. */
|
|
298
330
|
name: string;
|
|
299
331
|
/** Registry the image lives under, such as `ghcr.io/acme`; the image is `<registry>/<name>:<tag>`. */
|
|
@@ -301,13 +333,13 @@ interface AgentDefinition {
|
|
|
301
333
|
/** A full image reference instead of `registry`, such as one built elsewhere. */
|
|
302
334
|
image?: string;
|
|
303
335
|
/** The sandbox, or a function returning it, read only on the host. */
|
|
304
|
-
sandbox
|
|
336
|
+
sandbox?: AgentSandbox | (() => AgentSandbox);
|
|
305
337
|
/**
|
|
306
338
|
* Environment of every sandbox, or a function returning it, read only on the host, so the image
|
|
307
339
|
* needs none of the host's configuration. Never secrets in the image. A `pi` agent is traced in
|
|
308
340
|
* Braintrust when this has BRAINTRUST_API_KEY and BRAINTRUST_PROJECT_NAME; see docs/AGENT.md#tracing.
|
|
309
341
|
*/
|
|
310
|
-
|
|
342
|
+
env?: Record<string, string | undefined> | (() => Record<string, string | undefined>);
|
|
311
343
|
/** The image's main process. Defaults to `node /app/agent.mjs`, the entry point `neckbeard build` writes. */
|
|
312
344
|
command?: string[];
|
|
313
345
|
/** The port the runtime listens on, given to it as NECKBEARD_PORT. Defaults to 8080. */
|
|
@@ -316,14 +348,12 @@ interface AgentDefinition {
|
|
|
316
348
|
startTimeoutMs?: number;
|
|
317
349
|
/** How long `prepare()` may take to create a Daytona snapshot or E2B template. Defaults to 30 minutes. */
|
|
318
350
|
prepareTimeoutMs?: number;
|
|
319
|
-
/**
|
|
351
|
+
/** Aborts an inside-sandbox Pi submission when it exceeds this duration. Host-side workers own native submission deadlines. */
|
|
320
352
|
maxTurnDurationMs?: number;
|
|
321
|
-
/** See `ServeOptions.abortGraceMs`. */
|
|
322
|
-
abortGraceMs?: number;
|
|
323
353
|
/** The agent's Pi session. */
|
|
324
354
|
pi?: PiSessionConfig;
|
|
325
355
|
/** Creates the session instead of `pi`, for one that config can't express. */
|
|
326
|
-
createSession?: () => Promise<
|
|
356
|
+
createSession?: () => Promise<agent_neckbeard_pi_watch.ServedConversation>;
|
|
327
357
|
build?: {
|
|
328
358
|
/** Packages the image installs instead of bundling; Pi's always are, and for a `pi` agent Braintrust when its package depends on it. */
|
|
329
359
|
external?: string[];
|
|
@@ -337,33 +367,44 @@ declare const definedAgentMarker: unique symbol;
|
|
|
337
367
|
* its `Agent` the first time one is needed, so importing it in the image requires no image tag or
|
|
338
368
|
* host configuration. In the image, `serve()` serves its session.
|
|
339
369
|
*/
|
|
340
|
-
declare class
|
|
370
|
+
declare class AgentImage {
|
|
341
371
|
readonly definition: AgentDefinition;
|
|
342
372
|
readonly [definedAgentMarker] = true;
|
|
343
|
-
private client?;
|
|
344
|
-
private braintrustChecked;
|
|
345
373
|
constructor(definition: AgentDefinition);
|
|
346
374
|
get name(): string;
|
|
347
375
|
/** The image this host runs: `image`, else `<registry>/<name>:<tag>` with the tag `resolveImageTag()` finds. */
|
|
348
376
|
imageRef(tag?: string | undefined): string;
|
|
377
|
+
}
|
|
378
|
+
interface HostAgentDefinition extends AgentDefinition {
|
|
379
|
+
mode: 'harness-outside-sandbox';
|
|
380
|
+
pi: PiSessionConfig;
|
|
381
|
+
sandbox?: never;
|
|
382
|
+
createSession?: never;
|
|
383
|
+
env?: never;
|
|
384
|
+
}
|
|
385
|
+
declare class DefinedHostAgent extends AgentImage {
|
|
386
|
+
constructor(definition: HostAgentDefinition);
|
|
387
|
+
start(options: HostStartOptions, context: Context): Promise<HostSession>;
|
|
388
|
+
}
|
|
389
|
+
declare class DefinedAgent extends AgentImage {
|
|
390
|
+
private client?;
|
|
391
|
+
private braintrustChecked;
|
|
349
392
|
/** The `Agent` for an image, by default the one this host runs. */
|
|
350
|
-
forImage(image?: string): Agent
|
|
393
|
+
forImage(image?: string): Agent;
|
|
351
394
|
private get agent();
|
|
352
395
|
get artifactName(): string;
|
|
353
|
-
prepare(options?: Parameters<Agent
|
|
354
|
-
start(options?: StartOptions): Promise<
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
abort(sandboxId: string, turnId: string, signal?: AbortSignal): Promise<void>;
|
|
359
|
-
steer(sandboxId: string, turnId: string, steer: SteerTurnRequest, signal?: AbortSignal): Promise<boolean>;
|
|
396
|
+
prepare(options?: Parameters<Agent['prepare']>[0]): Promise<void>;
|
|
397
|
+
start(options?: StartOptions): Promise<SandboxSession>;
|
|
398
|
+
attach(sandboxId: string, options?: {
|
|
399
|
+
signal?: AbortSignal;
|
|
400
|
+
}): Promise<SandboxSession>;
|
|
360
401
|
health(sandboxId: string, signal?: AbortSignal): Promise<TurnHealth>;
|
|
361
402
|
waitForIdle(sandboxId: string, options?: {
|
|
362
403
|
timeoutMs?: number;
|
|
363
404
|
signal?: AbortSignal;
|
|
364
405
|
}): Promise<void>;
|
|
365
406
|
kill(sandboxId: string): Promise<void>;
|
|
366
|
-
sandbox(sandboxId: string): ReturnType<Agent
|
|
407
|
+
sandbox(sandboxId: string): ReturnType<Agent['sandbox']>;
|
|
367
408
|
gc(options?: {
|
|
368
409
|
keep?: number;
|
|
369
410
|
alsoKeep?: string[];
|
|
@@ -374,10 +415,19 @@ declare class DefinedAgent<TEvent = unknown> {
|
|
|
374
415
|
serve(options?: {
|
|
375
416
|
port?: number;
|
|
376
417
|
host?: string;
|
|
418
|
+
createSession?: () => Promise<agent_neckbeard_pi_watch.ServedConversation>;
|
|
377
419
|
}): Promise<ServeHandle>;
|
|
378
420
|
}
|
|
379
|
-
declare function defineAgent
|
|
380
|
-
declare function
|
|
421
|
+
declare function defineAgent(definition: HostAgentDefinition): DefinedHostAgent;
|
|
422
|
+
declare function defineAgent(definition: AgentDefinition & {
|
|
423
|
+
mode: 'harness-inside-sandbox';
|
|
424
|
+
}): DefinedAgent;
|
|
425
|
+
declare function isDefinedAgent(value: unknown): value is DefinedAgent | DefinedHostAgent;
|
|
426
|
+
|
|
427
|
+
declare class RemoteAdmissionRejected extends Error {
|
|
428
|
+
}
|
|
429
|
+
declare class RemoteSubmissionNotFound extends Error {
|
|
430
|
+
}
|
|
381
431
|
|
|
382
432
|
interface DockerSandboxConfig {
|
|
383
433
|
provider: 'docker';
|
|
@@ -425,6 +475,13 @@ declare class DeploymentError extends NeckbeardError {
|
|
|
425
475
|
/** A sandbox the failure left behind, for `kill()`. */
|
|
426
476
|
constructor(message: string, cause?: Error | undefined, sandboxId?: string | undefined);
|
|
427
477
|
}
|
|
478
|
+
/**
|
|
479
|
+
* Error thrown by `attach()` when the provider reports the sandbox absent, terminated or not
|
|
480
|
+
* running. Any other failure, such as a provider outage, surfaces as itself.
|
|
481
|
+
*/
|
|
482
|
+
declare class SandboxGoneError extends DeploymentError {
|
|
483
|
+
constructor(message: string, cause?: Error);
|
|
484
|
+
}
|
|
428
485
|
/**
|
|
429
486
|
* Error thrown when input or output schema validation fails.
|
|
430
487
|
*/
|
|
@@ -446,13 +503,6 @@ declare class ExecutionError extends NeckbeardError {
|
|
|
446
503
|
declare class RuntimeBusyError extends ExecutionError {
|
|
447
504
|
constructor(message: string);
|
|
448
505
|
}
|
|
449
|
-
/**
|
|
450
|
-
* Thrown when a sandbox's runtime no longer knows a turn, because the sandbox restarted or was
|
|
451
|
-
* replaced. The turn's outcome is unknown.
|
|
452
|
-
*/
|
|
453
|
-
declare class TurnLostError extends ExecutionError {
|
|
454
|
-
constructor(message: string);
|
|
455
|
-
}
|
|
456
506
|
/**
|
|
457
507
|
* Error thrown when required environment variables are missing.
|
|
458
508
|
*/
|
|
@@ -853,7 +903,9 @@ declare class SandboxClient {
|
|
|
853
903
|
}>): Promise<SandboxClient & {
|
|
854
904
|
readonly provider: 'e2b';
|
|
855
905
|
}>;
|
|
856
|
-
static connect(options: SandboxClientConnectOptions
|
|
906
|
+
static connect(options: SandboxClientConnectOptions, mode?: {
|
|
907
|
+
wake?: boolean;
|
|
908
|
+
}): Promise<SandboxClient>;
|
|
857
909
|
get id(): string;
|
|
858
910
|
get provider(): SandboxProvider;
|
|
859
911
|
get paths(): AgentSandboxContext;
|
|
@@ -901,7 +953,7 @@ declare class SandboxClient {
|
|
|
901
953
|
/** @deprecated Use `AgentKind` for user-facing task/session terminology. */
|
|
902
954
|
type AgentMode = 'run' | 'stream';
|
|
903
955
|
type AgentKind = 'task' | 'session';
|
|
904
|
-
/** @deprecated
|
|
956
|
+
/** @deprecated Only attached sessions exist; the durable-session supervisor was removed. */
|
|
905
957
|
type SessionDurability = 'attached' | 'durable';
|
|
906
958
|
/**
|
|
907
959
|
* @deprecated Bundles the agent's code on the host and uploads it, its dependencies, and its
|
|
@@ -1044,4 +1096,4 @@ declare class LegacyBundledAgent<TInput, TOutput = unknown, TFrame = unknown> {
|
|
|
1044
1096
|
}): AsyncGenerator<TFrame>;
|
|
1045
1097
|
}
|
|
1046
1098
|
|
|
1047
|
-
export { Agent, type AgentConfig, type AgentDefinition, type AgentKind, type AgentMode, type AgentOptions, type AgentRunContext, type AgentRunResult, type AgentSandbox, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaAgentSandbox, type DaytonaSandboxConfig, DefinedAgent, DeploymentError, type DockerSandboxConfig, type E2BSandboxConfig, type E2bAgentSandbox, ExecutionError, type FileDownload, LegacyBundledAgent, type LocalDirectoryUpload, type ModalAgentSandbox, type ModalSandboxConfig, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type PiSessionConfig,
|
|
1099
|
+
export { Agent, type AgentConfig, type AgentDefinition, type AgentKind, type AgentMode, type AgentOptions, type AgentRunContext, type AgentRunResult, type AgentSandbox, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaAgentSandbox, type DaytonaSandboxConfig, DefinedAgent, DefinedHostAgent, DeploymentError, type DockerSandboxConfig, type E2BSandboxConfig, type E2bAgentSandbox, ExecutionError, type FileDownload, type HostAgentDefinition, LegacyBundledAgent, type LocalDirectoryUpload, type ModalAgentSandbox, type ModalSandboxConfig, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type PiSessionConfig, RemoteAdmissionRejected, RemoteSubmissionNotFound, type ResolveAgentSourceFileOptions, type RunAgentConfig, RuntimeBusyError, SKILLS_DIR, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, type SandboxCommandOptions, type SandboxCommandResult, type SandboxConfig, type SandboxDetachedCommand, type SandboxDetachedCommandOptions, type SandboxFileContent, SandboxGoneError, type SandboxProvider, type SandboxServerEndpoint, type SandboxSession, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, type StartOptions, TURN_PROTOCOL_VERSION, type TurnHealth, ValidationError, defineAgent, isDefinedAgent, resolveAgentSourceFile, resolveImageTag, withNeckbeardNextConfig };
|