Cori
Reference

SDK reference

The @cori-do/sdk package — step constructors, shared options, and step file structure.

Installation

@cori-do/sdk is a dependency of your workflow's step files. It is automatically available when step files are compiled by the Cori CLI. You do not need to install it separately in the workflow folder.

Node.js ≥ 20 is required for step file execution.

Step file structure

Every step file must:

  1. Export a typed input Zod schema as a named export input
  2. Export a typed output Zod schema as a named export output
  3. Export a step.* constructor as the default export
  4. Use a two-digit numeric prefix in the filename (01_, 02_, …)
steps/01_example.ts
import { step } from '@cori-do/sdk';
import { z } from 'zod';

export const input = z.object({
  value: z.string(),
});

export const output = z.object({
  result: z.string(),
});

export default step.cli({
  description: 'Example step',
  command: ({ input }) => `echo ${input.value}`,
  parse_output: (stdout) => ({ result: stdout.trim() }),
});

Step constructors

All five constructors are available on the step object:

import { step } from '@cori-do/sdk';

step.cli({ ... })
step.mcp_tool({ ... })
step.code({ ... })
step.llm({ ... })
step.builtin({ ... })  // deferred in v1

Shared options

All step constructors accept these shared options:

OptionTypeRequiredDefaultDescription
descriptionstringHuman-readable description of what this step does. Required.
retriesobjectSee Retries and timeoutsRetry configuration.
retries.max_attemptsnumberPer-kind defaultMaximum number of attempts.
timeout_msnumberPer-kind defaultPer-attempt timeout in milliseconds.

step.cli options

OptionTypeRequiredDescription
descriptionstring
command(ctx) => stringShell command to run. Receives { input }.
parse_output(stdout: string) => outputParse stdout into the step's output type.
env(ctx) => Record<string, string>Additional environment variables.

step.mcp_tool options

OptionTypeRequiredDescription
descriptionstring
serverstringMCP server name (must match mcp_servers in manifest).
toolstringTool name on the MCP server.
args(ctx) => objectTool arguments. Receives { input }.
parse_output(result: unknown) => outputParse the tool's result into the step's output type.

step.code options

OptionTypeRequiredDescription
descriptionstring
run(ctx) => outputPure function. Receives { input }. Must not perform I/O.

step.llm options

OptionTypeRequiredDescription
descriptionstring
modelstringModel identifier (e.g., "gpt-4o-mini"). Provider inferred from name.
prompt(ctx) => stringPrompt string. Receives { input }.
output_schemaZod schemaMust match the file's output export.
systemstringOptional system prompt.

step.builtin — deferred in v1

Builtin constructors exist in the SDK but the v1 runtime does not execute them. See Activity kinds.

On this page