eve 0.64.1 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/src/channel/resolve-text.d.ts +11 -7
- package/dist/src/channel/resolve-text.js +1 -1
- package/dist/src/channel/types.d.ts +4 -5
- package/dist/src/chunks/{use-eve-agent-BdKlQF32.js → use-eve-agent-BIouJCii.js} +2 -10
- package/dist/src/chunks/{use-eve-agent-IIuxkn6y.js → use-eve-agent-BRvEh9sO.js} +2 -10
- package/dist/src/cli/dev/command-options.d.ts +1 -0
- package/dist/src/cli/dev/command.js +2 -2
- package/dist/src/cli/dev/local-server-process.js +1 -1
- package/dist/src/cli/dev/tui/blocks.d.ts +1 -1
- package/dist/src/cli/dev/tui/blocks.js +1 -1
- package/dist/src/cli/dev/tui/question-panel.d.ts +3 -2
- package/dist/src/cli/dev/tui/rail.d.ts +1 -1
- package/dist/src/cli/dev/tui/terminal-renderer.js +11 -12
- package/dist/src/cli/dev/tui/theme.d.ts +1 -1
- package/dist/src/cli/dev/tui/tool-presentation.d.ts +4 -4
- package/dist/src/cli/dev/tui/tool-presentation.js +1 -1
- package/dist/src/client/agent-info-schema.d.ts +0 -2
- package/dist/src/client/agent-info-schema.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -2
- package/dist/src/compiler/artifacts.d.ts +2 -0
- package/dist/src/compiler/artifacts.js +1 -1
- package/dist/src/compiler/bundled-extension.d.ts +17 -0
- package/dist/src/compiler/bundled-extension.js +1 -0
- package/dist/src/compiler/compile-agent.d.ts +4 -0
- package/dist/src/compiler/compile-agent.js +1 -1
- package/dist/src/compiler/compile-from-memory.js +1 -1
- package/dist/src/compiler/development-extensions.d.ts +23 -0
- package/dist/src/compiler/development-extensions.js +1 -0
- package/dist/src/compiler/extension-compatibility.d.ts +2 -2
- package/dist/src/compiler/extension-compatibility.js +1 -1
- package/dist/src/compiler/load-binding-namespace.js +1 -1
- package/dist/src/compiler/manifest.js +1 -1
- package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
- package/dist/src/compiler/normalize-manifest-types.d.ts +23 -0
- package/dist/src/compiler/normalize-manifest-types.js +1 -0
- package/dist/src/compiler/normalize-manifest.d.ts +2 -7
- package/dist/src/compiler/normalize-manifest.js +1 -1
- package/dist/src/compiler/source-graph-paths.d.ts +2 -0
- package/dist/src/compiler/source-graph-paths.js +1 -0
- package/dist/src/compiler/source-graph.d.ts +4 -1
- package/dist/src/compiler/source-graph.js +1 -1
- package/dist/src/context/dynamic-skill-lifecycle.js +1 -1
- package/dist/src/discover/bundled-extension.d.ts +11 -0
- package/dist/src/discover/bundled-extension.js +1 -0
- package/dist/src/discover/discover-agent.js +1 -1
- package/dist/src/discover/manifest.d.ts +5 -0
- package/dist/src/evals/assertions/collector.js +1 -1
- package/dist/src/evals/cli/eval.js +2 -2
- package/dist/src/evals/runner/artifacts.js +1 -1
- package/dist/src/evals/types.d.ts +2 -0
- package/dist/src/execution/coordination-dispatch-step.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/node-step.d.ts +2 -4
- package/dist/src/execution/node-step.js +1 -1
- package/dist/src/execution/proxied-deliver-step.js +1 -1
- package/dist/src/execution/sandbox/glob-tool.js +1 -1
- package/dist/src/execution/sandbox/grep-tool.js +1 -1
- package/dist/src/execution/sandbox/read-file.js +1 -1
- package/dist/src/execution/session-workflow-tool-run.js +1 -1
- package/dist/src/execution/tasks/parent/tool-execution.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/execution/tools/ask-question-workflow.d.ts +11 -0
- package/dist/src/execution/tools/ask-question-workflow.js +1 -0
- package/dist/src/execution/tools/ask-question.d.ts +20 -0
- package/dist/src/execution/tools/ask-question.js +2 -0
- package/dist/src/execution/tools/file-state.d.ts +1 -7
- package/dist/src/execution/tools/file-state.js +1 -1
- package/dist/src/execution/tools/sleep-workflow.js +1 -1
- package/dist/src/execution/tools/workflow/answer.d.ts +2 -0
- package/dist/src/execution/tools/workflow/answer.js +1 -1
- package/dist/src/execution/tools/workflow/ask.d.ts +3 -2
- package/dist/src/execution/tools/workflow/ask.js +1 -1
- package/dist/src/execution/tools/workflow/body.d.ts +5 -0
- package/dist/src/execution/tools/workflow/body.js +1 -1
- package/dist/src/execution/tools/workflow/cancel.d.ts +0 -4
- package/dist/src/execution/tools/workflow/cancel.js +1 -1
- package/dist/src/execution/tools/workflow/start.d.ts +1 -0
- package/dist/src/execution/tools/workflow/start.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/compaction-prompt.d.ts +0 -6
- package/dist/src/harness/compaction-prompt.js +2 -2
- package/dist/src/harness/compaction.js +1 -1
- package/dist/src/harness/hitl/approval-input-requests.d.ts +0 -2
- package/dist/src/harness/hitl/approval-input-requests.js +1 -1
- package/dist/src/harness/input-extraction.d.ts +4 -15
- package/dist/src/harness/input-extraction.js +1 -1
- package/dist/src/harness/input-request-class.d.ts +0 -20
- package/dist/src/harness/input-request-class.js +1 -1
- package/dist/src/harness/input-requests.d.ts +1 -1
- package/dist/src/harness/input-requests.js +1 -1
- package/dist/src/harness/pending-input-batches.d.ts +1 -1
- package/dist/src/harness/proxy-input-requests.d.ts +9 -1
- package/dist/src/harness/proxy-input-requests.js +1 -1
- package/dist/src/harness/stale-input-responses.d.ts +1 -2
- package/dist/src/harness/stale-input-responses.js +1 -1
- package/dist/src/harness/tool-loop.js +2 -2
- package/dist/src/harness/tools.d.ts +0 -9
- package/dist/src/harness/tools.js +1 -1
- package/dist/src/harness/types.d.ts +2 -9
- package/dist/src/internal/application/package.js +1 -1
- package/dist/src/internal/authored-definition/schema-backed.js +1 -1
- package/dist/src/internal/authored-module-loader.js +1 -1
- package/dist/src/internal/development-programmatic-source-loader.d.ts +6 -0
- package/dist/src/internal/development-programmatic-source-loader.js +1 -0
- package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -1
- package/dist/src/internal/nitro/host/create-application-nitro.js +1 -1
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.d.ts +2 -0
- package/dist/src/internal/nitro/host/dev-authored-rebuild-coordinator.js +1 -1
- package/dist/src/internal/nitro/host/dev-workspace-extensions.js +1 -1
- package/dist/src/internal/nitro/host/prepare-application-host.d.ts +2 -0
- package/dist/src/internal/nitro/host/prepare-application-host.js +1 -1
- package/dist/src/internal/nitro/host/start-development-server.js +2 -2
- package/dist/src/internal/nitro/host/types.d.ts +3 -0
- package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +1 -1
- package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +0 -2
- package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -1
- package/dist/src/public/tools/ask-question.d.ts +1 -1
- package/dist/src/public/tools/ask-question.js +1 -1
- package/dist/src/runtime/agent/mock-model-fixtures.js +2 -2
- package/dist/src/self-modification/extension/subagents/agent/instructions.js +6 -2
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/input.d.ts +1 -6
- package/dist/src/subagents/hitl-proxy.d.ts +11 -1
- package/dist/src/subagents/hitl-proxy.js +1 -1
- package/dist/src/svelte/index.js +1 -1
- package/dist/src/svelte/use-eve-agent.js +1 -1
- package/dist/src/tools/behavior.d.ts +2 -5
- package/dist/src/tools/definition.d.ts +23 -5
- package/dist/src/tools/provided/ask-question.d.ts +18 -0
- package/dist/src/tools/provided/ask-question.js +1 -0
- package/dist/src/tools/provided/sleep.d.ts +2 -2
- package/dist/src/vue/index.js +1 -1
- package/dist/src/vue/use-eve-agent.js +1 -1
- package/docs/agent-config.md +11 -11
- package/docs/concepts/built-in-tools.md +16 -66
- package/docs/concepts/default-harness.md +1 -3
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +2 -2
- package/docs/evals/assertions.mdx +2 -2
- package/docs/evals/judge.mdx +3 -3
- package/docs/getting-started.mdx +1 -1
- package/docs/guides/dev-tui.md +1 -1
- package/docs/guides/evaluate.md +12 -9
- package/docs/guides/frontend/overview.mdx +1 -1
- package/docs/reference/cli.md +10 -7
- package/docs/reference/typescript-api.md +42 -41
- package/docs/skills.mdx +2 -0
- package/docs/subagents/index.mdx +7 -5
- package/docs/tools/human-in-the-loop.md +22 -11
- package/docs/tools/workflows.mdx +44 -19
- package/docs/tutorial/guard-the-spend.mdx +1 -1
- package/package.json +1 -9
- package/dist/src/cli/dev/tui/todo-panel.d.ts +0 -44
- package/dist/src/cli/dev/tui/todo-panel.js +0 -1
- package/dist/src/compiled/@workflow/builders/LICENSE.md +0 -201
- package/dist/src/compiled/@workflow/builders/index.d.ts +0 -62
- package/dist/src/compiled/@workflow/builders/index.js +0 -1
- package/dist/src/execution/compaction.d.ts +0 -14
- package/dist/src/execution/compaction.js +0 -1
- package/dist/src/execution/tools/todo.d.ts +0 -91
- package/dist/src/execution/tools/todo.js +0 -2
- package/dist/src/harness/hitl/question-input-requests.d.ts +0 -15
- package/dist/src/harness/hitl/question-input-requests.js +0 -1
- package/dist/src/harness/request-input-tool.d.ts +0 -4
- package/dist/src/harness/request-input-tool.js +0 -1
- package/dist/src/public/tools/todo.d.ts +0 -3
- package/dist/src/public/tools/todo.js +0 -1
- package/dist/src/tools/framework/ask-question.d.ts +0 -38
- package/dist/src/tools/framework/ask-question.js +0 -1
- package/dist/src/tools/provided/todo.d.ts +0 -8
- package/dist/src/tools/provided/todo.js +0 -2
|
@@ -39,7 +39,7 @@ export default defineTool({
|
|
|
39
39
|
|
|
40
40
|
By default, omitted `approval` behaves like `never()`, so tool calls may execute without human approval. Require human approval or other safeguards for sensitive, irreversible, regulated, financial, healthcare, employment, housing, legal, safety-impacting, user-impacting, or external side-effecting actions.
|
|
41
41
|
|
|
42
|
-
`auto()` uses an [AI SDK evaluation model](/docs/guides/evaluate) to classify each call as `clear` or `caution`. It defaults to `typesafe-ai/jev
|
|
42
|
+
`auto()` uses an [AI SDK evaluation model](/docs/guides/evaluate) to classify each call as `clear` or `caution`. It defaults to `typesafe-ai/jev`, TypeSafe AI's [Jev evaluation model](https://vercel.com/i/what-is-jev). Like `evaluate`, a model string uses Vercel AI Gateway unless the application configures a global AI SDK default provider:
|
|
43
43
|
|
|
44
44
|
```ts
|
|
45
45
|
approval: auto({ model: "typesafe-ai/jev" });
|
|
@@ -150,27 +150,38 @@ export default defineTool({
|
|
|
150
150
|
|
|
151
151
|
## Questions
|
|
152
152
|
|
|
153
|
-
The
|
|
153
|
+
The `ask_question` tool lets the model pause and ask the user one question, rather than guessing. The model calls it with `{ question, options? }`:
|
|
154
154
|
|
|
155
|
-
- `
|
|
156
|
-
- `options`:
|
|
157
|
-
- `allowFreeform`: whether the user may answer with free text instead of picking an option.
|
|
155
|
+
- `question`: the question to put to the user, with the context needed to answer it.
|
|
156
|
+
- `options`: two or three mutually exclusive choices, each with a `label` and a one-sentence `description`. Channels render these as buttons or a select menu. Omit `options` for an open-ended question.
|
|
158
157
|
|
|
159
|
-
|
|
158
|
+
The user can always type their own answer instead of picking an option, so the model never needs an "Other" option. The tool returns `{ status: "answered", answer }` with the chosen option's label or the user's words, `{ status: "dismissed" }` when the user moved on without answering, or `{ status: "unavailable" }` when the session cannot request input.
|
|
159
|
+
|
|
160
|
+
`ask_question` is an [opt-in framework tool](/docs/concepts/built-in-tools#ask_question). Add it with `eve add tool/ask_question`, which creates this file:
|
|
161
|
+
|
|
162
|
+
```ts title="agent/tools/ask_question.ts"
|
|
163
|
+
import { askQuestion } from "eve/tools/ask_question";
|
|
164
|
+
|
|
165
|
+
export default askQuestion();
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`ask_question` is an ordinary [workflow tool](/docs/tools/workflows) built on `ctx.ask()`. Write your own workflow tool with `ctx.ask()` when you need a different schema or want to act on the answer in the same call. Without any asking tool, the model asks in its reply text and the user's next message carries the answer.
|
|
160
169
|
|
|
161
170
|
## How pause and resume works
|
|
162
171
|
|
|
163
172
|
Approvals and questions share one protocol:
|
|
164
173
|
|
|
165
|
-
1.
|
|
174
|
+
1. A tool call needs approval, or a workflow tool such as `ask_question` calls `ctx.ask()`.
|
|
166
175
|
2. eve emits an `input.requested` stream event carrying the pending requests.
|
|
167
176
|
3. The turn parks at `session.waiting`, durably, for as long as it takes.
|
|
168
177
|
4. The client answers with `inputResponses` (structured, keyed by `requestId`) or a normal follow-up `message`. A follow-up whose text matches an option ID, option label, or numeric option index resolves automatically, including approval options such as `approve` and `cancel`.
|
|
169
178
|
|
|
179
|
+
For `ctx.ask()` questions from blocking tools, a follow-up message answers the question only when exactly one question is pending. The message must match an option, or the question must allow free text. Otherwise the message reaches the model as a normal turn, and each pending question created with `dismissible: true` resolves as `dismissed`. Questions from background tools and subagents need a structured response.
|
|
180
|
+
|
|
170
181
|
Each request includes a `kind` discriminator: `tool-approval`, `question`, or
|
|
171
|
-
`session-limit`. Clients should use `kind` to choose behavior and presentation
|
|
172
|
-
`
|
|
173
|
-
semantics.
|
|
182
|
+
`session-limit`. Clients should use `kind` to choose behavior and presentation.
|
|
183
|
+
`requestId` identifies the request to answer, and `action.callId` identifies the
|
|
184
|
+
tool call that raised it; neither encodes the request's semantics.
|
|
174
185
|
|
|
175
186
|
The run picks back up exactly where it parked. Because the pause is durable, nothing is held in memory while it waits — the process can restart and the parked turn survives.
|
|
176
187
|
|
|
@@ -189,7 +200,7 @@ From your own frontend, scan all messages for pending requests and answer throug
|
|
|
189
200
|
## What to read next
|
|
190
201
|
|
|
191
202
|
- [Tools](/docs/tools): define the typed actions an approval gates
|
|
192
|
-
- [Built-in tools](/docs/concepts/built-in-tools): the default tools
|
|
203
|
+
- [Built-in tools](/docs/concepts/built-in-tools): the default tools and opt-in tools such as `ask_question`
|
|
193
204
|
- [Sessions, runs & streaming](/docs/concepts/sessions-runs-and-streaming): the event and resume contract behind the pause
|
|
194
205
|
- [Building a frontend](/docs/guides/frontend/overview): render and answer requests from your own UI
|
|
195
206
|
- [Multi-tenant approvals](/docs/patterns/multi-tenant-approvals): resolve per-tenant approval policy for authored and connection tools
|
package/docs/tools/workflows.mdx
CHANGED
|
@@ -44,7 +44,7 @@ export default defineWorkflowTool({
|
|
|
44
44
|
],
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
-
if (answer.optionId !== "approve") {
|
|
47
|
+
if (answer.status !== "answered" || answer.optionId !== "approve") {
|
|
48
48
|
return { deployed: false, reason: "rejected" };
|
|
49
49
|
}
|
|
50
50
|
return { deployed: true, url: await applyDeploy(plan) };
|
|
@@ -277,12 +277,30 @@ const answer = await ctx.ask({
|
|
|
277
277
|
display?: "confirmation" | "select" | "text",
|
|
278
278
|
options?: { id: string; label: string; description?: string; style?: "primary" | "danger" | "default" }[],
|
|
279
279
|
allowFreeform?: boolean,
|
|
280
|
-
|
|
280
|
+
dismissible?: boolean,
|
|
281
|
+
});
|
|
282
|
+
// | { status: "answered"; optionId?: string; text?: string }
|
|
283
|
+
// | { status: "dismissed" }
|
|
284
|
+
// | { status: "unavailable" }
|
|
281
285
|
```
|
|
282
286
|
|
|
283
287
|
`ctx.ask` publishes an `input.requested` event on the session — rendered the way channels render
|
|
284
|
-
|
|
285
|
-
|
|
288
|
+
tool approvals — and returns an awaitable answer. Awaiting it suspends the run until a response arrives.
|
|
289
|
+
The `ask_question` tool is a workflow tool built on `ctx.ask`.
|
|
290
|
+
|
|
291
|
+
The answer's `status` tells the body what happened:
|
|
292
|
+
|
|
293
|
+
- `answered`: the person picked an option (`optionId`) or typed a reply (`text`).
|
|
294
|
+
- `dismissed`: the request set `dismissible: true` and the person sent a message that did not answer
|
|
295
|
+
it. The message reaches the agent as a normal turn. Only blocking tools can be dismissed this way.
|
|
296
|
+
- `unavailable`: the session cannot request input, such as a scheduled run. `ctx.ask` returns this
|
|
297
|
+
immediately instead of waiting for an answer no one can give.
|
|
298
|
+
|
|
299
|
+
A plain follow-up message answers the request when it is the only pending question and the message
|
|
300
|
+
matches an option or the request allows free text. This applies to blocking tools only: answer a
|
|
301
|
+
question from a background tool or a subagent with a structured response.
|
|
302
|
+
|
|
303
|
+
`ctx.ask` composes with the SDK's own constructs; race it against a deadline:
|
|
286
304
|
|
|
287
305
|
```ts
|
|
288
306
|
const pending = ctx.ask({ prompt: `Deploy ${service}?`, options: APPROVE_OR_CANCEL });
|
|
@@ -290,13 +308,16 @@ const answer = await Promise.race([pending, sleep("4h")]);
|
|
|
290
308
|
if (answer === undefined) return { deployed: false, reason: "timed out" };
|
|
291
309
|
```
|
|
292
310
|
|
|
293
|
-
- The request belongs to the run, not the turn. It stays answerable until it is answered
|
|
294
|
-
ends. In a background tool that means long after the turn that started it.
|
|
311
|
+
- The request belongs to the run, not the turn. It stays answerable until it is answered, dismissed,
|
|
312
|
+
or the run ends. In a background tool that means long after the turn that started it.
|
|
295
313
|
- A request is answered once. Ask again for the next answer.
|
|
314
|
+
- Choose option `id`s that read well on their own, such as `approve` or the option's label. A
|
|
315
|
+
response carries only the `id`. If a person answers after the request has already resolved, for
|
|
316
|
+
example from an old Slack menu, the agent receives the `id` as a new message, not the label.
|
|
296
317
|
- Ending the run, by returning, throwing, or cancellation, withdraws its pending requests.
|
|
297
318
|
- Several requests may be outstanding at once.
|
|
298
|
-
- A response never steers. A new human message
|
|
299
|
-
normal `turnPolicy`.
|
|
319
|
+
- A response never steers. A new human message that does not answer a pending request follows the
|
|
320
|
+
session's normal `turnPolicy`.
|
|
300
321
|
|
|
301
322
|
Compare the [`approval`](/docs/human-in-the-loop) policy, which gates the call before `execute` runs
|
|
302
323
|
and can only show the model's input. Both compose: `approval` before the run, `ctx.ask` inside it.
|
|
@@ -322,9 +343,9 @@ The first argument is an available agent target. On the root agent, `"agent"` st
|
|
|
322
343
|
continue an existing child. An inline `outputSchema` requires structured output and determines the
|
|
323
344
|
return type, so `result` in the example is typed as `{ findings: string[] }`.
|
|
324
345
|
|
|
325
|
-
### Route to a hidden subagent with
|
|
346
|
+
### Route to a hidden subagent with Jev
|
|
326
347
|
|
|
327
|
-
Use an authored workflow tool when the parent model should decide to delegate, but
|
|
348
|
+
Use an authored workflow tool when the parent model should decide to delegate, but [Jev](https://vercel.com/i/what-is-jev) should choose the specialist. Set `tool: false` on each specialist so the parent model sees only the routing tool. The specialists remain available through `ctx.agents` and callable through `ctx.agent()`.
|
|
328
349
|
|
|
329
350
|
If the router may select the root-copy `agent`, author a root `description` that explains which work should stay with a copy of the root. `ctx.agents.agent` always exists in a top-level root workflow, but its `description` is an empty string when omitted from `agent.ts`. `agentRouter()` considers only entries with a non-empty description, so it does not route to an undescribed root copy.
|
|
330
351
|
|
|
@@ -333,7 +354,7 @@ import { defineAgent } from "eve";
|
|
|
333
354
|
|
|
334
355
|
export default defineAgent({
|
|
335
356
|
description: "Coordinate cross-specialist tasks that need the root agent's complete toolset.",
|
|
336
|
-
model: "anthropic/claude-opus-
|
|
357
|
+
model: "anthropic/claude-opus-5.5",
|
|
337
358
|
});
|
|
338
359
|
```
|
|
339
360
|
|
|
@@ -342,7 +363,7 @@ import { defineAgent } from "eve";
|
|
|
342
363
|
|
|
343
364
|
export default defineAgent({
|
|
344
365
|
description: "Investigation, analysis, and explanation",
|
|
345
|
-
model: "anthropic/claude-opus-
|
|
366
|
+
model: "anthropic/claude-opus-5.5",
|
|
346
367
|
tool: false,
|
|
347
368
|
});
|
|
348
369
|
```
|
|
@@ -352,12 +373,12 @@ import { defineAgent } from "eve";
|
|
|
352
373
|
|
|
353
374
|
export default defineAgent({
|
|
354
375
|
description: "Execution and operational changes",
|
|
355
|
-
model: "openai/gpt-
|
|
376
|
+
model: "openai/gpt-6-sol",
|
|
356
377
|
tool: false,
|
|
357
378
|
});
|
|
358
379
|
```
|
|
359
380
|
|
|
360
|
-
Define the model-visible router under `agent/tools/`. Build the
|
|
381
|
+
Define the model-visible router under `agent/tools/`. Build the Jev criteria from the subagents' effective descriptions, then pass its typed choice directly to `ctx.agent()`:
|
|
361
382
|
|
|
362
383
|
```ts title="agent/tools/agent-router.ts"
|
|
363
384
|
import { evaluate } from "eve/ai";
|
|
@@ -406,7 +427,7 @@ export default defineWorkflowTool({
|
|
|
406
427
|
});
|
|
407
428
|
```
|
|
408
429
|
|
|
409
|
-
The evaluation runs in a step so workflow replay records its result instead of making the routing request again. The parent model receives `agent-router`, but not `researcher` or `operator`.
|
|
430
|
+
The evaluation runs in a step so workflow replay records its result instead of making the routing request again. The parent model receives `agent-router`, but not `researcher` or `operator`. Jev returns the typed `"researcher" | "operator"` choice, and the selected subagent's result becomes the `agent-router` tool result.
|
|
410
431
|
|
|
411
432
|
`ctx.agents` is a replay-stable metadata snapshot taken when the workflow starts. In a top-level root workflow, `ctx.agents.agent` always represents the root-copy target and carries the root's authored `description` when provided. The snapshot also includes declared agents hidden from the parent model with `tool: false` or `disableTool()`, but exposes no model definitions, credentials, or callbacks. A delegated root copy omits `agent`, so `agentRouter()` cannot select another root copy recursively. Invocation still checks each target's availability through `ctx.agent()`.
|
|
412
433
|
|
|
@@ -420,11 +441,11 @@ import { agentRouter } from "eve/tools/agent-router";
|
|
|
420
441
|
export default agentRouter();
|
|
421
442
|
```
|
|
422
443
|
|
|
423
|
-
Its input is `{ message: string, outputSchema?: object }`. `agentRouter()` ignores entries without a non-empty description. With two or more described targets, it sends the message and effective descriptions to
|
|
444
|
+
Its input is `{ message: string, outputSchema?: object }`. `agentRouter()` ignores entries without a non-empty description. With two or more described targets, it sends the message and effective descriptions to Jev, then invokes the selected name through `ctx.agent()`. It invokes a sole target without evaluation and forwards an optional `outputSchema` unchanged. In a top-level root session, the candidates include the root-copy `agent`; delegated root copies and declared subagent contexts include only their declared targets.
|
|
424
445
|
|
|
425
446
|
When an authored tool accepts a JSON Schema supplied by the model, represent that input with a permissive object such as `z.looseObject({})`. Avoid `z.record(z.string(), z.json())`: its generated JSON Schema uses `propertyNames`, which OpenAI does not support. Validate the supplied value at the point where your tool consumes it.
|
|
426
447
|
|
|
427
|
-
This pattern controls specialist selection, not whether the parent model delegates at all. Route before the parent model runs if every incoming request must go through
|
|
448
|
+
This pattern controls specialist selection, not whether the parent model delegates at all. Route before the parent model runs if every incoming request must go through Jev.
|
|
428
449
|
|
|
429
450
|
## Report progress: `yield`
|
|
430
451
|
|
|
@@ -515,7 +536,9 @@ async execute({ service }, ctx) {
|
|
|
515
536
|
}
|
|
516
537
|
|
|
517
538
|
if (answer === undefined) return { deployed: false, reason: "timed out" };
|
|
518
|
-
if (answer.
|
|
539
|
+
if (answer.status !== "answered" || answer.optionId !== "approve") {
|
|
540
|
+
return { deployed: false, reason: "rejected" };
|
|
541
|
+
}
|
|
519
542
|
return { deployed: true, url: await applyDeploy(plan) };
|
|
520
543
|
}
|
|
521
544
|
```
|
|
@@ -574,7 +597,9 @@ export default defineWorkflowTool({
|
|
|
574
597
|
],
|
|
575
598
|
});
|
|
576
599
|
|
|
577
|
-
if (decision.optionId !== "approve")
|
|
600
|
+
if (decision.status !== "answered" || decision.optionId !== "approve") {
|
|
601
|
+
return { refunded: false };
|
|
602
|
+
}
|
|
578
603
|
return { refunded: true, receipt: await issueRefund(orderId, amount) };
|
|
579
604
|
},
|
|
580
605
|
});
|
|
@@ -55,7 +55,7 @@ The model proposes the query, `approval` returns `"user-approval"`, and the turn
|
|
|
55
55
|
|
|
56
56
|
Each session has exactly one active continuation. Answer an approval against a stale handle and it's rejected, so there's no way to double-resume the same parked turn.
|
|
57
57
|
|
|
58
|
-
The same machinery backs the
|
|
58
|
+
The same machinery backs the opt-in `ask_question` tool, where the model asks you mid-turn, and per-connection approval via `approval: once()`. See [Tools and human-in-the-loop](../tools).
|
|
59
59
|
|
|
60
60
|
→ Next: [Ship it](./ship-it)
|
|
61
61
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eve",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Filesystem-first framework for durable backend AI agents that run anywhere.",
|
|
6
6
|
"keywords": [
|
|
@@ -167,11 +167,6 @@
|
|
|
167
167
|
"import": "./dist/src/public/tools/write-file.js",
|
|
168
168
|
"default": "./dist/src/public/tools/write-file.js"
|
|
169
169
|
},
|
|
170
|
-
"./tools/todo": {
|
|
171
|
-
"types": "./dist/src/public/tools/todo.d.ts",
|
|
172
|
-
"import": "./dist/src/public/tools/todo.js",
|
|
173
|
-
"default": "./dist/src/public/tools/todo.js"
|
|
174
|
-
},
|
|
175
170
|
"./tools/web_fetch": {
|
|
176
171
|
"types": "./dist/src/public/tools/web-fetch.d.ts",
|
|
177
172
|
"import": "./dist/src/public/tools/web-fetch.js",
|
|
@@ -501,11 +496,9 @@
|
|
|
501
496
|
"@vercel/otel": "2.1.3",
|
|
502
497
|
"@vercel/sandbox": "3.3.0",
|
|
503
498
|
"@vercel/sdk": "1.28.8",
|
|
504
|
-
"@workflow/builders": "5.0.0-beta.55",
|
|
505
499
|
"@workflow/core": "5.0.0-beta.55",
|
|
506
500
|
"@workflow/errors": "5.0.0-beta.22",
|
|
507
501
|
"@workflow/serde": "5.0.0-beta.2",
|
|
508
|
-
"@workflow/utils": "5.0.0-beta.10",
|
|
509
502
|
"@workflow/world": "5.0.0-beta.37",
|
|
510
503
|
"@workflow/world-local": "5.0.0-beta.46",
|
|
511
504
|
"@workflow/world-vercel": "5.0.0-beta.50",
|
|
@@ -518,7 +511,6 @@
|
|
|
518
511
|
"env-runner": "0.1.16",
|
|
519
512
|
"eventsource-parser": "3.1.0",
|
|
520
513
|
"gray-matter": "4.0.3",
|
|
521
|
-
"historical-eve-0-30-8": "npm:eve@0.30.8",
|
|
522
514
|
"jose": "6.2.3",
|
|
523
515
|
"jsonc-parser": "3.3.1",
|
|
524
516
|
"just-bash": "3.1.0",
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The pinned todo panel: pure parsing and rendering for the task list the
|
|
3
|
-
* model maintains through the framework `todo` tool. The tool writes the
|
|
4
|
-
* whole list on every call, so the panel is driven entirely from tool-call
|
|
5
|
-
* inputs — no protocol addition and no durable client state. The renderer
|
|
6
|
-
* owns lifecycle (when a call updates the panel, when the finished list
|
|
7
|
-
* commits to the transcript); this module only reads inputs and paints rows.
|
|
8
|
-
*/
|
|
9
|
-
import type { Theme } from "./theme.js";
|
|
10
|
-
/** One panel row parsed from the `todo` tool's replacement-write input. */
|
|
11
|
-
export interface TodoPanelItem {
|
|
12
|
-
readonly content: string;
|
|
13
|
-
readonly status: "pending" | "in_progress" | "completed" | "cancelled";
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Extracts the panel items from a tool call when — and only when — it is a
|
|
17
|
-
* `todo` replacement write. Read-only calls (no `todos`) and malformed items
|
|
18
|
-
* return `undefined` so they fall through to the ordinary tool block.
|
|
19
|
-
*/
|
|
20
|
-
export declare function readTodoToolItems(toolName: string, input: unknown): TodoPanelItem[] | undefined;
|
|
21
|
-
/** True when every item reached a terminal status (completed or cancelled). */
|
|
22
|
-
export declare function allTodoItemsSettled(items: readonly TodoPanelItem[]): boolean;
|
|
23
|
-
export interface TodoPanelRowsInput {
|
|
24
|
-
readonly items: readonly TodoPanelItem[];
|
|
25
|
-
readonly width: number;
|
|
26
|
-
readonly theme: Theme;
|
|
27
|
-
/** True while the turn is running: pulses the header and the active item. */
|
|
28
|
-
readonly working: boolean;
|
|
29
|
-
/** Current shared pulse frame (the glyph, or a space on the off beat). */
|
|
30
|
-
readonly pulse: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Paints the pinned panel, indented so its marks share the tool column.
|
|
34
|
-
* Settled items ride a `│` rail under the header; the
|
|
35
|
-
* first unsettled item closes the rail with `└` and everything after hangs
|
|
36
|
-
* indented — the list reads as progress flowing through the corner.
|
|
37
|
-
*/
|
|
38
|
-
export declare function renderTodoPanelRows(input: TodoPanelRowsInput): string[];
|
|
39
|
-
/**
|
|
40
|
-
* The transcript form of a finished list: every item checked on the rail,
|
|
41
|
-
* closed by `└ Done`. Committed verbatim (pre-styled rows) once every item
|
|
42
|
-
* settles.
|
|
43
|
-
*/
|
|
44
|
-
export declare function renderFinishedTodoRows(items: readonly TodoPanelItem[], width: number, theme: Theme): string[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rail.js";import{toolBaseName}from"./tool-presentation.js";import{clipVisible,stripTerminalControls}from"#cli/ui/terminal-text.js";const TODO_STATUSES=new Set([`pending`,`in_progress`,`completed`,`cancelled`]);function readTodoToolItems(e,t){if(toolBaseName(e)!==`todo`||typeof t!=`object`||!t||Array.isArray(t))return;let n=t.todos;if(!Array.isArray(n))return;let r=[];for(let e of n){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=t.content,i=t.status;if(typeof n!=`string`||typeof i!=`string`||!TODO_STATUSES.has(i))return;r.push({content:firstLine(stripTerminalControls(n)),status:i})}return r}function allTodoItemsSettled(e){return e.every(e=>e.status===`completed`||e.status===`cancelled`)}function renderTodoPanelRows(e){let{items:t,width:n,theme:r}=e,i=r.colors,a=r.glyph,o=t.filter(e=>e.status===`completed`||e.status===`cancelled`).length,s=[e.working?` ${i.gray(a.square)} ${i.dim(`Todo`)}`:` ${i.gray(a.square)} ${i.dim(`${o}/${t.length} tasks`)}`],c=!1;for(let n of t){let t=n.status===`completed`||n.status===`cancelled`,o;c?o=` `:t?o=i.dim(a.rule):(o=i.dim(a.corner),c=!0),s.push(` ${o} ${todoItemBody(n,e,r)}`)}return s.map(e=>clipVisible(e,n))}function renderFinishedTodoRows(e,t,n){let r=n.colors,i=n.glyph,a=[` ${r.green(i.success)} ${r.dim(`Todo`)}`];for(let t of e)a.push(` ${r.dim(i.rule)} ${settledMark(t,n)} ${r.dim(t.content)}`);return a.push(` ${r.dim(i.corner)} ${r.green(`Done`)}`),a.map(e=>clipVisible(e,t))}function settledMark(e,t){return e.status===`cancelled`?t.colors.red(t.glyph.error):t.colors.green(t.glyph.success)}function todoItemBody(e,t,n){let r=n.colors,i=n.glyph;switch(e.status){case`completed`:return`${r.green(i.success)} ${r.dim(e.content)}`;case`cancelled`:return`${r.red(i.error)} ${r.dim(e.content)}`;case`in_progress`:{let n=t.working?t.pulse.trim().length>0?i.dotActive:` `:i.dotActive;return`${r.yellow(n)} ${e.content}`}case`pending`:return`${r.dim(i.reasoning)} ${r.dim(e.content)}`}}function firstLine(e){return e.split(/\r?\n/u,1)[0]??``}export{allTodoItemsSettled,readTodoToolItems,renderFinishedTodoRows,renderTodoPanelRows};
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
<http://www.apache.org/licenses/>
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2025 Vercel Inc.
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared utilities for detecting files that need workflow transformation.
|
|
3
|
-
* Used by builders, rollup plugin, Next.js loader, and vite plugin.
|
|
4
|
-
*/
|
|
5
|
-
export declare const useWorkflowPattern: RegExp;
|
|
6
|
-
export declare const useStepPattern: RegExp;
|
|
7
|
-
export declare const workflowSerdeImportPattern: RegExp;
|
|
8
|
-
export declare const workflowSerdeSymbolPattern: RegExp;
|
|
9
|
-
export declare const workflowSerdeComputedPropertyPattern: RegExp;
|
|
10
|
-
export declare const generatedWorkflowPathPattern: RegExp;
|
|
11
|
-
/**
|
|
12
|
-
* Detects workflow-related patterns in source code.
|
|
13
|
-
*/
|
|
14
|
-
export interface WorkflowPatternMatch {
|
|
15
|
-
/** File contains 'use workflow' directive */
|
|
16
|
-
hasUseWorkflow: boolean;
|
|
17
|
-
/** File contains 'use step' directive */
|
|
18
|
-
hasUseStep: boolean;
|
|
19
|
-
/** File contains @workflow/serde import */
|
|
20
|
-
hasSerdeImport: boolean;
|
|
21
|
-
/** File contains Symbol.for('workflow-serialize') or Symbol.for('workflow-deserialize') */
|
|
22
|
-
hasSerdeSymbol: boolean;
|
|
23
|
-
/** File contains any directive ('use workflow' or 'use step') */
|
|
24
|
-
hasDirective: boolean;
|
|
25
|
-
/** File contains any serde pattern (import or Symbol.for) */
|
|
26
|
-
hasSerde: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Detects workflow-related patterns in source code.
|
|
30
|
-
* @param source - The source code to analyze
|
|
31
|
-
* @returns Object with flags for each detected pattern
|
|
32
|
-
*/
|
|
33
|
-
export declare function detectWorkflowPatterns(source: string): WorkflowPatternMatch;
|
|
34
|
-
/**
|
|
35
|
-
* Determines if a file path is a generated workflow route file.
|
|
36
|
-
* @param filePath - The file path to check
|
|
37
|
-
* @returns true if the file is a generated workflow route
|
|
38
|
-
*/
|
|
39
|
-
export declare function isGeneratedWorkflowFile(filePath: string): boolean;
|
|
40
|
-
/**
|
|
41
|
-
* Determines if a file should be transformed based on its path and content patterns.
|
|
42
|
-
*
|
|
43
|
-
* Logic:
|
|
44
|
-
* - Generated workflow route files are never transformed
|
|
45
|
-
* - Files with directives ('use workflow' or 'use step') are always transformed
|
|
46
|
-
* - Files with serde patterns are always transformed; the SWC plugin performs
|
|
47
|
-
* AST-level extraction/filtering to determine whether they actually define
|
|
48
|
-
* serde classes
|
|
49
|
-
*
|
|
50
|
-
* @param filePath - The file path to check
|
|
51
|
-
* @param patterns - The detected patterns from detectWorkflowPatterns()
|
|
52
|
-
* @returns true if the file should be transformed
|
|
53
|
-
*/
|
|
54
|
-
export declare function shouldTransformFile(filePath: string, patterns: WorkflowPatternMatch): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Combined regex pattern for turbopack content matching.
|
|
57
|
-
* Uses backreferences to ensure matching quote types.
|
|
58
|
-
* Matches: 'use workflow', 'use step', @workflow/serde imports, Symbol.for serialization symbols,
|
|
59
|
-
* and WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE computed property usage
|
|
60
|
-
*/
|
|
61
|
-
export declare const turbopackContentPattern: RegExp;
|
|
62
|
-
//# sourceMappingURL=transform-utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=/^\s*(['"])use workflow\1;?\s*$/m,t=/^\s*(['"])use step\1;?\s*$/m,n=/from\s+(['"])@workflow\/serde\1/,r=/Symbol\.for\s*\(\s*(['"])workflow-(?:serialize|deserialize)\1\s*\)/,i=/\[\s*WORKFLOW_(?:SERIALIZE|DESERIALIZE)\s*\]/,a=/`(?:\\[\s\S]|[^`\\])*`/g,o=/\/\*[\s\S]*?\*\/|\/\/[^\r\n]*/g,s=/^\s*(['"])(use workflow|use step)\1;?\s*$/,c=/^\s*(['"])[^'"]+\1;?\s*$/,l=/[/\\]\.well-known[/\\]workflow[/\\]/;function u(e,t){let n;for(let r of e.split(/\r?\n/)){let e=r.trim();if(e===``)continue;let i=s.exec(e);if(i){if(i[2]===t&&(n===void 0||n.endsWith(`{`)||c.test(n)))return!0;n=e;continue}n=e}return!1}function d(e){let t=(e.includes(`use workflow`)||e.includes(`use step`))&&(e.includes("`")||e.includes(`/`))?e.replace(a,e=>e.replace(/[^\r\n]/g,` `)).replace(o,e=>e.replace(/[^\r\n]/g,` `)):e,s=e.includes(`use workflow`)&&u(t,`use workflow`),c=e.includes(`use step`)&&u(t,`use step`),l=e.includes(`@workflow/serde`)&&n.test(e),d=(e.includes(`workflow-serialize`)||e.includes(`workflow-deserialize`))&&r.test(e),f=(e.includes(`WORKFLOW_SERIALIZE`)||e.includes(`WORKFLOW_DESERIALIZE`))&&i.test(e);return{hasUseWorkflow:s,hasUseStep:c,hasSerdeImport:l,hasSerdeSymbol:d,hasDirective:s||c,hasSerde:l||d||f}}function f(e){return l.test(e)}function p(e,t){return f(e)?!1:t.hasDirective||t.hasSerde}const m=/(use workflow|use step|from\s+(['"])@workflow\/serde\2|Symbol\.for\s*\(\s*(['"])workflow-(?:serialize|deserialize)\3\s*\)|\[\s*WORKFLOW_(?:SERIALIZE|DESERIALIZE)\s*\])/;export{d as detectWorkflowPatterns,l as generatedWorkflowPathPattern,f as isGeneratedWorkflowFile,p as shouldTransformFile,m as turbopackContentPattern,t as useStepPattern,e as useWorkflowPattern,i as workflowSerdeComputedPropertyPattern,n as workflowSerdeImportPattern,r as workflowSerdeSymbolPattern};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { HarnessModelMessage } from "#harness/messages.js";
|
|
2
|
-
/**
|
|
3
|
-
* Re-applies framework-owned state preservation after the harness compacts
|
|
4
|
-
* message history, returning any messages to append to the compacted history.
|
|
5
|
-
*
|
|
6
|
-
* Runs the framework's built-in preservation steps:
|
|
7
|
-
* - resets read-before-write tracking, so a write after compaction re-reads
|
|
8
|
-
* the file whose read evidence was summarized away;
|
|
9
|
-
* - re-injects the todo list (when present), so the model keeps its task list.
|
|
10
|
-
*
|
|
11
|
-
* Must be called inside the harness step's `AlsContext`; both steps read
|
|
12
|
-
* durable context state.
|
|
13
|
-
*/
|
|
14
|
-
export declare function preserveFrameworkStateOnCompaction(): readonly HarnessModelMessage[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{clearReadFileState}from"#execution/tools/file-state.js";import{getTodoCompactionMessage}from"#execution/tools/todo.js";function preserveFrameworkStateOnCompaction(){clearReadFileState();let e=getTodoCompactionMessage();return e===void 0?[]:[e]}export{preserveFrameworkStateOnCompaction};
|