-
Notifications
You must be signed in to change notification settings - Fork 366
Expand file tree
/
Copy pathtypes.ts
More file actions
149 lines (141 loc) · 3.52 KB
/
Copy pathtypes.ts
File metadata and controls
149 lines (141 loc) · 3.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import { z } from "zod";
/**
* Project info schema
*/
export const ProjectSchema = z.object({
name: z.string().default(""),
language: z.string().default(""),
framework: z.string().default(""),
description: z.string().default(""),
});
/**
* Notifications schema for webhook configuration
*/
export const NotificationsSchema = z.object({
discord_webhook: z.string().default(""),
slack_webhook: z.string().default(""),
custom_webhook: z.string().default(""),
telemetry_webhook: z.string().default(""),
});
/**
* Commands schema
*/
export const CommandsSchema = z.object({
test: z.string().default(""),
lint: z.string().default(""),
build: z.string().default(""),
});
/**
* Boundaries schema
*/
export const BoundariesSchema = z.object({
never_touch: z
.array(z.string())
.nullable()
.transform((v) => v ?? [])
.default([]),
});
/**
* Full Ralphy config schema
*/
export const RalphyConfigSchema = z.object({
project: ProjectSchema.default({}),
commands: CommandsSchema.default({}),
rules: z
.array(z.string())
.nullable()
.transform((v) => v ?? [])
.default([]),
boundaries: BoundariesSchema.default({}),
notifications: NotificationsSchema.default({}),
});
/**
* Ralphy configuration from .ralphy/config.yaml
*/
export type RalphyConfig = z.infer<typeof RalphyConfigSchema>;
/**
* Runtime options parsed from CLI args
*/
export interface RuntimeOptions {
/** Skip running tests */
skipTests: boolean;
/** Skip running lint */
skipLint: boolean;
/** AI engine to use */
aiEngine: string;
/** Dry run mode (don't execute) */
dryRun: boolean;
/** Maximum iterations (0 = unlimited) */
maxIterations: number;
/** Maximum retries per task */
maxRetries: number;
/** Delay between retries in seconds */
retryDelay: number;
/** Verbose output */
verbose: boolean;
/** Create branch per task */
branchPerTask: boolean;
/** Base branch for PRs */
baseBranch: string;
/** Create PR after task */
createPr: boolean;
/** Create draft PR */
draftPr: boolean;
/** Run tasks in parallel */
parallel: boolean;
/** Maximum parallel agents */
maxParallel: number;
/** PRD source type */
prdSource: "markdown" | "markdown-folder" | "yaml" | "json" | "github";
/** PRD file or folder path */
prdFile: string;
/** Whether PRD path is a folder */
prdIsFolder: boolean;
/** GitHub repo (owner/repo) */
githubRepo: string;
/** GitHub issue label filter */
githubLabel: string;
/** GitHub issue number to sync PRD with on each iteration */
syncIssue?: number;
/** Auto-commit changes */
autoCommit: boolean;
/** Browser automation mode: 'auto' | 'true' | 'false' */
browserEnabled: "auto" | "true" | "false";
/** Override default model for the engine */
modelOverride?: string;
/** Enable comprehensive OpenCode debugging */
debugOpenCode?: boolean;
/** Skip automatic branch merging after parallel execution */
skipMerge?: boolean;
/** Use lightweight sandboxes instead of git worktrees for parallel execution */
useSandbox?: boolean;
/** Additional arguments to pass to the engine CLI */
engineArgs?: string[];
}
/**
* Default runtime options
*/
export const DEFAULT_OPTIONS: RuntimeOptions = {
skipTests: false,
skipLint: false,
aiEngine: "claude",
dryRun: false,
maxIterations: 0,
maxRetries: 3,
retryDelay: 5,
verbose: false,
branchPerTask: false,
baseBranch: "",
createPr: false,
draftPr: false,
parallel: false,
maxParallel: 3,
prdSource: "markdown",
prdFile: "PRD.md",
prdIsFolder: false,
githubRepo: "",
githubLabel: "",
autoCommit: true,
browserEnabled: "auto",
debugOpenCode: false,
};