eve 0.84.0 → 0.85.0
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 +46 -0
- package/dist/src/channel/channel-operations.d.ts +2 -18
- package/dist/src/channel/compiled-channel.d.ts +3 -7
- package/dist/src/channel/cross-channel-receive.d.ts +13 -11
- package/dist/src/channel/cross-channel-receive.js +1 -1
- package/dist/src/channel/delivery.js +1 -1
- package/dist/src/channel/schedule.js +1 -1
- package/dist/src/channel/session.d.ts +26 -4
- package/dist/src/channel/session.js +1 -1
- package/dist/src/channel/types.d.ts +2 -0
- package/dist/src/chunks/{use-eve-agent-BbbguIdB.js → use-eve-agent-B2jCfcnG.js} +29 -12
- package/dist/src/chunks/{use-eve-agent-DWjyzplb.js → use-eve-agent-DCLFi26P.js} +29 -12
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/delivery.d.ts +2 -0
- package/dist/src/client/delivery.js +1 -1
- package/dist/src/client/open-stream.js +1 -1
- package/dist/src/client/optimistic-message-submissions.js +1 -1
- package/dist/src/client/session-store.js +1 -1
- package/dist/src/client/session.js +1 -1
- package/dist/src/client/sessions.d.ts +1 -0
- package/dist/src/client/sessions.js +1 -1
- package/dist/src/client/types.d.ts +7 -4
- package/dist/src/compiled/.vendor-stamp.json +2 -2
- package/dist/src/compiled/@chat-adapter/slack/index.js +13 -13
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +75 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +4 -0
- package/dist/src/compiled/@vercel/sandbox/command.d.ts +78 -0
- package/dist/src/compiled/@vercel/sandbox/drive.d.ts +41 -1
- package/dist/src/compiled/@vercel/sandbox/index.js +13 -13
- package/dist/src/compiled/@vercel/sandbox/network-policy.d.ts +35 -4
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +18 -4
- package/dist/src/compiled/@vercel/sandbox/session.d.ts +29 -3
- package/dist/src/compiled/@vercel/sandbox/utils/pipe-stdin.d.ts +19 -0
- package/dist/src/compiled/_chunks/client/{core-CspsxXR-.js → core-BsvaaMUJ.js} +1 -1
- package/dist/src/compiled/_chunks/node/{auth-Dztlx9pE.js → auth-v5pS3mLo.js} +1 -1
- package/dist/src/compiled/_chunks/node/is-stream-DsuQX_bd.js +1 -0
- package/dist/src/compiled/_chunks/node/token-DHGH-jVc.js +1 -0
- package/dist/src/compiled/_chunks/node/token-util-BH2pw9Qm.js +25 -0
- package/dist/src/compiled/_chunks/node/token-util-CcvxNv76.js +1 -0
- package/dist/src/compiled/_chunks/node/version-C2PfNyEv.js +1 -0
- package/dist/src/compiled/zod/index.js +1 -1
- package/dist/src/compiled/zod/v4/core.js +1 -1
- package/dist/src/compiled/zod-validation-error/index.js +1 -1
- package/dist/src/compiler/artifacts.d.ts +1 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/manifest.d.ts +2 -2
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/model-catalog.d.ts +8 -18
- package/dist/src/compiler/model-catalog.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-manifest-types.d.ts +3 -0
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/context/keys.d.ts +7 -8
- package/dist/src/context/keys.js +1 -1
- package/dist/src/eve-channel/index.js +1 -1
- package/dist/src/eve-channel/request.d.ts +1 -0
- package/dist/src/eve-channel/request.js +1 -1
- package/dist/src/eve-channel/support.js +1 -1
- package/dist/src/execution/agent-sessions/context.d.ts +5 -1
- package/dist/src/execution/agent-sessions/context.js +1 -1
- package/dist/src/execution/agent-sessions/steps.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/legacy-session/snapshot.d.ts +1 -2
- package/dist/src/execution/legacy-session/snapshot.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/public-destination.d.ts +3 -0
- package/dist/src/execution/public-destination.js +1 -1
- package/dist/src/execution/publish-session-events.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-cli.d.ts +2 -0
- package/dist/src/execution/sandbox/bindings/docker-cli.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-connection.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/multiplexed-command.d.ts +11 -1
- package/dist/src/execution/sandbox/multiplexed-command.js +1 -1
- package/dist/src/execution/sandbox/session.js +1 -1
- package/dist/src/execution/session/checkpoint-migrations.d.ts +16 -5
- package/dist/src/execution/session/checkpoint-migrations.js +1 -1
- package/dist/src/execution/session/checkpoint-refusal.d.ts +4 -0
- package/dist/src/execution/session/checkpoint-refusal.js +1 -0
- package/dist/src/execution/session/entry.js +1 -1
- package/dist/src/execution/session/handoff-steps.d.ts +7 -1
- package/dist/src/execution/session/handoff-steps.js +1 -1
- package/dist/src/execution/session/imported-conversation.d.ts +2 -0
- package/dist/src/execution/session/imported-conversation.js +1 -0
- package/dist/src/execution/session/interrupted-step.js +1 -1
- package/dist/src/execution/session/pre-v27-checkpoint.d.ts +36 -0
- package/dist/src/execution/session/pre-v27-checkpoint.js +1 -0
- package/dist/src/execution/session/program.d.ts +2 -0
- package/dist/src/execution/session/program.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/session-callback-request.js +1 -1
- package/dist/src/execution/session-inbox/address.d.ts +1 -0
- package/dist/src/execution/session-inbox/handle.d.ts +7 -0
- package/dist/src/execution/session-inbox/handle.js +1 -0
- package/dist/src/execution/session-inbox/owner.d.ts +4 -4
- package/dist/src/execution/session-inbox/owner.js +1 -1
- package/dist/src/execution/session-inbox/resume.d.ts +1 -0
- package/dist/src/execution/session-inbox/resume.js +1 -1
- package/dist/src/execution/tool-auth.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/channel-to.d.ts +12 -0
- package/dist/src/execution/tools/channel-to.js +1 -0
- package/dist/src/execution/tools/workflow/body.d.ts +3 -0
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/step-context.d.ts +5 -0
- package/dist/src/execution/tools/workflow/step-execution.js +1 -1
- package/dist/src/execution/tools/workflow/step.js +1 -1
- package/dist/src/execution/workflow-callback-url.d.ts +2 -3
- package/dist/src/execution/workflow-callback-url.js +1 -1
- package/dist/src/execution/workflow-runtime.js +1 -1
- package/dist/src/harness/compaction/step.js +1 -1
- package/dist/src/harness/model-call/call.d.ts +3 -1
- package/dist/src/harness/model-call/call.js +1 -1
- package/dist/src/harness/model-call/run.js +1 -1
- package/dist/src/harness/semantic-errors/rules/gateway.js +1 -1
- package/dist/src/harness/session-machine/transitions.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.d.ts +2 -0
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/optional-package-install.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/attachments/limited-read.d.ts +2 -0
- package/dist/src/internal/attachments/limited-read.js +1 -1
- package/dist/src/internal/attachments/url-refs.js +1 -1
- package/dist/src/internal/capability-error.d.ts +3 -0
- package/dist/src/internal/capability-error.js +1 -0
- package/dist/src/internal/model-catalog.d.ts +39 -16
- package/dist/src/internal/model-catalog.js +1 -1
- package/dist/src/internal/nitro/host/dev-build-host.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/protocol/delivery.d.ts +1 -0
- package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +1 -1
- package/dist/src/public/channels/discord/discordChannel.js +1 -1
- package/dist/src/public/channels/github/githubChannel.js +1 -1
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/linq/inboundContent.js +1 -1
- package/dist/src/public/channels/slack/answers.d.ts +2 -3
- package/dist/src/public/channels/slack/answers.js +1 -1
- package/dist/src/public/channels/slack/api.d.ts +23 -3
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/app-manifest.d.ts +2 -0
- package/dist/src/public/channels/slack/app-manifest.js +1 -1
- package/dist/src/public/channels/slack/auth.d.ts +2 -1
- package/dist/src/public/channels/slack/auth.js +1 -1
- package/dist/src/public/channels/slack/code-channel.d.ts +42 -0
- package/dist/src/public/channels/slack/code-channel.js +1 -0
- package/dist/src/public/channels/slack/defaults.d.ts +7 -3
- package/dist/src/public/channels/slack/defaults.js +3 -3
- package/dist/src/public/channels/slack/hitl.d.ts +7 -17
- package/dist/src/public/channels/slack/hitl.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +4 -3
- package/dist/src/public/channels/slack/index.js +1 -1
- package/dist/src/public/channels/slack/interaction-cards.d.ts +0 -2
- package/dist/src/public/channels/slack/interaction-cards.js +1 -1
- package/dist/src/public/channels/slack/interactions.js +1 -1
- package/dist/src/public/channels/slack/open-code-channel.d.ts +30 -0
- package/dist/src/public/channels/slack/open-code-channel.js +1 -0
- package/dist/src/public/channels/slack/private-approval-delivery.d.ts +16 -4
- package/dist/src/public/channels/slack/private-approval-delivery.js +1 -1
- package/dist/src/public/channels/slack/renderers.d.ts +58 -6
- package/dist/src/public/channels/slack/renderers.js +1 -1
- package/dist/src/public/channels/slack/reply-delivery.d.ts +4 -0
- package/dist/src/public/channels/slack/reply-delivery.js +1 -1
- package/dist/src/public/channels/slack/request-card-render.d.ts +45 -0
- package/dist/src/public/channels/slack/request-card-render.js +1 -0
- package/dist/src/public/channels/slack/request-cards.d.ts +35 -0
- package/dist/src/public/channels/slack/request-cards.js +3 -0
- package/dist/src/public/channels/slack/sign-in-cancel.d.ts +3 -5
- package/dist/src/public/channels/slack/sign-in-cancel.js +1 -1
- package/dist/src/public/channels/slack/slackChannel.d.ts +109 -22
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/slack/task-card.d.ts +3 -3
- package/dist/src/public/channels/slack/task-card.js +1 -1
- package/dist/src/public/channels/slack/thread-status.js +1 -1
- package/dist/src/public/channels/teams/api.js +1 -1
- package/dist/src/public/channels/teams/defaults.js +1 -1
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/teams/verify.d.ts +9 -5
- package/dist/src/public/channels/teams/verify.js +1 -1
- package/dist/src/public/channels/telegram/telegramChannel.js +1 -1
- package/dist/src/public/channels/twilio/twilioChannel.js +1 -1
- package/dist/src/public/nuxt/module.js +1 -1
- package/dist/src/public/schedules/subscription.d.ts +10 -1
- package/dist/src/reactions/kinds/model.js +1 -1
- package/dist/src/reactions/kinds/subagent.js +1 -1
- package/dist/src/runtime/agent/resolve-model.d.ts +3 -4
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -0
- package/dist/src/runtime/loaders/artifact-paths.js +1 -1
- package/dist/src/runtime/loaders/bundled-artifacts.d.ts +2 -0
- package/dist/src/runtime/loaders/bundled-artifacts.js +1 -1
- package/dist/src/runtime/loaders/model-metadata.d.ts +4 -0
- package/dist/src/runtime/loaders/model-metadata.js +1 -0
- package/dist/src/runtime/resolve-agent.js +1 -1
- package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +3 -0
- package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
- package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +2 -2
- package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/sandbox/provider.d.ts +2 -0
- package/dist/src/setup/flows/model-source-change.js +1 -1
- package/dist/src/setup/index.d.ts +1 -1
- package/dist/src/setup/primitives/index.d.ts +1 -1
- package/dist/src/setup/primitives/pm/run.d.ts +0 -2
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +0 -1
- package/dist/src/shared/channel-definition.d.ts +4 -4
- package/dist/src/shared/sandbox-session.d.ts +4 -0
- package/dist/src/subagents/adapter.js +1 -1
- package/dist/src/subagents/parent-notification.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/definition.d.ts +21 -0
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/workflow-definition.d.ts +4 -4
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +5 -4
- package/docs/channels/custom.mdx +16 -3
- package/docs/channels/eve.mdx +2 -0
- package/docs/channels/linq.mdx +1 -1
- package/docs/channels/slack.mdx +185 -18
- package/docs/channels/teams.mdx +6 -2
- package/docs/concepts/default-harness.md +6 -0
- package/docs/concepts/upgrade-to-v27-events.md +2 -2
- package/docs/evals/judge.mdx +13 -0
- package/docs/experimental/dynamic-schedules.mdx +2 -2
- package/docs/guides/client/overview.mdx +24 -2
- package/docs/guides/remote-agents.md +8 -0
- package/docs/patterns/fork-conversations-into-new-threads.md +159 -0
- package/docs/patterns/meta.json +1 -0
- package/docs/reference/cli.md +1 -1
- package/docs/sandbox/custom-providers.mdx +1 -1
- package/docs/sandbox/index.mdx +1 -1
- package/docs/schedules.mdx +1 -1
- package/docs/tools/overview.mdx +34 -0
- package/docs/tools/workflows.mdx +51 -5
- package/package.json +2 -2
- package/dist/src/compiled/_chunks/node/token-Bedbhv5z.js +0 -1
- package/dist/src/compiled/_chunks/node/token-util-DpJNusVS.js +0 -1
- package/dist/src/compiled/_chunks/node/token-util-DwHQ2a3c.js +0 -1
- package/dist/src/compiled/_chunks/node/version-C__MqbLM.js +0 -1
- package/dist/src/public/channels/slack/approval-cards.d.ts +0 -25
- package/dist/src/public/channels/slack/approval-cards.js +0 -2
- package/dist/src/runtime/agent/model-catalog.d.ts +0 -10
- package/dist/src/runtime/agent/model-catalog.js +0 -1
|
@@ -8,6 +8,7 @@ import { z } from "#compiled/zod/index.js";
|
|
|
8
8
|
import { Readable } from "stream";
|
|
9
9
|
|
|
10
10
|
//#region src/api-client/api-client.d.ts
|
|
11
|
+
|
|
11
12
|
interface WithFetchOptions {
|
|
12
13
|
fetch?: typeof globalThis.fetch;
|
|
13
14
|
}
|
|
@@ -172,6 +173,7 @@ declare class APIClient extends BaseClient {
|
|
|
172
173
|
runtime?: RUNTIMES | (string & {});
|
|
173
174
|
image?: string;
|
|
174
175
|
networkPolicy?: NetworkPolicy;
|
|
176
|
+
networkId?: string;
|
|
175
177
|
env?: Record<string, string>;
|
|
176
178
|
tags?: Record<string, string>;
|
|
177
179
|
snapshotExpiration?: number;
|
|
@@ -194,6 +196,7 @@ declare class APIClient extends BaseClient {
|
|
|
194
196
|
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
195
197
|
region?: string | undefined;
|
|
196
198
|
failoverRegions?: string[] | undefined;
|
|
199
|
+
networkId?: string | undefined;
|
|
197
200
|
vcpus?: number | undefined;
|
|
198
201
|
memory?: number | undefined;
|
|
199
202
|
runtime?: string | undefined;
|
|
@@ -437,7 +440,9 @@ declare class APIClient extends BaseClient {
|
|
|
437
440
|
persistent?: boolean;
|
|
438
441
|
image?: string;
|
|
439
442
|
networkPolicy?: NetworkPolicy;
|
|
443
|
+
networkId?: string;
|
|
440
444
|
env?: Record<string, string>;
|
|
445
|
+
mounts?: SandboxMetaData["mounts"];
|
|
441
446
|
tags?: Record<string, string>;
|
|
442
447
|
snapshotExpiration?: number;
|
|
443
448
|
keepLastSnapshots?: {
|
|
@@ -458,6 +463,7 @@ declare class APIClient extends BaseClient {
|
|
|
458
463
|
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
459
464
|
region?: string | undefined;
|
|
460
465
|
failoverRegions?: string[] | undefined;
|
|
466
|
+
networkId?: string | undefined;
|
|
461
467
|
vcpus?: number | undefined;
|
|
462
468
|
memory?: number | undefined;
|
|
463
469
|
runtime?: string | undefined;
|
|
@@ -697,6 +703,7 @@ declare class APIClient extends BaseClient {
|
|
|
697
703
|
env: Record<string, string>;
|
|
698
704
|
sudo: boolean;
|
|
699
705
|
wait: true;
|
|
706
|
+
attachStdin?: boolean;
|
|
700
707
|
logs?: boolean;
|
|
701
708
|
onLog?: (log: LogOutputLine) => void;
|
|
702
709
|
timeout?: number;
|
|
@@ -713,6 +720,7 @@ declare class APIClient extends BaseClient {
|
|
|
713
720
|
env: Record<string, string>;
|
|
714
721
|
sudo: boolean;
|
|
715
722
|
wait?: false;
|
|
723
|
+
attachStdin?: boolean;
|
|
716
724
|
timeout?: number;
|
|
717
725
|
signal?: AbortSignal;
|
|
718
726
|
}): Promise<Parsed<z.infer<typeof CommandResponse>>>;
|
|
@@ -1036,6 +1044,8 @@ declare class APIClient extends BaseClient {
|
|
|
1036
1044
|
maxSizeBytes: number;
|
|
1037
1045
|
createdAt: number;
|
|
1038
1046
|
updatedAt: number;
|
|
1047
|
+
parentDriveId?: string | undefined;
|
|
1048
|
+
rootDriveId?: string | undefined;
|
|
1039
1049
|
currentSessionId?: string | undefined;
|
|
1040
1050
|
currentSandboxName?: string | undefined;
|
|
1041
1051
|
}[];
|
|
@@ -1044,6 +1054,25 @@ declare class APIClient extends BaseClient {
|
|
|
1044
1054
|
next: string | null;
|
|
1045
1055
|
};
|
|
1046
1056
|
}>>;
|
|
1057
|
+
getDrive(params: {
|
|
1058
|
+
projectId: string;
|
|
1059
|
+
name: string;
|
|
1060
|
+
signal?: AbortSignal;
|
|
1061
|
+
}): Promise<Parsed<{
|
|
1062
|
+
drive: {
|
|
1063
|
+
id: string;
|
|
1064
|
+
name: string;
|
|
1065
|
+
projectId: string;
|
|
1066
|
+
region: string;
|
|
1067
|
+
maxSizeBytes: number;
|
|
1068
|
+
createdAt: number;
|
|
1069
|
+
updatedAt: number;
|
|
1070
|
+
parentDriveId?: string | undefined;
|
|
1071
|
+
rootDriveId?: string | undefined;
|
|
1072
|
+
currentSessionId?: string | undefined;
|
|
1073
|
+
currentSandboxName?: string | undefined;
|
|
1074
|
+
};
|
|
1075
|
+
}>>;
|
|
1047
1076
|
getOrCreateDrive(params: {
|
|
1048
1077
|
projectId: string;
|
|
1049
1078
|
name: string;
|
|
@@ -1059,6 +1088,28 @@ declare class APIClient extends BaseClient {
|
|
|
1059
1088
|
maxSizeBytes: number;
|
|
1060
1089
|
createdAt: number;
|
|
1061
1090
|
updatedAt: number;
|
|
1091
|
+
parentDriveId?: string | undefined;
|
|
1092
|
+
rootDriveId?: string | undefined;
|
|
1093
|
+
currentSessionId?: string | undefined;
|
|
1094
|
+
currentSandboxName?: string | undefined;
|
|
1095
|
+
};
|
|
1096
|
+
}>>;
|
|
1097
|
+
forkDrive(params: {
|
|
1098
|
+
projectId: string;
|
|
1099
|
+
name: string;
|
|
1100
|
+
forkName: string;
|
|
1101
|
+
signal?: AbortSignal;
|
|
1102
|
+
}): Promise<Parsed<{
|
|
1103
|
+
drive: {
|
|
1104
|
+
id: string;
|
|
1105
|
+
name: string;
|
|
1106
|
+
projectId: string;
|
|
1107
|
+
region: string;
|
|
1108
|
+
maxSizeBytes: number;
|
|
1109
|
+
createdAt: number;
|
|
1110
|
+
updatedAt: number;
|
|
1111
|
+
parentDriveId?: string | undefined;
|
|
1112
|
+
rootDriveId?: string | undefined;
|
|
1062
1113
|
currentSessionId?: string | undefined;
|
|
1063
1114
|
currentSandboxName?: string | undefined;
|
|
1064
1115
|
};
|
|
@@ -1097,6 +1148,22 @@ declare class APIClient extends BaseClient {
|
|
|
1097
1148
|
durationMs?: number | undefined;
|
|
1098
1149
|
};
|
|
1099
1150
|
}>>;
|
|
1151
|
+
/**
|
|
1152
|
+
* Writes to a command's stdin. With `offset`, the request is safe to resend
|
|
1153
|
+
* (the server skips bytes it already has), so it is retried across
|
|
1154
|
+
* connection failures. Without it, only rate limited requests are retried,
|
|
1155
|
+
* since any other failure may have written the bytes already.
|
|
1156
|
+
*/
|
|
1157
|
+
writeCommandStdin(params: {
|
|
1158
|
+
sessionId: string;
|
|
1159
|
+
commandId: string;
|
|
1160
|
+
data?: Uint8Array;
|
|
1161
|
+
offset?: number;
|
|
1162
|
+
close?: boolean;
|
|
1163
|
+
abortSignal?: AbortSignal;
|
|
1164
|
+
}): Promise<{
|
|
1165
|
+
bytesWritten?: number;
|
|
1166
|
+
}>;
|
|
1100
1167
|
getLogs(params: {
|
|
1101
1168
|
sessionId: string;
|
|
1102
1169
|
cmdId: string;
|
|
@@ -1104,6 +1171,7 @@ declare class APIClient extends BaseClient {
|
|
|
1104
1171
|
}): AsyncGenerator<LogOutputLine, void, void> & Disposable & {
|
|
1105
1172
|
close(): void;
|
|
1106
1173
|
};
|
|
1174
|
+
private getLogsStream;
|
|
1107
1175
|
stopSession(params: {
|
|
1108
1176
|
sessionId: string;
|
|
1109
1177
|
signal?: AbortSignal;
|
|
@@ -1146,6 +1214,7 @@ declare class APIClient extends BaseClient {
|
|
|
1146
1214
|
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
1147
1215
|
region?: string | undefined;
|
|
1148
1216
|
failoverRegions?: string[] | undefined;
|
|
1217
|
+
networkId?: string | undefined;
|
|
1149
1218
|
vcpus?: number | undefined;
|
|
1150
1219
|
memory?: number | undefined;
|
|
1151
1220
|
runtime?: string | undefined;
|
|
@@ -1401,6 +1470,7 @@ declare class APIClient extends BaseClient {
|
|
|
1401
1470
|
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
1402
1471
|
region?: string | undefined;
|
|
1403
1472
|
failoverRegions?: string[] | undefined;
|
|
1473
|
+
networkId?: string | undefined;
|
|
1404
1474
|
vcpus?: number | undefined;
|
|
1405
1475
|
memory?: number | undefined;
|
|
1406
1476
|
runtime?: string | undefined;
|
|
@@ -1530,6 +1600,8 @@ declare class APIClient extends BaseClient {
|
|
|
1530
1600
|
maxSizeBytes: number;
|
|
1531
1601
|
createdAt: number;
|
|
1532
1602
|
updatedAt: number;
|
|
1603
|
+
parentDriveId?: string | undefined;
|
|
1604
|
+
rootDriveId?: string | undefined;
|
|
1533
1605
|
currentSessionId?: string | undefined;
|
|
1534
1606
|
currentSandboxName?: string | undefined;
|
|
1535
1607
|
};
|
|
@@ -1544,6 +1616,7 @@ declare class APIClient extends BaseClient {
|
|
|
1544
1616
|
};
|
|
1545
1617
|
timeout?: number;
|
|
1546
1618
|
networkPolicy?: NetworkPolicy;
|
|
1619
|
+
networkId?: string | null;
|
|
1547
1620
|
tags?: Record<string, string>;
|
|
1548
1621
|
ports?: number[];
|
|
1549
1622
|
snapshotExpiration?: number;
|
|
@@ -1567,6 +1640,7 @@ declare class APIClient extends BaseClient {
|
|
|
1567
1640
|
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
1568
1641
|
region?: string | undefined;
|
|
1569
1642
|
failoverRegions?: string[] | undefined;
|
|
1643
|
+
networkId?: string | undefined;
|
|
1570
1644
|
vcpus?: number | undefined;
|
|
1571
1645
|
memory?: number | undefined;
|
|
1572
1646
|
runtime?: string | undefined;
|
|
@@ -1699,6 +1773,7 @@ declare class APIClient extends BaseClient {
|
|
|
1699
1773
|
status: "pending" | "running" | "stopping" | "stopped" | "failed" | "aborted" | "snapshotting";
|
|
1700
1774
|
region?: string | undefined;
|
|
1701
1775
|
failoverRegions?: string[] | undefined;
|
|
1776
|
+
networkId?: string | undefined;
|
|
1702
1777
|
vcpus?: number | undefined;
|
|
1703
1778
|
memory?: number | undefined;
|
|
1704
1779
|
runtime?: string | undefined;
|
|
@@ -524,6 +524,8 @@ declare const SnapshotResponse: z.ZodObject<{
|
|
|
524
524
|
}, z.core.$strip>;
|
|
525
525
|
declare const Drive: z.ZodObject<{
|
|
526
526
|
id: z.ZodString;
|
|
527
|
+
parentDriveId: z.ZodOptional<z.ZodString>;
|
|
528
|
+
rootDriveId: z.ZodOptional<z.ZodString>;
|
|
527
529
|
name: z.ZodString;
|
|
528
530
|
projectId: z.ZodString;
|
|
529
531
|
region: z.ZodString;
|
|
@@ -539,6 +541,7 @@ declare const Sandbox: z.ZodObject<{
|
|
|
539
541
|
persistent: z.ZodBoolean;
|
|
540
542
|
region: z.ZodOptional<z.ZodString>;
|
|
541
543
|
failoverRegions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
544
|
+
networkId: z.ZodOptional<z.ZodString>;
|
|
542
545
|
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
543
546
|
memory: z.ZodOptional<z.ZodNumber>;
|
|
544
547
|
runtime: z.ZodOptional<z.ZodString>;
|
|
@@ -793,6 +796,7 @@ declare const StopSessionResponse: z.ZodObject<{
|
|
|
793
796
|
persistent: z.ZodBoolean;
|
|
794
797
|
region: z.ZodOptional<z.ZodString>;
|
|
795
798
|
failoverRegions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
799
|
+
networkId: z.ZodOptional<z.ZodString>;
|
|
796
800
|
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
797
801
|
memory: z.ZodOptional<z.ZodNumber>;
|
|
798
802
|
runtime: z.ZodOptional<z.ZodString>;
|
|
@@ -2,6 +2,7 @@ import { CommandData, LogOutputLine } from "./api-client/validators.js";
|
|
|
2
2
|
import { APIClient } from "./api-client/api-client.js";
|
|
3
3
|
import "./api-client/index.js";
|
|
4
4
|
import { Signal } from "./utils/resolveSignal.js";
|
|
5
|
+
import { StdinPipe } from "./utils/pipe-stdin.js";
|
|
5
6
|
import { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "./_workflow-serde.js";
|
|
6
7
|
|
|
7
8
|
//#region src/command.d.ts
|
|
@@ -73,6 +74,28 @@ declare class Command {
|
|
|
73
74
|
* @internal
|
|
74
75
|
*/
|
|
75
76
|
protected _resolvedOutput: CommandOutput | null;
|
|
77
|
+
/**
|
|
78
|
+
* Tail of pending stdin writes, so concurrent calls reach the process in
|
|
79
|
+
* call order.
|
|
80
|
+
*/
|
|
81
|
+
private stdinQueue;
|
|
82
|
+
/**
|
|
83
|
+
* Set when a write failed after possibly delivering some bytes. Later
|
|
84
|
+
* writes are rejected so they can't be appended to a partial message.
|
|
85
|
+
*/
|
|
86
|
+
private stdinError;
|
|
87
|
+
/**
|
|
88
|
+
* Bytes the API has confirmed written to stdin, sent with each request so
|
|
89
|
+
* the API can skip bytes it already has when a request is resent. Unknown
|
|
90
|
+
* until the first stdin call, because a deserialized `Command` can't know
|
|
91
|
+
* what an earlier instance wrote.
|
|
92
|
+
*/
|
|
93
|
+
private stdinOffset;
|
|
94
|
+
/**
|
|
95
|
+
* Set when the command was started with a `Readable` for stdin.
|
|
96
|
+
* @internal
|
|
97
|
+
*/
|
|
98
|
+
stdinPipe: StdinPipe | null;
|
|
76
99
|
/**
|
|
77
100
|
* ID of the command execution.
|
|
78
101
|
*/
|
|
@@ -223,6 +246,43 @@ declare class Command {
|
|
|
223
246
|
kill(signal?: Signal, opts?: {
|
|
224
247
|
abortSignal?: AbortSignal;
|
|
225
248
|
}): Promise<void>;
|
|
249
|
+
/**
|
|
250
|
+
* Write data to the stdin of a running command. The command must have been
|
|
251
|
+
* started with `stdin: true` and `detached: true`.
|
|
252
|
+
*
|
|
253
|
+
* Writes are delivered in the order they are called, and resolve once the
|
|
254
|
+
* process has accepted the data. Don't write to the same command from more
|
|
255
|
+
* than one place. If a write fails, part of it may have been written and
|
|
256
|
+
* further writes are rejected.
|
|
257
|
+
*
|
|
258
|
+
* ```
|
|
259
|
+
* const cmd = await sandbox.runCommand({ cmd: "cat", stdin: true, detached: true });
|
|
260
|
+
* await cmd.writeStdin("hello\n");
|
|
261
|
+
* await cmd.closeStdin();
|
|
262
|
+
* ```
|
|
263
|
+
*
|
|
264
|
+
* @param data - The data to write. Strings are encoded as UTF-8.
|
|
265
|
+
* @param opts - Optional parameters.
|
|
266
|
+
* @param opts.abortSignal - An AbortSignal to cancel the write. Aborting a
|
|
267
|
+
* write that has started may leave part of the data written.
|
|
268
|
+
* @returns Promise<void>.
|
|
269
|
+
*/
|
|
270
|
+
writeStdin(data: string | Uint8Array, opts?: {
|
|
271
|
+
abortSignal?: AbortSignal;
|
|
272
|
+
}): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Close the stdin of a running command, so it reads EOF once it has
|
|
275
|
+
* consumed any pending data.
|
|
276
|
+
*
|
|
277
|
+
* @param opts - Optional parameters.
|
|
278
|
+
* @param opts.abortSignal - An AbortSignal to cancel the operation.
|
|
279
|
+
* @returns Promise<void>.
|
|
280
|
+
*/
|
|
281
|
+
closeStdin(opts?: {
|
|
282
|
+
abortSignal?: AbortSignal;
|
|
283
|
+
}): Promise<void>;
|
|
284
|
+
private resolveStdinOffset;
|
|
285
|
+
private enqueueStdin;
|
|
226
286
|
}
|
|
227
287
|
/**
|
|
228
288
|
* A command that has finished executing.
|
|
@@ -286,6 +346,24 @@ declare class CommandFinished extends Command {
|
|
|
286
346
|
* @returns This CommandFinished instance.
|
|
287
347
|
*/
|
|
288
348
|
wait(): Promise<CommandFinished>;
|
|
349
|
+
/**
|
|
350
|
+
* Not available: the command has already exited.
|
|
351
|
+
*
|
|
352
|
+
* @deprecated Always throws on a finished command.
|
|
353
|
+
* @throws Always.
|
|
354
|
+
*/
|
|
355
|
+
writeStdin(_data: string | Uint8Array, _opts?: {
|
|
356
|
+
abortSignal?: AbortSignal;
|
|
357
|
+
}): Promise<never>;
|
|
358
|
+
/**
|
|
359
|
+
* Not available: the command has already exited.
|
|
360
|
+
*
|
|
361
|
+
* @deprecated Always throws on a finished command.
|
|
362
|
+
* @throws Always.
|
|
363
|
+
*/
|
|
364
|
+
closeStdin(_opts?: {
|
|
365
|
+
abortSignal?: AbortSignal;
|
|
366
|
+
}): Promise<never>;
|
|
289
367
|
}
|
|
290
368
|
//#endregion
|
|
291
369
|
export { Command, CommandFinished, CommandOutput, SerializedCommand, SerializedCommandFinished };
|
|
@@ -12,6 +12,17 @@ interface SerializedDrive {
|
|
|
12
12
|
projectId?: string;
|
|
13
13
|
}
|
|
14
14
|
/** @inline */
|
|
15
|
+
interface GetDriveParams {
|
|
16
|
+
/**
|
|
17
|
+
* The name of the drive.
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* An AbortSignal to cancel the operation.
|
|
22
|
+
*/
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}
|
|
25
|
+
/** @inline */
|
|
15
26
|
interface GetOrCreateDriveParams {
|
|
16
27
|
/**
|
|
17
28
|
* The name of the drive to get or create. Must be unique within the project.
|
|
@@ -35,7 +46,7 @@ interface GetOrCreateDriveParams {
|
|
|
35
46
|
* A Drive is a persistent, bottomless storage that can be attached and detached to Sandboxes.
|
|
36
47
|
* Drives can be mounted as read-write or as read-only snapshots, at a configurable path with `Sandbox.create()`.
|
|
37
48
|
*
|
|
38
|
-
* Use {@link Drive.getOrCreate} to construct.
|
|
49
|
+
* Use {@link Drive.get} or {@link Drive.getOrCreate} to construct.
|
|
39
50
|
* @hideconstructor
|
|
40
51
|
*/
|
|
41
52
|
declare class Drive {
|
|
@@ -51,6 +62,14 @@ declare class Drive {
|
|
|
51
62
|
* Unique ID of this drive.
|
|
52
63
|
*/
|
|
53
64
|
get driveId(): string;
|
|
65
|
+
/**
|
|
66
|
+
* The ID of the source drive, if this drive is a fork.
|
|
67
|
+
*/
|
|
68
|
+
get parentDriveId(): string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* The ID of the original drive at the root of this fork.
|
|
71
|
+
*/
|
|
72
|
+
get rootDriveId(): string | undefined;
|
|
54
73
|
/**
|
|
55
74
|
* The name of the drive.
|
|
56
75
|
*/
|
|
@@ -137,13 +156,34 @@ declare class Drive {
|
|
|
137
156
|
next: string | null;
|
|
138
157
|
};
|
|
139
158
|
}, "drives">>;
|
|
159
|
+
/**
|
|
160
|
+
* Retrieve an existing drive by its name. Use {@link Drive.getOrCreate}
|
|
161
|
+
* to create new drives.
|
|
162
|
+
*
|
|
163
|
+
* @param params - Get parameters and optional credentials.
|
|
164
|
+
* @returns A promise resolving to the {@link Drive} if it exists.
|
|
165
|
+
*/
|
|
166
|
+
static get(params: (GetDriveParams | (GetDriveParams & Credentials)) & WithFetchOptions): Promise<Drive>;
|
|
140
167
|
/**
|
|
141
168
|
* Retrieve an existing drive, or create a new one if it doesn't exists.
|
|
169
|
+
* Use {@link Drive.get} to get a drive without trying to create it if
|
|
170
|
+
* it doesn't exit.
|
|
142
171
|
*
|
|
143
172
|
* @param params - Get/create parameters and optional credentials.
|
|
144
173
|
* @returns A promise resolving to the {@link Drive}.
|
|
145
174
|
*/
|
|
146
175
|
static getOrCreate(params: (GetOrCreateDriveParams | (GetOrCreateDriveParams & Credentials)) & WithFetchOptions): Promise<Drive>;
|
|
176
|
+
/**
|
|
177
|
+
* Create a fork of this drive, with a new name. Forks inherit their parent
|
|
178
|
+
* drive's data, max size and region.
|
|
179
|
+
*
|
|
180
|
+
* @param params - Name of the forked drive and optional abort signal.
|
|
181
|
+
* @returns A promise resolving to the forked {@link Drive}.
|
|
182
|
+
*/
|
|
183
|
+
fork(params: {
|
|
184
|
+
name: string;
|
|
185
|
+
signal?: AbortSignal;
|
|
186
|
+
}): Promise<Drive>;
|
|
147
187
|
/**
|
|
148
188
|
* Delete this drive. The drive must not be attached to any sandbox.
|
|
149
189
|
* This operation is irreversible and will delete all data stored in the drive.
|