zcode-acp-server 0.88.2 → 0.89.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/README.md +1 -1
- package/dist/code-fingerprint.json +2 -2
- package/dist/config/deferred-probe-capability.d.ts +10 -1
- package/dist/config/deferred-probe-capability.d.ts.map +1 -1
- package/dist/config/deferred-probe-capability.js +41 -1
- package/dist/config/deferred-probe-capability.js.map +1 -1
- package/dist/handlers/background-tasks.d.ts +29 -0
- package/dist/handlers/background-tasks.d.ts.map +1 -1
- package/dist/handlers/background-tasks.js +97 -0
- package/dist/handlers/background-tasks.js.map +1 -1
- package/dist/handlers/replay.d.ts.map +1 -1
- package/dist/handlers/replay.js +22 -4
- package/dist/handlers/replay.js.map +1 -1
- package/dist/handlers/rewind.d.ts +55 -0
- package/dist/handlers/rewind.d.ts.map +1 -0
- package/dist/handlers/rewind.js +284 -0
- package/dist/handlers/rewind.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +23 -1
- package/dist/server.js.map +1 -1
- package/docs/PROTOCOL.md +61 -10
- package/docs/REMOTE-CLIENTS.md +27 -0
- package/package.json +1 -1
package/docs/PROTOCOL.md
CHANGED
|
@@ -747,16 +747,67 @@ Fork a new session from a checkpoint.
|
|
|
747
747
|
}
|
|
748
748
|
```
|
|
749
749
|
|
|
750
|
-
### `session/
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
750
|
+
### `session/edit_user_message` / `session/retry_turn` — rewind extensions
|
|
751
|
+
|
|
752
|
+
Edit-and-resend of the latest user message, and regenerate of the latest
|
|
753
|
+
turn, mapped onto the v4 conversation commands `editUserQuery` / `retryTurn`.
|
|
754
|
+
The old v3 `session/rewind` (and `session/rewindCascade`) existed up to
|
|
755
|
+
app-server 0.15.x; the 0.16 app-server removed them in favor of the v4
|
|
756
|
+
conversation API, and these two methods are that API's ACP surface.
|
|
757
|
+
|
|
758
|
+
**Capability:** `initialize` advertises `agentCapabilities._meta.zcode.rewind:
|
|
759
|
+
true` when the desktop bundle is at/above the source-verified floor (3.14.3 —
|
|
760
|
+
the v4 rewind command set and `v4/conversation/rowsRange` predate that tag).
|
|
761
|
+
Below the floor the key is ABSENT (not `false`); the methods then answer a
|
|
762
|
+
clean error. Clients should hide edit/regenerate when the flag is missing and
|
|
763
|
+
degrade to quote-to-composer.
|
|
764
|
+
|
|
765
|
+
**Request (`edit`):**
|
|
766
|
+
|
|
767
|
+
```json
|
|
768
|
+
{
|
|
769
|
+
"id": 8,
|
|
770
|
+
"method": "session/edit_user_message",
|
|
771
|
+
"params": {
|
|
772
|
+
"sessionId": "sess_abc123",
|
|
773
|
+
"messageId": "<_meta.zcode.mid of the user message>",
|
|
774
|
+
"newText": "replacement text"
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
**Request (`retry`; `messageId` optional — omitted retries the latest turn):**
|
|
780
|
+
|
|
781
|
+
```json
|
|
782
|
+
{
|
|
783
|
+
"id": 9,
|
|
784
|
+
"method": "session/retry_turn",
|
|
785
|
+
"params": { "sessionId": "sess_abc123", "messageId": "<_meta.zcode.mid of the assistant message>" }
|
|
786
|
+
}
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
**Result** (both): `{ "ok": true, "rewoundMessageId": "<the mid that was rewound>" }`
|
|
790
|
+
|
|
791
|
+
Semantics:
|
|
792
|
+
|
|
793
|
+
- Only the latest turn is addressable (upstream guards `latestQueryEditOnly`
|
|
794
|
+
/ `latestAssistantRetryOnly`); a stale/non-matching `messageId` answers
|
|
795
|
+
`-32602` before any backend round trip. Workspace files are never touched
|
|
796
|
+
(`workspaceMode: "preserve"` always — file rewind stays a desktop-app concern).
|
|
797
|
+
- The ack returns at ADMISSION: the rewound history is already committed, and
|
|
798
|
+
the replacement turn runs next. Clients should refetch history
|
|
799
|
+
(`session/load`) on the ack; the replacement turn itself streams to every
|
|
800
|
+
attached client as `agent_message_chunk` updates, and the session reports
|
|
801
|
+
busy (`$/zcode/turnState`) until it terminates.
|
|
802
|
+
- Other clients' cached tails are stale until their next replay (v1: single
|
|
803
|
+
user, edit happens on the viewed client).
|
|
804
|
+
|
|
805
|
+
**`_meta.zcode.mid`:** every REPLAYED update that renders as a message
|
|
806
|
+
(`user_message_chunk`, `agent_message_chunk`, `agent_thought_chunk`, and
|
|
807
|
+
replayed `tool_call`s) carries `_meta: { zcode: { mid: "<store message id>" } }`
|
|
808
|
+
on both `session/load` and `session/load_earlier` pages — the value the
|
|
809
|
+
rewind methods address (it equals the store row's v4 `entityId`). Live echo
|
|
810
|
+
chunks (`uprompt_`/`chunk_` ids) deliberately do NOT carry it.
|
|
760
811
|
|
|
761
812
|
### `session/goal`
|
|
762
813
|
|
package/docs/REMOTE-CLIENTS.md
CHANGED
|
@@ -962,6 +962,33 @@ Errors: `400` missing/empty title or oversized body (>4 KB), `401` bad token,
|
|
|
962
962
|
`404` unknown session (or instance), `502` bridge unreachable. Renaming during
|
|
963
963
|
a running turn is allowed — titles are no longer turn-coupled.
|
|
964
964
|
|
|
965
|
+
## Editing or regenerating a message (rewind)
|
|
966
|
+
|
|
967
|
+
Edit-and-resend of the latest user message and regenerate of the latest turn
|
|
968
|
+
ride two ACP extension methods (NOT hub routes — they go over the client's own
|
|
969
|
+
ACP connection, like `session/prompt`):
|
|
970
|
+
|
|
971
|
+
```json
|
|
972
|
+
{ "method": "session/edit_user_message",
|
|
973
|
+
"params": { "sessionId": "…", "messageId": "<_meta.zcode.mid>", "newText": "…" } }
|
|
974
|
+
{ "method": "session/retry_turn",
|
|
975
|
+
"params": { "sessionId": "…", "messageId": "<_meta.zcode.mid, optional>" } }
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
Gate on the `initialize` capability `agentCapabilities._meta.zcode.rewind ===
|
|
979
|
+
true` (absent on older bridges/backends — hide the actions and degrade to
|
|
980
|
+
quote-to-composer). Addressing uses the `_meta.zcode.mid` every replayed
|
|
981
|
+
message update carries (see `docs/PROTOCOL.md` §Extension Methods).
|
|
982
|
+
|
|
983
|
+
Client recipe on the ack (`{ok, rewoundMessageId}`): the rewound tail is
|
|
984
|
+
already committed — refetch history (`session/load`); the replacement turn
|
|
985
|
+
streams to every attached client as `agent_message_chunk` while the session
|
|
986
|
+
reports busy via `$/zcode/turnState`. A second attached client's cached tail
|
|
987
|
+
is stale until its next replay (v1: single user; the edit happens on the
|
|
988
|
+
viewed client). Only the LATEST user message can be edited and the latest
|
|
989
|
+
assistant reply regenerated — anything else answers `-32602` without a
|
|
990
|
+
backend round trip.
|
|
991
|
+
|
|
965
992
|
## Deleting a project or session
|
|
966
993
|
|
|
967
994
|
```text
|