@brutalist/mcp 0.6.14 → 0.6.16
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/brutalist-server.d.ts +2 -0
- package/dist/brutalist-server.d.ts.map +1 -1
- package/dist/brutalist-server.js +23 -22
- package/dist/brutalist-server.js.map +1 -1
- package/dist/cli-agents.d.ts.map +1 -1
- package/dist/cli-agents.js +4 -24
- package/dist/cli-agents.js.map +1 -1
- package/dist/domains/argument-space.d.ts +112 -0
- package/dist/domains/argument-space.d.ts.map +1 -0
- package/dist/domains/argument-space.js +178 -0
- package/dist/domains/argument-space.js.map +1 -0
- package/dist/domains/critic-persona.d.ts +77 -0
- package/dist/domains/critic-persona.d.ts.map +1 -0
- package/dist/domains/critic-persona.js +73 -0
- package/dist/domains/critic-persona.js.map +1 -0
- package/dist/domains/critique-domain.d.ts +33 -0
- package/dist/domains/critique-domain.d.ts.map +1 -0
- package/dist/domains/critique-domain.js +36 -0
- package/dist/domains/critique-domain.js.map +1 -0
- package/dist/domains/execution-strategy.d.ts +119 -0
- package/dist/domains/execution-strategy.d.ts.map +1 -0
- package/dist/domains/execution-strategy.js +95 -0
- package/dist/domains/execution-strategy.js.map +1 -0
- package/dist/generators/tool-generator.d.ts +33 -0
- package/dist/generators/tool-generator.d.ts.map +1 -0
- package/dist/generators/tool-generator.js +136 -0
- package/dist/generators/tool-generator.js.map +1 -0
- package/dist/registry/argument-spaces.d.ts +19 -0
- package/dist/registry/argument-spaces.d.ts.map +1 -0
- package/dist/registry/argument-spaces.js +132 -0
- package/dist/registry/argument-spaces.js.map +1 -0
- package/dist/registry/domains.d.ts +24 -0
- package/dist/registry/domains.d.ts.map +1 -0
- package/dist/registry/domains.js +129 -0
- package/dist/registry/domains.js.map +1 -0
- package/dist/registry/personas.d.ts +20 -0
- package/dist/registry/personas.d.ts.map +1 -0
- package/dist/registry/personas.js +75 -0
- package/dist/registry/personas.js.map +1 -0
- package/dist/streaming/intelligent-buffer.d.ts.map +1 -1
- package/dist/streaming/intelligent-buffer.js +3 -1
- package/dist/streaming/intelligent-buffer.js.map +1 -1
- package/dist/streaming/session-manager.d.ts.map +1 -1
- package/dist/streaming/session-manager.js +4 -2
- package/dist/streaming/session-manager.js.map +1 -1
- package/dist/streaming/sse-transport.d.ts.map +1 -1
- package/dist/streaming/sse-transport.js +2 -0
- package/dist/streaming/sse-transport.js.map +1 -1
- package/dist/streaming/streaming-orchestrator.d.ts.map +1 -1
- package/dist/streaming/streaming-orchestrator.js +3 -1
- package/dist/streaming/streaming-orchestrator.js.map +1 -1
- package/dist/tool-definitions-generated.d.ts +39 -0
- package/dist/tool-definitions-generated.d.ts.map +1 -0
- package/dist/tool-definitions-generated.js +107 -0
- package/dist/tool-definitions-generated.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: ArgumentSpace
|
|
3
|
+
*
|
|
4
|
+
* Defines the parameter schema for a tool - what arguments it accepts.
|
|
5
|
+
* Argument spaces are composable and reusable across tools.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export interface ArgumentSpace {
|
|
9
|
+
/** Unique identifier */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Human-readable name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Base arguments that all tools share */
|
|
14
|
+
base: z.ZodObject<any>;
|
|
15
|
+
/** Domain-specific arguments */
|
|
16
|
+
domain: z.ZodObject<any>;
|
|
17
|
+
/** Optional: compute additional arguments from user input */
|
|
18
|
+
computed?: (args: any) => Record<string, any>;
|
|
19
|
+
/** Optional: validate arguments beyond schema */
|
|
20
|
+
validate?: (args: any) => {
|
|
21
|
+
valid: boolean;
|
|
22
|
+
errors?: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Standard base arguments shared by all tools
|
|
27
|
+
*/
|
|
28
|
+
export declare const BASE_ARGUMENTS: z.ZodObject<{
|
|
29
|
+
context: z.ZodOptional<z.ZodString>;
|
|
30
|
+
models: z.ZodOptional<z.ZodObject<{
|
|
31
|
+
claude: z.ZodOptional<z.ZodString>;
|
|
32
|
+
codex: z.ZodOptional<z.ZodString>;
|
|
33
|
+
gemini: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
claude?: string | undefined;
|
|
36
|
+
codex?: string | undefined;
|
|
37
|
+
gemini?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
claude?: string | undefined;
|
|
40
|
+
codex?: string | undefined;
|
|
41
|
+
gemini?: string | undefined;
|
|
42
|
+
}>>;
|
|
43
|
+
preferredCLI: z.ZodOptional<z.ZodEnum<["claude", "codex", "gemini"]>>;
|
|
44
|
+
force_refresh: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
offset: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
48
|
+
verbose: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
context?: string | undefined;
|
|
51
|
+
models?: {
|
|
52
|
+
claude?: string | undefined;
|
|
53
|
+
codex?: string | undefined;
|
|
54
|
+
gemini?: string | undefined;
|
|
55
|
+
} | undefined;
|
|
56
|
+
preferredCLI?: "claude" | "codex" | "gemini" | undefined;
|
|
57
|
+
force_refresh?: boolean | undefined;
|
|
58
|
+
limit?: number | undefined;
|
|
59
|
+
offset?: number | undefined;
|
|
60
|
+
cursor?: string | undefined;
|
|
61
|
+
verbose?: boolean | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
context?: string | undefined;
|
|
64
|
+
models?: {
|
|
65
|
+
claude?: string | undefined;
|
|
66
|
+
codex?: string | undefined;
|
|
67
|
+
gemini?: string | undefined;
|
|
68
|
+
} | undefined;
|
|
69
|
+
preferredCLI?: "claude" | "codex" | "gemini" | undefined;
|
|
70
|
+
force_refresh?: boolean | undefined;
|
|
71
|
+
limit?: number | undefined;
|
|
72
|
+
offset?: number | undefined;
|
|
73
|
+
cursor?: string | undefined;
|
|
74
|
+
verbose?: boolean | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Common argument space: Filesystem-based analysis
|
|
78
|
+
*/
|
|
79
|
+
export declare const FILESYSTEM_ARGUMENT_SPACE: ArgumentSpace;
|
|
80
|
+
/**
|
|
81
|
+
* Common argument space: Text-based input
|
|
82
|
+
*/
|
|
83
|
+
export declare const TEXT_INPUT_ARGUMENT_SPACE: ArgumentSpace;
|
|
84
|
+
/**
|
|
85
|
+
* Argument space: Filesystem with depth control
|
|
86
|
+
*/
|
|
87
|
+
export declare const FILESYSTEM_WITH_DEPTH: ArgumentSpace;
|
|
88
|
+
/**
|
|
89
|
+
* Argument space: Package manifest analysis
|
|
90
|
+
*/
|
|
91
|
+
export declare const PACKAGE_MANIFEST_SPACE: ArgumentSpace;
|
|
92
|
+
/**
|
|
93
|
+
* Argument space: Git repository analysis
|
|
94
|
+
*/
|
|
95
|
+
export declare const GIT_REPOSITORY_SPACE: ArgumentSpace;
|
|
96
|
+
/**
|
|
97
|
+
* Argument space: Test suite analysis
|
|
98
|
+
*/
|
|
99
|
+
export declare const TEST_SUITE_SPACE: ArgumentSpace;
|
|
100
|
+
/**
|
|
101
|
+
* Helper to merge multiple argument spaces
|
|
102
|
+
*/
|
|
103
|
+
export declare function mergeArgumentSpaces(...spaces: ArgumentSpace[]): ArgumentSpace;
|
|
104
|
+
/**
|
|
105
|
+
* Helper to infer cache key fields from an argument space
|
|
106
|
+
*/
|
|
107
|
+
export declare function inferCacheKeys(space: ArgumentSpace): string[];
|
|
108
|
+
/**
|
|
109
|
+
* Helper to infer the primary argument field
|
|
110
|
+
*/
|
|
111
|
+
export declare function inferPrimaryArg(space: ArgumentSpace): string;
|
|
112
|
+
//# sourceMappingURL=argument-space.d.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aAAa,EAAE,GAAG,aAAa,CAyB7E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAY7D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAc5D"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: ArgumentSpace
|
|
3
|
+
*
|
|
4
|
+
* Defines the parameter schema for a tool - what arguments it accepts.
|
|
5
|
+
* Argument spaces are composable and reusable across tools.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
/**
|
|
9
|
+
* Standard base arguments shared by all tools
|
|
10
|
+
*/
|
|
11
|
+
export const BASE_ARGUMENTS = z.object({
|
|
12
|
+
context: z.string().optional().describe("Additional context for the analysis"),
|
|
13
|
+
models: z.object({
|
|
14
|
+
claude: z.string().optional(),
|
|
15
|
+
codex: z.string().optional(),
|
|
16
|
+
gemini: z.string().optional()
|
|
17
|
+
}).optional().describe("Specific models to use for each CLI agent"),
|
|
18
|
+
preferredCLI: z.enum(['claude', 'codex', 'gemini']).optional()
|
|
19
|
+
.describe("Preferred CLI agent to use (default: use all available CLIs)"),
|
|
20
|
+
force_refresh: z.boolean().optional()
|
|
21
|
+
.describe("Force re-analysis even if cached result exists (default: false)"),
|
|
22
|
+
limit: z.number().min(1000).max(100000).optional()
|
|
23
|
+
.describe("Maximum characters per response chunk (default: 90000, max: 100000)"),
|
|
24
|
+
offset: z.number().min(0).optional()
|
|
25
|
+
.describe("Character offset for response pagination (default: 0)"),
|
|
26
|
+
cursor: z.string().optional()
|
|
27
|
+
.describe("Pagination cursor from previous response"),
|
|
28
|
+
verbose: z.boolean().optional()
|
|
29
|
+
.describe("Include detailed execution information in output (default: false)")
|
|
30
|
+
});
|
|
31
|
+
/**
|
|
32
|
+
* Common argument space: Filesystem-based analysis
|
|
33
|
+
*/
|
|
34
|
+
export const FILESYSTEM_ARGUMENT_SPACE = {
|
|
35
|
+
id: 'filesystem',
|
|
36
|
+
name: 'Filesystem Analysis',
|
|
37
|
+
base: BASE_ARGUMENTS,
|
|
38
|
+
domain: z.object({
|
|
39
|
+
targetPath: z.string().describe("Directory or file path to analyze")
|
|
40
|
+
}),
|
|
41
|
+
computed: (args) => ({
|
|
42
|
+
workingDirectory: args.targetPath
|
|
43
|
+
})
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Common argument space: Text-based input
|
|
47
|
+
*/
|
|
48
|
+
export const TEXT_INPUT_ARGUMENT_SPACE = {
|
|
49
|
+
id: 'text_input',
|
|
50
|
+
name: 'Text Input',
|
|
51
|
+
base: BASE_ARGUMENTS,
|
|
52
|
+
domain: z.object({
|
|
53
|
+
content: z.string().describe("Text content to analyze"),
|
|
54
|
+
targetPath: z.string().describe("Working directory context (can be '.' for current directory)")
|
|
55
|
+
}),
|
|
56
|
+
computed: (args) => ({
|
|
57
|
+
workingDirectory: args.targetPath || '.'
|
|
58
|
+
})
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Argument space: Filesystem with depth control
|
|
62
|
+
*/
|
|
63
|
+
export const FILESYSTEM_WITH_DEPTH = {
|
|
64
|
+
id: 'filesystem_depth',
|
|
65
|
+
name: 'Filesystem with Depth Control',
|
|
66
|
+
base: BASE_ARGUMENTS,
|
|
67
|
+
domain: z.object({
|
|
68
|
+
targetPath: z.string().describe("Directory path to analyze"),
|
|
69
|
+
depth: z.number().optional().describe("Maximum directory depth to analyze (default: 3)")
|
|
70
|
+
}),
|
|
71
|
+
computed: (args) => ({
|
|
72
|
+
workingDirectory: args.targetPath,
|
|
73
|
+
analysisDepth: args.depth || 3
|
|
74
|
+
})
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Argument space: Package manifest analysis
|
|
78
|
+
*/
|
|
79
|
+
export const PACKAGE_MANIFEST_SPACE = {
|
|
80
|
+
id: 'package_manifest',
|
|
81
|
+
name: 'Package Manifest',
|
|
82
|
+
base: BASE_ARGUMENTS,
|
|
83
|
+
domain: z.object({
|
|
84
|
+
targetPath: z.string().describe("Path to package file (package.json, requirements.txt, Cargo.toml, etc.)"),
|
|
85
|
+
includeDevDeps: z.boolean().optional().describe("Include development dependencies in analysis (default: true)")
|
|
86
|
+
}),
|
|
87
|
+
computed: (args) => ({
|
|
88
|
+
workingDirectory: require('path').dirname(args.targetPath),
|
|
89
|
+
analyzeDevDependencies: args.includeDevDeps !== false
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Argument space: Git repository analysis
|
|
94
|
+
*/
|
|
95
|
+
export const GIT_REPOSITORY_SPACE = {
|
|
96
|
+
id: 'git_repository',
|
|
97
|
+
name: 'Git Repository',
|
|
98
|
+
base: BASE_ARGUMENTS,
|
|
99
|
+
domain: z.object({
|
|
100
|
+
targetPath: z.string().describe("Git repository path to analyze"),
|
|
101
|
+
commitRange: z.string().optional().describe("Commit range to analyze (e.g., 'HEAD~10..HEAD', default: last 20 commits)")
|
|
102
|
+
}),
|
|
103
|
+
computed: (args) => ({
|
|
104
|
+
workingDirectory: args.targetPath,
|
|
105
|
+
gitRange: args.commitRange || 'HEAD~20..HEAD'
|
|
106
|
+
})
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Argument space: Test suite analysis
|
|
110
|
+
*/
|
|
111
|
+
export const TEST_SUITE_SPACE = {
|
|
112
|
+
id: 'test_suite',
|
|
113
|
+
name: 'Test Suite',
|
|
114
|
+
base: BASE_ARGUMENTS,
|
|
115
|
+
domain: z.object({
|
|
116
|
+
targetPath: z.string().describe("Path to test directory or test configuration file"),
|
|
117
|
+
runCoverage: z.boolean().optional().describe("Attempt to run coverage analysis (default: true)")
|
|
118
|
+
}),
|
|
119
|
+
computed: (args) => ({
|
|
120
|
+
workingDirectory: args.targetPath,
|
|
121
|
+
executeCoverage: args.runCoverage !== false
|
|
122
|
+
})
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Helper to merge multiple argument spaces
|
|
126
|
+
*/
|
|
127
|
+
export function mergeArgumentSpaces(...spaces) {
|
|
128
|
+
const merged = {
|
|
129
|
+
id: spaces.map(s => s.id).join('_'),
|
|
130
|
+
name: spaces.map(s => s.name).join(' + '),
|
|
131
|
+
base: BASE_ARGUMENTS,
|
|
132
|
+
domain: z.object({})
|
|
133
|
+
};
|
|
134
|
+
// Merge domain schemas
|
|
135
|
+
for (const space of spaces) {
|
|
136
|
+
merged.domain = merged.domain.merge(space.domain);
|
|
137
|
+
}
|
|
138
|
+
// Combine computed functions
|
|
139
|
+
merged.computed = (args) => {
|
|
140
|
+
let result = {};
|
|
141
|
+
for (const space of spaces) {
|
|
142
|
+
if (space.computed) {
|
|
143
|
+
result = { ...result, ...space.computed(args) };
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return result;
|
|
147
|
+
};
|
|
148
|
+
return merged;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Helper to infer cache key fields from an argument space
|
|
152
|
+
*/
|
|
153
|
+
export function inferCacheKeys(space) {
|
|
154
|
+
const keys = [];
|
|
155
|
+
// Always include these base fields if present
|
|
156
|
+
const baseKeys = ['context', 'models', 'preferredCLI'];
|
|
157
|
+
keys.push(...baseKeys);
|
|
158
|
+
// Add all domain-specific fields
|
|
159
|
+
const domainShape = space.domain.shape;
|
|
160
|
+
keys.push(...Object.keys(domainShape));
|
|
161
|
+
return keys;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Helper to infer the primary argument field
|
|
165
|
+
*/
|
|
166
|
+
export function inferPrimaryArg(space) {
|
|
167
|
+
const domainKeys = Object.keys(space.domain.shape);
|
|
168
|
+
// Prefer these field names in order
|
|
169
|
+
const preferred = ['targetPath', 'content', 'idea', 'system', 'architecture', 'research', 'product', 'infrastructure'];
|
|
170
|
+
for (const key of preferred) {
|
|
171
|
+
if (domainKeys.includes(key)) {
|
|
172
|
+
return key;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Fallback to first domain key
|
|
176
|
+
return domainKeys[0] || 'targetPath';
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=argument-space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argument-space.js","sourceRoot":"","sources":["../../src/domains/argument-space.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAsBxB;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;IAE9E,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IAEnE,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;SAC3D,QAAQ,CAAC,8DAA8D,CAAC;IAE3E,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;SAClC,QAAQ,CAAC,iEAAiE,CAAC;IAE9E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;SAC/C,QAAQ,CAAC,qEAAqE,CAAC;IAElF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAA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C;IAEvH,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAED,+BAA+B;IAC/B,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: CriticPersona
|
|
3
|
+
*
|
|
4
|
+
* Defines who the critic is - their tone, expertise, and prompt template.
|
|
5
|
+
* Personas are reusable across domains.
|
|
6
|
+
*/
|
|
7
|
+
import { CritiqueDomain } from './critique-domain.js';
|
|
8
|
+
export type CriticTone = 'brutal' | 'constructive' | 'balanced' | 'pedagogical';
|
|
9
|
+
export type ExpertiseLevel = 'junior' | 'mid' | 'senior' | 'principal' | 'architect';
|
|
10
|
+
export interface ModelPreferences {
|
|
11
|
+
claude?: string;
|
|
12
|
+
codex?: string;
|
|
13
|
+
gemini?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A template string with variable substitution
|
|
17
|
+
*/
|
|
18
|
+
export declare class PromptTemplate {
|
|
19
|
+
private template;
|
|
20
|
+
constructor(template: string);
|
|
21
|
+
/**
|
|
22
|
+
* Render the template with domain-specific variables
|
|
23
|
+
*/
|
|
24
|
+
render(domain: CritiqueDomain, additionalVars?: Record<string, any>): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the raw template string
|
|
27
|
+
*/
|
|
28
|
+
getRaw(): string;
|
|
29
|
+
}
|
|
30
|
+
export interface CriticPersona {
|
|
31
|
+
/** Unique identifier for this persona */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Human-readable name */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Which domain(s) this persona critiques */
|
|
36
|
+
domain?: CritiqueDomain;
|
|
37
|
+
/** The system prompt template */
|
|
38
|
+
promptTemplate: PromptTemplate;
|
|
39
|
+
/** Tone of the critique */
|
|
40
|
+
tone: CriticTone;
|
|
41
|
+
/** Level of expertise */
|
|
42
|
+
expertise: ExpertiseLevel;
|
|
43
|
+
/** Preferred models for this persona */
|
|
44
|
+
preferredModels?: ModelPreferences;
|
|
45
|
+
/** Additional persona characteristics */
|
|
46
|
+
characteristics?: {
|
|
47
|
+
background?: string;
|
|
48
|
+
specialization?: string;
|
|
49
|
+
years_experience?: number;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Helper to create a persona for a specific domain
|
|
54
|
+
*/
|
|
55
|
+
export declare function bindPersonaToDomain(persona: CriticPersona, domain: CritiqueDomain): CriticPersona;
|
|
56
|
+
/**
|
|
57
|
+
* Pre-built prompt templates for common personas
|
|
58
|
+
*/
|
|
59
|
+
export declare const PromptTemplates: {
|
|
60
|
+
/**
|
|
61
|
+
* Brutal critic - finds every flaw, no mercy
|
|
62
|
+
*/
|
|
63
|
+
BRUTAL: PromptTemplate;
|
|
64
|
+
/**
|
|
65
|
+
* Constructive critic - identifies issues but provides solutions
|
|
66
|
+
*/
|
|
67
|
+
CONSTRUCTIVE: PromptTemplate;
|
|
68
|
+
/**
|
|
69
|
+
* Balanced critic - objective analysis with pros and cons
|
|
70
|
+
*/
|
|
71
|
+
BALANCED: PromptTemplate;
|
|
72
|
+
/**
|
|
73
|
+
* Pedagogical critic - teaches through critique
|
|
74
|
+
*/
|
|
75
|
+
PEDAGOGICAL: PromptTemplate;
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=critic-persona.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critic-persona.d.ts","sourceRoot":"","sources":["../../src/domains/critic-persona.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,cAAc,GAAG,UAAU,GAAG,a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
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: CriticPersona
|
|
3
|
+
*
|
|
4
|
+
* Defines who the critic is - their tone, expertise, and prompt template.
|
|
5
|
+
* Personas are reusable across domains.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A template string with variable substitution
|
|
9
|
+
*/
|
|
10
|
+
export class PromptTemplate {
|
|
11
|
+
template;
|
|
12
|
+
constructor(template) {
|
|
13
|
+
this.template = template;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Render the template with domain-specific variables
|
|
17
|
+
*/
|
|
18
|
+
render(domain, additionalVars) {
|
|
19
|
+
let result = this.template;
|
|
20
|
+
// Domain variables
|
|
21
|
+
const vars = {
|
|
22
|
+
domain_name: domain.name,
|
|
23
|
+
domain_description: domain.description,
|
|
24
|
+
domain_id: domain.id,
|
|
25
|
+
capabilities: domain.capabilities.join(', '),
|
|
26
|
+
artifact_types: domain.artifactTypes.join(', '),
|
|
27
|
+
...additionalVars
|
|
28
|
+
};
|
|
29
|
+
// Simple variable substitution: ${var_name}
|
|
30
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
31
|
+
const regex = new RegExp(`\\$\\{${key}\\}`, 'g');
|
|
32
|
+
result = result.replace(regex, String(value));
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get the raw template string
|
|
38
|
+
*/
|
|
39
|
+
getRaw() {
|
|
40
|
+
return this.template;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Helper to create a persona for a specific domain
|
|
45
|
+
*/
|
|
46
|
+
export function bindPersonaToDomain(persona, domain) {
|
|
47
|
+
return {
|
|
48
|
+
...persona,
|
|
49
|
+
domain
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Pre-built prompt templates for common personas
|
|
54
|
+
*/
|
|
55
|
+
export const PromptTemplates = {
|
|
56
|
+
/**
|
|
57
|
+
* Brutal critic - finds every flaw, no mercy
|
|
58
|
+
*/
|
|
59
|
+
BRUTAL: new PromptTemplate('You are a battle-scarred $' + '{domain_name} expert who has seen every disaster in this field. IMPORTANT: You have READ-ONLY access. You can read and analyze but MUST NOT write, modify, delete, or execute anything.\n\nYour expertise: $' + '{capabilities}.\nWhat you analyze: $' + '{artifact_types}.\n\nFind every flaw, every anti-pattern, every disaster waiting to happen. Be ruthlessly honest about what will fail in production. After demolishing everything, grudgingly admit what tiny kernel might actually work.'),
|
|
60
|
+
/**
|
|
61
|
+
* Constructive critic - identifies issues but provides solutions
|
|
62
|
+
*/
|
|
63
|
+
CONSTRUCTIVE: new PromptTemplate('You are an experienced $' + '{domain_name} consultant. IMPORTANT: You have READ-ONLY access. You can read and analyze but MUST NOT write, modify, delete, or execute anything.\n\nYour capabilities: $' + '{capabilities}.\nWhat you review: $' + '{artifact_types}.\n\nIdentify problems and anti-patterns, but for each issue provide a specific, actionable solution. Balance criticism with practical guidance. Focus on what will actually improve the work.'),
|
|
64
|
+
/**
|
|
65
|
+
* Balanced critic - objective analysis with pros and cons
|
|
66
|
+
*/
|
|
67
|
+
BALANCED: new PromptTemplate('You are an objective $' + '{domain_name} analyst. IMPORTANT: You have READ-ONLY access. You can read and analyze but MUST NOT write, modify, delete, or execute anything.\n\nYour analysis covers: $' + '{capabilities}.\nArtifact types: $' + '{artifact_types}.\n\nProvide a balanced assessment. Identify both strengths and weaknesses. For each weakness, explain the risk and suggest improvements. Acknowledge what is done well while being honest about gaps.'),
|
|
68
|
+
/**
|
|
69
|
+
* Pedagogical critic - teaches through critique
|
|
70
|
+
*/
|
|
71
|
+
PEDAGOGICAL: new PromptTemplate('You are a $' + '{domain_name} mentor who teaches through code review. IMPORTANT: You have READ-ONLY access. You can read and analyze but MUST NOT write, modify, delete, or execute anything.\n\nTeaching focus: $' + '{capabilities}.\nReview materials: $' + '{artifact_types}.\n\nFor each issue you find, explain WHY it is problematic and WHAT pattern would be better. Use this as a teaching moment. Help the developer grow their understanding while identifying real problems.')
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=critic-persona.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critic-persona.js","sourceRoot":"","sources":["../../src/domains/critic-persona.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAcH;;GAEG;AACH,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,QAAgB;QAAhB,aAAQ,GAAR,QAAQ,CAAQ;IAAG,CAAC;IAExC;;OAEG;IACH,MAAM,CAAC,MAAsB,EAAE,cAAoC;QACjE,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC;QAE3B,mBAAmB;QACnB,MAAM,IAAI,GAAwB;YAChC,WAAW,EAAE,MAAM,CAAC,IAAI;YACxB,kBAAkB,EAAE,MAAM,CAAC,WAAW;YACtC,SAAS,EAAE,MAAM,CAAC,EAAE;YACpB,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5C,cAAc,EAAE,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;YAC/C,GAAG,cAAc;SAClB,CAAC;QAEF,4CAA4C;QAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,SAAS,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;YACjD,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AAgCD;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAAsB,EACtB,MAAsB;IAEtB,OAAO;QACL,GAAG,OAAO;QACV,MAAM;KACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,MAAM,EAAE,IAAI,cAAc,CACxB,4BAA4B,GAAG,8MAA8M,GAAG,sCAAsC,GAAG,2OAA2O,CACrgB;IAED;;OAEG;IACH,YAAY,EAAE,IAAI,cAAc,CAC9B,0BAA0B,GAAG,2KAA2K,GAAG,qCAAqC,GAAG,gNAAgN,CACpc;IAED;;OAEG;IACH,QAAQ,EAAE,IAAI,cAAc,CAC1B,wBAAwB,GAAG,2KAA2K,GAAG,oCAAoC,GAAG,wNAAwN,CACzc;IAED;;OAEG;IACH,WAAW,EAAE,IAAI,cAAc,CAC7B,aAAa,GAAG,oMAAoM,GAAG,sCAAsC,GAAG,2NAA2N,CAC5d;CACF,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: CritiqueDomain
|
|
3
|
+
*
|
|
4
|
+
* Defines a conceptual space where expert critics operate.
|
|
5
|
+
* Domains are composable - security + architecture = holistic review.
|
|
6
|
+
*/
|
|
7
|
+
export type ArtifactType = 'code' | 'architecture_diagram' | 'api_spec' | 'deployment_config' | 'test_suite' | 'documentation' | 'git_history' | 'package_manifest' | 'directory_structure' | 'text_description';
|
|
8
|
+
export type DomainCapability = 'static_analysis' | 'dynamic_analysis' | 'penetration_testing' | 'threat_modeling' | 'compliance_audit' | 'scalability_analysis' | 'cost_estimation' | 'usability_review' | 'performance_profiling' | 'security_scanning';
|
|
9
|
+
export interface CritiqueDomain {
|
|
10
|
+
/** Unique identifier for this domain */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Human-readable name */
|
|
13
|
+
name: string;
|
|
14
|
+
/** What this domain critiques */
|
|
15
|
+
description: string;
|
|
16
|
+
/** Domain-specific analysis capabilities */
|
|
17
|
+
capabilities: DomainCapability[];
|
|
18
|
+
/** What types of artifacts this domain can analyze */
|
|
19
|
+
artifactTypes: ArtifactType[];
|
|
20
|
+
/** Optional: This domain composes other domains */
|
|
21
|
+
subdomains?: CritiqueDomain[];
|
|
22
|
+
/** Optional: Domain-specific configuration */
|
|
23
|
+
config?: Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Helper to check if a domain can analyze a given artifact type
|
|
27
|
+
*/
|
|
28
|
+
export declare function canAnalyzeArtifact(domain: CritiqueDomain, artifactType: ArtifactType): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Helper to compose multiple domains into a composite domain
|
|
31
|
+
*/
|
|
32
|
+
export declare function composeDomains(domains: CritiqueDomain[], compositeId: string, compositeName: string): CritiqueDomain;
|
|
33
|
+
//# sourceMappingURL=critique-domain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critique-domain.d.ts","sourceRoot":"","sources":["../../src/domains/critique-domain.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,sBAAsB,GACtB,UAAU,GACV,mBAAmB,GACnB,YAAY,GACZ,eAAe,GACf,aAAa,GACb,kBAAkB,GAClB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,MAAM,MAAM,gBAAgB,GACxB,iBAAiB,GACjB,kBAAkB,GAClB,qBAAqB,GACrB,iBAAiB,GACjB,kBAAkB,GAClB,sBAAsB,GACtB,iBAAiB,GACjB,kBAAkB,GAClB,uBAAuB,GACvB,mBAAmB,CAAC;AAExB,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IAEX,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IAEpB,4CAA4C;IAC5C,YAAY,EAAE,gBAAgB,EAAE,CAAC;IAEjC,sDAAsD;IACtD,aAAa,EAAE,YAAY,EAAE,CAAC;IAE9B,mDAAmD;IACnD,UAAU,CAAC,EAAE,cAAc,EAAE,CAAC;IAE9B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,YAAY,GACzB,OAAO,CAET;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,cAAc,EAAE,EACzB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACpB,cAAc,CAqBhB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: CritiqueDomain
|
|
3
|
+
*
|
|
4
|
+
* Defines a conceptual space where expert critics operate.
|
|
5
|
+
* Domains are composable - security + architecture = holistic review.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Helper to check if a domain can analyze a given artifact type
|
|
9
|
+
*/
|
|
10
|
+
export function canAnalyzeArtifact(domain, artifactType) {
|
|
11
|
+
return domain.artifactTypes.includes(artifactType);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Helper to compose multiple domains into a composite domain
|
|
15
|
+
*/
|
|
16
|
+
export function composeDomains(domains, compositeId, compositeName) {
|
|
17
|
+
const allCapabilities = new Set();
|
|
18
|
+
const allArtifactTypes = new Set();
|
|
19
|
+
for (const domain of domains) {
|
|
20
|
+
domain.capabilities.forEach(cap => allCapabilities.add(cap));
|
|
21
|
+
domain.artifactTypes.forEach(type => allArtifactTypes.add(type));
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
id: compositeId,
|
|
25
|
+
name: compositeName,
|
|
26
|
+
description: `Composite critique combining: ${domains.map(d => d.name).join(', ')}`,
|
|
27
|
+
capabilities: Array.from(allCapabilities),
|
|
28
|
+
artifactTypes: Array.from(allArtifactTypes),
|
|
29
|
+
subdomains: domains,
|
|
30
|
+
config: {
|
|
31
|
+
composite: true,
|
|
32
|
+
componentDomains: domains.map(d => d.id)
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=critique-domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"critique-domain.js","sourceRoot":"","sources":["../../src/domains/critique-domain.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiDH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAsB,EACtB,YAA0B;IAE1B,OAAO,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAyB,EACzB,WAAmB,EACnB,aAAqB;IAErB,MAAM,eAAe,GAAG,IAAI,GAAG,EAAoB,CAAC;IACpD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAgB,CAAC;IAEjD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO;QACL,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,iCAAiC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QACnF,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;QACzC,aAAa,EAAE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAC3C,UAAU,EAAE,OAAO;QACnB,MAAM,EAAE;YACN,SAAS,EAAE,IAAI;YACf,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core abstraction: ExecutionStrategy
|
|
3
|
+
*
|
|
4
|
+
* Defines how critique agents are orchestrated and how their results are synthesized.
|
|
5
|
+
*/
|
|
6
|
+
export type AgentCount = 1 | 3 | 'all';
|
|
7
|
+
export type ExecutionMode = 'parallel' | 'debate' | 'sequential' | 'tournament' | 'consensus';
|
|
8
|
+
export type SynthesisEngine = 'multi_perspective' | 'consensus_extraction' | 'best_of_breed' | 'voting' | 'concatenate';
|
|
9
|
+
export interface ExecutionLimits {
|
|
10
|
+
/** Maximum execution time per agent (ms) */
|
|
11
|
+
timeoutPerAgent: number;
|
|
12
|
+
/** Maximum total execution time (ms) */
|
|
13
|
+
maxTotalTime: number;
|
|
14
|
+
/** Maximum memory per agent (MB) */
|
|
15
|
+
maxMemoryMB?: number;
|
|
16
|
+
/** Maximum output size (characters) */
|
|
17
|
+
maxOutputSize?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ExecutionStrategy {
|
|
20
|
+
/** Unique identifier */
|
|
21
|
+
id: string;
|
|
22
|
+
/** Human-readable name */
|
|
23
|
+
name: string;
|
|
24
|
+
/** How many agents to run */
|
|
25
|
+
agentCount: AgentCount;
|
|
26
|
+
/** How agents interact */
|
|
27
|
+
mode: ExecutionMode;
|
|
28
|
+
/** How to synthesize results */
|
|
29
|
+
synthesis: SynthesisEngine;
|
|
30
|
+
/** Resource limits */
|
|
31
|
+
limits: ExecutionLimits;
|
|
32
|
+
/** Optional: custom synthesis function */
|
|
33
|
+
customSynthesis?: (results: any[]) => string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Default execution limits
|
|
37
|
+
*/
|
|
38
|
+
export declare const DEFAULT_LIMITS: ExecutionLimits;
|
|
39
|
+
/**
|
|
40
|
+
* Pre-built execution strategies
|
|
41
|
+
*/
|
|
42
|
+
export declare const ExecutionStrategies: {
|
|
43
|
+
/**
|
|
44
|
+
* Standard: Run all available agents in parallel, show all perspectives
|
|
45
|
+
*/
|
|
46
|
+
PARALLEL_CRITIQUE: {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
agentCount: AgentCount;
|
|
50
|
+
mode: ExecutionMode;
|
|
51
|
+
synthesis: SynthesisEngine;
|
|
52
|
+
limits: ExecutionLimits;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Single agent: Fast, focused analysis from one perspective
|
|
56
|
+
*/
|
|
57
|
+
SINGLE_AGENT: {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
agentCount: AgentCount;
|
|
61
|
+
mode: ExecutionMode;
|
|
62
|
+
synthesis: SynthesisEngine;
|
|
63
|
+
limits: {
|
|
64
|
+
maxTotalTime: number;
|
|
65
|
+
/** Maximum execution time per agent (ms) */
|
|
66
|
+
timeoutPerAgent: number;
|
|
67
|
+
/** Maximum memory per agent (MB) */
|
|
68
|
+
maxMemoryMB?: number;
|
|
69
|
+
/** Maximum output size (characters) */
|
|
70
|
+
maxOutputSize?: number;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Adversarial debate: Agents challenge each other
|
|
75
|
+
*/
|
|
76
|
+
ADVERSARIAL_DEBATE: {
|
|
77
|
+
id: string;
|
|
78
|
+
name: string;
|
|
79
|
+
agentCount: AgentCount;
|
|
80
|
+
mode: ExecutionMode;
|
|
81
|
+
synthesis: SynthesisEngine;
|
|
82
|
+
limits: {
|
|
83
|
+
maxTotalTime: number;
|
|
84
|
+
/** Maximum execution time per agent (ms) */
|
|
85
|
+
timeoutPerAgent: number;
|
|
86
|
+
/** Maximum memory per agent (MB) */
|
|
87
|
+
maxMemoryMB?: number;
|
|
88
|
+
/** Maximum output size (characters) */
|
|
89
|
+
maxOutputSize?: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Tournament: Agents compete, best wins
|
|
94
|
+
*/
|
|
95
|
+
TOURNAMENT: {
|
|
96
|
+
id: string;
|
|
97
|
+
name: string;
|
|
98
|
+
agentCount: AgentCount;
|
|
99
|
+
mode: ExecutionMode;
|
|
100
|
+
synthesis: SynthesisEngine;
|
|
101
|
+
limits: ExecutionLimits;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Sequential: One agent at a time, each builds on previous
|
|
105
|
+
*/
|
|
106
|
+
SEQUENTIAL_BUILD: {
|
|
107
|
+
id: string;
|
|
108
|
+
name: string;
|
|
109
|
+
agentCount: AgentCount;
|
|
110
|
+
mode: ExecutionMode;
|
|
111
|
+
synthesis: SynthesisEngine;
|
|
112
|
+
limits: ExecutionLimits;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Helper to create a custom execution strategy
|
|
117
|
+
*/
|
|
118
|
+
export declare function createExecutionStrategy(id: string, name: string, config: Partial<ExecutionStrategy>): ExecutionStrategy;
|
|
119
|
+
//# sourceMappingURL=execution-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-strategy.d.ts","sourceRoot":"","sources":["../../src/domains/execution-strategy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAEvC,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,WAAW,CAAC;AAEhB,MAAM,MAAM,eAAe,GACvB,mBAAmB,GACnB,sBAAsB,GACtB,eAAe,GACf,QAAQ,GACR,aAAa,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,eAAe,EAAE,MAAM,CAAC;IAExB,wCAAwC;IACxC,YAAY,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