Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/agui-durable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
"@systemfsoftware/agent": minor
"@systemfsoftware/agent-ai-decision": none
"@systemfsoftware/agent-platform-cloudflare": none
"@systemfsoftware/agent-platform-node": none
"@systemfsoftware/agent-pr-review": none
"@systemfsoftware/agent-storage-cloudflare": none
"@systemfsoftware/agent-storage-memory": none
"@systemfsoftware/agent-storage-postgres": none
"@systemfsoftware/agent-storage-sql": none
"@systemfsoftware/agent-storage-sqlite": none
"@systemfsoftware/agent-testing": none
---

Adds `projectDurableAgUi` and `toDurableAgUiEvents` to `@systemfsoftware/agent/agui`, projecting a durable Thread's canonical record log plus in-flight provisional text into cursor-indexed AG-UI events, so a reload that replays from any sequence renders the same view a live viewer saw. Settled Runs end in `RUN_FINISHED` or `RUN_ERROR`, aborted and host-halted Runs end as a stopped `RUN_FINISHED` with the `cancelled` outcome, steering transitions are emitted as `agent.steering` custom events, and a consumer's own structured run output travels in `RUN_FINISHED.result` and can be decoded and re-emitted through the typed `output` extension.
6 changes: 3 additions & 3 deletions packages/effect-agent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"./agent-registration": "./src/durable/AgentRegistration.ts",
"./agent-runtime": "./src/engine/AgentRuntime.ts",
"./agent-updates": "./src/core/AgentUpdates.ts",
"./agui": "./src/engine/AgUi.ts",
"./agui": "./src/AgUi.ts",
"./browser-use": "./src/capabilities/BrowserUse.ts",
"./budget": "./src/capabilities/Budget.ts",
"./code-executor": "./src/sandbox/CodeExecutor.ts",
Expand Down Expand Up @@ -170,8 +170,8 @@
"default": "./dist/core/AgentUpdates.mjs"
},
"./agui": {
"types": "./dist/engine/AgUi.d.mts",
"default": "./dist/engine/AgUi.mjs"
"types": "./dist/AgUi.d.mts",
"default": "./dist/AgUi.mjs"
},
"./browser-use": {
"types": "./dist/capabilities/BrowserUse.d.mts",
Expand Down
2 changes: 2 additions & 0 deletions packages/effect-agent/src/AgUi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './durable/DurableAgUi'
export * from './engine/AgUi'
26 changes: 15 additions & 11 deletions packages/effect-agent/src/core/ProvisionalText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ const modelIdentity = {
* Best-effort text and reasoning drafts, never canonical history. Native parts omit provider metadata.
* Discard retracts one generation; AttemptEnded closes every draft for that Attempt.
*/
const TextEvent = Schema.TaggedStruct('Text', {
...modelIdentity,
part: Schema.Union([
Response.TextStartPart,
Response.TextDeltaPart,
Response.TextEndPart,
Response.ReasoningStartPart,
Response.ReasoningDeltaPart,
Response.ReasoningEndPart,
]),
})

export type TextEvent = typeof TextEvent.Type

export const Event = Schema.Union([
Schema.TaggedStruct('Text', {
...modelIdentity,
part: Schema.Union([
Response.TextStartPart,
Response.TextDeltaPart,
Response.TextEndPart,
Response.ReasoningStartPart,
Response.ReasoningDeltaPart,
Response.ReasoningEndPart,
]),
}),
TextEvent,
Schema.TaggedStruct('Discard', modelIdentity),
Schema.TaggedStruct('AttemptEnded', attemptIdentity),
])
Expand Down
Loading
Loading