eve 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -2
- package/README.md +11 -11
- package/bin/eve.d.ts +1 -1
- package/bin/eve.js +6 -6
- package/dist/src/channel/routes.d.ts +4 -4
- package/dist/src/channel/types.d.ts +2 -2
- package/dist/src/channel/websocket-upgrade-server.d.ts +3 -3
- package/dist/src/chunks/{use-eve-agent-CdETo3qQ.js → use-eve-agent-D9ZhQhyV.js} +2 -2
- package/dist/src/chunks/{use-eve-agent-ClyM-_UT.js → use-eve-agent-DFI0POM9.js} +2 -2
- package/dist/src/cli/banner.d.ts +1 -1
- package/dist/src/cli/banner.js +1 -1
- package/dist/src/cli/commands/channel-add-conflicts.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/deploy.js +1 -1
- package/dist/src/cli/commands/info.js +1 -1
- package/dist/src/cli/commands/init-agent-instructions.md +1 -1
- package/dist/src/cli/commands/init-git.js +1 -1
- package/dist/src/cli/commands/init.d.ts +1 -1
- package/dist/src/cli/commands/link.js +1 -1
- package/dist/src/cli/commands/preconditions.d.ts +2 -2
- package/dist/src/cli/commands/preconditions.js +1 -1
- package/dist/src/cli/dev/environment.d.ts +1 -1
- package/dist/src/cli/dev/tui/runner.js +1 -1
- package/dist/src/cli/dev/tui/setup-issues.d.ts +2 -0
- package/dist/src/cli/dev/tui/setup-issues.js +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +2 -2
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tui.d.ts +1 -1
- package/dist/src/cli/dev/url.d.ts +1 -1
- package/dist/src/cli/run.d.ts +1 -1
- package/dist/src/cli/run.js +2 -2
- package/dist/src/cli/ui/output.d.ts +1 -1
- package/dist/src/client/client-error.d.ts +1 -1
- package/dist/src/client/client.d.ts +3 -3
- package/dist/src/client/eve-agent-store.d.ts +1 -1
- package/dist/src/client/eve-agent-store.js +1 -1
- package/dist/src/client/message-reducer-types.d.ts +3 -3
- package/dist/src/client/message-reducer.d.ts +3 -3
- package/dist/src/client/output-schema.d.ts +1 -1
- package/dist/src/client/reducer.d.ts +5 -5
- package/dist/src/client/session.d.ts +1 -1
- package/dist/src/client/types.d.ts +1 -1
- package/dist/src/client/url.d.ts +2 -2
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiled/@vercel/detect-agent/index.d.ts +1 -1
- package/dist/src/compiler/channel-instrumentation-types.js +1 -1
- package/dist/src/compiler/model-catalog.d.ts +1 -1
- package/dist/src/compiler/module-map.js +1 -1
- package/dist/src/compiler/normalize-agent-config.js +1 -1
- package/dist/src/compiler/normalize-channel.js +1 -1
- package/dist/src/compiler/normalize-connection.js +1 -1
- package/dist/src/compiler/normalize-instructions.js +1 -1
- package/dist/src/compiler/normalize-sandbox.js +1 -1
- package/dist/src/compiler/normalize-schedule.js +1 -1
- package/dist/src/compiler/normalize-skill.js +1 -1
- package/dist/src/compiler/normalize-subagent.js +1 -1
- package/dist/src/compiler/normalize-tool.js +1 -1
- package/dist/src/compiler/workspace-resources.js +1 -1
- package/dist/src/context/build-callback-context.js +1 -1
- package/dist/src/context/container.d.ts +4 -4
- package/dist/src/context/container.js +1 -1
- package/dist/src/discover/diagnostics.d.ts +1 -1
- package/dist/src/discover/project.d.ts +2 -2
- package/dist/src/discover/project.js +1 -1
- package/dist/src/evals/cli/eval-client.d.ts +1 -1
- package/dist/src/evals/define-eval.d.ts +1 -1
- package/dist/src/evals/runner/execute-eval.d.ts +1 -1
- package/dist/src/evals/runner/execute-task.d.ts +1 -1
- package/dist/src/evals/types.d.ts +6 -6
- package/dist/src/execution/durable-session-migrations/chain.js +1 -1
- package/dist/src/execution/sandbox/bash-tool.js +1 -1
- package/dist/src/execution/sandbox/bindings/docker-options.d.ts +1 -1
- package/dist/src/execution/sandbox/bindings/just-bash-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/microsandbox-runtime.js +1 -1
- package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
- package/dist/src/execution/sandbox/development-prewarm.js +1 -1
- package/dist/src/execution/sandbox/ensure.js +1 -1
- package/dist/src/execution/sandbox/prewarm.js +1 -1
- package/dist/src/execution/session-callback-step.d.ts +1 -1
- package/dist/src/harness/attachment-staging.js +1 -1
- package/dist/src/harness/code-mode-lifecycle.d.ts +1 -1
- package/dist/src/harness/emission.d.ts +1 -1
- package/dist/src/harness/runtime-actions.d.ts +1 -1
- package/dist/src/internal/application/cache-metadata.d.ts +2 -2
- package/dist/src/internal/application/compiled-artifacts.js +2 -2
- package/dist/src/internal/application/package.d.ts +7 -7
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-module-bundle.js +1 -1
- package/dist/src/internal/helpers/markdown.js +1 -1
- package/dist/src/internal/instrumentation.d.ts +1 -1
- package/dist/src/internal/nitro/host/build-application.d.ts +1 -1
- package/dist/src/internal/nitro/host/channel-routes.d.ts +3 -3
- package/dist/src/internal/nitro/host/configure-nitro-routes.d.ts +1 -1
- package/dist/src/internal/nitro/host/configure-nitro-routes.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.d.ts +1 -1
- package/dist/src/internal/nitro/host/cron-handler-route.d.ts +3 -3
- package/dist/src/internal/nitro/host/nitro-bundler-config.d.ts +1 -1
- package/dist/src/internal/nitro/host/optional-engine-dependency-plugin.d.ts +2 -2
- package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +2 -2
- package/dist/src/internal/nitro/host/start-development-server.d.ts +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +1 -1
- package/dist/src/internal/nitro/host/start-production-server.d.ts +1 -1
- package/dist/src/internal/nitro/host/start-production-server.js +2 -2
- package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -1
- package/dist/src/internal/nitro/routes/health.d.ts +1 -1
- package/dist/src/internal/nitro/routes/info.d.ts +1 -1
- package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/routes/schedule-task.d.ts +1 -1
- package/dist/src/internal/package-name.d.ts +1 -1
- package/dist/src/internal/vercel-agent-summary.d.ts +6 -6
- package/dist/src/internal/workflow/builtins.d.ts +3 -3
- package/dist/src/internal/workflow-bundle/nitro-step-entry.js +1 -1
- package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +7 -7
- package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +4 -4
- package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -1
- package/dist/src/packages/eve-catalog/src/index.js +1 -1
- package/dist/src/protocol/message.d.ts +2 -2
- package/dist/src/protocol/routes.d.ts +3 -3
- package/dist/src/public/agents/auth.d.ts +1 -1
- package/dist/src/public/channels/auth.d.ts +1 -1
- package/dist/src/public/channels/discord/api.d.ts +2 -2
- package/dist/src/public/channels/discord/discordChannel.d.ts +2 -2
- package/dist/src/public/channels/discord/hitl.d.ts +4 -4
- package/dist/src/public/channels/discord/verify.d.ts +1 -1
- package/dist/src/public/channels/eve.d.ts +5 -5
- package/dist/src/public/channels/github/api.d.ts +1 -1
- package/dist/src/public/channels/github/defaults.d.ts +1 -1
- package/dist/src/public/channels/github/inbound.d.ts +1 -1
- package/dist/src/public/channels/index.d.ts +2 -2
- package/dist/src/public/channels/linear/auth.d.ts +1 -1
- package/dist/src/public/channels/linear/hitl.d.ts +4 -4
- package/dist/src/public/channels/linear/inbound.d.ts +1 -1
- package/dist/src/public/channels/linear/verify.d.ts +1 -1
- package/dist/src/public/channels/slack/constants.d.ts +1 -1
- package/dist/src/public/channels/teams/api.d.ts +4 -4
- package/dist/src/public/channels/teams/hitl.d.ts +4 -4
- package/dist/src/public/channels/teams/limits.d.ts +3 -3
- package/dist/src/public/channels/teams/verify.d.ts +2 -2
- package/dist/src/public/channels/telegram/api.d.ts +1 -1
- package/dist/src/public/channels/telegram/hitl.d.ts +3 -3
- package/dist/src/public/channels/telegram/verify.d.ts +1 -1
- package/dist/src/public/channels/twilio/api.d.ts +1 -1
- package/dist/src/public/context/index.d.ts +1 -1
- package/dist/src/public/definitions/defineChannel.d.ts +2 -2
- package/dist/src/public/definitions/hook.d.ts +1 -1
- package/dist/src/public/definitions/remote-agent.d.ts +5 -5
- package/dist/src/public/definitions/sandbox.d.ts +1 -1
- package/dist/src/public/definitions/source.d.ts +2 -2
- package/dist/src/public/definitions/state.d.ts +2 -2
- package/dist/src/public/definitions/state.js +1 -1
- package/dist/src/public/instrumentation/index.d.ts +3 -3
- package/dist/src/public/next/index.d.ts +12 -12
- package/dist/src/public/next/index.js +1 -1
- package/dist/src/public/next/server.js +1 -1
- package/dist/src/public/next/vercel-output-config.js +1 -1
- package/dist/src/public/nuxt/dev-server.d.ts +2 -2
- package/dist/src/public/nuxt/dev-server.js +1 -1
- package/dist/src/public/nuxt/module.d.ts +10 -10
- package/dist/src/public/nuxt/routing.d.ts +6 -6
- package/dist/src/public/nuxt/routing.js +1 -1
- package/dist/src/public/nuxt/vercel-json.d.ts +2 -2
- package/dist/src/public/sandbox/backends/just-bash.d.ts +1 -1
- package/dist/src/public/sandbox/backends/microsandbox.d.ts +1 -1
- package/dist/src/public/sandbox/backends/vercel.d.ts +1 -1
- package/dist/src/public/sandbox/docker-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/just-bash-sandbox.d.ts +1 -1
- package/dist/src/public/sandbox/microsandbox-sandbox.d.ts +3 -3
- package/dist/src/public/sandbox/vercel-sandbox.d.ts +2 -2
- package/dist/src/public/sveltekit/dev-server.d.ts +2 -2
- package/dist/src/public/sveltekit/dev-server.js +1 -1
- package/dist/src/public/sveltekit/index.d.ts +11 -11
- package/dist/src/public/sveltekit/routing.d.ts +5 -5
- package/dist/src/public/sveltekit/routing.js +1 -1
- package/dist/src/public/sveltekit/vercel-json.d.ts +2 -2
- package/dist/src/public/tool-result-narrowing.js +1 -1
- package/dist/src/public/types/json.d.ts +1 -1
- package/dist/src/react/use-eve-agent.d.ts +8 -8
- package/dist/src/runtime/agent/bootstrap-model.js +1 -1
- package/dist/src/runtime/agent/bootstrap.d.ts +1 -1
- package/dist/src/runtime/agent/bootstrap.js +1 -1
- package/dist/src/runtime/agent/mock-model-adapter.js +1 -1
- package/dist/src/runtime/agent/resolve-model.js +1 -1
- package/dist/src/runtime/attributes/emit.d.ts +2 -2
- package/dist/src/runtime/connections/callback-route.d.ts +1 -1
- package/dist/src/runtime/connections/principal.js +1 -1
- package/dist/src/runtime/connections/scoped-authorization.d.ts +1 -1
- package/dist/src/runtime/connections/types.d.ts +4 -4
- package/dist/src/runtime/framework-tools/final-output.d.ts +1 -1
- package/dist/src/runtime/governance/auth/http-basic.d.ts +1 -1
- package/dist/src/runtime/governance/auth/token-claims.d.ts +1 -1
- package/dist/src/runtime/governance/auth/types.d.ts +1 -1
- package/dist/src/runtime/loaders/artifact-paths.d.ts +1 -1
- package/dist/src/runtime/loaders/compile-metadata.js +1 -1
- package/dist/src/runtime/loaders/manifest.js +1 -1
- package/dist/src/runtime/loaders/module-map.js +1 -1
- package/dist/src/runtime/prompt/compose.js +1 -1
- package/dist/src/runtime/resolve-channel.js +1 -1
- package/dist/src/runtime/schedules/register.js +1 -1
- package/dist/src/runtime/sessions/auth.d.ts +1 -1
- package/dist/src/runtime/sessions/runtime-session.d.ts +1 -1
- package/dist/src/runtime/types.d.ts +1 -1
- package/dist/src/runtime/workspace/types.d.ts +1 -1
- package/dist/src/services/dev-client/request-headers.d.ts +2 -2
- package/dist/src/services/dev-client/vercel-auth-error.d.ts +1 -1
- package/dist/src/services/inspect-application.d.ts +1 -1
- package/dist/src/setup/boxes/add-channels.d.ts +1 -1
- package/dist/src/setup/boxes/add-channels.js +1 -1
- package/dist/src/setup/boxes/deploy-project.js +1 -1
- package/dist/src/setup/boxes/resolve-target.d.ts +2 -2
- package/dist/src/setup/boxes/scaffold.d.ts +4 -4
- package/dist/src/setup/boxes/scaffold.js +1 -1
- package/dist/src/setup/channel-add-conflicts.js +1 -1
- package/dist/src/setup/cli/rail-log.d.ts +1 -1
- package/dist/src/setup/flows/model.d.ts +3 -5
- package/dist/src/setup/flows/model.js +1 -1
- package/dist/src/setup/node-engine.d.ts +5 -5
- package/dist/src/setup/node-engine.js +1 -1
- package/dist/src/setup/onboarding.d.ts +2 -2
- package/dist/src/setup/primitives/open-url.d.ts +1 -1
- package/dist/src/setup/primitives/pm/pnpm.js +1 -1
- package/dist/src/setup/primitives/pm/run.d.ts +1 -1
- package/dist/src/setup/primitives/pm/types.d.ts +1 -1
- package/dist/src/setup/scaffold/connections/catalog.d.ts +1 -1
- package/dist/src/setup/scaffold/create/add-to-project.d.ts +2 -2
- package/dist/src/setup/scaffold/create/add-to-project.js +1 -1
- package/dist/src/setup/scaffold/create/project.d.ts +5 -5
- package/dist/src/setup/scaffold/create/project.js +3 -3
- package/dist/src/setup/scaffold/create/web-template.d.ts +2 -2
- package/dist/src/setup/scaffold/create/web-template.js +2 -2
- package/dist/src/setup/scaffold/update/package-json.d.ts +1 -1
- package/dist/src/setup/slack-connect-lifecycle.d.ts +2 -2
- package/dist/src/setup/slack-connect-lifecycle.js +1 -1
- package/dist/src/setup/slackbot.d.ts +1 -1
- package/dist/src/setup/slackbot.js +1 -1
- package/dist/src/setup/validate-gateway-key.d.ts +1 -1
- package/dist/src/setup/vercel-project.js +1 -1
- package/dist/src/shared/agent-definition.d.ts +15 -15
- package/dist/src/shared/code-mode.d.ts +3 -3
- package/dist/src/shared/json-schema.d.ts +1 -1
- package/dist/src/shared/model-endpoint-status.d.ts +2 -2
- package/dist/src/shared/sandbox-backend.d.ts +4 -4
- package/dist/src/shared/sandbox-definition.d.ts +3 -3
- package/dist/src/shared/sandbox-network-policy.d.ts +1 -1
- package/dist/src/shared/sandbox-session.d.ts +2 -2
- package/dist/src/shared/skill-package.d.ts +1 -1
- package/dist/src/shared/skill-package.js +1 -1
- package/dist/src/shared/tool-definition.d.ts +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.d.ts +7 -7
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.d.ts +7 -7
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/README.md +10 -10
- package/docs/agent-config.md +2 -2
- package/docs/channels/custom.mdx +5 -5
- package/docs/channels/discord.mdx +3 -3
- package/docs/channels/eve.mdx +7 -7
- package/docs/channels/linear.mdx +6 -6
- package/docs/channels/overview.mdx +11 -11
- package/docs/channels/slack.mdx +4 -4
- package/docs/channels/teams.mdx +2 -2
- package/docs/channels/telegram.mdx +3 -3
- package/docs/channels/twilio.mdx +1 -1
- package/docs/concepts/context-control.md +5 -5
- package/docs/concepts/default-harness.md +2 -2
- package/docs/concepts/execution-model-and-durability.md +9 -9
- package/docs/concepts/security-model.md +9 -9
- package/docs/concepts/sessions-runs-and-streaming.md +3 -3
- package/docs/connections.mdx +11 -11
- package/docs/evals/judge.mdx +2 -2
- package/docs/evals/overview.mdx +2 -2
- package/docs/evals/reporters.mdx +2 -2
- package/docs/getting-started.mdx +10 -10
- package/docs/guides/auth-and-route-protection.md +6 -6
- package/docs/guides/client/continuations.mdx +3 -3
- package/docs/guides/client/output-schema.mdx +1 -1
- package/docs/guides/client/overview.mdx +5 -5
- package/docs/guides/client/streaming.mdx +1 -1
- package/docs/guides/deployment.md +7 -7
- package/docs/guides/dev-tui.md +2 -2
- package/docs/guides/frontend/nextjs.mdx +13 -13
- package/docs/guides/frontend/nuxt.mdx +7 -7
- package/docs/guides/frontend/overview.mdx +12 -12
- package/docs/guides/frontend/sveltekit.mdx +7 -7
- package/docs/guides/frontend/use-eve-agent-svelte.mdx +6 -6
- package/docs/guides/frontend/use-eve-agent-vue.mdx +6 -6
- package/docs/guides/hooks.md +2 -2
- package/docs/guides/instrumentation.md +12 -12
- package/docs/guides/remote-agents.md +4 -4
- package/docs/guides/session-context.md +4 -4
- package/docs/guides/state.md +1 -1
- package/docs/instructions.mdx +4 -4
- package/docs/introduction.mdx +12 -12
- package/docs/reference/cli.md +5 -5
- package/docs/reference/project-layout.md +4 -4
- package/docs/responsible-use.md +3 -3
- package/docs/sandbox.mdx +8 -8
- package/docs/schedules.mdx +1 -1
- package/docs/skills.mdx +4 -4
- package/docs/subagents.mdx +3 -3
- package/docs/tools/human-in-the-loop.md +10 -10
- package/docs/tools/overview.mdx +10 -10
- package/docs/tutorial/connect-a-warehouse.mdx +3 -3
- package/docs/tutorial/first-agent.mdx +2 -2
- package/docs/tutorial/how-it-runs.mdx +2 -2
- package/docs/tutorial/query-sample-data.mdx +1 -1
- package/docs/tutorial/ship-it.mdx +4 -4
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{joinRoutePrefix,normalizeOrigin}from"./routing.js";import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";import{resolvePackageRoot}from"#internal/application/package.js";import{join}from"node:path";import{spawn}from"node:child_process";import{mkdir,open,readFile,rm,stat,writeFile}from"node:fs/promises";const EVE_BASE_URL_ENV=`EVE_BASE_URL`,DEFAULT_SERVER_READY_TIMEOUT_MS=3e4,DEV_SERVER_REGISTRY_TIMEOUT_MS=3e4,LOCAL_SERVER_URL_PATTERN=/https?:\/\/(?:\[[^\]\s]+\]|[^\s/:[\]]+)(?::\d+)?/;function isNodeErrorWithCode(e,t){return e instanceof Error&&`code`in e&&e.code===t}function delay(e){return new Promise(t=>setTimeout(t,e))}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveEveCacheDirectory(e){return join(e,`.eve`)}function resolveEveDevServerRegistryPath(e){return join(resolveEveCacheDirectory(e),`nuxt-dev-server.json`)}function resolveEveDevServerLockPath(e){return join(resolveEveCacheDirectory(e),`nuxt-dev-server.lock`)}function normalizeDevServerRegistry(e){if(isRecord(e)&&!(typeof e.appRoot!=`string`||typeof e.origin!=`string`||typeof e.updatedAt!=`string`)&&!(e.pid!==null&&typeof e.pid!=`number`))try{return{appRoot:e.appRoot,origin:normalizeOrigin(e.origin),pid:e.pid,updatedAt:e.updatedAt}}catch{return}}async function isEveServerHealthy(t){let r=new AbortController,i=setTimeout(()=>r.abort(),1e3);try{return(await fetch(joinRoutePrefix(t,`${EVE_ROUTE_PREFIX}/health`),{signal:r.signal})).ok}catch{return!1}finally{clearTimeout(i)}}async function readUsableEveDevServerRegistry(e){try{let t=normalizeDevServerRegistry(JSON.parse(await readFile(resolveEveDevServerRegistryPath(e),`utf8`)));return t===void 0||t.appRoot!==e||!await isEveServerHealthy(t.origin)?void 0:t.origin}catch(e){if(isNodeErrorWithCode(e,`ENOENT`))return;throw e}}async function writeEveDevServerRegistry(e,t){await mkdir(resolveEveCacheDirectory(e),{recursive:!0}),await writeFile(resolveEveDevServerRegistryPath(e),`${JSON.stringify({appRoot:e,origin:t.origin,pid:t.process?.pid??null,updatedAt:new Date().toISOString()},null,2)}\n`)}async function removeStaleEveDevServerLock(e){try{let t=await stat(e);Date.now()-t.mtimeMs>3e4&&await rm(e,{force:!0})}catch(e){if(!isNodeErrorWithCode(e,`ENOENT`))throw e}}async function acquireEveDevServerLock(e){let t=resolveEveCacheDirectory(e),n=resolveEveDevServerLockPath(e),r=Date.now()+DEV_SERVER_REGISTRY_TIMEOUT_MS;for(await mkdir(t,{recursive:!0});;)try{let e=await open(n,`wx`);return await e.writeFile(`${String(process.pid)}\n`),await e.close(),async()=>{await rm(n,{force:!0})}}catch(t){if(!isNodeErrorWithCode(t,`EEXIST`))throw t;if(await readUsableEveDevServerRegistry(e)!==void 0)return async()=>{};if(await removeStaleEveDevServerLock(n),Date.now()>r)throw Error(`Timed out after ${DEV_SERVER_REGISTRY_TIMEOUT_MS}ms waiting for another Nuxt process to start
|
|
1
|
+
import{joinRoutePrefix,normalizeOrigin}from"./routing.js";import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";import{resolvePackageRoot}from"#internal/application/package.js";import{join}from"node:path";import{spawn}from"node:child_process";import{mkdir,open,readFile,rm,stat,writeFile}from"node:fs/promises";const EVE_BASE_URL_ENV=`EVE_BASE_URL`,DEFAULT_SERVER_READY_TIMEOUT_MS=3e4,DEV_SERVER_REGISTRY_TIMEOUT_MS=3e4,LOCAL_SERVER_URL_PATTERN=/https?:\/\/(?:\[[^\]\s]+\]|[^\s/:[\]]+)(?::\d+)?/;function isNodeErrorWithCode(e,t){return e instanceof Error&&`code`in e&&e.code===t}function delay(e){return new Promise(t=>setTimeout(t,e))}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveEveCacheDirectory(e){return join(e,`.eve`)}function resolveEveDevServerRegistryPath(e){return join(resolveEveCacheDirectory(e),`nuxt-dev-server.json`)}function resolveEveDevServerLockPath(e){return join(resolveEveCacheDirectory(e),`nuxt-dev-server.lock`)}function normalizeDevServerRegistry(e){if(isRecord(e)&&!(typeof e.appRoot!=`string`||typeof e.origin!=`string`||typeof e.updatedAt!=`string`)&&!(e.pid!==null&&typeof e.pid!=`number`))try{return{appRoot:e.appRoot,origin:normalizeOrigin(e.origin),pid:e.pid,updatedAt:e.updatedAt}}catch{return}}async function isEveServerHealthy(t){let r=new AbortController,i=setTimeout(()=>r.abort(),1e3);try{return(await fetch(joinRoutePrefix(t,`${EVE_ROUTE_PREFIX}/health`),{signal:r.signal})).ok}catch{return!1}finally{clearTimeout(i)}}async function readUsableEveDevServerRegistry(e){try{let t=normalizeDevServerRegistry(JSON.parse(await readFile(resolveEveDevServerRegistryPath(e),`utf8`)));return t===void 0||t.appRoot!==e||!await isEveServerHealthy(t.origin)?void 0:t.origin}catch(e){if(isNodeErrorWithCode(e,`ENOENT`))return;throw e}}async function writeEveDevServerRegistry(e,t){await mkdir(resolveEveCacheDirectory(e),{recursive:!0}),await writeFile(resolveEveDevServerRegistryPath(e),`${JSON.stringify({appRoot:e,origin:t.origin,pid:t.process?.pid??null,updatedAt:new Date().toISOString()},null,2)}\n`)}async function removeStaleEveDevServerLock(e){try{let t=await stat(e);Date.now()-t.mtimeMs>3e4&&await rm(e,{force:!0})}catch(e){if(!isNodeErrorWithCode(e,`ENOENT`))throw e}}async function acquireEveDevServerLock(e){let t=resolveEveCacheDirectory(e),n=resolveEveDevServerLockPath(e),r=Date.now()+DEV_SERVER_REGISTRY_TIMEOUT_MS;for(await mkdir(t,{recursive:!0});;)try{let e=await open(n,`wx`);return await e.writeFile(`${String(process.pid)}\n`),await e.close(),async()=>{await rm(n,{force:!0})}}catch(t){if(!isNodeErrorWithCode(t,`EEXIST`))throw t;if(await readUsableEveDevServerRegistry(e)!==void 0)return async()=>{};if(await removeStaleEveDevServerLock(n),Date.now()>r)throw Error(`Timed out after ${DEV_SERVER_REGISTRY_TIMEOUT_MS}ms waiting for another Nuxt process to start eve.`);await delay(100)}}function createEveBinaryPath(){return join(resolvePackageRoot(),`bin`,`eve.js`)}function startServerProcess(e){return new Promise((n,r)=>{let i=spawn(e.command,e.args,{cwd:e.cwd,env:{...process.env,...e.env},stdio:[`ignore`,`pipe`,`pipe`]}),a=setTimeout(()=>{i.kill(),r(Error(`Timed out after ${DEFAULT_SERVER_READY_TIMEOUT_MS}ms waiting for eve to print its server URL.`))},DEFAULT_SERVER_READY_TIMEOUT_MS),cleanup=()=>{clearTimeout(a),i.off(`error`,handleError),i.off(`exit`,handleEarlyExit)},handleError=e=>{cleanup(),r(e)},handleEarlyExit=(e,t)=>{cleanup(),r(Error(`eve server process exited before printing its server URL (code ${String(e)}, signal ${String(t)}).`))},o=!1,handleOutput=e=>{if(o)return;let r=LOCAL_SERVER_URL_PATTERN.exec(e.toString(`utf8`));r!==null&&(o=!0,cleanup(),n({origin:normalizeOrigin(r[0]),process:i}))};i.once(`error`,handleError),i.once(`exit`,handleEarlyExit),i.stdout.on(`data`,e=>{process.stdout.write(e),handleOutput(e)}),i.stderr.on(`data`,e=>{process.stderr.write(e),handleOutput(e)})})}function installProcessShutdown(e){let t=e.process;if(t===void 0)return e;let close=()=>{process.off(`beforeExit`,close),process.off(`exit`,close),t.killed||t.kill()};return process.once(`beforeExit`,close),process.once(`exit`,close),e}function startEveDevServer(e){return startServerProcess({args:[createEveBinaryPath(),`dev`,`--no-ui`,`--port`,`0`],command:process.execPath,cwd:e}).then(e=>(process.env[EVE_BASE_URL_ENV]=e.origin,installProcessShutdown(e)))}async function resolveSharedEveDevServer(e){let t=await readUsableEveDevServerRegistry(e);if(t!==void 0)return process.env[EVE_BASE_URL_ENV]=t,{origin:t};let n=await acquireEveDevServerLock(e);try{let t=await readUsableEveDevServerRegistry(e);if(t!==void 0)return process.env[EVE_BASE_URL_ENV]=t,{origin:t};let n=await startEveDevServer(e);return await writeEveDevServerRegistry(e,n),n}finally{await n()}}export{EVE_BASE_URL_ENV,normalizeDevServerRegistry,resolveSharedEveDevServer};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { EVE_NUXT_SERVICE_PREFIX } from "./routing.js";
|
|
2
2
|
export { EVE_NUXT_SERVICE_PREFIX };
|
|
3
3
|
/**
|
|
4
|
-
* Options for the
|
|
4
|
+
* Options for the eve Nuxt module.
|
|
5
5
|
*/
|
|
6
6
|
export interface EveNuxtModuleOptions {
|
|
7
7
|
/**
|
|
8
|
-
* Path to the
|
|
8
|
+
* Path to the eve application root, resolved relative to the Nuxt project
|
|
9
9
|
* root unless absolute. Defaults to the Nuxt project root. The dev server is
|
|
10
|
-
* spawned here and written as the
|
|
10
|
+
* spawned here and written as the eve service entrypoint in `vercel.json`
|
|
11
11
|
* (relative to the Nuxt root).
|
|
12
12
|
*/
|
|
13
13
|
eveRoot?: string;
|
|
14
14
|
/**
|
|
15
|
-
* Build command for the generated
|
|
15
|
+
* Build command for the generated eve Vercel service. Defaults to `"eve build"`.
|
|
16
16
|
*/
|
|
17
17
|
eveBuildCommand?: string;
|
|
18
18
|
/**
|
|
19
19
|
* Set to `false` to skip creating or updating `vercel.json`. By default the
|
|
20
20
|
* module ensures `vercel.json` contains `experimentalServices` for the Nuxt
|
|
21
|
-
* app and
|
|
21
|
+
* app and eve app.
|
|
22
22
|
*/
|
|
23
23
|
configureVercelJson?: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* Private Vercel service prefix
|
|
25
|
+
* Private Vercel service prefix eve transport is proxied to. Defaults to
|
|
26
26
|
* {@link EVE_NUXT_SERVICE_PREFIX}. When `configureVercelJson` is enabled, it
|
|
27
|
-
* is written as the
|
|
27
|
+
* is written as the eve service `routePrefix`, but an existing `routePrefix`
|
|
28
28
|
* in `vercel.json` takes precedence. Normalized to a leading-slash,
|
|
29
29
|
* no-trailing-slash route; cannot resolve to `/`.
|
|
30
30
|
*/
|
|
31
31
|
servicePrefix?: string;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Nuxt module that wires an
|
|
34
|
+
* Nuxt module that wires an eve agent into a Nuxt app. Register under `modules`
|
|
35
35
|
* (configured via the `eve` config key). It auto-imports the `useEveAgent()`
|
|
36
|
-
* composable, routes
|
|
36
|
+
* composable, routes eve transport requests (`/eve/v1/**`) to the eve service
|
|
37
37
|
* (a shared dev server spawned on demand in dev, a Vercel sibling service or a
|
|
38
38
|
* configured origin/port in production), and unless `configureVercelJson` is
|
|
39
|
-
* `false`, ensures `vercel.json` declares both the Nuxt and
|
|
39
|
+
* `false`, ensures `vercel.json` declares both the Nuxt and eve services.
|
|
40
40
|
* Requires Nuxt >= 4.0.0. Configure via {@link EveNuxtModuleOptions}.
|
|
41
41
|
*/
|
|
42
42
|
declare const _default: import("nuxt/schema").NuxtModule<EveNuxtModuleOptions, EveNuxtModuleOptions, false>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Private route namespace used when a Vercel deployment hosts
|
|
2
|
+
* Private route namespace used when a Vercel deployment hosts eve as a
|
|
3
3
|
* separate experimental service behind the Nuxt app.
|
|
4
4
|
*/
|
|
5
5
|
export declare const EVE_NUXT_SERVICE_PREFIX = "/_eve_internal/eve";
|
|
@@ -18,7 +18,7 @@ export declare function joinRoutePrefix(prefix: string, path: string): string;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function normalizeOrigin(origin: string): string;
|
|
20
20
|
/**
|
|
21
|
-
* Resolve the local production port the module proxies to when an
|
|
21
|
+
* Resolve the local production port the module proxies to when an eve service
|
|
22
22
|
* runs alongside a non-Vercel Nuxt deployment. Defaults to
|
|
23
23
|
* {@link DEFAULT_EVE_NUXT_PRODUCTION_PORT}.
|
|
24
24
|
*/
|
|
@@ -31,14 +31,14 @@ export interface EveVercelRewriteRoute {
|
|
|
31
31
|
readonly dest: string;
|
|
32
32
|
/**
|
|
33
33
|
* Re-run route matching against the rewritten `dest`. Required so the
|
|
34
|
-
* rewritten
|
|
34
|
+
* rewritten eve service path is routed to the sibling eve service instead of
|
|
35
35
|
* being resolved inside the host service's own filesystem (which 404s).
|
|
36
36
|
*/
|
|
37
37
|
readonly check: true;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Build the edge-level Vercel rewrite that forwards
|
|
41
|
-
* (`/eve/v1/**`) to the
|
|
40
|
+
* Build the edge-level Vercel rewrite that forwards eve transport requests
|
|
41
|
+
* (`/eve/v1/**`) to the eve service prefix (`/_eve_internal/eve/eve/v1/**`).
|
|
42
42
|
*
|
|
43
43
|
* Mirrors the Next.js integration's `beforeFiles` rewrite. A Nitro runtime
|
|
44
44
|
* `proxy` route rule cannot reach a sibling Vercel service — the proxied
|
|
@@ -47,7 +47,7 @@ export interface EveVercelRewriteRoute {
|
|
|
47
47
|
*/
|
|
48
48
|
export declare function createEveVercelRewriteRoute(servicePrefix: string): EveVercelRewriteRoute;
|
|
49
49
|
/**
|
|
50
|
-
* Resolve the proxy destination for
|
|
50
|
+
* Resolve the proxy destination for eve routes in production.
|
|
51
51
|
*
|
|
52
52
|
* On Vercel the destination is the private service prefix. Off Vercel it is an
|
|
53
53
|
* explicit origin override (`EVE_NUXT_PRODUCTION_ORIGIN`) or a local port.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";const EVE_NUXT_SERVICE_PREFIX=`/_eve_internal/eve`,EVE_NUXT_PRODUCTION_PORT_ENV=`EVE_NUXT_PRODUCTION_PORT`;function normalizeRoutePrefix(e){let t=(e.startsWith(`/`)?e:`/${e}`).replace(/\/+$/,``);if(t.length===0)throw Error(`
|
|
1
|
+
import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";const EVE_NUXT_SERVICE_PREFIX=`/_eve_internal/eve`,EVE_NUXT_PRODUCTION_PORT_ENV=`EVE_NUXT_PRODUCTION_PORT`;function normalizeRoutePrefix(e){let t=(e.startsWith(`/`)?e:`/${e}`).replace(/\/+$/,``);if(t.length===0)throw Error(`eve Nuxt service prefix cannot resolve to the root route.`);return t}function joinRoutePrefix(e,t){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+/,``)}`}function normalizeOrigin(e){return new URL(e.trim()).origin}function readLocalProductionPort(){let e=process.env[EVE_NUXT_PRODUCTION_PORT_ENV];if(e===void 0||e.trim().length===0)return 4274;let t=Number.parseInt(e,10);if(String(t)!==e.trim()||t<1||t>65535)throw Error(`${EVE_NUXT_PRODUCTION_PORT_ENV} must be an integer between 1 and 65535.`);return t}function createEveVercelRewriteRoute(t){let n=joinRoutePrefix(t,EVE_ROUTE_PREFIX);return{src:`^${EVE_ROUTE_PREFIX}/(.*)$`,dest:`${n}/$1`,check:!0}}function resolveProductionTarget(t){if(process.env.VERCEL)return joinRoutePrefix(t,EVE_ROUTE_PREFIX);let n=process.env.EVE_NUXT_PRODUCTION_ORIGIN;return n!==void 0&&n.trim().length>0?joinRoutePrefix(normalizeOrigin(n),EVE_ROUTE_PREFIX):joinRoutePrefix(`http://127.0.0.1:${String(readLocalProductionPort())}`,EVE_ROUTE_PREFIX)}export{EVE_NUXT_SERVICE_PREFIX,createEveVercelRewriteRoute,joinRoutePrefix,normalizeOrigin,normalizeRoutePrefix,readLocalProductionPort,resolveProductionTarget};
|
|
@@ -2,10 +2,10 @@ export interface EnsureVercelJsonResult {
|
|
|
2
2
|
readonly servicePrefix: string;
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
|
-
* Ensure `vercel.json` declares the Nuxt web service and the
|
|
5
|
+
* Ensure `vercel.json` declares the Nuxt web service and the eve agent
|
|
6
6
|
* service so a Vercel deployment ships both from one project.
|
|
7
7
|
*
|
|
8
|
-
* Existing services are preserved untouched; an already-configured
|
|
8
|
+
* Existing services are preserved untouched; an already-configured eve
|
|
9
9
|
* service's `routePrefix` wins over {@link input.servicePrefix}. The file is
|
|
10
10
|
* only rewritten when the resulting config differs from what is on disk.
|
|
11
11
|
*/
|
|
@@ -7,7 +7,7 @@ import type { JustBashSandboxCreateOptions } from "#public/sandbox/just-bash-san
|
|
|
7
7
|
* real binaries (`git`, `node`, package managers) and no network
|
|
8
8
|
* isolation.
|
|
9
9
|
*
|
|
10
|
-
* The `just-bash` package is not bundled with
|
|
10
|
+
* The `just-bash` package is not bundled with eve. When it is missing,
|
|
11
11
|
* `eve dev` installs it into the application automatically (disable
|
|
12
12
|
* with `autoInstall: false`); production processes fail with an
|
|
13
13
|
* actionable install error instead. Configuring this backend pins it
|
|
@@ -7,7 +7,7 @@ import type { MicrosandboxBootstrapUseOptions, MicrosandboxCreateOptions, Micros
|
|
|
7
7
|
* network policies and credential brokering.
|
|
8
8
|
*
|
|
9
9
|
* Supported hosts: macOS on Apple Silicon, or Linux (glibc) with KVM
|
|
10
|
-
* enabled. The `microsandbox` package is not bundled with
|
|
10
|
+
* enabled. The `microsandbox` package is not bundled with eve. When it
|
|
11
11
|
* (or its VM runtime) is missing, `eve dev` installs both
|
|
12
12
|
* automatically (disable with `setup: { autoInstall: false }`);
|
|
13
13
|
* production processes fail with actionable errors instead.
|
|
@@ -17,7 +17,7 @@ import type { VercelSandboxBootstrapUseOptions, VercelSandboxCreateOptions, Verc
|
|
|
17
17
|
* the author's snapshot, git revision, or tarball becomes the base
|
|
18
18
|
* layer of the template. Bootstrap, seed files, and framework setup
|
|
19
19
|
* still run on top, and every session derives from the resulting
|
|
20
|
-
*
|
|
20
|
+
* eve-owned snapshot. `source` is stripped from session creates so the
|
|
21
21
|
* framework's snapshot always wins.
|
|
22
22
|
*
|
|
23
23
|
* `bootstrap({ use })` applies its options to the template via
|
|
@@ -22,7 +22,7 @@ export type DockerSandboxNetworkPolicy = "allow-all" | "deny-all";
|
|
|
22
22
|
export interface DockerSandboxCreateOptions {
|
|
23
23
|
/**
|
|
24
24
|
* Base container image for templates and sessions. Defaults to
|
|
25
|
-
* `ghcr.io/vercel/eve:latest` —
|
|
25
|
+
* `ghcr.io/vercel/eve:latest` — eve's published sandbox runtime image.
|
|
26
26
|
* Framework setup creates `/workspace` and verifies Bash. Install any
|
|
27
27
|
* authored runtime tools in sandbox bootstrap or provide them through a
|
|
28
28
|
* custom image.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The just-bash backend runs the workspace under the pure-JS `just-bash`
|
|
5
5
|
* interpreter with a virtual filesystem — no daemon or VM required, but
|
|
6
6
|
* no real binaries either. The `just-bash` package is not bundled with
|
|
7
|
-
*
|
|
7
|
+
* eve; it is loaded lazily from the application install.
|
|
8
8
|
*/
|
|
9
9
|
export interface JustBashSandboxCreateOptions {
|
|
10
10
|
/**
|
|
@@ -4,13 +4,13 @@ import type { SandboxNetworkPolicy } from "#shared/sandbox-network-policy.js";
|
|
|
4
4
|
*
|
|
5
5
|
* The microsandbox backend runs sandboxes in lightweight local VMs via
|
|
6
6
|
* [microsandbox](https://www.npmjs.com/package/microsandbox). Options
|
|
7
|
-
* are
|
|
7
|
+
* are eve-owned rather than a raw passthrough so the public surface can
|
|
8
8
|
* stay stable while the underlying runtime evolves. Supported hosts:
|
|
9
9
|
* macOS on Apple Silicon, or Linux (glibc) with KVM enabled.
|
|
10
10
|
*/
|
|
11
11
|
export interface MicrosandboxCreateOptions {
|
|
12
12
|
/**
|
|
13
|
-
* OCI image used as the base runtime.
|
|
13
|
+
* OCI image used as the base runtime. eve prepares this image with
|
|
14
14
|
* Bash, the framework workspace, and the sandbox user before authored
|
|
15
15
|
* bootstrap code runs. Install authored runtime tools such as Node,
|
|
16
16
|
* Python, or ripgrep in sandbox bootstrap or provide them through a
|
|
@@ -29,7 +29,7 @@ export interface MicrosandboxCreateOptions {
|
|
|
29
29
|
readonly pullPolicy?: "always" | "if-missing" | "never";
|
|
30
30
|
/**
|
|
31
31
|
* Installation behavior for the microsandbox npm package and its VM
|
|
32
|
-
* runtime. By default
|
|
32
|
+
* runtime. By default eve installs both automatically when missing —
|
|
33
33
|
* the npm package with the project's package manager (during
|
|
34
34
|
* `eve dev` only), the runtime via microsandbox's own installer.
|
|
35
35
|
*/
|
|
@@ -6,7 +6,7 @@ import type { Sandbox as SdkSandbox, SandboxUpdateParams } from "#compiled/@verc
|
|
|
6
6
|
* Skipped on resume (`Sandbox.get`) since no create happens there.
|
|
7
7
|
*
|
|
8
8
|
* `networkPolicy` is deferred until after framework-owned base setup
|
|
9
|
-
* for fresh templates and template-less sessions, so
|
|
9
|
+
* for fresh templates and template-less sessions, so eve can install
|
|
10
10
|
* required packages before authored bootstrap code runs. Template-backed
|
|
11
11
|
* session creates receive it at creation time because the template
|
|
12
12
|
* already contains the prepared base runtime.
|
|
@@ -20,7 +20,7 @@ import type { Sandbox as SdkSandbox, SandboxUpdateParams } from "#compiled/@verc
|
|
|
20
20
|
* base layer for the template. Framework setup, bootstrap, and seed
|
|
21
21
|
* files all run on top, and the resulting
|
|
22
22
|
* framework-owned snapshot is what every later session derives from,
|
|
23
|
-
* so `source` is stripped from the session-create path.
|
|
23
|
+
* so `source` is stripped from the session-create path. eve does not
|
|
24
24
|
* detect external snapshot changes; to pick up a rebuilt external
|
|
25
25
|
* snapshot, force a template rebuild (e.g. by changing the sandbox
|
|
26
26
|
* definition so its template key changes).
|
|
@@ -17,8 +17,8 @@ export interface EveDevServerRegistry {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function normalizeDevServerRegistry(value: unknown): EveDevServerRegistry | undefined;
|
|
19
19
|
/**
|
|
20
|
-
* Resolve a shared
|
|
20
|
+
* Resolve a shared eve dev server for {@link appRoot}, reusing a healthy
|
|
21
21
|
* registered server when one exists and otherwise spawning a new one behind a
|
|
22
|
-
* cross-process lock so concurrent SvelteKit processes don't each boot
|
|
22
|
+
* cross-process lock so concurrent SvelteKit processes don't each boot eve.
|
|
23
23
|
*/
|
|
24
24
|
export declare function resolveSharedEveDevServer(appRoot: string): Promise<EveProcessHandle>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{joinRoutePrefix,normalizeOrigin}from"./routing.js";import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";import{resolvePackageRoot}from"#internal/application/package.js";import{join}from"node:path";import{spawn}from"node:child_process";import{mkdir,open,readFile,rm,stat,writeFile}from"node:fs/promises";const EVE_BASE_URL_ENV=`EVE_BASE_URL`,DEFAULT_SERVER_READY_TIMEOUT_MS=3e4,DEV_SERVER_REGISTRY_TIMEOUT_MS=3e4,LOCAL_SERVER_URL_PATTERN=/https?:\/\/(?:\[[^\]\s]+\]|[^\s/:[\]]+)(?::\d+)?/;function isNodeErrorWithCode(e,t){return e instanceof Error&&`code`in e&&e.code===t}function delay(e){return new Promise(t=>setTimeout(t,e))}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveEveCacheDirectory(e){return join(e,`.eve`)}function resolveEveDevServerRegistryPath(e){return join(resolveEveCacheDirectory(e),`sveltekit-dev-server.json`)}function resolveEveDevServerLockPath(e){return join(resolveEveCacheDirectory(e),`sveltekit-dev-server.lock`)}function normalizeDevServerRegistry(e){if(isRecord(e)&&!(typeof e.appRoot!=`string`||typeof e.origin!=`string`||typeof e.updatedAt!=`string`)&&!(e.pid!==null&&typeof e.pid!=`number`))try{return{appRoot:e.appRoot,origin:normalizeOrigin(e.origin),pid:e.pid,updatedAt:e.updatedAt}}catch{return}}async function isEveServerHealthy(t){let r=new AbortController,i=setTimeout(()=>r.abort(),1e3);try{return(await fetch(joinRoutePrefix(t,`${EVE_ROUTE_PREFIX}/health`),{signal:r.signal})).ok}catch{return!1}finally{clearTimeout(i)}}async function readUsableEveDevServerRegistry(e){try{let t=normalizeDevServerRegistry(JSON.parse(await readFile(resolveEveDevServerRegistryPath(e),`utf8`)));return t===void 0||t.appRoot!==e||!await isEveServerHealthy(t.origin)?void 0:t.origin}catch(e){if(isNodeErrorWithCode(e,`ENOENT`))return;throw e}}async function writeEveDevServerRegistry(e,t){await mkdir(resolveEveCacheDirectory(e),{recursive:!0}),await writeFile(resolveEveDevServerRegistryPath(e),`${JSON.stringify({appRoot:e,origin:t.origin,pid:t.process?.pid??null,updatedAt:new Date().toISOString()},null,2)}\n`)}async function removeStaleEveDevServerLock(e){try{let t=await stat(e);Date.now()-t.mtimeMs>3e4&&await rm(e,{force:!0})}catch(e){if(!isNodeErrorWithCode(e,`ENOENT`))throw e}}async function acquireEveDevServerLock(e){let t=resolveEveCacheDirectory(e),n=resolveEveDevServerLockPath(e),r=Date.now()+DEV_SERVER_REGISTRY_TIMEOUT_MS;for(await mkdir(t,{recursive:!0});;)try{let e=await open(n,`wx`);return await e.writeFile(`${String(process.pid)}\n`),await e.close(),async()=>{await rm(n,{force:!0})}}catch(t){if(!isNodeErrorWithCode(t,`EEXIST`))throw t;if(await readUsableEveDevServerRegistry(e)!==void 0)return async()=>{};if(await removeStaleEveDevServerLock(n),Date.now()>r)throw Error(`Timed out after ${DEV_SERVER_REGISTRY_TIMEOUT_MS}ms waiting for another SvelteKit process to start
|
|
1
|
+
import{joinRoutePrefix,normalizeOrigin}from"./routing.js";import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";import{resolvePackageRoot}from"#internal/application/package.js";import{join}from"node:path";import{spawn}from"node:child_process";import{mkdir,open,readFile,rm,stat,writeFile}from"node:fs/promises";const EVE_BASE_URL_ENV=`EVE_BASE_URL`,DEFAULT_SERVER_READY_TIMEOUT_MS=3e4,DEV_SERVER_REGISTRY_TIMEOUT_MS=3e4,LOCAL_SERVER_URL_PATTERN=/https?:\/\/(?:\[[^\]\s]+\]|[^\s/:[\]]+)(?::\d+)?/;function isNodeErrorWithCode(e,t){return e instanceof Error&&`code`in e&&e.code===t}function delay(e){return new Promise(t=>setTimeout(t,e))}function isRecord(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function resolveEveCacheDirectory(e){return join(e,`.eve`)}function resolveEveDevServerRegistryPath(e){return join(resolveEveCacheDirectory(e),`sveltekit-dev-server.json`)}function resolveEveDevServerLockPath(e){return join(resolveEveCacheDirectory(e),`sveltekit-dev-server.lock`)}function normalizeDevServerRegistry(e){if(isRecord(e)&&!(typeof e.appRoot!=`string`||typeof e.origin!=`string`||typeof e.updatedAt!=`string`)&&!(e.pid!==null&&typeof e.pid!=`number`))try{return{appRoot:e.appRoot,origin:normalizeOrigin(e.origin),pid:e.pid,updatedAt:e.updatedAt}}catch{return}}async function isEveServerHealthy(t){let r=new AbortController,i=setTimeout(()=>r.abort(),1e3);try{return(await fetch(joinRoutePrefix(t,`${EVE_ROUTE_PREFIX}/health`),{signal:r.signal})).ok}catch{return!1}finally{clearTimeout(i)}}async function readUsableEveDevServerRegistry(e){try{let t=normalizeDevServerRegistry(JSON.parse(await readFile(resolveEveDevServerRegistryPath(e),`utf8`)));return t===void 0||t.appRoot!==e||!await isEveServerHealthy(t.origin)?void 0:t.origin}catch(e){if(isNodeErrorWithCode(e,`ENOENT`))return;throw e}}async function writeEveDevServerRegistry(e,t){await mkdir(resolveEveCacheDirectory(e),{recursive:!0}),await writeFile(resolveEveDevServerRegistryPath(e),`${JSON.stringify({appRoot:e,origin:t.origin,pid:t.process?.pid??null,updatedAt:new Date().toISOString()},null,2)}\n`)}async function removeStaleEveDevServerLock(e){try{let t=await stat(e);Date.now()-t.mtimeMs>3e4&&await rm(e,{force:!0})}catch(e){if(!isNodeErrorWithCode(e,`ENOENT`))throw e}}async function acquireEveDevServerLock(e){let t=resolveEveCacheDirectory(e),n=resolveEveDevServerLockPath(e),r=Date.now()+DEV_SERVER_REGISTRY_TIMEOUT_MS;for(await mkdir(t,{recursive:!0});;)try{let e=await open(n,`wx`);return await e.writeFile(`${String(process.pid)}\n`),await e.close(),async()=>{await rm(n,{force:!0})}}catch(t){if(!isNodeErrorWithCode(t,`EEXIST`))throw t;if(await readUsableEveDevServerRegistry(e)!==void 0)return async()=>{};if(await removeStaleEveDevServerLock(n),Date.now()>r)throw Error(`Timed out after ${DEV_SERVER_REGISTRY_TIMEOUT_MS}ms waiting for another SvelteKit process to start eve.`);await delay(100)}}function createEveBinaryPath(){return join(resolvePackageRoot(),`bin`,`eve.js`)}function startServerProcess(e){return new Promise((n,r)=>{let i=spawn(e.command,e.args,{cwd:e.cwd,env:{...process.env,...e.env},stdio:[`ignore`,`pipe`,`pipe`]}),a=setTimeout(()=>{i.kill(),r(Error(`Timed out after ${DEFAULT_SERVER_READY_TIMEOUT_MS}ms waiting for eve to print its server URL.`))},DEFAULT_SERVER_READY_TIMEOUT_MS),cleanup=()=>{clearTimeout(a),i.off(`error`,handleError),i.off(`exit`,handleEarlyExit)},handleError=e=>{cleanup(),r(e)},handleEarlyExit=(e,t)=>{cleanup(),r(Error(`eve server process exited before printing its server URL (code ${String(e)}, signal ${String(t)}).`))},o=!1,handleOutput=e=>{if(o)return;let r=LOCAL_SERVER_URL_PATTERN.exec(e.toString(`utf8`));r!==null&&(o=!0,cleanup(),n({origin:normalizeOrigin(r[0]),process:i}))};i.once(`error`,handleError),i.once(`exit`,handleEarlyExit),i.stdout.on(`data`,e=>{process.stdout.write(e),handleOutput(e)}),i.stderr.on(`data`,e=>{process.stderr.write(e),handleOutput(e)})})}function installProcessShutdown(e){let t=e.process;if(t===void 0)return e;let close=()=>{process.off(`beforeExit`,close),process.off(`exit`,close),t.killed||t.kill()};return process.once(`beforeExit`,close),process.once(`exit`,close),e}function startEveDevServer(e){return startServerProcess({args:[createEveBinaryPath(),`dev`,`--no-ui`,`--port`,`0`],command:process.execPath,cwd:e}).then(e=>(process.env[EVE_BASE_URL_ENV]=e.origin,installProcessShutdown(e)))}async function resolveSharedEveDevServer(e){let t=await readUsableEveDevServerRegistry(e);if(t!==void 0)return process.env[EVE_BASE_URL_ENV]=t,{origin:t};let n=await acquireEveDevServerLock(e);try{let t=await readUsableEveDevServerRegistry(e);if(t!==void 0)return process.env[EVE_BASE_URL_ENV]=t,{origin:t};let n=await startEveDevServer(e);return await writeEveDevServerRegistry(e,n),n}finally{await n()}}export{EVE_BASE_URL_ENV,normalizeDevServerRegistry,resolveSharedEveDevServer};
|
|
@@ -2,16 +2,16 @@ import type { Plugin } from "vite";
|
|
|
2
2
|
import { EVE_SVELTEKIT_SERVICE_PREFIX } from "./routing.js";
|
|
3
3
|
export { EVE_SVELTEKIT_SERVICE_PREFIX };
|
|
4
4
|
/**
|
|
5
|
-
* Options for the
|
|
5
|
+
* Options for the eve SvelteKit Vite plugin.
|
|
6
6
|
*/
|
|
7
7
|
export interface EveSvelteKitPluginOptions {
|
|
8
8
|
/**
|
|
9
|
-
* Path to the
|
|
9
|
+
* Path to the eve application root, relative to the SvelteKit project root
|
|
10
10
|
* unless absolute. Defaults to the SvelteKit project root.
|
|
11
11
|
*/
|
|
12
12
|
readonly eveRoot?: string;
|
|
13
13
|
/**
|
|
14
|
-
* Build command for the generated
|
|
14
|
+
* Build command for the generated eve Vercel service.
|
|
15
15
|
* Defaults to `"eve build"`.
|
|
16
16
|
*/
|
|
17
17
|
readonly eveBuildCommand?: string;
|
|
@@ -19,26 +19,26 @@ export interface EveSvelteKitPluginOptions {
|
|
|
19
19
|
* Set to `false` to skip creating or updating `vercel.json`.
|
|
20
20
|
*
|
|
21
21
|
* By default the plugin ensures `vercel.json` contains `experimentalServices`
|
|
22
|
-
* for the SvelteKit app and
|
|
22
|
+
* for the SvelteKit app and eve app.
|
|
23
23
|
*/
|
|
24
24
|
readonly configureVercelJson?: boolean;
|
|
25
25
|
/**
|
|
26
|
-
* Private Vercel service prefix for the
|
|
27
|
-
*
|
|
26
|
+
* Private Vercel service prefix for the eve deployment. Must match the
|
|
27
|
+
* eve service's `routePrefix` in `vercel.json`. Defaults to
|
|
28
28
|
* {@link EVE_SVELTEKIT_SERVICE_PREFIX} (`"/_eve_internal/eve"`).
|
|
29
29
|
*/
|
|
30
30
|
readonly servicePrefix?: string;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Vite plugin for running an
|
|
33
|
+
* Vite plugin for running an eve agent alongside a SvelteKit app.
|
|
34
34
|
*
|
|
35
|
-
* In development and local preview, `eveSvelteKit` proxies
|
|
36
|
-
* endpoints to a local
|
|
37
|
-
* `EVE_BASE_URL` env var if set, then a healthy shared
|
|
35
|
+
* In development and local preview, `eveSvelteKit` proxies eve protocol
|
|
36
|
+
* endpoints to a local eve server. It resolves the server in order: the
|
|
37
|
+
* `EVE_BASE_URL` env var if set, then a healthy shared eve dev server already
|
|
38
38
|
* running for the app, then a freshly spawned `eve dev --no-ui --port 0`.
|
|
39
39
|
*
|
|
40
40
|
* During builds, unless `configureVercelJson` is `false`, it ensures
|
|
41
|
-
* `vercel.json` deploys the SvelteKit app and
|
|
41
|
+
* `vercel.json` deploys the SvelteKit app and eve agent as sibling Vercel
|
|
42
42
|
* services.
|
|
43
43
|
*/
|
|
44
44
|
export declare function eveSvelteKit(options?: EveSvelteKitPluginOptions): Plugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Private route namespace for hosting
|
|
2
|
+
* Private route namespace for hosting eve as a separate experimental Vercel
|
|
3
3
|
* service behind the SvelteKit app.
|
|
4
4
|
*/
|
|
5
5
|
export declare const EVE_SVELTEKIT_SERVICE_PREFIX = "/_eve_internal/eve";
|
|
@@ -18,15 +18,15 @@ export declare function joinRoutePrefix(prefix: string, path: string): string;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare function normalizeOrigin(origin: string): string;
|
|
20
20
|
/**
|
|
21
|
-
* A Vercel rewrite that forwards
|
|
22
|
-
* private
|
|
21
|
+
* A Vercel rewrite that forwards eve transport requests (`/eve/v1/**`) to the
|
|
22
|
+
* private eve service prefix (`/_eve_internal/eve/eve/v1/**`).
|
|
23
23
|
*/
|
|
24
24
|
export interface EveVercelRewrite {
|
|
25
25
|
readonly destination: string;
|
|
26
26
|
readonly source: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Build the Vercel rewrite that forwards browser
|
|
30
|
-
* sibling
|
|
29
|
+
* Build the Vercel rewrite that forwards browser eve transport requests to the
|
|
30
|
+
* sibling eve service.
|
|
31
31
|
*/
|
|
32
32
|
export declare function createEveVercelRewrite(servicePrefix: string): EveVercelRewrite;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";const EVE_SVELTEKIT_SERVICE_PREFIX=`/_eve_internal/eve`;function normalizeRoutePrefix(e){let t=(e.startsWith(`/`)?e:`/${e}`).replace(/\/+$/,``);if(t.length===0)throw Error(`
|
|
1
|
+
import{EVE_ROUTE_PREFIX}from"#protocol/routes.js";const EVE_SVELTEKIT_SERVICE_PREFIX=`/_eve_internal/eve`;function normalizeRoutePrefix(e){let t=(e.startsWith(`/`)?e:`/${e}`).replace(/\/+$/,``);if(t.length===0)throw Error(`eve SvelteKit service prefix cannot resolve to the root route.`);return t}function joinRoutePrefix(e,t){return`${e.replace(/\/+$/,``)}/${t.replace(/^\/+/,``)}`}function normalizeOrigin(e){return new URL(e.trim()).origin}function createEveVercelRewrite(t){return{destination:`${joinRoutePrefix(t,EVE_ROUTE_PREFIX)}/:path*`,source:`${EVE_ROUTE_PREFIX}/:path*`}}export{EVE_SVELTEKIT_SERVICE_PREFIX,createEveVercelRewrite,joinRoutePrefix,normalizeOrigin,normalizeRoutePrefix};
|
|
@@ -2,10 +2,10 @@ export interface EnsureVercelJsonResult {
|
|
|
2
2
|
readonly servicePrefix: string;
|
|
3
3
|
}
|
|
4
4
|
/**
|
|
5
|
-
* Ensure `vercel.json` declares the SvelteKit web service and the
|
|
5
|
+
* Ensure `vercel.json` declares the SvelteKit web service and the eve agent
|
|
6
6
|
* service so a Vercel deployment ships both from one project.
|
|
7
7
|
*
|
|
8
|
-
* Existing services are preserved untouched; an already-configured
|
|
8
|
+
* Existing services are preserved untouched; an already-configured eve
|
|
9
9
|
* service's `routePrefix` wins over {@link input.servicePrefix}. The file is
|
|
10
10
|
* only rewritten when the resulting config differs from what is on disk.
|
|
11
11
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const DEFINITION_KEY=Symbol.for(`eve.definition-source-key`),REGISTRY_SYMBOL=Symbol.for(`eve.definition-source-registry`),registryContainer=globalThis;registryContainer[REGISTRY_SYMBOL]===void 0&&(registryContainer[REGISTRY_SYMBOL]=new Map);const definitionSourceRegistry=registryContainer[REGISTRY_SYMBOL];function stampDefinitionKey(t,n){Object.defineProperty(t,DEFINITION_KEY,{configurable:!0,value:n})}function readDefinitionKey(t){if(DEFINITION_KEY in t)return t[DEFINITION_KEY]}function registerDefinitionSource(e,t){let n=definitionSourceRegistry.get(e);if(n!==void 0&&!sameDefinitionSourceEntry(n,t)){n.kind!==`ambiguous`&&console.warn([`
|
|
1
|
+
const DEFINITION_KEY=Symbol.for(`eve.definition-source-key`),REGISTRY_SYMBOL=Symbol.for(`eve.definition-source-registry`),registryContainer=globalThis;registryContainer[REGISTRY_SYMBOL]===void 0&&(registryContainer[REGISTRY_SYMBOL]=new Map);const definitionSourceRegistry=registryContainer[REGISTRY_SYMBOL];function stampDefinitionKey(t,n){Object.defineProperty(t,DEFINITION_KEY,{configurable:!0,value:n})}function readDefinitionKey(t){if(DEFINITION_KEY in t)return t[DEFINITION_KEY]}function registerDefinitionSource(e,t){let n=definitionSourceRegistry.get(e);if(n!==void 0&&!sameDefinitionSourceEntry(n,t)){n.kind!==`ambiguous`&&console.warn([`eve could not assign a unique toolResultFrom identity for ${JSON.stringify(e)}.`,`Conflicting definitions: ${formatDefinitionSourceForWarning(n)} and ${formatDefinitionSourceForWarning(t)}.`,`Multiple authored definitions share that fallback identity, so toolResultFrom will not match through it.`,`Use the original definition object loaded by eve so source-derived identity can be used instead.`].join(` `)),definitionSourceRegistry.set(e,{kind:`ambiguous`});return}definitionSourceRegistry.set(e,t)}function sameDefinitionSourceEntry(e,t){return e.kind===t.kind?e.name===t.name:!1}function formatDefinitionSourceForWarning(e){return e.logicalPath===void 0?`${e.kind} "${e.name}"`:`${e.kind} "${e.name}" from "${e.logicalPath}"`}const toolResultFrom=toolResultFromImpl;function toolResultFromImpl(e,t){if(e.kind!==`tool-result`||e.isError===!0)return;let n=readDefinitionKey(t);if(n===void 0)return;let r=definitionSourceRegistry.get(n);if(r===void 0||r.kind===`ambiguous`)return;if(r.kind===`tool`)return e.toolName===r.name?{callId:e.callId,output:e.output,toolName:e.toolName}:void 0;let i=r.name+`__`;if(e.toolName.startsWith(i))return{callId:e.callId,connectionToolName:e.toolName.slice(i.length),output:e.output,toolName:e.toolName}}export{registerDefinitionSource,stampDefinitionKey,toolResultFrom};
|
|
@@ -6,7 +6,7 @@ import type { HandleMessageStreamEvent } from "#protocol/message.js";
|
|
|
6
6
|
import type { ClientAuth, HeadersValue, SendTurnPayload, SessionState } from "#client/types.js";
|
|
7
7
|
export type { PrepareSend };
|
|
8
8
|
/**
|
|
9
|
-
* Lifecycle status of an
|
|
9
|
+
* Lifecycle status of an eve agent session.
|
|
10
10
|
*
|
|
11
11
|
* - `"ready"`: idle, accepting a new turn.
|
|
12
12
|
* - `"submitted"`: a turn was sent, no stream events received yet.
|
|
@@ -15,7 +15,7 @@ export type { PrepareSend };
|
|
|
15
15
|
*/
|
|
16
16
|
export type UseEveAgentStatus = EveAgentStoreStatus;
|
|
17
17
|
/**
|
|
18
|
-
* Snapshot of an
|
|
18
|
+
* Snapshot of an eve agent session: `data` (the reducer projection), `events`
|
|
19
19
|
* (the authoritative server stream), `session` (resumable cursor), `status`,
|
|
20
20
|
* and `error`.
|
|
21
21
|
*/
|
|
@@ -32,7 +32,7 @@ export interface UseEveAgentHelpers<TData> extends UseEveAgentSnapshot<TData> {
|
|
|
32
32
|
readonly stop: () => void;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Configuration for creating or binding a React
|
|
35
|
+
* Configuration for creating or binding a React eve agent session.
|
|
36
36
|
*
|
|
37
37
|
* Session configuration is read when the hook creates its internal store;
|
|
38
38
|
* remount the component to point at a different host, reducer, or session.
|
|
@@ -45,11 +45,11 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
45
45
|
readonly auth?: ClientAuth;
|
|
46
46
|
readonly headers?: HeadersValue;
|
|
47
47
|
/**
|
|
48
|
-
* Base URL for
|
|
48
|
+
* Base URL for eve client requests.
|
|
49
49
|
*
|
|
50
|
-
* Defaults to same-origin
|
|
50
|
+
* Defaults to same-origin eve routes such as `/eve/v1/...`. Pass a same-origin
|
|
51
51
|
* prefix such as `/api` for an app-owned proxy, or an absolute origin to talk
|
|
52
|
-
* to an
|
|
52
|
+
* to an eve server directly.
|
|
53
53
|
*
|
|
54
54
|
* @default ""
|
|
55
55
|
*/
|
|
@@ -58,11 +58,11 @@ export interface UseEveAgentOptions<TData> extends EveAgentStoreCallbacks<TData>
|
|
|
58
58
|
readonly initialSession?: SessionState;
|
|
59
59
|
readonly maxReconnectAttempts?: number;
|
|
60
60
|
/**
|
|
61
|
-
* Project submitted user messages before
|
|
61
|
+
* Project submitted user messages before eve confirms them with a
|
|
62
62
|
* `message.received` stream event.
|
|
63
63
|
*
|
|
64
64
|
* Optimistic events are reducer-facing projection events only. They are not
|
|
65
|
-
* exposed through `events`, which remains the authoritative
|
|
65
|
+
* exposed through `events`, which remains the authoritative eve stream.
|
|
66
66
|
*
|
|
67
67
|
* @default true
|
|
68
68
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MockLanguageModelV3}from"ai/test";import{BOOTSTRAP_RUNTIME_MODEL_ID}from"#runtime/agent/bootstrap.js";import{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptText}from"#runtime/agent/bootstrap-model-utils.js";const bootstrapRuntimeModels=new Map;function resolveBootstrapRuntimeModel(n){if(n.id!==BOOTSTRAP_RUNTIME_MODEL_ID)return null;let i=bootstrapRuntimeModels.get(n.id);if(i!==void 0)return i;let a=new MockLanguageModelV3({doGenerate:async e=>createBootstrapModelResult(e.prompt,n.id),doStream:async e=>createBootstrapStreamResult(createBootstrapModelResult(e.prompt,n.id)),modelId:n.id,provider:`eve-bootstrap`});return bootstrapRuntimeModels.set(n.id,a),a}function createBootstrapModelResult(e,t){let r=`Bootstrap reply: ${getLastUserPromptText(e)??`Hello from
|
|
1
|
+
import{MockLanguageModelV3}from"ai/test";import{BOOTSTRAP_RUNTIME_MODEL_ID}from"#runtime/agent/bootstrap.js";import{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptText}from"#runtime/agent/bootstrap-model-utils.js";const bootstrapRuntimeModels=new Map;function resolveBootstrapRuntimeModel(n){if(n.id!==BOOTSTRAP_RUNTIME_MODEL_ID)return null;let i=bootstrapRuntimeModels.get(n.id);if(i!==void 0)return i;let a=new MockLanguageModelV3({doGenerate:async e=>createBootstrapModelResult(e.prompt,n.id),doStream:async e=>createBootstrapStreamResult(createBootstrapModelResult(e.prompt,n.id)),modelId:n.id,provider:`eve-bootstrap`});return bootstrapRuntimeModels.set(n.id,a),a}function createBootstrapModelResult(e,t){let r=`Bootstrap reply: ${getLastUserPromptText(e)??`Hello from eve`}`;return createBootstrapGenerateResult({inputTokens:estimateTokenCount(getPromptText(e)),modelId:t,outputTokens:estimateTokenCount(r),text:r})}export{resolveBootstrapRuntimeModel};
|
|
@@ -32,7 +32,7 @@ export interface RuntimeTurnAgent {
|
|
|
32
32
|
/**
|
|
33
33
|
* Static system prompt for the bootstrap runtime path.
|
|
34
34
|
*/
|
|
35
|
-
export declare const BOOTSTRAP_RUNTIME_SYSTEM_PROMPT = "You are the
|
|
35
|
+
export declare const BOOTSTRAP_RUNTIME_SYSTEM_PROMPT = "You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.";
|
|
36
36
|
/**
|
|
37
37
|
* Creates the runtime-owned turn-preparation shape from a resolved authored
|
|
38
38
|
* agent and the authored tool descriptors prepared for the harness.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the
|
|
1
|
+
import{composeRuntimeBasePrompt}from"#runtime/prompt/compose.js";const BOOTSTRAP_RUNTIME_MODEL_ID=`eve-bootstrap-model`,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT=`You are the eve bootstrap agent. Be concise, stay grounded in the current conversation, and do not assume tools are available unless the runtime provides them.`;function createResolvedRuntimeTurnAgent(e){let t=e.agent;return{id:t.config.name,instructions:composeRuntimeBasePrompt({connections:t.connections,instructions:t.instructions,skills:t.skills,toolsAvailable:e.tools.length>0,workspaceSpec:t.workspaceSpec}),compactionModel:t.config.compaction?.model,model:t.config.model,nodeId:e.nodeId,outputSchema:t.config.outputSchema,tools:[...e.tools],workspaceSpec:t.workspaceSpec}}export{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT,createResolvedRuntimeTurnAgent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{z}from"#compiled/zod/index.js";import{CODE_MODE_TOOL_NAME}from"#shared/code-mode.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{FINAL_OUTPUT_TOOL_NAME}from"#runtime/framework-tools/final-output.js";import{MockLanguageModelV3}from"ai/test";import{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT}from"#runtime/agent/bootstrap.js";import{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptContentText,getPromptText}from"#runtime/agent/bootstrap-model-utils.js";import{createMockAuthoredToolInput,formatToolOutput,resolveMockFixtureToken,resolveWeatherCity}from"#runtime/agent/mock-model-fixtures.js";import{findRelevantSkill,getActivatedSkillIds,getAvailableSkills}from"#runtime/agent/mock-model-skill-selection.js";import{createJsonSchemaSample}from"#runtime/agent/mock-structured-output.js";const authoredRuntimeModelMocks=new Map,bootstrapWeatherPayloadSchema=z.object({city:z.string(),condition:z.string(),summary:z.string(),temperatureF:z.number().finite()}).strict();function shouldMockAuthoredRuntimeModels(){return process.env.NODE_ENV===`test`}function createMockAuthoredRuntimeModel(e){let t=authoredRuntimeModelMocks.get(e.id);if(t!==void 0)return t;let n=new MockLanguageModelV3({modelId:e.id,provider:`eve-runtime-mock`,doGenerate:async t=>createMockModelResult(t,e.id),doStream:async t=>createBootstrapStreamResult(createMockModelResult(t,e.id))});return authoredRuntimeModelMocks.set(e.id,n),n}function createMockModelResult(e,t){let n=getLastAuthoredToolResult(e.prompt);if(n!==null){let r=createFollowUpToolCallResult({modelId:t,options:e,result:n});if(r!==null)return r}else{let n=createSkillLoadResult(e.prompt,t)??createAuthoredToolCallResult(e,t);if(n!==null)return n}let r=createFinalOutputResult(e,t);if(r!==null)return r;let i=n===null?createAssistantMessage(e.prompt):formatToolResultReply(n,e.prompt);return createBootstrapGenerateResult({inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(i),text:i})}function createFinalOutputResult(e,t){let n=getAvailableTools(e).find(e=>e.name===FINAL_OUTPUT_TOOL_NAME);if(n===void 0)return null;let i=createJsonSchemaSample(n.inputSchema);return createToolCallGenerateResult({input:i,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(JSON.stringify(i)),toolCallId:createToolCallId(FINAL_OUTPUT_TOOL_NAME),toolName:FINAL_OUTPUT_TOOL_NAME})}function resolveMockAuthoredRuntimeModel(e){return!shouldMockAuthoredRuntimeModels()||e.id===BOOTSTRAP_RUNTIME_MODEL_ID?null:createMockAuthoredRuntimeModel(e)}function createSkillLoadResult(e,t){let r=getLastUserPromptText(e);if(r===null||getActivatedSkillIds(e).length>0)return null;let i=findRelevantSkill(getAvailableSkills(e),r);return i===null?null:createToolCallGenerateResult({input:{skill:i.name},inputTokens:estimateTokenCount(getPromptText(e)),modelId:t,outputTokens:estimateTokenCount(i.name),toolCallId:`call_load_skill`,toolName:LOAD_SKILL_TOOL_NAME})}function createAuthoredToolCallResult(e,n){let r=getLastUserPromptText(e.prompt);if(r===null)return null;let i=findRelevantTool(getAvailableTools(e),r);if(i===null)return null;let a=resolveWeatherCity(r),o=createMockAuthoredToolInput(i,r,a);if(i.name===CODE_MODE_TOOL_NAME){let t=findRelevantCodeModeHostTool(i.description,r);if(t===null)return null;let o=`return await tools${formatCodeModeToolAccess(t)}({ city: ${JSON.stringify(a)} });`;return createToolCallGenerateResult({input:{js:o},inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:n,outputTokens:estimateTokenCount(o),toolCallId:createToolCallId(i.name),toolName:i.name})}return createToolCallGenerateResult({input:o,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:n,outputTokens:estimateTokenCount(Object.values(o).join(` `)),toolCallId:createToolCallId(i.name),toolName:i.name})}function createFollowUpToolCallResult(e){let t=findNextExplicitToolAfterResult({previousToolName:e.result.toolName,prompt:e.options.prompt,tools:getAvailableTools(e.options)});if(t===null)return null;let n=createFollowUpToolInput(e.result.output);return n===null?null:createToolCallGenerateResult({input:n,inputTokens:estimateTokenCount(getPromptText(e.options.prompt)),modelId:e.modelId,outputTokens:estimateTokenCount(Object.values(n).join(` `)),toolCallId:createToolCallId(t.name),toolName:t.name})}function createAssistantMessage(e){let t=getLastUserPromptText(e)??`Hello from
|
|
1
|
+
import{z}from"#compiled/zod/index.js";import{CODE_MODE_TOOL_NAME}from"#shared/code-mode.js";import{LOAD_SKILL_TOOL_NAME}from"#runtime/skills/fragment-context.js";import{FINAL_OUTPUT_TOOL_NAME}from"#runtime/framework-tools/final-output.js";import{MockLanguageModelV3}from"ai/test";import{BOOTSTRAP_RUNTIME_MODEL_ID,BOOTSTRAP_RUNTIME_SYSTEM_PROMPT}from"#runtime/agent/bootstrap.js";import{createBootstrapGenerateResult,createBootstrapStreamResult,estimateTokenCount,getLastUserPromptText,getPromptContentText,getPromptText}from"#runtime/agent/bootstrap-model-utils.js";import{createMockAuthoredToolInput,formatToolOutput,resolveMockFixtureToken,resolveWeatherCity}from"#runtime/agent/mock-model-fixtures.js";import{findRelevantSkill,getActivatedSkillIds,getAvailableSkills}from"#runtime/agent/mock-model-skill-selection.js";import{createJsonSchemaSample}from"#runtime/agent/mock-structured-output.js";const authoredRuntimeModelMocks=new Map,bootstrapWeatherPayloadSchema=z.object({city:z.string(),condition:z.string(),summary:z.string(),temperatureF:z.number().finite()}).strict();function shouldMockAuthoredRuntimeModels(){return process.env.NODE_ENV===`test`}function createMockAuthoredRuntimeModel(e){let t=authoredRuntimeModelMocks.get(e.id);if(t!==void 0)return t;let n=new MockLanguageModelV3({modelId:e.id,provider:`eve-runtime-mock`,doGenerate:async t=>createMockModelResult(t,e.id),doStream:async t=>createBootstrapStreamResult(createMockModelResult(t,e.id))});return authoredRuntimeModelMocks.set(e.id,n),n}function createMockModelResult(e,t){let n=getLastAuthoredToolResult(e.prompt);if(n!==null){let r=createFollowUpToolCallResult({modelId:t,options:e,result:n});if(r!==null)return r}else{let n=createSkillLoadResult(e.prompt,t)??createAuthoredToolCallResult(e,t);if(n!==null)return n}let r=createFinalOutputResult(e,t);if(r!==null)return r;let i=n===null?createAssistantMessage(e.prompt):formatToolResultReply(n,e.prompt);return createBootstrapGenerateResult({inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(i),text:i})}function createFinalOutputResult(e,t){let n=getAvailableTools(e).find(e=>e.name===FINAL_OUTPUT_TOOL_NAME);if(n===void 0)return null;let i=createJsonSchemaSample(n.inputSchema);return createToolCallGenerateResult({input:i,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:t,outputTokens:estimateTokenCount(JSON.stringify(i)),toolCallId:createToolCallId(FINAL_OUTPUT_TOOL_NAME),toolName:FINAL_OUTPUT_TOOL_NAME})}function resolveMockAuthoredRuntimeModel(e){return!shouldMockAuthoredRuntimeModels()||e.id===BOOTSTRAP_RUNTIME_MODEL_ID?null:createMockAuthoredRuntimeModel(e)}function createSkillLoadResult(e,t){let r=getLastUserPromptText(e);if(r===null||getActivatedSkillIds(e).length>0)return null;let i=findRelevantSkill(getAvailableSkills(e),r);return i===null?null:createToolCallGenerateResult({input:{skill:i.name},inputTokens:estimateTokenCount(getPromptText(e)),modelId:t,outputTokens:estimateTokenCount(i.name),toolCallId:`call_load_skill`,toolName:LOAD_SKILL_TOOL_NAME})}function createAuthoredToolCallResult(e,n){let r=getLastUserPromptText(e.prompt);if(r===null)return null;let i=findRelevantTool(getAvailableTools(e),r);if(i===null)return null;let a=resolveWeatherCity(r),o=createMockAuthoredToolInput(i,r,a);if(i.name===CODE_MODE_TOOL_NAME){let t=findRelevantCodeModeHostTool(i.description,r);if(t===null)return null;let o=`return await tools${formatCodeModeToolAccess(t)}({ city: ${JSON.stringify(a)} });`;return createToolCallGenerateResult({input:{js:o},inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:n,outputTokens:estimateTokenCount(o),toolCallId:createToolCallId(i.name),toolName:i.name})}return createToolCallGenerateResult({input:o,inputTokens:estimateTokenCount(getPromptText(e.prompt)),modelId:n,outputTokens:estimateTokenCount(Object.values(o).join(` `)),toolCallId:createToolCallId(i.name),toolName:i.name})}function createFollowUpToolCallResult(e){let t=findNextExplicitToolAfterResult({previousToolName:e.result.toolName,prompt:e.options.prompt,tools:getAvailableTools(e.options)});if(t===null)return null;let n=createFollowUpToolInput(e.result.output);return n===null?null:createToolCallGenerateResult({input:n,inputTokens:estimateTokenCount(getPromptText(e.options.prompt)),modelId:e.modelId,outputTokens:estimateTokenCount(Object.values(n).join(` `)),toolCallId:createToolCallId(t.name),toolName:t.name})}function createAssistantMessage(e){let t=getLastUserPromptText(e)??`Hello from eve`,n=getSystemPromptLabels(e),r=resolveSystemProbe(e),i=resolveMockFixtureToken(e);return i===null?n.length>0?r===null?`Bootstrap reply [${n.join(`, `)}]: ${t}`:`Bootstrap reply [${n.join(`, `)}; probe=${r}]: ${t}`:r===null?`Bootstrap reply: ${t}`:`Bootstrap reply [probe=${r}]: ${t}`:i}function formatToolResultReply(e,t){if(e.isError)return`Local weather tool failed: ${formatToolOutput(e.output)}`;if(isWeatherPayload(e.output))return`Used local weather tool for ${e.output.city}: ${e.output.condition}, ${e.output.temperatureF}F. ${e.output.summary}`;let n=getLastUserPromptText(t)??`Hello from eve`;return`Used ${e.toolName} for "${n}": ${formatToolOutput(e.output)}`}function createToolCallGenerateResult(e){return{content:[{input:JSON.stringify(e.input),toolCallId:e.toolCallId,toolName:e.toolName,type:`tool-call`}],finishReason:{raw:void 0,unified:`tool-calls`},response:{id:`bootstrap-response`,modelId:e.modelId,timestamp:new Date(`2026-03-16T00:00:00.000Z`)},usage:{inputTokens:{cacheRead:0,cacheWrite:0,noCache:e.inputTokens,total:e.inputTokens},outputTokens:{reasoning:0,text:e.outputTokens,total:e.outputTokens}},warnings:[]}}function getAvailableTools(e){return(e.tools??[]).flatMap(e=>e.type===`function`?[{description:e.description,inputSchema:`inputSchema`in e?e.inputSchema:void 0,name:e.name,outputSchema:`outputSchema`in e?e.outputSchema:void 0}]:[])}function getLastAuthoredToolResult(e){for(let t of[...e].reverse()){if(t.role===`user`)return null;if(!(t.role!==`tool`&&t.role!==`assistant`)){for(let e of[...t.content].reverse())if(!(typeof e==`string`||e.type!==`tool-result`)&&e.toolName!==LOAD_SKILL_TOOL_NAME)return{isError:e.output.type===`error-json`||e.output.type===`error-text`||e.output.type===`execution-denied`,output:e.output.type===`execution-denied`?{reason:e.output.reason??null,type:e.output.type}:e.output.value,toolCallId:e.toolCallId,toolName:e.toolName}}}return null}function findNextExplicitToolAfterResult(e){let t=getLastUserPromptText(e.prompt);if(t===null)return null;let n=normalizeText(t),r=n.indexOf(normalizeText(e.previousToolName));return r<0?null:e.tools.filter(t=>t.name!==e.previousToolName).flatMap(e=>{let t=n.indexOf(normalizeText(e.name),r+1);return t<0?[]:[{index:t,tool:e}]}).sort((e,t)=>e.index-t.index)[0]?.tool??null}function createFollowUpToolInput(e){return isRecord(e)&&typeof e.stepKey==`string`?{stepKey:e.stepKey}:null}function getSystemPromptLabels(e){let t=e.filter(e=>e.role===`system`);if(t.length===0)return[];let n=t.flatMap(e=>{let t=getPromptContentText(e.content);if(t.startsWith(`Available skills
|
|
2
2
|
`))return[];let n=t.split(`
|
|
3
3
|
`).map(e=>e.trim()).filter(e=>e.length>0),r=[];for(let e of n){if(e===BOOTSTRAP_RUNTIME_SYSTEM_PROMPT||e===`Available skills`)continue;let t=/^System \((.+)\)$/.exec(e);if(t?.[1]){r.push(t[1]);continue}let n=/^Skill \((.+)\)$/.exec(e);n?.[1]&&r.push(n[1])}if(r.length>0)return r;let i=n.find(e=>e!==BOOTSTRAP_RUNTIME_SYSTEM_PROMPT&&e!==`Available skills`);return i===void 0?[]:[i]});return[...new Set(n)]}function findRelevantTool(e,t){let r=normalizeText(t),i=e.find(e=>e.name!==`agent`&&e.name!==LOAD_SKILL_TOOL_NAME&&r.includes(normalizeText(e.name)));return i===void 0?/\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(r)?e.find(e=>/\b(forecast|temperature|weather|wind|rain|snow)\b/u.test(normalizeText(`${e.name} ${e.description??``}`)))??null:null:i}function findRelevantCodeModeHostTool(e,t){return e===void 0?null:findRelevantTool(parseCodeModeHostTools(e),t)?.name??null}function parseCodeModeHostTools(e){let t=[],n;for(let r of e.split(`
|
|
4
4
|
`)){let e=/^\s*\/\*\*\s*(.*?)\s*\*\/\s*$/u.exec(r);if(e?.[1]!==void 0){n=e[1];continue}let i=/^\s*(?:([$A-Z_a-z][$\w]*)|(["'])(.*?)\2)\s*:\s*\(input:/u.exec(r),a=i?.[1]??i?.[3];a!==void 0&&(t.push({description:n,name:a}),n=void 0)}return t}function formatCodeModeToolAccess(e){return/^[$A-Z_a-z][$\w]*$/u.test(e)?`.${e}`:`[${JSON.stringify(e)}]`}function normalizeText(e){return e.toLowerCase().replace(/[^a-z0-9]+/gu,` `).trim()}function createToolCallId(e){return`call_${e.toLowerCase().replace(/[^a-z0-9]+/gu,`_`).replace(/^_+|_+$/gu,``)||`tool`}`}function resolveSystemProbe(e){let t=e.filter(e=>e.role===`system`).map(e=>getPromptContentText(e.content)).join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{expectObjectRecord,getAuthoredModuleExport,materializeAuthoredModuleExport}from"#internal/authored-module.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";async function resolveRuntimeModelReference(e,t={}){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):e.id:r}async function loadSourceBackedRuntimeModelReference(i,a){if(a.compiledArtifactsSource===void 0)throw Error(`Expected an explicit compiled artifact source to resolve the authored runtime model "${i.id}".`);let o=(await loadCompiledModuleMap({compiledArtifactsSource:a.compiledArtifactsSource})).nodes[ROOT_COMPILED_AGENT_NODE_ID]?.modules[i.source.sourceId],s=normalizeAgentDefinition(await materializeAuthoredModuleExport(getAuthoredModuleExport(expectObjectRecord(o,`Missing compiled agent config module for runtime model "${i.id}" at "${i.source.logicalPath}".`),i.source)),`Expected the authored agent config export "${i.source.exportName??`default`}" from "${i.source.logicalPath}" to match the public
|
|
1
|
+
import{expectObjectRecord,getAuthoredModuleExport,materializeAuthoredModuleExport}from"#internal/authored-module.js";import{ROOT_COMPILED_AGENT_NODE_ID}from"#compiler/manifest.js";import{normalizeAgentDefinition}from"#internal/authored-definition/core.js";import{loadCompiledModuleMap}from"#runtime/loaders/module-map.js";import{resolveBootstrapRuntimeModel}from"#runtime/agent/bootstrap-model.js";import{resolveMockAuthoredRuntimeModel,shouldMockAuthoredRuntimeModels}from"#runtime/agent/mock-model-adapter.js";async function resolveRuntimeModelReference(e,t={}){let n=resolveBootstrapRuntimeModel(e);if(n!==null)return n;let r=resolveMockAuthoredRuntimeModel(e);return r===null?isSourceBackedRuntimeModelReference(e)?await loadSourceBackedRuntimeModelReference(e,t):e.id:r}async function loadSourceBackedRuntimeModelReference(i,a){if(a.compiledArtifactsSource===void 0)throw Error(`Expected an explicit compiled artifact source to resolve the authored runtime model "${i.id}".`);let o=(await loadCompiledModuleMap({compiledArtifactsSource:a.compiledArtifactsSource})).nodes[ROOT_COMPILED_AGENT_NODE_ID]?.modules[i.source.sourceId],s=normalizeAgentDefinition(await materializeAuthoredModuleExport(getAuthoredModuleExport(expectObjectRecord(o,`Missing compiled agent config module for runtime model "${i.id}" at "${i.source.logicalPath}".`),i.source)),`Expected the authored agent config export "${i.source.exportName??`default`}" from "${i.source.logicalPath}" to match the public eve shape.`).model;if(s===void 0)throw Error(`Expected the authored agent config export "${i.source.exportName??`default`}" from "${i.source.logicalPath}" to provide a runtime model.`);return s}function isSourceBackedRuntimeModelReference(e){return e.source!==void 0}export{resolveRuntimeModelReference,shouldMockAuthoredRuntimeModels};
|
|
@@ -43,7 +43,7 @@ export type EveAttributeValue = string | number | undefined;
|
|
|
43
43
|
*/
|
|
44
44
|
export declare function truncateForTag(value: string, maxBytes?: number): string;
|
|
45
45
|
/**
|
|
46
|
-
* Writes a batch of
|
|
46
|
+
* Writes a batch of eve-owned attributes to the active workflow run.
|
|
47
47
|
*
|
|
48
48
|
* Reserved-namespace contract:
|
|
49
49
|
* - All keys must use the `$eve.` prefix (the workflow runtime would
|
|
@@ -65,7 +65,7 @@ export declare function truncateForTag(value: string, maxBytes?: number): string
|
|
|
65
65
|
* Failure policy: tag writes are observability metadata, not load-bearing
|
|
66
66
|
* state. A failure inside the runtime (transient network, schema bug,
|
|
67
67
|
* missing world adapter) is logged once per process and then swallowed
|
|
68
|
-
* so the
|
|
68
|
+
* so the eve session it tagged is unaffected.
|
|
69
69
|
*
|
|
70
70
|
* Must be called from inside a `"use workflow"` or `"use step"` body —
|
|
71
71
|
* the runtime throws a `FatalError` outside those contexts.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Owning this route in the framework - instead of routing the IdP at the
|
|
18
18
|
* workflow runtime's raw `/.well-known/workflow/v1/webhook/:token` -
|
|
19
|
-
* keeps the public surface namespaced under
|
|
19
|
+
* keeps the public surface namespaced under eve and lets the framework
|
|
20
20
|
* decide delivery policy (auth, throttling, logging) for connection
|
|
21
21
|
* callbacks without leaking generic workflow primitives to the public
|
|
22
22
|
* internet.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AuthKey}from"#context/keys.js";import{contextStorage}from"#context/container.js";import{ConnectionAuthorizationFailedError}from"#public/connections/errors.js";function principalKey(e){return e.type===`app`?`app`:`user:${e.issuer}:${e.id}`}function resolveConnectionPrincipal(t,n,r=contextStorage.getStore()){if(n.principalType===`app`)return{type:`app`};let i=r?.get(AuthKey);if(i==null||i.principalType!==`user`)throw new ConnectionAuthorizationFailedError(t,{message:r===void 0?`Connection "${t}" declares principalType "user" but was invoked outside an
|
|
1
|
+
import{AuthKey}from"#context/keys.js";import{contextStorage}from"#context/container.js";import{ConnectionAuthorizationFailedError}from"#public/connections/errors.js";function principalKey(e){return e.type===`app`?`app`:`user:${e.issuer}:${e.id}`}function resolveConnectionPrincipal(t,n,r=contextStorage.getStore()){if(n.principalType===`app`)return{type:`app`};let i=r?.get(AuthKey);if(i==null||i.principalType!==`user`)throw new ConnectionAuthorizationFailedError(t,{message:r===void 0?`Connection "${t}" declares principalType "user" but was invoked outside an eve context, so no user principal can be resolved.`:`Connection "${t}" declares principalType "user" but the active session has no authenticated user principal.`,reason:`principal_required`,retryable:!1});return{attributes:i.attributes,id:i.principalId,issuer:i.issuer??i.authenticator,type:`user`}}export{principalKey,resolveConnectionPrincipal};
|
|
@@ -45,7 +45,7 @@ export declare function resolveScopedToken(input: ScopedAuthorization): Promise<
|
|
|
45
45
|
* Called when an already-resolved bearer is rejected (a downstream
|
|
46
46
|
* `401`, or an explicit `requireAuth()` after a failed call) so the
|
|
47
47
|
* re-authorization attempt does not re-read the stale token. Drops two
|
|
48
|
-
* layers:
|
|
48
|
+
* layers: eve's per-step cache, and — via the strategy's optional
|
|
49
49
|
* {@link AuthorizationDefinition.evict} hook — any cache the strategy
|
|
50
50
|
* itself owns (e.g. the `@vercel/connect` in-process token cache). The
|
|
51
51
|
* single shared eviction path here means both authored tools and MCP
|