Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

GitManager.ts

43 lines1.2 KB

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 */
33 readonly runStackedAction: (
34 input: GitRunStackedActionInput,
35 ) => Effect.Effect<GitRunStackedActionResult, GitManagerServiceError>;
37​
38/**
39 * GitManager - Service tag for stacked Git workflow orchestration.
40 */
41export class GitManager extends ServiceMap.Service<GitManager, GitManagerShape>()(
42 "t3/git/Services/GitManager",
43) {}