d63d58ccb5
- Move 15 old workflow-* packages to legacy-packages/ (inactive, preserved for reference)
- Rename templates/ → examples/ for clarity
- Rewrite docs/architecture.md to reflect current uwf architecture
- Active packages remain in packages/: cli-uwf, uwf-agent-hermes, uwf-agent-kit, uwf-moderator, uwf-protocol, workflow-util
小橘 🍊(NEKO Team)
32 lines
1.1 KiB
Markdown
32 lines
1.1 KiB
Markdown
# @uncaged/workflow-cas
|
|
|
|
Content-addressable storage implementation, bundle hashing, and Merkle helpers.
|
|
|
|
## What This Package Does
|
|
|
|
It implements `CasStore` from `@uncaged/workflow-protocol`, hashes workflow bundle bytes and strings with XXH64, and builds serializable Merkle nodes for thread/step/content payloads used when persisting execution artifacts.
|
|
|
|
## Key Exports
|
|
|
|
From `src/index.ts`:
|
|
|
|
- **CAS:** `createCasStore`
|
|
- **Hash:** `hashString`, `hashWorkflowBundleBytes`
|
|
- **Merkle:** `createContentMerkleNode`, `getContentMerklePayload`, `parseMerkleNode`, `putContentMerkleNode`, `putStepMerkleNode`, `putThreadMerkleNode`, `serializeMerkleNode`
|
|
- **Types:** `CasStore`, `MerkleNode`, `MerkleNodeType`, `StepMerklePayload`, `ThreadMerklePayload`
|
|
|
|
## Dependencies
|
|
|
|
- **Workspace:** `@uncaged/workflow-protocol` (`CasStore` contract), `@uncaged/workflow-util`
|
|
- **npm:** `xxhashjs`, `yaml`
|
|
|
|
## Usage
|
|
|
|
```typescript
|
|
import { createCasStore, hashWorkflowBundleBytes } from "@uncaged/workflow-cas";
|
|
import { getGlobalCasDir } from "@uncaged/workflow-util";
|
|
|
|
const store = createCasStore(getGlobalCasDir());
|
|
const hash = await hashWorkflowBundleBytes(esmJsBytes);
|
|
```
|