feat(lab): experimental WebSocket tools — bars, stream-quotes, stream-bars#47
Open
feat(lab): experimental WebSocket tools — bars, stream-quotes, stream-bars#47
Conversation
- Add src/ws/ module: types, errors, protocol, auth, client, session, parser - Add src/tools/bars.ts: experimental_get_bars tool - Add src/tools/stream.ts: experimental_stream_quotes and experimental_stream_bars tools - Wire experimental tools into MCP server (gated by TV_EXPERIMENTAL_ENABLED) - Wire experimental CLI commands: experimental bars, stream-quotes, stream-bars - Add CLI help text and argument parsing for experimental commands - Add tests: ws-protocol, ws-parser, bars, stream - Add ws and jszip dependencies - Update CLAUDE.md with experimental tools and WebSocket architecture All experimental tools require TV_EXPERIMENTAL_ENABLED=1 to activate. The WebSocket module uses TradingView's undocumented socket.io protocol. Tools connect to wss://data.tradingview.com/socket.io/websocket, create chart/quote sessions, and collect bounded data.
- Add ws and @types/ws as dependencies - Add docs/SPEC-lab-path.md as source of truth
- Remove docs/SPEC-lab-path.md (moved to separate planning repo) feat(lab): - Add src/tests/integration/lab-tools.test.ts with 18 tests covering: - Lab-1: experimental_get_bars interface - Lab-2: streamQuotes validation - Lab-3: streamBars validation and live WS streaming - Lab-4: ws adapter layer (parser, protocol, auth, errors, types, module exports) - Add test:integration script to package.json
- Add experimental lab feature section and commands - Document experimental env vars and CLI usage - Expand MCP tools table to include experimental WebSocket tools - Update development instructions with lab integration test command
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.
Lab Path Implementation
Implements the lab-path spec defined in
docs/SPEC-lab-path.md— the experimental browserless WebSocket track for TradingView data access.Features Added (Lab-1 through Lab-4)
experimental_get_barstradingview-cli experimental barsexperimental_stream_quotestradingview-cli experimental stream-quotesexperimental_stream_barstradingview-cli experimental stream-barssrc/ws/*(7 modules)Architecture
Spec Verification
Lab-1
experimental_get_barsLab-2
experimental_stream_quotesLab-3
experimental_stream_barsLab-4 WebSocket/session adapter
~m~<len>~m~<payload>framing)Experimental Boundary
experimental_experimentalsubcommand namespaceTV_EXPERIMENTAL_ENABLED=1environment variableTests
Fix Applied
ws+@types/wsdependencies (build was failing)docs/SPEC-lab-path.mdas source of truth