Files
workflow/packages/workflow-protocol/README.md
T
xiaoju 064696c558 docs: update architecture docs and package READMEs for post-split structure
- Rewrite docs/architecture.md with 15-package map, dependency graph, updated engine paths
- Update CLAUDE.md monorepo structure section
- Add READMEs for: workflow-protocol, workflow-runtime, workflow-util, workflow-cas, workflow-register, workflow-execute, workflow-reactor
- Fix agent READMEs: update deps from @uncaged/workflow to actual packages
- Mark workflow-as-agent plan as outdated

Fixes #153

小橘 <xiaoju@shazhou.work>
2026-05-09 04:39:57 +00:00

1.3 KiB

@uncaged/workflow-protocol

Shared workflow types, sentinel constants, and Result helpers.

What This Package Does

It defines the cross-package contract for bundles and the engine: thread/step shapes, WorkflowFn, agent/extract contexts, descriptor types, and CasStore as an interface. Implementations (CAS store, CLI, extract) depend on these types so bundles stay decoupled from Node APIs.

Key Exports

From src/index.ts:

  • Types: Result, CasStore, WorkflowRoleSchema, WorkflowRoleDescriptor, WorkflowDescriptor, RoleMeta, RoleOutput, StartStep, RoleStep, ThreadContext, ModeratorContext, AgentContext, ExtractContext, WorkflowCompletion, WorkflowResult, LlmProvider, ProviderConfig, ResolvedModel, WorkflowConfig, ExtractFn, AgentFn, AgentBinding, WorkflowRuntime, WorkflowFn, RoleDefinition, Moderator, WorkflowDefinition, AdvanceOutcome
  • Constants: START, END
  • Functions: ok, err

Dependencies

  • Peer: zod ^4 — used in type positions for schemas (ExtractFn, RoleDefinition, etc.)

No workspace packages; this is the bottom layer.

Usage

import { END, START, type WorkflowFn, type ThreadContext } from "@uncaged/workflow-protocol";

Concrete WorkflowFn implementations are built with @uncaged/workflow-runtime (createWorkflow).