Skip to content

Graduate @bounded-systems/verbspec to a shared, standalone library #596

Description

@bdelanghe

Goal

Turn @bounded-systems/verbspec from a prx-internal workspace package into a shared layer across the @bounded-systems libraries (prx, keeperd, …): author a verb once as a typed VerbSpec, project it to every surface (CLI, MCP, OpenAPI, OpenRPC, JSON-RPC/NDJSON, Anthropic tool), no drift.

Done so far

Remaining

  • Decouple from Zod via Standard Schema. Today the package hard-depends on Zod v4 (z.toJSONSchema, input.parse/safeParse). Adopting the ~standard interface lets consumers bring Valibot/ArkType. Note: z.toJSONSchema is Zod-specific, so a validator-agnostic JSON-Schema path is needed (per-lib converter, or require schemas that can emit JSON Schema).
  • Graduate to its own repo and publish under @bounded-systems/verbspec. PolyForm-Noncommercial ⇒ a private registry (GitHub Packages or similar), not public npm.
  • Repoint prx at the published package (drop the workspace paths mapping).
  • Wire keeperd as the first external consumer: model sign / verify / status / commit / push / getPublicKey as a VerbSpec registry, serve the NDJSON protocol via dispatchNdjson, and derive lib/keeper.ts client types from the verb output schemas.

Open design questions

  • Source of truth: Zod vs an IDL. Keep Zod as the authoring source and emit OpenRPC/OpenAPI (current direction — schema is the runtime validator), or move to a declarative IDL (TypeSpec / OpenRPC) and generate Zod/TS? Recommendation: stay Zod-sourced; reach for TypeSpec only if authoring across many services starts to dominate.
  • OpenRPC params style. Currently by-name Content Descriptors from the input's top-level properties; revisit if any verb needs by-position params.

Tracking the shared-layer effort discussed in session.

https://claude.ai/code/session_01XvpnMDCnzCvn4MjDL15vi1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions