eve 0.46.1 → 0.47.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/src/channel/schedule.d.ts +1 -0
  3. package/dist/src/channel/schedule.js +1 -1
  4. package/dist/src/compiled/.vendor-stamp.json +2 -1
  5. package/dist/src/compiled/@vercel/sandbox/index.js +9 -15
  6. package/dist/src/compiled/@vercel/sandbox-delete/LICENSE +201 -0
  7. package/dist/src/compiled/@vercel/sandbox-delete/_async-retry.d.ts +8 -0
  8. package/dist/src/compiled/@vercel/sandbox-delete/_workflow-serde.d.ts +5 -0
  9. package/dist/src/compiled/@vercel/sandbox-delete/api-client/api-client.d.ts +1730 -0
  10. package/dist/src/compiled/@vercel/sandbox-delete/api-client/api-error.d.ts +29 -0
  11. package/dist/src/compiled/@vercel/sandbox-delete/api-client/base-client.d.ts +39 -0
  12. package/dist/src/compiled/@vercel/sandbox-delete/api-client/file-writer.d.ts +66 -0
  13. package/dist/src/compiled/@vercel/sandbox-delete/api-client/index.d.ts +2 -0
  14. package/dist/src/compiled/@vercel/sandbox-delete/api-client/validators.d.ts +907 -0
  15. package/dist/src/compiled/@vercel/sandbox-delete/api-client/with-retry.d.ts +10 -0
  16. package/dist/src/compiled/@vercel/sandbox-delete/auth/error.d.ts +15 -0
  17. package/dist/src/compiled/@vercel/sandbox-delete/auth/file.d.ts +18 -0
  18. package/dist/src/compiled/@vercel/sandbox-delete/auth/index.d.ts +6 -0
  19. package/dist/src/compiled/@vercel/sandbox-delete/auth/oauth.d.ts +111 -0
  20. package/dist/src/compiled/@vercel/sandbox-delete/auth/poll-for-token.d.ts +28 -0
  21. package/dist/src/compiled/@vercel/sandbox-delete/auth/project.d.ts +40 -0
  22. package/dist/src/compiled/@vercel/sandbox-delete/command.d.ts +292 -0
  23. package/dist/src/compiled/@vercel/sandbox-delete/constants.d.ts +15 -0
  24. package/dist/src/compiled/@vercel/sandbox-delete/execution-context.d.ts +116 -0
  25. package/dist/src/compiled/@vercel/sandbox-delete/filesystem.d.ts +258 -0
  26. package/dist/src/compiled/@vercel/sandbox-delete/index.d.ts +13 -0
  27. package/dist/src/compiled/@vercel/sandbox-delete/index.js +9 -0
  28. package/dist/src/compiled/@vercel/sandbox-delete/network-policy.d.ts +169 -0
  29. package/dist/src/compiled/@vercel/sandbox-delete/proxy.d.ts +55 -0
  30. package/dist/src/compiled/@vercel/sandbox-delete/sandbox-user.d.ts +211 -0
  31. package/dist/src/compiled/@vercel/sandbox-delete/sandbox.d.ts +1258 -0
  32. package/dist/src/compiled/@vercel/sandbox-delete/session.d.ts +435 -0
  33. package/dist/src/compiled/@vercel/sandbox-delete/snapshot.d.ts +238 -0
  34. package/dist/src/compiled/@vercel/sandbox-delete/utils/get-credentials.d.ts +21 -0
  35. package/dist/src/compiled/@vercel/sandbox-delete/utils/paginator.d.ts +16 -0
  36. package/dist/src/compiled/@vercel/sandbox-delete/utils/resolveSignal.d.ts +15 -0
  37. package/dist/src/compiled/@vercel/sandbox-delete/utils/sandbox-snapshot.d.ts +11 -0
  38. package/dist/src/compiled/@vercel/sandbox-delete/utils/types.d.ts +11 -0
  39. package/dist/src/compiled/_chunks/node/auth-DpzFWvTn.js +2 -0
  40. package/dist/src/compiled/_chunks/node/auth-QgeX8nBM.js +2 -0
  41. package/dist/src/compiled/_chunks/node/decode_jwt-Col8JOnf.js +7 -0
  42. package/dist/src/compiled/_chunks/node/version-DH6yRy-M.js +1 -0
  43. package/dist/src/compiled/_chunks/node/xdg-app-paths-Bys8q02u.js +1 -0
  44. package/dist/src/compiler/extension-compatibility.d.ts +12 -12
  45. package/dist/src/compiler/extension-compatibility.js +1 -1
  46. package/dist/src/compiler/model-catalog.js +1 -1
  47. package/dist/src/context/build-callback-context.js +1 -1
  48. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  49. package/dist/src/context/keys.d.ts +2 -0
  50. package/dist/src/context/keys.js +1 -1
  51. package/dist/src/context/memory-tools.js +1 -1
  52. package/dist/src/context/providers/sandbox.js +1 -1
  53. package/dist/src/evals/context.js +1 -1
  54. package/dist/src/evals/session-content.d.ts +5 -0
  55. package/dist/src/evals/session-content.js +3 -0
  56. package/dist/src/evals/session.d.ts +1 -0
  57. package/dist/src/evals/session.js +1 -1
  58. package/dist/src/evals/types.d.ts +5 -0
  59. package/dist/src/execution/dispatch-runtime-actions-shared.js +1 -1
  60. package/dist/src/execution/eve-workflow-attributes.d.ts +3 -0
  61. package/dist/src/execution/eve-workflow-attributes.js +1 -1
  62. package/dist/src/execution/runtime-context.js +1 -1
  63. package/dist/src/execution/sandbox/bindings/docker-base-setup.d.ts +4 -4
  64. package/dist/src/execution/sandbox/bindings/docker-base-setup.js +1 -1
  65. package/dist/src/execution/sandbox/bindings/docker-session.d.ts +1 -1
  66. package/dist/src/execution/sandbox/bindings/docker-session.js +1 -1
  67. package/dist/src/execution/sandbox/bindings/docker.js +1 -1
  68. package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
  69. package/dist/src/execution/sandbox/bindings/microsandbox-lifecycle.js +1 -1
  70. package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
  71. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +4 -0
  72. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.js +2 -2
  73. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.d.ts +8 -0
  74. package/dist/src/execution/sandbox/bindings/vercel-lifecycle.js +1 -0
  75. package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +3 -0
  76. package/dist/src/execution/sandbox/bindings/vercel.d.ts +2 -1
  77. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  78. package/dist/src/execution/sandbox/ensure.d.ts +2 -0
  79. package/dist/src/execution/sandbox/ensure.js +1 -1
  80. package/dist/src/execution/sandbox/require-sandbox.js +1 -1
  81. package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
  82. package/dist/src/execution/tools/connection-search.js +2 -2
  83. package/dist/src/execution/tools/file-state.js +1 -1
  84. package/dist/src/execution/tools/load-skill.js +1 -1
  85. package/dist/src/execution/tools/subagent/local.js +1 -1
  86. package/dist/src/execution/workflow-steps.js +1 -1
  87. package/dist/src/harness/approval-delivery-coordinator.js +1 -1
  88. package/dist/src/harness/attachment-staging.js +1 -1
  89. package/dist/src/harness/authorization.js +1 -1
  90. package/dist/src/harness/current-messages.d.ts +15 -0
  91. package/dist/src/harness/current-messages.js +1 -0
  92. package/dist/src/harness/instrumentation/runtime-context.js +1 -1
  93. package/dist/src/harness/instrumentation/state.js +1 -1
  94. package/dist/src/harness/step-hooks.js +1 -1
  95. package/dist/src/harness/tool-loop.js +2 -2
  96. package/dist/src/harness/tools.js +1 -1
  97. package/dist/src/internal/application/package.js +1 -1
  98. package/dist/src/internal/model-catalog.js +1 -1
  99. package/dist/src/packages/eve-catalog/src/index.js +1 -1
  100. package/dist/src/public/channels/chat-sdk/chatSdkChannel.js +2 -2
  101. package/dist/src/public/definitions/sandbox-backend.d.ts +1 -1
  102. package/dist/src/public/sandbox/index.d.ts +1 -1
  103. package/dist/src/runtime/agent/resolve-model.js +1 -1
  104. package/dist/src/runtime/connections/principal.js +1 -1
  105. package/dist/src/sandbox/state.d.ts +2 -0
  106. package/dist/src/setup/scaffold/create/project.js +1 -1
  107. package/dist/src/setup/scaffold/create/web-template.d.ts +1 -1
  108. package/dist/src/setup/scaffold/create/web-template.js +4 -2
  109. package/dist/src/shared/sandbox-backend.d.ts +9 -0
  110. package/dist/src/shared/sandbox-definition.d.ts +5 -4
  111. package/dist/src/shared/sandbox-session.d.ts +4 -1
  112. package/dist/src/tasks/delivery-policy.d.ts +12 -0
  113. package/dist/src/tasks/delivery-policy.js +1 -0
  114. package/dist/src/tracing/agent-trace-context-store.js +1 -1
  115. package/docs/evals/cases.mdx +11 -2
  116. package/docs/evals/judge.mdx +15 -0
  117. package/docs/evals/overview.mdx +2 -2
  118. package/docs/guides/instrumentation.md +1 -0
  119. package/docs/guides/session-context.md +2 -2
  120. package/docs/sandbox.mdx +25 -2
  121. package/docs/schedules.mdx +2 -0
  122. package/docs/tools/overview.mdx +2 -0
  123. package/package.json +2 -1
  124. package/dist/src/compiled/_chunks/node/auth-BaNbsImr.js +0 -2
@@ -0,0 +1,55 @@
1
+ //#region src/proxy.d.ts
2
+ interface ProxyMeta {
3
+ /**
4
+ * The host of the request as received by this proxy.
5
+ */
6
+ host: string;
7
+ /**
8
+ * The ID of the team that owns the sandbox that proxied the request.
9
+ */
10
+ teamId: string;
11
+ /**
12
+ * The ID of the project that owns the sandbox that proxied the request.
13
+ */
14
+ projectId: string;
15
+ /**
16
+ * The ID of the sandbox that proxied the request.
17
+ */
18
+ sandboxId: string;
19
+ /**
20
+ * The name of the sandbox that proxied the request, when using persistent sandboxes.
21
+ */
22
+ sandboxName: string;
23
+ }
24
+ type ProxyHandler = (request: Request, meta: ProxyMeta) => Response | Promise<Response>;
25
+ type InvalidRequestProxyHandler = (request: Request, error: Error) => Response | Promise<Response>;
26
+ /**
27
+ * Creates a Web Handler for proxied requests from Vercel Sandboxes using the network policy `forwardURL`
28
+ * option. The provided `handler` is called for each valid proxied request, with the original request
29
+ * alongside extracted metadata used to identify the source sandbox and request details.
30
+ *
31
+ * This function automatically verifies the OIDC token included in proxied requests to ensure the request
32
+ * is legitimate: if invalid, the `invalidRequestHandler` is called (by default, a 403 response is returned).
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * export default {
37
+ * fetch: defineSandboxProxy(async (request, meta) => {
38
+ * // meta contains the original host & source team/project/sandbox ids
39
+ * console.log(meta)
40
+ *
41
+ * // return a custom response, or proxy upstream:
42
+ * return await fetch(request)
43
+ * }, (request, error) => {
44
+ * // optional, handle any authorization error
45
+ * return new Response("Forbidden", { status: 403 })
46
+ * })
47
+ * }
48
+ * ```
49
+ *
50
+ * @see https://vercel.com/docs/vercel-sandbox/concepts/firewall#requests-proxying
51
+ */
52
+ declare function defineSandboxProxy(handler: ProxyHandler, invalidRequestHandler?: InvalidRequestProxyHandler): (request: Request) => Promise<Response>;
53
+ //#endregion
54
+ export { InvalidRequestProxyHandler, ProxyHandler, ProxyMeta, defineSandboxProxy };
55
+ //# sourceMappingURL=proxy.d.ts.map
@@ -0,0 +1,211 @@
1
+ import { Command, CommandFinished } from "./command.js";
2
+ import { ExecutionContext } from "./execution-context.js";
3
+ import { RunCommandParams } from "./session.js";
4
+ import { Sandbox } from "./sandbox.js";
5
+
6
+ //#region src/sandbox-user.d.ts
7
+
8
+ /**
9
+ * Thrown when {@link Sandbox.createUser} is called for an existing username.
10
+ */
11
+ declare class SandboxUserAlreadyExistsError extends Error {
12
+ readonly username: string;
13
+ constructor(username: string);
14
+ }
15
+ /**
16
+ * A user context within a sandbox.
17
+ *
18
+ * All file and command operations default to running as this user.
19
+ * Created via {@link Sandbox.createUser} or {@link Sandbox.asUser}.
20
+ *
21
+ * @hideconstructor
22
+ */
23
+ declare class SandboxUser implements ExecutionContext {
24
+ /**
25
+ * The Linux username.
26
+ */
27
+ readonly username: string;
28
+ /**
29
+ * The user's home directory (e.g., `/home/alice`).
30
+ */
31
+ readonly homeDir: string;
32
+ private readonly sandbox;
33
+ /**
34
+ * Memoized lookup of this user's primary group.
35
+ * See {@link SandboxUser.primaryGroup}.
36
+ */
37
+ private primaryGroupPromise?;
38
+ constructor({
39
+ sandbox,
40
+ username
41
+ }: {
42
+ sandbox: Sandbox;
43
+ username: string;
44
+ });
45
+ /**
46
+ * Build the wrapped command args to run as this user via `sudo -u`.
47
+ *
48
+ * When `env` is provided, injects `env KEY=VAL ...` so that environment
49
+ * variables survive the `sudo -u` transition.
50
+ */
51
+ private buildUserCommand;
52
+ /**
53
+ * Resolve a path relative to this user's home directory.
54
+ * Absolute paths are returned as-is.
55
+ */
56
+ private resolvePath;
57
+ /**
58
+ * Start executing a command as this user.
59
+ *
60
+ * @param command - The command to execute.
61
+ * @param args - Arguments to pass to the command.
62
+ * @param opts - Optional parameters.
63
+ * @returns A {@link CommandFinished} result once execution is done.
64
+ */
65
+ runCommand(command: string, args?: string[], opts?: {
66
+ signal?: AbortSignal;
67
+ timeoutMs?: number;
68
+ }): Promise<CommandFinished>;
69
+ /**
70
+ * Start executing a command as this user in detached mode.
71
+ *
72
+ * @param params - The command parameters.
73
+ * @returns A {@link Command} instance for the running command.
74
+ */
75
+ runCommand(params: RunCommandParams & {
76
+ detached: true;
77
+ }): Promise<Command>;
78
+ /**
79
+ * Start executing a command as this user.
80
+ *
81
+ * @param params - The command parameters.
82
+ * @returns A {@link CommandFinished} result once execution is done.
83
+ */
84
+ runCommand(params: RunCommandParams): Promise<CommandFinished>;
85
+ /**
86
+ * Write files to this user's home directory (or absolute paths).
87
+ * Files are written via the sandbox HTTP API then chowned to this user.
88
+ *
89
+ * The HTTP API can write to user home dirs because they are group-owned
90
+ * by the sandbox's default user group with `770` permissions.
91
+ *
92
+ * @param files - Array of files with path, content, and optional mode
93
+ * @param opts - Optional parameters.
94
+ */
95
+ writeFiles(files: {
96
+ path: string;
97
+ content: string | Uint8Array;
98
+ mode?: number;
99
+ }[], opts?: {
100
+ signal?: AbortSignal;
101
+ }): Promise<void>;
102
+ /**
103
+ * Read a file from this user's context as a stream.
104
+ *
105
+ * @param file - File to read, with path and optional cwd
106
+ * @param opts - Optional parameters.
107
+ * @returns A ReadableStream of the file contents, or null if not found
108
+ */
109
+ readFile(file: {
110
+ path: string;
111
+ cwd?: string;
112
+ }, opts?: {
113
+ signal?: AbortSignal;
114
+ }): Promise<NodeJS.ReadableStream | null>;
115
+ /**
116
+ * Read a file from this user's context as a Buffer.
117
+ *
118
+ * @param file - File to read, with path and optional cwd
119
+ * @param opts - Optional parameters.
120
+ * @returns The file contents as a Buffer, or null if not found
121
+ */
122
+ readFileToBuffer(file: {
123
+ path: string;
124
+ cwd?: string;
125
+ }, opts?: {
126
+ signal?: AbortSignal;
127
+ }): Promise<Buffer | null>;
128
+ /**
129
+ * Download a file from this user's context to the local filesystem.
130
+ *
131
+ * @param src - Source file in the sandbox
132
+ * @param dst - Destination on the local machine
133
+ * @param opts - Optional parameters.
134
+ * @returns The absolute path to the written file, or null if not found
135
+ */
136
+ downloadFile(src: {
137
+ path: string;
138
+ cwd?: string;
139
+ }, dst: {
140
+ path: string;
141
+ cwd?: string;
142
+ }, opts?: {
143
+ mkdirRecursive?: boolean;
144
+ signal?: AbortSignal;
145
+ }): Promise<string | null>;
146
+ /**
147
+ * Read a file as this user and return its bytes, or null if it does not
148
+ * exist.
149
+ *
150
+ * Reads via `sudo -u <user> base64` rather than the HTTP file API, which may
151
+ * not be able to read files this user has kept private (e.g. mode `600`).
152
+ * Reading as the user always honours the user's own permissions. The payload
153
+ * is base64-encoded because the command output channel is UTF-8 only and
154
+ * would otherwise corrupt binary files.
155
+ */
156
+ private catAsUser;
157
+ /**
158
+ * Create a directory owned by this user.
159
+ *
160
+ * @param path - Path of the directory to create
161
+ * @param opts - Optional parameters.
162
+ */
163
+ mkDir(path: string, opts?: {
164
+ signal?: AbortSignal;
165
+ }): Promise<void>;
166
+ /**
167
+ * This user's primary group. Users created via {@link Sandbox.createUser}
168
+ * get a group named after them, but {@link Sandbox.asUser} accepts
169
+ * pre-existing users whose primary group can differ (e.g. system users), so
170
+ * we resolve it from the sandbox rather than assuming `<username>`.
171
+ *
172
+ * The result is memoized for the lifetime of this instance.
173
+ */
174
+ private primaryGroup;
175
+ private resolvePrimaryGroup;
176
+ /**
177
+ * Run `chown <ownership> <paths...>` as root, throwing on failure.
178
+ */
179
+ private chownOrThrow;
180
+ /**
181
+ * Run `chmod <mode> <paths...>` as root, throwing on failure.
182
+ */
183
+ private chmodOrThrow;
184
+ /**
185
+ * Given absolute leaf paths, return the directories strictly between this
186
+ * user's home directory and each leaf. The home dir itself is excluded, as
187
+ * are any paths that fall outside the home dir.
188
+ */
189
+ private ancestorDirsUnderHome;
190
+ /**
191
+ * Add this user to a group.
192
+ *
193
+ * @param groupname - Name of the group to join
194
+ * @param opts - Optional parameters.
195
+ */
196
+ addToGroup(groupname: string, opts?: {
197
+ signal?: AbortSignal;
198
+ }): Promise<void>;
199
+ /**
200
+ * Remove this user from a group.
201
+ *
202
+ * @param groupname - Name of the group to leave
203
+ * @param opts - Optional parameters.
204
+ */
205
+ removeFromGroup(groupname: string, opts?: {
206
+ signal?: AbortSignal;
207
+ }): Promise<void>;
208
+ }
209
+ //#endregion
210
+ export { SandboxUser, SandboxUserAlreadyExistsError };
211
+ //# sourceMappingURL=sandbox-user.d.ts.map