@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/tools/feedback.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Tool Implementations — Review Tools
|
|
3
|
-
*
|
|
4
|
-
* Returns raw reviewer text to CC. No JSON parsing, no reformatting.
|
|
5
|
-
* CC handles interpretation and synthesis.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { getAvailableAdapters, } from '../adapters/index.js';
|
|
9
|
-
// =============================================================================
|
|
10
|
-
// INPUT SCHEMAS
|
|
11
|
-
// =============================================================================
|
|
12
|
-
export const ReviewInputSchema = z.object({
|
|
13
|
-
workingDir: z.string().describe('Working directory for the CLI to operate in'),
|
|
14
|
-
ccOutput: z.string().describe("Claude Code's output to review (findings, plan, analysis)"),
|
|
15
|
-
outputType: z.enum(['plan', 'findings', 'analysis', 'proposal']).describe('Type of output being reviewed'),
|
|
16
|
-
analyzedFiles: z.array(z.string()).optional().describe('File paths that CC analyzed'),
|
|
17
|
-
focusAreas: z.array(z.enum([
|
|
18
|
-
'security', 'performance', 'architecture', 'correctness',
|
|
19
|
-
'maintainability', 'scalability', 'testing', 'documentation'
|
|
20
|
-
])).optional().describe('Areas to focus the review on'),
|
|
21
|
-
customPrompt: z.string().optional().describe('Custom instructions for the reviewer'),
|
|
22
|
-
reasoningEffort: z.enum(['high', 'xhigh']).optional().describe('Codex reasoning effort level (default: high, use xhigh for deeper analysis)'),
|
|
23
|
-
serviceTier: z.enum(['default', 'fast', 'flex']).optional().describe('Codex service tier (default when omitted: fast = priority processing, ~2x cost; flex = 50% cheaper/slower; default = API default tier)')
|
|
24
|
-
});
|
|
25
|
-
// =============================================================================
|
|
26
|
-
// HELPERS
|
|
27
|
-
// =============================================================================
|
|
28
|
-
function toReviewRequest(input) {
|
|
29
|
-
return {
|
|
30
|
-
workingDir: input.workingDir,
|
|
31
|
-
ccOutput: input.ccOutput,
|
|
32
|
-
outputType: input.outputType,
|
|
33
|
-
analyzedFiles: input.analyzedFiles,
|
|
34
|
-
focusAreas: input.focusAreas,
|
|
35
|
-
customPrompt: input.customPrompt,
|
|
36
|
-
reasoningEffort: input.reasoningEffort,
|
|
37
|
-
serviceTier: input.serviceTier,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function formatResult(result, modelName) {
|
|
41
|
-
if (!result.success) {
|
|
42
|
-
const emoji = {
|
|
43
|
-
cli_not_found: '❌', timeout: '⏱️', rate_limit: '🚫',
|
|
44
|
-
auth_error: '🔐', cli_error: '❌',
|
|
45
|
-
};
|
|
46
|
-
let msg = `${emoji[result.error.type] || '❌'} **${result.error.type}**: ${result.error.message}`;
|
|
47
|
-
if (result.suggestion)
|
|
48
|
-
msg += `\n\n💡 ${result.suggestion}`;
|
|
49
|
-
return msg;
|
|
50
|
-
}
|
|
51
|
-
return `## ${modelName} Review\n\n**Execution Time:** ${(result.executionTimeMs / 1000).toFixed(1)}s\n\n${result.output}`;
|
|
52
|
-
}
|
|
53
|
-
// =============================================================================
|
|
54
|
-
// MULTI-MODEL HANDLER
|
|
55
|
-
// =============================================================================
|
|
56
|
-
export async function handleMultiReview(input) {
|
|
57
|
-
const request = toReviewRequest(input);
|
|
58
|
-
const availableAdapters = await getAvailableAdapters();
|
|
59
|
-
if (availableAdapters.length === 0) {
|
|
60
|
-
return { content: [{ type: 'text', text: '❌ No AI CLIs found.\n\nInstall at least one:\n - Codex: npm install -g @openai/codex-cli\n - Gemini (agy): curl -fsSL https://antigravity.google/cli/install.sh | bash' }] };
|
|
61
|
-
}
|
|
62
|
-
// Spawn 2 reviews per adapter: standard + adversarial (all in parallel)
|
|
63
|
-
// customPrompt steers the adversarial focus only — strip it from standard pass to avoid bias
|
|
64
|
-
const { customPrompt, ...standardRequest } = request;
|
|
65
|
-
const reviewPromises = availableAdapters.flatMap((adapter) => [
|
|
66
|
-
adapter.runReview({ ...standardRequest }).then(result => ({ adapter, result, mode: 'standard' })),
|
|
67
|
-
adapter.runReview({ ...request, reviewMode: 'adversarial' }).then(result => ({ adapter, result, mode: 'adversarial' })),
|
|
68
|
-
]);
|
|
69
|
-
const results = await Promise.all(reviewPromises);
|
|
70
|
-
const standardResults = results.filter(r => r.mode === 'standard');
|
|
71
|
-
const adversarialResults = results.filter(r => r.mode === 'adversarial');
|
|
72
|
-
const allFailed = results.every(r => !r.result.success);
|
|
73
|
-
const someFailed = results.some(r => !r.result.success);
|
|
74
|
-
const lines = [];
|
|
75
|
-
if (allFailed)
|
|
76
|
-
lines.push('## Multi-Model Review ❌ All Failed\n');
|
|
77
|
-
else if (someFailed)
|
|
78
|
-
lines.push('## Multi-Model Review ⚠️ Partial Success\n');
|
|
79
|
-
else
|
|
80
|
-
lines.push('## Multi-Model Review ✓\n');
|
|
81
|
-
lines.push(`**Models:** ${availableAdapters.map(a => a.id).join(', ')} (standard + adversarial)\n`);
|
|
82
|
-
// Standard section
|
|
83
|
-
lines.push('## Standard Review Findings\n');
|
|
84
|
-
for (const { adapter, result } of standardResults) {
|
|
85
|
-
lines.push(formatResult(result, adapter.getCapabilities().name));
|
|
86
|
-
lines.push('');
|
|
87
|
-
}
|
|
88
|
-
// Adversarial section
|
|
89
|
-
lines.push('## Challenge Review Findings\n');
|
|
90
|
-
for (const { adapter, result } of adversarialResults) {
|
|
91
|
-
lines.push(formatResult(result, `${adapter.getCapabilities().name} (Adversarial)`));
|
|
92
|
-
lines.push('');
|
|
93
|
-
}
|
|
94
|
-
return { content: [{ type: 'text', text: lines.join('\n') }] };
|
|
95
|
-
}
|
|
96
|
-
// =============================================================================
|
|
97
|
-
// TOOL DEFINITIONS
|
|
98
|
-
// =============================================================================
|
|
99
|
-
export const TOOL_DEFINITIONS = {
|
|
100
|
-
multi_review: {
|
|
101
|
-
name: 'multi_review',
|
|
102
|
-
description: "Use when reviewing existing CC-produced work (plan, findings, code). Requires 'ccOutput' — CC's prior output to evaluate. Runs parallel standard AND adversarial reviews from all available models. For asking the panel an open question with no prior CC-produced work to review, use 'multi_consult' instead. The discriminator is the shape of the input, not the user's phrasing.",
|
|
103
|
-
inputSchema: {
|
|
104
|
-
type: 'object',
|
|
105
|
-
properties: {
|
|
106
|
-
workingDir: { type: 'string', description: 'Working directory for the CLI to operate in' },
|
|
107
|
-
ccOutput: { type: 'string', description: "Claude Code's output to review (findings, plan, analysis)" },
|
|
108
|
-
outputType: { type: 'string', enum: ['plan', 'findings', 'analysis', 'proposal'], description: 'Type of output being reviewed' },
|
|
109
|
-
analyzedFiles: { type: 'array', items: { type: 'string' }, description: 'File paths that CC analyzed' },
|
|
110
|
-
focusAreas: { type: 'array', items: { type: 'string', enum: ['security', 'performance', 'architecture', 'correctness', 'maintainability', 'scalability', 'testing', 'documentation'] }, description: 'Areas to focus the review on' },
|
|
111
|
-
customPrompt: { type: 'string', description: 'Custom instructions for standard review + adversarial focus steering' },
|
|
112
|
-
serviceTier: { type: 'string', enum: ['default', 'fast', 'flex'], description: 'Codex service tier — only applies to Codex. Omit for fast default; fast = priority ~2x cost, flex = 50% cheaper/slower, default = API default tier.' }
|
|
113
|
-
},
|
|
114
|
-
required: ['workingDir', 'ccOutput', 'outputType']
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
};
|