The Open Framework for Building Agents
test: act on test audit decisions and remove remaining dead code (#3869)
Andrew Barba03d1f42101f9
diff --git a/.changeset/move-test-helpers-out-of-runtime.md b/.changeset/move-test-helpers-out-of-runtime.mdnew file mode 100644index 000000000..7dcdaf0fa--- /dev/null+++ b/.changeset/move-test-helpers-out-of-runtime.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Internal cleanup: helpers that only tests used are moved out of the published runtime or removed, and internal modules no longer export symbols used only in their own file. There is no user-visible change.diff --git a/.changeset/quiet-cancelled-tool-log.md b/.changeset/quiet-cancelled-tool-log.mdnew file mode 100644index 000000000..5c41c8e50--- /dev/null+++ b/.changeset/quiet-cancelled-tool-log.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Cancelling a turn no longer logs "tool execution failed" at error level for the tool that was running. Real tool failures are still logged.diff --git a/.changeset/remove-more-dead-internals.md b/.changeset/remove-more-dead-internals.mdnew file mode 100644index 000000000..bcdc7c8b8--- /dev/null+++ b/.changeset/remove-more-dead-internals.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Remove more unused internal modules and helpers from the `eve` package. This is internal cleanup with no user-visible behavior change.diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 7b6709ce8..9f9991ad9 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -159,7 +159,8 @@ jobs:- name: Run scenario testsrun: pnpm test:scenario- test-templates:+ test-framework-fixtures:+ name: test-framework-fixtures (next, nuxt, sveltekit)runs-on: ubuntu-lateststeps:@@ -180,13 +181,14 @@ jobs:- name: Install dependenciesrun: pnpm install --frozen-lockfile- - name: Check templates against the packed eve package- run: pnpm check:templates+ - name: Build workspace packages+ run: pnpm build- test-tui:+ - name: Build framework fixtures against the workspace eve dist+ run: pnpm test:framework-fixtures++ test-templates:runs-on: ubuntu-latest- env:- AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}steps:- name: Checkout code@@ -206,13 +208,13 @@ jobs:- name: Install dependenciesrun: pnpm install --frozen-lockfile- - name: Run TUI smoke tests- run: pnpm test:tui+ - name: Check templates against the packed eve package+ run: pnpm check:templates- test-dev-windows:- runs-on: windows-latest- # Temporarily disabled: consistently failing in CI and not currently debuggable.- if: false+ test-tui:+ runs-on: ubuntu-latest+ env:+ AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}steps:- name: Checkout code@@ -232,7 +234,5 @@ jobs:- name: Install dependenciesrun: pnpm install --frozen-lockfile- - name: Run eve dev scenario- run: |- $env:Path = "$env:PNPM_HOME;$env:Path"- pnpm --dir packages/eve exec vitest run --config vitest.dev-server.config.ts+ - name: Run TUI smoke tests+ run: pnpm test:tuidiff --git a/AGENTS.md b/AGENTS.mdindex 25903d5ee..3d2a1cb25 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -58,6 +58,7 @@ pnpm test # unit + integrationpnpm test:unit # unit tests (<3s)pnpm test:integration # integration tests (<10s)pnpm test:scenario # scenario tests (2–5 min; requires pnpm build first)+pnpm test:framework-fixtures # apps/frameworks smoke builds (requires pnpm build first)pnpm test:e2e # fixture-owned eve eval suites (CI only)pnpm test:tui # TUI smoke scripts (not e2e)```diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 044c1b2ad..f06d7fbe2 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -57,6 +57,7 @@ pnpm test # unit + integrationpnpm test:unit # unit testspnpm test:integration # integration testspnpm test:scenario # scenario tests (requires pnpm build first)+pnpm test:framework-fixtures # apps/frameworks smoke builds (requires pnpm build first)pnpm test:e2e # fixture-owned eve eval suitespnpm test:tui # TUI smoke scripts (not e2e)```diff --git a/apps/docs/app/(nights)/nights/rasterize-svg-to-texture.ts b/apps/docs/app/(nights)/nights/rasterize-svg-to-texture.tsindex cae221e72..a8f8968bc 100644--- a/apps/docs/app/(nights)/nights/rasterize-svg-to-texture.ts+++ b/apps/docs/app/(nights)/nights/rasterize-svg-to-texture.ts@@ -1,6 +1,6 @@import * as THREE from "three/webgpu";-export type RasterizedSvg = {+type RasterizedSvg = {texture: THREE.DataTexture;pixels: Uint8Array;size: number;diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/fallback-image.tsx b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/fallback-image.tsxindex b1fc6acd1..006b501a7 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/fallback-image.tsx+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/fallback-image.tsx@@ -8,12 +8,12 @@ import { BLOOM_RADIUS } from "./render";// INVARIANT: CSS padding mirrors the animated canvas bloom padding.// Imported only by index.tsx.-export const FALLBACK_IMAGE_WIDTH = 1095;-export const FALLBACK_IMAGE_HEIGHT = 348;-export const FALLBACK_IMAGE_ASPECT_RATIO = `${FALLBACK_IMAGE_WIDTH} / ${FALLBACK_IMAGE_HEIGHT}`;+const FALLBACK_IMAGE_WIDTH = 1095;+const FALLBACK_IMAGE_HEIGHT = 348;+const FALLBACK_IMAGE_ASPECT_RATIO = `${FALLBACK_IMAGE_WIDTH} / ${FALLBACK_IMAGE_HEIGHT}`;export const FALLBACK_CONTAINER_ASPECT_RATIO = `${FALLBACK_IMAGE_WIDTH + BLOOM_RADIUS} / ${FALLBACK_IMAGE_HEIGHT + BLOOM_RADIUS}`;-export const FALLBACK_IMAGE_SIZES = "(min-width: 768px) 1095px, calc(100vw - 16px)";-export const FALLBACK_IMAGE_PADDING = BLOOM_RADIUS / 2;+const FALLBACK_IMAGE_SIZES = "(min-width: 768px) 1095px, calc(100vw - 16px)";+const FALLBACK_IMAGE_PADDING = BLOOM_RADIUS / 2;const fallbackImageOptions = {alt: "",diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/hooks.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/hooks.tsindex ce0121d07..d1b9f5bf7 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/hooks.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/hooks.ts@@ -5,7 +5,7 @@ import { useEffect, useState } from "react";// INVARIANT: resolution order matches the old index.tsx hooks exactly.// Imported only by index.tsx.-export function getCurrentTheme(prefersDarkTheme: boolean): "light" | "dark" {+function getCurrentTheme(prefersDarkTheme: boolean): "light" | "dark" {if (typeof document === "undefined") return "light";const root = document.documentElement;if (root.classList.contains("dark") || root.dataset.theme === "dark") return "dark";diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/mobile-motion.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/mobile-motion.tsindex 92d1069b5..9415562b0 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/mobile-motion.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/mobile-motion.ts@@ -1,6 +1,6 @@export const MOBILE_AUTO_ROTATE_SPEED = 0.15;-export type EvePointerInteractionMode = {+type EvePointerInteractionMode = {paintEnabled: boolean;autoRotateEnvYaw: boolean;};diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/camera.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/camera.tsindex d3ff405c0..a31041d60 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/camera.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/camera.ts@@ -71,7 +71,7 @@ export function cameraAxisDepthRange(bounds: Bounds, forward: Vec3) {return { min: minDepth, max: maxDepth };}-export function normalizePositionForGpu(position: Vec3, bounds: Bounds): Vec3 {+function normalizePositionForGpu(position: Vec3, bounds: Bounds): Vec3 {const height = bounds.max[1] - bounds.min[1] || 1;const centerX = (bounds.min[0] + bounds.max[0]) * 0.5;const centerY = (bounds.min[1] + bounds.max[1]) * 0.5;diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/constants.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/constants.tsindex 6aaa9994e..ee90f05cf 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/constants.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/constants.ts@@ -14,7 +14,7 @@ export const CUBE_FACE_COUNT = 6;export const CUBE_FORMAT: GPUTextureFormat = "rgba16float";export const BLOOM_RADIUS = 16;export const SCENE_FORMAT: GPUTextureFormat = "rgba16float";-export const BLOOM_STRENGTH = 0.85;+const BLOOM_STRENGTH = 0.85;export const BLOOM_STRENGTH_OFF = BLOOM_STRENGTH;export const BLOOM_STRENGTH_ON = BLOOM_STRENGTH_OFF * 0.25;export const BLOOM_THRESHOLD = 0;@@ -43,7 +43,7 @@ export const EVE_THICKNESS_SCALE_MULTIPLIER = 1.3;export const PREVIEW_BACK_ALBEDO = 0;export const PREVIEW_BACK_DEPTH = 1;export const DEFAULT_IMPRINT_CELL_SIZE = 16;-export const REFERENCE_IMPRINT_LOGICAL_HEIGHT = 348;+const REFERENCE_IMPRINT_LOGICAL_HEIGHT = 348;export const DEFAULT_IMPRINT_DEVICE_PIXEL_RATIO = 2;export const DEFAULT_IMPRINT_GRID_SCALE_MULTIPLIER = 0.71;export const DEFAULT_IMPRINT_GLYPH_SCALE = 1.35;diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/cubemap.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/cubemap.tsindex e576f2655..f262f14a3 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/cubemap.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/cubemap.ts@@ -92,11 +92,7 @@ export function renderStudioCubemap(}}-export function cubeParamsData(- face: number,- lights: readonly EnvLightConfig[],- globalIntensity: number,-) {+function cubeParamsData(face: number, lights: readonly EnvLightConfig[], globalIntensity: number) {if (lights.length > CUBE_MAX_LIGHTS) {throw new Error(`Studio cubemap supports up to ${CUBE_MAX_LIGHTS} lights, received ${lights.length}`,@@ -125,11 +121,11 @@ export function cubeParamsData(return data;}-export function lightColorLinear(light: EnvLightConfig): Vec3 {+function lightColorLinear(light: EnvLightConfig): Vec3 {return srgbHexToLinear(light.color);}-export function srgbHexToLinear(hex: string): Vec3 {+function srgbHexToLinear(hex: string): Vec3 {const normalized = hex.replace(/^#/, "");if (!/^[0-9a-fA-F]{6}$/.test(normalized)) {throw new Error(`Expected a 6-digit sRGB hex color, received ${hex}`);diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/textures.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/textures.tsindex 6c234a80a..f7d73b28c 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/textures.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/render/textures.ts@@ -108,7 +108,7 @@ export function uploadStaticNoiseTexture();}-export function hashPaintCell(x: number, y: number, salt: number) {+function hashPaintCell(x: number, y: number, salt: number) {let h = (Math.imul(x >>> 0, 0x8da6b343) ^ Math.imul(y >>> 0, 0xd8163841) ^ salt) >>> 0;h = (h ^ (h >>> 13)) >>> 0;h = Math.imul(h, 0x85ebca6b) >>> 0;diff --git a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/runtime/frame-loop.ts b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/runtime/frame-loop.tsindex b5f1814ff..93416020a 100644--- a/apps/docs/app/[lang]/(home)/components/eve-logo-shader/runtime/frame-loop.ts+++ b/apps/docs/app/[lang]/(home)/components/eve-logo-shader/runtime/frame-loop.ts@@ -16,7 +16,7 @@ import type { ControlsRef, HeroRuntimeState } from "./state";// Imported only by index.tsx's single effect and driven by phase's useLoop.const ENV_YAW_LERP_SPEED = 3;-export const AGENTS_ENV_YAW_LERP_SPEED = 3;+const AGENTS_ENV_YAW_LERP_SPEED = 3;const AGENTS_ENV_YAW_OFFSET = -Math.PI * 0.1;const ASCII_MOUSE_LERP_SPEED = 6;const PAINT_MOVEMENT_GRACE_MS = 72;diff --git a/apps/docs/app/[lang]/(home)/components/file-tree-view.tsx b/apps/docs/app/[lang]/(home)/components/file-tree-view.tsxindex bcaa13e0b..4103e0b34 100644--- a/apps/docs/app/[lang]/(home)/components/file-tree-view.tsx+++ b/apps/docs/app/[lang]/(home)/components/file-tree-view.tsx@@ -3,7 +3,7 @@import { type ReactNode, useState } from "react";import { cn } from "@/lib/utils";-export interface FileTreeItem {+interface FileTreeItem {/** Category name (unused by this layout). */label: string;/** File/folder name shown in the IDE file tree. */diff --git a/apps/docs/app/[lang]/(home)/components/metal-shader.tsx b/apps/docs/app/[lang]/(home)/components/metal-shader.tsxdeleted file mode 100644index 39030ab96..000000000--- a/apps/docs/app/[lang]/(home)/components/metal-shader.tsx+++ /dev/null@@ -1,542 +0,0 @@-"use client";--import { useCallback, useEffect, useRef, useState } from "react";-import { cn } from "@/lib/utils";--const EVE_MARK_PATH =- "M600.491 30.1025H417.913L290.411 188.43H250L282.329 148.17L401.541 0H600.491V30.1025ZM162.992 188.351H0V158.248H162.992V188.351ZM600.491 158.248V188.351H437.5V158.248H600.491ZM137.363 108.609H0V78.5068H137.363V108.609ZM600.491 108.609H463.129V78.5068H600.491V108.609ZM250.001 30.1025H0V0H250.001V30.1025Z";-const EVE_MARK_WIDTH = 601;-const EVE_MARK_HEIGHT = 189;--interface MetalConfig {- roughness: number;- specular: number;- fresnel: number;- flowSpeed: number;- distortion: number;- tint: number;- brushAngle: number;- tonemap: number;-}--const DEFAULT_CONFIG: MetalConfig = {- roughness: 0.1,- specular: 1.5,- fresnel: 0.8,- flowSpeed: 0.6,- distortion: 0.5,- tint: 0.15,- brushAngle: 0,- tonemap: 0.6,-};--const HERO_CONFIG: MetalConfig = {- roughness: 0.12,- specular: 1.35,- fresnel: 0.78,- flowSpeed: 0.38,- distortion: 0.42,- tint: 0.18,- brushAngle: 0.32,- tonemap: 0.72,-};-const HERO_MARK_SCALE = 0.97;--type MetalShaderProps = {- className?: string;- config?: MetalConfig;- svgScale?: number;- svgPath?: string;- svgWidth?: number;- svgHeight?: number;-};--function getLogoTransform(- width: number,- height: number,- svgScale: number,- svgWidth: number,- svgHeight: number,-) {- const scale = Math.min(width / svgWidth, height / svgHeight) * svgScale;- return {- scale,- offsetX: (width - svgWidth * scale) / 2,- offsetY: (height - svgHeight * scale) / 2,- };-}--function getCurrentTheme(): "light" | "dark" {- if (typeof document === "undefined") return "light";- const root = document.documentElement;- if (root.classList.contains("dark") || root.dataset.theme === "dark") return "dark";- if (root.classList.contains("light") || root.dataset.theme === "light") return "light";- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";-}--function useResolvedTheme() {- const [theme, setTheme] = useState<"light" | "dark">("light");-- useEffect(() => {- const syncTheme = () => setTheme(getCurrentTheme());- const media = window.matchMedia("(prefers-color-scheme: dark)");- const observer = new MutationObserver(syncTheme);-- syncTheme();- observer.observe(document.documentElement, {- attributes: true,- attributeFilter: ["class", "data-theme"],- });- media.addEventListener("change", syncTheme);-- return () => {- observer.disconnect();- media.removeEventListener("change", syncTheme);- };- }, []);-- return theme;-}--export function MetalShader({- className,- config = DEFAULT_CONFIG,- svgScale = 0.92,- svgPath = EVE_MARK_PATH,- svgWidth = EVE_MARK_WIDTH,- svgHeight = EVE_MARK_HEIGHT,-}: MetalShaderProps) {- const theme = useResolvedTheme();- const canvasRef = useRef<HTMLCanvasElement>(null);- const rafRef = useRef<number>(0);- const configRef = useRef(config);- const svgScaleRef = useRef(svgScale);- const mouseRef = useRef({ x: 0, y: 0 });- const shadeCanvasRef = useRef<HTMLCanvasElement | null>(null);- const maskCanvasRef = useRef<HTMLCanvasElement | null>(null);- const envDataRef = useRef<Uint8ClampedArray | null>(null);- const maskPixelsRef = useRef<Uint8ClampedArray | null>(null);- const blurPixelsRef = useRef<Uint8ClampedArray | null>(null);- const sizeRef = useRef({ w: 0, h: 0, dpr: 1, renderScale: 1 });- const needsRebuildRef = useRef(true);- const themeRef = useRef(theme);- const svgPathRef = useRef(svgPath);- const svgWidthRef = useRef(svgWidth);- const svgHeightRef = useRef(svgHeight);- const startTimeRef = useRef<number | null>(null);- const glowColorRef = useRef("currentColor");-- configRef.current = config;- svgScaleRef.current = svgScale;- themeRef.current = theme;- svgPathRef.current = svgPath;- svgWidthRef.current = svgWidth;- svgHeightRef.current = svgHeight;-- const buildEnvMap = useCallback(() => {- const size = 1024;- const data = new Uint8ClampedArray(size * 4);- for (let i = 0; i < size; i++) {- const t = i / size;- let v = 25;- v += 230 * Math.exp(-((t - 0.48) * (t - 0.48)) / 0.003);- v += 140 * Math.exp(-((t - 0.2) * (t - 0.2)) / 0.004);- v += 160 * Math.exp(-((t - 0.72) * (t - 0.72)) / 0.005);- v += 40 * Math.exp(-((t - 0.35) * (t - 0.35)) / 0.02);- v += 35 * Math.exp(-((t - 0.6) * (t - 0.6)) / 0.015);- v += 60 * Math.exp(-((t - 0.05) * (t - 0.05)) / 0.003);- v += 55 * Math.exp(-((t - 0.9) * (t - 0.9)) / 0.004);- const c = Math.min(255, v | 0);- const idx = i * 4;- data[idx] = c;- data[idx + 1] = c;- data[idx + 2] = c;- data[idx + 3] = 255;- }- envDataRef.current = data;- }, []);-- const buildMask = useCallback(() => {- const { w, h, renderScale } = sizeRef.current;- const sw = Math.round(w * renderScale);- const sh = Math.round(h * renderScale);- if (w === 0 || h === 0) return;-- if (!maskCanvasRef.current) maskCanvasRef.current = document.createElement("canvas");- const maskCanvas = maskCanvasRef.current;- maskCanvas.width = sw;- maskCanvas.height = sh;-- const { scale, offsetX, offsetY } = getLogoTransform(- w,- h,- svgScaleRef.current,- svgWidthRef.current,- svgHeightRef.current,- );- const path = new Path2D(svgPathRef.current);- const maskContext = maskCanvas.getContext("2d", { willReadFrequently: true });- if (!maskContext) return;-- maskContext.fillStyle = "#000";- maskContext.fillRect(0, 0, sw, sh);- maskContext.save();- maskContext.translate(offsetX * renderScale, offsetY * renderScale);- maskContext.scale(scale * renderScale, scale * renderScale);- maskContext.fillStyle = "#fff";- maskContext.fill(path);- maskContext.restore();- maskPixelsRef.current = maskContext.getImageData(0, 0, sw, sh).data;-- const blurCanvas = document.createElement("canvas");- blurCanvas.width = sw;- blurCanvas.height = sh;- const blurContext = blurCanvas.getContext("2d", { willReadFrequently: true });- if (!blurContext) return;-- blurContext.filter = `blur(${Math.round(5 * renderScale)}px)`;- blurContext.drawImage(maskCanvas, 0, 0);- blurPixelsRef.current = blurContext.getImageData(0, 0, sw, sh).data;- needsRebuildRef.current = false;- }, []);-- const init = useCallback(() => {- const canvas = canvasRef.current;- if (!canvas) return;-- const rect = canvas.getBoundingClientRect();- const w = Math.max(1, Math.round(rect.width));- const h = Math.max(1, Math.round(rect.height));- const dpr = window.devicePixelRatio || 1;- const renderScale = Math.min(dpr, 1.35);-- canvas.width = Math.round(w * dpr);- canvas.height = Math.round(h * dpr);- sizeRef.current = { w, h, dpr, renderScale };- mouseRef.current = { x: w * 0.58, y: h * 0.35 };- needsRebuildRef.current = true;- startTimeRef.current = null;- glowColorRef.current = getComputedStyle(canvas).color;-- const sw = Math.round(w * renderScale);- const sh = Math.round(h * renderScale);- if (!shadeCanvasRef.current) shadeCanvasRef.current = document.createElement("canvas");- shadeCanvasRef.current.width = sw;- shadeCanvasRef.current.height = sh;-- if (!envDataRef.current) buildEnvMap();- }, [buildEnvMap]);-- useEffect(() => {- const canvas = canvasRef.current;- if (!canvas) return;-- init();- const observer = new ResizeObserver(init);- observer.observe(canvas);- window.addEventListener("resize", init);-- return () => {- observer.disconnect();- window.removeEventListener("resize", init);- };- }, [init]);-- useEffect(() => {- const canvas = canvasRef.current;- if (!canvas) return;-- const onPointerMove = (event: PointerEvent) => {- const rect = canvas.getBoundingClientRect();- mouseRef.current = { x: event.clientX - rect.left, y: event.clientY - rect.top };- };-- canvas.addEventListener("pointermove", onPointerMove, { passive: true });- return () => canvas.removeEventListener("pointermove", onPointerMove);- }, []);-- useEffect(() => {- const canvas = canvasRef.current;- if (!canvas) return;- const ctx = canvas.getContext("2d", { alpha: true });- if (!ctx) return;-- let outImg: ImageData | null = null;- let lastSw = 0;- let lastSh = 0;- const tonemapLUT = new Uint8Array(256);- let lastTonemap = -1;- let glowPath: Path2D | null = null;- let lastGlowSvg = "";- let lastBrushAngle = -999;- let brushCos = 1;- let brushSin = 0;-- const animate = (timestamp: number) => {- if (startTimeRef.current === null) startTimeRef.current = timestamp;- const introElapsed = (timestamp - startTimeRef.current) * 0.001;- const introDuration = 1.0;-- if (needsRebuildRef.current) buildMask();-- const cfg = configRef.current;- const { w, h, dpr, renderScale } = sizeRef.current;- const time = timestamp * 0.001;- const mouse = mouseRef.current;- const envData = envDataRef.current;- const mask = maskPixelsRef.current;- const blur = blurPixelsRef.current;- const shadeCanvas = shadeCanvasRef.current;-- if (!envData || !mask || !blur || !shadeCanvas || w === 0 || h === 0) {- rafRef.current = requestAnimationFrame(animate);- return;- }-- const sw = Math.round(w * renderScale);- const sh = Math.round(h * renderScale);- const shadeContext = shadeCanvas.getContext("2d", { willReadFrequently: true });- if (!shadeContext) {- rafRef.current = requestAnimationFrame(animate);- return;- }-- if (!outImg || sw !== lastSw || sh !== lastSh) {- outImg = shadeContext.createImageData(sw, sh);- lastSw = sw;- lastSh = sh;- }-- const out = outImg.data;- out.fill(0);-- const stride = sw * 4;- const envLen = 1024;- if (cfg.tonemap !== lastTonemap) {- lastTonemap = cfg.tonemap;- if (cfg.tonemap === 1) {- for (let i = 0; i < 256; i++) tonemapLUT[i] = i;- } else {- const invTone = 1 / cfg.tonemap;- for (let i = 0; i < 256; i++) {- tonemapLUT[i] = (255 * Math.pow(i / 255, invTone)) | 0;- }- }- }-- if (cfg.brushAngle !== lastBrushAngle) {- lastBrushAngle = cfg.brushAngle;- brushCos = Math.cos(cfg.brushAngle);- brushSin = Math.sin(cfg.brushAngle);- }-- const mx = mouse.x / w;- const my = mouse.y / h;- const t13 = time * cfg.flowSpeed * 1.3;- const t09 = time * cfg.flowSpeed * 0.9;- const t05 = time * cfg.flowSpeed * 0.5;- const t18 = time * cfg.flowSpeed * 1.8;- const tEnv = time * cfg.flowSpeed * 0.03;- const invSw = 1 / sw;- const invSh = 1 / sh;- const isLight = themeRef.current === "light";-- for (let y = 1; y < sh - 1; y++) {- const yOff = y * stride;- const py = y * invSh;-- for (let x = 1; x < sw - 1; x++) {- const idx = yOff + x * 4;- if (mask[idx] < 128) continue;-- const left = blur[idx - 4];- const right = blur[idx + 4];- const up = blur[idx - stride];- const down = blur[idx + stride];- let nx = (right - left) / 510;- let ny = (down - up) / 510;- const px = x * invSw;- const r1 =- Math.sin(px * 18 * cfg.roughness + t13) *- Math.cos(py * 14 * cfg.roughness + t09) *- 0.2 *- cfg.distortion;- const r2 = Math.sin((px + py) * 22 * cfg.roughness - t05) * 0.12 * cfg.distortion;- const r3 = Math.cos(px * 30 * cfg.roughness + py * 10 - t18) * 0.08 * cfg.distortion;-- nx += r1 + r2;- ny += r3 + r1 * 0.6;-- const envCoord = (nx + r2) * 4 + px * 2 + tEnv;- let envU = envCoord - Math.floor(envCoord);- if (envU < 0) envU += 1;- const envIdx = ((envU * (envLen - 1)) | 0) * 4;- let cr = envData[envIdx];- let cg = envData[envIdx + 1];- let cb = envData[envIdx + 2];-- let envU2 = envU + 0.35 + ny * 2.5;- envU2 = envU2 - Math.floor(envU2);- const envIdx2 = ((envU2 * (envLen - 1)) | 0) * 4;- cr = (cr * 0.65 + envData[envIdx2] * 0.35) | 0;- cg = (cg * 0.65 + envData[envIdx2 + 1] * 0.35) | 0;- cb = (cb * 0.65 + envData[envIdx2 + 2] * 0.35) | 0;- cr = ((cr * (cr + 60)) / 315) | 0;- cg = ((cg * (cg + 60)) / 315) | 0;- cb = ((cb * (cb + 60)) / 315) | 0;-- if (isLight) {- cr = 255 - cr;- cg = 255 - cg;- cb = 255 - cb;- if (cr > 225) cr = 225;- if (cg > 225) cg = 225;- if (cb > 223) cb = 223;- } else {- if (cr < 30) cr = 30;- if (cg < 30) cg = 30;- if (cb < 32) cb = 32;- }-- if (cfg.tint > 0.01) {- cr = (cr * (1 + cfg.tint * 0.25)) | 0;- cg = (cg * (1 + cfg.tint * 0.08)) | 0;- if (cr > 255) cr = 255;- if (cg > 255) cg = 255;- }-- const minEdge =- left < right- ? left < up- ? left < down- ? left- : down- : up < down- ? up- : down- : right < up- ? right < down- ? right- : down- : up < down- ? up- : down;- const edgeness = 1 - minEdge / 255;- if (edgeness > 0.02) {- const f = edgeness * edgeness * cfg.fresnel;- cr = (cr + f * 200) | 0;- cg = (cg + f * 200) | 0;- cb = (cb + f * 210) | 0;- }-- const ldx = px - mx;- const ldy = py - my;- const ld2 = ldx * ldx + ldy * ldy;- if (ld2 < 0.12) {- const sx = ldx + nx * 0.4;- const sy = ldy + ny * 0.4;- const sd = Math.sqrt(sx * sx + sy * sy);- const sp = 1 - sd * 4.5;- if (sp > 0) {- const sp2 = sp * sp;- const spow = sp2 * sp2 * sp2 * cfg.specular;- cr = (cr + spow * 240) | 0;- cg = (cg + spow * 240) | 0;- cb = (cb + spow * 250) | 0;- }- }-- if (cfg.brushAngle > 0.01) {- const bc2 = px * brushCos + py * brushSin;- const br = Math.sin(bc2 * 400 * cfg.roughness + nx * 20) * 0.5 + 0.5;- const bfx = br * 0.15 + 0.85;- cr = (cr * bfx) | 0;- cg = (cg * bfx) | 0;- cb = (cb * bfx) | 0;- }-- out[idx] = tonemapLUT[cr > 255 ? 255 : cr < 0 ? 0 : cr];- out[idx + 1] = tonemapLUT[cg > 255 ? 255 : cg < 0 ? 0 : cg];- out[idx + 2] = tonemapLUT[cb > 255 ? 255 : cb < 0 ? 0 : cb];- out[idx + 3] = 255;- }- }-- shadeContext.putImageData(outImg, 0, 0);-- const introFade =- introElapsed >= introDuration ? 1 : Math.pow(Math.min(introElapsed / introDuration, 1), 2);-- ctx.setTransform(1, 0, 0, 1, 0, 0);- ctx.clearRect(0, 0, canvas.width, canvas.height);- ctx.imageSmoothingEnabled = true;- ctx.imageSmoothingQuality = "high";- ctx.globalAlpha = introFade;- ctx.drawImage(shadeCanvas, 0, 0, sw, sh, 0, 0, canvas.width, canvas.height);- ctx.globalAlpha = 1;- ctx.setTransform(dpr, 0, 0, dpr, 0, 0);-- const { scale, offsetX, offsetY } = getLogoTransform(- w,- h,- svgScaleRef.current,- svgWidthRef.current,- svgHeightRef.current,- );- const currentSvg = svgPathRef.current;- if (currentSvg !== lastGlowSvg) {- glowPath = new Path2D(currentSvg);- lastGlowSvg = currentSvg;- }-- ctx.save();- ctx.globalCompositeOperation = isLight ? "multiply" : "screen";- ctx.filter = `blur(${12 + Math.sin(time * 0.3) * 3}px)`;- ctx.globalAlpha = 0.07 * cfg.fresnel * introFade;- ctx.translate(offsetX, offsetY);- ctx.scale(scale, scale);- ctx.fillStyle = glowColorRef.current;- if (glowPath) ctx.fill(glowPath);- ctx.restore();-- rafRef.current = requestAnimationFrame(animate);- };-- rafRef.current = requestAnimationFrame(animate);- return () => cancelAnimationFrame(rafRef.current);- }, [buildMask]);-- return (- <canvas- aria-hidden- className={cn("block size-full select-none text-gray-1000", className)}- ref={canvasRef}- style={{ touchAction: "none" }}- />- );-}--export function HeroMetalShader({ className }: { className?: string }) {- const scaleOffsetX = (EVE_MARK_WIDTH * (1 - HERO_MARK_SCALE)) / 2;- const scaleOffsetY = (EVE_MARK_HEIGHT * (1 - HERO_MARK_SCALE)) / 2;-- return (- <div className={cn("relative size-full", className)}>- <svg- aria-hidden- className="absolute inset-0 size-full text-gray-1000 opacity-[0.12] [mask-image:linear-gradient(90deg,transparent_0%,black_14%,black_78%,transparent_100%)] dark:opacity-20"- fill="none"- stroke="currentColor"- strokeLinejoin="round"- strokeWidth="1"- viewBox={`0 0 ${EVE_MARK_WIDTH} ${EVE_MARK_HEIGHT}`}- >- <path- d={EVE_MARK_PATH}- transform={`translate(${scaleOffsetX} ${scaleOffsetY}) scale(${HERO_MARK_SCALE})`}- />- </svg>- <MetalShader className="absolute inset-0" config={HERO_CONFIG} svgScale={HERO_MARK_SCALE} />- </div>- );-}diff --git a/apps/docs/components/geistdocs/installer.tsx b/apps/docs/components/geistdocs/installer.tsxdeleted file mode 100644index b4e8fba0c..000000000--- a/apps/docs/components/geistdocs/installer.tsx+++ /dev/null@@ -1,57 +0,0 @@-"use client";--import { track } from "@vercel/analytics";-import {- InputGroup,- InputGroupAddon,- InputGroupButton,-} from "@vercel/geistdocs/components/input-group";-import { Input } from "@vercel/geistdocs/components/input";-import { CheckIcon, CopyIcon } from "lucide-react";-import { useState } from "react";-import { toast } from "sonner";--const COPY_TIMEOUT = 2000;--interface InstallerProps {- className?: string;- command: string;-}--export const Installer = ({ command, className = "w-48" }: InstallerProps) => {- const [copied, setCopied] = useState(false);-- const handleCopy = () => {- navigator.clipboard.writeText(command);- toast.success("Copied to clipboard");- setCopied(true);-- track("Copied installer command");- setTimeout(() => {- setCopied(false);- }, COPY_TIMEOUT);- };-- const Icon = copied ? CheckIcon : CopyIcon;-- return (- <InputGroup- className="h-10 cursor-pointer bg-background font-mono shadow-none"- onClick={handleCopy}- >- <InputGroupAddon>- <span className="font-normal text-muted-foreground">$</span>- </InputGroupAddon>- <Input- className={`${className} h-full flex-1 cursor-pointer rounded-none border-0 bg-transparent font-mono shadow-none focus-visible:ring-0 dark:bg-transparent`}- readOnly- value={command}- />- <InputGroupAddon align="inline-end">- <InputGroupButton aria-label="Copy" onClick={handleCopy} size="icon-xs" title="Copy">- <Icon className="size-3.5" size={14} />- </InputGroupButton>- </InputGroupAddon>- </InputGroup>- );-};diff --git a/apps/docs/hooks/use-mobile.ts b/apps/docs/hooks/use-mobile.tsdeleted file mode 100644index 502fd3239..000000000--- a/apps/docs/hooks/use-mobile.ts+++ /dev/null@@ -1,19 +0,0 @@-import * as React from "react";--const MOBILE_BREAKPOINT = 768;--export function useIsMobile() {- const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);-- React.useEffect(() => {- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);- const onChange = () => {- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);- };- mql.addEventListener("change", onChange);- setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);- return () => mql.removeEventListener("change", onChange);- }, []);-- return !!isMobile;-}diff --git a/apps/docs/lib/analytics/events.ts b/apps/docs/lib/analytics/events.tsindex cf577408c..069ad9c70 100644--- a/apps/docs/lib/analytics/events.ts+++ b/apps/docs/lib/analytics/events.ts@@ -22,7 +22,7 @@ export const analyticsEvents = {export type AnalyticsEventName = (typeof analyticsEvents)[keyof typeof analyticsEvents];-export type DocsSurface = "docs" | "home" | "integrations" | "other" | "templates";+type DocsSurface = "docs" | "home" | "integrations" | "other" | "templates";export const isQueryFreeUrl = (url: string): boolean => {try {diff --git a/apps/docs/lib/evals/results.ts b/apps/docs/lib/evals/results.tsindex 0d06d7cf5..1293f7b9d 100644--- a/apps/docs/lib/evals/results.ts+++ b/apps/docs/lib/evals/results.ts@@ -1,7 +1,7 @@import rawResults from "./benchmark-results.json";-export type BenchmarkTreatment = "baseline" | "guided";-export type BenchmarkCellStatus = "current" | "missing" | "stale";+type BenchmarkTreatment = "baseline" | "guided";+type BenchmarkCellStatus = "current" | "missing" | "stale";export interface BenchmarkExperiment {id: string;diff --git a/apps/docs/lib/geistdocs/metadata-title.ts b/apps/docs/lib/geistdocs/metadata-title.tsindex dbba53715..6ff30ceda 100644--- a/apps/docs/lib/geistdocs/metadata-title.ts+++ b/apps/docs/lib/geistdocs/metadata-title.ts@@ -1,7 +1,7 @@import type { Metadata } from "next";export const siteTitle = "eve – durable AI agent framework";-export const siteTitleTemplate = "%s – eve";+const siteTitleTemplate = "%s – eve";export const rootTitleMetadata = {default: siteTitle,diff --git a/apps/docs/lib/geistdocs/sitemap.ts b/apps/docs/lib/geistdocs/sitemap.tsindex 710fbea24..09dc5a15a 100644--- a/apps/docs/lib/geistdocs/sitemap.ts+++ b/apps/docs/lib/geistdocs/sitemap.ts@@ -5,7 +5,7 @@ export interface SitemapSourceEntry {pathname: string;}-export interface CanonicalSitemapEntry {+interface CanonicalSitemapEntry {lastModified?: Date;url: string;}diff --git a/apps/docs/lib/integrations/connection-setup.ts b/apps/docs/lib/integrations/connection-setup.tsindex 948077220..cba53dfd4 100644--- a/apps/docs/lib/integrations/connection-setup.ts+++ b/apps/docs/lib/integrations/connection-setup.ts@@ -11,7 +11,7 @@ import {* One entry per (protocol, auth mode) the connection supports. The detail* page renders these as a pair of switchers; `key` is `"<protocol>:<auth>"`.*/-export interface ConnectionSetup {+interface ConnectionSetup {protocols: ConnectionProtocol[];authModes: AuthMode[];/** Generated quick-start markdown keyed by `"<protocol>:<auth>"`. */diff --git a/apps/docs/lib/integrations/data.ts b/apps/docs/lib/integrations/data.tsindex 7f6b1d1bf..743ac2330 100644--- a/apps/docs/lib/integrations/data.ts+++ b/apps/docs/lib/integrations/data.ts@@ -31,7 +31,7 @@ import type { ConnectionProtocol } from "@eve/catalog";*/export type AuthMode = "user" | "app" | "jwtBearer" | "apiKey";-export interface ApiKeySpec {+interface ApiKeySpec {/** Server-side environment variable containing the API key. */env: string;/** Header used to send the API key. */@@ -2714,5 +2714,3 @@ export const integrations: Integration[] = [export const getIntegration = (slug: string): Integration | undefined =>integrations.find((integration) => integration.slug === slug);--export const integrationSlugs = (): string[] => integrations.map((integration) => integration.slug);diff --git a/apps/docs/lib/integrations/logos.tsx b/apps/docs/lib/integrations/logos.tsxindex eb1062018..affd9d9e7 100644--- a/apps/docs/lib/integrations/logos.tsx+++ b/apps/docs/lib/integrations/logos.tsx@@ -42,7 +42,7 @@ import type { ComponentProps } from "react";type LogoProps = ComponentProps<"svg">;-export const eveLogo = (props: LogoProps) => (+const eveLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M12 2 2 19.5h20L12 2Zm0 4.7 6.1 10.6H5.9L12 6.7Z" fill="currentColor" /></svg>@@ -60,7 +60,7 @@ export const webLogo = (props: LogoProps) => (</svg>);-export const BuzzLogo = (props: LogoProps) => (+const BuzzLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 466 309" xmlns="http://www.w3.org/2000/svg" {...props}><defs><mask id="buzz-logo-mask">@@ -77,7 +77,7 @@ export const BuzzLogo = (props: LogoProps) => (</svg>);-export const browserUseLogo = (props: LogoProps) => (+const browserUseLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M585.941 28.6547C672.468 -0.299678 755.454 -7.58569 825.373 10.7402L826.395 11.0121L827 11.1565L827.641 11.3457C847.195 16.6483 865.182 23.835 881.555 32.7484L882.227 33.0905L882.764 33.4117C906.114 46.3093 926.136 62.7489 942.682 82.2677L943.373 83.0233L944.245 84.1306C946.291 86.5977 948.277 89.1138 950.214 91.6764L950.305 91.7659L950.355 91.8263L950.764 92.4079C955.445 98.6651 959.8 105.202 963.827 112.003L964.182 112.472H964.105C965.309 114.512 966.482 116.577 967.623 118.664L967.736 118.877C967.754 118.911 967.773 118.945 967.791 118.978L968.136 119.57C968.418 120.087 968.673 120.606 968.95 121.125L969.173 121.533C970.409 123.869 971.6 126.234 972.764 128.627L973.191 129.486L973.268 129.676C974.382 131.993 975.459 134.336 976.5 136.705L976.668 137.037L976.841 137.479C979.995 144.709 982.832 152.177 985.345 159.871C985.564 160.541 985.782 161.213 985.995 161.886L986.032 161.921L986.064 162.038L986.186 162.491C988.514 169.878 990.55 177.47 992.291 185.254L992.386 185.54L992.404 185.596L993.014 188.491L993.091 188.939C993.645 191.579 994.164 194.242 994.65 196.925L994.745 197.344H994.841V197.963C996.318 206.277 997.473 214.795 998.3 223.504L998.309 223.567C999.132 232.219 999.627 241.105 999.8 250.125L999.818 250.304L999.823 250.36L999.864 250.8L999.823 251.336C999.882 255.305 999.886 259.309 999.823 263.345V264.118L999.818 264.545C999.645 273.671 999.132 282.967 998.314 292.419V292.632C997.127 306.176 995.259 320.044 992.723 334.2L992.414 336.049L992 338.155C986.227 369.001 977.241 401.194 964.936 434.397L964.459 435.787L964.132 436.723L963.7 435.973C963.627 435.91 963.577 435.823 963.555 435.728L954.727 420.468L945.673 405.075L936.286 390.026L936.041 389.641L926.414 374.83L926.35 374.734L916.232 359.633L910.195 351.034L905.823 344.696L905.691 344.517L894.95 329.901L888.609 321.446L883.923 315.101L883.809 314.946L883.841 314.769C883.841 314.765 883.841 314.774 883.841 314.769L885.195 306.786V306.496L886.255 298.912L887.091 292.632L887.168 292.091L887.209 291.877L887.314 291.349L888.064 283.829L888.518 276.447L888.968 269.364L889.118 262.269L889.123 262.206V261.825L889.273 255.496L889.132 250.8L889.123 250.392V248.859L888.818 242.367L888.4 237.361L888.364 236.947V236.183L887.764 230.027L887.014 224.294L886.109 218.569L885.327 213.748L885.205 212.999L884.609 210.908L883.995 207.696L882.795 202.753L882.777 202.692L881.536 198.552H881.423V198.17L881.418 198.1V197.865L879.932 193.259L878.423 188.729L877.227 185.89L876.768 184.523L874.968 180.47L873.186 176.614L873.159 176.556L873.118 176.475L871.205 172.792L869.25 169.189L867.15 165.735L864.891 162.421L862.636 159.264L857.964 153.236L852.845 147.819L849.091 144.368L845.195 140.918L840.977 137.605L837.068 134.909L836.623 134.6L833.164 132.369L831.954 131.589L829.104 130.09L826.977 128.876L821.718 126.172L816.164 123.77L810.286 121.509L805.627 120.157L803.977 119.556L797.332 117.744L790.409 116.088L783.032 114.583L782.509 114.501L775.341 113.376L767.2 112.471L758.623 111.868L749.75 111.568H740.432L730.868 111.717L720.918 112.471L716.018 112.904L710.65 113.379L700.255 114.582L689.391 116.241L678.373 118.356L667.059 120.77L667.009 120.781L655.518 123.466L655.441 123.486L643.673 126.653L631.759 130.119L631.318 130.26L619.541 134.042L607.309 138.422L597.955 142.042L595.055 143.146L594.786 143.25L582.264 148.377L569.604 153.803L556.75 159.7L544.077 165.961L543.936 166.035L543.841 166.085L530.95 172.672L517.964 179.621L504.982 186.866L492.005 194.561L482.95 200.146L478.864 202.566L475.436 204.757L465.891 210.863L463.341 212.663L453.068 219.459L452.82 219.634L444.462 225.501L440.077 228.523L427.248 237.729L415.051 246.876L414.57 247.237L408.533 251.914L401.89 257.049L392.468 264.695L391.527 265.458L391.477 265.499L389.356 267.166L376.99 277.568L364.764 288.284L352.744 299.254L352.687 299.307L340.755 310.33L329.135 321.799L328.985 321.947L317.509 333.425L306.345 345.188L300.758 351.232L295.279 357.005L295.168 357.124L284.456 369.34L273.9 381.554L273.781 381.733L263.471 394.101L261.663 396.36L253.357 406.629L249.588 411.602L244.251 418.58L243.698 419.306L234.189 431.978L224.982 444.81L216.073 457.646L207.474 470.617L199.456 483.153L199.17 483.598L199.092 483.725L191.359 496.515L191.321 496.579L186.791 504.28L183.619 509.569L183.59 509.619L178.039 519.823L176.381 522.531L176.255 522.777L169.739 535.367L169.705 535.43L169.653 535.48L169.559 535.576L163.1 548.488L162.045 550.755L157.062 561.319L151.356 574.081L148.156 581.546L145.894 586.821L141.097 599.261L141.069 599.339L136.413 611.651L136.414 611.87L136.415 612.328H136.28L132.157 624.105L131.256 627.104L128.387 636.173L126.729 642.047L124.915 648.099L122.804 656.237L121.9 659.708L119.614 669.563L119.485 670.122L119.182 671.33L116.92 682.489L114.96 693.489L114.95 693.566L113.452 704.207L113.425 704.448L112.697 711.14L112.254 714.534L112.245 714.602L111.497 724.634L111.495 724.68L111.497 725.134L110.889 734.525L110.887 736.006L110.889 737.515V737.969L110.737 744.021L110.889 750.341V753.072L111.34 761.777L111.445 762.736L111.491 763.136L112.094 770.237L112.848 775.507L113.143 778.17L113.151 778.229L114.502 785.903L116.01 793.286L117.62 800.02L117.673 800.229L119.621 806.68L121.177 811.06L121.266 811.315L121.283 811.36L121.695 812.737L121.736 812.873L123.997 818.598L126.55 824L129.105 829.261L131.817 833.782L131.881 833.891V834.177L132.91 835.722L134.816 838.58L137.984 842.955L141.276 846.995L144.743 850.766L148.349 854.523L148.519 854.678L152.074 857.949L152.109 857.981L156.025 861.293L160.23 864.451L164.031 866.936L164.172 867.027L164.547 867.308L164.749 867.458L169.549 870.312L170.837 870.993L174.671 873.024L179.947 875.587L185.633 877.977L190.177 879.685L191.685 880.248L197.488 882.047L197.996 882.202L204.788 884.015L211.858 885.519L219.39 886.873L222.52 887.323L222.57 887.327L227.251 888.081L234.028 888.699L235.514 888.831L239.674 889.126L244.109 889.435L253.163 889.735L262.511 889.585L272.308 889.135L282.264 888.531L292.659 887.477L303.22 885.969L314.044 884.165L314.28 884.119L314.442 884.242L314.7 884.437L315.045 884.696L316.738 885.964L316.83 886.032L316.867 886.059L317.027 886.196L320.67 888.945L320.951 889.135L321.048 889.199L321.087 889.226L321.566 889.585H321.871V889.817L322.77 890.494H322.721L329.142 895.342L329.238 895.414L329.412 895.542L344.031 906.132L349.681 910.126L357.014 915.188L358.974 916.696L369.541 923.639L374.07 926.81L374.657 927.187L389.322 936.624L389.608 936.801L393.695 939.341L404.562 946.129L404.646 946.179L419.961 955.188L420.311 955.388L421.437 956.034L435.111 963.953C435.239 963.926 435.368 963.962 435.467 964.035H437.75L436.209 964.584L435.292 964.916L431.062 966.424L430.99 966.452L428.649 967.274C425.328 968.474 422.018 969.637 418.719 970.768L415.66 971.863L415.586 971.886L404.47 975.493L400.397 976.847L392.19 979.287H392.625L389.2 980.178L386.558 980.864C382.626 981.977 378.709 983.04 374.812 984.058L374.093 984.253L373.182 984.48C370.499 985.175 367.824 985.843 365.158 986.488L362.552 987.143H363.001L359.02 988.024L358.97 988.038L356.32 988.624L354.894 988.942L344.165 991.209L340.665 991.836C337.84 992.381 335.026 992.904 332.223 993.395L329.354 993.931L327.899 994.135C324.249 994.744 320.618 995.307 317.007 995.825L314.694 996.198L312.883 996.398C310.298 996.743 307.724 997.07 305.16 997.37L300.335 998.011L300.058 998.029L297.084 998.242C294.19 998.529 291.31 998.783 288.444 999.01L286.117 999.224L281.579 999.524L278.829 999.655C276.793 999.769 274.765 999.869 272.744 999.951L272.203 999.978H272.087L272.02 999.983C267.626 1000.15 263.27 1000.25 258.954 1000.27L258.75 1000.28L258.04 1000.28C254.292 1000.29 250.575 1000.25 246.887 1000.15L244.84 1000.13L243.418 1000.04C241.22 999.964 239.032 999.869 236.856 999.751L231.539 999.524L228.682 999.224L227.022 999.074C225.509 998.951 224.001 998.815 222.5 998.67L218.562 998.315L215.504 998.011L205.72 996.657L205.665 996.652L202.683 996.202L202.631 996.193L193.269 994.535L190.239 993.931L181.022 991.963L178.134 991.205L169.224 988.937L168.177 988.624L166.185 988.029L166.135 988.011L163.226 987.143H163.379L157.642 985.33L157.541 985.298L154.952 984.289C153.309 983.721 151.677 983.135 150.055 982.536L146.453 981.25L146.366 981.223L143.648 980.164L135.486 976.838L132.899 975.47L125.047 971.849L122.955 970.623C121.649 969.946 120.352 969.26 119.063 968.56L114.909 966.402L112.321 964.88L105.068 960.5L101.299 957.869C100.11 957.074 98.9291 956.27 97.7582 955.456L95.695 954.148L86.7509 947.333L86.1509 946.878L82.5714 943.843C81.9282 943.303 81.2886 942.758 80.6523 942.212L78.1264 940.072L77.025 939.027C75.4459 937.605 73.8877 936.165 72.3518 934.697L69.9577 932.507L67.7432 930.149C64.7277 927.087 61.8018 923.925 58.9686 920.667L56.0309 917.373L54.8073 915.846L48.0064 907.082L47.9605 907.005L47.8145 906.719L47.2723 905.942C45.885 904.029 44.5254 902.089 43.1946 900.121L41.636 897.891L41.5085 897.709L40.4306 896.023L40.3311 895.864L39.9891 895.328L36.9545 890.43L36.9096 890.344L36.7835 890.089L36.6658 889.853C36.5694 889.694 36.4716 889.531 36.3756 889.372L35.9285 888.813L35.8865 888.763L35.8612 888.699L35.6131 888.077C35.5528 887.977 35.4925 887.872 35.4323 887.768L35.302 887.572L34.866 886.791C34.6739 886.459 34.482 886.123 34.2914 885.791L33.6284 884.687L33.2836 884.001C32.9002 883.315 32.5184 882.625 32.1412 881.929L31.5161 880.916L30.4214 878.863L30.3317 878.694L30.2953 878.626L30.113 878.263L29.9855 878.013L29.0828 876.2L29.0604 876.155L28.7549 875.541L28.4325 874.823C27.8661 873.688 27.3079 872.547 26.7575 871.402L26.6384 871.161L26.5402 870.966L26.5136 870.911L26.1856 870.257L25.1624 868.063L24.8807 867.64L24.8499 867.59L24.414 866.936H24.5807L23.7846 865L22.8006 862.706C22.6616 862.383 22.5208 862.061 22.383 861.738L20.9112 858.499L20.3085 856.84L19.6708 855.305L19.5446 855.009L19.2937 854.4L18.1864 851.234L18.0224 850.775C17.5904 849.612 17.1642 848.439 16.7469 847.263L16.0811 845.668L15.313 843.369L13.9506 838.984L12.4453 834.459L12.4214 834.391V834.073L11.9519 832.315C11.3994 830.402 10.8639 828.471 10.3484 826.526L9.72045 824.323L9.41486 823.1L9.10091 821.633C8.4085 818.82 7.75659 815.981 7.14559 813.123L6.70127 811.642L6.68868 811.587L6.17286 808.393C5.64627 805.717 5.15518 803.023 4.69832 800.31L4.58059 799.842L4.44043 799.284H4.4979L4.28204 797.771C3.93671 795.612 3.61244 793.445 3.3107 791.264L2.76125 787.875L2.60567 786.035L2.49774 784.94C1.94323 780.251 1.48815 775.517 1.12973 770.737L1.09469 770.314L1.07366 769.983C0.922441 767.906 0.7887 765.821 0.674195 763.731L0.641955 763.217L0.640555 763.081C0.421359 758.938 0.275339 754.762 0.199034 750.555L0.187821 750.378V750.028C-0.0836691 733.785 0.703895 717.115 2.51596 700.104L2.75705 697.46L2.9785 695.96C3.42475 692.107 3.92292 688.241 4.47266 684.356L4.47967 684.297C5.10395 679.89 5.79636 675.465 6.55273 671.021L6.68586 669.958L7.57173 665.246C7.9145 663.365 8.27095 661.48 8.63695 659.594L8.65236 659.508C10.7446 648.731 13.2175 637.836 16.0573 626.872C19.8754 612.133 24.366 597.212 29.4991 582.223L29.6253 581.824L29.8159 581.215L29.9098 580.919L30.364 579.715C33.6331 570.297 37.1571 560.833 40.931 551.346L41.2968 550.401L41.3753 550.228C42.0896 548.438 42.8116 546.648 43.5437 544.862C85.0132 443.52 154.799 339.427 246.82 247.415L251.142 243.118C252.682 241.596 254.228 240.08 255.775 238.57H255.679L256.35 238.01C306.627 189.009 360.299 146.591 415.01 111.718H413.892L416.209 110.953C421.134 107.825 426.069 104.76 431.009 101.755L431.209 101.633C436.304 98.5352 441.406 95.5047 446.512 92.5396L446.557 92.5128C479.1 73.6206 511.845 57.4285 544.309 44.1443C558.245 38.4413 572.141 33.2718 585.941 28.6547ZM672.236 174.994C672.377 174.851 672.591 174.817 672.764 174.907L672.841 174.957L677.227 178.523C862.445 329.967 988.982 542.704 999.318 720.763L999.541 724.957C1000.69 748.978 999.668 771.732 996.6 793.091L996.564 793.332C994.818 805.426 992.414 817.071 989.377 828.244L989.523 828.275L989.227 828.871L989.2 828.934L989.168 828.993C983.85 848.33 976.627 866.254 967.609 882.647L967.464 882.974L967.441 883.02L967.414 883.061L967.286 883.224C966.327 884.96 965.345 886.682 964.345 888.381L963.982 889.035L963.877 889.29L963.709 889.49L963.65 889.585H963.9L963.2 890.298C961.932 892.411 960.627 894.492 959.295 896.546L958.673 897.532L955.345 902.525L954.291 903.929C952.882 905.914 951.445 907.873 949.977 909.799L948.691 911.598L946.191 914.642C944.986 916.137 943.759 917.609 942.514 919.068L941.423 920.381L940.818 921.035C938.941 923.18 937.027 925.283 935.068 927.351L933.859 928.7L930.059 932.498L925.832 936.578L923.805 938.373C920.555 941.326 917.209 944.184 913.768 946.942L913.118 947.474L908.582 951.104L904.259 954.13C901.668 955.979 899.027 957.774 896.336 959.518L894.659 960.636L889.668 963.812L884.814 966.547L882.668 967.706C881.709 968.237 880.741 968.764 879.768 969.282L879.518 969.419L879.368 969.496C877.523 970.473 875.659 971.431 873.777 972.367L869.086 974.712L863.932 976.983L858.341 979.405L852.886 981.522L852.341 981.722C850.654 982.367 848.955 982.99 847.245 983.599L847.141 983.64L847.041 983.671C843.75 984.844 840.409 985.952 837.027 987.002L835.805 987.42L833.459 988.079C831.427 988.678 829.382 989.255 827.318 989.81L824 990.75L821.455 991.318C819.295 991.85 817.118 992.363 814.923 992.845L811.75 993.622L809.732 993.967L808.95 994.099C806.268 994.635 803.559 995.135 800.827 995.603L799.345 995.893L799.295 995.903L797.277 996.189C794.173 996.68 791.036 997.129 787.868 997.534L786.636 997.706L786.586 997.711L784.418 997.952C783.345 998.079 782.268 998.197 781.186 998.315L779.827 998.465L773.627 999.069L771.559 999.197C769.023 999.396 766.473 999.565 763.905 999.705L760.327 999.978H760.223L756.286 1000.05C753.618 1000.14 750.936 1000.2 748.236 1000.23L746.718 1000.28L744.927 1000.26C741.364 1000.27 737.768 1000.23 734.141 1000.14L732.955 1000.13L727.859 999.978H727.805L718.945 999.528H718.9L714.877 999.215C713.668 999.128 712.459 999.038 711.245 998.942L704.686 998.465L700.114 997.911C697.732 997.656 695.35 997.388 692.964 997.097L690.323 996.802L686.6 996.284C686.023 996.207 685.445 996.121 684.868 996.043L683.818 995.898L683.523 995.853C681.5 995.566 679.477 995.266 677.445 994.953L675.705 994.694L675.65 994.689L669.005 993.631L660.841 992.118L657.286 991.391C655.359 991.009 653.423 990.618 651.486 990.214L645.882 989.096L641.277 987.97C638.327 987.293 635.368 986.588 632.409 985.857L630.764 985.466L628.25 984.812C626.482 984.358 624.709 983.899 622.936 983.426L615.65 981.541L608.541 979.423L600.236 977.006L593.195 974.762L593.123 974.739L592.886 974.662L590.359 973.853H590.418L584.818 972.017L581.086 970.668C578.791 969.878 576.491 969.073 574.195 968.255L569.255 966.579L562.145 963.853L553.686 960.686L547.341 958.042C546.409 957.665 545.477 957.288 544.545 956.91L538.118 954.339L530.864 951.163L522.405 947.537L517.809 945.338C515.895 944.466 513.986 943.58 512.073 942.689L506.691 940.286L499.423 936.656L490.973 932.58L483.709 928.8L475.255 924.42L468 920.49L459.791 916.015L459.682 915.955L459.623 915.919L458.132 915.11H458.2L452.388 911.785L452.279 911.726L452.179 911.667L450.805 910.88L443.974 906.891L436.83 902.725L436.718 902.661L436.64 902.616L435.278 901.821L428.406 897.673L421.269 893.211L421.154 893.143L420.767 892.897L419.82 892.307L417.078 890.576L417.036 890.548L416.999 890.512L416.89 890.403L416.708 890.294L416.18 889.976L415.08 889.29L414.961 889.217L413.3 888.159L413.066 887.999L412.838 887.85L411.025 886.641L408.465 884.983L408.343 884.905L407.18 884.151L406.405 883.61C405.799 883.215 405.194 882.815 404.588 882.42L401.52 880.457L397.435 877.731L397.242 877.549L395.24 876.195C394.087 875.419 392.935 874.642 391.784 873.856L387.579 871.011L387.461 870.934L387.295 870.821L386.241 870.107L382.175 867.308L381.842 867.086L381.714 867L380.484 866.182H380.583L377.07 863.633C374.182 861.588 371.299 859.521 368.422 857.436L366.927 856.44L362.227 852.951L354.975 847.517L351.813 845.254L347.415 841.77L339.568 835.731L338.225 834.627C336.105 832.964 333.986 831.288 331.874 829.602L331.408 829.234L322.947 822.437L322.192 821.833L321.185 821.029L314.333 815.336L307.535 809.593L305.571 807.934L301.122 804.013C299.326 802.459 297.535 800.896 295.747 799.324L293.189 797.216L288.237 792.664C287.114 791.66 285.992 790.651 284.873 789.642L278.979 784.367L278.206 783.595L275.475 781.042C270.6 776.525 265.757 771.955 260.952 767.329L259.639 766.089L257.935 764.412C252.43 759.069 246.974 753.653 241.569 748.165L237.725 744.321L231.08 737.379L224.721 730.722L224.584 730.582L221.565 727.41L212.055 716.997L211.604 716.542L207.254 711.603C204.962 709.041 202.683 706.465 200.415 703.875L198.901 702.18L193.309 695.683L192.798 695.079C191.123 693.125 189.456 691.158 187.795 689.19L186.509 687.673L185.875 686.928L183.943 684.652L174.863 673.638L174.699 673.438L174.395 672.984L174.281 672.811L174.335 672.616L176.147 665.819L177.205 661.589L177.96 658.867L180.078 651.766L182.303 644.792L182.346 644.655L182.398 644.492L184.268 638.753L184.461 638.158L184.726 637.363L184.763 637.254L187.179 630.003L189.901 622.442L192.917 614.905L193.062 614.332L193.081 614.269L195.95 607.322L198.063 602.042L199.124 599.616L202.447 591.91L203.353 589.802L206.078 584.045L206.103 583.991L208.807 578.048L209.102 577.389L209.506 576.585L209.706 576.185L209.833 575.935L215.327 564.945L217.56 560.478L221.794 552.464L222.138 551.814L222.562 552.414L222.599 552.464L231.43 564.89L231.47 564.945L240.525 577.316L245.659 583.964L249.906 589.525L250.04 589.702L259.698 601.924L269.664 614.155L279.772 626.222L285.82 633.06L289.435 637.095L290.2 638.008L300.759 649.776L311.625 661.393L315.7 665.619L322.345 672.416L322.398 672.48L322.675 672.898L333.963 684.034L337.133 687.055L345.437 695.056L345.53 695.142L356.974 705.692L357.06 705.77L368.836 716.338L369.887 717.133H369.745L380.755 726.747L392.711 736.611L392.834 736.711L405.067 746.525L417.319 755.939L417.452 756.039L417.538 756.107L429.809 765.385L437.21 770.519L442.343 774.294L454.877 782.9L467.409 791.355L480.077 799.347L492.759 807.198L495.768 808.852L497.309 809.702H497.195L505.436 814.591L517.068 821.083L518.127 821.692L530.791 828.475L539.4 832.855L543.273 834.941L543.332 834.973L555.85 841.002L568.223 846.74L580.595 852.17L580.732 852.224L592.941 857.136L605.055 861.829L607.464 862.706L617.114 866.2L629.032 870.125L640.655 873.597L652.123 876.763L652.195 876.782L652.727 876.918L663.432 879.63L674.609 882.047L685.423 884.151L696.023 885.814L704.782 887.023L706.455 887.327L716.382 888.381L726.2 889.135L726.582 889.154L735.7 889.59L744.814 889.74H744.882L753.795 889.585H753.855L762.218 889.135L770.505 888.381L778.195 887.327L782.382 886.646L785.573 886.123L792.659 884.619L799.3 882.956L805.764 881.003L810.473 879.43L811.645 879.04L817.35 876.791L822.786 874.374L827.886 871.825L832.705 869.112L837.209 866.263L839.477 864.641L841.436 863.247L842.141 862.679L842.673 862.252H842.605L843.691 861.438L845.477 860.102L849.241 856.786L852.859 853.324L856.323 849.712L859.632 845.95L862.786 841.892L865.795 837.676L868.641 833.182L871.359 828.503L873.905 823.414L876.164 818.143L878.423 812.419L880.536 806.38L882.341 800.065L884.145 793.45L884.391 792.182L885.505 786.357L886.259 781.841L886.859 778.82L887.764 770.991L887.768 770.946L888.518 762.854L889.118 754.417L889.273 745.68L889.123 736.475L888.818 726.983L888.1 718.037L888.064 717.619V717.315L887.75 714.298L887.009 707.224L887 707.164L886.559 704.211L885.659 697.023L885.65 696.964L885.627 696.819L883.841 686.26L881.732 675.396L879.323 664.406L878.868 662.734L876.45 653.065L876.395 652.861L873.305 641.539L873.277 641.443L869.814 629.844L866.491 619.871L865.891 617.922L861.623 606.29L861.505 605.977L856.982 593.768L855.332 590.006L852.023 581.596L852 581.537L846.573 569.175L840.841 556.648L835.073 544.826H835.023L834.923 544.513L834.782 544.09L828.473 531.618L827.114 529.351L821.673 518.924L818.805 513.944L814.577 506.247L814.268 505.729L807.027 493.716L806.882 493.48L800.818 483.666L800.686 483.448L800.259 482.758L799.332 481.04L791.205 468.396L791.086 468.278L791.032 468.209L782.727 455.833L774.127 443.307L770.05 437.723L765.118 430.843L765.064 430.772L758.877 422.473L755.859 418.403L746.2 406.023L736.518 393.962L736.468 393.903L736.386 393.798L726.427 381.723L726.395 381.69L722.941 377.805L722.795 377.644L722.75 377.587L722.136 376.898L716.209 369.858L716.154 369.794L716.105 369.736L705.595 358.026L696.532 348.211L694.859 346.234L683.854 334.777L682.805 333.725L672.686 323.461L661.427 312.5L661.364 312.44L653.814 305.191L649.895 301.426L638.7 291.427L638.555 291.293L638.104 290.846L626.191 280.29L626.127 280.234L614.273 270.181L614.114 270.05L602.073 260.243L602.036 260.214L589.818 250.559L577.432 241.197L577.309 241.103L565.05 231.986L554.345 224.597L552.568 223.264L552.527 223.236L551.927 222.816L552.573 222.465L560.427 218.237L568.441 214.155L572.768 211.991H572.423L574.495 211.127L576.309 210.371L584.159 206.6L591.868 203.122L599.573 199.648L607.25 196.486L614.836 193.3L622.245 190.429L627.259 188.586H626.877L629.623 187.715L637.064 185.137L644.323 182.868L651.423 180.603L658.536 178.635L665.482 176.671L671.986 175.008L672.041 174.994H672.236ZM778.214 552.468L782.445 560.469L786.523 568.479L790.305 576.34L793.895 584.127L793.991 584.218L794.773 584.99H794.377L797.559 591.901L800.886 599.616L804.204 607.317L807.118 614.746H807.164L807.241 615.055L810.104 622.433L812.827 629.994L812.868 630.125L815.395 637.399L817.814 644.651L818.268 646.009L820.027 651.584L820.077 651.748L822.045 658.863L822.65 660.821L824.014 665.819L825.604 672.484C825.745 672.611 825.786 672.802 825.723 672.97L825.705 673.016C825.691 673.043 825.673 673.075 825.655 673.098C825.564 673.207 825.477 673.32 825.386 673.429L823.477 675.878L818.891 681.367C810.073 692.044 801.014 702.557 791.736 712.903L790.541 714.257L790.15 714.661C782.886 722.721 775.491 730.672 767.968 738.505L765.909 740.695L764.318 742.286C748.055 759.056 731.209 775.289 713.868 790.901L713.845 790.955L713.777 791.014L711.6 792.941C708.827 795.422 706.041 797.889 703.241 800.338L702 801.428L701.209 802.15H701.345L700.341 802.936L700.214 803.055L699.445 803.641C696.495 806.203 693.527 808.743 690.545 811.269L688.1 813.368L687.295 814.013C682.491 818.044 677.655 822.033 672.786 825.967L672.705 826.045L672.523 826.208L672.282 826.145L672.082 826.09L665.536 824.35L665.491 824.336L658.541 822.523L651.436 820.556L644.323 818.289L639.486 816.676L637.073 815.872L629.673 813.455L622.255 810.729L614.7 807.857L607.218 804.718L607.136 804.686L603.141 803.055L603.055 803.023L599.605 801.519L591.964 798.225L591.873 798.189L584.014 794.558L583.955 794.531L576.7 791.128L576.582 791.073L576.323 790.901L576.123 790.764L568.3 787.007L560.432 782.922L552.577 778.842L552.336 778.72V778.447V778.293L552.332 778.061L552.523 777.925L567.232 767.42L568.1 766.798L568.382 766.598L583.782 755.157L584.232 754.821L584.273 754.794L599.923 742.604L615.473 729.918L630.723 716.788L645.809 703.362L649.282 700.04L660.459 689.468L662.85 687.078L663.527 686.396L663.623 686.305L663.755 686.174L674.5 675.719L674.95 675.278L683.568 666.387L684.309 665.623L684.436 665.483L689.141 660.639L690.945 658.681L697.436 651.589L702.882 645.841L716.305 630.761L717.059 629.857L723.559 622.301L729.323 615.65L729.886 614.914L730.014 614.746L736.082 607.213L742.123 599.961L742.4 599.543L748.464 591.815L753.927 584.809L754.35 584.263L766.118 568.42L777.445 552.414L777.873 551.814L778.214 552.468ZM183.482 8.60986C239.685 -4.21988 305.612 -1.39783 376.84 17.4494L378.263 17.79H378.123C395.74 22.4949 413.68 28.1758 431.875 34.8438L435.455 36.1669L435.536 36.2078C435.607 36.2518 435.661 36.3154 435.697 36.3868L436.216 36.5749L435.599 36.9238C435.549 36.9692 435.49 37.0024 435.425 37.0219L435.362 37.0597L422.562 44.3365L419.887 45.8599L404.564 55.0218L395.865 60.31L384.335 67.55L378.447 71.3275L372.246 75.3121L365.895 79.5684L359.728 83.7044L348.285 91.6832L348.169 91.8027L348.11 91.8513L339.571 97.885L337.987 99.0332L337.662 99.2672L329.842 104.932L328.334 106.042L325.616 108.095H325.679L324.577 108.894L324.453 109.001L323.979 109.33L321.416 111.266V111.393L321.169 111.518L320.913 111.644L320.228 112.162L319.652 112.625H319.891L318.672 113.438L318.56 113.532L318.308 113.682L317.524 114.205L315.042 116.078L314.47 116.587L314.313 116.726L314.243 116.716L314.07 116.803L313.947 116.866L313.811 116.848L313.11 116.761L312.602 116.698L305.806 115.491L301.949 114.96L298.107 114.433L290.405 113.529L282.89 112.776L275.654 112.174L272.114 111.951L268.38 111.718L261.45 111.567H257.522L254.681 111.417L253.355 111.564L248.04 111.567L241.558 111.867L235.214 112.324L229.192 112.923L223.322 113.675L217.736 114.582L212.326 115.483L207.645 116.551L207.042 116.69L202.065 117.898L197.334 119.226L197.249 119.25L194.871 119.941L192.57 120.61L188.228 122.105L184.017 123.759L179.94 125.573L176.02 127.382L172.268 129.331L168.655 131.288L165.201 133.392L161.889 135.651L158.772 137.875L156.166 139.958L152.713 142.722L147.319 147.815L142.196 153.237L137.37 159.27L135.119 162.421L132.876 165.704L131.828 167.658L130.967 169.085L130.915 169.176L128.809 172.786L126.856 176.542L126.224 178.014L125.966 178.618L125.942 178.67L125.045 180.462L123.391 184.521L121.739 188.729L121.387 189.783L121.288 190.085L120.076 193.263L118.724 197.916L118.654 198.174L117.669 201.694L117.366 202.748L116.01 207.718L115.065 212.444L114.976 212.898L114.958 212.981L113.93 218.404L113.901 218.566L112.998 224.294L112.921 225.062L112.851 225.777L112.81 226.185L112.243 230.027L111.643 236.173L111.644 238.118L111.34 242.366L111.04 248.859L110.889 255.494V262.27L111.04 269.364L111.466 276.022L111.493 276.438L112.014 282.859L112.095 283.829L112.7 289.869L112.841 291.292L112.85 291.379L113.754 298.907L114.96 306.752L116.319 314.757L116.351 314.946L116.237 315.1L114.576 317.365L105.195 329.721L105.064 329.896L94.3409 344.695L83.9377 359.617L83.8314 359.833L75.7718 371.714L73.7 374.672L73.6582 374.737L73.5391 374.918L67.4714 384.392L63.8523 389.819L59.3205 397.219L54.3418 405.065L54.2959 405.146L51.4755 410.044L45.335 420.372L45.2831 420.462L43.9263 422.877L38.7907 431.939L36.6027 435.728C36.583 435.823 36.5345 435.91 36.4625 435.973L36.049 436.691L35.7085 435.805L34.1989 431.877L31.0255 422.814L30.1186 420.397L26.6412 409.962L25.6825 406.798C25.2547 405.463 24.8322 404.129 24.4154 402.797L22.561 397.123L20.4417 389.708L18.9321 384.27L16.2129 374.604L15.4546 371.571L12.5868 359.491L12.434 358.887L9.41068 344.827L9.40086 344.78V344.47L9.30695 343.977C8.65604 340.705 8.041 337.445 7.461 334.2L6.84568 330.949L6.54432 329.741L4.57359 317.167L4.43342 315.118C4.09856 312.692 3.78546 310.273 3.49151 307.864L3.36396 306.887L2.96309 303.808L2.90842 303.402L2.90282 303.349L2.84395 302.902L2.45569 299.022L1.74225 291.877L1.6974 291.469L1.59087 290.369L1.54742 289.938L1.50257 289.462L1.30354 285.092C1.12497 282.527 0.971064 279.973 0.840991 277.431L0.801745 276.824L0 276.022H0.632145L0.490577 269.39L0.3392 263.651V261.32C0.309774 258.581 0.310253 255.857 0.3392 253.147V248.828L0.513005 245.107C0.578991 243.074 0.658759 241.049 0.758291 239.033L0.791932 238.118L0.790532 236.155L1.24607 229.93L1.51378 226.185L1.54462 225.748L1.54882 225.701L1.7002 224.179L2.30431 218.437L2.90702 213.47V212.859L3.61906 208.704C3.73422 207.889 3.8525 207.075 3.97368 206.263L4.36053 203.081L4.4222 202.564L4.57218 201.508L5.33186 197.707L6.23736 193.029L6.84145 189.858L7.14423 188.491L8.05109 184.262L8.836 180.732L8.95795 180.168L9.4135 178.357L10.0218 176.228L10.2937 175.257C10.6636 173.844 11.0415 172.437 11.4319 171.037L11.8411 169.406L11.9855 168.821L12.0668 168.5L12.441 167.312L12.8644 165.933L13.0255 165.407L13.0438 165.347L13.1419 165.027L14.1034 162.019L14.4244 161.053C14.6946 160.212 14.9705 159.374 15.2485 158.538L15.7601 156.749L17.1268 152.798L19.2405 147.363L19.5432 146.46L20.4346 144.374C21.2075 142.444 22.0003 140.527 22.8175 138.628L23.3206 137.39L23.622 136.492L23.6556 136.416L24.313 135.228C24.3801 135.078 24.4489 134.928 24.5163 134.779L25.0433 133.465H24.9774L25.3054 132.81L25.4049 132.559L26.3566 130.708L27.2621 128.746L27.8718 127.424H27.7877L28.1872 126.743L29.1585 125.08C29.375 124.654 29.5915 124.227 29.8103 123.802L30.1383 123.145L30.263 122.894L30.4915 122.496C30.7772 121.95 31.0651 121.405 31.3549 120.862L31.7992 119.974L31.9254 119.724L32.5547 118.614L33.1602 117.406L33.1925 117.341L33.243 117.291L33.355 117.176L33.4167 117.079C33.7922 116.407 34.1716 115.736 34.5535 115.068L34.6684 114.839L34.6965 114.79L34.8072 114.622C34.988 114.307 35.1743 113.996 35.3566 113.682L35.7421 112.995L35.8542 112.776L36.0967 112.408L36.1471 112.325H36.042L36.485 111.657L36.7681 111.231L36.8017 111.182L36.9363 110.911L37.0372 110.709V110.512L37.2278 110.51L38.0772 109.001L38.4599 108.314L38.4963 108.252L38.5846 108.095L38.9154 107.56L43.9473 99.9396H43.8464L44.3454 99.2599L44.459 99.0345L44.5136 99.0332L50.2659 91.2138L50.3095 91.162L50.4536 91.0175L51.0536 90.2606C52.3073 88.6309 53.5836 87.0188 54.8832 85.4268L56.7695 83.0469L58.7177 80.8592C60.0723 79.2917 61.4514 77.7442 62.8527 76.2158L64.1859 74.7219L65.0591 73.8473C66.4145 72.4134 67.7905 70.9954 69.1882 69.5978C69.7005 69.0857 70.2159 68.5764 70.7327 68.0703L71.9005 66.8562L73.7491 65.1774C75.5391 63.4927 77.3568 61.8407 79.2018 60.2214H79.13L80.0355 59.469L80.7545 58.8675C83.0468 56.8951 85.3827 54.9746 87.7573 53.1018L88.7036 52.3239L89.8077 51.5038C97.885 45.2915 106.421 39.6454 115.385 34.5662L116.851 33.707L117.775 33.2309C120.679 31.6316 123.627 30.0904 126.618 28.6083L126.985 28.4121L127.494 28.1767C130.561 26.6728 133.674 25.2312 136.829 23.8504L137.428 23.5714L137.883 23.3877C142.51 21.3891 147.233 19.5251 152.043 17.79H151.897L154.247 17.0051C158.705 15.4431 163.239 13.9938 167.845 12.6561H167.475L170.502 11.8979C174.362 10.8196 178.271 9.81815 182.23 8.89578L182.812 8.74303L183.482 8.60986Z"@@ -118,7 +118,7 @@ export const slackLogo = (props: LogoProps) => (</svg>);-export const discordLogo = (props: LogoProps) => (+const discordLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 800 620" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M677.676 51.8644C625.891 27.6353 570.519 10.0266 512.63 0C505.52 12.8537 497.214 30.1422 491.488 43.8951C429.95 34.6406 368.978 34.6406 308.572 43.8951C302.846 30.1422 294.352 12.8537 287.179 0C229.227 10.0266 173.792 27.7 122.006 51.9927C17.5548 209.833 -10.7604 363.753 3.39722 515.487C72.6751 567.222 139.814 598.649 205.819 619.214C222.116 596.785 236.651 572.942 249.173 547.813C225.325 538.752 202.484 527.569 180.902 514.587C186.628 510.346 192.229 505.911 197.639 501.348C329.273 562.916 472.297 562.916 602.358 501.348C607.832 505.911 613.432 510.346 619.095 514.587C597.449 527.633 574.546 538.815 550.699 547.878C563.22 572.942 577.692 596.849 594.052 619.278C660.121 598.713 727.322 567.286 796.6 515.487C813.212 339.588 768.222 187.082 677.676 51.8644ZM267.106 422.172C227.591 422.172 195.185 385.282 195.185 340.359C195.185 295.436 226.899 258.483 267.106 258.483C307.314 258.483 339.719 295.372 339.027 340.359C339.089 385.282 307.314 422.172 267.106 422.172ZM532.891 422.172C493.376 422.172 460.971 385.282 460.971 340.359C460.971 295.436 492.683 258.483 532.891 258.483C573.098 258.483 605.504 295.372 604.812 340.359C604.812 385.282 573.098 422.172 532.891 422.172Z"@@ -127,7 +127,7 @@ export const discordLogo = (props: LogoProps) => (</svg>);-export const teamsLogo = (props: LogoProps) => (+const teamsLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 2229 2074" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M1554.64 777.5H2130.35C2184.74 777.5 2228.83 821.592 2228.83 875.983V1400.38C2228.83 1600.28 2066.78 1762.33 1866.88 1762.33H1865.17C1665.27 1762.36 1503.2 1600.33 1503.17 1400.43V828.971C1503.17 800.544 1526.21 777.5 1554.64 777.5Z"@@ -156,7 +156,7 @@ export const teamsLogo = (props: LogoProps) => (</svg>);-export const telegramLogo = (props: LogoProps) => (+const telegramLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 240 240" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M120 240C186.274 240 240 186.274 240 120C240 53.7258 186.274 0 120 0C53.7258 0 0 53.7258 0 120C0 186.274 53.7258 240 120 240Z"@@ -169,7 +169,7 @@ export const telegramLogo = (props: LogoProps) => (</svg>);-export const twilioLogo = (props: LogoProps) => (+const twilioLogo = (props: LogoProps) => (<svg fill="#F22F46" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M15 0C6.7 0 0 6.7 0 15s6.7 15 15 15 15-6.7 15-15S23.3 0 15 0zm0 26C8.9 26 4 21.1 4 15S8.9 4 15 4s11 4.9 11 11-4.9 11-11 11zm6.8-14.7c0 1.7-1.4 3.1-3.1 3.1s-3.1-1.4-3.1-3.1 1.4-3.1 3.1-3.1 3.1 1.4 3.1 3.1zm0 7.4c0 1.7-1.4 3.1-3.1 3.1s-3.1-1.4-3.1-3.1c0-1.7 1.4-3.1 3.1-3.1s3.1 1.4 3.1 3.1zm-7.4 0c0 1.7-1.4 3.1-3.1 3.1s-3.1-1.4-3.1-3.1c0-1.7 1.4-3.1 3.1-3.1s3.1 1.4 3.1 3.1zm0-7.4c0 1.7-1.4 3.1-3.1 3.1S8.2 13 8.2 11.3s1.4-3.1 3.1-3.1 3.1 1.4 3.1 3.1z" /></svg>@@ -181,7 +181,7 @@ export const vercelLogo = (props: LogoProps) => (</svg>);-export const agentcardLogo = (props: LogoProps) => (+const agentcardLogo = (props: LogoProps) => (<svg viewBox="0 0 214 152" xmlns="http://www.w3.org/2000/svg" {...props}><pathclipRule="evenodd"@@ -201,7 +201,7 @@ export const linearLogo = (props: LogoProps) => (</svg>);-export const contextLogo = (props: LogoProps) => (+const contextLogo = (props: LogoProps) => (<svg viewBox="0 0 772.32 531.2" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M260.5,27.06v240.41c-29-28.17-69.08-44.96-113.07-43.26C69.5,227.24,5.16,289.98.31,367.81c-5.56,89.26,65.18,163.38,153.24,163.38,41.58,0,79.3-16.51,106.95-43.37h0c0,13.26,10.75,24.01,24.01,24.01h129.54c-51.07,0-96.29-24.98-124.23-63.34,2.81-5.4,5.32-10.98,7.47-16.76,0,0,0,0,0,0,.02-.12.06-.23.12-.35.46-1.2.89-2.4,1.3-3.6.41-1.22.81-2.42,1.2-3.64,0-.01,0-.02.01-.03.53-1.64,1.05-3.31,1.5-4.99,0,0,0,0,0,0,.02-.12.06-.23.08-.35,0,0,0-.01,0-.02.33-1.08.61-2.18.87-3.27,0-.02,0-.03.01-.04.12-.47.23-.95.35-1.43.27-1.08.52-2.15.74-3.23.06-.25.1-.5.17-.74.06-.29.12-.58.19-.89.04-.19.08-.37.13-.54.16-.85.33-1.7.47-2.55.04-.12.06-.25.08-.37.02-.1.04-.21.06-.33.12-.7.25-1.41.37-2.11.1-.58.19-1.18.29-1.76.02-.12.04-.23.04-.35.25-1.53.46-3.06.64-4.61.08-.72.17-1.45.25-2.17.04-.23.06-.45.08-.68h0c.06-.54.1-1.1.14-1.63h0c.02-.06.02-.13.02-.17.02-.19.04-.35.04-.54.1-.97.19-1.95.23-2.92.02-.1.04-.21.02-.31.06-.52.08-1.03.1-1.55.02-.1.02-.21.02-.31.04-.52.06-1.01.08-1.53h0c.04-.62.06-1.24.06-1.86h0c.02-.15.02-.27.02-.39.06-1.59.08-3.19.08-4.78h0c0-1.05-.02-2.11-.04-3.14,0-.39,0-.79-.02-1.16,0-.35-.02-.7-.04-1.06,0-.56-.02-1.12-.06-1.68,0-.29-.02-.58-.04-.87,0-.12,0-.23-.02-.33,0-.21-.02-.41-.04-.6,0-.19,0-.37-.02-.56,0-.08,0-.17-.02-.25-.02-.37-.04-.74-.06-1.1-.02-.37-.06-.72-.08-1.08,0-.08,0-.16-.02-.23-.04-.77-.12-1.55-.21-2.34-.02-.41-.06-.81-.1-1.2-.02-.14-.02-.29-.04-.41-.12-1.2-.27-2.38-.41-3.56-.06-.48-.12-.95-.19-1.43-.08-.6-.17-1.18-.25-1.76-.06-.37-.12-.72-.17-1.08-.06-.35-.1-.7-.17-1.03-.14-.85-.29-1.7-.43-2.52-.02-.12-.04-.25-.06-.37-.19-1.01-.39-2.03-.6-3.04-.08-.39-.15-.79-.25-1.16-.12-.58-.25-1.18-.37-1.76-.12-.54-.25-1.06-.37-1.59-.1-.46-.21-.91-.31-1.35-.15-.56-.29-1.1-.43-1.66-.1-.5-.25-.97-.37-1.47-.25-.89-.5-1.8-.74-2.71-.04-.1-.06-.21-.1-.31-.12-.43-.25-.89-.39-1.32-.27-.93-.56-1.84-.87-2.77-.12-.43-.27-.89-.41-1.32-.12-.35-.23-.68-.35-1.03-.1-.29-.19-.58-.29-.87-.1-.31-.23-.62-.33-.93-.33-.93-.66-1.86-1.01-2.79-.43-1.16-.89-2.3-1.34-3.44-.48-1.18-.95-2.36-1.47-3.52-.19-.43-.37-.87-.56-1.32-.33-.72-.66-1.43-.99-2.15-.1-.23-.21-.46-.33-.68-.1-.23-.23-.43-.33-.68-.85-1.78-1.72-3.58-2.65-5.34-.02-.08-.06-.14-.1-.23-.56-1.08-1.14-2.13-1.74-3.21-.56-1.03-1.16-2.05-1.76-3.06-.02-.06-.06-.14-.1-.21-.41-.72-.85-1.43-1.3-2.15-.89-1.49-1.82-2.94-2.77-4.39-.66-.99-1.32-2.01-2.03-3-.17-.23-.31-.48-.5-.7-.33-.48-.66-.97-1.03-1.47-.02-.02-.04-.06-.08-.1-.14-.23-.29-.43-.45-.66v-.02l-.1-.1c-.27-.37-.56-.77-.83-1.14-.17-.23-.33-.43-.5-.66-.31-.39-.62-.81-.93-1.2-.64-.85-1.3-1.7-1.99-2.55-.27-.35-.56-.7-.87-1.06-.6-.77-1.22-1.51-1.86-2.26-.83-.97-1.66-1.95-2.5-2.9-.52-.58-1.03-1.16-1.57-1.72-.58-.64-1.18-1.28-1.8-1.92-.25-.29-.52-.56-.81-.85h0c.29.29.56.56.81.85.62.64,1.22,1.28,1.8,1.92.54.56,1.05,1.14,1.57,1.72.85.95,1.68,1.92,2.5,2.9.64.74,1.26,1.49,1.86,2.26.31.35.6.7.87,1.06.68.85,1.34,1.7,1.99,2.55.31.39.62.81.93,1.2.17.23.33.44.5.66.27.37.56.77.83,1.14l.1.1c26.35-50.54,79.92-84.63,141.29-82.65,78.35,2.52,143.32,65.42,148.19,143.66,5.55,89.25-65.19,163.36-153.24,163.36h331.21c14.95,0,27.06-12.12,27.06-27.06V27.06c0-14.95-12.12-27.06-27.06-27.06h-457.7c-14.95,0-27.06,12.12-27.06,27.06ZM286.24,454.89s.01-.02.02-.03c0,0,0,.02-.01.02h0ZM286.62,454.23c.69-1.19,1.34-2.41,2-3.63-.66,1.21-1.31,2.44-1.99,3.62,0,0,0,0,0,.01Z"@@ -212,9 +212,9 @@ export const contextLogo = (props: LogoProps) => (export const notionLogo = (props: LogoProps) => <SiNotion {...props} />;-export const upstashLogo = (props: LogoProps) => <SiUpstash color="default" {...props} />;+const upstashLogo = (props: LogoProps) => <SiUpstash color="default" {...props} />;-export const arcanaLogo = (props: LogoProps) => (+const arcanaLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><circle cx="12" cy="12" r="3" fill="#1A1C1A" /><circle cx="5" cy="7" r="2" fill="#1A1C1A" />@@ -229,7 +229,7 @@ export const arcanaLogo = (props: LogoProps) => (</svg>);-export const supermemoryLogo = (props: LogoProps) => (+const supermemoryLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 39.467 32" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M39.126 12.632H24.606V.01h-4.692v13.695c0 1.454.574 2.851 1.595 3.88l11.856 11.958 3.318-3.346-8.758-8.831h11.204v-4.732ZM2.446 5.822l8.757 8.832H0v4.731h14.52v12.623h4.692V18.312c0-1.453-.573-2.847-1.595-3.88L5.764 2.476 2.446 5.822Z"@@ -238,7 +238,7 @@ export const supermemoryLogo = (props: LogoProps) => (</svg>);-export const hindsightLogo = (props: LogoProps) => (+const hindsightLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 186 139" xmlns="http://www.w3.org/2000/svg" {...props}><g stroke="#078BC2" strokeLinecap="round" strokeLinejoin="round" strokeWidth="8"><path d="m65 53-14-23M121 53l14-23M42 69l-20-5M144 69l20-5M61 96l-16 17M125 96l16 17" />@@ -258,7 +258,7 @@ export const hindsightLogo = (props: LogoProps) => (export const datadogLogo = (props: LogoProps) => <SiDatadog color="default" {...props} />;-export const honeycombLogo = (props: LogoProps) => (+const honeycombLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="m12 2 8.66 5v10L12 22l-8.66-5V7L12 2Zm0 2.31L5.34 8.15v7.7L12 19.69l6.66-3.84v-7.7L12 4.31Z"@@ -268,7 +268,7 @@ export const honeycombLogo = (props: LogoProps) => (</svg>);-export const kernelLogo = (props: LogoProps) => (+const kernelLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" {...props}><rect width="400" height="400" fill="#81B300" /><path@@ -278,53 +278,53 @@ export const kernelLogo = (props: LogoProps) => (</svg>);-export const airtableLogo = (props: LogoProps) => <SiAirtable color="default" {...props} />;+const airtableLogo = (props: LogoProps) => <SiAirtable color="default" {...props} />;-export const bitlyLogo = (props: LogoProps) => <SiBitly color="default" {...props} />;+const bitlyLogo = (props: LogoProps) => <SiBitly color="default" {...props} />;-export const brexLogo = (props: LogoProps) => <SiBrex {...props} />;+const brexLogo = (props: LogoProps) => <SiBrex {...props} />;-export const clickhouseLogo = (props: LogoProps) => <SiClickhouse color="default" {...props} />;+const clickhouseLogo = (props: LogoProps) => <SiClickhouse color="default" {...props} />;-export const cloudinaryLogo = (props: LogoProps) => <SiCloudinary color="default" {...props} />;+const cloudinaryLogo = (props: LogoProps) => <SiCloudinary color="default" {...props} />;-export const codaLogo = (props: LogoProps) => <SiCoda color="default" {...props} />;+const codaLogo = (props: LogoProps) => <SiCoda color="default" {...props} />;-export const egnyteLogo = (props: LogoProps) => <SiEgnyte color="default" {...props} />;+const egnyteLogo = (props: LogoProps) => <SiEgnyte color="default" {...props} />;-export const huggingFaceLogo = (props: LogoProps) => <SiHuggingface color="default" {...props} />;+const huggingFaceLogo = (props: LogoProps) => <SiHuggingface color="default" {...props} />;-export const makeLogo = (props: LogoProps) => <SiMake color="default" {...props} />;+const makeLogo = (props: LogoProps) => <SiMake color="default" {...props} />;-export const miroLogo = (props: LogoProps) => <SiMiro {...props} />;+const miroLogo = (props: LogoProps) => <SiMiro {...props} />;-export const mixpanelLogo = (props: LogoProps) => <SiMixpanel color="default" {...props} />;+const mixpanelLogo = (props: LogoProps) => <SiMixpanel color="default" {...props} />;-export const netlifyLogo = (props: LogoProps) => <SiNetlify color="default" {...props} />;+const netlifyLogo = (props: LogoProps) => <SiNetlify color="default" {...props} />;-export const oreillyLogo = (props: LogoProps) => <SiOreilly color="default" {...props} />;+const oreillyLogo = (props: LogoProps) => <SiOreilly color="default" {...props} />;-export const planetscaleLogo = (props: LogoProps) => <SiPlanetscale {...props} />;+const planetscaleLogo = (props: LogoProps) => <SiPlanetscale {...props} />;-export const posthogLogo = (props: LogoProps) => <SiPosthog {...props} />;+const posthogLogo = (props: LogoProps) => <SiPosthog {...props} />;-export const postmanLogo = (props: LogoProps) => <SiPostman color="default" {...props} />;+const postmanLogo = (props: LogoProps) => <SiPostman color="default" {...props} />;-export const razorpayLogo = (props: LogoProps) => <SiRazorpay {...props} />;+const razorpayLogo = (props: LogoProps) => <SiRazorpay {...props} />;export const sanityLogo = (props: LogoProps) => <SiSanity {...props} />;export const sentryLogo = (props: LogoProps) => <SiSentry {...props} />;-export const similarwebLogo = (props: LogoProps) => <SiSimilarweb {...props} />;+const similarwebLogo = (props: LogoProps) => <SiSimilarweb {...props} />;-export const stripeLogo = (props: LogoProps) => <SiStripe color="default" {...props} />;+const stripeLogo = (props: LogoProps) => <SiStripe color="default" {...props} />;-export const supabaseLogo = (props: LogoProps) => <SiSupabase color="default" {...props} />;+const supabaseLogo = (props: LogoProps) => <SiSupabase color="default" {...props} />;-export const ticktickLogo = (props: LogoProps) => <SiTicktick color="default" {...props} />;+const ticktickLogo = (props: LogoProps) => <SiTicktick color="default" {...props} />;-export const tinybirdLogo = (props: LogoProps) => (+const tinybirdLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 26 26" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M25 2.64 17.195.5 14.45 6.635zm-7.465 15.13-7.145-2.555L6.195 25.5z"@@ -334,17 +334,17 @@ export const tinybirdLogo = (props: LogoProps) => (</svg>);-export const todoistLogo = (props: LogoProps) => <SiTodoist color="default" {...props} />;+const todoistLogo = (props: LogoProps) => <SiTodoist color="default" {...props} />;-export const webflowLogo = (props: LogoProps) => <SiWebflow color="default" {...props} />;+const webflowLogo = (props: LogoProps) => <SiWebflow color="default" {...props} />;-export const wixLogo = (props: LogoProps) => <SiWix color="default" {...props} />;+const wixLogo = (props: LogoProps) => <SiWix color="default" {...props} />;-export const zapierLogo = (props: LogoProps) => <SiZapier color="default" {...props} />;+const zapierLogo = (props: LogoProps) => <SiZapier color="default" {...props} />;-export const zomatoLogo = (props: LogoProps) => <SiZomato color="default" {...props} />;+const zomatoLogo = (props: LogoProps) => <SiZomato color="default" {...props} />;-export const candidLogo = (props: LogoProps) => (+const candidLogo = (props: LogoProps) => (<svg viewBox="0 0 400 400" xmlns="http://www.w3.org/2000/svg" {...props}><rect fill="#febe10" height="400" rx="200" ry="200" width="400" x="0" y="0" /><path@@ -354,7 +354,7 @@ export const candidLogo = (props: LogoProps) => (</svg>);-export const embatLogo = (props: LogoProps) => (+const embatLogo = (props: LogoProps) => (// Cropped to the bird mark; the source asset is a full wordmark lockup on a// 340x340 canvas that renders illegibly small at icon sizes.<svg viewBox="33 139 59 62" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>@@ -364,7 +364,7 @@ export const embatLogo = (props: LogoProps) => (</svg>);-export const localFalconLogo = (props: LogoProps) => (+const localFalconLogo = (props: LogoProps) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" {...props}><g transform="translate(196.49, 75) scale(0.85)"><path@@ -381,7 +381,7 @@ export const localFalconLogo = (props: LogoProps) => (</svg>);-export const manufactLogo = (props: LogoProps) => (+const manufactLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" {...props}><rect fill="black" height="1000" rx="500" width="1000" /><path@@ -396,7 +396,7 @@ export const manufactLogo = (props: LogoProps) => (</svg>);-export const naturalLogo = (props: LogoProps) => (+const naturalLogo = (props: LogoProps) => (// Cropped to the square mark; the source asset is a full wordmark lockup// that renders illegibly small at icon sizes.<svg fill="none" viewBox="0 0 17.5 18" xmlns="http://www.w3.org/2000/svg" {...props}>@@ -407,7 +407,7 @@ export const naturalLogo = (props: LogoProps) => (</svg>);-export const neonLogo = (props: LogoProps) => (+const neonLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z"@@ -416,7 +416,7 @@ export const neonLogo = (props: LogoProps) => (</svg>);-export const mem0Logo = (props: LogoProps) => (+const mem0Logo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" {...props}><rect fill="#CBB2FF" height="100" rx="12" width="100" /><g fill="#09090B">@@ -425,7 +425,7 @@ export const mem0Logo = (props: LogoProps) => (</svg>);-export const ticketTailorLogo = (props: LogoProps) => (+const ticketTailorLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M21.328 19.239 15.283.631a.913.913 0 0 0-1.15-.586l-3.374 1.096a2.146 2.146 0 1 1-4.083 1.325L3.131 3.62a.73.73 0 0 0-.469.92l6.159 18.955a.73.73 0 0 0 .92.469l3.545-1.152a2.148 2.148 0 1 1 4.085-1.327l3.372-1.096a.913.913 0 0 0 .586-1.15zM10.302 14.52H8.578V8.345H6.506V6.673h5.857v1.672h-2.061zm6.865-3.577h-2.061v6.176H13.38v-6.176h-2.073V9.271h5.86z"@@ -434,7 +434,7 @@ export const ticketTailorLogo = (props: LogoProps) => (</svg>);-export const zernioLogo = (props: LogoProps) => (+const zernioLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 1000 1000" xmlns="http://www.w3.org/2000/svg" {...props}><rect width="1000" height="1000" fill="#eb3514" rx="161.29" /><path@@ -444,7 +444,7 @@ export const zernioLogo = (props: LogoProps) => (</svg>);-export const veltLogo = (props: LogoProps) => (+const veltLogo = (props: LogoProps) => (<svg fill="none" viewBox="50 50 130 130" xmlns="http://www.w3.org/2000/svg" {...props}><pathfill="currentColor"@@ -453,7 +453,7 @@ export const veltLogo = (props: LogoProps) => (</svg>);-export const sendblueLogo = (props: LogoProps) => (+const sendblueLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg" {...props}><pathfill="#008aff"@@ -466,7 +466,7 @@ export const sendblueLogo = (props: LogoProps) => (</svg>);-export const blooioLogo = (props: LogoProps) => (+const blooioLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 265 155" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M86.5954 73.4747C86.092 74.9551 85.6415 76.4636 85.2439 78C85.2439 78 83.0013 85 83.0013 97.0351C83.0013 109.07 82.9999 135.233 82.9999 135.233V154.268H107.111L138.202 154.268L151.24 154.268L153.486 154.268L209.393 154.268C218.091 154.256 225.81 152.846 232.55 150.038C239.459 147.077 245.24 143.058 249.893 137.982C254.687 132.906 258.282 126.843 260.679 119.793C263.217 112.743 264.486 104.988 264.486 96.5283C264.486 88.2092 263.217 80.5247 260.679 73.4747C258.282 66.4246 254.687 60.3616 249.893 55.2856C245.24 50.2095 239.459 46.2615 232.55 43.4415C225.81 40.4928 218.091 39.0123 209.393 39.0001L138.202 39C129.46 39 121.634 40.4805 114.725 43.4415C107.957 46.2615 102.176 50.2095 97.3818 55.2856C92.7288 60.3616 89.1334 66.4246 86.5954 73.4747Z"@@ -479,7 +479,7 @@ export const blooioLogo = (props: LogoProps) => (</svg>);-export const novuLogo = (props: LogoProps) => (+const novuLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M18.48 9.62a.72.72 0 0 1-1.235.503L8.007.68A12 12 0 0 1 18.48 1.898V9.62Zm3.36-4.49v4.49c0 3.656-4.44 5.466-6.996 2.853L4.909 2.319A11.98 11.98 0 0 0 0 12c0 2.555.799 4.924 2.16 6.87v-4.465c0-3.657 4.44-5.467 6.996-2.854l9.922 10.14A11.98 11.98 0 0 0 24 12c0-2.555-.799-4.924-2.16-6.87ZM6.755 13.9l9.22 9.425A12 12 0 0 1 5.52 22.102v-7.697a.72.72 0 0 1 1.235-.504Z"@@ -488,13 +488,13 @@ export const novuLogo = (props: LogoProps) => (</svg>);-export const liveblocksLogo = (props: LogoProps) => (+const liveblocksLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M14.5 5H3l3 3.8v4.5L14.5 5ZM9 19h12l-3-3.2v-5L9 19Z" fill="currentColor" /></svg>);-export const linqLogo = (props: LogoProps) => (+const linqLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 629.586 757.741" xmlns="http://www.w3.org/2000/svg" {...props}><pathfill="currentColor"@@ -507,7 +507,7 @@ export const linqLogo = (props: LogoProps) => (</svg>);-export const kapsoLogo = (props: LogoProps) => (+const kapsoLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" {...props}><path fill="#100e0d" d="M0 0h32v32H0z" /><path@@ -521,7 +521,7 @@ export const kapsoLogo = (props: LogoProps) => (</svg>);-export const photonLogo = (props: LogoProps) => (+const photonLogo = (props: LogoProps) => (<svg fill="none" viewBox="66 66 124 124" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M166.88 135.896H180.416C182.864 135.896 184.592 138.2 184.016 140.36L173.648 181.544C173.36 183.128 171.92 184.28 170.192 184.28H156.512C154.352 184.28 152.624 181.976 153.056 179.816L163.424 138.632C163.856 137.048 165.152 135.896 166.88 135.896ZM139.52 71.96H153.056C155.504 71.96 157.232 74.264 156.512 76.424L146.432 117.608C145.856 119.192 144.416 120.344 142.688 120.344H129.296C126.848 120.344 125.12 118.04 125.84 115.88L136.064 74.696C136.352 73.112 137.936 71.96 139.52 71.96ZM85.376 101.624H98.912C101.216 101.624 102.944 103.928 102.368 106.232L92.144 147.272C91.712 148.856 90.272 150.008 88.688 150.008H75.008C72.704 150.008 70.832 147.848 71.552 145.544L81.776 104.504C82.208 102.776 83.648 101.624 85.376 101.624Z"@@ -530,7 +530,7 @@ export const photonLogo = (props: LogoProps) => (</svg>);-export const dialLogo = (props: LogoProps) => (+const dialLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" {...props}><rect fill="#2C2C2A" height="512" rx="102" width="512" /><circle cx="256" cy="256" fill="#F1EFE8" r="56" />@@ -543,7 +543,7 @@ export const dialLogo = (props: LogoProps) => (</svg>);-export const agentphoneLogo = (props: LogoProps) => (+const agentphoneLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 236 240" xmlns="http://www.w3.org/2000/svg" {...props}><pathfill="currentColor"@@ -560,7 +560,7 @@ export const agentphoneLogo = (props: LogoProps) => (</svg>);-export const larkLogo = (props: LogoProps) => (+const larkLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" {...props}><rect width="16" height="16" rx="2" fill="white" /><path@@ -578,7 +578,7 @@ export const larkLogo = (props: LogoProps) => (</svg>);-export const beeperLogo = (props: LogoProps) => (+const beeperLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M52 144C52 65 115.7 0 196.3 0h119.4C395.4 0 460 64.3 460 144c-.1 42.9-18.8 79.9-44.9 104.5l-27.3 27.3c39.8 23.2 72 59.7 72 109.1 0 74-60 127.1-134 127.1H124V268.8C81.4 243.9 52 197.4 52 144Zm144.3-104C138 40 92 86.9 92 144s46 104 104.3 104H246l-27.6 139.8L387 220c19.3-18 33-45.2 33-76 0-58-47.5-104.6-104.3-104H196.3Z"@@ -606,7 +606,7 @@ export const typefullyLogo = (props: LogoProps) => ();// Source: https://www.gstatic.com/images/branding/productlogos/gmail_2026/v2/web/192px.svg-export const gmailLogo = (props: LogoProps) => (+const gmailLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 192 192" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M146 44h38v110c0 6.627-5.373 12-12 12h-20a6 6 0 0 1-6-6z" fill="url(#gmail-side)" /><path d="M46 44H8v110c0 6.627 5.373 12 12 12h20a6 6 0 0 0 6-6z" fill="#fc413d" />@@ -651,15 +651,15 @@ export const gmailLogo = (props: LogoProps) => (</svg>);-export const googlechatLogo = (props: LogoProps) => <SiGooglechat color="default" {...props} />;+const googlechatLogo = (props: LogoProps) => <SiGooglechat color="default" {...props} />;-export const whatsappLogo = (props: LogoProps) => <SiWhatsapp color="default" {...props} />;+const whatsappLogo = (props: LogoProps) => <SiWhatsapp color="default" {...props} />;-export const messengerLogo = (props: LogoProps) => <SiMessenger color="default" {...props} />;+const messengerLogo = (props: LogoProps) => <SiMessenger color="default" {...props} />;-export const xLogo = (props: LogoProps) => <SiX {...props} />;+const xLogo = (props: LogoProps) => <SiX {...props} />;-export const blitzreelsLogo = (props: LogoProps) => (+const blitzreelsLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 240 174" xmlns="http://www.w3.org/2000/svg" {...props}><path d="M85 0h155v174h-95L0 0h85Z" fill="#0E8062" opacity="0.85" /><path d="M0 0h215v174h-70L0 0Z" fill="#17FFA6" />@@ -676,7 +676,7 @@ export const muxLogo = (props: LogoProps) => (</svg>);-export const browserbaseLogo = (props: LogoProps) => (+const browserbaseLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg" {...props}><rect fill="white" height="124" width="134" x="30" y="36" /><path d="M111.168 116.901H83.168V109.901H111.168V116.901Z" fill="#FF4500" />@@ -690,7 +690,7 @@ export const browserbaseLogo = (props: LogoProps) => (</svg>);-export const jettyLogo = (props: LogoProps) => (+const jettyLogo = (props: LogoProps) => (<svgaria-label="Jetty"fill="none"@@ -739,7 +739,7 @@ export const jettyLogo = (props: LogoProps) => (</svg>);-export const agentBrowserLogo = (props: LogoProps) => (+const agentBrowserLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><rect height="16" rx="2" stroke="currentColor" strokeWidth="1.5" width="20" x="2" y="4" /><path d="M2 8h20" stroke="currentColor" strokeWidth="1.5" />@@ -754,11 +754,11 @@ export const agentBrowserLogo = (props: LogoProps) => (</svg>);-export const braintrustLogo = (props: LogoProps) => <SiBraintrust {...props} />;+const braintrustLogo = (props: LogoProps) => <SiBraintrust {...props} />;-export const jaegerLogo = (props: LogoProps) => <SiJaeger color="default" {...props} />;+const jaegerLogo = (props: LogoProps) => <SiJaeger color="default" {...props} />;-export const arizeLogo = (props: LogoProps) => (+const arizeLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 50 54.1" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M25.01 5.71c1.37-.05 2.65.64 3.37 1.81 6.87 9.89 13.73 19.79 20.56 29.69 1.35 1.79 1 4.33-.78 5.69l-.22.15c-1.92 1.29-4.53.77-5.81-1.15l-.09-.14c-4.73-6.8-9.43-13.61-14.1-20.42l-.28-.34c-1.88-2.67-3.74-2.67-5.57 0-4.77 6.84-9.53 13.7-14.29 20.57-.67 1.16-1.84 1.94-3.16 2.13-1.61.25-3.2-.52-4-1.94-.91-1.41-.84-3.24.17-4.58 2.28-3.31 4.59-6.61 6.89-9.92 4.54-6.51 9.07-13.03 13.6-19.55.78-1.29 2.2-2.05 3.71-2Z"@@ -771,7 +771,7 @@ export const arizeLogo = (props: LogoProps) => (</svg>);-export const raindropLogo = (props: LogoProps) => (+const raindropLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M12 2.25c3.93 4.92 6.55 8.58 6.55 11.7a6.55 6.55 0 1 1-13.1 0c0-3.12 2.62-6.78 6.55-11.7Z"@@ -780,7 +780,7 @@ export const raindropLogo = (props: LogoProps) => (</svg>);-export const shopifyLogo = (props: LogoProps) => (+const shopifyLogo = (props: LogoProps) => (<svg fill="none" viewBox="0 0 109.5 124.5" xmlns="http://www.w3.org/2000/svg" {...props}><pathd="M95.9 23.9c-.1-.6-.6-1-1.1-1-.5 0-9.3-.2-9.3-.2s-7.4-7.2-8.1-7.9c-.7-.7-2.2-.5-2.7-.3 0 0-1.4.4-3.7 1.1-.4-1.3-1-2.8-1.8-4.4-2.6-5-6.5-7.7-11.1-7.7h0c-.3 0-.6 0-1 .1-.1-.2-.3-.3-.4-.5-2-2.2-4.6-3.2-7.7-3.1-6 .2-12 4.5-16.8 12.2-3.4 5.4-6 12.2-6.8 17.5-6.9 2.1-11.7 3.6-11.8 3.7-3.5 1.1-3.6 1.2-4 4.5-.3 2.5-9.5 73-9.5 73l76.4 13.2 33.1-8.2S96 24.5 95.9 23.9ZM67.2 16.8c-1.8.5-3.8 1.2-5.9 1.8 0-3-.4-7.3-1.8-10.9 4.5.9 6.7 6 7.7 9.1Zm-10 3.1c-4 1.2-8.4 2.6-12.8 3.9 1.2-4.7 3.6-9.4 6.4-12.5 1.1-1.1 2.6-2.4 4.3-3.2 1.8 3.5 2.2 8.4 2.1 11.8ZM49.1 4c1.4 0 2.6.3 3.6.9-1.6.9-3.2 2.1-4.7 3.7-3.8 4.1-6.7 10.5-7.9 16.6-3.6 1.1-7.2 2.2-10.5 3.2C31.7 18.8 39.8 4.3 49.1 4Z"diff --git a/apps/docs/lib/templates/data.ts b/apps/docs/lib/templates/data.tsindex b3e52374f..429971d06 100644--- a/apps/docs/lib/templates/data.ts+++ b/apps/docs/lib/templates/data.ts@@ -13,7 +13,7 @@ export type { TemplateCategory, TemplateIntegration, TemplateSource } from "./maconst generatedTemplatesPath = join(process.cwd(), ".template-data/templates.json");-export const getTemplateEntries = async (): Promise<TemplateEntry[]> => {+const getTemplateEntries = async (): Promise<TemplateEntry[]> => {"use cache";cacheLife("max");diff --git a/apps/docs/next-env.d.ts b/apps/docs/next-env.d.tsindex a419cbe4e..ce4e94a6b 100644--- a/apps/docs/next-env.d.ts+++ b/apps/docs/next-env.d.ts@@ -1,7 +1,7 @@/// <reference types="next" />/// <reference types="next/image-types/global" />-import "./.next/dev/types/routes.d.ts";-import "./.next/dev/types/root-params.d.ts";+import "./.next/types/routes.d.ts";+import "./.next/types/root-params.d.ts";// NOTE: This file should not be edited// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.diff --git a/e2e/README.md b/e2e/README.mdindex 492245bf0..d62b1d879 100644--- a/e2e/README.md+++ b/e2e/README.md@@ -141,6 +141,9 @@ Fixture eval configs use the shared `e2eJudgeModel()` helper, which returns an O`agent-workflow-stress` uses eve's `mockModel` fixture helper so its 100-turnruns stay fast and deterministic. Its concurrent and sequential evals coverhigh-volume session execution and repeated session resumption respectively.+Its parallel-tool-calls eval scripts ten tool calls into one model step and+proves the durable runtime executes them concurrently, which a live model+cannot guarantee because it may split the calls across steps.## Fixturesdiff --git a/e2e/fixtures/agent-tools/evals/static-tools/fanout-authored.eval.ts b/e2e/fixtures/agent-tools/evals/static-tools/fanout-authored.eval.tsdeleted file mode 100644index 56d672ed5..000000000--- a/e2e/fixtures/agent-tools/evals/static-tools/fanout-authored.eval.ts+++ /dev/null@@ -1,40 +0,0 @@-import { defineEval } from "eve/evals";--import { FANOUT_SIZE, fanoutExecutionsReachBarrier } from "./fanout";--const TOOL_NAME = "fanout-barrier";-const LABELS = [- "fanout-authored-01",- "fanout-authored-02",- "fanout-authored-03",- "fanout-authored-04",- "fanout-authored-05",- "fanout-authored-06",- "fanout-authored-07",- "fanout-authored-08",- "fanout-authored-09",- "fanout-authored-10",-] as const;--export default defineEval({- tags: ["real-model"],- description: "Static tools smoke: ten authored tool calls begin concurrently.",- async test(t) {- const turn = await t.send(- [- `Call the \`${TOOL_NAME}\` tool exactly ${FANOUT_SIZE} separate times in one tool-use step.`,- `Use each label exactly once: ${LABELS.map((label) => `"${label}"`).join(", ")}.`,- "Start every call before waiting for any result. Do not use any other tool.",- "After every call returns, reply with exactly: authored fanout complete",- ].join("\n"),- );- turn.expectOk();-- t.succeeded();- t.calledTool(TOOL_NAME, { count: FANOUT_SIZE });- turn.eventsSatisfy(- "ten distinctly labeled authored executions reach the concurrency barrier",- (events) => fanoutExecutionsReachBarrier({ events, labels: LABELS, toolName: TOOL_NAME }),- );- },-});diff --git a/e2e/fixtures/agent-tools/evals/static-tools/fanout.ts b/e2e/fixtures/agent-tools/evals/static-tools/fanout.tsdeleted file mode 100644index 421719cc6..000000000--- a/e2e/fixtures/agent-tools/evals/static-tools/fanout.ts+++ /dev/null@@ -1,42 +0,0 @@-import type { MessageStreamEvent } from "eve/client";--export const FANOUT_SIZE = 10;--/** A serialized executor cannot release the fixture tool's concurrency barrier. */-export function fanoutExecutionsReachBarrier(input: {- readonly events: readonly MessageStreamEvent[];- readonly labels: readonly string[];- readonly toolName: string;-}): boolean {- const executions = input.events.flatMap((event) => {- if (event.type !== "action.result" || event.data.result.kind !== "tool-result") return [];- if (event.data.result.toolName !== input.toolName) return [];-- const count = readFiniteNumberField(event.data.result.output, "concurrentCallsAtRelease");- const label = readStringField(event.data.result.output, "label");- return count === undefined || label === undefined ? [] : [{ count, label }];- });- const expectedLabels = new Set(input.labels);-- return (- executions.length === FANOUT_SIZE &&- executions.every((execution) => execution.count === FANOUT_SIZE) &&- expectedLabels.size === FANOUT_SIZE &&- new Set(executions.map((execution) => execution.label)).size === FANOUT_SIZE &&- executions.every((execution) => expectedLabels.has(execution.label))- );-}--function readFiniteNumberField(value: unknown, field: string): number | undefined {- if (typeof value !== "object" || value === null || Array.isArray(value)) return undefined;-- const candidate = Reflect.get(value, field);- return typeof candidate === "number" && Number.isFinite(candidate) ? candidate : undefined;-}--function readStringField(value: unknown, field: string): string | undefined {- if (typeof value !== "object" || value === null || Array.isArray(value)) return undefined;-- const candidate = Reflect.get(value, field);- return typeof candidate === "string" ? candidate : undefined;-}diff --git a/e2e/fixtures/agent-workflow-stress/agent/agent.ts b/e2e/fixtures/agent-workflow-stress/agent/agent.tsindex 377b38e64..292443536 100644--- a/e2e/fixtures/agent-workflow-stress/agent/agent.ts+++ b/e2e/fixtures/agent-workflow-stress/agent/agent.ts@@ -1,14 +1,27 @@import { e2eAgentConfig } from "@eve-e2e/config";import { defineAgent } from "eve";-import { mockModel } from "eve/evals";+import { mockModel, type MockModelRequest, type MockModelResponse } from "eve/evals";++import { FANOUT_LABELS, FANOUT_REPLY, FANOUT_TOOL_NAME } from "./lib/fanout";export default defineAgent({// Harness config wires the workflow world; the model is always this// fixture's scripted mock....e2eAgentConfig(),- model: mockModel(- ({ lastUserMessage, userMessageCount }) =>- `stress-ack:${userMessageCount}:${lastUserMessage ?? ""}`,+ model: mockModel((request) =>+ request.lastUserMessage?.includes(`\`${FANOUT_TOOL_NAME}\``)+ ? respondToFanout(request)+ : `stress-ack:${request.userMessageCount}:${request.lastUserMessage ?? ""}`,),modelContextWindowTokens: 1_000_000,});++function respondToFanout(request: MockModelRequest): MockModelResponse {+ const roles = request.messages.map((message) => message.role);+ if (roles.lastIndexOf("tool") > roles.lastIndexOf("user")) {+ return { text: FANOUT_REPLY };+ }+ return {+ toolCalls: FANOUT_LABELS.map((label) => ({ name: FANOUT_TOOL_NAME, input: { label } })),+ };+}diff --git a/e2e/fixtures/agent-workflow-stress/agent/lib/fanout.ts b/e2e/fixtures/agent-workflow-stress/agent/lib/fanout.tsnew file mode 100644index 000000000..df40fbaad--- /dev/null+++ b/e2e/fixtures/agent-workflow-stress/agent/lib/fanout.ts@@ -0,0 +1,9 @@+/** The mock model asks for every label in one step when a prompt names this tool. */+export const FANOUT_TOOL_NAME = "fanout-barrier";++export const FANOUT_LABELS = Array.from(+ { length: 10 },+ (_, index) => `fanout-${String(index + 1).padStart(2, "0")}`,+);++export const FANOUT_REPLY = "fanout complete";diff --git a/e2e/fixtures/agent-tools/agent/tools/fanout-barrier.ts b/e2e/fixtures/agent-workflow-stress/agent/tools/fanout-barrier.tssimilarity index 69%rename from e2e/fixtures/agent-tools/agent/tools/fanout-barrier.tsrename to e2e/fixtures/agent-workflow-stress/agent/tools/fanout-barrier.tsindex b439ab2b4..56e5a267b 100644--- a/e2e/fixtures/agent-tools/agent/tools/fanout-barrier.ts+++ b/e2e/fixtures/agent-workflow-stress/agent/tools/fanout-barrier.ts@@ -1,7 +1,8 @@import { defineTool } from "eve/tools";-import { z } from "zod";-const EXPECTED_CONCURRENT_CALLS = 10;+import { FANOUT_LABELS } from "../lib/fanout";++const EXPECTED_CONCURRENT_CALLS = FANOUT_LABELS.length;const BARRIER_TIMEOUT_MS = 15_000;interface Barrier {@@ -14,12 +15,14 @@ interface Barrier {let activeBarrier: Barrier | undefined;export default defineTool({- description:- "Test-only tool: waits for ten concurrent calls before releasing them. Only call when the user explicitly asks to use `fanout-barrier`.",- inputSchema: z.object({- label: z.string(),- }),- async execute(input) {+ description: "Waits until every call in the same model step has started, then releases them.",+ inputSchema: {+ type: "object",+ properties: { label: { type: "string" } },+ required: ["label"],+ additionalProperties: false,+ },+ async execute(input: { label: string }) {const barrier = joinBarrier();try {@@ -39,7 +42,7 @@ function joinBarrier(): Barrier {activeBarrier = barrier;if (barrier.arrived >= EXPECTED_CONCURRENT_CALLS) {- throw new Error("fanout-barrier received more than ten concurrent calls");+ throw new Error(`fanout-barrier received more than ${EXPECTED_CONCURRENT_CALLS} calls`);}barrier.arrived += 1;@@ -65,7 +68,11 @@ async function waitForRelease(released: Promise<void>): Promise<void> {released,new Promise<never>((_resolve, reject) => {timer = setTimeout(() => {- reject(new Error("fanout-barrier timed out waiting for ten concurrent calls"));+ reject(+ new Error(+ `fanout-barrier timed out waiting for ${EXPECTED_CONCURRENT_CALLS} concurrent calls`,+ ),+ );}, BARRIER_TIMEOUT_MS);}),]);diff --git a/e2e/fixtures/agent-workflow-stress/evals/parallel-tool-calls.eval.ts b/e2e/fixtures/agent-workflow-stress/evals/parallel-tool-calls.eval.tsnew file mode 100644index 000000000..0a5a09a37--- /dev/null+++ b/e2e/fixtures/agent-workflow-stress/evals/parallel-tool-calls.eval.ts@@ -0,0 +1,44 @@+import type { MessageStreamEvent } from "eve/client";+import { defineEval } from "eve/evals";++import { FANOUT_LABELS, FANOUT_REPLY, FANOUT_TOOL_NAME } from "../agent/lib/fanout";++export default defineEval({+ description: "Workflow tools: every tool call in one model step runs concurrently.",+ tags: ["workflow", "tools", "concurrent"],++ async test(t) {+ // The fixture's mock model answers this prompt with all ten calls in a+ // single step, so a serialized executor can never release the barrier.+ const turn = await t.send(`Call \`${FANOUT_TOOL_NAME}\` once for each label.`);+ turn.expectOk();++ t.succeeded();+ t.calledTool(FANOUT_TOOL_NAME, { count: FANOUT_LABELS.length });+ t.messageIncludes(FANOUT_REPLY);+ turn.eventsSatisfy("every labeled call reached the concurrency barrier together", (events) =>+ everyCallReachedBarrier(events),+ );+ },+});++function everyCallReachedBarrier(events: readonly MessageStreamEvent[]): boolean {+ const executions = events.flatMap((event) => {+ if (event.type !== "action.result" || event.data.result.kind !== "tool-result") return [];+ if (event.data.result.toolName !== FANOUT_TOOL_NAME) return [];++ const output = event.data.result.output;+ if (typeof output !== "object" || output === null) return [];+ const { concurrentCallsAtRelease, label } = output as Record<string, unknown>;+ return typeof concurrentCallsAtRelease === "number" && typeof label === "string"+ ? [{ concurrentCallsAtRelease, label }]+ : [];+ });++ return (+ executions.length === FANOUT_LABELS.length &&+ executions.every((execution) => execution.concurrentCallsAtRelease === FANOUT_LABELS.length) &&+ new Set(executions.map((execution) => execution.label)).size === FANOUT_LABELS.length &&+ executions.every((execution) => FANOUT_LABELS.includes(execution.label))+ );+}diff --git a/package.json b/package.jsonindex f55c63f53..4c886913e 100644--- a/package.json+++ b/package.json@@ -23,6 +23,7 @@"release": "pnpm build && node ./scripts/assert-changeset-publish-packages.mjs && changeset publish","test": "pnpm test:unit && pnpm test:integration","test:e2e": "turbo run test:e2e --concurrency=1",+ "test:framework-fixtures": "pnpm --filter eve run test:framework-fixtures","test:integration": "turbo run test:integration --filter=eve && turbo run test:integration --filter=\"!eve\"","test:scenario": "turbo run test:scenario","test:tui": "pnpm --filter eve run test:tui",diff --git a/packages/eve-code/extension/lib/computer-use-driver-source.ts b/packages/eve-code/extension/lib/computer-use-driver-source.tsindex 22b279cf8..9fb0fc113 100644--- a/packages/eve-code/extension/lib/computer-use-driver-source.ts+++ b/packages/eve-code/extension/lib/computer-use-driver-source.ts@@ -5,7 +5,7 @@ export const SERVER_MJS_SOURCE =export const CLIENT_MJS_SOURCE ='import http from "node:http";\nimport { env } from "node:process";\n\nconst socketPath = env.COMPUTER_USE_SOCKET_PATH;\nconst body = env.COMPUTER_USE_REQUEST;\n\nif (body === undefined) {\n throw new Error("COMPUTER_USE_REQUEST is required");\n}\n\nconst deadline = Date.now() + 120_000;\nconst response = await new Promise((resolve, reject) => {\n const request = http.request(\n {\n socketPath,\n method: "POST",\n path: "/call",\n headers: {\n "content-length": Buffer.byteLength(body),\n "content-type": "application/json",\n "x-computer-use-deadline": String(deadline),\n },\n },\n (incoming) => {\n incoming.on("error", reject);\n incoming.setEncoding("utf8");\n let responseBody = "";\n incoming.on("data", (chunk) => {\n responseBody += chunk;\n });\n incoming.on("end", () => {\n resolve({ body: responseBody, statusCode: incoming.statusCode ?? 500 });\n });\n },\n );\n const timer = setTimeout(\n () => request.destroy(new Error("computer-use request deadline exceeded")),\n Math.max(0, deadline - Date.now()),\n );\n request.once("close", () => clearTimeout(timer));\n request.on("error", reject);\n request.end(body);\n});\n\nif (response.statusCode !== 200) {\n process.stderr.write(response.body);\n process.exitCode = 1;\n} else {\n process.stdout.write(response.body);\n}\n';-export const STATE_MJS_SOURCE =+const STATE_MJS_SOURCE ='const MAX_GROUNDING_ELEMENTS = 80;\n\n/**\n * @typedef {{\n * element_index?: number;\n * frame?: { h?: number; w?: number; x?: number; y?: number };\n * label?: unknown;\n * [key: string]: unknown;\n * }} GroundingElement\n */\n\n/**\n * Keep the model-facing state aligned with the visible desktop screenshot.\n *\n * @param {unknown[]} elements\n * @returns {GroundingElement[]}\n */\nexport function selectGroundingElements(elements, screen = { width: 1920, height: 1080 }) {\n return elements\n .filter((element) => isVisibleLabeledElement(element, screen))\n .slice(0, MAX_GROUNDING_ELEMENTS);\n}\n\n/**\n * @param {unknown} value\n * @returns {value is GroundingElement}\n */\nfunction isVisibleLabeledElement(value, screen) {\n if (typeof value !== "object" || value === null) return false;\n const element = /** @type {GroundingElement} */ (value);\n const frame = element.frame;\n if (typeof element.label !== "string" || element.label.trim().length === 0) return false;\n if (typeof frame !== "object" || frame === null) return false;\n if (\n !Number.isFinite(frame.x) ||\n !Number.isFinite(frame.y) ||\n !Number.isFinite(frame.w) ||\n !Number.isFinite(frame.h)\n ) {\n return false;\n }\n\n const x = /** @type {number} */ (frame.x);\n const y = /** @type {number} */ (frame.y);\n const width = /** @type {number} */ (frame.w);\n const height = /** @type {number} */ (frame.h);\n return (\n width > 0 &&\n height > 0 &&\n x < screen.width &&\n y < screen.height &&\n x + width > 0 &&\n y + height > 0\n );\n}\n';export const TYPING_MJS_SOURCE =@@ -14,7 +14,7 @@ export const TYPING_MJS_SOURCE =export const POINTER_MOTION_MJS_SOURCE ='const FRAME_MS = 16;\n\nexport function pointerMotionPlan(start, end, options = {}) {\n const style = options.style ?? "natural";\n const distance = Math.hypot(end.x - start.x, end.y - start.y);\n const durationMs = options.durationMs ?? naturalDuration(distance, style);\n if (distance < 2 || durationMs === 0) {\n return { phases: [[{ ...end, delayMs: 0 }]], settleMs: 0 };\n }\n\n if (style === "precision" && distance >= 120) {\n const ratio = 0.92 + deterministicUnit(start, end, 7) * 0.04;\n const undershoot = {\n x: Math.round(start.x + (end.x - start.x) * ratio),\n y: Math.round(start.y + (end.y - start.y) * ratio),\n };\n // Cover most of the distance quickly, then spend a disproportionate\n // share of the duration continuously correcting the final 4\u20138%.\n const firstDuration = Math.round(durationMs * 0.62);\n return {\n phases: [\n bezierPhase(start, undershoot, firstDuration, "natural", 11),\n bezierPhase(undershoot, end, durationMs - firstDuration, "precision", 23),\n ],\n settleMs: 0,\n };\n }\n\n return {\n phases: [bezierPhase(start, end, durationMs, style, 17)],\n settleMs: style === "natural" ? 15 + Math.round(deterministicUnit(start, end, 31) * 15) : 0,\n };\n}\n\nfunction bezierPhase(start, end, durationMs, style, salt) {\n const distance = Math.hypot(end.x - start.x, end.y - start.y);\n const steps = Math.max(2, Math.min(60, Math.round(durationMs / FRAME_MS)));\n const perpendicular = unitPerpendicular(start, end);\n const bendLimit = style === "precision" ? 8 : Math.min(70, distance * 0.09);\n const bend = (deterministicUnit(start, end, salt) * 2 - 1) * bendLimit;\n const c1 = {\n x: start.x + (end.x - start.x) * 0.28 + perpendicular.x * bend,\n y: start.y + (end.y - start.y) * 0.28 + perpendicular.y * bend,\n };\n const c2 = {\n x: start.x + (end.x - start.x) * 0.76 + perpendicular.x * bend * 0.65,\n y: start.y + (end.y - start.y) * 0.76 + perpendicular.y * bend * 0.65,\n };\n const delayMs = durationMs / steps;\n return Array.from({ length: steps }, (_, index) => {\n // This asymmetric timing curve accelerates quickly and eases into the\n // target without the perfectly mirrored feel of smoothstep.\n const progress = (index + 1) / steps;\n const t = 1 - (1 - progress) ** 2.35;\n const point = cubicBezier(start, c1, c2, end, t);\n return {\n x: index === steps - 1 ? end.x : Math.round(point.x),\n y: index === steps - 1 ? end.y : Math.round(point.y),\n delayMs: index === steps - 1 ? 0 : delayMs,\n };\n });\n}\n\nfunction cubicBezier(start, c1, c2, end, t) {\n const inverse = 1 - t;\n return {\n x:\n inverse ** 3 * start.x +\n 3 * inverse ** 2 * t * c1.x +\n 3 * inverse * t ** 2 * c2.x +\n t ** 3 * end.x,\n y:\n inverse ** 3 * start.y +\n 3 * inverse ** 2 * t * c1.y +\n 3 * inverse * t ** 2 * c2.y +\n t ** 3 * end.y,\n };\n}\n\nfunction naturalDuration(distance, style) {\n const base = style === "precision" ? 150 : 110;\n const scale = style === "precision" ? 0.35 : 0.28;\n const minimum = style === "precision" ? 180 : 140;\n const maximum = style === "precision" ? 650 : 550;\n return Math.round(Math.min(maximum, Math.max(minimum, base + distance * scale)));\n}\n\nfunction unitPerpendicular(start, end) {\n const dx = end.x - start.x;\n const dy = end.y - start.y;\n const length = Math.hypot(dx, dy) || 1;\n return { x: -dy / length, y: dx / length };\n}\n\nfunction deterministicUnit(start, end, salt) {\n let value =\n (Math.imul(Math.round(start.x), 73_856_093) ^\n Math.imul(Math.round(start.y), 19_349_663) ^\n Math.imul(Math.round(end.x), 83_492_791) ^\n Math.imul(Math.round(end.y), 2_654_435_761) ^\n salt) >>>\n 0;\n value ^= value << 13;\n value ^= value >>> 17;\n value ^= value << 5;\n return (value >>> 0) / 0x1_0000_0000;\n}\n';-export const PACKAGE_JSON_SOURCE =+const PACKAGE_JSON_SOURCE ='{\n "name": "computer-use-driver",\n "private": true,\n "type": "module",\n "dependencies": {\n "@trycua/cua-driver": "0.12.5"\n }\n}\n';export const COMPUTER_USE_DRIVER_SOURCES = {diff --git a/packages/eve-code/extension/lib/computer-use.ts b/packages/eve-code/extension/lib/computer-use.tsindex f36a81255..030b1e6a6 100644--- a/packages/eve-code/extension/lib/computer-use.ts+++ b/packages/eve-code/extension/lib/computer-use.ts@@ -149,7 +149,7 @@ type LaunchAction =type DriverAction = { action: string } & Record<string, unknown>;-export interface ComputerUseDriverRequest {+interface ComputerUseDriverRequest {action: DriverAction;screenshotPath: string;}diff --git a/packages/eve-code/extension/lib/generated-paths.ts b/packages/eve-code/extension/lib/generated-paths.tsindex f5395d0f4..70747cb7e 100644--- a/packages/eve-code/extension/lib/generated-paths.ts+++ b/packages/eve-code/extension/lib/generated-paths.ts@@ -35,7 +35,7 @@ const GENERATED_PATH_RULES: readonly {},];-export interface GeneratedPathMatch {+interface GeneratedPathMatch {readonly path: string;readonly label: string;readonly remedy: string;diff --git a/packages/eve-code/extension/lib/grep-search.ts b/packages/eve-code/extension/lib/grep-search.tsindex 28d6001dd..145a41616 100644--- a/packages/eve-code/extension/lib/grep-search.ts+++ b/packages/eve-code/extension/lib/grep-search.ts@@ -1,6 +1,6 @@import { shellQuote } from "./shell.ts";-export const DEFAULT_GREP_LIMIT = 50;+const DEFAULT_GREP_LIMIT = 50;export const MAX_GREP_LIMIT = 200;export const MAX_GREP_COMMAND_BYTES = 256 * 1024;export const MAX_GREP_LINE_BYTES = 8 * 1024;@@ -10,9 +10,9 @@ const REGEX_META = /[\\^$.*+?()[\]{}|]/u;export const GREP_OUTPUT_MODES = ["files_with_matches", "content", "count"] as const;-export type GrepOutputMode = (typeof GREP_OUTPUT_MODES)[number];+type GrepOutputMode = (typeof GREP_OUTPUT_MODES)[number];-export interface GrepCommandInput {+interface GrepCommandInput {readonly contextLines: number;readonly glob: string | undefined;readonly ignoreCase: boolean;@@ -31,7 +31,7 @@ export interface GrepSearchResult {readonly truncated: boolean;}-export interface GrepSandbox {+interface GrepSandbox {resolvePath(path: string): string;run(input: {abortSignal?: AbortSignal;@@ -39,7 +39,7 @@ export interface GrepSandbox {}): PromiseLike<{ exitCode: number; stderr: string; stdout: string }>;}-export interface GrepToolInput {+interface GrepToolInput {readonly context?: number;readonly glob?: string;readonly ignoreCase?: boolean;diff --git a/packages/eve-code/extension/lib/guidelines.ts b/packages/eve-code/extension/lib/guidelines.tsindex 6e6b19a72..67d72f2da 100644--- a/packages/eve-code/extension/lib/guidelines.ts+++ b/packages/eve-code/extension/lib/guidelines.ts@@ -23,7 +23,7 @@ export interface SandboxLike {}>;}-export interface RepoGuidelines {+interface RepoGuidelines {/** Repo-relative path of the root guideline file, or null when absent. */rootPath: string | null;/** Root guideline content (capped at {@link MAX_GUIDELINE_BYTES}). */diff --git a/packages/eve-code/extension/lib/patch.ts b/packages/eve-code/extension/lib/patch.tsindex 6b20a7184..60807ab25 100644--- a/packages/eve-code/extension/lib/patch.ts+++ b/packages/eve-code/extension/lib/patch.ts@@ -4,7 +4,7 @@ import type { SandboxSession } from "eve/sandbox";import { shellQuote } from "./shell.ts";-export type PatchHunk =+type PatchHunk =| { readonly type: "add"; readonly path: string; readonly contents: string }| { readonly type: "delete"; readonly path: string }| {@@ -14,7 +14,7 @@ export type PatchHunk =readonly chunks: readonly UpdateChunk[];};-export interface UpdateChunk {+interface UpdateChunk {readonly oldLines: readonly string[];readonly newLines: readonly string[];readonly changeContext?: string;diff --git a/packages/eve-code/extension/lib/prwatch-github.ts b/packages/eve-code/extension/lib/prwatch-github.tsindex d140919b5..94c12290e 100644--- a/packages/eve-code/extension/lib/prwatch-github.ts+++ b/packages/eve-code/extension/lib/prwatch-github.ts@@ -5,7 +5,7 @@ import extension from "../extension.ts";const GITHUB_API = "https://api.github.com";-export const RepoSchema = z+const RepoSchema = z.string().trim().regex(/^[A-Za-z0-9-]+\/[A-Za-z0-9._-]+$/u)@@ -56,7 +56,7 @@ export interface PullRequestWatchSnapshot {readonly url: string;}-export interface PullRequestWatchNotificationState {+interface PullRequestWatchNotificationState {readonly previousSnapshot: PullRequestWatchSnapshot | null;readonly redHeadPolls: number;readonly redHeadWakeSent: boolean;diff --git a/packages/eve-code/extension/lib/prwatch-registry.ts b/packages/eve-code/extension/lib/prwatch-registry.tsindex 4c0f2922e..454104dfd 100644--- a/packages/eve-code/extension/lib/prwatch-registry.ts+++ b/packages/eve-code/extension/lib/prwatch-registry.ts@@ -11,7 +11,7 @@ export interface PrwatchRegistration extends PrwatchTarget {readonly callId: string;}-export interface PrwatchRecord {+interface PrwatchRecord {readonly callId: string;readonly cancelled: boolean;}diff --git a/packages/eve/package.json b/packages/eve/package.jsonindex c51313281..6d73cc335 100644--- a/packages/eve/package.json+++ b/packages/eve/package.json@@ -491,6 +491,7 @@"dev": "pnpm run build:compiled && node ./scripts/copy-runtime-assets.mjs && tsc -p tsconfig.dev.json --watch --preserveWatchOutput","prepack": "pnpm run build && node ../../scripts/copy-package-license.mjs .","test": "pnpm run test:unit && pnpm run test:integration",+ "test:framework-fixtures": "pnpm run build:compiled && vitest run --config vitest.framework-fixtures.config.ts","test:integration": "pnpm run build:js && vitest run --config vitest.integration.config.ts","test:scenario": "pnpm run build:compiled && vitest run --config vitest.scenario.config.ts","test:unit": "pnpm run build:compiled && vitest run --config vitest.unit.config.ts",@@ -498,8 +499,7 @@"typecheck": "pnpm run check:web-template && pnpm run build:compiled && tsc -p tsconfig.json --noEmit","generate:web-template": "node src/setup/build.ts --write","check:web-template": "node src/setup/build.ts --check",- "test:tui": "pnpm run build:js && tsc -p tsconfig.tui.json --noEmit && node test/tui-client/run-all.mjs",- "test:vercel": "vitest run --config vitest.vercel.config.ts"+ "test:tui": "pnpm run build:js && tsc -p tsconfig.tui.json --noEmit && node test/tui-client/run-all.mjs"},"dependencies": {"nitro": "3.0.260903-beta",diff --git a/packages/eve/scripts/build-rolldown.mjs b/packages/eve/scripts/build-rolldown.mjsindex 0bf4d5b75..aba1f7399 100644--- a/packages/eve/scripts/build-rolldown.mjs+++ b/packages/eve/scripts/build-rolldown.mjs@@ -19,7 +19,7 @@ import { join, parse, relative } from "node:path";import { buildWithNitroRolldown } from "./nitro-rolldown.mjs";import vendoredZod from "./vendor-compiled/zod.mjs";-import { createVendoredDependencyWarningFilter } from "./vendor-warning-log.mjs";+import { onVendoredDependencyLog } from "../src/internal/bundler/vendored-dependency-log.ts";/*** Names of the CJS-interop helpers that rolldown injects into its@@ -286,8 +286,6 @@ const input = Object.fromEntries(}),);-const warningFilter = createVendoredDependencyWarningFilter();-await buildWithNitroRolldown({input,external: isExternalPackageSpecifier,@@ -338,7 +336,7 @@ await buildWithNitroRolldown({// silent `undefined` reads deep inside the runtime.topLevelVar: false,},- onLog: warningFilter.onLog,+ onLog: onVendoredDependencyLog,});// Vue integration — separate build that resolves `#` subpath imports so the@@ -395,7 +393,7 @@ if (vueSourceFiles.length > 0) {minify: false,sourcemap: false,},- onLog: warningFilter.onLog,+ onLog: onVendoredDependencyLog,});}@@ -452,6 +450,6 @@ if (svelteSourceFiles.length > 0) {minify: false,sourcemap: false,},- onLog: warningFilter.onLog,+ onLog: onVendoredDependencyLog,});}diff --git a/packages/eve/scripts/vendor-compiled.mjs b/packages/eve/scripts/vendor-compiled.mjsindex bd9271b46..3d0023d37 100644--- a/packages/eve/scripts/vendor-compiled.mjs+++ b/packages/eve/scripts/vendor-compiled.mjs@@ -31,7 +31,7 @@ const scriptFiles = [fileURLToPath(import.meta.url),join(packageRoot, "package.json"),join(here, "nitro-rolldown.mjs"),- join(here, "vendor-warning-log.mjs"),+ join(packageRoot, "src", "internal", "bundler", "vendored-dependency-log.ts"),...(await collectFilesRecursively(vendorCompiledDir, [".mjs", ".d.ts"])),];diff --git a/packages/eve/scripts/vendor-compiled/_shared.mjs b/packages/eve/scripts/vendor-compiled/_shared.mjsindex aa289c7bc..172b9eee5 100644--- a/packages/eve/scripts/vendor-compiled/_shared.mjs+++ b/packages/eve/scripts/vendor-compiled/_shared.mjs@@ -48,7 +48,7 @@ import { dirname, isAbsolute, join, parse, posix, relative } from "node:path";import { fileURLToPath } from "node:url";import { buildWithNitroRolldown } from "../nitro-rolldown.mjs";-import { createVendoredDependencyWarningFilter } from "../vendor-warning-log.mjs";+import { onVendoredDependencyLog } from "../../src/internal/bundler/vendored-dependency-log.ts";const declarationsDir = fileURLToPath(new URL("./declarations/", import.meta.url));const require = createRequire(import.meta.url);@@ -673,7 +673,6 @@ async function bundleStandaloneModule({packageRoot,sharedSpecifiers,}) {- const warningFilter = createVendoredDependencyWarningFilter();const entries = getModuleEntries(module, packageInfo);const platform = getModulePlatform(module);@@ -701,7 +700,7 @@ async function bundleStandaloneModule({minify: true,sourcemap: false,},- onLog: warningFilter.onLog,+ onLog: onVendoredDependencyLog,});}@@ -713,7 +712,6 @@ async function bundleModuleGroup({compiledRoot,sharedSpecifiers,}) {- const warningFilter = createVendoredDependencyWarningFilter();const entrypoints = Object.fromEntries(preparedModules.flatMap(({ module, packageInfo }) =>getModuleEntries(module, packageInfo).map((entry) => [@@ -761,7 +759,7 @@ async function bundleModuleGroup({minify: true,sourcemap: false,},- onLog: warningFilter.onLog,+ onLog: onVendoredDependencyLog,});}diff --git a/packages/eve/scripts/vendor-warning-log.mjs b/packages/eve/scripts/vendor-warning-log.mjsdeleted file mode 100644index 772d9530a..000000000--- a/packages/eve/scripts/vendor-warning-log.mjs+++ /dev/null@@ -1,49 +0,0 @@-function normalizePath(value) {- return value.replaceAll("\\", "/");-}--function isNodeModulesPath(filePath) {- return normalizePath(filePath).split("/").includes("node_modules");-}--function hasPathSegments(filePath, segments) {- const pathSegments = normalizePath(filePath).split("/").filter(Boolean);- return pathSegments.some((_, index) =>- segments.every((segment, offset) => pathSegments[index + offset] === segment),- );-}--function isCompiledVendorPath(filePath) {- return (- hasPathSegments(filePath, [".generated", "compiled"]) ||- hasPathSegments(filePath, ["dist", "src", "compiled"])- );-}--function getLogFilePaths(log) {- if (typeof log === "string") {- return [];- }-- return [log.id, ...(log.ids ?? []), log.loc?.file].filter((value) => typeof value === "string");-}--function isVendoredDependencyWarning(log) {- const filePaths = getLogFilePaths(log);- return (- filePaths.length > 0 &&- filePaths.every((filePath) => isNodeModulesPath(filePath) || isCompiledVendorPath(filePath))- );-}--export function createVendoredDependencyWarningFilter() {- return {- onLog(level, log, defaultHandler) {- if (level === "warn" && isVendoredDependencyWarning(log)) {- return;- }-- defaultHandler(level, log);- },- };-}diff --git a/packages/eve/src/channel/channel-address.ts b/packages/eve/src/channel/channel-address.tsindex 1a65fc33b..696dd487f 100644--- a/packages/eve/src/channel/channel-address.ts+++ b/packages/eve/src/channel/channel-address.ts@@ -43,7 +43,7 @@ export type ChannelAddressDeliveryOptions<TState = undefined> = [TState] extends* Dynamic handle for whichever durable session currently owns one channel-local address.* Only {@link send} may create a session when the address is unowned.*/-export interface ChannelAddress<TState = undefined> {+interface ChannelAddress<TState = undefined> {readonly continuationToken: string;deliver(input: SendPayload, options: ChannelAddressDeliveryOptions<TState>): Promise<Session>;send(@@ -62,9 +62,7 @@ export interface ChannelAddress<TState = undefined> {}/** Factory for binding a route-local continuation token to a {@link ChannelAddress}. */-export type ChannelAddressFn<TState = undefined> = (- continuationToken: string,-) => ChannelAddress<TState>;+type ChannelAddressFn<TState = undefined> = (continuationToken: string) => ChannelAddress<TState>;/** Creates one channel address backed by the runtime's continuation dispatch primitive. */export function createChannelAddress<TState = undefined>(input: {diff --git a/packages/eve/src/channel/compiled-channel.ts b/packages/eve/src/channel/compiled-channel.tsindex 0acd5d7d4..7dae800b9 100644--- a/packages/eve/src/channel/compiled-channel.ts+++ b/packages/eve/src/channel/compiled-channel.ts@@ -27,12 +27,12 @@ const channelInstrumentationKindGlobal = globalThis as ChannelInstrumentationKinchannelInstrumentationKindGlobal[CHANNEL_INSTRUMENTATION_KINDS] ??= new Map();const channelInstrumentationKinds = channelInstrumentationKindGlobal[CHANNEL_INSTRUMENTATION_KINDS];-export interface ChannelBuildMetadata {+interface ChannelBuildMetadata {readonly externalCredentials?: unknown;readonly manifest?: JsonObject;}-export type ChannelBuildMetadataFactory = (channelName: string) => ChannelBuildMetadata;+type ChannelBuildMetadataFactory = (channelName: string) => ChannelBuildMetadata;/** Structural identity shared by public authored channels and compiled channels. */export interface ChannelReference<diff --git a/packages/eve/src/channel/cross-channel-receive.ts b/packages/eve/src/channel/cross-channel-receive.tsindex c26a1d593..d96213ee2 100644--- a/packages/eve/src/channel/cross-channel-receive.ts+++ b/packages/eve/src/channel/cross-channel-receive.ts@@ -20,7 +20,7 @@ import type { ResolvedChannelDefinition } from "#runtime/types.js";/*** Options for sending a message to a channel selected with `ctx.to(...)`.*/-export interface CrossChannelSendOptions {+interface CrossChannelSendOptions {readonly auth: SessionAuthContext | null;readonly turnPolicy?: TurnPolicy;/** Updates the session policy; omission preserves it. New sessions default to auto, schedules to cohort. */@@ -125,7 +125,7 @@ interface InvokeChannelReceiveInput {/*** Shared authored `receive(input, ctx)` invocation used by route and schedule delivery.*/-export async function invokeChannelReceive(args: InvokeChannelReceiveInput): Promise<Session> {+async function invokeChannelReceive(args: InvokeChannelReceiveInput): Promise<Session> {if (!args.target.receive) {throw new Error(args.describeMissingReceive());}diff --git a/packages/eve/src/channel/forwarded-principal.ts b/packages/eve/src/channel/forwarded-principal.tsindex 8d523dd27..b79b1baab 100644--- a/packages/eve/src/channel/forwarded-principal.ts+++ b/packages/eve/src/channel/forwarded-principal.ts@@ -55,7 +55,7 @@ export type TrustedForwarders = (assertion: ForwardedAssertion,) => boolean | Promise<boolean>;-export type ForwardedPrincipalParseResult =+type ForwardedPrincipalParseResult =| {readonly forwardedPrincipal: ForwardedPrincipal;readonly ok: true;@@ -72,7 +72,7 @@ export type ForwardedPrincipalParseResult =* assertion, or the stamped forwarded contexts once a trusted forwarder's* assertion is accepted.*/-export type ResolvedForwardedPrincipal =+type ResolvedForwardedPrincipal =| {readonly accepted: false;readonly auth: SessionAuthContext;diff --git a/packages/eve/src/channel/instrumentation.test.ts b/packages/eve/src/channel/instrumentation.test.tsindex 67e051b23..76b5d4bf1 100644--- a/packages/eve/src/channel/instrumentation.test.ts+++ b/packages/eve/src/channel/instrumentation.test.ts@@ -4,6 +4,7 @@ import type { ChannelAdapter } from "#channel/adapter.js";import { buildChannelInstrumentationProjection } from "#channel/instrumentation.js";import { resolveAudience } from "#channel/audience.js";import type { AudienceContext } from "#shared/conversation-context.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const audienceInput: AudienceContext<Record<string, unknown>> = {auth: null,@@ -98,6 +99,7 @@ describe("channel instrumentation", () => {});it("ignores an asynchronous audience classifier", () => {+ const warn = vi.spyOn(console, "warn").mockImplementation(() => undefined);const adapter: ChannelAdapter = {instrumentation: { audience: () => Promise.resolve("public") as never },kind: "failing-classifier",@@ -105,9 +107,13 @@ describe("channel instrumentation", () => {};expect(resolveAudience(adapter, audienceInput)).toBe("unknown");+ expect(warn).toHaveBeenCalledExactlyOnceWith(+ "ignoring channel audience classifier because it returned a Promise",+ );});it("consumes a rejected classifier promise before failing closed", async () => {+ const warn = vi.spyOn(console, "warn").mockImplementation(() => undefined);const unhandledRejection = vi.fn();process.once("unhandledRejection", unhandledRejection);const adapter: ChannelAdapter = {@@ -123,6 +129,9 @@ describe("channel instrumentation", () => {expect(unhandledRejection).not.toHaveBeenCalled();process.removeListener("unhandledRejection", unhandledRejection);+ expect(warn).toHaveBeenCalledExactlyOnceWith(+ "ignoring channel audience classifier because it returned a Promise",+ );});it("does not log authored classifier failures verbatim", () => {@@ -144,6 +153,7 @@ describe("channel instrumentation", () => {});it("observes rejected thenables before ignoring channel metadata", async () => {+ const logs = captureLogRecords();let observed = false;const promise = Promise.reject(new Error("metadata failed"));const originalCatch = promise.catch.bind(promise);@@ -169,5 +179,17 @@ describe("channel instrumentation", () => {await Promise.resolve();expect(observed).toBe(true);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring instrumentation projection because it returned a Promise",+ }),+ );+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignored instrumentation projection Promise rejected",+ }),+ );});});diff --git a/packages/eve/src/channel/resolve-text.ts b/packages/eve/src/channel/resolve-text.tsindex a7693476a..d042c9967 100644--- a/packages/eve/src/channel/resolve-text.ts+++ b/packages/eve/src/channel/resolve-text.ts@@ -1,7 +1,7 @@import type { InputOption, InputResponse } from "#shared/input.js";/** The request fields plain text is resolved against. */-export interface TextResolvableRequest {+interface TextResolvableRequest {readonly allowFreeform?: boolean;readonly options?: readonly InputOption[];readonly requestId: string;diff --git a/packages/eve/src/channel/schedule.ts b/packages/eve/src/channel/schedule.tsindex d13c815d9..70e15407f 100644--- a/packages/eve/src/channel/schedule.ts+++ b/packages/eve/src/channel/schedule.ts@@ -33,7 +33,7 @@ export const SCHEDULE_ADAPTER: ChannelAdapter = {* Loaded shape of one schedule for the dispatcher. Either `run` is* defined (authored handler) or `markdown` is defined (fire-and-forget).*/-export interface ScheduleDispatchInput {+interface ScheduleDispatchInput {readonly scheduleId: string;readonly run?: ScheduleRunHandler;readonly markdown?: string;@@ -56,7 +56,7 @@ export interface ScheduleDispatchInput {* handler started (for telemetry / task-result observability) and the* `waitUntil` promises the handler registered.*/-export interface ScheduleDispatchResult {+interface ScheduleDispatchResult {readonly sessions: readonly Session[];readonly waitUntilTasks: readonly Promise<unknown>[];}diff --git a/packages/eve/src/channel/session-callback.ts b/packages/eve/src/channel/session-callback.tsindex ed7160bbc..58f92b423 100644--- a/packages/eve/src/channel/session-callback.ts+++ b/packages/eve/src/channel/session-callback.ts@@ -5,7 +5,7 @@ import { createEveCallbackRoutePath } from "#protocol/routes.js";import { normalizePublicEveRoutePath } from "#shared/eve-route-path.js";import { isReservedIpAddress } from "#shared/network-address.js";-export type SessionCallbackParseResult =+type SessionCallbackParseResult =| {readonly callback: SessionCallback;readonly ok: true;diff --git a/packages/eve/src/channel/types.ts b/packages/eve/src/channel/types.tsindex 7cd6f3440..83d6d30f6 100644--- a/packages/eve/src/channel/types.ts+++ b/packages/eve/src/channel/types.ts@@ -139,14 +139,6 @@ export interface SessionAuthContext {readonly subject?: string;}-/**- * Runtime-provided function that writes one event to the event stream.- *- * Backed by `getWritable()` in the workflow runtime. Not part of the adapter- * interface: the runtime always writes events itself.- */-export type EventEmitFn = (event: UnstampedMessageStreamEvent) => Promise<void>;-// ---------------------------------------------------------------------------// Deliver payload// ---------------------------------------------------------------------------diff --git a/packages/eve/src/cli/acp/command.ts b/packages/eve/src/cli/acp/command.tsindex 3f203068c..a3f47fdd6 100644--- a/packages/eve/src/cli/acp/command.ts+++ b/packages/eve/src/cli/acp/command.ts@@ -24,7 +24,7 @@ export type RunAcpServer = (input: {export type ResolveVerifiedRemoteDevelopmentClient =typeof import("#setup/verified-remote-client.js").resolveVerifiedRemoteDevelopmentClient;-export interface RegisterAcpCommandOptions {+interface RegisterAcpCommandOptions {readonly applicationContext: CliApplicationContext;readonly eveVersion: string;readonly program: Command;diff --git a/packages/eve/src/cli/agent-command.ts b/packages/eve/src/cli/agent-command.tsindex e5e755f24..63867c1b4 100644--- a/packages/eve/src/cli/agent-command.ts+++ b/packages/eve/src/cli/agent-command.ts@@ -3,7 +3,7 @@ import type { AgentWorkspace } from "#internal/project-context.js";import type { CliApplicationContext } from "./application-command.js";-export type AgentCommandRequirement = (command: Command) => boolean;+type AgentCommandRequirement = (command: Command) => boolean;async function selectWorkspaceAgent(workspace: AgentWorkspace,diff --git a/packages/eve/src/cli/agent-detection.test.ts b/packages/eve/src/cli/agent-detection.test.tsindex 2703dbd7c..fa4615f18 100644--- a/packages/eve/src/cli/agent-detection.test.ts+++ b/packages/eve/src/cli/agent-detection.test.ts@@ -1,6 +1,8 @@import { afterEach, describe, expect, it, vi } from "vitest";-import { CODING_AGENT_ENV_MARKERS, isCodingAgentLaunch } from "./agent-detection.js";+import { CODING_AGENT_ENV_MARKERS } from "#setup/primitives/coding-agent-env.js";++import { isCodingAgentLaunch } from "./agent-detection.js";afterEach(() => {vi.unstubAllEnvs();diff --git a/packages/eve/src/cli/agent-detection.ts b/packages/eve/src/cli/agent-detection.tsindex f6bde528a..98883cb8c 100644--- a/packages/eve/src/cli/agent-detection.ts+++ b/packages/eve/src/cli/agent-detection.ts@@ -1,9 +1,5 @@import { determineAgent } from "#compiled/@vercel/detect-agent/index.js";-// The canonical marker list lives with the subprocess primitives, where every-// spawned `vercel` strips it; re-exported here for the detection tests.-export { CODING_AGENT_ENV_MARKERS } from "#setup/primitives/coding-agent-env.js";-/*** Whether this CLI invocation was launched by an AI coding agent (Claude Code,* Cursor, Codex, ...) rather than a human at a terminal. Wrapsdiff --git a/packages/eve/src/cli/application-command.ts b/packages/eve/src/cli/application-command.tsindex 14661f0b6..27b544a58 100644--- a/packages/eve/src/cli/application-command.ts+++ b/packages/eve/src/cli/application-command.ts@@ -9,7 +9,7 @@ export interface CliApplicationContext {resolveAgent(): Promise<EveProjectContext>;}-export type CliApplicationRootRequirement = (command: Command) => boolean;+type CliApplicationRootRequirement = (command: Command) => boolean;/** Adds application-root resolution to a project-scoped CLI command. */export function applicationCommand(diff --git a/packages/eve/src/cli/application-root.test.ts b/packages/eve/src/cli/application-root.test.tsindex 54979a282..92d80dfb6 100644--- a/packages/eve/src/cli/application-root.test.ts+++ b/packages/eve/src/cli/application-root.test.ts@@ -1,15 +1,18 @@import { describe, expect, it, vi } from "vitest";-import {- findCliApplicationRoot,- resolveCliApplicationProject,- type ResolveCliApplicationRootDependencies,-} from "#cli/application-root.js";+import { findCliApplicationRoot, resolveCliApplicationProject } from "#cli/application-root.js";import {createDiscoverErrorDiagnostic,DISCOVER_PROJECT_NOT_FOUND,} from "#discover/diagnostics.js";-import { DiscoveryProjectResolutionError } from "#discover/project.js";+import { DiscoveryProjectResolutionError, resolveDiscoveryProject } from "#discover/project.js";++vi.mock("#discover/project.js", async (importOriginal) => ({+ ...(await importOriginal<typeof import("#discover/project.js")>()),+ resolveDiscoveryProject: vi.fn(),+}));++const resolveDiscoveryProjectMock = vi.mocked(resolveDiscoveryProject);function projectNotFound(path: string): DiscoveryProjectResolutionError {return new DiscoveryProjectResolutionError(@@ -21,12 +24,6 @@ function projectNotFound(path: string): DiscoveryProjectResolutionError {);}-function dependencies(- implementation: ResolveCliApplicationRootDependencies["resolveDiscoveryProject"],-): ResolveCliApplicationRootDependencies {- return { resolveDiscoveryProject: vi.fn(implementation) };-}-describe("CLI application root", () => {it("returns the complete project resolved by discovery", async () => {const project = {@@ -34,48 +31,46 @@ describe("CLI application root", () => {appRoot: "/repo",layout: "nested" as const,};- const deps = dependencies(async () => project);+ resolveDiscoveryProjectMock.mockResolvedValueOnce(project);- await expect(resolveCliApplicationProject("/repo/agent/tools", deps)).resolves.toEqual(project);+ await expect(resolveCliApplicationProject("/repo/agent/tools")).resolves.toEqual(project);});it("finds a named agent workspace member", async () => {- const deps = dependencies(async () => ({+ resolveDiscoveryProjectMock.mockResolvedValueOnce({agentRoot: "/repo/agents/billing/agent",appRoot: "/repo/agents/billing",layout: "nested",- }));+ });- await expect(findCliApplicationRoot("/repo/agents/billing/tools", deps)).resolves.toBe(+ await expect(findCliApplicationRoot("/repo/agents/billing/tools")).resolves.toBe("/repo/agents/billing",);});it("finds flat application roots", async () => {- const deps = dependencies(async () => ({+ resolveDiscoveryProjectMock.mockResolvedValueOnce({agentRoot: "/repo/agents/billing",appRoot: "/repo/agents/billing",layout: "flat",- }));+ });- await expect(findCliApplicationRoot("/repo/agents/billing", deps)).resolves.toBe(+ await expect(findCliApplicationRoot("/repo/agents/billing")).resolves.toBe("/repo/agents/billing",);});it("returns undefined when finding from outside an application", async () => {- const deps = dependencies(async (path) => {+ resolveDiscoveryProjectMock.mockImplementationOnce(async (path) => {throw projectNotFound(path ?? process.cwd());});- await expect(findCliApplicationRoot("/workspace/packages", deps)).resolves.toBeUndefined();+ await expect(findCliApplicationRoot("/workspace/packages")).resolves.toBeUndefined();});it("does not hide unexpected discovery failures", async () => {- const deps = dependencies(async () => {- throw new Error("read failed");- });+ resolveDiscoveryProjectMock.mockRejectedValueOnce(new Error("read failed"));- await expect(findCliApplicationRoot("/workspace", deps)).rejects.toThrow("read failed");+ await expect(findCliApplicationRoot("/workspace")).rejects.toThrow("read failed");});});diff --git a/packages/eve/src/cli/application-root.ts b/packages/eve/src/cli/application-root.tsindex 6fa6714a0..e6de702cc 100644--- a/packages/eve/src/cli/application-root.ts+++ b/packages/eve/src/cli/application-root.ts@@ -4,29 +4,19 @@ import {type ResolvedDiscoveryProject,} from "#discover/project.js";-export interface ResolveCliApplicationRootDependencies {- readonly resolveDiscoveryProject: typeof resolveDiscoveryProject;-}--const defaultDependencies: ResolveCliApplicationRootDependencies = {- resolveDiscoveryProject,-};-/** Resolves the nearest enclosing eve application and agent roots. */export async function resolveCliApplicationProject(cwd: string = process.cwd(),- dependencies: ResolveCliApplicationRootDependencies = defaultDependencies,): Promise<ResolvedDiscoveryProject> {- return dependencies.resolveDiscoveryProject(cwd);+ return resolveDiscoveryProject(cwd);}/** Finds the nearest enclosing eve application. */export async function findCliApplicationRoot(cwd: string = process.cwd(),- dependencies: ResolveCliApplicationRootDependencies = defaultDependencies,): Promise<string | undefined> {try {- return (await dependencies.resolveDiscoveryProject(cwd)).appRoot;+ return (await resolveDiscoveryProject(cwd)).appRoot;} catch (error) {if (error instanceof DiscoveryProjectResolutionError) return undefined;throw error;diff --git a/packages/eve/src/cli/commands/channel-add-conflicts.ts b/packages/eve/src/cli/commands/channel-add-conflicts.tsdeleted file mode 100644index 05025cf67..000000000--- a/packages/eve/src/cli/commands/channel-add-conflicts.ts+++ /dev/null@@ -1,114 +0,0 @@-import { join } from "node:path";--import type { ChannelKind } from "#setup/scaffold/index.js";-import type { DisabledChannelReasons } from "#setup/cli/index.js";--import { compileChannelDefinition } from "#compiler/normalize-channel.js";-import { createCompiledBindingNamespaceLoader } from "#compiler/load-binding-namespace.js";-import type { AgentModuleBinding } from "#compiler/source-graph.js";-import { discoverAgent } from "#discover/discover-agent.js";-import { EVE_SESSION_ROUTE_PATH } from "#protocol/routes.js";--const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH = "channels/eve.ts";-const SCAFFOLDED_SLACK_CHANNEL_LOGICAL_PATH = "channels/slack.ts";--/**- * Existing authored registrations that affect the scaffolded channel picker- * or would conflict with a generated channel module.- */-export interface ExistingChannelRegistrations {- readonly disabledChannelReasons: DisabledChannelReasons;- readonly webRouteOwners: readonly string[];- readonly slackOwners: readonly string[];-}--/**- * Inspects compiled authored channels so custom filenames still disable the- * scaffold option for the channel behavior they register.- */-export async function inspectExistingChannelRegistrations(- projectRoot: string,-): Promise<ExistingChannelRegistrations> {- const agentRoot = join(projectRoot, "agent");- const { manifest } = await discoverAgent({ agentRoot, appRoot: projectRoot });- const webRouteOwners = new Set<string>();- const slackOwners = new Set<string>();-- for (const source of manifest.channels) {- const binding: AgentModuleBinding = {- backing: {- externalDependencies: [],- kind: "filesystem",- sourcePath: join(agentRoot, source.logicalPath),- },- logicalPath: source.logicalPath,- owner: { kind: "application" },- };- const compiled = await compileChannelDefinition(agentRoot, source, {- binding,- loadNamespace: createCompiledBindingNamespaceLoader({- bindings: { [source.sourceId]: binding },- registries: [],- }),- });- if (compiled.kind !== "channel") continue;- for (const definition of compiled.definitions) {- if (definition.kind !== "channel") {- continue;- }- if (definition.method === "POST" && definition.urlPath === EVE_SESSION_ROUTE_PATH) {- webRouteOwners.add(source.logicalPath);- }- if (definition.adapterKind === "slack") {- slackOwners.add(source.logicalPath);- }- }- }-- const disabledChannelReasons: Partial<Record<ChannelKind, string>> = {};- if (- [...webRouteOwners].some((logicalPath) => logicalPath !== SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)- ) {- disabledChannelReasons.web = `POST ${EVE_SESSION_ROUTE_PATH} already registered`;- }- if (slackOwners.size > 0) {- disabledChannelReasons.slack = "Slack channel already registered";- }-- return {- disabledChannelReasons,- webRouteOwners: [...webRouteOwners],- slackOwners: [...slackOwners],- };-}--/**- * Rejects scaffolding when another authored module already owns behavior- * emitted by the generated channel module.- */-export function assertCanAddSelectedChannels(- selectedChannels: readonly ChannelKind[],- registrations: ExistingChannelRegistrations,-): void {- if (selectedChannels.includes("web")) {- const conflictingOwner = registrations.webRouteOwners.find(- (logicalPath) => logicalPath !== SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH,- );- if (conflictingOwner !== undefined) {- throw new Error(- `Cannot scaffold Web Chat because agent/${conflictingOwner} already defines POST ${EVE_SESSION_ROUTE_PATH}. Web Chat scaffolds the same eve session routes.`,- );- }- }-- if (selectedChannels.includes("slack")) {- const conflictingOwner = registrations.slackOwners.find(- (logicalPath) => logicalPath !== SCAFFOLDED_SLACK_CHANNEL_LOGICAL_PATH,- );- if (conflictingOwner !== undefined) {- throw new Error(- `Cannot scaffold Slack because agent/${conflictingOwner} already defines a Slack channel. Slack scaffolding would register the channel again.`,- );- }- }-}diff --git a/packages/eve/src/cli/commands/info.test.ts b/packages/eve/src/cli/commands/info.test.tsindex 438539b25..c591f3b23 100644--- a/packages/eve/src/cli/commands/info.test.ts+++ b/packages/eve/src/cli/commands/info.test.ts@@ -2,7 +2,7 @@ import { describe, expect, test, vi } from "vitest";import { COMPILE_METADATA_KIND, COMPILE_METADATA_VERSION } from "#compiler/artifacts.js";import type { CompileAgentResult } from "#compiler/compile-agent.js";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { defineInstructions } from "#public/definitions/instructions.js";import { defineSchedule } from "#public/definitions/schedule.js";import { getApplicationInfo } from "#internal/application/paths.js";diff --git a/packages/eve/src/cli/commands/init-target.ts b/packages/eve/src/cli/commands/init-target.tsindex 7c212d55e..98a04208f 100644--- a/packages/eve/src/cli/commands/init-target.ts+++ b/packages/eve/src/cli/commands/init-target.ts@@ -17,7 +17,7 @@ const ENVIRONMENT_ONLY_ENTRIES = new Set([".vscode",]);-export type InitTarget =+type InitTarget =| {kind: "existing";projectPath: string;diff --git a/packages/eve/src/cli/commands/init-telemetry.ts b/packages/eve/src/cli/commands/init-telemetry.tsindex d98748df8..38becb9e4 100644--- a/packages/eve/src/cli/commands/init-telemetry.ts+++ b/packages/eve/src/cli/commands/init-telemetry.ts@@ -1,6 +1,6 @@import type { EveCliSetupFailureCode } from "#cli/telemetry/index.js";-export type InitTargetFailureCode = Extract<+type InitTargetFailureCode = Extract<EveCliSetupFailureCode,"target_conflict" | "target_filesystem" | "target_invalid" | "workspace_input">;diff --git a/packages/eve/src/cli/commands/registry-declared-setups.ts b/packages/eve/src/cli/commands/registry-declared-setups.tsindex 725714f26..34a446128 100644--- a/packages/eve/src/cli/commands/registry-declared-setups.ts+++ b/packages/eve/src/cli/commands/registry-declared-setups.ts@@ -8,7 +8,7 @@ import type { RegistryCommandLogger, RegistrySetupDependencies } from "./registrimport type { RegistrySetupCommand } from "./registry-setup-command.js";import { headlessSetupContinuation, serializeHeadlessSetupEvent } from "./setup-headless.js";-export interface DeclaredSetupOptions {+interface DeclaredSetupOptions {yes?: boolean;force?: boolean;nonInteractive?: boolean;diff --git a/packages/eve/src/cli/commands/registry-install-transaction.ts b/packages/eve/src/cli/commands/registry-install-transaction.tsindex 524d15a37..b0fca9172 100644--- a/packages/eve/src/cli/commands/registry-install-transaction.ts+++ b/packages/eve/src/cli/commands/registry-install-transaction.ts@@ -47,7 +47,7 @@ async function snapshotFile(path: string): Promise<Snapshot> {}}-export async function snapshotRegistryInstall(+async function snapshotRegistryInstall(appRoot: string,item: unknown,): Promise<readonly Snapshot[]> {@@ -55,7 +55,7 @@ export async function snapshotRegistryInstall(return await Promise.all(paths.map((path) => snapshotFile(resolve(appRoot, path))));}-export async function rollbackRegistryInstall(+async function rollbackRegistryInstall(appRoot: string,snapshots: readonly Snapshot[],): Promise<{ readonly restored: boolean; readonly changed: readonly string[] }> {@@ -74,16 +74,16 @@ export async function rollbackRegistryInstall(return { restored: changed.length === 0, changed };}-export type RegistryInstallFailureCode = "pnpm_build_policy" | "dependency_install";+type RegistryInstallFailureCode = "pnpm_build_policy" | "dependency_install";-export function registryInstallFailureCode(error: unknown): RegistryInstallFailureCode {+function registryInstallFailureCode(error: unknown): RegistryInstallFailureCode {const message = error instanceof Error ? error.message : String(error);return message.includes("ERR_PNPM_IGNORED_BUILDS") || message.includes("Ignored build scripts")? "pnpm_build_policy": "dependency_install";}-export function registryInstallFailureMessage(code: RegistryInstallFailureCode): string {+function registryInstallFailureMessage(code: RegistryInstallFailureCode): string {return code === "pnpm_build_policy"? "Dependency installation stopped because pnpm requires build-script decisions. Run `pnpm approve-builds`, then retry the eve add command.": "Dependency installation failed. Retry the eve add command in a terminal for details.";diff --git a/packages/eve/src/cli/commands/registry-pnpm-build-policy-flow.ts b/packages/eve/src/cli/commands/registry-pnpm-build-policy-flow.tsindex 9f0dafeed..a6a529b5e 100644--- a/packages/eve/src/cli/commands/registry-pnpm-build-policy-flow.ts+++ b/packages/eve/src/cli/commands/registry-pnpm-build-policy-flow.ts@@ -15,7 +15,7 @@ const PNPM_BUILD_POLICY_ANSWER_KEY = "install.pnpm.buildScripts";const AUTO_ACCEPT_RECOMMENDED_ITEMS = new Set(["eve/self-modification"]);type PnpmBuildPolicyChoice = PnpmBuildPolicyAction | "abort";-export interface DeclaredPnpmBuildPolicy {+interface DeclaredPnpmBuildPolicy {readonly packages: readonly string[];readonly optional: true;readonly recommendedAction: "ignore-optional";diff --git a/packages/eve/src/cli/commands/registry-presentation.ts b/packages/eve/src/cli/commands/registry-presentation.tsindex 3f98ac874..99bcfcea7 100644--- a/packages/eve/src/cli/commands/registry-presentation.ts+++ b/packages/eve/src/cli/commands/registry-presentation.ts@@ -18,7 +18,7 @@ export interface RegistrySearchPresentationSection {total: number;}-export function normalizeRegistryText(value: string): string {+function normalizeRegistryText(value: string): string {return sanitizeForTerminal(value).replaceAll('\\"', '"').replaceAll("\\'", "'")diff --git a/packages/eve/src/cli/commands/registry-project.ts b/packages/eve/src/cli/commands/registry-project.tsindex 84affa171..9b2cbf065 100644--- a/packages/eve/src/cli/commands/registry-project.ts+++ b/packages/eve/src/cli/commands/registry-project.ts@@ -17,7 +17,7 @@ interface RegistryPackage {config: RegistryConfig;}-export interface AddRegistryMappingsResult {+interface AddRegistryMappingsResult {added: string[];skippedBuiltIn: string[];skippedExisting: string[];diff --git a/packages/eve/src/cli/commands/registry-search-presentation.ts b/packages/eve/src/cli/commands/registry-search-presentation.tsdeleted file mode 100644index 3dc14593b..000000000--- a/packages/eve/src/cli/commands/registry-search-presentation.ts+++ /dev/null@@ -1,83 +0,0 @@-import type { RegistrySearchItem } from "#compiled/shadcn-registry/index.js";-import { createCliTheme, sanitizeForTerminal } from "#cli/ui/output.js";-import { clipVisible, wrapVisibleLine } from "#cli/ui/terminal-text.js";--export function normalizeRegistryText(value: string): string {- return sanitizeForTerminal(value)- .replaceAll('\\"', '"')- .replaceAll("\\'", "'")- .replaceAll(/\s+/gu, " ")- .trim();-}--function registryDescriptionSummary(description: string): string {- const normalized = normalizeRegistryText(description);- return normalized.match(/^.*?[.!?](?=\s|$)/u)?.[0] ?? normalized;-}--function renderSearchItem(- item: RegistrySearchItem,- address: string,- width: number,- theme: ReturnType<typeof createCliTheme>,-): string {- const valueWidth = Math.max(1, width - 4);- const addressLines = wrapVisibleLine(normalizeRegistryText(address), valueWidth);- const name = normalizeRegistryText(item.name);- const title = name.split("/").at(-1) ?? name;- const lines = [` ${theme.label(title)}`, ...addressLines.map((line) => ` ${line}`)];- if (!item.description) return lines.join("\n");-- const description = registryDescriptionSummary(item.description);- if (description.length === 0) return lines.join("\n");-- const wrapped = wrapVisibleLine(description, valueWidth);- const descriptionLines =- wrapped.length <= 2- ? wrapped- : [wrapped[0]!, `${clipVisible(wrapped[1]!, Math.max(1, valueWidth - 1)).trimEnd()}…`];- lines.push(...descriptionLines.map((line) => theme.muted(` ${line}`)));- return lines.join("\n");-}--export function printRegistrySearchResults(- logger: { log(message: string): void },- result: { items: RegistrySearchItem[] },- options: {- json?: boolean;- query: string | undefined;- sections: readonly {- label: string;- items: RegistrySearchItem[];- total: number;- address(item: RegistrySearchItem): string;- }[];- },-): void {- if (options.json) {- logger.log(JSON.stringify(result, null, 2));- return;- }- if (result.items.length === 0) {- const query = options.query && normalizeRegistryText(options.query);- logger.log(query ? `No registry items match "${query}".` : "No registry items found.");- return;- }-- const theme = createCliTheme();- const width = Math.max(20, process.stdout.columns ?? 80);- const sections = options.sections.flatMap((section) => {- if (section.items.length === 0) return [];- const count = `${section.total} result${section.total === 1 ? "" : "s"}`;- const detail =- section.items.length < section.total ? `showing ${section.items.length} of ${count}` : count;- const heading = `${theme.label(section.label)} ${theme.muted(`(${detail})`)}`;- return [- [- heading,- ...section.items.map((item) => renderSearchItem(item, section.address(item), width, theme)),- ].join("\n"),- ];- });- logger.log(sections.join("\n"));-}diff --git a/packages/eve/src/cli/commands/registry.ts b/packages/eve/src/cli/commands/registry.tsindex f764e3d12..ae04943d5 100644--- a/packages/eve/src/cli/commands/registry.ts+++ b/packages/eve/src/cli/commands/registry.ts@@ -155,20 +155,6 @@ function itemAddress(item: string): string {: `${OFFICIAL_REGISTRY}/${item}.json`;}-/** Installs an official registry item without running its declared setup command. */-export async function installOfficialRegistryItem(- appRoot: string,- item: string,- options: AddCommandOptions = {},-): Promise<void> {- const config = await readEveRegistryConfig(appRoot);- await addRegistryItems([itemAddress(item)], {- config,- cwd: appRoot,- overwrite: options.overwrite,- });-}-function assertCompatibleEveVersion(requiredVersion: string | undefined): void {if (requiredVersion === undefined) return;const installedVersion = resolveInstalledPackageInfo().version;@@ -417,13 +403,6 @@ async function browseRegistryItems(if (errors.length > 0) process.exitCode = 1;}-/** Resolves one official, configured, or URL-addressed item manifest. */-export async function getRegistryItemManifest(appRoot: string, item: string): Promise<unknown> {- const config = await readEveRegistryConfig(appRoot);- const items = await getRegistryItems([itemAddress(item)], { config });- return items.length === 1 ? items[0] : items;-}-/** Installs an official, configured, or URL-addressed registry item. */export async function installRegistryItem(appRoot: string,diff --git a/packages/eve/src/cli/commands/setup-headless.ts b/packages/eve/src/cli/commands/setup-headless.tsindex 165d41380..4c549e27a 100644--- a/packages/eve/src/cli/commands/setup-headless.ts+++ b/packages/eve/src/cli/commands/setup-headless.ts@@ -86,7 +86,7 @@ export function headlessSetupContinuation(input: {};}-export type HeadlessIntegrationSetupEvent =+type HeadlessIntegrationSetupEvent =| {version: 1;type: "external_action";diff --git a/packages/eve/src/cli/commands/vercel-non-interactive.ts b/packages/eve/src/cli/commands/vercel-non-interactive.tsindex 9ae9aa75a..5cf88af97 100644--- a/packages/eve/src/cli/commands/vercel-non-interactive.ts+++ b/packages/eve/src/cli/commands/vercel-non-interactive.ts@@ -6,7 +6,7 @@ import { resolveProjectByNameOrId, resolveTeam } from "#setup/vercel-project.js"import { NOT_AN_AGENT_MESSAGE } from "./preconditions.js";-export interface VercelNonInteractiveLogger {+interface VercelNonInteractiveLogger {error(message: string): void;log(message: string): void;}diff --git a/packages/eve/src/cli/dev/diagnostic-dump.ts b/packages/eve/src/cli/dev/diagnostic-dump.tsindex cdf3e70ec..a9b3fb5f8 100644--- a/packages/eve/src/cli/dev/diagnostic-dump.ts+++ b/packages/eve/src/cli/dev/diagnostic-dump.ts@@ -142,7 +142,7 @@ function formatDump(input: {}/** Collects the real environment facts for {@link createDevDiagnosticDump}. */-export async function collectDevEnvironmentInfo(appRoot: string): Promise<DevEnvironmentInfo> {+async function collectDevEnvironmentInfo(appRoot: string): Promise<DevEnvironmentInfo> {const [vercelCli, sessionsDirectory] = await Promise.all([detectVercelCli(appRoot),measureSessionsDirectory(appRoot),diff --git a/packages/eve/src/cli/dev/diagnostic-sink.ts b/packages/eve/src/cli/dev/diagnostic-sink.tsindex 61399074d..8129834d6 100644--- a/packages/eve/src/cli/dev/diagnostic-sink.ts+++ b/packages/eve/src/cli/dev/diagnostic-sink.ts@@ -4,7 +4,7 @@ import { join, relative, sep } from "node:path";import type { LogLevel } from "#internal/logging.js";import type { JsonObject } from "#shared/json.js";-export type DevDiagnosticSource = "stderr" | "stdout" | "sandbox" | "workflow" | "tool" | "log";+type DevDiagnosticSource = "stderr" | "stdout" | "sandbox" | "workflow" | "tool" | "log";/** Captured output or a failure summary attributed to one capture point. */export interface DevDiagnosticOutputEntry {@@ -38,7 +38,7 @@ export interface DevDiagnosticSink {close(): Promise<void>;}-export interface CreateDevDiagnosticSinkOptions {+interface CreateDevDiagnosticSinkOptions {readonly now?: () => Date;readonly pid?: number;}diff --git a/packages/eve/src/cli/dev/tui/agent-header.ts b/packages/eve/src/cli/dev/tui/agent-header.tsindex 8657d1692..c62918109 100644--- a/packages/eve/src/cli/dev/tui/agent-header.ts+++ b/packages/eve/src/cli/dev/tui/agent-header.ts@@ -5,7 +5,7 @@ import { resolveInstalledPackageInfo } from "#internal/application/package.js";import { clipVisible } from "#cli/ui/terminal-text.js";import type { Theme } from "./theme.js";-export interface AgentHeaderInput {+interface AgentHeaderInput {/** Resolved display name used when agent inspection is unavailable. */name?: string;/** Agent inspection payload, or `undefined` when it could not be fetched. */diff --git a/packages/eve/src/cli/dev/tui/argument-typeahead.ts b/packages/eve/src/cli/dev/tui/argument-typeahead.tsindex 92ae67b51..b53df22ba 100644--- a/packages/eve/src/cli/dev/tui/argument-typeahead.ts+++ b/packages/eve/src/cli/dev/tui/argument-typeahead.ts@@ -12,7 +12,7 @@ export interface PromptArgumentSuggestion {readonly next?: readonly PromptArgumentSuggestion[];}-export interface ArgumentTypeaheadQuery {+interface ArgumentTypeaheadQuery {readonly command: ArgumentTypeaheadCommand;readonly argument: string;/** Complete arguments before the one currently being typed. */diff --git a/packages/eve/src/cli/dev/tui/dev-rebuild-status.ts b/packages/eve/src/cli/dev/tui/dev-rebuild-status.tsindex 33e1cddcf..993c556b2 100644--- a/packages/eve/src/cli/dev/tui/dev-rebuild-status.ts+++ b/packages/eve/src/cli/dev/tui/dev-rebuild-status.ts@@ -7,7 +7,7 @@import type { WatcherChangeEvent } from "#internal/nitro/host/dev-watcher-log.js";-export type DevRebuildPhase = "rebuilding" | "rebuilt" | "reloading";+type DevRebuildPhase = "rebuilding" | "rebuilt" | "reloading";const MAX_SUMMARY_PATHS = 3;diff --git a/packages/eve/src/cli/dev/tui/diagnostic-presentation.ts b/packages/eve/src/cli/dev/tui/diagnostic-presentation.tsindex 19f4775b0..0115d2a3e 100644--- a/packages/eve/src/cli/dev/tui/diagnostic-presentation.ts+++ b/packages/eve/src/cli/dev/tui/diagnostic-presentation.ts@@ -9,7 +9,7 @@ const DIAGNOSTIC_SUMMARY_MAX_CHARACTERS = 240;*/const ERROR_HEADLINE_PATTERN = /^\s*(?:message|name):\s*\S|^\s*[A-Z][\w$]*Error\b/u;-export type DiagnosticPresentation =+type DiagnosticPresentation =| { readonly kind: "inline"; readonly text: string }| {readonly kind: "stored";diff --git a/packages/eve/src/cli/dev/tui/errors.ts b/packages/eve/src/cli/dev/tui/errors.tsindex ab988395c..58081f1ec 100644--- a/packages/eve/src/cli/dev/tui/errors.ts+++ b/packages/eve/src/cli/dev/tui/errors.ts@@ -39,16 +39,6 @@ export function isInterruptedError(error: unknown): boolean {return error instanceof InterruptedError;}-/**- * Recognizes errors raised by aborting an in-flight fetch/stream (e.g. the- * subagent child-session pump being cancelled). These are expected shutdown- * noise, not failures to surface.- */-export function isAbortLikeError(error: unknown): boolean {- if (!(error instanceof Error)) return false;- return error.name === "AbortError" || /\babort(?:ed)?\b/iu.test(error.message);-}-/*** Stable identity for one failure cascade entry. The harness emits the same* `{ code, message }` payload on `step.failed`, `turn.failed`, and (for@@ -80,7 +70,7 @@ export function formatFailureMessage(event: FailureStreamEvent): string {* inspection dump for unrecognized failures. One projection so every* consumer narrows the untyped `details` payload the same way.*/-export interface FailureDetails {+interface FailureDetails {readonly semanticErrorId?: string;readonly hint?: string;readonly detail?: string;diff --git a/packages/eve/src/cli/dev/tui/flow-drawer.ts b/packages/eve/src/cli/dev/tui/flow-drawer.tsindex dbd334b07..dba585999 100644--- a/packages/eve/src/cli/dev/tui/flow-drawer.ts+++ b/packages/eve/src/cli/dev/tui/flow-drawer.ts@@ -2,7 +2,7 @@ import type { Theme } from "./theme.js";import { renderFlowPanel, type FlowPanelState } from "./setup-panel.js";/** Temporary setup content enclosed by a drawer and its navigation controls. */-export interface FlowDrawer {+interface FlowDrawer {readonly rows: string[];readonly controls: string[];}diff --git a/packages/eve/src/cli/dev/tui/line-editor.ts b/packages/eve/src/cli/dev/tui/line-editor.tsindex bb648d105..b8deb3372 100644--- a/packages/eve/src/cli/dev/tui/line-editor.ts+++ b/packages/eve/src/cli/dev/tui/line-editor.ts@@ -186,7 +186,7 @@ function logicalLineEnd(text: string, cursor: number): number {}/** Options for {@link applyLineEditorKey}. */-export interface LineEditorOptions {+interface LineEditorOptions {/** Single-line inputs flatten pasted newlines and ignore Shift+Enter. */readonly multiline?: boolean;}diff --git a/packages/eve/src/cli/dev/tui/mcp-connection-status.ts b/packages/eve/src/cli/dev/tui/mcp-connection-status.tsindex bad411ca0..779414a25 100644--- a/packages/eve/src/cli/dev/tui/mcp-connection-status.ts+++ b/packages/eve/src/cli/dev/tui/mcp-connection-status.ts@@ -46,7 +46,7 @@ export interface McpConnectionStatusTracker {dispose(): void;}-export interface McpConnectionStatusTrackerOptions {+interface McpConnectionStatusTrackerOptions {onChange: (disabledConnectionReasons: Readonly<Record<string, string>>) => void;probe?: McpConnectionProbe;intervalMs?: number;diff --git a/packages/eve/src/cli/dev/tui/message-queue.ts b/packages/eve/src/cli/dev/tui/message-queue.tsindex ce2373975..a27ad82a5 100644--- a/packages/eve/src/cli/dev/tui/message-queue.ts+++ b/packages/eve/src/cli/dev/tui/message-queue.ts@@ -23,7 +23,7 @@ import { clipVisible, stripTerminalControls } from "#cli/ui/terminal-text.js";export const MESSAGE_QUEUE_LIMIT = 5;/** What one Esc press did to the queue state. */-export type MessageQueueEscapeOutcome =+type MessageQueueEscapeOutcome =/*** A message is staged for steering. The caller sends it to the active* session; repeated presses may select more queued messages.@@ -33,7 +33,7 @@ export type MessageQueueEscapeOutcome =| "cancel";/** Read-only projection consumed by {@link renderMessageQueueRows}. */-export interface MessageQueueView {+interface MessageQueueView {readonly messages: readonly string[];readonly full: boolean;/** A popped message is awaiting steering admission. */@@ -169,7 +169,7 @@ function joinOptionalMessages(a: string | undefined, b: string | undefined): strreturn joinMessages(a, b);}-export interface MessageQueuePanelRowsInput {+interface MessageQueuePanelRowsInput {readonly view: MessageQueueView;readonly width: number;readonly theme: Theme;diff --git a/packages/eve/src/cli/dev/tui/prompt-command-handler.ts b/packages/eve/src/cli/dev/tui/prompt-command-handler.tsindex 251ca0d0d..4e5cc0ff1 100644--- a/packages/eve/src/cli/dev/tui/prompt-command-handler.ts+++ b/packages/eve/src/cli/dev/tui/prompt-command-handler.ts@@ -17,7 +17,7 @@ import type { DevelopmentTuiTarget } from "./target.js";type ExtensionCommand = Extract<PromptCommand, { type: "extension" }>;-export interface PromptCommandHandlerOptions {+interface PromptCommandHandlerOptions {readonly target: DevelopmentTuiTarget;/** Test seam; defaults to the model flow's shared source-change apply. */readonly applyModel?: (input: { appRoot: string; slug: string }) => Promise<ApplyModelOutcome>;diff --git a/packages/eve/src/cli/dev/tui/provider-picker.ts b/packages/eve/src/cli/dev/tui/provider-picker.tsindex 7d3b233f0..d16f052bb 100644--- a/packages/eve/src/cli/dev/tui/provider-picker.ts+++ b/packages/eve/src/cli/dev/tui/provider-picker.ts@@ -18,7 +18,7 @@ export type ProviderPickerPhase =| { kind: "invalid"; editor: LineState; message: string };/** One provider picker interaction: ordinary select state plus its key field. */-export interface ProviderPickerState {+interface ProviderPickerState {select: SelectState;phase: ProviderPickerPhase;}@@ -32,7 +32,7 @@ export type ProviderPickerEvent =| { type: "validated"; validation: GatewayKeyValidation };/** One state transition; abort controllers remain in the terminal renderer. */-export type ProviderPickerTransition =+type ProviderPickerTransition =| { kind: "ignore"; state: ProviderPickerState }| { kind: "render"; state: ProviderPickerState }| { kind: "clear"; state: ProviderPickerState }diff --git a/packages/eve/src/cli/dev/tui/question-panel.ts b/packages/eve/src/cli/dev/tui/question-panel.tsindex 8a445ada7..945362254 100644--- a/packages/eve/src/cli/dev/tui/question-panel.ts+++ b/packages/eve/src/cli/dev/tui/question-panel.ts@@ -21,7 +21,7 @@ import { renderOptionRow } from "#setup/cli/option-row.js";const FREEFORM_ROW_LABEL = "Type your own answer…";-export interface QuestionPanelState {+interface QuestionPanelState {readonly prompt: string;readonly options: readonly AgentTUIInputOption[];/** Row index under the cursor; `options.length` is the freeform row. */diff --git a/packages/eve/src/cli/dev/tui/registry-result-message.ts b/packages/eve/src/cli/dev/tui/registry-result-message.tsindex bd4536f93..6282500d2 100644--- a/packages/eve/src/cli/dev/tui/registry-result-message.ts+++ b/packages/eve/src/cli/dev/tui/registry-result-message.ts@@ -20,7 +20,7 @@ export function registryItemProgress(renderer: {};}-export interface RegistryCommandOutcome {+interface RegistryCommandOutcome {failed: boolean;/** Replaces the echoed `/add` once it settles. */summary: string;@@ -50,7 +50,7 @@ function outcomeDetails(outcome: RegistrySessionOutcome): string[] {}/** The one-line record of an `/add` item left in place of its invocation. */-export function registryOutcomeSummary(outcome: RegistrySessionOutcome): string {+function registryOutcomeSummary(outcome: RegistrySessionOutcome): string {switch (outcome.kind) {case "installed":return `Added ${outcome.title}`;diff --git a/packages/eve/src/cli/dev/tui/remote-connection-probe.ts b/packages/eve/src/cli/dev/tui/remote-connection-probe.tsindex a6e10b752..73a8724b1 100644--- a/packages/eve/src/cli/dev/tui/remote-connection-probe.ts+++ b/packages/eve/src/cli/dev/tui/remote-connection-probe.ts@@ -10,12 +10,12 @@ import { isObject } from "#shared/guards.js";import { probeAgentInfo } from "#services/dev-client/agent-info-probe.js";import type { RemoteConnectionState } from "./remote-connection-types.js";-export type RemoteProbeResult = Extract<+type RemoteProbeResult = Extract<RemoteConnectionState,{ state: "ready" | "auth-required" | "unavailable" }>;-export type RemoteProbePhase = "connection-check" | "authentication-verification";+type RemoteProbePhase = "connection-check" | "authentication-verification";function isEveOidcChallenge(error: unknown): boolean {if (!(error instanceof ClientError) || error.status !== 401) return false;diff --git a/packages/eve/src/cli/dev/tui/setup-panel.ts b/packages/eve/src/cli/dev/tui/setup-panel.tsindex 3e105a4c6..6cb71ddae 100644--- a/packages/eve/src/cli/dev/tui/setup-panel.ts+++ b/packages/eve/src/cli/dev/tui/setup-panel.ts@@ -116,7 +116,7 @@ interface SetupActionsPanelState {export type SetupSelectPanelState = SetupOptionSelectPanelState | SetupActionsPanelState;-export interface SetupTextPanelState {+interface SetupTextPanelState {message: string;editor: LineState;placeholder?: string;@@ -126,7 +126,7 @@ export interface SetupTextPanelState {notices?: readonly SelectNotice[];}-export interface SetupAcknowledgePanelState {+interface SetupAcknowledgePanelState {message: string;lines: readonly string[];}diff --git a/packages/eve/src/cli/dev/tui/setup-selection-input.ts b/packages/eve/src/cli/dev/tui/setup-selection-input.tsindex 370476d9c..e5978cac6 100644--- a/packages/eve/src/cli/dev/tui/setup-selection-input.ts+++ b/packages/eve/src/cli/dev/tui/setup-selection-input.ts@@ -12,7 +12,7 @@ import {import type { TerminalKey } from "./stream-format.js";/** Shared navigation grammar for setup selects, actions, and editable selects. */-export type SetupSelectionIntent =+type SetupSelectionIntent =| { kind: "cancel" }| { kind: "move"; direction: "up" | "down" }| { kind: "repaint" }@@ -47,7 +47,7 @@ export function setupSelectionIntent(}}-export type SetupSelectInputResult =+type SetupSelectInputResult =| { kind: "cancel" }| { kind: "repaint" }| { kind: "update"; select: SelectState }diff --git a/packages/eve/src/cli/dev/tui/status-line.ts b/packages/eve/src/cli/dev/tui/status-line.tsindex 028546f3c..a6379854c 100644--- a/packages/eve/src/cli/dev/tui/status-line.ts+++ b/packages/eve/src/cli/dev/tui/status-line.ts@@ -21,7 +21,7 @@ function formatDevBuildStatus(status: DevBuildStatus, theme: Theme): string {return `${glyph} ${summary}`;}-export interface StatusLineInput {+interface StatusLineInput {/** Transient authored-source build state, independent of the server log filter. */devBuild?: DevBuildStatus;/** Resolved model slug, e.g. "anthropic/claude-sonnet-5"; absent when `/eve/v1/info` failed. */diff --git a/packages/eve/src/cli/dev/tui/stream-format.ts b/packages/eve/src/cli/dev/tui/stream-format.tsindex 32c7533ae..c12c84907 100644--- a/packages/eve/src/cli/dev/tui/stream-format.ts+++ b/packages/eve/src/cli/dev/tui/stream-format.ts@@ -64,7 +64,7 @@ export type TerminalKey =| { type: "ignore" };/** One decoded key plus the UTF-16 code units it consumed from the input buffer. */-export interface KeyToken {+interface KeyToken {key?: TerminalKey;consumed: number;/** The buffer ends mid-sequence; wait for more bytes before decoding. */@@ -334,7 +334,7 @@ export function parseKey(chunk: Buffer): TerminalKey {}}-export interface AssistantResponseStats {+interface AssistantResponseStats {totalTokens: number | undefined;outputTokens: number | undefined;tokensPerSecond: number | undefined;diff --git a/packages/eve/src/cli/dev/tui/terminal-renderer.ts b/packages/eve/src/cli/dev/tui/terminal-renderer.tsindex 1f03b7812..dda18b58b 100644--- a/packages/eve/src/cli/dev/tui/terminal-renderer.ts+++ b/packages/eve/src/cli/dev/tui/terminal-renderer.ts@@ -274,7 +274,7 @@ const STATUS_LINE_LEFT_PADDING = " ";const defaultAssistantResponseStats: AssistantResponseStatsMode = "tokensPerSecond";-export type TerminalRendererOptions = {+type TerminalRendererOptions = {input?: TerminalInput;output?: TerminalOutput;tools?: TerminalPartDisplayMode;@@ -299,7 +299,7 @@ export type TerminalRendererOptions = {onExitRequest?: () => void;};-export type AgentHeaderOptions = {+type AgentHeaderOptions = {name: string;serverUrl: string;info?: AgentInfoResult;diff --git a/packages/eve/src/cli/dev/tui/theme.ts b/packages/eve/src/cli/dev/tui/theme.tsindex c9949ed28..674c90b58 100644--- a/packages/eve/src/cli/dev/tui/theme.ts+++ b/packages/eve/src/cli/dev/tui/theme.ts@@ -202,7 +202,7 @@ export interface Theme {readonly spinner: readonly string[];}-export interface CreateThemeOptions {+interface CreateThemeOptions {/** Whether to emit ANSI color. Defaults to `true`. */color?: boolean;/** Whether the terminal renders Unicode glyphs. Defaults to `true`. */diff --git a/packages/eve/src/cli/dev/tui/tool-block-groups.ts b/packages/eve/src/cli/dev/tui/tool-block-groups.tsindex faab1a2b1..aa91532b3 100644--- a/packages/eve/src/cli/dev/tui/tool-block-groups.ts+++ b/packages/eve/src/cli/dev/tui/tool-block-groups.ts@@ -1,7 +1,7 @@import type { Block, DisplayBlock, ToolGroupItem } from "./blocks.js";import { toolBaseName } from "./tool-presentation.js";-export interface ToolBlockDisplayGroup {+interface ToolBlockDisplayGroup {readonly members: readonly Block[];readonly display: DisplayBlock;}@@ -21,7 +21,7 @@ export interface ToolBlockDisplayGroup {* consume a group must remove its members by identity, never by prefix* length.*/-export interface GroupToolBlocksOptions {+interface GroupToolBlocksOptions {/*** How captured log writes coalesce. `"window"` (the default, for the live* block window) merges every write of one source across the whole inputdiff --git a/packages/eve/src/cli/dev/tui/tool-presentation.ts b/packages/eve/src/cli/dev/tui/tool-presentation.tsindex dd86acbb7..ff00ef728 100644--- a/packages/eve/src/cli/dev/tui/tool-presentation.ts+++ b/packages/eve/src/cli/dev/tui/tool-presentation.ts@@ -3,7 +3,7 @@ import { stripTerminalControls } from "#cli/ui/terminal-text.js";import { summarizeToolArgs, summarizeToolResult } from "./tool-format.js";/** Renderer-ready copy derived from a tool call without owning its lifecycle. */-export interface ToolPresentation {+interface ToolPresentation {readonly title: string;readonly subtitle: string;readonly summarizeResult: (output: unknown) => string | undefined;diff --git a/packages/eve/src/cli/dev/tui/traces/trace-content.ts b/packages/eve/src/cli/dev/tui/traces/trace-content.tsindex c8c40fa07..87f2e140b 100644--- a/packages/eve/src/cli/dev/tui/traces/trace-content.ts+++ b/packages/eve/src/cli/dev/tui/traces/trace-content.ts@@ -128,7 +128,7 @@ function toolResponseText(response: unknown): string {}/** Pretty-prints a JSON value with two-space indents, wrapped to `width`. */-export function prettyJson(value: unknown, width: number): string[] {+function prettyJson(value: unknown, width: number): string[] {return JSON.stringify(value, null, 2).split("\n").flatMap((line) => wrapHanging(line, width, width));@@ -174,7 +174,7 @@ function wrapHanging(text: string, width: number, firstWidth: number): string[]* frame. Split them into real display lines; a trailing newline's empty tail* is dropped.*/-export function splitEmbeddedNewlines(lines: readonly string[]): string[] {+function splitEmbeddedNewlines(lines: readonly string[]): string[] {const split = lines.flatMap((line) => line.split(/\r\n|\r|\n/));while (split.length > 1 && split[split.length - 1] === "") split.pop();return split;diff --git a/packages/eve/src/cli/dev/tui/traces/trace-view.ts b/packages/eve/src/cli/dev/tui/traces/trace-view.tsindex 9add374f9..8308e0bc7 100644--- a/packages/eve/src/cli/dev/tui/traces/trace-view.ts+++ b/packages/eve/src/cli/dev/tui/traces/trace-view.ts@@ -37,7 +37,7 @@ const BODY_MIN_WIDTH = 20;const PANEL_MIN_WIDTH = 20;const PANEL_MAX_WIDTH = 64;-export interface TraceViewerFrame {+interface TraceViewerFrame {readonly rows: readonly string[];/** Detail rows the panel has for the selected span — fed back into key handling. */readonly panelTotalRows: number;@@ -49,7 +49,7 @@ export interface TraceViewerFrame {readonly contentWidth: number;}-export interface RenderTraceViewerOptions {+interface RenderTraceViewerOptions {readonly width: number;readonly height: number;readonly theme: Theme;diff --git a/packages/eve/src/cli/dev/tui/traces/trace-viewer-session.ts b/packages/eve/src/cli/dev/tui/traces/trace-viewer-session.tsindex 6be2fce3b..ed6532f02 100644--- a/packages/eve/src/cli/dev/tui/traces/trace-viewer-session.ts+++ b/packages/eve/src/cli/dev/tui/traces/trace-viewer-session.ts@@ -45,7 +45,7 @@ export interface TraceViewerRenderer {open(options: TraceViewerOpenOptions): Promise<void>;}-export interface TraceViewerSessionOptions extends TraceViewerOpenOptions {+interface TraceViewerSessionOptions extends TraceViewerOpenOptions {readonly theme: Theme;readonly paint: (rows: readonly string[]) => void;readonly dimensions: () => { readonly width: number; readonly height: number };diff --git a/packages/eve/src/cli/dev/tui/traces/trace-viewer-state.ts b/packages/eve/src/cli/dev/tui/traces/trace-viewer-state.tsindex c53f0ac59..5c0cdd824 100644--- a/packages/eve/src/cli/dev/tui/traces/trace-viewer-state.ts+++ b/packages/eve/src/cli/dev/tui/traces/trace-viewer-state.ts@@ -98,7 +98,7 @@ export interface TraceViewerKeyEnvironment {readonly conversationLineCounts?: readonly number[];}-export interface TraceViewerKeyResult {+interface TraceViewerKeyResult {readonly state: TraceViewerState;readonly effect?: "close";/** A completed drag selection to copy — the controller extracts and copies the text. */@@ -144,7 +144,7 @@ export function selectedTraceViewerSpan(state: TraceViewerState): LocalTraceSpan}/** The number of selectable cards. */-export function traceViewerItemCount(state: TraceViewerState): number {+function traceViewerItemCount(state: TraceViewerState): number {return state.conversationItems.length;}diff --git a/packages/eve/src/cli/dev/ui-options.ts b/packages/eve/src/cli/dev/ui-options.tsindex d87a0d4b8..880aa9797 100644--- a/packages/eve/src/cli/dev/ui-options.ts+++ b/packages/eve/src/cli/dev/ui-options.ts@@ -6,7 +6,7 @@ import type {} from "#cli/dev/tui/types.js";/** Parsed `eve dev` options that control terminal-UI behavior. */-export interface DevelopmentTuiOptions {+interface DevelopmentTuiOptions {readonly assistantResponseStats?: AssistantResponseStatsMode;readonly connectionAuth?: TerminalPartDisplayMode;readonly contextSize?: number;@@ -18,7 +18,7 @@ export interface DevelopmentTuiOptions {}/** Whether `eve dev` launches the terminal UI or keeps only the server running. */-export type DevUiMode = "tui" | "headless";+type DevUiMode = "tui" | "headless";/** Resolves the UI mode from parsed flags and terminal interactivity. */export function resolveDevUiMode(input: {diff --git a/packages/eve/src/cli/dev/url-target.ts b/packages/eve/src/cli/dev/url-target.tsindex a83638a0e..801f1a956 100644--- a/packages/eve/src/cli/dev/url-target.ts+++ b/packages/eve/src/cli/dev/url-target.ts@@ -5,7 +5,7 @@ import { parseDevelopmentServerUrl } from "./url.js";export type DevelopmentRequestHeaders = Readonly<Record<string, string>>;-export interface DevelopmentUrlTargetOptions {+interface DevelopmentUrlTargetOptions {header?: DevelopmentRequestHeaders;host?: string;port?: number;diff --git a/packages/eve/src/cli/invoke/command.ts b/packages/eve/src/cli/invoke/command.tsindex eb28bfef8..49534b06a 100644--- a/packages/eve/src/cli/invoke/command.ts+++ b/packages/eve/src/cli/invoke/command.ts@@ -17,7 +17,7 @@ interface InvokeCliOptions {scope?: string;}-export interface InvokeCommandDependencies {+interface InvokeCommandDependencies {readonly loadEnvironment: (appRoot: string) => void | Promise<void>;readonly runInvoke: (input: RunInvokeInput) => Promise<InvokeResult>;}@@ -50,7 +50,7 @@ export function registerRuntimeInvokeCommand(input: {}/** Registers the non-interactive remote invocation command. */-export function registerInvokeCommand(input: {+function registerInvokeCommand(input: {readonly applicationContext: CliApplicationContext;readonly deps: InvokeCommandDependencies;readonly logger: InvokeCommandLogger;diff --git a/packages/eve/src/cli/invoke/result.ts b/packages/eve/src/cli/invoke/result.tsindex 09310d5b6..fe909d3fa 100644--- a/packages/eve/src/cli/invoke/result.ts+++ b/packages/eve/src/cli/invoke/result.ts@@ -69,7 +69,7 @@ const invokeResultSchema = z.discriminatedUnion("status", [/** Durable session coordinates emitted by `eve remote invoke`. Credentials are deliberately excluded. */export type InvokeResume = z.infer<typeof invokeResumeSchema>;-export type InvocationInputRequest = z.infer<typeof invocationInputRequestSchema>;+type InvocationInputRequest = z.infer<typeof invocationInputRequestSchema>;/** Result emitted by one non-interactive agent invocation. */export type InvokeResult = z.infer<typeof invokeResultSchema>;export type InvokeAuthenticationFailure = Extract<diff --git a/packages/eve/src/cli/telemetry/index.ts b/packages/eve/src/cli/telemetry/index.tsindex fb1d62529..357cb4536 100644--- a/packages/eve/src/cli/telemetry/index.ts+++ b/packages/eve/src/cli/telemetry/index.ts@@ -13,7 +13,7 @@ import {readOrCreateEveTelemetryIdentity,} from "#cli/telemetry/preference.js";-export type EveCliTelemetryEvent = {+type EveCliTelemetryEvent = {readonly id: string;readonly event_time: number;readonly key: string;diff --git a/packages/eve/src/cli/telemetry/preference.ts b/packages/eve/src/cli/telemetry/preference.tsindex 07f373bc9..48646c559 100644--- a/packages/eve/src/cli/telemetry/preference.ts+++ b/packages/eve/src/cli/telemetry/preference.ts@@ -11,7 +11,7 @@ import { z } from "#compiled/zod/index.js";const EVE_TELEMETRY_NOTICE_VERSION = 1;-export type EveTelemetryPreference = {+type EveTelemetryPreference = {readonly enabled: boolean;readonly notified: boolean;};diff --git a/packages/eve/src/cli/ui/alt-screen.ts b/packages/eve/src/cli/ui/alt-screen.tsindex 42ce9190a..cc1ea5b89 100644--- a/packages/eve/src/cli/ui/alt-screen.ts+++ b/packages/eve/src/cli/ui/alt-screen.ts@@ -25,11 +25,11 @@ const CURSOR_HOME = `${ESC}[H`;const SYNC_START = `${ESC}[?2026h`;const SYNC_END = `${ESC}[?2026l`;-export interface AltScreenOutput {+interface AltScreenOutput {write(chunk: string): boolean;}-export interface AltScreenEnterOptions {+interface AltScreenEnterOptions {/** Interactive subprocesses need the terminal cursor; rendered views do not. */cursor?: "hidden" | "visible";/** Rendered views use mouse events; inherited subprocesses retain native selection. */diff --git a/packages/eve/src/cli/ui/live-region.ts b/packages/eve/src/cli/ui/live-region.tsindex 3015383a3..c16919621 100644--- a/packages/eve/src/cli/ui/live-region.ts+++ b/packages/eve/src/cli/ui/live-region.ts@@ -32,11 +32,11 @@ const SYNC_END = `${ESC}[?2026l`;const BRACKETED_PASTE_ON = `${ESC}[?2004h`;const BRACKETED_PASTE_OFF = `${ESC}[?2004l`;-export interface LiveRegionOutput {+interface LiveRegionOutput {write(chunk: string): boolean;}-export interface LiveRegionOptions {+interface LiveRegionOptions {/** Wrap each paint in synchronized-update markers to avoid flicker. */synchronized?: boolean;}diff --git a/packages/eve/src/cli/ui/output.ts b/packages/eve/src/cli/ui/output.tsindex 9b9919bbe..9136b6556 100644--- a/packages/eve/src/cli/ui/output.ts+++ b/packages/eve/src/cli/ui/output.ts@@ -13,7 +13,7 @@ type CliMessageTone =/*** Shared color palette used by the eve CLI.*/-export interface CliTheme {+interface CliTheme {readonly color: boolean;accent(text: string): string;danger(text: string): string;diff --git a/packages/eve/src/client/eve-agent-store-helpers.ts b/packages/eve/src/client/eve-agent-store-helpers.tsindex 2cd95a428..440c0dade 100644--- a/packages/eve/src/client/eve-agent-store-helpers.ts+++ b/packages/eve/src/client/eve-agent-store-helpers.ts@@ -14,7 +14,7 @@ export function isSettledSessionTail(events: readonly MessageStreamEvent[]): boo);}-export function collectPendingAuthorizations(events: readonly MessageStreamEvent[]): Set<string> {+function collectPendingAuthorizations(events: readonly MessageStreamEvent[]): Set<string> {const pending = new Set<string>();for (const event of events) updatePendingAuthorizations(pending, event);return pending;diff --git a/packages/eve/src/client/message-action-parts.ts b/packages/eve/src/client/message-action-parts.tsindex eb913576a..3d5ea7447 100644--- a/packages/eve/src/client/message-action-parts.ts+++ b/packages/eve/src/client/message-action-parts.ts@@ -13,7 +13,7 @@ import type {* plain tool calls onto a single `dynamic-tool` UI part; this descriptor is the* shared shape those variants collapse to before rendering.*/-export interface ActionDescriptor {+interface ActionDescriptor {readonly kind: "load-skill" | "subagent-call" | "tool-call";readonly name: string;readonly toolName: string;diff --git a/packages/eve/src/client/session-utils.ts b/packages/eve/src/client/session-utils.tsindex b85eec487..b5952cc50 100644--- a/packages/eve/src/client/session-utils.ts+++ b/packages/eve/src/client/session-utils.ts@@ -9,7 +9,7 @@ import { isCurrentTurnBoundaryEvent, isTurnFailureEvent } from "#protocol/messagimport type { InputRequest } from "#shared/input.js";/** A connection authorization challenge that remains unresolved at a turn boundary. */-export interface PendingAuthorization {+interface PendingAuthorization {readonly authorization?: AuthorizationRequiredStreamEvent["data"]["authorization"];readonly description: string;readonly name: string;@@ -17,7 +17,7 @@ export interface PendingAuthorization {}/** Canonical projection of the lifecycle state represented by one turn's events. */-export interface TurnEventSummary {+interface TurnEventSummary {readonly boundary: UnstampedMessageStreamEvent | undefined;readonly failure: TurnFailureStreamEvent | undefined;readonly inputRequests: readonly InputRequest[];diff --git a/packages/eve/src/compiler/artifacts.ts b/packages/eve/src/compiler/artifacts.tsindex 8ee675e8c..5734d6271 100644--- a/packages/eve/src/compiler/artifacts.ts+++ b/packages/eve/src/compiler/artifacts.ts@@ -2,19 +2,13 @@ import { createHash } from "node:crypto";import { mkdir, writeFile } from "node:fs/promises";import { join, relative, resolve } from "node:path";-import { z } from "#compiled/zod/index.js";-import {- discoverDiagnosticsSummarySchema,- type DiscoverDiagnostic,- type DiscoverDiagnosticsSummary,-} from "#discover/diagnostics.js";+import type { DiscoverDiagnostic, DiscoverDiagnosticsSummary } from "#discover/diagnostics.js";import { normalizeLogicalPath } from "#discover/filesystem.js";import type { AgentSourceManifest } from "#discover/manifest.js";import { resolveInstalledPackageInfo } from "#internal/application/package.js";import type { CompiledAgentManifest } from "#compiler/manifest.js";import { ROOT_COMPILED_AGENT_NODE_ID } from "#compiler/manifest.js";import {- compilerDiagnosticSchema,projectDiscoverDiagnostic,summarizeCompilerDiagnostics,type CompilerDiagnostic,@@ -28,12 +22,12 @@ import { createSandboxPreparedArtifactsManifest } from "#shared/sandbox-prepared/*** Stable diagnostics artifact kind emitted by the compiler.*/-export const COMPILER_DIAGNOSTICS_ARTIFACT_KIND = "eve-compiler-diagnostics";+const COMPILER_DIAGNOSTICS_ARTIFACT_KIND = "eve-compiler-diagnostics";/*** Current diagnostics artifact schema version.*/-export const COMPILER_DIAGNOSTICS_ARTIFACT_VERSION = 2;+const COMPILER_DIAGNOSTICS_ARTIFACT_VERSION = 2;/*** Stable compile metadata artifact kind emitted by the compiler.@@ -63,22 +57,13 @@ export interface CompilerArtifactPaths {/*** Machine-readable compiler diagnostics artifact written by the compiler.*/-export interface CompilerDiagnosticsArtifact {+interface CompilerDiagnosticsArtifact {diagnostics: CompilerDiagnostic[];kind: typeof COMPILER_DIAGNOSTICS_ARTIFACT_KIND;summary: DiscoverDiagnosticsSummary;version: typeof COMPILER_DIAGNOSTICS_ARTIFACT_VERSION;}-export const compilerDiagnosticsArtifactSchema = z- .object({- diagnostics: z.array(compilerDiagnosticSchema),- kind: z.literal(COMPILER_DIAGNOSTICS_ARTIFACT_KIND),- summary: discoverDiagnosticsSummarySchema,- version: z.literal(COMPILER_DIAGNOSTICS_ARTIFACT_VERSION),- })- .strict();-/*** One artifact digest recorded in compile metadata.*/diff --git a/packages/eve/src/compiler/compile-agent.ts b/packages/eve/src/compiler/compile-agent.tsindex 61d99602e..3d91e9ad9 100644--- a/packages/eve/src/compiler/compile-agent.ts+++ b/packages/eve/src/compiler/compile-agent.ts@@ -20,7 +20,7 @@ import type { DevelopmentExtensionSelection } from "#compiler/development-extens* Input for compiling the current authored agent into framework-owned* discovery artifacts.*/-export interface CompileAgentInput {+interface CompileAgentInput {/** Development-only source extensions applied before source composition. */developmentExtensions?: DevelopmentExtensionSelection;/**diff --git a/packages/eve/src/compiler/diagnostics.ts b/packages/eve/src/compiler/diagnostics.tsindex 60f19923c..b8647763a 100644--- a/packages/eve/src/compiler/diagnostics.ts+++ b/packages/eve/src/compiler/diagnostics.ts@@ -3,9 +3,9 @@ import { z } from "#compiled/zod/index.js";import type { DiscoverDiagnostic, DiscoverDiagnosticsSummary } from "#discover/diagnostics.js";import type { AgentSourceDescriptor } from "#compiler/source-graph.js";-export const compilerDiagnosticSeveritySchema = z.enum(["error", "warning"]);+const compilerDiagnosticSeveritySchema = z.enum(["error", "warning"]);-export const compilerDiagnosticSourceSchema = z+const compilerDiagnosticSourceSchema = z.object({logicalPath: z.string().optional(),nodeId: z.string().min(1),@@ -21,7 +21,7 @@ export const compilerDiagnosticSourceSchema = z"Compiler diagnostic source must identify a logical, compiled, or physical source.",);-export type CompilerDiagnosticSource = z.infer<typeof compilerDiagnosticSourceSchema>;+type CompilerDiagnosticSource = z.infer<typeof compilerDiagnosticSourceSchema>;export const compilerDiagnosticSchema = z.object({diff --git a/packages/eve/src/compiler/manifest.test.ts b/packages/eve/src/compiler/manifest.test.tsindex 888c0482c..e77398b50 100644--- a/packages/eve/src/compiler/manifest.test.ts+++ b/packages/eve/src/compiler/manifest.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import {COMPILED_AGENT_MANIFEST_VERSION,compiledAgentManifestSchema,diff --git a/packages/eve/src/compiler/manifest.ts b/packages/eve/src/compiler/manifest.tsindex e481f836b..9c0516524 100644--- a/packages/eve/src/compiler/manifest.ts+++ b/packages/eve/src/compiler/manifest.ts@@ -59,11 +59,6 @@ export const ROOT_COMPILED_AGENT_NODE_ID = "__root__";*/export const COMPILED_AGENT_MANIFEST_VERSION = 52;-/**- * Compiled channel entry preserved in the compiled manifest.- */-export type CompiledChannelEntry = CompiledChannelDefinition;-/*** Active compiled channel entry — backed by an authored `Channel` module.*/diff --git a/packages/eve/src/compiler/module-map.test.ts b/packages/eve/src/compiler/module-map.test.tsindex dd8572021..276a4aa70 100644--- a/packages/eve/src/compiler/module-map.test.ts+++ b/packages/eve/src/compiler/module-map.test.ts@@ -1,6 +1,6 @@import { describe, expect, it, vi } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import {collectRuntimeModuleBindingsForManifest,createCompiledModuleMapSource,diff --git a/packages/eve/src/compiler/module-map.ts b/packages/eve/src/compiler/module-map.tsindex 444800061..89a1d1c74 100644--- a/packages/eve/src/compiler/module-map.ts+++ b/packages/eve/src/compiler/module-map.ts@@ -15,7 +15,6 @@ import { normalizeEsmImportSpecifier } from "#internal/application/import-specifexport { resolveCompiledModuleExtensionScopeNamespace } from "#compiler/load-binding-namespace.js";-export type CompiledModuleNodeScope = z.infer<typeof compiledModuleNodeScopeSchema>;export type CompiledModuleMap = z.infer<typeof compiledModuleMapSchema>;const compiledModuleNodeScopeSchema = z@@ -26,7 +25,7 @@ export const compiledModuleMapSchema = z.object({ nodes: z.record(z.string(), compiledModuleNodeScopeSchema) }).strict();-export interface CreateCompiledModuleMapSourceInput {+interface CreateCompiledModuleMapSourceInput {importSpecifierStyle?: "absolute" | "relative";manifest: CompiledAgentManifest;moduleMapPath: string;diff --git a/packages/eve/src/compiler/normalize-connection.ts b/packages/eve/src/compiler/normalize-connection.tsindex e42887065..04b1ca85b 100644--- a/packages/eve/src/compiler/normalize-connection.ts+++ b/packages/eve/src/compiler/normalize-connection.ts@@ -20,7 +20,7 @@ import {type DynamicToolEventName,} from "#dynamic/definition.js";-export type CompiledConnectionEntry =+type CompiledConnectionEntry =| { readonly kind: "connection"; readonly definition: CompiledConnectionDefinition }| {readonly kind: "dynamic-connection";diff --git a/packages/eve/src/compiler/normalize-instructions.ts b/packages/eve/src/compiler/normalize-instructions.tsindex 6a14ab598..709a4fe4c 100644--- a/packages/eve/src/compiler/normalize-instructions.ts+++ b/packages/eve/src/compiler/normalize-instructions.ts@@ -24,7 +24,7 @@ import {* Either a static instructions definition or a dynamic resolver that* produces model messages at runtime.*/-export type CompiledInstructionsEntry =+type CompiledInstructionsEntry =| { readonly kind: "instructions"; readonly definition: CompiledInstructionsDefinition }| {readonly kind: "dynamic-instructions";@@ -121,21 +121,3 @@ export async function compileInstructionsEntry(},};}--/**- * @deprecated Use {@link compileInstructionsEntry} instead. Kept for- * backwards compatibility with callers that pass a single source.- */-export async function compileInstructions(- agentRoot: string,- source: InstructionsSourceRef,- options: SourceDefinitionCompileOptions,-): Promise<CompiledInstructionsDefinition> {- const entry = await compileInstructionsEntry(agentRoot, source, options);- if (entry.kind === "dynamic-instructions") {- throw new Error(- `Expected static instructions from "${source.logicalPath}" but got a dynamic resolver. Use compileInstructionsEntry instead.`,- );- }- return entry.definition;-}diff --git a/packages/eve/src/compiler/normalize-manifest-helpers.ts b/packages/eve/src/compiler/normalize-manifest-helpers.tsindex 51250cc50..ff072a99f 100644--- a/packages/eve/src/compiler/normalize-manifest-helpers.ts+++ b/packages/eve/src/compiler/normalize-manifest-helpers.ts@@ -8,7 +8,6 @@ import type {CompiledRemoteAgentNode,CompiledSubagentNode,} from "#compiler/manifest.js";-import { ROOT_COMPILED_AGENT_NODE_ID } from "#compiler/manifest.js";import type { ModuleSourceRef } from "#shared/source-ref.js";import { normalizeSubagentConfig } from "#compiler/normalize-subagent.js";import {@@ -67,13 +66,6 @@ export function assertUniqueRegistryIds(registries: readonly AgentSourceRegistry}}-export function assertRootOwnedSpecialTool(candidate: AgentModuleCandidate, label: string): void {- if (candidate.nodeId !== ROOT_COMPILED_AGENT_NODE_ID) {- throw new Error(`${label} can only be enabled on the root agent.`);- }- assertNonExtensionSpecialTool(candidate, label);-}-export function assertNonExtensionSpecialTool(candidate: AgentModuleCandidate,label: string,diff --git a/packages/eve/src/compiler/normalize-skill.ts b/packages/eve/src/compiler/normalize-skill.tsindex 967dfec8b..8d46e5351 100644--- a/packages/eve/src/compiler/normalize-skill.ts+++ b/packages/eve/src/compiler/normalize-skill.ts@@ -24,7 +24,7 @@ import {* Either a real skill definition or a dynamic skill resolver that* produces skills at runtime.*/-export type CompiledSkillEntry =+type CompiledSkillEntry =| { readonly kind: "skill"; readonly definition: CompiledSkillDefinition }| { readonly kind: "dynamic-skill"; readonly definition: CompiledDynamicSkillDefinition };diff --git a/packages/eve/src/compiler/project-sources.ts b/packages/eve/src/compiler/project-sources.tsindex cf6533995..4a5c8c380 100644--- a/packages/eve/src/compiler/project-sources.ts+++ b/packages/eve/src/compiler/project-sources.ts@@ -176,7 +176,7 @@ export function projectSelectedSources(input: {return projected;}-export function createFilesystemModuleCandidate(input: {+function createFilesystemModuleCandidate(input: {readonly externalDependencies: readonly string[];readonly extensionScope?: { readonly namespace: string; readonly sourceRoot: string };readonly layer: AgentSourceLayer;diff --git a/packages/eve/src/compiler/source-graph.ts b/packages/eve/src/compiler/source-graph.tsindex b00146185..1e995f9f6 100644--- a/packages/eve/src/compiler/source-graph.ts+++ b/packages/eve/src/compiler/source-graph.ts@@ -61,7 +61,7 @@ export interface AgentSourceRegistration {readonly source: ProgrammaticAgentSource;}-export interface AgentSourceRegistryOptions {+interface AgentSourceRegistryOptions {/** Programmatic extension declarations loaded by compiled virtual mounts. */readonly extensionDeclarations?: readonly ProgrammaticAgentSource[];readonly templates?: readonly ProgrammaticAgentSource[];@@ -589,11 +589,6 @@ export async function loadProgrammaticModuleNamespace(input: {return namespace;}-export function canonicalModuleSlot(logicalPath: string): string {- validateProgrammaticLogicalPath(logicalPath);- return canonicalSourceSlot(logicalPath);-}-/*** Canonical composition slot for one logical path. Module extensions, folder* forms, and skill packages collapse onto the same authored primitive identity.diff --git a/packages/eve/src/context/build-base-tool-context.ts b/packages/eve/src/context/build-base-tool-context.tsindex 28e6fe6b8..e134f9158 100644--- a/packages/eve/src/context/build-base-tool-context.ts+++ b/packages/eve/src/context/build-base-tool-context.ts@@ -5,7 +5,7 @@ import type { SandboxEnvironment } from "#shared/sandbox-environment.js";import type { ToolExecuteOptions } from "#tools/definition.js";/** Base context shared by tool executors. */-export type BaseToolContext = SessionContext & {+type BaseToolContext = SessionContext & {readonly abortSignal: AbortSignal;readonly callId: string;readonly toolName: string;diff --git a/packages/eve/src/context/dynamic-connection-lifecycle.test.ts b/packages/eve/src/context/dynamic-connection-lifecycle.test.tsindex a9de914a6..01c4461b4 100644--- a/packages/eve/src/context/dynamic-connection-lifecycle.test.ts+++ b/packages/eve/src/context/dynamic-connection-lifecycle.test.ts@@ -12,6 +12,7 @@ import type {ResolvedConnectionDefinition,ResolvedDynamicConnectionResolver,} from "#runtime/types.js";+import { captureLogRecords } from "#internal/testing/log-records.js";describe("dynamic connection lifecycle", () => {it("resolves a mixed connection map with bare map-key names", async () => {@@ -126,6 +127,7 @@ describe("dynamic connection lifecycle", () => {});it("does not reveal a shadowed static connection when its resolver fails", async () => {+ const logs = captureLogRecords();const { ctx, registry } = createContext([createStaticConnection("production")]);const resolver = createResolver({eventNames: ["session.started", "turn.started"],@@ -160,9 +162,16 @@ describe("dynamic connection lifecycle", () => {expect(registry.getConnections()).toMatchObject([{ connectionName: "production", description: "Caller production account." },]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic connection resolver (turn.started) failed.",+ }),+ );});it("requires an instance key for authenticated dynamic connections", async () => {+ const logs = captureLogRecords();const { ctx } = createContext();const resolver = createResolver({handler: () =>@@ -182,6 +191,12 @@ describe("dynamic connection lifecycle", () => {).rejects.toThrow('Dynamic connection resolver "connections/accounts.ts" failed during "session.started".',);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic connection resolver (session.started) failed.",+ }),+ );});it("derives an opaque identity for authenticated dynamic connections", async () => {@@ -289,6 +304,7 @@ describe("dynamic connection lifecycle", () => {});it("fails closed when a handler returns an unbranded connection", async () => {+ const logs = captureLogRecords();const { ctx, registry } = createContext();const resolver = createResolver({handler: () => ({@@ -310,6 +326,12 @@ describe("dynamic connection lifecycle", () => {);expect(registry.getConnections()).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic connection resolver (session.started) failed.",+ }),+ );});it("prefixes map keys produced by an extension resolver", async () => {diff --git a/packages/eve/src/context/dynamic-instruction-lifecycle.test.ts b/packages/eve/src/context/dynamic-instruction-lifecycle.test.tsindex d42a9a3c8..c585bc854 100644--- a/packages/eve/src/context/dynamic-instruction-lifecycle.test.ts+++ b/packages/eve/src/context/dynamic-instruction-lifecycle.test.ts@@ -25,6 +25,7 @@ import {import type { ResolvedDynamicInstructionsResolver } from "#runtime/types.js";import type { UnstampedMessageStreamEvent } from "#protocol/message.js";import type { DynamicResolveContext } from "#dynamic/definition.js";+import { captureLogRecords } from "#internal/testing/log-records.js";function createResolver(slug: string,@@ -184,6 +185,7 @@ describe("dispatchDynamicInstructionEvent", () => {});it("logs and skips unbranded return values", async () => {+ const logs = captureLogRecords();const ctx = createCtx();const resolver = createResolver("context", ["session.started"], () => ({markdown: "not branded",@@ -197,9 +199,17 @@ describe("dispatchDynamicInstructionEvent", () => {});expect(buildDynamicInstructionMessages(ctx)).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message:+ 'Dynamic instructions resolver "context" returned an unbranded value — wrap with defineInstructions().',+ }),+ );});it("logs and skips throwing resolvers", async () => {+ const logs = captureLogRecords();const ctx = createCtx();const resolver = createResolver("broken", ["session.started"], () => {throw new Error("resolver exploded");@@ -213,6 +223,12 @@ describe("dispatchDynamicInstructionEvent", () => {});expect(buildDynamicInstructionMessages(ctx)).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic instructions resolver (session.started) threw — skipping.",+ }),+ );});it("unions messages from different resolver slugs", async () => {@@ -265,6 +281,7 @@ describe("dispatchDynamicInstructionEvent", () => {});it("clears stale turn system instructions on role changes and resolver failures", async () => {+ const logs = captureLogRecords();const ctx = createCtx();let result: "system" | "user" | "throw" = "system";const resolver = createResolver("context", ["turn.started"], () => {@@ -306,9 +323,16 @@ describe("dispatchDynamicInstructionEvent", () => {event: makeEvent("turn.started"),});expect(buildDynamicInstructionMessages(ctx)).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic instructions resolver (turn.started) threw — skipping.",+ }),+ );});it("keeps valid session system instructions when refresh resolution fails", async () => {+ const logs = captureLogRecords();const ctx = createCtx();let throws = false;const resolver = createResolver("context", ["session.started"], () => {@@ -333,6 +357,12 @@ describe("dispatchDynamicInstructionEvent", () => {expect(buildDynamicInstructionMessages(ctx)).toEqual([{ content: "Durable session context.", role: "system" },]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic instructions resolver (session.started) threw — skipping.",+ }),+ );});it("materializes no message for blank user content", async () => {diff --git a/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts b/packages/eve/src/context/dynamic-subagent-lifecycle.test.tsindex 2e321090d..3fb4e2816 100644--- a/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts+++ b/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts@@ -16,6 +16,7 @@ import { defineAgent } from "#public/definitions/agent.js";import { defineRemoteAgent } from "#public/definitions/remote-agent.js";import { createSessionStartedEvent, createTurnStartedEvent } from "#protocol/message.js";import type { ResolvedDynamicSubagentResolver } from "#runtime/subagents/registry.js";+import { captureLogRecords } from "#internal/testing/log-records.js";describe("dynamic subagent lifecycle", () => {it("omits a subagent when its resolver returns null", async () => {@@ -391,6 +392,7 @@ describe("dynamic subagent lifecycle", () => {});it("omits an invalid non-null result", async () => {+ const logs = captureLogRecords();const ctx = createContext();const { resolver } = createResolver({handler: () => false,@@ -404,6 +406,12 @@ describe("dynamic subagent lifecycle", () => {});expect(buildDynamicSubagentTools(ctx)).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic subagent resolver (session.started) threw — omitting subagent.",+ }),+ );});it("refreshes session availability once per runtime revision", async () => {diff --git a/packages/eve/src/context/dynamic-tool-lifecycle.test.ts b/packages/eve/src/context/dynamic-tool-lifecycle.test.tsindex 187f43df8..d3c4560ba 100644--- a/packages/eve/src/context/dynamic-tool-lifecycle.test.ts+++ b/packages/eve/src/context/dynamic-tool-lifecycle.test.ts@@ -28,13 +28,12 @@ vi.mock("#context/build-callback-context.js", () => ({// Import after mock so the module picks up the mockconst {- replayDynamicSessionTools,dispatchDynamicToolEvent,refreshDynamicSessionToolsForRuntimeRevision,rebindMissingCompiledDynamicToolCallbacks,validateDurableDynamicToolCallbacks,} = await import("#context/dynamic-tool-lifecycle.js");-const { buildDynamicTools, buildResponseAuthorizationTools } =+const { buildDynamicTools, buildResponseAuthorizationTools, replayDynamicTools } =await import("#context/build-dynamic-tools.js");import { ContextContainer } from "#context/container.js";@@ -59,6 +58,7 @@ import {createStepStartedEvent,type UnstampedMessageStreamEvent,} from "#protocol/message.js";+import { captureLogRecords } from "#internal/testing/log-records.js";// Re-implement the naming logic here to test it independently// (the production function is unexported — testing via the public behavior)@@ -217,7 +217,7 @@ describe("durable callback capture validation", () => {});// ----------------------------------------------------------------------------// replayDynamicSessionTools — name+phase lookup + closure replay+// replayDynamicTools — name+phase lookup + closure replay// ---------------------------------------------------------------------------function callbackOwner(@@ -264,7 +264,9 @@ function requireCurrentMetadata(return metadata;}-describe("replayDynamicSessionTools", () => {+const SESSION_SCOPE = { sessionId: "test-session", scope: "session" } as const;++describe("replayDynamicTools", () => {function metadata(name: string, closure: JsonObject = {}): CurrentDynamicToolMetadata {return {callbacks: { execute: { closure } },@@ -277,7 +279,7 @@ describe("replayDynamicSessionTools", () => {}it("fails execution closed when the registered callback is unavailable", async () => {- const [tool] = replayDynamicSessionTools([metadata("unregistered")], [], "test-session");+ const [tool] = replayDynamicTools([metadata("unregistered")], SESSION_SCOPE);await expect(tool!.execute!({}, executeOptions)).rejects.toThrow('Dynamic tool "unregistered" cannot replay its execute callback',);@@ -296,7 +298,7 @@ describe("replayDynamicSessionTools", () => {tenantName: "Acme",});- const tools = replayDynamicSessionTools([durable], [], "test-session");+ const tools = replayDynamicTools([durable], SESSION_SCOPE);expect(tools).toHaveLength(1);expect(tools[0]!.name).toBe("replay-tool");expect(tools[0]!.description).toBe("replay-tool description");@@ -316,12 +318,12 @@ describe("replayDynamicSessionTools", () => {it("runs the latest registered implementation after a redeploy rebinds the name", async () => {registerTestCallback("latest-tool", "execute", () => ({ version: 1 }));- const tools = replayDynamicSessionTools([metadata("latest-tool")], [], "test-session");+ const tools = replayDynamicTools([metadata("latest-tool")], SESSION_SCOPE);await expect(tools[0]!.execute!({}, executeOptions)).resolves.toEqual({ version: 1 });// A redeploy re-resolves and replaces the binding under the same identity.registerTestCallback("latest-tool", "execute", () => ({ version: 2 }));- const rebound = replayDynamicSessionTools([metadata("latest-tool")], [], "test-session");+ const rebound = replayDynamicTools([metadata("latest-tool")], SESSION_SCOPE);await expect(rebound[0]!.execute!({}, executeOptions)).resolves.toEqual({ version: 2 });getDynamicCallbackRegistry().delete("latest-tool");});@@ -335,11 +337,7 @@ describe("replayDynamicSessionTools", () => {try {const closureVars = { counter: 1, label: "v1" };- const tools = replayDynamicSessionTools(- [metadata("snapshot-tool", closureVars)],- [],- "test-session",- );+ const tools = replayDynamicTools([metadata("snapshot-tool", closureVars)], SESSION_SCOPE);const tool = tools[0]!;tool.execute!({}, executeOptions);@@ -367,7 +365,7 @@ describe("replayDynamicSessionTools", () => {metadata("tenant__export", { tenant: "acme" }),];- const tools = replayDynamicSessionTools(durable, [], "test-session");+ const tools = replayDynamicTools(durable, SESSION_SCOPE);expect(tools).toHaveLength(2);expect(tools[0]!.name).toBe("tenant__query");expect(tools[1]!.name).toBe("tenant__export");@@ -1253,6 +1251,7 @@ describe("dispatchDynamicToolEvent", () => {});it("skips map entries that were not created with defineTool", async () => {+ const logs = captureLogRecords();const ctx = createCtx();const rawResolver = createResolver("raw", ["step.started"], () => ({unwrapped: {@@ -1270,11 +1269,18 @@ describe("dispatchDynamicToolEvent", () => {});expect(buildDynamicTools(ctx)).toHaveLength(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic tool resolver (step.started) failed — skipping its complete result.",+ }),+ );});it.each(["single", "map"])("does not advertise a workflow tool returned as a %s",async (shape) => {+ const logs = captureLogRecords();const ctx = createCtx();const tool = defineWorkflowTool({description: "Invalid dynamic workflow",@@ -1293,10 +1299,17 @@ describe("dispatchDynamicToolEvent", () => {event: makeEvent("session.started"),});expect(buildDynamicTools(ctx)).toHaveLength(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic tool resolver (session.started) failed — skipping its complete result.",+ }),+ );},);it("resolver throwing is logged and skipped — other resolvers still work", async () => {+ const logs = captureLogRecords();const ctx = createCtx();const badResolver = createResolver("bad", ["session.started"], () => {throw new Error("resolver exploded");@@ -1315,6 +1328,12 @@ describe("dispatchDynamicToolEvent", () => {const tools = buildDynamicTools(ctx);expect(tools).toHaveLength(1);expect(tools[0]!.name).toBe("working");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic tool resolver (session.started) failed — skipping its complete result.",+ }),+ );});it("uses file slug when handler returns a single entry", async () => {@@ -1808,6 +1827,7 @@ describe("programmatic dynamic tools (no bundler transform)", () => {});it("rejects an untransformed tool atomically without resolver hydration", async () => {+ const logs = captureLogRecords();const ctx = createCtx();const execute = vi.fn(async () => ({ ok: true }));const request = vi.fn(async () => "user-approval" as const);@@ -1834,6 +1854,12 @@ describe("programmatic dynamic tools (no bundler transform)", () => {expect(execute).not.toHaveBeenCalled();expect(request).not.toHaveBeenCalled();expect(response).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Dynamic tool resolver (session.started) failed — skipping its complete result.",+ }),+ );});it("propagates outputSchema from dynamic entries into harness tools and metadata", async () => {@@ -2119,6 +2145,7 @@ describe("dynamic callback cache recovery", () => {it.each(["null", "throw", "invalid"])("clears withdrawn and partially registered callbacks when a resolver returns %s",async (outcome) => {+ const logs = captureLogRecords();const ctx = createCtx();const original = createResolver("changing", ["session.started"], () => ({changed: createReplayableTool(),@@ -2158,6 +2185,12 @@ describe("dynamic callback cache recovery", () => {await expect(tools.find((tool) => tool.name === "other")!.execute!({}, executeOptions),).resolves.toEqual({ ok: true });+ const failures = logs.records.filter(+ (record) =>+ record.message ===+ "Dynamic tool resolver (session.started) failed — skipping its complete result.",+ );+ expect(failures).toHaveLength(outcome === "null" ? 0 : 1);},);diff --git a/packages/eve/src/context/dynamic-tool-lifecycle.ts b/packages/eve/src/context/dynamic-tool-lifecycle.tsindex 0491868be..7924a181e 100644--- a/packages/eve/src/context/dynamic-tool-lifecycle.ts+++ b/packages/eve/src/context/dynamic-tool-lifecycle.ts@@ -2,7 +2,6 @@ import type { ModelMessage } from "ai";import { isWorkflowToolDefinition } from "#tools/workflow-definition.js";-import { replayDynamicTools } from "#context/build-dynamic-tools.js";import { contextStorage, type AlsContext } from "#context/container.js";import type { ContextKey } from "#context/key.js";import {@@ -19,7 +18,6 @@ import {type PersistedDynamicToolMetadata,} from "#context/dynamic-tool-metadata.js";import { buildResolveContext } from "#context/dynamic-resolve-context.js";-import type { HarnessToolDefinition } from "#harness/execute-tool.js";import { createLogger } from "#internal/logging.js";import type {SessionStartedStreamEvent,@@ -69,15 +67,6 @@ function qualifyDynamicToolNames(}));}-/** Kept as the session-specific entry point for existing runtime consumers. */-export function replayDynamicSessionTools(- metadata: readonly CurrentDynamicToolMetadata[],- _resolvers: readonly ResolvedDynamicToolResolver[],- sessionId: string,-): readonly HarnessToolDefinition[] {- return replayDynamicTools(metadata, { sessionId, scope: "session" });-}-function durableKeyForEvent(eventType: string,): ContextKey<readonly PersistedDynamicToolMetadata[]> | undefined {diff --git a/packages/eve/src/context/dynamic-tool-metadata.ts b/packages/eve/src/context/dynamic-tool-metadata.tsindex d2bd3dc20..2347fca80 100644--- a/packages/eve/src/context/dynamic-tool-metadata.ts+++ b/packages/eve/src/context/dynamic-tool-metadata.ts@@ -59,7 +59,7 @@ export function isCurrentDynamicToolMetadata(return metadata.callbacks !== undefined && !isOldSourceOffsetDynamicToolMetadata(metadata);}-export function isOldStepFunctionDynamicToolMetadata(+function isOldStepFunctionDynamicToolMetadata(metadata: PersistedDynamicToolMetadata,): metadata is OldStepFunctionDynamicToolMetadata {return metadata.callbacks === undefined;diff --git a/packages/eve/src/context/memory-lifecycle.ts b/packages/eve/src/context/memory-lifecycle.tsindex 03bab068c..5727027ff 100644--- a/packages/eve/src/context/memory-lifecycle.ts+++ b/packages/eve/src/context/memory-lifecycle.ts@@ -477,7 +477,7 @@ async function settleMemoryOperations<T>(operations: readonly Promise<T>[]): Proreturn values;}-export function memoryOperationId(input: {+function memoryOperationId(input: {readonly phase: string;readonly sequence: number;readonly sessionId: string;diff --git a/packages/eve/src/discover/connections.ts b/packages/eve/src/discover/connections.tsindex f4559c2ed..0d0e1db71 100644--- a/packages/eve/src/discover/connections.ts+++ b/packages/eve/src/discover/connections.ts@@ -16,20 +16,19 @@ import { collectNamedSlotCandidates } from "#discover/slots.js";* Shared diagnostic emitted when the authored `connections/` root is not a* directory.*/-export const DISCOVER_CONNECTIONS_DIRECTORY_INVALID = "discover/connections-directory-invalid";+const DISCOVER_CONNECTIONS_DIRECTORY_INVALID = "discover/connections-directory-invalid";/*** Discovery diagnostic emitted when a connection exists in both file form* (`connections/<name>.ts`) and folder form (`connections/<name>/`).*/-export const DISCOVER_CONNECTION_FILE_FOLDER_COLLISION =- "discover/connection-file-folder-collision";+const DISCOVER_CONNECTION_FILE_FOLDER_COLLISION = "discover/connection-file-folder-collision";/*** Discovery diagnostic emitted when a folder-form connection contains no* `connection.ts` definition module.*/-export const DISCOVER_CONNECTION_FOLDER_EMPTY = "discover/connection-folder-empty";+const DISCOVER_CONNECTION_FOLDER_EMPTY = "discover/connection-folder-empty";/*** Filename of the connection definition module inside a folder-formdiff --git a/packages/eve/src/discover/diagnostics.ts b/packages/eve/src/discover/diagnostics.tsindex 866ebcaee..8b5526807 100644--- a/packages/eve/src/discover/diagnostics.ts+++ b/packages/eve/src/discover/diagnostics.ts@@ -1,14 +1,9 @@import { z } from "#compiled/zod/index.js";-/**- * Structured discovery diagnostic severity.- */-export type DiscoverDiagnosticSeverity = z.infer<typeof discoverDiagnosticSeveritySchema>;-/*** Zod schema for structured discovery diagnostic severities.*/-export const discoverDiagnosticSeveritySchema = z.union([z.literal("error"), z.literal("warning")]);+const discoverDiagnosticSeveritySchema = z.union([z.literal("error"), z.literal("warning")]);/*** Structured discovery diagnostic emitted while classifying authored sources.diff --git a/packages/eve/src/discover/discover-subagent.ts b/packages/eve/src/discover/discover-subagent.tsindex 38058e792..cab6c7b2d 100644--- a/packages/eve/src/discover/discover-subagent.ts+++ b/packages/eve/src/discover/discover-subagent.ts@@ -47,7 +47,7 @@ export const DISCOVER_LOCAL_SUBAGENT_SCHEDULES_INVALID ="discover/local-subagent-schedules-invalid";export const DISCOVER_REQUIRED_SUBAGENT_CONFIG_MODULE_MISSING ="discover/required-subagent-config-module-missing";-export const DISCOVER_SUBAGENTS_DIRECTORY_INVALID = "discover/subagents-directory-invalid";+const DISCOVER_SUBAGENTS_DIRECTORY_INVALID = "discover/subagents-directory-invalid";/*** Input for discovering subagent entries beneath one authored source root.diff --git a/packages/eve/src/discover/extensions.ts b/packages/eve/src/discover/extensions.tsindex 5c1f90a76..20ec3c631 100644--- a/packages/eve/src/discover/extensions.ts+++ b/packages/eve/src/discover/extensions.ts@@ -18,7 +18,7 @@ import {/*** Emitted when a mount file cannot be resolved to an extension package.*/-export const DISCOVER_EXTENSION_MOUNT_UNRESOLVED = "discover/extension-mount-unresolved";+const DISCOVER_EXTENSION_MOUNT_UNRESOLVED = "discover/extension-mount-unresolved";/*** Emitted when one namespace is claimed by both a file mount@@ -44,7 +44,7 @@ export const DISCOVER_EXTENSION_NESTED_MOUNT_UNSUPPORTED =/*** Emitted when a resolved package is not a valid eve extension.*/-export const DISCOVER_EXTENSION_PACKAGE_INVALID = "discover/extension-package-invalid";+const DISCOVER_EXTENSION_PACKAGE_INVALID = "discover/extension-package-invalid";/*** Emitted when an extension distribution's compatibility manifest is missing@@ -83,7 +83,7 @@ export const DISCOVER_EXTENSION_INSTRUMENTATION_UNSUPPORTED =/*** Resolved on-disk location of one mounted extension package.*/-export interface ExtensionMountLocation {+interface ExtensionMountLocation {/** Mount namespace derived from the mount filename (e.g. `crm`). */readonly namespace: string;/** Package specifier the mount imports (e.g. `@acme/crm`). */@@ -103,7 +103,7 @@ export interface ExtensionMountLocation {* inspected. Development uses this to build a mounted workspace extension* before the consumer requires its dist tree to exist.*/-export interface ExtensionMountPackageLocation {+interface ExtensionMountPackageLocation {/** Mount namespace derived from the mount filename. */readonly namespace: string;/** Package specifier read from the mount declaration. */diff --git a/packages/eve/src/discover/filesystem.ts b/packages/eve/src/discover/filesystem.tsindex 6c244b758..a78e780fc 100644--- a/packages/eve/src/discover/filesystem.ts+++ b/packages/eve/src/discover/filesystem.ts@@ -17,7 +17,7 @@ export const SUPPORTED_AUTHORED_MODULE_FILE_EXTENSIONS = [* Files that mark a surrounding directory as an application root when paired* with a top-level `agent/` directory.*/-export const PROJECT_MARKER_FILE_NAMES = ["package.json", "vercel.json"] as const;+const PROJECT_MARKER_FILE_NAMES = ["package.json", "vercel.json"] as const;const PROJECT_MARKER_FILE_NAME_SET = new Set<string>(PROJECT_MARKER_FILE_NAMES);const GENERATED_AGENT_DIRECTORY_NAMES = new Set<string>([@@ -37,7 +37,7 @@ export type DirectoryEntryType = "directory" | "file" | "other";/*** Classified root-level agent entry.*/-export type AgentRootEntryKind =+type AgentRootEntryKind =| "agent-config-module"| "channels-directory"| "connections-directory"@@ -63,7 +63,7 @@ export type AgentRootEntryKind =/*** Classified local-subagent root entry.*/-export type LocalSubagentEntryKind =+type LocalSubagentEntryKind =| "agent-config-module"| "connections-directory"| "extensions-directory"@@ -87,7 +87,7 @@ export type LocalSubagentEntryKind =/*** Classified Agent Skills package entry.*/-export type SkillPackageEntryKind =+type SkillPackageEntryKind =| "skill-assets-directory"| "skill-markdown"| "skill-references-directory"@@ -97,7 +97,7 @@ export type SkillPackageEntryKind =/*** Classified top-level entry inside `skills/`.*/-export type SkillsDirectoryEntryKind =+type SkillsDirectoryEntryKind =| "flat-skill-markdown"| "flat-skill-module"| "ignored-declaration"diff --git a/packages/eve/src/discover/grammar.ts b/packages/eve/src/discover/grammar.tsindex b53de9609..b8804d5c9 100644--- a/packages/eve/src/discover/grammar.ts+++ b/packages/eve/src/discover/grammar.ts@@ -1,4 +1,3 @@-import type { Dirent } from "node:fs";import { join } from "node:path";import type { ModuleSourceRef } from "#shared/source-ref.js";@@ -78,7 +77,7 @@ export const DISCOVER_TOOL_NAME_INVALID = "discover/tool-name-invalid";* Shared diagnostic emitted when an authored `connections/*.{ts,…}` filename* does not satisfy the connection slug charset rule.*/-export const DISCOVER_CONNECTION_NAME_INVALID = "discover/connection-name-invalid";+const DISCOVER_CONNECTION_NAME_INVALID = "discover/connection-name-invalid";/*** Shared diagnostic emitted when the authored `sandbox/` root is not a@@ -91,13 +90,13 @@ export const DISCOVER_SANDBOX_DIRECTORY_INVALID = "discover/sandbox-directory-in* Shared diagnostic emitted when the authored `instructions/` root is not a* directory.*/-export const DISCOVER_INSTRUCTIONS_DIRECTORY_INVALID = "discover/instructions-directory-invalid";+const DISCOVER_INSTRUCTIONS_DIRECTORY_INVALID = "discover/instructions-directory-invalid";/*** Shared diagnostic emitted when an authored `channels/**` filename or* directory segment does not satisfy the channel slug charset rule.*/-export const DISCOVER_CHANNEL_NAME_INVALID = "discover/channel-name-invalid";+const DISCOVER_CHANNEL_NAME_INVALID = "discover/channel-name-invalid";/*** Shared diagnostic emitted when an authored `hooks/**` filename or@@ -132,7 +131,7 @@ export const CONNECTION_SLUG_PATTERN = /^[a-z][a-z0-9-]{0,63}$/;/*** Channel filename / directory segment charset.*/-export const CHANNEL_SLUG_PATTERN = /^(\.?[a-z][a-z0-9-]{0,63}|\[[a-zA-Z][a-zA-Z0-9_]{0,63}\])$/;+const CHANNEL_SLUG_PATTERN = /^(\.?[a-z][a-z0-9-]{0,63}|\[[a-zA-Z][a-zA-Z0-9_]{0,63}\])$/;/*** Hook filename / directory segment charset. Each segment of the@@ -141,7 +140,7 @@ export const CHANNEL_SLUG_PATTERN = /^(\.?[a-z][a-z0-9-]{0,63}|\[[a-zA-Z][a-zA-Z* letter, up to 64 characters per segment. Bracketed parameter forms* are not allowed — hooks have no URL semantics.*/-export const HOOK_SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;+const HOOK_SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;/*** Extension mount filename charset. The basename becomes the namespace the@@ -150,24 +149,13 @@ export const HOOK_SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;* digits, underscores, and dashes, starting with a letter, up to 64* characters.*/-export const EXTENSION_SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;+const EXTENSION_SLUG_PATTERN = /^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/;/*** Shared diagnostic emitted when discovery ignores one unsupported directory.*/export const DISCOVER_UNSUPPORTED_DIRECTORY = "discover/unsupported-directory";-/**- * Structural `Dirent`-like entry used throughout discovery.- *- * Legacy alias preserved for backwards compatibility inside `src/discover/`.- * Every discover function now consumes {@link ProjectSourceEntry}, which- * has the same three properties (`name`, `isDirectory()`, `isFile()`). Real- * `Dirent<string>` values from `node:fs` satisfy this shape, so- * {@link createDiskProjectSource} returns them directly.- */-export type StringDirent = Dirent<string>;-/*** Reads sorted agent source entries, excluding colocated tests unless reading resources.*/diff --git a/packages/eve/src/discover/manifest.ts b/packages/eve/src/discover/manifest.tsindex 66158f2b1..992d71862 100644--- a/packages/eve/src/discover/manifest.ts+++ b/packages/eve/src/discover/manifest.ts@@ -183,7 +183,7 @@ export type SubagentSourceRef = LocalSubagentSourceRef;/*** Input used to build a manifest-ready connection source ref.*/-export interface CreateConnectionSourceRefInput extends CreateModuleSourceRefInput {+interface CreateConnectionSourceRefInput extends CreateModuleSourceRefInput {connectionName: string;}@@ -279,7 +279,7 @@ export interface CreateAgentSourceManifestInput {/*** Input used to build a manifest-ready skill package source ref.*/-export interface CreateSkillPackageSourceRefInput {+interface CreateSkillPackageSourceRefInput {assetsPath?: string;description: string;license?: string;@@ -298,7 +298,7 @@ export interface CreateSkillPackageSourceRefInput {/*** Input used to build a manifest-ready module source ref.*/-export interface CreateModuleSourceRefInput {+interface CreateModuleSourceRefInput {exportName?: string;logicalPath: string;sourceId?: string;@@ -307,7 +307,7 @@ export interface CreateModuleSourceRefInput {/*** Input used to build a manifest-ready local subagent source ref.*/-export interface CreateLocalSubagentSourceRefInput {+interface CreateLocalSubagentSourceRefInput {entryPath: string;logicalPath: string;manifest: AgentSourceManifest;diff --git a/packages/eve/src/discover/memory.ts b/packages/eve/src/discover/memory.tsindex a51682f62..2029d16de 100644--- a/packages/eve/src/discover/memory.ts+++ b/packages/eve/src/discover/memory.ts@@ -7,7 +7,7 @@ import type { MemorySourceRef } from "#discover/manifest.js";import { discoverNamedSourceDirectory } from "#discover/named-source-directory.js";import type { ProjectSource, ProjectSourceEntry } from "#discover/project-source.js";-export const DISCOVER_MEMORY_DIRECTORY_INVALID = "discover/memory-directory-invalid";+const DISCOVER_MEMORY_DIRECTORY_INVALID = "discover/memory-directory-invalid";export const DISCOVER_MEMORY_SLOT_AMBIGUOUS = "discover/memory-slot-ambiguous";export const DISCOVER_MEMORY_NAME_INVALID = "discover/memory-name-invalid";diff --git a/packages/eve/src/discover/project-source.ts b/packages/eve/src/discover/project-source.tsindex a409d28d3..e964c430b 100644--- a/packages/eve/src/discover/project-source.ts+++ b/packages/eve/src/discover/project-source.ts@@ -104,7 +104,7 @@ export function createDiskProjectSource(): ProjectSource {** Keys are paths; values are UTF-8 text or `{ content }` records.*/-export interface MemoryProjectSourceInput {+interface MemoryProjectSourceInput {/*** Optional root hint used only for diagnostics. The source itself accepts* reads against any path — unrelated absolute paths simply resolve asdiff --git a/packages/eve/src/discover/skills.ts b/packages/eve/src/discover/skills.tsindex 37b9f3f75..32e28efff 100644--- a/packages/eve/src/discover/skills.ts+++ b/packages/eve/src/discover/skills.ts@@ -22,7 +22,7 @@ import { createDiskProjectSource, type ProjectSource } from "#discover/project-s/*** Diagnostics emitted by skill discovery.*/-export const DISCOVER_SKILLS_DIRECTORY_INVALID = "discover/skills-directory-invalid";+const DISCOVER_SKILLS_DIRECTORY_INVALID = "discover/skills-directory-invalid";export const DISCOVER_SKILL_COLLISION = "discover/skill-collision";export const DISCOVER_SKILL_ENTRY_NOT_DIRECTORY = "discover/skill-entry-not-directory";export const DISCOVER_SKILL_FRONTMATTER_INVALID = "discover/skill-frontmatter-invalid";diff --git a/packages/eve/src/evals/cli/eval-client.ts b/packages/eve/src/evals/cli/eval-client.tsindex fe72cf988..565794fe7 100644--- a/packages/eve/src/evals/cli/eval-client.ts+++ b/packages/eve/src/evals/cli/eval-client.ts@@ -29,7 +29,7 @@ export function resolveEvalClientOptions(return options;}-export interface CreateEvalClientOptions {+interface CreateEvalClientOptions {/** Working directory for Vercel lookup and the fallback on-disk project link. */readonly workspaceRoot?: string;/** Test seams for the two authority-resolution boundaries. */diff --git a/packages/eve/src/evals/judge.ts b/packages/eve/src/evals/judge.tsindex bbfda02ca..432dad8e4 100644--- a/packages/eve/src/evals/judge.ts+++ b/packages/eve/src/evals/judge.ts@@ -13,7 +13,7 @@ import type {JudgeQuestionConstraint,} from "#evals/types.js";-export interface JudgeDeps {+interface JudgeDeps {readonly collector: AssertionCollector;readonly getReply: () => string | null;readonly getInput: () => string;diff --git a/packages/eve/src/evals/runner/execute-task.ts b/packages/eve/src/evals/runner/execute-task.tsindex 54402c729..c8374fdce 100644--- a/packages/eve/src/evals/runner/execute-task.ts+++ b/packages/eve/src/evals/runner/execute-task.ts@@ -43,7 +43,7 @@ interface ExecuteTaskOptions {* set when the `test` body threw (e.g. a failed `expectOk()` or a bespoke* `throw`); the partial run is still captured so recorded assertions report.*/-export interface ExecuteTaskResult {+interface ExecuteTaskResult {readonly result: EveEvalTaskResult;readonly assertions: readonly AssertionResult[];readonly error?: string;diff --git a/packages/eve/src/evals/types.ts b/packages/eve/src/evals/types.tsindex d0ee57379..c66392cc2 100644--- a/packages/eve/src/evals/types.ts+++ b/packages/eve/src/evals/types.ts@@ -294,7 +294,7 @@ export interface EveEvalLiveTurn {}/** Operations and state belonging to one accepted session. */-export interface EveEvalSessionDriver {+interface EveEvalSessionDriver {/** All events observed on this session so far. */readonly events: readonly MessageStreamEvent[];/**diff --git a/packages/eve/src/eve-channel/support.ts b/packages/eve/src/eve-channel/support.tsindex b9b5a28fb..09a21078a 100644--- a/packages/eve/src/eve-channel/support.ts+++ b/packages/eve/src/eve-channel/support.ts@@ -108,7 +108,7 @@ export function normalizeEveCors(cors: EveChannelCors | undefined): ChannelCorsreturn result;}-export function normalizeEveCorsOrigin(+function normalizeEveCorsOrigin(origin: NonNullable<EveChannelCorsOptions["origin"]>,): "*" | "null" | readonly string[] {if (origin === "*" || origin === "null") {@@ -159,6 +159,6 @@ export async function resolveOnMessage(input: {return { auth: result.auth, context: result.context, title: result.title };}-export function defaultOnMessage(ctx: EveMessageContext): EveMessageResult {+function defaultOnMessage(ctx: EveMessageContext): EveMessageResult {return { auth: defaultEveAuth(ctx) };}diff --git a/packages/eve/src/execution/cancel-indexed-session-tasks-step.test.ts b/packages/eve/src/execution/cancel-indexed-session-tasks-step.test.tsindex 34ee9b9df..e7a4c231e 100644--- a/packages/eve/src/execution/cancel-indexed-session-tasks-step.test.ts+++ b/packages/eve/src/execution/cancel-indexed-session-tasks-step.test.ts@@ -7,6 +7,7 @@ import {readWorkflowTaskView,type BackgroundWorkflowToolRun,} from "#harness/workflow-tool-runs.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const { cancelOwnedTaskMock, deserializeContextMock, hydrateDurableSessionMock } = vi.hoisted(() => ({@@ -34,6 +35,7 @@ describe("cancelAllIndexedSessionTasksStep", () => {});it("cancels every indexed task sequentially with the hydrated parent session", async () => {+ const logs = captureLogRecords();const task1 = indexedTask("task-1");const task2 = indexedTask("task-2");@@ -61,9 +63,16 @@ describe("cancelAllIndexedSessionTasksStep", () => {serializedContext: { context: "latest" },session: "runtime-session",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "failed to settle background task instrumentation",+ }),+ );});it("leaves a task working when cancellation fails", async () => {+ const logs = captureLogRecords();cancelOwnedTaskMock.mockRejectedValueOnce(new Error("Cancellation unavailable"));const result = await cancelAllIndexedSessionTasksStep({serializedContext: {},@@ -74,6 +83,15 @@ describe("cancelAllIndexedSessionTasksStep", () => {.query().map((task) => task.status),).toEqual(["working", "cancelled"]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "failed to cancel indexed task" }),+ );+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "failed to settle background task instrumentation",+ }),+ );});it("does not require runtime context when no tasks are indexed", async () => {diff --git a/packages/eve/src/execution/connection-auth-tool-result.ts b/packages/eve/src/execution/connection-auth-tool-result.tsdeleted file mode 100644index e68c5ddd1..000000000--- a/packages/eve/src/execution/connection-auth-tool-result.ts+++ /dev/null@@ -1,13 +0,0 @@-import type { JsonValue } from "#shared/json.js";--export function normalizeConnectionAuthToolResult(result: unknown): JsonValue {- if (result === undefined) return null;- try {- return JSON.parse(JSON.stringify(result)) as JsonValue;- } catch {- return {- error: "tool_result_not_serializable",- retryable: false,- };- }-}diff --git a/packages/eve/src/execution/dynamic-workflow/schema.ts b/packages/eve/src/execution/dynamic-workflow/schema.tsindex ddcf7360c..ca90df6e0 100644--- a/packages/eve/src/execution/dynamic-workflow/schema.ts+++ b/packages/eve/src/execution/dynamic-workflow/schema.ts@@ -26,7 +26,7 @@ export interface WorkflowProgramInput {export type WorkflowProgramOptions = Pick<WorkflowProgramInput, "maxSubagents">;-export interface WorkflowProgramAgentCall {+interface WorkflowProgramAgentCall {readonly input: {readonly agentId?: string;readonly message: string;diff --git a/packages/eve/src/execution/effective-agent-config.ts b/packages/eve/src/execution/effective-agent-config.tsindex c2f5ad0ec..2ee8f5633 100644--- a/packages/eve/src/execution/effective-agent-config.ts+++ b/packages/eve/src/execution/effective-agent-config.ts@@ -5,7 +5,7 @@ import type { CompiledBundle } from "#runtime/sessions/runtime-context-keys.js";import type { AgentLimitsDefinition } from "#shared/agent-definition.js";import type { DynamicSubagentAgentConfig } from "#runtime/subagents/dynamic-agent-config.js";-export interface EffectiveAgentRuntime {+interface EffectiveAgentRuntime {readonly limits?: AgentLimitsDefinition;readonly thresholdPercent?: number;readonly turnAgent: RuntimeTurnAgent;diff --git a/packages/eve/src/execution/eve-workflow-attributes.ts b/packages/eve/src/execution/eve-workflow-attributes.tsindex cc313ec2c..d9c508b4f 100644--- a/packages/eve/src/execution/eve-workflow-attributes.ts+++ b/packages/eve/src/execution/eve-workflow-attributes.ts@@ -60,7 +60,7 @@ import { resolveForwardedTraceSeed } from "#shared/forwarded-trace-policy.js";* delegated child runs. Tag emitters use this to populate* `$eve.subagent`.*/-export interface SessionIdentitySummary {+interface SessionIdentitySummary {readonly nodeId: string;}@@ -82,7 +82,7 @@ interface SerializedSessionParent {/*** Parent session lineage decoded from the serialized run context.*/-export interface SessionParentLineage {+interface SessionParentLineage {readonly callId?: string;readonly rootSessionId?: string;readonly sessionId?: string;@@ -121,7 +121,7 @@ export function isWorkflowTraceContentVisible(serializedContext: Record<string,});}-export function isWorkflowOtelTraceEnabled(serializedContext: Record<string, unknown>): boolean {+function isWorkflowOtelTraceEnabled(serializedContext: Record<string, unknown>): boolean {return serializedContext[OtelTraceEnabledKey.name] === true;}@@ -195,7 +195,7 @@ export function readScheduleId(serializedContext: Record<string, unknown>): stri}/** Reads the bounded title stored for a top-level session. */-export function readSessionTitle(serializedContext: Record<string, unknown>): string | undefined {+function readSessionTitle(serializedContext: Record<string, unknown>): string | undefined {const title = serializedContext[SessionTitleKey.name];return isNonEmptyString(title) ? title : undefined;}diff --git a/packages/eve/src/execution/history-view.ts b/packages/eve/src/execution/history-view.tsindex 70cbe1ef0..d1f8f164b 100644--- a/packages/eve/src/execution/history-view.ts+++ b/packages/eve/src/execution/history-view.ts@@ -6,7 +6,7 @@ import {} from "#shared/history-view.js";import { projectMemoryHistoryFromSessionState } from "#shared/memory-state.js";-export interface ExecutionHistoryView {+interface ExecutionHistoryView {readonly initial: PreparedHistoryView;readonly messages: (session: HarnessSession) => PreparedHistoryView["messages"];readonly prepare: (session: HarnessSession) => PreparedHistoryView;diff --git a/packages/eve/src/execution/legacy-session/import.integration.test.ts b/packages/eve/src/execution/legacy-session/import.integration.test.tsindex 7d8f2d919..1b3ef2e1d 100644--- a/packages/eve/src/execution/legacy-session/import.integration.test.ts+++ b/packages/eve/src/execution/legacy-session/import.integration.test.ts@@ -14,6 +14,7 @@ import {sessionCommandHookToken,sessionInboxHookToken,} from "#execution/session-inbox/address.js";+import { captureConsoleOutput, workflowSdkNotice } from "#internal/testing/log-records.js";describe("legacy session import", () => {it.each([@@ -23,6 +24,7 @@ describe("legacy session import", () => {])("imports $inputVersion / inbox $inboxVersion / duplicate $duplicateImport / committed $committedInput",async (variant) => {+ const output = captureConsoleOutput();const runtime = await createTestRuntime({ agent: { name: "legacy-import-current" } });{await runtime.run(async () => {@@ -128,6 +130,13 @@ describe("legacy session import", () => {}});}+ // The SDK reports the ignored `latest` deployment once per process.+ expect(+ output.unexpected(+ workflowSdkNotice.ignoredLatestDeployment,+ workflowSdkNotice.unpinnedDelivery,+ ),+ ).toEqual([]);},);});@@ -161,6 +170,7 @@ describe("unsupported drivers", () => {describe("imported session lifetime", () => {it("hands off again using a current checkpoint and completes the original stream", async () => {+ const output = captureConsoleOutput();const runtime = await createTestRuntime({ agent: { name: "legacy-handoff" } });await runtime.run(async () => {const driver = await start(legacySessionDriverWorkflow, [@@ -218,6 +228,10 @@ describe("imported session lifetime", () => {if ((await driver.status) === "running") await driver.cancel();}});+ expect(output.lines).toContainEqual(+ expect.stringContaining(workflowSdkNotice.unpinnedDelivery),+ );+ expect(output.unexpected(workflowSdkNotice.unpinnedDelivery)).toEqual([]);});it("expires after the renewed configured lifetime", async () => {const runtime = await createTestRuntime({ agent: { name: "legacy-timeout" } });diff --git a/packages/eve/src/execution/node-step.test.ts b/packages/eve/src/execution/node-step.test.tsindex 3a2304617..bf1d86ea2 100644--- a/packages/eve/src/execution/node-step.test.ts+++ b/packages/eve/src/execution/node-step.test.ts@@ -21,7 +21,7 @@ import type { RuntimeTurnAgent } from "#runtime/agent/bootstrap.js";import { resolveRuntimeModelReference } from "#runtime/agent/resolve-model.js";import { createBundledRuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";import { ROOT_RUNTIME_AGENT_NODE_ID, type ResolvedRuntimeAgentNode } from "#runtime/graph.js";-import { createEmptyHookRegistry } from "#runtime/hooks/registry.js";+import { createRuntimeHookRegistry } from "#runtime/hooks/registry.js";import type { RuntimeToolRegistry } from "#runtime/tools/registry.js";import { createRuntimeToolRegistry } from "#runtime/tools/registry.js";import { createPreparedRuntimeSubagentTool } from "#runtime/subagents/registry.js";@@ -37,6 +37,10 @@ import {SUBAGENT_TOOL_INPUT_SCHEMA,} from "#tools/framework/agent-contract.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+vi.mock("ai", () => ({ToolLoopAgent: vi.fn(),jsonSchema: vi.fn((schema: unknown) => schema),@@ -156,7 +160,7 @@ function createTestNode(return {agent,channels: [],- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),nodeId: ROOT_RUNTIME_AGENT_NODE_ID,sandboxRegistry: createStubSandboxRegistry(),subagentRegistry: {diff --git a/packages/eve/src/execution/node-step.ts b/packages/eve/src/execution/node-step.tsindex 5ea0e632e..917f48e98 100644--- a/packages/eve/src/execution/node-step.ts+++ b/packages/eve/src/execution/node-step.ts@@ -42,7 +42,7 @@ const log = createLogger("execution.node-step");* `createWorkflowRuntime`, so callers pass the constructor directly —* no wrapper needed.*/-export type CreateRuntime = (config: {+type CreateRuntime = (config: {readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;readonly nodeId?: string;}) => Runtime;@@ -50,7 +50,7 @@ export type CreateRuntime = (config: {/*** Input for building a harness step for one resolved runtime node.*/-export interface CreateExecutionNodeStepInput {+interface CreateExecutionNodeStepInput {readonly steeringSignal?: AbortSignal;/** Cancellation signal forwarded to the tool-loop harness. */readonly abortSignal?: AbortSignal;diff --git a/packages/eve/src/execution/sandbox/active-handles.test.ts b/packages/eve/src/execution/sandbox/active-handles.test.tsindex 67dc8fe3a..cd12d34e9 100644--- a/packages/eve/src/execution/sandbox/active-handles.test.ts+++ b/packages/eve/src/execution/sandbox/active-handles.test.ts@@ -1,14 +1,12 @@import { afterEach, describe, expect, it, vi } from "vitest";import {- clearActiveSandboxHandlesForTest,- countActiveSandboxHandles,shutdownActiveSandboxHandles,trackActiveSandboxHandle,} from "#execution/sandbox/active-handles.js";-afterEach(() => {- clearActiveSandboxHandlesForTest();+afterEach(async () => {+ await shutdownActiveSandboxHandles();});describe("shutdownActiveSandboxHandles", () => {@@ -18,11 +16,11 @@ describe("shutdownActiveSandboxHandles", () => {trackActiveSandboxHandle({ providerName: "docker", handle: first, sessionId: "session-1" });trackActiveSandboxHandle({ providerName: "docker", handle: second, sessionId: "session-2" });+ await shutdownActiveSandboxHandles();await shutdownActiveSandboxHandles();expect(first.onRuntimeShutdown).toHaveBeenCalledTimes(1);expect(second.onRuntimeShutdown).toHaveBeenCalledTimes(1);- expect(countActiveSandboxHandles()).toBe(0);});it("replaces the tracked handle when the same session is reopened", async () => {@@ -31,7 +29,6 @@ describe("shutdownActiveSandboxHandles", () => {trackActiveSandboxHandle({ providerName: "docker", handle: stale, sessionId: "session-1" });trackActiveSandboxHandle({ providerName: "docker", handle: fresh, sessionId: "session-1" });- expect(countActiveSandboxHandles()).toBe(1);await shutdownActiveSandboxHandles();expect(stale.onRuntimeShutdown).not.toHaveBeenCalled();diff --git a/packages/eve/src/execution/sandbox/active-handles.ts b/packages/eve/src/execution/sandbox/active-handles.tsindex d6d06cb8d..b14b7f09d 100644--- a/packages/eve/src/execution/sandbox/active-handles.ts+++ b/packages/eve/src/execution/sandbox/active-handles.ts@@ -5,7 +5,7 @@ import { toErrorMessage } from "#shared/errors.js";* Structural so handles of any session-options generic register without* variance friction.*/-export interface ShutdownCapableSandboxHandle {+interface ShutdownCapableSandboxHandle {onRuntimeShutdown(): Promise<void>;}@@ -61,12 +61,3 @@ export async function shutdownActiveSandboxHandles(input?: {}}}--/** Returns the number of tracked handles. Exposed for tests and logging. */-export function countActiveSandboxHandles(): number {- return activeSandboxHandles.size;-}--export function clearActiveSandboxHandlesForTest(): void {- activeSandboxHandles.clear();-}diff --git a/packages/eve/src/execution/sandbox/bash.ts b/packages/eve/src/execution/sandbox/bash.tsindex d0c5a0438..6b7b98222 100644--- a/packages/eve/src/execution/sandbox/bash.ts+++ b/packages/eve/src/execution/sandbox/bash.ts@@ -22,7 +22,7 @@ export interface BashInput {/*** Structured result returned from {@link executeBashOnSandbox}.*/-export interface BashResult {+interface BashResult {readonly exitCode: number;readonly stderr: string;readonly stdout: string;diff --git a/packages/eve/src/execution/sandbox/bindings/docker.scenario.test.ts b/packages/eve/src/execution/sandbox/bindings/docker.scenario.test.tsindex e852c0d34..e814c52e8 100644--- a/packages/eve/src/execution/sandbox/bindings/docker.scenario.test.ts+++ b/packages/eve/src/execution/sandbox/bindings/docker.scenario.test.ts@@ -1,45 +1,18 @@-import { randomUUID } from "node:crypto";-import { mkdir, writeFile } from "node:fs/promises";-import { join } from "node:path";+import { describe, expect, it, vi } from "vitest";-import { afterAll, describe, expect, it, vi } from "vitest";--import { createDockerCli, DockerUnavailableError } from "#execution/sandbox/bindings/docker-cli.js";+import { DockerUnavailableError } from "#execution/sandbox/bindings/docker-cli.js";import { createDockerSandboxProvider } from "#execution/sandbox/bindings/docker.js";-import {- createDockerSandboxOptionsHash,- DEFAULT_DOCKER_SANDBOX_IMAGE,- resolveDockerSandboxOptions,-} from "#execution/sandbox/bindings/docker-options.js";-import { dockerTemplateImageReference } from "#execution/sandbox/bindings/docker-templates.js";-import {- dockerfileImageReference,- resolveSandboxDockerfile,-} from "#execution/sandbox/dockerfile.js";import { createSandboxProviderHarness } from "#internal/testing/sandbox-provider-harness.js";import { useTemporaryDirectories } from "#internal/testing/use-temporary-app-roots.js";-// Real-daemon scenarios are opt-in: they pull images and create-// containers, so CI and dev machines without Docker stay green.-// Run with: EVE_RUN_DOCKER_SANDBOX_SCENARIOS=1-const runDockerScenarios = process.env.EVE_RUN_DOCKER_SANDBOX_SCENARIOS === "1";--// Default to the same image users get while allowing opt-in scenario-// runs to pin a local or mirrored image.-const TEST_IMAGE = process.env.EVE_DOCKER_SANDBOX_TEST_IMAGE ?? DEFAULT_DOCKER_SANDBOX_IMAGE;-const createScratchDirectory = useTemporaryDirectories();-function createEngine(options?: Parameters<typeof createDockerSandboxProvider>[0]) {- return createSandboxProviderHarness(createDockerSandboxProvider(options), undefined);-}-describe("docker CLI resolution", () => {it("fails with an actionable error when the docker executable is missing", async () => {vi.stubEnv("EVE_DOCKER_PATH", "/nonexistent/docker-binary");try {const appRoot = await createScratchDirectory("eve-docker-missing-");- const engine = createEngine();+ const engine = createSandboxProviderHarness(createDockerSandboxProvider(), undefined);await expect(engine.prepare({ appRoot, seedFiles: [] })).rejects.toThrow(DockerUnavailableError,@@ -49,311 +22,3 @@ describe("docker CLI resolution", () => {}});});--describe.runIf(runDockerScenarios)("docker sandbox engine against a real daemon", () => {- const runId = randomUUID().slice(0, 8);- const templateKey = `eve-sbx-tpl-test-${runId}`;- const templateImageReference = dockerTemplateImageReference({- optionsHash: createDockerSandboxOptionsHash(resolveDockerSandboxOptions({ image: TEST_IMAGE })),- templateKey,- });- const sessionKeys: string[] = [];- const extraImages: string[] = [];- const cleanupCli = createDockerCli();-- function nextSessionKey(label: string): string {- const key = `eve-sbx-ses-test-${runId}-${label}`;- sessionKeys.push(key);- return key;- }-- function createEngine() {- return createSandboxProviderHarness(- createDockerSandboxProvider({ image: TEST_IMAGE }),- undefined,- );- }-- afterAll(async () => {- for (const sessionKey of sessionKeys) {- await cleanupCli.run(["rm", "-f", sessionKey]);- }- await cleanupCli.run(["rmi", "-f", templateImageReference, ...extraImages]);- }, 60_000);-- it(- "builds a colocated Dockerfile before prewarming the template",- async () => {- const appRoot = await createScratchDirectory("eve-dockerfile-scenario-");- const agentRoot = join(appRoot, "agent");- const sandboxRoot = join(agentRoot, "sandbox");- await mkdir(sandboxRoot, { recursive: true });- await writeFile(- join(sandboxRoot, "Dockerfile"),- `FROM ${TEST_IMAGE}\nUSER root\nRUN printf dockerfile-ready > /dockerfile-marker\nUSER vercel-sandbox\n`,- );- const resourcesPath = join(appRoot, "compiled-resources");- await mkdir(join(resourcesPath, "workspace"), { recursive: true });- await writeFile(join(resourcesPath, "workspace", "seed.txt"), "immutable seed");- const dockerfile = await resolveSandboxDockerfile(agentRoot);- expect(dockerfile).toBeDefined();- const dockerfileTemplateKey = `${templateKey}-dockerfile`;- const dockerfileTemplateImage = dockerTemplateImageReference({- optionsHash: createDockerSandboxOptionsHash(- resolveDockerSandboxOptions({ image: TEST_IMAGE }),- ),- templateKey: dockerfileTemplateKey,- });- extraImages.push(- dockerfileTemplateImage,- dockerfileImageReference({ dockerfile: dockerfile!, templateKey: dockerfileTemplateKey }),- );-- const engine = createEngine();- await engine.prepare({- resourcesPath,- appRoot,- seedFiles: [],- });- const handle = await engine.openSession({- appRoot,- sandboxName: nextSessionKey("dockerfile"),- });-- const result = await handle.sandbox.run({- command: [- "cat /dockerfile-marker",- "cat /workspace/seed.txt",- "! sh -c 'printf bad > /eve/resources/workspace/seed.txt' 2>/dev/null",- "printf changed > /workspace/seed.txt",- ].join(" && "),- });- expect(result).toMatchObject({- exitCode: 0,- stdout: "dockerfile-readyimmutable seed",- });- },- 5 * 60_000,- );-- it(- "prewarms a template with seed files and opens a session from it",- async () => {- const appRoot = await createScratchDirectory("eve-docker-scenario-");- const engine = createEngine();-- const first = await engine.prepare({- appRoot,- seedFiles: [{ content: "# Weather skill\n", path: "/workspace/skills/weather.md" }],- });- const second = await engine.prepare({- appRoot,- seedFiles: [{ content: "# Weather skill\n", path: "/workspace/skills/weather.md" }],- });- expect(second).toEqual(first);-- const handle = await engine.openSession({- appRoot,- sandboxName: nextSessionKey("seeded"),- });-- const result = await handle.sandbox.run({- command: "cat /workspace/skills/weather.md",- });- expect(result.exitCode).toBe(0);- expect(result.stdout).toBe("# Weather skill\n");- },- 5 * 60_000,- );-- it(- "runs commands with env vars and streams spawned output",- async () => {- const appRoot = await createScratchDirectory("eve-docker-scenario-");- const engine = createEngine();- const handle = await engine.openSession({- appRoot,- sandboxName: nextSessionKey("env"),- });-- const result = await handle.sandbox.run({- command: 'echo "$DEPLOY_ENV"',- env: { DEPLOY_ENV: "staging" },- });- expect(result.exitCode).toBe(0);- expect(result.stdout.trim()).toBe("staging");-- const spawned = await handle.sandbox.spawn({ command: "printf out; printf err >&2" });- const [stdout, stderr, waited] = await Promise.all([- collectStream(spawned.stdout),- collectStream(spawned.stderr),- spawned.wait(),- ]);- expect(waited.exitCode).toBe(0);- expect(stdout).toBe("out");- expect(stderr).toBe("err");- },- 5 * 60_000,- );-- it(- "kill() terminates the spawned process tree inside the container",- async () => {- const appRoot = await createScratchDirectory("eve-docker-scenario-");- const engine = createEngine();- const handle = await engine.openSession({- appRoot,- sandboxName: nextSessionKey("kill-tree"),- });-- // Counts container processes whose cmdline matches the sentinel- // sleeps. The patterns are assembled at runtime so the counting- // command's own cmdline never matches itself.- const countSurvivors = [- 'pat_a="sleep 3"; pat_a="${pat_a}27"',- 'pat_b="sleep 3"; pat_b="${pat_b}13"',- "count=0",- "for f in /proc/[0-9]*/cmdline; do",- ' c="$(tr "\\0" " " < "$f" 2>/dev/null)"',- ' case "$c" in *"$pat_a"*|*"$pat_b"*) count=$((count+1)) ;; esac',- "done",- 'echo "$count"',- ].join("\n");-- // A foreground child plus a backgrounded one exercises the- // recursive tree kill beyond the immediate wrapper pid.- const spawned = await handle.sandbox.spawn({ command: "sleep 327 & sleep 313" });-- let running = 0;- for (let attempt = 0; attempt < 50; attempt += 1) {- const counted = await handle.sandbox.run({ command: countSurvivors });- running = Number(counted.stdout.trim());- if (running >= 2) {- break;- }- await new Promise((resolve) => setTimeout(resolve, 100));- }- expect(running).toBeGreaterThanOrEqual(2);-- await spawned.kill();- await Promise.resolve(spawned.wait()).catch(() => {});-- const survivors = await handle.sandbox.run({ command: countSurvivors });- expect(survivors.exitCode).toBe(0);- expect(survivors.stdout.trim()).toBe("0");- },- 5 * 60_000,- );-- it(- "round-trips files, preserves binary bytes, and removes paths",- async () => {- const appRoot = await createScratchDirectory("eve-docker-scenario-");- const engine = createEngine();- const handle = await engine.openSession({- appRoot,- sandboxName: nextSessionKey("files"),- });-- await handle.sandbox.writeTextFile({ content: "hello", path: "deep/nested/note.txt" });- await expect(- handle.sandbox.readTextFile({ path: "/workspace/deep/nested/note.txt" }),- ).resolves.toBe("hello");-- const bytes = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0xff, 0x00]);- await handle.sandbox.writeBinaryFile({ content: bytes, path: "assets/fixture.bin" });- const sized = await handle.sandbox.run({ command: "wc -c < assets/fixture.bin" });- expect(Number(sized.stdout.trim())).toBe(bytes.length);- const readBack = await handle.sandbox.readBinaryFile({ path: "assets/fixture.bin" });- expect(readBack === null ? null : Buffer.from(readBack).equals(bytes)).toBe(true);-- await expect(handle.sandbox.readTextFile({ path: "missing.txt" })).resolves.toBeNull();-- await handle.sandbox.removePath({ force: true, path: "deep", recursive: true });- await expect(- handle.sandbox.readTextFile({ path: "deep/nested/note.txt" }),- ).resolves.toBeNull();- },- 5 * 60_000,- );-- it(- "flips a deny-all-created session to allow-all and back",- async () => {- const appRoot = await createScratchDirectory("eve-docker-scenario-");- const engine = createSandboxProviderHarness(- createDockerSandboxProvider({ image: TEST_IMAGE }),- { networkPolicy: "deny-all" },- );- // Create from the suite's prewarmed template: bash is already- // baked in there, which a `--network none` container could not- // install on the fly.- const handle = await engine.openSession({- appRoot,- sandboxName: nextSessionKey("network-flip"),- });-- // `--network none` containers have no interfaces beyond loopback.- const denied = await handle.sandbox.run({ command: "ip route 2>/dev/null | wc -l" });- expect(denied.stdout.trim()).toBe("0");-- await handle.sandbox.setNetworkPolicy("allow-all");- const allowed = await handle.sandbox.run({ command: "ip route 2>/dev/null | wc -l" });- expect(Number(allowed.stdout.trim())).toBeGreaterThan(0);-- await handle.sandbox.setNetworkPolicy("deny-all");- const deniedAgain = await handle.sandbox.run({ command: "ip route 2>/dev/null | wc -l" });- expect(deniedAgain.stdout.trim()).toBe("0");- },- 5 * 60_000,- );-- it(- "persists session state across shutdown and reattach",- async () => {- const appRoot = await createScratchDirectory("eve-docker-scenario-");- const engine = createEngine();- const sessionKey = nextSessionKey("reconnect");-- const { handle: firstHandle, state } = await engine.start({- appRoot,- sandboxName: sessionKey,- });- await firstHandle.sandbox.writeTextFile({- content: "survives reconnect",- path: "persisted.txt",- });- expect(state).toMatchObject({ version: 2 });- // Server shutdown stops the container; reattach must restart it- // transparently.- await firstHandle.onRuntimeShutdown();-- const reconnected = await engine.openSession({- existing: state,- appRoot,- sandboxName: sessionKey,- });- await expect(reconnected.sandbox.readTextFile({ path: "persisted.txt" })).resolves.toBe(- "survives reconnect",- );- },- 5 * 60_000,- );-});--async function collectStream(stream: ReadableStream<Uint8Array>): Promise<string> {- const reader = stream.getReader();- const decoder = new TextDecoder();- let out = "";- for (;;) {- const { done, value } = await reader.read();- if (done) {- break;- }- if (value !== undefined) {- out += decoder.decode(value, { stream: true });- }- }- out += decoder.decode();- return out;-}diff --git a/packages/eve/src/execution/sandbox/bindings/immutable-resources.ts b/packages/eve/src/execution/sandbox/bindings/immutable-resources.tsindex 89076ad4c..6c09830cb 100644--- a/packages/eve/src/execution/sandbox/bindings/immutable-resources.ts+++ b/packages/eve/src/execution/sandbox/bindings/immutable-resources.ts@@ -10,9 +10,9 @@ import {} from "#shared/sandbox-provider.js";import type { SandboxSession } from "#shared/sandbox-session.js";-export const SANDBOX_RESOURCES_ROOT = "/eve/resources";+const SANDBOX_RESOURCES_ROOT = "/eve/resources";-export function resolveImmutableResourcesPath(input: {+function resolveImmutableResourcesPath(input: {readonly storagePath: string;readonly provider: string;readonly resourcesKey: string;diff --git a/packages/eve/src/execution/sandbox/bindings/local-provider-utils.ts b/packages/eve/src/execution/sandbox/bindings/local-provider-utils.tsindex 3fb3b99d4..6e3f7ee98 100644--- a/packages/eve/src/execution/sandbox/bindings/local-provider-utils.ts+++ b/packages/eve/src/execution/sandbox/bindings/local-provider-utils.ts@@ -5,7 +5,7 @@ import { dirname, join } from "node:path";import { bufferToStream, streamToBuffer } from "#execution/sandbox/stream-utils.js";import { WORKSPACE_ROOT } from "#runtime/workspace/types.js";import { resolveSandboxModelPath } from "#shared/skill-paths.js";-export interface SandboxSeedFile {+interface SandboxSeedFile {readonly content: string | Uint8Array;readonly path: string;}@@ -17,7 +17,7 @@ import type {SandboxSpawnOptions,} from "#shared/sandbox-session.js";-export interface FileBackedSandbox {+interface FileBackedSandbox {readFileBytes(path: string): Promise<Buffer | null>;removePath(options: SandboxRemovePathOptions): Promise<void>;spawn(options: SandboxSpawnOptions): Promise<SandboxProcess>;diff --git a/packages/eve/src/execution/sandbox/bindings/microsandbox-lifecycle.ts b/packages/eve/src/execution/sandbox/bindings/microsandbox-lifecycle.tsindex f0b60694d..3cf330b62 100644--- a/packages/eve/src/execution/sandbox/bindings/microsandbox-lifecycle.ts+++ b/packages/eve/src/execution/sandbox/bindings/microsandbox-lifecycle.ts@@ -421,7 +421,3 @@ function cacheHandle(activeMicrosandboxSessionHandles.set(key, handle);return handle;}--export function clearActiveMicrosandboxSessionHandlesForTest(): void {- activeMicrosandboxSessionHandles.clear();-}diff --git a/packages/eve/src/execution/sandbox/bindings/microsandbox-network.ts b/packages/eve/src/execution/sandbox/bindings/microsandbox-network.tsindex a740c3099..5324d6d9c 100644--- a/packages/eve/src/execution/sandbox/bindings/microsandbox-network.ts+++ b/packages/eve/src/execution/sandbox/bindings/microsandbox-network.ts@@ -63,7 +63,7 @@ interface MicrosandboxNativePortRange {readonly start: number;}-export interface MicrosandboxNetworkPlan {+interface MicrosandboxNetworkPlan {readonly disabled: boolean;readonly policy: MicrosandboxNetworkPolicy | null;readonly transformHeaderRules: readonly MicrosandboxTransformHeaderRule[];diff --git a/packages/eve/src/execution/sandbox/bindings/microsandbox-options.ts b/packages/eve/src/execution/sandbox/bindings/microsandbox-options.tsindex 0d1c3923d..352e990a4 100644--- a/packages/eve/src/execution/sandbox/bindings/microsandbox-options.ts+++ b/packages/eve/src/execution/sandbox/bindings/microsandbox-options.ts@@ -2,9 +2,9 @@ import { DEFAULT_EVE_SANDBOX_IMAGE } from "#execution/sandbox/bindings/eve-imageimport type { MicrosandboxSandboxCreateOptions } from "#public/sandbox/microsandbox-sandbox.js";export const MICROSANDBOX_DEFAULT_IMAGE = DEFAULT_EVE_SANDBOX_IMAGE;-export const MICROSANDBOX_DEFAULT_CPUS = 1;-export const MICROSANDBOX_DEFAULT_MEMORY_MIB = 1024;-export const MICROSANDBOX_DEFAULT_PULL_POLICY = "if-missing";+const MICROSANDBOX_DEFAULT_CPUS = 1;+const MICROSANDBOX_DEFAULT_MEMORY_MIB = 1024;+const MICROSANDBOX_DEFAULT_PULL_POLICY = "if-missing";/** User every sandbox command runs as, mirroring hosted Vercel Sandbox. */export const MICROSANDBOX_USER = "vercel-sandbox";diff --git a/packages/eve/src/execution/sandbox/bindings/microsandbox-templates.ts b/packages/eve/src/execution/sandbox/bindings/microsandbox-templates.tsindex 252f31570..22f54883f 100644--- a/packages/eve/src/execution/sandbox/bindings/microsandbox-templates.ts+++ b/packages/eve/src/execution/sandbox/bindings/microsandbox-templates.ts@@ -72,7 +72,7 @@ export function resolveMicrosandboxTemplateRootPath();}-export function resolveMicrosandboxTemplatesDirectory(cacheDirectory: string): string {+function resolveMicrosandboxTemplatesDirectory(cacheDirectory: string): string {return resolveLocalProviderTemplatesDirectory(cacheDirectory, MICROSANDBOX_CACHE_DIRECTORY_NAME);}diff --git a/packages/eve/src/execution/sandbox/bindings/microsandbox.scenario.test.ts b/packages/eve/src/execution/sandbox/bindings/microsandbox.scenario.test.tsindex d4820af56..4466a1117 100644--- a/packages/eve/src/execution/sandbox/bindings/microsandbox.scenario.test.ts+++ b/packages/eve/src/execution/sandbox/bindings/microsandbox.scenario.test.ts@@ -5,286 +5,22 @@ import { join } from "node:path";import { describe, expect, it } from "vitest";import { useTemporaryDirectories } from "#internal/testing/use-temporary-app-roots.js";-import {- createMicrosandboxSandboxProvider,- pruneMicrosandboxTemplates,-} from "#execution/sandbox/bindings/microsandbox.js";-import { isMicrosandboxPlatformSupported } from "#execution/sandbox/bindings/microsandbox-platform.js";-import { createSandboxProviderHarness } from "#internal/testing/sandbox-provider-harness.js";+import { pruneMicrosandboxTemplates } from "#execution/sandbox/bindings/microsandbox.js";// Microsandbox is unsupported on Windows (native bindings ship for-// macOS Apple Silicon and glibc Linux only), so every suite in this-// file stays off win32. The real-VM suites are additionally opt-in:-// they install the microsandbox runtime, pull OCI images, and boot-// VMs. Run with: EVE_RUN_MICROSANDBOX_SCENARIOS=1+// macOS Apple Silicon and glibc Linux only). Template pruning operates on+// the on-disk metadata cache and only touches the microsandbox runtime+// when it is already installed, so it needs no VM.const onWindows = process.platform === "win32";-const runMicrosandboxVmScenarios =- !onWindows &&- process.env.EVE_RUN_MICROSANDBOX_SCENARIOS === "1" &&- isMicrosandboxPlatformSupported();const createScratchDirectory = useTemporaryDirectories();-function createProvider() {- return createSandboxProviderHarness(createMicrosandboxSandboxProvider(), undefined);-}--async function createTemporaryCacheDirectory(label: string): Promise<string> {- // The provider derives its cache directory from- // `appRoot` via `resolveSandboxCacheDirectory`, so the- // helper returns a temporary appRoot rather than a cache directory- // directly.- return await createScratchDirectory(`eve-microsandbox-${label}-`);-}--async function createPrewarmedHandle(input: {- readonly appRoot: string;- readonly sandboxName: string;-}) {- const provider = createProvider();- await provider.prepare({- appRoot: input.appRoot,- seedFiles: [],- });- return await provider.openSession({- appRoot: input.appRoot,- sandboxName: input.sandboxName,- });-}--async function collectStream(stream: ReadableStream<Uint8Array>): Promise<string> {- const reader = stream.getReader();- const decoder = new TextDecoder();- let out = "";- for (;;) {- const { done, value } = await reader.read();- if (done) {- break;- }- if (value !== undefined) {- out += decoder.decode(value, { stream: true });- }- }- out += decoder.decode();- return out;-}--describe.runIf(runMicrosandboxVmScenarios)("microsandbox sandbox file API", () => {- it("prewarms from a colocated Dockerfile", async () => {- const appRoot = await createTemporaryCacheDirectory("dockerfile");- const agentRoot = join(appRoot, "agent");- const sandboxRoot = join(agentRoot, "sandbox");- await mkdir(sandboxRoot, { recursive: true });- await writeFile(- join(sandboxRoot, "Dockerfile"),- [- "FROM ubuntu:24.04",- "RUN apt-get update && apt-get install -y bash sudo",- "RUN printf dockerfile-ready > /dockerfile-marker",- "",- ].join("\n"),- );- const resourcesPath = join(appRoot, "compiled-resources");- await mkdir(join(resourcesPath, "workspace"), { recursive: true });- await writeFile(join(resourcesPath, "workspace", "seed.txt"), "immutable seed");- const provider = createProvider();- await provider.prepare({- resourcesPath,- appRoot,- seedFiles: [],- });- const handle = await provider.openSession({- appRoot,- sandboxName: "session-dockerfile",- });-- const result = await handle.sandbox.run({- command: [- "cat /dockerfile-marker",- "cat /workspace/seed.txt",- "! sh -c 'printf bad > /eve/resources/workspace/seed.txt' 2>/dev/null",- "printf changed > /workspace/seed.txt",- ].join(" && "),- });- expect(result).toMatchObject({ exitCode: 0, stdout: "dockerfile-readyimmutable seed" });- });-- it("writes a file via the public session and reads it back", async () => {- const appRoot = await createTemporaryCacheDirectory("file-api");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-write-read",- });-- await handle.sandbox.writeTextFile({ content: "hello world", path: "note.txt" });- const content = await handle.sandbox.readTextFile({ path: "note.txt" });-- expect(content).toBe("hello world");- });-- it("passes env vars to a command run via the public session", async () => {- const appRoot = await createTemporaryCacheDirectory("run-env");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-run-env",- });-- const result = await handle.sandbox.run({- command: 'echo "$DEPLOY_ENV"',- env: { DEPLOY_ENV: "staging" },- });-- expect(result.exitCode).toBe(0);- expect(result.stdout.trim()).toBe("staging");- });-- it("passes env vars to a process spawned via the public session", async () => {- const appRoot = await createTemporaryCacheDirectory("spawn-env");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-spawn-env",- });-- const spawned = await handle.sandbox.spawn({- command: 'echo "$DEPLOY_ENV"',- env: { DEPLOY_ENV: "production" },- });- const stdout = await collectStream(spawned.stdout);- const { exitCode } = await spawned.wait();-- expect(exitCode).toBe(0);- expect(stdout.trim()).toBe("production");- });-- it("applies setNetworkPolicy by restarting the microsandbox VM", async () => {- const appRoot = await createTemporaryCacheDirectory("network-policy");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-network-policy",- });-- await expect(handle.sandbox.setNetworkPolicy("deny-all")).resolves.toBeUndefined();- });-- it("readFile returns null for a missing file", async () => {- const appRoot = await createTemporaryCacheDirectory("file-api");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-missing",- });-- const content = await handle.sandbox.readTextFile({ path: "does-not-exist.txt" });-- expect(content).toBeNull();- });-- it("removePath deletes a recursive directory tree", async () => {- const appRoot = await createTemporaryCacheDirectory("file-api");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-remove",- });-- await handle.sandbox.writeTextFile({- content: "dynamic skill",- path: "skills/tenant/SKILL.md",- });- await handle.sandbox.writeTextFile({- content: "policy",- path: "skills/tenant/references/policy.md",- });- await handle.sandbox.removePath({ force: true, path: "skills/tenant", recursive: true });-- await expect(- handle.sandbox.readTextFile({ path: "skills/tenant/SKILL.md" }),- ).resolves.toBeNull();- await expect(- handle.sandbox.readTextFile({ path: "skills/tenant/references/policy.md" }),- ).resolves.toBeNull();- });-- it("preserves files across capture and reconnect", async () => {- const appRoot = await createTemporaryCacheDirectory("file-api");- const provider = createProvider();-- await provider.prepare({- appRoot,- seedFiles: [],- });-- const { handle: firstHandle, state } = await provider.start({- appRoot,- sandboxName: "session-reconnect",- });- await firstHandle.sandbox.writeTextFile({- content: "survives reconnect",- path: "persisted.txt",- });-- expect(state).toMatchObject({- optionsHash: expect.any(String),- sandboxName: expect.any(String),- version: 2,- });-- const reconnectedHandle = await provider.openSession({- existing: state,- appRoot,- sandboxName: "session-reconnect",- });- const content = await reconnectedHandle.sandbox.readTextFile({ path: "persisted.txt" });-- expect(content).toBe("survives reconnect");- });-- it("preserves Buffer bytes written through the public session", async () => {- const appRoot = await createTemporaryCacheDirectory("file-api");- const handle = await createPrewarmedHandle({- appRoot,- sandboxName: "session-buffer",- });-- // A PNG header plus a handful of non-UTF-8 bytes. Reading this- // back as UTF-8 text would throw, so the roundtrip check uses the- // `wc -c` command to confirm the on-disk byte length matches.- const bytes = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0xff, 0x00]);- await handle.sandbox.writeBinaryFile({ content: bytes, path: "assets/fixture.bin" });-- const result = await handle.sandbox.run({ command: "wc -c < assets/fixture.bin" });- expect(result.exitCode).toBe(0);- expect(Number(result.stdout.trim())).toBe(bytes.length);- });-- it("reports a fresh build on first prewarm and a reuse on the second", async () => {- const appRoot = await createTemporaryCacheDirectory("reuse-report");- const provider = createProvider();-- const first = await provider.prepare({- appRoot,- seedFiles: [{ content: "# Weather skill\n", path: "/workspace/skills/weather.md" }],- });- const second = await provider.prepare({- appRoot,- seedFiles: [{ content: "# Weather skill\n", path: "/workspace/skills/weather.md" }],- });-- expect(second).toEqual(first);- const handle = await provider.openSession({- appRoot,- sandboxName: "session-reuse-report",- });- await expect(- handle.sandbox.readTextFile({ path: "/workspace/skills/weather.md" }),- ).resolves.toBe("# Weather skill\n");- });-});--// Template pruning operates on the on-disk metadata cache and only-// touches the microsandbox runtime when it is already installed, so it-// runs without the VM gate (still not on Windows).describe.skipIf(onWindows)("pruneMicrosandboxTemplates", () => {it("prunes stale cached templates while preserving retained and recent templates", async () => {- const appRoot = await createTemporaryCacheDirectory("template-prune");+ // The provider derives its cache directory from `appRoot` via+ // `resolveSandboxCacheDirectory`, so the test builds the cache under a+ // temporary appRoot.+ const appRoot = await createScratchDirectory("eve-microsandbox-template-prune-");const templatesRoot = join(appRoot, ".eve", "sandbox-cache", "microsandbox", "templates");const recentTemplateRoot = join(templatesRoot, "recent");const retainedTemplateRoot = join(templatesRoot, "retained");diff --git a/packages/eve/src/execution/sandbox/bindings/vercel.ts b/packages/eve/src/execution/sandbox/bindings/vercel.tsindex ce0f5d4f0..52d89afa6 100644--- a/packages/eve/src/execution/sandbox/bindings/vercel.ts+++ b/packages/eve/src/execution/sandbox/bindings/vercel.ts@@ -91,7 +91,7 @@ export function createVercelSandboxProvider(return createVercelSandbox({ createOptions: authoredCreateOptions, prepare });}-export interface CreateVercelSandboxInput {+interface CreateVercelSandboxInput {readonly createSandbox?: CreateVercelSandbox;readonly createOptions?: VercelCreateOptions;readonly loadDeleteSandboxModule?: () => Promise<VercelModule>;diff --git a/packages/eve/src/execution/sandbox/dockerfile.integration.test.ts b/packages/eve/src/execution/sandbox/dockerfile.integration.test.tsdeleted file mode 100644index 4e2a9e118..000000000--- a/packages/eve/src/execution/sandbox/dockerfile.integration.test.ts+++ /dev/null@@ -1,34 +0,0 @@-import { join } from "node:path";--import { describe, expect, it } from "vitest";--import { resolveSandboxDockerfile } from "#execution/sandbox/dockerfile.js";-import { useTemporaryDirectories } from "#internal/testing/use-temporary-app-roots.js";-import { mkdir, writeFile } from "node:fs/promises";--const createScratchDirectory = useTemporaryDirectories();--describe("resolveSandboxDockerfile", () => {- it("discovers and hashes the colocated Docker build context", async () => {- const agentRoot = await createScratchDirectory("eve-dockerfile-");- const sandboxRoot = join(agentRoot, "sandbox");- await mkdir(sandboxRoot, { recursive: true });- await writeFile(join(sandboxRoot, "Dockerfile"), "FROM alpine\nCOPY setup.sh /setup.sh\n");- await writeFile(join(sandboxRoot, "setup.sh"), "#!/bin/sh\n");-- const first = await resolveSandboxDockerfile(agentRoot);- await writeFile(join(sandboxRoot, "setup.sh"), "#!/bin/sh\necho changed\n");- const second = await resolveSandboxDockerfile(agentRoot);-- expect(first).toMatchObject({- contextPath: sandboxRoot,- path: join(sandboxRoot, "Dockerfile"),- });- expect(second?.contentHash).not.toBe(first?.contentHash);- });-- it("returns undefined when the sandbox has no Dockerfile", async () => {- const agentRoot = await createScratchDirectory("eve-no-dockerfile-");- await expect(resolveSandboxDockerfile(agentRoot)).resolves.toBeUndefined();- });-});diff --git a/packages/eve/src/execution/sandbox/dockerfile.ts b/packages/eve/src/execution/sandbox/dockerfile.tsindex eb887d0da..2b6273f90 100644--- a/packages/eve/src/execution/sandbox/dockerfile.ts+++ b/packages/eve/src/execution/sandbox/dockerfile.ts@@ -1,6 +1,6 @@import { createHash, randomUUID } from "node:crypto";-import { access, mkdir, readdir, readFile, rename, rm, writeFile } from "node:fs/promises";-import { dirname, join, relative } from "node:path";+import { access, mkdir, rename, rm, writeFile } from "node:fs/promises";+import { dirname, join } from "node:path";import type { DockerCli } from "#execution/sandbox/bindings/docker-cli.js";import type { SandboxProviderFiles } from "#shared/sandbox-provider.js";@@ -65,24 +65,6 @@ export async function materializeSandboxDockerfile(input: {return { contentHash, contextPath, path: join(contextPath, "Dockerfile") };}-export async function resolveSandboxDockerfile(- agentRoot: string,-): Promise<SandboxDockerfile | undefined> {- const path = join(agentRoot, "sandbox", "Dockerfile");- try {- await readFile(path);- } catch (error) {- if (isFileNotFoundError(error)) return undefined;- throw error;- }- const contextPath = dirname(path);- return {- contextPath,- contentHash: await hashDirectory(contextPath),- path,- };-}-export function dockerfileImageReference(input: {readonly dockerfile: SandboxDockerfile;readonly templateKey: string;@@ -160,25 +142,3 @@ export async function publishDockerImageForMicrosandbox(input: {function isFileNotFoundError(error: unknown): boolean {return error instanceof Error && "code" in error && error.code === "ENOENT";}--async function hashDirectory(root: string): Promise<string> {- const hash = createHash("sha256");- const paths = await collectFilePaths(root);- for (const path of paths) {- hash.update(relative(root, path));- hash.update("\0");- hash.update(await readFile(path));- hash.update("\0");- }- return hash.digest("hex");-}--async function collectFilePaths(root: string): Promise<string[]> {- const paths: string[] = [];- for (const entry of await readdir(root, { withFileTypes: true })) {- const path = join(root, entry.name);- if (entry.isDirectory()) paths.push(...(await collectFilePaths(path)));- else if (entry.isFile()) paths.push(path);- }- return paths.sort();-}diff --git a/packages/eve/src/execution/sandbox/ensure.test.ts b/packages/eve/src/execution/sandbox/ensure.test.tsindex 21f4abdb8..79189a50b 100644--- a/packages/eve/src/execution/sandbox/ensure.test.ts+++ b/packages/eve/src/execution/sandbox/ensure.test.ts@@ -1,8 +1,5 @@import { afterEach, describe, expect, it, vi } from "vitest";-import {- clearActiveSandboxHandlesForTest,- countActiveSandboxHandles,-} from "#execution/sandbox/active-handles.js";+import { shutdownActiveSandboxHandles } from "#execution/sandbox/active-handles.js";import { ContextContainer, contextStorage } from "#context/container.js";import { SessionKey } from "#context/keys.js";import { ensureSandboxAccess } from "#execution/sandbox/ensure.js";@@ -20,12 +17,13 @@ vi.mock("#runtime/sandbox/prepared-artifacts.js", () => ({function fixture(setup?: () => void, returnCopy = false) {const deleteSandbox = vi.fn(async () => {});const stopSandbox = vi.fn(async () => {});+ const shutdownSandbox = vi.fn(async () => {});const create = vi.fn(async () => {const sandbox = mockSandbox();return {sandbox: sandbox.session,onSessionDelete: deleteSandbox,- onRuntimeShutdown: async () => {},+ onRuntimeShutdown: shutdownSandbox,onSessionStop: stopSandbox,};});@@ -57,7 +55,7 @@ function fixture(setup?: () => void, returnCopy = false) {workspaceResourceRoot: { logicalPath: "", rootEntries: [] },},};- return { create, deleteSandbox, registry, stopSandbox };+ return { create, deleteSandbox, registry, shutdownSandbox, stopSandbox };}async function open(registry: RuntimeSandboxRegistry,@@ -91,7 +89,7 @@ async function open(return { access, sandbox: await access.get() };});}-afterEach(() => clearActiveSandboxHandlesForTest());+afterEach(() => shutdownActiveSandboxHandles());describe("ensureSandboxAccess", () => {it("does not prepare or start anything until the sandbox is requested", async () => {@@ -203,7 +201,8 @@ describe("ensureSandboxAccess", () => {state: null,});await expect(access.get()).rejects.toThrow("setup failed");- expect(countActiveSandboxHandles()).toBe(0);+ await shutdownActiveSandboxHandles();+ expect(value.shutdownSandbox).not.toHaveBeenCalled();await expect(access.get()).resolves.toBeTruthy();});expect(attempts).toBe(2);@@ -212,7 +211,8 @@ describe("ensureSandboxAccess", () => {it("tracks dedicated handles for server shutdown", async () => {const value = fixture();await open(value.registry);- expect(countActiveSandboxHandles()).toBe(1);+ await shutdownActiveSandboxHandles();+ expect(value.shutdownSandbox).toHaveBeenCalledOnce();});it("deletes a dedicated sandbox and creates a fresh handle on next access", async () => {diff --git a/packages/eve/src/execution/sandbox/ensure.ts b/packages/eve/src/execution/sandbox/ensure.tsindex 4ae87de90..dda63dd5d 100644--- a/packages/eve/src/execution/sandbox/ensure.ts+++ b/packages/eve/src/execution/sandbox/ensure.ts@@ -29,7 +29,7 @@ import {import type { RuntimeSandboxSession } from "#shared/sandbox-session.js";import { SandboxTemplateNotProvisionedError } from "#shared/sandbox-template-error.js";-export interface EnsureSandboxAccessInput {+interface EnsureSandboxAccessInput {readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource;readonly nodeId: string;readonly ownsSandbox?: boolean;diff --git a/packages/eve/src/execution/sandbox/prewarm.ts b/packages/eve/src/execution/sandbox/prewarm.tsindex e6a377847..15414463f 100644--- a/packages/eve/src/execution/sandbox/prewarm.ts+++ b/packages/eve/src/execution/sandbox/prewarm.ts@@ -67,7 +67,7 @@ interface NodeSandbox extends RuntimeRegisteredSandbox {* templates the orchestrator emits and what preparation calls flow through* them.*/-export type SandboxProviderPrepareDispatch = (input: {+type SandboxProviderPrepareDispatch = (input: {readonly context: SandboxProviderPrepareContext;readonly provider: SandboxProviderRuntime;}) => Promise<SandboxPreparedArtifact>;@@ -89,7 +89,7 @@ interface PrewarmSandboxesInput {* Iterates every registered sandbox and invokes `provider.prepare(...)`* for each provider template.*/-export async function prewarmSandboxes(input: PrewarmSandboxesInput): Promise<void> {+async function prewarmSandboxes(input: PrewarmSandboxesInput): Promise<void> {const targets = await collectPrewarmTargets(input);if (targets.length === 0) {diff --git a/packages/eve/src/execution/sandbox/require-sandbox.ts b/packages/eve/src/execution/sandbox/require-sandbox.tsindex 10698fa47..7ad895a54 100644--- a/packages/eve/src/execution/sandbox/require-sandbox.ts+++ b/packages/eve/src/execution/sandbox/require-sandbox.ts@@ -1,38 +1,6 @@-import { loadContext } from "#context/container.js";-import { SandboxKey } from "#context/keys.js";import type { SandboxSession } from "#public/definitions/sandbox.js";-import { bindSandboxAbortSignal } from "#execution/sandbox/abort-bound-session.js";import { resolveSandboxModelPath } from "#shared/skill-paths.js";-/**- * Resolves the active sandbox session from the runtime context.- *- * Shared preamble for every sandbox-backed tool executor (`bash`,- * `read_file`, `write_file`, `glob`, `grep`). Centralizes the context- * lookup, null checks, and error messages so each executor does not- * duplicate them.- *- * Binds the returned session to `abortSignal` when provided.- */-export async function requireSandboxSession(abortSignal?: AbortSignal): Promise<SandboxSession> {- const sandboxAccess = loadContext().get(SandboxKey);-- if (sandboxAccess === undefined) {- throw new Error(- "This tool requires sandbox access on the runtime context. " +- "Ensure the step is running inside a managed runtime context with sandbox support.",- );- }-- const sandbox = await sandboxAccess.get();-- if (sandbox === null) {- throw new Error("The sandbox is not available in the current runtime context.");- }-- return abortSignal === undefined ? sandbox : bindSandboxAbortSignal(sandbox, abortSignal);-}-/*** Resolves a model-supplied `$HOME` prefix and validates that the resulting* sandbox file path is absolute.diff --git a/packages/eve/src/execution/sandbox/truncate-output.ts b/packages/eve/src/execution/sandbox/truncate-output.tsindex c6c590808..00da1a634 100644--- a/packages/eve/src/execution/sandbox/truncate-output.ts+++ b/packages/eve/src/execution/sandbox/truncate-output.ts@@ -27,12 +27,12 @@ export const MAX_LINE_LENGTH = 2000;/*** Suffix appended to lines exceeding {@link MAX_LINE_LENGTH}.*/-export const LINE_TRUNCATION_SUFFIX = " [truncated]";+const LINE_TRUNCATION_SUFFIX = " [truncated]";/*** Result of a {@link truncateTail} or {@link truncateHead} call.*/-export interface TruncationResult {+interface TruncationResult {/** The truncated output text. */readonly output: string;/** True when the output was shortened. */diff --git a/packages/eve/src/execution/session-activity-projection.test.ts b/packages/eve/src/execution/session-activity-projection.test.tsindex 01cda2031..c3294cece 100644--- a/packages/eve/src/execution/session-activity-projection.test.ts+++ b/packages/eve/src/execution/session-activity-projection.test.ts@@ -10,6 +10,7 @@ import { deriveRootTurnActivityWorkId } from "#execution/activity-work-id.js";import { createActivitySnapshot, reduceActivityBatch } from "#execution/session-activity.js";import type { ActivitySnapshotV1, ActivityWorkIdentityV1 } from "#protocol/activity.js";import type { MessageStreamEvent } from "#protocol/message.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const at = "2026-01-01T00:00:00.000Z";@@ -297,6 +298,7 @@ describe("observeSessionActivity", () => {});it("submits projected activity and swallows transport failure", async () => {+ const logs = captureLogRecords();const fetchMock = vi.fn().mockRejectedValue(new Error("network down"));vi.stubGlobal("fetch", fetchMock);@@ -308,5 +310,8 @@ describe("observeSessionActivity", () => {}),).resolves.toBeUndefined();expect(fetchMock).toHaveBeenCalledOnce();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "activity sink request failed" }),+ );});});diff --git a/packages/eve/src/execution/session-activity.ts b/packages/eve/src/execution/session-activity.tsindex b9ce258a3..288c8c094 100644--- a/packages/eve/src/execution/session-activity.ts+++ b/packages/eve/src/execution/session-activity.ts@@ -10,9 +10,9 @@ import {type ActivityWorkStateV1,} from "#protocol/activity.js";-export const MAX_ACTIVITY_EVENT_IDS = 1_000;-export const MAX_ACTIVITY_PENDING_SETTLEMENTS = 500;-export const MAX_ACTIVITY_ENTITIES = 500;+const MAX_ACTIVITY_EVENT_IDS = 1_000;+const MAX_ACTIVITY_PENDING_SETTLEMENTS = 500;+const MAX_ACTIVITY_ENTITIES = 500;export function createActivitySnapshot(): ActivitySnapshotV1 {return {diff --git a/packages/eve/src/execution/session-inbox/protocol.ts b/packages/eve/src/execution/session-inbox/protocol.tsindex a8b5c41c1..551807adc 100644--- a/packages/eve/src/execution/session-inbox/protocol.ts+++ b/packages/eve/src/execution/session-inbox/protocol.ts@@ -4,7 +4,7 @@ import type {SessionTimeoutHookPayload,} from "#channel/types.js";-export type DecodedSessionInbox =+type DecodedSessionInbox =| DeliverHookPayload| SessionTimeoutHookPayload| Extract<SessionCommand, { readonly kind: "cancel" | "clear" | "compact" | "reset" }>;diff --git a/packages/eve/src/execution/session-reset.integration.test.ts b/packages/eve/src/execution/session-reset.integration.test.tsindex 524d67992..a4fbec45a 100644--- a/packages/eve/src/execution/session-reset.integration.test.ts+++ b/packages/eve/src/execution/session-reset.integration.test.ts@@ -4,7 +4,7 @@ import { describe, expect, it, vi } from "vitest";import { ContextContainer } from "#context/container.js";import { SessionKey } from "#context/keys.js";import { ensureSandboxAccess } from "#execution/sandbox/ensure.js";-import { clearActiveSandboxHandlesForTest } from "#execution/sandbox/active-handles.js";+import { shutdownActiveSandboxHandles } from "#execution/sandbox/active-handles.js";import { sessionCommandInboxWorkflow } from "#internal/testing/session-inbox-workflow.js";import { waitForHook } from "#internal/testing/workflow-test-helpers.js";import { mockSandbox } from "#internal/testing/mocks/mock-sandbox.js";@@ -64,7 +64,7 @@ describe("session reset integration", () => {} finally {const status = await first.status;if (status === "pending" || status === "running") await first.cancel();- clearActiveSandboxHandlesForTest();+ await shutdownActiveSandboxHandles();}});});diff --git a/packages/eve/src/execution/session.ts b/packages/eve/src/execution/session.tsindex be9c18a96..516488db9 100644--- a/packages/eve/src/execution/session.ts+++ b/packages/eve/src/execution/session.ts@@ -19,7 +19,7 @@ export const DEFAULT_ROOT_MAX_INPUT_TOKENS_PER_SESSION = 40_000_000;* explicitly uncapped the axis (skipping the root default). Resolution maps* this shape onto the numeric {@link SessionLimits} the harness checks.*/-export interface AuthoredSessionLimits {+interface AuthoredSessionLimits {readonly maxInputTokensPerSession?: number | false;readonly maxOutputTokensPerSession?: number | false;readonly maxTokenCostUsdPerSession?: number | false;@@ -59,7 +59,7 @@ export function createCompactionConfig(return config;}-export interface CreateSessionInput {+interface CreateSessionInput {readonly continuationToken: string;readonly compactionOverrides?: {readonly thresholdPercent?: number;diff --git a/packages/eve/src/execution/session/admission.ts b/packages/eve/src/execution/session/admission.tsindex cdb5333f6..ceafade55 100644--- a/packages/eve/src/execution/session/admission.ts+++ b/packages/eve/src/execution/session/admission.ts@@ -14,10 +14,10 @@ import type { WorkflowToolRunMessage } from "#execution/tools/workflow/messages.import { findRunningAgentHandle } from "#subagents/handles/query.js";import { runProxySubagentEventStep } from "#subagents/event-proxy-step.js";-export type SessionCancellation = Extract<SessionCommand, { readonly kind: "cancel" }>;+type SessionCancellation = Extract<SessionCommand, { readonly kind: "cancel" }>;/** One canonical admission result, after wire decoding but before turn policy. */-export type SessionAdmission =+type SessionAdmission =| { readonly admission: DeliveryAdmission; readonly kind: "delivery" }| { readonly command: SessionCancellation; readonly kind: "cancel" }| { readonly kind: "consumed" }diff --git a/packages/eve/src/execution/session/entry-handoff-lifetime.integration.test.ts b/packages/eve/src/execution/session/entry-handoff-lifetime.integration.test.tsindex db7b434ec..9617eb24b 100644--- a/packages/eve/src/execution/session/entry-handoff-lifetime.integration.test.ts+++ b/packages/eve/src/execution/session/entry-handoff-lifetime.integration.test.ts@@ -4,6 +4,7 @@ import { getWorld, resumeHook, start } from "#internal/workflow/runtime.js";import { hydrateStepReturnValue, hydrateWorkflowArguments } from "@workflow/core/serialization";import { captureTurnEvents } from "#internal/testing/events.js";import { createTestRuntime } from "#internal/testing/app-harness.js";+import { captureConsoleOutput, workflowSdkNotice } from "#internal/testing/log-records.js";import { waitForParkedTurnStep } from "#internal/testing/session-test-helpers.js";import { createBundledRuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";import { workflowEntry } from "#execution/session/entry.js";@@ -23,6 +24,7 @@ describe("workflowEntry integration", () => {it.each([undefined, 60_000, false] as const)("renews the configured lifetime across handoffs and keeps the original stream (%s)",async (sessionTimeoutMs) => {+ const output = captureConsoleOutput();const runtime = await createTestRuntime({ agent: { name: "workflow-entry-handoff" } });await runtime.run(async () => {@@ -204,6 +206,11 @@ describe("workflowEntry integration", () => {if (!completed) await anchor.cancel();}});+ // Each handoff delivers the session to a deployment it was not started on.+ expect(output.lines).toContainEqual(+ expect.stringContaining(workflowSdkNotice.unpinnedDelivery),+ );+ expect(output.unexpected(workflowSdkNotice.unpinnedDelivery)).toEqual([]);},);});diff --git a/packages/eve/src/execution/session/entry-handoff.integration.test.ts b/packages/eve/src/execution/session/entry-handoff.integration.test.tsindex 27a760851..5677e164d 100644--- a/packages/eve/src/execution/session/entry-handoff.integration.test.ts+++ b/packages/eve/src/execution/session/entry-handoff.integration.test.ts@@ -18,10 +18,12 @@ import {} from "#execution/session-inbox/address.js";import { createWorkflowRuntime, waitForCommandHookOwner } from "#execution/workflow-runtime.js";import { buildSerializedContext, handoffFollowUp } from "#internal/testing/entry-test-helpers.js";+import { captureConsoleOutput, workflowSdkNotice } from "#internal/testing/log-records.js";describe("workflowEntry integration", () => {describe("deployment handoff", () => {it("recovers the original owner when target rejects nested state", async () => {+ const output = captureConsoleOutput();const runtime = await createTestRuntime({ agent: { name: "handoff-validation" } });await runtime.run(async () => {const anchor = await start(workflowEntry, [@@ -176,6 +178,13 @@ describe("workflowEntry integration", () => {stream.dispose();}});+ expect(output.lines).toContainEqual(+ expect.stringContaining(workflowSdkNotice.unpinnedDelivery),+ );+ expect(output.lines).toContainEqual(expect.stringContaining(workflowSdkNotice.maxRetries));+ expect(+ output.unexpected(workflowSdkNotice.unpinnedDelivery, workflowSdkNotice.maxRetries),+ ).toEqual([]);});it("retains a message accepted just before durable hook disposal", async () => {@@ -287,6 +296,7 @@ describe("workflowEntry integration", () => {});it("hands off an alias-addressed session and keeps the alias resolving through the gap", async () => {+ const output = captureConsoleOutput();const runtime = await createTestRuntime({ agent: { name: "workflow-entry-handoff-alias" } });const continuationToken = "http:workflow-entry-handoff-alias";@@ -389,6 +399,10 @@ describe("workflowEntry integration", () => {await anchor.cancel();}});+ expect(output.lines).toContainEqual(+ expect.stringContaining(workflowSdkNotice.unpinnedDelivery),+ );+ expect(output.unexpected(workflowSdkNotice.unpinnedDelivery)).toEqual([]);});it("keeps the session on the current owner when it is not idle", async () => {diff --git a/packages/eve/src/execution/session/entry.integration.test.ts b/packages/eve/src/execution/session/entry.integration.test.tsindex 911e96508..ae5ee1f8d 100644--- a/packages/eve/src/execution/session/entry.integration.test.ts+++ b/packages/eve/src/execution/session/entry.integration.test.ts@@ -19,7 +19,7 @@ import { createWorkflowRuntime } from "#execution/workflow-runtime.js";import { normalizeEveAttributes } from "#runtime/attributes/normalize.js";import { defineHook } from "#public/definitions/hook.js";import type { MessageStreamEvent } from "#protocol/message.js";-import { isEventId } from "#protocol/event-id.js";+import { isEventId } from "#internal/testing/event-id.js";import { always } from "#tools/approval/policies.js";import { defineTool } from "#tools/definition.js";import { SessionTitleKey } from "#context/keys.js";@@ -31,6 +31,7 @@ import {listCallerStepNames,withTimeout,} from "#internal/testing/entry-test-helpers.js";+import { captureConsoleOutput, workflowSdkNotice } from "#internal/testing/log-records.js";afterEach(() => {vi.unstubAllEnvs();@@ -174,6 +175,7 @@ describe("workflowEntry integration", () => {});it("parks in conversation mode and resumes via runtime delivery", async () => {+ const output = captureConsoleOutput();vi.stubEnv("VERCEL_DEPLOYMENT_ID", "dpl_inline");const runtime = await createTestRuntime({ agent: { name: "workflow-entry-conversation" } });const continuationToken = "http:workflow-entry-conversation";@@ -269,6 +271,7 @@ describe("workflowEntry integration", () => {if (!completed) await run.cancel();}});+ expect(output.unexpected(workflowSdkNotice.unpinnedDelivery)).toEqual([]);});it("publishes the session ID as the waiting address for an ID-only session", async () => {diff --git a/packages/eve/src/execution/session/event-sink.ts b/packages/eve/src/execution/session/event-sink.tsindex 7bdd69ed2..5b0ce9037 100644--- a/packages/eve/src/execution/session/event-sink.ts+++ b/packages/eve/src/execution/session/event-sink.ts@@ -13,7 +13,7 @@ import {type UnstampedMessageStreamEvent,} from "#protocol/message.js";-export interface SessionEventSinkInput {+interface SessionEventSinkInput {readonly adapter: ChannelAdapter;readonly ctx: ContextContainer;readonly isFirstTurn: boolean;diff --git a/packages/eve/src/execution/session/finalization.ts b/packages/eve/src/execution/session/finalization.tsindex 80361fd18..f3ad201f9 100644--- a/packages/eve/src/execution/session/finalization.ts+++ b/packages/eve/src/execution/session/finalization.ts@@ -16,7 +16,7 @@ export type SessionTerminalOutcome =| { readonly kind: "expired" }| { readonly kind: "failed"; readonly error: unknown; readonly turnId?: string };-export interface SessionFinalizationContext {+interface SessionFinalizationContext {readonly caller: TurnCaller | undefined;readonly cursor: {readonly serializedContext: Record<string, unknown>;diff --git a/packages/eve/src/execution/session/handoff.ts b/packages/eve/src/execution/session/handoff.tsindex 7674336e7..f36d03f30 100644--- a/packages/eve/src/execution/session/handoff.ts+++ b/packages/eve/src/execution/session/handoff.ts@@ -40,7 +40,7 @@ export type SessionOwnerActivation =readonly payloads: readonly SessionInboxPayload[];};-export type SessionTransferOutcome =+type SessionTransferOutcome =| { readonly kind: "transferred" }| {readonly kind: "retained";@@ -53,7 +53,7 @@ export type SessionTransferOutcome =| "activation-failed";};-export interface SessionHandoffInput {+interface SessionHandoffInput {readonly checkpoint: Omit<SessionCheckpoint, "serializedContext" | "sessionState" | "version">;readonly deploymentId: string;readonly inbox: SessionInboxHandle;diff --git a/packages/eve/src/execution/session/route-selected-delivery.ts b/packages/eve/src/execution/session/route-selected-delivery.tsindex 1a7c97273..8e2082069 100644--- a/packages/eve/src/execution/session/route-selected-delivery.ts+++ b/packages/eve/src/execution/session/route-selected-delivery.ts@@ -2,7 +2,7 @@ import { routeDeliverToChildren } from "#execution/route-child-delivery.js";import type { TurnSelection } from "#execution/session/input-queue.js";import type { SessionStateCursor } from "#execution/session/state-cursor.js";-export type RoutedTurnSelection =+type RoutedTurnSelection =| { readonly kind: "cancel-turn" }| { readonly kind: "consumed" }| TurnSelection;diff --git a/packages/eve/src/execution/session/timeout-control.ts b/packages/eve/src/execution/session/timeout-control.tsindex 5bb2956de..11d2b0fad 100644--- a/packages/eve/src/execution/session/timeout-control.ts+++ b/packages/eve/src/execution/session/timeout-control.ts@@ -7,7 +7,7 @@ import {import { sessionCommandHookToken } from "#execution/session-inbox/address.js";/** Workflow-body handle that targets a durable deadline at the stable command inbox. */-export interface SessionTimeoutControl {+interface SessionTimeoutControl {dispose(): Promise<void>;start(): Promise<void>;}diff --git a/packages/eve/src/execution/session/turn-connection-approval.integration.test.ts b/packages/eve/src/execution/session/turn-connection-approval.integration.test.tsindex db3d3004e..e4741a4c5 100644--- a/packages/eve/src/execution/session/turn-connection-approval.integration.test.ts+++ b/packages/eve/src/execution/session/turn-connection-approval.integration.test.ts@@ -21,7 +21,7 @@ import {ChannelKey,type CompiledBundle,} from "#runtime/sessions/runtime-context-keys.js";-import { createEmptyHookRegistry } from "#runtime/hooks/registry.js";+import { createRuntimeHookRegistry } from "#runtime/hooks/registry.js";import { resolveRuntimeModelReference } from "#runtime/agent/resolve-model.js";import type {ResolvedDynamicConnectionResolver,@@ -31,6 +31,10 @@ import connectionSearch from "#tools/framework/connection-search.js";import { clearDurableDynamicCallbacks } from "#tools/durable-callbacks.js";import type { ApprovalResponseContext } from "#approval/definition.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+vi.mock("#runtime/sessions/compiled-agent-cache.js", () => ({getCompiledRuntimeAgentBundle: vi.fn(),}));@@ -200,7 +204,7 @@ function setup(sandboxRegistry: sandboxRegistry as CompiledBundle["graph"]["root"]["sandboxRegistry"],turnAgent,channels: [],- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),nodeId: "__root__",subagentRegistry: {dynamicNodeIds: new Set(),@@ -212,7 +216,7 @@ function setup(toolRegistry: { preparedTools: [], toolsByName: new Map() },},},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),moduleMap: { nodes: {} },resolvedAgent: resolvedAgent as CompiledBundle["resolvedAgent"],subagentRegistry: {diff --git a/packages/eve/src/execution/session/turn-step.test.ts b/packages/eve/src/execution/session/turn-step.test.tsindex ddb521a0c..83178dcbd 100644--- a/packages/eve/src/execution/session/turn-step.test.ts+++ b/packages/eve/src/execution/session/turn-step.test.ts@@ -39,7 +39,7 @@ import { getProxyInputRequests, upsertProxyInputRequests } from "#harness/proxy-import { appendPendingInputBatch } from "#harness/input-requests.js";import { queueDeferredStepInput } from "#harness/pending-input-batches.js";import type { HarnessSession, StepFn, StepResult } from "#harness/types.js";-import { createEmptyHookRegistry, createRuntimeHookRegistry } from "#runtime/hooks/registry.js";+import { createRuntimeHookRegistry } from "#runtime/hooks/registry.js";import {createActionsRequestedEvent,createInputRequestedEvent,@@ -88,6 +88,11 @@ function turnStep(input: Omit<TurnStepInput, "input"> & { readonly input?: Legacreturn runTurnStep({ ...input, input: payload });}import { routeProxiedDeliverStep } from "#execution/proxied-deliver-step.js";+import { captureLogRecords } from "#internal/testing/log-records.js";++// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));const bindSessionInstrumentationSpy = vi.hoisted(() => vi.fn());/** When set, `bindSessionInstrumentation` binds this runtime instead of the global one. */@@ -226,7 +231,7 @@ function createTurnStepTestBundle(modelCallsPerStep?: number) {nodesByNodeId: new Map(),root: { sandboxRegistry: { sandbox: null }, turnAgent: TestTurnAgent },},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),moduleMap: { nodes: {} },resolvedAgent: { config },subagentRegistry: {},@@ -299,7 +304,7 @@ function createStubBundle(): Awaited<ReturnType<typeof getCompiledRuntimeAgentButurnAgent: TestTurnAgent,},},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -853,7 +858,7 @@ describe("dispatchCoordinationStep", () => {nodesByNodeId: new Map(),root: { sandboxRegistry: { sandbox: null }, turnAgent: TestTurnAgent },},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: { subagentsByNodeId: new Map() },toolRegistry: {},@@ -901,7 +906,7 @@ describe("dispatchCoordinationStep", () => {nodesByNodeId: new Map(),root: { sandboxRegistry: { sandbox: null }, turnAgent: TestTurnAgent },},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {subagentsByNodeId: new Map([@@ -965,7 +970,7 @@ describe("dispatchCoordinationStep", () => {turnAgent: TestTurnAgent,},},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {subagentsByNodeId: new Map(),@@ -1032,7 +1037,7 @@ describe("dispatchCoordinationStep", () => {turnAgent: TestTurnAgent,},},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {dynamicNodeIds: new Set([nodeId]),@@ -1563,7 +1568,7 @@ describe("turnStep", () => {root: { sandboxRegistry: { sandbox: null }, turnAgent: TestTurnAgent },},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -1677,7 +1682,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {}, dynamicToolResolvers: [dynamicToolResolver] },subagentRegistry: { dynamicResolvers: [dynamicSubagentResolver] },toolRegistry: {},@@ -1758,7 +1763,7 @@ describe("turnStep", () => {root: { sandboxRegistry: { sandbox: null }, turnAgent: TestTurnAgent },},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: {config: {},dynamicToolResolvers: [@@ -1865,7 +1870,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -1926,7 +1931,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: {config: {},},@@ -2065,7 +2070,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -2140,7 +2145,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -2218,7 +2223,7 @@ describe("turnStep", () => {root: { sandboxRegistry: { sandbox: null }, turnAgent: TestTurnAgent },},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -2279,7 +2284,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -2336,7 +2341,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: {config: {},},@@ -2852,7 +2857,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: {config: {},},@@ -2940,7 +2945,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -3030,7 +3035,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -3094,7 +3099,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -3190,7 +3195,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: {config: {},dynamicToolResolvers: [dynamicToolResolver],@@ -3349,7 +3354,7 @@ describe("turnStep", () => {},},moduleMap: { nodes: {} },- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: {config: {},dynamicToolResolvers: [@@ -3476,7 +3481,7 @@ describe("emitTerminalSessionFailureStep", () => {turnAgent: TestTurnAgent,},},- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},@@ -3557,6 +3562,7 @@ describe("emitTerminalSessionFailureStep", () => {});it("replaces cataloged failures with their semantic summary while keeping the raw dump", async () => {+ const logs = captureLogRecords();const sessionFailedCalls: Array<{ data: unknown }> = [];const capturingAdapter: ChannelAdapter = {kind: "thread-context",@@ -3594,9 +3600,16 @@ describe("emitTerminalSessionFailureStep", () => {// The raw inspection stays attached so the private session trace keeps// the evidence the curated message summarizes away.expect(data.details?.detail).toContain("fetch failed");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "workflow loop threw — emitting terminal session.failed",+ }),+ );});it("does not throw when the adapter handler itself throws", async () => {+ const logs = captureLogRecords();// A throwing handler must not prevent the event from reaching// the durable stream. This mirrors `callAdapterEventHandler`'s// safety net — the step's guarantee to the workflow body is@@ -3623,6 +3636,18 @@ describe("emitTerminalSessionFailureStep", () => {const writes = workflowWritesByNamespace.get(DEFAULT_WORKFLOW_STREAM_NAMESPACE) ?? [];expect(writes.length).toBe(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "workflow loop threw — emitting terminal session.failed",+ }),+ );+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "adapter event handler threw — event swallowed",+ }),+ );});});@@ -3654,7 +3679,7 @@ describe("runProxySubagentEventStep", () => {turnAgent: TestTurnAgent,},},- hookRegistry: options.hookRegistry ?? createEmptyHookRegistry(),+ hookRegistry: options.hookRegistry ?? createRuntimeHookRegistry([]),resolvedAgent: { config: {} },subagentRegistry: {},toolRegistry: {},diff --git a/packages/eve/src/execution/stable-workflow-names.ts b/packages/eve/src/execution/stable-workflow-names.tsindex 9c89f4717..e001d78aa 100644--- a/packages/eve/src/execution/stable-workflow-names.ts+++ b/packages/eve/src/execution/stable-workflow-names.ts@@ -3,7 +3,7 @@* an explicitly stamped deployment can find them across eve versions.* Dependency-free so the bundler can import it.*/-export const TURN_WORKFLOW_NAME = "turnWorkflow";+const TURN_WORKFLOW_NAME = "turnWorkflow";export const WORKFLOW_ENTRY_NAME = "workflowEntry";export const SESSION_TIMEOUT_WORKFLOW_NAME = "sessionTimeoutWorkflow";export const WORKFLOW_TOOL_RUN_WORKFLOW_NAME = "workflowToolRunWorkflow";diff --git a/packages/eve/src/execution/submit-activity.test.ts b/packages/eve/src/execution/submit-activity.test.tsindex 90cf6d22d..df99c3bca 100644--- a/packages/eve/src/execution/submit-activity.test.ts+++ b/packages/eve/src/execution/submit-activity.test.ts@@ -1,6 +1,7 @@import { afterEach, describe, expect, it, vi } from "vitest";import { submitActivity } from "#execution/submit-activity.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const event = {eventId: "root:session:turn:started",@@ -63,6 +64,7 @@ describe("submitActivity", () => {});it("posts one versioned batch and swallows transport failure", async () => {+ const logs = captureLogRecords();const fetchMock = vi.fn().mockResolvedValueOnce(new Response(null, { status: 202 }))@@ -78,5 +80,8 @@ describe("submitActivity", () => {events: [event],version: 1,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "activity sink request failed" }),+ );});});diff --git a/packages/eve/src/execution/tasks/child/notify.test.ts b/packages/eve/src/execution/tasks/child/notify.test.tsindex 1864c1aaa..76ead375c 100644--- a/packages/eve/src/execution/tasks/child/notify.test.ts+++ b/packages/eve/src/execution/tasks/child/notify.test.ts@@ -12,6 +12,7 @@ import { resumeWorkflowToolRunAnswers } from "#execution/tools/workflow/answer.jimport type { TaskView } from "#tasks/types.js";import { resumeSessionInbox } from "#execution/session-inbox/resume.js";import { submitActivity } from "#execution/submit-activity.js";+import { captureLogRecords } from "#internal/testing/log-records.js";vi.mock("#execution/submit-activity.js", () => ({ submitActivity: vi.fn() }));@@ -332,8 +333,15 @@ describe("notifyTaskParent", () => {new HookNotFoundError("parent-token"),new Error("delivery failed", { cause: new RunExpiredError("parent ended") }),])("tolerates an ended parent", async (error) => {+ const logs = captureLogRecords();vi.mocked(resumeSessionInbox).mockRejectedValueOnce(error);await expect(notifyTaskParent(notification)).resolves.toBeUndefined();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "task notification target is gone; the parent session already ended",+ }),+ );});it("propagates transient delivery failures so the durable step can retry", async () => {diff --git a/packages/eve/src/execution/terminate-child-sessions-step.test.ts b/packages/eve/src/execution/terminate-child-sessions-step.test.tsindex 5e1719925..b0879f2e1 100644--- a/packages/eve/src/execution/terminate-child-sessions-step.test.ts+++ b/packages/eve/src/execution/terminate-child-sessions-step.test.ts@@ -4,6 +4,7 @@ import { AGENT_HANDLES_STATE_KEY, type AgentHandle } from "#subagents/handles/stimport type { DurableSessionState } from "#execution/durable-session-store.js";import { terminateChildSessionsStep } from "#execution/terminate-child-sessions-step.js";import type { BackgroundWorkflowToolRun } from "#harness/workflow-tool-runs.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const COMPILED_BUNDLE = {subagentRegistry: { subagentsByNodeId: new Map() },@@ -246,6 +247,7 @@ describe("terminateChildSessionsStep", () => {});it("settles every indexed task cancellation before terminating local children", async () => {+ const logs = captureLogRecords();const firstCancellation = createDeferred();const secondCancellation = createDeferred();const order: string[] = [];@@ -287,47 +289,56 @@ describe("terminateChildSessionsStep", () => {expect(cancelRunMock).toHaveBeenCalledExactlyOnceWith("world", "session-local", {cancelReason: "Parent session ended",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "failed to settle background task instrumentation",+ }),+ );});it("continues finalization after an indexed task cancellation fails", async () => {- const errorSpy = vi.spyOn(console, "error").mockImplementation(() => {});+ const logs = captureLogRecords();cancelOwnedTaskMock.mockRejectedValueOnce(new Error("task cancellation unavailable")).mockImplementationOnce(async ({ entry }: { entry: BackgroundWorkflowToolRun }) =>cancelledView(entry),);- try {- await expect(- terminateChildSessionsStep({- serializedContext: { context: "serialized" },- sessionState: makeSessionState(- [- parkedHandle({- id: "ag_local:1",- kind: "agent/local",- sessionId: "session-local",- }),- ],- [indexedTask("task-1"), indexedTask("task-2")],- ),- }),- ).resolves.toBeUndefined();+ await expect(+ terminateChildSessionsStep({+ serializedContext: { context: "serialized" },+ sessionState: makeSessionState(+ [+ parkedHandle({+ id: "ag_local:1",+ kind: "agent/local",+ sessionId: "session-local",+ }),+ ],+ [indexedTask("task-1"), indexedTask("task-2")],+ ),+ }),+ ).resolves.toBeUndefined();- expect(cancelOwnedTaskMock).toHaveBeenCalledTimes(2);- expect(cancelRunMock).toHaveBeenCalledExactlyOnceWith("world", "session-local", {- cancelReason: "Parent session ended",- });- expect(errorSpy).toHaveBeenCalledWith(- "[eve:execution.cancel-indexed-session-tasks] failed to cancel indexed task",- expect.objectContaining({- parentSessionId: "parent-session",- taskId: "task-1",- }),- );- } finally {- errorSpy.mockRestore();- }+ expect(cancelOwnedTaskMock).toHaveBeenCalledTimes(2);+ expect(cancelRunMock).toHaveBeenCalledExactlyOnceWith("world", "session-local", {+ cancelReason: "Parent session ended",+ });+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ namespace: "execution.cancel-indexed-session-tasks",+ message: "failed to cancel indexed task",+ fields: expect.objectContaining({ parentSessionId: "parent-session", taskId: "task-1" }),+ }),+ );+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "failed to settle background task instrumentation",+ }),+ );});it("continues terminating children after one termination fails", async () => {diff --git a/packages/eve/src/execution/tools/connection-search-authorization.integration.test.ts b/packages/eve/src/execution/tools/connection-search-authorization.integration.test.tsindex bec34b8e7..c56a9f849 100644--- a/packages/eve/src/execution/tools/connection-search-authorization.integration.test.ts+++ b/packages/eve/src/execution/tools/connection-search-authorization.integration.test.ts@@ -10,6 +10,7 @@ import { ConnectionRegistryImpl } from "#runtime/connections/registry.js";import type { ResolvedConnectionDefinition } from "#runtime/types.js";import type { ToolContext } from "#tools/definition.js";import type { DynamicToolSet } from "#tools/dynamic.js";+import { captureLogRecords } from "#internal/testing/log-records.js";function setup() {const getToken = vi.fn(async () => {@@ -92,6 +93,7 @@ describe("connection search callback availability", () => {// The real MCP client asks the provider for a token before making any HTTP request.for (const missing of ["session", "origin", "both"] as const) {it(`fails a private-only search when ${missing} is missing`, async () => {+ const logs = captureLogRecords();const state = setup();if (missing !== "origin") state.context.delete(SessionIdKey);if (missing !== "session") state.context.delete(CallbackBaseUrlKey);@@ -102,6 +104,9 @@ describe("connection search callback availability", () => {);expect(state.getToken).toHaveBeenCalledOnce();expect(state.startAuthorization).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "connection authorization failed" }),+ );} finally {await state.registry.dispose();}@@ -109,6 +114,7 @@ describe("connection search callback availability", () => {}it("keeps public tools discoverable alongside the private connection's callback error", async () => {+ const logs = captureLogRecords();const state = setup();state.context.delete(CallbackBaseUrlKey);@@ -127,5 +133,8 @@ describe("connection search callback availability", () => {} finally {await state.registry.dispose();}+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "connection authorization failed" }),+ );});});diff --git a/packages/eve/src/execution/tools/connection-search.test.ts b/packages/eve/src/execution/tools/connection-search.test.tsindex dc3f348cb..2ea8b31b8 100644--- a/packages/eve/src/execution/tools/connection-search.test.ts+++ b/packages/eve/src/execution/tools/connection-search.test.ts@@ -25,6 +25,7 @@ import { isBrandedToolEntry, type DynamicToolSet } from "#tools/dynamic.js";import type { DynamicResolveContext } from "#dynamic/definition.js";import { readDurableDynamicToolCallbacks } from "#tools/durable-callbacks.js";import { resolveHeaders } from "#runtime/connections/mcp-client.js";+import { captureLogRecords } from "#internal/testing/log-records.js";function connection(name: string): ResolvedConnectionDefinition {return {@@ -297,6 +298,7 @@ describe("connection dynamic tools", () => {describe("connection_search", () => {it("fails when every targeted connection fails to load", async () => {+ const logs = captureLogRecords();const incident = connection("incident");const connectionRegistry = registry({connections: [incident],@@ -315,6 +317,9 @@ describe("connection_search", () => {).rejects.toThrow('Failed to load tools for "incident": MCP SSE Transport Error: 400 Bad Request',);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "failed to load connection tools" }),+ );});it("fails when the requested connection is not registered", async () => {@@ -333,6 +338,7 @@ describe("connection_search", () => {});it("fails when authorization cannot be started", async () => {+ const logs = captureLogRecords();const salesforce: ResolvedConnectionDefinition = {...connection("salesforce"),authorization: {@@ -372,6 +378,9 @@ describe("connection_search", () => {},),).rejects.toThrow('Failed to start authorization for "salesforce": OAuth provider unavailable');+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "connection authorization failed" }),+ );});it("returns connection summaries when loading succeeds without a keyword match", async () => {@@ -392,6 +401,7 @@ describe("connection_search", () => {});it("returns matches and errors when at least one connection loads", async () => {+ const logs = captureLogRecords();const incident = connection("incident");const linear = connection("linear");const connectionRegistry = registry({@@ -427,6 +437,9 @@ describe("connection_search", () => {error: 'Failed to load tools for "incident": MCP SSE Transport Error: 400 Bad Request',},]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "failed to load connection tools" }),+ );});it("does not complete an unrelated connection authorization", async () => {@@ -577,6 +590,7 @@ describe("connection_search", () => {it.each([false, true])("completes connection auth through the shared token cache (fresh token refused: %s)",async (refused) => {+ const logs = captureLogRecords();const getToken = vi.fn(async () => {throw new ConnectionAuthorizationRequiredError("salesforce");});@@ -648,6 +662,10 @@ describe("connection_search", () => {callback: { method: "GET", params: { code: "approved" } },}),);+ const failures = logs.records.filter(+ (record) => record.message === "connection authorization failed",+ );+ expect(failures).toHaveLength(refused ? 1 : 0);},);diff --git a/packages/eve/src/execution/tools/subagent/emit-event-step.integration.test.ts b/packages/eve/src/execution/tools/subagent/emit-event-step.integration.test.tsindex 7bcdcb93e..456fedecd 100644--- a/packages/eve/src/execution/tools/subagent/emit-event-step.integration.test.ts+++ b/packages/eve/src/execution/tools/subagent/emit-event-step.integration.test.ts@@ -10,7 +10,6 @@ import {SessionTitleKey,} from "#context/keys.js";import { deserializeContext, serializeContext } from "#context/serialize.js";-import { createEmptyHookRegistry } from "#runtime/hooks/registry.js";import { emitSubagentEventStep } from "#execution/tools/subagent/emit-event-step.js";import { createSessionEventSink } from "#execution/session/event-sink.js";import { createStubSandboxRegistry } from "#internal/testing/stub-sandbox-registry.js";@@ -273,7 +272,7 @@ it("does not prepare context when no hook subscribes to the published event", asctx.set(AuthKey, null);ctx.set(ChannelKey, { kind: "test" });const bundle: Partial<CompiledBundle> = {- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),get turnAgent(): never {throw new Error("unsubscribed event prepared runtime context");},diff --git a/packages/eve/src/execution/tools/subagent/invoke-preparation.test.ts b/packages/eve/src/execution/tools/subagent/invoke-preparation.test.tsindex 521491ca4..a36b3962a 100644--- a/packages/eve/src/execution/tools/subagent/invoke-preparation.test.ts+++ b/packages/eve/src/execution/tools/subagent/invoke-preparation.test.ts@@ -1,6 +1,7 @@import { describe, expect, it } from "vitest";import { planAgentDispatch } from "#execution/tools/subagent/invoke-preparation.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const localAction = {callId: "call-1",@@ -25,6 +26,7 @@ function session(rootSessionId?: string) {describe("planAgentDispatch", () => {it("rejects recursive self-agent starts outside the root session", () => {+ const logs = captureLogRecords();expect(planAgentDispatch({action: { ...localAction, name: "agent", nodeId: "__root__", subagentName: "agent" },@@ -39,9 +41,16 @@ describe("planAgentDispatch", () => {kind: "reject",result: { output: { code: "RECURSIVE_AGENT_ROOT_ONLY" } },});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "recursive agent call blocked outside the root session",+ }),+ );});it("rejects a dynamic target omitted from the current selection", () => {+ const logs = captureLogRecords();expect(planAgentDispatch({action: localAction,@@ -56,9 +65,16 @@ describe("planAgentDispatch", () => {session: session() as never,}),).toMatchObject({ kind: "reject", result: { output: { code: "SUBAGENT_UNAVAILABLE" } } });+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "dynamic subagent call blocked after availability changed",+ }),+ );});it("falls back to a fresh start for an unknown agentId", () => {+ const logs = captureLogRecords();expect(planAgentDispatch({action: { ...localAction, input: { agentId: "unknown", message: "Find it" } },@@ -75,5 +91,11 @@ describe("planAgentDispatch", () => {session: session() as never,}),).toMatchObject({ kind: "start", target: { action: localAction, kind: "local" } });+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "unknown agentId on subagent call; starting a new agent",+ }),+ );});});diff --git a/packages/eve/src/execution/tools/subagent/invoke-preparation.ts b/packages/eve/src/execution/tools/subagent/invoke-preparation.tsindex a3dabd7a2..35fbab645 100644--- a/packages/eve/src/execution/tools/subagent/invoke-preparation.ts+++ b/packages/eve/src/execution/tools/subagent/invoke-preparation.ts@@ -42,7 +42,7 @@ import { getBackgroundTasks } from "#harness/workflow-tool-runs.js";const log = createLogger("execution.agent-invocation");-export type OwnerAgentDispatchPlanEntry =+type OwnerAgentDispatchPlanEntry =| {readonly kind: "resume";readonly action: RuntimeAgentHandleAction;diff --git a/packages/eve/src/execution/tools/subagent/task-agent-requests.ts b/packages/eve/src/execution/tools/subagent/task-agent-requests.tsindex 8f24d94cd..2494662ef 100644--- a/packages/eve/src/execution/tools/subagent/task-agent-requests.ts+++ b/packages/eve/src/execution/tools/subagent/task-agent-requests.ts@@ -7,20 +7,20 @@ import {import { resumeHookStep } from "#execution/tools/workflow/resume-hook-step.js";import type { TaskAgentRequestDelivery } from "#tasks/types.js";-export interface AgentRequestDelivery {+interface AgentRequestDelivery {readonly ownerId: string;readonly replyTo: TaskAgentRequestDelivery["replyTo"];readonly request: TaskAgentRequestDelivery["request"];readonly taskId?: string;}-export interface TaskAgentRequestContext {+interface TaskAgentRequestContext {readonly sessionWritable: WritableStream<Uint8Array>;readonly serializedContext: Record<string, unknown>;readonly sessionState: DurableSessionState;}-export interface AppliedTaskAgentRequest {+interface AppliedTaskAgentRequest {readonly serializedContext: Record<string, unknown>;readonly sessionState: DurableSessionState;}diff --git a/packages/eve/src/execution/tools/workflow/background.ts b/packages/eve/src/execution/tools/workflow/background.tsindex e1d9af1d1..534f195e6 100644--- a/packages/eve/src/execution/tools/workflow/background.ts+++ b/packages/eve/src/execution/tools/workflow/background.ts@@ -4,7 +4,7 @@ import { parseJsonObject, type JsonValue } from "#shared/json.js";import type { ToolExecuteOptions } from "#tools/definition.js";import { UNSPECIFIED_INPUT_SCHEMA, toInputSchema, toOutputSchema } from "#tools/schema.js";-export interface WorkflowToolHarnessDefinitionInput {+interface WorkflowToolHarnessDefinitionInput {readonly definition: HarnessToolDefinition;readonly executeInput?: (input: unknown) => JsonValue;/** Selected agent definition's runtime graph ID; absent for authored workflow tools. */@@ -62,7 +62,7 @@ export function createPreparedWorkflowToolHarnessDefinition(}/** Returns a task receipt after the background scope starts the owning run. */-export function createWorkflowToolBackgroundExecute(input: {+function createWorkflowToolBackgroundExecute(input: {readonly toolName: string;readonly workflowId: string;}): NonNullable<HarnessToolDefinition["execute"]> {diff --git a/packages/eve/src/execution/tools/workflow/owner-channels.ts b/packages/eve/src/execution/tools/workflow/owner-channels.tsindex 3c8bf694b..11b6b4390 100644--- a/packages/eve/src/execution/tools/workflow/owner-channels.ts+++ b/packages/eve/src/execution/tools/workflow/owner-channels.ts@@ -25,7 +25,7 @@ type ChannelReadResult<R> =? { readonly channel: C; readonly next: IteratorResult<T> }: never;-export type ChannelRead<R extends readonly ChannelReader<string, unknown>[]> = ChannelReadResult<+type ChannelRead<R extends readonly ChannelReader<string, unknown>[]> = ChannelReadResult<R[number]>;diff --git a/packages/eve/src/execution/tools/workflow/workflow-owner-background.ts b/packages/eve/src/execution/tools/workflow/workflow-owner-background.tsindex 5fde345a3..519d7e53a 100644--- a/packages/eve/src/execution/tools/workflow/workflow-owner-background.ts+++ b/packages/eve/src/execution/tools/workflow/workflow-owner-background.ts@@ -29,7 +29,7 @@ import {type TaskView,} from "#tasks/types.js";-export interface BackgroundWorkflowOwner {+interface BackgroundWorkflowOwner {readonly kind: "session";readonly commands: ChannelReader<"commands", TaskRunInboundPayload>;readonly signal: AbortSignal;diff --git a/packages/eve/src/execution/tools/workflow/workflow-tool-run-authorization-close.integration.test.ts b/packages/eve/src/execution/tools/workflow/workflow-tool-run-authorization-close.integration.test.tsindex e6a0ce148..e624ab248 100644--- a/packages/eve/src/execution/tools/workflow/workflow-tool-run-authorization-close.integration.test.ts+++ b/packages/eve/src/execution/tools/workflow/workflow-tool-run-authorization-close.integration.test.ts@@ -6,6 +6,11 @@ import { sessionCommandHookToken } from "#execution/session-inbox/address.js";import { handleConnectionCallbackRequest } from "#execution/connections/callback-route.js";import { resumeSessionInbox } from "#execution/session-inbox/resume.js";import { authorizedDeployWorkflow } from "#internal/testing/workflow-tool-fixtures.js";+import {+ captureConsoleOutput,+ taskParentEndedNotice,+ workflowSdkNotice,+} from "#internal/testing/log-records.js";import {buildWorkflowToolSerializedContext,createWorkflowToolRuntime,@@ -21,6 +26,7 @@ describe("workflow step authorization failures", () => {])("closes authorization on $disposition (background=$background)",async ({ background, disposition }) => {+ const output = captureConsoleOutput();const runtime = await createWorkflowToolRuntime({agentName: "workflow-step-auth-failure",background,@@ -104,6 +110,11 @@ describe("workflow step authorization failures", () => {await run.cancel();}});+ // A denied or rejected authorization fails the step fatally.+ expect(+ output.lines.filter((line) => line.startsWith(workflowSdkNotice.fatalStep)),+ ).toHaveLength(disposition === "cancel" ? 0 : 1);+ expect(output.unexpected(workflowSdkNotice.fatalStep, taskParentEndedNotice)).toEqual([]);},60_000,);diff --git a/packages/eve/src/execution/tools/workflow/workflow-tool-run-background.integration.test.ts b/packages/eve/src/execution/tools/workflow/workflow-tool-run-background.integration.test.tsindex cf67fc539..16974a9e4 100644--- a/packages/eve/src/execution/tools/workflow/workflow-tool-run-background.integration.test.ts+++ b/packages/eve/src/execution/tools/workflow/workflow-tool-run-background.integration.test.ts@@ -15,10 +15,16 @@ import {buildWorkflowToolSerializedContext,createWorkflowToolRuntime,} from "#internal/testing/workflow-tool-run-harness.js";+import {+ captureConsoleOutput,+ taskParentEndedNotice,+ workflowSdkNotice,+} from "#internal/testing/log-records.js";describe("background workflow tools", () => {afterEach(() => vi.unstubAllEnvs());it("runs a session-owned background workflow invocation", async () => {+ const output = captureConsoleOutput();vi.stubEnv("VERCEL_DEPLOYMENT_ID", "dpl_inline");const runtime = await createWorkflowToolRuntime({agentName: "workflow-tool-background",@@ -70,6 +76,9 @@ describe("background workflow tools", () => {await run.cancel();}});+ expect(output.unexpected(workflowSdkNotice.unpinnedDelivery, taskParentEndedNotice)).toEqual(+ [],+ );}, 90_000);it("wakes the agent with the failure when a background workflow tool throws", async () => {diff --git a/packages/eve/src/execution/tools/workflow/workflow-tool-run-cancellation.integration.test.ts b/packages/eve/src/execution/tools/workflow/workflow-tool-run-cancellation.integration.test.tsindex 30ca22844..6d39197ca 100644--- a/packages/eve/src/execution/tools/workflow/workflow-tool-run-cancellation.integration.test.ts+++ b/packages/eve/src/execution/tools/workflow/workflow-tool-run-cancellation.integration.test.ts@@ -17,10 +17,16 @@ import {createWorkflowToolRuntime,waitForWorkflowToolRunTerminal,} from "#internal/testing/workflow-tool-run-harness.js";+import {+ captureConsoleOutput,+ taskParentEndedNotice,+ workflowSdkNotice,+} from "#internal/testing/log-records.js";describe("workflow tool cancellation", () => {afterEach(() => vi.unstubAllEnvs());it("fails the retained caller when a yielded child receives reset", async () => {+ const output = captureConsoleOutput();const kind = "reset";const runtime = await createWorkflowToolRuntime({agentName: `yielded-child-${kind}`,@@ -97,9 +103,19 @@ describe("workflow tool cancellation", () => {}}});+ expect(output.lines).toContainEqual(expect.stringContaining(workflowSdkNotice.maxRetries));+ expect(output.lines).toContainEqual(expect.stringContaining(taskParentEndedNotice));+ expect(+ output.unexpected(+ workflowSdkNotice.maxRetries,+ taskParentEndedNotice,+ workflowSdkNotice.unpinnedDelivery,+ ),+ ).toEqual([]);}, 30_000);it("cancels nested work after its owning child has yielded", async () => {+ const output = captureConsoleOutput();const runtime = await createWorkflowToolRuntime({agentName: "yielded-child-cancel",background: true,@@ -186,9 +202,18 @@ describe("workflow tool cancellation", () => {await child.cancel();}});+ expect(output.lines).toContainEqual(expect.stringContaining(workflowSdkNotice.maxRetries));+ expect(+ output.unexpected(+ workflowSdkNotice.maxRetries,+ workflowSdkNotice.unpinnedDelivery,+ taskParentEndedNotice,+ ),+ ).toEqual([]);}, 30_000);it("cancels the run when the waiting turn is cancelled and lets the body clean up", async () => {+ const output = captureConsoleOutput();vi.stubEnv("VERCEL_DEPLOYMENT_ID", "dpl_inline");const runtime = await createWorkflowToolRuntime({agentName: "workflow-tool-cancel",@@ -235,6 +260,14 @@ describe("workflow tool cancellation", () => {await run.cancel();}});+ expect(output.lines).toContainEqual(expect.stringContaining(workflowSdkNotice.maxRetries));+ expect(+ output.unexpected(+ workflowSdkNotice.maxRetries,+ workflowSdkNotice.unpinnedDelivery,+ taskParentEndedNotice,+ ),+ ).toEqual([]);}, 60_000);});diff --git a/packages/eve/src/execution/tools/workflow/workflow-tool-run.integration.test.ts b/packages/eve/src/execution/tools/workflow/workflow-tool-run.integration.test.tsindex 72713f934..d5a8e7b7d 100644--- a/packages/eve/src/execution/tools/workflow/workflow-tool-run.integration.test.ts+++ b/packages/eve/src/execution/tools/workflow/workflow-tool-run.integration.test.ts@@ -23,6 +23,7 @@ import {buildWorkflowToolSerializedContext,createWorkflowToolRuntime,} from "#internal/testing/workflow-tool-run-harness.js";+import { captureConsoleOutput, workflowSdkNotice } from "#internal/testing/log-records.js";describe("workflow tools", () => {afterEach(() => vi.unstubAllEnvs());@@ -99,6 +100,7 @@ describe("workflow tools", () => {});it("fails workflow-context misuse in a step with actionable guidance", async () => {+ const consoleOutput = captureConsoleOutput();const runtime = await createWorkflowToolRuntime({agentName: "workflow-step-context-misuse",execute: workflowContextMisuseWorkflow,@@ -124,6 +126,10 @@ describe("workflow tools", () => {"Read ctx.agents in the workflow body and pass the required serializable metadata into the step.",);expect(output).toContain("Attempt 1.");+ expect(consoleOutput.lines).toContainEqual(+ expect.stringContaining(workflowSdkNotice.fatalStep),+ );+ expect(consoleOutput.unexpected(workflowSdkNotice.fatalStep)).toEqual([]);});it("settles the call with an error when the workflow body throws", async () => {@@ -151,6 +157,7 @@ describe("workflow tools", () => {});it("routes workflow reports, human input, and outcome through the session owner", async () => {+ const output = captureConsoleOutput();vi.stubEnv("VERCEL_DEPLOYMENT_ID", "dpl_inline");const runtime = await createWorkflowToolRuntime({agentName: "workflow-tool-hitl",@@ -218,6 +225,7 @@ describe("workflow tools", () => {await run.cancel();}});+ expect(output.unexpected(workflowSdkNotice.unpinnedDelivery)).toEqual([]);}, 60_000);it("lets a deadline win a race against an unanswered ask", async () => {diff --git a/packages/eve/src/execution/turn-cancellation.integration.test.ts b/packages/eve/src/execution/turn-cancellation.integration.test.tsindex f77d017b0..8575e5e6f 100644--- a/packages/eve/src/execution/turn-cancellation.integration.test.ts+++ b/packages/eve/src/execution/turn-cancellation.integration.test.ts@@ -26,6 +26,7 @@ import { defineMemory } from "#public/memory/index.js";import type { ToolContext } from "#tools/definition.js";import type { ResolvedToolDefinition } from "#runtime/types.js";import { toInputSchema } from "#tools/schema.js";+import { captureConsoleOutput } from "#internal/testing/log-records.js";/*** Turn cancellation settles as `turn.cancelled` → `session.waiting` with@@ -399,6 +400,7 @@ describe("turn cancellation integration", () => {}, 60_000);it("keeps an abort-shaped memory recall error terminal while the turn signal is active", async () => {+ const output = captureConsoleOutput();const fixture = await createAbortRecallRuntime("turn-active-memory-abort", {waitForAbort: false,});@@ -416,17 +418,24 @@ describe("turn cancellation integration", () => {},]);const stream = captureTurnEvents(run);+ let failed = false;try {await fixture.recallStarted;const failedTurn = await stream.nextTurn();expect(failedTurn.at(-1)?.type).toBe("session.failed");expect(filterEventsByType(failedTurn, "turn.cancelled")).toHaveLength(0);+ await expect(run.returnValue).rejects.toThrow("Agent workflow failed.");+ failed = true;} finally {stream.dispose();- await run.cancel();+ // A failed run is terminal and rejects cancellation.+ if (!failed) await run.cancel();}});+ expect(output.lines).toContain(+ "[eve:execution.workflow-entry] workflow loop threw — emitting terminal session.failed",+ );});it.each([@@ -500,6 +509,7 @@ describe("turn cancellation integration", () => {);it("cancels a turn mid-tool and accepts the next message normally", async () => {+ const output = captureConsoleOutput();const fixture = await createWaitToolRuntime("turn-cancel-tool");const continuationToken = "http:turn-cancel-tool";@@ -575,9 +585,11 @@ describe("turn cancellation integration", () => {await run.cancel();}});+ expect(output.lines).not.toContain("[eve:harness.tool-loop] tool execution failed");});it("cancels a turn through the eve channel cancel route", async () => {+ const output = captureConsoleOutput();const fixture = await createWaitToolRuntime("turn-cancel-route");const continuationToken = "http:turn-cancel-route";const cancelViaRoute = createCancelRouteCaller();@@ -655,9 +667,11 @@ describe("turn cancellation integration", () => {await run.cancel();}});+ expect(output.lines).not.toContain("[eve:harness.tool-loop] tool execution failed");}, 60_000);it("cancels a turn from a channel route helper addressed by continuation token", async () => {+ const output = captureConsoleOutput();const fixture = await createWaitToolRuntime("turn-cancel-helper");const rawToken = "turn-cancel-helper";const continuationToken = `http:${rawToken}`;@@ -746,9 +760,11 @@ describe("turn cancellation integration", () => {await run.cancel();}});+ expect(output.lines).not.toContain("[eve:harness.tool-loop] tool execution failed");}, 60_000);it("consumes a cancel with a stale turn guard as a no-op and keeps the turn running", async () => {+ const output = captureConsoleOutput();const fixture = await createWaitToolRuntime("turn-cancel-stale-guard");const continuationToken = "http:turn-cancel-stale-guard";@@ -794,6 +810,7 @@ describe("turn cancellation integration", () => {await run.cancel();}});+ expect(output.lines).not.toContain("[eve:harness.tool-loop] tool execution failed");}, 60_000);it("treats a cancel after the turn settled as a benign no-op", async () => {diff --git a/packages/eve/src/execution/web-fetch/execute.ts b/packages/eve/src/execution/web-fetch/execute.tsindex 234c8daf7..5d57610a4 100644--- a/packages/eve/src/execution/web-fetch/execute.ts+++ b/packages/eve/src/execution/web-fetch/execute.ts@@ -26,7 +26,7 @@ export interface WebFetchInput {}/** Per-call options accepted by {@link executeWebFetchTool}. */-export interface WebFetchExecuteOptions {+interface WebFetchExecuteOptions {/** Signal combined with the request timeout. */readonly abortSignal?: AbortSignal;}@@ -34,7 +34,7 @@ export interface WebFetchExecuteOptions {/*** Structured result returned from {@link executeWebFetchTool}.*/-export interface WebFetchResult {+interface WebFetchResult {/** Response body, bounded to the shared tool-output limits. */readonly content: string;/** Response `Content-Type` header. */diff --git a/packages/eve/src/execution/web-fetch/request.ts b/packages/eve/src/execution/web-fetch/request.tsindex af5f449fb..94a7b8d81 100644--- a/packages/eve/src/execution/web-fetch/request.ts+++ b/packages/eve/src/execution/web-fetch/request.ts@@ -16,7 +16,7 @@ type DispatcherRequestInit = Omit<RequestInit, "dispatcher"> & {};/** Options for an SSRF-safe HTTPS request. */-export interface PublicUrlRequestOptions {+interface PublicUrlRequestOptions {readonly headers: Readonly<Record<string, string>>;readonly maxResponseSize: number;readonly signal: AbortSignal;diff --git a/packages/eve/src/execution/workflow-runtime.test.ts b/packages/eve/src/execution/workflow-runtime.test.tsindex 40fb5ecbd..0911be8ad 100644--- a/packages/eve/src/execution/workflow-runtime.test.ts+++ b/packages/eve/src/execution/workflow-runtime.test.ts@@ -33,6 +33,7 @@ import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifactsimport { getCompiledRuntimeAgentBundle } from "#runtime/sessions/compiled-agent-cache.js";import { markAgentTraceContext } from "#tracing/agent-trace-context.js";import type { TraceCaptureContext } from "#shared/trace-policy.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const getHookByTokenMock = vi.fn();const world = {@@ -275,6 +276,7 @@ describe("createWorkflowRuntime command dispatch", () => {});it("does not report an accepted command as missing when metadata hydration fails", async () => {+ const logs = captureLogRecords();const { HookNotFoundError } = await import("#compiled/@workflow/errors/index.js");resumeHookMock.mockResolvedValue({runId: "owner",@@ -291,6 +293,9 @@ describe("createWorkflowRuntime command dispatch", () => {expect(resumeHookMock).toHaveBeenCalledOnce();expect(startMock).not.toHaveBeenCalled();expect(getHookByTokenMock).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "failed to dispatch session command" }),+ );});it("preserves the delivery payload through the stable session inbox", async () => {@@ -349,6 +354,7 @@ describe("createWorkflowRuntime command dispatch", () => {});it("re-throws unexpected errors from `resumeHook`", async () => {+ const logs = captureLogRecords();const failure = new Error("transient backing-store outage");resumeHookMock.mockRejectedValue(failure);@@ -360,6 +366,9 @@ describe("createWorkflowRuntime command dispatch", () => {continuationToken: NOT_FOUND_TOKEN,}),).rejects.toBe(failure);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "failed to dispatch session command" }),+ );});it("dispatches guarded cancellation through the stable inbox", async () => {@@ -403,6 +412,7 @@ describe("createWorkflowRuntime command dispatch", () => {});it("rethrows unexpected runtime failures", async () => {+ const logs = captureLogRecords();const failure = new Error("transient backing-store outage");resumeHookMock.mockRejectedValue(failure);@@ -412,6 +422,9 @@ describe("createWorkflowRuntime command dispatch", () => {sessionId: "session-1",}),).rejects.toBe(failure);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "failed to dispatch session command" }),+ );});it("waits for reset to release the stable command inbox", async () => {@@ -472,10 +485,17 @@ describe("createWorkflowRuntime#resolveContinuation", () => {});it("rethrows unexpected lookup failures", async () => {+ const logs = captureLogRecords();const failure = new Error("transient backing-store outage");getHookByTokenMock.mockRejectedValue(failure);await expect(buildRuntime().resolveContinuation("test:token")).rejects.toBe(failure);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "failed to resolve session by continuation token",+ }),+ );});});@@ -748,6 +768,7 @@ describe("createWorkflowRuntime#createSession", () => {});it("starts the root without activity when collector launch fails", async () => {+ const logs = captureLogRecords();const compiledArtifactsSource = {} as RuntimeCompiledArtifactsSource;mockBundleAndRun(compiledArtifactsSource);startMock@@ -762,9 +783,13 @@ describe("createWorkflowRuntime#createSession", () => {const workflowInput = startMock.mock.calls[1]?.[1][0];expect(workflowInput.serializedContext[ActivityObserverKey.name]).toBeUndefined();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "failed to start activity collector" }),+ );});it("cancels the collector when root workflow startup fails", async () => {+ const logs = captureLogRecords();const compiledArtifactsSource = {} as RuntimeCompiledArtifactsSource;mockBundleAndRun(compiledArtifactsSource);const failure = new Error("root start failed");@@ -781,6 +806,9 @@ describe("createWorkflowRuntime#createSession", () => {expect(cancelRunMock).toHaveBeenCalledWith(world, "collector-run", {cancelReason: "Root session creation did not complete",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "failed to start workflow run" }),+ );});it("does not inspect continuation ownership after accepting a root candidate", async () => {diff --git a/packages/eve/src/framework/host-inventory.ts b/packages/eve/src/framework/host-inventory.tsindex 62dc468df..eb042a9db 100644--- a/packages/eve/src/framework/host-inventory.ts+++ b/packages/eve/src/framework/host-inventory.ts@@ -12,9 +12,9 @@ import {DEVELOPMENT_WORKFLOW_WORLD_ROUTE,} from "#internal/workflow/development-world-protocol.js";-export type HostHttpMethod = "ALL" | "GET" | "POST";+type HostHttpMethod = "ALL" | "GET" | "POST";-export interface HostHttpRegistration {+interface HostHttpRegistration {readonly capability: "workflow" | "development" | "schedule";readonly method: HostHttpMethod;readonly path: string;diff --git a/packages/eve/src/harness/approval-candidates.ts b/packages/eve/src/harness/approval-candidates.tsindex 1b9ab5f80..6af62e42d 100644--- a/packages/eve/src/harness/approval-candidates.ts+++ b/packages/eve/src/harness/approval-candidates.ts@@ -4,7 +4,7 @@ import type { SessionStateMap } from "#harness/types.js";const APPROVAL_STATE_KEY = "eve.runtime.hitl.approvalState";-export type ApprovalCandidateStatus =+type ApprovalCandidateStatus =| "pending"| "authorization-required"| "allowed"@@ -13,7 +13,7 @@ export type ApprovalCandidateStatus =| "timed-out"| "stale";-export interface ApprovalCandidateAuditRecord {+interface ApprovalCandidateAuditRecord {readonly candidateId: string;readonly requestId: string;readonly responder: ApprovalResponderIdentity;@@ -59,7 +59,7 @@ interface DurableApprovalState {readonly settlements: Readonly<Record<string, ApprovalSettlementAuditRecord>>;}-export interface ApprovalStateTransition {+interface ApprovalStateTransition {readonly changed: boolean;readonly state: SessionStateMap | undefined;}diff --git a/packages/eve/src/harness/approval-delivery-coordinator.ts b/packages/eve/src/harness/approval-delivery-coordinator.tsindex 4173e074a..33d56b839 100644--- a/packages/eve/src/harness/approval-delivery-coordinator.ts+++ b/packages/eve/src/harness/approval-delivery-coordinator.ts@@ -34,7 +34,7 @@ const UNAUTHENTICATED_APPROVAL_FEEDBACK = "Authentication is required to respondconst APPROVAL_AUTHORIZER_TIMEOUT_MS = 10_000;const APPROVAL_CANDIDATE_TTL_MS = 10 * 60_000;-export interface ApprovalDeliveryResult {+interface ApprovalDeliveryResult {readonly challenges: readonly AuthorizationChallenge[];readonly feedback: readonly string[];readonly kind:diff --git a/packages/eve/src/harness/attachment-staging.integration.test.ts b/packages/eve/src/harness/attachment-staging.integration.test.tsindex 49075cee0..369a32144 100644--- a/packages/eve/src/harness/attachment-staging.integration.test.ts+++ b/packages/eve/src/harness/attachment-staging.integration.test.ts@@ -12,6 +12,7 @@ import {hydrateSandboxAttachments,stageAttachmentsToSandbox,} from "#harness/attachment-staging.js";+import { captureLogRecords } from "#internal/testing/log-records.js";/*** Integration coverage for {@link stageAttachmentsToSandbox}.@@ -249,6 +250,7 @@ describe("stageAttachmentsToSandbox (integration)", () => {});it("degrades plain resolver errors to a channel-neutral safe note", async () => {+ const logs = captureLogRecords();const upstream = new Error("boom https://secret.example/file?token=private");const adapter: ChannelAdapter<any> = {async fetchFile() {@@ -280,9 +282,16 @@ describe("stageAttachmentsToSandbox (integration)", () => {]);expect(staged[0]).not.toHaveProperty("text", expect.stringContaining("secret.example"));expect(sandbox.writes).toHaveLength(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "attachment resolver failed — degrading to text part",+ }),+ );});it("exposes a channel-authored safe resolver error to the model", async () => {+ const logs = captureLogRecords();const resolverError = new EveAttachmentError({adapterKind: "custom-channel",kind: "resolver-threw",@@ -317,9 +326,16 @@ describe("stageAttachmentsToSandbox (integration)", () => {},]);expect(sandbox.writes).toHaveLength(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "attachment resolver failed — degrading to text part",+ }),+ );});it("stages sibling attachments when one resolver call fails", async () => {+ const logs = captureLogRecords();const adapter: ChannelAdapter<any> = {async fetchFile(url) {if (url.endsWith("missing.bin")) {@@ -361,6 +377,12 @@ describe("stageAttachmentsToSandbox (integration)", () => {});expect((staged[1] as FilePart).filename).toMatch(/\/available\.bin$/);expect(sandbox.writes).toHaveLength(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "attachment resolver failed — degrading to text part",+ }),+ );});it("works alongside non-file parts in the same user message", async () => {@@ -620,6 +642,7 @@ describe("hydrateSandboxAttachments (integration)", () => {});it("degrades to a text reference when an inlinable sandbox ref points at a missing file", async () => {+ const logs = captureLogRecords();// Resuming a durable session whose staging sandbox was torn down// leaves historical attachment refs pointing at bytes that are gone.// Hydration must not fail the whole turn over it — it degrades to a@@ -662,9 +685,16 @@ describe("hydrateSandboxAttachments (integration)", () => {});const fileParts = hydratedContent.filter((p) => (p as FilePart).type === "file");expect(fileParts).toHaveLength(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "sandbox-ref attachment bytes missing on hydration — degrading to text reference",+ }),+ );});it("survives a resume after the staging sandbox was torn down (#276)", async () => {+ const logs = captureLogRecords();// Stage an image into one sandbox, then hydrate the resulting// ref-only message against a fresh sandbox — the same shape as// resuming a durable session whose ephemeral sandbox is gone. The@@ -695,6 +725,12 @@ describe("hydrateSandboxAttachments (integration)", () => {type: "text",});expect(hydratedContent.filter((p) => (p as FilePart).type === "file")).toHaveLength(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "sandbox-ref attachment bytes missing on hydration — degrading to text reference",+ }),+ );});it("does not touch the sandbox when every ref is non-inlinable — text references carry all the info", async () => {diff --git a/packages/eve/src/harness/compaction-prompt.ts b/packages/eve/src/harness/compaction-prompt.tsindex 3965a98ae..1bd0339ef 100644--- a/packages/eve/src/harness/compaction-prompt.ts+++ b/packages/eve/src/harness/compaction-prompt.ts@@ -33,7 +33,7 @@ interface CompactionTranscriptEntry {readonly role: ModelMessage["role"];}-export interface CompactionPrompt {+interface CompactionPrompt {readonly prompt: string;readonly system: string;}diff --git a/packages/eve/src/harness/coordination.ts b/packages/eve/src/harness/coordination.tsindex 5cde5662e..9c5a69d0b 100644--- a/packages/eve/src/harness/coordination.ts+++ b/packages/eve/src/harness/coordination.ts@@ -114,13 +114,6 @@ export function getPendingCoordinationBatch(return batch;}-/**- * Returns true when the session is parked on pending task/control coordination.- */-export function hasPendingCoordinationBatch(state: SessionStateMap | undefined): boolean {- return getPendingCoordinationBatch(state) !== undefined;-}-export function clearPendingCoordinationBatch(session: HarnessSession): HarnessSession {if (session.state?.[PENDING_COORDINATION_BATCH_KEY] === undefined) {return session;diff --git a/packages/eve/src/harness/input-requests.test.ts b/packages/eve/src/harness/input-requests.test.tsindex 2116037c2..9e552de97 100644--- a/packages/eve/src/harness/input-requests.test.ts+++ b/packages/eve/src/harness/input-requests.test.ts@@ -9,16 +9,16 @@ import type { HarnessToolDefinition } from "#harness/execute-tool.js";import {clearPendingSessionLimitPrompt,consumeDeferredStepInput,- createRuntimeToolCallActionFromToolCall,getApprovedTools,getPendingInputRequestIds,- hasDeferredStepInput,hasPendingInputBatch,hasStepInput,resolvePendingInput,appendPendingInputBatch,} from "#harness/input-requests.js";+import { getDeferredStepInput } from "#harness/pending-input-batches.js";import { createSessionLimitContinuationRequest } from "#harness/session-limit-continuation.js";+import { createRuntimeToolCallActionFromToolCall } from "#harness/tool-call-action.js";import { buildToolApproval, buildToolSet } from "#harness/tools.js";import type { HarnessSession, HarnessToolMap } from "#harness/types.js";@@ -176,7 +176,7 @@ describe("resolvePendingInput", () => {// The follow-up message should be deferred.expect(result.deferredMessage).toBe(true);- expect(hasDeferredStepInput(result.session)).toBe(true);+ expect(getDeferredStepInput(result.session)).toBeDefined();const deferred = consumeDeferredStepInput({session: result.session,@@ -185,7 +185,7 @@ describe("resolvePendingInput", () => {expect(deferred.input).toEqual({message: "Ignore that and say hi instead.",});- expect(hasDeferredStepInput(deferred.session)).toBe(false);+ expect(getDeferredStepInput(deferred.session)).toBeUndefined();});it("defers channel context until after tool approvals are resolved", () => {@@ -241,11 +241,11 @@ describe("resolvePendingInput", () => {expect(result.outcome).toBe("resolved");expect(result.messages.at(-1)?.role).toBe("tool");- expect(hasDeferredStepInput(result.session)).toBe(true);+ expect(getDeferredStepInput(result.session)).toBeDefined();const deferred = consumeDeferredStepInput({ session: result.session });expect(deferred.input).toEqual({ context: [context] });- expect(hasDeferredStepInput(deferred.session)).toBe(false);+ expect(getDeferredStepInput(deferred.session)).toBeUndefined();});it("resolves approval when follow-up text matches an option", () => {@@ -310,7 +310,7 @@ describe("resolvePendingInput", () => {role: "tool",});expect(getApprovedTools(result.session).has("bash")).toBe(true);- expect(hasDeferredStepInput(result.session)).toBe(false);+ expect(getDeferredStepInput(result.session)).toBeUndefined();});it("records compound approval key when resolveApprovalKey is provided", () => {@@ -652,7 +652,7 @@ describe("resolvePendingInput", () => {expect(result.outcome).toBe("continue");expect(result.rejectedActions).toBeUndefined();expect(result.messages).toEqual([{ content: "previous", kind: "user", role: "user" }]);- expect(hasDeferredStepInput(result.session)).toBe(false);+ expect(getDeferredStepInput(result.session)).toBeUndefined();expect(getPendingInputRequestIds(result.session.state)).toEqual(new Set(["approval-1"]));});@@ -1061,7 +1061,7 @@ describe("pending input batch collection", () => {expect(result.outcome).toBe("continue");expect(result.messages).toEqual([{ content: "previous", kind: "user", role: "user" }]);- expect(hasDeferredStepInput(result.session)).toBe(false);+ expect(getDeferredStepInput(result.session)).toBeUndefined();expect(getPendingInputRequestIds(result.session.state)).toEqual(new Set(["approval-1", "approval-2"]),);@@ -1180,7 +1180,7 @@ describe("resolvePendingInput with a session-limit continuation batch", () => {expect(result.outcome).toBe("unresolved");expect(result.limitContinuation).toBeUndefined();expect(result.messages).toEqual([{ content: "previous", kind: "user", role: "user" }]);- expect(hasDeferredStepInput(result.session)).toBe(true);+ expect(getDeferredStepInput(result.session)).toBeDefined();const deferred = consumeDeferredStepInput({ session: result.session });expect(deferred.input).toEqual({ message: "also do this other thing" });@@ -1209,7 +1209,7 @@ describe("resolvePendingInput with a session-limit continuation batch", () => {expect(result.limitContinuation).toEqual({ granted: true });expect(result.consumedMessage).toBe(true);expect(getPendingInputRequestIds(result.session.state)).toEqual(new Set(["approval-1"]));- expect(hasDeferredStepInput(result.session)).toBe(false);+ expect(getDeferredStepInput(result.session)).toBeUndefined();});it("defers an approval response while the limit batch remains open", () => {@@ -1264,7 +1264,7 @@ describe("clearPendingSessionLimitPrompt", () => {// No stale batch left: the follow-up message flows to the step (where// the pre-model gate re-raises the prompt) instead of deferring forever.expect(result.outcome).toBe("continue");- expect(hasDeferredStepInput(cleared)).toBe(false);+ expect(getDeferredStepInput(cleared)).toBeUndefined();});it("keeps model-anchored batches (tool approvals) intact", () => {@@ -1299,7 +1299,7 @@ describe("clearPendingSessionLimitPrompt", () => {// answerable; the follow-up message continues as an ordinary turn.expect(getPendingInputRequestIds(result.session.state)).toEqual(new Set(["approval-1"]));expect(result.outcome).toBe("continue");- expect(hasDeferredStepInput(result.session)).toBe(false);+ expect(getDeferredStepInput(result.session)).toBeUndefined();});it("is a no-op without a pending batch", () => {diff --git a/packages/eve/src/harness/input-requests.ts b/packages/eve/src/harness/input-requests.tsindex c8d32ba34..17b9621a4 100644--- a/packages/eve/src/harness/input-requests.ts+++ b/packages/eve/src/harness/input-requests.ts@@ -1,6 +1,5 @@import type { ModelMessage } from "ai";-import type { RuntimeToolCallActionRequest } from "#shared/action-types.js";import type { InputRequest, InputResponse } from "#shared/input.js";import { resolveTextToResponses } from "#channel/resolve-text.js";import { hasTailApprovalResponse } from "#harness/current-messages.js";@@ -22,7 +21,6 @@ import type {ResolvePendingInputResult,ResolvedStepInput,} from "#harness/hitl/pending-input-resolution.js";-import { resolveToolCallInputObject } from "#harness/coordination.js";import {clearPendingSessionLimitPrompt,isSessionLimitInputBatch,@@ -38,7 +36,6 @@ export {appendPendingInputBatch,consumeDeferredStepInput,getPendingInputRequestIds,- hasDeferredStepInput,hasPendingInputBatch,} from "#harness/pending-input-batches.js";@@ -255,22 +252,3 @@ function resolveTextMessageInput(message: undefined,});}--/** Creates a runtime tool-call action shape from an AI SDK tool call. */-export function createRuntimeToolCallActionFromToolCall(input: {- readonly toolCall: {- readonly input: unknown;- readonly toolCallId: string;- readonly toolName: string;- };-}): RuntimeToolCallActionRequest {- return {- callId: input.toolCall.toolCallId,- input: resolveToolCallInputObject(input.toolCall.input, {- callId: input.toolCall.toolCallId,- toolName: input.toolCall.toolName,- }),- kind: "tool-call",- toolName: input.toolCall.toolName,- };-}diff --git a/packages/eve/src/harness/issue-3494-adversarial.integration.test.ts b/packages/eve/src/harness/issue-3494-adversarial.integration.test.tsindex 1ebce4c6d..d840b6e8a 100644--- a/packages/eve/src/harness/issue-3494-adversarial.integration.test.ts+++ b/packages/eve/src/harness/issue-3494-adversarial.integration.test.ts@@ -24,6 +24,11 @@ import { bindDynamicConnections } from "#execution/dynamic-connections.js";import { ConnectionRegistryKey } from "#context/providers/connection-key.js";import { ConnectionRegistryImpl } from "#runtime/connections/registry.js";import { createTurnStartedEvent } from "#protocol/message.js";+import { captureLogRecords } from "#internal/testing/log-records.js";++// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));// Diagnostic probes assert desired outcomes. Pending state is created by the// real harness and SDK; only provider output and runtime result delivery are scripted.@@ -290,6 +295,7 @@ for (const variant of ["response-authorized",] as const) {it(`finishes unrelated ${variant} tool turn while an approval stays open`, async () => {+ const logs = captureLogRecords();const f = fixture(variant, variant === "response-authorized");await f.gate("gateA");f.script.push(@@ -313,6 +319,9 @@ for (const variant of [}[variant];expect([...f.executions].sort()).toEqual(expectedExecutions.sort());expect(result.settledTurn?.output).toBe("FINAL");+ expect(+ logs.records.filter((record) => record.message === "tool execution failed"),+ ).toHaveLength(variant === "fail" ? 1 : 0);});}@@ -425,6 +434,7 @@ it("reaches the next budget prompt after a grant while an earlier approval remaifor (const variant of ["fail", "invalid"]) {it(`recovers from ${variant} without pending input [control]`, async () => {+ const logs = captureLogRecords();const f = fixture(`control-${variant}`);f.script.push(variant === "invalid" ? [{ toolName: "read", input: { n: "invalid" } }] : calls("fail"),@@ -432,6 +442,9 @@ for (const variant of ["fail", "invalid"]) {);expect((await f.drive({ message: "Try the tool." })).settledTurn?.output).toBe("FINAL");if (variant === "invalid") expect(f.executions).toHaveLength(0);+ expect(+ logs.records.filter((record) => record.message === "tool execution failed"),+ ).toHaveLength(variant === "fail" ? 1 : 0);});}diff --git a/packages/eve/src/harness/issue-3494-diagnosis.integration.test.ts b/packages/eve/src/harness/issue-3494-diagnosis.integration.test.tsindex e50b98fa6..43d98ba7f 100644--- a/packages/eve/src/harness/issue-3494-diagnosis.integration.test.ts+++ b/packages/eve/src/harness/issue-3494-diagnosis.integration.test.ts@@ -18,6 +18,10 @@ import type { HarnessSession, StepInput, ToolLoopHarnessConfig } from "#harness/import type { UnstampedMessageStreamEvent } from "#protocol/message.js";import { always } from "#tools/approval/policies.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+it("continues the second step past an older approval batch", async () => {const events: UnstampedMessageStreamEvent[] = [];const gate = vi.fn(async () => ({ changed: true }));diff --git a/packages/eve/src/harness/pending-input-batches.ts b/packages/eve/src/harness/pending-input-batches.tsindex 16cfeaf91..1bbdb122b 100644--- a/packages/eve/src/harness/pending-input-batches.ts+++ b/packages/eve/src/harness/pending-input-batches.ts@@ -234,14 +234,6 @@ export function consumeDeferredStepInput(input: {};}-/**- * Returns true when the session carries queued follow-up input for the next- * internal harness step.- */-export function hasDeferredStepInput(session: HarnessSession): boolean {- return getDeferredStepInput(session) !== undefined;-}-export function getDeferredStepInput(session: HarnessSession): StepInput | undefined {return session.state?.[DEFERRED_STEP_INPUT_KEY] as StepInput | undefined;}diff --git a/packages/eve/src/harness/provider-tools.ts b/packages/eve/src/harness/provider-tools.tsindex ee132affd..6983b5faa 100644--- a/packages/eve/src/harness/provider-tools.ts+++ b/packages/eve/src/harness/provider-tools.ts@@ -15,7 +15,7 @@ import type { WebSearchProvider } from "#shared/web-search.js";/*** The provider backend resolved for one web search tool invocation.*/-export type WebSearchBackend = "anthropic" | "exa" | "google" | "openai" | "parallel";+type WebSearchBackend = "anthropic" | "exa" | "google" | "openai" | "parallel";/*** Maps an upstream provider tool type (the literal `type` string the AI SDKdiff --git a/packages/eve/src/harness/session-limit-continuation.ts b/packages/eve/src/harness/session-limit-continuation.tsindex 69182a83c..8a786d5ae 100644--- a/packages/eve/src/harness/session-limit-continuation.ts+++ b/packages/eve/src/harness/session-limit-continuation.ts@@ -12,10 +12,10 @@ import type { JsonObject } from "#shared/json.js";import type { SessionUsageLimitViolation } from "#harness/turn-tag-state.js";/** Synthetic action tool name carried by session-limit continuation requests. */-export const SESSION_LIMIT_CONTINUATION_TOOL_NAME = "session_limit_continuation";+const SESSION_LIMIT_CONTINUATION_TOOL_NAME = "session_limit_continuation";/** Option id that grants a fresh token budget window. */-export const SESSION_LIMIT_CONTINUE_OPTION_ID = "continue";+const SESSION_LIMIT_CONTINUE_OPTION_ID = "continue";/** Option id that declines continuation and ends the session. */export const SESSION_LIMIT_STOP_OPTION_ID = "stop";diff --git a/packages/eve/src/harness/session-usage-limits.ts b/packages/eve/src/harness/session-usage-limits.tsindex 31dbdb25d..23861b723 100644--- a/packages/eve/src/harness/session-usage-limits.ts+++ b/packages/eve/src/harness/session-usage-limits.ts@@ -1,4 +1,4 @@-export interface SessionUsageAmounts {+interface SessionUsageAmounts {readonly costUsd?: number;readonly inputTokens: number;readonly outputTokens: number;diff --git a/packages/eve/src/harness/tool-input-validation.integration.test.ts b/packages/eve/src/harness/tool-input-validation.integration.test.tsindex 9eb433ad4..969976469 100644--- a/packages/eve/src/harness/tool-input-validation.integration.test.ts+++ b/packages/eve/src/harness/tool-input-validation.integration.test.ts@@ -1,10 +1,14 @@import type { LanguageModel, ModelMessage } from "ai";import { MockLanguageModelV4 } from "ai/test";-import { describe, expect, it } from "vitest";+import { describe, expect, it, vi } from "vitest";import { createToolLoopHarness } from "#harness/tool-loop.js";import type { HarnessSession, ToolLoopHarnessConfig } from "#harness/types.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+const usage = {inputTokens: {cacheRead: undefined,diff --git a/packages/eve/src/harness/tool-loop-cancellation.integration.test.ts b/packages/eve/src/harness/tool-loop-cancellation.integration.test.tsindex 8cdd88dfc..6a86cc2ff 100644--- a/packages/eve/src/harness/tool-loop-cancellation.integration.test.ts+++ b/packages/eve/src/harness/tool-loop-cancellation.integration.test.ts@@ -7,6 +7,11 @@ import { createToolLoopHarness } from "#harness/tool-loop.js";import { TurnCancelledError } from "#harness/turn-cancellation.js";import type { HarnessEmitFn, HarnessSession, ToolLoopHarnessConfig } from "#harness/types.js";import type { ToolExecuteOptions } from "#tools/definition.js";+import { captureLogRecords } from "#internal/testing/log-records.js";++// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));type StreamResult = Awaited<ReturnType<MockLanguageModelV3["doStream"]>>;type StreamPart = StreamResult["stream"] extends ReadableStream<infer Part> ? Part : never;@@ -92,6 +97,7 @@ describe("tool loop cancellation (real AI SDK)", () => {});it("forwards a live signal to executing tools and discards the straggler result", async () => {+ const logs = captureLogRecords();const abortController = new AbortController();const cancellation = new TurnCancelledError();@@ -181,6 +187,9 @@ describe("tool loop cancellation (real AI SDK)", () => {for (const failureType of FAILURE_EVENT_TYPES) {expect(eventTypes).not.toContain(failureType);}+ expect(logs.records).not.toContainEqual(+ expect.objectContaining({ message: "tool execution failed" }),+ );});it("leaves behavior unchanged when the signal never aborts", async () => {diff --git a/packages/eve/src/harness/tool-loop-compaction-accounting.test.ts b/packages/eve/src/harness/tool-loop-compaction-accounting.test.tsindex b8332e7c5..83abc37a9 100644--- a/packages/eve/src/harness/tool-loop-compaction-accounting.test.ts+++ b/packages/eve/src/harness/tool-loop-compaction-accounting.test.ts@@ -13,6 +13,10 @@ import {validateMemoryRecallResult,} from "#shared/memory-state.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+vi.mock("ai", () => ({generateText: vi.fn(),ToolLoopAgent: vi.fn(),diff --git a/packages/eve/src/harness/tool-loop-content-filter.integration.test.ts b/packages/eve/src/harness/tool-loop-content-filter.integration.test.tsindex c1acc089f..d62bb6a84 100644--- a/packages/eve/src/harness/tool-loop-content-filter.integration.test.ts+++ b/packages/eve/src/harness/tool-loop-content-filter.integration.test.ts@@ -5,6 +5,7 @@ import { describe, expect, it } from "vitest";import { createToolLoopHarness } from "#harness/tool-loop.js";import type { HarnessSession } from "#harness/types.js";import type { UnstampedMessageStreamEvent } from "#protocol/message.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const usage = {inputTokens: { total: 10, noCache: 10, cacheRead: undefined, cacheWrite: undefined },@@ -29,6 +30,7 @@ describe("content-filter reporting (real AI SDK)", () => {it.each(["", "Alice's inventory list is"])("reports a filtered stream without retry or successful delivery: %j",async (text) => {+ const logs = captureLogRecords();let calls = 0;const model = new MockLanguageModelV4({doStream: async () => {@@ -74,6 +76,12 @@ describe("content-filter reporting (real AI SDK)", () => {),).toBe(false);expect(events.some((event) => event.type === "session.waiting")).toBe(true);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );},);diff --git a/packages/eve/src/harness/tool-loop-generate-approval-resume.integration.test.ts b/packages/eve/src/harness/tool-loop-generate-approval-resume.integration.test.tsindex dbe67d499..c381993e7 100644--- a/packages/eve/src/harness/tool-loop-generate-approval-resume.integration.test.ts+++ b/packages/eve/src/harness/tool-loop-generate-approval-resume.integration.test.ts@@ -36,6 +36,10 @@ import {stampDurableDynamicCallback,} from "#tools/durable-callbacks.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+const usage = {inputTokens: {cacheRead: undefined,diff --git a/packages/eve/src/harness/tool-loop-request-envelope.integration.test.ts b/packages/eve/src/harness/tool-loop-request-envelope.integration.test.tsindex 704ad1d3d..86ec399e2 100644--- a/packages/eve/src/harness/tool-loop-request-envelope.integration.test.ts+++ b/packages/eve/src/harness/tool-loop-request-envelope.integration.test.ts@@ -1,6 +1,6 @@import { getRequestEnvelopeTokens } from "#harness/request-envelope.js";import type { LanguageModel } from "ai";-import { describe, expect, it } from "vitest";+import { describe, expect, it, vi } from "vitest";import { ContextContainer, contextStorage } from "#context/container.js";import { PendingSkillAnnouncementKey } from "#context/dynamic-skill-lifecycle.js";@@ -8,6 +8,11 @@ import { SessionDynamicInstructionsKey } from "#context/keys.js";import { mockModel, type MockModelRequest } from "#evals/mock-model.js";import { createToolLoopHarness } from "#harness/tool-loop.js";import type { HarnessSession } from "#harness/types.js";+import { captureLogRecords } from "#internal/testing/log-records.js";++// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));function session(): HarnessSession {return {@@ -107,6 +112,7 @@ describe("model request envelope accounting", () => {});it("rechecks instructions added before an empty-response retry", async () => {+ const logs = captureLogRecords();const ctx = new ContextContainer();const requests: MockModelRequest[] = [];let summaries = 0;@@ -155,5 +161,11 @@ describe("model request envelope accounting", () => {role: "assistant",content: expect.any(Array),});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "empty model response; reissuing the model call once",+ }),+ );});});diff --git a/packages/eve/src/harness/tool-loop-steering.integration.test.ts b/packages/eve/src/harness/tool-loop-steering.integration.test.tsindex a12e71979..ac6592765 100644--- a/packages/eve/src/harness/tool-loop-steering.integration.test.ts+++ b/packages/eve/src/harness/tool-loop-steering.integration.test.ts@@ -9,6 +9,11 @@ import type { UnstampedMessageStreamEvent } from "#protocol/message.js";import { always } from "#tools/approval/policies.js";import { ContextContainer, contextStorage } from "#context/container.js";import { SessionKey } from "#context/keys.js";+import { captureLogRecords } from "#internal/testing/log-records.js";++// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));type StreamResult = Awaited<ReturnType<MockLanguageModelV3["doStream"]>>;type Part = StreamResult["stream"] extends ReadableStream<infer T> ? T : never;@@ -42,6 +47,7 @@ describe("generation steering with the real AI SDK", () => {const warning = vi.spyOn(console, "warn").mockImplementation((message) => {if (String(message).includes("retrying")) retrying.resolve();});+ const streamError = vi.spyOn(console, "error").mockImplementation(() => {});const steering = new AbortController();const cancellation = new AbortController();const doStream = vi.fn<MockLanguageModelV3["doStream"]>(async () => ({@@ -69,8 +75,13 @@ describe("generation steering with the real AI SDK", () => {if (kind === "cancel") await expect(running).rejects.toBeInstanceOf(TurnCancelledError);else expect((await running).steered).toBe(true);expect(doStream).toHaveBeenCalledOnce();+ expect(streamError).toHaveBeenCalledWith(+ "[eve:harness.tool-loop] tool-loop stream error",+ expect.anything(),+ );} finally {warning.mockRestore();+ streamError.mockRestore();vi.useRealTimers();}});@@ -78,6 +89,7 @@ describe("generation steering with the real AI SDK", () => {it.each(["input.requested", "turn.completed", "step.failed"] as const)("finishes committing %s when a correction arrives during publication",async (boundary) => {+ const logs = captureLogRecords();const steering = new AbortController();const events: UnstampedMessageStreamEvent[] = [];const model = new MockLanguageModelV3({@@ -138,6 +150,10 @@ describe("generation steering with the real AI SDK", () => {expect(events.filter((event) => event.type === boundary)).toHaveLength(1);expect(events.filter((event) => event.type === "session.waiting")).toHaveLength(1);expect(events.filter((event) => event.type === "message.appended")).toHaveLength(0);+ const parked = logs.records.filter(+ (record) => record.message === "model call failed — parking session for retry by the user",+ );+ expect(parked).toHaveLength(boundary === "step.failed" ? 1 : 0);},);diff --git a/packages/eve/src/harness/tool-loop.test.ts b/packages/eve/src/harness/tool-loop.test.tsindex f5b97356d..65160dd4a 100644--- a/packages/eve/src/harness/tool-loop.test.ts+++ b/packages/eve/src/harness/tool-loop.test.ts@@ -75,10 +75,10 @@ import {} from "#harness/authorization.js";import {getPendingInputRequestIds,- hasDeferredStepInput,hasPendingInputBatch,appendPendingInputBatch,} from "#harness/input-requests.js";+import { getDeferredStepInput } from "#harness/pending-input-batches.js";import { activeTurnId } from "#harness/active-turn-id.js";import { registerWorkflowToolRun } from "#harness/workflow-tool-runs.js";import { getPendingCoordinationBatch } from "#harness/coordination.js";@@ -113,6 +113,11 @@ import {TASK_DELIVERY_INITIATING_INSTRUCTION,TASK_DELIVERY_SETTLED_INSTRUCTION,} from "#tasks/delivery-context.js";+import { captureLogRecords } from "#internal/testing/log-records.js";++// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));vi.mock("ai", () => ({ToolLoopAgent: vi.fn(),@@ -1695,6 +1700,7 @@ describe("createToolLoopHarness", () => {});it("emits a terminal failure when no dynamic model selection is active", async () => {+ const logs = captureLogRecords();const { emit, events } = createEventCollector();const runStep = createToolLoopHarness(createTestConfig(emit));const session = createTestSession({@@ -1721,9 +1727,13 @@ describe("createToolLoopHarness", () => {const turnFailed = events.find((event) => event.type === "turn.failed");expect(turnFailed?.data.message).toContain("Dynamic model selection is required");expect(ToolLoopAgent).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "model selection failed terminally" }),+ );});it("emits a terminal failure when a turn-scoped dynamic model resolver throws", async () => {+ const logs = captureLogRecords();const events: UnstampedMessageStreamEvent[] = [];const emit: HarnessEmitFn = async (event) => {events.push(event);@@ -1748,6 +1758,9 @@ describe("createToolLoopHarness", () => {const turnFailed = events.find((event) => event.type === "turn.failed");expect(turnFailed?.data.message).toBe("flag service unavailable");expect(ToolLoopAgent).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "model selection failed terminally" }),+ );});it("keeps declared subagent tools visible in delegated sessions", async () => {@@ -3422,6 +3435,7 @@ describe("createToolLoopHarness", () => {it.each(["", "Alice's inventory list is"])("reports content-filter without retrying (text: %j)",async (text) => {+ const logs = captureLogRecords();setupMockAgent({finishReason: "content-filter",providerMetadata: {@@ -3462,6 +3476,12 @@ describe("createToolLoopHarness", () => {);expect(result.next).toBeNull();expect(events.some((event) => event.type === "session.waiting")).toBe(true);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );},);@@ -4285,6 +4305,7 @@ describe("createToolLoopHarness", () => {});it("retries a model call after an undici body timeout", async () => {+ const logs = captureLogRecords();vi.useFakeTimers();const timeout = new TypeError("terminated", {cause: Object.assign(new Error("Body Timeout Error"), {@@ -4341,6 +4362,12 @@ describe("createToolLoopHarness", () => {} finally {vi.useRealTimers();}+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "model call failed transiently — retrying",+ }),+ );});it("feeds malformed provider web search input back to the model", async () => {@@ -4487,6 +4514,7 @@ describe("createToolLoopHarness", () => {});it("emits a recoverable failure cascade and parks the session on a non-terminal model-call error", async () => {+ const logs = captureLogRecords();setupMockAgentError(new Error("Model blew up"));const { emit, events } = createEventCollector();@@ -4520,6 +4548,12 @@ describe("createToolLoopHarness", () => {message: "Model blew up",});expect((stepFailed!.data as { details?: { errorId?: string } }).details?.errorId).toBeDefined();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );});it.each([@@ -4538,6 +4572,7 @@ describe("createToolLoopHarness", () => {])("parks the session for the recoverable AI Gateway error: $message",async ({ message, hint }) => {+ const logs = captureLogRecords();setupMockAgentError(Object.assign(new Error(message), {name: "GatewayInvalidRequestError",@@ -4558,10 +4593,17 @@ describe("createToolLoopHarness", () => {});expect(events.map((event) => event.type)).toContain("session.waiting");expect(events.map((event) => event.type)).not.toContain("session.failed");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );},);it("parks the session on an ambiguous GatewayInternalServerError 400 model-call error", async () => {+ const logs = captureLogRecords();setupMockAgentError(createGatewayModelCallError({gatewayName: "GatewayInternalServerError",@@ -4602,9 +4644,16 @@ describe("createToolLoopHarness", () => {expect(JSON.stringify((stepFailed!.data as { details?: unknown }).details)).not.toContain("large schema",);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "AI Gateway rejected the model request before the agent produced a response.",+ }),+ );});it("emits the full terminal failure cascade on a structural 4xx model-call error", async () => {+ const logs = captureLogRecords();// 400/401/403/404 responses are classified as terminal — the// session is torn down because retrying would hit the same wall.const error = Object.assign(new Error("invalid api key"), {@@ -4625,9 +4674,13 @@ describe("createToolLoopHarness", () => {expect(types).toContain("turn.failed");expect(types).toContain("session.failed");expect(types).not.toContain("session.waiting");+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "invalid api key" }),+ );});it("surfaces a terminal model-call error to a delegated conversation caller", async () => {+ const logs = captureLogRecords();const error = Object.assign(new Error("No endpoints found for anthropic/claude-3.5-haiku"), {name: "AI_APICallError",statusCode: 404,@@ -4653,9 +4706,16 @@ describe("createToolLoopHarness", () => {expect(types).toContain("step.failed");expect(types).toContain("turn.failed");expect(types).toContain("session.failed");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "No endpoints found for anthropic/claude-3.5-haiku",+ }),+ );});it("emits the full terminal failure cascade on an explicit Gateway invalid-request error", async () => {+ const logs = captureLogRecords();setupMockAgentError(createGatewayModelCallError({gatewayName: "GatewayInvalidRequestError",@@ -4690,6 +4750,12 @@ describe("createToolLoopHarness", () => {expect(JSON.stringify((stepFailed!.data as { details?: unknown }).details)).not.toContain("large schema",);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "AI Gateway rejected the model request before the agent produced a response.",+ }),+ );});describe("unsupported provider tool recovery", () => {@@ -5066,6 +5132,7 @@ describe("createToolLoopHarness", () => {});it("retries with the offending tool dropped and a one-shot system note", async () => {+ const logs = captureLogRecords();const resolveRuntimeContext = vi.fn((input: InstrumentationStepStartedEventInput) => ({"test.attempt": typeof input.modelInput.instructions === "string" ? "original" : "retry",}));@@ -5167,9 +5234,16 @@ describe("createToolLoopHarness", () => {expect(resolveRuntimeContext.mock.calls[1]?.[0].modelInput.instructions).toEqual(retryInstructions,);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "disabling unsupported provider tool(s); retrying step once",+ }),+ );});it("falls through to terminal cascade when recovery retry also fails", async () => {+ const logs = captureLogRecords();// Both attempts fail with the same unsupported-tool error. The// existing terminal/recoverable handling runs on the second// failure so the session is torn down.@@ -5213,9 +5287,22 @@ describe("createToolLoopHarness", () => {expect(types).toContain("step.failed");expect(types).toContain("turn.failed");expect(types).toContain("session.failed");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "disabling unsupported provider tool(s); retrying step once",+ }),+ );+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "AI Gateway rejected the model request before the agent produced a response.",+ }),+ );});it("does not retry when the error is unrelated to unsupported provider tools", async () => {+ const logs = captureLogRecords();setupMockAgentError(new Error("Model blew up"));const { emit, events } = createEventCollector();@@ -5229,6 +5316,12 @@ describe("createToolLoopHarness", () => {// The unrelated error still flows through the recoverable cascade// (plain Error defaults to recoverable classification).expect(types).toContain("session.waiting");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );});});@@ -8156,7 +8249,7 @@ describe("createToolLoopHarness", () => {expect(pendingApprovalInstructions(callIndex)).toContain("bash");expect(pendingApprovalInstructions(callIndex)).not.toContain("rm -rf /tmp/demo");expect(followup.session.history.filter(isPendingApprovalProjection)).toHaveLength(1);- expect(hasDeferredStepInput(followup.session)).toBe(false);+ expect(getDeferredStepInput(followup.session)).toBeUndefined();expect(hasPendingInputBatch(followup.session.state)).toBe(true);pendingSession = followup.session;}@@ -8434,7 +8527,7 @@ describe("createToolLoopHarness", () => {const lastMessages = (generateCalls[0] ?? []).filter((message) => message.role === "user");expect(JSON.stringify(lastMessages)).toContain("Wedged hello.");expect(JSON.stringify(lastMessages)).toContain("Are you there?");- expect(hasDeferredStepInput(result.session)).toBe(false);+ expect(getDeferredStepInput(result.session)).toBeUndefined();expect(getPendingInputRequestIds(result.session.state)).toEqual(new Set(["approval-1"]));});@@ -9146,6 +9239,7 @@ describe("createToolLoopHarness", () => {});it("returns a failed manual compaction to its waiting boundary", async () => {+ const logs = captureLogRecords();vi.mocked(compactMessages).mockRejectedValueOnce(new Error("summary failed"));const { emit, events } = createEventCollector();@@ -9169,9 +9263,13 @@ describe("createToolLoopHarness", () => {expect(ctx.get(HistoryStateKey)).toEqual({ taskState: "old message" });expect(getCompatibilityEventTypes(events)).toEqual(["compaction.requested", "session.waiting"]);expect(ToolLoopAgent).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "manual session compaction failed" }),+ );});it("returns a failed manual model resolution to its waiting boundary", async () => {+ const logs = captureLogRecords();const { emit, events } = createEventCollector();const runStep = createToolLoopHarness(createTestConfig(emit, {@@ -9190,6 +9288,9 @@ describe("createToolLoopHarness", () => {expect(getCompatibilityEventTypes(events)).toEqual(["session.waiting"]);expect(compactMessages).not.toHaveBeenCalled();expect(ToolLoopAgent).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "manual session compaction failed" }),+ );});it("uses the authored compaction model when one is configured", async () => {@@ -11061,6 +11162,7 @@ describe("createToolLoopHarness", () => {});it("merges runtime context before emitting step.started", async () => {+ const logs = captureLogRecords();setupMockAgent({finishReason: "stop",response: { messages: [{ content: "Hello!", role: "assistant" }] },@@ -11152,9 +11254,16 @@ describe("createToolLoopHarness", () => {expect(order.indexOf("turn.started")).toBeLessThan(order.indexOf("runtimeContext"));expect(order.indexOf("step.started")).toBeLessThan(order.indexOf("runtimeContext"));expect(getCompatibilityEventTypes(events)).toContain("step.started");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring reserved instrumentation runtime context key",+ }),+ );});it("continues the normal turn flow when runtime context throws", async () => {+ const logs = captureLogRecords();setupMockAgent({finishReason: "stop",response: { messages: [{ content: "Hello!", role: "assistant" }] },@@ -11191,6 +11300,12 @@ describe("createToolLoopHarness", () => {expect(agentCall?.runtimeContext).toMatchObject({"eve.session.id": "test-session",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring instrumentation projection after projector failure",+ }),+ );});it("resolves runtime context for each step and turn coordinate", async () => {@@ -11716,6 +11831,7 @@ describe("createToolLoopHarness", () => {);it("does not advance history state when the model call fails", async () => {+ const logs = captureLogRecords();const ctx = new ContextContainer();ctx.set(PendingSkillAnnouncementKey, "Available skills\n- policy: Tenant policy");const { emit } = createEventCollector();@@ -11744,6 +11860,12 @@ describe("createToolLoopHarness", () => {expect(ctx.get(HistoryStateKey)).toEqual({availableSkills: "Available skills\n- policy: Tenant policy",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );});it("does not advance history state when recording the step result fails", async () => {@@ -11769,6 +11891,7 @@ describe("createToolLoopHarness", () => {});it("retains completed compaction when the next model call fails", async () => {+ const logs = captureLogRecords();const announcement = "Available skills\n- policy: Tenant policy";const ctx = new ContextContainer();ctx.set(PendingSkillAnnouncementKey, announcement);@@ -11817,6 +11940,12 @@ describe("createToolLoopHarness", () => {retried.session.history.filter((message) => message.content === announcement),).toHaveLength(1);expect(restoredContext.get(HistoryStateKey)).toEqual({ availableSkills: announcement });+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "model call failed — parking session for retry by the user",+ }),+ );});it.each(["clear", "manual compaction", "automatic compaction"])(@@ -12539,6 +12668,7 @@ describe("boundary event failures", () => {it.each(["turn.started", "step.started"] as const)("parks a failed %s and accepts the next turn",async (boundary) => {+ const logs = captureLogRecords();const events: UnstampedMessageStreamEvent[] = [];let denied = true;const emit: HarnessEmitFn = async (event) => {@@ -12585,10 +12715,17 @@ describe("boundary event failures", () => {{ data: { turnId: "turn_1", sequence: 1 } },]);expect(events.filter((event) => event.type === "session.started")).toHaveLength(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "turn boundary handler failed — parking session",+ }),+ );},);it("fails the current later step without invoking another model", async () => {+ const logs = captureLogRecords();const events: UnstampedMessageStreamEvent[] = [];const emit: HarnessEmitFn = async (event) => {events.push(event);@@ -12608,9 +12745,16 @@ describe("boundary event failures", () => {data: { stepIndex: 3, turnId: "turn_2" },});expect(ToolLoopAgent).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "turn boundary handler failed — parking session",+ }),+ );});it("lets a failed failure handler escalate", async () => {+ const logs = captureLogRecords();const emit: HarnessEmitFn = async (event) => {if (event.type === "turn.started") throw new BoundaryHookError(new Error("admission denied"));if (event.type === "turn.failed") throw new Error("failure handler failed");@@ -12620,6 +12764,12 @@ describe("boundary event failures", () => {message: "Hi",}),).rejects.toThrow("failure handler failed");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "turn boundary handler failed — parking session",+ }),+ );});it("keeps runtime preamble failures terminal", async () => {diff --git a/packages/eve/src/harness/tool-loop.ts b/packages/eve/src/harness/tool-loop.tsindex 25af5135e..99a3d4c1c 100644--- a/packages/eve/src/harness/tool-loop.ts+++ b/packages/eve/src/harness/tool-loop.ts@@ -270,7 +270,9 @@ function logToolExecutionError(event: {readonly toolCall: { readonly toolName: string; readonly toolCallId: string };readonly toolOutput: { readonly type: string; readonly error?: unknown };}): void {- if (event.toolOutput.type !== "tool-error") {+ // A tool unwinding because its turn was cancelled is the expected outcome+ // of a user action, not a failure worth an error log.+ if (event.toolOutput.type !== "tool-error" || isTurnCancellation(event.toolOutput.error)) {return;}logError(log, "tool execution failed", event.toolOutput.error, {diff --git a/packages/eve/src/harness/tool-model-output.ts b/packages/eve/src/harness/tool-model-output.tsindex 1a073d744..c7bd3dc2f 100644--- a/packages/eve/src/harness/tool-model-output.ts+++ b/packages/eve/src/harness/tool-model-output.ts@@ -12,7 +12,7 @@ import { withToolOutputSerializationError } from "#harness/tool-output-serializa* `json` values are proven JSON-serializable and `content` arrays are* mutable so the value is assignable to the SDK's `ToolResultOutput`.*/-export type ToolModelOutputValue =+type ToolModelOutputValue =| { readonly type: "json"; readonly value: JSONValue }| { readonly type: "text"; readonly value: string }| { readonly type: "content"; readonly value: ToolModelOutputPart[] };diff --git a/packages/eve/src/harness/turn-client-context.ts b/packages/eve/src/harness/turn-client-context.tsindex 185600ce7..23ea298bc 100644--- a/packages/eve/src/harness/turn-client-context.ts+++ b/packages/eve/src/harness/turn-client-context.ts@@ -2,7 +2,7 @@ import type { HarnessSession, SessionStateMap } from "#harness/types.js";const TURN_CLIENT_CONTEXT_STATE_KEY = "eve.harness.turnClientContext";-export interface TurnClientContextState {+interface TurnClientContextState {/** Position of ephemeral client context in each model request for this turn. */readonly insertionIndex: number;readonly messages: readonly string[];diff --git a/packages/eve/src/instrumentation/ai-sdk-hook-bridge.test.ts b/packages/eve/src/instrumentation/ai-sdk-hook-bridge.test.tsindex c63dc1bf8..c38207246 100644--- a/packages/eve/src/instrumentation/ai-sdk-hook-bridge.test.ts+++ b/packages/eve/src/instrumentation/ai-sdk-hook-bridge.test.ts@@ -14,6 +14,7 @@ import {type InstrumentationToolCallStartedEvent,type InstrumentationToolCallTerminalEvent,} from "#instrumentation/lifecycle.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const scope: InstrumentationAttemptScope = {attemptId: "turn-1:step-0:attempt-0",@@ -313,6 +314,7 @@ describe("createAiSdkHookBridge", () => {});it("isolates a failing provider from the remaining providers", async () => {+ const logs = captureLogRecords();const after = vi.fn();const hooks = createInstrumentationHooks([{@@ -347,6 +349,9 @@ describe("createAiSdkHookBridge", () => {]);expect(after).toHaveBeenCalledOnce();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "instrumentation provider failed" }),+ );});it("terminalizes started operations when the attempt errors", async () => {diff --git a/packages/eve/src/instrumentation/runtime-context.test.ts b/packages/eve/src/instrumentation/runtime-context.test.tsindex 98169d4e6..90b7755cb 100644--- a/packages/eve/src/instrumentation/runtime-context.test.ts+++ b/packages/eve/src/instrumentation/runtime-context.test.ts@@ -11,6 +11,7 @@ import {import type { RuntimeContextResolver } from "#tracing/otel-declaration.js";import type { HarnessSession } from "#harness/types.js";import type { InstrumentationStepStartedEventInput } from "#public/instrumentation/index.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const session: HarnessSession = {agent: {@@ -196,14 +197,22 @@ describe("buildTelemetryRuntimeContext", () => {});it("drops reserved eve.* keys from resolver results", () => {+ const logs = captureLogRecords();const resolver: RuntimeContextResolver = () =>({ "eve.session.id": "override", team: "platform" }) as never;const runtimeContext = build({ providerResolvers: [resolver] });expect(runtimeContext).toEqual({ ...FRAMEWORK_KEYS, team: "platform" });+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring reserved instrumentation runtime context key",+ }),+ );});it("continues when a resolver throws", () => {+ const logs = captureLogRecords();const failing: RuntimeContextResolver = () => {throw new Error("boom");};@@ -213,6 +222,12 @@ describe("buildTelemetryRuntimeContext", () => {});expect(runtimeContext).toEqual({ ...FRAMEWORK_KEYS, team: "platform" });+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring instrumentation projection after projector failure",+ }),+ );});it("returns undefined when no resolvers are configured", () => {diff --git a/packages/eve/src/instrumentation/runtime.test.ts b/packages/eve/src/instrumentation/runtime.test.tsindex cc3846793..b4ed3ddad 100644--- a/packages/eve/src/instrumentation/runtime.test.ts+++ b/packages/eve/src/instrumentation/runtime.test.ts@@ -30,6 +30,7 @@ import { ContextAgentTraceStateStore } from "#tracing/agent-trace-context-store.import type { TraceCapturePolicy } from "#tracing/otel-declaration.js";import { readForwardedAudienceBaggage, writeForwardedAudienceBaggage } from "#protocol/baggage.js";import { ConversationContextKey } from "#shared/conversation-context.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const boundSession = {agentName: "test-agent",@@ -110,7 +111,11 @@ function initializeRemoteSession(traceFlags: 1,traceId: "d".repeat(32),});+ const logs = captureLogRecords();initializeSessionInstrumentation({ agentName: "remote-agent", ctx });+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "info", message: "resolved forwarded trace policy" }),+ );return ctx;}@@ -223,6 +228,7 @@ describe("initializeSessionInstrumentation", () => {});it("redacts runtime-context model input when the forwarded ceiling denies inputs", async () => {+ const logs = captureLogRecords();const ctx = createContext("public");const runtime: InstrumentationRuntime = {...createRuntime({ capturesContent: true, publish: vi.fn() }, () => ({@@ -276,6 +282,13 @@ describe("initializeSessionInstrumentation", () => {);expect(messageCount).toBe(0);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "info",+ message: "resolved forwarded trace policy",+ fields: expect.objectContaining({ ceilingEffective: "i0o1", ceilingIn: "i0o1" }),+ }),+ );});it("narrows monotonically across a three-hop chain", () => {diff --git a/packages/eve/src/instrumentation/state.ts b/packages/eve/src/instrumentation/state.tsindex 3faea97ce..a5cb18d46 100644--- a/packages/eve/src/instrumentation/state.ts+++ b/packages/eve/src/instrumentation/state.ts@@ -77,7 +77,7 @@ export interface InstrumentationStateSlot {set(value: JsonValue | undefined): void;}-export interface InstrumentationStateLease extends InstrumentationStateSlot {+interface InstrumentationStateLease extends InstrumentationStateSlot {/** Makes later reads empty and writes no-ops. */revoke(): void;}@@ -231,7 +231,7 @@ export function takeInstrumentationInputScope(return scope;}-export interface InstrumentationActionCorrelation {+interface InstrumentationActionCorrelation {readonly idempotencyKey: string;readonly scope: InstrumentationAttemptScope;}diff --git a/packages/eve/src/internal/agent-name.ts b/packages/eve/src/internal/agent-name.tsindex d43726543..f0309a9e6 100644--- a/packages/eve/src/internal/agent-name.ts+++ b/packages/eve/src/internal/agent-name.ts@@ -1,7 +1,7 @@const PUBLIC_AGENT_NAME_PATTERN = /^[a-z0-9](?:[a-z0-9_-]*[a-z0-9])?$/;/** Whether a name is safe to expose as an eve public route segment. */-export function isValidPublicAgentName(name: string): boolean {+function isValidPublicAgentName(name: string): boolean {return PUBLIC_AGENT_NAME_PATTERN.test(name);}diff --git a/packages/eve/src/internal/application/build-profile.ts b/packages/eve/src/internal/application/build-profile.tsindex d5066f45c..df665e5d1 100644--- a/packages/eve/src/internal/application/build-profile.ts+++ b/packages/eve/src/internal/application/build-profile.ts@@ -16,7 +16,7 @@ export interface ApplicationBuildProfilePhase {}/** Size totals for one Vercel function directory in the published output. */-export interface ApplicationBuildProfileFunctionBundle {+interface ApplicationBuildProfileFunctionBundle {readonly files: number;readonly gzipBytes: number;readonly path: string;@@ -32,7 +32,7 @@ export interface ApplicationBuildProfileOutput {}/** Timing data gathered while an application build runs. */-export interface ApplicationBuildProfileTiming {+interface ApplicationBuildProfileTiming {readonly durationMs: number;readonly phases: readonly ApplicationBuildProfilePhase[];}diff --git a/packages/eve/src/internal/application/dev-environment.ts b/packages/eve/src/internal/application/dev-environment.tsindex 464763f23..7cff1152f 100644--- a/packages/eve/src/internal/application/dev-environment.ts+++ b/packages/eve/src/internal/application/dev-environment.ts@@ -1,7 +1,7 @@/** Environment flag set for processes that belong to an `eve dev` session. */export const EVE_DEV_ENV_FLAG = "EVE_DEV";-export type InstrumentationEnvironment = "development" | "preview" | "production";+type InstrumentationEnvironment = "development" | "preview" | "production";/** Reports whether this process belongs to an `eve dev` session. */export function isEveDevEnvironment(): boolean {@@ -26,7 +26,7 @@ export const EVE_EVALUATION_RUN_ID_ENV = "EVE_EVALUATION_RUN_ID";* False for a server that `eve eval --url` merely points at: that process was* started to serve ordinary traffic and cannot know an eval is among it.*/-export function isEveEvaluationEnvironment(): boolean {+function isEveEvaluationEnvironment(): boolean {return process.env[EVE_EVALUATION_ENV_FLAG] === "1";}diff --git a/packages/eve/src/internal/application/optional-package-install.test.ts b/packages/eve/src/internal/application/optional-package-install.test.tsindex 570faaea8..0057e434f 100644--- a/packages/eve/src/internal/application/optional-package-install.test.ts+++ b/packages/eve/src/internal/application/optional-package-install.test.ts@@ -3,7 +3,7 @@ import { existsSync } from "node:fs";import { mkdir, readFile } from "node:fs/promises";import { PassThrough } from "node:stream";import { Worker } from "node:worker_threads";-import { beforeEach, describe, expect, it, vi } from "vitest";+import { afterEach, beforeEach, describe, expect, it, vi, type MockInstance } from "vitest";import { ensurePnpmOptionalDependencyDefaults } from "#setup/primitives/pm/pnpm-build-policy.js";@@ -113,9 +113,14 @@ function mockProcessPlatform(platform: NodeJS.Platform): () => void {};}+// Installs report progress on the console for the `eve dev` user; capture it+// so the assertions below can check what that user sees.+let consoleInfo: MockInstance<typeof console.info>;+beforeEach(() => {vi.clearAllMocks();vi.unstubAllEnvs();+ consoleInfo = vi.spyOn(console, "info").mockImplementation(() => {});workerMockState.messages = [];workerMockState.workers = [];mockedExistsSync.mockReturnValue(false);@@ -127,6 +132,10 @@ beforeEach(() => {});});+afterEach(() => {+ consoleInfo.mockRestore();+});+describe("loadOptionalEnginePackage", () => {it("retries loading the package after auto-install finishes", async () => {const appRoot = "/repo/retry-app";@@ -493,6 +502,7 @@ describe("installPackageIntoProject", () => {ignoredOptionalDependencies: ["node-liblzma"],}),).rejects.toThrow("exit 1");+ expect(consoleInfo).not.toHaveBeenCalledWith('[eve:dev] installed "just-bash".');});it("uses the project's package manager", async () => {@@ -513,6 +523,10 @@ describe("installPackageIntoProject", () => {shell: process.platform === "win32",}),);+ expect(consoleInfo.mock.calls).toEqual([+ ['[eve:dev] installing optional dependency "microsandbox" via `pnpm add -D microsandbox`...'],+ ['[eve:dev] installed "microsandbox".'],+ ]);});it("enables shell spawning on Windows so package manager shims resolve", async () => {diff --git a/packages/eve/src/internal/application/output-publication.ts b/packages/eve/src/internal/application/output-publication.tsindex d963743b2..af472afc4 100644--- a/packages/eve/src/internal/application/output-publication.ts+++ b/packages/eve/src/internal/application/output-publication.ts@@ -19,7 +19,7 @@ import {export { resolveOutputPublicationLockPath };-export interface OutputPublicationInput {+interface OutputPublicationInput {readonly appRoot: string;readonly finalOutputDir: string;readonly finalSummaryPath: string;diff --git a/packages/eve/src/internal/application/paths.ts b/packages/eve/src/internal/application/paths.tsindex 49663426d..529c2c21e 100644--- a/packages/eve/src/internal/application/paths.ts+++ b/packages/eve/src/internal/application/paths.ts@@ -42,17 +42,6 @@ export function isVercelBuildEnvironment(): boolean {return Boolean(process.env.VERCEL);}-/**- * Resolves the programmatic Nitro build directory for an app.- */-export function resolveNitroBuildDirectory(appRoot: string): string {- return join(appRoot, ".eve", "nitro");-}--export function resolveApplicationHostArtifactsDirectory(appRoot: string): string {- return join(appRoot, ".eve", "host");-}-/*** Resolves the package-owned Workflow DevKit bundle directory for a target app.*diff --git a/packages/eve/src/internal/application/tsconfig-dependencies.ts b/packages/eve/src/internal/application/tsconfig-dependencies.tsindex 4611a65a0..7012e1e0d 100644--- a/packages/eve/src/internal/application/tsconfig-dependencies.ts+++ b/packages/eve/src/internal/application/tsconfig-dependencies.ts@@ -1,4 +1,3 @@-import { existsSync } from "node:fs";import { readdir, readFile } from "node:fs/promises";import { createRequire } from "node:module";import { dirname, isAbsolute, join, resolve } from "node:path";@@ -25,7 +24,7 @@ export async function resolveTsConfigDependencyPaths(appRoot: string): Promise<sreturn [...resolvedConfigPaths].sort((left, right) => left.localeCompare(right));}-export async function resolveRootTsConfigPaths(appRoot: string): Promise<string[]> {+async function resolveRootTsConfigPaths(appRoot: string): Promise<string[]> {const paths = new Set<string>([join(appRoot, "tsconfig.json"), join(appRoot, "jsconfig.json")]);try {@@ -51,7 +50,7 @@ export async function resolveRootTsConfigPaths(appRoot: string): Promise<string[return [...paths];}-export async function collectTsConfigDependencyPaths(input: {+async function collectTsConfigDependencyPaths(input: {readonly configPath: string;readonly resolvedConfigPaths: Set<string>;readonly visitingConfigPaths: Set<string>;@@ -120,7 +119,7 @@ export function parseTsConfigObject(source: string): Record<string, unknown> | ureturn parsedConfig as Record<string, unknown>;}-export function extractTsConfigExtendsSpecifiers(source: string): string[] {+function extractTsConfigExtendsSpecifiers(source: string): string[] {const parsedConfig = parseTsConfigObject(source);if (parsedConfig === undefined) {@@ -142,7 +141,7 @@ export function extractTsConfigExtendsSpecifiers(source: string): string[] {);}-export function resolveTsConfigExtendsTargetPaths(input: {+function resolveTsConfigExtendsTargetPaths(input: {readonly configPath: string;readonly extendsSpecifier: string;}): string[] {@@ -167,19 +166,6 @@ export function resolveTsConfigExtendsTargetPaths(input: {return [...uniquePaths];}-export function resolveFirstExistingTsConfigExtendsTarget(input: {- readonly configPath: string;- readonly extendsSpecifier: string;-}): string | undefined {- for (const candidate of resolveTsConfigExtendsTargetPaths(input)) {- if (existsSync(candidate)) {- return candidate;- }- }-- return undefined;-}-function resolveFileExtendsCandidates(input: {readonly configPath: string;readonly extendsSpecifier: string;@@ -223,7 +209,7 @@ function resolvePackageExtendsCandidates(input: {return [...resolvedPaths];}-export function isTsConfigFilePath(specifier: string): boolean {+function isTsConfigFilePath(specifier: string): boolean {if (specifier.startsWith(".")) {return true;}diff --git a/packages/eve/src/internal/authored-definition/source-identity.ts b/packages/eve/src/internal/authored-definition/source-identity.tsindex 02e316ee1..54762062a 100644--- a/packages/eve/src/internal/authored-definition/source-identity.ts+++ b/packages/eve/src/internal/authored-definition/source-identity.ts@@ -1,4 +1,4 @@-export type DefinitionSourceEntry =+type DefinitionSourceEntry =| { readonly kind: "connection"; readonly logicalPath?: string; readonly name: string }| { readonly kind: "tool"; readonly logicalPath?: string; readonly name: string };diff --git a/packages/eve/src/internal/authored-module-loader.integration.test.ts b/packages/eve/src/internal/authored-module-loader.integration.test.tsindex ace37547a..0ea99e5bc 100644--- a/packages/eve/src/internal/authored-module-loader.integration.test.ts+++ b/packages/eve/src/internal/authored-module-loader.integration.test.ts@@ -7,6 +7,7 @@ import { describe, expect, it } from "vitest";import { compileAgentManifest } from "#compiler/normalize-manifest.js";import { discoverAgent } from "#discover/discover-agent.js";import {+ bundleAuthoredModuleCode,bundleAuthoredModuleForGeneration,bundleAuthoredModuleMapForGeneration,loadAuthoredModuleNamespace,@@ -833,19 +834,20 @@ export default defineWorkflowTool({ description: "Probe", inputSchema: { type: "].join("\n"),);- const externalPackageRoot = join(app.appRoot, "node_modules", "@aws-sdk", "client-kms");- await mkdir(externalPackageRoot, { recursive: true });+ // Installed beside the workspace package, as pnpm lays it out.+ const dependencyRoot = join(packageRoot, "node_modules", "@aws-sdk", "client-kms");+ await mkdir(dependencyRoot, { recursive: true });await writeFile(- join(externalPackageRoot, "package.json"),+ join(dependencyRoot, "package.json"),JSON.stringify({ main: "index.cjs", name: "@aws-sdk/client-kms" }, null, 2),);await writeFile(- join(externalPackageRoot, "index.cjs"),+ join(dependencyRoot, "index.cjs"),'module.exports = require("./runtimeConfig.shared");\n',);await writeFile(- join(externalPackageRoot, "runtimeConfig.shared.js"),- "module.exports = { value: 'bundled-dependency' };\n",+ join(dependencyRoot, "runtimeConfig.shared.js"),+ "module.exports = { value: 'kms-client-inlined' };\n",);await mkdir(join(app.appRoot, "node_modules", "@repo"), { recursive: true });@@ -855,11 +857,19 @@ export default defineWorkflowTool({ description: "Probe", inputSchema: { type: ""junction",);- const moduleNamespace = await loadAuthoredModuleNamespace(- join(app.appRoot, "agent", "channels", "api", "contact-sales", "webhook.ts"),+ const modulePath = join(+ app.appRoot,+ "agent",+ "channels",+ "api",+ "contact-sales",+ "webhook.ts",);+ const moduleNamespace = await loadAuthoredModuleNamespace(modulePath);- expect(moduleNamespace.result).toBe("bundled-dependency");+ expect(moduleNamespace.result).toBe("kms-client-inlined");+ // The dependency's source is inlined, not left as an external import.+ expect(await bundleAuthoredModuleCode(modulePath)).toContain("kms-client-inlined");} finally {await rm(workspaceRoot, { force: true, recursive: true });}diff --git a/packages/eve/src/internal/bundler/extension-scope-plugin.ts b/packages/eve/src/internal/bundler/extension-scope-plugin.tsindex ece3e9e95..ebb266a09 100644--- a/packages/eve/src/internal/bundler/extension-scope-plugin.ts+++ b/packages/eve/src/internal/bundler/extension-scope-plugin.ts@@ -5,7 +5,7 @@ import { resolve, sep } from "node:path";* One extension's on-disk source root paired with the namespace its durable* state keys and config binding must be scoped to.*/-export interface ExtensionScope {+interface ExtensionScope {/** Absolute path to the extension's source root. */readonly sourceRoot: string;/** Package-derived namespace (e.g. `acme-crm`). */diff --git a/packages/eve/src/internal/bundler/nitro-rolldown.ts b/packages/eve/src/internal/bundler/nitro-rolldown.tsindex 6b558349c..ecf9a10f8 100644--- a/packages/eve/src/internal/bundler/nitro-rolldown.ts+++ b/packages/eve/src/internal/bundler/nitro-rolldown.ts@@ -30,7 +30,7 @@ type RolldownParseAst = (options?: Record<string, unknown> | null,filename?: string,) => unknown;-export type RolldownParserLanguage = "js" | "jsx" | "ts" | "tsx";+type RolldownParserLanguage = "js" | "jsx" | "ts" | "tsx";type RolldownModule = {readonly build: RolldownBuild;@@ -62,7 +62,7 @@ function loadNitroRolldown(): Promise<RolldownModule> {* Loads Rolldown's parser from Nitro's dependency tree so workflow directive* transforms can use the same bundler dependency without exposing it publicly.*/-export function loadNitroRolldownParseAst(): Promise<RolldownParseAstModule> {+function loadNitroRolldownParseAst(): Promise<RolldownParseAstModule> {rolldownParseAstPromise ??= (async () => {const require = createRequire(import.meta.url);const nitroRequire = createRequire(require.resolve("nitro/package.json"));@@ -73,7 +73,7 @@ export function loadNitroRolldownParseAst(): Promise<RolldownParseAstModule> {return rolldownParseAstPromise;}-export function inferRolldownParserLanguage(filename: string): RolldownParserLanguage {+function inferRolldownParserLanguage(filename: string): RolldownParserLanguage {if (filename.endsWith(".tsx")) return "tsx";if (filename.endsWith(".jsx")) return "jsx";if (/\.[cm]?ts$/.test(filename)) return "ts";diff --git a/packages/eve/src/internal/bundler/vendored-dependency-log.test.ts b/packages/eve/src/internal/bundler/vendored-dependency-log.test.tsnew file mode 100644index 000000000..6866be6dd--- /dev/null+++ b/packages/eve/src/internal/bundler/vendored-dependency-log.test.ts@@ -0,0 +1,52 @@+import { describe, expect, it, vi } from "vitest";++import { onVendoredDependencyLog } from "#internal/bundler/vendored-dependency-log.js";++function forwardedLogs(level: string, log: unknown): unknown[][] {+ const defaultHandler = vi.fn();+ onVendoredDependencyLog(level, log, defaultHandler);+ return defaultHandler.mock.calls;+}++describe("onVendoredDependencyLog", () => {+ it.each([+ ["a dependency module id", { id: "/app/node_modules/dep/index.js" }],+ ["a dependency source location", { loc: { file: "/repo/node_modules/fixture/index.js" } }],+ ["a Windows dependency path", { id: "C:\\app\\node_modules\\dep\\index.js" }],+ [+ "eve's generated vendor modules",+ { ids: ["/repo/packages/eve/.generated/compiled/gray-matter/index.js"] },+ ],+ [+ "eve's published vendor modules",+ { id: "/app/node_modules/eve/dist/src/compiled/gray-matter/index.js" },+ ],+ ])("drops a warning raised only by %s", (_, log) => {+ expect(forwardedLogs("warn", { message: "dependency detail", ...log })).toEqual([]);+ });++ it.each([+ ["an authored module", "warn", { id: "/app/agent/tools/evaluate.ts" }],+ [+ "a module that only resembles a vendor path",+ "warn",+ { ids: ["/app/agent/compiled/tool.ts", "/app/node_modules_backup/index.js"] },+ ],+ [+ "authored code alongside a dependency",+ "warn",+ {+ id: "/app/agent/tools/evaluate.ts",+ ids: [+ "/app/agent/tools/evaluate.ts",+ "/app/node_modules/eve/dist/src/compiled/vendor/index.js",+ ],+ },+ ],+ ["a module-less warning", "warn", { message: "unresolved entry" }],+ ["a plain-string warning", "warn", "unresolved entry"],+ ["a dependency error", "error", { id: "/app/node_modules/dep/index.js" }],+ ])("forwards %s", (_, level, log) => {+ expect(forwardedLogs(level, log)).toEqual([[level, log]]);+ });+});diff --git a/packages/eve/src/internal/bundler/vendored-dependency-log.ts b/packages/eve/src/internal/bundler/vendored-dependency-log.tsindex 84828c2b1..dbcb2287b 100644--- a/packages/eve/src/internal/bundler/vendored-dependency-log.ts+++ b/packages/eve/src/internal/bundler/vendored-dependency-log.ts@@ -1,3 +1,6 @@+// The build scripts import this file directly through Node type stripping, so+// it must stay free of `#` imports and non-erasable TypeScript syntax.+interface BundlerLog {readonly id?: string;readonly ids?: readonly unknown[];diff --git a/packages/eve/src/internal/compiled-manifest-fingerprint.test.ts b/packages/eve/src/internal/compiled-manifest-fingerprint.test.tsindex da5c983ea..25b835b3e 100644--- a/packages/eve/src/internal/compiled-manifest-fingerprint.test.ts+++ b/packages/eve/src/internal/compiled-manifest-fingerprint.test.ts@@ -1,7 +1,7 @@import { join } from "node:path";import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { serializeCompiledManifestForFingerprint } from "#internal/compiled-manifest-fingerprint.js";async function manifestWithRoot(runtimeAppRoot: string, agentRoot = join(runtimeAppRoot, "agent")) {diff --git a/packages/eve/src/internal/eve-project-root.ts b/packages/eve/src/internal/eve-project-root.tsindex e81953e64..9949ae7f4 100644--- a/packages/eve/src/internal/eve-project-root.ts+++ b/packages/eve/src/internal/eve-project-root.ts@@ -22,16 +22,6 @@ async function packageDeclaresEve(return isJsonObject(dependencies) && typeof dependencies.eve === "string";}-export async function isEveProjectRoot(- root: string,- options: { readonly source?: ProjectSource } = {},-): Promise<boolean> {- const source = options.source ?? createDiskProjectSource();- const packageJsonPath = join(resolve(root), "package.json");- if ((await source.stat(packageJsonPath)) !== "file") return false;- return packageDeclaresEve(packageJsonPath, source);-}-/** Find the nearest package boundary and return it only when it owns an eve project. */export async function findEveProjectRoot(startPath: string,diff --git a/packages/eve/src/internal/external-resources-snapshot.ts b/packages/eve/src/internal/external-resources-snapshot.tsindex 18dc84e6f..2e93a33f1 100644--- a/packages/eve/src/internal/external-resources-snapshot.ts+++ b/packages/eve/src/internal/external-resources-snapshot.ts@@ -3,7 +3,7 @@ import type { JsonObject } from "#shared/json.js";export const EXTERNAL_RESOURCES_SNAPSHOT_KIND = "eve-external-resources";export const EXTERNAL_RESOURCES_SNAPSHOT_VERSION = 1;-export interface ExternalCredentialRequirement {+interface ExternalCredentialRequirement {readonly method?: string;readonly reference: string;readonly service: string;diff --git a/packages/eve/src/internal/external-resources.ts b/packages/eve/src/internal/external-resources.tsindex 241b14f96..71c2965ae 100644--- a/packages/eve/src/internal/external-resources.ts+++ b/packages/eve/src/internal/external-resources.ts@@ -11,7 +11,7 @@ import {} from "#internal/external-resources-snapshot.js";import { parseJsonObject, type JsonObject } from "#shared/json.js";-export const CONNECT_MANIFEST_FILENAME = "vercel-connect-manifest.json";+const CONNECT_MANIFEST_FILENAME = "vercel-connect-manifest.json";export function buildExternalResourcesSnapshot(input: {readonly generatorVersion: string;diff --git a/packages/eve/src/internal/invocation/metadata.ts b/packages/eve/src/internal/invocation/metadata.tsindex a128d9b0e..4c1814cdb 100644--- a/packages/eve/src/internal/invocation/metadata.ts+++ b/packages/eve/src/internal/invocation/metadata.ts@@ -8,7 +8,7 @@ import {export { INVOCATION_OWNER_ATTRIBUTE, INVOCATION_TOKEN_ATTRIBUTE };-export type ExternalInvocationMetadata = NonNullable<RunInput["externalInvocation"]>;+type ExternalInvocationMetadata = NonNullable<RunInput["externalInvocation"]>;/** Batch-scoped request id exposed to MCP clients for one durable pending-input event. */export function invocationInputRequestId(pendingBatchId: string, requestId: string): string {diff --git a/packages/eve/src/internal/materialized-authored-modules.ts b/packages/eve/src/internal/materialized-authored-modules.tsindex df4b1673e..f99a9d6c9 100644--- a/packages/eve/src/internal/materialized-authored-modules.ts+++ b/packages/eve/src/internal/materialized-authored-modules.ts@@ -20,7 +20,7 @@ export interface MaterializedInstrumentation {readonly modulePathsBySlot: Readonly<Record<string, string>>;}-export interface MaterializedAuthoredModuleIndex {+interface MaterializedAuthoredModuleIndex {readonly fingerprint: string;readonly instrumentation?: MaterializedInstrumentation;readonly moduleMap: string;diff --git a/packages/eve/src/internal/mcp/protected-resource.ts b/packages/eve/src/internal/mcp/protected-resource.tsindex e7219ff90..bb1a7c916 100644--- a/packages/eve/src/internal/mcp/protected-resource.ts+++ b/packages/eve/src/internal/mcp/protected-resource.ts@@ -1,6 +1,6 @@import { escapeAuthChallengeParameter } from "#public/channels/auth.js";-export interface McpProtectedResourceMetadataOptions {+interface McpProtectedResourceMetadataOptions {readonly authorizationServers: readonly string[];readonly resource: string;readonly scopesSupported?: readonly string[];diff --git a/packages/eve/src/internal/mcp/streamable-http-server.test.ts b/packages/eve/src/internal/mcp/streamable-http-server.test.tsindex fd5e18cf9..c0031170f 100644--- a/packages/eve/src/internal/mcp/streamable-http-server.test.ts+++ b/packages/eve/src/internal/mcp/streamable-http-server.test.ts@@ -5,12 +5,13 @@ import { z } from "#compiled/zod/index.js";import {createMcpStreamableHttpServer,defineMcpTool,- MCP_LEGACY_PROTOCOL_VERSION,MCP_PROTOCOL_VERSION,MCP_REQUEST_BODY_MAX_BYTES,McpToolOperationError,} from "#internal/mcp/streamable-http-server.js";+import { captureLogRecords } from "#internal/testing/log-records.js";+const MCP_LEGACY_PROTOCOL_VERSION = "2025-11-25";const MCP_PROTOCOL_VERSION_META_KEY = "io.modelcontextprotocol/protocolVersion";const MCP_CLIENT_INFO_META_KEY = "io.modelcontextprotocol/clientInfo";const MCP_CLIENT_CAPABILITIES_META_KEY = "io.modelcontextprotocol/clientCapabilities";@@ -319,6 +320,7 @@ describe("stateless MCP Streamable HTTP server", () => {});it("sanitizes unexpected tool failures behind an error id", async () => {+ const logs = captureLogRecords();const handle = createMcpStreamableHttpServer({authenticate: async () => auth,name: "eve-test",@@ -360,6 +362,9 @@ describe("stateless MCP Streamable HTTP server", () => {expect(body.result.content[0]?.text).toContain(String(body.result.structuredContent.error.errorId),);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "MCP tool call failed" }),+ );});it("returns JSON-RPC errors and acknowledges notifications", async () => {diff --git a/packages/eve/src/internal/mcp/streamable-http-server.ts b/packages/eve/src/internal/mcp/streamable-http-server.tsindex 1e271a0c2..7c1258be6 100644--- a/packages/eve/src/internal/mcp/streamable-http-server.ts+++ b/packages/eve/src/internal/mcp/streamable-http-server.ts@@ -11,16 +11,13 @@ import { createLogger, logError } from "#internal/logging.js";const log = createLogger("mcp.server");export const MCP_PROTOCOL_VERSION = "2026-07-28";-export const MCP_LEGACY_PROTOCOL_VERSION = "2025-11-25";/*** Upper bound for any MCP POST body. Tool arguments are small JSON; the* largest legitimate payload is an `outputSchema`, itself capped at 64 KiB.*/export const MCP_REQUEST_BODY_MAX_BYTES = 1024 * 1024;-export interface McpToolDefinition<- TInputSchema extends StandardSchemaWithJSON = StandardSchemaWithJSON,-> {+interface McpToolDefinition<TInputSchema extends StandardSchemaWithJSON = StandardSchemaWithJSON> {readonly name: string;readonly description?: string;readonly annotations?: McpToolAnnotations;@@ -50,9 +47,9 @@ export type McpContent =* change or re-read something; `not_found` means stop; `internal` means the* server failed and `errorId` correlates with its logs.*/-export type McpToolOperationErrorCode = "invalid_input" | "not_found" | "conflict" | "internal";+type McpToolOperationErrorCode = "invalid_input" | "not_found" | "conflict" | "internal";-export interface McpToolOperationErrorData {+interface McpToolOperationErrorData {readonly code: McpToolOperationErrorCode;readonly errorId?: string;readonly message: string;@@ -121,7 +118,7 @@ export function defineMcpTool<};}-export interface McpStreamableHttpServerOptions {+interface McpStreamableHttpServerOptions {readonly name: string;readonly version: string;/** Server-level usage guidance returned from `initialize` and `server/discover`. */diff --git a/packages/eve/src/internal/model-catalog.ts b/packages/eve/src/internal/model-catalog.tsindex 993871719..5bec831c6 100644--- a/packages/eve/src/internal/model-catalog.ts+++ b/packages/eve/src/internal/model-catalog.ts@@ -28,7 +28,7 @@ export const modelCatalogResponseSchema = zexport type CatalogModelProvider = z.infer<typeof catalogModelProviderSchema>;export type CatalogModel = z.infer<typeof catalogModelSchema>;-export interface ModelCatalogLimits {+interface ModelCatalogLimits {readonly contextWindowTokens: number;readonly maxOutputTokens?: number;}diff --git a/packages/eve/src/internal/nitro/dev-runtime-artifacts.integration.test.ts b/packages/eve/src/internal/nitro/dev-runtime-artifacts.integration.test.tsindex 47abc3a5c..22dc83184 100644--- a/packages/eve/src/internal/nitro/dev-runtime-artifacts.integration.test.ts+++ b/packages/eve/src/internal/nitro/dev-runtime-artifacts.integration.test.ts@@ -21,10 +21,12 @@ import { createDiskRuntimeCompiledArtifactsSource } from "#runtime/compiled-artiimport { getCompiledRuntimeAgentBundle } from "#runtime/sessions/compiled-agent-cache.js";import { createRuntimeSession, withRuntimeSession } from "#runtime/sessions/runtime-session.js";import { createDevelopmentNitroArtifactsConfig } from "#internal/nitro/host/artifacts-config.js";-import { publishDevelopmentGeneration } from "#internal/nitro/development-generation.js";+import {+ activateDevelopmentGeneration,+ stageDevelopmentGeneration,+} from "#internal/nitro/development-generation.js";import { resolveLocalWorkflowWorldDataDirectory } from "#internal/workflow/local-world-data-directory.js";import {- activateDevelopmentRuntimeArtifactsSnapshot,activateDevelopmentRuntimeArtifactsSnapshotTransaction,pruneDevelopmentRuntimeArtifactsSnapshots,readDevelopmentRuntimeArtifactsSnapshotRoot,@@ -37,6 +39,13 @@ import { resolveNitroCompiledArtifactsSource } from "#internal/nitro/routes/runtconst createScratchDirectory = useTemporaryDirectories();+async function activateSnapshot(+ input: Parameters<typeof activateDevelopmentRuntimeArtifactsSnapshotTransaction>[0],+): Promise<void> {+ const activation = await activateDevelopmentRuntimeArtifactsSnapshotTransaction(input);+ activation.commit();+}+async function markSnapshotMaterialized(snapshot: DevelopmentRuntimeArtifactsSnapshot,): Promise<DevelopmentRuntimeArtifactsSnapshot> {@@ -117,11 +126,12 @@ async function createNextStyleImportSnapshotFixture(): Promise<{ readonly appRooconst compileResult = await compileAgent({ startPath: appRoot });- await publishDevelopmentGeneration({+ const generation = await stageDevelopmentGeneration({...compileResult,paths: { ...compileResult.paths, compileDirectoryPath, moduleMapPath },project: { appRoot },} as CompileAgentResult);+ await activateDevelopmentGeneration({ appRoot, generation });return { appRoot };}@@ -157,7 +167,7 @@ describe("development runtime artifact snapshots", () => {JSON.parse(await readFile(join(snapshot.snapshotRoot, "generation.json"), "utf8")),).toEqual({ runtimeAppRoot: snapshot.runtimeAppRoot });- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized(snapshot),});@@ -184,7 +194,7 @@ describe("development runtime artifact snapshots", () => {} as CompileAgentResult;const first = await stageDevelopmentRuntimeArtifactsSnapshot(compileResult);const second = await stageDevelopmentRuntimeArtifactsSnapshot(compileResult);- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized(first),});@@ -444,7 +454,7 @@ describe("development runtime artifact snapshots", () => {await utimes(retainedSnapshotRoot, new Date(now - 20_000), new Date(now - 20_000));await utimes(staleSnapshotRoot, new Date(now - 30_000), new Date(now - 30_000));- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized({runtimeAppRoot: join(activeSnapshotRoot, "source", "app"),@@ -483,12 +493,12 @@ describe("development runtime artifact snapshots", () => {snapshotSourceRoot: join(snapshotRoot, "source"),sourceRoot: appRoot,});- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized(createSnapshot(firstSnapshotRoot)),});const beforeRetirement = Date.now();- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized(createSnapshot(nextSnapshotRoot)),});@@ -531,7 +541,7 @@ describe("development runtime artifact snapshots", () => {`${JSON.stringify({ retiredAt: now - gracePeriodMs - index - 1 })}\n`,);}- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized({runtimeAppRoot: join(activeSnapshotRoot, "source"),@@ -567,7 +577,7 @@ describe("development runtime artifact snapshots", () => {await mkdir(snapshotRoot, { recursive: true });await writeFile(join(snapshotRoot, "activated"), "");}- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized({runtimeAppRoot: join(activeSnapshotRoot, "source", "app"),@@ -612,7 +622,7 @@ describe("development runtime artifact snapshots", () => {join(retiredSnapshotRoot, "retired.json"),`${JSON.stringify({ retiredAt: 1 })}\n`,);- await activateDevelopmentRuntimeArtifactsSnapshot({+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized({runtimeAppRoot: join(activeSnapshotRoot, "source"),@@ -698,10 +708,10 @@ describe("development runtime artifact snapshots", () => {paths: { compileDirectoryPath },project: { appRoot },} as CompileAgentResult);- await expect(- activateDevelopmentRuntimeArtifactsSnapshot({ appRoot, snapshot }),- ).rejects.toThrow("before its authored modules are materialized");- await activateDevelopmentRuntimeArtifactsSnapshot({+ await expect(activateSnapshot({ appRoot, snapshot })).rejects.toThrow(+ "before its authored modules are materialized",+ );+ await activateSnapshot({appRoot,snapshot: await markSnapshotMaterialized(snapshot),});diff --git a/packages/eve/src/internal/nitro/dev-runtime-artifacts.ts b/packages/eve/src/internal/nitro/dev-runtime-artifacts.tsindex 834c7d34a..e9d3bdef5 100644--- a/packages/eve/src/internal/nitro/dev-runtime-artifacts.ts+++ b/packages/eve/src/internal/nitro/dev-runtime-artifacts.ts@@ -213,14 +213,6 @@ function findPackageRoot(entryPath: string, packageName: string): string {/*** Moves the dev runtime pointer so future sessions use a staged snapshot.*/-export async function activateDevelopmentRuntimeArtifactsSnapshot(input: {- readonly appRoot: string;- readonly snapshot: DevelopmentRuntimeArtifactsSnapshot;-}): Promise<void> {- const activation = await activateDevelopmentRuntimeArtifactsSnapshotTransaction(input);- activation.commit();-}-export async function activateDevelopmentRuntimeArtifactsSnapshotTransaction(input: {readonly appRoot: string;readonly snapshot: DevelopmentRuntimeArtifactsSnapshot;diff --git a/packages/eve/src/internal/nitro/dev-runtime-source-snapshot.ts b/packages/eve/src/internal/nitro/dev-runtime-source-snapshot.tsindex 76e3e215e..cccf61a58 100644--- a/packages/eve/src/internal/nitro/dev-runtime-source-snapshot.ts+++ b/packages/eve/src/internal/nitro/dev-runtime-source-snapshot.ts@@ -15,7 +15,7 @@ import {export { isAuthoredSourcePath } from "#internal/nitro/dev-runtime-source-snapshot-local-roots.js";-export const DEV_RUNTIME_SOURCE_DIRECTORY = "source";+const DEV_RUNTIME_SOURCE_DIRECTORY = "source";const SOURCE_ROOT_MARKER_NAMES = [".git", "pnpm-workspace.yaml"] as const;const WORKSPACE_METADATA_FILE_NAMES = [diff --git a/packages/eve/src/internal/nitro/development-generation.ts b/packages/eve/src/internal/nitro/development-generation.tsindex c0d866952..406f78ba0 100644--- a/packages/eve/src/internal/nitro/development-generation.ts+++ b/packages/eve/src/internal/nitro/development-generation.ts@@ -82,17 +82,6 @@ export async function stageDevelopmentGeneration(}}-export async function publishDevelopmentGeneration(- compileResult: CompileAgentResult,-): Promise<DevelopmentGeneration> {- const generation = await stageDevelopmentGeneration(compileResult);- await activateDevelopmentGeneration({- appRoot: compileResult.project.appRoot,- generation,- });- return generation;-}-export async function activateDevelopmentGeneration(input: {readonly appRoot: string;readonly generation: DevelopmentGeneration;diff --git a/packages/eve/src/internal/nitro/host/application-route-registry.test.ts b/packages/eve/src/internal/nitro/host/application-route-registry.test.tsindex a7ce93226..3f060f5ae 100644--- a/packages/eve/src/internal/nitro/host/application-route-registry.test.ts+++ b/packages/eve/src/internal/nitro/host/application-route-registry.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { createApplicationRouteRegistry } from "#internal/nitro/host/application-route-registry.js";import {EVE_DEV_DISPATCH_SCHEDULE_ROUTE_PATTERN,diff --git a/packages/eve/src/internal/nitro/host/build-application.scenario.test.ts b/packages/eve/src/internal/nitro/host/build-application.scenario.test.tsindex 286a23290..cbfa30bc7 100644--- a/packages/eve/src/internal/nitro/host/build-application.scenario.test.ts+++ b/packages/eve/src/internal/nitro/host/build-application.scenario.test.ts@@ -4,7 +4,7 @@ import { join } from "node:path";import type { Nitro } from "nitro/types";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import {APPLICATION_BUILD_PROFILE_SCHEMA_VERSION,type ApplicationBuildProfile,diff --git a/packages/eve/src/internal/nitro/host/build-vercel-agent-summary.test.ts b/packages/eve/src/internal/nitro/host/build-vercel-agent-summary.test.tsindex 62bdbfbb3..a38adff8a 100644--- a/packages/eve/src/internal/nitro/host/build-vercel-agent-summary.test.ts+++ b/packages/eve/src/internal/nitro/host/build-vercel-agent-summary.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { defineChannel, POST } from "#public/definitions/channel.js";import { defineInstructions } from "#public/definitions/instructions.js";import { defineSchedule } from "#public/definitions/schedule.js";diff --git a/packages/eve/src/internal/nitro/host/channel-routes.ts b/packages/eve/src/internal/nitro/host/channel-routes.tsindex 2d897d1a9..64ba6294c 100644--- a/packages/eve/src/internal/nitro/host/channel-routes.ts+++ b/packages/eve/src/internal/nitro/host/channel-routes.ts@@ -22,7 +22,7 @@ interface ChannelRouteNitro {}/** One active channel binding in the eve-owned application route registry. */-export type NitroChannelRouteRegistration = ApplicationChannelRouteRegistration;+type NitroChannelRouteRegistration = ApplicationChannelRouteRegistration;/*** Computes the merged set of channel routes the Nitro host should mount.diff --git a/packages/eve/src/internal/nitro/host/create-application-nitro.scenario.test.ts b/packages/eve/src/internal/nitro/host/create-application-nitro.scenario.test.tsindex e45db02a1..82bde7663 100644--- a/packages/eve/src/internal/nitro/host/create-application-nitro.scenario.test.ts+++ b/packages/eve/src/internal/nitro/host/create-application-nitro.scenario.test.ts@@ -5,7 +5,7 @@ import { join } from "node:path";import type { Nitro } from "nitro/types";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import {COMPILE_METADATA_KIND,COMPILE_METADATA_VERSION,@@ -19,7 +19,6 @@ import {resolveInstalledPackageInfo,resolveWorkflowModulePath,} from "#internal/application/package.js";-import { resolveNitroBuildDirectory } from "#internal/application/paths.js";import type {PreparedApplicationHost,PreparedDevelopmentApplicationHost,@@ -230,6 +229,10 @@ async function createPreparedHost(};}+function resolveNitroBuildDirectory(appRoot: string): string {+ return join(appRoot, ".eve", "nitro");+}+function createProductionOptions(preparedHost: PreparedApplicationHost) {return {buildDir: resolveNitroBuildDirectory(preparedHost.appRoot),diff --git a/packages/eve/src/internal/nitro/host/dev-authored-rebuild-coordinator.ts b/packages/eve/src/internal/nitro/host/dev-authored-rebuild-coordinator.tsindex 8edf8dbe7..ec80d6570 100644--- a/packages/eve/src/internal/nitro/host/dev-authored-rebuild-coordinator.ts+++ b/packages/eve/src/internal/nitro/host/dev-authored-rebuild-coordinator.ts@@ -13,7 +13,7 @@ import {discardDevelopmentGeneration,} from "#internal/nitro/development-generation.js";-export type DevelopmentRebuildKind = "structural" | "unchanged" | "runtime";+type DevelopmentRebuildKind = "structural" | "unchanged" | "runtime";/*** Raised when generation activation fails after the replacement worker hasdiff --git a/packages/eve/src/internal/nitro/host/dev-authored-source-watcher.scenario.test.ts b/packages/eve/src/internal/nitro/host/dev-authored-source-watcher.scenario.test.tsindex c7730eb74..8d29360bf 100644--- a/packages/eve/src/internal/nitro/host/dev-authored-source-watcher.scenario.test.ts+++ b/packages/eve/src/internal/nitro/host/dev-authored-source-watcher.scenario.test.ts@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";import { dirname, join } from "node:path";import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import type { DevelopmentAuthoredRebuildCoordinator } from "#internal/nitro/host/dev-authored-rebuild-coordinator.js";import type { PreparedDevelopmentApplicationHost } from "#internal/nitro/host/types.js";import { STRUCTURAL_RELOAD_LOG_LINE } from "#internal/nitro/host/dev-watcher-log.js";diff --git a/packages/eve/src/internal/nitro/host/dev-host-candidate.ts b/packages/eve/src/internal/nitro/host/dev-host-candidate.tsindex 00268e71d..b80884a27 100644--- a/packages/eve/src/internal/nitro/host/dev-host-candidate.ts+++ b/packages/eve/src/internal/nitro/host/dev-host-candidate.ts@@ -7,7 +7,7 @@ import type { PreparedDevelopmentApplicationHost } from "#internal/nitro/host/tyconst CANDIDATE_BUILD_TIMEOUT_MS = 120_000;-export interface DevelopmentWorkerPayload {+interface DevelopmentWorkerPayload {readonly entry: string;readonly workerData: Readonly<Record<string, unknown>>;}diff --git a/packages/eve/src/internal/nitro/host/dev-host-fingerprint.integration.test.ts b/packages/eve/src/internal/nitro/host/dev-host-fingerprint.integration.test.tsindex f7cede26f..f975cdca1 100644--- a/packages/eve/src/internal/nitro/host/dev-host-fingerprint.integration.test.ts+++ b/packages/eve/src/internal/nitro/host/dev-host-fingerprint.integration.test.ts@@ -3,7 +3,7 @@ import { tmpdir } from "node:os";import { join } from "node:path";import { afterEach, describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { computeDevelopmentHostFingerprint } from "#internal/nitro/host/dev-host-fingerprint.js";import type { PreparedDevelopmentApplicationHost } from "#internal/nitro/host/types.js";import { defineChannel, GET } from "#public/definitions/channel.js";diff --git a/packages/eve/src/internal/nitro/host/drained-nitro-dev-server.ts b/packages/eve/src/internal/nitro/host/drained-nitro-dev-server.tsindex 806d3479d..9c658ae28 100644--- a/packages/eve/src/internal/nitro/host/drained-nitro-dev-server.ts+++ b/packages/eve/src/internal/nitro/host/drained-nitro-dev-server.ts@@ -24,7 +24,7 @@ export interface DrainedDevServerListener {readonly url: string | undefined;}-export interface DevelopmentWorkerReplacement {+interface DevelopmentWorkerReplacement {readonly dispose?: () => Promise<void>;readonly entry: string;readonly workerData: Readonly<Record<string, unknown>>;diff --git a/packages/eve/src/internal/nitro/host/nitro-bundler-config.test.ts b/packages/eve/src/internal/nitro/host/nitro-bundler-config.test.tsindex 899b61cda..5a53595f4 100644--- a/packages/eve/src/internal/nitro/host/nitro-bundler-config.test.ts+++ b/packages/eve/src/internal/nitro/host/nitro-bundler-config.test.ts@@ -1,99 +1,11 @@-import { describe, expect, it, vi } from "vitest";+import { describe, expect, it } from "vitest";-import { createNitroBundlerConfig } from "./nitro-bundler-config.js";--type BundlerLogHandler = (- level: string,- log: unknown,- defaultHandler: (level: string, log: { readonly message: string }) => void,-) => void;--function getBundlerLogHandler(): BundlerLogHandler {- const config = createNitroBundlerConfig([]);- const onLog = config.onLog;+import { onVendoredDependencyLog } from "#internal/bundler/vendored-dependency-log.js";- if (typeof onLog !== "function") {- throw new Error("Expected Nitro bundler config to install an onLog handler.");- }-- return onLog as BundlerLogHandler;-}+import { createNitroBundlerConfig } from "./nitro-bundler-config.js";describe("createNitroBundlerConfig", () => {- it("suppresses vendored dependency warnings without hiding actionable logs", () => {- const onLog = getBundlerLogHandler();- const defaultHandler = vi.fn();-- onLog(- "warn",- {- id: "/repo/node_modules/fixture/index.js",- message: "dependency implementation detail",- },- defaultHandler,- );- onLog(- "warn",- {- loc: {- file: "/repo/packages/eve/.generated/compiled/gray-matter/index.js",- },- message: "generated compiled dependency implementation detail",- },- defaultHandler,- );- onLog(- "warn",- {- id: "/repo/packages/eve/dist/src/compiled/gray-matter/index.js",- message: "dist compiled dependency implementation detail",- },- defaultHandler,- );- onLog(- "warn",- {- id: "/repo/packages/eve/src/internal/nitro/host/create-application-nitro.ts",- message: "eve build warning",- },- defaultHandler,- );- onLog(- "error",- {- id: "/repo/packages/eve/dist/src/compiled/gray-matter/index.js",- message: "dependency build failure",- },- defaultHandler,- );-- expect(defaultHandler).toHaveBeenCalledTimes(2);- expect(defaultHandler).toHaveBeenNthCalledWith(- 1,- "warn",- expect.objectContaining({ message: "eve build warning" }),- );- expect(defaultHandler).toHaveBeenNthCalledWith(- 2,- "error",- expect.objectContaining({ message: "dependency build failure" }),- );- });-- it("preserves cross-module warnings that involve authored code", () => {- const onLog = getBundlerLogHandler();- const defaultHandler = vi.fn();- const mixedWarning = {- id: "/app/agent/tools/evaluate.ts",- ids: [- "/app/agent/tools/evaluate.ts",- "/app/node_modules/eve/dist/src/compiled/vendor/index.js",- ],- pluginCode: "/app/node_modules/eve/dist/src/compiled/vendor/index.js",- };-- onLog("warn", mixedWarning, defaultHandler);-- expect(defaultHandler).toHaveBeenCalledWith("warn", mixedWarning);+ it("filters vendored dependency warnings from hosted builds", () => {+ expect(createNitroBundlerConfig([]).onLog).toBe(onVendoredDependencyLog);});});diff --git a/packages/eve/src/internal/nitro/host/sandbox-shutdown-plugin.test.ts b/packages/eve/src/internal/nitro/host/sandbox-shutdown-plugin.test.tsindex c89b18c49..3c95e7231 100644--- a/packages/eve/src/internal/nitro/host/sandbox-shutdown-plugin.test.ts+++ b/packages/eve/src/internal/nitro/host/sandbox-shutdown-plugin.test.ts@@ -1,7 +1,7 @@import { afterEach, describe, expect, it, vi } from "vitest";import {- clearActiveSandboxHandlesForTest,+ shutdownActiveSandboxHandles,trackActiveSandboxHandle,} from "#execution/sandbox/active-handles.js";import {@@ -29,8 +29,8 @@ function createFakeProcess(env: Record<string, string | undefined> = {}) {};}-afterEach(() => {- clearActiveSandboxHandlesForTest();+afterEach(async () => {+ await shutdownActiveSandboxHandles();vi.unstubAllEnvs();});diff --git a/packages/eve/src/internal/nitro/host/schedule-task-routes.ts b/packages/eve/src/internal/nitro/host/schedule-task-routes.tsindex 87f669626..0301b2919 100644--- a/packages/eve/src/internal/nitro/host/schedule-task-routes.ts+++ b/packages/eve/src/internal/nitro/host/schedule-task-routes.ts@@ -24,7 +24,7 @@ interface ScheduleTaskNitro {* module — the synthetic task module imports it and forwards `event.name`* along with the baked-in artifacts config.*/-export interface RegisterScheduleTaskHandlersInput {+interface RegisterScheduleTaskHandlersInput {readonly artifactsConfig: NitroArtifactsConfig;readonly dispatchModulePath: string;readonly registrations: readonly ScheduleRegistration[];diff --git a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.ts b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.tsindex fae19d46c..74f0e8c97 100644--- a/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.ts+++ b/packages/eve/src/internal/nitro/routes/agent-info/build-agent-info-response.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { AgentInfoResultSchema } from "#client/agent-info-schema.js";import { buildAgentInfoResponse } from "#internal/nitro/routes/agent-info/build-agent-info-response.js";import { webSearch } from "#tools/provided/web-search.js";diff --git a/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts b/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.tsindex b4236dd54..46cde84ee 100644--- a/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts+++ b/packages/eve/src/internal/nitro/routes/channel-request-instrumentation.ts@@ -35,7 +35,7 @@ const headersGetter: TextMapGetter<Headers> = {};/** Inputs for {@link traceChannelRequest}. */-export interface TraceChannelRequestInput {+interface TraceChannelRequestInput {readonly request: Request;readonly routeKey: string;}diff --git a/packages/eve/src/internal/nitro/routes/channel-route-context.ts b/packages/eve/src/internal/nitro/routes/channel-route-context.tsindex 728e8278b..7006fb851 100644--- a/packages/eve/src/internal/nitro/routes/channel-route-context.ts+++ b/packages/eve/src/internal/nitro/routes/channel-route-context.ts@@ -2,7 +2,7 @@ import type { RouteHandlerArgs } from "#channel/routes.js";import type { RunHandle, RunInput } from "#channel/types.js";type AgentInfoRouteResponse = () => Promise<Response>;-export interface HomeRouteMetadata {+interface HomeRouteMetadata {readonly agentName: string;}/**diff --git a/packages/eve/src/internal/nitro/routes/runtime-artifacts.test.ts b/packages/eve/src/internal/nitro/routes/runtime-artifacts.test.tsindex dcd49dc39..29732c531 100644--- a/packages/eve/src/internal/nitro/routes/runtime-artifacts.test.ts+++ b/packages/eve/src/internal/nitro/routes/runtime-artifacts.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import { installBundledCompiledArtifacts } from "#runtime/loaders/bundled-artifacts.js";import { createRuntimeSession, withRuntimeSession } from "#runtime/sessions/runtime-session.js";import { resolveNitroCompiledArtifactsSource } from "#internal/nitro/routes/runtime-artifacts.js";diff --git a/packages/eve/src/internal/nitro/routes/runtime-stack.ts b/packages/eve/src/internal/nitro/routes/runtime-stack.tsindex 2a8fd1a13..527fd0bf8 100644--- a/packages/eve/src/internal/nitro/routes/runtime-stack.ts+++ b/packages/eve/src/internal/nitro/routes/runtime-stack.ts@@ -18,7 +18,7 @@ import {* against a registered URL pattern, then calls the matched channel's* `fetch` with a `RouteContext` built from `runtime`.*/-export interface NitroChannelRuntimeBundle {+interface NitroChannelRuntimeBundle {readonly agentName: string;readonly channels: readonly ResolvedChannelDefinition[];readonly resolveRemoteAgentStreamHeaders?: RemoteAgentStreamHeadersResolver;diff --git a/packages/eve/src/internal/process/pnpm.ts b/packages/eve/src/internal/process/pnpm.tsdeleted file mode 100644index 1235ea09a..000000000--- a/packages/eve/src/internal/process/pnpm.ts+++ /dev/null@@ -1,70 +0,0 @@-import { existsSync } from "node:fs";-import { extname, join } from "node:path";--/**- * Resolved invocation for the host's pnpm executable. The shape carries- * everything `child_process.spawn` and `execFile` need to dispatch to the- * right binary across macOS/Linux PATH installs, Corepack-managed shims,- * and Windows runners that surface pnpm only through `PNPM_HOME`.- */-export interface PnpmInvocation {- readonly args: readonly string[];- readonly command: string;- readonly shell?: boolean;-}--/**- * Picks the right pnpm executable for the current host. Resolution order:- *- * 1. `PNPM_HOME` — the standard install location used by Corepack and the- * pnpm installers. On Windows, points at `pnpm.CMD` because the bare- * `pnpm` shim is not directly invokable from a non-shell spawn.- * 2. `npm_execpath` — set when the current process was launched by an- * npm-compatible package manager. Pointing at a `.cjs`/`.js` entry- * means we have to run it through `node` (typical for Corepack- * shims); otherwise treat it as a bare executable path.- * 3. Bare `pnpm` on PATH — the macOS/Linux happy path.- *- * Pure: no side effects, returns the invocation shape; the caller picks- * `spawn` vs. `execFile`. The test harness uses this to keep platform- * handling in one place.- */-export function resolvePnpmInvocation(args: readonly string[]): PnpmInvocation {- const pnpmHome = process.env.PNPM_HOME;-- if (pnpmHome !== undefined) {- const command = join(pnpmHome, process.platform === "win32" ? "pnpm.CMD" : "pnpm");-- if (existsSync(command)) {- return {- args,- command,- shell: process.platform === "win32",- };- }- }-- const npmExecPath = process.env.npm_execpath;-- if (npmExecPath !== undefined && npmExecPath.toLowerCase().includes("pnpm")) {- const extension = extname(npmExecPath).toLowerCase();-- if (extension === ".cjs" || extension === ".js") {- return {- args: [npmExecPath, ...args],- command: process.execPath,- };- }-- return {- args,- command: npmExecPath,- shell: process.platform === "win32",- };- }-- return {- args,- command: "pnpm",- };-}diff --git a/packages/eve/src/internal/resolve-model-endpoint-status.ts b/packages/eve/src/internal/resolve-model-endpoint-status.tsindex 99c270186..bc03e0ece 100644--- a/packages/eve/src/internal/resolve-model-endpoint-status.ts+++ b/packages/eve/src/internal/resolve-model-endpoint-status.ts@@ -29,7 +29,7 @@ export type GatewayCredentialSource = { kind: "env-file"; path: string } | { kin* whatever their vantage point can see — env files on disk, the process* environment, an SDK token lookup — and the resolver ranks it.*/-export interface GatewayCredentialEvidence {+interface GatewayCredentialEvidence {/** `AI_GATEWAY_API_KEY` found in an app env file (the file's name). */readonly apiKeyFile?: string;/** `AI_GATEWAY_API_KEY` present in the process environment. */diff --git a/packages/eve/src/internal/testing/app-harness.ts b/packages/eve/src/internal/testing/app-harness.tsindex 7c7008525..32cc60e9c 100644--- a/packages/eve/src/internal/testing/app-harness.ts+++ b/packages/eve/src/internal/testing/app-harness.ts@@ -1,5 +1,8 @@import type { ChannelAdapter } from "#channel/adapter.js";-import { compileFromMemory, type CompileFromMemoryInput } from "#compiler/compile-from-memory.js";+import {+ compileFromMemory,+ type CompileFromMemoryInput,+} from "#internal/testing/compile-from-memory.js";import type { CompiledAgentManifest } from "#compiler/manifest.js";import type { CompiledModuleMap } from "#compiler/module-map.js";import type { ProgrammaticAgentModule } from "#compiler/source-graph.js";@@ -36,7 +39,7 @@ import { mockSandbox, type MockSandbox } from "#internal/testing/mocks/mock-sand* no tools, skills, or subagents. The harness installs an in-memory sandbox* backend so runtime tests never depend on a host container or VM service.*/-export interface TestAppDescriptor {+interface TestAppDescriptor {readonly agent?: {readonly limits?: {readonly maxInputTokensPerSession?: number | false;diff --git a/packages/eve/src/compiler/compile-from-memory.test.ts b/packages/eve/src/internal/testing/compile-from-memory.test.tssimilarity index 97%rename from packages/eve/src/compiler/compile-from-memory.test.tsrename to packages/eve/src/internal/testing/compile-from-memory.test.tsindex 2bb18981c..dd3cdab6c 100644--- a/packages/eve/src/compiler/compile-from-memory.test.ts+++ b/packages/eve/src/internal/testing/compile-from-memory.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import {COMPILED_AGENT_MANIFEST_KIND,COMPILED_AGENT_MANIFEST_VERSION,diff --git a/packages/eve/src/compiler/compile-from-memory.ts b/packages/eve/src/internal/testing/compile-from-memory.tssimilarity index 99%rename from packages/eve/src/compiler/compile-from-memory.tsrename to packages/eve/src/internal/testing/compile-from-memory.tsindex 07bc46b0f..471e8358a 100644--- a/packages/eve/src/compiler/compile-from-memory.ts+++ b/packages/eve/src/internal/testing/compile-from-memory.ts@@ -53,7 +53,7 @@ export interface CompileFromMemorySkillInput {readonly markdown?: string;}-export interface CompileFromMemoryResult {+interface CompileFromMemoryResult {readonly manifest: CompiledAgentManifest;readonly moduleMap: CompiledModuleMap;}diff --git a/packages/eve/src/internal/testing/durable-session-workflow.ts b/packages/eve/src/internal/testing/durable-session-workflow.tsindex 414a1fb97..c91e7751b 100644--- a/packages/eve/src/internal/testing/durable-session-workflow.ts+++ b/packages/eve/src/internal/testing/durable-session-workflow.ts@@ -46,7 +46,7 @@ function buildSyntheticSession(input: {}/** Writes one synthetic snapshot into the returned durable state. */-export async function durableSessionWriteStep(input: {+async function durableSessionWriteStep(input: {readonly marker: string;readonly historyDepth: number;readonly sessionId: string;@@ -67,7 +67,7 @@ export async function durableSessionWriteStep(input: {* Verifies the retry's returned state, not the seed state, is what* the next read sees.*/-export async function durableSessionWriteWithRetryStep(input: {+async function durableSessionWriteWithRetryStep(input: {readonly marker: string;readonly historyDepth: number;readonly sessionId: string;@@ -92,7 +92,7 @@ export async function durableSessionWriteWithRetryStep(input: {}/** Reads the latest snapshot and projects the fields the test asserts on. */-export async function durableSessionReadStep(input: {+async function durableSessionReadStep(input: {readonly sessionState: DurableSessionState;}): Promise<{readonly marker: string;@@ -115,11 +115,11 @@ export async function durableSessionReadStep(input: {* outcome. `sessionId` comes from `workflowRunId` to mirror production* session identity.*/-export interface DurableSessionStoreFixtureInput {+interface DurableSessionStoreFixtureInput {readonly markers: readonly { readonly marker: string; readonly historyDepth: number }[];}-export interface DurableSessionStoreFixtureResult {+interface DurableSessionStoreFixtureResult {readonly sessionId: string;readonly readsAfterEachWrite: readonly {readonly marker: string;@@ -171,7 +171,7 @@ export async function durableSessionStoreFixtureWorkflow(}/** Forces a write-step retry and reads back the retry's returned state. */-export interface DurableSessionRetryFixtureResult {+interface DurableSessionRetryFixtureResult {readonly sessionId: string;readonly writeAttempt: number;readonly readAfterRetry: {diff --git a/packages/eve/src/internal/testing/event-id.test.ts b/packages/eve/src/internal/testing/event-id.test.tsnew file mode 100644index 000000000..cbaa1ada8--- /dev/null+++ b/packages/eve/src/internal/testing/event-id.test.ts@@ -0,0 +1,14 @@+import { describe, expect, it } from "vitest";++import { isEventId } from "#internal/testing/event-id.js";+import { createEventId, EVENT_ID_PREFIX } from "#protocol/event-id.js";++describe("isEventId", () => {+ it("rejects a bare ULID, a wrong length, or a non-Crockford character", () => {+ const body = createEventId().slice(EVENT_ID_PREFIX.length);++ expect(isEventId(body)).toBe(false);+ expect(isEventId(`${EVENT_ID_PREFIX}${body.slice(1)}`)).toBe(false);+ expect(isEventId(`${EVENT_ID_PREFIX}U${body.slice(1)}`)).toBe(false);+ });+});diff --git a/packages/eve/src/internal/testing/event-id.ts b/packages/eve/src/internal/testing/event-id.tsnew file mode 100644index 000000000..369d3279f--- /dev/null+++ b/packages/eve/src/internal/testing/event-id.ts@@ -0,0 +1,13 @@+import { EVENT_ID_PREFIX } from "#protocol/event-id.js";++const ULID_SHAPE = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/u;++/**+ * Returns true when `value` has the shape `createEventId` produces: the event+ * id prefix followed by a Crockford base32 ULID.+ *+ * Shape-only: this does not prove eve minted the id.+ */+export function isEventId(value: string): boolean {+ return value.startsWith(EVENT_ID_PREFIX) && ULID_SHAPE.test(value.slice(EVENT_ID_PREFIX.length));+}diff --git a/packages/eve/src/internal/testing/events.ts b/packages/eve/src/internal/testing/events.tsindex 7bbbdac3f..8269a8470 100644--- a/packages/eve/src/internal/testing/events.ts+++ b/packages/eve/src/internal/testing/events.ts@@ -132,7 +132,7 @@ export function filterEventsByType<T extends UnstampedMessageStreamEvent["type"]* Options accepted by {@link captureTurnEvents} and* {@link captureTurnSequence}.*/-export interface CaptureTurnEventsOptions {+interface CaptureTurnEventsOptions {/*** Text decoder used to convert stream bytes into UTF-8 strings. Defaults* to a fresh `TextDecoder`. Tests rarely need to override this.diff --git a/packages/eve/src/internal/testing/fake-prompter.ts b/packages/eve/src/internal/testing/fake-prompter.tsindex 8c5302ceb..2ec158870 100644--- a/packages/eve/src/internal/testing/fake-prompter.ts+++ b/packages/eve/src/internal/testing/fake-prompter.ts@@ -14,7 +14,7 @@ import type {* answers a single-select (`select`) and `multiple` answers a checklist* (`select({ multiple: true })`).*/-export interface FakePrompterConfig {+interface FakePrompterConfig {text?: (opts: Parameters<Prompter["text"]>[0]) => string;password?: (opts: { message: string }) => string;single?: (opts: SingleSelectOptions<PrompterValue>) => PrompterValue | Promise<PrompterValue>;@@ -23,7 +23,7 @@ export interface FakePrompterConfig {) => PrompterValue[] | Promise<PrompterValue[]>;}-export interface FakePrompter {+interface FakePrompter {prompter: Prompter;/** Every `select` message in call order, for asserting which prompts ran. */selectMessages: string[];diff --git a/packages/eve/src/internal/testing/in-memory-agent-trace-state-store.ts b/packages/eve/src/internal/testing/in-memory-agent-trace-state-store.tsnew file mode 100644index 000000000..560e87c81--- /dev/null+++ b/packages/eve/src/internal/testing/in-memory-agent-trace-state-store.ts@@ -0,0 +1,129 @@+import type {+ AgentActionTraceState,+ AgentInvocationTraceState,+ AgentSessionTraceState,+ AgentTraceStateStore,+ AgentTurnTraceState,+} from "#tracing/agent-trace-state.js";++export class InMemoryAgentTraceStateStore implements AgentTraceStateStore {+ readonly #actionAnchors = new Map<string, AgentActionTraceState>();+ readonly #actions = new Map<string, AgentActionTraceState>();+ readonly #invocations = new Map<string, AgentInvocationTraceState>();+ readonly #sessions = new Map<string, AgentSessionTraceState>();+ readonly #turns = new Map<string, AgentTurnTraceState>();++ deleteAction(idempotencyKey: string): void {+ this.#actions.delete(idempotencyKey);+ }++ deleteActionAnchors(sessionId: string): void {+ for (const [key, state] of this.#actionAnchors) {+ if (state.sessionId === sessionId) this.#actionAnchors.delete(key);+ }+ }++ deleteActions(sessionId: string, turnId?: string): void {+ for (const [key, state] of this.#actions) {+ if (state.sessionId === sessionId && (turnId === undefined || state.turnId === turnId)) {+ this.#actions.delete(key);+ }+ }+ }++ deleteInvocation(idempotencyKey: string): void {+ this.#invocations.delete(idempotencyKey);+ }++ deleteInvocations(sessionId: string, turnId?: string): void {+ for (const [key, state] of this.#invocations) {+ if (state.sessionId === sessionId && (turnId === undefined || state.turnId === turnId)) {+ this.#invocations.delete(key);+ }+ }+ }++ deleteSession(sessionId: string): void {+ this.#sessions.delete(sessionId);+ }++ deleteTurn(sessionId: string, turnId: string): void {+ this.#turns.delete(turnKey(sessionId, turnId));+ }++ findAction(sessionId: string, callId: string): AgentActionTraceState | undefined {+ return [...this.#actions.values()].find(+ (state) => state.sessionId === sessionId && state.callId === callId,+ );+ }++ findActionAnchor(+ sessionId: string,+ turnId: string,+ callId: string,+ ): AgentActionTraceState | undefined {+ return [...this.#actionAnchors.values()].find(+ (state) =>+ state.sessionId === sessionId && state.turnId === turnId && state.callId === callId,+ );+ }++ findInvocations(+ sessionId?: string,+ turnId?: string,+ parentActionCallId?: string,+ ): readonly AgentInvocationTraceState[] {+ return [...this.#invocations.values()].filter(+ (state) =>+ (sessionId === undefined || state.sessionId === sessionId) &&+ (turnId === undefined || state.turnId === turnId) &&+ (parentActionCallId === undefined || state.parentActionCallId === parentActionCallId),+ );+ }++ getAction(idempotencyKey: string): AgentActionTraceState | undefined {+ return this.#actions.get(idempotencyKey);+ }++ getSession(sessionId: string): AgentSessionTraceState | undefined {+ return this.#sessions.get(sessionId);+ }++ getTurn(sessionId: string, turnId: string): AgentTurnTraceState | undefined {+ return this.#turns.get(turnKey(sessionId, turnId));+ }++ setAction(idempotencyKey: string, state: AgentActionTraceState): void {+ this.#actions.set(idempotencyKey, state);+ }++ setActionAnchor(idempotencyKey: string, state: AgentActionTraceState): void {+ this.#actionAnchors.set(idempotencyKey, state);+ }++ setInvocation(idempotencyKey: string, state: AgentInvocationTraceState): void {+ this.#invocations.set(idempotencyKey, state);+ }++ setSession(sessionId: string, state: AgentSessionTraceState): void {+ this.#sessions.set(sessionId, state);+ }++ setTurn(sessionId: string, turnId: string, state: AgentTurnTraceState): void {+ this.#turns.set(turnKey(sessionId, turnId), state);+ }++ updateTurn(+ sessionId: string,+ turnId: string,+ update: (state: AgentTurnTraceState) => AgentTurnTraceState,+ ): void {+ const key = turnKey(sessionId, turnId);+ const state = this.#turns.get(key);+ if (state !== undefined) this.#turns.set(key, update(state));+ }+}++function turnKey(sessionId: string, turnId: string): string {+ return `${sessionId}:${turnId}`;+}diff --git a/packages/eve/src/internal/testing/log-records.ts b/packages/eve/src/internal/testing/log-records.tsnew file mode 100644index 000000000..4340f303b--- /dev/null+++ b/packages/eve/src/internal/testing/log-records.ts@@ -0,0 +1,71 @@+import { onTestFinished, vi } from "vitest";++import { setLogRecordSubscriber, type LogRecord } from "#internal/logging.js";++/**+ * Routes eve logger records to an array for the rest of the current test+ * instead of the console, so a test that drives an expected failure path+ * can assert the record it produces rather than printing it.+ *+ * The subscriber slot is process-wide, so the helper registers its own+ * teardown rather than leaving that to each caller.+ */+export function captureLogRecords(): { readonly records: LogRecord[] } {+ const records: LogRecord[] = [];+ setLogRecordSubscriber((record) => records.push(record));+ onTestFinished(() => setLogRecordSubscriber(undefined));+ return { records };+}++/** Prefixes of workflow SDK console notices that integration tests drive on purpose. */+export const workflowSdkNotice = {+ fatalStep: "[workflow-sdk] Encountered FatalError while executing step",+ ignoredLatestDeployment: "[workflow-sdk] deploymentId: 'latest' has no effect in this world",+ maxRetries: "[workflow-sdk] Max retries reached, bubbling error to parent workflow",+ unpinnedDelivery:+ "[workflow-sdk] Queue message was delivered to a deployment it was not pinned to",+} as const;++/** Logged when a background task reports back after its parent session ended. */+export const taskParentEndedNotice =+ "[eve:execution.tasks.run] task notification target is gone; the parent session already ended";++// The workflow SDK reports a duplicate in-process delivery of the same step+// whenever redelivery races a slow step, so its presence depends on load.+const WORKFLOW_STEP_SINGLE_FLIGHT_NOTICE =+ "[workflow-sdk] Step execution already in flight in this process";++/**+ * Captures `console.error` and `console.warn` for the rest of the current+ * test and records the first argument of each call.+ *+ * Use this only for output that {@link captureLogRecords} cannot reach: code+ * running inside the bundled workflow runtime has its own copy of the eve+ * logger, and the vendored workflow SDK writes to the console directly.+ * `unexpected()` returns the lines that start with none of the given+ * prefixes, ignoring the SDK's load-dependent single-flight notice.+ */+export function captureConsoleOutput(): {+ readonly lines: string[];+ unexpected(...expected: string[]): string[];+} {+ const lines: string[] = [];+ const capture = (first?: unknown) => {+ lines.push(String(first));+ };+ const error = vi.spyOn(console, "error").mockImplementation(capture);+ const warn = vi.spyOn(console, "warn").mockImplementation(capture);+ onTestFinished(() => {+ error.mockRestore();+ warn.mockRestore();+ });+ return {+ lines,+ unexpected: (...expected) =>+ lines.filter(+ (line) =>+ !line.startsWith(WORKFLOW_STEP_SINGLE_FLIGHT_NOTICE) &&+ !expected.some((prefix) => line.startsWith(prefix)),+ ),+ };+}diff --git a/packages/eve/src/internal/testing/memory-agent-source.ts b/packages/eve/src/internal/testing/memory-agent-source.tsindex a761b6989..bbc7cc421 100644--- a/packages/eve/src/internal/testing/memory-agent-source.ts+++ b/packages/eve/src/internal/testing/memory-agent-source.ts@@ -10,7 +10,7 @@ import { createMemoryProjectSource, type ProjectSource } from "#discover/project* `agent/` (eg. `"instructions.md"`, `"tools/get_weather.ts"`) and the helper* materializes them under a synthetic absolute root (`/memory/app/agent/…`).*/-export interface MemoryAgentProjectInput {+interface MemoryAgentProjectInput {/*** Files authored relative to the agent root* (eg. `"instructions.md"`, `"tools/weather.ts"`).@@ -59,7 +59,7 @@ export interface MemoryAgentProjectInput {/*** Materialized in-memory project handed to tests.*/-export interface MemoryAgentProject {+interface MemoryAgentProject {/*** Absolute path of the synthetic app root. Use this as `appRoot` on any* `discover*({ agentRoot, appRoot, source })` call or as the start pathdiff --git a/packages/eve/src/internal/testing/mocks/mock-model.ts b/packages/eve/src/internal/testing/mocks/mock-model.tsdeleted file mode 100644index 678bc810b..000000000--- a/packages/eve/src/internal/testing/mocks/mock-model.ts+++ /dev/null@@ -1,43 +0,0 @@-import { shouldMockAuthoredRuntimeModels } from "#runtime/agent/mock-model-adapter.js";--/**- * Declarative description of the deterministic mock model surface used by- * the AppHarness.- */-export interface MockModelInput {- /**- * Authored model id applied to the resolved runtime model when overriding- * from the default. When omitted the descriptor leaves the model unchanged.- */- readonly id?: string;-}--/**- * A materialized mock model descriptor returned from {@link mockModel}.- */-export interface MockModel {- /** Effective model id applied to the resolved runtime model. */- readonly id?: string;- /**- * Returns `true` when the mock adapter is active in the current process.- * Always true when the unit/integration tiers run with `NODE_ENV=test`.- */- isActive(): boolean;-}--/**- * Builds a {@link MockModel} descriptor for the AppHarness.- *- * The current implementation is intentionally thin: it delegates to the- * existing auto-activated mock adapter so the full deterministic behaviour- * (weather tool calls, skill load calls, bootstrap replies) is available- * without further wiring.- */-export function mockModel(input: MockModelInput = {}): MockModel {- return {- id: input.id,- isActive() {- return shouldMockAuthoredRuntimeModels();- },- };-}diff --git a/packages/eve/src/internal/testing/mocks/mock-sandbox.ts b/packages/eve/src/internal/testing/mocks/mock-sandbox.tsindex c09c95496..d42488925 100644--- a/packages/eve/src/internal/testing/mocks/mock-sandbox.ts+++ b/packages/eve/src/internal/testing/mocks/mock-sandbox.ts@@ -29,7 +29,7 @@ import { bufferToStream, streamToBuffer } from "#execution/sandbox/stream-utils.* `MockSandbox` after running a tool to assert on ordering, arguments,* or file contents without touching disk or spawning processes.*/-export interface MockSandboxInput {+interface MockSandboxInput {/** Callback invoked when authored runtime code deletes this sandbox. */readonly delete?: () => Promise<void> | void;/**diff --git a/packages/eve/src/internal/testing/mocks/mock-tool.ts b/packages/eve/src/internal/testing/mocks/mock-tool.tsindex f271b37f8..ef0ae598c 100644--- a/packages/eve/src/internal/testing/mocks/mock-tool.ts+++ b/packages/eve/src/internal/testing/mocks/mock-tool.ts@@ -12,7 +12,7 @@ import { toInputSchema } from "#tools/schema.js";* source id, permissive input schema) so most tests can supply just a name* and an `execute` function. Everything else is overrideable.*/-export interface MockToolInput {+interface MockToolInput {/** Presentation callbacks derived from tool lifecycle values. */readonly label?: ResolvedToolDefinition["label"];/** Tool name exposed to the model. */diff --git a/packages/eve/src/internal/testing/run-pnpm-command.ts b/packages/eve/src/internal/testing/run-pnpm-command.tsindex b7dbf9334..bef30f09a 100644--- a/packages/eve/src/internal/testing/run-pnpm-command.ts+++ b/packages/eve/src/internal/testing/run-pnpm-command.ts@@ -1,8 +1,8 @@import { execFile } from "node:child_process";+import { existsSync } from "node:fs";+import { extname, join } from "node:path";import { promisify } from "node:util";-import { resolvePnpmInvocation } from "#internal/process/pnpm.js";-const runFile = promisify(execFile);interface PnpmCommandInput {@@ -18,7 +18,7 @@ interface PnpmCommandInput {* that need to parse output (e.g. `pnpm dlx vercel deploy --json`) read* `stdout` directly.*/-export interface PnpmCommandResult {+interface PnpmCommandResult {readonly stderr: string;readonly stdout: string;}@@ -72,3 +72,69 @@ export async function runPnpmCommand(input: PnpmCommandInput): Promise<PnpmComma);}}++/**+ * Resolved invocation for the host's pnpm executable. The shape carries+ * everything `child_process.spawn` and `execFile` need to dispatch to the+ * right binary across macOS/Linux PATH installs, Corepack-managed shims,+ * and Windows runners that surface pnpm only through `PNPM_HOME`.+ */+interface PnpmInvocation {+ readonly args: readonly string[];+ readonly command: string;+ readonly shell?: boolean;+}++/**+ * Picks the right pnpm executable for the current host. Resolution order:+ *+ * 1. `PNPM_HOME` — the standard install location used by Corepack and the+ * pnpm installers. On Windows, points at `pnpm.CMD` because the bare+ * `pnpm` shim is not directly invokable from a non-shell spawn.+ * 2. `npm_execpath` — set when the current process was launched by an+ * npm-compatible package manager. Pointing at a `.cjs`/`.js` entry+ * means we have to run it through `node` (typical for Corepack+ * shims); otherwise treat it as a bare executable path.+ * 3. Bare `pnpm` on PATH — the macOS/Linux happy path.+ *+ * Pure: no side effects, returns the invocation shape.+ */+function resolvePnpmInvocation(args: readonly string[]): PnpmInvocation {+ const pnpmHome = process.env.PNPM_HOME;++ if (pnpmHome !== undefined) {+ const command = join(pnpmHome, process.platform === "win32" ? "pnpm.CMD" : "pnpm");++ if (existsSync(command)) {+ return {+ args,+ command,+ shell: process.platform === "win32",+ };+ }+ }++ const npmExecPath = process.env.npm_execpath;++ if (npmExecPath !== undefined && npmExecPath.toLowerCase().includes("pnpm")) {+ const extension = extname(npmExecPath).toLowerCase();++ if (extension === ".cjs" || extension === ".js") {+ return {+ args: [npmExecPath, ...args],+ command: process.execPath,+ };+ }++ return {+ args,+ command: npmExecPath,+ shell: process.platform === "win32",+ };+ }++ return {+ args,+ command: "pnpm",+ };+}diff --git a/packages/eve/src/internal/testing/scenario-app.ts b/packages/eve/src/internal/testing/scenario-app.tsindex 7dd0e299b..0b894a930 100644--- a/packages/eve/src/internal/testing/scenario-app.ts+++ b/packages/eve/src/internal/testing/scenario-app.ts@@ -83,7 +83,7 @@ export interface ScenarioAppDescriptor {* Handle to a materialized scenario app. Callers must call* {@link ScenarioApp.cleanup} in `afterEach` / `afterAll`.*/-export interface ScenarioApp {+interface ScenarioApp {/** Absolute filesystem path to the materialized app root. */readonly appRoot: string;/** Removes the app root and all transient artifacts. */diff --git a/packages/eve/src/internal/testing/scenario-apps/index.ts b/packages/eve/src/internal/testing/scenario-apps/index.tsindex 08f5107c0..d93fcf6bc 100644--- a/packages/eve/src/internal/testing/scenario-apps/index.ts+++ b/packages/eve/src/internal/testing/scenario-apps/index.ts@@ -3,7 +3,6 @@ export { DISCORD_ROUTE_PORTABILITY_DESCRIPTOR } from "#internal/testing/scenarioexport { EXTENSION_AGENT_DESCRIPTOR } from "#internal/testing/scenario-apps/extension-agent.js";export { GITHUB_ROUTE_PORTABILITY_DESCRIPTOR } from "#internal/testing/scenario-apps/github-route-portability.js";export { EVE_ROUTE_PORTABILITY_DESCRIPTOR } from "#internal/testing/scenario-apps/eve-route-portability.js";-export { SANDBOX_BUNDLING_DESCRIPTOR } from "#internal/testing/scenario-apps/sandbox-bundling.js";export { SANDBOX_WORKSPACES_DESCRIPTOR } from "#internal/testing/scenario-apps/sandbox-workspaces.js";export { SLACK_CUSTOM_CHANNEL_PORTABILITY_DESCRIPTOR } from "#internal/testing/scenario-apps/slack-custom-channel-portability.js";export { SLACK_ROUTE_PORTABILITY_DESCRIPTOR } from "#internal/testing/scenario-apps/slack-route-portability.js";diff --git a/packages/eve/src/internal/testing/scenario-apps/next-eve-proxy.ts b/packages/eve/src/internal/testing/scenario-apps/next-eve-proxy.tsindex 5a7fd7008..111566797 100644--- a/packages/eve/src/internal/testing/scenario-apps/next-eve-proxy.ts+++ b/packages/eve/src/internal/testing/scenario-apps/next-eve-proxy.ts@@ -5,7 +5,7 @@ import type { ScenarioAppDescriptor } from "#internal/testing/scenario-app.js";const require = createRequire(import.meta.url);const nextRequire = createRequire(require.resolve("next/package.json"));-export interface NextEveProxyDescriptorOptions {+interface NextEveProxyDescriptorOptions {readonly installDependencies?: boolean;readonly vercelVersion?: string;}diff --git a/packages/eve/src/internal/testing/scenario-apps/nuxt-eve-service.ts b/packages/eve/src/internal/testing/scenario-apps/nuxt-eve-service.tsindex 5a322d993..4b7b61f01 100644--- a/packages/eve/src/internal/testing/scenario-apps/nuxt-eve-service.ts+++ b/packages/eve/src/internal/testing/scenario-apps/nuxt-eve-service.ts@@ -6,7 +6,7 @@ import type { ScenarioAppDescriptor } from "#internal/testing/scenario-app.js";const NUXT_VERSION = "^4.0.0";const VUE_VERSION = "^3.5.0";-export interface NuxtEveServiceDescriptorOptions {+interface NuxtEveServiceDescriptorOptions {readonly installDependencies?: boolean;}diff --git a/packages/eve/src/internal/testing/scenario-apps/sandbox-bundling.ts b/packages/eve/src/internal/testing/scenario-apps/sandbox-bundling.tsdeleted file mode 100644index 66fa8356f..000000000--- a/packages/eve/src/internal/testing/scenario-apps/sandbox-bundling.ts+++ /dev/null@@ -1,60 +0,0 @@-import type { ScenarioAppDescriptor } from "#internal/testing/scenario-app.js";--/**- * Scenario-tier descriptor exercising sandbox-bundling diagnostics. Used by- * the Vercel e2e deployment tests to verify the hosted bundle loads cleanly:- * the local sandbox backend (Docker + optional just-bash engines) must be- * pruned and the vendored `@vercel/sandbox` chunk must resolve.- */-export const SANDBOX_BUNDLING_DESCRIPTOR: ScenarioAppDescriptor = {- dependencies: {- zod: "^4.3.6",- },- files: {- ".gitignore": `.vercel-`,- "agent/agent.ts": `import { defineAgent } from "eve";--export default defineAgent({- model: "openai/gpt-5.4-mini",-});-`,- "agent/channels/eve.ts": `import { none } from "eve/channels/auth";-import { eveChannel } from "eve/channels/eve";--export default eveChannel({ auth: none() });-`,- "agent/instructions.md": `You are a sandbox bundling diagnostics assistant. Use the framework-provided bash tool to inspect the deployed environment.-`,- "tsconfig.json": `{- "$schema": "https://json.schemastore.org/tsconfig",- "compilerOptions": {- "target": "ES2024",- "lib": ["ES2024"],- "module": "esnext",- "moduleResolution": "bundler",- "moduleDetection": "force",- "verbatimModuleSyntax": true,- "noEmit": true,- "erasableSyntaxOnly": true,- "strict": true,- "isolatedModules": true,- "forceConsistentCasingInFileNames": true,- "noUncheckedIndexedAccess": true,- "noFallthroughCasesInSwitch": true,- "noImplicitOverride": true,- "useUnknownInCatchVariables": true,- "resolveJsonModule": true,- "skipLibCheck": true,- "types": ["node"],- "allowJs": true,- "rootDir": "."- },- "include": ["agent/**/*"],- "exclude": ["node_modules", "dist", "build", ".turbo", ".vercel"]-}-`,- },- installDependencies: true,- name: "sandbox-bundling",-};diff --git a/packages/eve/src/internal/testing/scenario-apps/session-reset.ts b/packages/eve/src/internal/testing/scenario-apps/session-reset.tsdeleted file mode 100644index c68115cac..000000000--- a/packages/eve/src/internal/testing/scenario-apps/session-reset.ts+++ /dev/null@@ -1,45 +0,0 @@-import type { ScenarioAppDescriptor } from "#internal/testing/scenario-app.js";--/** Vercel deployment fixture for continuation-token session reset behavior. */-export const SESSION_RESET_DESCRIPTOR: ScenarioAppDescriptor = {- files: {- "agent/agent.ts": `import { defineAgent } from "eve";--export default defineAgent({ model: "openai/gpt-5.4-mini" });-`,- "agent/channels/threads.ts": `import { defineChannel, POST } from "eve/channels";--const AUTH = {- attributes: { source: "session-reset-vercel-test" },- authenticator: "session-reset-vercel-test",- principalId: "session-reset-vercel-test",- principalType: "service",-};--export default defineChannel({- routes: [- POST("/session-reset/:threadId/messages", async (request, { from, params }) => {- const body = (await request.json().catch(() => ({}))) as { message?: string };- const session = await from(params.threadId ?? "").send(body.message ?? "Reply with hello.", {- auth: AUTH,- });- return Response.json({ sessionId: session.id });- }),- POST("/session-reset/:threadId/owner", async (_request, { params, resolveSession }) => {- const owner = await resolveSession(params.threadId ?? "");- return Response.json({ sessionId: owner?.id ?? null });- }),- POST("/session-reset/:threadId/new", async (_request, { from, params }) => {- return Response.json(- await from(params.threadId ?? "").reset({- reason: "Vercel session reset integration test",- }),- );- }),- ],-});-`,- "agent/instructions.md": "You are a concise test assistant.\n",- },- name: "session-reset",-};diff --git a/packages/eve/src/internal/testing/scenario-apps/sveltekit-eve-service.ts b/packages/eve/src/internal/testing/scenario-apps/sveltekit-eve-service.tsindex 14cfafd2d..6b5c6087a 100644--- a/packages/eve/src/internal/testing/scenario-apps/sveltekit-eve-service.ts+++ b/packages/eve/src/internal/testing/scenario-apps/sveltekit-eve-service.ts@@ -4,7 +4,7 @@ const SVELTEKIT_VERSION = "^2.63.0";const SVELTE_VERSION = "^5.0.0";const VITE_VERSION = "^8.1.5";-export interface SvelteKitEveServiceDescriptorOptions {+interface SvelteKitEveServiceDescriptorOptions {readonly installDependencies?: boolean;}diff --git a/packages/eve/src/internal/testing/slack-api-body.ts b/packages/eve/src/internal/testing/slack-api-body.tsnew file mode 100644index 000000000..31513866e--- /dev/null+++ b/packages/eve/src/internal/testing/slack-api-body.ts@@ -0,0 +1,20 @@+/** Decodes a Slack Web API request body captured from a mocked `fetch`. */+export function decodeSlackApiBody(body: unknown, contentType: string | null): unknown {+ if (typeof body !== "string") return body;+ if (contentType?.includes("application/json")) return parseJson(body);+ if (!contentType?.includes("application/x-www-form-urlencoded")) return body;++ const parsed: Record<string, unknown> = {};+ for (const [key, value] of new URLSearchParams(body)) {+ parsed[key] = value.startsWith("[") || value.startsWith("{") ? parseJson(value) : value;+ }+ return parsed;+}++function parseJson(value: string): unknown {+ try {+ return JSON.parse(value);+ } catch {+ return value;+ }+}diff --git a/packages/eve/src/public/models/openai/chatgpt/unsigned-jwt.ts b/packages/eve/src/internal/testing/unsigned-jwt.tssimilarity index 100%rename from packages/eve/src/public/models/openai/chatgpt/unsigned-jwt.tsrename to packages/eve/src/internal/testing/unsigned-jwt.tsdiff --git a/packages/eve/src/internal/testing/use-temporary-app-roots.ts b/packages/eve/src/internal/testing/use-temporary-app-roots.tsindex c0af8d060..dc78a3951 100644--- a/packages/eve/src/internal/testing/use-temporary-app-roots.ts+++ b/packages/eve/src/internal/testing/use-temporary-app-roots.ts@@ -9,7 +9,7 @@ import { resolvePackageRoot } from "#internal/application/package.js";* Options accepted by the factory returned from* {@link useTemporaryAppRoots}.*/-export interface CreateTemporaryAppRootOptions {+interface CreateTemporaryAppRootOptions {/** Value written into the synthetic `package.json#name`. */readonly packageName?: string;/** Value written into the synthetic `package.json#type`. */@@ -24,7 +24,7 @@ export interface CreateTemporaryAppRootOptions {/*** Handle returned by the {@link useTemporaryAppRoots} factory.*/-export interface TemporaryAppRoot {+interface TemporaryAppRoot {/** Absolute path to the temporary app root. */readonly appRoot: string;/**diff --git a/packages/eve/src/internal/testing/workflow-step-registrations.ts b/packages/eve/src/internal/testing/workflow-step-registrations.tsnew file mode 100644index 000000000..6961af26d--- /dev/null+++ b/packages/eve/src/internal/testing/workflow-step-registrations.ts@@ -0,0 +1,96 @@+import { mkdir } from "node:fs/promises";+import { dirname } from "node:path";++import { resolveWorkflowModulePath } from "#internal/application/package.js";+import { buildSingleRolldownChunk } from "#internal/bundler/nitro-rolldown.js";+import {+ createEvePackageImportsPlugin,+ createWorkflowImport,+ createWorkflowPseudoPackagePlugin,+ createWorkflowTransformPlugin,+ createWorkflowVirtualEntryPlugin,+ WORKFLOW_SOURCE_EXTENSIONS,+ WORKFLOW_VIRTUAL_ENTRY_ID,+ type WorkflowBundleDiscoveredEntries,+} from "#internal/workflow-bundle/builder-support.js";+import { WORKFLOW_STEP_EXTERNAL_PACKAGES } from "#internal/workflow-bundle/vercel-workflow-output.js";+import type { WorkflowManifest } from "#internal/workflow-bundle/workflow-builders.js";+import { atomicWriteFile } from "#shared/atomic-write-file.js";++/**+ * Bundles step registrations for the Vitest workflow world. Hosted builds let+ * Nitro bundle the raw `steps.mjs` entrypoint; tests load it directly, so the+ * step-mode transform has to be applied here.+ */+export async function bundleWorkflowStepRegistrations(input: {+ builtinsPath: string;+ discoveredEntries: WorkflowBundleDiscoveredEntries;+ outfile: string;+ projectRoot: string;+ tsconfigPath?: string;+ workingDir: string;+}): Promise<void> {+ const stepFiles = [...input.discoveredEntries.discoveredSteps].sort();+ const stepFileSet = new Set(stepFiles);+ const serdeOnlyFiles = [...input.discoveredEntries.discoveredSerdeFiles]+ .sort()+ .filter((filePath) => !stepFileSet.has(filePath));+ const manifest: WorkflowManifest = {};+ const virtualEntrySource = [+ createWorkflowImport(input.builtinsPath, input.workingDir),+ ...stepFiles.map((filePath) => createWorkflowImport(filePath, input.workingDir)),+ ...serdeOnlyFiles.map((filePath) => createWorkflowImport(filePath, input.workingDir)),+ "export const __steps_registered = true;",+ ].join("\n");+ const chunk = await buildSingleRolldownChunk(`step registrations bundle for "${input.outfile}"`, {+ cwd: input.workingDir,+ input: WORKFLOW_VIRTUAL_ENTRY_ID,+ // Optional runtime packages (the just-bash sandbox engine and its+ // native codecs) resolve lazily against the application install at+ // run time; inlining them would drag platform-specific `.node`+ // binaries into the step bundle.+ external: isWorkflowStepExternalPackage,+ platform: "node",+ plugins: [+ createWorkflowVirtualEntryPlugin(virtualEntrySource),+ createWorkflowPseudoPackagePlugin(),+ {+ name: "eve-workflow-runtime-aliases",+ resolveId(source: string) {+ if (source !== "workflow" && !source.startsWith("workflow/")) {+ return undefined;+ }++ return resolveWorkflowModulePath(source);+ },+ },+ createEvePackageImportsPlugin(input.workingDir),+ createWorkflowTransformPlugin({+ manifest,+ mode: "step",+ projectRoot: input.projectRoot,+ sideEffectFiles: [...stepFiles, ...serdeOnlyFiles],+ workingDir: input.workingDir,+ }),+ ],+ resolve: {+ conditionNames: ["eve-source"],+ extensions: WORKFLOW_SOURCE_EXTENSIONS,+ mainFields: ["module", "main"],+ },+ tsconfig: input.tsconfigPath ?? false,+ output: {+ comments: false,+ format: "esm",+ sourcemap: "inline",+ },+ });+ await mkdir(dirname(input.outfile), { recursive: true });+ await atomicWriteFile(input.outfile, chunk.code);+}++function isWorkflowStepExternalPackage(source: string): boolean {+ return WORKFLOW_STEP_EXTERNAL_PACKAGES.some(+ (packageName) => source === packageName || source.startsWith(`${packageName}/`),+ );+}diff --git a/packages/eve/src/internal/testing/workflow-test-helpers.ts b/packages/eve/src/internal/testing/workflow-test-helpers.tsindex 74e2d39dd..8b050ace7 100644--- a/packages/eve/src/internal/testing/workflow-test-helpers.ts+++ b/packages/eve/src/internal/testing/workflow-test-helpers.ts@@ -9,7 +9,7 @@ interface WorkflowEventLike {readonly eventType?: string;}-export interface WorkflowHookLike {+interface WorkflowHookLike {readonly hookId: string;readonly token: string;}diff --git a/packages/eve/src/internal/vercel/assemble-eve-services.ts b/packages/eve/src/internal/vercel/assemble-eve-services.tsindex 50b45fd59..6b6578384 100644--- a/packages/eve/src/internal/vercel/assemble-eve-services.ts+++ b/packages/eve/src/internal/vercel/assemble-eve-services.ts@@ -13,12 +13,12 @@ import type {VercelServiceConfig,} from "#internal/vercel/vercel-services-config.js";-export interface EveVercelServiceTarget {+interface EveVercelServiceTarget {readonly agent: EveVercelAgentTarget;readonly target: EveVercelBuildTarget;}-export interface AssembledEveVercelServices {+interface AssembledEveVercelServices {readonly rootDirectories: readonly string[];readonly routes: readonly VercelRouteConfig[];readonly services: Readonly<Record<string, VercelServiceConfig>>;diff --git a/packages/eve/src/internal/vercel/eve-service-contribution.ts b/packages/eve/src/internal/vercel/eve-service-contribution.tsindex 4bd6f7b33..3614d1a41 100644--- a/packages/eve/src/internal/vercel/eve-service-contribution.ts+++ b/packages/eve/src/internal/vercel/eve-service-contribution.ts@@ -39,7 +39,7 @@ export interface EveVercelBuildTarget {readonly projectRoot: string;}-export interface EveVercelServiceContribution {+interface EveVercelServiceContribution {readonly homeRouteSrc: string | undefined;readonly rootDirectory: string;readonly routeSrc: string;@@ -92,7 +92,7 @@ export function createEveHomeRouteSrc(publicRoutePrefix: string): string | undef}/** Route a member's public base path to its package-owned home channel. */-export function createEveHomePathRoute(publicRoutePrefix: string): VercelRouteConfig | undefined {+function createEveHomePathRoute(publicRoutePrefix: string): VercelRouteConfig | undefined {const src = createEveHomeRouteSrc(publicRoutePrefix);return src === undefined? undefineddiff --git a/packages/eve/src/internal/vercel/project-link.ts b/packages/eve/src/internal/vercel/project-link.tsindex 152ad3234..505459e52 100644--- a/packages/eve/src/internal/vercel/project-link.ts+++ b/packages/eve/src/internal/vercel/project-link.ts@@ -3,7 +3,7 @@ import { dirname, join, relative } from "node:path";import { z } from "#compiled/zod/index.js";-export const VercelProjectLinkSchema = z.object({+const VercelProjectLinkSchema = z.object({projectId: z.string().min(1),orgId: z.string().min(1),projectName: z.string().min(1).optional(),diff --git a/packages/eve/src/internal/workflow-bundle/builder-support.ts b/packages/eve/src/internal/workflow-bundle/builder-support.tsindex 5efd8f884..51f9bdf8a 100644--- a/packages/eve/src/internal/workflow-bundle/builder-support.ts+++ b/packages/eve/src/internal/workflow-bundle/builder-support.ts@@ -6,7 +6,6 @@ import { dirname, extname, join, relative, resolve } from "node:path";import { atomicWriteFile } from "#shared/atomic-write-file.js";-import { buildSingleRolldownChunk } from "#internal/bundler/nitro-rolldown.js";import { normalizeEsmImportSpecifier } from "#internal/application/import-specifier.js";import { resolvePackageRoot, resolveWorkflowModulePath } from "#internal/application/package.js";import {@@ -14,7 +13,6 @@ import {getImportPath,type WorkflowManifest,} from "#internal/workflow-bundle/workflow-builders.js";-import { WORKFLOW_STEP_EXTERNAL_PACKAGES } from "#internal/workflow-bundle/vercel-workflow-output.js";export const WORKFLOW_VIRTUAL_ENTRY_ID = "\0eve-workflow-entry";@@ -219,19 +217,6 @@ export function createWorkflowPseudoPackagePlugin(): WorkflowRolldownPlugin {};}-export function createWorkflowRuntimeAliasPlugin(): WorkflowRolldownPlugin {- return {- name: "eve-workflow-runtime-aliases",- resolveId(source: string) {- if (source !== "workflow" && !source.startsWith("workflow/")) {- return undefined;- }-- return resolveWorkflowModulePath(source);- },- };-}-/*** `workflow` resolves to the body-side shim. A `workflow/api` import still live* after step bodies were stubbed means a body calls the runtime API; fail the@@ -354,69 +339,6 @@ export function createWorkflowTransformPlugin(input: {};}-export async function bundleWorkflowStepRegistrations(input: {- builtinsPath: string;- discoveredEntries: WorkflowBundleDiscoveredEntries;- outfile: string;- projectRoot: string;- tsconfigPath?: string;- workingDir: string;-}): Promise<void> {- const stepFiles = [...input.discoveredEntries.discoveredSteps].sort();- const stepFileSet = new Set(stepFiles);- const serdeOnlyFiles = [...input.discoveredEntries.discoveredSerdeFiles]- .sort()- .filter((filePath) => !stepFileSet.has(filePath));- const manifest: WorkflowManifest = {};- const virtualEntrySource = [- createWorkflowImport(input.builtinsPath, input.workingDir),- ...stepFiles.map((filePath) => createWorkflowImport(filePath, input.workingDir)),- ...serdeOnlyFiles.map((filePath) => createWorkflowImport(filePath, input.workingDir)),- "export const __steps_registered = true;",- ].join("\n");- const chunk = await buildSingleRolldownChunk(`step registrations bundle for "${input.outfile}"`, {- cwd: input.workingDir,- input: WORKFLOW_VIRTUAL_ENTRY_ID,- // Optional runtime packages (the just-bash sandbox engine and its- // native codecs) resolve lazily against the application install at- // run time; inlining them would drag platform-specific `.node`- // binaries into the step bundle.- external: isWorkflowStepExternalPackage,- platform: "node",- plugins: [- createWorkflowVirtualEntryPlugin(virtualEntrySource),- createWorkflowPseudoPackagePlugin(),- createWorkflowRuntimeAliasPlugin(),- createEvePackageImportsPlugin(input.workingDir),- createWorkflowTransformPlugin({- manifest,- mode: "step",- projectRoot: input.projectRoot,- sideEffectFiles: [...stepFiles, ...serdeOnlyFiles],- workingDir: input.workingDir,- }),- ],- resolve: {- conditionNames: ["eve-source"],- extensions: WORKFLOW_SOURCE_EXTENSIONS,- mainFields: ["module", "main"],- },- tsconfig: input.tsconfigPath ?? false,- output: {- comments: false,- format: "esm",- sourcemap: "inline",- },- });- await writeWorkflowBundleAtomically(input.outfile, chunk.code);-}--function isWorkflowStepExternalPackage(source: string): boolean {- return WORKFLOW_STEP_EXTERNAL_PACKAGES.some(- (packageName) => source === packageName || source.startsWith(`${packageName}/`),- );-}-export function createWorkflowNodeBuiltinGuardPlugin(): WorkflowRolldownPlugin {return {name: "eve-workflow-node-builtins",diff --git a/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.test.ts b/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.test.tsindex 0e621711c..f1bd570e9 100644--- a/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.test.ts+++ b/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.test.ts@@ -1662,7 +1662,8 @@ export default defineDynamic({}const tools = buildTools(baseUrl);const timestamp = Date.now();- console.log("tools built at", timestamp);+ const audit = [];+ audit.push("tools built at " + timestamp);return tools;},},diff --git a/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.ts b/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.tsindex 2bda4a7a9..519ff8bf9 100644--- a/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.ts+++ b/packages/eve/src/internal/workflow-bundle/dynamic-tool-transform.ts@@ -95,9 +95,6 @@ interface WalkContext {readonly workflowFunctions: ReadonlySet<string>;}-// Keep the old export name for backward compatibility with the plugin.-export { transformDynamicToolExecute as transformDynamicToolAwait };-function findDefineToolAliases(ast: AstNode,names: readonly string[] = ["defineTool", "defineWorkflowTool"],diff --git a/packages/eve/src/internal/workflow/development-world-codec.ts b/packages/eve/src/internal/workflow/development-world-codec.tsindex cc1704600..27136e4b5 100644--- a/packages/eve/src/internal/workflow/development-world-codec.ts+++ b/packages/eve/src/internal/workflow/development-world-codec.ts@@ -14,7 +14,7 @@ interface EncodedValue {readonly data?: unknown;}-export interface SerializedDevelopmentWorldError {+interface SerializedDevelopmentWorldError {readonly details: Readonly<Record<string, unknown>>;readonly message: string;readonly name: string;diff --git a/packages/eve/src/internal/workflow/world-compatibility.ts b/packages/eve/src/internal/workflow/world-compatibility.tsindex 1446f51fb..612239998 100644--- a/packages/eve/src/internal/workflow/world-compatibility.ts+++ b/packages/eve/src/internal/workflow/world-compatibility.ts@@ -14,7 +14,7 @@ export interface WorkflowWorldManifest {readonly peerDependencies?: Readonly<Record<string, string>>;}-export interface AssertWorkflowWorldCompatibilityInput {+interface AssertWorkflowWorldCompatibilityInput {/** Package name of the configured world, used only for the error message. */readonly worldPackageName: string;/** Parsed `package.json` of the installed configured world. */diff --git a/packages/eve/src/protocol/activity.ts b/packages/eve/src/protocol/activity.tsindex 8de362f3e..81a6c81b2 100644--- a/packages/eve/src/protocol/activity.ts+++ b/packages/eve/src/protocol/activity.ts@@ -1,10 +1,10 @@-export const MAX_ACTIVITY_EVENTS_PER_BATCH = 100;+const MAX_ACTIVITY_EVENTS_PER_BATCH = 100;export type ActivityWorkKind = "root-turn" | "subagent" | "remote-agent" | "task";export type ActivityWorkPhase = "running" | "completed" | "failed" | "cancelled";-export type ActivityActionKind = "tool" | "skill";+type ActivityActionKind = "tool" | "skill";export type ActivityActionPhase = "running" | "completed" | "failed" | "rejected" | "cancelled";-export type ActivityBlockerKind = "approval" | "authorization" | "input";+type ActivityBlockerKind = "approval" | "authorization" | "input";export type ActivityBlockerPhase = "blocked" | "completed" | "cancelled" | "failed";export interface ActivityWorkIdentityV1 {diff --git a/packages/eve/src/protocol/baggage.ts b/packages/eve/src/protocol/baggage.tsindex 22493c4c6..8d9f8f495 100644--- a/packages/eve/src/protocol/baggage.ts+++ b/packages/eve/src/protocol/baggage.ts@@ -22,8 +22,8 @@ interface BaggageMember {readonly properties: readonly BaggageProperty[];}-export type ForwardedTraceBaggage = "absent" | "malformed" | ForwardedTraceAssertion;-export type ForwardedParentSessionBaggage = "absent" | "malformed" | SessionParent;+type ForwardedTraceBaggage = "absent" | "malformed" | ForwardedTraceAssertion;+type ForwardedParentSessionBaggage = "absent" | "malformed" | SessionParent;/** Reads remote parent lineage without trusting the caller that supplied it. */export function readForwardedParentSessionBaggage(diff --git a/packages/eve/src/protocol/cancel-turn.ts b/packages/eve/src/protocol/cancel-turn.tsindex d6a9fad89..ff2a0368d 100644--- a/packages/eve/src/protocol/cancel-turn.ts+++ b/packages/eve/src/protocol/cancel-turn.ts@@ -1,8 +1,5 @@import { z } from "#compiled/zod/index.js";-/** Outcome of requesting cooperative turn cancellation. */-export type CancelTurnStatus = "accepted" | "no_active_turn";-/** Transport-independent result of requesting cooperative turn cancellation. */export type CancelTurnResult =| { readonly sessionId: string; readonly status: "accepted" }diff --git a/packages/eve/src/protocol/event-dedupe.ts b/packages/eve/src/protocol/event-dedupe.tsindex 1706e73bb..3260406c7 100644--- a/packages/eve/src/protocol/event-dedupe.ts+++ b/packages/eve/src/protocol/event-dedupe.ts@@ -1,7 +1,7 @@import type { MessageStreamEvent } from "#protocol/message.js";/** Remembers which session-stream events have already been consumed. */-export type EventDeduper = {+type EventDeduper = {/*** Records `event` and returns true when it is new — false when its id was* already admitted, so the caller should drop it.diff --git a/packages/eve/src/protocol/event-id.test.ts b/packages/eve/src/protocol/event-id.test.tsindex bb8c1ca50..64389c056 100644--- a/packages/eve/src/protocol/event-id.test.ts+++ b/packages/eve/src/protocol/event-id.test.ts@@ -1,27 +1,10 @@import { describe, expect, it } from "vitest";-import { createEventId, EVENT_ID_PREFIX, isEventId } from "#protocol/event-id.js";-import { isUlid } from "#shared/ulid.js";+import { isEventId } from "#internal/testing/event-id.js";+import { createEventId } from "#protocol/event-id.js";describe("createEventId", () => {it("prefixes a ULID", () => {- const id = createEventId();-- expect(id.startsWith(EVENT_ID_PREFIX)).toBe(true);- expect(isUlid(id.slice(EVENT_ID_PREFIX.length))).toBe(true);- });-});--describe("isEventId", () => {- it("accepts ids this module mints", () => {expect(isEventId(createEventId())).toBe(true);});-- it("rejects a bare ULID, a wrong length, or a non-Crockford character", () => {- const body = createEventId().slice(EVENT_ID_PREFIX.length);-- expect(isEventId(body)).toBe(false);- expect(isEventId(`${EVENT_ID_PREFIX}${body.slice(1)}`)).toBe(false);- expect(isEventId(`${EVENT_ID_PREFIX}U${body.slice(1)}`)).toBe(false);- });});diff --git a/packages/eve/src/protocol/event-id.ts b/packages/eve/src/protocol/event-id.tsindex aa192b7bf..2bef13c35 100644--- a/packages/eve/src/protocol/event-id.ts+++ b/packages/eve/src/protocol/event-id.ts@@ -1,4 +1,4 @@-import { createUlid, isUlid } from "#shared/ulid.js";+import { createUlid } from "#shared/ulid.js";/** Prefix stamped on every eve session stream event id. */export const EVENT_ID_PREFIX = "evt_";@@ -13,12 +13,3 @@ export const EVENT_ID_PREFIX = "evt_";export function createEventId(): string {return `${EVENT_ID_PREFIX}${createUlid()}`;}--/**- * Returns true when `value` has the shape {@link createEventId} produces.- *- * Shape-only: this does not prove eve minted the id.- */-export function isEventId(value: string): boolean {- return value.startsWith(EVENT_ID_PREFIX) && isUlid(value.slice(EVENT_ID_PREFIX.length));-}diff --git a/packages/eve/src/protocol/message.test.ts b/packages/eve/src/protocol/message.test.tsindex 99ab68d1c..4daeb22f6 100644--- a/packages/eve/src/protocol/message.test.ts+++ b/packages/eve/src/protocol/message.test.ts@@ -27,7 +27,7 @@ import {normalizePersistedMessageStreamEvent,type MessageStreamEventForVersion,} from "#protocol/message-version.js";-import { isEventId } from "#protocol/event-id.js";+import { isEventId } from "#internal/testing/event-id.js";import { createEveConnectionCallbackRoutePath } from "#protocol/routes.js";describe("message stream protocol", () => {diff --git a/packages/eve/src/protocol/traceparent.ts b/packages/eve/src/protocol/traceparent.tsindex e7d2861c9..22ff2893b 100644--- a/packages/eve/src/protocol/traceparent.ts+++ b/packages/eve/src/protocol/traceparent.ts@@ -1,6 +1,6 @@import { createTraceState, type TraceState } from "#compiled/@opentelemetry/api/index.js";-export interface TraceparentContext {+interface TraceparentContext {readonly isRemote?: boolean;readonly spanId: string;readonly traceFlags: number;diff --git a/packages/eve/src/public/channels/chat-sdk/audience.ts b/packages/eve/src/public/channels/chat-sdk/audience.tsindex 848678c37..7e562df18 100644--- a/packages/eve/src/public/channels/chat-sdk/audience.ts+++ b/packages/eve/src/public/channels/chat-sdk/audience.ts@@ -6,7 +6,7 @@ import type {} from "#public/channels/chat-sdk/chatSdkChannel.js";import type { AudienceContext } from "#shared/conversation-context.js";-export function chatSdkInstrumentationMetadata(+function chatSdkInstrumentationMetadata(state: ChatSdkChannelState,): ChatSdkInstrumentationMetadata {return {@@ -17,7 +17,7 @@ export function chatSdkInstrumentationMetadata(};}-export function chatSdkAudience(thread: SerializedThread | null): ChannelAudience {+function chatSdkAudience(thread: SerializedThread | null): ChannelAudience {if (thread?.isDM === true) return "private";if (thread?.channelVisibility === "workspace") return "public";if (thread?.channelVisibility === "private" || thread?.channelVisibility === "external") {diff --git a/packages/eve/src/public/channels/chat-sdk/chatSdkChannel.test.ts b/packages/eve/src/public/channels/chat-sdk/chatSdkChannel.test.tsindex 851f592c4..3635f34eb 100644--- a/packages/eve/src/public/channels/chat-sdk/chatSdkChannel.test.ts+++ b/packages/eve/src/public/channels/chat-sdk/chatSdkChannel.test.ts@@ -195,6 +195,8 @@ describe("chatSdkChannel", () => {const bridge = chatSdkChannel({adapters: { test: testAdapter() },state: memoryState(),+ // Tests that initialize Chat SDK keep its warnings but not its info-level startup lines.+ logger: "warn",userName: "bot",});const compiled = asCompiled<ChatSdkChannelState>(bridge.channel);@@ -227,6 +229,7 @@ describe("chatSdkChannel", () => {adapters: { test: adapter },concurrency: "concurrent",state: memoryState(),+ logger: "warn",userName: "bot",});@@ -268,6 +271,7 @@ describe("chatSdkChannel", () => {adapters: { test: testAdapter() },concurrency: "concurrent",state: memoryState(),+ logger: "warn",userName: "bot",});@@ -303,6 +307,7 @@ describe("chatSdkChannel", () => {adapters: { test: testAdapter() },concurrency: "concurrent",state: memoryState(),+ logger: "warn",userName: "bot",});@@ -716,6 +721,7 @@ describe("chatSdkChannel", () => {adapters: { test: adapter },concurrency: "concurrent",state: memoryState(),+ logger: "warn",userName: "bot",});const channelAdapter = withState(getAdapter(bridge.channel), {diff --git a/packages/eve/src/public/channels/discord/discordChannel.test.ts b/packages/eve/src/public/channels/discord/discordChannel.test.tsindex ccc309fde..e27c2fdb8 100644--- a/packages/eve/src/public/channels/discord/discordChannel.test.ts+++ b/packages/eve/src/public/channels/discord/discordChannel.test.ts@@ -15,6 +15,7 @@ import {renderInputRequestComponents,} from "#public/channels/discord/hitl.js";import { defaultDiscordAuth, discordChannel } from "#public/channels/discord/index.js";+import { captureLogRecords } from "#internal/testing/log-records.js";function asCompiled<T = unknown>(channel: unknown): CompiledChannel<T> {if (!isCompiledChannel(channel)) {@@ -268,6 +269,7 @@ describe("discordChannel() inbound route", () => {});it("rejects requests with invalid signatures", async () => {+ const logs = captureLogRecords();const { privateKey, publicKeyHex } = testKeys();const channel = discordChannel({ credentials: { publicKey: publicKeyHex } });@@ -282,6 +284,9 @@ describe("discordChannel() inbound route", () => {expect(response.status).toBe(401);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "discord inbound verification failed" }),+ );});it("delivers HITL button clicks as inputResponses", async () => {@@ -438,6 +443,7 @@ describe("discordChannel() default event handlers", () => {});it("swallows typing indicator failures", async () => {+ const logs = captureLogRecords();const fetchMock = vi.fn().mockRejectedValue(new Error("typing failed"));vi.stubGlobal("fetch", fetchMock);const adapter = withState(@@ -452,6 +458,12 @@ describe("discordChannel() default event handlers", () => {await expect(callAdapterEventHandler(adapter, makeEvent("turn.started", {}), ctx),).resolves.toEqual(makeEvent("turn.started", {}));+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "adapter event handler threw — event swallowed",+ }),+ );});it("uses the environment bot token for proactive messages", async () => {diff --git a/packages/eve/src/public/channels/discord/discordChannel.ts b/packages/eve/src/public/channels/discord/discordChannel.tsindex ddb6c9902..3ea17bdf9 100644--- a/packages/eve/src/public/channels/discord/discordChannel.ts+++ b/packages/eve/src/public/channels/discord/discordChannel.ts@@ -65,7 +65,7 @@ export interface DiscordContext {}/** Channel-owned Discord context returned by `context()`. */-export type DiscordChannelContext = DiscordContext & { state: DiscordChannelState };+type DiscordChannelContext = DiscordContext & { state: DiscordChannelState };/** Event-handler Discord context, including continuation routing. */export interface DiscordEventContext extends DiscordChannelContext, ChannelContinuationOps {}diff --git a/packages/eve/src/public/channels/eve-forwarded-principal.integration.test.ts b/packages/eve/src/public/channels/eve-forwarded-principal.integration.test.tsindex 69ba9835b..f81653276 100644--- a/packages/eve/src/public/channels/eve-forwarded-principal.integration.test.ts+++ b/packages/eve/src/public/channels/eve-forwarded-principal.integration.test.ts@@ -29,6 +29,7 @@ import { principalKey, resolveConnectionPrincipal } from "#runtime/connections/pimport type { CompiledBundle } from "#runtime/sessions/runtime-context-keys.js";import { eveChannel, type EveChannelInput } from "#public/channels/eve.js";import { attachRouteSessionCreator } from "#internal/nitro/routes/channel-route-context.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const ROUTER_CALLER: SessionAuthContext = {attributes: {},@@ -109,6 +110,7 @@ function createEveCreateHandler(input: EveChannelInput) {describe("eveChannel forwarded principal → runtime principal", () => {it("preserves origin audience and ceiling across adapter-state persistence", async () => {+ const logs = captureLogRecords();const trustedForwarders = vi.fn((caller: SessionAuthContext) => caller.principalId === ROUTER_CALLER.principalId,);@@ -224,11 +226,15 @@ describe("eveChannel forwarded principal → runtime principal", () => {// The audit attribute never enters Connect token-cache keying.expect(principalKey(principal)).toBe('["user","slack","slack:U123"]');expect(trustedForwarders).toHaveBeenCalledTimes(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "info", message: "accepted forwarded trace policy" }),+ );});it.each(["eve.audience=public;ceiling=i1", "eve.audience=public"])("keeps malformed or mixed-version baggage metadata-only: %s",async (baggage) => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({trustedForwarders: () => true,auth: () => ROUTER_CALLER,@@ -272,10 +278,17 @@ describe("eveChannel forwarded principal → runtime principal", () => {ceiling: { recordInputs: false, recordOutputs: false },originAudience: "unknown",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "using metadata-only policy for malformed forwarded audience baggage",+ }),+ );},);it("ignores a ceiling that disagrees with unsampled trace flags", async () => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({trustedForwarders: () => true,auth: () => ROUTER_CALLER,@@ -305,9 +318,16 @@ describe("eveChannel forwarded principal → runtime principal", () => {expect(handler.createSession.mock.calls[0]?.[0]?.parentTraceContext).not.toHaveProperty("forwardedTracePolicy",);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring forwarded trace policy without an accepted sampled principal",+ }),+ );});it("ignores public audience baggage without an accepted forwarded principal", async () => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({trustedForwarders: () => true,auth: () => ROUTER_CALLER,@@ -346,6 +366,12 @@ describe("eveChannel forwarded principal → runtime principal", () => {},});expect(ctx.get(ConversationContextKey)?.audience).toBe("unknown");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring forwarded trace policy without an accepted sampled principal",+ }),+ );});it("resolves the transport service principal (and fails Connect) without forwarding", async () => {diff --git a/packages/eve/src/public/channels/eve-session-routes.test.ts b/packages/eve/src/public/channels/eve-session-routes.test.tsindex 496d474a6..9d6541f49 100644--- a/packages/eve/src/public/channels/eve-session-routes.test.ts+++ b/packages/eve/src/public/channels/eve-session-routes.test.ts@@ -7,6 +7,7 @@ import { mockChannelContext } from "#internal/testing/mocks/mock-channel-operatiimport { writeForwardedParentSessionBaggage } from "#protocol/baggage.js";import { none } from "#public/channels/auth.js";import { eveChannel, type TrustedForwarders } from "#public/channels/eve.js";+import { captureLogRecords } from "#internal/testing/log-records.js";function route(method: "GET" | "POST",@@ -340,6 +341,7 @@ describe("eve ID-addressed session routes", () => {it.each([true, false])("promotes remote parent lineage only from a trusted forwarder (%s)",async (trusted) => {+ const logs = captureLogRecords();const createSession = vi.fn().mockResolvedValue({events: new ReadableStream(),sessionId: "wrun_A",@@ -385,6 +387,10 @@ describe("eve ID-addressed session routes", () => {parent: trusted ? parent : undefined,}),);+ const untrusted = logs.records.filter(+ (record) => record.message === "ignoring remote parent lineage from an untrusted forwarder",+ );+ expect(untrusted).toHaveLength(trusted ? 0 : 1);},);diff --git a/packages/eve/src/public/channels/eve.test.ts b/packages/eve/src/public/channels/eve.test.tsindex 37f98b8df..d957a2ab6 100644--- a/packages/eve/src/public/channels/eve.test.ts+++ b/packages/eve/src/public/channels/eve.test.ts@@ -27,6 +27,7 @@ import {type Session as RuntimeSession,} from "#context/keys.js";import { createMessageCompletedEvent } from "#protocol/message.js";+import { captureLogRecords } from "#internal/testing/log-records.js";/*** Unit coverage for the inbound HTTP route's message-body parser and@@ -758,6 +759,7 @@ describe("eveChannel — onMessage", () => {});it("rejects an invalid null onMessage result instead of returning an empty success", async () => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({auth: none(),onMessage: (() => null) as never,@@ -771,6 +773,9 @@ describe("eveChannel — onMessage", () => {error: "onMessage handler failed.",ok: false,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "onMessage handler failed" }),+ );});it("allows onMessage to dispatch with an empty context array", async () => {@@ -789,6 +794,7 @@ describe("eveChannel — onMessage", () => {});it("returns 500 without dispatching when onMessage throws", async () => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({auth: none(),onMessage: () => {@@ -804,6 +810,9 @@ describe("eveChannel — onMessage", () => {error: "onMessage handler failed.",ok: false,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "onMessage handler failed" }),+ );});it("rejects combined messages and input responses on continue requests", async () => {@@ -1037,6 +1046,7 @@ describe("eveChannel — create session idempotency", () => {describe("eveChannel — create session (text)", () => {it("returns a structured 500 when session creation fails", async () => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({ auth: none() });handler.send.mockRejectedValue(new Error("backing store outage"));@@ -1047,6 +1057,9 @@ describe("eveChannel — create session (text)", () => {error: "Failed to create the session.",ok: false,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "session-create request failed" }),+ );});it("accepts a plain-string message and opens a new session", async () => {@@ -1593,6 +1606,7 @@ describe("eveChannel — continue session HITL (inputResponses)", () => {});it("returns a structured 500 when fixed-session delivery fails", async () => {+ const logs = captureLogRecords();const handler = createEveContinueHandler({ auth: none() });handler.send.mockRejectedValue(new Error("backing store outage"));@@ -1603,6 +1617,9 @@ describe("eveChannel — continue session HITL (inputResponses)", () => {error: "Failed to send the session message.",ok: false,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "session-message request failed" }),+ );});it("converts clientContext on continue-session requests", async () => {@@ -1856,6 +1873,7 @@ describe("eveChannel — cancel turn", () => {});it("returns 500 when the cancellation request fails unexpectedly", async () => {+ const logs = captureLogRecords();const handler = createEveCancelHandler({ auth: none() });handler.cancelTurn.mockRejectedValue(new Error("backing store outage"));@@ -1866,6 +1884,9 @@ describe("eveChannel — cancel turn", () => {error: "Failed to cancel the turn.",ok: false,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "cancel-turn request failed" }),+ );});});@@ -1918,6 +1939,7 @@ describe("eveChannel — reset session", () => {});it("returns 500 when reset fails unexpectedly", async () => {+ const logs = captureLogRecords();const handler = createEveResetHandler({ auth: none() });handler.reset.mockRejectedValue(new Error("backing store outage"));@@ -1928,6 +1950,9 @@ describe("eveChannel — reset session", () => {error: "Failed to reset the session.",ok: false,});+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "session-reset request failed" }),+ );});});@@ -2128,6 +2153,7 @@ describe("eveChannel — forwarded principal", () => {});it("returns 500 when the authored predicate throws", async () => {+ const logs = captureLogRecords();const handler = createEveCreateHandler({trustedForwarders: () => {throw new Error("boom");@@ -2139,6 +2165,9 @@ describe("eveChannel — forwarded principal", () => {expect(response.status).toBe(500);expect(handler.send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "trustedForwarders handler failed" }),+ );});it("replaces the session principal when the forwarder is accepted", async () => {diff --git a/packages/eve/src/public/channels/github/api.test.ts b/packages/eve/src/public/channels/github/api.test.tsindex 4e52a3913..63a143912 100644--- a/packages/eve/src/public/channels/github/api.test.ts+++ b/packages/eve/src/public/channels/github/api.test.ts@@ -1,4 +1,4 @@-import { beforeEach, describe, expect, it, vi } from "vitest";+import { describe, expect, it, vi } from "vitest";import {GitHubApiError,@@ -9,24 +9,11 @@ import {getGitHubPullRequest,listGitHubPullRequestFiles,} from "#public/channels/github/api.js";-import {- clearGitHubInstallationTokenCache,- seedGitHubInstallationTokenForTests,-} from "#public/channels/github/auth.js";const credentials = {- appId: "test-app",+ installationToken: "ghs_test",};-beforeEach(() => {- clearGitHubInstallationTokenCache();- seedGitHubInstallationTokenForTests({- apiBaseUrl: "https://github.test",- installationId: 123,- token: "ghs_test",- });-});-function jsonResponse(body: unknown, init?: ResponseInit): Response {return new Response(JSON.stringify(body), {headers: { "content-type": "application/json" },diff --git a/packages/eve/src/public/channels/github/api.ts b/packages/eve/src/public/channels/github/api.tsindex 1cdc276bd..0b4ad76a7 100644--- a/packages/eve/src/public/channels/github/api.ts+++ b/packages/eve/src/public/channels/github/api.ts@@ -27,7 +27,7 @@ export type GitHubApiMethod = "DELETE" | "GET" | "PATCH" | "POST" | "PUT";export interface GitHubApiOptions extends GitHubAuthApiOptions {}/** Options for {@link GitHubHandle.request}. */-export interface GitHubRequestOptions {+interface GitHubRequestOptions {readonly auth?: boolean;readonly headers?: Readonly<Record<string, string>>;readonly installationId?: number;@@ -66,7 +66,7 @@ export class GitHubApiError extends Error {}/** Body accepted by GitHub comment-writing helpers. */-export interface GitHubCommentBody {+interface GitHubCommentBody {readonly body: string;}@@ -173,26 +173,6 @@ export async function createGitHubIssueComment(return toPostedComment(response.body);}-/** Updates an issue or PR timeline comment. */-export async function updateGitHubIssueComment(- input: GitHubResourceInput & {- readonly body: string | GitHubCommentBody;- readonly commentId: number;- },-): Promise<GitHubPostedComment> {- const response = await callGitHubApi({- api: input.api,- body: normalizeCommentBody(input.body),- credentials: input.credentials,- installationId: input.installationId,- method: "PATCH",- path: `/repos/${encodePath(input.owner)}/${encodePath(input.repo)}/issues/comments/${- input.commentId- }`,- });- return toPostedComment(response.body);-}-/** Replies to an inline pull-request review comment thread. */export async function createGitHubReviewCommentReply(input: GitHubResourceInput & {@@ -214,25 +194,6 @@ export async function createGitHubReviewCommentReply(return toPostedComment(response.body);}-/** Creates a pull-request review. */-export function createGitHubPullRequestReview(- input: GitHubResourceInput & {- readonly body: GitHubJsonObject;- readonly pullRequestNumber: number;- },-): Promise<GitHubApiResponse> {- return callGitHubApi({- api: input.api,- body: input.body,- credentials: input.credentials,- installationId: input.installationId,- method: "POST",- path: `/repos/${encodePath(input.owner)}/${encodePath(input.repo)}/pulls/${- input.pullRequestNumber- }/reviews`,- });-}-/** Minimal pull-request metadata returned by {@link getGitHubPullRequest}. */export interface GitHubPullRequestDetails {readonly additions: number | undefined;diff --git a/packages/eve/src/public/channels/github/auth.test.ts b/packages/eve/src/public/channels/github/auth.test.tsindex 3774c90fc..6d73cda1d 100644--- a/packages/eve/src/public/channels/github/auth.test.ts+++ b/packages/eve/src/public/channels/github/auth.test.ts@@ -3,7 +3,6 @@ import { createPublicKey, createVerify, generateKeyPairSync } from "node:crypto"import { beforeEach, describe, expect, it, vi } from "vitest";import {- clearGitHubInstallationTokenCache,createGitHubAppJwt,createGitHubInstallationToken,normalizeGitHubPrivateKey,@@ -23,7 +22,6 @@ function keyPair(): { privateKey: string; publicKey: string } {describe("GitHub App auth helpers", () => {beforeEach(() => {- clearGitHubInstallationTokenCache();vi.unstubAllEnvs();});diff --git a/packages/eve/src/public/channels/github/auth.ts b/packages/eve/src/public/channels/github/auth.tsindex b01be4d61..9a07c4887 100644--- a/packages/eve/src/public/channels/github/auth.ts+++ b/packages/eve/src/public/channels/github/auth.ts@@ -252,26 +252,6 @@ export async function createGitHubInstallationToken(input: {return body.token;}-/** Clears the in-memory GitHub installation token cache. Intended for tests. */-export function clearGitHubInstallationTokenCache(): void {- installationTokenCache.clear();-}--/** Seeds the in-memory installation token cache. Intended for tests. */-export function seedGitHubInstallationTokenForTests(input: {- readonly apiBaseUrl?: string;- readonly appId?: string;- readonly installationId: number;- readonly token: string;-}): void {- const apiBaseUrl = input.apiBaseUrl ?? "https://api.github.com";- const appId = input.appId ?? "test-app";- installationTokenCache.set(`${apiBaseUrl}:${appId}:${input.installationId}`, {- expiresAtMs: Date.now() + 60 * 60 * 1000,- token: input.token,- });-}-function base64UrlJson(value: unknown): string {return Buffer.from(JSON.stringify(value)).toString("base64url");}diff --git a/packages/eve/src/public/channels/github/binding.ts b/packages/eve/src/public/channels/github/binding.tsindex b922263c9..6b690743d 100644--- a/packages/eve/src/public/channels/github/binding.ts+++ b/packages/eve/src/public/channels/github/binding.ts@@ -17,13 +17,13 @@ import type {} from "#public/channels/github/inbound.js";/** Minimal config needed to rebuild GitHub API handles. */-export interface GitHubBindingConfig {+interface GitHubBindingConfig {readonly api?: GitHubApiOptions;readonly credentials?: GitHubChannelCredentials;}/** Serializable state fields needed to rebuild GitHub API handles. */-export interface GitHubBindingState {+interface GitHubBindingState {readonly conversationKind: GitHubConversationKind;readonly installationId: number | null;readonly issueNumber: number | null;diff --git a/packages/eve/src/public/channels/github/checkout.test.ts b/packages/eve/src/public/channels/github/checkout.test.tsindex a1b4222f6..b2532effd 100644--- a/packages/eve/src/public/channels/github/checkout.test.ts+++ b/packages/eve/src/public/channels/github/checkout.test.ts@@ -1,23 +1,12 @@-import { beforeEach, describe, expect, it, vi } from "vitest";+import { describe, expect, it, vi } from "vitest";import { mockSandbox } from "#internal/testing/mocks/mock-sandbox.js";-import {- clearGitHubInstallationTokenCache,- seedGitHubInstallationTokenForTests,-} from "#public/channels/github/auth.js";import { checkoutGitHubRepository } from "#public/channels/github/checkout.js";const credentials = {- appId: "test-app",+ installationToken: "ghs_checkout",};-beforeEach(() => {- clearGitHubInstallationTokenCache();- for (const apiBaseUrl of ["https://api.github.com", "https://github.test"]) {- seedGitHubInstallationTokenForTests({ apiBaseUrl, installationId: 55, token: "ghs_checkout" });- }-});-function jsonResponse(body: unknown): Response {return new Response(JSON.stringify(body), {headers: { "content-type": "application/json" },diff --git a/packages/eve/src/public/channels/github/checkout.ts b/packages/eve/src/public/channels/github/checkout.tsindex dddb1b7db..cd29fc2f2 100644--- a/packages/eve/src/public/channels/github/checkout.ts+++ b/packages/eve/src/public/channels/github/checkout.ts@@ -22,7 +22,7 @@ const GITHUB_CHECKOUT_NETWORK_HINT ="Verify the GitHub App installation has access to this repository.";/** Options for cloning a GitHub repository ref into the active sandbox. */-export interface GitHubCheckoutOptions {+interface GitHubCheckoutOptions {readonly depth?: number;readonly includeBase?: boolean;readonly mode?: "full" | "shallow";@@ -31,7 +31,7 @@ export interface GitHubCheckoutOptions {}/** Result returned after a GitHub checkout completes. */-export interface GitHubCheckout {+interface GitHubCheckout {readonly baseRef: string | null;readonly path: string;readonly ref: string;@@ -39,7 +39,7 @@ export interface GitHubCheckout {}/** Internal descriptor used by channel-owned checkout paths. */-export interface GitHubCheckoutInput extends GitHubCheckoutOptions {+interface GitHubCheckoutInput extends GitHubCheckoutOptions {readonly api?: GitHubApiOptions;readonly baseRef?: string | null;readonly baseSha?: string | null;diff --git a/packages/eve/src/public/channels/github/defaults.ts b/packages/eve/src/public/channels/github/defaults.tsindex ca9ab70e9..2fa4a0bb2 100644--- a/packages/eve/src/public/channels/github/defaults.ts+++ b/packages/eve/src/public/channels/github/defaults.ts@@ -58,7 +58,7 @@ export function defaultGitHubAuth(ctx: GitHubInboundContext): SessionAuthContext}/** Options used by the built-in GitHub comment dispatch hook. */-export interface GitHubDefaultDispatchOptions {+interface GitHubDefaultDispatchOptions {readonly botName?: GitHubBotNameResolver;}@@ -81,7 +81,7 @@ export async function defaultOnComment(}/** Options used by built-in GitHub event handlers. */-export interface GitHubDefaultEventOptions {+interface GitHubDefaultEventOptions {readonly api?: GitHubApiOptions;readonly botName?: GitHubBotNameResolver;readonly credentials?: GitHubChannelCredentials;diff --git a/packages/eve/src/public/channels/github/githubChannel.test.ts b/packages/eve/src/public/channels/github/githubChannel.test.tsindex b96d4882f..8b55ba566 100644--- a/packages/eve/src/public/channels/github/githubChannel.test.ts+++ b/packages/eve/src/public/channels/github/githubChannel.test.ts@@ -9,14 +9,11 @@ import { SandboxKey, SessionKey } from "#context/keys.js";import { mockChannelContext } from "#internal/testing/mocks/mock-channel-operations.js";import { mockSandbox, type MockSandbox } from "#internal/testing/mocks/mock-sandbox.js";import type { UnstampedMessageStreamEvent } from "#protocol/message.js";-import {- clearGitHubInstallationTokenCache,- seedGitHubInstallationTokenForTests,-} from "#public/channels/github/auth.js";import { defaultGitHubAuth } from "#public/channels/github/defaults.js";import { githubChannel } from "#public/channels/github/githubChannel.js";import { type GitHubChannelState } from "#public/channels/github/state.js";import { signGitHubWebhookBody } from "#public/channels/github/verify.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const SECRET = "github-secret";@@ -193,10 +190,6 @@ async function firePost(describe("githubChannel", () => {beforeEach(() => {vi.restoreAllMocks();- clearGitHubInstallationTokenCache();- for (const apiBaseUrl of ["https://api.github.com", "https://github.test"]) {- seedGitHubInstallationTokenForTests({ apiBaseUrl, installationId: 55, token: "ghs_test" });- }});it("acks ping deliveries without dispatching", async () => {@@ -319,6 +312,7 @@ describe("githubChannel", () => {});it("retries a failed botName resolver on the next delivery instead of pinning", async () => {+ const logs = captureLogRecords();const resolveBotName = vi.fn().mockRejectedValueOnce(new Error("no request context"))@@ -348,6 +342,12 @@ describe("githubChannel", () => {expect(first.send).not.toHaveBeenCalled();expect(second.send).toHaveBeenCalledTimes(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "githubChannel: botName resolver failed; retrying on the next event",+ }),+ );});it("falls back to the credentials' appSlug when botName is not configured", async () => {@@ -478,6 +478,7 @@ describe("githubChannel", () => {});it("returns 401 when webhookVerifier rejects", async () => {+ const logs = captureLogRecords();const verifier = vi.fn().mockRejectedValue(new Error("nope"));const channel = githubChannel({botName: "testbot",@@ -501,6 +502,9 @@ describe("githubChannel", () => {expect(response.status).toBe(401);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "github inbound verification failed" }),+ );});it("does not dispatch unmentioned default issue comments", async () => {@@ -529,7 +533,7 @@ describe("githubChannel", () => {api: { apiBaseUrl: "https://github.test", fetch: fetchMock },botName: "testbot",credentials: {- appId: "test-app",+ installationToken: "ghs_test",webhookSecret: SECRET,},});@@ -561,7 +565,7 @@ describe("githubChannel", () => {const channel = githubChannel({api: { apiBaseUrl: "https://github.test", fetch: prContextFetch() },botName: "testbot",- credentials: { appId: "test-app", webhookSecret: SECRET },+ credentials: { installationToken: "ghs_test", webhookSecret: SECRET },});const { send } = await firePost(channel,@@ -660,7 +664,7 @@ describe("githubChannel", () => {const hook = vi.fn();const channel = githubChannel({api: { apiBaseUrl: "https://github.test", fetch: prContextFetch() },- credentials: { appId: "test-app", webhookSecret: SECRET },+ credentials: { installationToken: "ghs_test", webhookSecret: SECRET },onPullRequest(ctx, pullRequest) {hook(ctx.conversation, pullRequest);return { auth: defaultGitHubAuth(ctx) };@@ -719,7 +723,7 @@ describe("githubChannel", () => {const hook = vi.fn();const commonConfig = {api: { apiBaseUrl: "https://github.test", fetch: prContextFetch() },- credentials: { appId: "test-app", webhookSecret: SECRET },+ credentials: { installationToken: "ghs_test", webhookSecret: SECRET },};const channel =testCase.event === "check_suite"@@ -794,6 +798,7 @@ describe("githubChannel", () => {});it("invokes CI hooks without dispatching when no pull request is associated", async () => {+ const logs = captureLogRecords();const hook = vi.fn();const channel = githubChannel({credentials: { webhookSecret: SECRET },@@ -826,6 +831,12 @@ describe("githubChannel", () => {[],);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "GitHub CI event cannot dispatch without an associated pull request",+ }),+ );});it("ignores issue, pull request, and CI webhooks without opt-in hooks", async () => {@@ -887,7 +898,7 @@ describe("githubChannel", () => {githubChannel({api: { apiBaseUrl: "https://github.test", fetch: fetchMock },credentials: {- appId: "test-app",+ installationToken: "ghs_test",webhookSecret: SECRET,},}),@@ -929,7 +940,7 @@ describe("githubChannel", () => {api: { apiBaseUrl: "https://github.test", fetch: fetchMock },botName: "testbot",credentials: {- appId: "test-app",+ installationToken: "ghs_test",webhookSecret: SECRET,},}),@@ -979,7 +990,7 @@ describe("githubChannel", () => {githubChannel({api: { apiBaseUrl: "https://github.test", fetch: fetchMock },botName: () => Promise.resolve("testbot"),- credentials: { appId: "test-app", webhookSecret: SECRET },+ credentials: { installationToken: "ghs_test", webhookSecret: SECRET },}),),{@@ -1026,7 +1037,7 @@ describe("githubChannel", () => {getAdapter(githubChannel({api: { apiBaseUrl: "https://github.test", fetch: fetchMock },- credentials: { appId: "test-app", webhookSecret: SECRET },+ credentials: { installationToken: "ghs_test", webhookSecret: SECRET },}),),{@@ -1071,7 +1082,7 @@ describe("githubChannel", () => {getAdapter(githubChannel({api: { apiBaseUrl: "https://github.test", fetch: fetchMock },- credentials: { appId: "test-app", webhookSecret: SECRET },+ credentials: { installationToken: "ghs_test", webhookSecret: SECRET },}),),{@@ -1099,6 +1110,7 @@ describe("githubChannel", () => {});it("turn.started adds an eyes reaction to the triggering comment", async () => {+ const logs = captureLogRecords();const fetchMock = vi.fn().mockImplementation(() => Promise.resolve(new Response(JSON.stringify({ id: 77 }))));@@ -1107,7 +1119,7 @@ describe("githubChannel", () => {githubChannel({api: { apiBaseUrl: "https://github.test", fetch: fetchMock },credentials: {- appId: "test-app",+ installationToken: "ghs_test",webhookSecret: SECRET,},}),@@ -1136,6 +1148,9 @@ describe("githubChannel", () => {expect(fetchMock.mock.calls.map((call) => call[0])).toEqual(["https://github.test/repos/vercel/eve/issues/comments/10/reactions",]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "GitHub checkout failed — swallowed" }),+ );});it("turn.started checks out the triggering GitHub ref", async () => {@@ -1155,7 +1170,7 @@ describe("githubChannel", () => {getAdapter(githubChannel({credentials: {- appId: "test-app",+ installationToken: "ghs_test",webhookSecret: SECRET,},}),diff --git a/packages/eve/src/public/channels/github/githubChannel.ts b/packages/eve/src/public/channels/github/githubChannel.tsindex 9467bc303..303ca3052 100644--- a/packages/eve/src/public/channels/github/githubChannel.ts+++ b/packages/eve/src/public/channels/github/githubChannel.ts@@ -90,7 +90,7 @@ export interface GitHubInboundContext {}/** Channel-owned GitHub context rebuilt from persisted channel state. */-export interface GitHubChannelContext {+interface GitHubChannelContext {readonly conversation: GitHubConversationRef;readonly github: GitHubHandle;readonly repository: GitHubRepositoryRef;diff --git a/packages/eve/src/public/channels/github/limits.ts b/packages/eve/src/public/channels/github/limits.tsindex be7f9f7b7..260d9bdd2 100644--- a/packages/eve/src/public/channels/github/limits.ts+++ b/packages/eve/src/public/channels/github/limits.ts@@ -1,5 +1,5 @@/** Maximum body length accepted by GitHub issue and pull-request comments. */-export const GITHUB_COMMENT_BODY_MAX_LENGTH = 65_536;+const GITHUB_COMMENT_BODY_MAX_LENGTH = 65_536;/** Splits a long comment body into GitHub-sized comment bodies. */export function splitGitHubCommentBody(diff --git a/packages/eve/src/public/channels/github/pr-context.test.ts b/packages/eve/src/public/channels/github/pr-context.test.tsindex 82c8988f9..8f50bf0ab 100644--- a/packages/eve/src/public/channels/github/pr-context.test.ts+++ b/packages/eve/src/public/channels/github/pr-context.test.ts@@ -1,24 +1,11 @@-import { beforeEach, describe, expect, it, vi } from "vitest";+import { describe, expect, it, vi } from "vitest";-import {- clearGitHubInstallationTokenCache,- seedGitHubInstallationTokenForTests,-} from "#public/channels/github/auth.js";import { buildGitHubPullRequestContext } from "#public/channels/github/pr-context.js";const credentials = {- appId: "test-app",+ installationToken: "ghs_test",};-beforeEach(() => {- clearGitHubInstallationTokenCache();- seedGitHubInstallationTokenForTests({- apiBaseUrl: "https://github.test",- installationId: 55,- token: "ghs_test",- });-});-function jsonResponse(body: unknown): Response {return new Response(JSON.stringify(body), {headers: { "content-type": "application/json" },diff --git a/packages/eve/src/public/channels/github/pr-context.ts b/packages/eve/src/public/channels/github/pr-context.tsindex 8b914ae75..f7e1e0077 100644--- a/packages/eve/src/public/channels/github/pr-context.ts+++ b/packages/eve/src/public/channels/github/pr-context.ts@@ -51,7 +51,7 @@ export interface GitHubPullRequestContextConfig {}/** Input for building one-shot model context for a pull request. */-export interface GitHubPullRequestContextInput {+interface GitHubPullRequestContextInput {readonly api?: GitHubApiOptions;/*** When set with {@link headSha}, file patches load via the compare API for@@ -239,7 +239,7 @@ function renderFileSummary(file: GitHubPullRequestFile): string {}/** Returns true when a file path matches any of the provided glob patterns. */-export function fileMatchesAnyGlob(filename: string, patterns: readonly string[]): boolean {+function fileMatchesAnyGlob(filename: string, patterns: readonly string[]): boolean {return patterns.some((pattern) => globToRegExp(pattern).test(filename));}diff --git a/packages/eve/src/public/channels/github/state.ts b/packages/eve/src/public/channels/github/state.tsindex 55f7470fa..9c34b9162 100644--- a/packages/eve/src/public/channels/github/state.ts+++ b/packages/eve/src/public/channels/github/state.ts@@ -44,7 +44,7 @@ export interface GitHubChannelState {}/** Minimal receive target needed to seed GitHub channel state. */-export interface GitHubReceiveStateTarget {+interface GitHubReceiveStateTarget {readonly installationId?: number;readonly issueNumber?: number;readonly pullRequestNumber?: number;diff --git a/packages/eve/src/public/channels/github/verify.ts b/packages/eve/src/public/channels/github/verify.tsindex 1b1e5ec31..52f74916a 100644--- a/packages/eve/src/public/channels/github/verify.ts+++ b/packages/eve/src/public/channels/github/verify.ts@@ -28,7 +28,7 @@ const log = createLogger("github.verify");export type GitHubWebhookVerifier = (request: Request, body: string) => unknown | Promise<unknown>;/** Options for {@link verifyGitHubRequest}. */-export interface GitHubVerifyOptions {+interface GitHubVerifyOptions {readonly webhookSecret?: GitHubWebhookSecret;readonly webhookVerifier?: GitHubWebhookVerifier;}diff --git a/packages/eve/src/public/channels/linear/defaults.ts b/packages/eve/src/public/channels/linear/defaults.tsindex ec46401d3..a128fb920 100644--- a/packages/eve/src/public/channels/linear/defaults.ts+++ b/packages/eve/src/public/channels/linear/defaults.ts@@ -57,7 +57,7 @@ export function defaultOnAgentSession(}/** Options used by built-in Linear event handlers. */-export interface LinearDefaultEventOptions {+interface LinearDefaultEventOptions {readonly api?: LinearApiOptions;readonly credentials?: LinearChannelCredentials;}diff --git a/packages/eve/src/public/channels/linear/inbound-images.ts b/packages/eve/src/public/channels/linear/inbound-images.tsindex 45efbd48e..f1e40582b 100644--- a/packages/eve/src/public/channels/linear/inbound-images.ts+++ b/packages/eve/src/public/channels/linear/inbound-images.ts@@ -11,7 +11,7 @@ const MARKDOWN_IMAGE_PATTERN =/!\[([^\]\r\n]*)\]\(\s*(?:<([^>\r\n]+)>|([^\s)\r\n]+))(?:\s+(?:"[^"\r\n]*"|'[^'\r\n]*'|\([^)\r\n]*\)))?\s*\)/gu;/** One trusted Linear upload referenced by markdown image syntax. */-export interface LinearUploadImageReference {+interface LinearUploadImageReference {readonly altText: string;readonly end: number;readonly start: number;diff --git a/packages/eve/src/public/channels/linear/linearChannel.test.ts b/packages/eve/src/public/channels/linear/linearChannel.test.tsindex fbb7dfd05..31e850b17 100644--- a/packages/eve/src/public/channels/linear/linearChannel.test.ts+++ b/packages/eve/src/public/channels/linear/linearChannel.test.ts@@ -12,6 +12,7 @@ import { defaultLinearAuth } from "#public/channels/linear/defaults.js";import { linearChannel, type LinearChannelState } from "#public/channels/linear/linearChannel.js";import { signLinearWebhookBody } from "#public/channels/linear/verify.js";import type { InputRequest } from "#shared/input.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const SECRET = "linear-secret";@@ -401,6 +402,7 @@ describe("linearChannel default event handlers", () => {});it("posts turn-start and tool-call progress as ephemeral Linear activities", async () => {+ const logs = captureLogRecords();const fetchMock = vi.fn().mockResolvedValue(jsonResponse({data: {@@ -460,6 +462,12 @@ describe("linearChannel default event handlers", () => {},},});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "adapter event handler threw — event swallowed",+ }),+ );});it("surfaces pre-tool-call assistant text as the next ephemeral Linear thought", async () => {diff --git a/packages/eve/src/public/channels/mcp.test.ts b/packages/eve/src/public/channels/mcp.test.tsindex 507ebe384..31fb24fed 100644--- a/packages/eve/src/public/channels/mcp.test.ts+++ b/packages/eve/src/public/channels/mcp.test.ts@@ -7,13 +7,12 @@ import {attachRouteChannelName,attachRouteSessionCreator,} from "#internal/nitro/routes/channel-route-context.js";-import {- MCP_LEGACY_PROTOCOL_VERSION,- MCP_PROTOCOL_VERSION,-} from "#internal/mcp/streamable-http-server.js";+import { MCP_PROTOCOL_VERSION } from "#internal/mcp/streamable-http-server.js";import { ForbiddenError, none, oauthResource, withAuthChallenges } from "#public/channels/auth.js";import { mcpChannel } from "#public/channels/mcp.js";+const MCP_LEGACY_PROTOCOL_VERSION = "2025-11-25";+const principal: SessionAuthContext = {attributes: {},authenticator: "test",diff --git a/packages/eve/src/public/channels/slack/api-encoding.ts b/packages/eve/src/public/channels/slack/api-encoding.tsdeleted file mode 100644index c931c60e1..000000000--- a/packages/eve/src/public/channels/slack/api-encoding.ts+++ /dev/null@@ -1,40 +0,0 @@-export function encodeSlackApiBody(body: unknown): {- readonly body: string;- readonly contentType: string;-} {- const params = new URLSearchParams();- if (body && typeof body === "object") {- for (const [key, value] of Object.entries(body)) {- if (value === undefined || value === null) continue;- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {- params.set(key, String(value));- } else {- params.set(key, JSON.stringify(value));- }- }- }- return {- body: params.toString(),- contentType: "application/x-www-form-urlencoded",- };-}--export function decodeSlackApiBody(body: unknown, contentType: string | null): unknown {- if (typeof body !== "string") return body;- if (contentType?.includes("application/json")) return parseJson(body);- if (!contentType?.includes("application/x-www-form-urlencoded")) return body;-- const parsed: Record<string, unknown> = {};- for (const [key, value] of new URLSearchParams(body)) {- parsed[key] = value.startsWith("[") || value.startsWith("{") ? parseJson(value) : value;- }- return parsed;-}--function parseJson(value: string): unknown {- try {- return JSON.parse(value);- } catch {- return value;- }-}diff --git a/packages/eve/src/public/channels/slack/api.test.ts b/packages/eve/src/public/channels/slack/api.test.tsindex 1a051b451..9abbf6a7a 100644--- a/packages/eve/src/public/channels/slack/api.test.ts+++ b/packages/eve/src/public/channels/slack/api.test.ts@@ -1,7 +1,7 @@import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";import { Card, CardText } from "#compiled/chat/index.js";-import { decodeSlackApiBody } from "#public/channels/slack/api-encoding.js";+import { decodeSlackApiBody } from "#internal/testing/slack-api-body.js";import {buildSlackBinding,callSlackApi,@@ -9,6 +9,7 @@ import {type SlackBotTokenContext,} from "#public/channels/slack/api.js";import { resolveSlackTransportOptions } from "#public/channels/slack/transport.js";+import { captureLogRecords } from "#internal/testing/log-records.js";interface FetchCall {url: string;@@ -596,6 +597,7 @@ describe("SlackThread.refresh", () => {});it("preserves loaded messages when a later refresh fails", async () => {+ const logs = captureLogRecords();const { thread } = buildSlackBinding({botToken: "xoxb-test",channelId: "C01",@@ -609,6 +611,9 @@ describe("SlackThread.refresh", () => {await thread.refresh();expect(thread.recentMessages).toEqual(loadedMessages);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "refresh threw — swallowed" }),+ );});it("marks only replies from the bound Slack app as mine", async () => {diff --git a/packages/eve/src/public/channels/slack/app-manifest.test.ts b/packages/eve/src/public/channels/slack/app-manifest.test.tsindex c09c739fb..f37fe75dc 100644--- a/packages/eve/src/public/channels/slack/app-manifest.test.ts+++ b/packages/eve/src/public/channels/slack/app-manifest.test.ts@@ -1,13 +1,10 @@import { describe, expect, it } from "vitest";-import {- buildSlackAppManifest,- defineSlackAppManifest,-} from "#public/channels/slack/app-manifest.js";+import { defineSlackAppManifest } from "#public/channels/slack/app-manifest.js";describe("Slack app manifests", () => {it("builds the native baseline manifest", () => {- expect(buildSlackAppManifest(defineSlackAppManifest({}), "support")).toEqual({+ expect(defineSlackAppManifest({}).build("support")).toEqual({$type: "https://docs.slack.dev/reference/app-manifest/",display_information: { name: "support" },features: {@@ -31,7 +28,7 @@ describe("Slack app manifests", () => {it("uses a configured bot name and enforces Slack's app name limit", () => {const definition = defineSlackAppManifest({ botName: "x".repeat(40) });- expect(buildSlackAppManifest(definition, "support")).toMatchObject({+ expect(definition.build("support")).toMatchObject({display_information: { name: "x".repeat(35) },features: { bot_user: { display_name: "x".repeat(35) } },});diff --git a/packages/eve/src/public/channels/slack/app-manifest.ts b/packages/eve/src/public/channels/slack/app-manifest.tsindex 3840db7ad..9055f0a24 100644--- a/packages/eve/src/public/channels/slack/app-manifest.ts+++ b/packages/eve/src/public/channels/slack/app-manifest.ts@@ -1,10 +1,10 @@import type { AppsManifestCreateArguments } from "@slack/web-api";-import { parseJsonObject, type JsonObject } from "#shared/json.js";+import type { JsonObject } from "#shared/json.js";-export const SLACK_APP_MANIFEST_TYPE = "https://docs.slack.dev/reference/app-manifest/";+const SLACK_APP_MANIFEST_TYPE = "https://docs.slack.dev/reference/app-manifest/";-export interface SlackAppManifestBuildDefinition {+interface SlackAppManifestBuildDefinition {readonly build: (channelName: string) => JsonObject;}@@ -37,10 +37,3 @@ export function defineSlackAppManifest(input: {},};}--export function buildSlackAppManifest(value: unknown, channelName: string): JsonObject | undefined {- if (value === null || typeof value !== "object") return undefined;- const build = (value as { readonly build?: unknown }).build;- if (typeof build !== "function") return undefined;- return parseJsonObject(build(channelName));-}diff --git a/packages/eve/src/public/channels/slack/attachments.test.ts b/packages/eve/src/public/channels/slack/attachments.test.tsindex 9916b407b..9adf464ee 100644--- a/packages/eve/src/public/channels/slack/attachments.test.ts+++ b/packages/eve/src/public/channels/slack/attachments.test.ts@@ -12,6 +12,7 @@ import {type SlackTransportOptions,} from "#public/channels/slack/transport.js";import { DEFAULT_UPLOAD_POLICY, mergeUploadPolicy } from "#public/channels/upload-policy.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const DISABLED_POLICY = mergeUploadPolicy("disabled");const ZERO_BYTES_POLICY = mergeUploadPolicy({ maxBytes: 0 });@@ -76,6 +77,7 @@ describe("collectSlackFileParts", () => {});it("drops attachments missing a url (nothing for fetchFile to fetch)", () => {+ const logs = captureLogRecords();const attachments = makeAttachments([{ type: "file", url: undefined, name: "ghost.csv", mimeType: "text/csv" },{ type: "file", url: "https://files.slack.com/a/b/real.csv", mimeType: "text/csv" },@@ -85,6 +87,9 @@ describe("collectSlackFileParts", () => {expect(parts).toHaveLength(1);expect((parts[0]!.data as URL).href).toBe("https://files.slack.com/a/b/real.csv");+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "dropped attachment — no url available" }),+ );});it("falls back to a generic mediaType when the attachment lacks one", () => {@@ -134,6 +139,7 @@ describe("collectSlackFileParts", () => {});it("drops attachments whose mediaType is not in the policy allowlist", () => {+ const logs = captureLogRecords();const policy = mergeUploadPolicy({ allowedMediaTypes: ["image/*"] });const attachments = makeAttachments([{ type: "file", url: "https://files.slack.com/a/b/x.csv", mimeType: "text/csv" },@@ -144,6 +150,13 @@ describe("collectSlackFileParts", () => {expect(parts).toHaveLength(1);expect(parts[0]?.mediaType).toBe("image/png");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message:+ 'dropped attachment — attachment-0 has media type "text/csv" which is not allowed by this route. Allowed: image/*.',+ }),+ );});it("returns an empty array when the message has no attachments", () => {@@ -484,6 +497,7 @@ describe("collectInboundFileParts", () => {});it("drops 'disabled'-policy inline mention attachments at the per-file check", async () => {+ const logs = captureLogRecords();const refresh = vi.fn().mockResolvedValue(undefined);const thread = makeSlackThread({ refresh });@@ -495,6 +509,13 @@ describe("collectInboundFileParts", () => {expect(parts).toEqual([]);expect(refresh).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message:+ 'dropped attachment — mention.csv has media type "text/csv" which is not allowed by this route.',+ }),+ );});it("keeps inline mention attachments with maxBytes: 0 (size unknown until fetch)", async () => {@@ -512,6 +533,7 @@ describe("collectInboundFileParts", () => {});it("returns an empty array when refresh throws", async () => {+ const logs = captureLogRecords();const refresh = vi.fn().mockRejectedValue(new Error("Slack 500"));const thread = makeSlackThread({ refresh });@@ -522,6 +544,12 @@ describe("collectInboundFileParts", () => {});expect(parts).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "slack thread refresh failed for attachment collection",+ }),+ );});});diff --git a/packages/eve/src/public/channels/slack/defaults.test.ts b/packages/eve/src/public/channels/slack/defaults.test.tsindex 15251619e..7c15ce01c 100644--- a/packages/eve/src/public/channels/slack/defaults.test.ts+++ b/packages/eve/src/public/channels/slack/defaults.test.ts@@ -3,6 +3,7 @@ import { describe, expect, it, vi } from "vitest";import type { SessionContext } from "#public/definitions/callback-context.js";import { defaultEvents, defaultInputRequestedHandler } from "#public/channels/slack/defaults.js";import type { SlackChannelState, SlackEventContext } from "#public/channels/slack/slackChannel.js";+import { captureLogRecords } from "#internal/testing/log-records.js";function sessionContext(current: SessionContext["session"]["auth"]["current"] = null,@@ -150,6 +151,7 @@ describe("defaultInputRequestedHandler private input requests", () => {});it("fails closed when no direct-message reviewer can be resolved", async () => {+ const logs = captureLogRecords();const { channel, post, postDirectMessage, postEphemeral } = buildChannelStub();await defaultInputRequestedHandler(() => "direct-message")(@@ -161,6 +163,12 @@ describe("defaultInputRequestedHandler private input requests", () => {expect(post).not.toHaveBeenCalled();expect(postDirectMessage).not.toHaveBeenCalled();expect(postEphemeral).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "direct-message input request not delivered because no reviewer was resolved",+ }),+ );});it("rolls back partial DM delivery without announcing an unusable approval", async () => {@@ -198,6 +206,7 @@ describe("defaultInputRequestedHandler private input requests", () => {});it("keeps the actionable DM committed when its thread announcement fails", async () => {+ const logs = captureLogRecords();const { channel, post, request } = buildChannelStub({triggeringMessageTs: "111.333",triggeringUserId: "U_REVIEWER",@@ -219,6 +228,12 @@ describe("defaultInputRequestedHandler private input requests", () => {messageChannelId: "D123",messageTs: "dm3",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "failed to announce private input request",+ }),+ );});it("previews the triggering message and updates the routed DM card after settlement", async () => {@@ -626,6 +641,7 @@ describe("defaultEvents authorization.required", () => {});it("keeps the link-free public status when the ephemeral delivery fails", async () => {+ const logs = captureLogRecords();const { channel, post, postEphemeral } = buildChannelStub({ triggeringUserId: "U777" });postEphemeral.mockRejectedValueOnce(new Error("ephemeral rejected"));@@ -636,6 +652,9 @@ describe("defaultEvents authorization.required", () => {expect(publicText).toBe("Connect with Notion to continue");expect(publicText).not.toContain("https://");expect(channel.state.pendingAuthMessageTs).toEqual({ notion: "ts1" });+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "Slack auth ephemeral delivery failed" }),+ );});it("reuses an existing public status when authorization is already pending", async () => {diff --git a/packages/eve/src/public/channels/slack/inbound.ts b/packages/eve/src/public/channels/slack/inbound.tsindex e9ba07ba0..78c2a06ba 100644--- a/packages/eve/src/public/channels/slack/inbound.ts+++ b/packages/eve/src/public/channels/slack/inbound.ts@@ -133,7 +133,7 @@ interface SlackMessageEvent {* only about `team_id` (for ergonomic auth derivation) and the inner* `event` payload.*/-export interface SlackEventCallback {+interface SlackEventCallback {readonly type: "event_callback";readonly team_id?: string;readonly authorizations?: readonly {diff --git a/packages/eve/src/public/channels/slack/model-context.ts b/packages/eve/src/public/channels/slack/model-context.tsindex 42044aa63..db68dac1e 100644--- a/packages/eve/src/public/channels/slack/model-context.ts+++ b/packages/eve/src/public/channels/slack/model-context.ts@@ -19,7 +19,7 @@ interface SlackModelMessageInput {* model-visible message. Slack user ids are stable and require no profile* lookup, so they remain the canonical speaker identity.*/-export function formatSlackModelMessage(input: SlackModelMessageInput): string {+function formatSlackModelMessage(input: SlackModelMessageInput): string {return ["<slack_message>",`sender_type: ${input.senderType}`,diff --git a/packages/eve/src/public/channels/slack/privacy.ts b/packages/eve/src/public/channels/slack/privacy.tsindex a1f272cf5..48c6ce6c1 100644--- a/packages/eve/src/public/channels/slack/privacy.ts+++ b/packages/eve/src/public/channels/slack/privacy.ts@@ -1,6 +1,6 @@import type { SlackApiResponse } from "#public/channels/slack/api.js";-export type SlackConversationPrivacy = "private" | "public" | "unknown";+type SlackConversationPrivacy = "private" | "public" | "unknown";export function readSlackConversationPrivacy(raw: Readonly<Record<string, unknown>> | undefined,diff --git a/packages/eve/src/public/channels/slack/slackChannel.test.ts b/packages/eve/src/public/channels/slack/slackChannel.test.tsindex 31f810928..ca3038a2a 100644--- a/packages/eve/src/public/channels/slack/slackChannel.test.ts+++ b/packages/eve/src/public/channels/slack/slackChannel.test.ts@@ -13,14 +13,14 @@ import type { ChannelFrom, ChannelSource } from "#channel/channel-operations.js"import { isHttpRouteDefinition } from "#channel/routes.js";import { ContextContainer, contextStorage } from "#context/container.js";import { SessionKey } from "#context/keys.js";-import { setLogRecordSubscriber, type LogRecord } from "#internal/logging.js";+import { captureLogRecords } from "#internal/testing/log-records.js";import {mockChannelContext,type ObservedChannelDelivery,} from "#internal/testing/mocks/mock-channel-operations.js";import type { UnstampedMessageStreamEvent } from "#protocol/message.js";import { experimental_slackActivityStatus } from "#public/channels/slack/activity.js";-import { decodeSlackApiBody } from "#public/channels/slack/api-encoding.js";+import { decodeSlackApiBody } from "#internal/testing/slack-api-body.js";import {HITL_ACTION_PREFIX,HITL_FREEFORM_ACTION_PREFIX,@@ -121,16 +121,6 @@ function slackOperations(fetchMock: ReturnType<typeof vi.fn>): string[] {});}-// Captures structured log records for the rest of the current test. The-// subscriber slot is process-wide, so the helper registers its own-// teardown rather than leaving that to each caller.-function captureLogRecords(): { records: LogRecord[] } {- const records: LogRecord[] = [];- setLogRecordSubscriber((record) => records.push(record));- onTestFinished(() => setLogRecordSubscriber(undefined));- return { records };-}-// A response from a gateway in front of Slack: a received non-2xx whose// body is an HTML error page rather than a Slack JSON envelope.function htmlGatewayError(): Response {@@ -2187,6 +2177,7 @@ describe("slackChannel() inbound mention pipeline", () => {});it("drops a redelivery of an already-handled event_id", async () => {+ const logs = captureLogRecords();const onAppMention = vi.fn().mockReturnValue({ auth: null });const channel = slackChannel({credentials: { botToken: "xoxb-test" },@@ -2204,6 +2195,9 @@ describe("slackChannel() inbound mention pipeline", () => {expect(await second.response.text()).toBe("ok");expect(onAppMention).toHaveBeenCalledTimes(1);expect(second.send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "received a duplicate event" }),+ );});it("keeps Slack attribution in the message and authored context separate", async () => {@@ -2505,15 +2499,20 @@ describe("slackChannel() inbound mention pipeline", () => {});it("rejects requests with a bad signature", async () => {+ const logs = captureLogRecords();const channel = slackChannel({ credentials: { botToken: "xoxb-test" } });const { body } = buildMentionBody();const req = buildSignedRequest({ body, signingSecret: "wrong-secret" });const { response, send } = await firePost(channel, req);expect(response.status).toBe(401);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "slack inbound verification failed" }),+ );});it("logs and drops the mention when onAppMention throws", async () => {+ const logs = captureLogRecords();const onAppMention = vi.fn().mockRejectedValue(new Error("typing failed"));const channel = slackChannel({credentials: { botToken: "xoxb-test" },@@ -2525,6 +2524,9 @@ describe("slackChannel() inbound mention pipeline", () => {expect(onAppMention).toHaveBeenCalledTimes(1);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "app_mention handler failed" }),+ );});});@@ -2694,10 +2696,11 @@ describe("slackChannel() generic Events API pipeline", () => {beforeEach(() => {process.env.SLACK_SIGNING_SECRET = SIGNING_SECRET;- fetchMock = vi.fn().mockResolvedValue(- new Response(JSON.stringify({ ok: true }), {- headers: { "content-type": "application/json" },- }),+ fetchMock = vi.fn(+ async () =>+ new Response(JSON.stringify({ ok: true }), {+ headers: { "content-type": "application/json" },+ }),);vi.stubGlobal("fetch", fetchMock);});@@ -3003,6 +3006,7 @@ describe("slackChannel() generic Events API pipeline", () => {});it("deduplicates generic events by event_id", async () => {+ const logs = captureLogRecords();const onEvent = vi.fn();const channel = slackChannel({credentials: { botToken: "xoxb-test" },@@ -3017,9 +3021,13 @@ describe("slackChannel() generic Events API pipeline", () => {await firePost(channel, buildSignedRequest({ body }));expect(onEvent).toHaveBeenCalledTimes(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "received a duplicate event" }),+ );});it("acks and logs handler failures without starting a turn", async () => {+ const logs = captureLogRecords();const onEvent = vi.fn().mockRejectedValue(new Error("event failed"));const channel = slackChannel({credentials: { botToken: "xoxb-test" },@@ -3032,6 +3040,9 @@ describe("slackChannel() generic Events API pipeline", () => {expect(response.status).toBe(200);expect(onEvent).toHaveBeenCalledTimes(1);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "event handler failed" }),+ );});});@@ -3042,10 +3053,11 @@ describe("slackChannel() inbound direct message pipeline", () => {beforeEach(() => {process.env.SLACK_SIGNING_SECRET = SIGNING_SECRET;- fetchMock = vi.fn().mockResolvedValue(- new Response(JSON.stringify({ ok: true, ts: "1700000001.000001" }), {- headers: { "content-type": "application/json" },- }),+ fetchMock = vi.fn(+ async () =>+ new Response(JSON.stringify({ ok: true, ts: "1700000001.000001" }), {+ headers: { "content-type": "application/json" },+ }),);vi.stubGlobal("fetch", fetchMock);});@@ -3198,6 +3210,7 @@ describe("slackChannel() inbound direct message pipeline", () => {});it("logs and drops the DM when onDirectMessage throws", async () => {+ const logs = captureLogRecords();const onDirectMessage = vi.fn().mockRejectedValue(new Error("bad handler"));const channel = slackChannel({credentials: { botToken: "xoxb-test" },@@ -3209,6 +3222,9 @@ describe("slackChannel() inbound direct message pipeline", () => {expect(onDirectMessage).toHaveBeenCalledTimes(1);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "direct_message handler failed" }),+ );});});@@ -3219,10 +3235,11 @@ describe("slackChannel() HITL interaction pipeline", () => {beforeEach(() => {process.env.SLACK_SIGNING_SECRET = SIGNING_SECRET;- fetchMock = vi.fn().mockResolvedValue(- new Response(JSON.stringify({ ok: true, ts: "1700000001.000001" }), {- headers: { "content-type": "application/json" },- }),+ fetchMock = vi.fn(+ async () =>+ new Response(JSON.stringify({ ok: true, ts: "1700000001.000001" }), {+ headers: { "content-type": "application/json" },+ }),);vi.stubGlobal("fetch", fetchMock);});@@ -3342,6 +3359,7 @@ describe("slackChannel() HITL interaction pipeline", () => {});it("acknowledges slash commands without a configured handler", async () => {+ const logs = captureLogRecords();const channel = slackChannel({});const { response, waitUntil } = await firePost(channel, buildSignedSlashCommandRequest());@@ -3349,6 +3367,12 @@ describe("slackChannel() HITL interaction pipeline", () => {expect(response.status).toBe(200);await expect(response.text()).resolves.toBe("");expect(waitUntil).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "Slack slash command ignored because onSlashCommand is not configured",+ }),+ );});it("delivers message shortcuts with workspace-scoped Slack API access", async () => {@@ -3830,6 +3854,7 @@ describe("slackChannel() HITL interaction pipeline", () => {});it("keeps HITL pending when the input-response hook rejects or throws", async () => {+ const logs = captureLogRecords();const handlers = [vi.fn(() => null),vi.fn(() => {@@ -3850,6 +3875,12 @@ describe("slackChannel() HITL interaction pipeline", () => {expect(send).not.toHaveBeenCalled();expect(slackOperations(fetchMock)).toEqual([]);}+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "HITL input response authorization failed",+ }),+ );});it("uses default HITL auth when onAppMention is authored", async () => {@@ -3865,6 +3896,7 @@ describe("slackChannel() HITL interaction pipeline", () => {});it("does not mark a HITL card answered when response delivery fails", async () => {+ const logs = captureLogRecords();const send = vi.fn().mockRejectedValue(new Error("target session not found"));const channel = slackChannel({ credentials: { botToken: "xoxb-test" } });@@ -3872,6 +3904,9 @@ describe("slackChannel() HITL interaction pipeline", () => {expect(send).toHaveBeenCalledTimes(1);expect(slackOperations(fetchMock)).toEqual([]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "HITL interaction delivery failed" }),+ );});it("waits for approval settlement before updating a tool-approval card", async () => {@@ -4285,10 +4320,11 @@ describe("slackChannel() webhookVerifier credentials path", () => {delete process.env.SLACK_BOT_TOKEN;vi.stubGlobal("fetch",- vi.fn().mockResolvedValue(- new Response(JSON.stringify({ ok: true, ts: "1.0" }), {- headers: { "content-type": "application/json" },- }),+ vi.fn(+ async () =>+ new Response(JSON.stringify({ ok: true, ts: "1.0" }), {+ headers: { "content-type": "application/json" },+ }),),);});@@ -4326,6 +4362,7 @@ describe("slackChannel() webhookVerifier credentials path", () => {});it("rejects with 401 when webhookVerifier throws", async () => {+ const logs = captureLogRecords();const verifier = vi.fn().mockRejectedValue(new Error("nope"));const channel = slackChannel({credentials: { botToken: "xoxb-test", webhookVerifier: verifier },@@ -4341,6 +4378,9 @@ describe("slackChannel() webhookVerifier credentials path", () => {const { response, send } = await firePost(channel, req);expect(response.status).toBe(401);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "slack inbound verification failed" }),+ );});});@@ -4617,6 +4657,13 @@ describe("slackChannel().receive", () => {// token from `event.thread_ts` so it matches the one receive()// used, and the parked session resumes via runtime.deliver.const inboundSend = vi.fn().mockResolvedValue({ id: "s" });+ // The mention's typing indicator and thread refresh reach Slack too.+ fetchMock.mockImplementation(+ async () =>+ new Response(JSON.stringify({ ok: true, messages: [] }), {+ headers: { "content-type": "application/json" },+ }),+ );const mentionBody = JSON.stringify({type: "event_callback",team_id: "T01",diff --git a/packages/eve/src/public/channels/slack/verify.ts b/packages/eve/src/public/channels/slack/verify.tsindex 9c8e64c49..63798a090 100644--- a/packages/eve/src/public/channels/slack/verify.ts+++ b/packages/eve/src/public/channels/slack/verify.ts@@ -6,7 +6,7 @@ import {export type { SlackWebhookVerifier };/** Verification inputs for Eve's Slack webhook route. */-export interface SlackVerifyOptions {+interface SlackVerifyOptions {readonly signingSecret: string | undefined;readonly webhookVerifier: SlackWebhookVerifier | undefined;readonly maxSkewSeconds?: number;diff --git a/packages/eve/src/public/channels/teams/teamsChannel.ts b/packages/eve/src/public/channels/teams/teamsChannel.tsindex efcf8e887..2cc3e2058 100644--- a/packages/eve/src/public/channels/teams/teamsChannel.ts+++ b/packages/eve/src/public/channels/teams/teamsChannel.ts@@ -81,7 +81,7 @@ export interface TeamsInboundMessageContext extends TeamsContext {}/** Channel-owned Teams context returned by `context()`. */-export interface TeamsChannelContext extends TeamsContext {+interface TeamsChannelContext extends TeamsContext {readonly adaptiveCardVersion: string;state: TeamsChannelState;}diff --git a/packages/eve/src/public/channels/telegram/attachments.test.ts b/packages/eve/src/public/channels/telegram/attachments.test.tsindex d74bf524e..db0c137ef 100644--- a/packages/eve/src/public/channels/telegram/attachments.test.ts+++ b/packages/eve/src/public/channels/telegram/attachments.test.ts@@ -5,9 +5,11 @@ import {createTelegramFetchFile,createTelegramFileUrl,} from "#public/channels/telegram/attachments.js";+import { captureLogRecords } from "#internal/testing/log-records.js";describe("collectTelegramFileParts", () => {it("emits URL-backed file parts and applies the upload policy", () => {+ const logs = captureLogRecords();const parts = collectTelegramFileParts([{@@ -35,6 +37,13 @@ describe("collectTelegramFileParts", () => {type: "file",});expect(String(parts[0]!.data)).toContain("telegram-file:");+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message:+ 'dropped attachment — report.pdf has media type "application/pdf" which is not allowed by this route. Allowed: image/*.',+ }),+ );});});diff --git a/packages/eve/src/public/channels/telegram/audience.ts b/packages/eve/src/public/channels/telegram/audience.tsindex c6c7d7eef..91606eb4d 100644--- a/packages/eve/src/public/channels/telegram/audience.ts+++ b/packages/eve/src/public/channels/telegram/audience.ts@@ -3,7 +3,7 @@ import type { TelegramInstrumentationMetadata } from "#public/channels/telegram/import type { TelegramChannelState } from "#public/channels/telegram/telegramChannel.js";import type { AudienceContext } from "#shared/conversation-context.js";-export function telegramInstrumentationMetadata(+function telegramInstrumentationMetadata(state: TelegramChannelState,): TelegramInstrumentationMetadata {return {@@ -13,7 +13,7 @@ export function telegramInstrumentationMetadata(};}-export function telegramAudience(state: TelegramChannelState): ChannelAudience {+function telegramAudience(state: TelegramChannelState): ChannelAudience {return telegramAudienceForChatType(state.chatType);}diff --git a/packages/eve/src/public/channels/telegram/telegramChannel.test.ts b/packages/eve/src/public/channels/telegram/telegramChannel.test.tsindex b8a4efc7a..5dab51a0c 100644--- a/packages/eve/src/public/channels/telegram/telegramChannel.test.ts+++ b/packages/eve/src/public/channels/telegram/telegramChannel.test.ts@@ -14,6 +14,7 @@ import {type TelegramChannelState,} from "#public/channels/telegram/index.js";import { isTelegramBotMentioned } from "#public/channels/telegram/defaults.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const SECRET = "telegram-secret";@@ -276,6 +277,7 @@ describe("telegramChannel() inbound route", () => {});it("sends authorization privately after the requester taps its group callback", async () => {+ const logs = captureLogRecords();const fetchMock = vi.fn().mockResolvedValue(new Response(JSON.stringify({ ok: true, result: true })));@@ -336,6 +338,12 @@ describe("telegramChannel() inbound route", () => {callback_query_id: "cb-auth",text: "Sign-in prompt sent privately.",});+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "error",+ message: "Telegram authorization callback delivery failed",+ }),+ );});it("keeps direct approval replies as fallback text for option prompts", async () => {@@ -366,6 +374,7 @@ describe("telegramChannel() inbound route", () => {});it("rejects requests with invalid webhook verification", async () => {+ const logs = captureLogRecords();const channel = telegramChannel({ credentials: { webhookSecretToken: SECRET } });const compiled = asCompiled(channel);const post = compiled.routes.find((route) => route.method === "POST");@@ -392,6 +401,9 @@ describe("telegramChannel() inbound route", () => {expect(response.status).toBe(401);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "telegram inbound verification failed" }),+ );});});diff --git a/packages/eve/src/public/channels/telegram/telegramChannel.ts b/packages/eve/src/public/channels/telegram/telegramChannel.tsindex 129bdf10c..d6ff7ac66 100644--- a/packages/eve/src/public/channels/telegram/telegramChannel.ts+++ b/packages/eve/src/public/channels/telegram/telegramChannel.ts@@ -86,7 +86,7 @@ export interface TelegramContext {}/** Channel-owned Telegram context returned by `context()`. */-export interface TelegramChannelContext extends TelegramContext {+interface TelegramChannelContext extends TelegramContext {state: TelegramChannelState;}diff --git a/packages/eve/src/public/channels/twilio/defaults.ts b/packages/eve/src/public/channels/twilio/defaults.tsindex bfe8fe053..164129851 100644--- a/packages/eve/src/public/channels/twilio/defaults.ts+++ b/packages/eve/src/public/channels/twilio/defaults.ts@@ -14,7 +14,7 @@ import type {} from "#public/channels/twilio/twilioChannel.js";/** Default phone-number auth projection for Twilio webhook actors. */-export function defaultTwilioAuth(input: {+function defaultTwilioAuth(input: {readonly from: string;readonly to?: string;readonly channel: "text" | "voice";diff --git a/packages/eve/src/public/channels/twilio/routing.ts b/packages/eve/src/public/channels/twilio/routing.tsindex 1fc5183c6..b3c2bf272 100644--- a/packages/eve/src/public/channels/twilio/routing.ts+++ b/packages/eve/src/public/channels/twilio/routing.ts@@ -10,7 +10,7 @@ export interface TwilioRoutes {readonly voice: string;}-export type TwilioVerifyResult = {+type TwilioVerifyResult = {readonly body: string;readonly params: URLSearchParams;} | null;diff --git a/packages/eve/src/public/channels/twilio/twilioChannel.test.ts b/packages/eve/src/public/channels/twilio/twilioChannel.test.tsindex cabe156df..06f0dce24 100644--- a/packages/eve/src/public/channels/twilio/twilioChannel.test.ts+++ b/packages/eve/src/public/channels/twilio/twilioChannel.test.ts@@ -11,6 +11,7 @@ import type { UnstampedMessageStreamEvent } from "#protocol/message.js";import type { TwilioTextMessage } from "#public/channels/twilio/inbound.js";import { twilioChannel, type TwilioContext } from "#public/channels/twilio/twilioChannel.js";import { signTwilioRequest } from "#public/channels/twilio/verify.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const AUTH_TOKEN = "test-auth-token";@@ -361,6 +362,7 @@ describe("twilioChannel() inbound text pipeline", () => {});it("rejects inbound text with a bad signature", async () => {+ const logs = captureLogRecords();const channel = twilioChannel({ allowFrom: "*" });const compiled = asCompiled(channel);const post = compiled.routes.find((r) => r.path === "/eve/v1/twilio/messages");@@ -389,6 +391,9 @@ describe("twilioChannel() inbound text pipeline", () => {expect(response.status).toBe(401);expect(send).not.toHaveBeenCalled();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "twilio inbound verification failed" }),+ );});it("keeps the same sender separate across different Twilio receiver numbers", async () => {diff --git a/packages/eve/src/public/channels/twilio/twilioChannel.ts b/packages/eve/src/public/channels/twilio/twilioChannel.tsindex 45fa9dff6..54bf57117 100644--- a/packages/eve/src/public/channels/twilio/twilioChannel.ts+++ b/packages/eve/src/public/channels/twilio/twilioChannel.ts@@ -57,7 +57,7 @@ export interface TwilioContext {}/** Channel-owned Twilio context returned by `context()`. */-export interface TwilioChannelContext extends TwilioContext {+interface TwilioChannelContext extends TwilioContext {state: TwilioChannelState;}diff --git a/packages/eve/src/public/definitions/channel.ts b/packages/eve/src/public/definitions/channel.tsindex e94aa4cd9..6e4e73702 100644--- a/packages/eve/src/public/definitions/channel.ts+++ b/packages/eve/src/public/definitions/channel.ts@@ -175,7 +175,7 @@ export interface ChannelContinuationOps {* Channel context passed to event handlers: `TCtx` intersected with* {@link ChannelContinuationOps}.*/-export type ChannelContext<TCtx> = TCtx & ChannelContinuationOps;+type ChannelContext<TCtx> = TCtx & ChannelContinuationOps;type ChannelEventHandler<T extends UnstampedMessageStreamEvent["type"], TCtx> = (data: EventData<T>,diff --git a/packages/eve/src/public/definitions/exact.test.ts b/packages/eve/src/public/definitions/exact.test.tsindex 1049062fa..d920cd77f 100644--- a/packages/eve/src/public/definitions/exact.test.ts+++ b/packages/eve/src/public/definitions/exact.test.ts@@ -18,10 +18,7 @@ import {defineDynamic as defineDynamicInstructions,defineInstructions,} from "#public/definitions/instructions.js";-import {- defineInstrumentation,- type ProviderDefinition,-} from "#public/definitions/instrumentation.js";+import { defineInstrumentation, type ProviderDefinition } from "#public/instrumentation/index.js";import { defineSandbox } from "#public/definitions/sandbox.js";import { DockerSandbox, VercelSandbox } from "#sandbox/providers.js";import { defineSchedule } from "#public/definitions/schedule.js";diff --git a/packages/eve/src/public/definitions/instrumentation.ts b/packages/eve/src/public/definitions/instrumentation.tsdeleted file mode 100644index 34ff123c2..000000000--- a/packages/eve/src/public/definitions/instrumentation.ts+++ /dev/null@@ -1 +0,0 @@-export * from "#public/instrumentation/index.js";diff --git a/packages/eve/src/public/models/openai/chatgpt/auth.test.ts b/packages/eve/src/public/models/openai/chatgpt/auth.test.tsindex e14cebf8a..540d8d966 100644--- a/packages/eve/src/public/models/openai/chatgpt/auth.test.ts+++ b/packages/eve/src/public/models/openai/chatgpt/auth.test.ts@@ -5,7 +5,7 @@ import {extractCodexAccountLabelFromToken,readCodexJwtExpirationMs,} from "./auth.js";-import { createUnsignedJwt } from "./unsigned-jwt.js";+import { createUnsignedJwt } from "#internal/testing/unsigned-jwt.js";describe("Codex token metadata", () => {it("reads JWT expiry without exposing token contents", () => {diff --git a/packages/eve/src/public/models/openai/chatgpt/model.integration.test.ts b/packages/eve/src/public/models/openai/chatgpt/model.integration.test.tsindex 8f51b24f4..d16a3d5a3 100644--- a/packages/eve/src/public/models/openai/chatgpt/model.integration.test.ts+++ b/packages/eve/src/public/models/openai/chatgpt/model.integration.test.ts@@ -6,6 +6,10 @@ import { createToolLoopHarness } from "#harness/tool-loop.js";import type { HarnessSession } from "#harness/types.js";import { createCodexSubscriptionModel } from "./model.js";+// The harness runs outside a workflow body here, where run attributes cannot+// be written; the attribute contract is covered by emit.test.ts.+vi.mock("#runtime/attributes/emit.js", () => ({ setEveAttributes: vi.fn(async () => {}) }));+afterEach(() => vi.restoreAllMocks());interface RecordedRequest {diff --git a/packages/eve/src/public/models/openai/chatgpt/model.ts b/packages/eve/src/public/models/openai/chatgpt/model.tsindex ffc6a819f..7201bed0c 100644--- a/packages/eve/src/public/models/openai/chatgpt/model.ts+++ b/packages/eve/src/public/models/openai/chatgpt/model.ts@@ -8,7 +8,7 @@ import { createCodexFetch, type CodexTransportOptions } from "./transport.js";const CODEX_LOCAL_AUTH_API_KEY = "codex-local-auth";/** Configures the Codex model selected by the local ChatGPT login. */-export interface CodexModelOptions {+interface CodexModelOptions {/** OpenAI model ID passed to the Codex Responses endpoint, for example `gpt-5.6-sol`. */readonly model: string;}diff --git a/packages/eve/src/public/models/openai/chatgpt/oauth.test.ts b/packages/eve/src/public/models/openai/chatgpt/oauth.test.tsindex 1c90edb95..b7eab060b 100644--- a/packages/eve/src/public/models/openai/chatgpt/oauth.test.ts+++ b/packages/eve/src/public/models/openai/chatgpt/oauth.test.ts@@ -1,6 +1,6 @@import { describe, expect, it, vi } from "vitest";import { CHATGPT_CLIENT_ID, requestChatGptTokens } from "./oauth.js";-import { createUnsignedJwt } from "./unsigned-jwt.js";+import { createUnsignedJwt } from "#internal/testing/unsigned-jwt.js";describe("ChatGPT OAuth token exchange", () => {it("exchanges a PKCE code and retains account identity from the ID token", async () => {diff --git a/packages/eve/src/public/models/openai/chatgpt/token-broker.ts b/packages/eve/src/public/models/openai/chatgpt/token-broker.tsindex 9cd835592..c8e862350 100644--- a/packages/eve/src/public/models/openai/chatgpt/token-broker.ts+++ b/packages/eve/src/public/models/openai/chatgpt/token-broker.ts@@ -32,7 +32,7 @@ export interface CodexTokenBroker {export type ChatGptCredentialOwner = "codex" | "eve";-export interface CodexTokenBrokerOptions extends CodexAppServerOptions {+interface CodexTokenBrokerOptions extends CodexAppServerOptions {readonly appServer?: CodexAppServer;readonly store?: ChatGptCredentialStore;readonly fetch?: typeof fetch;diff --git a/packages/eve/src/public/nuxt/dev-server.ts b/packages/eve/src/public/nuxt/dev-server.tsindex 17abb633c..f18760e87 100644--- a/packages/eve/src/public/nuxt/dev-server.ts+++ b/packages/eve/src/public/nuxt/dev-server.ts@@ -19,12 +19,12 @@ const EVE_NUXT_DEV_SERVER_FILE_NAME = "nuxt-dev-server.json";const EVE_NUXT_DEV_SERVER_LOCK_FILE_NAME = "nuxt-dev-server.lock";const LOCAL_SERVER_URL_PATTERN = /https?:\/\/(?:\[[^\]\s]+\]|[^\s/:[\]]+)(?::\d+)?/;-export interface EveProcessHandle {+interface EveProcessHandle {readonly origin: string;readonly process?: ChildProcess;}-export interface EveDevServerRegistry {+interface EveDevServerRegistry {readonly appRoot: string;readonly origin: string;readonly pid: number | null;diff --git a/packages/eve/src/public/sveltekit/dev-server.ts b/packages/eve/src/public/sveltekit/dev-server.tsindex 135f463f2..b30ba30b7 100644--- a/packages/eve/src/public/sveltekit/dev-server.ts+++ b/packages/eve/src/public/sveltekit/dev-server.ts@@ -19,12 +19,12 @@ const EVE_SVELTEKIT_DEV_SERVER_FILE_NAME = "sveltekit-dev-server.json";const EVE_SVELTEKIT_DEV_SERVER_LOCK_FILE_NAME = "sveltekit-dev-server.lock";const LOCAL_SERVER_URL_PATTERN = /https?:\/\/(?:\[[^\]\s]+\]|[^\s/:[\]]+)(?::\d+)?/;-export interface EveProcessHandle {+interface EveProcessHandle {readonly origin: string;readonly process?: ChildProcess;}-export interface EveDevServerRegistry {+interface EveDevServerRegistry {readonly appRoot: string;readonly origin: string;readonly pid: number | null;diff --git a/packages/eve/src/react/use-eve-agent.test.ts b/packages/eve/src/react/use-eve-agent.test.tsindex 345c96d74..92ebc0934 100644--- a/packages/eve/src/react/use-eve-agent.test.ts+++ b/packages/eve/src/react/use-eve-agent.test.ts@@ -1,6 +1,6 @@import { createElement, StrictMode, useState } from "react";import { act, create as createRenderer } from "react-test-renderer";-import { afterEach, describe, expect, it, vi } from "vitest";+import { afterAll, afterEach, beforeAll, describe, expect, it, vi } from "vitest";import { useEveAgent, type UseEveAgentHelpers } from "#react/use-eve-agent.js";import type { EveMessageData } from "#client/message-reducer.js";@@ -133,12 +133,39 @@ function completedTurnData(input: {const renderers: ReturnType<typeof createRenderer>[] = [];+const REACT_TEST_RENDERER_DEPRECATION =+ "react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer";+function create(...args: Parameters<typeof createRenderer>) {- const renderer = createRenderer(...args);- renderers.push(renderer);- return renderer;+ // react-test-renderer 19 reports its own deprecation on every create().+ // Drop only that line; any other error still reaches the console.+ const consoleError = console.error;+ const spy = vi.spyOn(console, "error").mockImplementation((...data: unknown[]) => {+ if (data[0] !== REACT_TEST_RENDERER_DEPRECATION) consoleError(...data);+ });+ try {+ const renderer = createRenderer(...args);+ renderers.push(renderer);+ return renderer;+ } finally {+ spy.mockRestore();+ }}+type ReactActEnvironment = typeof globalThis & { IS_REACT_ACT_ENVIRONMENT?: boolean };+const actEnvironment = globalThis as ReactActEnvironment;+const previousActEnvironment = actEnvironment.IS_REACT_ACT_ENVIRONMENT;++// Every update in this file runs inside act(); declaring the act environment+// is how React knows that, instead of warning on each update.+beforeAll(() => {+ actEnvironment.IS_REACT_ACT_ENVIRONMENT = true;+});++afterAll(() => {+ actEnvironment.IS_REACT_ACT_ENVIRONMENT = previousActEnvironment;+});+afterEach(async () => {try {await act(async () => {diff --git a/packages/eve/src/runtime/compiled-artifacts-source.ts b/packages/eve/src/runtime/compiled-artifacts-source.tsindex afbff38a4..a6c78dcd6 100644--- a/packages/eve/src/runtime/compiled-artifacts-source.ts+++ b/packages/eve/src/runtime/compiled-artifacts-source.ts@@ -90,15 +90,6 @@ export function createDiskRuntimeCompiledArtifactsSource(};}-/**- * Returns the disk-backed app root when one exists for the artifact source.- */-export function getRuntimeCompiledArtifactsAppRoot(- source: RuntimeCompiledArtifactsSource,-): string | undefined {- return source.kind === "disk" ? source.appRoot : undefined;-}-/*** Returns the stable application root to use for local sandbox cache scope.*/diff --git a/packages/eve/src/runtime/connections/instance-identity.ts b/packages/eve/src/runtime/connections/instance-identity.tsindex c23dc5b61..6220cdd05 100644--- a/packages/eve/src/runtime/connections/instance-identity.ts+++ b/packages/eve/src/runtime/connections/instance-identity.ts@@ -1,7 +1,6 @@import { createHash } from "node:crypto";import type { ConnectionProtocol } from "#shared/connection-types.js";-import type { ResolvedConnectionDefinition } from "#runtime/types.js";/** Builds the opaque, reconstruction-stable identity for one resolved connection instance. */export function createConnectionInstanceId(input: {@@ -24,8 +23,3 @@ export function createConnectionInstanceId(input: {.digest("base64url");return `connection:${digest}`;}--/** Returns the cache and callback scope for one resolved connection. */-export function connectionAuthorizationScope(connection: ResolvedConnectionDefinition): string {- return connection.instanceId ?? connection.connectionName;-}diff --git a/packages/eve/src/runtime/connections/mcp-tracing.ts b/packages/eve/src/runtime/connections/mcp-tracing.tsindex c5d74b74b..d7df9a7ad 100644--- a/packages/eve/src/runtime/connections/mcp-tracing.ts+++ b/packages/eve/src/runtime/connections/mcp-tracing.ts@@ -87,7 +87,7 @@ export function createMcpTraceFetch(input: {};}-export function injectMcpTraceContext(+function injectMcpTraceContext(message: JsonRpcRequest,activeContext: Context,injectContext: McpTraceContextInjector = injectOpenTelemetryTraceContext,@@ -295,7 +295,7 @@ interface JsonRpcRequest extends Record<string, unknown> {readonly params?: unknown;}-export type McpTraceContextInjector = (context: Context, carrier: Record<string, string>) => void;+type McpTraceContextInjector = (context: Context, carrier: Record<string, string>) => void;function injectOpenTelemetryTraceContext(context: Context, carrier: Record<string, string>): void {propagation.inject(context, carrier, traceContextSetter);diff --git a/packages/eve/src/runtime/connections/openapi-client.ts b/packages/eve/src/runtime/connections/openapi-client.tsindex 4c1b05c83..9222080b1 100644--- a/packages/eve/src/runtime/connections/openapi-client.ts+++ b/packages/eve/src/runtime/connections/openapi-client.ts@@ -63,7 +63,7 @@ const SWAGGER_PARAMETER_SCHEMA_KEYS = [* tool result so it can react to the status and body of any response,* including non-2xx responses.*/-export interface OpenApiToolResult {+interface OpenApiToolResult {readonly status: number;readonly statusText: string;readonly body: unknown;diff --git a/packages/eve/src/runtime/connections/scoped-authorization.ts b/packages/eve/src/runtime/connections/scoped-authorization.tsindex f679a00ca..0cf0671e9 100644--- a/packages/eve/src/runtime/connections/scoped-authorization.ts+++ b/packages/eve/src/runtime/connections/scoped-authorization.ts@@ -314,7 +314,7 @@ export async function completeScopedAuthorization(input: ScopedAuthorization): P* callback URL can be minted (for example outside a deployment), so* callers can fall through to rethrowing the original `Required` error.*/-export async function startScopedAuthorization(+async function startScopedAuthorization(input: ScopedAuthorization,): Promise<AuthorizationSignal | undefined> {const { scope, authorization, connection } = input;diff --git a/packages/eve/src/runtime/hooks/registry.test.ts b/packages/eve/src/runtime/hooks/registry.test.tsindex a81e2fe25..9a0531e09 100644--- a/packages/eve/src/runtime/hooks/registry.test.ts+++ b/packages/eve/src/runtime/hooks/registry.test.ts@@ -1,7 +1,7 @@import { describe, expect, it } from "vitest";import type { ResolvedHookDefinition } from "../types.js";-import { createEmptyHookRegistry, createRuntimeHookRegistry } from "./registry.js";+import { createRuntimeHookRegistry } from "./registry.js";describe("createRuntimeHookRegistry", () => {it("splits typed and wildcard stream-event subscribers", () => {@@ -22,14 +22,6 @@ describe("createRuntimeHookRegistry", () => {});});-describe("createEmptyHookRegistry", () => {- it("returns flat empty buckets", () => {- const registry = createEmptyHookRegistry();- expect(registry.streamEventsByType.size).toBe(0);- expect(registry.streamEventsWildcard).toEqual([]);- });-});-function makeHook(partial: {readonly slug: string;readonly events?: ResolvedHookDefinition["events"];diff --git a/packages/eve/src/runtime/hooks/registry.ts b/packages/eve/src/runtime/hooks/registry.tsindex 99db43c21..e4b54c6ee 100644--- a/packages/eve/src/runtime/hooks/registry.ts+++ b/packages/eve/src/runtime/hooks/registry.ts@@ -25,19 +25,6 @@ export interface RuntimeHookRegistry {readonly streamEventsWildcard: readonly RuntimeStreamEventHookEntry[];}-/**- * Returns an empty registry. Used by tests that build a runtime bundle- * stub without authored hooks — production registries are constructed- * via {@link createRuntimeHookRegistry} from the resolved authored- * graph.- */-export function createEmptyHookRegistry(): RuntimeHookRegistry {- return {- streamEventsByType: new Map(),- streamEventsWildcard: [],- };-}-/*** Builds the per-node runtime hook registry from an ordered list of* resolved hook definitions.diff --git a/packages/eve/src/runtime/loaders/artifact-paths.ts b/packages/eve/src/runtime/loaders/artifact-paths.tsindex 09dd4b2c4..a1a064f0e 100644--- a/packages/eve/src/runtime/loaders/artifact-paths.ts+++ b/packages/eve/src/runtime/loaders/artifact-paths.ts@@ -1,7 +1,7 @@/*** Runtime-owned compiled artifact paths for one application root.*/-export interface RuntimeCompilerArtifactPaths {+interface RuntimeCompilerArtifactPaths {readonly appRoot: string;readonly compiledManifestPath: string;readonly compileDirectoryPath: string;diff --git a/packages/eve/src/runtime/loaders/bundled-artifacts.test.ts b/packages/eve/src/runtime/loaders/bundled-artifacts.test.tsindex ec96d7d55..43440c83f 100644--- a/packages/eve/src/runtime/loaders/bundled-artifacts.test.ts+++ b/packages/eve/src/runtime/loaders/bundled-artifacts.test.ts@@ -1,7 +1,7 @@import { describe, expect, it } from "vitest";import { createCompileMetadata, resolveCompilerArtifactPaths } from "#compiler/artifacts.js";-import { compileFromMemory } from "#compiler/compile-from-memory.js";+import { compileFromMemory } from "#internal/testing/compile-from-memory.js";import {readBundledCompiledArtifacts,withBundledCompiledArtifacts,diff --git a/packages/eve/src/runtime/loaders/bundled-artifacts.ts b/packages/eve/src/runtime/loaders/bundled-artifacts.tsindex e325e9f16..a86357781 100644--- a/packages/eve/src/runtime/loaders/bundled-artifacts.ts+++ b/packages/eve/src/runtime/loaders/bundled-artifacts.ts@@ -63,16 +63,6 @@ export async function withBundledCompiledArtifacts<T>(* Reads the bundled compiled-artifact snapshot for the active runtime* session, or `null` if none has been installed.*/-export function updateBundledSandboxPreparedArtifacts(- sandboxPreparedArtifacts: SandboxPreparedArtifactsManifest,-): boolean {- const session = getActiveRuntimeSession();- const installed = session.compiledArtifacts;- if (installed === null) return false;- setRuntimeSessionCompiledArtifacts(session, { ...installed, sandboxPreparedArtifacts });- return true;-}-export function readBundledCompiledArtifacts(): BundledCompiledArtifacts | null {return getActiveRuntimeSession().compiledArtifacts;}diff --git a/packages/eve/src/runtime/resolve-agent.ts b/packages/eve/src/runtime/resolve-agent.tsindex a8540bbca..c1697f84e 100644--- a/packages/eve/src/runtime/resolve-agent.ts+++ b/packages/eve/src/runtime/resolve-agent.ts@@ -7,11 +7,6 @@ import type { AgentSourceOwner } from "#compiler/source-graph.js";import type { CompiledModuleMap } from "#compiler/module-map.js";import { resolveChannelDefinition } from "#runtime/resolve-channel.js";-// Re-exported so external consumers (tests, integrations) can keep-// importing the error class from this path even though it now lives-// in resolve-helpers.ts.-export { ResolveAgentError } from "#runtime/resolve-helpers.js";-import { resolveConnectionDefinition } from "#runtime/resolve-connection.js";import { resolveDynamicConnectionDefinition } from "#runtime/resolve-dynamic-connection.js";import { resolveHookDefinition } from "#runtime/resolve-hook.js";@@ -32,7 +27,7 @@ import type {/*** Input for resolving one compiled authored agent into a runtime-owned model.*/-export interface ResolveAgentInput {+interface ResolveAgentInput {manifest: CompiledAgentNodeManifest | CompiledAgentResources;moduleMap: CompiledModuleMap;nodeId?: string;diff --git a/packages/eve/src/runtime/resolve-dynamic-tool.ts b/packages/eve/src/runtime/resolve-dynamic-tool.tsindex 25fbab7d5..a4bb0c95b 100644--- a/packages/eve/src/runtime/resolve-dynamic-tool.ts+++ b/packages/eve/src/runtime/resolve-dynamic-tool.ts@@ -66,7 +66,7 @@ export async function resolveDynamicToolDefinition(* Framework-owned definitions are already loaded with eve itself. Both use* the same validation, source registration, and resolver construction here.*/-export function resolveLoadedDynamicToolDefinition(+function resolveLoadedDynamicToolDefinition(value: unknown,source: DynamicToolResolverSource,eventNames?: readonly string[],diff --git a/packages/eve/src/runtime/sandbox/prepared-artifacts.ts b/packages/eve/src/runtime/sandbox/prepared-artifacts.tsindex a729e6a16..302f4098e 100644--- a/packages/eve/src/runtime/sandbox/prepared-artifacts.ts+++ b/packages/eve/src/runtime/sandbox/prepared-artifacts.ts@@ -56,7 +56,7 @@ export async function loadSandboxPreparedArtifact(input: {return entry?.artifact;}-export async function loadSandboxPreparedArtifactsManifest(+async function loadSandboxPreparedArtifactsManifest(source: RuntimeCompiledArtifactsSource,): Promise<SandboxPreparedArtifactsManifest | null> {if (source.kind === "bundled") {diff --git a/packages/eve/src/runtime/schedules/register.ts b/packages/eve/src/runtime/schedules/register.tsindex 6785a4a38..7c3e0eda7 100644--- a/packages/eve/src/runtime/schedules/register.ts+++ b/packages/eve/src/runtime/schedules/register.ts@@ -3,7 +3,7 @@ import type { ResolvedScheduleDefinition } from "#runtime/types.js";/*** Stable Nitro task-name prefix for framework-owned authored schedules.*/-export const EVE_SCHEDULE_TASK_NAME_PREFIX = "eve.schedule.";+const EVE_SCHEDULE_TASK_NAME_PREFIX = "eve.schedule.";/*** One compiled schedule registration consumed by the Nitro host wiring.diff --git a/packages/eve/src/sandbox/backends/probes.ts b/packages/eve/src/sandbox/backends/probes.tsdeleted file mode 100644index 8b0b6563a..000000000--- a/packages/eve/src/sandbox/backends/probes.ts+++ /dev/null@@ -1,16 +0,0 @@-import { isLinuxDockerDaemonAvailableSync } from "#execution/sandbox/bindings/docker-cli.js";-import { isMicrosandboxPlatformSupported } from "#execution/sandbox/bindings/microsandbox-platform.js";--/** Availability probes shared by built-in backend selectors. */-export interface DefaultSandboxProbes {- readonly isDeployedOnVercel: () => boolean;- readonly isDockerAvailable: () => boolean;- readonly isMicrosandboxSupported: () => boolean;-}--// Keep probes separate from backend factories so authored selectors do not bundle engines.-export const SANDBOX_BACKEND_PROBES: DefaultSandboxProbes = {- isDeployedOnVercel: () => Boolean(process.env.VERCEL),- isDockerAvailable: () => isLinuxDockerDaemonAvailableSync(),- isMicrosandboxSupported: () => isMicrosandboxPlatformSupported(),-};diff --git a/packages/eve/src/self-modification/config.test.ts b/packages/eve/src/self-modification/config.test.tsindex db408c391..b4376c4fe 100644--- a/packages/eve/src/self-modification/config.test.ts+++ b/packages/eve/src/self-modification/config.test.ts@@ -1,7 +1,7 @@import { afterEach, describe, expect, it } from "vitest";import { resolveSelfModificationConfig } from "./config.js";-import { resolveGitHubCredential } from "./credentials.js";+import { createGitHubCredentialProvider } from "./credentials.js";import { resolveSelfModificationMode } from "./mode.js";afterEach(() => {@@ -168,11 +168,12 @@ describe("self-modification deployed configuration", () => {it("resolves the GitHub token for each capability", async () => {process.env.EVE_SELF_MODIFICATION_GITHUB_TOKEN = " secret-token ";- const repository = resolveSelfModificationConfig(deployed).deployed!.repository;- await expect(resolveGitHubCredential({ capability: "checkout", repository })).resolves.toBe(+ const { credentials, repository } = resolveSelfModificationConfig(deployed).deployed!;+ const provider = createGitHubCredentialProvider(credentials);+ await expect(provider.resolve({ capability: "checkout", repository })).resolves.toBe("secret-token",);- await expect(resolveGitHubCredential({ capability: "publish", repository })).resolves.toBe(+ await expect(provider.resolve({ capability: "publish", repository })).resolves.toBe("secret-token",);});diff --git a/packages/eve/src/self-modification/credentials.ts b/packages/eve/src/self-modification/credentials.tsindex 6d0ecadea..db6cc4817 100644--- a/packages/eve/src/self-modification/credentials.ts+++ b/packages/eve/src/self-modification/credentials.ts@@ -1,8 +1,4 @@-import type {- GitHubCredentialProvider,- GitHubCredentialRequest,- ResolvedGitHubCredentials,-} from "./config.js";+import type { GitHubCredentialProvider, ResolvedGitHubCredentials } from "./config.js";export const SELF_MODIFICATION_GITHUB_TOKEN_ENV = "EVE_SELF_MODIFICATION_GITHUB_TOKEN";@@ -27,12 +23,7 @@ export function createGitHubCredentialProvider(};}-/** Resolves a PAT GitHub credential without exposing it to authored code. */-export async function resolveGitHubCredential(request: GitHubCredentialRequest): Promise<string> {- return defaultGitHubCredentialProvider.resolve(request);-}--export const defaultGitHubCredentialProvider: GitHubCredentialProvider = {+const defaultGitHubCredentialProvider: GitHubCredentialProvider = {async resolve() {const token = process.env[SELF_MODIFICATION_GITHUB_TOKEN_ENV];if (token === undefined || token.trim().length === 0) {diff --git a/packages/eve/src/self-modification/filesystem.ts b/packages/eve/src/self-modification/filesystem.tsindex 98add1e03..dafe6c32f 100644--- a/packages/eve/src/self-modification/filesystem.ts+++ b/packages/eve/src/self-modification/filesystem.ts@@ -64,5 +64,3 @@ export async function createSelfModificationFilesystem(input: {],});}--export const createLocalSelfModificationFilesystem = createSelfModificationFilesystem;diff --git a/packages/eve/src/self-modification/git-workspace.ts b/packages/eve/src/self-modification/git-workspace.tsindex 9a38b0961..9ee4db703 100644--- a/packages/eve/src/self-modification/git-workspace.ts+++ b/packages/eve/src/self-modification/git-workspace.ts@@ -13,9 +13,9 @@ import { gitOutput, runGitCommand, withBrokeredGitHubCredential } from "./git.jsimport { assertFullSha, assertGitRef } from "./identifiers.js";export const SELF_MODIFICATION_CONFIG_PATH = "agent/extensions/self-modification/extension.ts";-export const WORKSPACE_PATH = "/workspace";+const WORKSPACE_PATH = "/workspace";export const REPOSITORY_PATH = `${WORKSPACE_PATH}/repository`;-export const BASE_REF = "refs/eve-self-modification/base";+const BASE_REF = "refs/eve-self-modification/base";const GIT_FETCH_ENV ="GIT_CONFIG_NOSYSTEM=1 GIT_CONFIG_GLOBAL=/dev/null GIT_LFS_SKIP_SMUDGE=1 GIT_TERMINAL_PROMPT=0";@@ -90,7 +90,7 @@ export async function readPreparedSelfModificationWorkspace(input: {};}-export async function verifyApplicationRoot(+async function verifyApplicationRoot(sandbox: Pick<SandboxSession, "run">,directory: string,): Promise<void> {diff --git a/packages/eve/src/self-modification/github-publisher.ts b/packages/eve/src/self-modification/github-publisher.tsindex 0cdc349d5..a3d52ec3c 100644--- a/packages/eve/src/self-modification/github-publisher.ts+++ b/packages/eve/src/self-modification/github-publisher.ts@@ -25,7 +25,7 @@ export interface PublishedSelfModificationProposal {readonly deployed: false;}-export interface GitHubDraftPublisherInput {+interface GitHubDraftPublisherInput {readonly credentialProvider: GitHubCredentialProvider;readonly description: string;readonly fetch?: typeof fetch;diff --git a/packages/eve/src/self-modification/migration.ts b/packages/eve/src/self-modification/migration.tsindex 9a999a321..8e8eac1b4 100644--- a/packages/eve/src/self-modification/migration.ts+++ b/packages/eve/src/self-modification/migration.ts@@ -1,7 +1,7 @@import { readdir, readFile, rm } from "node:fs/promises";import { join, relative } from "node:path";-export const LEGACY_SELF_MODIFICATION_ROOT = "agent/subagents/self-modification";+const LEGACY_SELF_MODIFICATION_ROOT = "agent/subagents/self-modification";const LEGACY_FILES = ["agent.ts", "config.ts", "sandbox.ts", "extensions/selfmod.ts"] as const;const LEGACY_DEFAULTS: Readonly<Record<string, readonly string[]>> = {"agent.ts": [diff --git a/packages/eve/src/self-modification/mode.ts b/packages/eve/src/self-modification/mode.tsindex a1f23de3b..5a5004802 100644--- a/packages/eve/src/self-modification/mode.ts+++ b/packages/eve/src/self-modification/mode.ts@@ -1,6 +1,6 @@import type { ResolvedSelfModificationConfig } from "./config.js";-export type SelfModificationMode = "local" | "disabled" | "deployed";+type SelfModificationMode = "local" | "disabled" | "deployed";/** Resolves the mutually exclusive local or deployed editing mode. */export function resolveSelfModificationMode(diff --git a/packages/eve/src/self-modification/proposal.ts b/packages/eve/src/self-modification/proposal.tsindex 7806fab40..a838ff52a 100644--- a/packages/eve/src/self-modification/proposal.ts+++ b/packages/eve/src/self-modification/proposal.ts@@ -8,8 +8,8 @@ import type { PreparedSelfModificationWorkspace } from "./git-workspace.js";import { gitOutput, runGitCommand } from "./git.js";import { assertFullSha } from "./identifiers.js";-export const MAX_PROPOSAL_CHANGED_BYTES = 1_000_000;-export const MAX_PROPOSAL_CHANGED_FILES = 100;+const MAX_PROPOSAL_CHANGED_BYTES = 1_000_000;+const MAX_PROPOSAL_CHANGED_FILES = 100;export interface ProposalChange {readonly bytes: number;diff --git a/packages/eve/src/self-modification/sandbox.scenario.test.ts b/packages/eve/src/self-modification/sandbox.scenario.test.tsindex 4ce4735e9..0aabb0b22 100644--- a/packages/eve/src/self-modification/sandbox.scenario.test.ts+++ b/packages/eve/src/self-modification/sandbox.scenario.test.ts@@ -7,7 +7,7 @@ import { afterEach, describe, expect, it } from "vitest";import { installLocalDevCapabilityEnvironment } from "#runtime/local-dev-capability.js";-import { createLocalSelfModificationFilesystem } from "./filesystem.js";+import { createSelfModificationFilesystem } from "./filesystem.js";const temporaryDirectories: string[] = [];@@ -52,7 +52,7 @@ describe("self-modification filesystem", () => {it("mounts authored source read-write and traces, logs, and eve docs read-only", async () => {const appRoot = await createAppRoot();await withLocalDevCapability(appRoot, async () => {- const filesystem = await createLocalSelfModificationFilesystem({+ const filesystem = await createSelfModificationFilesystem({appRoot,defaultFilesystem: new justBash.InMemoryFs(),justBash,@@ -83,7 +83,7 @@ describe("self-modification filesystem", () => {const runtimeRoot = await createAppRoot();await withLocalDevCapability(authoredRoot, async () => {- const filesystem = await createLocalSelfModificationFilesystem({+ const filesystem = await createSelfModificationFilesystem({appRoot: runtimeRoot,defaultFilesystem: new justBash.InMemoryFs(),justBash,@@ -101,7 +101,7 @@ describe("self-modification filesystem", () => {it("mounts empty trace and log directories when nothing has been captured", async () => {const appRoot = await createAppRoot({ traces: false, logs: false });await withLocalDevCapability(appRoot, async () => {- const filesystem = await createLocalSelfModificationFilesystem({+ const filesystem = await createSelfModificationFilesystem({appRoot,defaultFilesystem: new justBash.InMemoryFs(),justBash,@@ -116,7 +116,7 @@ describe("self-modification filesystem", () => {const appRoot = await createAppRoot();await expect(- createLocalSelfModificationFilesystem({+ createSelfModificationFilesystem({appRoot,defaultFilesystem: new justBash.InMemoryFs(),justBash,diff --git a/packages/eve/src/services/dev-client/agent-info-probe.ts b/packages/eve/src/services/dev-client/agent-info-probe.tsindex f14b66a99..29d0ee6df 100644--- a/packages/eve/src/services/dev-client/agent-info-probe.ts+++ b/packages/eve/src/services/dev-client/agent-info-probe.ts@@ -7,7 +7,7 @@ import {const RETRY_DELAY_MS = 100;-export type AgentInfoProbeResult =+type AgentInfoProbeResult =| { readonly kind: "ready"; readonly info: AgentInfoResult }| { readonly kind: "unavailable"; readonly error: unknown };diff --git a/packages/eve/src/services/dev-client/request-headers.ts b/packages/eve/src/services/dev-client/request-headers.tsindex c94e9867c..deac102b4 100644--- a/packages/eve/src/services/dev-client/request-headers.ts+++ b/packages/eve/src/services/dev-client/request-headers.ts@@ -14,7 +14,7 @@ const LocalDevelopmentUserOidcClaimsSchema = VercelOidcClaimsSchema.extend({});/** Vercel owner and project expected to have minted an OIDC token. */-export interface DevelopmentOidcTarget {+interface DevelopmentOidcTarget {readonly ownerId: string;readonly projectId: string;/** Ignore an ambient token and ask Vercel for this exact project. */diff --git a/packages/eve/src/setup/ai-gateway-api-key.ts b/packages/eve/src/setup/ai-gateway-api-key.tsindex bd6ec08ed..e186b8726 100644--- a/packages/eve/src/setup/ai-gateway-api-key.ts+++ b/packages/eve/src/setup/ai-gateway-api-key.ts@@ -6,7 +6,7 @@ export const AI_GATEWAY_API_KEY_ENV_VAR = "AI_GATEWAY_API_KEY";export const AI_GATEWAY_API_KEY_ENV_FILE = ".env.local";/** The location written by eve when a user supplies an AI Gateway API key. */-export interface AiGatewayApiKeyLocation {+interface AiGatewayApiKeyLocation {envKey: typeof AI_GATEWAY_API_KEY_ENV_VAR;envFile: typeof AI_GATEWAY_API_KEY_ENV_FILE;envPath: string;diff --git a/packages/eve/src/setup/append-env.ts b/packages/eve/src/setup/append-env.tsindex 5c4966164..74b6bd125 100644--- a/packages/eve/src/setup/append-env.ts+++ b/packages/eve/src/setup/append-env.ts@@ -1,11 +1,11 @@import { readFile, writeFile } from "node:fs/promises";-export interface AppendEnvOptions {+interface AppendEnvOptions {/** Replace existing keys. Default: false (existing keys are preserved). */force?: boolean;}-export interface AppendEnvResult {+interface AppendEnvResult {/** Keys that were inserted or replaced. */written: string[];/** Keys that already existed and were preserved (only when `force` is false). */diff --git a/packages/eve/src/setup/ask.ts b/packages/eve/src/setup/ask.tsindex 79f67f87f..155d4f1e1 100644--- a/packages/eve/src/setup/ask.ts+++ b/packages/eve/src/setup/ask.ts@@ -216,7 +216,7 @@ export interface Asker {}/** A ladder rung: wraps an asker and resolves (or rewrites) some questions. */-export type AskerDecorator = (inner: Asker) => Asker;+type AskerDecorator = (inner: Asker) => Asker;// Channel-level outcomes are signals, not return values: they must cross every// box unchanged so the driver (CLI, agent loop) can react with full context.@@ -236,7 +236,7 @@ export interface Resolution {}/** Every resolution is announced with its source: nothing is silently assumed. */-export interface AskerEvents {+interface AskerEvents {onResolved?: (resolution: Resolution) => void;}@@ -598,7 +598,7 @@ export function withRequired(keys: readonly string[]): AskerDecorator {}/** The two detected/recommended rungs of the ladder. */-export type AnswerPolicy = "confirm-detected" | "assume";+type AnswerPolicy = "confirm-detected" | "assume";/*** The detected/recommended rungs. "confirm-detected" turns a detected valuediff --git a/packages/eve/src/setup/boxes/apply-ai-gateway-credential.ts b/packages/eve/src/setup/boxes/apply-ai-gateway-credential.tsindex f7901f25a..dce54d8e5 100644--- a/packages/eve/src/setup/boxes/apply-ai-gateway-credential.ts+++ b/packages/eve/src/setup/boxes/apply-ai-gateway-credential.ts@@ -25,7 +25,7 @@ export interface ApplyAiGatewayCredentialDeps {detectAiGatewayResolution: typeof detectAiGatewayResolution;}-export interface ApplyAiGatewayCredentialOptions {+interface ApplyAiGatewayCredentialOptions {/** Reports credential progress and warnings. The box never prompts through it. */prompter: Prompter;deps?: ApplyAiGatewayCredentialDeps;diff --git a/packages/eve/src/setup/boxes/deploy-project.ts b/packages/eve/src/setup/boxes/deploy-project.tsindex 4426c09c3..d59236fd3 100644--- a/packages/eve/src/setup/boxes/deploy-project.ts+++ b/packages/eve/src/setup/boxes/deploy-project.ts@@ -32,7 +32,7 @@ export interface DeployProjectDeps {syncHostFrameworkPreset: typeof syncHostFrameworkPreset;}-export interface DeployProjectOptions {+interface DeployProjectOptions {/** Deploy progress and command output stream through this log (rail styling preserved). */prompter: { log: ChannelSetupLog };/** Skip the post-channel Vercel deployment entirely (`--no-deploy`). */@@ -58,12 +58,12 @@ export interface DeployProjectOptions {* commands inside `perform`; it is fixed at composition time (the box prompts* for nothing) and passed straight through {@link DeployProjectOptions.headless}.*/-export interface DeployProjectInput {+interface DeployProjectInput {headless: boolean;}/** The deploy facts `apply` records: the (re)deployed project and the cleared flags. */-export interface DeployProjectPayload {+interface DeployProjectPayload {project: ProjectResolution;deploymentPending: boolean;deploymentDependenciesInstalled: boolean;diff --git a/packages/eve/src/setup/boxes/link-project.ts b/packages/eve/src/setup/boxes/link-project.tsindex bfbdbf0fc..64040d53b 100644--- a/packages/eve/src/setup/boxes/link-project.ts+++ b/packages/eve/src/setup/boxes/link-project.ts@@ -21,7 +21,7 @@ export interface LinkProjectDeps {unresolvedProject: typeof unresolvedProject;}-export interface LinkProjectOptions {+interface LinkProjectOptions {/** Streams link progress and, in interactive runs, may confirm ambiguous framework detection. */prompter: Prompter;/** Headless runs must not ask follow-up questions after the plan is fixed. */diff --git a/packages/eve/src/setup/boxes/resolve-provisioning.ts b/packages/eve/src/setup/boxes/resolve-provisioning.tsindex ca7a44711..4d21fcb8d 100644--- a/packages/eve/src/setup/boxes/resolve-provisioning.ts+++ b/packages/eve/src/setup/boxes/resolve-provisioning.ts@@ -82,7 +82,7 @@ export interface ResolveProvisioningOptions {}/** Both provisioning plans plus the model wiring they imply. Input and payload. */-export interface ResolvedProvisioning {+interface ResolvedProvisioning {vercelProject: ResolvedVercelProject;aiGateway: ResolvedAiGateway;modelWiring: WiringMode;diff --git a/packages/eve/src/setup/boxes/select-model.test.ts b/packages/eve/src/setup/boxes/select-model.test.tsindex 9167c1e70..c82e0e56b 100644--- a/packages/eve/src/setup/boxes/select-model.test.ts+++ b/packages/eve/src/setup/boxes/select-model.test.ts@@ -1,11 +1,11 @@import { afterEach, describe, expect, it, vi } from "vitest";import { DEFAULT_AGENT_MODEL_ID } from "#shared/default-agent-model.js";+import { parseGatewayModelCatalog } from "#shared/gateway-model-catalog.js";import {fetchGatewayCatalog,modelOptionsFromCatalog,- parseGatewayCatalog,type GatewayCatalogModel,} from "./select-model.js";@@ -136,9 +136,9 @@ describe("modelOptionsFromCatalog", () => {});});-describe("parseGatewayCatalog", () => {+describe("parseGatewayModelCatalog", () => {it("skips malformed catalog entries instead of rejecting the whole catalog", () => {- const models = parseGatewayCatalog({+ const models = parseGatewayModelCatalog({data: [CATALOG[0],{ id: "vendor/experimental", shape: "unrecognized" },@@ -152,7 +152,7 @@ describe("parseGatewayCatalog", () => {it("keeps a model when only its optional catalog metadata is malformed", () => {expect(- parseGatewayCatalog({+ parseGatewayModelCatalog({data: [{id: "vendor/experimental",@@ -175,6 +175,6 @@ describe("parseGatewayCatalog", () => {});it("rejects a catalog payload without a data array", () => {- expect(() => parseGatewayCatalog({ models: [] })).toThrow("invalid model catalog");+ expect(() => parseGatewayModelCatalog({ models: [] })).toThrow("invalid model catalog");});});diff --git a/packages/eve/src/setup/boxes/select-model.ts b/packages/eve/src/setup/boxes/select-model.tsindex b1c3c9a50..9763fcc9a 100644--- a/packages/eve/src/setup/boxes/select-model.ts+++ b/packages/eve/src/setup/boxes/select-model.ts@@ -70,8 +70,6 @@ export async function fetchGatewayCatalog(signal?: AbortSignal): Promise<Gateway}}-export { parseGatewayModelCatalog as parseGatewayCatalog } from "#shared/gateway-model-catalog.js";-/** Position in the curated shortlist, or its length for everything else. */function featuredPriority(id: string): number {const index = FEATURED_MODEL_IDS.indexOf(id);diff --git a/packages/eve/src/setup/channel-add-conflicts.ts b/packages/eve/src/setup/channel-add-conflicts.tsdeleted file mode 100644index 65ac1086d..000000000--- a/packages/eve/src/setup/channel-add-conflicts.ts+++ /dev/null@@ -1,125 +0,0 @@-import { join } from "node:path";--import { isNextJsProject, type ChannelKind } from "#setup/scaffold/index.js";-import type { DisabledChannelReasons } from "#setup/cli/index.js";--import { compileChannelDefinition } from "#compiler/normalize-channel.js";-import { createCompiledBindingNamespaceLoader } from "#compiler/load-binding-namespace.js";-import type { AgentModuleBinding } from "#compiler/source-graph.js";-import { discoverAgent } from "#discover/discover-agent.js";-import { EVE_SESSION_ROUTE_PATH } from "#protocol/routes.js";--const SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH = "channels/eve.ts";-const SCAFFOLDED_SLACK_CHANNEL_LOGICAL_PATH = "channels/slack.ts";--/**- * Existing authored registrations that affect the scaffolded channel picker- * or would conflict with a generated channel module.- */-export interface ExistingChannelRegistrations {- readonly disabledChannelReasons: DisabledChannelReasons;- readonly webRouteOwners: readonly string[];- readonly slackOwners: readonly string[];- /**- * Whether the Next.js Web Chat app is already in place (the project depends- * on `next`). Owning the session route alone (`webRouteOwners`) does not- * imply the app: every scaffolded agent has `agent/channels/eve.ts` for the- * dev REPL, while the app only arrives via `--web` or the web scaffold.- */- readonly webAppPresent: boolean;-}--/**- * Inspects compiled authored channels so custom filenames still disable the- * scaffold option for the channel behavior they register.- */-export async function inspectExistingChannelRegistrations(- projectRoot: string,-): Promise<ExistingChannelRegistrations> {- const agentRoot = join(projectRoot, "agent");- const [{ manifest }, webAppPresent] = await Promise.all([- discoverAgent({ agentRoot, appRoot: projectRoot }),- isNextJsProject(projectRoot),- ]);- const webRouteOwners = new Set<string>();- const slackOwners = new Set<string>();-- for (const source of manifest.channels) {- const binding: AgentModuleBinding = {- backing: {- externalDependencies: [],- kind: "filesystem",- sourcePath: join(agentRoot, source.logicalPath),- },- logicalPath: source.logicalPath,- owner: { kind: "application" },- };- const compiled = await compileChannelDefinition(agentRoot, source, {- binding,- loadNamespace: createCompiledBindingNamespaceLoader({- bindings: { [source.sourceId]: binding },- registries: [],- }),- });- if (compiled.kind !== "channel") continue;- for (const definition of compiled.definitions) {- if (definition.kind !== "channel") {- continue;- }- if (definition.method === "POST" && definition.urlPath === EVE_SESSION_ROUTE_PATH) {- webRouteOwners.add(source.logicalPath);- }- if (definition.adapterKind === "slack") {- slackOwners.add(source.logicalPath);- }- }- }-- const disabledChannelReasons: Partial<Record<ChannelKind, string>> = {};- if (- [...webRouteOwners].some((logicalPath) => logicalPath !== SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH)- ) {- disabledChannelReasons.web = `POST ${EVE_SESSION_ROUTE_PATH} already registered`;- }- if (slackOwners.size > 0) {- disabledChannelReasons.slack = "Slack channel already registered";- }-- return {- disabledChannelReasons,- webRouteOwners: [...webRouteOwners],- slackOwners: [...slackOwners],- webAppPresent,- };-}--/**- * Rejects scaffolding when another authored module already owns behavior- * emitted by the generated channel module.- */-export function assertCanAddSelectedChannels(- selectedChannels: readonly ChannelKind[],- registrations: ExistingChannelRegistrations,-): void {- if (selectedChannels.includes("web")) {- const conflictingOwner = registrations.webRouteOwners.find(- (logicalPath) => logicalPath !== SCAFFOLDED_WEB_CHANNEL_LOGICAL_PATH,- );- if (conflictingOwner !== undefined) {- throw new Error(- `Cannot scaffold Web Chat because agent/${conflictingOwner} already defines POST ${EVE_SESSION_ROUTE_PATH}. Web Chat scaffolds the same eve session routes.`,- );- }- }-- if (selectedChannels.includes("slack")) {- const conflictingOwner = registrations.slackOwners.find(- (logicalPath) => logicalPath !== SCAFFOLDED_SLACK_CHANNEL_LOGICAL_PATH,- );- if (conflictingOwner !== undefined) {- throw new Error(- `Cannot scaffold Slack because agent/${conflictingOwner} already defines a Slack channel. Slack scaffolding would register the channel again.`,- );- }- }-}diff --git a/packages/eve/src/setup/cli/option-row.ts b/packages/eve/src/setup/cli/option-row.tsindex ef825b83f..c8524ae62 100644--- a/packages/eve/src/setup/cli/option-row.ts+++ b/packages/eve/src/setup/cli/option-row.ts@@ -22,7 +22,7 @@ export interface RowColors {}/** The glyphs the row painter draws; the TUI passes theme-derived values, the CLI the unicode set. */-export interface RowGlyphs {+interface RowGlyphs {/** Hollow cursor marker for an inert row. */pointer: string;/** Filled cursor marker for an actionable row. */diff --git a/packages/eve/src/setup/cli/prompt-ui.ts b/packages/eve/src/setup/cli/prompt-ui.tsindex ff91e49ff..d3a387fde 100644--- a/packages/eve/src/setup/cli/prompt-ui.ts+++ b/packages/eve/src/setup/cli/prompt-ui.ts@@ -371,7 +371,7 @@ function descriptionLine<T extends PromptValue>(* it does. Callers put a blank rail line above it to set it apart from the* options.*/-export function renderSubmitRow(+function renderSubmitRow(isCursor: boolean,colors: PromptColors,label: string = "Submit",diff --git a/packages/eve/src/setup/cli/rail-log.ts b/packages/eve/src/setup/cli/rail-log.tsindex 993704922..b16b4c479 100644--- a/packages/eve/src/setup/cli/rail-log.ts+++ b/packages/eve/src/setup/cli/rail-log.ts@@ -69,7 +69,7 @@ function dotCount(glyph: string): number {/** Densest frame, shown as a static marker when the output cannot animate. */const SPINNER_STATIC = SPINNER_FRAMES.reduce((a, b) => (dotCount(b) > dotCount(a) ? b : a));/** Delay between spinner frames. ~8 fps reads as a calm pulse. */-export const SPINNER_FRAME_MS = 120;+const SPINNER_FRAME_MS = 120;/** A rail log whose current command detail can be cleared before the next prompt is drawn. */export interface RailLog extends ChannelSetupLog {diff --git a/packages/eve/src/setup/connect-provisioning.ts b/packages/eve/src/setup/connect-provisioning.tsindex 43ae28288..beb5c5dcb 100644--- a/packages/eve/src/setup/connect-provisioning.ts+++ b/packages/eve/src/setup/connect-provisioning.ts@@ -11,7 +11,7 @@ export type ConnectTriggerAttachmentResult =| { state: "attach-failed" };/** Inputs required to replace a Vercel Connect connector's trigger destination. */-export interface ReplaceConnectTriggerOptions {+interface ReplaceConnectTriggerOptions {connectorUid: string;projectRoot: string;triggerPath: string;diff --git a/packages/eve/src/setup/connection-connector.ts b/packages/eve/src/setup/connection-connector.tsindex 32c57b12e..8db1f7e1a 100644--- a/packages/eve/src/setup/connection-connector.ts+++ b/packages/eve/src/setup/connection-connector.ts@@ -22,7 +22,7 @@ export interface SetupConnectionConnectorOptions {}/** Connector identity returned by the Vercel CLI. */-export interface ConnectConnectorRef {+interface ConnectConnectorRef {uid: string;id: string;name?: string;diff --git a/packages/eve/src/setup/flows/link.ts b/packages/eve/src/setup/flows/link.tsindex c8598cde9..8cb785e35 100644--- a/packages/eve/src/setup/flows/link.ts+++ b/packages/eve/src/setup/flows/link.ts@@ -36,7 +36,7 @@ export interface LinkFlowDeps {applyAiGatewayCredential?: ApplyAiGatewayCredentialDeps;}-export type LinkFlowResult =+type LinkFlowResult =| {kind: "done";/**diff --git a/packages/eve/src/setup/flows/model-login.ts b/packages/eve/src/setup/flows/model-login.tsindex abc2741c5..3b8501d6e 100644--- a/packages/eve/src/setup/flows/model-login.ts+++ b/packages/eve/src/setup/flows/model-login.ts@@ -91,7 +91,7 @@ type LoginInput = {withConnectionUpdate?(task: () => Promise<void>): Promise<void>;};-export type ModelLoginResult =+type ModelLoginResult =| { kind: "ready"; reload: boolean; model?: ConnectedModel }| { kind: "cancelled" };diff --git a/packages/eve/src/setup/flows/registry-session.ts b/packages/eve/src/setup/flows/registry-session.tsindex 3541e82bf..681233a04 100644--- a/packages/eve/src/setup/flows/registry-session.ts+++ b/packages/eve/src/setup/flows/registry-session.ts@@ -4,7 +4,7 @@ import type { RegistrySetupCompletion, RegistrySetupFact } from "#setup/registryimport { runDeployFlow } from "./deploy.js";-export interface RegistrySessionDeps {+interface RegistrySessionDeps {detectDeployment: typeof detectDeployment;runDeployFlow: typeof runDeployFlow;}@@ -31,7 +31,7 @@ export interface RegistrySessionResult {deployed?: "production";}-export interface RegistrySession {+interface RegistrySession {add(title: string, output: readonly string[], setup?: RegistrySetupCompletion): void;addIncomplete(title: string, resumeCommand: string): void;addFailure(title: string, message: string): void;diff --git a/packages/eve/src/setup/integrations/discord/api.ts b/packages/eve/src/setup/integrations/discord/api.tsindex 6cf481aa1..344fad7db 100644--- a/packages/eve/src/setup/integrations/discord/api.ts+++ b/packages/eve/src/setup/integrations/discord/api.ts@@ -9,7 +9,7 @@ const DiscordApplicationSchema = z.object({});/** Non-secret Discord application metadata resolved from a bot token. */-export interface DiscordApplication {+interface DiscordApplication {id: string;name: string;publicKey: string;diff --git a/packages/eve/src/setup/integrations/discord/connect.ts b/packages/eve/src/setup/integrations/discord/connect.tsindex d09d13c1c..57886fe81 100644--- a/packages/eve/src/setup/integrations/discord/connect.ts+++ b/packages/eve/src/setup/integrations/discord/connect.ts@@ -4,14 +4,14 @@ import type { VercelProjectReference } from "#setup/project-resolution.js";import { runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";import { z } from "#compiled/zod/index.js";-export const DISCORD_TRIGGER_PATH = "/eve/v1/discord";+const DISCORD_TRIGGER_PATH = "/eve/v1/discord";-export interface DiscordConnectorRef {+interface DiscordConnectorRef {id: string;uid: string;}-export interface ProvisionDiscordConnectorDeps {+interface ProvisionDiscordConnectorDeps {runVercel: typeof runVercel;runVercelCaptureStdout: typeof runVercelCaptureStdout;}diff --git a/packages/eve/src/setup/integrations/discord/setup.ts b/packages/eve/src/setup/integrations/discord/setup.tsindex e3b8ee544..009b1fdba 100644--- a/packages/eve/src/setup/integrations/discord/setup.ts+++ b/packages/eve/src/setup/integrations/discord/setup.ts@@ -54,7 +54,7 @@ export default discordChannel({`;}-export interface DiscordSetupPlan {+interface DiscordSetupPlan {botToken: string;commandName: string;commandDescription: string;diff --git a/packages/eve/src/setup/integrations/file-memory/vercel.ts b/packages/eve/src/setup/integrations/file-memory/vercel.tsindex 55b4377f1..72750440a 100644--- a/packages/eve/src/setup/integrations/file-memory/vercel.ts+++ b/packages/eve/src/setup/integrations/file-memory/vercel.ts@@ -89,7 +89,7 @@ export interface FileMemoryBlobPlan {readonly regionWarning?: string;}-export interface FileMemoryBlobResult {+interface FileMemoryBlobResult {readonly action: FileMemoryBlobAction;readonly store: BlobStore;}diff --git a/packages/eve/src/setup/integrations/github/connect.ts b/packages/eve/src/setup/integrations/github/connect.tsindex 95b6edc91..eb8151bd6 100644--- a/packages/eve/src/setup/integrations/github/connect.ts+++ b/packages/eve/src/setup/integrations/github/connect.ts@@ -4,10 +4,10 @@ import type { VercelProjectReference } from "#setup/project-resolution.js";import { runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";import { z } from "#compiled/zod/index.js";-export const GITHUB_TRIGGER_PATH = "/eve/v1/github";+const GITHUB_TRIGGER_PATH = "/eve/v1/github";/** Identity of the GitHub connector provisioned for an agent channel. */-export interface GitHubConnectorRef {+interface GitHubConnectorRef {/** GitHub's actual @mention handle, without the `[bot]` suffix. */appSlug: string;id: string;@@ -15,7 +15,7 @@ export interface GitHubConnectorRef {}/** Effects used to provision a GitHub Connect connector. */-export interface ProvisionGitHubConnectorDeps {+interface ProvisionGitHubConnectorDeps {runVercel: typeof runVercel;runVercelCaptureStdout: typeof runVercelCaptureStdout;}diff --git a/packages/eve/src/setup/integrations/github/setup.ts b/packages/eve/src/setup/integrations/github/setup.tsindex cb3ce6cf4..26da8c7b6 100644--- a/packages/eve/src/setup/integrations/github/setup.ts+++ b/packages/eve/src/setup/integrations/github/setup.ts@@ -93,7 +93,7 @@ export default githubChannel({`;}-export interface GitHubSetupPlan {+interface GitHubSetupPlan {events: readonly GitHubWebhookEvent[];project: VercelProjectReference;slug: string;diff --git a/packages/eve/src/setup/integrations/linear/connect.ts b/packages/eve/src/setup/integrations/linear/connect.tsindex 8d732fdbc..778df24c0 100644--- a/packages/eve/src/setup/integrations/linear/connect.ts+++ b/packages/eve/src/setup/integrations/linear/connect.ts@@ -4,7 +4,7 @@ import type { VercelProjectReference } from "#setup/project-resolution.js";import { runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";import { z } from "#compiled/zod/index.js";-export const LINEAR_TRIGGER_PATH = "/eve/v1/linear";+const LINEAR_TRIGGER_PATH = "/eve/v1/linear";const LINEAR_AGENT_SESSION_TRIGGER_EVENT = "AgentSessionEvent";/** Identity of the Linear connector provisioned for an agent channel. */@@ -14,7 +14,7 @@ export interface LinearConnectorRef {}/** Effects used to provision a Linear Connect connector. */-export interface ProvisionLinearConnectorDeps {+interface ProvisionLinearConnectorDeps {runVercel: typeof runVercel;runVercelCaptureStdout: typeof runVercelCaptureStdout;}diff --git a/packages/eve/src/setup/integrations/linear/setup.ts b/packages/eve/src/setup/integrations/linear/setup.tsindex 4d4f93c30..026205c63 100644--- a/packages/eve/src/setup/integrations/linear/setup.ts+++ b/packages/eve/src/setup/integrations/linear/setup.ts@@ -53,7 +53,7 @@ type ConnectorPlan =| { kind: "reuse"; connector: LinearConnectorRef }| { kind: "create"; slug: string };-export interface LinearSetupPlan {+interface LinearSetupPlan {connector: ConnectorPlan;project: VercelProjectReference;}diff --git a/packages/eve/src/setup/integrations/linq/connect.ts b/packages/eve/src/setup/integrations/linq/connect.tsindex 88f5dd8e1..1c69bcfde 100644--- a/packages/eve/src/setup/integrations/linq/connect.ts+++ b/packages/eve/src/setup/integrations/linq/connect.ts@@ -10,16 +10,16 @@ import {} from "#setup/primitives/run-vercel.js";import { z } from "#compiled/zod/index.js";-export const LINQ_TRIGGER_PATH = "/eve/v1/linq";-export const LINQ_TRIGGER_EVENTS = ["message.received", "reaction.added", "reaction.removed"];+const LINQ_TRIGGER_PATH = "/eve/v1/linq";+const LINQ_TRIGGER_EVENTS = ["message.received", "reaction.added", "reaction.removed"];-export interface LinqConnectorRef {+interface LinqConnectorRef {id: string;uid: string;phoneNumber?: string;}-export interface ProvisionLinqConnectorDeps {+interface ProvisionLinqConnectorDeps {runVercel: typeof runVercel;runVercelCaptureStdout: typeof runVercelCaptureStdout;}diff --git a/packages/eve/src/setup/integrations/linq/management.ts b/packages/eve/src/setup/integrations/linq/management.tsindex b3b143bed..d12050413 100644--- a/packages/eve/src/setup/integrations/linq/management.ts+++ b/packages/eve/src/setup/integrations/linq/management.ts@@ -6,7 +6,7 @@ const PhoneNumbersSchema = z.object({phone_numbers: z.array(z.object({ phone_number: z.string().min(1) })),});-export interface LinqManagementDeps {+interface LinqManagementDeps {fetch: typeof fetch;}diff --git a/packages/eve/src/setup/integrations/linq/setup.ts b/packages/eve/src/setup/integrations/linq/setup.tsindex 0f369e516..004b9d6ad 100644--- a/packages/eve/src/setup/integrations/linq/setup.ts+++ b/packages/eve/src/setup/integrations/linq/setup.ts@@ -169,7 +169,7 @@ export async function prepareLinqSetup(return { credentials, apiKey: apiKey.trim(), signingSecret: signingSecret.trim() };}-export async function applyLinqSetup(plan: LinqSetupPlan, context: SetupApplyContext) {+async function applyLinqSetup(plan: LinqSetupPlan, context: SetupApplyContext) {const path = join(context.appRoot, "agent/channels/linq.ts");let phoneNumber: string | undefined;if (plan.credentials === "connect") {diff --git a/packages/eve/src/setup/integrations/photon/connect.ts b/packages/eve/src/setup/integrations/photon/connect.tsindex 5400c3a7f..71ddeab43 100644--- a/packages/eve/src/setup/integrations/photon/connect.ts+++ b/packages/eve/src/setup/integrations/photon/connect.ts@@ -9,18 +9,18 @@ import {} from "#setup/primitives/run-vercel.js";import { z } from "#compiled/zod/index.js";-export const PHOTON_CONNECT_SERVICE = "photon";-export const PHOTON_CONNECTOR_TYPE = "photon";-export const PHOTON_TRIGGER_PATH = "/eve/v1/photon";+const PHOTON_CONNECT_SERVICE = "photon";+const PHOTON_CONNECTOR_TYPE = "photon";+const PHOTON_TRIGGER_PATH = "/eve/v1/photon";/** Photon project credentials collected separately from their Connect storage encoding. */-export interface PhotonProjectCredentials {+interface PhotonProjectCredentials {projectId: string;projectSecret: string;}/** Identity of a native Photon connector created through Vercel Connect. */-export interface PhotonConnectorRef {+interface PhotonConnectorRef {id: string;uid: string;/** Direct project URL used until Photon is available as a managed trigger connector. */@@ -28,13 +28,13 @@ export interface PhotonConnectorRef {}/** Effects used to provision a Photon connector. */-export interface ProvisionPhotonConnectorDeps {+interface ProvisionPhotonConnectorDeps {runVercel: typeof runVercel;runVercelCaptureStdout: typeof runVercelCaptureStdout;}/** Input for provisioning one Photon connector and its eve webhook destination. */-export interface ProvisionPhotonConnectorOptions {+interface ProvisionPhotonConnectorOptions {credentials: PhotonProjectCredentials;log: ChannelSetupLog;project: VercelProjectReference;diff --git a/packages/eve/src/setup/integrations/photon/management.ts b/packages/eve/src/setup/integrations/photon/management.tsindex fed661e5c..e8e649a31 100644--- a/packages/eve/src/setup/integrations/photon/management.ts+++ b/packages/eve/src/setup/integrations/photon/management.ts@@ -62,12 +62,12 @@ export interface PhotonManagedProject {cleanup(): Promise<void>;}-export interface PhotonDeviceAuthorization {+interface PhotonDeviceAuthorization {userCode: string;verificationUrl: string;}-export interface ProvisionPhotonProjectOptions {+interface ProvisionPhotonProjectOptions {projectName: string;phoneNumber: string;onAuthorization(authorization: PhotonDeviceAuthorization): void;@@ -75,7 +75,7 @@ export interface ProvisionPhotonProjectOptions {deps?: PhotonManagementDeps;}-export interface UsePhotonProjectOptions {+interface UsePhotonProjectOptions {projectId: string;projectSecret: string;dedicatedLine?: string;@@ -83,7 +83,7 @@ export interface UsePhotonProjectOptions {deps?: PhotonManagementDeps;}-export interface PhotonManagementDeps {+interface PhotonManagementDeps {fetch: typeof fetch;delay(ms: number, signal?: AbortSignal): Promise<void>;}diff --git a/packages/eve/src/setup/integrations/photon/setup-flow.ts b/packages/eve/src/setup/integrations/photon/setup-flow.tsindex 67933c227..bc8949d6b 100644--- a/packages/eve/src/setup/integrations/photon/setup-flow.ts+++ b/packages/eve/src/setup/integrations/photon/setup-flow.ts@@ -16,7 +16,7 @@ import {type PhotonManagedProject,} from "./management.js";-export interface PhotonSetupPlan {+interface PhotonSetupPlan {agentName: string;credentials: "vercel-connect" | "environment";photonProject: "create" | { projectId: string; projectSecret: string };diff --git a/packages/eve/src/setup/integrations/registry.ts b/packages/eve/src/setup/integrations/registry.tsindex 383e787b1..49ed326c6 100644--- a/packages/eve/src/setup/integrations/registry.ts+++ b/packages/eve/src/setup/integrations/registry.ts@@ -15,7 +15,7 @@ import type { SetupIntegration } from "./types.js";import { WEB_SETUP } from "./web/setup.js";/** Built-in registry setup integrations in canonical picker order. */-export const SETUP_INTEGRATIONS: readonly SetupIntegration[] = [+const SETUP_INTEGRATIONS: readonly SetupIntegration[] = [WEB_SETUP,FILE_MEMORY_SETUP,SLACK_SETUP,diff --git a/packages/eve/src/setup/integrations/runner.ts b/packages/eve/src/setup/integrations/runner.tsindex 99eca0b48..213ef61e8 100644--- a/packages/eve/src/setup/integrations/runner.ts+++ b/packages/eve/src/setup/integrations/runner.ts@@ -17,7 +17,7 @@ import { setupIntegration } from "./registry.js";import type { IntegrationSetupResult, SetupExternalAction } from "./types.js";/** Inputs shared by every registry-owned integration setup flow. */-export interface RunIntegrationSetupOptions {+interface RunIntegrationSetupOptions {/** Selected agent project where authored files are changed. */appRoot: string;/** Project root for shared dependencies, Vercel links, and environment files. */@@ -36,7 +36,7 @@ export interface RunIntegrationSetupOptions {}/** Effects shared by the built-in integration setup runner. */-export type SetupProjectResolver = (integration: string) => Promise<VercelProjectReference>;+type SetupProjectResolver = (integration: string) => Promise<VercelProjectReference>;export interface IntegrationSetupRunnerDeps {detectDeployment: typeof detectDeployment;diff --git a/packages/eve/src/setup/integrations/shared/scaffold.ts b/packages/eve/src/setup/integrations/shared/scaffold.tsindex 3df2f37eb..3878e1f54 100644--- a/packages/eve/src/setup/integrations/shared/scaffold.ts+++ b/packages/eve/src/setup/integrations/shared/scaffold.ts@@ -6,7 +6,7 @@ import {} from "#setup/primitives/pm/run.js";/** Effects used to install dependencies added by an integration scaffold. */-export interface IntegrationScaffoldDeps {+interface IntegrationScaffoldDeps {detectPackageManager: typeof detectPackageManager;runPackageManagerInstall: typeof runPackageManagerInstall;}diff --git a/packages/eve/src/setup/integrations/shared/vercel-project.ts b/packages/eve/src/setup/integrations/shared/vercel-project.tsindex 65843cdbc..9885acaf6 100644--- a/packages/eve/src/setup/integrations/shared/vercel-project.ts+++ b/packages/eve/src/setup/integrations/shared/vercel-project.ts@@ -2,7 +2,7 @@ import { readProjectLink, type VercelProjectReference } from "#setup/project-resimport { SetupPrerequisiteRequired } from "./prerequisite.js";-export interface IntegrationVercelProjectDeps {+interface IntegrationVercelProjectDeps {readProjectLink: typeof readProjectLink;}diff --git a/packages/eve/src/setup/integrations/shopify/setup.ts b/packages/eve/src/setup/integrations/shopify/setup.tsindex 04695e86a..a88a47fa5 100644--- a/packages/eve/src/setup/integrations/shopify/setup.ts+++ b/packages/eve/src/setup/integrations/shopify/setup.ts@@ -18,7 +18,7 @@ export interface ShopifySetupDeps {const defaultDeps: ShopifySetupDeps = { appendEnv, writeTextFile };-export interface ShopifySetupPlan {+interface ShopifySetupPlan {storeDomain: string;}diff --git a/packages/eve/src/setup/integrations/slack/setup.ts b/packages/eve/src/setup/integrations/slack/setup.tsindex 22628731d..7c0c9c080 100644--- a/packages/eve/src/setup/integrations/slack/setup.ts+++ b/packages/eve/src/setup/integrations/slack/setup.ts@@ -10,10 +10,9 @@ import {provisionSlackbot,reconcileSlackUid,type ProvisionSlackbotResult,- type SlackConnectorRef,type SlackConnectorSelection,} from "#setup/slackbot.js";-import { slackMessageDeepLink } from "#setup/slack-connect.js";+import { slackMessageDeepLink, type SlackConnectorRef } from "#setup/slack-connect.js";import { WizardCancelledError } from "#setup/step.js";import { installScaffoldDependencies, reportOverwrittenFiles } from "../shared/scaffold.js";diff --git a/packages/eve/src/setup/integrations/teams/connect.ts b/packages/eve/src/setup/integrations/teams/connect.tsindex 1828bf49c..4e329500e 100644--- a/packages/eve/src/setup/integrations/teams/connect.ts+++ b/packages/eve/src/setup/integrations/teams/connect.ts@@ -3,14 +3,14 @@ import type { VercelProjectReference } from "#setup/project-resolution.js";import { runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";import { z } from "#compiled/zod/index.js";-export const TEAMS_TRIGGER_PATH = "/eve/v1/teams";+const TEAMS_TRIGGER_PATH = "/eve/v1/teams";-export interface TeamsConnectorRef {+interface TeamsConnectorRef {id: string;uid: string;}-export interface ProvisionTeamsConnectorDeps {+interface ProvisionTeamsConnectorDeps {runVercel: typeof runVercel;runVercelCaptureStdout: typeof runVercelCaptureStdout;}diff --git a/packages/eve/src/setup/integrations/teams/setup.ts b/packages/eve/src/setup/integrations/teams/setup.tsindex 9c59ac5bc..f2ace16fe 100644--- a/packages/eve/src/setup/integrations/teams/setup.ts+++ b/packages/eve/src/setup/integrations/teams/setup.ts@@ -36,7 +36,7 @@ export default teamsChannel({`;}-export interface TeamsSetupPlan {+interface TeamsSetupPlan {name: string;project: VercelProjectReference;}diff --git a/packages/eve/src/setup/integrations/web/setup.ts b/packages/eve/src/setup/integrations/web/setup.tsindex e5bbe183a..df7246980 100644--- a/packages/eve/src/setup/integrations/web/setup.ts+++ b/packages/eve/src/setup/integrations/web/setup.ts@@ -59,7 +59,7 @@ const defaultDeps: WebSetupDeps = {writeTextFile,};-export interface WebSetupPlan {+interface WebSetupPlan {hosting: "next" | "vercel";packageManager: PackageManagerKind;}diff --git a/packages/eve/src/setup/primitives/pm/process-result.ts b/packages/eve/src/setup/primitives/pm/process-result.tsindex e66145db0..932b62157 100644--- a/packages/eve/src/setup/primitives/pm/process-result.ts+++ b/packages/eve/src/setup/primitives/pm/process-result.ts@@ -19,7 +19,7 @@ export function resultSucceeded(result: PackageManagerProcessResult): boolean {return result.termination.kind === "exit" && result.termination.code === 0;}-export interface PackageProcessStdoutCollector {+interface PackageProcessStdoutCollector {end(): void;result(termination: PackageManagerProcessTermination): PackageManagerProcessResult;write(chunk: Buffer): void;diff --git a/packages/eve/src/setup/primitives/pm/shared.ts b/packages/eve/src/setup/primitives/pm/shared.tsindex 0346b13a1..625500e1b 100644--- a/packages/eve/src/setup/primitives/pm/shared.ts+++ b/packages/eve/src/setup/primitives/pm/shared.ts@@ -2,7 +2,7 @@ import { extname } from "node:path";import type { PackageManagerInvocation } from "./types.js";-export type StandardExecutablePackageManager = "bun" | "npm" | "yarn";+type StandardExecutablePackageManager = "bun" | "npm" | "yarn";/** Resolves a manager executable, preserving test and package-runner interposition. */export function resolveStandardInvocation(diff --git a/packages/eve/src/setup/primitives/process-output.ts b/packages/eve/src/setup/primitives/process-output.tsindex cae35f1fe..1a2bf9240 100644--- a/packages/eve/src/setup/primitives/process-output.ts+++ b/packages/eve/src/setup/primitives/process-output.ts@@ -11,7 +11,7 @@ export interface ProcessOutputLine {export type ProcessOutputHandler = (line: ProcessOutputLine) => void;/** Accumulates partial chunks until they can be emitted as prompt-safe lines. */-export interface ProcessOutputBuffer {+interface ProcessOutputBuffer {write(stream: ProcessOutputStream, chunk: Buffer): void;flush(): void;}diff --git a/packages/eve/src/setup/primitives/run-pnpm.test.ts b/packages/eve/src/setup/primitives/run-pnpm.test.tsindex cb3a8b8a2..8531b50e5 100644--- a/packages/eve/src/setup/primitives/run-pnpm.test.ts+++ b/packages/eve/src/setup/primitives/run-pnpm.test.ts@@ -3,12 +3,7 @@ import { existsSync } from "node:fs";import { PassThrough } from "node:stream";import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";-import {- eveDevArguments,- runPackageManagerInstall,- runPnpmInstall,- spawnPnpm,-} from "./run-pnpm.js";+import { eveDevArguments, runPackageManagerInstall, runPnpmInstall, spawnPnpm } from "./pm/run.js";import { packageManagerInstallSucceeded } from "./pm/run.js";import { resultSucceeded } from "./pm/process-result.js";import { pnpmPackageManager } from "./pm/pnpm.js";diff --git a/packages/eve/src/setup/primitives/run-pnpm.ts b/packages/eve/src/setup/primitives/run-pnpm.tsdeleted file mode 100644index dd536cef0..000000000--- a/packages/eve/src/setup/primitives/run-pnpm.ts+++ /dev/null@@ -1,9 +0,0 @@-export {- eveDevArguments,- runPackageManagerInstall,- runPnpmInstall,- spawnPackageManager,- spawnPnpm,- type RunInstallOptions,- type RunPackageManagerOptions as RunPnpmOptions,-} from "./pm/run.js";diff --git a/packages/eve/src/setup/quit-guard.ts b/packages/eve/src/setup/quit-guard.tsindex bb0bb20eb..fcec5c089 100644--- a/packages/eve/src/setup/quit-guard.ts+++ b/packages/eve/src/setup/quit-guard.ts@@ -20,14 +20,14 @@ export const initialQuitGuardState: QuitGuardState = { armed: false };* Key intents the guard distinguishes. Escape arms or quits; every other key is* collapsed to `other-key`, which only matters while armed (it disarms).*/-export type QuitGuardEvent = { type: "escape" } | { type: "other-key" };+type QuitGuardEvent = { type: "escape" } | { type: "other-key" };/*** Side effect the prompt wiring should perform after the transition. Only `quit`* requires the caller to act (cancel the prompt); `arm`/`disarm`/`none` are* reflected purely by re-rendering with the returned {@link QuitGuardState}.*/-export type QuitGuardAction = "none" | "arm" | "quit" | "disarm";+type QuitGuardAction = "none" | "arm" | "quit" | "disarm";/*** Advances the guard for a single keypress.diff --git a/packages/eve/src/setup/scaffold/create/add-to-project.ts b/packages/eve/src/setup/scaffold/create/add-to-project.tsindex 531a2976d..72df0aaf9 100644--- a/packages/eve/src/setup/scaffold/create/add-to-project.ts+++ b/packages/eve/src/setup/scaffold/create/add-to-project.ts@@ -37,7 +37,7 @@ export interface AddAgentToProjectOptions {zodPackageVersion?: string;}-export interface AddAgentToProjectResult {+interface AddAgentToProjectResult {filesWritten: string[];configurationFilesChanged: string[];/** Dependencies added to package.json; ones the project already declares anywhere are left untouched. */diff --git a/packages/eve/src/setup/scaffold/files.ts b/packages/eve/src/setup/scaffold/files.tsindex 0f691d436..d2d63fedc 100644--- a/packages/eve/src/setup/scaffold/files.ts+++ b/packages/eve/src/setup/scaffold/files.ts@@ -20,7 +20,7 @@ export class WriteFileExistsError extends Error {}}-export interface WriteFileOptions {+interface WriteFileOptions {force?: boolean;}diff --git a/packages/eve/src/setup/scaffold/update/channels.ts b/packages/eve/src/setup/scaffold/update/channels.tsindex ed1cfbfc2..11b2a04e3 100644--- a/packages/eve/src/setup/scaffold/update/channels.ts+++ b/packages/eve/src/setup/scaffold/update/channels.ts@@ -63,8 +63,6 @@ export interface PackageJsonMutation {scripts: string[];}-export type ChannelMutationAction = "created" | "overwritten" | "skipped";-export type ChannelMutationResult = SlackChannelMutationResult | WebChannelMutationResult;interface SlackChannelWrittenResult {diff --git a/packages/eve/src/setup/scaffold/workspace-glob.ts b/packages/eve/src/setup/scaffold/workspace-glob.tsindex f0c402fae..d87cc0e94 100644--- a/packages/eve/src/setup/scaffold/workspace-glob.ts+++ b/packages/eve/src/setup/scaffold/workspace-glob.ts@@ -24,7 +24,7 @@ function workspacePatternToRegex(pattern: string): RegExp {return new RegExp(source, "u");}-export function workspaceRelativePath(workspaceRoot: string, projectRoot: string): string {+function workspaceRelativePath(workspaceRoot: string, projectRoot: string): string {return relative(workspaceRoot, resolve(projectRoot)).split(sep).join("/");}diff --git a/packages/eve/src/setup/scaffold/workspace-root.ts b/packages/eve/src/setup/scaffold/workspace-root.tsindex 475f32f06..8c09bb0f1 100644--- a/packages/eve/src/setup/scaffold/workspace-root.ts+++ b/packages/eve/src/setup/scaffold/workspace-root.ts@@ -27,7 +27,7 @@ export interface WorkspaceRootMutation {path: string;}-export interface WorkspaceRootPackageJsonPatchResult extends PackageJsonPatchResult {+interface WorkspaceRootPackageJsonPatchResult extends PackageJsonPatchResult {/** Root package.json path when an ancestor workspace root was eligible for patching. */path?: string;}diff --git a/packages/eve/src/setup/slack-connect-create.ts b/packages/eve/src/setup/slack-connect-create.tsindex 0d070562a..a2cc28867 100644--- a/packages/eve/src/setup/slack-connect-create.ts+++ b/packages/eve/src/setup/slack-connect-create.ts@@ -21,7 +21,7 @@ export interface SlackConnectorCreateDeps {now?: () => number;}-export type SlackConnectorCreateResult =+type SlackConnectorCreateResult =| { state: "created"; via: "cli"; ref: SlackConnectorRef }| {state: "created";diff --git a/packages/eve/src/setup/slack-connect-lifecycle.ts b/packages/eve/src/setup/slack-connect-lifecycle.tsindex a37589607..2bcfd5503 100644--- a/packages/eve/src/setup/slack-connect-lifecycle.ts+++ b/packages/eve/src/setup/slack-connect-lifecycle.ts@@ -24,7 +24,7 @@ export interface SlackConnectLifecycleDeps {runVercel: typeof runVercel;}-export type SlackConnectorInventory =+type SlackConnectorInventory =| { state: "ok"; body: unknown; connectors: readonly RawSlackConnector[] }| { state: "failed"; message: string };@@ -35,7 +35,7 @@ export type SlackConnectorCleanupResult =type CommandOutput = ReturnType<typeof createPromptCommandOutput>;/** Shared dependencies and output routing for one connector cleanup operation. */-export interface SlackConnectorCleanupContext {+interface SlackConnectorCleanupContext {log: ChannelSetupLog;deps: SlackConnectLifecycleDeps;projectRoot: string;@@ -115,7 +115,7 @@ export async function findSlackConnector(* while an old trigger destination may still exist. A `detach-failed` connector* is left in a known-stale state the caller surfaces with manual recovery steps.*/-export type SlackConnectorAttachmentResult = ConnectTriggerAttachmentResult;+type SlackConnectorAttachmentResult = ConnectTriggerAttachmentResult;/*** Replaces the connector's default trigger destination with the eve route:@@ -140,12 +140,12 @@ export async function attachSlackConnector(});}-export type SlackWorkspaceLookup =+type SlackWorkspaceLookup =| { state: "connected"; workspace: SlackWorkspaceConnection }| { state: "pending" }| { state: "failed"; message: string };-export type SlackConnectorDetailsLookup =+type SlackConnectorDetailsLookup =| { state: "found"; details: SlackConnectorDetails }| { state: "failed"; message: string };diff --git a/packages/eve/src/setup/slack-connect.ts b/packages/eve/src/setup/slack-connect.tsindex fa3bca20f..497aeef2c 100644--- a/packages/eve/src/setup/slack-connect.ts+++ b/packages/eve/src/setup/slack-connect.ts@@ -101,45 +101,6 @@ export function parseCreatedSlackConnector(stdout: string): SlackConnectorRef |return parseSlackConnectorDetails(parsed)?.ref;}-/**- * Finds the expected connector, or the newest Slack connector already attached to this project.- */-export function pickSlackConnector(- listJson: unknown,- projectId: string | undefined,- expectedUid: string | undefined,-): SlackConnectorRef | undefined {- if (projectId === undefined) return undefined;- if (typeof listJson !== "object" || listJson === null) return undefined;- const response = listJson as VercelConnectListResponse;- const connectors = response.connectors ?? response.clients;- if (!Array.isArray(connectors)) return undefined;-- let matched: { ref: SlackConnectorRef; createdAt: number } | undefined;- for (const raw of connectors as VercelConnectListClient[]) {- if (raw.type !== "slack") continue;- if (typeof raw.uid !== "string" || typeof raw.id !== "string") continue;- if (!Array.isArray(raw.projects)) continue;- const matchesProject = raw.projects.some(- (project) =>- typeof project === "object" &&- project !== null &&- (project as { id?: unknown }).id === projectId,- );- if (!matchesProject) continue;-- const ref: SlackConnectorRef = { uid: raw.uid, id: raw.id };- if (expectedUid !== undefined && ref.uid === expectedUid) {- return ref;- }- const createdAt = typeof raw.createdAt === "number" ? raw.createdAt : 0;- if (!matched || createdAt > matched.createdAt) {- matched = { ref, createdAt };- }- }- return matched?.ref;-}-/*** Turns a Slack `app_redirect` install URL into a deep link that opens the* Messages tab, a DM compose with the bot, instead of the app's about page.diff --git a/packages/eve/src/setup/slackbot.test.ts b/packages/eve/src/setup/slackbot.test.tsindex 8b7d57ac5..94b9d9d26 100644--- a/packages/eve/src/setup/slackbot.test.ts+++ b/packages/eve/src/setup/slackbot.test.ts@@ -4,14 +4,8 @@ import type { ChannelSetupAwaitChoice, ChannelSetupLog } from "#setup/cli/index.import { captureVercel, runVercel, runVercelCaptureStdout } from "#setup/primitives/run-vercel.js";import { updateSlackChannelConnectorUid } from "#setup/scaffold/update/update-slack-channel.js";-import {- parseCreatedSlackConnector,- parseSlackConnectorDetails,- pickSlackConnector,- provisionSlackbot,- reconcileSlackUid,- type SlackConnectorSelection,-} from "./slackbot.js";+import { parseCreatedSlackConnector, parseSlackConnectorDetails } from "./slack-connect.js";+import { provisionSlackbot, reconcileSlackUid, type SlackConnectorSelection } from "./slackbot.js";vi.mock("#setup/primitives/run-vercel.js", () => ({captureVercel: vi.fn(),@@ -86,161 +80,6 @@ beforeEach(() => {vi.resetAllMocks();});-describe("pickSlackConnector", () => {- const projectId = "prj_demo";-- it("reads the `connectors` key emitted by `vercel connect list -F json` (CLI 54+)", () => {- const json = {- connectors: [- {- uid: "slack/my-agent",- id: "scl_my_agent",- type: "slack",- createdAt: 1,- projects: [{ id: projectId }],- },- ],- };-- expect(pickSlackConnector(json, projectId, undefined)).toEqual({- uid: "slack/my-agent",- id: "scl_my_agent",- });- });-- it("prefers the expected Slack connector UID attached to the project", () => {- const json = {- clients: [- {- uid: "slack/expected",- id: "scl_expected",- type: "slack",- createdAt: 1,- projects: [{ id: projectId }],- },- {- uid: "slack/project-match",- id: "scl_project",- type: "slack",- createdAt: 100,- projects: [{ id: projectId }],- },- ],- };-- expect(pickSlackConnector(json, projectId, "slack/expected")).toEqual({- uid: "slack/expected",- id: "scl_expected",- });- });-- it("does not adopt the expected UID from another project", () => {- const json = {- clients: [- {- uid: "slack/expected",- id: "scl_expected",- type: "slack",- createdAt: 100,- projects: [{ id: "prj_other" }],- },- {- uid: "slack/project-match",- id: "scl_project",- type: "slack",- createdAt: 1,- projects: [{ id: projectId }],- },- ],- };-- expect(pickSlackConnector(json, projectId, "slack/expected")).toEqual({- uid: "slack/project-match",- id: "scl_project",- });- });-- it("does not adopt any connector when the linked project is unknown", () => {- const json = {- connectors: [- {- uid: "slack/expected",- id: "scl_expected",- type: "slack",- projects: [{ id: projectId }],- },- ],- };-- expect(pickSlackConnector(json, undefined, "slack/expected")).toBeUndefined();- });-- it("returns the newest Slack connector attached to the project", () => {- const json = {- clients: [- {- uid: "github/unrelated",- id: "scl_github",- type: "github",- createdAt: 5,- projects: [{ id: projectId }],- },- {- uid: "slack/older",- id: "scl_older",- type: "slack",- createdAt: 10,- projects: [{ id: projectId }],- },- {- uid: "slack/newer",- id: "scl_newer",- type: "slack",- createdAt: 20,- projects: [{ id: projectId }],- },- ],- };-- expect(pickSlackConnector(json, projectId, undefined)).toEqual({- uid: "slack/newer",- id: "scl_newer",- });- });-- it("does not fall back to an unrelated newest Slack connector", () => {- const json = {- clients: [- {- uid: "slack/older",- id: "scl_a",- type: "slack",- createdAt: 1,- projects: [{ id: "prj_other" }],- },- { uid: "slack/newer", id: "scl_b", type: "slack", createdAt: 9, projects: [] },- ],- };-- expect(pickSlackConnector(json, projectId, undefined)).toBeUndefined();- });-- it("requires both uid and id to be strings", () => {- expect(- pickSlackConnector({ clients: [{ type: "slack", uid: "slack/x" }] }, projectId, undefined),- ).toBeUndefined();- expect(- pickSlackConnector({ clients: [{ type: "slack", id: "scl_x" }] }, projectId, undefined),- ).toBeUndefined();- });-- it("returns undefined for malformed input rather than throwing", () => {- expect(pickSlackConnector(null, projectId, undefined)).toBeUndefined();- expect(pickSlackConnector({}, projectId, undefined)).toBeUndefined();- expect(pickSlackConnector({ clients: "nope" }, projectId, undefined)).toBeUndefined();- });-});-describe("parseSlackConnectorDetails", () => {it("derives workspace metadata from the live connector detail payload", () => {expect(diff --git a/packages/eve/src/setup/slackbot.ts b/packages/eve/src/setup/slackbot.tsindex 0bc34db9f..9c9c4de0f 100644--- a/packages/eve/src/setup/slackbot.ts+++ b/packages/eve/src/setup/slackbot.ts@@ -28,17 +28,8 @@ import {type SlackConnectorLookup,} from "./slack-connect-lifecycle.js";-// Re-exported so the Connect parsers remain importable from the provisioning-// entry point (and unit-testable alongside it).-export {- parseCreatedSlackConnector,- parseSlackConnectorDetails,- pickSlackConnector,- type SlackConnectorRef,-} from "./slack-connect.js";-/** Injected for tests; defaults to the real Vercel CLI subprocess primitives. */-export interface SlackbotProvisionDeps extends SlackConnectLifecycleDeps, SlackConnectorCreateDeps {+interface SlackbotProvisionDeps extends SlackConnectLifecycleDeps, SlackConnectorCreateDeps {/** Test seam for the linked Vercel project and team lookup. */readProjectLink?: typeof readProjectLink;/** Test seam for the workspace poll's pacing; defaults to a real sleep. */@@ -337,7 +328,7 @@ export async function inspectSlackbotConnectors(return lookup;}-export interface ProvisionSlackbotOptions {+interface ProvisionSlackbotOptions {/*** Cancels the caller's whole operation. The promise rejects after attempting* cleanup; only the explicit interactive Cancel action returns `cancelled`.diff --git a/packages/eve/src/setup/vercel-project-api.ts b/packages/eve/src/setup/vercel-project-api.tsindex 4ceff5566..efe842ad1 100644--- a/packages/eve/src/setup/vercel-project-api.ts+++ b/packages/eve/src/setup/vercel-project-api.ts@@ -26,7 +26,7 @@ const VercelProjectListEntrySchema = z.object({export type VercelProjectListEntry = z.infer<typeof VercelProjectListEntrySchema>;/** One ranked Vercel project search page and its optional continuation cursor. */-export interface VercelProjectSearchPage {+interface VercelProjectSearchPage {readonly projects: VercelProjectListEntry[];readonly next?: number;}diff --git a/packages/eve/src/setup/vercel-project.ts b/packages/eve/src/setup/vercel-project.tsindex ef413545b..97d36e670 100644--- a/packages/eve/src/setup/vercel-project.ts+++ b/packages/eve/src/setup/vercel-project.ts@@ -39,7 +39,7 @@ const VercelProjectReferenceSchema = z.object({name: z.string().min(1),});-export interface PickProjectOptions extends VercelProjectOperationOptions {+interface PickProjectOptions extends VercelProjectOperationOptions {/** Whether an empty project list may fall back to entering a name to create. */allowCreateWhenEmpty?: boolean;/**@@ -50,7 +50,7 @@ export interface PickProjectOptions extends VercelProjectOperationOptions {suggestedName?: string;}-export interface PickTeamOptions extends VercelProjectOperationOptions {+interface PickTeamOptions extends VercelProjectOperationOptions {/** Builds the team selector heading from the current team's display name. */selectMessage?: (currentTeam: string) => string;}@@ -123,7 +123,7 @@ export async function assertNewProjectNameAvailable(* ever hears "log in", even when the real fault is a missing CLI or a transient* API error and the user is already authenticated.*/-export function requireVercelLogin(failure?: VercelCaptureFailure): never {+function requireVercelLogin(failure?: VercelCaptureFailure): never {const base = "Provisioning a Vercel project requires you to be logged in to Vercel.";const stderr = failure?.stderr.trim();const reason = failure@@ -179,7 +179,7 @@ function isLoggedOutFailure(failure: VercelCaptureFailure): boolean {* anything else is a transient fault surfaced as a plain error, so the caller* reports "try again" rather than mislabeling it "log in".*/-export function requireVercelAuth(failure: VercelCaptureFailure): never {+function requireVercelAuth(failure: VercelCaptureFailure): never {if (failure.errno === "ENOENT") {throw new HumanActionRequiredError({kind: "vercel-cli-missing",diff --git a/packages/eve/src/shared/action-types.ts b/packages/eve/src/shared/action-types.tsindex 27880b4d0..99bb03a35 100644--- a/packages/eve/src/shared/action-types.ts+++ b/packages/eve/src/shared/action-types.ts@@ -1,11 +1,6 @@import { z } from "#compiled/zod/index.js";-import {- agentTurnOutcomeSchema,- agentTurnOutcomeWithCostSchema,-} from "#shared/agent-turn-outcome.js";import { jsonObjectSchema, jsonValueSchema } from "#shared/json-schemas.js";-import { tokenUsageSchema, tokenUsageWithCostSchema } from "#shared/token-usage.js";/*** Eve-owned `tool-call` action requested by the model.@@ -47,7 +42,7 @@ export type RuntimeRemoteAgentCallActionRequest = z.infer<typeof runtimeRemoteAgentCallActionRequestSchema>;-export const runtimeRemoteAgentCallActionRequestSchema = z+const runtimeRemoteAgentCallActionRequestSchema = z.object({callId: z.string(),description: z.string(),@@ -193,17 +188,6 @@ export type RuntimeAgentDispatchRequest =| RuntimeRemoteAgentDispatchRequest| RuntimeSubagentDispatchRequest;-/**- * Zod schema for one runtime action request.- */-export const runtimeActionRequestSchema = z.discriminatedUnion("kind", [- runtimeLoadSkillActionRequestSchema,- runtimeRemoteAgentCallActionRequestSchema,- runtimeSubagentCallActionRequestSchema,- runtimeToolCallActionRequestSchema,- runtimeWorkflowToolCallActionRequestSchema,-]);-/*** Runtime-owned authored tool-result projected back into a harness resume call.*/@@ -263,50 +247,6 @@ export interface RuntimeSubagentChildResult {readonly usage?: import("#shared/token-usage.js").TokenUsage;}-const runtimeSubagentChildResultFields = {- backgroundTask: z- .strictObject({- status: z.literal("working"),- taskId: z.string(),- })- .optional(),- callId: z.string(),- isError: z.boolean().optional(),- kind: z.literal("subagent-result"),- origin: z.literal("child"),- output: jsonValueSchema,- subagentName: z.string(),-};--/** Token-only subagent result schema retained for historical wire formats. */-export const runtimeSubagentChildResultSchema = z- .object({- backgroundTask: z- .strictObject({- status: z.literal("working"),- taskId: z.string(),- })- .optional(),- callId: z.string(),- isError: z.boolean().optional(),- kind: z.literal("subagent-result"),- origin: z.literal("child"),- outcome: agentTurnOutcomeSchema,- output: jsonValueSchema,- subagentName: z.string(),- usage: tokenUsageSchema.optional(),- })- .strict();--/** Current subagent result schema, including optional model token cost. */-export const runtimeSubagentChildResultWithCostSchema: z.ZodType<RuntimeSubagentChildResult> = z- .object({- ...runtimeSubagentChildResultFields,- outcome: agentTurnOutcomeWithCostSchema,- usage: tokenUsageWithCostSchema.optional(),- })- .strict();-/*** Subagent failure synthesized on the parent side when no child produced a* result: dispatch rejections, start failures, and agentId-continuationdiff --git a/packages/eve/src/shared/agent-definition.ts b/packages/eve/src/shared/agent-definition.tsindex 79f48fdfc..393185faf 100644--- a/packages/eve/src/shared/agent-definition.ts+++ b/packages/eve/src/shared/agent-definition.ts@@ -80,10 +80,6 @@ export type AgentModelResolver = (export type PublicAgentDynamicModelDefinition = DynamicSentinel<PublicAgentDynamicModelResult>;-export interface PublicAgentDynamicModelDefinitionInput {- readonly events: DynamicSentinel<PublicAgentDynamicModelResult>["events"];-}-export function isDynamicModelDefinition(value: unknown,): value is PublicAgentDynamicModelDefinition {diff --git a/packages/eve/src/shared/agent-turn-outcome.ts b/packages/eve/src/shared/agent-turn-outcome.tsindex 29043228d..b4c5b2215 100644--- a/packages/eve/src/shared/agent-turn-outcome.ts+++ b/packages/eve/src/shared/agent-turn-outcome.ts@@ -1,11 +1,7 @@import { z } from "#compiled/zod/index.js";import type { JsonValue } from "#shared/json.js";-import {- tokenUsageSchema,- tokenUsageWithCostSchema,- type TokenUsage,-} from "#shared/token-usage.js";+import { tokenUsageWithCostSchema, type TokenUsage } from "#shared/token-usage.js";/*** What one delegated child turn produced, independent of whether the child@@ -69,25 +65,11 @@ const agentTurnResultSchema: z.ZodType<AgentTurnResult> = z.discriminatedUnion("]);/**- * Zod schema for {@link AgentTurnOutcome}.+ * Zod schema for {@link AgentTurnOutcome}, including optional model token cost.** Validates outcomes crossing the process boundary (remote session* callbacks). Local notification paths construct the type directly.*/-export const agentTurnOutcomeSchema: z.ZodType<AgentTurnOutcome> = z.discriminatedUnion("kind", [- z.strictObject({- kind: z.literal("parked"),- result: agentTurnResultSchema,- usageDelta: tokenUsageSchema,- }),- z.strictObject({- kind: z.literal("terminal"),- result: agentTurnResultSchema,- usageDelta: tokenUsageSchema,- }),-]);--/** Current outcome schema, including optional model token cost. */export const agentTurnOutcomeWithCostSchema: z.ZodType<AgentTurnOutcome> = z.discriminatedUnion("kind",[diff --git a/packages/eve/src/shared/chatgpt-model.ts b/packages/eve/src/shared/chatgpt-model.tsindex 2edaef801..fd9624d8b 100644--- a/packages/eve/src/shared/chatgpt-model.ts+++ b/packages/eve/src/shared/chatgpt-model.ts@@ -2,7 +2,6 @@ import type { ModelRouting } from "./agent-definition.js";export const DEFAULT_CHATGPT_MODEL_ID = "gpt-5.6-luna-fast";export const CHATGPT_MODEL_SELECTION_PREFIX = "chatgpt/";-export const DEFAULT_CHATGPT_MODEL_SELECTION = `${CHATGPT_MODEL_SELECTION_PREFIX}${DEFAULT_CHATGPT_MODEL_ID}`;/** Returns the bare OpenAI model id encoded by a setup-facing ChatGPT selection. */export function parseChatGptModelSelection(selection: string): string | undefined {diff --git a/packages/eve/src/shared/conversation-context.ts b/packages/eve/src/shared/conversation-context.tsindex f0bd2dbc1..e8099f23b 100644--- a/packages/eve/src/shared/conversation-context.ts+++ b/packages/eve/src/shared/conversation-context.ts@@ -55,7 +55,7 @@ export const UNKNOWN_CONVERSATION_CONTEXT: ConversationContext = {principalType: "anonymous",};-export interface ConversationContextFallback {+interface ConversationContextFallback {readonly channelKind?: string;readonly environment: ConversationEnvironment;readonly forwardedTracePolicy?: ForwardedTraceAssertion;diff --git a/packages/eve/src/shared/dispatch-action.ts b/packages/eve/src/shared/dispatch-action.tsdeleted file mode 100644index 94d2afe25..000000000--- a/packages/eve/src/shared/dispatch-action.ts+++ /dev/null@@ -1,32 +0,0 @@-import type { JsonObject } from "#shared/json.js";-import type { PreparedDispatchTarget } from "#tools/behavior.js";--/** One model tool call selected for durable execution outside the harness. */-export interface PendingDispatchAction {- readonly callId: string;- readonly description: string;- readonly input: JsonObject;- readonly target: PreparedDispatchTarget;- readonly toolName: string;-}--/** Pending action that delegates work to a prepared agent identity. */-export type PendingAgentDispatchAction = PendingDispatchAction & {- readonly target: Extract<- PreparedDispatchTarget,- { readonly kind: "remote-agent-call" | "self-agent-call" | "subagent-call" }- >;-};--/** Pending action that mutates the durable task lifecycle. */-export type PendingTaskControlAction = PendingDispatchAction & {- readonly target: Extract<PreparedDispatchTarget, { readonly kind: "task-cancel" }>;-};--/** Pending action that runs a tool's execute body as a durable workflow. */-export type PendingWorkflowToolAction = PendingDispatchAction & {- readonly target: Extract<PreparedDispatchTarget, { readonly kind: "workflow-tool-call" }>;-};--/** Fields common to task-control dispatch and its result projection helpers. */-export type TaskControlInvocation = Pick<PendingDispatchAction, "callId" | "input" | "toolName">;diff --git a/packages/eve/src/shared/extension-package-contract.ts b/packages/eve/src/shared/extension-package-contract.tsindex 547c6bc97..9a72482cf 100644--- a/packages/eve/src/shared/extension-package-contract.ts+++ b/packages/eve/src/shared/extension-package-contract.ts@@ -1,5 +1,5 @@/** Authoring and distribution roots declared by an extension package. */-export interface ExtensionPackageRoots {+interface ExtensionPackageRoots {/*** Authoring root. Optional so published packages can ship `dist` only;* `eve extension build` requires it.diff --git a/packages/eve/src/shared/forwarded-trace-policy.ts b/packages/eve/src/shared/forwarded-trace-policy.tsindex 9de5d35c0..a4777539b 100644--- a/packages/eve/src/shared/forwarded-trace-policy.ts+++ b/packages/eve/src/shared/forwarded-trace-policy.ts@@ -25,13 +25,13 @@ export interface ForwardedTraceAssertion {readonly originAudience: ChannelAudience;}-export interface ResolvedForwardedTraceState {+interface ResolvedForwardedTraceState {readonly decision?: InstrumentationDecision;readonly forwardedTracePolicy?: ForwardedTraceAssertion;readonly traceFlags: number;}-export interface ForwardedTraceSeedState {+interface ForwardedTraceSeedState {readonly decision?: unknown;readonly forwardedTracePolicy?: unknown;readonly traceFlags: number;diff --git a/packages/eve/src/shared/gateway-service-tier.ts b/packages/eve/src/shared/gateway-service-tier.tsindex cd5440b7e..f99c74d6e 100644--- a/packages/eve/src/shared/gateway-service-tier.ts+++ b/packages/eve/src/shared/gateway-service-tier.ts@@ -3,7 +3,7 @@* `standard` (no tier authored), the `priority` tier eve's Fast mode writes,* or any other authored `custom` tier value.*/-export type GatewayServiceTierState =+type GatewayServiceTierState =| { kind: "standard" }| { kind: "priority" }| { kind: "custom"; value: string };diff --git a/packages/eve/src/shared/memory-state.test.ts b/packages/eve/src/shared/memory-state.test.tsindex ac779799a..2fe3d21ef 100644--- a/packages/eve/src/shared/memory-state.test.ts+++ b/packages/eve/src/shared/memory-state.test.ts@@ -7,7 +7,7 @@ import {clearMemorySessionState,createMemoryLock,projectMemoryHistory,- readMemoryLocks,+ projectMemoryHistoryFromSessionState,shouldCanonicalizeMemory,validateMemoryRecallResult,} from "#shared/memory-state.js";@@ -135,7 +135,7 @@ describe("memory record state", () => {expect(identical.history).toHaveLength(second.history.length);expect(- projectMemoryHistory({ locks: readMemoryLocks(second.state), messages: second.history }),+ projectMemoryHistoryFromSessionState({ messages: second.history, state: second.state }),).toEqual([{ content: "first note", kind: "memory.load", role: "user" },{ content: "new profile", kind: "memory.load", role: "user" },diff --git a/packages/eve/src/shared/memory-state.ts b/packages/eve/src/shared/memory-state.tsindex 6c53e30ce..43cf330b3 100644--- a/packages/eve/src/shared/memory-state.ts+++ b/packages/eve/src/shared/memory-state.ts@@ -12,13 +12,13 @@ import type {MemoryScopeResolverResult,} from "#public/memory/index.js";-export const MEMORY_NAMESPACE_MAX_BYTES = 1_024;-export const MEMORY_SCOPE_COMPONENT_MAX_BYTES = 1_024;-export const MEMORY_SCOPE_TUPLE_MAX_COMPONENTS = 16;-export const MEMORY_CANONICAL_KEY_INPUT_MAX_BYTES = 4_096;-export const MEMORY_ITEM_ID_MAX_BYTES = 1_024;-export const MEMORY_RAW_RECORD_MAX_COUNT = 512;-export const MEMORY_RAW_RECORD_MAX_BYTES = 262_144;+const MEMORY_NAMESPACE_MAX_BYTES = 1_024;+const MEMORY_SCOPE_COMPONENT_MAX_BYTES = 1_024;+const MEMORY_SCOPE_TUPLE_MAX_COMPONENTS = 16;+const MEMORY_CANONICAL_KEY_INPUT_MAX_BYTES = 4_096;+const MEMORY_ITEM_ID_MAX_BYTES = 1_024;+const MEMORY_RAW_RECORD_MAX_COUNT = 512;+const MEMORY_RAW_RECORD_MAX_BYTES = 262_144;const MEMORY_MESSAGE_METADATA_KEY = "eve.memory";const MEMORY_SESSION_STATE_KEY = "eve.memory";@@ -277,12 +277,6 @@ export function clearMemorySessionState(state: SessionStateMap | undefined): Sesreturn remaining;}-export function readMemoryLocks(- state: SessionStateMap | undefined,-): Readonly<Record<string, InternalMemoryLock>> {- return readMemorySessionState(state).locks;-}-function validateMemoryNamespace(namespace: string): void {if (namespace.trim().length === 0) throw new Error("Memory namespace must be non-empty.");if (utf8Bytes(namespace) > MEMORY_NAMESPACE_MAX_BYTES) {diff --git a/packages/eve/src/shared/sandbox-environment.ts b/packages/eve/src/shared/sandbox-environment.tsindex d568d6c36..cc04dedd4 100644--- a/packages/eve/src/shared/sandbox-environment.ts+++ b/packages/eve/src/shared/sandbox-environment.ts@@ -129,12 +129,6 @@ function stableSerialize(value: unknown, seen = new WeakSet<object>()): string {return typeof value;}-export function getSandboxEnvironmentConfigurationHash(- environment: SandboxEnvironmentIdentity,-): string {- return environment[CONFIGURATION_HASH];-}-export function getSandboxEnvironmentRuntime(environment: SandboxEnvironmentIdentity,): SandboxProviderRuntime {diff --git a/packages/eve/src/shared/skill-package.ts b/packages/eve/src/shared/skill-package.tsindex 952bc26e7..660ff44af 100644--- a/packages/eve/src/shared/skill-package.ts+++ b/packages/eve/src/shared/skill-package.ts@@ -126,7 +126,7 @@ export async function removeSkillPackageFromSandbox(input: {* Validates a runtime-contributed skill name before it becomes one path* segment under the sandbox skill root.*/-export function assertSafeSkillPackageName(name: string): void {+function assertSafeSkillPackageName(name: string): void {if (name.length === 0 ||name.startsWith(".") ||diff --git a/packages/eve/src/shared/token-usage.ts b/packages/eve/src/shared/token-usage.tsindex fc7402954..0b5a32e70 100644--- a/packages/eve/src/shared/token-usage.ts+++ b/packages/eve/src/shared/token-usage.ts@@ -3,8 +3,7 @@ import { z } from "#compiled/zod/index.js";/** Provider-reported token usage and optional model token cost totals. */export type TokenUsage = z.infer<typeof tokenUsageWithCostSchema>;-/** Token-only schema retained for historical wire formats. */-export const tokenUsageSchema = z.object({+const tokenUsageSchema = z.object({cacheReadTokens: z.number().int().nonnegative(),cacheWriteTokens: z.number().int().nonnegative(),inputTokens: z.number().int().nonnegative(),diff --git a/packages/eve/src/shared/ulid.test.ts b/packages/eve/src/shared/ulid.test.tsindex b6dc2c91b..38a008e97 100644--- a/packages/eve/src/shared/ulid.test.ts+++ b/packages/eve/src/shared/ulid.test.ts@@ -1,6 +1,6 @@import { afterEach, describe, expect, it, vi } from "vitest";-import { createUlid, createUlidFactory, isUlid, ULID_LENGTH } from "#shared/ulid.js";+import { createUlid, createUlidFactory, ULID_LENGTH } from "#shared/ulid.js";const CROCKFORD = /^[0-7][0-9A-HJKMNP-TV-Z]{25}$/;const TIME_MAX = 2 ** 48 - 1;@@ -141,19 +141,3 @@ describe("createUlidFactory", () => {expect(fresh() < settled()).toBe(true);});});--describe("isUlid", () => {- it("accepts values this module mints", () => {- expect(isUlid(createUlid())).toBe(true);- });-- it("rejects a wrong length or a non-Crockford character", () => {- const ulid = createUlid();-- expect(isUlid(ulid.slice(1))).toBe(false);- expect(isUlid(`${ulid}0`)).toBe(false);- expect(isUlid(`8${"0".repeat(25)}`)).toBe(false);- // U is excluded from the Crockford alphabet.- expect(isUlid(`U${ulid.slice(1)}`)).toBe(false);- });-});diff --git a/packages/eve/src/shared/ulid.ts b/packages/eve/src/shared/ulid.tsindex d563baf79..3e1b0623d 100644--- a/packages/eve/src/shared/ulid.ts+++ b/packages/eve/src/shared/ulid.ts@@ -17,7 +17,7 @@ const RANDOM_CHARS = 16;export const ULID_LENGTH = TIME_CHARS + RANDOM_CHARS;/** Mints one ULID. See {@link createUlidFactory}. */-export type UlidFactory = () => string;+type UlidFactory = () => string;/*** Creates an independent ULID generator with its own monotonic state.@@ -68,21 +68,6 @@ export function createUlidFactory(): UlidFactory {*/export const createUlid: UlidFactory = createUlidFactory();-/**- * Returns true when `value` is shaped like a ULID: {@link ULID_LENGTH}- * characters drawn from the Crockford base32 alphabet.- *- * Shape-only — this does not prove the value was minted here.- */-export function isUlid(value: string): boolean {- if (value.length !== ULID_LENGTH) return false;- if (ENCODING.indexOf(value[0] ?? "") > 7) return false;- for (const character of value) {- if (!ENCODING.includes(character)) return false;- }- return true;-}-function randomFill(target: Uint8Array<ArrayBuffer>): void {const webCrypto = globalThis.crypto;if (typeof webCrypto?.getRandomValues !== "function") {diff --git a/packages/eve/src/shared/vercel-project.ts b/packages/eve/src/shared/vercel-project.tsindex be5670852..1f0d3341c 100644--- a/packages/eve/src/shared/vercel-project.ts+++ b/packages/eve/src/shared/vercel-project.ts@@ -5,7 +5,7 @@* as stable identifiers (sandbox key derivation, credential routing),* never to make authentication decisions.*/-export interface VercelOidcTokenClaims {+interface VercelOidcTokenClaims {readonly ownerId: string | undefined;readonly projectId: string | undefined;}diff --git a/packages/eve/src/shared/vercel-services.ts b/packages/eve/src/shared/vercel-services.tsindex 223d51131..0cb0cc921 100644--- a/packages/eve/src/shared/vercel-services.ts+++ b/packages/eve/src/shared/vercel-services.ts@@ -60,7 +60,7 @@ interface VercelJsonConfig {* The top-level Vercel Build Output route that sends eve transport requests to* the generated eve service.*/-export type EveVercelServiceRoute = {+type EveVercelServiceRoute = {readonly destination: {readonly service: string;readonly type: "service";@@ -72,7 +72,7 @@ export type EveVercelServiceRoute = {* A service-scoped route carrying the `request.path` transform that pins the* path the eve runtime observes to the eve transport namespace.*/-export type EveVercelServiceRequestPathRoute = {+type EveVercelServiceRequestPathRoute = {readonly src: string;readonly transforms: readonly [VercelRequestPathTransform];};diff --git a/packages/eve/src/shared/workflow-sandbox.ts b/packages/eve/src/shared/workflow-sandbox.tsindex 74e1761cd..cdd68ca94 100644--- a/packages/eve/src/shared/workflow-sandbox.ts+++ b/packages/eve/src/shared/workflow-sandbox.ts@@ -69,7 +69,7 @@ export async function unwrapWorkflowSandboxResult(| { readonly interrupt: WorkflowSandboxInterrupt; readonly status: "interrupted" };}-export type WorkflowSandboxResolution =+type WorkflowSandboxResolution =| { readonly status: "completed"; readonly output: unknown }| { readonly status: "failed"; readonly error: string };diff --git a/packages/eve/src/source-change/agent-config-ast.ts b/packages/eve/src/source-change/agent-config-ast.tsindex 172e024de..114172a2a 100644--- a/packages/eve/src/source-change/agent-config-ast.ts+++ b/packages/eve/src/source-change/agent-config-ast.ts@@ -49,7 +49,7 @@ type ParseError = {readonly start?: number;};-export type ParsedAgentObject =+type ParsedAgentObject =| { readonly kind: "ok"; readonly object: ObjectExpression; readonly program: Program }| { readonly kind: "bail"; readonly reason: string; readonly line: number };diff --git a/packages/eve/src/source-change/agent-config-string-path.ts b/packages/eve/src/source-change/agent-config-string-path.tsindex 9fa9b5882..63dd00f3a 100644--- a/packages/eve/src/source-change/agent-config-string-path.ts+++ b/packages/eve/src/source-change/agent-config-string-path.ts@@ -17,11 +17,11 @@ type PropertyNode = AstNode & {readonly type: "Property";};-export type AgentConfigStringPathPatch =+type AgentConfigStringPathPatch =| { readonly kind: "set"; readonly value: string }| { readonly kind: "remove"; readonly removable?: (value: string) => boolean };-export type AgentConfigStringPathEdit =+type AgentConfigStringPathEdit =| { readonly kind: "applied"; readonly nextSource: string }| { readonly kind: "bail"; readonly reason: string; readonly line: number };diff --git a/packages/eve/src/source-change/apply-agent-model-settings.ts b/packages/eve/src/source-change/apply-agent-model-settings.tsindex 7fff070dc..9344bc511 100644--- a/packages/eve/src/source-change/apply-agent-model-settings.ts+++ b/packages/eve/src/source-change/apply-agent-model-settings.ts@@ -16,7 +16,7 @@ export interface AgentModelSettingsPatch {export type AgentModelSetting = "model" | "reasoning" | "fast-mode";-export type AgentModelSettingsEdit =+type AgentModelSettingsEdit =| {readonly kind: "applied";readonly changed: readonly AgentModelSetting[];diff --git a/packages/eve/src/source-change/apply-model-selection.ts b/packages/eve/src/source-change/apply-model-selection.tsindex d1b98d3cc..f3c4bd32d 100644--- a/packages/eve/src/source-change/apply-model-selection.ts+++ b/packages/eve/src/source-change/apply-model-selection.ts@@ -11,7 +11,7 @@ import {} from "./agent-config-ast.js";import { MODEL_HELPERS, parseModelHelper, type ModelHelper } from "#shared/model-helper.js";-export type SourceEdit =+type SourceEdit =| {readonly kind: "applied";readonly from: string;diff --git a/packages/eve/src/source-change/static-source-change.ts b/packages/eve/src/source-change/static-source-change.tsindex 7151eee3e..f28ddb160 100644--- a/packages/eve/src/source-change/static-source-change.ts+++ b/packages/eve/src/source-change/static-source-change.ts@@ -14,7 +14,7 @@ import { applyModelSelectionToSource } from "#source-change/apply-model-selectio* Outcome of a static source change, returned to upstream callers (CLI, web* setup UI) so they can render success or route the bail to a guided fix.*/-export type ApplyResult =+type ApplyResult =| { readonly kind: "applied"; readonly from: string; readonly to: string }| {readonly kind: "bail";@@ -22,7 +22,7 @@ export type ApplyResult =readonly at: { readonly logicalPath: string; readonly line: number };};-export type ApplyModelSettingsResult =+type ApplyModelSettingsResult =| { readonly kind: "applied"; readonly changed: readonly AgentModelSetting[] }| {readonly kind: "bail";@@ -37,7 +37,7 @@ export type ApplyModelSettingsResult =* `ModuleSourceRef`, so each operation can locate the file it edits without* recompiling. Consumers depend only on this interface.*/-export interface StaticSourceChange {+interface StaticSourceChange {/*** Rewrites the agent's `model` in `agent.ts` in place. Bails (no write) when* the value isn't a string literal; the bail carries the source location sodiff --git a/packages/eve/src/subagents/handle-dispatch.test.ts b/packages/eve/src/subagents/handle-dispatch.test.tsindex a66cf6ea6..8fe4cc1eb 100644--- a/packages/eve/src/subagents/handle-dispatch.test.ts+++ b/packages/eve/src/subagents/handle-dispatch.test.ts@@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";import { createWorkflowRuntime } from "#execution/workflow-runtime.js";import { dispatchToClaimedAgentAddress } from "./handle-dispatch.js";import { continueRemoteAgentSession, resolveRemoteAgentForAction } from "./remote-dispatch.js";+import { captureLogRecords } from "#internal/testing/log-records.js";vi.mock("#execution/workflow-runtime.js", () => ({ createWorkflowRuntime: vi.fn() }));vi.mock("#subagents/remote-dispatch.js", async (importOriginal) => ({@@ -81,12 +82,16 @@ describe("claimed child delivery", () => {});it("reports a missing child without starting a replacement", async () => {+ const logs = captureLogRecords();dispatchSession.mockResolvedValueOnce({ status: "session_not_active" });await expect(dispatchToClaimedAgentAddress(input)).resolves.toMatchObject({kind: "error",deliveryPermanent: true,});expect(dispatchSession).toHaveBeenCalledTimes(1);+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "error", message: "task agent delivery failed" }),+ );});it("steers a remote child without replacing its callback", async () => {diff --git a/packages/eve/src/subagents/hitl-proxy.integration.test.ts b/packages/eve/src/subagents/hitl-proxy.integration.test.tsindex 879544649..f1fc99c04 100644--- a/packages/eve/src/subagents/hitl-proxy.integration.test.ts+++ b/packages/eve/src/subagents/hitl-proxy.integration.test.ts@@ -15,7 +15,7 @@ import type { UnstampedMessageStreamEvent } from "#protocol/message.js";import type { InputRequest } from "#shared/input.js";import { createRuntimeAdapterRegistry } from "#runtime/channels/registry.js";import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js";-import { createEmptyHookRegistry } from "#runtime/hooks/registry.js";+import { createRuntimeHookRegistry } from "#runtime/hooks/registry.js";import type { ResolvedChannelDefinition } from "#runtime/types.js";import { emitProxiedInputRequest, routeDeliverPayload } from "#subagents/hitl-proxy.js";@@ -53,7 +53,7 @@ function buildMockBundle(adapters: readonly ChannelAdapter[]): CompiledBundle {adapterRegistry: createRuntimeAdapterRegistry({ channels }),compiledArtifactsSource: {} as RuntimeCompiledArtifactsSource,graph: {} as CompiledBundle["graph"],- hookRegistry: createEmptyHookRegistry(),+ hookRegistry: createRuntimeHookRegistry([]),moduleMap: {} as CompiledBundle["moduleMap"],resolvedAgent: {} as CompiledBundle["resolvedAgent"],subagentRegistry: {} as CompiledBundle["subagentRegistry"],diff --git a/packages/eve/src/subagents/invocation.ts b/packages/eve/src/subagents/invocation.tsindex f95a65882..e5084088e 100644--- a/packages/eve/src/subagents/invocation.ts+++ b/packages/eve/src/subagents/invocation.ts@@ -15,7 +15,7 @@ export interface SubagentParentContext {* Narrowed form of {@link StepInput} whose `message` is always a plain string.* Delegated child runs receive a synthesized text-only prompt.*/-export interface FormattedSubagentInvocation extends StepInput {+interface FormattedSubagentInvocation extends StepInput {readonly message: string;}diff --git a/packages/eve/src/subagents/tool.ts b/packages/eve/src/subagents/tool.tsindex bc81e0eca..e14081392 100644--- a/packages/eve/src/subagents/tool.ts+++ b/packages/eve/src/subagents/tool.ts@@ -34,7 +34,7 @@ export type SubagentInputSource =* {@link RunInput} so dispatch sites never re-derive the token from* `(callId, parentSessionId)` on their own.*/-export interface SubagentRunInputBuild {+interface SubagentRunInputBuild {readonly childContinuationToken: string;readonly runInput: RunInput;}diff --git a/packages/eve/src/tools/definition.ts b/packages/eve/src/tools/definition.tsindex 6083bed54..45ef7d034 100644--- a/packages/eve/src/tools/definition.ts+++ b/packages/eve/src/tools/definition.ts@@ -103,13 +103,6 @@ export interface InternalToolDefinitionWithExecuteFn<execute: ToolExecuteFn<TInput, TOutput>;}-export interface PublicToolDefinitionWithExecuteFn<- TInput = unknown,- TOutput = unknown,-> extends PublicToolDefinition<TInput, TOutput> {- execute: ToolExecuteFn<TInput, TOutput>;-}-/*** A question a workflow tool asks the human on the session's channel, sent* with `ctx.ask` from a `defineWorkflowTool` executor. Channels render it thediff --git a/packages/eve/src/tools/durable-callbacks.ts b/packages/eve/src/tools/durable-callbacks.tsindex 37984a147..6350d9ad6 100644--- a/packages/eve/src/tools/durable-callbacks.ts+++ b/packages/eve/src/tools/durable-callbacks.ts@@ -49,7 +49,7 @@ export interface StampedDurableDynamicCallback {readonly closure: JsonObject;}-export type LiveDurableDynamicToolCallbacks = Partial<{+type LiveDurableDynamicToolCallbacks = Partial<{execute: StampedDurableDynamicCallback;inputSchema: StampedDurableDynamicCallback;outputSchema: StampedDurableDynamicCallback;@@ -65,7 +65,7 @@ export type LiveDurableDynamicToolCallbacks = Partial<{}>;const STAMPED_CALLBACK = Symbol.for("eve:durable-dynamic-callback");-export const DURABLE_DYNAMIC_TOOL_CALLBACKS = Symbol.for("eve:durable-dynamic-tool-callbacks");+const DURABLE_DYNAMIC_TOOL_CALLBACKS = Symbol.for("eve:durable-dynamic-tool-callbacks");const REGISTRY = Symbol.for("eve:scoped-dynamic-tool-callbacks");const MAX_CACHED_SESSIONS = 1_024;diff --git a/packages/eve/src/tools/native-definition.ts b/packages/eve/src/tools/native-definition.tsindex e3c2de599..db420f539 100644--- a/packages/eve/src/tools/native-definition.ts+++ b/packages/eve/src/tools/native-definition.ts@@ -2,7 +2,7 @@ import type { PublicToolDefinition } from "#tools/definition.js";import { attachToolBehavior, type CompiledToolBehavior } from "#tools/behavior.js";/** Framework-only tool definition whose implementation is owned outside an executor. */-export type NativeToolDefinition<TInput = unknown, TOutput = unknown> = PublicToolDefinition<+type NativeToolDefinition<TInput = unknown, TOutput = unknown> = PublicToolDefinition<TInput,TOutput>;diff --git a/packages/eve/src/tracing/agent-action-instrumentation.ts b/packages/eve/src/tracing/agent-action-instrumentation.tsindex de3b95791..2113e21b4 100644--- a/packages/eve/src/tracing/agent-action-instrumentation.ts+++ b/packages/eve/src/tracing/agent-action-instrumentation.ts@@ -34,7 +34,7 @@ import { withChannelAudience } from "#tracing/channel-audience-context.js";import { AGENT_SPAN_NAMES, workflowInvocationSpanName } from "#tracing/agent-span-contract.js";import { recordAgentSpanError as recordError } from "#tracing/agent-span-error.js";-export interface AgentActionInstrumentation {+interface AgentActionInstrumentation {readonly events: Pick<NonNullable<InstrumentationProviderDefinition["events"]>,"action.completed" | "action.failed" | "action.started"diff --git a/packages/eve/src/tracing/agent-memory-instrumentation.ts b/packages/eve/src/tracing/agent-memory-instrumentation.tsindex bfd743994..fbd1af6e4 100644--- a/packages/eve/src/tracing/agent-memory-instrumentation.ts+++ b/packages/eve/src/tracing/agent-memory-instrumentation.ts@@ -36,7 +36,7 @@ import type { ConversationEnvironment } from "#shared/conversation-context.js";type SpanState = { readonly context: Context; readonly span: Span };-export interface AgentMemoryInstrumentation {+interface AgentMemoryInstrumentation {readonly events: Pick<NonNullable<InstrumentationProviderDefinition["events"]>,"memory.operation.completed" | "memory.operation.failed" | "memory.operation.started"diff --git a/packages/eve/src/tracing/agent-otel-provider.test.ts b/packages/eve/src/tracing/agent-otel-provider.test.tsindex 941d597f6..7395c7d46 100644--- a/packages/eve/src/tracing/agent-otel-provider.test.ts+++ b/packages/eve/src/tracing/agent-otel-provider.test.ts@@ -31,10 +31,8 @@ import {import { AgentSpanIdGenerator } from "#tracing/agent-span-id-generator.js";import { prepareAgentInvocationTrace } from "#tracing/agent-invocation-coordinator.js";import { ContextAgentTraceStateStore } from "#tracing/agent-trace-context-store.js";-import {- type AgentTraceStateStore,- InMemoryAgentTraceStateStore,-} from "#tracing/agent-trace-state.js";+import type { AgentTraceStateStore } from "#tracing/agent-trace-state.js";+import { InMemoryAgentTraceStateStore } from "#internal/testing/in-memory-agent-trace-state-store.js";import {createInstrumentationHooks,type InstrumentationActionKind,diff --git a/packages/eve/src/tracing/agent-otel-provider.ts b/packages/eve/src/tracing/agent-otel-provider.tsindex 652515a21..7d53fa6b9 100644--- a/packages/eve/src/tracing/agent-otel-provider.ts+++ b/packages/eve/src/tracing/agent-otel-provider.ts@@ -97,7 +97,7 @@ export interface AgentOtelInstrumentationInput {}/** OTel event definition and its trusted framework context runner. */-export interface AgentOtelInstrumentation {+interface AgentOtelInstrumentation {readonly hook: InstrumentationProviderDefinition;readonly prepareSessionTrace: (event: InstrumentationSessionStartedEvent,diff --git a/packages/eve/src/tracing/agent-span-id-generator.ts b/packages/eve/src/tracing/agent-span-id-generator.tsindex 0339c9b25..f2702db72 100644--- a/packages/eve/src/tracing/agent-span-id-generator.ts+++ b/packages/eve/src/tracing/agent-span-id-generator.ts@@ -65,7 +65,7 @@ export class AgentSpanIdGenerator {}}-export function deriveAgentSpanId(key: string): string {+function deriveAgentSpanId(key: string): string {const spanId = createHash("sha256").update(key).digest("hex").slice(0, 16);return /^0+$/u.test(spanId) ? "0000000000000001" : spanId;}diff --git a/packages/eve/src/tracing/agent-telemetry-contract.integration.test.ts b/packages/eve/src/tracing/agent-telemetry-contract.integration.test.tsindex 1edbfe1e1..f52d1a93c 100644--- a/packages/eve/src/tracing/agent-telemetry-contract.integration.test.ts+++ b/packages/eve/src/tracing/agent-telemetry-contract.integration.test.ts@@ -51,6 +51,7 @@ import { summarizeLocalTrace } from "#tracing/local-trace-summary.js";import { buildConversationItems } from "#cli/dev/tui/traces/trace-conversation.js";import { contentFilteringProcessor } from "#tracing/content-span-processor.js";import { ConversationContextKey } from "#shared/conversation-context.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const traceContext = (agentName: string, audience: "public" | "private") => ({agentName,@@ -198,6 +199,7 @@ describe("exported agent telemetry contract", () => {it.each(["throw", "reject"] as const)("preserves the settlement context when invocation materialization fails (%s)",async (failure) => {+ const logs = captureLogRecords();const runtime = createRuntime();const flush = vi.spyOn(runtime, "flushSettledInvocations").mockImplementation(() => {const error = new Error("Span processor unavailable");@@ -213,6 +215,12 @@ describe("exported agent telemetry contract", () => {serializedContext,);expect(flush).toHaveBeenCalledOnce();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "could not materialize settled invocation traces",+ }),+ );} finally {registered.mockRestore();await runtime.shutdown();@@ -750,6 +758,7 @@ describe("exported agent telemetry contract", () => {] as const)("bounds public-channel principal IDs by origin %s and input/output ceiling %s/%s",async (originAudience, recordInputs, recordOutputs) => {+ const logs = captureLogRecords();const runtime = createRuntime();const hooks = runtime.hooks.forTrace!(traceContext("child", "public"));const registered = vi@@ -768,6 +777,9 @@ describe("exported agent telemetry contract", () => {const includesIds = originAudience === "public" && recordInputs && recordOutputs;try {instrumentation.initializeSessionInstrumentation({ agentName: "child", ctx });+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "info", message: "resolved forwarded trace policy" }),+ );expect(ctx.get(SessionTraceSeedKey)?.decision).toEqual({action: "record",recordInputs: originAudience === "public" && recordInputs,diff --git a/packages/eve/src/tracing/agent-tool-instrumentation.ts b/packages/eve/src/tracing/agent-tool-instrumentation.tsindex 49fa621e5..fa0c0c823 100644--- a/packages/eve/src/tracing/agent-tool-instrumentation.ts+++ b/packages/eve/src/tracing/agent-tool-instrumentation.ts@@ -40,7 +40,7 @@ interface ToolSpanState {pendingError?: { readonly error: unknown; readonly errorType?: string };}-export interface AgentToolInstrumentation {+interface AgentToolInstrumentation {actionStarted(event: InstrumentationActionStartedEvent): Promise<void>;contextFor(attemptId: string, idempotencyKey: string): Context | undefined;drain(attemptId: string, failure?: { readonly error: unknown }): void;diff --git a/packages/eve/src/tracing/agent-tool-span-context.ts b/packages/eve/src/tracing/agent-tool-span-context.tsindex 1203f20a5..f08b7e27b 100644--- a/packages/eve/src/tracing/agent-tool-span-context.ts+++ b/packages/eve/src/tracing/agent-tool-span-context.ts@@ -5,12 +5,12 @@ import {type Context,} from "#compiled/@opentelemetry/api/index.js";-export interface AgentToolContentPolicy {+interface AgentToolContentPolicy {readonly recordInputs: boolean;readonly recordOutputs: boolean;}-export interface AgentToolSpanContext extends AgentToolContentPolicy {+interface AgentToolSpanContext extends AgentToolContentPolicy {readonly recordError?: (error: unknown, errorType?: string) => void;readonly setAttributes?: (attributes: Attributes) => void;}diff --git a/packages/eve/src/tracing/agent-trace-state.ts b/packages/eve/src/tracing/agent-trace-state.tsindex 63ac16195..842614f94 100644--- a/packages/eve/src/tracing/agent-trace-state.ts+++ b/packages/eve/src/tracing/agent-trace-state.ts@@ -132,126 +132,3 @@ export interface AgentTraceStateStore {update: (state: AgentTurnTraceState) => AgentTurnTraceState,): void | PromiseLike<void>;}--/** In-memory trace state used by tests and non-durable runtimes. */-export class InMemoryAgentTraceStateStore implements AgentTraceStateStore {- readonly #actionAnchors = new Map<string, AgentActionTraceState>();- readonly #actions = new Map<string, AgentActionTraceState>();- readonly #invocations = new Map<string, AgentInvocationTraceState>();- readonly #sessions = new Map<string, AgentSessionTraceState>();- readonly #turns = new Map<string, AgentTurnTraceState>();-- deleteAction(idempotencyKey: string): void {- this.#actions.delete(idempotencyKey);- }-- deleteActionAnchors(sessionId: string): void {- for (const [key, state] of this.#actionAnchors) {- if (state.sessionId === sessionId) this.#actionAnchors.delete(key);- }- }-- deleteActions(sessionId: string, turnId?: string): void {- for (const [key, state] of this.#actions) {- if (state.sessionId === sessionId && (turnId === undefined || state.turnId === turnId)) {- this.#actions.delete(key);- }- }- }-- deleteInvocation(idempotencyKey: string): void {- this.#invocations.delete(idempotencyKey);- }-- deleteInvocations(sessionId: string, turnId?: string): void {- for (const [key, state] of this.#invocations) {- if (state.sessionId === sessionId && (turnId === undefined || state.turnId === turnId)) {- this.#invocations.delete(key);- }- }- }-- deleteSession(sessionId: string): void {- this.#sessions.delete(sessionId);- }-- deleteTurn(sessionId: string, turnId: string): void {- this.#turns.delete(turnKey(sessionId, turnId));- }-- findAction(sessionId: string, callId: string): AgentActionTraceState | undefined {- return [...this.#actions.values()].find(- (state) => state.sessionId === sessionId && state.callId === callId,- );- }-- findActionAnchor(- sessionId: string,- turnId: string,- callId: string,- ): AgentActionTraceState | undefined {- return [...this.#actionAnchors.values()].find(- (state) =>- state.sessionId === sessionId && state.turnId === turnId && state.callId === callId,- );- }-- findInvocations(- sessionId?: string,- turnId?: string,- parentActionCallId?: string,- ): readonly AgentInvocationTraceState[] {- return [...this.#invocations.values()].filter(- (state) =>- (sessionId === undefined || state.sessionId === sessionId) &&- (turnId === undefined || state.turnId === turnId) &&- (parentActionCallId === undefined || state.parentActionCallId === parentActionCallId),- );- }-- getAction(idempotencyKey: string): AgentActionTraceState | undefined {- return this.#actions.get(idempotencyKey);- }-- getSession(sessionId: string): AgentSessionTraceState | undefined {- return this.#sessions.get(sessionId);- }-- getTurn(sessionId: string, turnId: string): AgentTurnTraceState | undefined {- return this.#turns.get(turnKey(sessionId, turnId));- }-- setAction(idempotencyKey: string, state: AgentActionTraceState): void {- this.#actions.set(idempotencyKey, state);- }-- setActionAnchor(idempotencyKey: string, state: AgentActionTraceState): void {- this.#actionAnchors.set(idempotencyKey, state);- }-- setInvocation(idempotencyKey: string, state: AgentInvocationTraceState): void {- this.#invocations.set(idempotencyKey, state);- }-- setSession(sessionId: string, state: AgentSessionTraceState): void {- this.#sessions.set(sessionId, state);- }-- setTurn(sessionId: string, turnId: string, state: AgentTurnTraceState): void {- this.#turns.set(turnKey(sessionId, turnId), state);- }-- updateTurn(- sessionId: string,- turnId: string,- update: (state: AgentTurnTraceState) => AgentTurnTraceState,- ): void {- const key = turnKey(sessionId, turnId);- const state = this.#turns.get(key);- if (state !== undefined) this.#turns.set(key, update(state));- }-}--export function turnKey(sessionId: string, turnId: string): string {- return `${sessionId}:${turnId}`;-}diff --git a/packages/eve/src/tracing/batch-span-processor.test.ts b/packages/eve/src/tracing/batch-span-processor.test.tsindex 36d8a3e4b..8435b944e 100644--- a/packages/eve/src/tracing/batch-span-processor.test.ts+++ b/packages/eve/src/tracing/batch-span-processor.test.ts@@ -5,6 +5,7 @@ import { isTracingSuppressed } from "@opentelemetry/core";import { afterEach, describe, expect, it, vi } from "vitest";import { batchSpanProcessor } from "#tracing/batch-span-processor.js";+import { captureLogRecords } from "#internal/testing/log-records.js";interface RecordingExporter extends SpanExporter {readonly batches: readonly (readonly unknown[])[];@@ -80,12 +81,16 @@ describe("batchSpanProcessor", () => {});it("logs a refused export rather than failing the turn that produced it", async () => {+ const logs = captureLogRecords();const processor = batchSpanProcessor(recordingExporter({ fail: true }), {maxExportBatchSize: 1,});processor.onEnd(span(1));await expect(processor.forceFlush()).resolves.toBeUndefined();+ expect(logs.records).toContainEqual(+ expect.objectContaining({ level: "warn", message: "span export failed" }),+ );});it("exports only sampled spans", async () => {@@ -121,6 +126,7 @@ describe("batchSpanProcessor", () => {});it("does not overlap a later batch after the first times out", async () => {+ const logs = captureLogRecords();vi.useFakeTimers();const batches: (readonly unknown[])[] = [];const callbacks: Array<(result: { code: number }) => void> = [];@@ -153,9 +159,16 @@ describe("batchSpanProcessor", () => {expect(batchIndexes(batches)).toStrictEqual([[1], [2]]);callbacks[1]?.({ code: 0 });await flushed;+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "span export timed out; preserving exporter serialization",+ }),+ );});it("continues exporting after exporter forceFlush times out", async () => {+ const logs = captureLogRecords();vi.useFakeTimers();const exporter = recordingExporter() as RecordingExporter & {forceFlush: () => Promise<void>;@@ -175,9 +188,16 @@ describe("batchSpanProcessor", () => {await vi.advanceTimersByTimeAsync(0);expect(batchIndexes(exporter.batches)).toStrictEqual([[1], [2]]);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "exporter flush timed out; preserving exporter serialization",+ }),+ );});it("drains queued batches and closes the exporter after shutdown times out", async () => {+ const logs = captureLogRecords();vi.useFakeTimers();const batches: (readonly unknown[])[] = [];const callbacks: Array<(result: { code: number }) => void> = [];@@ -208,6 +228,12 @@ describe("batchSpanProcessor", () => {callbacks[1]?.({ code: 0 });await vi.advanceTimersByTimeAsync(0);expect(shutdown).toHaveBeenCalledOnce();+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "span export timed out; preserving exporter serialization",+ }),+ );});it("drains and then closes the exporter on shutdown, and takes nothing after", async () => {diff --git a/packages/eve/src/tracing/batch-span-processor.ts b/packages/eve/src/tracing/batch-span-processor.tsindex 8e45d5402..c343352c6 100644--- a/packages/eve/src/tracing/batch-span-processor.ts+++ b/packages/eve/src/tracing/batch-span-processor.ts@@ -18,7 +18,7 @@ const DEFAULTS = {} as const;/** @internal — exposed for tests; authors get the defaults. */-export interface BatchSpanProcessorOptions {+interface BatchSpanProcessorOptions {readonly exportTimeoutMillis?: number;readonly maxExportBatchSize?: number;readonly maxQueueSize?: number;diff --git a/packages/eve/src/tracing/local-trace-analysis.ts b/packages/eve/src/tracing/local-trace-analysis.tsindex bea89d00d..073ac15db 100644--- a/packages/eve/src/tracing/local-trace-analysis.ts+++ b/packages/eve/src/tracing/local-trace-analysis.ts@@ -10,7 +10,7 @@ import {} from "#tracing/local-trace-operations.js";import { summarizeLocalTrace, type LocalTraceSummary } from "#tracing/local-trace-summary.js";-export interface TraceAnalysisSelector {+interface TraceAnalysisSelector {readonly excludeSessionId?: string;readonly fromMs?: number;readonly sessionId?: string;@@ -25,7 +25,7 @@ export interface TraceTokenUsage {readonly cacheWriteTokens?: number;}-export interface TraceTimelineRecord {+interface TraceTimelineRecord {readonly actionDurationMs?: number;readonly actionName?: string;readonly callId?: string;@@ -44,7 +44,7 @@ export interface TraceTimelineRecord {readonly usage?: TraceTokenUsage;}-export interface TraceAnalysis {+interface TraceAnalysis {readonly summary: LocalTraceSummary;readonly groups: readonly TraceAnalysisGroup[];/** Accumulated operation time, not elapsed time; parallel calls can overlap. */diff --git a/packages/eve/src/tracing/local-trace-discovery-index.ts b/packages/eve/src/tracing/local-trace-discovery-index.tsindex c7baad9fe..f7063651d 100644--- a/packages/eve/src/tracing/local-trace-discovery-index.ts+++ b/packages/eve/src/tracing/local-trace-discovery-index.ts@@ -7,7 +7,7 @@ const CONVERSATIONS_DIRECTORY = `${INDEX_DIRECTORY}/conversations`;const INDEXED_MARKER = `${INDEX_DIRECTORY}/indexed`;/** A path-safe, non-reversible key for one recorded conversation identifier. */-export function localTraceConversationIndexKey(conversationId: string): string {+function localTraceConversationIndexKey(conversationId: string): string {return createHash("sha256").update(conversationId).digest("hex");}diff --git a/packages/eve/src/tracing/local-trace-query.ts b/packages/eve/src/tracing/local-trace-query.tsindex 9224fbd6b..2a2729256 100644--- a/packages/eve/src/tracing/local-trace-query.ts+++ b/packages/eve/src/tracing/local-trace-query.ts@@ -2,7 +2,7 @@ import type { LocalTraceSummary } from "#tracing/local-trace-summary.js";export type LocalTraceSortBy = "duration" | "failures" | "inputTokens" | "latest";-export interface LocalTraceQueryFilter {+interface LocalTraceQueryFilter {readonly agentName?: string;/** Selects traces containing error spans, not necessarily failed activations. */readonly failedOnly?: boolean;diff --git a/packages/eve/src/tracing/local-trace-retention.test.ts b/packages/eve/src/tracing/local-trace-retention.test.tsindex b2b2cd531..b0e5a756f 100644--- a/packages/eve/src/tracing/local-trace-retention.test.ts+++ b/packages/eve/src/tracing/local-trace-retention.test.ts@@ -1,6 +1,7 @@import { describe, expect, it } from "vitest";import { resolveLocalTraceRetentionSettings } from "#tracing/local-trace-retention.js";+import { captureLogRecords } from "#internal/testing/log-records.js";const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1_000;const FIVE_HUNDRED_TWELVE_MIB = 512 * 1024 * 1024;@@ -51,6 +52,7 @@ describe("resolveLocalTraceRetentionSettings", () => {});it("falls back to the default rather than throwing on an unparseable value", () => {+ const logs = captureLogRecords();const settings = resolveLocalTraceRetentionSettings({EVE_TRACES_MAX_AGE_MS: "sometimes",EVE_TRACES_RETAIN_COUNT: "-4",@@ -58,5 +60,11 @@ describe("resolveLocalTraceRetentionSettings", () => {expect(settings.maxAgeMs).toBe(SEVEN_DAYS_MS);expect(settings.retainCount).toBe(20);+ expect(logs.records).toContainEqual(+ expect.objectContaining({+ level: "warn",+ message: "ignoring invalid local trace retention value",+ }),+ );});});diff --git a/packages/eve/src/tracing/local-trace-retention.ts b/packages/eve/src/tracing/local-trace-retention.tsindex 04779410e..5dd382b65 100644--- a/packages/eve/src/tracing/local-trace-retention.ts+++ b/packages/eve/src/tracing/local-trace-retention.ts@@ -33,7 +33,7 @@ const LOCAL_TRACE_RETAIN_COUNT = 20;type RetentionBound = number | false;/** Resolved retention policy for one dev worker. */-export interface LocalTraceRetentionSettings {+interface LocalTraceRetentionSettings {readonly enabled: boolean;readonly maxAgeMs: RetentionBound;readonly maxTotalBytes: RetentionBound;@@ -41,17 +41,17 @@ export interface LocalTraceRetentionSettings {}/** Which bound removed traces, reported for a single diagnostics line. */-export type LocalTracePruneReason = "maxAgeMs" | "maxTotalBytes";+type LocalTracePruneReason = "maxAgeMs" | "maxTotalBytes";/** Outcome of one sweep. `removedTraces` counts trace directories, not spans. */-export interface LocalTracePruneResult {+interface LocalTracePruneResult {readonly reasons: readonly LocalTracePruneReason[];readonly reclaimedBytes: number;readonly removedTraces: number;readonly retainedTraces: number;}-export interface PruneLocalTraceStoreInput {+interface PruneLocalTraceStoreInput {readonly appRoot: string;/** Traces whose session is open in this worker; never evicted. */readonly activeTraceIds: ReadonlySet<string>;diff --git a/packages/eve/src/tracing/telemetry-budget.ts b/packages/eve/src/tracing/telemetry-budget.tsindex 378a636e3..2d858c659 100644--- a/packages/eve/src/tracing/telemetry-budget.ts+++ b/packages/eve/src/tracing/telemetry-budget.ts@@ -1,4 +1,4 @@-export const TELEMETRY_PRINCIPAL_ID_BYTES = 1024;+const TELEMETRY_PRINCIPAL_ID_BYTES = 1024;export function boundedPrincipalId(value: unknown): string | undefined {return typeof value === "string" &&diff --git a/packages/eve/test/framework-fixtures/framework-fixtures.test.ts b/packages/eve/test/framework-fixtures/framework-fixtures.test.tsnew file mode 100644index 000000000..709799790--- /dev/null+++ b/packages/eve/test/framework-fixtures/framework-fixtures.test.ts@@ -0,0 +1,23 @@+import { fileURLToPath } from "node:url";++import { describe, it } from "vitest";++import { runPnpmCommand } from "../../src/internal/testing/run-pnpm-command.js";++const REPO_ROOT = fileURLToPath(new URL("../../../..", import.meta.url));++// Root `pnpm build` only builds `./packages/*`, so this is the only check that+// the example apps under `apps/frameworks` still build against the workspace+// eve dist. A non-zero exit from the fixture's own build is the failure signal.+describe("framework fixtures", () => {+ it.each(["framework-next", "framework-nuxt", "framework-sveltekit"])(+ "builds the %s fixture against the workspace eve dist",+ async (fixture) => {+ await runPnpmCommand({+ args: ["--filter", fixture, "build"],+ cwd: REPO_ROOT,+ });+ },+ 300_000,+ );+});diff --git a/packages/eve/test/helpers/vercel-deployment-fixture.ts b/packages/eve/test/helpers/vercel-deployment-fixture.tsdeleted file mode 100644index b93bd048a..000000000--- a/packages/eve/test/helpers/vercel-deployment-fixture.ts+++ /dev/null@@ -1,345 +0,0 @@-import { cp, mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";-import { tmpdir } from "node:os";-import { basename, dirname, join } from "node:path";--import type { ScenarioAppDescriptor } from "#internal/testing/scenario-app.js";-import { ensureScenarioEveTarballPath } from "#internal/testing/scenario-app.js";-import { runPnpmCommand } from "#internal/testing/run-pnpm-command.js";-import { EVE_PACKAGE_NAME } from "#internal/package-name.js";-import { EVE_HEALTH_ROUTE_PATH } from "#protocol/routes.js";-import { createDevelopmentRequestHeadersAsync } from "../dev-client-harness/request-headers.js";-import { resolveDevelopmentServerRouteUrl } from "../dev-client-harness/url.js";--const VERCEL_CLI_PACKAGE = "vercel@latest";-const DEFAULT_DEPLOYMENT_READY_ATTEMPTS = 30;-const DEFAULT_DEPLOYMENT_READY_WAIT_MS = 2_000;--/**- * One deployed test app prepared from a fixture copy and an eve tarball.- */-export interface TarballVercelDeploymentFixture {- readonly appRoot: string;- readonly deploymentUrl: string;- cleanup(): Promise<void>;-}--/**- * Input for creating one deployed fixture application on Vercel.- */-export interface CreateTarballVercelDeploymentFixtureInput {- readonly descriptor: ScenarioAppDescriptor;- readonly orgId: string;- readonly prefix: string;- readonly projectId: string;- readonly runtimeEnv?: Readonly<Record<string, string>>;- readonly scope?: string;- readonly token: string;- /** Wait for the deployed eve health route after the Vercel build succeeds. */- readonly waitForHealth?: boolean;-}--/**- * Materializes the descriptor into a fresh temporary directory, wires the- * app to depend on the locally packed eve tarball, deploys it to Vercel,- * and returns the deployment URL.- */-export async function createTarballVercelDeploymentFixture(- input: CreateTarballVercelDeploymentFixtureInput,-): Promise<TarballVercelDeploymentFixture> {- const appRoot = await mkdtemp(join(tmpdir(), input.prefix));-- try {- const tarballSourcePath = await ensureScenarioEveTarballPath();- const tarballFileName = basename(tarballSourcePath);-- await cp(tarballSourcePath, join(appRoot, tarballFileName));- await writeDescriptorAppFiles({- appRoot,- descriptor: input.descriptor,- });- await writeDescriptorPackageManifest({- appRoot,- descriptor: input.descriptor,- tarballFileName,- });- await writeVercelProjectLink({- appRoot,- orgId: input.orgId,- projectId: input.projectId,- });-- const deploymentUrl = await deployFixtureToVercel({- appRoot,- runtimeEnv: input.runtimeEnv,- scope: input.scope,- token: input.token,- });-- if (input.waitForHealth !== false) {- await waitForDeploymentReady({- deploymentUrl,- });- }-- return {- appRoot,- async cleanup(): Promise<void> {- await rm(appRoot, {- force: true,- recursive: true,- });- },- deploymentUrl,- };- } catch (error) {- await rm(appRoot, {- force: true,- recursive: true,- });-- throw error;- }-}--async function writeDescriptorAppFiles(input: {- readonly appRoot: string;- readonly descriptor: ScenarioAppDescriptor;-}): Promise<void> {- for (const [relativePath, contents] of Object.entries(input.descriptor.files)) {- const destinationPath = join(input.appRoot, relativePath);- await mkdir(dirname(destinationPath), {- recursive: true,- });- await writeFile(destinationPath, contents, "utf8");- }-}--async function writeDescriptorPackageManifest(input: {- readonly appRoot: string;- readonly descriptor: ScenarioAppDescriptor;- readonly tarballFileName: string;-}): Promise<void> {- const packageJson: Record<string, unknown> = {- dependencies: {- [EVE_PACKAGE_NAME]: `file:./${input.tarballFileName}`,- ...input.descriptor.dependencies,- },- name: input.descriptor.name,- private: true,- type: "module",- };-- await writeFile(- join(input.appRoot, "package.json"),- `${JSON.stringify(packageJson, null, 2)}\n`,- "utf8",- );-}--async function writeVercelProjectLink(input: {- readonly appRoot: string;- readonly orgId: string;- readonly projectId: string;-}): Promise<void> {- const vercelDirectoryPath = join(input.appRoot, ".vercel");-- await mkdir(vercelDirectoryPath, {- recursive: true,- });- await writeFile(- join(vercelDirectoryPath, "project.json"),- `${JSON.stringify(- {- orgId: input.orgId,- projectId: input.projectId,- },- null,- 2,- )}\n`,- "utf8",- );-}--async function deployFixtureToVercel(input: {- readonly appRoot: string;- readonly runtimeEnv?: Readonly<Record<string, string>>;- readonly scope?: string;- readonly token: string;-}): Promise<string> {- const args = ["dlx", VERCEL_CLI_PACKAGE, "deploy", "--json", "--yes"];-- if (input.scope !== undefined && input.scope.trim().length > 0) {- args.push("--scope", input.scope.trim());- }-- for (const [name, value] of Object.entries(input.runtimeEnv ?? {})) {- if (name.trim().length === 0 || value.trim().length === 0) {- continue;- }-- args.push("--build-env", `${name}=${value}`);- args.push("--env", `${name}=${value}`);- }-- const result = await runPnpmCommand({- args,- cwd: input.appRoot,- env: {- ...process.env,- VERCEL_TOKEN: input.token,- },- });- const deploymentUrl =- extractDeploymentUrlFromJsonOutput(result.stdout) ??- extractDeploymentUrlFromText([result.stdout, result.stderr].join("\n"));-- if (deploymentUrl === undefined) {- throw new Error(- [- "Failed to resolve Vercel deployment URL from CLI output.",- `stdout:\n${result.stdout}`,- `stderr:\n${result.stderr}`,- ].join("\n\n"),- );- }-- return deploymentUrl;-}--function extractDeploymentUrlFromJsonOutput(stdout: string): string | undefined {- try {- const parsed: unknown = JSON.parse(stdout);- const deploymentUrl = readDeploymentUrl(parsed);-- if (deploymentUrl !== undefined) {- return deploymentUrl;- }- } catch {}-- for (const line of stdout.split(/\r?\n/u).reverse()) {- const trimmedLine = line.trim();-- if (!trimmedLine.startsWith("{")) {- continue;- }-- try {- const parsed: unknown = JSON.parse(trimmedLine);- const deploymentUrl = readDeploymentUrl(parsed);-- if (deploymentUrl !== undefined) {- return deploymentUrl;- }- } catch {}- }-- return undefined;-}--function readDeploymentUrl(value: unknown): string | undefined {- if (!isRecord(value)) {- return undefined;- }-- if (typeof value.url === "string" && value.url.trim().length > 0) {- return normalizeDeploymentUrl(value.url);- }-- if (- isRecord(value.deployment) &&- typeof value.deployment.url === "string" &&- value.deployment.url.trim().length > 0- ) {- return normalizeDeploymentUrl(value.deployment.url);- }-- return undefined;-}--function isRecord(value: unknown): value is Record<string, unknown> {- return value !== null && typeof value === "object" && !Array.isArray(value);-}--function extractDeploymentUrlFromText(output: string): string | undefined {- const urlMatches = output.match(/https:\/\/[a-zA-Z0-9.-]+\.vercel\.app/gu);-- if (urlMatches !== null && urlMatches.length > 0) {- const latestUrl = urlMatches.at(-1);-- if (latestUrl !== undefined) {- return normalizeDeploymentUrl(latestUrl);- }- }-- const bareMatches = output.match(/[a-zA-Z0-9.-]+\.vercel\.app/gu);-- if (bareMatches !== null && bareMatches.length > 0) {- const latestUrl = bareMatches.at(-1);-- if (latestUrl !== undefined) {- return normalizeDeploymentUrl(latestUrl);- }- }-- return undefined;-}--function normalizeDeploymentUrl(value: string): string {- const trimmedValue = value.trim();-- if (trimmedValue.startsWith("https://") || trimmedValue.startsWith("http://")) {- return trimmedValue;- }-- return `https://${trimmedValue}`;-}--async function waitForDeploymentReady(input: { readonly deploymentUrl: string }): Promise<void> {- const healthUrl = resolveDevelopmentServerRouteUrl({- routePath: EVE_HEALTH_ROUTE_PATH,- serverUrl: input.deploymentUrl,- });- let lastError: unknown;-- for (let attempt = 1; attempt <= DEFAULT_DEPLOYMENT_READY_ATTEMPTS; attempt += 1) {- try {- const headers = await createDevelopmentRequestHeadersAsync({- resourceUrl: healthUrl,- });- const response = await fetch(healthUrl, {- headers,- });-- if (response.ok) {- return;- }-- lastError = new Error(- `Health route returned ${response.status} ${response.statusText} while waiting for deployment readiness.`,- );- } catch (error) {- lastError = error;- }-- await sleep(DEFAULT_DEPLOYMENT_READY_WAIT_MS);- }-- const detail =- lastError instanceof Error- ? `${lastError.name}: ${lastError.message}`- : `Unknown error: ${String(lastError)}`;-- throw new Error(- [- `Deployment did not become ready after ${DEFAULT_DEPLOYMENT_READY_ATTEMPTS} attempts.`,- `Health URL: ${healthUrl.toString()}`,- `Last error: ${detail}`,- ].join("\n"),- );-}--async function sleep(milliseconds: number): Promise<void> {- await new Promise<void>((resolve) => {- setTimeout(resolve, milliseconds);- });-}diff --git a/packages/eve/test/resolve-agent.test.ts b/packages/eve/test/resolve-agent.test.tsindex e90fad84d..843188c85 100644--- a/packages/eve/test/resolve-agent.test.ts+++ b/packages/eve/test/resolve-agent.test.ts@@ -2,9 +2,10 @@ import { asSchema } from "ai";import { describe, expect, it } from "vitest";import { z } from "#compiled/zod/index.js";-import { compileFromMemory } from "../src/compiler/compile-from-memory.js";+import { compileFromMemory } from "../src/internal/testing/compile-from-memory.js";import { defineTool } from "../src/tools/definition.js";-import { ResolveAgentError, resolveAgent } from "../src/runtime/resolve-agent.js";+import { resolveAgent } from "../src/runtime/resolve-agent.js";+import { ResolveAgentError } from "../src/runtime/resolve-helpers.js";import { serializeInputSchema } from "../src/tools/schema.js";describe("resolveAgent", () => {diff --git a/packages/eve/test/runtime-agent-graph.test.ts b/packages/eve/test/runtime-agent-graph.test.tsindex 3916be360..ce264af5a 100644--- a/packages/eve/test/runtime-agent-graph.test.ts+++ b/packages/eve/test/runtime-agent-graph.test.ts@@ -1,6 +1,6 @@import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";-import { compileFromMemory } from "../src/compiler/compile-from-memory.js";+import { compileFromMemory } from "../src/internal/testing/compile-from-memory.js";import { disableTool } from "../src/tools/definition.js";import { resolveRuntimeAgentGraph } from "../src/runtime/resolve-agent-graph.js";diff --git a/packages/eve/test/runtime-schedule-resolution.test.ts b/packages/eve/test/runtime-schedule-resolution.test.tsindex 69e43caea..4ad531185 100644--- a/packages/eve/test/runtime-schedule-resolution.test.ts+++ b/packages/eve/test/runtime-schedule-resolution.test.ts@@ -1,6 +1,6 @@import { describe, expect, it } from "vitest";-import { compileFromMemory } from "../src/compiler/compile-from-memory.js";+import { compileFromMemory } from "../src/internal/testing/compile-from-memory.js";import { defineSchedule } from "../src/public/definitions/schedule.js";import { resolveSchedules } from "../src/runtime/schedules/resolve-schedule.js";diff --git a/packages/eve/test/scenarios/compiled-vendor-assets.scenario.test.ts b/packages/eve/test/scenarios/compiled-vendor-assets.scenario.test.tsindex 1a7245332..f1d5b7769 100644--- a/packages/eve/test/scenarios/compiled-vendor-assets.scenario.test.ts+++ b/packages/eve/test/scenarios/compiled-vendor-assets.scenario.test.ts@@ -18,7 +18,6 @@ const EVE_CATALOG_FINGERPRINT_FILES = ["tsconfig.json",] as const;const COMPILED_VENDOR_ROOT = join(EVE_PACKAGE_ROOT, ".generated", "compiled");-const VENDOR_WARNING_LOG_PATH = join(EVE_PACKAGE_ROOT, "scripts", "vendor-warning-log.mjs");const execFileAsync = promisify(execFile);const require = createRequire(import.meta.url);const VERCEL_BLOB_DIST_ROOT = dirname(require.resolve("@vercel/blob"));@@ -27,26 +26,6 @@ const VERCEL_SANDBOX_DIST_ROOT = join("dist",);-type VendorWarningLog = {- readonly createVendoredDependencyWarningFilter: () => {- readonly onLog: (- level: string,- log: {- readonly id?: string;- readonly ids?: readonly string[];- readonly loc?: { readonly file?: string };- readonly message: string;- readonly pluginCode?: string;- },- defaultHandler: (level: string, log: { readonly message: string }) => void,- ) => void;- };-};--async function loadVendorWarningLog(): Promise<VendorWarningLog> {- return (await import(pathToFileURL(VENDOR_WARNING_LOG_PATH).href)) as VendorWarningLog;-}-function containsSourceMapComment(source: string): boolean {return /(?:^|\n)\s*\/\/# sourceMappingURL=/u.test(source);}@@ -223,111 +202,6 @@ describe("compiled vendor assets", () => {);});- it("suppresses dependency warnings without hiding actionable logs", async () => {- const { createVendoredDependencyWarningFilter } = await loadVendorWarningLog();- const forwardedLogs: string[] = [];- const filter = createVendoredDependencyWarningFilter();- const dependencyFilePath = join(- EVE_PACKAGE_ROOT,- "..",- "..",- "node_modules",- "fixture",- "index.js",- );- const generatedCompiledFilePath = join(- EVE_PACKAGE_ROOT,- ".generated",- "compiled",- "gray-matter",- "index.js",- );- const distCompiledFilePath = join(- EVE_PACKAGE_ROOT,- "dist",- "src",- "compiled",- "gray-matter",- "index.js",- );- const scriptFilePath = join(EVE_PACKAGE_ROOT, "scripts", "vendor-compiled.mjs");-- filter.onLog(- "warn",- {- loc: {- file: dependencyFilePath,- },- message: "dependency implementation detail",- },- (level, log) => {- forwardedLogs.push(`${level}:${log.message}`);- },- );- filter.onLog(- "warn",- {- id: generatedCompiledFilePath,- message: "generated compiled dependency implementation detail",- },- (level, log) => {- forwardedLogs.push(`${level}:${log.message}`);- },- );- filter.onLog(- "warn",- {- loc: {- file: distCompiledFilePath,- },- message: "dist compiled dependency implementation detail",- },- (level, log) => {- forwardedLogs.push(`${level}:${log.message}`);- },- );- filter.onLog(- "warn",- {- id: scriptFilePath,- message: "eve vendoring warning",- },- (level, log) => {- forwardedLogs.push(`${level}:${log.message}`);- },- );- filter.onLog(- "warn",- {- id: scriptFilePath,- ids: [scriptFilePath, generatedCompiledFilePath],- message: "mixed eve and dependency warning",- pluginCode: generatedCompiledFilePath,- },- (level, log) => {- forwardedLogs.push(`${level}:${log.message}`);- },- );- filter.onLog(- "error",- {- loc: {- file: dependencyFilePath,- },- message: "dependency build failure",- },- (level, log) => {- forwardedLogs.push(`${level}:${log.message}`);- },- );-- expect(forwardedLogs).toEqual([- "warn:eve vendoring warning",- "warn:mixed eve and dependency warning",- "error:dependency build failure",- ]);- });-it("copies @workflow/core declaration files from the installed package", async () => {const [indexDts, createHookDts, workflowDts, workflowIndexDts, runtimeRunDts] =await Promise.all([diff --git a/packages/eve/test/scenarios/dev-server-workflow-generations.scenario.test.ts b/packages/eve/test/scenarios/dev-server-workflow-generations.scenario.test.tsindex 53c6f7033..ee252920e 100644--- a/packages/eve/test/scenarios/dev-server-workflow-generations.scenario.test.ts+++ b/packages/eve/test/scenarios/dev-server-workflow-generations.scenario.test.ts@@ -1,4 +1,4 @@-import { readFile, writeFile } from "node:fs/promises";+import { writeFile } from "node:fs/promises";import { join } from "node:path";import { describe, expect, it } from "vitest";@@ -39,7 +39,7 @@ const WORKFLOW_GENERATION_DESCRIPTOR: ScenarioAppDescriptor = {function createGenerationMarkerToolSource(marker: string, crashOnce: boolean): string {const lifecycle = crashOnce? [- 'import { existsSync, renameSync, watch, writeFileSync } from "node:fs";',+ 'import { existsSync, watch, writeFileSync } from "node:fs";','import { basename, join } from "node:path";',"","async function waitForPath(path: string) {",@@ -64,19 +64,11 @@ function createGenerationMarkerToolSource(marker: string, crashOnce: boolean): s' const startedPath = join(process.cwd(), ".turn-started");',' const crashPath = join(process.cwd(), ".crash-turn-worker");',' const crashedPath = join(process.cwd(), ".turn-worker-crashed");',- ' const restartPath = join(process.cwd(), ".restart-generation-test");',' writeFileSync(startedPath, "ready");',- " if (existsSync(restartPath)) {",- ' const recoveredPath = join(process.cwd(), ".recovered-turn-started");',- " const temporaryRecoveredPath = `${recoveredPath}.${process.pid}.tmp`;",- ` writeFileSync(temporaryRecoveredPath, JSON.stringify({ instrumentation: String(globalThis.__EVE_INSTRUMENTATION_MARKER__ ?? "missing"), marker: ${JSON.stringify(marker)} }));`,- " renameSync(temporaryRecoveredPath, recoveredPath);",- " } else {",- " await waitForPath(crashPath);",- " if (!existsSync(crashedPath)) {",- ' writeFileSync(crashedPath, "crashed");',- " process.exit(1);",- " }",+ " await waitForPath(crashPath);",+ " if (!existsSync(crashedPath)) {",+ ' writeFileSync(crashedPath, "crashed");',+ " process.exit(1);"," }",]: [];@@ -185,67 +177,6 @@ describe("eve dev server workflow generations", () => {},DEV_SERVER_SCENARIO_TIMEOUT_MS,);-- // Re-enable after https://github.com/vercel/workflow/pull/3824 ships and eve- // vendors the release with abortable local queue deliveries.- it.skip(- "recovers a nonterminal child Workflow on its selected generation after restart",- async () => {- const app = await scenarioApp(WORKFLOW_GENERATION_DESCRIPTOR);- let server = await startEveDev(app.appRoot, {- env: { WORKFLOW_INLINE_OWNERSHIP_LEASE_SECONDS: "1" },- });- const turnStartedPath = join(app.appRoot, ".turn-started");- const restartPath = join(app.appRoot, ".restart-generation-test");- const recoveredPath = join(app.appRoot, ".recovered-turn-started");-- try {- await writeFile(- join(app.appRoot, "agent", "tools", "get_marker.ts"),- createGenerationMarkerToolSource("generation-one-runtime", true),- );- await forceDevelopmentRebuild(server.url);- await expect(fetchText(server.url, "/instrumentation-marker")).resolves.toBe("one");-- const interruptedTurn = sendDevelopmentMessage({- message: "Use get_marker.",- session: createDevelopmentSessionState(),- serverUrl: server.url,- }).catch(() => undefined);- await waitForPath(turnStartedPath);-- await writeFile(- join(app.appRoot, "agent", "tools", "get_marker.ts"),- createGenerationMarkerToolSource("generation-two", false),- );- await writeFile(- join(app.appRoot, "agent", "instrumentation", "reload.ts"),- createInstrumentationSource("two"),- );- await forceDevelopmentRebuild(server.url);- await expect(fetchText(server.url, "/instrumentation-marker")).resolves.toBe("two");-- await server.crash();- await withinDeadline(interruptedTurn, "Interrupted client stream did not settle.");- await writeFile(restartPath, "restart");- server = await startEveDev(app.appRoot, {- env: { WORKFLOW_INLINE_OWNERSHIP_LEASE_SECONDS: "1" },- });- await waitForPath(recoveredPath);- await expect(- readFile(recoveredPath, "utf8").then((source) => JSON.parse(source) as unknown),- ).resolves.toEqual({- // The recorded generation owns both its tool and instrumentation- // sources, even when recovery happens in a freshly started worker.- instrumentation: "one",- marker: "generation-one-runtime",- });- } finally {- await server.stop();- }- },- DEV_SERVER_SCENARIO_TIMEOUT_MS,- );});function readCompletedMessages(diff --git a/packages/eve/test/scenarios/eval-command-environment.scenario.test.ts b/packages/eve/test/scenarios/eval-command-environment.scenario.test.tsindex e24b03556..e4fcce208 100644--- a/packages/eve/test/scenarios/eval-command-environment.scenario.test.ts+++ b/packages/eve/test/scenarios/eval-command-environment.scenario.test.ts@@ -8,7 +8,7 @@ import { defineEval } from "../../src/evals/define-eval.js";import { runCli } from "../../src/cli/run.js";import {- clearActiveSandboxHandlesForTest,+ shutdownActiveSandboxHandles,trackActiveSandboxHandle,} from "../../src/execution/sandbox/active-handles.js";import { useTemporaryDirectories } from "../../src/internal/testing/use-temporary-app-roots.js";@@ -96,11 +96,11 @@ function clearDevelopmentEnvironment(): void {}}-afterEach(() => {+afterEach(async () => {clearDevelopmentEnvironment();process.exitCode = undefined;vi.restoreAllMocks();- clearActiveSandboxHandlesForTest();+ await shutdownActiveSandboxHandles();mockedEvalDependencies.createDevelopmentServer.mockReset();mockedEvalDependencies.discoverAndImportEvals.mockReset();mockedEvalDependencies.discoverEvalConfig.mockReset();diff --git a/packages/eve/test/scenarios/eve-init.scenario.test.ts b/packages/eve/test/scenarios/eve-init.scenario.test.tsindex 72f8027e7..62273bb21 100644--- a/packages/eve/test/scenarios/eve-init.scenario.test.ts+++ b/packages/eve/test/scenarios/eve-init.scenario.test.ts@@ -6,12 +6,12 @@ import { promisify } from "node:util";import { describe, expect, it } from "vitest";-import { CODING_AGENT_ENV_MARKERS } from "../../src/cli/agent-detection.js";+import { CODING_AGENT_ENV_MARKERS } from "../../src/setup/primitives/coding-agent-env.js";import { stripAnsi } from "../../src/cli/ui/terminal-text.js";import { loadYaml } from "../../src/evals/loaders/yaml.js";import { DEFAULT_AGENT_MODEL_ID } from "../../src/shared/default-agent-model.js";import { pathExists } from "../../src/setup/path-exists.js";-import { eveDevArguments } from "../../src/setup/primitives/run-pnpm.js";+import { eveDevArguments } from "../../src/setup/primitives/index.js";import { ensureScenarioEveTarballPath } from "../../src/internal/testing/scenario-app.js";import { useTemporaryDirectories } from "../../src/internal/testing/use-temporary-app-roots.js";diff --git a/packages/eve/test/scenarios/framework-next-build.scenario.test.ts b/packages/eve/test/scenarios/framework-next-build.scenario.test.tsindex 58ec392b4..fe099cbc8 100644--- a/packages/eve/test/scenarios/framework-next-build.scenario.test.ts+++ b/packages/eve/test/scenarios/framework-next-build.scenario.test.ts@@ -1,6 +1,5 @@import { access, readFile } from "node:fs/promises";import { join } from "node:path";-import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";@@ -9,7 +8,6 @@ import { createNextEveProxyDescriptor } from "../../src/internal/testing/scenariimport { useScenarioApp } from "../../src/internal/testing/scenario-app.js";import { runPnpmCommand } from "../../src/internal/testing/run-pnpm-command.js";-const REPO_ROOT = fileURLToPath(new URL("../../../..", import.meta.url));const VERCEL_GENERATED_SERVICES_VERSION = "56.4.0";const VERCEL_PNPM_10_PROJECT_CREATED_AT = Date.UTC(2026, 6, 13);const scenarioApp = useScenarioApp();@@ -142,13 +140,6 @@ async function runVercelBuild(appRoot: string): Promise<void> {}describe("framework-next build", () => {- it("builds the Next.js framework fixture against the workspace eve dist", async () => {- await runPnpmCommand({- args: ["--filter", "framework-next", "build"],- cwd: REPO_ROOT,- });- }, 180_000);-it("preserves Next middleware when Vercel assembles the generated eve service", async () => {const app = await scenarioApp(NEXT_EVE_MIDDLEWARE_DESCRIPTOR);diff --git a/packages/eve/test/scenarios/framework-nuxt-build.scenario.test.ts b/packages/eve/test/scenarios/framework-nuxt-build.scenario.test.tsindex b03883d07..e6458d711 100644--- a/packages/eve/test/scenarios/framework-nuxt-build.scenario.test.ts+++ b/packages/eve/test/scenarios/framework-nuxt-build.scenario.test.ts@@ -1,6 +1,5 @@import { readFile } from "node:fs/promises";import { join } from "node:path";-import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";@@ -8,7 +7,6 @@ import { createNuxtEveServiceDescriptor } from "../../src/internal/testing/scenaimport { useScenarioApp } from "../../src/internal/testing/scenario-app.js";import { runPnpmCommand } from "../../src/internal/testing/run-pnpm-command.js";-const REPO_ROOT = fileURLToPath(new URL("../../../..", import.meta.url));const scenarioApp = useScenarioApp();const NUXT_EVE_SERVICE_DESCRIPTOR = createNuxtEveServiceDescriptor({@@ -58,13 +56,6 @@ function isFilesystemHandle(route: unknown): boolean {}describe("framework-nuxt build", () => {- it("builds the Nuxt framework fixture against the workspace eve dist", async () => {- await runPnpmCommand({- args: ["--filter", "framework-nuxt", "build"],- cwd: REPO_ROOT,- });- }, 300_000);-it("emits the eve service and route into the Vercel Build Output", async () => {const app = await scenarioApp(NUXT_EVE_SERVICE_DESCRIPTOR);diff --git a/packages/eve/test/scenarios/framework-sveltekit-build.scenario.test.ts b/packages/eve/test/scenarios/framework-sveltekit-build.scenario.test.tsindex 0a2e5202e..777b9974d 100644--- a/packages/eve/test/scenarios/framework-sveltekit-build.scenario.test.ts+++ b/packages/eve/test/scenarios/framework-sveltekit-build.scenario.test.ts@@ -1,6 +1,5 @@import { readFile } from "node:fs/promises";import { join } from "node:path";-import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";@@ -8,7 +7,6 @@ import { createSvelteKitEveServiceDescriptor } from "../../src/internal/testing/import { useScenarioApp } from "../../src/internal/testing/scenario-app.js";import { runPnpmCommand } from "../../src/internal/testing/run-pnpm-command.js";-const REPO_ROOT = fileURLToPath(new URL("../../../..", import.meta.url));const scenarioApp = useScenarioApp();const SVELTEKIT_EVE_SERVICE_DESCRIPTOR = createSvelteKitEveServiceDescriptor({@@ -39,13 +37,6 @@ async function readVercelOutputConfig(outputRoot: string): Promise<{}describe("framework-sveltekit build", () => {- it("builds the SvelteKit framework fixture against the workspace eve dist", async () => {- await runPnpmCommand({- args: ["--filter", "framework-sveltekit", "build"],- cwd: REPO_ROOT,- });- }, 300_000);-it("emits the eve service and route into the Vercel Build Output", async () => {const app = await scenarioApp(SVELTEKIT_EVE_SERVICE_DESCRIPTOR);diff --git a/packages/eve/test/setup/workflow-global-setup.ts b/packages/eve/test/setup/workflow-global-setup.tsindex abbe8d3fc..436f84dea 100644--- a/packages/eve/test/setup/workflow-global-setup.ts+++ b/packages/eve/test/setup/workflow-global-setup.ts@@ -10,9 +10,9 @@ import {resolveWorkflowModulePath,} from "#internal/application/package.js";import { resolveWorkflowTestOutputDirectory } from "#internal/testing/workflow-vitest-plugin.js";+import { bundleWorkflowStepRegistrations } from "#internal/testing/workflow-step-registrations.js";import { WorkflowBundleBuilder } from "#internal/workflow-bundle/builder.js";import {- bundleWorkflowStepRegistrations,collectWorkflowInputFiles,type WorkflowBundleDiscoveredEntries,} from "#internal/workflow-bundle/builder-support.js";diff --git a/packages/eve/test/setup/workflow-setup.ts b/packages/eve/test/setup/workflow-setup.tsindex 349e0c9fc..d535ed6fd 100644--- a/packages/eve/test/setup/workflow-setup.ts+++ b/packages/eve/test/setup/workflow-setup.ts@@ -21,6 +21,10 @@ const poolId = process.env.VITEST_POOL_ID ?? "0";installEveWorkflowQueueNamespace(WORKFLOW_TEST_AGENT_NAME);const world = createWorld({dataDir: join(resolveLocalWorkflowWorldDataDirectory(packageRoot), `vitest-${poolId}`),+ // Every test file in this worker shares the data directory, and the file's+ // state is cleared below. Recovering the previous file's unfinished runs on+ // start would only re-enqueue deliveries that fail before a handler exists.+ recoverActiveRuns: false,tag: `vitest-${poolId}`,});diff --git a/packages/eve/test/vercel/next-eve-proxy.vercel.test.ts b/packages/eve/test/vercel/next-eve-proxy.vercel.test.tsdeleted file mode 100644index 42c9d1e48..000000000--- a/packages/eve/test/vercel/next-eve-proxy.vercel.test.ts+++ /dev/null@@ -1,70 +0,0 @@-import { afterAll, beforeAll, describe, expect, it } from "vitest";--import { createNextEveProxyDescriptor } from "../../src/internal/testing/scenario-apps/next-eve-proxy.js";-import {- createTarballVercelDeploymentFixture,- type TarballVercelDeploymentFixture,-} from "../helpers/vercel-deployment-fixture.js";--const REQUIRED_VERCEL_ENV_NAMES = ["VERCEL_TOKEN", "VERCEL_ORG_ID", "VERCEL_PROJECT_ID"] as const;-const missingEnvironmentVariables = REQUIRED_VERCEL_ENV_NAMES.filter(- (name) => !hasEnvironmentVariable(name),-);--if (missingEnvironmentVariables.length > 0) {- throw new Error(- [- "Missing required environment variables for Next.js proxy Vercel deployment tests.",- `Set: ${missingEnvironmentVariables.join(", ")}`,- ].join("\n"),- );-}--describe.sequential("Next.js proxy with generated eve service", () => {- let deploymentFixture: TarballVercelDeploymentFixture | undefined;-- beforeAll(async () => {- deploymentFixture = await createTarballVercelDeploymentFixture({- descriptor: createNextEveProxyDescriptor(),- orgId: readRequiredEnvironmentVariable("VERCEL_ORG_ID"),- prefix: "eve-vercel-next-proxy-",- projectId: readRequiredEnvironmentVariable("VERCEL_PROJECT_ID"),- scope: readOptionalEnvironmentVariable("VERCEL_SCOPE"),- token: readRequiredEnvironmentVariable("VERCEL_TOKEN"),- waitForHealth: false,- });- }, 20 * 60_000);-- afterAll(async () => {- await deploymentFixture?.cleanup();- deploymentFixture = undefined;- });-- it("deploys from source without rejecting the host middleware mapping", () => {- if (deploymentFixture === undefined) {- throw new Error("Expected Vercel deployment fixture to be initialized.");- }-- expect(deploymentFixture.deploymentUrl).toMatch(/^https:\/\//u);- });-});--function hasEnvironmentVariable(name: string): boolean {- return readOptionalEnvironmentVariable(name) !== undefined;-}--function readOptionalEnvironmentVariable(name: string): string | undefined {- const value = process.env[name]?.trim();-- return value === undefined || value.length === 0 ? undefined : value;-}--function readRequiredEnvironmentVariable(name: string): string {- const value = readOptionalEnvironmentVariable(name);-- if (value === undefined) {- throw new Error(`Missing required environment variable: ${name}`);- }-- return value;-}diff --git a/packages/eve/test/vercel/session-reset.vercel.test.ts b/packages/eve/test/vercel/session-reset.vercel.test.tsdeleted file mode 100644index 669f31338..000000000--- a/packages/eve/test/vercel/session-reset.vercel.test.ts+++ /dev/null@@ -1,154 +0,0 @@-import { afterAll, beforeAll, describe, expect, it } from "vitest";--import { SESSION_RESET_DESCRIPTOR } from "#internal/testing/scenario-apps/session-reset.js";-import {- createTarballVercelDeploymentFixture,- type TarballVercelDeploymentFixture,-} from "../helpers/vercel-deployment-fixture.js";--const REQUIRED_VERCEL_ENV_NAMES = ["VERCEL_TOKEN", "VERCEL_ORG_ID", "VERCEL_PROJECT_ID"] as const;-const missingEnvironmentVariables = REQUIRED_VERCEL_ENV_NAMES.filter(- (name) => !hasEnvironmentVariable(name),-);--if (missingEnvironmentVariables.length > 0) {- throw new Error(- [- "Missing required environment variables for session-reset Vercel deployment tests.",- `Set: ${missingEnvironmentVariables.join(", ")}`,- ].join("\n"),- );-}--describe.sequential("session reset Vercel deployment integration", () => {- let deploymentFixture: TarballVercelDeploymentFixture | undefined;-- beforeAll(async () => {- deploymentFixture = await createTarballVercelDeploymentFixture({- descriptor: SESSION_RESET_DESCRIPTOR,- orgId: readRequiredEnvironmentVariable("VERCEL_ORG_ID"),- prefix: "eve-vercel-session-reset-",- projectId: readRequiredEnvironmentVariable("VERCEL_PROJECT_ID"),- runtimeEnv: collectDeploymentEnvironment(["AI_GATEWAY_API_KEY"]),- scope: readOptionalEnvironmentVariable("VERCEL_SCOPE"),- token: readRequiredEnvironmentVariable("VERCEL_TOKEN"),- });- }, 20 * 60_000);-- afterAll(async () => {- await deploymentFixture?.cleanup();- deploymentFixture = undefined;- });-- it(- "releases a stable continuation token before the next message starts",- async () => {- const deploymentUrl = deploymentFixture?.deploymentUrl;- if (deploymentUrl === undefined) {- throw new Error("Expected Vercel deployment fixture to be initialized.");- }-- const threadId = `thread-${crypto.randomUUID()}`;- const first = await postJson(deploymentUrl, `/session-reset/${threadId}/messages`, {- message: "Write a detailed 1,000-word explanation of test isolation.",- });- const firstSessionId = requireString(first, "sessionId");-- await expect(waitForOwner(deploymentUrl, threadId, "present")).resolves.toBe(firstSessionId);-- const reset = await postJson(deploymentUrl, `/session-reset/${threadId}/new`);- expect(reset).toEqual({ previousSessionId: firstSessionId, status: "reset" });-- await expect(waitForOwner(deploymentUrl, threadId, "absent")).resolves.toBeNull();-- const second = await postJson(deploymentUrl, `/session-reset/${threadId}/messages`, {- message: "Give another concise greeting.",- });- expect(requireString(second, "sessionId")).not.toBe(firstSessionId);- },- 5 * 60_000,- );-});--async function postJson(- deploymentUrl: string,- path: string,- body?: unknown,-): Promise<Record<string, unknown>> {- const response = await fetch(new URL(path, deploymentUrl), {- ...(body === undefined- ? {}- : { body: JSON.stringify(body), headers: { "content-type": "application/json" } }),- method: "POST",- });-- if (!response.ok) {- throw new Error(await response.text());- }-- const value: unknown = await response.json();- if (value === null || typeof value !== "object" || Array.isArray(value)) {- throw new Error("Expected the channel route to return a JSON object.");- }- return value as Record<string, unknown>;-}--async function waitForOwner(- deploymentUrl: string,- threadId: string,- expected: "absent" | "present",-): Promise<string | null> {- const deadline = Date.now() + 30_000;-- while (Date.now() < deadline) {- const response = await postJson(deploymentUrl, `/session-reset/${threadId}/owner`);- const sessionId = response.sessionId;- const owner = typeof sessionId === "string" ? sessionId : null;-- if ((expected === "present" && owner !== null) || (expected === "absent" && owner === null)) {- return owner;- }-- await new Promise((resolve) => setTimeout(resolve, 100));- }-- throw new Error(`Timed out waiting for the continuation token owner to become ${expected}.`);-}--function requireString(value: Record<string, unknown>, key: string): string {- const field = value[key];- if (typeof field !== "string" || field.length === 0) {- throw new Error(`Expected response field ${key} to be a non-empty string.`);- }- return field;-}--function collectDeploymentEnvironment(names: readonly string[]): Record<string, string> {- const environment: Record<string, string> = {};-- for (const name of names) {- const value = readOptionalEnvironmentVariable(name);- if (value !== undefined) {- environment[name] = value;- }- }-- return environment;-}--function hasEnvironmentVariable(name: string): boolean {- return readOptionalEnvironmentVariable(name) !== undefined;-}--function readOptionalEnvironmentVariable(name: string): string | undefined {- const value = process.env[name]?.trim();- return value === undefined || value.length === 0 ? undefined : value;-}--function readRequiredEnvironmentVariable(name: string): string {- const value = readOptionalEnvironmentVariable(name);- if (value === undefined) {- throw new Error(`Missing required environment variable: ${name}`);- }- return value;-}diff --git a/packages/eve/test/vercel/vercel-sandbox-bundling.vercel.test.ts b/packages/eve/test/vercel/vercel-sandbox-bundling.vercel.test.tsdeleted file mode 100644index 329b0252e..000000000--- a/packages/eve/test/vercel/vercel-sandbox-bundling.vercel.test.ts+++ /dev/null@@ -1,126 +0,0 @@-import { afterAll, beforeAll, describe, it } from "vitest";-import { SANDBOX_BUNDLING_DESCRIPTOR } from "../../src/internal/testing/scenario-apps/sandbox-bundling.js";-import type { MessageStreamEvent } from "../../src/protocol/message.js";-import { sendDevelopmentMessage } from "../dev-client-harness/send-message.js";-import { createDevelopmentSessionState } from "../dev-client-harness/session.js";-import {- createTarballVercelDeploymentFixture,- type TarballVercelDeploymentFixture,-} from "../helpers/vercel-deployment-fixture.js";--const REQUIRED_VERCEL_ENV_NAMES = ["VERCEL_TOKEN", "VERCEL_ORG_ID", "VERCEL_PROJECT_ID"] as const;-const missingEnvironmentVariables = REQUIRED_VERCEL_ENV_NAMES.filter(- (name) => !hasEnvironmentVariable(name),-);--if (missingEnvironmentVariables.length > 0) {- throw new Error(- [- "Missing required environment variables for sandbox-bundling Vercel deployment tests.",- `Set: ${missingEnvironmentVariables.join(", ")}`,- ].join("\n"),- );-}--describe.sequential("sandbox-bundling Vercel deployment integration", () => {- let deploymentFixture: TarballVercelDeploymentFixture | undefined;-- beforeAll(async () => {- deploymentFixture = await createTarballVercelDeploymentFixture({- descriptor: SANDBOX_BUNDLING_DESCRIPTOR,- orgId: readRequiredEnvironmentVariable("VERCEL_ORG_ID"),- prefix: "eve-vercel-sandbox-bundling-",- projectId: readRequiredEnvironmentVariable("VERCEL_PROJECT_ID"),- runtimeEnv: collectDeploymentEnvironment(["AI_GATEWAY_API_KEY"]),- scope: readOptionalEnvironmentVariable("VERCEL_SCOPE"),- token: readRequiredEnvironmentVariable("VERCEL_TOKEN"),- });- }, 20 * 60_000);-- afterAll(async () => {- await deploymentFixture?.cleanup();- deploymentFixture = undefined;- });-- it(- "responds to a basic message after the framework bundle loads",- async () => {- // Reaching this point already proves the deployed function evaluated- // its top-level module graph without crashing: the hosted bundle must- // prune the local sandbox providers (Docker engine + optional just-bash- // engine) via the sandbox execution-adapter plugin and resolve the Vercel- // provider's vendored `@vercel/sandbox` chunk. The end-to-end message- // round-trip then confirms the framework runtime path is wired up and- // the response stream completes.- if (deploymentFixture === undefined) {- throw new Error("Expected Vercel deployment fixture to be initialized.");- }-- const response = await sendDevelopmentMessage({- message: "Reply with the single word: ready.",- serverUrl: deploymentFixture.deploymentUrl,- session: createDevelopmentSessionState(),- });-- expectAtLeastOneAssistantTextEvent(response.events);- },- 5 * 60_000,- );-});--function expectAtLeastOneAssistantTextEvent(events: readonly MessageStreamEvent[]): void {- for (const event of events) {- if (- event.type === "message.completed" &&- event.data.message !== null &&- event.data.message.trim().length > 0- ) {- return;- }- }-- throw new Error(- [- "Expected at least one message.completed stream event with assistant text from the deployed agent.",- `Observed: ${events.map((event) => event.type).join(", ")}`,- ].join("\n"),- );-}--function collectDeploymentEnvironment(names: readonly string[]): Record<string, string> {- const environment: Record<string, string> = {};-- for (const name of names) {- const value = readOptionalEnvironmentVariable(name);-- if (value !== undefined) {- environment[name] = value;- }- }-- return environment;-}--function hasEnvironmentVariable(name: string): boolean {- return readOptionalEnvironmentVariable(name) !== undefined;-}--function readOptionalEnvironmentVariable(name: string): string | undefined {- const value = process.env[name]?.trim();-- if (value === undefined || value.length === 0) {- return undefined;- }-- return value;-}--function readRequiredEnvironmentVariable(name: string): string {- const value = readOptionalEnvironmentVariable(name);-- if (value === undefined) {- throw new Error(`Missing required environment variable: ${name}`);- }-- return value;-}diff --git a/packages/eve/test/vercel/vercel-verbose-bundling.vercel.test.ts b/packages/eve/test/vercel/vercel-verbose-bundling.vercel.test.tsdeleted file mode 100644index b3c884e72..000000000--- a/packages/eve/test/vercel/vercel-verbose-bundling.vercel.test.ts+++ /dev/null@@ -1,179 +0,0 @@-import { afterAll, beforeAll, describe, it } from "vitest";-import { VERBOSE_BUNDLING_DESCRIPTOR } from "../../src/internal/testing/scenario-apps/verbose-bundling.js";-import type { MessageStreamEvent } from "../../src/protocol/message.js";-import type { RuntimeToolResultActionResult } from "../../src/shared/action-types.js";-import { sendDevelopmentMessage } from "../dev-client-harness/send-message.js";-import { createDevelopmentSessionState } from "../dev-client-harness/session.js";-import {- createTarballVercelDeploymentFixture,- type TarballVercelDeploymentFixture,-} from "../helpers/vercel-deployment-fixture.js";-const REQUIRED_VERCEL_ENV_NAMES = ["VERCEL_TOKEN", "VERCEL_ORG_ID", "VERCEL_PROJECT_ID"] as const;-const missingEnvironmentVariables = REQUIRED_VERCEL_ENV_NAMES.filter(- (name) => !hasEnvironmentVariable(name),-);--if (missingEnvironmentVariables.length > 0) {- throw new Error(- [- "Missing required environment variables for verbose-bundling Vercel deployment tests.",- `Set: ${missingEnvironmentVariables.join(", ")}`,- ].join("\n"),- );-}--describe.sequential("verbose-bundling Vercel deployment integration", () => {- let deploymentFixture: TarballVercelDeploymentFixture | undefined;-- beforeAll(async () => {- deploymentFixture = await createTarballVercelDeploymentFixture({- descriptor: VERBOSE_BUNDLING_DESCRIPTOR,- orgId: readRequiredEnvironmentVariable("VERCEL_ORG_ID"),- prefix: "eve-vercel-verbose-bundling-",- projectId: readRequiredEnvironmentVariable("VERCEL_PROJECT_ID"),- runtimeEnv: collectDeploymentEnvironment(["AI_GATEWAY_API_KEY"]),- scope: readOptionalEnvironmentVariable("VERCEL_SCOPE"),- token: readRequiredEnvironmentVariable("VERCEL_TOKEN"),- });- }, 20 * 60_000);-- afterAll(async () => {- await deploymentFixture?.cleanup();- deploymentFixture = undefined;- });-- it(- "executes the snowflake inspection tool",- async () => {- const output = await sendToolMessageAndCollectResult({- deploymentFixture,- message:- 'Call exactly one tool named "inspect_snowflake_module" with no arguments. Do not call any other tools.',- toolName: "inspect_snowflake_module",- });- expectToolOutput(output, "inspect_snowflake_module output");- },- 5 * 60_000,- );-- it(- "executes the alias path tool",- async () => {- const output = await sendToolMessageAndCollectResult({- deploymentFixture,- message:- 'Call exactly one tool named "check_alias_paths" with no arguments. Do not call any other tools.',- toolName: "check_alias_paths",- });- expectToolOutput(output, "check_alias_paths output");- },- 5 * 60_000,- );-});--async function sendToolMessageAndCollectResult(input: {- readonly deploymentFixture: TarballVercelDeploymentFixture | undefined;- readonly message: string;- readonly toolName: string;-}): Promise<unknown> {- const deploymentFixture = input.deploymentFixture;-- if (deploymentFixture === undefined) {- throw new Error("Expected Vercel deployment fixture to be initialized.");- }-- const response = await sendDevelopmentMessage({- message: input.message,- serverUrl: deploymentFixture.deploymentUrl,- session: createDevelopmentSessionState(),- });- const toolResult = extractToolResult(response.events, input.toolName);-- if (toolResult === undefined) {- throw new Error(- [- `Expected a tool-result for "${input.toolName}".`,- `Observed stream events: ${response.events.map((event) => event.type).join(", ")}`,- ].join("\n"),- );- }-- if (toolResult.isError === true) {- throw new Error(- `Tool "${input.toolName}" returned an error result: ${JSON.stringify(toolResult.output)}`,- );- }-- return toolResult.output;-}--function extractToolResult(- events: readonly MessageStreamEvent[],- toolName: string,-): RuntimeToolResultActionResult | undefined {- for (const event of events) {- if (event.type !== "action.result") {- continue;- }-- if (event.data.result.kind !== "tool-result") {- continue;- }-- if (event.data.result.toolName !== toolName) {- continue;- }-- return event.data.result;- }-- return undefined;-}--function expectToolOutput(value: unknown, label: string): void {- if (value === undefined || value === null) {- throw new Error(`Expected ${label} to be present.`);- }-- if (typeof value === "string" && value.trim().length === 0) {- throw new Error(`Expected ${label} to be non-empty.`);- }-}--function collectDeploymentEnvironment(names: readonly string[]): Record<string, string> {- const environment: Record<string, string> = {};-- for (const name of names) {- const value = readOptionalEnvironmentVariable(name);-- if (value !== undefined) {- environment[name] = value;- }- }-- return environment;-}--function hasEnvironmentVariable(name: string): boolean {- return readOptionalEnvironmentVariable(name) !== undefined;-}--function readOptionalEnvironmentVariable(name: string): string | undefined {- const value = process.env[name]?.trim();-- if (value === undefined || value.length === 0) {- return undefined;- }-- return value;-}--function readRequiredEnvironmentVariable(name: string): string {- const value = readOptionalEnvironmentVariable(name);-- if (value === undefined) {- throw new Error(`Missing required environment variable: ${name}`);- }-- return value;-}diff --git a/packages/eve/vitest.dev-server.config.ts b/packages/eve/vitest.dev-server.config.tsdeleted file mode 100644index 2dbf30ee7..000000000--- a/packages/eve/vitest.dev-server.config.ts+++ /dev/null@@ -1,31 +0,0 @@-import { fileURLToPath } from "node:url";--import { defineConfig } from "vitest/config";--export default defineConfig({- resolve: {- alias: [- {- find: /^#compiled\/(.+)\.js$/,- replacement: fileURLToPath(new URL("./.generated/compiled/$1.js", import.meta.url)),- },- {- find: /^#(.+)\.js$/,- replacement: fileURLToPath(new URL("./src/$1.ts", import.meta.url)),- },- ],- },- test: {- environment: "node",- exclude: ["**/node_modules/**", "test/vercel/**"],- globalSetup: ["./test/setup/pack-scenario-tarball.ts"],- include: [- "test/scenarios/dev-server-apps.scenario.test.ts",- "test/scenarios/dev-server-connections.scenario.test.ts",- "test/scenarios/dev-server-rebuild.scenario.test.ts",- "test/scenarios/dev-server-workflow-generations.scenario.test.ts",- ],- setupFiles: ["./test/setup/mock-ai-gateway.ts"],- testTimeout: 360_000,- },-});diff --git a/packages/eve/vitest.framework-fixtures.config.ts b/packages/eve/vitest.framework-fixtures.config.tsnew file mode 100644index 000000000..6ad41fe44--- /dev/null+++ b/packages/eve/vitest.framework-fixtures.config.ts@@ -0,0 +1,28 @@+import { defineConfig } from "vitest/config";++/**+ * Framework fixture smoke builds.+ *+ * Builds the example apps under `apps/frameworks` against the workspace eve+ * dist. These run in their own CI job, apart from the scenario tier, and+ * require a prebuilt workspace (`pnpm build`).+ */+export default defineConfig({+ resolve: {+ alias: [+ {+ find: /^#compiled\/(.+)\.js$/,+ replacement: new URL("./.generated/compiled/$1.js", import.meta.url).pathname,+ },+ {+ find: /^#(.+)\.js$/,+ replacement: new URL("./src/$1.ts", import.meta.url).pathname,+ },+ ],+ },+ test: {+ environment: "node",+ include: ["test/framework-fixtures/**/*.test.ts"],+ testTimeout: 300_000,+ },+});diff --git a/packages/eve/vitest.integration.config.ts b/packages/eve/vitest.integration.config.tsindex 59504bdae..8695edf59 100644--- a/packages/eve/vitest.integration.config.ts+++ b/packages/eve/vitest.integration.config.ts@@ -32,7 +32,7 @@ export default defineConfig({},test: {environment: "node",- exclude: ["**/node_modules/**", "test/scenarios/**", "test/vercel/**"],+ exclude: ["**/node_modules/**", "test/scenarios/**"],globalSetup: ["./test/setup/clear-workflow-cache.ts"],include: ["src/**/*.integration.test.ts", "test/**/*.integration.test.ts"],setupFiles: ["./test/setup/mock-ai-gateway.ts"],diff --git a/packages/eve/vitest.scenario.config.ts b/packages/eve/vitest.scenario.config.tsindex 08aaefcb0..2f8bdf082 100644--- a/packages/eve/vitest.scenario.config.ts+++ b/packages/eve/vitest.scenario.config.ts@@ -36,7 +36,7 @@ export default defineConfig({},test: {environment: "node",- exclude: ["**/node_modules/**", "test/vercel/**"],+ exclude: ["**/node_modules/**"],globalSetup: ["./test/setup/pack-scenario-tarball.ts"],include: ["src/**/*.scenario.test.ts", "test/scenarios/**/*.scenario.test.ts"],// Subprocess-heavy files (dev servers, real builds, installs) fan outdiff --git a/packages/eve/vitest.unit.config.ts b/packages/eve/vitest.unit.config.tsindex aed1a7bb0..a330cfb56 100644--- a/packages/eve/vitest.unit.config.ts+++ b/packages/eve/vitest.unit.config.ts@@ -34,8 +34,8 @@ export default defineConfig({"src/**/*.integration.test.ts","src/**/*.scenario.test.ts","test/**/*.integration.test.ts",+ "test/framework-fixtures/**","test/scenarios/**",- "test/vercel/**",],include: ["src/**/*.test.ts", "test/**/*.test.ts"],setupFiles: ["./src/internal/testing/unit-guard.ts", "./test/setup/mock-ai-gateway.ts"],diff --git a/packages/eve/vitest.vercel.config.ts b/packages/eve/vitest.vercel.config.tsdeleted file mode 100644index 2d0a7b430..000000000--- a/packages/eve/vitest.vercel.config.ts+++ /dev/null@@ -1,36 +0,0 @@-import { defineConfig } from "vitest/config";--/**- * Tier 3 — Vercel deployment tests.- *- * Tests that deploy to real infrastructure (Vercel) and exercise the public- * shape of eve from outside the repository. These are the slowest and most- * externally dependent tests in the suite. They run sequentially and are- * expected to be gated by credentials provided from CI secrets.- */-export default defineConfig({- resolve: {- alias: [- {- find: /^#compiled\/(.+)\.js$/,- replacement: new URL("./.generated/compiled/$1.js", import.meta.url).pathname,- },- {- find: /^#(.+)\.js$/,- replacement: new URL("./src/$1.ts", import.meta.url).pathname,- },- ],- },- test: {- environment: "node",- exclude: ["**/node_modules/**"],- fileParallelism: false,- globalSetup: ["./test/setup/pack-scenario-tarball.ts"],- include: ["test/vercel/**/*.vercel.test.ts"],- sequence: {- concurrent: false,- },- setupFiles: ["./test/setup/mock-ai-gateway.ts"],- testTimeout: 30 * 60_000,- },-});diff --git a/scripts/guard-invariants-baseline.json b/scripts/guard-invariants-baseline.jsonindex 570b8be79..43e9e5eec 100644--- a/scripts/guard-invariants-baseline.json+++ b/scripts/guard-invariants-baseline.json@@ -10,21 +10,13 @@],"rule21_authoredNameAllowlist": [],"rule23_unknownCastByFile": {- "apps/docs/components/geistdocs/code-block.tsx": 1,"packages/eve/src/channel/adapter-context.ts": 1,"packages/eve/src/compiler/manifest.ts": 1,"packages/eve/src/evals/runner/reporters/braintrust.ts": 1,- "packages/eve/src/execution/await-authorization-orchestrator.test.ts": 1,- "packages/eve/src/execution/connection-auth-steps.ts": 1,"packages/eve/src/execution/node-step.test.ts": 4,- "packages/eve/src/execution/workflow-entry.integration.test.ts": 1,- "packages/eve/src/execution/workflow-entry.ts": 1,"packages/eve/src/harness/prompt-cache.test.ts": 6,"packages/eve/src/harness/tool-loop-compaction-accounting.test.ts": 2,"packages/eve/src/harness/tool-loop.test.ts": 16,- "packages/eve/src/harness/tool-result-pruning.ts": 1,- "packages/eve/src/internal/authored-definition/sandbox.ts": 1,- "packages/eve/src/internal/json-schema.ts": 1,"packages/eve/src/internal/nitro/host/build-application.scenario.test.ts": 2,"packages/eve/src/internal/nitro/host/create-application-nitro.scenario.test.ts": 2,"packages/eve/src/internal/nitro/host/cron-handler-route.test.ts": 1,@@ -43,7 +35,6 @@"packages/eve/src/runtime/sessions/runtime-session.ts","packages/eve/src/context/accessors.integration.test.ts","packages/eve/src/execution/harness-tool-execution.integration.test.ts",- "packages/eve/src/execution/session-start.scenario.test.ts","packages/eve/src/internal/nitro/routes/runtime-artifacts.test.ts","packages/eve/test/scenarios/load-agent-info-data.scenario.test.ts","packages/eve/test/scenarios/runtime-loaders.scenario.test.ts"diff --git a/scripts/guard-invariants.mjs b/scripts/guard-invariants.mjsindex 86c1dc12e..cfef01076 100644--- a/scripts/guard-invariants.mjs+++ b/scripts/guard-invariants.mjs@@ -16,10 +16,6 @@* rule 13 — No spread-ternary object composition* (`...(c ? {} : { k: v })`). (Rationale: hard to read, easy* to mistype; declare the object then assign optional keys.)- * rule 15 — No `@workflow/*` imports inside `src/channel/**`,- * `src/harness/**`, or `src/tracing/**`. Channels, harnesses,- * and tracing must stay workflow-agnostic — only- * runtime/execution code touches workflow primitives.* rule 19 — No `new AsyncLocalStorage()` outside the two allowlisted* files. All ambient runtime state flows through a single* `EveContext`.@@ -197,7 +193,6 @@ function isTsLike(relPath) {** @param {{* rule13: { baseline: Record<string, number>; current: Map<string, number> };- * rule15: Violation[];* rule19: { allowlist: Set<string>; current: Set<string>; lines: Map<string, number> };* rule21: { allowlist: Set<string>; violations: Violation[] };* rule23: { baseline: Record<string, number>; current: Map<string, number> };@@ -229,7 +224,6 @@ async function scanRepo(state) {const lines = content.split(/\r?\n/);checkRule13(posix, lines, state.rule13);- checkRule15(posix, lines, state.rule15);checkRule19(posix, lines, state.rule19);checkRule21(posix, lines, state.rule21.allowlist, state.rule21.violations);checkRule23(posix, lines, state.rule23);@@ -357,40 +351,6 @@ function checkRule13(posix, lines, state) {if (count > 0) state.current.set(posix, count);}-// ---------- Rule 15: workflow primitives outside runtime/execution ------------const WORKFLOW_IMPORT_RE = /from ["']@workflow\b/;--/**- * @param {string} posix- */-function isChannelOrHarness(posix) {- return (- posix.startsWith("packages/eve/src/channel/") ||- posix.startsWith("packages/eve/src/harness/") ||- posix.startsWith("packages/eve/src/tracing/")- );-}--/**- * @param {string} posix- * @param {string[]} lines- * @param {Violation[]} violations- */-function checkRule15(posix, lines, violations) {- if (!isChannelOrHarness(posix)) return;- lines.forEach((line, idx) => {- if (WORKFLOW_IMPORT_RE.test(line)) {- violations.push({- rule: 15,- file: posix,- line: idx + 1,- message: `imports from "@workflow/*". Channel, harness, and tracing code must stay workflow-agnostic. Move the workflow primitive call into src/runtime/ or src/execution/ and have the caller use a thin runtime helper instead.`,- });- }- });-}-// ---------- Rule 33: namespaced Workflow runtime boundary ----------const RAW_WORKFLOW_RUNTIME_SPECIFIER_RE =@@ -1401,7 +1361,6 @@ async function main() {const state = {rule13: { baseline: baseline.rule13_spreadTernaryByFile, current: new Map() },- rule15: /** @type {Violation[]} */ ([]),rule19: {allowlist: new Set(baseline.rule19_asyncLocalStorageAllowlist),current: new Set(),@@ -1450,9 +1409,6 @@ async function main() {});}- // Rule 15- violations.push(...state.rule15);-// Rule 19for (const file of state.rule19.current) {if (state.rule19.allowlist.has(file)) continue;