trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
37 lines • 1.13 kB
TypeScript
/**
* VCS Operation Constructors
*
* Helpers to create content-addressed VcsOps with proper
* causality chaining and metadata.
*/
import type { VcsOp, VcsOpKind, VcsPayload } from './types.js';
type VcsOpHashInput = Pick<VcsOp, 'kind' | 'timestamp' | 'agentId' | 'previousHash' | 'vcs'>;
/**
* Computes the content-addressed hash for a VCS op body.
*/
export declare function hashVcsOp(op: VcsOpHashInput): Promise<string>;
/**
* Verifies that a VCS op's hash matches its immutable body.
*/
export declare function verifyVcsOpHash(op: VcsOp): Promise<boolean>;
/**
* Creates a VcsOp with full metadata, hash, and causal chain link.
*/
export declare function createVcsOp(kind: VcsOpKind, params: {
agentId: string;
previousHash?: string;
vcs: VcsPayload;
}): Promise<VcsOp>;
/**
* Checks whether a KernelOp is a VcsOp (has a vcs payload).
*/
export declare function isVcsOp(op: {
kind: string;
vcs?: unknown;
}): op is VcsOp;
/**
* Checks whether an op kind is a VCS kind.
*/
export declare function isVcsOpKind(kind: string): kind is VcsOpKind;
export {};
//# sourceMappingURL=ops.d.ts.map