You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bring the Vue port up to parity with @cloudflare/ai-chat 0.9.x on resume/recovery:
- Resume dedupe (0.8.5): fallback-ACK a resume offer at most once per socket,
preventing duplicated assistant text when a stream resume is replayed twice.
- isRecovering (0.8.0): reactive flag driven by the cf_agent_chat_recovering frame,
distinct from streaming; not cleared by ordinary message sync.
- cancelOnClientAbort (0.7.0): generic client aborts are local-only by default and the
server turn keeps running and stays observable; explicit stop() always cancels via
active-server-turn tracking (locally-initiated, resume-fallback-observed, and
transport-resumed turns are all cancellable).
- cf_agent_stream_pending (0.9.0): extend the resume probe 5s -> 60s during the
server's pre-stream window.
- connectionError (0.9.0): surface terminal WebSocket failures from the AgentClient.
Bumps the agents dependency to 0.17.0 and raises the peer floor to >=0.17.0 (the
version that first exports connectionError / onConnectionError / AgentConnectionError).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012MmBgJB6Z7GT9ZffT79YhA
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ Vue 3 composable for [Cloudflare Agents](https://github.com/cloudflare/agents)
6
6
7
7
## Status
8
8
9
-
v0.1 — covers the surface needed for a working chat UI: streaming responses, client-side tools, tool approvals, stream resumption, broadcast handling. Deeper upstream features (the `useAgent` connection hook, initial-message HTTP cache, `isServerStreaming`flag) are on the roadmap.
9
+
Covers the surface needed for a working chat UI — streaming responses, client-side tools, tool approvals, stream resumption, broadcast handling — at parity with upstream `@cloudflare/ai-chat` 0.9.x on resume/recovery: resume dedupe, `isRecovering`, `cancelOnClientAbort`, pre-stream `cf_agent_stream_pending`, and `connectionError`. Deeper upstream features (the `useAgent` connection hook, initial-message HTTP cache, `isServerStreaming`/ `isStreaming` flags) are on the roadmap.
10
10
11
11
## Install
12
12
@@ -21,7 +21,7 @@ Peer dependencies (must also be installed):
21
21
|`vue`|`^3.3.4`|
22
22
|`@ai-sdk/vue`|`^3.0.0`|
23
23
|`ai`|`^6.0.0`|
24
-
|`agents`|`>=0.11.0 <1.0.0`|
24
+
|`agents`|`>=0.17.0 <1.0.0`|
25
25
26
26
## Usage
27
27
@@ -78,7 +78,9 @@ Returns:
78
78
|`addToolOutput`|`function`| Submit a tool result. Sends `cf_agent_tool_result` and triggers continuation if enabled. |
79
79
|`addToolApprovalResponse`|`function`| Resolve a human-in-the-loop tool approval. Sends `cf_agent_tool_approval` and triggers continuation. |
80
80
|`clearHistory`|`function`| Clear local state and broadcast `cf_agent_chat_clear` to the server. |
81
-
|`stop`|`function`| Abort the active stream and any pending tool continuation. |
81
+
|`stop`|`function`| Abort the active stream and any pending tool continuation. Always cancels the server turn (explicit cancel). |
82
+
|`isRecovering`|`Ref<boolean>`| Reactive — `true` while the server is recovering a durable chat turn (distinct from streaming, so a UI can show "recovering…"). Driven by `cf_agent_chat_recovering`. |
83
+
|`connectionError`|`Ref<AgentConnectionError \| null>`| Reactive — the terminal WebSocket connection failure, or `null`. Cleared on reconnect. |
|`autoContinueAfterToolResult`|`boolean`|`true`| Server resumes the stream after a tool result. |
93
95
|`resume`|`boolean`|`true`| Resume in-flight streams on socket reconnect. |
96
+
|`cancelOnClientAbort`|`boolean`|`false`| When `true`, a generic client-side abort cancels the server turn; when `false` (default) such aborts are local-only and the server turn keeps running and can resume. Explicit `stop()` always cancels. |
0 commit comments