/** * GitManager - Effect service contract for stacked Git workflows. * * Orchestrates status inspection and commit/push/PR flows by composing * lower-level Git and external tool services. * * @module GitManager */ import { GitPreparePullRequestThreadInput, GitPreparePullRequestThreadResult, GitPullRequestRefInput, GitResolvePullRequestResult, GitRunStackedActionInput, GitRunStackedActionResult, GitStatusInput, GitStatusResult, } from "@t3tools/contracts"; import { ServiceMap } from "effect"; import type { Effect } from "effect"; import type { GitManagerServiceError } from "../Errors.ts"; /** * GitManagerShape - Service API for high-level Git workflow actions. */ export interface GitManagerShape { /** * Read current repository Git status plus open PR metadata when available. */ readonly status: ( input: GitStatusInput, ) => Effect.Effect; /** * Resolve a pull request by URL/number against the current repository. */ readonly resolvePullRequest: ( input: GitPullRequestRefInput, ) => Effect.Effect; /** * Prepare a new thread workspace from a pull request in local or worktree mode. */ readonly preparePullRequestThread: ( input: GitPreparePullRequestThreadInput, ) => Effect.Effect; /** * Run a stacked Git action (`commit`, `commit_push`, `commit_push_pr`). * When `featureBranch` is set, creates and checks out a feature branch first. */ readonly runStackedAction: ( input: GitRunStackedActionInput, ) => Effect.Effect; } /** * GitManager - Service tag for stacked Git workflow orchestration. */ export class GitManager extends ServiceMap.Service()( "t3/git/Services/GitManager", ) {}