Tailrace
Reference

tRPC

Reference for @tailrace/trpc - createTailraceMiddleware, withTrpc, and TailraceTrpcOptions.

@tailrace/trpc provides procedure middleware for @trpc/server. It scans procedure input and result data at the tool boundary (not an OpenAI REST gateway).

Install

pnpm add @tailrace/core @tailrace/trpc @trpc/server

Peer dependency: @trpc/server >=10 (bound against @trpc/server@11.x). Depends on @tailrace/core + @tailrace/adapter (not @tailrace/http).

Exports

ExportDescription
createTailraceMiddlewareStandalone middleware for t.procedure.use(...)
withTrpcAttach fluent middleware(...) to a Tailrace instance
TailraceTrpcOptionsOptions type
TrpcMiddlewareContextContext passed to option resolvers
TailraceWithTrpcFluent instance type

Options

OptionDefaultNotes
agent"default"string or (info) => string
nameprocedure pathTool name for the boundary
workflowId"default"string or (info) => string
onDecision-Audit callback

Surfaces

SurfaceBoundaryBehavior
Input{ kind: "tool", name, direction: "out" }check before next; rewrite input on tokenize/mask
Output{ kind: "tool", name, direction: "in" }check ok result data; rewrite on tokenize/mask
Block-Throw TRPCError (BAD_REQUEST), value-free message

Streaming procedures are out of scope in v0.1 (non-streaming queries/mutations only).

See also

On this page