docs(examples): add usage examples for the WebSocket API#54
Open
FenjuFu wants to merge 3 commits into
Open
Conversation
Adds docs/examples.md with a wscat smoke test, a minimal Node.js client for the v2 card-model protocol (streaming, keep-alive, prompt handling, interrupt, resume), and links it from both READMEs' documentation sections.
Adds docs/examples.md with a wscat smoke test, a minimal Node.js client for the v2 card-model protocol (streaming, keep-alive, prompt handling, interrupt, resume), and links it from both READMEs' documentation sections.
Adds docs/examples.md with a wscat smoke test, a minimal Node.js client for the v2 card-model protocol (streaming, keep-alive, prompt handling, interrupt, resume), and links it from both READMEs' documentation sections.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
docs/examples.md- a practical "first conversation" guide for the WebSocket API - and links it from the documentation section of both READMEs.Contents:
make run, default endpointws://localhost:8081/v1/wssession.eventkind=opened), oneuser.message, what thecard.*stream means(card_id, channel, index), the bareping/pongkeep-alive, auto-approvingpermissionprompts, detecting turn completion viacard.closeon theturncardsession.interruptwith the observedtrace_iddecisionvalues and reply payload shapes forpermission/question/plan_review/step_decisionsession.resumewithlast_seq, and the prompt re-send /request_iddedup contractWhy
The protocol spec (
docs/protocols/websocket.md) is thorough but is a wire contract, not a tutorial - there was no copy-paste path from "cloned the repo" to "saw streaming output". Usage examples are also the most-requested doc type from new integrators.Verification
All frames, field names, decision values and defaults were taken from
docs/protocols/websocket.md(v2 card model) andconfigs/config.yaml- notably the endpoint is/v1/wsper the spec, not the/wscurrently shown in the README's protocol summary (that section also still says v1.4; happy to refresh it in a follow-up if wanted).Docs-only change.