zcode-acp-server 0.88.2 → 0.90.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.
Files changed (60) hide show
  1. package/README.md +1 -1
  2. package/dist/backend/client.d.ts +8 -0
  3. package/dist/backend/client.d.ts.map +1 -1
  4. package/dist/backend/client.js +14 -0
  5. package/dist/backend/client.js.map +1 -1
  6. package/dist/code-fingerprint.json +2 -2
  7. package/dist/config/deferred-probe-capability.d.ts +10 -1
  8. package/dist/config/deferred-probe-capability.d.ts.map +1 -1
  9. package/dist/config/deferred-probe-capability.js +41 -1
  10. package/dist/config/deferred-probe-capability.js.map +1 -1
  11. package/dist/config/official-mcp-auth.d.ts +60 -0
  12. package/dist/config/official-mcp-auth.d.ts.map +1 -0
  13. package/dist/config/official-mcp-auth.js +253 -0
  14. package/dist/config/official-mcp-auth.js.map +1 -0
  15. package/dist/handlers/background-tasks.d.ts +29 -0
  16. package/dist/handlers/background-tasks.d.ts.map +1 -1
  17. package/dist/handlers/background-tasks.js +97 -0
  18. package/dist/handlers/background-tasks.js.map +1 -1
  19. package/dist/handlers/replay.d.ts.map +1 -1
  20. package/dist/handlers/replay.js +22 -4
  21. package/dist/handlers/replay.js.map +1 -1
  22. package/dist/handlers/rewind.d.ts +55 -0
  23. package/dist/handlers/rewind.d.ts.map +1 -0
  24. package/dist/handlers/rewind.js +284 -0
  25. package/dist/handlers/rewind.js.map +1 -0
  26. package/dist/handlers/server-requests.d.ts +6 -0
  27. package/dist/handlers/server-requests.d.ts.map +1 -1
  28. package/dist/handlers/server-requests.js +34 -0
  29. package/dist/handlers/server-requests.js.map +1 -1
  30. package/dist/handlers/slash.d.ts.map +1 -1
  31. package/dist/handlers/slash.js +5 -41
  32. package/dist/handlers/slash.js.map +1 -1
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +7 -1
  35. package/dist/index.js.map +1 -1
  36. package/dist/remote/settings-endpoint.d.ts.map +1 -1
  37. package/dist/remote/settings-endpoint.js +162 -3
  38. package/dist/remote/settings-endpoint.js.map +1 -1
  39. package/dist/server.d.ts.map +1 -1
  40. package/dist/server.js +50 -2
  41. package/dist/server.js.map +1 -1
  42. package/dist/settings/cli-config.d.ts +21 -0
  43. package/dist/settings/cli-config.d.ts.map +1 -1
  44. package/dist/settings/cli-config.js +97 -0
  45. package/dist/settings/cli-config.js.map +1 -1
  46. package/dist/settings/mcp-status.d.ts +20 -0
  47. package/dist/settings/mcp-status.d.ts.map +1 -0
  48. package/dist/settings/mcp-status.js +55 -0
  49. package/dist/settings/mcp-status.js.map +1 -0
  50. package/dist/settings/provider-config.d.ts +34 -0
  51. package/dist/settings/provider-config.d.ts.map +1 -1
  52. package/dist/settings/provider-config.js +125 -0
  53. package/dist/settings/provider-config.js.map +1 -1
  54. package/dist/settings/skills.d.ts +23 -0
  55. package/dist/settings/skills.d.ts.map +1 -1
  56. package/dist/settings/skills.js +34 -0
  57. package/dist/settings/skills.js.map +1 -1
  58. package/docs/PROTOCOL.md +61 -10
  59. package/docs/REMOTE-CLIENTS.md +27 -0
  60. 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/rewind` — removed in 0.16+
751
-
752
- `session/rewind` (and `session/rewindCascade`) existed up to app-server
753
- 0.15.x. The 0.16 app-server removed them from its RPC dispatch (verified
754
- against 0.16.3: `-32601 Method not found`) — rewind moved to the v4
755
- conversation API (`v4/conversation/fileRewindPreview` and friends), which the
756
- bridge does not speak. The bridge's `session/rewind` /
757
- `session/rewindCascade` ACP extensions and the `/rewind` slash command were
758
- removed accordingly. `session/fork` (branch from checkpoint) remains the
759
- bridge-side alternative.
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
 
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-acp-server",
3
- "version": "0.88.2",
3
+ "version": "0.90.0",
4
4
  "description": "Agent Client Protocol (ACP) server bridging headless ZCode to editors like Zed and JetBrains.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",