uncaged

AI Agent 项目开发

@uncaged/workflow-register (0.3.5)

Published 2026-05-13 01:34:24 +00:00 by xingyue

Installation

@uncaged:registry=https://git.shazhou.work/api/packages/uncaged/npm/
npm install @uncaged/workflow-register@0.3.5
"@uncaged/workflow-register": "0.3.5"

About this package

@uncaged/workflow-register

Bundle validation, dynamic export extraction, registry YAML, and model/provider resolution.

What This Package Does

It validates workflow .esm.js bundles, extracts descriptor / run exports at runtime, reads and writes workflow.yaml, and resolves which LLM endpoint/model to use from registry config (resolveModel, splitProviderModelRef).

Key Exports

From src/index.ts:

  • Bundle: buildDescriptor, importWorkflowBundleModule, validateWorkflowBundle, ensureUncagedWorkflowSymlink, extractBundleExports, stringifyWorkflowDescriptor, validateWorkflowDescriptor
  • Bundle types: ExtractBundleExportsOptions, ExtractedBundleExports, WorkflowBundleValidationInput, WorkflowDescriptor, WorkflowRoleDescriptor, WorkflowRoleSchema
  • Registry: getRegisteredWorkflow, listRegisteredWorkflowNames, parseWorkflowRegistryYaml, readWorkflowRegistry, registerWorkflowVersion, rollbackWorkflowToHistoryHash, stringifyWorkflowRegistryYaml, unregisterWorkflow, workflowRegistryPath, writeWorkflowRegistry
  • Registry types: WorkflowConfig, WorkflowHistoryEntry, WorkflowRegistryEntry, WorkflowRegistryFile
  • Config: resolveModel, splitProviderModelRef, types ProviderConfig, ResolvedModel

Dependencies

  • Workspace: @uncaged/workflow-protocol, @uncaged/workflow-util
  • Peer: acorn, yaml, zod ^4 — parsing/validation at runtime for consumers

Usage

import { readFile } from "node:fs/promises";
import { readWorkflowRegistry, validateWorkflowBundle } from "@uncaged/workflow-register";
import { getDefaultWorkflowStorageRoot } from "@uncaged/workflow-util";

const reg = await readWorkflowRegistry(getDefaultWorkflowStorageRoot());
if (!reg.ok) throw new Error(reg.error.message);

const path = "./my.esm.js";
const source = await readFile(path, "utf8");
const v = validateWorkflowBundle({ filePath: path, source });
if (!v.ok) throw new Error(v.error);

Dependencies

Dependencies

ID Version
@uncaged/workflow-protocol 0.3.5
@uncaged/workflow-util 0.3.5

Development Dependencies

ID Version
acorn ^8.14.1
typescript ^5.8.3
yaml ^2.7.1
zod ^4.0.0

Peer Dependencies

ID Version
acorn ^8.0.0
yaml ^2.0.0
zod ^4.0.0
Details
npm
2026-05-13 01:34:24 +00:00
2
10 KiB
Assets (1)
Versions (20) View all
0.4.3 2026-05-13
0.4.2 2026-05-13
0.4.1 2026-05-13
0.3.24 2026-05-13
0.3.22 2026-05-13