@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
34 lines (33 loc) • 2.15 kB
TypeScript
import { type Json } from "./protocol.js";
interface Run {
code: number | null;
output: string;
missing: boolean;
timedOut: boolean;
}
/** One process with stdout and stderr interleaved in arrival order, bounded,
* never attached to a terminal and never prompting. */
export declare function runCombined(command: string, args: string[], cwd: string, timeout: number, extraEnv?: NodeJS.ProcessEnv, killGraceMs?: number): Promise<Run>;
/** `git commit` of the index only: no `-a`, no `--no-verify`, no amend. A
* hook's refusal comes back as `{ ok: false, output }`, exactly as printed. */
export declare function gitCommit(cwd: string, message: unknown): Promise<Json>;
/** The current branch to its upstream, or to `origin` with the upstream set.
* Never forced: no `--force`, no `+` refspec, no `--no-verify`. The default
* branch needs the phone's explicit `confirmDefault`. */
export declare function gitPush(cwd: string, confirmDefault: unknown): Promise<Json>;
/** Open a pull or merge request for the current branch on the remote's host
* (git-hosts.ts). GitHub's: `gh pr create --fill`; a missing or signed-out
* CLI is `{ ok: false, reason: "missing" | "auth" }`, the host's own refusal
* `reason: "failed"` with its output, and a request that already exists for
* the branch is success with `existing: true`. A stubbed host is
* `reason: "unsupported"`, an unrecognised one `reason: "unknown-host"`. */
export declare function gitPullRequest(cwd: string, draft: unknown): Promise<Json>;
/** Merge one pull or merge request on the remote's host. The host decides:
* its refusal (checks, approvals, conflicts, a head that moved past
* `expectedHeadSha`) is `{ ok: false, reason: "blocked", message }`. */
export declare function gitMergeRequest(cwd: string, data: unknown): Promise<Json>;
/** Connect (or, with an empty token, disconnect) this repository's GitLab or
* gitboy host: the token is checked against the host first and stored in the
* Hook's git-hosts.json with the account it signs in as. GitHub keeps gh's. */
export declare function gitHostToken(cwd: string, data: unknown): Promise<Json>;
export {};