import "@agimon-ai/doompi-session"; import "@agimon-ai/doompi-core/hubChannel"; //#region src/services/worktreeEvents/index.d.ts declare const WORKTREE_MESSAGE_VERSION: 1; type WorktreeMessageParty = 'parent' | 'child'; interface WorktreeMessage { readonly version: typeof WORKTREE_MESSAGE_VERSION; readonly worktreeId: string; readonly fromSessionId: string; readonly from: WorktreeMessageParty; readonly text: string; readonly sentAt: string; } //#endregion //#region src/types/worktreeRegistry.d.ts /** * A worktree's lifecycle as this package sees it. * * `orphaned` is a finding, not a cleanup: the session process is gone or the * directory has vanished, but the worktree may still hold uncommitted work, so * the record is kept until someone decides what to do with it. */ type WorktreeStatus = 'spawning' | 'running' | 'closing' | 'orphaned'; declare const WORKTREE_RECORD_VERSION = 1; interface WorktreeRecord { version: typeof WORKTREE_RECORD_VERSION; /** This registry's own id, distinct from the session id, and stable across restarts. */ id: string; /** The branch checked out in the worktree. */ branch: string; /** The ref the branch was created from, kept so a merge can name its base. */ baseRef: string; /** Absolute path to the worktree directory. */ path: string; /** Absolute path to the repository the worktree belongs to. */ repositoryRoot: string; /** The session spawned into the worktree. */ sessionId: string; /** * The session that asked for the worktree; the rail nests one under the other. * Absent for a worktree opened from the new-session dialog, which has no parent. */ parentSessionId?: string; status: WorktreeStatus; /** ISO 8601. */ createdAt: string; } //#endregion //#region src/services/worktreeNaming/index.d.ts interface PrunePlan { /** Orphans whose directory git still lists, safe to remove. */ remove: WorktreeRecord[]; /** Orphans whose directory is already gone; drop the record only. */ forget: WorktreeRecord[]; /** Paths git lists under our root that we have no record of; report, never touch. */ untracked: string[]; /** Orphans left alone because they still hold uncommitted work. */ keptDirty: WorktreeRecord[]; /** * Branches git refused to delete because they hold commits. * * Filled by the prune itself, not by the plan: a dry run destroys nothing, so * it has nothing to report here and leaves it empty. */ keptBranches: string[]; } /** * What a prune would do, decided before anything is destroyed. * * Separating the plan from the execution is what makes dryRun honest and lets * the destructive half be reviewed on its own. */ declare function planPrune(input: { records: readonly WorktreeRecord[]; gitPaths: readonly string[]; worktreesRoot: string; dirtyByPath: ReadonlyMap; }): PrunePlan; //#endregion //#region src/services/worktreeOperations/index.d.ts interface WorktreeContext { /** Where the calling session is working, used to find the repository. */ cwd: string; /** * The calling session, recorded as the new session's parent. Absent when the * new-session dialog opens a top-level worktree session for the workspace. */ sessionId?: string; } interface SpawnWorktreeRequest { branch: string; baseRef?: string; name?: string; task?: string; /** Host-owned execution setup, exposed by the UI rather than the agent tool. */ reservationId?: string; /** `existing` checks out a branch that already exists instead of creating one from `baseRef`. */ checkout?: 'new' | 'existing'; /** With `existing`: the branch exists only on this remote; a local tracking branch is created. */ remote?: string; } interface SpawnOptions { /** Aborted when the caller gives up, so a spawn nobody is waiting for stops. */ signal?: AbortSignal; /** Phase labels, for a caller that can show them while the work runs. */ onProgress?: (label: string) => void; } interface WorktreeOperations { spawn(context: WorktreeContext, request: SpawnWorktreeRequest, options?: SpawnOptions): Promise; close(context: WorktreeContext, id: string, force: boolean): Promise; list(context: WorktreeContext): Promise; status(context: WorktreeContext, id: string): Promise<{ record: WorktreeRecord; dirtyFiles: string[]; }>; merge(context: WorktreeContext, id: string, message?: string): Promise; prune(context: WorktreeContext, dryRun: boolean): Promise>; send(context: WorktreeContext, id: string, message: string): Promise; messages(context: WorktreeContext, id: string): Promise; } //#endregion //#region src/types/extension.d.ts type GitNotificationLevel = 'info'; interface GitExtensionResult { message: string; level: GitNotificationLevel; } interface GitExtensionService { execute(): Promise; } interface GitExtensionDependencies { service: GitExtensionService; operations: WorktreeOperations; } //#endregion //#region src/services/extensionService/index.d.ts declare class DefaultGitExtensionService implements GitExtensionService { execute(): Promise; } //#endregion //#region src/services/gitDependencies/index.d.ts declare function createGitDependencies(overrides?: Partial): GitExtensionDependencies; //#endregion export { GitExtensionService as a, GitExtensionResult as i, DefaultGitExtensionService as n, GitExtensionDependencies as r, createGitDependencies as t }; //# sourceMappingURL=index-D79MSCee.d.mts.map