- @chttp/mcp: Add
StdioTransport(line-delimited JSON-RPC over stdin/stdout, with progress frames and a purehandleLinecore) and makeJsonRpcResponse.idnullable so parse-error envelopes onid: nullno longer abort inside a scriptc build. - @chttp/mcp: Add
Symbol.asyncDisposetoStdioClientTransportso it works withawait using; it delegates toclose(), matchingClientandStreamableHttpTransport. - @chttp/router: Add
c.rawJson(s)to send an already-serialised JSON string withapplication/jsonand a content-length, skipping the stringify pass.
- @chttp/unplugin: Answer
c.rawJson('<literal>')handlers from the static-send fast path, likec.json,c.textandc.htmlliterals.
- @chttp/router: Type the adopted-body read callback as unknown and narrow instead of naming DOM ReadableStreamReadResult, so scriptc typechecks the router when a program reaches it through @chttp/router/src
- @chttp/router: fix(router):
route("/", sub)now mounts the sub-app at the root instead of registering double-slash paths (//health) that 404 on every request. A"/"prefix collapses to""beforemountRoutesconcatenation, matching Hono behavior.
- @chttp/auth, @chttp/mcp: Move
@chttp/authand@chttp/mcpinto the chttp monorepo from sigilco/cutils (where they shipped as 0.2.0). Both packages join the fixed versioning group and publish at chttp's shared version going forward. No source changes in the move — session/JWT/OAuth/CSRF/TOTP primitives and the JSON-RPC 2.0 MCP server land as-is, with gates wired intoscripts/scriptc-gate.shand docs pages added to the site nav. - @chttp/html: Add
page(head, body)full-document shell andIsrPagerevalidate cache: the pages/SSG/ISR slice of issue #14. SSG is render-once-at-startup; ISR re-renders lazily after the TTL (blocking semantics, no background refresh). Seeexamples/pages. - @chttp/mcp: Typed client on a new
./clientsubpath (@chttp/mcp/client):ClientplustoolDef/resourceDef/promptDefschema-first descriptors that register on the server viaserver.toolDef, three transports (fetch,node:net/node:tlsHTTP/1.1+SSE for the ELF path, stdio),callTool/call/listTools/readResource/getPrompt, progress-notification handlers, andJsonRpcErrorpassthrough. Ported from sigilco/cutils PR #19. - @chttp/router, @chttp/stream, @chttp/unplugin: feat(router): Web Standards generated-dispatch arm (GenFetch/withFetchDispatch, contract v4) + fetch emitter in unplugin; @chttp/stream streams through FetchResponseSink as a real ReadableStream
- @chttp/router: feat(ctx): typed
c.resresponse view on both surfaces —.status,.header(name),.headers(plusstatusCode/nodeRes()escape hatches for the Node surface).use()middleware now also wraps the notFound chain, andc.req.urlreports the absolute URL onapp.fetch(Hono parity for hono/logger's outbound-->line). - @chttp/router: feat(router): lite Node fetch bridge (issue #89) —
app.fetchBridge()/app.serveFetch()drive the fetch dispatch arm overLiteRequest(WebReqViewoverIncomingMessage) andLiteResponse(aFetchResponseSinkwriting straight toServerResponse), skipping per-request undiciRequest/Headers/Responseconstruction;WebReqView.headersnarrows to the structuralWebHeadersView.c.req.rawon the lite surface returns theLiteRequest;lite.request()materializes a real undiciRequestlazily forfetch(c.req.raw)-style consumers. Bench:chttp-fetch-lite-noderuns at 86–101% ofchttp-nodevs the undici bridge's 50–56% (bench/RESULTS-v2.md). - @chttp/router: fetch(app.fetch) passthrough contract: capture the Web Request into c.req.raw, adopt handler-returned Response objects (incl. streams), and stop eager body buffering on undeclared routes
- @chttp/router: Typed HTTP client at
@chttp/router/client:createClient(baseUrl)+get/post/put/patch/delete/requestover a minimal HTTP/1.1 transport onnode:net/node:tls— nofetch, so the same source compiles into an app ELF.ClientInput<P>checksparamskeys againstParamKey<P>on Node.js (.d.tssurface only — compiled apps bind aClientCorereceiver and get the concrete signatures); response types are caller-declared per call. One request per connection (Connection: close), chunked responses decoded, no redirects/streaming in v1. - @chttp/ws: feat(ws): post-merge audit hardening for issue #13 —
allowOriginexact-match allowlist (403),Sec-WebSocket-Keybase64/16-byte format check, peer close-reason UTF-8 validation (1007);upgradeHandler()catches a throwing dispatch and destroys the socket;UpgradeFnre-exported
- @chttp/mcp, @chttp/val: Fix Standard Schema v1 type compatibility for the mcp+val pairing (sigilco/cutils#27):
StdProps.versionis now the literal1, each concrete schema class merges aStdTyped<I, O>interface soInferInput/InferOutputresolve real types intool()handlers, andtoJsonSchema/toOpenApiSchemaaccept the{"~standard": unknown}structural minimum instead of requiringVSchema. In@chttp/mcp, response/listing records are built from{}open records or single full literals so expanding writes survive scriptc lowering of the packed dist.pnpm smoke:packnow packs@chttp/mcp, type-checks the pairing under tsc, and runs tools/list + tools/call throughServer.handleRequeston the built ELF. - @chttp/router: fix(req):
c.req.header(name)no longer crashes on absent headers in single-graph (vendored/program-code) scriptc builds —_headers/_headersDistinctare probed withhasOwnPropertybefore indexing instead of a bare record read that throws "record has no key". - @chttp/router, @chttp/unplugin: empty-body responses send no content-type (Hono parity); default text/plain charset is UTF-8
- @chttp/static: Add an end-to-end ELF smoke (serve + SPA + embedded) so runtime-only fences on older scriptc versions can't slip through
The Web Standards release: app.fetch(req, env?, ctx?) → Promise<Response> is now the canonical entry, multipart/form-data uploads ship as a per-route opt-in, and the compiled ELF is healthy again under scriptc 0.3.x.
If you are on v0.2.0 or v0.2.1 and have tried to scriptc build your app, you hit SC9001 ("live dynFrom of unsupported type httpReq") and, behind it, a runtime-broken ELF (c.json is not a function — vercel-labs/scriptc#963). v0.3.0 fixes both, with one caveat: the SC9001 fix covers two of three known sites — a third site in the ReqView constructor's URL read is still open (#62) and will land in v0.2.3.
app.fetch is JS-runtime-only in v0.3.0 — Cloudflare Workers, Deno Deploy, Bun, Vercel Edge, Netlify Edge, Supabase, and Node via app.handler(). The router compiles to a working ELF (the app.handler Node path and multipart dispatch are ELF-verified), but the real WHATWG Request boundary is not constructible under scriptc yet; the ELF seam is the fetchShim primitive. Hold for the next release if you want app.fetch inside the binary.
Companion utility packages that work with chttp and the scriptc subset — @cutils/sqlite, @chttp/cache, @chttp/mcp — live in sigilco/cutils.
- @chttp/router: Add the Web Standards
app.fetch(req, env?, ctx?) → Promise<Response>surface.app.handler()is now a thin Node adapter around it. New Ctx additions:c.set/c.getfor request-scoped vars,c.req.rawexposing the inboundRequest, andc.header(name, value, { append: true })for multi-value headers. NewApp.use(path, ...mw)overload for Hono-style path-scoped middleware. TheResponseSinkabstraction inpackages/router/src/sink.tsis the single seam that lets the same chain produce either aServerResponsewrite (Node) or a WebResponsefinalization (Workers, Deno Deploy, Bun, Vercel Edge, Netlify Edge, Supabase, Service Worker). Both surfaces compile to a native ELF; thebench/apps/chttp-fetch.tsgate is the new scriptc subset check. This commit also includes the SC9001 fix (seefix-sc9001.md):ReqViewnow materializesraw.headersandraw.headersDistinctinto Record-typed locals at construction soheader()reads from Record locals instead of class-typed fields onIncomingMessage. The change is needed on the app.fetch commit because the partial fix forheaderswas already there (commit0305d62); theheadersDistinctarm was left in the prior state and fences scriptc 0.3.x with "live dynFrom of unsupported type httpReq". - @chttp/router, @chttp/unplugin: Multipart uploads: per-route multipart option parses the stream at dispatch (memoryStorage/diskStorage, streaming maxFileBytes/maxFiles/maxFieldBytes -> 413), c.req.file/field/files/fields; unplugin declines declared-multipart routes (contract v3).
- @chttp/router: Fix a runtime failure of the compiled ELF under scriptc 0.3.x (upstream: vercel-labs/scriptc#963). Two root causes, both removed from the router surface. First, generic classes lower to methodless instances:
Ctx<P>andReqView<P>compile to objects whose fields read but whose every method call throws (c.json is not a functionon 0.3.1/0.3.2,rv._setBody is not a functionon 0.3.3). Second, class-typed unions are unrepresentable:ResponseSink | ServerResponseandIncomingMessage | NodeReqStubcannot sit in constructor or parameter positions, andtypeof x.method === "function"discrimination demotes method names intoprototypeMethodAccesses, which removes the fallback entirely. The fix narrows the surface so the same source lowers to a working ELF: -Ctx/ReqViewbecome non-genericCtxCore/ReqViewCoreclasses;interface Ctx<P> extends CtxCoreplusconst Ctx = CtxCorealiases keepnew Ctx(...),Ctxannotations andCtx<'/path'>working under tsc with no source change for users. - TheCtxconstructor,_guardand_buffertake aResponseSinkonly; callers with a rawServerResponsewrap it:new Ctx(rv, new NodeResponseSink(res)).ROUTE_CONTRACT_VERSIONbumps 1→2 and the generated dispatch is regenerated to match. -ReqViewCoretakesIncomingMessage | nullplus optional stub arguments; theapp.fetcharm passesnullinstead of a record union.c.req.rawis nowIncomingMessage | null(nullon the fetch path). -ResponseSinkgainsnodeRes(): ServerResponse | nullfor sink-flavor reads without casts. ELF-verified under scriptc 0.3.3:chttp.tsandchttp-fast.tsserve real 200s (/json,/user/42,POST /echo,/files,/missing404,GET /echo405), and a fetch-surface probe (_dispatchPrim+FetchResponseSink+toResponse()) serves 200s includingc.set/c.get, append headers and middleware. - @chttp/router: Fix scriptc 0.3.x build fence (SC9001 "live dynFrom of unsupported type httpReq") in
ReqView.header(). The prior implementation readthis.raw.headersDistinctthrough a chainedas unknown as Record<...>cast on a class-typed field; scriptc 0.3.x cannot lower the indexed field read on theIncomingMessage(httpReq) arm of the union and emits SC9001 as an internal compiler error. The fix materializesraw.headersandraw.headersDistinctinto Record-typed locals (_headersand_headersDistinct) at construction;header()reads from these locals, both indexed field reads lower cleanly, and the cost is O(headers) once per request (same as the prior single-value lookups). The same materialization also gives theapp.fetchWeb Standards surface a single shared lookup shape (Web Headers are joined with,per RFC 7230 beforecopyHeaders). This is a known fence in the published v0.2.0 and v0.2.1 tarballs (introduced by the 0.2.8→0.3.x scriptc pin bump in commit273f209). Consumers on those versions that try toscriptc buildtheir app will hit SC9001 on the chttp router. The next release re-enables thechttp-scriptcandchttp-fast-scriptcbench cells under 0.3.x and unblocks any downstreamscriptc buildof an app that imports@chttp/router. No source change is required on the consumer side beyond bumping the @chttp/router version. Defense-in-depth: even if a future scriptc release fixes SC9001 directly, the materialization is the right shape (Record locals + O(headers) copy at construction) and stays. The fix is small (~80 LOC net inpackages/router/src/index.ts) and backports cleanly onto the v0.2.x line if a backport release is needed. Partial fix. This entry fixes two of three known SC9001 sites (index.tsReqView.header()headersandheadersDistinctarms). A third site in theReqViewconstructor's URL read remains open and is tracked in issue #62; it will land in v0.2.3.
- @chttp/router, @chttp/stream, @chttp/ws: Real TCP backpressure on scriptc 0.3.2.
@chttp/wsand@chttp/streamnow route outbound data through a compiledWritablewrapper whose_writeforwards to the socket/response, sowrite(): boolean,"drain"andwritableLengthobserve the real queue; the per-window byte caps stay as the secondary fail-safe (ws flood still closes 1008). When the wrapper ships inside a statically compiled npm package — where 0.3.2 never pumps a subclassed_write— it detects the dead pump at construction and degrades to direct writes, leaving the window cap as the only policy. Requires scriptc >= 0.3.2. - @chttp/ws: ws-echo example adds a
/ffi/{text}route demonstratingscriptc --ffioutbound FFI with a call-scoped callback; seedocs/native.md.
The frontend release: WebSockets, SSE and streaming, HTML rendering and static asset serving join the router, each as its own package that stays 100% static under scriptc. The router gains c.bytes, and the upgrade listener is no longer attached by serve(), so wire server.on('upgrade', ...) yourself if you use @chttp/ws. @chttp/unplugin can now emit an OpenAPI document from @chttp/val schemas.
- @chttp/html: Add @chttp/html: subset-native HTML rendering (escapeHtml, h, html tag) and a node-only jsx-runtime
- @chttp/router: router: serve() no longer attaches the upgrade listener; wire server.on(upgrade, ...) in your own program (npm-static compilation stays 100% for every app)
- @chttp/router: Add c.bytes(buf, contentType) for binary response bodies
- @chttp/static: Add @chttp/static: AssetSource, DiskAssets, EmbeddedAssets and serveStatic with ETag/304, HEAD, precompressed siblings, immutable caching and opt-in SPA fallback
- @chttp/stream: Add @chttp/stream: streamSSE, SSEStream and streamText for Server-Sent Events and chunked text, with a pending-bytes cap for slow consumers
- @chttp/unplugin, @chttp/val: unplugin: OpenAPI side channel emitting .chttp/routes.openapi.ts from proven @chttp/val schemas; val: toJsonSchema/toOpenApiSchema
- @chttp/ws: Add @chttp/ws: WebSocket router, RFC 6455 framing, and WsHandler/WsConn on the router upgrade seam
- @chttp/val: Fix runtime import of type-only VSafeResult in parse.ts so the source loads as program code
Initial release.
- @chttp/router: minimal async-first HTTP router for
node:http, zero dependencies, authored in the scriptc compilable subset so the same source compiles to a single native ELF - @chttp/val: schema validation that lowers under scriptc
- @chttp/unplugin: build-time route lowering plugin that emits a generated dispatch module