trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
82 lines • 2.69 kB
TypeScript
/**
* Multi-Repo Linking — Cross-repo entity references.
*
* Enables entities in one Trellis repo to reference entities in another.
* Linked repos are registered with a local alias and remote path/URL.
* Cross-repo references use the format: `@alias:entityId`
*
* @module trellis/sync
*/
import type { TrellisKernel } from '../core/kernel/trellis-kernel.js';
import type { Link } from '../core/store/eav-store.js';
export interface LinkedRepo {
/** Local alias for the remote repo (e.g. "backend", "shared-lib"). */
alias: string;
/** Path or URL to the remote repo. */
location: string;
/** Optional human-readable description. */
description?: string;
/** When this link was established. */
linkedAt: string;
/** Last sync timestamp. */
lastSyncedAt?: string;
}
export interface CrossRepoRef {
/** The repo alias. */
repoAlias: string;
/** The entity ID in the remote repo. */
entityId: string;
}
export declare class MultiRepoManager {
private kernel;
constructor(kernel: TrellisKernel);
/**
* Link a remote repository.
*/
linkRepo(alias: string, location: string, description?: string): Promise<void>;
/**
* Unlink a remote repository.
*/
unlinkRepo(alias: string): Promise<void>;
/**
* List all linked repos.
*/
listLinkedRepos(): LinkedRepo[];
/**
* Get a linked repo by alias.
*/
getLinkedRepo(alias: string): LinkedRepo | null;
/**
* Create a cross-repo link: entity in this repo → entity in remote repo.
*/
addCrossRepoLink(sourceEntityId: string, attribute: string, targetRepoAlias: string, targetEntityId: string): Promise<void>;
/**
* Remove a cross-repo link.
*/
removeCrossRepoLink(sourceEntityId: string, attribute: string, targetRepoAlias: string, targetEntityId: string): Promise<void>;
/**
* Find all cross-repo references from a given entity.
*/
getCrossRepoLinks(entityId: string): Array<{
attribute: string;
ref: CrossRepoRef;
}>;
/**
* Find all cross-repo references pointing to a specific remote entity.
*/
findReferencesTo(repoAlias: string, entityId: string): Link[];
/**
* Update the lastSyncedAt timestamp for a linked repo.
*/
markSynced(alias: string): Promise<void>;
}
/**
* Parse a cross-repo reference string.
* Format: `@alias:entityId`
*/
export declare function parseCrossRepoRef(ref: string): CrossRepoRef | null;
/**
* Format a cross-repo reference string.
*/
export declare function formatCrossRepoRef(repoAlias: string, entityId: string): string;
//# sourceMappingURL=multi-repo.d.ts.map