@danypops/vehicle-core
v0.20.0
Published
Vehicle's runtime-neutral wire contract: operation descriptors, schema codecs, failure shapes. Dependency-free root entry, optional TypeBox schema adapter, zero Bun-specific code -- the one thing every Vehicle client and server package depends on.
Readme
@danypops/vehicle-core
Vehicle's runtime-neutral wire contract: operation descriptors, schema codecs, and failure shapes. Zero runtime dependencies, zero Bun-specific code -- the one thing every Vehicle client and server package depends on.
bun add @danypops/vehicle-coredefineVehicleOperation()/bindVehicleOperation() build a serializable
descriptor kept separate from its executable handler. See the
workspace README for how it
fits with @danypops/vehicle-server, @danypops/vehicle-client, and
@danypops/vehicle-client-pi.
An operation whose result should be read as a narrative rather than parsed
as data can intersect its Output type with WithVehicleContent and include
a content: [{ type: "text", text }] field alongside its own domain data --
the same field name and shape MCP's CallToolResult.content and Pi's own
tool-result type use, so no translation layer is needed at either boundary.
extractVehicleContent(output) reads those blocks back out for a generic
Vehicle client to prefer over raw JSON, returning undefined for absent or
malformed content so the caller can fall back safely.
Layout
src/ is organized by capability, not by feature-flat filename prefix:
operations/, events/, manifest/, client/, schemas/, content/,
approvals/, jobs/, schedules/, watches/, and errors//idempotency/
each hold one cohesive concern; persistence/ (atomic JSON writes) is kept
separate as a technical utility, not a Vehicle protocol capability. Every
public symbol is re-exported unchanged from the package root
(import { X } from "@danypops/vehicle-core"); ./persistence is also
available as its own subpath export for a consumer that only needs the
atomic-write primitive without the rest of the wire contract.
