eve 0.27.0 → 0.27.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 +18 -0
- package/dist/src/channel/resolve-active-session.d.ts +4 -0
- package/dist/src/channel/resolve-active-session.js +1 -0
- package/dist/src/channel/routes.d.ts +11 -0
- package/dist/src/cli/dev/tui/vercel-trusted-sources-policy.d.ts +1 -1
- package/dist/src/cli/dev/tui/vercel-trusted-sources.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +16 -16
- package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/google/index.d.ts +9 -2
- package/dist/src/compiled/@ai-sdk/google/index.js +6 -6
- package/dist/src/compiled/@ai-sdk/mcp/index.d.ts +18 -3
- package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/openai/index.d.ts +285 -24
- package/dist/src/compiled/@ai-sdk/openai/index.js +2 -2
- package/dist/src/compiled/@ai-sdk/otel/index.js +1 -1
- package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +7 -3
- package/dist/src/compiled/@vercel/oidc/index.js +28 -2
- package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +11 -0
- package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +7 -0
- package/dist/src/compiled/@vercel/sandbox/command.d.ts +8 -0
- package/dist/src/compiled/@vercel/sandbox/execution-context.d.ts +116 -0
- package/dist/src/compiled/@vercel/sandbox/index.d.ts +3 -1
- package/dist/src/compiled/@vercel/sandbox/index.js +20 -19
- package/dist/src/compiled/@vercel/sandbox/network-policy.d.ts +13 -5
- package/dist/src/compiled/@vercel/sandbox/sandbox-user.d.ts +212 -0
- package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +133 -2
- package/dist/src/compiled/@vercel/sandbox/session.d.ts +2 -1
- package/dist/src/compiled/@vercel/sandbox/snapshot.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/create-hook.d.ts +41 -22
- package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +29 -0
- package/dist/src/compiled/@workflow/core/global.d.ts +2 -0
- package/dist/src/compiled/@workflow/core/index.js +2 -2
- package/dist/src/compiled/@workflow/core/private.d.ts +6 -17
- package/dist/src/compiled/@workflow/core/private.js +1 -1
- package/dist/src/compiled/@workflow/core/replay-payload-cache.d.ts +56 -0
- package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +11 -0
- package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +6 -4
- package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +4 -1
- package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +39 -0
- package/dist/src/compiled/@workflow/core/runtime.js +3 -3
- package/dist/src/compiled/@workflow/core/serialization.d.ts +44 -4
- package/dist/src/compiled/@workflow/core/symbols.d.ts +13 -0
- package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/errors/error-codes.d.ts +2 -0
- package/dist/src/compiled/@workflow/errors/index.d.ts +14 -0
- package/dist/src/compiled/@workflow/errors/index.js +1 -1
- package/dist/src/compiled/@workflow/world/events.d.ts +15 -0
- package/dist/src/compiled/@workflow/world/hooks.d.ts +2 -1
- package/dist/src/compiled/@workflow/world/interfaces.d.ts +77 -4
- package/dist/src/compiled/@workflow/world-local/index.js +4 -4
- package/dist/src/compiled/@workflow/world-vercel/index.js +16 -16
- package/dist/src/compiled/_chunks/node/{auth-BuQkq4Gr.js → auth-l7F2PF2b.js} +2 -2
- package/dist/src/compiled/_chunks/node/{version-DD-FX9rK.js → version-CjHTLx2a.js} +1 -1
- package/dist/src/compiled/_chunks/node/virtual-loader-Cwgujv7l.js +1 -0
- package/dist/src/compiled/_chunks/workflow/attribute-changes-Dk1fP6vt.js +20 -0
- package/dist/src/compiled/_chunks/workflow/{chunk-BHKSVoKr.js → chunk-BTyA9uPd.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/dist-B3qkUnLJ.js +3 -0
- package/dist/src/compiled/_chunks/workflow/{dist-CSfKNxQW.js → dist-BX517Nmz.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/{dist-zLevmMyU.js → dist-C_VDTghO.js} +10 -10
- package/dist/src/compiled/_chunks/workflow/{dist-CttsoN4D.js → dist-CrxV2rsR.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{functions-PT9ri9Hu.js → functions-Dv8dc_-I.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/resume-hook-czpG5xnP.js +1 -0
- package/dist/src/compiled/_chunks/workflow/run-6zaMjFY6.js +1 -0
- package/dist/src/compiled/_chunks/workflow/sleep-B2u06FWc.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{src-CQuMexnO.js → src-D1EltLDA.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{token-CaY0nA5J.js → token-Cz223z3C.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/token-DWqA5-DA.js +1 -0
- package/dist/src/compiled/_chunks/workflow/token-util-B6qBs3-0.js +27 -0
- package/dist/src/compiled/_chunks/workflow/{undici-fb54XL8i.js → undici-C2ZhYnV9.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/wrapper-Cc2otuUR.js +6 -0
- package/dist/src/compiled/env-runner/index.js +1 -1
- package/dist/src/compiled/env-runner/node-worker.js +1 -1
- package/dist/src/compiled/eventsource-parser/stream/index.d.ts +16 -3
- package/dist/src/compiled/jose/index.js +1 -1
- package/dist/src/compiler/compile-from-memory.d.ts +5 -0
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/extension-compatibility.d.ts +10 -10
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/execution/deliver-payloads.d.ts +1 -1
- package/dist/src/execution/deliver-payloads.js +1 -1
- package/dist/src/execution/workflow-entry.js +1 -1
- package/dist/src/execution/workflow-steps.js +1 -1
- package/dist/src/harness/session-limit-continuation.d.ts +8 -0
- package/dist/src/harness/session-limit-continuation.js +1 -1
- package/dist/src/harness/session-limit-enforcement.d.ts +9 -6
- package/dist/src/harness/session-limit-enforcement.js +1 -1
- package/dist/src/harness/stale-input-responses.d.ts +21 -3
- package/dist/src/harness/stale-input-responses.js +2 -2
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/turn-cancellation.d.ts +13 -0
- package/dist/src/harness/turn-cancellation.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +1 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/models/updateprojectblock.js +1 -0
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.8/node_modules/@vercel/sdk/esm/models/updateprojectprojectsbranchmatcher.js +1 -0
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/public/channels/discord/defaults.js +1 -1
- package/dist/src/public/channels/linear/api.d.ts +2 -0
- package/dist/src/public/channels/linear/api.js +3 -1
- package/dist/src/public/channels/linear/defaults.js +2 -2
- package/dist/src/public/channels/linear/hitl.d.ts +8 -13
- package/dist/src/public/channels/linear/hitl.js +3 -3
- package/dist/src/public/channels/linear/index.d.ts +1 -1
- package/dist/src/public/channels/linear/index.js +1 -1
- package/dist/src/public/channels/linear/linearChannel.js +1 -1
- package/dist/src/public/channels/slack/api.d.ts +20 -0
- package/dist/src/public/channels/slack/api.js +1 -1
- package/dist/src/public/channels/slack/defaults.js +1 -1
- package/dist/src/public/channels/slack/inbound.d.ts +31 -0
- package/dist/src/public/channels/slack/inbound.js +1 -1
- package/dist/src/public/channels/slack/index.d.ts +2 -2
- package/dist/src/public/channels/slack/slackChannel.d.ts +72 -4
- package/dist/src/public/channels/slack/slackChannel.js +1 -1
- package/dist/src/public/channels/teams/defaults.js +2 -2
- package/dist/src/public/channels/teams/index.d.ts +1 -1
- package/dist/src/public/channels/teams/teamsChannel.d.ts +7 -2
- package/dist/src/public/channels/teams/teamsChannel.js +1 -1
- package/dist/src/public/channels/telegram/defaults.js +1 -1
- package/dist/src/public/definitions/channel.d.ts +1 -1
- package/dist/src/runtime/framework-tools/connection-search-dynamic.js +2 -1
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +2 -2
- package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
- package/dist/src/setup/scaffold/create/web-template.js +90 -5
- package/dist/src/setup/scaffold/update/channels.js +2 -2
- package/dist/src/setup/scaffold/update/connections.js +1 -1
- package/docs/agent-config.md +10 -5
- package/docs/channels/slack.mdx +76 -10
- package/docs/channels/teams.mdx +10 -3
- package/docs/guides/deployment/vercel.mdx +1 -1
- package/docs/guides/frontend/overview.mdx +2 -0
- package/package.json +22 -22
- package/dist/src/compiled/@workflow/core/step-hydration-cache.d.ts +0 -148
- package/dist/src/compiled/_chunks/node/virtual-loader-B8K8w9cr.js +0 -1
- package/dist/src/compiled/_chunks/workflow/attribute-changes-CXiYB8h9.js +0 -20
- package/dist/src/compiled/_chunks/workflow/dist-BYo8Gno2.js +0 -3
- package/dist/src/compiled/_chunks/workflow/resume-hook-CHXbXuRZ.js +0 -1
- package/dist/src/compiled/_chunks/workflow/run-BjtAGa3_.js +0 -1
- package/dist/src/compiled/_chunks/workflow/sleep-BJAv0MFP.js +0 -1
- package/dist/src/compiled/_chunks/workflow/token-D4VIwGlD.js +0 -1
- package/dist/src/compiled/_chunks/workflow/wrapper-ulTvoTdW.js +0 -6
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/updateprojectprojectsaction.js +0 -1
- package/dist/src/node_modules/.pnpm/@vercel_sdk@1.28.1/node_modules/@vercel/sdk/esm/models/updateprojectprojectsoptionsallowlist.js +0 -1
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/lib/primitives.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/lib/schemas.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/models/aclaction.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/models/sdkvalidationerror.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/types/defaultToZeroValue.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/types/fp.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/types/primitives.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/types/rfcdate.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/types/smartUnion.js +0 -0
- /package/dist/src/node_modules/.pnpm/{@vercel_sdk@1.28.1 → @vercel_sdk@1.28.8}/node_modules/@vercel/sdk/esm/types/unrecognized.js +0 -0
|
@@ -193,6 +193,7 @@ declare class APIClient extends BaseClient {
|
|
|
193
193
|
vcpus?: number | undefined;
|
|
194
194
|
memory?: number | undefined;
|
|
195
195
|
runtime?: string | undefined;
|
|
196
|
+
image?: string | undefined;
|
|
196
197
|
timeout?: number | undefined;
|
|
197
198
|
networkPolicy?: {
|
|
198
199
|
[x: string]: unknown;
|
|
@@ -284,6 +285,7 @@ declare class APIClient extends BaseClient {
|
|
|
284
285
|
totalIngressBytes?: number | undefined;
|
|
285
286
|
totalActiveCpuDurationMs?: number | undefined;
|
|
286
287
|
totalDurationMs?: number | undefined;
|
|
288
|
+
expiresAt?: number | undefined;
|
|
287
289
|
currentSnapshotId?: string | undefined;
|
|
288
290
|
statusUpdatedAt?: number | undefined;
|
|
289
291
|
cwd?: string | undefined;
|
|
@@ -771,6 +773,7 @@ declare class APIClient extends BaseClient {
|
|
|
771
773
|
sessionId: string;
|
|
772
774
|
exitCode: number | null;
|
|
773
775
|
startedAt: number;
|
|
776
|
+
durationMs?: number | undefined;
|
|
774
777
|
};
|
|
775
778
|
}>>;
|
|
776
779
|
getLogs(params: {
|
|
@@ -824,6 +827,7 @@ declare class APIClient extends BaseClient {
|
|
|
824
827
|
vcpus?: number | undefined;
|
|
825
828
|
memory?: number | undefined;
|
|
826
829
|
runtime?: string | undefined;
|
|
830
|
+
image?: string | undefined;
|
|
827
831
|
timeout?: number | undefined;
|
|
828
832
|
networkPolicy?: {
|
|
829
833
|
[x: string]: unknown;
|
|
@@ -915,6 +919,7 @@ declare class APIClient extends BaseClient {
|
|
|
915
919
|
totalIngressBytes?: number | undefined;
|
|
916
920
|
totalActiveCpuDurationMs?: number | undefined;
|
|
917
921
|
totalDurationMs?: number | undefined;
|
|
922
|
+
expiresAt?: number | undefined;
|
|
918
923
|
currentSnapshotId?: string | undefined;
|
|
919
924
|
statusUpdatedAt?: number | undefined;
|
|
920
925
|
cwd?: string | undefined;
|
|
@@ -1067,6 +1072,7 @@ declare class APIClient extends BaseClient {
|
|
|
1067
1072
|
vcpus?: number | undefined;
|
|
1068
1073
|
memory?: number | undefined;
|
|
1069
1074
|
runtime?: string | undefined;
|
|
1075
|
+
image?: string | undefined;
|
|
1070
1076
|
timeout?: number | undefined;
|
|
1071
1077
|
networkPolicy?: {
|
|
1072
1078
|
[x: string]: unknown;
|
|
@@ -1158,6 +1164,7 @@ declare class APIClient extends BaseClient {
|
|
|
1158
1164
|
totalIngressBytes?: number | undefined;
|
|
1159
1165
|
totalActiveCpuDurationMs?: number | undefined;
|
|
1160
1166
|
totalDurationMs?: number | undefined;
|
|
1167
|
+
expiresAt?: number | undefined;
|
|
1161
1168
|
currentSnapshotId?: string | undefined;
|
|
1162
1169
|
statusUpdatedAt?: number | undefined;
|
|
1163
1170
|
cwd?: string | undefined;
|
|
@@ -1207,6 +1214,7 @@ declare class APIClient extends BaseClient {
|
|
|
1207
1214
|
vcpus?: number | undefined;
|
|
1208
1215
|
memory?: number | undefined;
|
|
1209
1216
|
runtime?: string | undefined;
|
|
1217
|
+
image?: string | undefined;
|
|
1210
1218
|
timeout?: number | undefined;
|
|
1211
1219
|
networkPolicy?: {
|
|
1212
1220
|
[x: string]: unknown;
|
|
@@ -1298,6 +1306,7 @@ declare class APIClient extends BaseClient {
|
|
|
1298
1306
|
totalIngressBytes?: number | undefined;
|
|
1299
1307
|
totalActiveCpuDurationMs?: number | undefined;
|
|
1300
1308
|
totalDurationMs?: number | undefined;
|
|
1309
|
+
expiresAt?: number | undefined;
|
|
1301
1310
|
currentSnapshotId?: string | undefined;
|
|
1302
1311
|
statusUpdatedAt?: number | undefined;
|
|
1303
1312
|
cwd?: string | undefined;
|
|
@@ -1331,6 +1340,7 @@ declare class APIClient extends BaseClient {
|
|
|
1331
1340
|
vcpus?: number | undefined;
|
|
1332
1341
|
memory?: number | undefined;
|
|
1333
1342
|
runtime?: string | undefined;
|
|
1343
|
+
image?: string | undefined;
|
|
1334
1344
|
timeout?: number | undefined;
|
|
1335
1345
|
networkPolicy?: {
|
|
1336
1346
|
[x: string]: unknown;
|
|
@@ -1422,6 +1432,7 @@ declare class APIClient extends BaseClient {
|
|
|
1422
1432
|
totalIngressBytes?: number | undefined;
|
|
1423
1433
|
totalActiveCpuDurationMs?: number | undefined;
|
|
1424
1434
|
totalDurationMs?: number | undefined;
|
|
1435
|
+
expiresAt?: number | undefined;
|
|
1425
1436
|
currentSnapshotId?: string | undefined;
|
|
1426
1437
|
statusUpdatedAt?: number | undefined;
|
|
1427
1438
|
cwd?: string | undefined;
|
|
@@ -151,6 +151,7 @@ declare const Command: z.ZodObject<{
|
|
|
151
151
|
cwd: z.ZodString;
|
|
152
152
|
sessionId: z.ZodString;
|
|
153
153
|
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
154
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
154
155
|
startedAt: z.ZodNumber;
|
|
155
156
|
}, z.core.$strip>;
|
|
156
157
|
declare const SessionResponse: z.ZodObject<{
|
|
@@ -284,6 +285,7 @@ declare const CommandResponse: z.ZodObject<{
|
|
|
284
285
|
cwd: z.ZodString;
|
|
285
286
|
sessionId: z.ZodString;
|
|
286
287
|
exitCode: z.ZodNullable<z.ZodNumber>;
|
|
288
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
287
289
|
startedAt: z.ZodNumber;
|
|
288
290
|
}, z.core.$strip>;
|
|
289
291
|
}, z.core.$strip>;
|
|
@@ -295,6 +297,7 @@ declare const CommandFinishedResponse: z.ZodObject<{
|
|
|
295
297
|
args: z.ZodArray<z.ZodString>;
|
|
296
298
|
cwd: z.ZodString;
|
|
297
299
|
sessionId: z.ZodString;
|
|
300
|
+
durationMs: z.ZodOptional<z.ZodNumber>;
|
|
298
301
|
startedAt: z.ZodNumber;
|
|
299
302
|
exitCode: z.ZodNumber;
|
|
300
303
|
}, z.core.$strip>;
|
|
@@ -521,6 +524,7 @@ declare const Sandbox: z.ZodObject<{
|
|
|
521
524
|
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
522
525
|
memory: z.ZodOptional<z.ZodNumber>;
|
|
523
526
|
runtime: z.ZodOptional<z.ZodString>;
|
|
527
|
+
image: z.ZodOptional<z.ZodString>;
|
|
524
528
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
525
529
|
networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
526
530
|
mode: z.ZodLiteral<"allow-all">;
|
|
@@ -611,6 +615,7 @@ declare const Sandbox: z.ZodObject<{
|
|
|
611
615
|
totalDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
612
616
|
createdAt: z.ZodNumber;
|
|
613
617
|
updatedAt: z.ZodNumber;
|
|
618
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
614
619
|
currentSessionId: z.ZodString;
|
|
615
620
|
currentSnapshotId: z.ZodOptional<z.ZodString>;
|
|
616
621
|
status: z.ZodEnum<{
|
|
@@ -758,6 +763,7 @@ declare const StopSessionResponse: z.ZodObject<{
|
|
|
758
763
|
vcpus: z.ZodOptional<z.ZodNumber>;
|
|
759
764
|
memory: z.ZodOptional<z.ZodNumber>;
|
|
760
765
|
runtime: z.ZodOptional<z.ZodString>;
|
|
766
|
+
image: z.ZodOptional<z.ZodString>;
|
|
761
767
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
762
768
|
networkPolicy: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
763
769
|
mode: z.ZodLiteral<"allow-all">;
|
|
@@ -848,6 +854,7 @@ declare const StopSessionResponse: z.ZodObject<{
|
|
|
848
854
|
totalDurationMs: z.ZodOptional<z.ZodNumber>;
|
|
849
855
|
createdAt: z.ZodNumber;
|
|
850
856
|
updatedAt: z.ZodNumber;
|
|
857
|
+
expiresAt: z.ZodOptional<z.ZodNumber>;
|
|
851
858
|
currentSessionId: z.ZodString;
|
|
852
859
|
currentSnapshotId: z.ZodOptional<z.ZodString>;
|
|
853
860
|
status: z.ZodEnum<{
|
|
@@ -26,6 +26,7 @@ interface SerializedCommand {
|
|
|
26
26
|
*/
|
|
27
27
|
interface SerializedCommandFinished extends SerializedCommand {
|
|
28
28
|
exitCode: number;
|
|
29
|
+
durationMs?: number;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* A command executed in a Sandbox.
|
|
@@ -60,6 +61,7 @@ declare class Command {
|
|
|
60
61
|
*/
|
|
61
62
|
protected cmd: CommandData;
|
|
62
63
|
exitCode: number | null;
|
|
64
|
+
durationMs?: number;
|
|
63
65
|
protected outputCache: Promise<{
|
|
64
66
|
stdout: string;
|
|
65
67
|
stderr: string;
|
|
@@ -237,12 +239,17 @@ declare class CommandFinished extends Command {
|
|
|
237
239
|
* CommandFinished instances.
|
|
238
240
|
*/
|
|
239
241
|
exitCode: number;
|
|
242
|
+
/**
|
|
243
|
+
* The duration of the command execution in milliseconds.
|
|
244
|
+
*/
|
|
245
|
+
durationMs?: number;
|
|
240
246
|
/**
|
|
241
247
|
* @param params - Object containing client, sandbox ID, command data, and exit code.
|
|
242
248
|
* @param params.client - Optional API client. If not provided, will be lazily created using global credentials.
|
|
243
249
|
* @param params.sessionId - The ID of the session where the command ran.
|
|
244
250
|
* @param params.cmd - The command data.
|
|
245
251
|
* @param params.exitCode - The exit code of the completed command.
|
|
252
|
+
* @param params.durationMs - Optional duration of the command execution in milliseconds.
|
|
246
253
|
* @param params.output - Optional cached output to restore (used during deserialization).
|
|
247
254
|
*/
|
|
248
255
|
constructor(params: {
|
|
@@ -250,6 +257,7 @@ declare class CommandFinished extends Command {
|
|
|
250
257
|
sessionId: string;
|
|
251
258
|
cmd: CommandData;
|
|
252
259
|
exitCode: number;
|
|
260
|
+
durationMs?: number;
|
|
253
261
|
output?: CommandOutput;
|
|
254
262
|
});
|
|
255
263
|
/**
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Command, CommandFinished } from "./command.js";
|
|
2
|
+
import { RunCommandParams } from "./session.js";
|
|
3
|
+
|
|
4
|
+
//#region src/execution-context.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The common surface for running commands and performing file operations in
|
|
8
|
+
* a sandbox, regardless of scope.
|
|
9
|
+
*
|
|
10
|
+
* Implemented by {@link Sandbox}, {@link Session}, and {@link SandboxUser},
|
|
11
|
+
* so code can be written against "somewhere to run commands" without caring
|
|
12
|
+
* whether it targets the whole sandbox or a specific user's context.
|
|
13
|
+
*
|
|
14
|
+
* Implementations may scope the operations: for example, {@link SandboxUser}
|
|
15
|
+
* runs commands as its user and resolves relative paths against the user's
|
|
16
|
+
* home directory.
|
|
17
|
+
*/
|
|
18
|
+
interface ExecutionContext {
|
|
19
|
+
/**
|
|
20
|
+
* Start executing a command in this context.
|
|
21
|
+
*
|
|
22
|
+
* @param command - The command to execute.
|
|
23
|
+
* @param args - Arguments to pass to the command.
|
|
24
|
+
* @param opts - Optional parameters.
|
|
25
|
+
* @returns A {@link CommandFinished} result once execution is done.
|
|
26
|
+
*/
|
|
27
|
+
runCommand(command: string, args?: string[], opts?: {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
timeoutMs?: number;
|
|
30
|
+
}): Promise<CommandFinished>;
|
|
31
|
+
/**
|
|
32
|
+
* Start executing a command in this context in detached mode.
|
|
33
|
+
*
|
|
34
|
+
* @param params - The command parameters.
|
|
35
|
+
* @returns A {@link Command} instance for the running command.
|
|
36
|
+
*/
|
|
37
|
+
runCommand(params: RunCommandParams & {
|
|
38
|
+
detached: true;
|
|
39
|
+
}): Promise<Command>;
|
|
40
|
+
/**
|
|
41
|
+
* Start executing a command in this context.
|
|
42
|
+
*
|
|
43
|
+
* @param params - The command parameters.
|
|
44
|
+
* @returns A {@link CommandFinished} result once execution is done.
|
|
45
|
+
*/
|
|
46
|
+
runCommand(params: RunCommandParams): Promise<CommandFinished>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a directory in the filesystem of this context.
|
|
49
|
+
*
|
|
50
|
+
* @param path - Path of the directory to create
|
|
51
|
+
* @param opts - Optional parameters.
|
|
52
|
+
*/
|
|
53
|
+
mkDir(path: string, opts?: {
|
|
54
|
+
signal?: AbortSignal;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Read a file from this context as a stream.
|
|
58
|
+
*
|
|
59
|
+
* @param file - File to read, with path and optional cwd
|
|
60
|
+
* @param opts - Optional parameters.
|
|
61
|
+
* @returns A ReadableStream of the file contents, or null if not found
|
|
62
|
+
*/
|
|
63
|
+
readFile(file: {
|
|
64
|
+
path: string;
|
|
65
|
+
cwd?: string;
|
|
66
|
+
}, opts?: {
|
|
67
|
+
signal?: AbortSignal;
|
|
68
|
+
}): Promise<NodeJS.ReadableStream | null>;
|
|
69
|
+
/**
|
|
70
|
+
* Read a file from this context as a Buffer.
|
|
71
|
+
*
|
|
72
|
+
* @param file - File to read, with path and optional cwd
|
|
73
|
+
* @param opts - Optional parameters.
|
|
74
|
+
* @returns The file contents as a Buffer, or null if not found
|
|
75
|
+
*/
|
|
76
|
+
readFileToBuffer(file: {
|
|
77
|
+
path: string;
|
|
78
|
+
cwd?: string;
|
|
79
|
+
}, opts?: {
|
|
80
|
+
signal?: AbortSignal;
|
|
81
|
+
}): Promise<Buffer | null>;
|
|
82
|
+
/**
|
|
83
|
+
* Download a file from this context to the local filesystem.
|
|
84
|
+
*
|
|
85
|
+
* @param src - Source file in the sandbox
|
|
86
|
+
* @param dst - Destination on the local machine
|
|
87
|
+
* @param opts - Optional parameters.
|
|
88
|
+
* @returns The absolute path to the written file, or null if not found
|
|
89
|
+
*/
|
|
90
|
+
downloadFile(src: {
|
|
91
|
+
path: string;
|
|
92
|
+
cwd?: string;
|
|
93
|
+
}, dst: {
|
|
94
|
+
path: string;
|
|
95
|
+
cwd?: string;
|
|
96
|
+
}, opts?: {
|
|
97
|
+
mkdirRecursive?: boolean;
|
|
98
|
+
signal?: AbortSignal;
|
|
99
|
+
}): Promise<string | null>;
|
|
100
|
+
/**
|
|
101
|
+
* Write files to the filesystem of this context.
|
|
102
|
+
*
|
|
103
|
+
* @param files - Array of files with path, content, and optional mode
|
|
104
|
+
* @param opts - Optional parameters.
|
|
105
|
+
*/
|
|
106
|
+
writeFiles(files: {
|
|
107
|
+
path: string;
|
|
108
|
+
content: string | Uint8Array;
|
|
109
|
+
mode?: number;
|
|
110
|
+
}[], opts?: {
|
|
111
|
+
signal?: AbortSignal;
|
|
112
|
+
}): Promise<void>;
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
export { ExecutionContext };
|
|
116
|
+
//# sourceMappingURL=execution-context.d.ts.map
|
|
@@ -3,8 +3,10 @@ import { SnapshotTreeNodeData } from "./api-client/validators.js";
|
|
|
3
3
|
import { NetworkPolicy, NetworkPolicyKeyValueMatcher, NetworkPolicyMatch, NetworkPolicyMatcher, NetworkPolicyRule, NetworkTransformer } from "./network-policy.js";
|
|
4
4
|
import { Command, CommandFinished, CommandOutput, SerializedCommand, SerializedCommandFinished } from "./command.js";
|
|
5
5
|
import { SerializedSnapshot, Snapshot } from "./snapshot.js";
|
|
6
|
+
import { ExecutionContext } from "./execution-context.js";
|
|
6
7
|
import { Session } from "./session.js";
|
|
7
8
|
import { FileSystem } from "./filesystem.js";
|
|
9
|
+
import { SandboxUser, SandboxUserAlreadyExistsError } from "./sandbox-user.js";
|
|
8
10
|
import { Sandbox, SerializedSandbox } from "./sandbox.js";
|
|
9
11
|
import { InvalidRequestProxyHandler, ProxyHandler, ProxyMeta, defineSandboxProxy } from "./proxy.js";
|
|
10
|
-
export { APIError, Command, CommandFinished, type CommandOutput, FileSystem, type InvalidRequestProxyHandler, type NetworkPolicy, type NetworkPolicyKeyValueMatcher, type NetworkPolicyMatch, type NetworkPolicyMatcher, type NetworkPolicyRule, type NetworkTransformer, type ProxyHandler, type ProxyMeta, Sandbox, type SerializedCommand, type SerializedCommandFinished, type SerializedSandbox, type SerializedSnapshot, Session, Snapshot, type SnapshotTreeNodeData, StreamError, defineSandboxProxy };
|
|
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 };
|