eve 0.64.0 → 0.64.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 +12 -0
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.d.ts +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy-flow.js +1 -1
- package/dist/src/cli/dev/tui/runner.d.ts +0 -1
- package/dist/src/cli/dev/tui/runner.js +2 -2
- package/dist/src/cli/dev/tui/terminal-renderer.d.ts +0 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/development-lazy-prewarm.d.ts +7 -0
- package/dist/src/execution/sandbox/development-lazy-prewarm.js +1 -0
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/session/turn-step.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/internal/application/compiled-artifacts.js +1 -1
- package/dist/src/internal/application/optional-package-install.d.ts +3 -0
- package/dist/src/internal/application/optional-package-install.js +2 -2
- package/dist/src/internal/application/output-publication-lock.d.ts +6 -0
- package/dist/src/internal/application/output-publication-lock.js +1 -1
- package/dist/src/internal/application/output-publication.js +1 -1
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-module-loader.d.ts +1 -0
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/authored-runtime-modules.d.ts +1 -0
- package/dist/src/internal/nitro/development-generation.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.d.ts +9 -0
- package/dist/src/internal/nitro/host/development-runtime-prune-plugin.js +2 -0
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/runtime/cache-key.js +1 -1
- package/dist/src/runtime/sandbox/prepared-artifacts.js +1 -1
- package/dist/src/{cli/commands/registry-pnpm-build-policy.d.ts → setup/primitives/pm/pnpm-build-policy.d.ts} +4 -0
- package/dist/src/setup/primitives/pm/pnpm-build-policy.js +8 -0
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/sandbox-provider.d.ts +2 -0
- package/docs/channels/slack.mdx +1 -1
- package/docs/guides/deployment/vercel.mdx +0 -6
- package/docs/guides/instrumentation/instrumentation.mdx +1 -1
- package/docs/guides/instrumentation/migration.md +1 -6
- package/docs/guides/instrumentation/otel.mdx +15 -47
- package/docs/reference/typescript-api.md +2 -2
- package/docs/sandbox/index.mdx +3 -1
- package/docs/sandbox/just-bash.mdx +6 -0
- package/package.json +1 -1
- package/dist/src/cli/commands/registry-pnpm-build-policy.js +0 -6
- package/dist/src/execution/sandbox/development-prewarm.d.ts +0 -20
- package/dist/src/execution/sandbox/development-prewarm.js +0 -1
|
@@ -6,6 +6,10 @@ export interface PnpmBuildPolicyContext {
|
|
|
6
6
|
}
|
|
7
7
|
/** Applies one explicit pnpm build policy while preserving unrelated workspace settings. */
|
|
8
8
|
export declare function withPnpmBuildPolicy(source: string, packages: readonly string[], action: PnpmBuildPolicyAction): string;
|
|
9
|
+
/** Adds optional-package defaults without replacing the application's explicit decisions. */
|
|
10
|
+
export declare function withPnpmOptionalDependencyDefaults(source: string, packages: readonly string[]): string;
|
|
11
|
+
/** Prepares defaults in the owning workspace before installing an optional engine. */
|
|
12
|
+
export declare function ensurePnpmOptionalDependencyDefaults(appRoot: string, packages: readonly string[]): Promise<void>;
|
|
9
13
|
/** Resolves whether every package already has an explicit non-blocking pnpm policy. */
|
|
10
14
|
export declare function inspectPnpmBuildPolicy(appRoot: string, packages: readonly string[]): Promise<PnpmBuildPolicyContext>;
|
|
11
15
|
/** Persists the policy selected before the registry installation transaction begins. */
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{PNPM_WORKSPACE_PATH,findClaimingAncestorPnpmWorkspaceRoot}from"./pnpm.js";import{access,readFile,writeFile}from"node:fs/promises";import{join}from"node:path";function blockRange(e,t){let n=e.findIndex(e=>RegExp(`^${t}:`).test(e));if(n<0)return;if(!RegExp(`^${t}:\\s*(?:#.*)?$`).test(e[n]??``))throw Error(`Cannot safely update ${t} because it does not use block-style YAML in ${PNPM_WORKSPACE_PATH}.`);let r=n+1;for(;r<e.length&&!/^\S/u.test(e[r]??``);)r+=1;return{start:n,end:r}}function unquoteYamlScalar(e){let t=e.trim();if(t.startsWith(`"`)&&t.endsWith(`"`))try{let e=JSON.parse(t);if(typeof e==`string`)return e}catch{return t}return t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1).replaceAll(`''`,`'`):t}function mappingEntry(e){let t=/^\s+("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^:#][^:]*?):\s*(true|false)\s*(?:#.*)?$/u.exec(e);if(t!==null)return{key:unquoteYamlScalar(t[1]),value:t[2]===`true`}}function sequenceEntry(e){let t=/^\s+-\s+(.*?)(?:\s+#.*)?$/u.exec(e);return t===null?void 0:unquoteYamlScalar(t[1])}function policyEntries(e,t,n){let r=blockRange(e,t),i=new Map;if(r===void 0)return i;for(let t of e.slice(r.start+1,r.end))if(n===`mapping`){let e=mappingEntry(t);e!==void 0&&i.set(e.key,e.value)}else{let e=sequenceEntry(t);e!==void 0&&i.set(e,!0)}return i}function removePolicyEntries(e,t,n,r){let i=blockRange(e,t);if(i===void 0)return;for(let t=i.end-1;t>i.start;--t){let i=n===`mapping`?mappingEntry(e[t]??``)?.key:sequenceEntry(e[t]??``);i!==void 0&&r.has(i)&&e.splice(t,1)}let a=blockRange(e,t);if(a!==void 0&&!e.slice(a.start+1,a.end).some(e=>(n===`mapping`?mappingEntry(e):sequenceEntry(e))!==void 0)){let t=e.slice(a.start+1,a.end).filter(e=>e.trimStart().startsWith(`#`));e.splice(a.start,a.end-a.start,...t)}}function appendPolicyEntries(e,t,n,r){let i=blockRange(e,t);if(i===void 0){for(;e.at(-1)===``;)e.pop();e.length>0&&e.push(``),e.push(`${t}:`),i={start:e.length-1,end:e.length}}let a=policyEntries(e,t,n),o=r.filter(e=>!a.has(e));if(o.length===0)return;let s=o.map(e=>n===`mapping`?` ${JSON.stringify(e)}: true`:` - ${JSON.stringify(e)}`);e.splice(i.end,0,...s)}function withPnpmBuildPolicy(e,t,n){let r=[...new Set(t)].sort(),i=new Set(r),a=e.replace(/\r\n/gu,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`);for(removePolicyEntries(a,`allowBuilds`,`mapping`,i),removePolicyEntries(a,`ignoredOptionalDependencies`,`sequence`,i),n===`allow-builds`?appendPolicyEntries(a,`allowBuilds`,`mapping`,r):appendPolicyEntries(a,`ignoredOptionalDependencies`,`sequence`,r);a.at(-1)===``;)a.pop();return`${a.join(`
|
|
4
|
+
`)}\n`}function withPnpmOptionalDependencyDefaults(e,t){let n=e.replace(/\r\n/gu,`
|
|
5
|
+
`).split(`
|
|
6
|
+
`),r=[policyEntries(n,`allowBuilds`,`mapping`),policyEntries(n,`ignoredOptionalDependencies`,`sequence`),policyEntries(n,`onlyBuiltDependencies`,`sequence`),policyEntries(n,`ignoredBuiltDependencies`,`sequence`)],i=t.filter(e=>!r.some(t=>t.has(e)));return i.length===0?e:withPnpmBuildPolicy(e,i,`ignore-optional`)}async function ensurePnpmOptionalDependencyDefaults(e,t){let n=join(await owningPnpmWorkspaceRoot(e),PNPM_WORKSPACE_PATH),r=await readWorkspacePolicy(n),i=withPnpmOptionalDependencyDefaults(r,t);i!==r&&(await writeFile(n,i,`utf8`),console.info(`[eve:dev] updated optional dependency defaults in "${n}".`))}async function readWorkspacePolicy(e){try{return await readFile(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}}async function owningPnpmWorkspaceRoot(e){try{return await access(join(e,PNPM_WORKSPACE_PATH)),e}catch(e){if(e.code!==`ENOENT`)throw e}return findClaimingAncestorPnpmWorkspaceRoot(e)??e}async function inspectPnpmBuildPolicy(e,t){let n=await owningPnpmWorkspaceRoot(e),r=join(n,PNPM_WORKSPACE_PATH),i=(await readWorkspacePolicy(r)).replace(/\r\n/gu,`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),a=policyEntries(i,`allowBuilds`,`mapping`),o=policyEntries(i,`ignoredOptionalDependencies`,`sequence`);return{filePath:r,packages:t,satisfied:t.every(e=>a.get(e)===!0||o.has(e))}}async function applyPnpmBuildPolicy(e,t){let n=await readWorkspacePolicy(e.filePath);await writeFile(e.filePath,withPnpmBuildPolicy(n,e.packages,t),`utf8`)}export{applyPnpmBuildPolicy,ensurePnpmOptionalDependencyDefaults,inspectPnpmBuildPolicy,withPnpmBuildPolicy,withPnpmOptionalDependencyDefaults};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.105`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.64.
|
|
1
|
+
import{pinnedNodeEngineMajor}from"../../node-engine.js";import{parseChatGptModelSelection}from"../../../shared/chatgpt-model.js";import{SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS}from"../update/module-files.js";import{pathExists,writeTextFile}from"../files.js";import{blockingCreateInPlaceEntries}from"../create-in-place.js";import{DEFAULT_CONNECT_PACKAGE_VERSION,resolveVersionToken}from"../version-tokens.js";import{applyPackageManagerWorkspaceConfiguration,isPackageManagerWorkspaceMember,patchWorkspaceRootPackageJson}from"../workspace-root.js";import{WEB_APP_TEMPLATE_FILES}from"./web-template.js";import{mkdir,readdir,stat}from"node:fs/promises";import{basename,join,resolve}from"node:path";const CURRENT_DIRECTORY_PROJECT_NAME=`.`,DEFAULT_AI_PACKAGE_VERSION=`^7.0.105`,DEFAULT_ZOD_PACKAGE_VERSION=`4.5.4`,DEFAULT_EVE_PACKAGE_CONTRACT={version:`0.64.1`,nodeEngine:`>=24`};function resolveEvePackageContract(e=DEFAULT_EVE_PACKAGE_CONTRACT){return{version:resolveVersionToken(`evePackage.version`,e.version),nodeEngine:resolveVersionToken(`evePackage.nodeEngine`,e.nodeEngine)}}function modelProviderSlug(e){let t=(e.split(`/`)[0]??``).replaceAll(/[^A-Za-z0-9._-]/gu,``);return t.length>0?t:`anthropic`}function byokProviderEnvVar(e){let t=modelProviderSlug(e).toUpperCase().replaceAll(/[^A-Z0-9]/gu,`_`);return`${/^[0-9]/.test(t)?`_`:``}${t}_API_KEY`}function agentTemplateFiles(e,t){return{"agent/agent.ts":renderAgentTemplate(e,t),"agent/channels/eve.ts":WEB_APP_TEMPLATE_FILES[`agent/channels/eve.ts`],"agent/instructions.md":AGENT_INSTRUCTIONS_TEMPLATE}}function renderAgentTemplate(e,t){let n=parseChatGptModelSelection(e);return n===void 0?BASE_AGENT_TEMPLATE.replaceAll(`__EVE_INIT_MODEL__`,e).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t)):`import { defineAgent } from "eve";\nimport { chatgpt } from "eve/models/openai";\n\nexport default defineAgent({\n model: chatgpt(${JSON.stringify(n)}),\n${reasoningTemplateLine(t)}});\n`}function reasoningTemplateLine(e){return e===void 0||e===`provider-default`?``:` reasoning: "${e}",\n`}function renderTemplate(e,t){return e===BASE_AGENT_TEMPLATE&&parseChatGptModelSelection(t.model)!==void 0?renderAgentTemplate(t.model,t.reasoning):e.replaceAll(`__EVE_INIT_APP_NAME__`,t.appName).replaceAll(`__EVE_INIT_MODEL__`,t.model).replaceAll(`__EVE_INIT_REASONING__`,reasoningTemplateLine(t.reasoning)).replaceAll(`__EVE_INIT_BYOK_PROVIDER__`,modelProviderSlug(t.model)).replaceAll(`__EVE_INIT_BYOK_ENV_VAR__`,byokProviderEnvVar(t.model)).replaceAll(`__EVE_INIT_PACKAGE_VERSION__`,formatEveDependencySpecifier(t.eveVersion)).replaceAll(`__EVE_INIT_AI_SDK_VERSION__`,t.aiPackageVersion).replaceAll(`__EVE_INIT_CONNECT_VERSION__`,t.connectPackageVersion).replaceAll(`__EVE_INIT_ZOD_VERSION__`,t.zodPackageVersion).replaceAll(`__EVE_INIT_TYPESCRIPT_VERSION__`,t.typescriptPackageVersion).replaceAll(`__EVE_INIT_TYPES_NODE_VERSION__`,t.nodeTypesVersion).replaceAll(`__EVE_INIT_NODE_ENGINE__`,t.nodeEngine)}function formatEveDependencySpecifier(e){return/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/.test(e)?`^${e}`:e}const BASE_AGENT_TEMPLATE=`import { defineAgent } from "eve";
|
|
2
2
|
|
|
3
3
|
export default defineAgent({
|
|
4
4
|
model: "__EVE_INIT_MODEL__",
|
|
@@ -50,6 +50,8 @@ export interface SandboxProviderHost {
|
|
|
50
50
|
loadOptionalPackage<T>(input: {
|
|
51
51
|
readonly autoInstall: boolean;
|
|
52
52
|
readonly importModule: () => Promise<T>;
|
|
53
|
+
readonly installPackageName?: string;
|
|
54
|
+
readonly ignoredOptionalDependencies?: readonly string[];
|
|
53
55
|
readonly missingMessage: string;
|
|
54
56
|
readonly packageName: string;
|
|
55
57
|
}): Promise<T>;
|
package/docs/channels/slack.mdx
CHANGED
|
@@ -135,7 +135,7 @@ Check the delivery path in order so you can identify where a Slack event stops:
|
|
|
135
135
|
| Mentions work but DMs or thread replies do not | Check the Slack app's Event Subscriptions and OAuth scopes. DMs require `message.im` and `im:history`; channel replies require the matching message event and history scope. | Add the missing events or scopes, then reinstall the Slack app if Slack requires it. |
|
|
136
136
|
| A long response cannot be uploaded as a snippet | Check whether the installed Slack app has the `files:write` bot scope. | Add `files:write`, then reinstall the Slack app so the new scope takes effect. |
|
|
137
137
|
| A preview request receives an authentication page or protection error | Check whether the branch domain is exempt or the direct Slack request URL includes `x-vercel-protection-bypass`. Slack cannot complete an interactive Vercel Authentication challenge. | Add a Deployment Protection Exception for the branch domain, or add the automation bypass query parameter to a Slack app that uses environment-variable credentials. |
|
|
138
|
-
| The webhook reaches the deployment but the agent does not reply | Open the project's Vercel runtime logs
|
|
138
|
+
| The webhook reaches the deployment but the agent does not reply | Open the project's Vercel runtime logs and locate the request for the inbound Slack event. | Use the first missing or failed stage to narrow the issue to channel dispatch, model or tool execution, or outbound Slack delivery. |
|
|
139
139
|
|
|
140
140
|
## Audience
|
|
141
141
|
|
|
@@ -155,12 +155,6 @@ eve dev https://your_agent.vercel.app/eve/support
|
|
|
155
155
|
|
|
156
156
|
Set `VERCEL_AUTOMATION_BYPASS_SECRET` locally before connecting if the deployment uses Deployment Protection.
|
|
157
157
|
|
|
158
|
-
## Inspect agent runs
|
|
159
|
-
|
|
160
|
-
Vercel detects eve and can add an **Agent Runs** tab under the project’s **Observability** view. Use it to browse sessions and inspect each conversation trace.
|
|
161
|
-
|
|
162
|
-
The Agent Runs tab requires enablement for your Vercel team. Contact your Vercel representative if the tab doesn’t appear. For third-party tracing backends, configure [OpenTelemetry instrumentation](../../observability/instrumentation).
|
|
163
|
-
|
|
164
158
|
## Continue configuring production
|
|
165
159
|
|
|
166
160
|
Use these guides to secure and observe the deployed agent:
|
|
@@ -159,6 +159,6 @@ not depend on execution order. Use `flush` to drain buffered records and
|
|
|
159
159
|
## What to read next
|
|
160
160
|
|
|
161
161
|
- [Migrate instrumentation](/docs/observability/instrumentation-migration): replace `agent/instrumentation.ts`.
|
|
162
|
-
- [OpenTelemetry](/docs/observability/otel): configure OTel destinations and
|
|
162
|
+
- [OpenTelemetry](/docs/observability/otel): configure OTel destinations and third-party exports.
|
|
163
163
|
- [Local development](../guides/dev-tui): inspect local traces in the TUI
|
|
164
164
|
- [Hooks](../guides/hooks): react to runtime events outside the instrumentation lifecycle
|
|
@@ -89,9 +89,4 @@ see
|
|
|
89
89
|
Run `eve build`. A remaining `agent/instrumentation.ts` fails the build with a
|
|
90
90
|
message directing you to the instrumentation directory.
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
project needs at least one sampling rule with a rate above 0%; we recommend
|
|
94
|
-
setting the rate to 100%. See
|
|
95
|
-
[Enable tracing on Vercel](/docs/observability/otel#enable-tracing-on-vercel).
|
|
96
|
-
|
|
97
|
-
Then run the agent and verify each destination independently.
|
|
92
|
+
Run the agent and verify each destination independently.
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "OpenTelemetry"
|
|
3
|
-
description: "Configure OpenTelemetry destinations, content capture, and
|
|
3
|
+
description: "Configure OpenTelemetry destinations, content capture, and third-party exports."
|
|
4
4
|
url: "/observability/otel"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
eve
|
|
8
|
-
`
|
|
9
|
-
to Vercel Agent Runs by default. You do not need `otel()` or
|
|
10
|
-
`otelIntegration()` to use these defaults.
|
|
7
|
+
`eve dev` records local traces automatically. You do not need `otel()` or
|
|
8
|
+
`localTraces()` to use this default.
|
|
11
9
|
|
|
12
10
|
## Configure OpenTelemetry
|
|
13
11
|
|
|
@@ -118,11 +116,7 @@ lineage and trace-content policy. See [Remote agents](../guides/remote-agents#pr
|
|
|
118
116
|
Use `gen_ai.conversation.id` to find the traces for one conversation in your
|
|
119
117
|
destination's span-search surface.
|
|
120
118
|
|
|
121
|
-
##
|
|
122
|
-
|
|
123
|
-
Instrumentation has two environment-specific defaults.
|
|
124
|
-
|
|
125
|
-
### Local traces
|
|
119
|
+
## Local traces
|
|
126
120
|
|
|
127
121
|
`eve dev` records local traces by default. Omitting
|
|
128
122
|
`agent/instrumentation/local.ts` preserves that default. Export
|
|
@@ -134,42 +128,16 @@ import { disableInstrumentation } from "eve/instrumentation";
|
|
|
134
128
|
export default disableInstrumentation();
|
|
135
129
|
```
|
|
136
130
|
|
|
137
|
-
### Vercel Agent Runs
|
|
138
|
-
|
|
139
|
-
Preview and production deployments export to Vercel Agent Runs by default.
|
|
140
|
-
Omitting `agent/instrumentation/agent-runs.ts` preserves that default. Export
|
|
141
|
-
`agentRuns(...)` from that file to reconfigure it, or export
|
|
142
|
-
`disableInstrumentation()` to disable it.
|
|
143
|
-
|
|
144
|
-
## Enable tracing on Vercel
|
|
145
|
-
|
|
146
|
-
A deployed eve project needs at least one
|
|
147
|
-
[sampling rule with a rate above 0%](https://vercel.com/docs/tracing/always-on-tracing#enable-always-on-tracing)
|
|
148
|
-
before Vercel collects traces. We recommend setting the rate to **100%** for
|
|
149
|
-
eve projects so every matching request is traced.
|
|
150
|
-
|
|
151
|
-
Select your team and project, then open
|
|
152
|
-
[**Settings → Tracing**](https://vercel.com/d?to=%2F%5Bteam%5D%2F%5Bproject%5D%2Fsettings%2Ftracing&title=Go+to+Tracing+settings):
|
|
153
|
-
|
|
154
|
-
1. Select **Add Sampling Rule**.
|
|
155
|
-
2. Choose **All Environments**, **Production**, or **Preview**.
|
|
156
|
-
3. Set **Rate** to `100%`.
|
|
157
|
-
4. Select **Save**.
|
|
158
|
-
|
|
159
|
-
Tracing starts as soon as you save the rule. You can also manage sampling
|
|
160
|
-
rules with [`vercel traces config`](https://vercel.com/docs/cli/traces#manage-trace-sampling-rules).
|
|
161
|
-
The CLI accepts rates from 1 to 100%; add a 0% rule from the dashboard.
|
|
162
|
-
|
|
163
131
|
## Filter a destination
|
|
164
132
|
|
|
165
|
-
`otelIntegration()
|
|
133
|
+
`otelIntegration()` and `localTraces()` accept one
|
|
166
134
|
`exportPolicy` object or an array applied in order. Each policy filters spans
|
|
167
135
|
and attributes before that destination's processors receive them:
|
|
168
136
|
|
|
169
|
-
```ts title="agent/instrumentation/
|
|
170
|
-
import {
|
|
137
|
+
```ts title="agent/instrumentation/local.ts"
|
|
138
|
+
import { localTraces } from "eve/instrumentation/otel";
|
|
171
139
|
|
|
172
|
-
export default
|
|
140
|
+
export default localTraces({
|
|
173
141
|
exportPolicy: {
|
|
174
142
|
span: ({ name }) => ({ emit: name !== "internal.cache.refresh" }),
|
|
175
143
|
attribute: ({ key }) => (key === "customer.id" ? { emit: false } : { emit: true }),
|
|
@@ -188,17 +156,17 @@ A throwing `span` callback drops the span from this destination. Return
|
|
|
188
156
|
`{ replace: true, value }` from `attribute` to retain, remove, or change
|
|
189
157
|
one attribute.
|
|
190
158
|
|
|
191
|
-
###
|
|
159
|
+
### Redact content from local traces
|
|
192
160
|
|
|
193
|
-
Return a redaction decision to further narrow what
|
|
161
|
+
Return a redaction decision to further narrow what the local trace destination
|
|
194
162
|
receives after the process-wide `otel({ tracePolicy })` has admitted a trace.
|
|
195
|
-
For example, keep
|
|
196
|
-
outputs unless the session is public:
|
|
163
|
+
For example, keep spans in the local trace viewer while redacting their inputs
|
|
164
|
+
and outputs unless the session is public:
|
|
197
165
|
|
|
198
|
-
```ts title="agent/instrumentation/
|
|
199
|
-
import {
|
|
166
|
+
```ts title="agent/instrumentation/local.ts"
|
|
167
|
+
import { localTraces } from "eve/instrumentation/otel";
|
|
200
168
|
|
|
201
|
-
export default
|
|
169
|
+
export default localTraces({
|
|
202
170
|
exportPolicy: {
|
|
203
171
|
span: ({ audience }) =>
|
|
204
172
|
audience === "public" ? { emit: true } : { redact: true, inputs: true, outputs: true },
|
|
@@ -136,9 +136,9 @@ Tool definitions accept `availableInSubagents: false` to restrict the tool to to
|
|
|
136
136
|
| `eve/memory/file` | `fileMemory`, `inMemory`, and the conditional document backend contract |
|
|
137
137
|
| `eve/memory/file/vercel` | `vercelBlob` and Vercel Blob backend options |
|
|
138
138
|
| `eve/context` | `defineState`, session and state types |
|
|
139
|
-
| `eve/sandbox` | `defineSandbox`, provider environments, and sandbox session types
|
|
139
|
+
| `eve/sandbox` | `defineSandbox`, provider environments, and sandbox session types |
|
|
140
140
|
| `eve/instrumentation` | `defineInstrumentation`, `disableInstrumentation`, `isChannel`, lifecycle provider types |
|
|
141
|
-
| `eve/instrumentation/otel` | `otel`, `otelIntegration`, `localTraces`,
|
|
141
|
+
| `eve/instrumentation/otel` | `otel`, `otelIntegration`, `localTraces`, OpenTelemetry policy types |
|
|
142
142
|
| `eve/local-dev` | `getLocalDevCapability`, `LocalDevCapability` |
|
|
143
143
|
| [`eve/models`](../guides/evaluate) | Automatic model selection with `auto` |
|
|
144
144
|
| `eve/models/openai` | `openai`, `chatgpt`, deprecated `experimental_chatgpt` |
|
package/docs/sandbox/index.mdx
CHANGED
|
@@ -80,7 +80,9 @@ export default defineSandbox(() => environment.open());
|
|
|
80
80
|
|
|
81
81
|
eve runs `prepare` while creating a reusable provider artifact, not once for each live session sandbox. Vercel captures a snapshot; Docker captures an image; microsandbox captures a VM snapshot; and just-bash captures a filesystem template.
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
During `eve dev`, startup and authored-source rebuilds do not prepare sandbox environments. The first sandbox access prepares all environments in that compiled generation before opening the requested sandbox. This includes environments declared by subagents and extensions, even if they use different providers. Concurrent requests share the preparation work; a failed preparation can be retried on a later access. Optional provider installation and setup can make that first access slow.
|
|
84
|
+
|
|
85
|
+
`eve build` still prepares environments eagerly. In production, eve passes the recorded artifact directly to the provider when it creates a live sandbox. Production runtime does not rebuild or repair a missing artifact. A missing image, snapshot, or template fails with rebuild or redeploy guidance.
|
|
84
86
|
|
|
85
87
|
### Reuse native resources across sessions
|
|
86
88
|
|
|
@@ -15,4 +15,10 @@ export default defineSandbox(() => environment.open());
|
|
|
15
15
|
|
|
16
16
|
just-bash can prepare and persist its virtual filesystem. It cannot use OCI images or Dockerfiles, does not run native processes, and provides no network isolation. The session does not expose `setNetworkPolicy()`.
|
|
17
17
|
|
|
18
|
+
## Automatic installation
|
|
19
|
+
|
|
20
|
+
When an environment uses just-bash during `eve dev`, eve installs the package into your application if it is missing, unless you set `autoInstall: false` in the environment options. `DefaultSandbox` selects only one provider, but another environment, such as local self-modification, can use just-bash independently. Other environments require you to install the package yourself.
|
|
21
|
+
|
|
22
|
+
For pnpm projects, automatic installation adds `@mongodb-js/zstd` and `node-liblzma` to `ignoredOptionalDependencies` in the owning `pnpm-workspace.yaml` when they have no explicit package policy. These optional native codecs are not needed for basic shell and filesystem operations. Commands that require those codecs may be unavailable without them. eve preserves existing package-specific build decisions and does not automatically approve build scripts.
|
|
23
|
+
|
|
18
24
|
See the [sandbox overview](/docs/sandbox) for managed workspace, skills, parent inheritance, and custom providers.
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{access,readFile,writeFile}from"node:fs/promises";import{join}from"node:path";import{PNPM_WORKSPACE_PATH,findClaimingAncestorPnpmWorkspaceRoot}from"#setup/primitives/pm/pnpm.js";function blockRange(e,t){let n=e.findIndex(e=>RegExp(`^${t}:`).test(e));if(n<0)return;if(!RegExp(`^${t}:\\s*(?:#.*)?$`).test(e[n]??``))throw Error(`Cannot safely update ${t} because it does not use block-style YAML in ${PNPM_WORKSPACE_PATH}.`);let r=n+1;for(;r<e.length&&!/^\S/u.test(e[r]??``);)r+=1;return{start:n,end:r}}function unquoteYamlScalar(e){let t=e.trim();if(t.startsWith(`"`)&&t.endsWith(`"`))try{let e=JSON.parse(t);if(typeof e==`string`)return e}catch{return t}return t.startsWith(`'`)&&t.endsWith(`'`)?t.slice(1,-1).replaceAll(`''`,`'`):t}function mappingEntry(e){let t=/^\s+("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^:#][^:]*?):\s*(true|false)\s*(?:#.*)?$/u.exec(e);if(t!==null)return{key:unquoteYamlScalar(t[1]),value:t[2]===`true`}}function sequenceEntry(e){let t=/^\s+-\s+(.*?)(?:\s+#.*)?$/u.exec(e);return t===null?void 0:unquoteYamlScalar(t[1])}function policyEntries(e,t,n){let r=blockRange(e,t),i=new Map;if(r===void 0)return i;for(let t of e.slice(r.start+1,r.end))if(n===`mapping`){let e=mappingEntry(t);e!==void 0&&i.set(e.key,e.value)}else{let e=sequenceEntry(t);e!==void 0&&i.set(e,!0)}return i}function removePolicyEntries(e,t,n,r){let i=blockRange(e,t);if(i===void 0)return;for(let t=i.end-1;t>i.start;--t){let i=n===`mapping`?mappingEntry(e[t]??``)?.key:sequenceEntry(e[t]??``);i!==void 0&&r.has(i)&&e.splice(t,1)}let a=blockRange(e,t);if(a!==void 0&&!e.slice(a.start+1,a.end).some(e=>(n===`mapping`?mappingEntry(e):sequenceEntry(e))!==void 0)){let t=e.slice(a.start+1,a.end).filter(e=>e.trimStart().startsWith(`#`));e.splice(a.start,a.end-a.start,...t)}}function appendPolicyEntries(e,t,n,r){let i=blockRange(e,t);if(i===void 0){for(;e.at(-1)===``;)e.pop();e.length>0&&e.push(``),e.push(`${t}:`),i={start:e.length-1,end:e.length}}let a=policyEntries(e,t,n),o=r.filter(e=>!a.has(e));if(o.length===0)return;let s=o.map(e=>n===`mapping`?` ${JSON.stringify(e)}: true`:` - ${JSON.stringify(e)}`);e.splice(i.end,0,...s)}function withPnpmBuildPolicy(e,t,n){let r=[...new Set(t)].sort(),i=new Set(r),a=e.replace(/\r\n/gu,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`);for(removePolicyEntries(a,`allowBuilds`,`mapping`,i),removePolicyEntries(a,`ignoredOptionalDependencies`,`sequence`,i),n===`allow-builds`?appendPolicyEntries(a,`allowBuilds`,`mapping`,r):appendPolicyEntries(a,`ignoredOptionalDependencies`,`sequence`,r);a.at(-1)===``;)a.pop();return`${a.join(`
|
|
4
|
-
`)}\n`}async function readWorkspacePolicy(e){try{return await readFile(e,`utf8`)}catch(e){if(e.code===`ENOENT`)return``;throw e}}async function owningPnpmWorkspaceRoot(e){try{return await access(join(e,PNPM_WORKSPACE_PATH)),e}catch(e){if(e.code!==`ENOENT`)throw e}return findClaimingAncestorPnpmWorkspaceRoot(e)??e}async function inspectPnpmBuildPolicy(e,t){let n=await owningPnpmWorkspaceRoot(e),r=join(n,PNPM_WORKSPACE_PATH),i=(await readWorkspacePolicy(r)).replace(/\r\n/gu,`
|
|
5
|
-
`).split(`
|
|
6
|
-
`),a=policyEntries(i,`allowBuilds`,`mapping`),o=policyEntries(i,`ignoredOptionalDependencies`,`sequence`);return{filePath:r,packages:t,satisfied:t.every(e=>a.get(e)===!0||o.has(e))}}async function applyPnpmBuildPolicy(e,t){let n=await readWorkspacePolicy(e.filePath);await writeFile(e.filePath,withPnpmBuildPolicy(n,e.packages,t),`utf8`)}export{applyPnpmBuildPolicy,inspectPnpmBuildPolicy,withPnpmBuildPolicy};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";
|
|
2
|
-
export declare function prewarmDevelopmentSandboxes(input: {
|
|
3
|
-
readonly appRoot: string;
|
|
4
|
-
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
5
|
-
readonly log?: (message: string) => void;
|
|
6
|
-
}): Promise<void>;
|
|
7
|
-
export declare function startDevelopmentSandboxPrewarmInBackground(input: {
|
|
8
|
-
readonly appRoot: string;
|
|
9
|
-
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
10
|
-
readonly log?: (message: string) => void;
|
|
11
|
-
}): void;
|
|
12
|
-
export declare function subscribeDevelopmentSandboxPrewarmLogs(input: {
|
|
13
|
-
readonly appRoot: string;
|
|
14
|
-
readonly log: (message: string) => void;
|
|
15
|
-
}): () => void;
|
|
16
|
-
export declare function waitForDevelopmentSandboxPrewarm(input: {
|
|
17
|
-
readonly appRoot: string;
|
|
18
|
-
readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;
|
|
19
|
-
readonly log?: (message: string) => void;
|
|
20
|
-
}): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{prewarmAppSandboxes}from"./prewarm.js";import{toErrorMessage}from"#shared/errors.js";import{getRuntimeCompiledArtifactsAppRoot,getRuntimeCompiledArtifactsSandboxAppRoot}from"#runtime/compiled-artifacts-source.js";const pendingDevelopmentPrewarms=new Map,retainedDevelopmentPrewarmLogs=new Map;async function prewarmDevelopmentSandboxes(e){startDevelopmentSandboxPrewarmInBackground(e),await waitForDevelopmentSandboxPrewarm(e)}function startDevelopmentSandboxPrewarmInBackground(e){let t=resolvePrewarmKeys(e),n=findPendingPrewarm(t);if(n!==void 0){registerPrewarmAliases(t,n);return}let r={logs:[],promise:Promise.resolve(),subscribers:new Set};for(let e of t)retainedDevelopmentPrewarmLogs.delete(e);let i=prewarmAppSandboxes({appRoot:e.appRoot,compiledArtifactsSource:e.compiledArtifactsSource,log:t=>recordPrewarmLog(r,t,e.log)});r.promise=i,registerPrewarmAliases(t,r),i.catch(t=>{recordPrewarmLog(r,`eve: failed to initialize sandbox templates in the background: ${toErrorMessage(t)}`,e.log)}).finally(()=>{for(let e of t)pendingDevelopmentPrewarms.get(e)===r&&pendingDevelopmentPrewarms.delete(e),r.subscribers.size===0&&r.logs.length>0&&retainedDevelopmentPrewarmLogs.set(e,[...r.logs])})}function subscribeDevelopmentSandboxPrewarmLogs(e){let t=findPendingPrewarm([e.appRoot]);if(t!==void 0){for(let n of t.logs)e.log(n);return t.subscribers.add(e.log),()=>t.subscribers.delete(e.log)}let n=retainedDevelopmentPrewarmLogs.get(e.appRoot);if(n===void 0)return()=>{};retainedDevelopmentPrewarmLogs.delete(e.appRoot);for(let t of n)e.log(t);return()=>{}}async function waitForDevelopmentSandboxPrewarm(e){let t=findPendingPrewarm(resolvePrewarmKeys(e));if(t===void 0)return;let unsubscribe;if(e.log!==void 0){for(let n of t.logs)e.log(n);let subscriber=t=>e.log?.(t);t.subscribers.add(subscriber),unsubscribe=()=>t.subscribers.delete(subscriber)}try{await withProgressHeartbeat(`waiting for background sandbox template prewarm`,e.log,()=>t.promise)}finally{unsubscribe?.()}}function resolvePrewarmKeys(e){let t=new Set([e.appRoot]),n=getRuntimeCompiledArtifactsAppRoot(e.compiledArtifactsSource);n!==void 0&&t.add(n);let r=getRuntimeCompiledArtifactsSandboxAppRoot(e.compiledArtifactsSource);return r!==void 0&&t.add(r),[...t]}function findPendingPrewarm(e){for(let t of e){let e=pendingDevelopmentPrewarms.get(t);if(e!==void 0)return e}}function registerPrewarmAliases(e,t){for(let n of e)pendingDevelopmentPrewarms.set(n,t)}function recordPrewarmLog(e,t,n){e.logs.push(t),e.logs.length>50&&e.logs.splice(0,e.logs.length-50),n?.(t);for(let n of e.subscribers)n(t)}async function withProgressHeartbeat(e,t,n){if(t===void 0)return await n();let r=Date.now(),i=setInterval(()=>{t(`${e} (${Math.round((Date.now()-r)/1e3)}s elapsed)`)},1e4);i.unref?.();try{return await n()}finally{clearInterval(i)}}export{prewarmDevelopmentSandboxes,startDevelopmentSandboxPrewarmInBackground,subscribeDevelopmentSandboxPrewarmLogs,waitForDevelopmentSandboxPrewarm};
|