UNPKG

trellis

Version:

Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications

37 lines 1.49 kB
/** * Cross-agent file ownership (TRL-117 AC4). * * A file touched by another agent's *live* active lane is owned by that lane. * Writes from a different agentId are rejected with an ADR 0015 handoff prompt. */ import { type LaneMeta } from './lane.js'; import type { VcsOp } from './types.js'; export interface FileOwner { laneId: string; agentId: string; issueId?: string; name?: string; } export declare function isFileWriteOp(kind: string): boolean; export declare function extractOpFilePaths(op: VcsOp): string[]; export declare function isLiveActiveLane(meta: LaneMeta, now?: number): boolean; /** Map relative file path → owning live active lane (first writer wins). */ export declare function buildActiveLaneFileOwners(trellisDir: string, opts?: { excludeLaneId?: string; now?: number; }): Map<string, FileOwner>; export declare function formatCrossAgentOwnershipMessage(path: string, owner: FileOwner, writerAgentId: string): string; export declare class CrossAgentFileOwnershipError extends Error { readonly path: string; readonly owner: FileOwner; readonly writerAgentId: string; constructor(path: string, owner: FileOwner, writerAgentId: string); } /** * Reject file writes that target paths owned by a different agent's live lane. */ export declare function assertCrossAgentFileWriteAllowed(trellisDir: string, op: VcsOp, opts?: { excludeLaneId?: string; now?: number; }): void; //# sourceMappingURL=lane-ownership.d.ts.map