@simonren/quorum 0.11.1 → 0.12.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 +2 -2
- package/commands/multi-consult.md +1 -1
- package/commands/multi-review.md +2 -2
- package/dist/adapters/claude.js +3 -1
- package/dist/adapters/codex.js +4 -1
- package/dist/adapters/gemini.d.ts +31 -3
- package/dist/adapters/gemini.js +97 -26
- package/dist/command-hashes.d.ts +9 -0
- package/dist/command-hashes.js +40 -0
- package/dist/commands.d.ts +51 -5
- package/dist/commands.js +215 -30
- package/dist/config.d.ts +32 -28
- package/dist/config.js +7 -5
- package/dist/consult-prompt.js +5 -4
- package/dist/decoders/agy.d.ts +26 -0
- package/dist/decoders/agy.js +44 -0
- package/dist/decoders/index.d.ts +2 -0
- package/dist/decoders/index.js +1 -0
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.js +116 -3
- package/dist/executor.d.ts +10 -0
- package/dist/executor.js +50 -9
- package/dist/handoff.js +13 -13
- package/dist/index.d.ts +2 -1
- package/dist/index.js +16 -10
- package/dist/server.js +18 -0
- package/dist/tools/consult.js +3 -3
- package/dist/tools/review.js +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ You have a question → /multi-consult → question + criteria → Codex, Gemi
|
|
|
83
83
|
|
|
84
84
|
**Key principles:**
|
|
85
85
|
- **Claude Code is primary.** External models assist; Claude Code verifies and decides.
|
|
86
|
-
- **Working-directory strategy.** Claude Code passes the cwd and a small brief; reviewers read the files themselves. Read-only by contract: Codex runs with `--sandbox read-only`; Claude runs in default permission mode with prompts disabled, write and agent tools removed, and only read-only `git` allowed in Bash; agy runs with `--sandbox
|
|
86
|
+
- **Working-directory strategy.** Claude Code passes the cwd and a small brief; reviewers read the files themselves. Read-only by contract: Codex runs with `--sandbox read-only`; Claude runs in default permission mode with prompts disabled, write and agent tools removed, and only read-only `git` allowed in Bash; agy runs with `--sandbox`, which covers only its terminal, and agy lets the model rerun a command outside it unless agy's `toolPermission` is `proceed-in-sandbox` (`doctor` warns on `always-proceed`). agy cannot make its file tools read-only, so quorum fingerprints the working tree (`git status`) before and after every run and flags any change at the top of the result.
|
|
87
87
|
- **Structured, verifiable answers.** Reviewers respond with `Verdict` / `Findings` (severity, location, evidence, impact, fix, confidence) / `Answers` / `Decisions`; drift from the contract is flagged so Claude Code can discount it.
|
|
88
88
|
- **Synthesis, not passthrough.** Raw model output never reaches you unless you ask for it; the provenance footer always does.
|
|
89
89
|
|
|
@@ -129,7 +129,7 @@ You have a question → /multi-consult → question + criteria → Codex, Gemi
|
|
|
129
129
|
| `claude.effort` / `claude.consultEffort` | `claude --effort` (`low`…`max`) for review / consult; `null` omits the flag. |
|
|
130
130
|
| `codex.reasoningEffort` / `codex.serviceTier` | Review defaults; the `consult*` keys are the consult defaults. Tool arguments override both. |
|
|
131
131
|
| `gemini.model` | Passed as `agy --model`; omit to use agy's own setting (`agy models` lists ids). |
|
|
132
|
-
| `*.inactivityTimeoutMs` | How long a reviewer may stay silent. Codex liveness is also proven via its rollout file; agy
|
|
132
|
+
| `*.inactivityTimeoutMs` | How long a reviewer may stay silent. Codex liveness is also proven via its rollout file; agy streams an event per model turn and tool call. agy's `--print-timeout` is set from `gemini.maxTimeoutMs`. |
|
|
133
133
|
|
|
134
134
|
`npx -y @simonren/quorum doctor` prints the detected CLIs, their versions, and the effective settings.
|
|
135
135
|
|
|
@@ -5,7 +5,7 @@ argument-hint: <question or steering> [flex|high reasoning]
|
|
|
5
5
|
|
|
6
6
|
# Multi Consult
|
|
7
7
|
|
|
8
|
-
Ask the panel — Codex, Gemini, and Claude with a fresh context — the same question in parallel and synthesize their answers into one recommendation. Use this for **consultation**: choosing an approach, weighing alternatives, getting a second opinion on a design. Not for reviewing work you
|
|
8
|
+
Ask the panel — Codex, Gemini, and Claude with a fresh context — the same question in parallel and synthesize their answers into one recommendation. Use this for **consultation**: choosing an approach, weighing alternatives, getting a second opinion on a design. Not for reviewing work you already did — that is the multi-review command.
|
|
9
9
|
|
|
10
10
|
Each model answers in a fixed structure (Recommendation with a confidence line / Reasoning / Tradeoffs / Risks / Open questions). You read all of them and present one consolidated answer with a "Models said:" footer so dissent stays visible.
|
|
11
11
|
|
package/commands/multi-review.md
CHANGED
|
@@ -5,9 +5,9 @@ argument-hint: [steering, e.g. "focus the challenge on rollback safety"] [flex|x
|
|
|
5
5
|
|
|
6
6
|
# Multi Review
|
|
7
7
|
|
|
8
|
-
Convene the panel on work you
|
|
8
|
+
Convene the panel on work you produced in this conversation: code you changed, a plan you wrote, findings, an analysis, or a proposal. Every available model reviews it twice, in parallel — a **standard pass** (bugs, gaps, does it clear the bar) and an **adversarial pass** (assumptions, design decisions, failure paths). The reviewers have the filesystem but not this conversation. They return raw findings; **you verify each one against the code and deliver one verdict.** You are the judge, not a relay.
|
|
9
9
|
|
|
10
|
-
If there is no
|
|
10
|
+
If there is no work of yours in this conversation to review, say so and suggest `/multi-consult` instead of inventing a brief.
|
|
11
11
|
|
|
12
12
|
## Arguments
|
|
13
13
|
|
package/dist/adapters/claude.js
CHANGED
|
@@ -115,7 +115,9 @@ export class ClaudeAdapter extends CliAdapter {
|
|
|
115
115
|
// A completed response wins over a non-fatal error event that preceded it.
|
|
116
116
|
// `!== null` so an empty-string result reaches empty-response handling.
|
|
117
117
|
if (finalResponse !== null) {
|
|
118
|
-
|
|
118
|
+
// The stream also carries every tool result, so the executor's cap on raw
|
|
119
|
+
// stdout says nothing about whether the response is complete.
|
|
120
|
+
return { stdout: finalResponse, stderr: result.stderr, exitCode: 0, truncated: false };
|
|
119
121
|
}
|
|
120
122
|
if (decoderError) {
|
|
121
123
|
return { stdout: '', stderr: this.combineDiagnostics(decoderError, result.stderr), exitCode: 1, truncated: false };
|
package/dist/adapters/codex.js
CHANGED
|
@@ -54,6 +54,7 @@ export class CodexAdapter extends CliAdapter {
|
|
|
54
54
|
'-m', cfg.model,
|
|
55
55
|
'-c', `model_reasoning_effort=${reasoningEffort}`,
|
|
56
56
|
'-c', 'model_reasoning_summary_format=experimental',
|
|
57
|
+
'-c', 'mcp_servers={}', // no inherited MCP servers — incl. quorum itself under a Codex host
|
|
57
58
|
'--sandbox', 'read-only',
|
|
58
59
|
'--skip-git-repo-check',
|
|
59
60
|
'-C', workingDir,
|
|
@@ -112,7 +113,9 @@ export class CodexAdapter extends CliAdapter {
|
|
|
112
113
|
// `!== null` so an empty-string response reaches empty-response handling.
|
|
113
114
|
const finalResponse = decoder.getFinalResponse();
|
|
114
115
|
if (finalResponse !== null) {
|
|
115
|
-
|
|
116
|
+
// The JSONL stream also carries every command's output, so the executor's
|
|
117
|
+
// cap on raw stdout says nothing about whether the response is complete.
|
|
118
|
+
return { stdout: finalResponse, stderr: result.stderr, exitCode: result.exitCode, truncated: false };
|
|
116
119
|
}
|
|
117
120
|
const decoderError = decoder.getError();
|
|
118
121
|
if (decoderError) {
|
|
@@ -9,13 +9,28 @@
|
|
|
9
9
|
* - the prompt must be the positional after `--print` (stdin alone makes agy
|
|
10
10
|
* print --help and exit 0), so the prompt size is bounded by the OS argv
|
|
11
11
|
* limit — see MAX_ARGV_PROMPT_BYTES
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
12
|
+
* - `--output-format stream-json` emits an event per model turn and per tool
|
|
13
|
+
* call, so the inactivity timer only fires on a real stall. In text mode
|
|
14
|
+
* agy printed nothing until it finished, which made that timer a
|
|
15
|
+
* total-runtime cap: reviews of 100+ serial turns were killed at 15 minutes
|
|
16
|
+
* and all of their output was lost
|
|
17
|
+
* - agy's own `--print-timeout` ends the run as a SUCCESS with partial
|
|
18
|
+
* output, so it is set to the total cap; quorum's timer starts earlier and
|
|
19
|
+
* always fires first
|
|
14
20
|
* - `--sandbox` restricts the terminal only. agy's file tools CAN still write
|
|
15
21
|
* to the workspace (verified with `--sandbox` and with `--mode plan`), and
|
|
16
22
|
* 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`)
|
|
23
|
+
* tree before and after every run and flag any change (`integrity.ts`).
|
|
24
|
+
* The model can also ask to run a command outside the sandbox; agy grants
|
|
25
|
+
* that unasked when the user's `toolPermission` is `always-proceed`
|
|
26
|
+
* (`quorum doctor` warns), and denies it in print mode under
|
|
27
|
+
* `proceed-in-sandbox`
|
|
28
|
+
* - a failing git is what makes the model ask for that bypass: inside the
|
|
29
|
+
* sandbox git cannot read ~/.gitconfig, nor a git dir outside the
|
|
30
|
+
* workspace — see SANDBOX_GIT_ENV and gitDirOutside
|
|
18
31
|
* - `--add-dir` scopes reads; `--model` is optional (`gemini.model`)
|
|
32
|
+
* - agy names its log by the second a run starts, so the two parallel passes
|
|
33
|
+
* wrote one file; each run gets its own `--log-file`
|
|
19
34
|
* - every print run does a silent OAuth handshake (keyring token, a few round
|
|
20
35
|
* trips to cloudcode-pa.googleapis.com, then an eligibility check that
|
|
21
36
|
* fetches the profile picture from lh3.googleusercontent.com) before the
|
|
@@ -25,6 +40,19 @@
|
|
|
25
40
|
*/
|
|
26
41
|
import { ReviewerCapabilities } from './base.js';
|
|
27
42
|
import { CliAdapter, CliOutcome, RunContext, RunLimits } from './cli-adapter.js';
|
|
43
|
+
/**
|
|
44
|
+
* The terminal sandbox denies reads outside the workspace, so git dies on
|
|
45
|
+
* ~/.gitconfig and warns about ~/.config/git/ignore on every call. A review
|
|
46
|
+
* needs only the repository's own config.
|
|
47
|
+
*/
|
|
48
|
+
export declare const SANDBOX_GIT_ENV: Record<string, string>;
|
|
49
|
+
/**
|
|
50
|
+
* The repository's git dir when it lies outside `workingDir`: a worktree, whose
|
|
51
|
+
* `.git` file points into the main checkout, or a subdirectory of a repository.
|
|
52
|
+
* The sandbox can read it only as an extra `--add-dir`; without that every git
|
|
53
|
+
* command fails. Null outside a git repository.
|
|
54
|
+
*/
|
|
55
|
+
export declare function gitDirOutside(workingDir: string): string | null;
|
|
28
56
|
/**
|
|
29
57
|
* Linux caps a single argv string at 128 KiB (MAX_ARG_STRLEN); macOS caps the
|
|
30
58
|
* whole argv+env block. A prompt beyond this would make spawn fail with E2BIG,
|
package/dist/adapters/gemini.js
CHANGED
|
@@ -9,13 +9,28 @@
|
|
|
9
9
|
* - the prompt must be the positional after `--print` (stdin alone makes agy
|
|
10
10
|
* print --help and exit 0), so the prompt size is bounded by the OS argv
|
|
11
11
|
* limit — see MAX_ARGV_PROMPT_BYTES
|
|
12
|
-
* -
|
|
13
|
-
*
|
|
12
|
+
* - `--output-format stream-json` emits an event per model turn and per tool
|
|
13
|
+
* call, so the inactivity timer only fires on a real stall. In text mode
|
|
14
|
+
* agy printed nothing until it finished, which made that timer a
|
|
15
|
+
* total-runtime cap: reviews of 100+ serial turns were killed at 15 minutes
|
|
16
|
+
* and all of their output was lost
|
|
17
|
+
* - agy's own `--print-timeout` ends the run as a SUCCESS with partial
|
|
18
|
+
* output, so it is set to the total cap; quorum's timer starts earlier and
|
|
19
|
+
* always fires first
|
|
14
20
|
* - `--sandbox` restricts the terminal only. agy's file tools CAN still write
|
|
15
21
|
* to the workspace (verified with `--sandbox` and with `--mode plan`), and
|
|
16
22
|
* 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`)
|
|
23
|
+
* tree before and after every run and flag any change (`integrity.ts`).
|
|
24
|
+
* The model can also ask to run a command outside the sandbox; agy grants
|
|
25
|
+
* that unasked when the user's `toolPermission` is `always-proceed`
|
|
26
|
+
* (`quorum doctor` warns), and denies it in print mode under
|
|
27
|
+
* `proceed-in-sandbox`
|
|
28
|
+
* - a failing git is what makes the model ask for that bypass: inside the
|
|
29
|
+
* sandbox git cannot read ~/.gitconfig, nor a git dir outside the
|
|
30
|
+
* workspace — see SANDBOX_GIT_ENV and gitDirOutside
|
|
18
31
|
* - `--add-dir` scopes reads; `--model` is optional (`gemini.model`)
|
|
32
|
+
* - agy names its log by the second a run starts, so the two parallel passes
|
|
33
|
+
* wrote one file; each run gets its own `--log-file`
|
|
19
34
|
* - every print run does a silent OAuth handshake (keyring token, a few round
|
|
20
35
|
* trips to cloudcode-pa.googleapis.com, then an eligibility check that
|
|
21
36
|
* fetches the profile picture from lh3.googleusercontent.com) before the
|
|
@@ -23,18 +38,59 @@
|
|
|
23
38
|
* timed out" (~10s) or "Eligibility check failed … TLS handshake timeout"
|
|
24
39
|
* (~50s) even though the login is fine — see the retry below
|
|
25
40
|
*/
|
|
41
|
+
import { execFileSync } from 'child_process';
|
|
42
|
+
import { randomUUID } from 'crypto';
|
|
43
|
+
import { homedir } from 'os';
|
|
44
|
+
import { isAbsolute, join, relative, resolve, sep } from 'path';
|
|
26
45
|
import { registerAdapter } from './base.js';
|
|
27
46
|
import { CliAdapter } from './cli-adapter.js';
|
|
28
47
|
import { CliExecutor } from '../executor.js';
|
|
48
|
+
import { AgyEventDecoder } from '../decoders/index.js';
|
|
29
49
|
import { getConfig } from '../config.js';
|
|
30
50
|
const AGY_INSTALL_CMD = 'curl -fsSL https://antigravity.google/cli/install.sh | bash';
|
|
51
|
+
/**
|
|
52
|
+
* The terminal sandbox denies reads outside the workspace, so git dies on
|
|
53
|
+
* ~/.gitconfig and warns about ~/.config/git/ignore on every call. A review
|
|
54
|
+
* needs only the repository's own config.
|
|
55
|
+
*/
|
|
56
|
+
export const SANDBOX_GIT_ENV = {
|
|
57
|
+
GIT_CONFIG_GLOBAL: '/dev/null',
|
|
58
|
+
GIT_CONFIG_COUNT: '1',
|
|
59
|
+
GIT_CONFIG_KEY_0: 'core.excludesFile',
|
|
60
|
+
GIT_CONFIG_VALUE_0: '/dev/null',
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* The repository's git dir when it lies outside `workingDir`: a worktree, whose
|
|
64
|
+
* `.git` file points into the main checkout, or a subdirectory of a repository.
|
|
65
|
+
* The sandbox can read it only as an extra `--add-dir`; without that every git
|
|
66
|
+
* command fails. Null outside a git repository.
|
|
67
|
+
*/
|
|
68
|
+
export function gitDirOutside(workingDir) {
|
|
69
|
+
try {
|
|
70
|
+
const out = execFileSync('git', ['-C', workingDir, 'rev-parse', '--git-common-dir'], {
|
|
71
|
+
encoding: 'utf-8',
|
|
72
|
+
timeout: 15_000,
|
|
73
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
74
|
+
}).trim();
|
|
75
|
+
const dir = resolve(workingDir, out);
|
|
76
|
+
const rel = relative(workingDir, dir);
|
|
77
|
+
return rel === '..' || rel.startsWith(`..${sep}`) || isAbsolute(rel) ? dir : null;
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
function agyLogFile() {
|
|
84
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
85
|
+
return join(homedir(), '.gemini', 'antigravity-cli', 'log', `cli-quorum-${stamp}-${randomUUID().slice(0, 8)}.log`);
|
|
86
|
+
}
|
|
31
87
|
/**
|
|
32
88
|
* Linux caps a single argv string at 128 KiB (MAX_ARG_STRLEN); macOS caps the
|
|
33
89
|
* whole argv+env block. A prompt beyond this would make spawn fail with E2BIG,
|
|
34
90
|
* so refuse early with a message that says what to shrink.
|
|
35
91
|
*/
|
|
36
92
|
export const MAX_ARGV_PROMPT_BYTES = 120_000;
|
|
37
|
-
/**
|
|
93
|
+
/** Diagnostics of an agy run that died in the pre-prompt handshake. */
|
|
38
94
|
const AUTH_HANDSHAKE_FAILURE = /authentication (?:failed or timed out|required)|eligibility check failed/i;
|
|
39
95
|
/**
|
|
40
96
|
* A handshake failure surfaces within ~60s (startup, the ~10s auth deadline,
|
|
@@ -77,39 +133,54 @@ export class GeminiAdapter extends CliAdapter {
|
|
|
77
133
|
truncated: false,
|
|
78
134
|
};
|
|
79
135
|
}
|
|
80
|
-
const
|
|
136
|
+
const gitDir = gitDirOutside(workingDir);
|
|
137
|
+
const args = (logFile) => [
|
|
81
138
|
...(cfg.model ? ['--model', cfg.model] : []),
|
|
82
|
-
|
|
83
|
-
//
|
|
84
|
-
'
|
|
139
|
+
'--output-format', 'stream-json',
|
|
140
|
+
// Go duration syntax. Matches the total cap rather than the inactivity
|
|
141
|
+
// timer: agy's clock starts after quorum's, so quorum's fires first.
|
|
142
|
+
'--print-timeout', `${Math.ceil(limits.maxTimeoutMs / 1000)}s`,
|
|
85
143
|
'--sandbox',
|
|
86
144
|
'--add-dir', workingDir,
|
|
145
|
+
...(gitDir ? ['--add-dir', gitDir] : []),
|
|
146
|
+
'--log-file', logFile,
|
|
87
147
|
'--print', prompt,
|
|
88
148
|
];
|
|
89
149
|
const cliStartTime = Date.now();
|
|
90
150
|
const seconds = () => Math.round((Date.now() - cliStartTime) / 1000);
|
|
91
151
|
console.error(`[gemini] Running ${ctx.kind} via agy${cfg.model ? ` (${cfg.model})` : ''}...`);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
152
|
+
let steps = 0;
|
|
153
|
+
const runOnce = async () => {
|
|
154
|
+
const decoder = new AgyEventDecoder();
|
|
155
|
+
const result = await new CliExecutor({
|
|
156
|
+
command: this.binary,
|
|
157
|
+
args: args(agyLogFile()),
|
|
158
|
+
cwd: workingDir,
|
|
159
|
+
env: SANDBOX_GIT_ENV,
|
|
160
|
+
inactivityTimeoutMs: limits.inactivityTimeoutMs,
|
|
161
|
+
maxTimeoutMs: limits.maxTimeoutMs,
|
|
162
|
+
maxBufferSize: limits.maxBufferSize,
|
|
163
|
+
onLine: (line) => decoder.processLine(line),
|
|
164
|
+
}).run();
|
|
165
|
+
steps += decoder.getStepCount();
|
|
166
|
+
const final = decoder.getResult();
|
|
167
|
+
if (result.exitCode === 0 && final?.status === 'SUCCESS') {
|
|
168
|
+
// The stream also carries every tool output, so the executor's cap on
|
|
169
|
+
// raw stdout says nothing about whether the response is complete.
|
|
170
|
+
return { stdout: final.response, stderr: result.stderr, exitCode: 0, truncated: false };
|
|
171
|
+
}
|
|
172
|
+
const reason = final?.error
|
|
173
|
+
|| (final ? `agy ended with status ${final.status} (exit ${result.exitCode})` : `No result event from agy (exit ${result.exitCode})`);
|
|
174
|
+
return { stdout: '', stderr: this.combineDiagnostics(reason, result.stderr), exitCode: result.exitCode || 1, truncated: false };
|
|
175
|
+
};
|
|
176
|
+
let outcome = await runOnce();
|
|
177
|
+
if (outcome.exitCode !== 0 && Date.now() - cliStartTime < AUTH_RETRY_WINDOW_MS && AUTH_HANDSHAKE_FAILURE.test(outcome.stderr)) {
|
|
102
178
|
// The handshake is transient (slow network to Google), one retry usually lands.
|
|
103
179
|
console.error(`[gemini] agy auth handshake failed after ${seconds()}s; retrying once`);
|
|
104
|
-
|
|
180
|
+
outcome = await runOnce();
|
|
105
181
|
}
|
|
106
|
-
console.error(`[gemini] ✓ complete (${seconds()}s)`);
|
|
107
|
-
return
|
|
108
|
-
stdout: result.rawStdout,
|
|
109
|
-
stderr: result.stderr,
|
|
110
|
-
exitCode: result.exitCode,
|
|
111
|
-
truncated: result.truncated,
|
|
112
|
-
};
|
|
182
|
+
console.error(`[gemini] ✓ complete (${seconds()}s, ${steps} steps)`);
|
|
183
|
+
return outcome;
|
|
113
184
|
}
|
|
114
185
|
}
|
|
115
186
|
export const geminiAdapter = new GeminiAdapter();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SHA-256 of every command file quorum has ever shipped — GENERATED, do not edit.
|
|
3
|
+
* Regenerate with `node scripts/gen-command-hashes.mjs`.
|
|
4
|
+
*
|
|
5
|
+
* Used to recognize an install from a release that predates the provenance
|
|
6
|
+
* marker, so quorum can upgrade its own files without ever touching one the
|
|
7
|
+
* operator wrote. A missing hash costs an upgrade, never data.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SHIPPED_COMMAND_HASHES: ReadonlySet<string>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SHA-256 of every command file quorum has ever shipped — GENERATED, do not edit.
|
|
3
|
+
* Regenerate with `node scripts/gen-command-hashes.mjs`.
|
|
4
|
+
*
|
|
5
|
+
* Used to recognize an install from a release that predates the provenance
|
|
6
|
+
* marker, so quorum can upgrade its own files without ever touching one the
|
|
7
|
+
* operator wrote. A missing hash costs an upgrade, never data.
|
|
8
|
+
*/
|
|
9
|
+
export const SHIPPED_COMMAND_HASHES = new Set([
|
|
10
|
+
'0799b9576f018a8b0c8ee8032c2c65621e3ac40b0f91469167f8effc9e3c68bc',
|
|
11
|
+
'0973d253db3dd34771b2a6251ab0952a38e2f239312f81a78b516a2aa77f188e',
|
|
12
|
+
'0aa3c041fbc439c959900096044e9c7fc29367abd433ea5528c3220e203fe4f7',
|
|
13
|
+
'0e640efa9a7fb5a3c3a5d2d4423f983a6d724a1c4f6b1c724eff6661a197b588',
|
|
14
|
+
'23d7a8280cac407051bf627531f651b3356a649afe823d98e372704dadd83707',
|
|
15
|
+
'2a9bdc5e10740baa0d03dd98f83505d78002050d1c833fb37eb362922b7c1847',
|
|
16
|
+
'3a1f0d1580e01f434bc67dfb305c8195dc864267edc4fd0b7d7e5852e59d7235',
|
|
17
|
+
'3c02aa89c99f09fd3372a0ce4e822a289d18bd19a5af1fb52de9def208dcbf19',
|
|
18
|
+
'3e83a69212c2caaa521f848c7adfe6f0534568ca51a70a404723107d86a02f34',
|
|
19
|
+
'4e492be65caaa12cf821d722e3c0d0e23a0ae69995c555e50b5fe9cabece535e',
|
|
20
|
+
'6073cc2cacd1ed3193bfdd4c3bc682bdddddfff1926f270ac54297220919a250',
|
|
21
|
+
'71826597257ae5e5aae97eb949fcaf296b6233671527bc1d909a9819f700bdf5',
|
|
22
|
+
'7340667a2b12f26c4a9e7ad06cab9b657f79c7846e3f39055913e9f95d12d8a6',
|
|
23
|
+
'80e5572b0de7b7f3dbcfc6058b54bee8b66c8af0aa177fa0c8010fb14bb1a710',
|
|
24
|
+
'9448a29e4523551155297c8da68ea36e14047cb470a740e74fdbac7a5dea36e4',
|
|
25
|
+
'94512584761514488cbec665a7d95656d729ceea9ea2a38959c51e991fdb8470',
|
|
26
|
+
'9aa277b158cd2a34ffc13865d4eaf129f5f6ce25ef8b1de73f67096104b5f794',
|
|
27
|
+
'9d2ed5597e531c8411242ba720944fb1be287ab8a4f098879255320a82d082ee',
|
|
28
|
+
'aa2d1ee0d16e74530c17c44d1558708452894abbeef84204167bbc458cd31549',
|
|
29
|
+
'b4a54f73411aac6ea0a46fac14d655a48d55839330b8de9b14e6766d405370a0',
|
|
30
|
+
'c017641338fa4bc44f57caff21c648a58f8ecbe67d8b93d53968d96ba841e37b',
|
|
31
|
+
'c14e0f4e0b1d261e3df3486f377b949f8847f5303bace0ab74409a452c86a865',
|
|
32
|
+
'c6828c722a60427942e4173a19115e03f4993a7d1d477e407791ed5422b968f3',
|
|
33
|
+
'd4d4e3977f5b6054a421bd2c34d8ca66956d92de6126964cef31dc5880898dd3',
|
|
34
|
+
'dcbe42ab9ddc24dd2fbc715c9af0ec5a230f584de8be381624a548bbba17c369',
|
|
35
|
+
'e211a1e9180a4170c656812008ead03f7659e631cd75ce9176360e036c71052a',
|
|
36
|
+
'e547dcc16c6af42d5db492e5dff5f8e3c46a4aff1bb2ab69575548d7ca2c0c33',
|
|
37
|
+
'f0946130b81916ba13bb30520934e11626dabc7c41c470314c5c70e95c6bc320',
|
|
38
|
+
'fc7fc509ee1f274eff7e4f04bbe280463eaebf23431bd12b46eae238b993b787',
|
|
39
|
+
'fe308b8b7b52ec83cc87e9842431e62d3956d0a0085d21489195cf5f4fe7e0db',
|
|
40
|
+
]);
|
package/dist/commands.d.ts
CHANGED
|
@@ -7,22 +7,68 @@ export interface InstallResult {
|
|
|
7
7
|
success: boolean;
|
|
8
8
|
installed: string[];
|
|
9
9
|
removed: string[];
|
|
10
|
+
/** Directories actually written to — one per host CLI present on this machine. */
|
|
11
|
+
targets: string[];
|
|
12
|
+
/** Files left alone because something quorum did not write already sits there. */
|
|
13
|
+
skipped: string[];
|
|
10
14
|
error?: string;
|
|
11
15
|
}
|
|
16
|
+
export type HostId = 'claude' | 'codex';
|
|
12
17
|
/**
|
|
13
|
-
*
|
|
18
|
+
* Map an MCP `initialize` clientInfo.name onto a host.
|
|
19
|
+
*
|
|
20
|
+
* Measured against the real CLIs: Claude Code sends `claude-code`, Codex sends
|
|
21
|
+
* `codex-mcp-client`. An unknown client gets nothing written to disk — quorum's
|
|
22
|
+
* tools work regardless, only the slash-command shorthand is host-specific.
|
|
23
|
+
*/
|
|
24
|
+
export declare function hostFromClientName(name: string | undefined): HostId | null;
|
|
25
|
+
/**
|
|
26
|
+
* Get source and target paths for command files.
|
|
27
|
+
*
|
|
28
|
+
* A target is included only when that host's home directory already exists —
|
|
29
|
+
* quorum never creates `~/.codex` for a user who has no Codex installed. This
|
|
30
|
+
* runs before `server.connect()`, so the MCP client identity is not available
|
|
31
|
+
* yet; directory presence is the signal.
|
|
14
32
|
*/
|
|
15
|
-
export declare function getCommandPaths(): {
|
|
33
|
+
export declare function getCommandPaths(host?: HostId): {
|
|
16
34
|
source: string;
|
|
17
|
-
|
|
35
|
+
targets: string[];
|
|
18
36
|
};
|
|
19
37
|
/**
|
|
20
|
-
*
|
|
38
|
+
* Rewrite a Claude Code command file as a Codex skill.
|
|
39
|
+
*
|
|
40
|
+
* A skill's frontmatter is `name` + `description`; `argument-hint` is not a
|
|
41
|
+
* skill field, and `$ARGUMENTS` is not substituted the way a slash command
|
|
42
|
+
* substitutes it, so the body refers to the request in prose instead.
|
|
43
|
+
*/
|
|
44
|
+
export declare function toSkill(name: string, body: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Install the orchestration instructions for a host CLI.
|
|
47
|
+
*
|
|
48
|
+
* With `host`, only that host's directory is written — the server uses this so
|
|
49
|
+
* a session never writes into a CLI that is merely installed as a *reviewer*.
|
|
50
|
+
* Without it (the `quorum update` subcommand, an explicit user action), every
|
|
51
|
+
* host present on the machine is written.
|
|
21
52
|
*
|
|
22
|
-
* @param overrides Test-only path overrides; production callers pass
|
|
53
|
+
* @param overrides Test-only path overrides; production callers pass `host`.
|
|
54
|
+
* A `target` override collapses the install to that single directory.
|
|
23
55
|
* @returns Result object with success status and installed commands
|
|
24
56
|
*/
|
|
25
57
|
export declare function installCommands(overrides?: Partial<{
|
|
26
58
|
source: string;
|
|
27
59
|
target: string;
|
|
60
|
+
host: HostId;
|
|
28
61
|
}>): InstallResult;
|
|
62
|
+
/**
|
|
63
|
+
* Stamped into every file quorum writes, so a later install can recognize its
|
|
64
|
+
* own work without guessing. Must never change: older installs are identified
|
|
65
|
+
* by this exact string.
|
|
66
|
+
*/
|
|
67
|
+
export declare const PROVENANCE_MARKER = "<!-- installed by quorum; edits are overwritten on upgrade -->";
|
|
68
|
+
/**
|
|
69
|
+
* True when these bytes are a marked file, or one quorum shipped verbatim.
|
|
70
|
+
*
|
|
71
|
+
* `known` is injectable so the identity rule can be tested without depending
|
|
72
|
+
* on the generated manifest's current contents.
|
|
73
|
+
*/
|
|
74
|
+
export declare function isOurContent(body: Buffer, known?: ReadonlySet<string>): boolean;
|