eve 1.0.0-rc.3 → 1.0.0-rc.4
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 -71
- package/NOTICE +24 -0
- package/dist/src/_virtual/_rolldown/runtime.js +1 -1
- package/dist/src/cli/dev/tui/file-content-cache.d.ts +9 -3
- package/dist/src/cli/dev/tui/file-content-cache.js +1 -1
- package/dist/src/cli/dev/tui/transcript.js +1 -1
- package/dist/src/compiled/.vendor-stamp.json +1 -1
- package/dist/src/compiled/@workflow/core/index.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
- package/dist/src/compiled/@workflow/core/runtime.js +1 -1
- package/dist/src/compiled/@workflow/core/serialization.js +1 -1
- package/dist/src/compiled/@workflow/core/workflow.js +1 -1
- package/dist/src/compiled/@workflow/world/index.js +1 -1
- package/dist/src/compiled/@workflow/world-local/index.js +3 -3
- package/dist/src/compiled/@workflow/world-vercel/index.js +1 -1
- package/dist/src/compiled/_chunks/workflow/{attribute-changes-D1iAmxwH.js → attribute-changes-AOnel6r3.js} +3 -3
- package/dist/src/compiled/_chunks/workflow/delivery-DS_fO4NK.js +1 -0
- package/dist/src/compiled/_chunks/workflow/dist-BSEKQ8u2.js +45 -0
- package/dist/src/compiled/_chunks/workflow/dist-C0vwtoWB.js +1 -0
- package/dist/src/compiled/_chunks/workflow/global-singleton-BNinwFrL.js +1 -0
- package/dist/src/compiled/_chunks/workflow/helpers-9AgMPjGd.js +1 -0
- package/dist/src/compiled/_chunks/workflow/{resume-hook-D3rP2sy1.js → resume-hook-XRKdnxa4.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{run-4Zr4Jcrn.js → run-CfkXT03M.js} +2 -2
- package/dist/src/compiled/_chunks/workflow/serialization-bMKNKGL1.js +15 -0
- package/dist/src/compiled/_chunks/workflow/sleep-rBxEVIeO.js +1 -0
- package/dist/src/compiled/_chunks/workflow/suspension-hooks-RNPAbmnS.js +5 -0
- package/dist/src/compiled/_chunks/workflow/{token-CuVMlqdU.js → token-CAXqMDzD.js} +1 -1
- package/dist/src/compiled/_chunks/workflow/{wait-until-BmHArYQw.js → wait-until-RI3P9oYt.js} +1 -1
- package/dist/src/definitions/builtins.d.ts +2 -3
- package/dist/src/definitions/builtins.js +1 -1
- package/dist/src/definitions/definition.d.ts +0 -1
- package/dist/src/definitions/definition.js +1 -1
- package/dist/src/definitions/instructions.js +1 -1
- package/dist/src/evals/cli/eval-client.d.ts +2 -1
- package/dist/src/evals/cli/eval-client.js +1 -1
- package/dist/src/execution/dynamic-workflow/tool.js +1 -1
- package/dist/src/execution/sandbox/bash.d.ts +3 -2
- package/dist/src/execution/sandbox/bash.js +6 -3
- package/dist/src/execution/sandbox/workspace-root.d.ts +0 -7
- package/dist/src/execution/sandbox/workspace-root.js +1 -1
- package/dist/src/execution/sandbox/write-file.d.ts +9 -0
- package/dist/src/execution/sandbox/write-file.js +1 -1
- package/dist/src/execution/session-inbox/handle.js +1 -1
- package/dist/src/execution/tools/agent-router-workflow.js +1 -1
- package/dist/src/extensions/code/extension/instructions/project.d.ts +2 -0
- package/dist/src/extensions/code/extension/instructions/project.js +1 -0
- package/dist/src/extensions/code/extension/instructions.md +16 -8
- package/dist/src/extensions/code/extension/lib/project-instructions.d.ts +13 -0
- package/dist/src/extensions/code/extension/lib/project-instructions.js +4 -0
- package/dist/src/extensions/code/extension/lib/sandbox.d.ts +2 -2
- package/dist/src/extensions/code/extension/lib/sandbox.js +1 -1
- package/dist/src/extensions/code/extension/lib/tooling.d.ts +0 -12
- package/dist/src/extensions/code/extension/lib/tooling.js +1 -92
- package/dist/src/extensions/git/extension/lib/github-shell.d.ts +5 -3
- package/dist/src/extensions/git/extension/lib/github-shell.js +1 -1
- package/dist/src/framework/sources/registry.js +1 -1
- package/dist/src/harness/compaction/engine.js +1 -1
- package/dist/src/harness/compaction/prompt.d.ts +3 -3
- package/dist/src/harness/compaction/prompt.js +1 -1
- package/dist/src/harness/provider-tools.d.ts +3 -2
- package/dist/src/harness/provider-tools.js +1 -1
- package/dist/src/harness/semantic-errors/rules/model-provider.js +1 -1
- package/dist/src/harness/semantic-errors/signals.d.ts +4 -1
- package/dist/src/harness/semantic-errors/signals.js +1 -1
- package/dist/src/harness/session-machine/cascade.js +1 -1
- package/dist/src/harness/tool-model-output.d.ts +3 -0
- package/dist/src/harness/tool-model-output.js +1 -1
- package/dist/src/internal/application/stamped-package-version.js +1 -1
- package/dist/src/internal/mcp/published-tools.js +1 -1
- package/dist/src/public/tools/edit-file.d.ts +3 -0
- package/dist/src/public/tools/edit-file.js +1 -0
- package/dist/src/runtime/prompt/compose.d.ts +0 -2
- package/dist/src/runtime/prompt/compose.js +2 -3
- package/dist/src/runtime/subagents/workflow.js +1 -1
- package/dist/src/setup/scaffold/create/project.js +1 -1
- package/dist/src/shared/web-search.d.ts +2 -2
- package/dist/src/shared/web-search.js +1 -1
- package/dist/src/tools/model-output.d.ts +10 -0
- package/dist/src/tools/model-output.js +1 -1
- package/dist/src/tools/provided/ask-question-workflow.js +1 -1
- package/dist/src/tools/provided/bash.js +3 -3
- package/dist/src/tools/provided/edit-file.d.ts +19 -0
- package/dist/src/tools/provided/edit-file.js +13 -0
- package/dist/src/tools/provided/sleep-workflow.js +1 -1
- package/dist/src/tools/provided/write-file.d.ts +1 -0
- package/dist/src/tools/provided/write-file.js +2 -2
- package/dist/src/tools/schema.d.ts +5 -0
- package/dist/src/tools/schema.js +1 -1
- package/docs/code-extension.mdx +15 -31
- package/docs/concepts/built-in-tools.md +50 -4
- package/docs/concepts/execution-model-and-durability.mdx +1 -1
- package/docs/concepts/security-model.md +1 -1
- package/docs/concepts/sessions-runs-and-streaming.md +2 -0
- package/docs/evals/assertions.mdx +25 -0
- package/docs/evals/targets.mdx +15 -1
- package/docs/extensions/index.md +1 -1
- package/docs/guides/client/index.mdx +1 -1
- package/docs/guides/deployment/index.md +1 -1
- package/docs/guides/upgrade/agent-files.md +13 -0
- package/docs/reference/typescript-api.md +2 -2
- package/docs/sandbox/index.mdx +1 -1
- package/docs/tools/index.mdx +2 -2
- package/package.json +6 -19
- package/dist/src/compiled/_chunks/workflow/delivery-DfW1k9T2.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-BrdA0lMi.js +0 -1
- package/dist/src/compiled/_chunks/workflow/dist-zRr5IZEB.js +0 -45
- package/dist/src/compiled/_chunks/workflow/helpers-D0Wn85SG.js +0 -1
- package/dist/src/compiled/_chunks/workflow/serialization-BEe0I8fg.js +0 -15
- package/dist/src/compiled/_chunks/workflow/sleep-8FShVa1U.js +0 -1
- package/dist/src/compiled/_chunks/workflow/suspension-hooks-DR0uRGOc.js +0 -5
- package/dist/src/extensions/code/extension/lib/diagnostics.d.ts +0 -32
- package/dist/src/extensions/code/extension/lib/diagnostics.js +0 -6
- package/dist/src/extensions/code/extension/lib/generated-paths.d.ts +0 -19
- package/dist/src/extensions/code/extension/lib/generated-paths.js +0 -2
- package/dist/src/extensions/code/extension/lib/guidelines.d.ts +0 -26
- package/dist/src/extensions/code/extension/lib/guidelines.js +0 -2
- package/dist/src/extensions/code/extension/lib/patch.d.ts +0 -42
- package/dist/src/extensions/code/extension/lib/patch.js +0 -20
- package/dist/src/extensions/code/extension/lib/shell.d.ts +0 -1
- package/dist/src/extensions/code/extension/lib/shell.js +0 -1
- package/dist/src/extensions/code/extension/lib/workspace-root.d.ts +0 -1
- package/dist/src/extensions/code/extension/lib/workspace-root.js +0 -1
- package/dist/src/extensions/code/extension/tools/apply_patch.d.ts +0 -28
- package/dist/src/extensions/code/extension/tools/apply_patch.js +0 -15
- package/dist/src/extensions/code/tools.d.ts +0 -2
- package/dist/src/extensions/code/tools.js +0 -1
- package/dist/src/internal/grep.d.ts +0 -1
- package/dist/src/internal/grep.js +0 -1
- package/dist/src/internal/workspace.d.ts +0 -1
- package/dist/src/internal/workspace.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,82 +1,30 @@
|
|
|
1
|
-
# eve 1.0.0-rc.
|
|
1
|
+
# eve 1.0.0-rc.4
|
|
2
2
|
|
|
3
|
-
Released 2026-11-
|
|
3
|
+
Released 2026-11-04 · [Compare with 1.0.0-rc.3](https://github.com/vercel/eve/compare/eve%401.0.0-rc.3...eve%401.0.0-rc.4)
|
|
4
4
|
|
|
5
5
|
## Breaking Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
- Every agent now gets a default `edit_file` tool, the code extension drops `code__apply_patch`, and `bash` results and eve's system prompt now match pi's.
|
|
8
|
+
`edit_file`, exported from `eve/tools/edit_file`, edits one sandbox file with exact text replacements matched the same way as pi's `edit` tool. The model sends `path` and a list of `{ oldText, newText }` edits, each matched once against the original file, with a fallback that ignores trailing whitespace and normalizes smart quotes, dashes, and special spaces. Files that are not valid UTF-8 are rejected rather than rewritten, and a file keeps its mode, such as its executable bit, on sandboxes that write files with a default mode. Remove it with `defaultTools: false` or an `agent/tools/edit_file.ts` that exports `disableTool()`; an authored `agent/tools/edit_file.ts` replaces it.
|
|
9
|
+
`edit_file` changes existing files without `write_file`. If you disabled or wrapped `write_file` to limit writes, or gate `write_file` in an approval policy, do the same for `edit_file`. `write_file` can also overwrite a file the session read and then changed with `edit_file`, without another `read_file` call. A change made by anything else since the read still requires one.
|
|
10
|
+
The code extension (`eve/extensions/code`) no longer mounts `code__apply_patch`, and the `eve/extensions/code/tools` entry point is removed. Import `grep` from `eve/tools/grep` instead of `eve/extensions/code/tools`. Move an override of the old tool, whether `agent/tools/code__apply_patch.ts` or `agent/extensions/code/tools/apply_patch.ts`, to `agent/tools/edit_file.ts` and spread `editFile` from `eve/tools/edit_file`. `edit_file` takes `path` and `edits` instead of a patch, so a wrapper that reads `input.patch` needs updating. A `code__apply_patch.ts` file that exports `disableTool()` fails `eve build` with `disables a slot with no lower-precedence source`; to keep agents from editing, export `disableTool()` from `agent/tools/edit_file.ts` instead.
|
|
11
|
+
`installCodeTooling()` no longer installs TypeScript or the post-edit diagnostics worker, and `CODE_TOOLING_REVALIDATION_KEY` changed, so sandbox templates keyed on it rebuild once.
|
|
12
|
+
The code extension adds the workspace root's `AGENTS.md`, or `CLAUDE.md` when there is none, to the conversation, and its coding instructions now follow pi's tool guidance. The extension reads the file once per session, with one sandbox command on the first turn, which starts the sandbox. A file over 64,000 bytes is cut off with a note that tells the model where to read the rest.
|
|
13
|
+
A successful `bash` command shows only its output, or `(no output)`, and a command that exits non-zero ends with `[exit code: N]` and reaches the model as an error result. `bash` waits 60 seconds by default before it leaves a command running in the background, and a truncated `stdout` or `stderr` now names a file in the sandbox that holds its full output.
|
|
14
|
+
`toolOutput.errorText(value)` from `eve/tools`, or a `{ type: "error-text", value }` literal, lets any tool's `toModelOutput` show the model a failure while the call still completes, so channels and hooks get the full output on `call.settled`. The MCP channel returns such a result as its text with `isError: true`.
|
|
15
|
+
eve no longer adds a "Tool execution" note about parallel tool calls to every agent's system prompt. Tool calls in one response still run in parallel. Without the note, Sonnet 5.5 solved a concurrency task in 93% of replayed eve-code runs instead of 75%, matching how pi, which runs tool calls in parallel without telling the model, performs.
|
|
16
|
+
Thanks @badlogic for pi, whose MIT-licensed `edit` tool `edit_file` adapts. ([#5892](https://github.com/vercel/eve/pull/5892))
|
|
15
17
|
|
|
16
18
|
## Features
|
|
17
19
|
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
- `eve/events` exports `createStreamChecker`, which checks a stored session stream against its lifecycle rules.
|
|
21
|
-
Run it over a stored or recorded stream to find lines that break the lifecycle rules, such as a turn that settles twice or a fact that names something never introduced. Its `StreamChecker`, `Violation`, and `ViolationRule` types, and the `StoredLine`, `CommitLine`, and `ProgressLine` types it reads, are exported beside it. ([#5834](https://github.com/vercel/eve/pull/5834))
|
|
22
|
-
- Slack message hooks can return `status: "deferred"` to keep a message's turn quiet until a tool call finishes, and `guidance` to tell the model how to treat that one message, so an agent can follow a thread and stay silent with `no_reply` when a reply isn't meant for it.
|
|
23
|
-
`status: "deferred"` skips the `received` acknowledgement. Mentions and DMs outside code channels get that acknowledgement before their hook runs, so for them it keeps only the rest of the turn quiet. A message that isn't deferred and joins the turn shows the status again. eve adds `guidance` as a `<guidance>` block inside the message's `<slack_message>` or `<slack_message_edit>` block, after the metadata and before the content. The Slack docs show how to follow threads the agent already serves with `onMessage`.
|
|
24
|
-
Message edits now go through an app's own message hooks. Without an authored `onMessageEdited`, an edit goes to the hook a new message of the same kind would reach: `onDirectMessage`, then `onMessage`, for DMs; `onAppMention`, then `onMessage`, for messages that mention the agent; `onMessage`, then `onAppMention`, in code channels; and `onMessage` for other messages. Without those hooks, the built-in defaults send edits to DMs, code channel messages, and messages that mention the agent before or after the edit, and drop the rest. Edits are always quiet and ignore `status`, and an authored `onEvent` still comes before this default. The new `ctx.edit` is set while a hook decides an edit.
|
|
25
|
-
In 1.0.0-rc.2, an authored `onAppMention`, `onDirectMessage`, or `onMessage` turned off edits unless the app also defined `onMessageEdited`. Those hooks now also run for edits in threads that have a session. If a hook has side effects, such as `ctx.send()`, `ctx.end()`, or a decision model call, return early when `ctx.edit` is set. To keep edits off, define `onMessageEdited` and return `null`. ([#5801](https://github.com/vercel/eve/pull/5801))
|
|
26
|
-
- The provided `bash` tool shows the model its output as plain text instead of JSON, so source code, diffs, and test logs reach the model without escaped newlines and quotes.
|
|
27
|
-
The model reads stdout, then any stderr after a `[stderr]` line, then a final `[exit code: N]` line; for a command still running, its instructions replace the exit code line. The tool's `execute` output, its output schema, and `call.settled` events keep the structured fields. Authored code that reads the conversation, through `ctx.messages` in tools or `ctx.messages()` in dynamic capabilities, sees this text for new `bash` results, and sessions keep the JSON results they already saved. A `bash` tool published over MCP sends the text in `content[0].text`, and its `structuredContent` keeps the structured fields. Wrappers that spread `bash` keep the plain-text view: a wrapper's `execute` that returns a string reaches the model as text, and any other shape as JSON. ([#5822](https://github.com/vercel/eve/pull/5822))
|
|
28
|
-
- `auto()` from `eve/models` and `eve/tools/approval` accept `modelOptions.providerOptions`, and `decide()` accepts `providerOptions`, so decision calls can set options such as AI Gateway's `zeroDataRetention`. ([#5846](https://github.com/vercel/eve/pull/5846))
|
|
29
|
-
- The code extension (`eve/extensions/code`) sends a prompt about a third of its previous size (4,942 to 1,636 characters) that keeps only coding and safety rules, so agents spend fewer tokens on every step.
|
|
30
|
-
The prompt no longer assumes a chat product or sets consumer policy, such as brevity, asking one question, avoiding em dashes, omitting private references, or not rebasing. Agents that relied on those rules should state them in their own `agent/instructions.md`. Agents publish or write to external systems only when the requester asks for it or for an outcome that requires it, such as a pull request. The prompt asks agents to edit files with the editing tool instead of the shell, and no longer names `apply_patch` specifically. The issue and design checklists moved into the `code__investigate` skill. ([#5805](https://github.com/vercel/eve/pull/5805))
|
|
31
|
-
- Update the bundled Workflow runtime to 5.3.0 and create new runs with Workflow spec version 9, which drives each run from one orchestrator.
|
|
32
|
-
Workflow 5.3.0 lets parallel branches advance inline steps without waiting on slower siblings, reuses resolved hooks to skip token lookups on later resumes, and fixes a step that could be created but never run when two executions raced in one process. eve now sets `WORKFLOW_SPEC_VERSION=9` before it creates a world unless `WORKFLOW_SPEC_VERSION` or `WORKFLOW_SEALED_LOG` is already set. Set `WORKFLOW_SPEC_VERSION=8` to keep creating spec 8 runs. Existing runs keep their version. ([#5860](https://github.com/vercel/eve/pull/5860))
|
|
20
|
+
- Add `EVE_EVAL_OIDC_TOKEN` to reach a protected Vercel deployment from `eve eval --url` through Trusted Sources. ([#4894](https://github.com/vercel/eve/pull/4894))
|
|
21
|
+
- `webSearch({ provider: "tako" })` selects Tako Search through AI Gateway, which returns web pages and Tako data cards with their rows in one call. `"tako"` also works as a `fallback` for `webSearch({ provider: "native" })`. ([#5880](https://github.com/vercel/eve/pull/5880))
|
|
33
22
|
|
|
34
23
|
## Bug Fixes
|
|
35
24
|
|
|
36
|
-
- Fix
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
- Every eve build now reads `paths` aliases from the authored package's own `tsconfig.json` or `jsconfig.json`, and an asset import that leaves the authored package fails the build.
|
|
41
|
-
The Nitro host, authored module bundles, and the workflow driver share one resolver. The workflow driver no longer searches parent directories for a config, and an agent directory without its own `package.json` uses the enclosing package's config in every build. Before, only `?raw` asset imports were checked against the package root; now plain imports such as `import notes from "../../notes.txt"` are checked too. If a build fails with "resolves outside package root", move the file into the authored package or into the workspace package that imports it. ([#5879](https://github.com/vercel/eve/pull/5879))
|
|
42
|
-
- Model calls made by `decide()` from `eve/ai`, and so by `auto()` and approval `auto()`, now count toward the session's usage and `limits.sessionUsage`. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
43
|
-
- Inline tool execution now requires permission from eve's approval gate.
|
|
44
|
-
When a person answers the same call more than once, eve uses their latest answer. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
45
|
-
- eve now records which of its catalog tools a session has been offered in the same session state as its other definitions, rather than under a separate context key.
|
|
46
|
-
A session an earlier deployment ran still keeps every catalog tool it was offered. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
47
|
-
- Under `eve dev`, eve now throws if a tool call starts before its approval is accepted, or names a different approval as what cleared it. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
48
|
-
- Compacting a session between turns no longer repeats the last question after its answer, so the next turn's new message follows the summary and recent history instead of an already-answered question. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
49
|
-
- Keep child questions and approvals answerable while a serving task remains active after replying to its original call.
|
|
50
|
-
Upgrading a session whose history was cleared or compacted also restores its dynamic user instructions before the next model call. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
51
|
-
- Fix tool-stub validation for memory-only agents, mounted dynamic connection names, and sandbox skill files when an earlier definition starts offering a colliding skill.
|
|
52
|
-
The chosen model also remains visible to session code across separately bundled runtime modules. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
53
|
-
- Dynamic connection resolvers can exchange names within one evaluation without a transient collision, and namespaced tools and skills retain their full name-length validation. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
54
|
-
- Fix release asset uploads failing with 401 through the git extension's `gh` tool.
|
|
55
|
-
The credential lease now covers `uploads.github.com`, not only `api.github.com` and `github.com`. A 401 there was read as a revoked token and opened a sign-in for a user who was already signed in.
|
|
56
|
-
When Vercel Connect starts an authorization without a sign-in URL or device code, the user-scoped GitHub sign-in now fails with `ConnectionAuthorizationFailedError` instead of opening a sign-in prompt with no link. ([#5852](https://github.com/vercel/eve/pull/5852))
|
|
57
|
-
- A workflow tool's question that reaches the session after its turn was cancelled no longer fails the session: eve drops it, and the next message starts a turn. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
58
|
-
- Memory slots and schedule collections now offer their tools themselves, so agent info no longer lists them as generated dynamic tool files.
|
|
59
|
-
A tool file at `agent/tools/<slot>.ts` or `agent/tools/schedule__<name>.ts` still replaces those tools, and `disableTool()` there still removes them. Sessions and approvals parked across the upgrade keep working. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
60
|
-
- Upgrade Nitro to 3.0.261103-rc, the first Nitro 3 release candidate eve builds on.
|
|
61
|
-
eve now declares Rolldown 1.2.16 itself and hands that copy to Nitro, so a plain npm install builds without relying on another package to provide Rolldown, and Nitro never installs a package into your app on demand. Importing `nitro/storage`, `nitro/kv`, or `nitro/database` from agent code now fails the build with an explanation instead of pulling in storage drivers. A request with a method its path doesn't declare, other than `HEAD`, now gets `405 Method Not Allowed` with an `Allow` header instead of `404`. `eve dev` runs on env-runner 0.3, and a stopped `eve start` server runs Nitro's close hooks and exits on its own.
|
|
62
|
-
Thanks @pi0 for the investigation in #5167. ([#5870](https://github.com/vercel/eve/pull/5870))
|
|
63
|
-
- eve now compiles an agent's dynamic tool, skill, connection, and instructions files, hooks, and memories to one list in the compiled manifest, and runs them as definitions of one shape.
|
|
64
|
-
Rebuild agents after upgrading; authored files don't change. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
65
|
-
- The discovery manifest in `.eve/discovery/agent-discovery-manifest.json` now lists an agent's authored files in one `sources` array, with each file's kind given by its path, instead of one array per kind. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
66
|
-
- Session history now changes in one place, which checks every message as it joins, and under `eve dev` fails a step whose tool results don't follow the calls they answer.
|
|
67
|
-
A turn that fails after the model delivered its structured reply keeps that reply in history instead of an unanswered `eve__reply` call. A compaction whose summary model fails to resolve now appears on the stream as a failed compaction instead of failing the turn before it starts. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
68
|
-
- The model no longer sees an "awaiting approval" note in history after the approval it describes is answered or dropped, because eve now tells each model call about pending approvals from the session's current state instead of writing a note into history when the call parks. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
69
|
-
- eve now renders each model call's system prompt from the current deployment's agent files instead of storing it with the session.
|
|
70
|
-
Session checkpoints move to version 19, without `agent.system`. A deployment from before this change refuses to take over a session this one wrote, so the session stays on the deployment that wrote it, such as after a rollback. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
71
|
-
- A turn's input now joins history before its first model call, so a model call that fails keeps the person's message for the next turn.
|
|
72
|
-
A response the provider filters is the exception: a refusal note replaces its turn's input, so the next turn doesn't send that input again. Completed tool calls and their results stay in history, so the model knows which actions already ran.
|
|
73
|
-
A compaction now opens only once it summarizes or rewrites the history, so `session.compact()` records no change when its model doesn't resolve or the history has nothing to compact. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
74
|
-
- eve's session loop now runs as a kernel that owns every session transition, with no change in behavior. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
75
|
-
- Prevent `gh-signed-commit` from publishing another file's contents for paths that resemble Git stage syntax or silently losing file modes and types.
|
|
76
|
-
The command now reads staged paths literally and rejects additions or updates involving executable files, symlinks, submodules, or mode changes before contacting GitHub. Staged changes remain intact; publish unsupported changes with native Git and a configured signing key. ([#5863](https://github.com/vercel/eve/pull/5863))
|
|
77
|
-
- Ending a stranded session now writes the same checked commit as any other session end.
|
|
78
|
-
A stranded stream that never recorded `session.started`, such as one an older deployment opened, gets it in the commit that ends the session. ([#5638](https://github.com/vercel/eve/pull/5638))
|
|
79
|
-
- Self-hosted eve servers now close their Workflow world on shutdown, so a pending workflow `sleep` or delivery retry no longer holds the process open until the supervisor kills it.
|
|
80
|
-
If closing the world fails or takes longer than 5 seconds, eve logs it and still runs the rest of its shutdown, including sandbox shutdown and the final trace flush. ([#5879](https://github.com/vercel/eve/pull/5879))
|
|
25
|
+
- Fix signed inbox handles so follow-up messages can skip repeated hook lookups when `EVE_INBOX_HANDLE_SECRET` is set and the world supports guarded hook resumes. ([#5904](https://github.com/vercel/eve/pull/5904))
|
|
26
|
+
- A prompt that OpenAI refuses for possible cybersecurity (`cyber_policy`) or biological (`bio_policy`) risk now fails only its turn instead of ending the session. ([#5772](https://github.com/vercel/eve/pull/5772))
|
|
27
|
+
- Fail closed for repository-based authorization policies when GitHub commands use a caller's unscoped token.
|
|
28
|
+
User-mode `authorize` callbacks always receive `repository: null`, regardless of the command's declaration. Use GitHub App tokens with a full `owner/name` declaration for repository allowlists. Policies that intentionally permit the caller's full GitHub access can continue to authorize through `auth`. ([#5903](https://github.com/vercel/eve/pull/5903))
|
|
81
29
|
|
|
82
|
-
For an upgrade across multiple releases, review each version between the installed and target versions in the [target version's changelog](https://raw.githubusercontent.com/vercel/eve/refs/tags/eve%401.0.0-rc.
|
|
30
|
+
For an upgrade across multiple releases, review each version between the installed and target versions in the [target version's changelog](https://raw.githubusercontent.com/vercel/eve/refs/tags/eve%401.0.0-rc.4/packages/eve/CHANGELOG.md).
|
package/NOTICE
CHANGED
|
@@ -75,3 +75,27 @@ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
75
75
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
76
76
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
77
77
|
SOFTWARE.
|
|
78
|
+
|
|
79
|
+
The edit_file tool is adapted from the edit tool in pi
|
|
80
|
+
(https://github.com/badlogic/pi-mono) under the MIT License.
|
|
81
|
+
|
|
82
|
+
pi
|
|
83
|
+
Copyright (c) 2025 Mario Zechner
|
|
84
|
+
|
|
85
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
86
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
87
|
+
in the Software without restriction, including without limitation the rights
|
|
88
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
89
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
90
|
+
furnished to do so, subject to the following conditions:
|
|
91
|
+
|
|
92
|
+
The above copyright notice and this permission notice shall be included in all
|
|
93
|
+
copies or substantial portions of the Software.
|
|
94
|
+
|
|
95
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
96
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
97
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
98
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
99
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
100
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
101
|
+
SOFTWARE.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"node:module";
|
|
1
|
+
import"node:module";export{};
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* Session-local knowledge of file contents, so the write block can show a
|
|
3
3
|
* real diff without any protocol addition. Two feeds keep it current: every
|
|
4
4
|
* `write_file` input is a full replacement (exact), and every full-file
|
|
5
|
-
* `read_file` result reconstructs to the file's exact lines.
|
|
6
|
-
*
|
|
7
|
-
* unknown prior content renders plain rather than pretending to be a
|
|
5
|
+
* `read_file` result reconstructs to the file's exact lines. An `edit_file`
|
|
6
|
+
* call makes its file unknown. Files touched by `bash` are invisible here — a
|
|
7
|
+
* write over unknown prior content renders plain rather than pretending to be a
|
|
8
|
+
* diff.
|
|
8
9
|
*/
|
|
9
10
|
export declare class FileContentCache {
|
|
10
11
|
#private;
|
|
@@ -19,6 +20,11 @@ export declare class FileContentCache {
|
|
|
19
20
|
content: string;
|
|
20
21
|
callId: string;
|
|
21
22
|
}): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Marks the content of `path` unknown after a change this cache cannot replay. A write that
|
|
25
|
+
* already rendered keeps returning its previous content when it re-renders.
|
|
26
|
+
*/
|
|
27
|
+
forget(path: string): void;
|
|
22
28
|
/**
|
|
23
29
|
* Forgets everything. A new conversation runs against a fresh session —
|
|
24
30
|
* possibly a fresh sandbox — so stale bases would produce confidently
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const MAX_CACHED_CONTENT_CHARS=2e5;var FileContentCache=class{#e=new Map;observeWrite(e){let t=this.#e.get(e.path);if(t?.writerCallId===e.callId)return t.previous;if(e.content.length>MAX_CACHED_CONTENT_CHARS){this.#e.delete(e.path);return}let n=t?.content,r={content:e.content,writerCallId:e.callId};return n!==void 0&&(r.previous=n),this.#e.set(e.path,r),n}clear(){this.#e.clear()}observeRead(e){let t=readFileResultShape(e);if(t===void 0||t.truncated||t.content.length>MAX_CACHED_CONTENT_CHARS)return;let n=reconstructNumberedLines(t.content);n!==void 0&&n.length===t.totalLines&&this.#e.set(t.path,{content:n.join(`
|
|
1
|
+
const MAX_CACHED_CONTENT_CHARS=2e5;var FileContentCache=class{#e=new Map;observeWrite(e){let t=this.#e.get(e.path);if(t?.writerCallId===e.callId)return t.previous;if(e.content.length>MAX_CACHED_CONTENT_CHARS){this.#e.delete(e.path);return}let n=t?.content,r={content:e.content,writerCallId:e.callId};return n!==void 0&&(r.previous=n),this.#e.set(e.path,r),n}forget(e){let t=this.#e.get(e);if(t?.writerCallId===void 0){this.#e.delete(e);return}let n={writerCallId:t.writerCallId};t.previous!==void 0&&(n.previous=t.previous),this.#e.set(e,n)}clear(){this.#e.clear()}observeRead(e){let t=readFileResultShape(e);if(t===void 0||t.truncated||t.content.length>MAX_CACHED_CONTENT_CHARS)return;let n=reconstructNumberedLines(t.content);n!==void 0&&n.length===t.totalLines&&this.#e.set(t.path,{content:n.join(`
|
|
2
2
|
`)})}};function readFileResultShape(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let{content:t,path:n,totalLines:r,truncated:i}=e;if(typeof t==`string`&&typeof n==`string`&&typeof r==`number`&&typeof i==`boolean`)return{content:t,path:n,totalLines:r,truncated:i}}function reconstructNumberedLines(e){if(e===``)return[];let t=[];for(let[n,r]of e.split(`
|
|
3
3
|
`).entries()){let e=/^(\d+): (.*)$/su.exec(r);if(e===null||Number(e[1])!==n+1)return;t.push(e[2])}return t}export{FileContentCache};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FileContentCache}from"./file-content-cache.js";import{signInLabel,waitingLabel}from"./task-activity.js";import{TaskRecords}from"./task-records.js";import{agentDisplayName,agentTaskLabel,isPanelRoutedTool,readWriteFileInput,toolBaseName}from"./tool-presentation.js";import{activeToolSteps,authorizationTerminalMessage,endLine,firstLine,followUpLine,formatAuthorization,isActive,isToolCallRow,nestedTaskRecord,startLine,subagentSteps,taskCallsById,taskNeedsApproval,toolBlock,toolState,userText,writeExistedFlag}from"./transcript-parts.js";import{activity,callOutputSource}from"#protocol/session-projection/selectors.js";import{sessionTables,snapshotState}from"#protocol/session-projection/session-view.js";import{stripTerminalControls}from"#cli/ui/terminal-text.js";import{agentCallActivity,agentToolSession,taskCalls}from"#client/conversation-state.js";var ConversationTranscript=class{#e=new Map;#t=new FileContentCache;#n=new TaskRecords;#r=new Map;#i=[];#a=new Set;#o=[];reset(){this.#e=new Map,this.#t.clear(),this.#n.clear(),this.#r.clear(),this.#i=[],this.#a.clear(),this.#o=[]}get tasks(){return this.#o}taskLabel(e,t){let n=sessionTables(e.view).tasks[t];if(n===void 0)return;let r=taskCalls(e.view,t),i=r.findLast(e=>e.status!==`settled`)??r.at(-1),a=i===void 0?void 0:this.#n.get(i.callId);return a===void 0?n.kind===`agent`?agentTaskLabel(agentDisplayName(stripTerminalControls(n.name))):stripTerminalControls(n.name):a.kind===`agent`?agentTaskLabel(a.name):a.name}stopWorking(e){let t=[];for(let n of this.#n.values())n.ended||(n.ended=!0,t.push(endLine(n,{outcome:`interrupted`,status:`settled`},void 0,e.dot??`·`)));return this.#o=[],t}project(e,t){let{conversation:n,working:r}=e,i=Date.now(),a=[],o=taskCallsById(n),{toolLabels:s,withdrawn:c}=e.data,l=new Map(e.failures.flatMap(e=>e.turnId===void 0?[]:[[e.turnId,e]])),u=new Map;for(let[e,t]of n.messages.entries()){let n=t.metadata?.turnId;n!==void 0&&u.set(n,e)}let d=new Set,endTurn=(e,n)=>{if(n===void 0||u.get(n)!==e)return!1;let r=l.get(n);return r!==void 0&&(a.push(this.#g(`failure:${n}`,r,t)),d.add(n),!0)};for(let[d,f]of n.messages.entries()){if(f.role===`user`){let e=this.#f(f);e!==void 0&&a.push(e),endTurn(d,f.metadata?.turnId);continue}let p=f.parts.filter(e=>isToolCallRow(e)&&(e.state!==`streaming`||r)&&e.kind!==`control`&&!c(e.callId)&&!o.has(e.callId)&&!isPanelRoutedTool(e.name)),m=new Map(p.map(t=>[t,toolState(t,e.data.view)])),h=activeToolSteps(m);for(let[n,c]of f.parts.entries())if(c.type===`text`||c.type===`reasoning`){let e=this.#p(f,n,t,r);e!==void 0&&a.push(e)}else if(c.type===`interaction`)c.request.signIn!==void 0&&t.connectionAuth!==`hidden`&&a.push(this.#m(c,c.request.signIn));else if(c.type===`tool`){let n=o.get(c.callId);if(n!==void 0){let r=this.#c(c,n.task,s,t,i,e.data.view);r!==void 0&&a.push(r);continue}let r=m.get(c);if(r===void 0||t.tools===`hidden`)continue;let l=s(c.callId);a.push(this.#h(c,r,h.has(c.stepIndex),l,t))}let g=f.metadata?.turnId;endTurn(d,g)||g!==void 0&&!l.has(g)&&u.get(g)===d&&sessionTables(n.view).turns[g]?.outcome===`cancelled`&&a.push(this.#d(`cancelled:${g}`,[],()=>({kind:`notice`,body:`Cancelled.`,live:!1})))}let f=0;for(let n of e.failures){if(n.turnId!==void 0&&d.has(n.turnId))continue;let e=n.turnId===void 0?`failure:session:${f++}`:`failure:${n.turnId}`;a.push(this.#g(e,n,t))}let p=this.#s(a),m=this.#l(e,o,t,i);for(let e of m){let t=p.slice(-8).map(e=>e.id);this.#i.push({block:e,after:t}),this.#a.add(e.id),p.push(e)}return p}#s(e){let t=[...e];for(let{block:e,after:n}of this.#i){let r=t.length;for(let e=n.length-1;e>=0;--e){let i=t.findIndex(t=>t.id===n[e]);if(i!==-1){r=i+1;break}}t.splice(r,0,e)}return t}#c(e,t,n,r,i,a){if(!(t.kind===`agent`?r.subagents!==`hidden`:r.tools!==`hidden`))return;let o=n(e.callId)?.start,s=this.#n.record(e,t,o,i,a);return s.callId===e.callId?this.#d(`task:${s.callId}:start`,[s],()=>startLine(s)):this.#d(`task:${e.callId}:message`,[s],()=>followUpLine(s,e,o))}#l(e,t,n,r){let{conversation:i,working:a}=e,o=Object.values(sessionTables(i.view).turns).at(-1),s=!a&&(e.data.sessionFailed||o?.outcome===`cancelled`||o?.outcome===`failed`),c=[],l=[],u={remaining:128};for(let e of this.#n.values()){if(e.ended)continue;let o=t.get(e.callId)?.task;if(o===void 0)continue;let d=e.callIds.flatMap(e=>{let n=t.get(e)?.call;return n===void 0?[]:[n]}),f=d.at(-1),p=this.#u(e,o,d,i,n,u);if(n.subagents===`full`)for(let e of p.rows)this.#a.has(e.id)||c.push(e);let m=d.every(e=>e.status===`settled`);m&&(e.settledAtMs??=r);let h=m&&p.pending&&a;if(m&&!h||!m&&s){e.ended=!0,c.push(endLine(e,m?{...f,output:callOutputSource(sessionTables(i.view),f.callId)?.output}:{outcome:`interrupted`,status:`settled`},p.tools,n.dot??`·`));continue}let g={callId:e.callId,kind:e.kind,name:e.name,toolName:e.toolName,input:e.input,label:e.label,purpose:e.purpose,children:p.children,omittedTasks:p.omittedTasks,omittedAttention:p.omittedAttention,startedAtMs:e.startedAtMs,childTools:new Map(p.tools.map(e=>[e.id,e]))};p.step!==void 0&&(g.step=p.step),h&&(g.finishing=!0),l.push(g)}return this.#o=l,c}#u(e,t,n,r,i,a,o=0){let s=t.kind===`agent`?agentToolSession(r,t):void 0,c=s===void 0||s.observation.status===`not-followed`?void 0:s.observation.conversation;if(s===void 0||c===void 0)return{tools:[],rows:[],pending:!1};let l=n.flatMap(e=>{let t=agentCallActivity(r,e.callId);return t.status===`unlinked`?[]:t.sessions.filter(e=>e.sessionId===s.sessionId)}),u=s.observation.status===`following`&&l.some(e=>e.deliveries.some(({status:e})=>e!==`settled`)),d=new Set(l.flatMap(e=>e.turns.map(({turnId:e})=>e))),f=!sessionTables(r.view).children[s.sessionId]?.deliveries?.length,p=c.messages.filter(e=>e.role===`assistant`&&e.metadata?.turnId!==void 0&&(f||d.has(e.metadata.turnId))),m=taskCallsById(c),h=[],g=[],_=[],v=new Set,y=0,b=!1,x=0;for(let t of p)for(let n of t.parts){if(x+=1,!isToolCallRow(n)||n.kind===`control`)continue;let t=m.get(n.callId),r=toolState(n,sessionTables(c.view)),s=`subagent:${e.callId}:tool:${n.callId}`,l=this.#d(s,[n,r.status,e.name],()=>{let a=this.#_(n.callId,n,r,i,{isSubagent:t?.task.kind===`agent`});return{...toolBlock(n,r,a),kind:`subagent-tool`,subagentCallId:e.callId,agentName:e.name,depth:1,live:!1}}),u=t?.task.kind===`agent`?i.subagents!==`hidden`:i.tools!==`hidden`;if(t!==void 0&&t.call.status!==`settled`&&u){if(v.has(t.task.taskId))continue;if(v.add(t.task.taskId),o>=8||a.remaining<=0){y+=1,b||=r.status===`approval`||taskNeedsApproval(c,t.task);continue}--a.remaining;let s=`${e.callId}/${n.callId}`,u=this.#r.get(s);u===void 0&&(u=nestedTaskRecord(s,n,t.task,l),this.#r.set(s,u));let d=this.#u(u,t.task,taskCalls(c.view,t.task.taskId).filter(e=>e.status!==`settled`),c,i,a,o+1);_.push({...u,step:d.step,children:d.children,omittedTasks:d.omittedTasks,omittedAttention:d.omittedAttention,childTools:new Map(d.tools.map(e=>[e.id,e]))})}else g.push(l);h.push({order:x,block:l,settled:!isActive(r.status)})}let S=subagentSteps(p);for(let t of S){if(!t.finalized)continue;let n=`subagent:${e.callId}:step:${t.key}`,r=this.#d(n,[t.reasoning,t.message,e.name],()=>{let n={kind:`subagent-step`,subagentCallId:e.callId,agentName:e.name,depth:1,body:t.message,live:!1};return t.reasoning.length>0&&(n.reasoning=t.reasoning),n});h.push({order:t.order,block:r,settled:!0})}let C=h.filter(e=>e.settled).sort((e,t)=>e.order-t.order).map(e=>e.block),w=S.at(-1),T={tools:g,rows:C,children:_,omittedTasks:y,omittedAttention:b,pending:u};return w!==void 0&&(T.step=firstLine(w.message)??`Thinking`),T}#d(e,t,n){let r=this.#e.get(e);if(r!==void 0&&sameKey(r.key,t))return r.block;let i={...n(),id:e};return this.#e.set(e,{key:t,block:i}),i}#f(e){let t=stripTerminalControls(userText(e));if(t.trim().length===0)return;let n=`user:${e.id}`;return this.#d(n,[t],()=>({kind:`user`,body:t,live:!1}))}#p(e,t,n,r){let i=e.parts[t];if(i?.type!==`text`&&i?.type!==`reasoning`||i.type===`reasoning`&&n.reasoning!==`full`)return;let a=stripTerminalControls(i.text).trim();if(a.length===0)return;let o=i.state===`streaming`&&r,s=`${i.type}:${i.id??`${e.id}:${t}`}`;return this.#d(s,[a,o],()=>i.type===`text`?{kind:`assistant`,body:a,live:o}:{kind:`reasoning`,body:a,collapsed:!1,live:o})}#m(e,t){return this.#d(`connection-auth:${e.interactionId}`,[e],()=>{let n=e.outcome??`required`,r=authorizationTerminalMessage(n);return{kind:`connection-auth`,title:`${stripTerminalControls(t.displayName??t.name)} · authorization · ${n}`,...formatAuthorization(e,t,r),preformatted:!0,live:r===void 0}})}#h(e,t,n,r,i){let a=n||isActive(t.status);return this.#d(`tool:${e.callId}`,[e,t.status,a,i.tools,i.subagentNames,r?.start,r?.complete],()=>{let n=this.#_(e.callId,e,t,i,{label:r?.start,completeLabel:r?.complete});return{...toolBlock(e,t,n),kind:`tool`,live:a,expanded:i.tools===`full`}})}#g(e,t,n){let{message:r,hint:i,detail:a}=t;return this.#d(e,[r,i,a],()=>{let e={kind:`error`,title:`Error`,body:stripTerminalControls(r),live:!1};return i!==void 0&&(e.hint=stripTerminalControls(i)),a!==void 0&&(e.detail=n.diagnosticsPath===void 0?stripTerminalControls(a):`details: ${n.diagnosticsPath}`),e})}#_(e,t,n,r,i={}){n.output!==void 0&&this.#t.observeRead(n.output);let a={};(i.isSubagent===!0||r.subagentNames?.includes(toolBaseName(t.name))===!0)&&(a.isSubagent=!0),i.label!==void 0&&(a.label=i.label),i.completeLabel!==void 0&&(a.completeLabel=i.completeLabel);let o=readWriteFileInput(t.name,t.input);if(o!==void 0){let t=this.#t.observeWrite({...o,callId:e});t!==void 0&&(a.previousContent=t);let r=writeExistedFlag(n.output);r!==void 0&&(a.existed=r)}return Object.keys(a).length>0?a:void 0}};function turnActivity(e,t){let n=activity(e.data.view);switch(n.kind){case`calling`:return`Running`;case`compacting`:return`Compacting`;case`waiting-on-tasks`:return waitingLabel(t);case`waiting-on-interaction`:{let e=n.interactions.flatMap(e=>e.request.signIn===void 0?[]:[e.request.signIn]);return e.length>0?signInLabel(e.map(e=>e.displayName??e.name)):`Waiting for input`}default:{let{previews:t}=snapshotState(e.conversation.view);return Object.values(t.parts).some(e=>e.kind===`text`)||Object.keys(t.calls).length>0?`Generating`:`Thinking`}}}function sameKey(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{ConversationTranscript,turnActivity};
|
|
1
|
+
import{FileContentCache}from"./file-content-cache.js";import{signInLabel,waitingLabel}from"./task-activity.js";import{TaskRecords}from"./task-records.js";import{agentDisplayName,agentTaskLabel,isPanelRoutedTool,readWriteFileInput,toolBaseName}from"./tool-presentation.js";import{activeToolSteps,authorizationTerminalMessage,endLine,firstLine,followUpLine,formatAuthorization,isActive,isToolCallRow,nestedTaskRecord,startLine,subagentSteps,taskCallsById,taskNeedsApproval,toolBlock,toolState,userText,writeExistedFlag}from"./transcript-parts.js";import{activity,callOutputSource}from"#protocol/session-projection/selectors.js";import{sessionTables,snapshotState}from"#protocol/session-projection/session-view.js";import{stripTerminalControls}from"#cli/ui/terminal-text.js";import{agentCallActivity,agentToolSession,taskCalls}from"#client/conversation-state.js";var ConversationTranscript=class{#e=new Map;#t=new FileContentCache;#n=new TaskRecords;#r=new Map;#i=[];#a=new Set;#o=[];reset(){this.#e=new Map,this.#t.clear(),this.#n.clear(),this.#r.clear(),this.#i=[],this.#a.clear(),this.#o=[]}get tasks(){return this.#o}taskLabel(e,t){let n=sessionTables(e.view).tasks[t];if(n===void 0)return;let r=taskCalls(e.view,t),i=r.findLast(e=>e.status!==`settled`)??r.at(-1),a=i===void 0?void 0:this.#n.get(i.callId);return a===void 0?n.kind===`agent`?agentTaskLabel(agentDisplayName(stripTerminalControls(n.name))):stripTerminalControls(n.name):a.kind===`agent`?agentTaskLabel(a.name):a.name}stopWorking(e){let t=[];for(let n of this.#n.values())n.ended||(n.ended=!0,t.push(endLine(n,{outcome:`interrupted`,status:`settled`},void 0,e.dot??`·`)));return this.#o=[],t}project(e,t){let{conversation:n,working:r}=e,i=Date.now(),a=[],o=taskCallsById(n),{toolLabels:s,withdrawn:c}=e.data,l=new Map(e.failures.flatMap(e=>e.turnId===void 0?[]:[[e.turnId,e]])),u=new Map;for(let[e,t]of n.messages.entries()){let n=t.metadata?.turnId;n!==void 0&&u.set(n,e)}let d=new Set,endTurn=(e,n)=>{if(n===void 0||u.get(n)!==e)return!1;let r=l.get(n);return r!==void 0&&(a.push(this.#g(`failure:${n}`,r,t)),d.add(n),!0)};for(let[d,f]of n.messages.entries()){if(f.role===`user`){let e=this.#f(f);e!==void 0&&a.push(e),endTurn(d,f.metadata?.turnId);continue}let p=f.parts.filter(e=>isToolCallRow(e)&&(e.state!==`streaming`||r)&&e.kind!==`control`&&!c(e.callId)&&!o.has(e.callId)&&!isPanelRoutedTool(e.name)),m=new Map(p.map(t=>[t,toolState(t,e.data.view)])),h=activeToolSteps(m);for(let[n,c]of f.parts.entries())if(c.type===`text`||c.type===`reasoning`){let e=this.#p(f,n,t,r);e!==void 0&&a.push(e)}else if(c.type===`interaction`)c.request.signIn!==void 0&&t.connectionAuth!==`hidden`&&a.push(this.#m(c,c.request.signIn));else if(c.type===`tool`){let n=o.get(c.callId);if(n!==void 0){let r=this.#c(c,n.task,s,t,i,e.data.view);r!==void 0&&a.push(r);continue}let r=m.get(c);if(r===void 0||t.tools===`hidden`)continue;let l=s(c.callId);a.push(this.#h(c,r,h.has(c.stepIndex),l,t))}let g=f.metadata?.turnId;endTurn(d,g)||g!==void 0&&!l.has(g)&&u.get(g)===d&&sessionTables(n.view).turns[g]?.outcome===`cancelled`&&a.push(this.#d(`cancelled:${g}`,[],()=>({kind:`notice`,body:`Cancelled.`,live:!1})))}let f=0;for(let n of e.failures){if(n.turnId!==void 0&&d.has(n.turnId))continue;let e=n.turnId===void 0?`failure:session:${f++}`:`failure:${n.turnId}`;a.push(this.#g(e,n,t))}let p=this.#s(a),m=this.#l(e,o,t,i);for(let e of m){let t=p.slice(-8).map(e=>e.id);this.#i.push({block:e,after:t}),this.#a.add(e.id),p.push(e)}return p}#s(e){let t=[...e];for(let{block:e,after:n}of this.#i){let r=t.length;for(let e=n.length-1;e>=0;--e){let i=t.findIndex(t=>t.id===n[e]);if(i!==-1){r=i+1;break}}t.splice(r,0,e)}return t}#c(e,t,n,r,i,a){if(!(t.kind===`agent`?r.subagents!==`hidden`:r.tools!==`hidden`))return;let o=n(e.callId)?.start,s=this.#n.record(e,t,o,i,a);return s.callId===e.callId?this.#d(`task:${s.callId}:start`,[s],()=>startLine(s)):this.#d(`task:${e.callId}:message`,[s],()=>followUpLine(s,e,o))}#l(e,t,n,r){let{conversation:i,working:a}=e,o=Object.values(sessionTables(i.view).turns).at(-1),s=!a&&(e.data.sessionFailed||o?.outcome===`cancelled`||o?.outcome===`failed`),c=[],l=[],u={remaining:128};for(let e of this.#n.values()){if(e.ended)continue;let o=t.get(e.callId)?.task;if(o===void 0)continue;let d=e.callIds.flatMap(e=>{let n=t.get(e)?.call;return n===void 0?[]:[n]}),f=d.at(-1),p=this.#u(e,o,d,i,n,u);if(n.subagents===`full`)for(let e of p.rows)this.#a.has(e.id)||c.push(e);let m=d.every(e=>e.status===`settled`);m&&(e.settledAtMs??=r);let h=m&&p.pending&&a;if(m&&!h||!m&&s){e.ended=!0,c.push(endLine(e,m?{...f,output:callOutputSource(sessionTables(i.view),f.callId)?.output}:{outcome:`interrupted`,status:`settled`},p.tools,n.dot??`·`));continue}let g={callId:e.callId,kind:e.kind,name:e.name,toolName:e.toolName,input:e.input,label:e.label,purpose:e.purpose,children:p.children,omittedTasks:p.omittedTasks,omittedAttention:p.omittedAttention,startedAtMs:e.startedAtMs,childTools:new Map(p.tools.map(e=>[e.id,e]))};p.step!==void 0&&(g.step=p.step),h&&(g.finishing=!0),l.push(g)}return this.#o=l,c}#u(e,t,n,r,i,a,o=0){let s=t.kind===`agent`?agentToolSession(r,t):void 0,c=s===void 0||s.observation.status===`not-followed`?void 0:s.observation.conversation;if(s===void 0||c===void 0)return{tools:[],rows:[],pending:!1};let l=n.flatMap(e=>{let t=agentCallActivity(r,e.callId);return t.status===`unlinked`?[]:t.sessions.filter(e=>e.sessionId===s.sessionId)}),u=s.observation.status===`following`&&l.some(e=>e.deliveries.some(({status:e})=>e!==`settled`)),d=new Set(l.flatMap(e=>e.turns.map(({turnId:e})=>e))),f=!sessionTables(r.view).children[s.sessionId]?.deliveries?.length,p=c.messages.filter(e=>e.role===`assistant`&&e.metadata?.turnId!==void 0&&(f||d.has(e.metadata.turnId))),m=taskCallsById(c),h=[],g=[],_=[],v=new Set,y=0,b=!1,x=0;for(let t of p)for(let n of t.parts){if(x+=1,!isToolCallRow(n)||n.kind===`control`)continue;let t=m.get(n.callId),r=toolState(n,sessionTables(c.view)),s=`subagent:${e.callId}:tool:${n.callId}`,l=this.#d(s,[n,r.status,e.name],()=>{let a=this.#_(n.callId,n,r,i,{isSubagent:t?.task.kind===`agent`});return{...toolBlock(n,r,a),kind:`subagent-tool`,subagentCallId:e.callId,agentName:e.name,depth:1,live:!1}}),u=t?.task.kind===`agent`?i.subagents!==`hidden`:i.tools!==`hidden`;if(t!==void 0&&t.call.status!==`settled`&&u){if(v.has(t.task.taskId))continue;if(v.add(t.task.taskId),o>=8||a.remaining<=0){y+=1,b||=r.status===`approval`||taskNeedsApproval(c,t.task);continue}--a.remaining;let s=`${e.callId}/${n.callId}`,u=this.#r.get(s);u===void 0&&(u=nestedTaskRecord(s,n,t.task,l),this.#r.set(s,u));let d=this.#u(u,t.task,taskCalls(c.view,t.task.taskId).filter(e=>e.status!==`settled`),c,i,a,o+1);_.push({...u,step:d.step,children:d.children,omittedTasks:d.omittedTasks,omittedAttention:d.omittedAttention,childTools:new Map(d.tools.map(e=>[e.id,e]))})}else g.push(l);h.push({order:x,block:l,settled:!isActive(r.status)})}let S=subagentSteps(p);for(let t of S){if(!t.finalized)continue;let n=`subagent:${e.callId}:step:${t.key}`,r=this.#d(n,[t.reasoning,t.message,e.name],()=>{let n={kind:`subagent-step`,subagentCallId:e.callId,agentName:e.name,depth:1,body:t.message,live:!1};return t.reasoning.length>0&&(n.reasoning=t.reasoning),n});h.push({order:t.order,block:r,settled:!0})}let C=h.filter(e=>e.settled).sort((e,t)=>e.order-t.order).map(e=>e.block),w=S.at(-1),T={tools:g,rows:C,children:_,omittedTasks:y,omittedAttention:b,pending:u};return w!==void 0&&(T.step=firstLine(w.message)??`Thinking`),T}#d(e,t,n){let r=this.#e.get(e);if(r!==void 0&&sameKey(r.key,t))return r.block;let i={...n(),id:e};return this.#e.set(e,{key:t,block:i}),i}#f(e){let t=stripTerminalControls(userText(e));if(t.trim().length===0)return;let n=`user:${e.id}`;return this.#d(n,[t],()=>({kind:`user`,body:t,live:!1}))}#p(e,t,n,r){let i=e.parts[t];if(i?.type!==`text`&&i?.type!==`reasoning`||i.type===`reasoning`&&n.reasoning!==`full`)return;let a=stripTerminalControls(i.text).trim();if(a.length===0)return;let o=i.state===`streaming`&&r,s=`${i.type}:${i.id??`${e.id}:${t}`}`;return this.#d(s,[a,o],()=>i.type===`text`?{kind:`assistant`,body:a,live:o}:{kind:`reasoning`,body:a,collapsed:!1,live:o})}#m(e,t){return this.#d(`connection-auth:${e.interactionId}`,[e],()=>{let n=e.outcome??`required`,r=authorizationTerminalMessage(n);return{kind:`connection-auth`,title:`${stripTerminalControls(t.displayName??t.name)} · authorization · ${n}`,...formatAuthorization(e,t,r),preformatted:!0,live:r===void 0}})}#h(e,t,n,r,i){let a=n||isActive(t.status);return this.#d(`tool:${e.callId}`,[e,t.status,a,i.tools,i.subagentNames,r?.start,r?.complete],()=>{let n=this.#_(e.callId,e,t,i,{label:r?.start,completeLabel:r?.complete});return{...toolBlock(e,t,n),kind:`tool`,live:a,expanded:i.tools===`full`}})}#g(e,t,n){let{message:r,hint:i,detail:a}=t;return this.#d(e,[r,i,a],()=>{let e={kind:`error`,title:`Error`,body:stripTerminalControls(r),live:!1};return i!==void 0&&(e.hint=stripTerminalControls(i)),a!==void 0&&(e.detail=n.diagnosticsPath===void 0?stripTerminalControls(a):`details: ${n.diagnosticsPath}`),e})}#_(e,t,n,r,i={}){if(n.output!==void 0&&this.#t.observeRead(n.output),toolBaseName(t.name)===`edit_file`)for(let e of[pathField(t.input),pathField(n.output)])e!==void 0&&this.#t.forget(e);let a={};(i.isSubagent===!0||r.subagentNames?.includes(toolBaseName(t.name))===!0)&&(a.isSubagent=!0),i.label!==void 0&&(a.label=i.label),i.completeLabel!==void 0&&(a.completeLabel=i.completeLabel);let o=readWriteFileInput(t.name,t.input);if(o!==void 0){let t=this.#t.observeWrite({...o,callId:e});t!==void 0&&(a.previousContent=t);let r=writeExistedFlag(n.output);r!==void 0&&(a.existed=r)}return Object.keys(a).length>0?a:void 0}};function pathField(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e.path;return typeof t==`string`&&t.length>0?t:void 0}function turnActivity(e,t){let n=activity(e.data.view);switch(n.kind){case`calling`:return`Running`;case`compacting`:return`Compacting`;case`waiting-on-tasks`:return waitingLabel(t);case`waiting-on-interaction`:{let e=n.interactions.flatMap(e=>e.request.signIn===void 0?[]:[e.request.signIn]);return e.length>0?signInLabel(e.map(e=>e.displayName??e.name)):`Waiting for input`}default:{let{previews:t}=snapshotState(e.conversation.view);return Object.values(t.parts).some(e=>e.kind===`text`)||Object.keys(t.calls).length>0?`Generating`:`Thinking`}}}function sameKey(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}export{ConversationTranscript,turnActivity};
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"zod": "4.5.4",
|
|
62
62
|
"zod-validation-error": "5.0.0"
|
|
63
63
|
},
|
|
64
|
-
"scriptHash": "
|
|
64
|
+
"scriptHash": "c1580cf3f457233664de0f3704c7d03f87a2d4aaf0fb79e26350448aa694bc00",
|
|
65
65
|
"toolVersions": {
|
|
66
66
|
"env-runner>crossws": "0.4.17",
|
|
67
67
|
"env-runner>srvx": "1.0.8",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as e,h as t}from"../../_chunks/workflow/dist-C32arEh7.js";import{a as n,i as r,r as i,t as a}from"../../_chunks/workflow/attribute-changes-
|
|
1
|
+
import{a as e,h as t}from"../../_chunks/workflow/dist-C32arEh7.js";import{a as n,i as r,r as i,t as a}from"../../_chunks/workflow/attribute-changes-AOnel6r3.js";import{n as o}from"../../_chunks/workflow/resume-hook-XRKdnxa4.js";import{Ai as s,Ci as c,Ei as l,Mi as u,Qr as d,T as f,Ti as p,X as m,Z as h,_i as g,bi as _,i as v,ji as y,ki as b,wi as x,x as S}from"../../_chunks/workflow/serialization-bMKNKGL1.js";import{r as C}from"../../_chunks/workflow/wait-until-RI3P9oYt.js";import{t as w}from"../../_chunks/workflow/sleep-rBxEVIeO.js";function T(e){r(`createHook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-hook`,T)}function E(e){r(`createWebhook()`,`https://workflow-sdk.dev/docs/api-reference/workflow/create-webhook`,E)}function D({schema:e}={}){function t(e){r(`defineHook().create()`,`https://workflow-sdk.dev/docs/api-reference/workflow/define-hook`,t)}return{create:t,async resume(t,n){if(!e?.[`~standard`])return await o(t,n);let r=e[`~standard`].validate(n);if(r instanceof Promise&&(r=await r),r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>String(typeof e==`object`&&e?e.key:e)).join(`.`);return t?` at "${t}": ${e.message}`:` ${e.message}`});throw Error(`Hook payload did not match the defined schema:\n${e.join(`
|
|
2
2
|
`)}`)}return await o(t,r.value)}}}async function O(t,n={}){let r=h.getStore(),i=r?.workflowMetadata?.workflowRunId;if(!i)throw new e(`setAttributes() must be called from a 'use workflow' or 'use step' function. Calling it from plain host code is not supported.`);let o={type:`step`,stepId:r.stepMetadata.stepId,attempt:r.stepMetadata.attempt},s=a(t,n,o);s.length!==0&&(r.runReadyBarrier&&await r.runReadyBarrier,await(await _()).events.create(i,{eventType:`attr_set`,specVersion:C(r.runSpecVersion),eventData:{changes:s,writer:o,...n.allowReservedAttributes===!0?{allowReservedAttributes:!0}:{}}},{inBand:!1}))}function k(){let e=h.getStore();return e||i(`getStepMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-step-metadata`,k),e.stepMetadata}function A(){let e=h.getStore();return e||n(`getWorkflowMetadata()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-workflow-metadata`,A),e.workflowMetadata}function j(e={}){let t=h.getStore();t||n(`getWritable()`,`https://workflow-sdk.dev/docs/api-reference/workflow/get-writable`,j);let{namespace:r}=e,i=t.workflowMetadata.workflowRunId,a=m(i,r);t.writables??=new Map;let o=t.writables,_=o.get(a);if(_)return _.writable;let C=c();C.deferReleaseSettlement=t.streamStates!==void 0;let w=f(S(globalThis,t.ops,i,t.encryptionKey,!0,t.runReadyBarrier),t.encryptionKey),T=new v(i,a,t.runReadyBarrier);t.streamStates??=[],t.streamStates.push(C),t.ops.push(C.promise),x(w.readable,T,C).catch(()=>{});let E=l(w.writable,C);return p(E,C),Object.defineProperty(E,b,{value:a,writable:!1}),Object.defineProperty(E,u,{value:i,writable:!1}),t.workflowDeploymentId&&Object.defineProperty(E,s,{value:t.workflowDeploymentId,writable:!1}),d(t.encryptionKey)&&Object.defineProperty(E,y,{value:g(t.encryptionKey.keyPair.publicKey),writable:!1}),o.set(a,{writable:E,state:C}),E}export{e as FatalError,t as RetryableError,T as createHook,E as createWebhook,D as defineHook,k as getStepMetadata,A as getWorkflowMetadata,j as getWritable,O as setAttributes,w as sleep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as DYNAMIC_WORKFLOW_VERSION,n as REPLAY_RESOLVE_DATA,r as SLOT_GAP_RECHECK_ATTEMPTS,i as SLOT_GAP_RECHECK_BASE_DELAY_MS,a as absorbSkippedSlotReport,o as appendEventLog,s as appendUniqueEvents,c as findEventSlotGap,l as getQueueOverhead,u as getWorkflowQueueName,d as handleHealthCheckMessage,f as healthCheck,p as insertEventByEventId,m as isQueueSendFailure,h as isSlotGapCheckEnabled,g as loadWorkflowRunEvents,_ as maxEventSlot,v as memoizeEncryptionKey,y as mergeReportedEvents,b as parseHealthCheckPayload,x as preconditionEventDelta,S as queueMessage,C as queueMessages,w as resolveRunEncryptionKey,T as rootRunIdFrom,E as runDispatchContext,D as settleEventSlotGap,O as slotSnapshotParams,k as stepDispatchIdempotencyKey,A as withHealthCheck,j as withReplayDelta}from"../../../_chunks/workflow/helpers-
|
|
1
|
+
export{t as DYNAMIC_WORKFLOW_VERSION,n as REPLAY_RESOLVE_DATA,r as SLOT_GAP_RECHECK_ATTEMPTS,i as SLOT_GAP_RECHECK_BASE_DELAY_MS,a as absorbSkippedSlotReport,o as appendEventLog,s as appendUniqueEvents,c as findEventSlotGap,l as getQueueOverhead,u as getWorkflowQueueName,d as handleHealthCheckMessage,f as healthCheck,p as insertEventByEventId,m as isQueueSendFailure,h as isSlotGapCheckEnabled,g as loadWorkflowRunEvents,_ as maxEventSlot,v as memoizeEncryptionKey,y as mergeReportedEvents,b as parseHealthCheckPayload,x as preconditionEventDelta,S as queueMessage,C as queueMessages,w as resolveRunEncryptionKey,T as rootRunIdFrom,E as runDispatchContext,D as settleEventSlotGap,O as slotSnapshotParams,k as stepDispatchIdempotencyKey,A as withHealthCheck,j as withReplayDelta}from"../../../_chunks/workflow/helpers-9AgMPjGd.js";
|