trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
54 lines • 2.09 kB
TypeScript
/**
* Git Sync — commit the working tree to the target branch (ADR 0038).
*
* Git is the sole authority over file bytes. Sync never materializes op-log
* state over disk: it stages the actual working tree and commits it, then
* optionally pushes. The op-log is not consulted for file content.
*/
import type { LaneMeta } from '../vcs/lane.js';
import type { VcsOp } from '../vcs/types.js';
export interface GitSyncOptions {
rootPath: string;
branch?: string;
remote?: string;
authorName?: string;
authorEmail?: string;
/** Commit message body (first line becomes subject). */
message: string;
/** Push after commit when true and remote configured. */
push?: boolean;
/** Skip commit when working tree matches HEAD (default true). */
skipIfClean?: boolean;
}
export interface GitSyncResult {
committed: boolean;
commitHash?: string;
pushed: boolean;
/** Number of files staged from the working tree. */
filesMaterialized: number;
}
export interface PromoteCommitMessageParams {
lane: LaneMeta;
laneOps: VcsOp[];
issueTitle?: string;
}
/** Build a git commit message from lane promote context + op log summary. */
export declare function buildPromoteCommitMessage(params: PromoteCommitMessageParams): string;
/**
* Commit the actual working tree to `branch`, and optionally push to `remote`.
*
* The working tree is the source of truth (ADR 0038): no op-log state is
* materialized over disk. `filesMaterialized` reports the number of files
* staged from disk, so callers can gauge what the commit captured.
*/
export declare function syncIntegrationToGit(opts: GitSyncOptions): GitSyncResult;
/** Resolve integration branch head from ops. */
export declare function resolveIntegrationHead(ops: VcsOp[], branchName: string): string | undefined;
export interface GitSyncConfig {
syncOnPromote?: boolean;
pushOnClose?: boolean;
remote?: string;
branch?: string;
}
export declare function readGitSyncConfig(rootPath: string): GitSyncConfig | undefined;
//# sourceMappingURL=git-sync.d.ts.map