feat(wire): bumped collaborative protocol to version 3
- Bumped the collaborative protocol version (`COLLAB_PROTO`) from 2 to 3. - Required protocol-3 to coordinate `ui-request`, `ui-request-end`, and `ui-response` frames. - Rejected older protocol-2 guests at handshake to prevent host-asked requests from hanging. - Updated verification tests and CI installation check scripts to expect protocol version 3.
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- Bumped `COLLAB_PROTO` to `3`: the `ui-request`/`ui-request-end` host frames and `ui-response` guest frame are part of the handshake contract. Proto-2 guests, which silently dropped host ask requests, are now rejected at hello with the protocol-mismatch error.
|
||||
|
||||
### Added
|
||||
|
||||
- Added collaboration UI request/response wireframes, enabling browser guests to respond to host-side interactive prompts.
|
||||
|
||||
@@ -389,8 +389,12 @@ export type WireFrame = GuestFrame | HostFrame;
|
||||
* transcript entries follow in `snapshot-chunk` frames, so multi-MB
|
||||
* sessions are not gated on a single welcome frame fitting under the
|
||||
* guest's first-welcome timeout.
|
||||
* - `3`: host asks guests through `ui-request`/`ui-request-end` host frames
|
||||
* answered by the `ui-response` guest frame. Guests that predate the
|
||||
* grammar would silently drop `ui-request` (asks hang forever on the
|
||||
* host), so they must be rejected at hello.
|
||||
*/
|
||||
export const COLLAB_PROTO = 2;
|
||||
export const COLLAB_PROTO = 3;
|
||||
|
||||
/** Parameter key used for intent tracing (e.g. prompt explanation/reasoning) */
|
||||
export const INTENT_FIELD = "i";
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
|
||||
describe("collab wire constants", () => {
|
||||
it("exports the protocol constants consumed by host, guest, and relay links", () => {
|
||||
expect(COLLAB_PROTO).toBe(2);
|
||||
expect(COLLAB_PROTO).toBe(3);
|
||||
expect(COLLAB_PROMPT_MESSAGE_TYPE).toBe("collab-prompt");
|
||||
expect(ENVELOPE_HEADER_LENGTH).toBe(4);
|
||||
expect(ROOM_ID_BYTES).toBe(16);
|
||||
|
||||
@@ -170,7 +170,7 @@ mkdir -p "$TARBALL_APP_DIR"
|
||||
exit 1
|
||||
}
|
||||
wire_proto="$(bun -e 'import { COLLAB_PROTO } from "@oh-my-pi/pi-wire"; process.stdout.write(String(COLLAB_PROTO));')"
|
||||
[ "$wire_proto" = "2" ] || {
|
||||
[ "$wire_proto" = "3" ] || {
|
||||
echo "Unexpected @oh-my-pi/pi-wire COLLAB_PROTO: $wire_proto"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user