@uncaged/workflow (0.1.0)
Published 2026-05-08 02:53:29 +00:00 by xiaoju
Installation
@uncaged:registry=https://git.shazhou.work/api/packages/uncaged/npm/npm install @uncaged/workflow@0.1.0"@uncaged/workflow": "0.1.0"About this package
@uncaged/workflow
Core workflow engine: registry, CAS, thread execution, bundle validation, and role/workflow types.
This package implements the three-phase engine loop that runs single-file ESM workflow bundles (each exports run and descriptor). It persists threads under ~/.uncaged/workflow/ by default and hashes bundles with XXH64 (Crockford Base32). See the repo root README for workflow, bundle, thread, role, and registry concepts.
Install
bun add @uncaged/workflow zod
In this monorepo, depend with "@uncaged/workflow": "workspace:*". zod is a peer dependency (used by bundle/shape validation at the integration boundary).
Usage
import { createWorkflow, readWorkflowRegistry, executeThread } from "@uncaged/workflow";
// Wire a WorkflowDefinition + AgentBinding + extract + optional LlmProvider into createWorkflow,
// then run the returned WorkflowFn inside your host (or use executeThread for disk-backed runs).
API overview
| Area | Exports (representative) |
|---|---|
| Types | WorkflowDefinition, WorkflowFn, AgentFn, AgentBinding, Moderator, RoleDefinition, ThreadContext, LlmProvider, Result shape via ok / err, START / END |
| Bundle | buildDescriptor, extractBundleExports, validateWorkflowBundle, validateWorkflowDescriptor, WorkflowDescriptor, WorkflowRoleDescriptor |
| Registry | readWorkflowRegistry, writeWorkflowRegistry, registerWorkflowVersion, workflowRegistryPath, YAML helpers |
| CAS | createCasStore, Merkle helpers (putStepMerkleNode, getContentMerklePayload, …), hashWorkflowBundleBytes |
| Engine | createWorkflow, executeThread, parseThreadDataJsonl, fork helpers, garbageCollectCas |
| Extract / LLM tools | llmExtract, reactExtract, createExtract, getExtractProvider |
| Agent bridge | workflowAsAgent — expose a registered workflow as an agent-backed role |
| Utilities | createLogger, ULID / Crockford Base32 codecs, getDefaultWorkflowStorageRoot, paths |
Full surface is re-exported from src/index.ts.
Dependencies
Dependencies
| ID | Version |
|---|---|
| acorn | ^8.16.0 |
| xxhashjs | ^0.2.2 |
| yaml | ^2.8.4 |
Development Dependencies
| ID | Version |
|---|---|
| @types/acorn | ^6.0.4 |
| zod | ^4.0.0 |
Peer Dependencies
| ID | Version |
|---|---|
| zod | ^4.0.0 |
Details
2026-05-08 02:53:29 +00:00
Assets (1)
Versions (2)
View all
npm
0
52 KiB
workflow-0.1.0.tgz
52 KiB