62 lines · 1.9 KB · TypeScript
RawDownload
/** * 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<GitStatusResult, GitManagerServiceError>;   /**   * Resolve a pull request by URL/number against the current repository.   */  readonly resolvePullRequest: (    input: GitPullRequestRefInput,  ) => Effect.Effect<GitResolvePullRequestResult, GitManagerServiceError>;   /**   * Prepare a new thread workspace from a pull request in local or worktree mode.   */  readonly preparePullRequestThread: (    input: GitPreparePullRequestThreadInput,  ) => Effect.Effect<GitPreparePullRequestThreadResult, GitManagerServiceError>;   /**   * 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<GitRunStackedActionResult, GitManagerServiceError>;} /** * GitManager - Service tag for stacked Git workflow orchestration. */export class GitManager extends ServiceMap.Service<GitManager, GitManagerShape>()(  "t3/git/Services/GitManager",) {}