[TypeScript client] feat: RPC & in-memory clients#9
Draft
0xpolarzero wants to merge 20 commits into
Draft
Conversation
0204b74 to
d0b8c5c
Compare
a910a36 to
0a2be78
Compare
Owner
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced May 25, 2026
d0b8c5c to
d5267b8
Compare
3085f50 to
52cec2a
Compare
1756ff4 to
8e074ab
Compare
8e074ab to
51a3a8d
Compare
52cec2a to
a0b2d92
Compare
a0b2d92 to
d3705f9
Compare
2518d21 to
ef926cd
Compare
97a9ab0 to
e2182b7
Compare
e2182b7 to
c0ddef3
Compare
ef926cd to
0dc678e
Compare
c0ddef3 to
e1db698
Compare
0dc678e to
a0219ef
Compare
a09a13f to
118f835
Compare
ba9090d to
b441dc7
Compare
This was referenced May 27, 2026
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.

This PR adds the public typed client surface on top of the runtime and transport foundation from PR #8.
API
Full API example is available in this gist.
HTTP clients call a served CLI through a
HttpTransport, while exposing a command-aware client API:The command name,
args,options, anddatatype all come fromCommands.When the CLI is available in the same process, memory clients infer command names, args, and options directly from the concrete CLI:
Generated
Commandsdeclarations still provide the richest client surface, including declared output data and streaming metadata.Callers can also create a client directly from a transport factory:
Streaming
Streaming commands return an async iterable for chunks, plus a
finalpromise for the terminal result:Callers that need raw protocol records can use
records():Resources
The public client exposes resource discovery as methods rather than raw
transport.discover(...)requests:Resource scopes are typed from the command map, so command groups such as
'project'and leaf commands such as'project status'are accepted while unknown scopes are rejected.Local methods
Memory clients also expose local-only setup methods. These are intentionally not available on HTTP clients.
The
skillsandmcpnamespaces merge resource methods and memory-local methods on memory clients:Type generation
Typegen now emits an exported
Commandstype and augments bothincurandincur/clientwith the same command map:That lets users either pass
Commandsexplicitly:or rely on module augmentation when the generated declarations are loaded:
Changes
incur/clientnamespace surface forClient,HttpClient,MemoryClient,Run,Resources,Local,Rpc,Transport,HttpTransport, andMemoryTransport.Client.create(...),HttpClient.create(...), andMemoryClient.create(...).client.run(...)with command-name inference, required input enforcement, exact top-level/inner input key checks, output selection behavior, pagination helpers, CTA follow-up runs, and streaming return types.llms,llmsFull,schema,help,openapi, generated skills, and MCP tools.client/actions/*Actions.ts.ClientErrorand transport error handling to use the canonicalRpc.Errortype.Commandstype and augmentincur/client.incur/clientto TypeScript path resolution.Tests
Client.create,HttpClient.create,MemoryClient.create, run actions, resource actions, local actions, and transport/client composition.Client,HttpClient,MemoryClient,Run,Resources,Local, andTransport.unknown, streaming commands, resource scope narrowing, local-only method visibility, and transport capability types.Notes
HttpClient.create(...)exposes resource methods but not memory-local methods.MemoryClient.create(cli)exposes the same resource methods and also localskills.add/listandmcp.add.MemoryClient.create(cli)can infer command names, args, and options from a concrete CLI; callers can still pass an explicit command map when they need declared output or stream metadata.'project'narrow LLM manifests to that subtree.