Fetch remote changes before agents start working so they build on up-to-date code. Adds ProjectSyncManager with git fetch + ff-only merge of defaultBranch, integrated into phase dispatch to sync before branch creation. - Schema: lastFetchedAt column on projects table (migration 0029) - Events: project:synced, project:sync_failed - Phase dispatch: sync all linked projects before creating branches - tRPC: syncProject, syncAllProjects, getProjectSyncStatus - CLI: cw project sync [name] --all, cw project status [name] - Frontend: sync button + ahead/behind badge on projects settings
28 lines
876 B
TypeScript
28 lines
876 B
TypeScript
/**
|
|
* Git Module - Public API
|
|
*
|
|
* Exports the WorktreeManager port interface, types, and adapters.
|
|
* All modules should import from this index file.
|
|
*
|
|
* Pattern follows EventBus module:
|
|
* - Port interface (WorktreeManager) is what consumers depend on
|
|
* - Adapter implementation (SimpleGitWorktreeManager) uses simple-git
|
|
*/
|
|
|
|
// Port interface (what consumers depend on)
|
|
export type { WorktreeManager } from './types.js';
|
|
|
|
// Domain types
|
|
export type { Worktree, WorktreeDiff, MergeResult } from './types.js';
|
|
|
|
// Adapters
|
|
export { SimpleGitWorktreeManager } from './manager.js';
|
|
|
|
// Utilities
|
|
export { cloneProject } from './clone.js';
|
|
export { ensureProjectClone, getProjectCloneDir } from './project-clones.js';
|
|
|
|
// Remote sync
|
|
export { ProjectSyncManager } from './remote-sync.js';
|
|
export type { SyncResult, SyncStatus, BranchDivergence } from './remote-sync.js';
|