Skip to content

release: v0.6.16 (#332)

Choose a tag to compare

@github-actions github-actions released this 17 May 02:31
d0226b0

Features

  • Zod input/output schemas for workflows: The workflow() function now accepts a new three-argument form — workflow(name, { input, output }, handler) — where input and output are Zod schemas. The handler's input parameter is automatically typed from the schema via z.infer<>, so no separate type Input = ... declaration is needed. At runtime, --params values are validated against the input schema before the handler is called; invalid input throws a LibrettoWorkflowInputError with a clear, field-by-field message. The legacy two-argument workflow(name, handler) form continues to work unchanged for existing workflows.

  • Workflow JSON Schema metadata via API: Deployed workflows built with Zod schemas now expose input_schema and output_schema as JSON Schema (Draft 2020-12) objects on the /v1/workflows/get API endpoint, enabling downstream platforms to surface typed I/O metadata programmatically.

  • Experimental search command: A new libretto search <regex> --session <name> command (behind the search experiment flag) searches the current page's formatted HTML snapshot using a JavaScript regex and prints matching lines with surrounding context. Enable it with libretto experiments enable search.

  • LibrettoWorkflowInputError: A new exported error class is thrown when workflow input fails Zod validation. It exposes workflowName and zodError properties for programmatic inspection.