@pepps233/mendr 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env node
2
+ import React from 'react';
3
+
4
+ type AgentName = "claude" | "codex";
5
+ type EffortLevel = "low" | "medium" | "high" | "xhigh" | "max";
6
+
7
+ type ExecResult = {
8
+ stdout: string;
9
+ stderr: string;
10
+ exitCode: number;
11
+ timedOut?: boolean;
12
+ };
13
+ type ExecOptions = {
14
+ cwd?: string;
15
+ env?: NodeJS.ProcessEnv;
16
+ input?: string;
17
+ timeoutMs?: number;
18
+ stdoutFile?: string;
19
+ stderrFile?: string;
20
+ };
21
+ type ExecFn = (command: string, args: string[], options?: ExecOptions) => Promise<ExecResult>;
22
+
23
+ type ReviewState = {
24
+ phase: string;
25
+ currentStatus: string;
26
+ issuesFound: number;
27
+ issuesFixed: number;
28
+ done: boolean;
29
+ capReached: boolean;
30
+ error?: string;
31
+ };
32
+
33
+ type CliParseResult = {
34
+ ok: true;
35
+ command: "start";
36
+ agent: AgentName;
37
+ pr: string;
38
+ maxRounds: number;
39
+ model?: string;
40
+ effort?: EffortLevel;
41
+ } | {
42
+ ok: true;
43
+ command: "ls";
44
+ } | {
45
+ ok: true;
46
+ command: "view" | "kill" | "stop";
47
+ reviewId: string;
48
+ } | {
49
+ ok: false;
50
+ exitCode: 1;
51
+ error: string;
52
+ };
53
+ type StartReviewOptions = {
54
+ mendrHome?: string;
55
+ cwd?: string;
56
+ agent: AgentName;
57
+ pr: string;
58
+ maxRounds: number;
59
+ model?: string;
60
+ effort?: EffortLevel;
61
+ exec?: ExecFn;
62
+ createId?: () => string;
63
+ spawnDaemon?: (args: SpawnDaemonArgs) => SpawnedDaemon;
64
+ };
65
+ type SpawnDaemonArgs = {
66
+ mendrHome: string;
67
+ reviewId: string;
68
+ };
69
+ type SpawnedDaemon = {
70
+ pid: number;
71
+ unref: () => void;
72
+ };
73
+ type StartReviewResult = {
74
+ id: string;
75
+ reviewDir: string;
76
+ };
77
+ type RenderReviewListOptions = {
78
+ mendrHome?: string;
79
+ terminalColumns?: number;
80
+ };
81
+ type RenderReviewViewOptions = {
82
+ mendrHome?: string;
83
+ reviewId: string;
84
+ };
85
+ type ReviewViewSnapshot = ReviewState & {
86
+ reviewId: string;
87
+ agent: string;
88
+ pr: string;
89
+ recentEvents: string[];
90
+ frame: string;
91
+ spinner: string;
92
+ };
93
+ type StopReviewOptions = RenderReviewViewOptions & {
94
+ killProcess?: (pid: number, signal?: NodeJS.Signals) => boolean;
95
+ };
96
+ type CloseReviewOptions = RenderReviewViewOptions & {
97
+ exec?: ExecFn;
98
+ };
99
+ type LiveReviewViewOptions = RenderReviewViewOptions & {
100
+ pollIntervalMs?: number;
101
+ loadSnapshot?: (options: RenderReviewViewOptions) => Promise<ReviewViewSnapshot>;
102
+ };
103
+ declare function parseCliArgs(argv: string[]): CliParseResult;
104
+ declare function startReview(options: StartReviewOptions): Promise<StartReviewResult>;
105
+ declare function renderReviewList(options?: RenderReviewListOptions): Promise<string>;
106
+ declare function renderReviewViewSnapshot(options: RenderReviewViewOptions): Promise<ReviewViewSnapshot>;
107
+ declare function closeReview(options: CloseReviewOptions): Promise<void>;
108
+ declare function stopReview(options: StopReviewOptions): Promise<void>;
109
+ declare function startLiveReviewView(options: LiveReviewViewOptions): Promise<void>;
110
+ declare function ReviewView(props: LiveReviewViewOptions): React.ReactElement;
111
+ declare function isCliEntrypoint(invokedPath: string | undefined, modulePath?: string): boolean;
112
+
113
+ export { type CliParseResult, type CloseReviewOptions, type LiveReviewViewOptions, type RenderReviewListOptions, type RenderReviewViewOptions, ReviewView, type ReviewViewSnapshot, type SpawnDaemonArgs, type SpawnedDaemon, type StartReviewOptions, type StartReviewResult, type StopReviewOptions, closeReview, isCliEntrypoint, parseCliArgs, renderReviewList, renderReviewViewSnapshot, startLiveReviewView, startReview, stopReview };