trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
33 lines • 1.22 kB
TypeScript
/**
* Trellis CMS — internal helpers (fact join, status detection, reference expansion).
*/
import type { Entry } from './types.js';
export type RawFact = {
e: string;
a: string;
v: string | number | boolean;
};
export type RawEntity = {
id: string;
type: string;
};
export type RawLink = {
e1: string;
a: string;
e2: string;
};
export declare function isSystemType(type: string): boolean;
export declare function typeKey(type: string): string;
export declare function entryFromFacts(entity: RawEntity, facts: RawFact[], links?: RawLink[]): Entry;
export declare function groupFactsByEntity(facts: RawFact[]): Map<string, RawFact[]>;
export declare function groupLinksBySource(links: RawLink[]): Map<string, RawLink[]>;
/**
* For each entry, replace string ids in `expand` field keys with the resolved Entry.
* Lookups are batched in parallel.
*/
export declare function expandReferences(entries: Entry[], expandKeys: string[], fetchEntity: (id: string) => Promise<Entry | null>): Promise<Entry[]>;
/**
* Cheap deep-equality fingerprint for change detection in subscriptions.
*/
export declare function fingerprint(value: unknown): string;
//# sourceMappingURL=internal.d.ts.map