@simonren/quorum 0.9.1 → 0.11.1
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/README.md +91 -48
- package/commands/multi-consult.md +47 -72
- package/commands/multi-review.md +68 -99
- package/dist/adapters/base.d.ts +53 -70
- package/dist/adapters/base.js +21 -79
- package/dist/adapters/claude.d.ts +38 -17
- package/dist/adapters/claude.js +93 -185
- package/dist/adapters/cli-adapter.d.ts +78 -0
- package/dist/adapters/cli-adapter.js +220 -0
- package/dist/adapters/codex.d.ts +18 -13
- package/dist/adapters/codex.js +64 -200
- package/dist/adapters/gemini.d.ts +45 -21
- package/dist/adapters/gemini.js +81 -152
- package/dist/adapters/index.d.ts +8 -5
- package/dist/adapters/index.js +7 -8
- package/dist/config.d.ts +98 -28
- package/dist/config.js +44 -25
- package/dist/consult-prompt.d.ts +6 -5
- package/dist/consult-prompt.js +48 -23
- package/dist/decoders/claude.d.ts +6 -0
- package/dist/decoders/claude.js +10 -1
- package/dist/doctor.d.ts +20 -0
- package/dist/doctor.js +91 -0
- package/dist/executor.d.ts +58 -46
- package/dist/executor.js +218 -129
- package/dist/guards.d.ts +29 -0
- package/dist/guards.js +72 -0
- package/dist/handoff.d.ts +79 -229
- package/dist/handoff.js +411 -402
- package/dist/index.d.ts +8 -12
- package/dist/index.js +81 -106
- package/dist/integrity.d.ts +16 -0
- package/dist/integrity.js +49 -0
- package/dist/sections.d.ts +22 -0
- package/dist/sections.js +31 -0
- package/dist/server.d.ts +9 -0
- package/dist/server.js +36 -0
- package/dist/tools/consult.d.ts +17 -76
- package/dist/tools/consult.js +72 -188
- package/dist/tools/format.d.ts +35 -0
- package/dist/tools/format.js +85 -0
- package/dist/tools/review.d.ts +55 -0
- package/dist/tools/review.js +120 -0
- package/dist/types.d.ts +20 -103
- package/dist/types.js +18 -29
- package/package.json +7 -4
- package/dist/cli/check.d.ts +0 -20
- package/dist/cli/check.js +0 -78
- package/dist/cli/codex.d.ts +0 -11
- package/dist/cli/codex.js +0 -255
- package/dist/cli/gemini.d.ts +0 -12
- package/dist/cli/gemini.js +0 -253
- package/dist/context.d.ts +0 -1538
- package/dist/context.js +0 -383
- package/dist/decoders/gemini.d.ts +0 -33
- package/dist/decoders/gemini.js +0 -58
- package/dist/errors.d.ts +0 -46
- package/dist/errors.js +0 -198
- package/dist/pipeline.d.ts +0 -135
- package/dist/pipeline.js +0 -462
- package/dist/prompt-v2.d.ts +0 -38
- package/dist/prompt-v2.js +0 -391
- package/dist/prompt.d.ts +0 -71
- package/dist/prompt.js +0 -309
- package/dist/schema.d.ts +0 -660
- package/dist/schema.js +0 -536
- package/dist/tools/feedback.d.ts +0 -91
- package/dist/tools/feedback.js +0 -117
package/dist/adapters/gemini.js
CHANGED
|
@@ -1,115 +1,109 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Gemini
|
|
2
|
+
* Gemini adapter (via the Antigravity CLI, `agy`).
|
|
3
3
|
*
|
|
4
|
-
* Google replaced `gemini-cli` with the Antigravity CLI
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Gemini under the hood — only the CLI brand changed — so the adapter id and
|
|
8
|
-
* config key remain `gemini`.
|
|
4
|
+
* Google replaced `gemini-cli` with the Antigravity CLI at I/O 2026; the
|
|
5
|
+
* free-tier `gemini` binary stopped serving requests on 2026-06-18. The model
|
|
6
|
+
* is still Gemini, so the adapter id and config key remain `gemini`.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
8
|
+
* agy specifics:
|
|
9
|
+
* - the prompt must be the positional after `--print` (stdin alone makes agy
|
|
10
|
+
* print --help and exit 0), so the prompt size is bounded by the OS argv
|
|
11
|
+
* limit — see MAX_ARGV_PROMPT_BYTES
|
|
12
|
+
* - no streaming output, so the inactivity timeout is a total-runtime cap;
|
|
13
|
+
* agy has its own print-mode timeout (default 5m) which is set to match
|
|
14
|
+
* - `--sandbox` restricts the terminal only. agy's file tools CAN still write
|
|
15
|
+
* to the workspace (verified with `--sandbox` and with `--mode plan`), and
|
|
16
|
+
* agy has no read-only switch, so the tool handlers fingerprint the working
|
|
17
|
+
* tree before and after every run and flag any change (`integrity.ts`)
|
|
18
|
+
* - `--add-dir` scopes reads; `--model` is optional (`gemini.model`)
|
|
19
|
+
* - every print run does a silent OAuth handshake (keyring token, a few round
|
|
20
|
+
* trips to cloudcode-pa.googleapis.com, then an eligibility check that
|
|
21
|
+
* fetches the profile picture from lh3.googleusercontent.com) before the
|
|
22
|
+
* prompt is sent. On a slow route it fails with "authentication failed or
|
|
23
|
+
* timed out" (~10s) or "Eligibility check failed … TLS handshake timeout"
|
|
24
|
+
* (~50s) even though the login is fine — see the retry below
|
|
16
25
|
*/
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { registerAdapter, } from './base.js';
|
|
26
|
+
import { registerAdapter } from './base.js';
|
|
27
|
+
import { CliAdapter } from './cli-adapter.js';
|
|
20
28
|
import { CliExecutor } from '../executor.js';
|
|
21
|
-
import { buildSimpleHandoff, buildHandoffPrompt, buildAdversarialHandoffPrompt, selectRole, } from '../handoff.js';
|
|
22
|
-
import { buildConsultPrompt } from '../consult-prompt.js';
|
|
23
29
|
import { getConfig } from '../config.js';
|
|
24
30
|
const AGY_INSTALL_CMD = 'curl -fsSL https://antigravity.google/cli/install.sh | bash';
|
|
25
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Linux caps a single argv string at 128 KiB (MAX_ARG_STRLEN); macOS caps the
|
|
33
|
+
* whole argv+env block. A prompt beyond this would make spawn fail with E2BIG,
|
|
34
|
+
* so refuse early with a message that says what to shrink.
|
|
35
|
+
*/
|
|
36
|
+
export const MAX_ARGV_PROMPT_BYTES = 120_000;
|
|
37
|
+
/** stderr of an agy run that died in the pre-prompt handshake. */
|
|
38
|
+
const AUTH_HANDSHAKE_FAILURE = /authentication (?:failed or timed out|required)|eligibility check failed/i;
|
|
39
|
+
/**
|
|
40
|
+
* A handshake failure surfaces within ~60s (startup, the ~10s auth deadline,
|
|
41
|
+
* then up to two 10s TLS attempts for the eligibility check). An auth error
|
|
42
|
+
* after this window came from a run that had already started reviewing, and
|
|
43
|
+
* re-running that would double the cost, not fix the login.
|
|
44
|
+
*/
|
|
45
|
+
export const AUTH_RETRY_WINDOW_MS = 90_000;
|
|
46
|
+
export class GeminiAdapter extends CliAdapter {
|
|
26
47
|
id = 'gemini';
|
|
48
|
+
binary = 'agy';
|
|
49
|
+
installHint = `Install with: ${AGY_INSTALL_CMD}, then run \`agy\` and complete the Google OAuth sign-in`;
|
|
50
|
+
authHint = 'Run `agy` and complete the Google OAuth sign-in. If `agy` already works by hand, its pre-prompt handshake with Google timed out: retry, and check the route to *.googleapis.com and lh3.googleusercontent.com';
|
|
51
|
+
extraRateLimitPatterns = ['resource exhausted', 'resource_exhausted'];
|
|
52
|
+
/** agy's account-eligibility check runs before the prompt; its failure is a login-stage problem, not a slow review. */
|
|
53
|
+
extraAuthPatterns = ['eligibility check failed'];
|
|
27
54
|
getCapabilities() {
|
|
28
55
|
return {
|
|
29
56
|
name: 'Gemini',
|
|
30
|
-
description: 'Google Gemini
|
|
31
|
-
strengths: ['architecture', 'maintainability', 'scalability', 'documentation'],
|
|
32
|
-
weaknesses: ['security'],
|
|
33
|
-
hasFilesystemAccess: true,
|
|
34
|
-
supportsStructuredOutput: false,
|
|
35
|
-
maxContextTokens: 2000000,
|
|
36
|
-
reasoningLevels: undefined,
|
|
57
|
+
description: 'Google Gemini via the Antigravity CLI (agy) in sandbox mode; model set in agy or via gemini.model',
|
|
37
58
|
};
|
|
38
59
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} };
|
|
47
|
-
const proc = spawn('agy', ['--version'], {
|
|
48
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
49
|
-
});
|
|
50
|
-
proc.on('close', (code) => done(code === 0));
|
|
51
|
-
proc.on('error', () => done(false));
|
|
52
|
-
const timer = setTimeout(() => { proc.kill(); done(false); }, 5000);
|
|
53
|
-
});
|
|
60
|
+
getLimits() {
|
|
61
|
+
const cfg = getConfig().gemini;
|
|
62
|
+
return {
|
|
63
|
+
inactivityTimeoutMs: cfg.inactivityTimeoutMs,
|
|
64
|
+
maxTimeoutMs: cfg.maxTimeoutMs,
|
|
65
|
+
maxBufferSize: cfg.maxBufferSize,
|
|
66
|
+
};
|
|
54
67
|
}
|
|
55
|
-
async
|
|
56
|
-
const
|
|
57
|
-
|
|
68
|
+
async runCli(prompt, workingDir, ctx) {
|
|
69
|
+
const cfg = getConfig().gemini;
|
|
70
|
+
const limits = this.getLimits();
|
|
71
|
+
const promptBytes = Buffer.byteLength(prompt, 'utf8');
|
|
72
|
+
if (promptBytes > MAX_ARGV_PROMPT_BYTES) {
|
|
58
73
|
return {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
stdout: '',
|
|
75
|
+
stderr: `Prompt is ${promptBytes} bytes; agy takes the prompt as a command-line argument and the OS limit is ~${MAX_ARGV_PROMPT_BYTES} bytes. Shorten the brief (ccOutput/question) or the file lists.`,
|
|
76
|
+
exitCode: 1,
|
|
77
|
+
truncated: false,
|
|
63
78
|
};
|
|
64
79
|
}
|
|
65
|
-
try {
|
|
66
|
-
const handoff = buildSimpleHandoff(request.workingDir, request.ccOutput, request.analyzedFiles, request.focusAreas, request.customPrompt);
|
|
67
|
-
const prompt = request.reviewMode === 'adversarial'
|
|
68
|
-
? buildAdversarialHandoffPrompt({ handoff })
|
|
69
|
-
: buildHandoffPrompt({ handoff, role: selectRole(request.focusAreas) });
|
|
70
|
-
const result = await this.runCli(prompt, request.workingDir);
|
|
71
|
-
if (result.exitCode !== 0) {
|
|
72
|
-
const error = this.categorizeError(result.stderr);
|
|
73
|
-
return { success: false, error, suggestion: this.getSuggestion(error), executionTimeMs: Date.now() - startTime };
|
|
74
|
-
}
|
|
75
|
-
if (!result.stdout.trim()) {
|
|
76
|
-
return {
|
|
77
|
-
success: false,
|
|
78
|
-
error: { type: 'cli_error', message: 'agy returned empty response' },
|
|
79
|
-
suggestion: 'Try again or use /multi-review instead',
|
|
80
|
-
executionTimeMs: Date.now() - startTime,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
return { success: true, output: result.stdout, executionTimeMs: Date.now() - startTime };
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
return this.handleException(error, startTime);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async runCli(prompt, workingDir) {
|
|
90
|
-
const cfg = getConfig().gemini;
|
|
91
|
-
// agy requires the prompt as the positional after --print; passing only via
|
|
92
|
-
// stdin makes it print --help and exit 0. Sandbox keeps terminal-restricted
|
|
93
|
-
// execution like the old gemini-cli's `--approval-mode plan`.
|
|
94
80
|
const args = [
|
|
95
81
|
...(cfg.model ? ['--model', cfg.model] : []),
|
|
82
|
+
// agy's own print-mode timeout defaults to 5m and would end long reviews
|
|
83
|
+
// before quorum's timer; keep the two in step. Go duration syntax.
|
|
84
|
+
'--print-timeout', `${Math.ceil(limits.inactivityTimeoutMs / 1000)}s`,
|
|
96
85
|
'--sandbox',
|
|
97
86
|
'--add-dir', workingDir,
|
|
98
87
|
'--print', prompt,
|
|
99
88
|
];
|
|
100
89
|
const cliStartTime = Date.now();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
const seconds = () => Math.round((Date.now() - cliStartTime) / 1000);
|
|
91
|
+
console.error(`[gemini] Running ${ctx.kind} via agy${cfg.model ? ` (${cfg.model})` : ''}...`);
|
|
92
|
+
const runOnce = () => new CliExecutor({
|
|
93
|
+
command: this.binary,
|
|
104
94
|
args,
|
|
105
95
|
cwd: workingDir,
|
|
106
|
-
inactivityTimeoutMs:
|
|
107
|
-
maxTimeoutMs:
|
|
108
|
-
maxBufferSize:
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
96
|
+
inactivityTimeoutMs: limits.inactivityTimeoutMs,
|
|
97
|
+
maxTimeoutMs: limits.maxTimeoutMs,
|
|
98
|
+
maxBufferSize: limits.maxBufferSize,
|
|
99
|
+
}).run();
|
|
100
|
+
let result = await runOnce();
|
|
101
|
+
if (result.exitCode !== 0 && Date.now() - cliStartTime < AUTH_RETRY_WINDOW_MS && AUTH_HANDSHAKE_FAILURE.test(result.stderr)) {
|
|
102
|
+
// The handshake is transient (slow network to Google), one retry usually lands.
|
|
103
|
+
console.error(`[gemini] agy auth handshake failed after ${seconds()}s; retrying once`);
|
|
104
|
+
result = await runOnce();
|
|
105
|
+
}
|
|
106
|
+
console.error(`[gemini] ✓ complete (${seconds()}s)`);
|
|
113
107
|
return {
|
|
114
108
|
stdout: result.rawStdout,
|
|
115
109
|
stderr: result.stderr,
|
|
@@ -117,71 +111,6 @@ export class GeminiAdapter {
|
|
|
117
111
|
truncated: result.truncated,
|
|
118
112
|
};
|
|
119
113
|
}
|
|
120
|
-
handleException(error, startTime) {
|
|
121
|
-
const err = error;
|
|
122
|
-
if (err.code === 'ENOENT') {
|
|
123
|
-
return { success: false, error: { type: 'cli_not_found', message: 'agy CLI not found' },
|
|
124
|
-
suggestion: `Install with: ${AGY_INSTALL_CMD}`, executionTimeMs: Date.now() - startTime };
|
|
125
|
-
}
|
|
126
|
-
if (err.message === 'TIMEOUT') {
|
|
127
|
-
return { success: false, error: { type: 'timeout', message: 'agy timed out — no output received' },
|
|
128
|
-
suggestion: 'Try a smaller scope or use /multi-review', executionTimeMs: Date.now() - startTime };
|
|
129
|
-
}
|
|
130
|
-
if (err.message === 'MAX_TIMEOUT') {
|
|
131
|
-
return { success: false, error: { type: 'timeout', message: 'Task exceeded 60 minute maximum' },
|
|
132
|
-
suggestion: 'Try a smaller scope', executionTimeMs: Date.now() - startTime };
|
|
133
|
-
}
|
|
134
|
-
return { success: false, error: { type: 'cli_error', message: err.message }, executionTimeMs: Date.now() - startTime };
|
|
135
|
-
}
|
|
136
|
-
categorizeError(stderr) {
|
|
137
|
-
const lower = stderr.toLowerCase();
|
|
138
|
-
if (lower.includes('rate limit') || lower.includes('quota')) {
|
|
139
|
-
return { type: 'rate_limit', message: `Rate limit or quota exceeded: ${stderr.slice(0, 500)}` };
|
|
140
|
-
}
|
|
141
|
-
if (lower.includes('unauthorized') || lower.includes('authentication') || lower.includes('oauth') || stderr.includes('401') || stderr.includes('403')) {
|
|
142
|
-
return { type: 'auth_error', message: `Authentication failed: ${stderr.slice(0, 500)}`, details: { stderr } };
|
|
143
|
-
}
|
|
144
|
-
return { type: 'cli_error', message: stderr.slice(0, 500) || 'Unknown error' };
|
|
145
|
-
}
|
|
146
|
-
getSuggestion(error) {
|
|
147
|
-
switch (error.type) {
|
|
148
|
-
case 'rate_limit': return 'Wait and retry, or use /multi-review instead';
|
|
149
|
-
case 'auth_error': return 'Run `agy` and complete the Google OAuth sign-in';
|
|
150
|
-
case 'cli_not_found': return `Install with: ${AGY_INSTALL_CMD}`;
|
|
151
|
-
default: return 'Check the error message and try again';
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
async runConsult(request) {
|
|
155
|
-
const startTime = Date.now();
|
|
156
|
-
if (!existsSync(request.workingDir)) {
|
|
157
|
-
return {
|
|
158
|
-
success: false,
|
|
159
|
-
error: { type: 'cli_error', message: `Working directory does not exist: ${request.workingDir}` },
|
|
160
|
-
suggestion: 'Check that the working directory path is correct',
|
|
161
|
-
executionTimeMs: Date.now() - startTime,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
try {
|
|
165
|
-
const prompt = buildConsultPrompt(request);
|
|
166
|
-
const result = await this.runCli(prompt, request.workingDir);
|
|
167
|
-
if (result.exitCode !== 0) {
|
|
168
|
-
const error = this.categorizeError(result.stderr);
|
|
169
|
-
return { success: false, error, suggestion: this.getSuggestion(error), executionTimeMs: Date.now() - startTime };
|
|
170
|
-
}
|
|
171
|
-
if (!result.stdout.trim()) {
|
|
172
|
-
return {
|
|
173
|
-
success: false,
|
|
174
|
-
error: { type: 'cli_error', message: 'agy returned empty response' },
|
|
175
|
-
suggestion: 'Try again or use /multi-review instead',
|
|
176
|
-
executionTimeMs: Date.now() - startTime,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
return { success: true, output: result.stdout, executionTimeMs: Date.now() - startTime };
|
|
180
|
-
}
|
|
181
|
-
catch (error) {
|
|
182
|
-
return this.handleException(error, startTime);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
114
|
}
|
|
186
|
-
registerAdapter(new GeminiAdapter());
|
|
187
115
|
export const geminiAdapter = new GeminiAdapter();
|
|
116
|
+
registerAdapter(geminiAdapter);
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Adapter
|
|
2
|
+
* Adapter registry entry point.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Importing this module registers every built-in adapter. To add a CLI:
|
|
5
|
+
* subclass `CliAdapter`, register the instance, and import the module here.
|
|
5
6
|
*/
|
|
6
7
|
import './codex.js';
|
|
7
8
|
import './gemini.js';
|
|
8
9
|
import './claude.js';
|
|
9
10
|
export * from './base.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
11
|
+
export { CliAdapter, AVAILABILITY_TTL_MS, probeVersion } from './cli-adapter.js';
|
|
12
|
+
export type { CliOutcome, RunContext, RunLimits } from './cli-adapter.js';
|
|
13
|
+
export { codexAdapter, CodexAdapter } from './codex.js';
|
|
14
|
+
export { geminiAdapter, GeminiAdapter } from './gemini.js';
|
|
15
|
+
export { claudeAdapter, ClaudeAdapter } from './claude.js';
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Adapter
|
|
2
|
+
* Adapter registry entry point.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Importing this module registers every built-in adapter. To add a CLI:
|
|
5
|
+
* subclass `CliAdapter`, register the instance, and import the module here.
|
|
5
6
|
*/
|
|
6
|
-
// Import adapters to register them
|
|
7
7
|
import './codex.js';
|
|
8
8
|
import './gemini.js';
|
|
9
9
|
import './claude.js';
|
|
10
|
-
// Re-export everything from base
|
|
11
10
|
export * from './base.js';
|
|
12
|
-
|
|
13
|
-
export { codexAdapter } from './codex.js';
|
|
14
|
-
export { geminiAdapter } from './gemini.js';
|
|
15
|
-
export { claudeAdapter } from './claude.js';
|
|
11
|
+
export { CliAdapter, AVAILABILITY_TTL_MS, probeVersion } from './cli-adapter.js';
|
|
12
|
+
export { codexAdapter, CodexAdapter } from './codex.js';
|
|
13
|
+
export { geminiAdapter, GeminiAdapter } from './gemini.js';
|
|
14
|
+
export { claudeAdapter, ClaudeAdapter } from './claude.js';
|
package/dist/config.d.ts
CHANGED
|
@@ -4,22 +4,26 @@
|
|
|
4
4
|
* Config file: ~/.config/quorum/config.json
|
|
5
5
|
*
|
|
6
6
|
* Semantics:
|
|
7
|
-
* - Lazy, cached load. `getConfig()` returns the
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* - Lazy, cached load with mtime-based hot reload. `getConfig()` returns the
|
|
8
|
+
* cached config or re-reads when the file changed on disk.
|
|
9
|
+
* - Missing file → defaults in memory (no write). `initConfig()` (server
|
|
10
|
+
* start-up) creates the file with defaults on first launch.
|
|
11
|
+
* - Invalid JSON → defaults, warn on stderr. A schema violation in one
|
|
12
|
+
* adapter's section resets only that section; the others survive.
|
|
11
13
|
* - Partial user configs are deep-merged against defaults via Zod `.default()`.
|
|
12
|
-
* - Tool-call arguments
|
|
13
|
-
*
|
|
14
|
+
* - Tool-call arguments override config (e.g. `reasoningEffort` on a single
|
|
15
|
+
* `multi_review` call). Config only sets defaults.
|
|
14
16
|
*/
|
|
15
17
|
import { z } from 'zod';
|
|
16
18
|
export declare const CodexConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
19
|
+
/** Set to false to leave Codex out of the panel even when installed. */
|
|
20
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
17
21
|
model: z.ZodDefault<z.ZodString>;
|
|
18
22
|
reasoningEffort: z.ZodDefault<z.ZodEnum<["high", "xhigh"]>>;
|
|
19
23
|
serviceTier: z.ZodDefault<z.ZodEnum<["default", "fast", "flex"]>>;
|
|
20
|
-
/** Consult-specific defaults —
|
|
21
|
-
*
|
|
22
|
-
*
|
|
24
|
+
/** Consult-specific defaults — consult questions are deeper than reviews,
|
|
25
|
+
* so the default leans toward more reasoning. Override to cap cost without
|
|
26
|
+
* touching review behaviour. */
|
|
23
27
|
consultReasoningEffort: z.ZodDefault<z.ZodEnum<["high", "xhigh"]>>;
|
|
24
28
|
consultServiceTier: z.ZodDefault<z.ZodEnum<["default", "fast", "flex"]>>;
|
|
25
29
|
/**
|
|
@@ -27,10 +31,10 @@ export declare const CodexConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
27
31
|
*
|
|
28
32
|
* Normally the rollout-file liveness watcher (`codex-liveness.ts`) resets
|
|
29
33
|
* this timer while the model reasons, so it only fires on a genuinely dead
|
|
30
|
-
* process. These values
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
+
* process. These values protect a run when that watcher cannot find the
|
|
35
|
+
* rollout file (`--ephemeral`, a relocated CODEX_HOME, a layout change),
|
|
36
|
+
* and must therefore exceed a realistic reasoning block: an xhigh block
|
|
37
|
+
* has been measured at 287s of unbroken silence.
|
|
34
38
|
*/
|
|
35
39
|
inactivityTimeoutMs: z.ZodDefault<z.ZodObject<{
|
|
36
40
|
high: z.ZodDefault<z.ZodNumber>;
|
|
@@ -45,6 +49,7 @@ export declare const CodexConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
45
49
|
maxTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
46
50
|
maxBufferSize: z.ZodDefault<z.ZodNumber>;
|
|
47
51
|
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
enabled: boolean;
|
|
48
53
|
model: string;
|
|
49
54
|
reasoningEffort: "high" | "xhigh";
|
|
50
55
|
serviceTier: "default" | "fast" | "flex";
|
|
@@ -57,6 +62,7 @@ export declare const CodexConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
57
62
|
maxTimeoutMs: number;
|
|
58
63
|
maxBufferSize: number;
|
|
59
64
|
}, {
|
|
65
|
+
enabled?: boolean | undefined;
|
|
60
66
|
model?: string | undefined;
|
|
61
67
|
reasoningEffort?: "high" | "xhigh" | undefined;
|
|
62
68
|
serviceTier?: "default" | "fast" | "flex" | undefined;
|
|
@@ -70,22 +76,45 @@ export declare const CodexConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
70
76
|
maxBufferSize?: number | undefined;
|
|
71
77
|
}>>;
|
|
72
78
|
export declare const ClaudeConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
79
|
+
/** Set to false to leave the fresh-context Claude reviewer out of the panel. */
|
|
80
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
81
|
+
/** `claude --model`: an alias (`fable`, `opus`, `sonnet`) or a full model id. */
|
|
73
82
|
model: z.ZodDefault<z.ZodString>;
|
|
83
|
+
/**
|
|
84
|
+
* `claude --fallback-model`: used when `model` is overloaded or the account
|
|
85
|
+
* cannot reach it. Set to null to run without a fallback.
|
|
86
|
+
*/
|
|
87
|
+
fallbackModel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
88
|
+
/** `claude --effort` for review passes. null omits the flag (older CLIs). */
|
|
89
|
+
effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
|
|
90
|
+
/** `claude --effort` for consult. null omits the flag. */
|
|
91
|
+
consultEffort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
|
|
92
|
+
/** Claude streams an event per tool call, so silence really does mean stuck. */
|
|
74
93
|
inactivityTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
75
94
|
maxTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
76
95
|
maxBufferSize: z.ZodDefault<z.ZodNumber>;
|
|
77
96
|
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
enabled: boolean;
|
|
78
98
|
model: string;
|
|
79
99
|
inactivityTimeoutMs: number;
|
|
80
100
|
maxTimeoutMs: number;
|
|
81
101
|
maxBufferSize: number;
|
|
102
|
+
fallbackModel: string | null;
|
|
103
|
+
effort: "high" | "xhigh" | "low" | "medium" | "max" | null;
|
|
104
|
+
consultEffort: "high" | "xhigh" | "low" | "medium" | "max" | null;
|
|
82
105
|
}, {
|
|
106
|
+
enabled?: boolean | undefined;
|
|
83
107
|
model?: string | undefined;
|
|
84
108
|
inactivityTimeoutMs?: number | undefined;
|
|
85
109
|
maxTimeoutMs?: number | undefined;
|
|
86
110
|
maxBufferSize?: number | undefined;
|
|
111
|
+
fallbackModel?: string | null | undefined;
|
|
112
|
+
effort?: "high" | "xhigh" | "low" | "medium" | "max" | null | undefined;
|
|
113
|
+
consultEffort?: "high" | "xhigh" | "low" | "medium" | "max" | null | undefined;
|
|
87
114
|
}>>;
|
|
88
115
|
export declare const GeminiConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
116
|
+
/** Set to false to leave Gemini out of the panel even when agy is installed. */
|
|
117
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
89
118
|
/**
|
|
90
119
|
* Passed through as `agy --model`. Optional: when unset the adapter omits
|
|
91
120
|
* the flag and agy picks the model from its own settings. Run `agy models`
|
|
@@ -96,18 +125,19 @@ export declare const GeminiConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
96
125
|
* `agy --print` emits nothing until it is done, so there is no activity to
|
|
97
126
|
* reset this timer and no way to tell a working run from a wedged one —
|
|
98
127
|
* it is effectively a total-runtime cap, and anything under a realistic
|
|
99
|
-
* review duration just kills healthy runs.
|
|
100
|
-
* silent reasoning blocks, minus any out-of-band liveness signal to watch.
|
|
128
|
+
* review duration just kills healthy runs.
|
|
101
129
|
*/
|
|
102
130
|
inactivityTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
103
131
|
maxTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
104
132
|
maxBufferSize: z.ZodDefault<z.ZodNumber>;
|
|
105
133
|
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
enabled: boolean;
|
|
106
135
|
inactivityTimeoutMs: number;
|
|
107
136
|
maxTimeoutMs: number;
|
|
108
137
|
maxBufferSize: number;
|
|
109
138
|
model?: string | undefined;
|
|
110
139
|
}, {
|
|
140
|
+
enabled?: boolean | undefined;
|
|
111
141
|
model?: string | undefined;
|
|
112
142
|
inactivityTimeoutMs?: number | undefined;
|
|
113
143
|
maxTimeoutMs?: number | undefined;
|
|
@@ -115,12 +145,14 @@ export declare const GeminiConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
115
145
|
}>>;
|
|
116
146
|
export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
117
147
|
codex: z.ZodDefault<z.ZodObject<{
|
|
148
|
+
/** Set to false to leave Codex out of the panel even when installed. */
|
|
149
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
118
150
|
model: z.ZodDefault<z.ZodString>;
|
|
119
151
|
reasoningEffort: z.ZodDefault<z.ZodEnum<["high", "xhigh"]>>;
|
|
120
152
|
serviceTier: z.ZodDefault<z.ZodEnum<["default", "fast", "flex"]>>;
|
|
121
|
-
/** Consult-specific defaults —
|
|
122
|
-
*
|
|
123
|
-
*
|
|
153
|
+
/** Consult-specific defaults — consult questions are deeper than reviews,
|
|
154
|
+
* so the default leans toward more reasoning. Override to cap cost without
|
|
155
|
+
* touching review behaviour. */
|
|
124
156
|
consultReasoningEffort: z.ZodDefault<z.ZodEnum<["high", "xhigh"]>>;
|
|
125
157
|
consultServiceTier: z.ZodDefault<z.ZodEnum<["default", "fast", "flex"]>>;
|
|
126
158
|
/**
|
|
@@ -128,10 +160,10 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
128
160
|
*
|
|
129
161
|
* Normally the rollout-file liveness watcher (`codex-liveness.ts`) resets
|
|
130
162
|
* this timer while the model reasons, so it only fires on a genuinely dead
|
|
131
|
-
* process. These values
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
163
|
+
* process. These values protect a run when that watcher cannot find the
|
|
164
|
+
* rollout file (`--ephemeral`, a relocated CODEX_HOME, a layout change),
|
|
165
|
+
* and must therefore exceed a realistic reasoning block: an xhigh block
|
|
166
|
+
* has been measured at 287s of unbroken silence.
|
|
135
167
|
*/
|
|
136
168
|
inactivityTimeoutMs: z.ZodDefault<z.ZodObject<{
|
|
137
169
|
high: z.ZodDefault<z.ZodNumber>;
|
|
@@ -146,6 +178,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
146
178
|
maxTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
147
179
|
maxBufferSize: z.ZodDefault<z.ZodNumber>;
|
|
148
180
|
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
enabled: boolean;
|
|
149
182
|
model: string;
|
|
150
183
|
reasoningEffort: "high" | "xhigh";
|
|
151
184
|
serviceTier: "default" | "fast" | "flex";
|
|
@@ -158,6 +191,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
158
191
|
maxTimeoutMs: number;
|
|
159
192
|
maxBufferSize: number;
|
|
160
193
|
}, {
|
|
194
|
+
enabled?: boolean | undefined;
|
|
161
195
|
model?: string | undefined;
|
|
162
196
|
reasoningEffort?: "high" | "xhigh" | undefined;
|
|
163
197
|
serviceTier?: "default" | "fast" | "flex" | undefined;
|
|
@@ -171,22 +205,45 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
171
205
|
maxBufferSize?: number | undefined;
|
|
172
206
|
}>>;
|
|
173
207
|
claude: z.ZodDefault<z.ZodObject<{
|
|
208
|
+
/** Set to false to leave the fresh-context Claude reviewer out of the panel. */
|
|
209
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
210
|
+
/** `claude --model`: an alias (`fable`, `opus`, `sonnet`) or a full model id. */
|
|
174
211
|
model: z.ZodDefault<z.ZodString>;
|
|
212
|
+
/**
|
|
213
|
+
* `claude --fallback-model`: used when `model` is overloaded or the account
|
|
214
|
+
* cannot reach it. Set to null to run without a fallback.
|
|
215
|
+
*/
|
|
216
|
+
fallbackModel: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
/** `claude --effort` for review passes. null omits the flag (older CLIs). */
|
|
218
|
+
effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
|
|
219
|
+
/** `claude --effort` for consult. null omits the flag. */
|
|
220
|
+
consultEffort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
|
|
221
|
+
/** Claude streams an event per tool call, so silence really does mean stuck. */
|
|
175
222
|
inactivityTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
176
223
|
maxTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
177
224
|
maxBufferSize: z.ZodDefault<z.ZodNumber>;
|
|
178
225
|
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
enabled: boolean;
|
|
179
227
|
model: string;
|
|
180
228
|
inactivityTimeoutMs: number;
|
|
181
229
|
maxTimeoutMs: number;
|
|
182
230
|
maxBufferSize: number;
|
|
231
|
+
fallbackModel: string | null;
|
|
232
|
+
effort: "high" | "xhigh" | "low" | "medium" | "max" | null;
|
|
233
|
+
consultEffort: "high" | "xhigh" | "low" | "medium" | "max" | null;
|
|
183
234
|
}, {
|
|
235
|
+
enabled?: boolean | undefined;
|
|
184
236
|
model?: string | undefined;
|
|
185
237
|
inactivityTimeoutMs?: number | undefined;
|
|
186
238
|
maxTimeoutMs?: number | undefined;
|
|
187
239
|
maxBufferSize?: number | undefined;
|
|
240
|
+
fallbackModel?: string | null | undefined;
|
|
241
|
+
effort?: "high" | "xhigh" | "low" | "medium" | "max" | null | undefined;
|
|
242
|
+
consultEffort?: "high" | "xhigh" | "low" | "medium" | "max" | null | undefined;
|
|
188
243
|
}>>;
|
|
189
244
|
gemini: z.ZodDefault<z.ZodObject<{
|
|
245
|
+
/** Set to false to leave Gemini out of the panel even when agy is installed. */
|
|
246
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
190
247
|
/**
|
|
191
248
|
* Passed through as `agy --model`. Optional: when unset the adapter omits
|
|
192
249
|
* the flag and agy picks the model from its own settings. Run `agy models`
|
|
@@ -197,18 +254,19 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
197
254
|
* `agy --print` emits nothing until it is done, so there is no activity to
|
|
198
255
|
* reset this timer and no way to tell a working run from a wedged one —
|
|
199
256
|
* it is effectively a total-runtime cap, and anything under a realistic
|
|
200
|
-
* review duration just kills healthy runs.
|
|
201
|
-
* silent reasoning blocks, minus any out-of-band liveness signal to watch.
|
|
257
|
+
* review duration just kills healthy runs.
|
|
202
258
|
*/
|
|
203
259
|
inactivityTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
204
260
|
maxTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
205
261
|
maxBufferSize: z.ZodDefault<z.ZodNumber>;
|
|
206
262
|
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
enabled: boolean;
|
|
207
264
|
inactivityTimeoutMs: number;
|
|
208
265
|
maxTimeoutMs: number;
|
|
209
266
|
maxBufferSize: number;
|
|
210
267
|
model?: string | undefined;
|
|
211
268
|
}, {
|
|
269
|
+
enabled?: boolean | undefined;
|
|
212
270
|
model?: string | undefined;
|
|
213
271
|
inactivityTimeoutMs?: number | undefined;
|
|
214
272
|
maxTimeoutMs?: number | undefined;
|
|
@@ -216,6 +274,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
216
274
|
}>>;
|
|
217
275
|
}, "strip", z.ZodTypeAny, {
|
|
218
276
|
codex: {
|
|
277
|
+
enabled: boolean;
|
|
219
278
|
model: string;
|
|
220
279
|
reasoningEffort: "high" | "xhigh";
|
|
221
280
|
serviceTier: "default" | "fast" | "flex";
|
|
@@ -229,12 +288,17 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
229
288
|
maxBufferSize: number;
|
|
230
289
|
};
|
|
231
290
|
claude: {
|
|
291
|
+
enabled: boolean;
|
|
232
292
|
model: string;
|
|
233
293
|
inactivityTimeoutMs: number;
|
|
234
294
|
maxTimeoutMs: number;
|
|
235
295
|
maxBufferSize: number;
|
|
296
|
+
fallbackModel: string | null;
|
|
297
|
+
effort: "high" | "xhigh" | "low" | "medium" | "max" | null;
|
|
298
|
+
consultEffort: "high" | "xhigh" | "low" | "medium" | "max" | null;
|
|
236
299
|
};
|
|
237
300
|
gemini: {
|
|
301
|
+
enabled: boolean;
|
|
238
302
|
inactivityTimeoutMs: number;
|
|
239
303
|
maxTimeoutMs: number;
|
|
240
304
|
maxBufferSize: number;
|
|
@@ -242,6 +306,7 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
242
306
|
};
|
|
243
307
|
}, {
|
|
244
308
|
codex?: {
|
|
309
|
+
enabled?: boolean | undefined;
|
|
245
310
|
model?: string | undefined;
|
|
246
311
|
reasoningEffort?: "high" | "xhigh" | undefined;
|
|
247
312
|
serviceTier?: "default" | "fast" | "flex" | undefined;
|
|
@@ -255,12 +320,17 @@ export declare const ConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
255
320
|
maxBufferSize?: number | undefined;
|
|
256
321
|
} | undefined;
|
|
257
322
|
claude?: {
|
|
323
|
+
enabled?: boolean | undefined;
|
|
258
324
|
model?: string | undefined;
|
|
259
325
|
inactivityTimeoutMs?: number | undefined;
|
|
260
326
|
maxTimeoutMs?: number | undefined;
|
|
261
327
|
maxBufferSize?: number | undefined;
|
|
328
|
+
fallbackModel?: string | null | undefined;
|
|
329
|
+
effort?: "high" | "xhigh" | "low" | "medium" | "max" | null | undefined;
|
|
330
|
+
consultEffort?: "high" | "xhigh" | "low" | "medium" | "max" | null | undefined;
|
|
262
331
|
} | undefined;
|
|
263
332
|
gemini?: {
|
|
333
|
+
enabled?: boolean | undefined;
|
|
264
334
|
model?: string | undefined;
|
|
265
335
|
inactivityTimeoutMs?: number | undefined;
|
|
266
336
|
maxTimeoutMs?: number | undefined;
|
|
@@ -275,10 +345,10 @@ export declare const DEFAULT_CONFIG: Config;
|
|
|
275
345
|
export declare function getConfigPath(): string;
|
|
276
346
|
export declare function getConfig(): Config;
|
|
277
347
|
/**
|
|
278
|
-
* Create the config file with defaults if it does not exist.
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
348
|
+
* Create the config file with defaults if it does not exist. Uses the
|
|
349
|
+
* exclusive `wx` flag for atomic creation — safe against TOCTOU races when
|
|
350
|
+
* multiple server instances start concurrently. Refreshes the cache so
|
|
351
|
+
* subsequent `getConfig()` calls see disk state.
|
|
282
352
|
*/
|
|
283
353
|
export declare function initConfig(): {
|
|
284
354
|
path: string;
|