Add TypeScript runtimeuse client package and documentation#13
Open
jackcbrown89 wants to merge 5 commits intomainfrom
Open
Add TypeScript runtimeuse client package and documentation#13jackcbrown89 wants to merge 5 commits intomainfrom
jackcbrown89 wants to merge 5 commits intomainfrom
Conversation
Equivalent to the Python runtimeuse-client package, this provides: - RuntimeUseClient: main client class with query() and abort() methods - Transport interface and WebSocketTransport implementation - Full type definitions matching the wire protocol (InvocationMessage, ResultMessage, AssistantMessage, ErrorMessage, etc.) - AgentRuntimeError and CancelledException error classes - SendQueue: async queue for outbound message handling - QueryOptions with validation (artifacts_dir/callback co-requirement) - Comprehensive test suite (33 tests) covering: - Result messages (text, structured output, missing result) - Assistant message dispatch and callback handling - Error message handling with/without metadata - Artifact upload handshake - Cancellation via abort() - Timeout support - Unknown/malformed message handling - Full message sequences - Invocation message construction - Constructor and QueryOptions validation Co-authored-by: jack <jack@uselark.io>
- Add typescript-client.mdx with full API reference matching python-client.mdx (basic query, structured JSON, downloadables, artifact uploads, streaming, cancellation, timeout, secret redaction, error handling) - Update meta.json to add TypeScript Client to sidebar navigation - Update index.mdx to mention TypeScript alongside Python - Update quickstart.mdx with Python/TypeScript tabs for install and connect steps Co-authored-by: jack <jack@uselark.io>
Mirrors the Python client docs pattern of using pydantic for schema definition by using zod + zod-to-json-schema in the TypeScript example. Co-authored-by: jack <jack@uselark.io>
Zod 4 has built-in JSON Schema conversion, no need for the third-party zod-to-json-schema package. Co-authored-by: jack <jack@uselark.io>
- Replace gpt-4.1 with gpt-5.3 in all TypeScript client doc examples - Change 'pre_agent_downloadables' to 'Pre-agent downloadables' in intro Co-authored-by: jack <jack@uselark.io>
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.
Summary
Adds a TypeScript client package (
runtimeuse-client) equivalent to the existing Pythonruntimeuse-clientpackage, along with full documentation updates.TypeScript Client Package
Package Structure
API Surface
RuntimeUseClientquery()andabort()TransportWebSocketTransportAgentRuntimeError.errorand.metadataCancelledExceptionSendQueueQueryOptionsQueryResult.dataand.metadataTextResultStructuredOutputResultTests
33 unit tests covering: result messages, assistant message dispatch, error handling, artifact upload handshake, cancellation, timeout, unknown messages, message sequencing, invocation construction, and validation.
Documentation Updates
typescript-client.mdx— Full API reference matchingpython-client.mdxwith sections for basic query, structured JSON, downloadables, artifact uploads, streaming, cancellation, timeout, secret redaction, and error handling.meta.json— Added TypeScript Client to sidebar navigation (between Python Client and Agent Runtime).index.mdx— Updated description to mention TypeScript alongside Python.quickstart.mdx— Added Python/TypeScript tabs for the install and connect steps so users can choose their preferred language.