eve 0.22.1 → 0.22.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.
Files changed (184) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/src/chunks/{use-eve-agent-CM24ZUEI.js → use-eve-agent-Cojyfr4X.js} +25 -13
  3. package/dist/src/chunks/{use-eve-agent-CxcKypLZ.js → use-eve-agent-D-S1TPCW.js} +25 -13
  4. package/dist/src/cli/commands/init-repl.d.ts +6 -5
  5. package/dist/src/cli/dev/url.js +1 -1
  6. package/dist/src/client/client-error.d.ts +5 -1
  7. package/dist/src/client/client-error.js +1 -1
  8. package/dist/src/client/client.js +1 -1
  9. package/dist/src/client/open-stream.js +1 -1
  10. package/dist/src/client/session.js +1 -1
  11. package/dist/src/client/types.d.ts +2 -1
  12. package/dist/src/client/url.js +1 -1
  13. package/dist/src/compiled/.vendor-stamp.json +6 -4
  14. package/dist/src/compiled/@workflow/core/create-hook.d.ts +2 -2
  15. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +1 -1
  16. package/dist/src/compiled/@workflow/core/index.js +2 -2
  17. package/dist/src/compiled/@workflow/core/private.js +1 -1
  18. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +14 -0
  19. package/dist/src/compiled/@workflow/core/runtime/get-world-lazy.d.ts +3 -12
  20. package/dist/src/compiled/@workflow/core/runtime/wait-continuation.d.ts +2 -2
  21. package/dist/src/compiled/@workflow/core/runtime/world-compatibility.d.ts +5 -0
  22. package/dist/src/compiled/@workflow/core/runtime/world-init.d.ts +16 -41
  23. package/dist/src/compiled/@workflow/core/runtime/world-target.d.ts +11 -0
  24. package/dist/src/compiled/@workflow/core/runtime/world.d.ts +21 -9
  25. package/dist/src/compiled/@workflow/core/runtime.d.ts +2 -1
  26. package/dist/src/compiled/@workflow/core/runtime.js +3 -141
  27. package/dist/src/compiled/@workflow/core/version.d.ts +1 -1
  28. package/dist/src/compiled/@workflow/core/workflow/world-init-stub.d.ts +2 -2
  29. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  30. package/dist/src/compiled/@workflow/errors/index.js +1 -1
  31. package/dist/src/compiled/@workflow/world/analytics.d.ts +182 -0
  32. package/dist/src/compiled/@workflow/world/env-config.d.ts +39 -0
  33. package/dist/src/compiled/@workflow/world/events.d.ts +25 -0
  34. package/dist/src/compiled/@workflow/world/index.d.ts +6 -3
  35. package/dist/src/compiled/@workflow/world/interfaces.d.ts +14 -7
  36. package/dist/src/compiled/@workflow/world/runs.d.ts +9 -1
  37. package/dist/src/compiled/@workflow/world/shared.d.ts +15 -0
  38. package/dist/src/compiled/@workflow/world/steps.d.ts +8 -0
  39. package/dist/src/compiled/@workflow/world-local/LICENSE.md +201 -0
  40. package/dist/src/compiled/@workflow/world-local/index.js +4 -0
  41. package/dist/src/compiled/@workflow/world-vercel/LICENSE.md +201 -0
  42. package/dist/src/compiled/@workflow/world-vercel/index.js +42 -0
  43. package/dist/src/compiled/_chunks/workflow/attribute-changes-BnKD8Y3m.js +20 -0
  44. package/dist/src/compiled/_chunks/workflow/{dist-FLIfyJ4Y.js → dist-CttsoN4D.js} +1 -1
  45. package/dist/src/compiled/_chunks/workflow/dist-DJU_7R9s.js +40 -0
  46. package/dist/src/compiled/_chunks/workflow/dist-DpDDcpTl.js +3 -0
  47. package/dist/src/compiled/_chunks/workflow/resume-hook-DjPY9VGg.js +1 -0
  48. package/dist/src/compiled/_chunks/workflow/run-BSANnUPR.js +1 -0
  49. package/dist/src/compiled/_chunks/workflow/sleep-phozDCW8.js +1 -0
  50. package/dist/src/compiled/_chunks/workflow/token-CaY0nA5J.js +1 -0
  51. package/dist/src/compiled/_chunks/workflow/token-D4VIwGlD.js +1 -0
  52. package/dist/src/compiled/_chunks/workflow/undici-fb54XL8i.js +95 -0
  53. package/dist/src/compiler/manifest.d.ts +40 -2
  54. package/dist/src/compiler/manifest.js +1 -1
  55. package/dist/src/compiler/module-map.js +2 -2
  56. package/dist/src/compiler/normalize-extension.d.ts +68 -0
  57. package/dist/src/compiler/normalize-extension.js +1 -0
  58. package/dist/src/compiler/normalize-manifest.js +2 -2
  59. package/dist/src/compiler/workspace-resources.js +1 -1
  60. package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
  61. package/dist/src/context/dynamic-tool-lifecycle.js +1 -1
  62. package/dist/src/discover/discover-agent.d.ts +14 -1
  63. package/dist/src/discover/discover-agent.js +1 -1
  64. package/dist/src/discover/extension-specifier.d.ts +15 -0
  65. package/dist/src/discover/extension-specifier.js +1 -0
  66. package/dist/src/discover/extensions.d.ts +109 -0
  67. package/dist/src/discover/extensions.js +1 -0
  68. package/dist/src/discover/filesystem.d.ts +1 -1
  69. package/dist/src/discover/filesystem.js +1 -1
  70. package/dist/src/discover/grammar.d.ts +27 -0
  71. package/dist/src/discover/grammar.js +1 -1
  72. package/dist/src/discover/manifest.d.ts +46 -0
  73. package/dist/src/discover/manifest.js +1 -1
  74. package/dist/src/evals/assertions/run.d.ts +3 -2
  75. package/dist/src/evals/assertions/run.js +2 -2
  76. package/dist/src/evals/index.d.ts +1 -1
  77. package/dist/src/evals/loaders/yaml.js +1 -1
  78. package/dist/src/evals/match.d.ts +11 -6
  79. package/dist/src/execution/sandbox/bindings/microsandbox-network.js +1 -1
  80. package/dist/src/harness/emission.js +1 -1
  81. package/dist/src/harness/model-call-error.d.ts +5 -0
  82. package/dist/src/harness/model-call-error.js +1 -1
  83. package/dist/src/harness/prompt-cache.d.ts +18 -9
  84. package/dist/src/harness/prompt-cache.js +1 -1
  85. package/dist/src/harness/tool-loop.js +1 -1
  86. package/dist/src/internal/application/compiled-artifacts.d.ts +4 -0
  87. package/dist/src/internal/application/compiled-artifacts.js +5 -4
  88. package/dist/src/internal/application/package.d.ts +9 -5
  89. package/dist/src/internal/application/package.js +1 -1
  90. package/dist/src/internal/authored-module-loader.d.ts +14 -0
  91. package/dist/src/internal/authored-module-loader.js +2 -2
  92. package/dist/src/internal/authored-module-map-loader.js +1 -1
  93. package/dist/src/internal/bundler/extension-scope-plugin.d.ts +37 -0
  94. package/dist/src/internal/bundler/extension-scope-plugin.js +3 -0
  95. package/dist/src/internal/helpers/gray-matter.d.ts +25 -0
  96. package/dist/src/internal/helpers/gray-matter.js +1 -0
  97. package/dist/src/internal/helpers/markdown.js +1 -1
  98. package/dist/src/internal/nitro/dev-runtime-source-snapshot-copy.js +1 -1
  99. package/dist/src/internal/nitro/host/build-application.js +1 -1
  100. package/dist/src/internal/nitro/host/build-extension.d.ts +24 -0
  101. package/dist/src/internal/nitro/host/build-extension.js +4 -0
  102. package/dist/src/internal/nitro/host/configure-nitro-routes.js +2 -2
  103. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
  104. package/dist/src/internal/nitro/routes/health.d.ts +3 -3
  105. package/dist/src/internal/workflow/runtime.js +1 -1
  106. package/dist/src/internal/workflow/validate-world.d.ts +16 -0
  107. package/dist/src/internal/workflow/validate-world.js +1 -0
  108. package/dist/src/internal/workflow/world-compatibility.d.ts +1 -12
  109. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/index.js +1 -0
  110. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/parse-name.js +1 -0
  111. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/pluralize.js +1 -0
  112. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/promise.js +1 -0
  113. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/time.js +1 -0
  114. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/workflow-routes.js +1 -0
  115. package/dist/src/node_modules/.pnpm/@workflow_utils@5.0.0-beta.6/node_modules/@workflow/utils/dist/world-target.js +1 -0
  116. package/dist/src/node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js +1 -0
  117. package/dist/src/public/channels/discord/discordChannel.js +1 -1
  118. package/dist/src/public/channels/slack/action-status.d.ts +19 -0
  119. package/dist/src/public/channels/slack/action-status.js +1 -0
  120. package/dist/src/public/channels/slack/api.js +1 -1
  121. package/dist/src/public/channels/slack/defaults.js +2 -2
  122. package/dist/src/public/channels/slack/index.d.ts +1 -0
  123. package/dist/src/public/channels/slack/index.js +1 -1
  124. package/dist/src/public/channels/slack/mrkdwn.d.ts +0 -2
  125. package/dist/src/public/channels/slack/mrkdwn.js +1 -1
  126. package/dist/src/public/channels/slack/slackChannel.d.ts +1 -1
  127. package/dist/src/public/definitions/extension.d.ts +68 -0
  128. package/dist/src/public/definitions/extension.js +1 -0
  129. package/dist/src/public/extension/index.d.ts +10 -0
  130. package/dist/src/public/extension/index.js +1 -0
  131. package/dist/src/public/next/index.d.ts +9 -9
  132. package/dist/src/public/next/index.js +1 -1
  133. package/dist/src/public/next/vercel-output-config.js +1 -1
  134. package/dist/src/runtime/connections/openapi-client.js +1 -1
  135. package/dist/src/runtime/connections/openapi-spec.js +1 -1
  136. package/dist/src/runtime/resolve-dynamic-skill.js +1 -1
  137. package/dist/src/runtime/resolve-dynamic-tool.js +1 -1
  138. package/dist/src/runtime/types.d.ts +10 -0
  139. package/dist/src/services/dev-client/vercel-auth-error.d.ts +2 -2
  140. package/dist/src/services/dev-client/vercel-auth-error.js +3 -3
  141. package/dist/src/setup/scaffold/create/project.js +4 -4
  142. package/dist/src/svelte/index.js +1 -1
  143. package/dist/src/svelte/use-eve-agent.js +1 -1
  144. package/dist/src/vue/index.js +1 -1
  145. package/dist/src/vue/use-eve-agent.js +1 -1
  146. package/docs/agent-config.md +1 -1
  147. package/docs/channels/custom.mdx +2 -2
  148. package/docs/channels/github.mdx +35 -2
  149. package/docs/channels/linear.mdx +36 -6
  150. package/docs/channels/slack.mdx +5 -3
  151. package/docs/concepts/context-control.md +1 -1
  152. package/docs/concepts/execution-model-and-durability.md +1 -1
  153. package/docs/connections/openapi.mdx +3 -1
  154. package/docs/evals/assertions.mdx +4 -2
  155. package/docs/extensions.md +155 -0
  156. package/docs/guides/client/overview.mdx +1 -1
  157. package/docs/guides/deployment.md +1 -1
  158. package/docs/guides/dev-tui.md +4 -0
  159. package/docs/guides/dynamic-capabilities.md +3 -3
  160. package/docs/guides/frontend/nextjs.mdx +7 -7
  161. package/docs/guides/instrumentation.md +1 -1
  162. package/docs/guides/state.md +3 -3
  163. package/docs/instructions.mdx +1 -1
  164. package/docs/meta.json +1 -0
  165. package/docs/patterns/dynamic-scheduling.md +11 -11
  166. package/docs/patterns/multi-tenant-approvals.md +6 -6
  167. package/docs/patterns/multi-tenant-auth.md +13 -13
  168. package/docs/patterns/multi-tenant-memory.md +9 -9
  169. package/docs/schedules.mdx +1 -1
  170. package/docs/subagents.mdx +2 -0
  171. package/docs/tutorial/guard-the-spend.mdx +2 -2
  172. package/docs/tutorial/query-sample-data.mdx +1 -1
  173. package/docs/tutorial/remember-definitions.mdx +2 -2
  174. package/docs/tutorial/ship-it.mdx +1 -1
  175. package/package.json +12 -5
  176. package/dist/src/compiled/_chunks/workflow/attribute-changes-zAifvEhb.js +0 -59
  177. package/dist/src/compiled/_chunks/workflow/dist-Dxrjttr2.js +0 -3
  178. package/dist/src/compiled/_chunks/workflow/resume-hook-C15uJ2ik.js +0 -1
  179. package/dist/src/compiled/_chunks/workflow/run-BJUPZ0Ni.js +0 -1
  180. package/dist/src/compiled/_chunks/workflow/sleep-C8B-TYir.js +0 -1
  181. package/dist/src/compiled/_chunks/workflow/token-Bm-WLAUB.js +0 -1
  182. package/dist/src/compiled/_chunks/workflow/token-J7YP0s9a.js +0 -1
  183. package/dist/src/internal/workflow/configure-world.d.ts +0 -18
  184. package/dist/src/internal/workflow/configure-world.js +0 -1
@@ -6,30 +6,17 @@
6
6
  * # Why this exists
7
7
  *
8
8
  * `getWorldLazy()` in `./get-world-lazy.ts` checks the globalThis cache
9
- * (populated by `world.ts`'s module-load side effect) before falling back
10
- * to a runtime-built dynamic `import('./world.js')`. When a server route
11
- * only consumes a single helper that goes through `getWorldLazy` — most
12
- * commonly `start` from `workflow/api` — webpack/turbopack tree-shake the
13
- * named import `{ getWorld } from './runtime/world.js'` out of
14
- * `runtime.ts`, taking `world.ts`'s module evaluation with it. The
9
+ * populated by `world.ts`'s module-load side effect. When a server route
10
+ * only consumes a helper that goes through `getWorldLazy` for example
11
+ * `start` from `workflow/api`, or `defineHook().resume()` from `workflow`
12
+ * — webpack/turbopack can tree-shake the named import `{ getWorld }` out
13
+ * of `runtime.ts`, taking `world.ts`'s module evaluation with it. The
15
14
  * globalThis registration never fires.
16
15
  *
17
- * `getWorldLazy` then falls through to its dynamic-import fallback, which
18
- * itself fails: webpack inlines `get-world-lazy.js` into the bundled route
19
- * file, so the relative specifier `./world.js` resolves against
20
- * `/var/task/<app>/.next/server/app/<...>/route.js` where no sibling
21
- * `world.js` exists — and Node throws `MODULE_NOT_FOUND`. The symptom is a
22
- * cold-start regression: the very first user request that goes through
23
- * `start()` fails until some other code path (typically the queue-driven
24
- * `/.well-known/workflow/v1/flow` route, which uses `getWorld` directly
25
- * via `workflowEntrypoint`) has loaded `world.ts` and populated the
26
- * cache.
27
- *
28
- * Importing this module for its side effect — exactly once, from the
29
- * host-side `workflow/api` (`packages/workflow/src/api.ts`) — guarantees
30
- * `world.ts` enters the bundle, the global is registered at module load,
31
- * and `getWorldLazy()` short-circuits to the registered function on the
32
- * first call.
16
+ * Importing this module for its side effect from the host-side `workflow`
17
+ * and `workflow/api` entries guarantees `world.ts` enters the bundle, the
18
+ * global is registered at module load, and `getWorldLazy()` short-circuits
19
+ * to the registered function on the first call.
33
20
  *
34
21
  * # Why a separate module instead of importing `./world.js` directly
35
22
  *
@@ -47,29 +34,17 @@
47
34
  * `workflow` condition active, so they pick up the stub and never reach
48
35
  * `world.ts`. Host bundlers (webpack, turbopack, Node.js) use the
49
36
  * `default` (or `node`) condition and pick up this file, loading
50
- * `world.ts` as intended. The split keeps `@workflow/world-vercel`,
51
- * `@workflow/world-local`, `cbor-x`, and other server-only deps out of
52
- * the workflow sandbox bundle.
53
- *
54
- * # Why we keep the `getWorldLazy` dynamic-import fallback
55
- *
56
- * The fallback remains in `./get-world-lazy.ts` as a defense-in-depth for
57
- * environments we haven't accounted for (CJS test runners, scripts that
58
- * import `start` without going through `workflow/api`, future bundlers
59
- * with stricter tree-shaking). With this init module in place, the
60
- * fallback should never fire in normal use — but if it does, the
61
- * dynamic-import branch still resolves correctly when `world.js` is
62
- * physically adjacent on disk (e.g., direct Node.js execution of
63
- * unbundled source).
37
+ * `world.ts` as intended. The split keeps the configured world package
38
+ * and other server-only deps out of the workflow sandbox bundle.
64
39
  *
65
40
  * # Maintenance notes
66
41
  *
67
42
  * If you add another `getWorldLazy()` consumer that's reachable from a
68
- * host route without going through `workflow/api` (e.g., a new helper in
69
- * `workflow/runtime`), make sure that entry also imports this module —
70
- * or that it transitively reaches `world.ts` via a non-tree-shakeable
71
- * path. Adding a regression test in `world-init.test.ts` is preferred to
72
- * relying on careful manual tracing.
43
+ * host route without going through `workflow` or `workflow/api`, make
44
+ * sure that entry also imports this module — or that it transitively
45
+ * reaches `world.ts` via a non-tree-shakeable path. Adding a regression
46
+ * test in `world-init.test.ts` is preferred to relying on careful manual
47
+ * tracing.
73
48
  */
74
49
  import './world.js';
75
50
  //# sourceMappingURL=world-init.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { World } from '#compiled/@workflow/world/index.js';
2
+ /**
3
+ * Unaliased target stub.
4
+ *
5
+ * Framework integrations alias this module to the configured world package at
6
+ * build time, including the default local world. Reaching this file means that
7
+ * static injection did not happen, so fail loudly instead of importing a
8
+ * fallback world that bundlers could retain alongside the configured one.
9
+ */
10
+ export declare function createWorld(): World | Promise<World>;
11
+ //# sourceMappingURL=world-target.d.ts.map
@@ -1,15 +1,27 @@
1
1
  import type { World } from '#compiled/@workflow/world/index.js';
2
+ export type WorldFactoryModule = {
3
+ createWorld?: () => World | Promise<World>;
4
+ /** @deprecated World packages should export `createWorld()` instead. */
5
+ createLocalWorld?: () => World | Promise<World>;
6
+ /** @deprecated World packages should export `createWorld()` instead. */
7
+ createVercelWorld?: () => World | Promise<World>;
8
+ default?: (() => World | Promise<World>) | World;
9
+ };
2
10
  /**
3
- * Create a new world instance based on environment variables.
4
- * WORKFLOW_TARGET_WORLD is used to determine the target world.
11
+ * Create a World instance from a world factory module. Shared by
12
+ * `createWorld()` (for the statically injected target world module) and
13
+ * tooling that loads a world module dynamically (e.g. the Nitro dev
14
+ * handler and `@workflow/world-testing`). Legacy world-specific factory
15
+ * names are still accepted for compatibility, but world packages should
16
+ * export `createWorld()`.
17
+ */
18
+ export declare function createWorldFromModule(mod: WorldFactoryModule): World | Promise<World>;
19
+ /**
20
+ * Create a new world instance from the statically imported target world module.
5
21
  *
6
- * Note: WORKFLOW_VERCEL_* env vars (PROJECT, TEAM, AUTH_TOKEN, etc.) are
7
- * intentionally NOT read here. Those are for CLI/observability tooling only
8
- * and should not affect runtime behavior. The Vercel runtime provides
9
- * authentication via OIDC tokens and project context via system env vars
10
- * (VERCEL_DEPLOYMENT_ID, VERCEL_PROJECT_ID). Tooling that needs these env
11
- * vars should call createVercelWorld() directly with an explicit config and
12
- * use setWorld() to inject the instance.
22
+ * Framework integrations alias `@workflow/core/runtime/world-target` to the
23
+ * concrete world package at build time, so bundlers see a static import path
24
+ * instead of tracing a runtime-built require/import expression.
13
25
  */
14
26
  export declare const createWorld: () => Promise<World>;
15
27
  export type WorldHandlers = Pick<World, 'createQueueHandler' | 'specVersion'>;
@@ -6,7 +6,7 @@ export { getHookByToken, resumeHook, resumeWebhook, } from './runtime/resume-hoo
6
6
  export { getRun, Run, type WorkflowReadableStream, type WorkflowReadableStreamOptions, } from './runtime/run.js';
7
7
  export { cancelRun, listStreams, type ReadStreamOptions, type RecreateRunOptions, readStream, recreateRunFromExisting, reenqueueRun, type StopSleepOptions, type StopSleepResult, wakeUpRun, } from './runtime/runs.js';
8
8
  export { type StartOptions, type StartOptionsBase, type StartOptionsWithDeploymentId, type StartOptionsWithoutDeploymentId, start, } from './runtime/start.js';
9
- export { createWorld, getWorld, getWorldHandlers, setWorld, } from './runtime/world.js';
9
+ export { createWorld, createWorldFromModule, getWorld, getWorldHandlers, setWorld, type WorldFactoryModule, } from './runtime/world.js';
10
10
  /**
11
11
  * Creates a single route which handles workflow execution requests,
12
12
  * executing steps inline when possible to reduce function invocations
@@ -21,5 +21,6 @@ export { createWorld, getWorld, getWorldHandlers, setWorld, } from './runtime/wo
21
21
  export declare function workflowEntrypoint(workflowCode: string, options?: {
22
22
  namespace?: string;
23
23
  routeModuleBodyStartedAt?: number;
24
+ basePath?: string;
24
25
  }): (req: Request) => Promise<Response>;
25
26
  //# sourceMappingURL=runtime.d.ts.map