Open History to see the last commit
1/**
2 * GitManager - Effect service contract for stacked Git workflows.
3 *
4 * Orchestrates status inspection and commit/push/PR flows by composing
5 * lower-level Git and external tool services.
6 *
7 * @module GitManager
8 */
9import {
10 GitRunStackedActionInput,
11 GitRunStackedActionResult,
12 GitStatusInput,
13 GitStatusResult,
14} from "@t3tools/contracts";
15import { ServiceMap } from "effect";
16import type { Effect } from "effect";
17import type { GitManagerServiceError } from "../Errors.ts";
18
19/**
20 * GitManagerShape - Service API for high-level Git workflow actions.
21 */
22export interface GitManagerShape {
23 /**
24 * Read current repository Git status plus open PR metadata when available.
25 */
26 readonly status: (
27 input: GitStatusInput,
28 ) => Effect.Effect<GitStatusResult, GitManagerServiceError>;
29
30 /**
31 * Run a stacked Git action (`commit`, `commit_push`, `commit_push_pr`).
32 * When `featureBranch` is set, creates and checks out a feature branch first.
33 */
34 readonly runStackedAction: (
35 input: GitRunStackedActionInput,
36 ) => Effect.Effect<GitRunStackedActionResult, GitManagerServiceError>;
37}
38
39/**
40 * GitManager - Service tag for stacked Git workflow orchestration.
41 */
42export class GitManager extends ServiceMap.Service<GitManager, GitManagerShape>()(
43 "t3/git/Services/GitManager",
44) {}