eve 0.36.0 → 0.37.1
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 +29 -0
- package/README.md +1 -0
- package/dist/src/channel/routes.d.ts +13 -3
- package/dist/src/channel/routes.js +1 -1
- package/dist/src/channel/session-callback.js +1 -1
- package/dist/src/channel/session.d.ts +2 -1
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +41 -0
- package/dist/src/chunks/{use-eve-agent-CnppTEFk.js → use-eve-agent-Bi5fRxcZ.js} +9 -1
- package/dist/src/chunks/{use-eve-agent-COmP-H8R.js → use-eve-agent-DbKUBhl-.js} +9 -1
- package/dist/src/cli/commands/agent-instructions.d.ts +4 -4
- package/dist/src/cli/commands/init-confirm.d.ts +12 -0
- package/dist/src/cli/commands/init-confirm.js +1 -0
- package/dist/src/cli/commands/init-git.js +1 -1
- package/dist/src/cli/commands/init-recovery.d.ts +3 -0
- package/dist/src/cli/commands/init-recovery.js +3 -0
- package/dist/src/cli/commands/init-target.d.ts +21 -0
- package/dist/src/cli/commands/init-target.js +1 -0
- package/dist/src/cli/commands/init.d.ts +6 -5
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +8 -0
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/subagent-pump.d.ts +27 -22
- package/dist/src/cli/dev/tui/subagent-pump.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +16 -0
- package/dist/src/cli/dev/tui/terminal-renderer.js +12 -12
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/cli/run.d.ts +1 -0
- package/dist/src/cli/run.js +3 -3
- package/dist/src/client/open-stream.d.ts +2 -0
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +3 -1
- package/dist/src/compiled/@modelcontextprotocol/server/LICENSE +216 -0
- package/dist/src/compiled/@modelcontextprotocol/server/index.d.ts +98 -0
- package/dist/src/compiled/@modelcontextprotocol/server/index.js +80 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +339 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +1 -1
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +25 -1
- package/dist/src/compiled/@vercel/sandbox/drive.d.ts +140 -0
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -2
- package/dist/src/compiled/@vercel/sandbox/index.js +13 -13
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +55 -18
- package/dist/src/compiled/@vercel/sandbox-stable/LICENSE +201 -0
- package/dist/src/compiled/@vercel/sandbox-stable/_async-retry.d.ts +8 -0
- package/dist/src/compiled/@vercel/sandbox-stable/_workflow-serde.d.ts +5 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-client.d.ts +1456 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/api-error.d.ts +29 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/base-client.d.ts +39 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/file-writer.d.ts +66 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/index.d.ts +2 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/validators.d.ts +899 -0
- package/dist/src/compiled/@vercel/sandbox-stable/api-client/with-retry.d.ts +10 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/error.d.ts +15 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/file.d.ts +18 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/index.d.ts +6 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/oauth.d.ts +111 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/poll-for-token.d.ts +28 -0
- package/dist/src/compiled/@vercel/sandbox-stable/auth/project.d.ts +40 -0
- package/dist/src/compiled/@vercel/sandbox-stable/command.d.ts +292 -0
- package/dist/src/compiled/@vercel/sandbox-stable/constants.d.ts +5 -0
- package/dist/src/compiled/@vercel/sandbox-stable/execution-context.d.ts +116 -0
- package/dist/src/compiled/@vercel/sandbox-stable/filesystem.d.ts +258 -0
- package/dist/src/compiled/@vercel/sandbox-stable/index.d.ts +12 -0
- package/dist/src/compiled/@vercel/sandbox-stable/index.js +1 -0
- package/dist/src/compiled/@vercel/sandbox-stable/network-policy.d.ts +169 -0
- package/dist/src/compiled/@vercel/sandbox-stable/proxy.d.ts +55 -0
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox-user.d.ts +212 -0
- package/dist/src/compiled/@vercel/sandbox-stable/sandbox.d.ts +1216 -0
- package/dist/src/compiled/@vercel/sandbox-stable/session.d.ts +433 -0
- package/dist/src/compiled/@vercel/sandbox-stable/snapshot.d.ts +229 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/get-credentials.d.ts +21 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/paginator.d.ts +16 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/resolveSignal.d.ts +15 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/sandbox-snapshot.d.ts +11 -0
- package/dist/src/compiled/@vercel/sandbox-stable/utils/types.d.ts +11 -0
- package/dist/src/compiled/_chunks/node/{auth-BS3UoyvT.js → auth-BaNbsImr.js} +1 -1
- package/dist/src/compiled/_chunks/node/version-BYHw-SDY.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +10 -10
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/normalize-subagent.d.ts +1 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/context/serialized-dynamic-model-selection.d.ts +2 -0
- package/dist/src/context/serialized-dynamic-model-selection.js +1 -0
- package/dist/src/execution/agent-handle-dispatch.d.ts +15 -1
- package/dist/src/execution/agent-handle-dispatch.js +1 -1
- package/dist/src/execution/cancel-descendant-turns-step.js +1 -1
- package/dist/src/execution/delegated-parent-notification.d.ts +17 -0
- package/dist/src/execution/delegated-parent-notification.js +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/dispatch-runtime-actions-shared.d.ts +155 -0
- package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -0
- package/dist/src/execution/dispatch-runtime-actions-step.d.ts +18 -14
- package/dist/src/execution/dispatch-runtime-actions-step.js +1 -1
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.d.ts +7 -2
- package/dist/src/execution/dispatch-workflow-runtime-actions-step.js +1 -1
- package/dist/src/execution/effective-output-schema.d.ts +21 -0
- package/dist/src/execution/effective-output-schema.js +1 -0
- package/dist/src/execution/eve-workflow-attributes.d.ts +2 -0
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/parked-delivery-wait.d.ts +8 -12
- package/dist/src/execution/parked-delivery-wait.js +1 -1
- package/dist/src/execution/{route-proxied-deliver-step.d.ts → proxied-deliver-step.d.ts} +7 -4
- package/dist/src/execution/proxied-deliver-step.js +1 -0
- package/dist/src/execution/remote-agent-dispatch.d.ts +32 -0
- package/dist/src/execution/remote-agent-dispatch.js +1 -1
- package/dist/src/execution/remote-agent-route-url.d.ts +2 -0
- package/dist/src/execution/remote-agent-route-url.js +1 -0
- package/dist/src/execution/route-child-delivery.d.ts +2 -1
- package/dist/src/execution/route-child-delivery.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/session-callback-step.d.ts +11 -0
- package/dist/src/execution/session-callback-step.js +1 -1
- package/dist/src/execution/session-command-wire.js +1 -1
- package/dist/src/execution/session-state-cursor.d.ts +25 -0
- package/dist/src/execution/session-state-cursor.js +1 -0
- package/dist/src/execution/settle-cancelled-turn-step.d.ts +2 -0
- package/dist/src/execution/settle-cancelled-turn-step.js +1 -1
- package/dist/src/execution/subagent-event-proxy-step.d.ts +15 -0
- package/dist/src/execution/subagent-event-proxy-step.js +1 -1
- package/dist/src/execution/subagent-hitl-proxy.d.ts +14 -7
- package/dist/src/execution/subagent-hitl-proxy.js +1 -1
- package/dist/src/execution/subagent-start-local.d.ts +29 -0
- package/dist/src/execution/subagent-start-local.js +1 -0
- package/dist/src/execution/subagent-start-remote.d.ts +23 -0
- package/dist/src/execution/subagent-start-remote.js +1 -0
- package/dist/src/execution/task-event-callback.d.ts +13 -0
- package/dist/src/execution/task-event-callback.js +1 -0
- package/dist/src/execution/task-input-capability.d.ts +4 -0
- package/dist/src/execution/task-input-capability.js +1 -0
- package/dist/src/execution/tasks/child/steps.d.ts +46 -0
- package/dist/src/execution/tasks/child/steps.js +1 -0
- package/dist/src/execution/tasks/child/workflow.d.ts +31 -0
- package/dist/src/execution/tasks/child/workflow.js +1 -0
- package/dist/src/execution/tasks/parent/agent-identity.d.ts +13 -0
- package/dist/src/execution/tasks/parent/agent-identity.js +1 -0
- package/dist/src/execution/tasks/parent/agent-views.d.ts +6 -0
- package/dist/src/execution/tasks/parent/agent-views.js +1 -0
- package/dist/src/execution/tasks/parent/continuation-dispatch.d.ts +37 -0
- package/dist/src/execution/tasks/parent/continuation-dispatch.js +1 -0
- package/dist/src/execution/tasks/parent/control-shared.d.ts +36 -0
- package/dist/src/execution/tasks/parent/control-shared.js +1 -0
- package/dist/src/execution/tasks/parent/delegate.d.ts +70 -0
- package/dist/src/execution/tasks/parent/delegate.js +1 -0
- package/dist/src/execution/tasks/parent/dispatch-task-step.d.ts +19 -0
- package/dist/src/execution/tasks/parent/dispatch-task-step.js +1 -0
- package/dist/src/execution/tasks/parent/dispatch.d.ts +33 -0
- package/dist/src/execution/tasks/parent/dispatch.js +1 -0
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.d.ts +29 -0
- package/dist/src/execution/tasks/parent/hitl-proxy-steps.js +1 -0
- package/dist/src/execution/tasks/parent/run-parent.d.ts +72 -0
- package/dist/src/execution/tasks/parent/run-parent.js +1 -0
- package/dist/src/execution/tasks/parent/send.d.ts +25 -0
- package/dist/src/execution/tasks/parent/send.js +1 -0
- package/dist/src/execution/tasks/workflow-target.d.ts +2 -0
- package/dist/src/execution/tasks/workflow-target.js +1 -0
- package/dist/src/execution/terminate-child-sessions-step.d.ts +1 -0
- package/dist/src/execution/terminate-child-sessions-step.js +1 -1
- package/dist/src/execution/turn-control-receiver.d.ts +10 -0
- package/dist/src/execution/turn-control-receiver.js +1 -1
- package/dist/src/execution/turn-dispatch.d.ts +2 -0
- package/dist/src/execution/turn-dispatch.js +1 -1
- package/dist/src/execution/turn-execution-cursor.d.ts +2 -8
- package/dist/src/execution/turn-execution-cursor.js +1 -1
- package/dist/src/execution/turn-workflow.js +1 -1
- package/dist/src/execution/workflow-callback-url.d.ts +5 -0
- package/dist/src/execution/workflow-callback-url.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-runtime.d.ts +9 -0
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/execution/workflow-steps.d.ts +7 -21
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/advertised-tools.js +1 -1
- package/dist/src/harness/authorization.js +1 -1
- package/dist/src/harness/execute-tool.d.ts +7 -0
- package/dist/src/harness/handles/prompt.d.ts +12 -0
- package/dist/src/harness/handles/prompt.js +2 -1
- package/dist/src/harness/handles/query.js +1 -1
- package/dist/src/harness/handles/store.d.ts +9 -2
- package/dist/src/harness/handles/store.js +1 -1
- package/dist/src/harness/handles/transitions.d.ts +10 -1
- package/dist/src/harness/handles/transitions.js +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +21 -4
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/runtime-actions.d.ts +2 -0
- package/dist/src/harness/runtime-actions.js +1 -1
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/workflow-runtime-action-state.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/core.js +1 -1
- package/dist/src/internal/invocation/agent-invocation.d.ts +54 -0
- package/dist/src/internal/invocation/agent-invocation.js +1 -0
- package/dist/src/internal/invocation/attributes.d.ts +2 -0
- package/dist/src/internal/invocation/attributes.js +1 -0
- package/dist/src/internal/invocation/metadata.d.ts +9 -0
- package/dist/src/internal/invocation/metadata.js +1 -0
- package/dist/src/internal/invocation/workflow-execution.d.ts +32 -0
- package/dist/src/internal/invocation/workflow-execution.js +1 -0
- package/dist/src/internal/mcp/http-security.d.ts +12 -0
- package/dist/src/internal/mcp/http-security.js +1 -0
- package/dist/src/internal/mcp/protected-resource.d.ts +9 -0
- package/dist/src/internal/mcp/protected-resource.js +1 -0
- package/dist/src/internal/mcp/streamable-http-server.d.ts +51 -0
- package/dist/src/internal/mcp/streamable-http-server.js +1 -0
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/nitro/routes/channel-route-context.d.ts +14 -0
- package/dist/src/internal/nitro/routes/channel-route-context.js +1 -1
- package/dist/src/internal/nitro/routes/runtime-stack.d.ts +2 -0
- package/dist/src/internal/nitro/routes/runtime-stack.js +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/protocol/message.d.ts +28 -0
- package/dist/src/protocol/message.js +2 -2
- package/dist/src/protocol/routes.d.ts +14 -0
- package/dist/src/protocol/routes.js +1 -1
- package/dist/src/public/channels/auth.d.ts +36 -0
- package/dist/src/public/channels/auth.js +1 -1
- package/dist/src/public/channels/eve.js +1 -1
- package/dist/src/public/channels/mcp.d.ts +19 -0
- package/dist/src/public/channels/mcp.js +1 -0
- package/dist/src/public/definitions/channel.d.ts +2 -2
- package/dist/src/public/definitions/channel.js +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +5 -4
- package/dist/src/public/sandbox/backends/vercel.js +1 -1
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +25 -1
- package/dist/src/public/sandbox/vercel.d.ts +2 -1
- package/dist/src/public/sandbox/vercel.js +1 -1
- package/dist/src/react/use-eve-agent.js +1 -1
- package/dist/src/runtime/actions/types.d.ts +9 -0
- package/dist/src/runtime/actions/types.js +1 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/connections/authorization-complete-page.js +70 -28
- package/dist/src/runtime/framework-channels/index.js +1 -1
- package/dist/src/runtime/framework-tools/index.js +1 -1
- package/dist/src/runtime/framework-tools/tasks.d.ts +95 -0
- package/dist/src/runtime/framework-tools/tasks.js +1 -0
- package/dist/src/runtime/prompt/compose.d.ts +1 -0
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-agent-graph.js +1 -1
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/session-callback-route.js +1 -1
- package/dist/src/runtime/task-input-response-route.d.ts +5 -0
- package/dist/src/runtime/task-input-response-route.js +1 -0
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +0 -1
- package/dist/src/shared/agent-definition.d.ts +7 -0
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tasks/json.d.ts +88 -0
- package/dist/src/tasks/json.js +1 -0
- package/dist/src/tasks/session-index.d.ts +48 -0
- package/dist/src/tasks/session-index.js +1 -0
- package/dist/src/tasks/task-id.d.ts +34 -0
- package/dist/src/tasks/task-id.js +1 -0
- package/dist/src/tasks/transitions.d.ts +23 -0
- package/dist/src/tasks/transitions.js +1 -0
- package/dist/src/tasks/types.d.ts +295 -0
- package/dist/src/tasks/types.js +1 -0
- package/dist/src/tasks/wire.d.ts +26 -0
- package/dist/src/tasks/wire.js +1 -0
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/channels/eve.mdx +14 -0
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/reference/cli.md +10 -6
- package/docs/tools/human-in-the-loop.md +3 -1
- package/package.json +8 -1
- package/dist/src/compiled/_chunks/node/version-Cztrk7z6.js +0 -1
- package/dist/src/execution/route-proxied-deliver-step.js +0 -1
|
@@ -4,6 +4,7 @@ import { FileWriter } from "./file-writer.js";
|
|
|
4
4
|
import { NetworkPolicy } from "../network-policy.js";
|
|
5
5
|
import { WithPrivate } from "../utils/types.js";
|
|
6
6
|
import { RUNTIMES } from "../constants.js";
|
|
7
|
+
import { BaseCreateSandboxParams } from "../sandbox.js";
|
|
7
8
|
import { z } from "#compiled/zod/index.js";
|
|
8
9
|
import { Readable } from "stream";
|
|
9
10
|
|
|
@@ -180,6 +181,7 @@ declare class APIClient extends BaseClient {
|
|
|
180
181
|
expiration?: number;
|
|
181
182
|
deleteEvicted?: boolean;
|
|
182
183
|
};
|
|
184
|
+
mounts?: BaseCreateSandboxParams["mounts"];
|
|
183
185
|
signal?: AbortSignal;
|
|
184
186
|
}>): Promise<Parsed<{
|
|
185
187
|
sandbox: {
|
|
@@ -290,6 +292,271 @@ declare class APIClient extends BaseClient {
|
|
|
290
292
|
statusUpdatedAt?: number | undefined;
|
|
291
293
|
cwd?: string | undefined;
|
|
292
294
|
tags?: Record<string, string> | undefined;
|
|
295
|
+
mounts?: Record<string, {
|
|
296
|
+
drive: string;
|
|
297
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
298
|
+
}> | undefined;
|
|
299
|
+
snapshotExpiration?: number | undefined;
|
|
300
|
+
keepLastSnapshots?: {
|
|
301
|
+
count: number;
|
|
302
|
+
expiration?: number | undefined;
|
|
303
|
+
deleteEvicted?: boolean | undefined;
|
|
304
|
+
} | undefined;
|
|
305
|
+
};
|
|
306
|
+
session: {
|
|
307
|
+
[x: string]: unknown;
|
|
308
|
+
id: string;
|
|
309
|
+
memory: number;
|
|
310
|
+
vcpus: number;
|
|
311
|
+
region: string;
|
|
312
|
+
runtime: string;
|
|
313
|
+
timeout: number;
|
|
314
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
315
|
+
requestedAt: number;
|
|
316
|
+
createdAt: number;
|
|
317
|
+
cwd: string;
|
|
318
|
+
updatedAt: number;
|
|
319
|
+
startedAt?: number | undefined;
|
|
320
|
+
requestedStopAt?: number | undefined;
|
|
321
|
+
stoppedAt?: number | undefined;
|
|
322
|
+
abortedAt?: number | undefined;
|
|
323
|
+
duration?: number | undefined;
|
|
324
|
+
sourceSnapshotId?: string | undefined;
|
|
325
|
+
snapshottedAt?: number | undefined;
|
|
326
|
+
interactivePort?: number | undefined;
|
|
327
|
+
networkPolicy?: {
|
|
328
|
+
[x: string]: unknown;
|
|
329
|
+
mode: "allow-all";
|
|
330
|
+
} | {
|
|
331
|
+
[x: string]: unknown;
|
|
332
|
+
mode: "deny-all";
|
|
333
|
+
} | {
|
|
334
|
+
[x: string]: unknown;
|
|
335
|
+
mode: "custom";
|
|
336
|
+
allowedDomains?: string[] | undefined;
|
|
337
|
+
allowedCIDRs?: string[] | undefined;
|
|
338
|
+
deniedCIDRs?: string[] | undefined;
|
|
339
|
+
injectionRules?: {
|
|
340
|
+
domain: string;
|
|
341
|
+
headers?: Record<string, string> | undefined;
|
|
342
|
+
headerNames?: string[] | undefined;
|
|
343
|
+
match?: {
|
|
344
|
+
path?: {
|
|
345
|
+
exact?: string | undefined;
|
|
346
|
+
startsWith?: string | undefined;
|
|
347
|
+
regex?: string | undefined;
|
|
348
|
+
} | undefined;
|
|
349
|
+
method?: string[] | undefined;
|
|
350
|
+
queryString?: {
|
|
351
|
+
key?: {
|
|
352
|
+
exact?: string | undefined;
|
|
353
|
+
startsWith?: string | undefined;
|
|
354
|
+
regex?: string | undefined;
|
|
355
|
+
} | undefined;
|
|
356
|
+
value?: {
|
|
357
|
+
exact?: string | undefined;
|
|
358
|
+
startsWith?: string | undefined;
|
|
359
|
+
regex?: string | undefined;
|
|
360
|
+
} | undefined;
|
|
361
|
+
}[] | undefined;
|
|
362
|
+
headers?: {
|
|
363
|
+
key?: {
|
|
364
|
+
exact?: string | undefined;
|
|
365
|
+
startsWith?: string | undefined;
|
|
366
|
+
regex?: string | undefined;
|
|
367
|
+
} | undefined;
|
|
368
|
+
value?: {
|
|
369
|
+
exact?: string | undefined;
|
|
370
|
+
startsWith?: string | undefined;
|
|
371
|
+
regex?: string | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
}[] | undefined;
|
|
374
|
+
} | undefined;
|
|
375
|
+
}[] | undefined;
|
|
376
|
+
forwardRules?: {
|
|
377
|
+
domain: string;
|
|
378
|
+
forwardURL: string;
|
|
379
|
+
match?: {
|
|
380
|
+
path?: {
|
|
381
|
+
exact?: string | undefined;
|
|
382
|
+
startsWith?: string | undefined;
|
|
383
|
+
regex?: string | undefined;
|
|
384
|
+
} | undefined;
|
|
385
|
+
method?: string[] | undefined;
|
|
386
|
+
queryString?: {
|
|
387
|
+
key?: {
|
|
388
|
+
exact?: string | undefined;
|
|
389
|
+
startsWith?: string | undefined;
|
|
390
|
+
regex?: string | undefined;
|
|
391
|
+
} | undefined;
|
|
392
|
+
value?: {
|
|
393
|
+
exact?: string | undefined;
|
|
394
|
+
startsWith?: string | undefined;
|
|
395
|
+
regex?: string | undefined;
|
|
396
|
+
} | undefined;
|
|
397
|
+
}[] | undefined;
|
|
398
|
+
headers?: {
|
|
399
|
+
key?: {
|
|
400
|
+
exact?: string | undefined;
|
|
401
|
+
startsWith?: string | undefined;
|
|
402
|
+
regex?: string | undefined;
|
|
403
|
+
} | undefined;
|
|
404
|
+
value?: {
|
|
405
|
+
exact?: string | undefined;
|
|
406
|
+
startsWith?: string | undefined;
|
|
407
|
+
regex?: string | undefined;
|
|
408
|
+
} | undefined;
|
|
409
|
+
}[] | undefined;
|
|
410
|
+
} | undefined;
|
|
411
|
+
}[] | undefined;
|
|
412
|
+
} | undefined;
|
|
413
|
+
activeCpuDurationMs?: number | undefined;
|
|
414
|
+
networkTransfer?: {
|
|
415
|
+
ingress: number;
|
|
416
|
+
egress: number;
|
|
417
|
+
} | undefined;
|
|
418
|
+
};
|
|
419
|
+
routes: {
|
|
420
|
+
url: string;
|
|
421
|
+
subdomain: string;
|
|
422
|
+
port: number;
|
|
423
|
+
}[];
|
|
424
|
+
resumed?: boolean | undefined;
|
|
425
|
+
}>>;
|
|
426
|
+
forkSandbox(params: WithPrivate<{
|
|
427
|
+
sourceSandbox: string;
|
|
428
|
+
projectId: string;
|
|
429
|
+
name?: string;
|
|
430
|
+
ports?: number[];
|
|
431
|
+
timeout?: number;
|
|
432
|
+
resources?: {
|
|
433
|
+
vcpus: number;
|
|
434
|
+
};
|
|
435
|
+
persistent?: boolean;
|
|
436
|
+
image?: string;
|
|
437
|
+
networkPolicy?: NetworkPolicy;
|
|
438
|
+
env?: Record<string, string>;
|
|
439
|
+
tags?: Record<string, string>;
|
|
440
|
+
snapshotExpiration?: number;
|
|
441
|
+
keepLastSnapshots?: {
|
|
442
|
+
count: number;
|
|
443
|
+
expiration?: number;
|
|
444
|
+
deleteEvicted?: boolean;
|
|
445
|
+
};
|
|
446
|
+
signal?: AbortSignal;
|
|
447
|
+
}>): Promise<Parsed<{
|
|
448
|
+
sandbox: {
|
|
449
|
+
name: string;
|
|
450
|
+
persistent: boolean;
|
|
451
|
+
createdAt: number;
|
|
452
|
+
updatedAt: number;
|
|
453
|
+
currentSessionId: string;
|
|
454
|
+
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
455
|
+
region?: string | undefined;
|
|
456
|
+
vcpus?: number | undefined;
|
|
457
|
+
memory?: number | undefined;
|
|
458
|
+
runtime?: string | undefined;
|
|
459
|
+
image?: string | undefined;
|
|
460
|
+
timeout?: number | undefined;
|
|
461
|
+
networkPolicy?: {
|
|
462
|
+
[x: string]: unknown;
|
|
463
|
+
mode: "allow-all";
|
|
464
|
+
} | {
|
|
465
|
+
[x: string]: unknown;
|
|
466
|
+
mode: "deny-all";
|
|
467
|
+
} | {
|
|
468
|
+
[x: string]: unknown;
|
|
469
|
+
mode: "custom";
|
|
470
|
+
allowedDomains?: string[] | undefined;
|
|
471
|
+
allowedCIDRs?: string[] | undefined;
|
|
472
|
+
deniedCIDRs?: string[] | undefined;
|
|
473
|
+
injectionRules?: {
|
|
474
|
+
domain: string;
|
|
475
|
+
headers?: Record<string, string> | undefined;
|
|
476
|
+
headerNames?: string[] | undefined;
|
|
477
|
+
match?: {
|
|
478
|
+
path?: {
|
|
479
|
+
exact?: string | undefined;
|
|
480
|
+
startsWith?: string | undefined;
|
|
481
|
+
regex?: string | undefined;
|
|
482
|
+
} | undefined;
|
|
483
|
+
method?: string[] | undefined;
|
|
484
|
+
queryString?: {
|
|
485
|
+
key?: {
|
|
486
|
+
exact?: string | undefined;
|
|
487
|
+
startsWith?: string | undefined;
|
|
488
|
+
regex?: string | undefined;
|
|
489
|
+
} | undefined;
|
|
490
|
+
value?: {
|
|
491
|
+
exact?: string | undefined;
|
|
492
|
+
startsWith?: string | undefined;
|
|
493
|
+
regex?: string | undefined;
|
|
494
|
+
} | undefined;
|
|
495
|
+
}[] | undefined;
|
|
496
|
+
headers?: {
|
|
497
|
+
key?: {
|
|
498
|
+
exact?: string | undefined;
|
|
499
|
+
startsWith?: string | undefined;
|
|
500
|
+
regex?: string | undefined;
|
|
501
|
+
} | undefined;
|
|
502
|
+
value?: {
|
|
503
|
+
exact?: string | undefined;
|
|
504
|
+
startsWith?: string | undefined;
|
|
505
|
+
regex?: string | undefined;
|
|
506
|
+
} | undefined;
|
|
507
|
+
}[] | undefined;
|
|
508
|
+
} | undefined;
|
|
509
|
+
}[] | undefined;
|
|
510
|
+
forwardRules?: {
|
|
511
|
+
domain: string;
|
|
512
|
+
forwardURL: string;
|
|
513
|
+
match?: {
|
|
514
|
+
path?: {
|
|
515
|
+
exact?: string | undefined;
|
|
516
|
+
startsWith?: string | undefined;
|
|
517
|
+
regex?: string | undefined;
|
|
518
|
+
} | undefined;
|
|
519
|
+
method?: string[] | undefined;
|
|
520
|
+
queryString?: {
|
|
521
|
+
key?: {
|
|
522
|
+
exact?: string | undefined;
|
|
523
|
+
startsWith?: string | undefined;
|
|
524
|
+
regex?: string | undefined;
|
|
525
|
+
} | undefined;
|
|
526
|
+
value?: {
|
|
527
|
+
exact?: string | undefined;
|
|
528
|
+
startsWith?: string | undefined;
|
|
529
|
+
regex?: string | undefined;
|
|
530
|
+
} | undefined;
|
|
531
|
+
}[] | undefined;
|
|
532
|
+
headers?: {
|
|
533
|
+
key?: {
|
|
534
|
+
exact?: string | undefined;
|
|
535
|
+
startsWith?: string | undefined;
|
|
536
|
+
regex?: string | undefined;
|
|
537
|
+
} | undefined;
|
|
538
|
+
value?: {
|
|
539
|
+
exact?: string | undefined;
|
|
540
|
+
startsWith?: string | undefined;
|
|
541
|
+
regex?: string | undefined;
|
|
542
|
+
} | undefined;
|
|
543
|
+
}[] | undefined;
|
|
544
|
+
} | undefined;
|
|
545
|
+
}[] | undefined;
|
|
546
|
+
} | undefined;
|
|
547
|
+
totalEgressBytes?: number | undefined;
|
|
548
|
+
totalIngressBytes?: number | undefined;
|
|
549
|
+
totalActiveCpuDurationMs?: number | undefined;
|
|
550
|
+
totalDurationMs?: number | undefined;
|
|
551
|
+
expiresAt?: number | undefined;
|
|
552
|
+
currentSnapshotId?: string | undefined;
|
|
553
|
+
statusUpdatedAt?: number | undefined;
|
|
554
|
+
cwd?: string | undefined;
|
|
555
|
+
tags?: Record<string, string> | undefined;
|
|
556
|
+
mounts?: Record<string, {
|
|
557
|
+
drive: string;
|
|
558
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
559
|
+
}> | undefined;
|
|
293
560
|
snapshotExpiration?: number | undefined;
|
|
294
561
|
keepLastSnapshots?: {
|
|
295
562
|
count: number;
|
|
@@ -742,6 +1009,47 @@ declare class APIClient extends BaseClient {
|
|
|
742
1009
|
count: string;
|
|
743
1010
|
} | undefined;
|
|
744
1011
|
}>>;
|
|
1012
|
+
listDrives(params: {
|
|
1013
|
+
projectId: string;
|
|
1014
|
+
limit?: number;
|
|
1015
|
+
cursor?: string | number;
|
|
1016
|
+
since?: number | string;
|
|
1017
|
+
until?: number | string;
|
|
1018
|
+
sortBy?: "createdAt" | "updatedAt" | "name";
|
|
1019
|
+
sortOrder?: "asc" | "desc";
|
|
1020
|
+
namePrefix?: string;
|
|
1021
|
+
signal?: AbortSignal;
|
|
1022
|
+
}): Promise<Parsed<{
|
|
1023
|
+
drives: {
|
|
1024
|
+
name: string;
|
|
1025
|
+
projectId: string;
|
|
1026
|
+
maxSizeBytes: number;
|
|
1027
|
+
createdAt: number;
|
|
1028
|
+
updatedAt: number;
|
|
1029
|
+
currentSessionId?: string | undefined;
|
|
1030
|
+
currentSandboxName?: string | undefined;
|
|
1031
|
+
}[];
|
|
1032
|
+
pagination: {
|
|
1033
|
+
count: number;
|
|
1034
|
+
next: string | null;
|
|
1035
|
+
};
|
|
1036
|
+
}>>;
|
|
1037
|
+
getOrCreateDrive(params: {
|
|
1038
|
+
projectId: string;
|
|
1039
|
+
name: string;
|
|
1040
|
+
maxSizeBytes?: number;
|
|
1041
|
+
signal?: AbortSignal;
|
|
1042
|
+
}): Promise<Parsed<{
|
|
1043
|
+
drive: {
|
|
1044
|
+
name: string;
|
|
1045
|
+
projectId: string;
|
|
1046
|
+
maxSizeBytes: number;
|
|
1047
|
+
createdAt: number;
|
|
1048
|
+
updatedAt: number;
|
|
1049
|
+
currentSessionId?: string | undefined;
|
|
1050
|
+
currentSandboxName?: string | undefined;
|
|
1051
|
+
};
|
|
1052
|
+
}>>;
|
|
745
1053
|
writeFiles(params: {
|
|
746
1054
|
sessionId: string;
|
|
747
1055
|
cwd: string;
|
|
@@ -924,6 +1232,10 @@ declare class APIClient extends BaseClient {
|
|
|
924
1232
|
statusUpdatedAt?: number | undefined;
|
|
925
1233
|
cwd?: string | undefined;
|
|
926
1234
|
tags?: Record<string, string> | undefined;
|
|
1235
|
+
mounts?: Record<string, {
|
|
1236
|
+
drive: string;
|
|
1237
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1238
|
+
}> | undefined;
|
|
927
1239
|
snapshotExpiration?: number | undefined;
|
|
928
1240
|
keepLastSnapshots?: {
|
|
929
1241
|
count: number;
|
|
@@ -1169,6 +1481,10 @@ declare class APIClient extends BaseClient {
|
|
|
1169
1481
|
statusUpdatedAt?: number | undefined;
|
|
1170
1482
|
cwd?: string | undefined;
|
|
1171
1483
|
tags?: Record<string, string> | undefined;
|
|
1484
|
+
mounts?: Record<string, {
|
|
1485
|
+
drive: string;
|
|
1486
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1487
|
+
}> | undefined;
|
|
1172
1488
|
snapshotExpiration?: number | undefined;
|
|
1173
1489
|
keepLastSnapshots?: {
|
|
1174
1490
|
count: number;
|
|
@@ -1181,6 +1497,21 @@ declare class APIClient extends BaseClient {
|
|
|
1181
1497
|
next: string | null;
|
|
1182
1498
|
};
|
|
1183
1499
|
}>>;
|
|
1500
|
+
deleteDrive(params: {
|
|
1501
|
+
projectId: string;
|
|
1502
|
+
name: string;
|
|
1503
|
+
signal?: AbortSignal;
|
|
1504
|
+
}): Promise<Parsed<{
|
|
1505
|
+
drive: {
|
|
1506
|
+
name: string;
|
|
1507
|
+
projectId: string;
|
|
1508
|
+
maxSizeBytes: number;
|
|
1509
|
+
createdAt: number;
|
|
1510
|
+
updatedAt: number;
|
|
1511
|
+
currentSessionId?: string | undefined;
|
|
1512
|
+
currentSandboxName?: string | undefined;
|
|
1513
|
+
};
|
|
1514
|
+
}>>;
|
|
1184
1515
|
updateSandbox(params: {
|
|
1185
1516
|
name: string;
|
|
1186
1517
|
projectId: string;
|
|
@@ -1311,6 +1642,10 @@ declare class APIClient extends BaseClient {
|
|
|
1311
1642
|
statusUpdatedAt?: number | undefined;
|
|
1312
1643
|
cwd?: string | undefined;
|
|
1313
1644
|
tags?: Record<string, string> | undefined;
|
|
1645
|
+
mounts?: Record<string, {
|
|
1646
|
+
drive: string;
|
|
1647
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1648
|
+
}> | undefined;
|
|
1314
1649
|
snapshotExpiration?: number | undefined;
|
|
1315
1650
|
keepLastSnapshots?: {
|
|
1316
1651
|
count: number;
|
|
@@ -1437,6 +1772,10 @@ declare class APIClient extends BaseClient {
|
|
|
1437
1772
|
statusUpdatedAt?: number | undefined;
|
|
1438
1773
|
cwd?: string | undefined;
|
|
1439
1774
|
tags?: Record<string, string> | undefined;
|
|
1775
|
+
mounts?: Record<string, {
|
|
1776
|
+
drive: string;
|
|
1777
|
+
mode?: "read-only" | "read-write" | undefined;
|
|
1778
|
+
}> | undefined;
|
|
1440
1779
|
snapshotExpiration?: number | undefined;
|
|
1441
1780
|
keepLastSnapshots?: {
|
|
1442
1781
|
count: number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Command, CommandData, CommandFinishedData, CommandFinishedResponse, CommandResponse, CreateSnapshotResponse, InteractiveSessionResponse, LogError, LogLine, LogLineData, LogOutputLine, Sandbox, SandboxMetaData, SandboxRoute, SandboxRouteData, Session, SessionMetaData, SessionResponse, Snapshot, SnapshotMetadata, SnapshotResponse, SnapshotTreeNode, SnapshotTreeNodeData, StopSessionResponse } from "./validators.js";
|
|
1
|
+
import { Command, CommandData, CommandFinishedData, CommandFinishedResponse, CommandResponse, CreateSnapshotResponse, Drive, DriveMetadata, InteractiveSessionResponse, LogError, LogLine, LogLineData, LogOutputLine, Sandbox, SandboxMetaData, SandboxRoute, SandboxRouteData, Session, SessionMetaData, SessionResponse, Snapshot, SnapshotMetadata, SnapshotResponse, SnapshotTreeNode, SnapshotTreeNodeData, StopSessionResponse } from "./validators.js";
|
|
2
2
|
import { APIClient } from "./api-client.js";
|
|
@@ -517,6 +517,16 @@ declare const SnapshotResponse: z.ZodObject<{
|
|
|
517
517
|
parentId: z.ZodOptional<z.ZodString>;
|
|
518
518
|
}, z.core.$strip>;
|
|
519
519
|
}, z.core.$strip>;
|
|
520
|
+
declare const Drive: z.ZodObject<{
|
|
521
|
+
name: z.ZodString;
|
|
522
|
+
projectId: z.ZodString;
|
|
523
|
+
maxSizeBytes: z.ZodNumber;
|
|
524
|
+
currentSessionId: z.ZodOptional<z.ZodString>;
|
|
525
|
+
currentSandboxName: z.ZodOptional<z.ZodString>;
|
|
526
|
+
createdAt: z.ZodNumber;
|
|
527
|
+
updatedAt: z.ZodNumber;
|
|
528
|
+
}, z.core.$strip>;
|
|
529
|
+
type DriveMetadata = z.infer<typeof Drive>;
|
|
520
530
|
declare const Sandbox: z.ZodObject<{
|
|
521
531
|
name: z.ZodString;
|
|
522
532
|
persistent: z.ZodBoolean;
|
|
@@ -630,6 +640,13 @@ declare const Sandbox: z.ZodObject<{
|
|
|
630
640
|
statusUpdatedAt: z.ZodOptional<z.ZodNumber>;
|
|
631
641
|
cwd: z.ZodOptional<z.ZodString>;
|
|
632
642
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
643
|
+
mounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
644
|
+
drive: z.ZodString;
|
|
645
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
646
|
+
"read-only": "read-only";
|
|
647
|
+
"read-write": "read-write";
|
|
648
|
+
}>>;
|
|
649
|
+
}, z.core.$strip>>>;
|
|
633
650
|
snapshotExpiration: z.ZodOptional<z.ZodNumber>;
|
|
634
651
|
keepLastSnapshots: z.ZodOptional<z.ZodObject<{
|
|
635
652
|
count: z.ZodNumber;
|
|
@@ -869,6 +886,13 @@ declare const StopSessionResponse: z.ZodObject<{
|
|
|
869
886
|
statusUpdatedAt: z.ZodOptional<z.ZodNumber>;
|
|
870
887
|
cwd: z.ZodOptional<z.ZodString>;
|
|
871
888
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
889
|
+
mounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
890
|
+
drive: z.ZodString;
|
|
891
|
+
mode: z.ZodOptional<z.ZodEnum<{
|
|
892
|
+
"read-only": "read-only";
|
|
893
|
+
"read-write": "read-write";
|
|
894
|
+
}>>;
|
|
895
|
+
}, z.core.$strip>>>;
|
|
872
896
|
snapshotExpiration: z.ZodOptional<z.ZodNumber>;
|
|
873
897
|
keepLastSnapshots: z.ZodOptional<z.ZodObject<{
|
|
874
898
|
count: z.ZodNumber;
|
|
@@ -895,5 +919,5 @@ declare const StopSessionResponse: z.ZodObject<{
|
|
|
895
919
|
}, z.core.$strip>>;
|
|
896
920
|
}, z.core.$strip>;
|
|
897
921
|
//#endregion
|
|
898
|
-
export { Command, CommandData, CommandFinishedData, CommandFinishedResponse, CommandResponse, CreateSnapshotResponse, InteractiveSessionResponse, LogError, LogLine, LogLineData, LogOutputLine, Sandbox, SandboxMetaData, SandboxRoute, SandboxRouteData, Session, SessionMetaData, SessionResponse, Snapshot, SnapshotMetadata, SnapshotResponse, SnapshotTreeNode, SnapshotTreeNodeData, StopSessionResponse };
|
|
922
|
+
export { Command, CommandData, CommandFinishedData, CommandFinishedResponse, CommandResponse, CreateSnapshotResponse, Drive, DriveMetadata, InteractiveSessionResponse, LogError, LogLine, LogLineData, LogOutputLine, Sandbox, SandboxMetaData, SandboxRoute, SandboxRouteData, Session, SessionMetaData, SessionResponse, Snapshot, SnapshotMetadata, SnapshotResponse, SnapshotTreeNode, SnapshotTreeNodeData, StopSessionResponse };
|
|
899
923
|
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Paginator } from "./utils/paginator.js";
|
|
2
|
+
import { DriveMetadata } from "./api-client/validators.js";
|
|
3
|
+
import { APIClient, WithFetchOptions } from "./api-client/api-client.js";
|
|
4
|
+
import "./api-client/index.js";
|
|
5
|
+
import { Credentials } from "./utils/get-credentials.js";
|
|
6
|
+
import { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "./_workflow-serde.js";
|
|
7
|
+
|
|
8
|
+
//#region src/drive.d.ts
|
|
9
|
+
interface SerializedDrive {
|
|
10
|
+
drive: DriveMetadata;
|
|
11
|
+
projectId?: string;
|
|
12
|
+
}
|
|
13
|
+
/** @inline */
|
|
14
|
+
interface GetOrCreateDriveParams {
|
|
15
|
+
/**
|
|
16
|
+
* The name of the drive to get or create. Must be unique within the project.
|
|
17
|
+
*/
|
|
18
|
+
name: string;
|
|
19
|
+
/**
|
|
20
|
+
* Maximum drive size in bytes. If omitted, a default of 100 GiB is used.
|
|
21
|
+
*/
|
|
22
|
+
maxSize?: number;
|
|
23
|
+
/**
|
|
24
|
+
* An AbortSignal to cancel the operation.
|
|
25
|
+
*/
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A Drive is a persistent, bottomless storage that can be attached and detached to Sandboxes.
|
|
30
|
+
* Drives can be mounted as read-write or read-only, at a configurable path with `Sandbox.create()`.
|
|
31
|
+
*
|
|
32
|
+
* Use {@link Drive.getOrCreate} to construct.
|
|
33
|
+
* @hideconstructor
|
|
34
|
+
*/
|
|
35
|
+
declare class Drive {
|
|
36
|
+
private _client;
|
|
37
|
+
private drive;
|
|
38
|
+
private readonly _projectId;
|
|
39
|
+
/**
|
|
40
|
+
* Lazily resolve credentials and construct an API client.
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
private ensureClient;
|
|
44
|
+
/**
|
|
45
|
+
* The name of the drive.
|
|
46
|
+
*/
|
|
47
|
+
get name(): string;
|
|
48
|
+
/**
|
|
49
|
+
* The project ID that owns the drive.
|
|
50
|
+
*/
|
|
51
|
+
get projectId(): string;
|
|
52
|
+
/**
|
|
53
|
+
* The maximum drive size in bytes.
|
|
54
|
+
*/
|
|
55
|
+
get maxSize(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Current session ID the drive is attached to, if any.
|
|
58
|
+
*/
|
|
59
|
+
get currentSessionId(): string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Current sandbox name the drive is attached to, if any.
|
|
62
|
+
*/
|
|
63
|
+
get currentSandboxName(): string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Timestamp when the drive was created.
|
|
66
|
+
*/
|
|
67
|
+
get createdAt(): Date;
|
|
68
|
+
/**
|
|
69
|
+
* Timestamp when the drive was last updated.
|
|
70
|
+
*/
|
|
71
|
+
get updatedAt(): Date;
|
|
72
|
+
/**
|
|
73
|
+
* Serialize a Drive instance to plain data for @workflow/serde.
|
|
74
|
+
*
|
|
75
|
+
* @param instance - The Drive instance to serialize
|
|
76
|
+
* @returns A plain object containing drive metadata
|
|
77
|
+
*/
|
|
78
|
+
static [WORKFLOW_SERIALIZE](instance: Drive): SerializedDrive;
|
|
79
|
+
/**
|
|
80
|
+
* Deserialize a Drive from serialized data.
|
|
81
|
+
*
|
|
82
|
+
* The deserialized instance uses the serialized metadata synchronously and
|
|
83
|
+
* lazily creates an API client only when methods perform API requests.
|
|
84
|
+
*
|
|
85
|
+
* @param data - The serialized drive data
|
|
86
|
+
* @returns The reconstructed Drive instance
|
|
87
|
+
*/
|
|
88
|
+
static [WORKFLOW_DESERIALIZE](data: SerializedDrive): Drive;
|
|
89
|
+
constructor({
|
|
90
|
+
client,
|
|
91
|
+
drive,
|
|
92
|
+
projectId
|
|
93
|
+
}: {
|
|
94
|
+
client?: APIClient;
|
|
95
|
+
drive: DriveMetadata;
|
|
96
|
+
projectId?: string;
|
|
97
|
+
});
|
|
98
|
+
/**
|
|
99
|
+
* Allow to get a list of drives for a team narrowed to the given params.
|
|
100
|
+
* It returns both the drives and the pagination metadata to allow getting
|
|
101
|
+
* the next page of results.
|
|
102
|
+
*
|
|
103
|
+
* The returned object is async-iterable to auto-paginate through all pages:
|
|
104
|
+
*
|
|
105
|
+
* ```ts
|
|
106
|
+
* const result = await Drive.list({ limit: 10 });
|
|
107
|
+
* for await (const drive of result) { ... }
|
|
108
|
+
* // or: await result.toArray();
|
|
109
|
+
* // or: for await (const page of result.pages()) { ... }
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
static list(params?: Partial<Parameters<APIClient["listDrives"]>[0]> & Partial<Credentials> & WithFetchOptions): Promise<Paginator<{
|
|
113
|
+
drives: Drive[];
|
|
114
|
+
pagination: {
|
|
115
|
+
count: number;
|
|
116
|
+
next: string | null;
|
|
117
|
+
};
|
|
118
|
+
}, "drives">>;
|
|
119
|
+
/**
|
|
120
|
+
* Retrieve an existing drive, or create a new one if it doesn't exists.
|
|
121
|
+
*
|
|
122
|
+
* @param params - Get/create parameters and optional credentials.
|
|
123
|
+
* @returns A promise resolving to the {@link Drive}.
|
|
124
|
+
*/
|
|
125
|
+
static getOrCreate(params: (GetOrCreateDriveParams | (GetOrCreateDriveParams & Credentials)) & WithFetchOptions): Promise<Drive>;
|
|
126
|
+
/**
|
|
127
|
+
* Delete this drive. The drive must not be attached to any sandbox.
|
|
128
|
+
* This operation is irreversible and will delete all data stored in the drive.
|
|
129
|
+
*
|
|
130
|
+
* @param opts - Optional parameters.
|
|
131
|
+
* @param opts.signal - An AbortSignal to cancel the operation.
|
|
132
|
+
* @returns A promise that resolves once the drive has been deleted.
|
|
133
|
+
*/
|
|
134
|
+
delete(opts?: {
|
|
135
|
+
signal?: AbortSignal;
|
|
136
|
+
}): Promise<void>;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
export { Drive, SerializedDrive };
|
|
140
|
+
//# sourceMappingURL=drive.d.ts.map
|
|
@@ -7,6 +7,7 @@ import { ExecutionContext } from "./execution-context.js";
|
|
|
7
7
|
import { Session } from "./session.js";
|
|
8
8
|
import { FileSystem } from "./filesystem.js";
|
|
9
9
|
import { SandboxUser, SandboxUserAlreadyExistsError } from "./sandbox-user.js";
|
|
10
|
-
import { Sandbox, SerializedSandbox } from "./sandbox.js";
|
|
10
|
+
import { Sandbox, SandboxMountMode, SandboxMounts, SerializedSandbox } from "./sandbox.js";
|
|
11
|
+
import { Drive, SerializedDrive } from "./drive.js";
|
|
11
12
|
import { InvalidRequestProxyHandler, ProxyHandler, ProxyMeta, defineSandboxProxy } from "./proxy.js";
|
|
12
|
-
export { APIError, Command, CommandFinished, type CommandOutput, type ExecutionContext, FileSystem, type InvalidRequestProxyHandler, type NetworkPolicy, type NetworkPolicyKeyValueMatcher, type NetworkPolicyMatch, type NetworkPolicyMatcher, type NetworkPolicyRule, type NetworkTransformer, type ProxyHandler, type ProxyMeta, Sandbox, SandboxUser, SandboxUserAlreadyExistsError, type SerializedCommand, type SerializedCommandFinished, type SerializedSandbox, type SerializedSnapshot, Session, Snapshot, type SnapshotTreeNodeData, StreamError, defineSandboxProxy };
|
|
13
|
+
export { APIError, Command, CommandFinished, type CommandOutput, Drive, type ExecutionContext, FileSystem, type InvalidRequestProxyHandler, type NetworkPolicy, type NetworkPolicyKeyValueMatcher, type NetworkPolicyMatch, type NetworkPolicyMatcher, type NetworkPolicyRule, type NetworkTransformer, type ProxyHandler, type ProxyMeta, Sandbox, type SandboxMountMode, type SandboxMounts, SandboxUser, SandboxUserAlreadyExistsError, type SerializedCommand, type SerializedCommandFinished, type SerializedDrive, type SerializedSandbox, type SerializedSnapshot, Session, Snapshot, type SnapshotTreeNodeData, StreamError, defineSandboxProxy };
|