e067a2f25a
CI / check (pull_request) Failing after 9m51s
Package mapping: - @uncaged/cli-workflow → @united-workforce/cli - @uncaged/workflow-protocol → @united-workforce/protocol - @uncaged/workflow-util → @united-workforce/util - @uncaged/workflow-util-agent → @united-workforce/util-agent - @uncaged/workflow-agent-hermes → @united-workforce/agent-hermes - @uncaged/workflow-agent-claude-code → @united-workforce/agent-claude-code - @uncaged/workflow-agent-builtin → @united-workforce/agent-builtin - @uncaged/workflow-dashboard → @united-workforce/dashboard Changes: - 8 package.json name + dependency refs - 82 files: import statements updated - .changeset/config.json updated - CLAUDE.md updated - bunfig.toml restored for preload CLI command (uwf) and directory names unchanged. Closes shazhou/united-workforce#8
27 lines
858 B
TypeScript
27 lines
858 B
TypeScript
import type { Hash, Store } from "@ocas/core";
|
|
import { putSchema } from "@ocas/core";
|
|
import { START_NODE_SCHEMA, STEP_NODE_SCHEMA, WORKFLOW_SCHEMA } from "@united-workforce/protocol";
|
|
|
|
export type UwfAgentSchemaHashes = {
|
|
workflow: Hash;
|
|
startNode: Hash;
|
|
stepNode: Hash;
|
|
text: Hash;
|
|
};
|
|
|
|
const TEXT_SCHEMA = { type: "string" as const };
|
|
|
|
/**
|
|
* Register Workflow, StartNode, and StepNode JSON Schemas in the CAS store.
|
|
* Idempotent: safe to call on every agent invocation.
|
|
*/
|
|
export async function registerAgentSchemas(store: Store): Promise<UwfAgentSchemaHashes> {
|
|
const [workflow, startNode, stepNode, text] = await Promise.all([
|
|
putSchema(store, WORKFLOW_SCHEMA),
|
|
putSchema(store, START_NODE_SCHEMA),
|
|
putSchema(store, STEP_NODE_SCHEMA),
|
|
putSchema(store, TEXT_SCHEMA),
|
|
]);
|
|
return { workflow, startNode, stepNode, text };
|
|
}
|