@soleri/forge 5.1.3 → 5.4.0

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.
Files changed (77) hide show
  1. package/dist/index.js +0 -0
  2. package/dist/scaffolder.js +150 -2
  3. package/dist/scaffolder.js.map +1 -1
  4. package/dist/templates/brain.d.ts +6 -0
  5. package/dist/templates/brain.js +478 -0
  6. package/dist/templates/brain.js.map +1 -0
  7. package/dist/templates/claude-md-template.js +90 -1
  8. package/dist/templates/claude-md-template.js.map +1 -1
  9. package/dist/templates/core-facade.d.ts +6 -0
  10. package/dist/templates/core-facade.js +564 -0
  11. package/dist/templates/core-facade.js.map +1 -0
  12. package/dist/templates/domain-facade.d.ts +4 -0
  13. package/dist/templates/domain-facade.js +4 -0
  14. package/dist/templates/domain-facade.js.map +1 -1
  15. package/dist/templates/entry-point.js +32 -0
  16. package/dist/templates/entry-point.js.map +1 -1
  17. package/dist/templates/facade-factory.d.ts +1 -0
  18. package/dist/templates/facade-factory.js +63 -0
  19. package/dist/templates/facade-factory.js.map +1 -0
  20. package/dist/templates/facade-types.d.ts +1 -0
  21. package/dist/templates/facade-types.js +46 -0
  22. package/dist/templates/facade-types.js.map +1 -0
  23. package/dist/templates/intelligence-loader.d.ts +1 -0
  24. package/dist/templates/intelligence-loader.js +43 -0
  25. package/dist/templates/intelligence-loader.js.map +1 -0
  26. package/dist/templates/intelligence-types.d.ts +1 -0
  27. package/dist/templates/intelligence-types.js +24 -0
  28. package/dist/templates/intelligence-types.js.map +1 -0
  29. package/dist/templates/llm-client.d.ts +7 -0
  30. package/dist/templates/llm-client.js +300 -0
  31. package/dist/templates/llm-client.js.map +1 -0
  32. package/dist/templates/llm-key-pool.d.ts +7 -0
  33. package/dist/templates/llm-key-pool.js +211 -0
  34. package/dist/templates/llm-key-pool.js.map +1 -0
  35. package/dist/templates/llm-types.d.ts +5 -0
  36. package/dist/templates/llm-types.js +161 -0
  37. package/dist/templates/llm-types.js.map +1 -0
  38. package/dist/templates/llm-utils.d.ts +5 -0
  39. package/dist/templates/llm-utils.js +260 -0
  40. package/dist/templates/llm-utils.js.map +1 -0
  41. package/dist/templates/planner.d.ts +5 -0
  42. package/dist/templates/planner.js +150 -0
  43. package/dist/templates/planner.js.map +1 -0
  44. package/dist/templates/setup-script.js +26 -1
  45. package/dist/templates/setup-script.js.map +1 -1
  46. package/dist/templates/test-brain.d.ts +6 -0
  47. package/dist/templates/test-brain.js +474 -0
  48. package/dist/templates/test-brain.js.map +1 -0
  49. package/dist/templates/test-facades.js +173 -3
  50. package/dist/templates/test-facades.js.map +1 -1
  51. package/dist/templates/test-llm.d.ts +7 -0
  52. package/dist/templates/test-llm.js +574 -0
  53. package/dist/templates/test-llm.js.map +1 -0
  54. package/dist/templates/test-loader.d.ts +5 -0
  55. package/dist/templates/test-loader.js +146 -0
  56. package/dist/templates/test-loader.js.map +1 -0
  57. package/dist/templates/test-planner.d.ts +5 -0
  58. package/dist/templates/test-planner.js +271 -0
  59. package/dist/templates/test-planner.js.map +1 -0
  60. package/dist/templates/test-vault.d.ts +5 -0
  61. package/dist/templates/test-vault.js +380 -0
  62. package/dist/templates/test-vault.js.map +1 -0
  63. package/dist/templates/vault.d.ts +5 -0
  64. package/dist/templates/vault.js +263 -0
  65. package/dist/templates/vault.js.map +1 -0
  66. package/dist/types.d.ts +4 -0
  67. package/dist/types.js +2 -0
  68. package/dist/types.js.map +1 -1
  69. package/package.json +1 -1
  70. package/src/__tests__/scaffolder.test.ts +2 -2
  71. package/src/scaffolder.ts +153 -2
  72. package/src/templates/claude-md-template.ts +181 -0
  73. package/src/templates/domain-facade.ts +4 -0
  74. package/src/templates/entry-point.ts +32 -0
  75. package/src/templates/setup-script.ts +28 -1
  76. package/src/templates/test-facades.ts +173 -3
  77. package/src/types.ts +2 -0
@@ -0,0 +1,63 @@
1
+ export function generateFacadeFactory() {
2
+ return `import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+ import { z } from 'zod';
4
+ import type { FacadeConfig, FacadeResponse } from './types.js';
5
+
6
+ export function registerFacade(server: McpServer, facade: FacadeConfig): void {
7
+ const opNames = facade.ops.map((o) => o.name);
8
+
9
+ server.tool(
10
+ facade.name,
11
+ \`\${facade.description}\\n\\nOperations: \${opNames.join(', ')}\`,
12
+ {
13
+ op: z.string().describe(\`Operation: \${opNames.join(' | ')}\`),
14
+ params: z.record(z.unknown()).optional().default({}).describe('Operation parameters'),
15
+ },
16
+ async ({ op, params }): Promise<{ content: Array<{ type: 'text'; text: string }> }> => {
17
+ const response = await dispatchOp(facade, op, params);
18
+ return { content: [{ type: 'text' as const, text: JSON.stringify(response, null, 2) }] };
19
+ },
20
+ );
21
+ }
22
+
23
+ async function dispatchOp(
24
+ facade: FacadeConfig,
25
+ opName: string,
26
+ params: Record<string, unknown>,
27
+ ): Promise<FacadeResponse> {
28
+ const op = facade.ops.find((o) => o.name === opName);
29
+ if (!op) {
30
+ return {
31
+ success: false,
32
+ error: \`Unknown operation "\${opName}" on \${facade.name}. Available: \${facade.ops.map((o) => o.name).join(', ')}\`,
33
+ op: opName,
34
+ facade: facade.name,
35
+ };
36
+ }
37
+
38
+ try {
39
+ let validatedParams = params;
40
+ if (op.schema) {
41
+ const result = op.schema.safeParse(params);
42
+ if (!result.success) {
43
+ return { success: false, error: \`Invalid params for \${opName}: \${result.error.message}\`, op: opName, facade: facade.name };
44
+ }
45
+ validatedParams = result.data as Record<string, unknown>;
46
+ }
47
+
48
+ const data = await op.handler(validatedParams);
49
+ return { success: true, data, op: opName, facade: facade.name };
50
+ } catch (err) {
51
+ const message = err instanceof Error ? err.message : String(err);
52
+ return { success: false, error: message, op: opName, facade: facade.name };
53
+ }
54
+ }
55
+
56
+ export function registerAllFacades(server: McpServer, facades: FacadeConfig[]): void {
57
+ for (const facade of facades) {
58
+ registerFacade(server, facade);
59
+ }
60
+ }
61
+ `;
62
+ }
63
+ //# sourceMappingURL=facade-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facade-factory.js","sourceRoot":"","sources":["../../src/templates/facade-factory.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,qBAAqB;IACnC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DR,CAAC;AACF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function generateFacadeTypes(): string;
@@ -0,0 +1,46 @@
1
+ export function generateFacadeTypes() {
2
+ return `import { z } from 'zod';
3
+
4
+ /** Handler function for a single facade operation */
5
+ export type OpHandler = (params: Record<string, unknown>) => Promise<unknown>;
6
+
7
+ /** Auth level required for an operation */
8
+ export type AuthLevel = 'read' | 'write' | 'admin';
9
+
10
+ /** Operation definition within a facade */
11
+ export interface OpDefinition {
12
+ name: string;
13
+ description: string;
14
+ auth: AuthLevel;
15
+ handler: OpHandler;
16
+ schema?: z.ZodType;
17
+ }
18
+
19
+ /** Facade configuration — one MCP tool */
20
+ export interface FacadeConfig {
21
+ /** MCP tool name */
22
+ name: string;
23
+ /** Human-readable description */
24
+ description: string;
25
+ /** Domain operations */
26
+ ops: OpDefinition[];
27
+ }
28
+
29
+ /** Standard facade response envelope */
30
+ export interface FacadeResponse {
31
+ success: boolean;
32
+ data?: unknown;
33
+ error?: string;
34
+ op?: string;
35
+ facade?: string;
36
+ }
37
+
38
+ export const facadeInputSchema = z.object({
39
+ op: z.string().describe('Operation name'),
40
+ params: z.record(z.unknown()).optional().default({}),
41
+ });
42
+
43
+ export type FacadeInput = z.infer<typeof facadeInputSchema>;
44
+ `;
45
+ }
46
+ //# sourceMappingURL=facade-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facade-types.js","sourceRoot":"","sources":["../../src/templates/facade-types.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,mBAAmB;IACjC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CR,CAAC;AACF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function generateIntelligenceLoader(): string;
@@ -0,0 +1,43 @@
1
+ export function generateIntelligenceLoader() {
2
+ return `import { readFileSync, readdirSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import type { IntelligenceBundle, IntelligenceEntry } from './types.js';
5
+
6
+ export function loadIntelligenceData(dataDir: string): IntelligenceEntry[] {
7
+ const entries: IntelligenceEntry[] = [];
8
+ let files: string[];
9
+ try {
10
+ files = readdirSync(dataDir).filter((f) => f.endsWith('.json'));
11
+ } catch {
12
+ console.warn('Intelligence data directory not found: ' + dataDir);
13
+ return entries;
14
+ }
15
+
16
+ for (const file of files) {
17
+ try {
18
+ const raw = readFileSync(join(dataDir, file), 'utf-8');
19
+ const bundle = JSON.parse(raw) as IntelligenceBundle;
20
+ if (!bundle.entries || !Array.isArray(bundle.entries)) continue;
21
+ for (const entry of bundle.entries) {
22
+ if (validateEntry(entry)) entries.push(entry);
23
+ }
24
+ } catch (err) {
25
+ console.warn('Failed to load ' + file + ': ' + (err instanceof Error ? err.message : err));
26
+ }
27
+ }
28
+ return entries;
29
+ }
30
+
31
+ function validateEntry(entry: IntelligenceEntry): boolean {
32
+ return (
33
+ typeof entry.id === 'string' && entry.id.length > 0 &&
34
+ ['pattern', 'anti-pattern', 'rule'].includes(entry.type) &&
35
+ typeof entry.title === 'string' && entry.title.length > 0 &&
36
+ typeof entry.description === 'string' && entry.description.length > 0 &&
37
+ ['critical', 'warning', 'suggestion'].includes(entry.severity) &&
38
+ Array.isArray(entry.tags)
39
+ );
40
+ }
41
+ `;
42
+ }
43
+ //# sourceMappingURL=intelligence-loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intelligence-loader.js","sourceRoot":"","sources":["../../src/templates/intelligence-loader.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,0BAA0B;IACxC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCR,CAAC;AACF,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function generateIntelligenceTypes(): string;
@@ -0,0 +1,24 @@
1
+ export function generateIntelligenceTypes() {
2
+ return `export interface IntelligenceEntry {
3
+ id: string;
4
+ type: 'pattern' | 'anti-pattern' | 'rule';
5
+ domain: string;
6
+ title: string;
7
+ severity: 'critical' | 'warning' | 'suggestion';
8
+ description: string;
9
+ context?: string;
10
+ example?: string;
11
+ counterExample?: string;
12
+ why?: string;
13
+ tags: string[];
14
+ appliesTo?: string[];
15
+ }
16
+
17
+ export interface IntelligenceBundle {
18
+ domain: string;
19
+ version: string;
20
+ entries: IntelligenceEntry[];
21
+ }
22
+ `;
23
+ }
24
+ //# sourceMappingURL=intelligence-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intelligence-types.js","sourceRoot":"","sources":["../../src/templates/intelligence-types.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,yBAAyB;IACvC,OAAO;;;;;;;;;;;;;;;;;;;;CAoBR,CAAC;AACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from '../types.js';
2
+ /**
3
+ * Generate the LLM client file for a new agent.
4
+ * Contains LLMClient (OpenAI fetch + Anthropic SDK) and ModelRouter (inlined).
5
+ * Uses config.id to resolve ~/.{agentId}/model-routing.json.
6
+ */
7
+ export declare function generateLLMClient(config: AgentConfig): string;
@@ -0,0 +1,300 @@
1
+ /**
2
+ * Generate the LLM client file for a new agent.
3
+ * Contains LLMClient (OpenAI fetch + Anthropic SDK) and ModelRouter (inlined).
4
+ * Uses config.id to resolve ~/.{agentId}/model-routing.json.
5
+ */
6
+ export function generateLLMClient(config) {
7
+ return `/**
8
+ * LLM Client — Unified OpenAI/Anthropic caller with key pool rotation
9
+ * Generated by Soleri — do not edit manually.
10
+ */
11
+
12
+ import Anthropic from '@anthropic-ai/sdk';
13
+ import { SecretString, LLMError, CircuitBreaker, retry, parseRateLimitHeaders } from '@soleri/core';
14
+ import type {
15
+ LLMCallOptions,
16
+ LLMCallResult,
17
+ RouteEntry,
18
+ RoutingConfig,
19
+ KeyPool,
20
+ } from '@soleri/core';
21
+ import * as fs from 'node:fs';
22
+ import * as path from 'node:path';
23
+ import { homedir } from 'node:os';
24
+
25
+ // =============================================================================
26
+ // CONSTANTS
27
+ // =============================================================================
28
+
29
+ const OPENAI_API_URL = 'https://api.openai.com/v1/chat/completions';
30
+
31
+ // =============================================================================
32
+ // MODEL ROUTER (inlined)
33
+ // =============================================================================
34
+
35
+ function loadRoutingConfig(): RoutingConfig {
36
+ const defaultConfig: RoutingConfig = {
37
+ routes: [],
38
+ defaultOpenAIModel: 'gpt-4o-mini',
39
+ defaultAnthropicModel: 'claude-sonnet-4-20250514',
40
+ };
41
+
42
+ const configPath = path.join(
43
+ homedir(),
44
+ '.${config.id}',
45
+ 'model-routing.json',
46
+ );
47
+
48
+ try {
49
+ if (fs.existsSync(configPath)) {
50
+ const data = JSON.parse(fs.readFileSync(configPath, 'utf-8')) as Partial<RoutingConfig>;
51
+ if (data.routes && Array.isArray(data.routes)) {
52
+ defaultConfig.routes = data.routes;
53
+ }
54
+ if (data.defaultOpenAIModel) {
55
+ defaultConfig.defaultOpenAIModel = data.defaultOpenAIModel;
56
+ }
57
+ if (data.defaultAnthropicModel) {
58
+ defaultConfig.defaultAnthropicModel = data.defaultAnthropicModel;
59
+ }
60
+ }
61
+ } catch {
62
+ // Config not available — use defaults
63
+ }
64
+
65
+ return defaultConfig;
66
+ }
67
+
68
+ function inferProvider(model: string): 'openai' | 'anthropic' {
69
+ if (model.startsWith('claude-') || model.startsWith('anthropic/')) {
70
+ return 'anthropic';
71
+ }
72
+ return 'openai';
73
+ }
74
+
75
+ class ModelRouter {
76
+ private config: RoutingConfig;
77
+
78
+ constructor(config?: RoutingConfig) {
79
+ this.config = config || loadRoutingConfig();
80
+ }
81
+
82
+ resolve(
83
+ caller: string,
84
+ task?: string,
85
+ originalModel?: string,
86
+ ): { model: string; provider: 'openai' | 'anthropic' } {
87
+ if (task) {
88
+ const exactMatch = this.config.routes.find(
89
+ (r) => r.caller === caller && r.task === task,
90
+ );
91
+ if (exactMatch) {
92
+ return { model: exactMatch.model, provider: exactMatch.provider };
93
+ }
94
+ }
95
+
96
+ const callerMatch = this.config.routes.find(
97
+ (r) => r.caller === caller && !r.task,
98
+ );
99
+ if (callerMatch) {
100
+ return { model: callerMatch.model, provider: callerMatch.provider };
101
+ }
102
+
103
+ if (originalModel) {
104
+ const provider = inferProvider(originalModel);
105
+ return { model: originalModel, provider };
106
+ }
107
+
108
+ return { model: this.config.defaultOpenAIModel, provider: 'openai' };
109
+ }
110
+
111
+ getRoutes(): RouteEntry[] {
112
+ return [...this.config.routes];
113
+ }
114
+ }
115
+
116
+ // =============================================================================
117
+ // LLM CLIENT
118
+ // =============================================================================
119
+
120
+ export class LLMClient {
121
+ private openaiKeyPool: KeyPool;
122
+ private anthropicKeyPool: KeyPool;
123
+ private anthropicClient: Anthropic | null = null;
124
+ private anthropicBreaker: CircuitBreaker;
125
+ private anthropicKeyFingerprint: string = '';
126
+ private router: ModelRouter;
127
+
128
+ constructor(openaiKeyPool: KeyPool, anthropicKeyPool: KeyPool) {
129
+ this.openaiKeyPool = openaiKeyPool;
130
+ this.anthropicKeyPool = anthropicKeyPool;
131
+ this.anthropicBreaker = new CircuitBreaker({
132
+ name: 'llm-anthropic',
133
+ failureThreshold: 5,
134
+ resetTimeoutMs: 60_000,
135
+ });
136
+ this.router = new ModelRouter();
137
+ }
138
+
139
+ async complete(options: LLMCallOptions): Promise<LLMCallResult> {
140
+ const routed = this.router.resolve(
141
+ options.caller,
142
+ options.task,
143
+ options.model,
144
+ );
145
+ const resolvedOptions = { ...options, model: routed.model, provider: routed.provider };
146
+
147
+ return resolvedOptions.provider === 'anthropic'
148
+ ? this.callAnthropic(resolvedOptions)
149
+ : this.callOpenAI(resolvedOptions);
150
+ }
151
+
152
+ isAvailable(): { openai: boolean; anthropic: boolean } {
153
+ return {
154
+ openai: this.openaiKeyPool.hasKeys,
155
+ anthropic: this.anthropicKeyPool.hasKeys,
156
+ };
157
+ }
158
+
159
+ getRoutes(): RouteEntry[] {
160
+ return this.router.getRoutes();
161
+ }
162
+
163
+ // ===========================================================================
164
+ // OPENAI
165
+ // ===========================================================================
166
+
167
+ private async callOpenAI(options: LLMCallOptions): Promise<LLMCallResult> {
168
+ const keyPool = this.openaiKeyPool.hasKeys ? this.openaiKeyPool : null;
169
+
170
+ if (!keyPool) {
171
+ throw new LLMError('OpenAI API key not configured', { retryable: false });
172
+ }
173
+
174
+ const start = Date.now();
175
+
176
+ const doRequest = async (): Promise<LLMCallResult> => {
177
+ const apiKey = keyPool.getActiveKey().expose();
178
+ const keyIndex = keyPool.activeKeyIndex;
179
+
180
+ const response = await fetch(OPENAI_API_URL, {
181
+ method: 'POST',
182
+ headers: {
183
+ 'Content-Type': 'application/json',
184
+ Authorization: \`Bearer \${apiKey}\`,
185
+ },
186
+ body: JSON.stringify({
187
+ model: options.model,
188
+ messages: [
189
+ { role: 'system', content: options.systemPrompt },
190
+ { role: 'user', content: options.userPrompt },
191
+ ],
192
+ temperature: options.temperature ?? 0.3,
193
+ max_completion_tokens: options.maxTokens ?? 500,
194
+ }),
195
+ });
196
+
197
+ if (response.headers) {
198
+ const rateLimits = parseRateLimitHeaders(response.headers);
199
+ if (rateLimits.remaining !== null) {
200
+ keyPool.updateQuota(keyIndex, rateLimits.remaining);
201
+ keyPool.rotatePreemptive();
202
+ }
203
+ }
204
+
205
+ if (!response.ok) {
206
+ if (response.status === 429 && keyPool.poolSize > 1) {
207
+ keyPool.rotateOnError();
208
+ }
209
+
210
+ const errorBody = await response.text();
211
+ throw new LLMError(
212
+ \`OpenAI API error: \${response.status} - \${errorBody}\`,
213
+ { retryable: response.status === 429 || response.status >= 500, statusCode: response.status },
214
+ );
215
+ }
216
+
217
+ const data = (await response.json()) as {
218
+ choices: Array<{ message: { content: string } }>;
219
+ usage?: { prompt_tokens?: number; completion_tokens?: number };
220
+ };
221
+
222
+ return {
223
+ text: data.choices[0]?.message?.content || '',
224
+ model: options.model,
225
+ provider: 'openai' as const,
226
+ inputTokens: data.usage?.prompt_tokens,
227
+ outputTokens: data.usage?.completion_tokens,
228
+ durationMs: Date.now() - start,
229
+ };
230
+ };
231
+
232
+ return retry(doRequest, { maxAttempts: 3 });
233
+ }
234
+
235
+ // ===========================================================================
236
+ // ANTHROPIC
237
+ // ===========================================================================
238
+
239
+ private async callAnthropic(options: LLMCallOptions): Promise<LLMCallResult> {
240
+ const client = this.getAnthropicClient();
241
+ if (!client) {
242
+ throw new LLMError('Anthropic API key not configured', { retryable: false });
243
+ }
244
+
245
+ const start = Date.now();
246
+
247
+ return this.anthropicBreaker.call(() =>
248
+ retry(
249
+ async () => {
250
+ const response = await client.messages.create(
251
+ {
252
+ model: options.model,
253
+ max_tokens: options.maxTokens ?? 1024,
254
+ system: options.systemPrompt,
255
+ messages: [{ role: 'user', content: options.userPrompt }],
256
+ },
257
+ { timeout: 60_000 },
258
+ );
259
+
260
+ const text = response.content
261
+ .filter(
262
+ (block): block is Anthropic.TextBlock => block.type === 'text',
263
+ )
264
+ .map((block) => block.text)
265
+ .join('\\n');
266
+
267
+ return {
268
+ text,
269
+ model: options.model,
270
+ provider: 'anthropic' as const,
271
+ inputTokens: response.usage?.input_tokens,
272
+ outputTokens: response.usage?.output_tokens,
273
+ durationMs: Date.now() - start,
274
+ };
275
+ },
276
+ { maxAttempts: 2 },
277
+ ),
278
+ );
279
+ }
280
+
281
+ private getAnthropicClient(): Anthropic | null {
282
+ if (!this.anthropicKeyPool.hasKeys) return null;
283
+
284
+ const currentKey = this.anthropicKeyPool.getActiveKey().expose();
285
+ const currentFingerprint = currentKey.slice(-8);
286
+
287
+ if (currentFingerprint !== this.anthropicKeyFingerprint) {
288
+ this.anthropicClient = null;
289
+ this.anthropicKeyFingerprint = currentFingerprint;
290
+ }
291
+
292
+ if (this.anthropicClient) return this.anthropicClient;
293
+
294
+ this.anthropicClient = new Anthropic({ apiKey: currentKey });
295
+ return this.anthropicClient;
296
+ }
297
+ }
298
+ `;
299
+ }
300
+ //# sourceMappingURL=llm-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-client.js","sourceRoot":"","sources":["../../src/templates/llm-client.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAqCD,MAAM,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8PhB,CAAC;AACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { AgentConfig } from '../types.js';
2
+ /**
3
+ * Generate the LLM key pool file for a new agent.
4
+ * KeyPool manages multiple API keys with per-key circuit breakers.
5
+ * Uses config.id to resolve ~/.{agentId}/keys.json.
6
+ */
7
+ export declare function generateLLMKeyPool(config: AgentConfig): string;