@zhixuan92/multi-model-agent-core 0.3.1 → 1.0.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.
- package/dist/config/load.js +9 -9
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +168 -275
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +30 -39
- package/dist/config/schema.js.map +1 -1
- package/dist/cost/cost-meter.d.ts +13 -0
- package/dist/cost/cost-meter.d.ts.map +1 -0
- package/dist/cost/cost-meter.js +20 -0
- package/dist/cost/cost-meter.js.map +1 -0
- package/dist/delegate-with-escalation.d.ts +1 -28
- package/dist/delegate-with-escalation.d.ts.map +1 -1
- package/dist/delegate-with-escalation.js +10 -89
- package/dist/delegate-with-escalation.js.map +1 -1
- package/dist/error-codes.d.ts +4 -0
- package/dist/error-codes.d.ts.map +1 -0
- package/dist/error-codes.js +16 -0
- package/dist/error-codes.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/model-profiles.json +10 -5
- package/dist/provider.d.ts +2 -2
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +10 -13
- package/dist/provider.js.map +1 -1
- package/dist/readiness/normalization-budget.d.ts +2 -0
- package/dist/readiness/normalization-budget.d.ts.map +1 -0
- package/dist/readiness/normalization-budget.js +9 -0
- package/dist/readiness/normalization-budget.js.map +1 -0
- package/dist/readiness/normalize-brief.d.ts +17 -0
- package/dist/readiness/normalize-brief.d.ts.map +1 -0
- package/dist/readiness/normalize-brief.js +124 -0
- package/dist/readiness/normalize-brief.js.map +1 -0
- package/dist/readiness/readiness.d.ts +16 -0
- package/dist/readiness/readiness.d.ts.map +1 -0
- package/dist/readiness/readiness.js +160 -0
- package/dist/readiness/readiness.js.map +1 -0
- package/dist/reporting/structured-report.d.ts +18 -0
- package/dist/reporting/structured-report.d.ts.map +1 -0
- package/dist/reporting/structured-report.js +100 -0
- package/dist/reporting/structured-report.js.map +1 -0
- package/dist/review/aggregate-result.d.ts +3 -0
- package/dist/review/aggregate-result.d.ts.map +1 -0
- package/dist/review/aggregate-result.js +31 -0
- package/dist/review/aggregate-result.js.map +1 -0
- package/dist/review/quality-reviewer.d.ts +13 -0
- package/dist/review/quality-reviewer.d.ts.map +1 -0
- package/dist/review/quality-reviewer.js +39 -0
- package/dist/review/quality-reviewer.js.map +1 -0
- package/dist/review/reviewer-prompt.d.ts +10 -0
- package/dist/review/reviewer-prompt.d.ts.map +1 -0
- package/dist/review/reviewer-prompt.js +58 -0
- package/dist/review/reviewer-prompt.js.map +1 -0
- package/dist/review/spec-reviewer.d.ts +13 -0
- package/dist/review/spec-reviewer.d.ts.map +1 -0
- package/dist/review/spec-reviewer.js +37 -0
- package/dist/review/spec-reviewer.js.map +1 -0
- package/dist/routing/model-profiles.d.ts +5 -0
- package/dist/routing/model-profiles.d.ts.map +1 -1
- package/dist/routing/model-profiles.js +5 -0
- package/dist/routing/model-profiles.js.map +1 -1
- package/dist/routing/resolve-agent.d.ts +8 -0
- package/dist/routing/resolve-agent.d.ts.map +1 -0
- package/dist/routing/resolve-agent.js +45 -0
- package/dist/routing/resolve-agent.js.map +1 -0
- package/dist/run-tasks.d.ts +0 -23
- package/dist/run-tasks.d.ts.map +1 -1
- package/dist/run-tasks.js +241 -72
- package/dist/run-tasks.js.map +1 -1
- package/dist/runners/claude-runner.d.ts.map +1 -1
- package/dist/runners/claude-runner.js +71 -34
- package/dist/runners/claude-runner.js.map +1 -1
- package/dist/runners/codex-runner.d.ts.map +1 -1
- package/dist/runners/codex-runner.js +72 -31
- package/dist/runners/codex-runner.js.map +1 -1
- package/dist/runners/openai-runner.d.ts.map +1 -1
- package/dist/runners/openai-runner.js +144 -32
- package/dist/runners/openai-runner.js.map +1 -1
- package/dist/runners/prevention.d.ts +2 -0
- package/dist/runners/prevention.d.ts.map +1 -1
- package/dist/runners/prevention.js +12 -0
- package/dist/runners/prevention.js.map +1 -1
- package/dist/runners/supervision.d.ts +31 -5
- package/dist/runners/supervision.d.ts.map +1 -1
- package/dist/runners/supervision.js +43 -68
- package/dist/runners/supervision.js.map +1 -1
- package/dist/tools/call-cache.d.ts +16 -0
- package/dist/tools/call-cache.d.ts.map +1 -0
- package/dist/tools/call-cache.js +28 -0
- package/dist/tools/call-cache.js.map +1 -0
- package/dist/types.d.ts +92 -30
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +48 -16
- package/dist/routing/capabilities.d.ts +0 -3
- package/dist/routing/capabilities.d.ts.map +0 -1
- package/dist/routing/capabilities.js +0 -26
- package/dist/routing/capabilities.js.map +0 -1
- package/dist/routing/get-provider-eligibility.d.ts +0 -8
- package/dist/routing/get-provider-eligibility.d.ts.map +0 -1
- package/dist/routing/get-provider-eligibility.js +0 -53
- package/dist/routing/get-provider-eligibility.js.map +0 -1
- package/dist/routing/resolve-task-capabilities.d.ts +0 -7
- package/dist/routing/resolve-task-capabilities.d.ts.map +0 -1
- package/dist/routing/resolve-task-capabilities.js +0 -19
- package/dist/routing/resolve-task-capabilities.js.map +0 -1
- package/dist/routing/select-provider-for-task.d.ts +0 -18
- package/dist/routing/select-provider-for-task.d.ts.map +0 -1
- package/dist/routing/select-provider-for-task.js +0 -50
- package/dist/routing/select-provider-for-task.js.map +0 -1
package/dist/config/load.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { multiModelConfigSchema } from './schema.js';
|
|
3
3
|
/**
|
|
4
|
-
* Warn if any openai-compatible
|
|
5
|
-
* inline `apiKey` instead of using `apiKeyEnv`. The schema permits both
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Warn if any openai-compatible agent in the parsed config carries an
|
|
5
|
+
* inline `apiKey` instead of using `apiKeyEnv`. The schema permits both,
|
|
6
|
+
* but storing a plaintext API key in a config file that may end up in a
|
|
7
|
+
* backup, dotfile repo, or git is a footgun. We surface the issue at load
|
|
8
|
+
* time, once, so the operator notices.
|
|
9
9
|
*/
|
|
10
10
|
function warnOnInlineApiKey(config, configPath) {
|
|
11
11
|
const offenders = [];
|
|
12
|
-
for (const [name,
|
|
13
|
-
if (
|
|
14
|
-
typeof
|
|
12
|
+
for (const [name, agent] of Object.entries(config.agents)) {
|
|
13
|
+
if (agent.type === 'openai-compatible' &&
|
|
14
|
+
typeof agent.apiKey === 'string') {
|
|
15
15
|
offenders.push(name);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
if (offenders.length > 0) {
|
|
19
19
|
// eslint-disable-next-line no-console
|
|
20
20
|
console.warn(`[multi-model-agent] WARNING: ${configPath} stores an inline \`apiKey\` for ` +
|
|
21
|
-
`
|
|
21
|
+
`agent(s): ${offenders.join(', ')}. Prefer \`apiKeyEnv\` and read the key ` +
|
|
22
22
|
`from an environment variable so it never lands in version control.`);
|
|
23
23
|
}
|
|
24
24
|
}
|
package/dist/config/load.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGrD;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,MAAwB,EAAE,UAAkB;IACtE,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/config/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAGrD;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,MAAwB,EAAE,UAAkB;IACtE,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,KA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C,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAChG,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -1,281 +1,174 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { MultiModelConfig } from '../types.js';
|
|
3
|
-
export declare const codexProviderConfigSchema: z.ZodObject<{
|
|
4
|
-
type: z.ZodLiteral<"codex">;
|
|
5
|
-
model: z.ZodString;
|
|
6
|
-
effort: z.ZodOptional<z.ZodEnum<{
|
|
7
|
-
high: "high";
|
|
8
|
-
medium: "medium";
|
|
9
|
-
low: "low";
|
|
10
|
-
none: "none";
|
|
11
|
-
}>>;
|
|
12
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
14
|
-
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
15
|
-
none: "none";
|
|
16
|
-
"cwd-only": "cwd-only";
|
|
17
|
-
}>>;
|
|
18
|
-
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
19
|
-
web_search: "web_search";
|
|
20
|
-
image_generation: "image_generation";
|
|
21
|
-
code_interpreter: "code_interpreter";
|
|
22
|
-
}>>>;
|
|
23
|
-
costTier: z.ZodOptional<z.ZodEnum<{
|
|
24
|
-
high: "high";
|
|
25
|
-
medium: "medium";
|
|
26
|
-
low: "low";
|
|
27
|
-
free: "free";
|
|
28
|
-
}>>;
|
|
29
|
-
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
30
|
-
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
export declare const claudeProviderConfigSchema: z.ZodObject<{
|
|
34
|
-
type: z.ZodLiteral<"claude">;
|
|
35
|
-
model: z.ZodString;
|
|
36
|
-
effort: z.ZodOptional<z.ZodEnum<{
|
|
37
|
-
high: "high";
|
|
38
|
-
medium: "medium";
|
|
39
|
-
low: "low";
|
|
40
|
-
none: "none";
|
|
41
|
-
}>>;
|
|
42
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
43
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
44
|
-
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
45
|
-
none: "none";
|
|
46
|
-
"cwd-only": "cwd-only";
|
|
47
|
-
}>>;
|
|
48
|
-
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
49
|
-
web_search: "web_search";
|
|
50
|
-
image_generation: "image_generation";
|
|
51
|
-
code_interpreter: "code_interpreter";
|
|
52
|
-
}>>>;
|
|
53
|
-
costTier: z.ZodOptional<z.ZodEnum<{
|
|
54
|
-
high: "high";
|
|
55
|
-
medium: "medium";
|
|
56
|
-
low: "low";
|
|
57
|
-
free: "free";
|
|
58
|
-
}>>;
|
|
59
|
-
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
62
|
-
}, z.core.$strip>;
|
|
63
|
-
export declare const openAICompatibleProviderConfigSchema: z.ZodObject<{
|
|
64
|
-
type: z.ZodLiteral<"openai-compatible">;
|
|
65
|
-
model: z.ZodString;
|
|
66
|
-
baseUrl: z.ZodString;
|
|
67
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
68
|
-
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
69
|
-
effort: z.ZodOptional<z.ZodEnum<{
|
|
70
|
-
high: "high";
|
|
71
|
-
medium: "medium";
|
|
72
|
-
low: "low";
|
|
73
|
-
none: "none";
|
|
74
|
-
}>>;
|
|
75
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
76
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
77
|
-
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
78
|
-
none: "none";
|
|
79
|
-
"cwd-only": "cwd-only";
|
|
80
|
-
}>>;
|
|
81
|
-
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
82
|
-
web_search: "web_search";
|
|
83
|
-
image_generation: "image_generation";
|
|
84
|
-
code_interpreter: "code_interpreter";
|
|
85
|
-
}>>>;
|
|
86
|
-
costTier: z.ZodOptional<z.ZodEnum<{
|
|
87
|
-
high: "high";
|
|
88
|
-
medium: "medium";
|
|
89
|
-
low: "low";
|
|
90
|
-
free: "free";
|
|
91
|
-
}>>;
|
|
92
|
-
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
93
|
-
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
95
|
-
}, z.core.$strip>;
|
|
96
|
-
export declare const providerConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
97
|
-
type: z.ZodLiteral<"codex">;
|
|
98
|
-
model: z.ZodString;
|
|
99
|
-
effort: z.ZodOptional<z.ZodEnum<{
|
|
100
|
-
high: "high";
|
|
101
|
-
medium: "medium";
|
|
102
|
-
low: "low";
|
|
103
|
-
none: "none";
|
|
104
|
-
}>>;
|
|
105
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
106
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
107
|
-
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
108
|
-
none: "none";
|
|
109
|
-
"cwd-only": "cwd-only";
|
|
110
|
-
}>>;
|
|
111
|
-
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
112
|
-
web_search: "web_search";
|
|
113
|
-
image_generation: "image_generation";
|
|
114
|
-
code_interpreter: "code_interpreter";
|
|
115
|
-
}>>>;
|
|
116
|
-
costTier: z.ZodOptional<z.ZodEnum<{
|
|
117
|
-
high: "high";
|
|
118
|
-
medium: "medium";
|
|
119
|
-
low: "low";
|
|
120
|
-
free: "free";
|
|
121
|
-
}>>;
|
|
122
|
-
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
123
|
-
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
124
|
-
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
125
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
126
|
-
type: z.ZodLiteral<"claude">;
|
|
127
|
-
model: z.ZodString;
|
|
128
|
-
effort: z.ZodOptional<z.ZodEnum<{
|
|
129
|
-
high: "high";
|
|
130
|
-
medium: "medium";
|
|
131
|
-
low: "low";
|
|
132
|
-
none: "none";
|
|
133
|
-
}>>;
|
|
134
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
135
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
136
|
-
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
137
|
-
none: "none";
|
|
138
|
-
"cwd-only": "cwd-only";
|
|
139
|
-
}>>;
|
|
140
|
-
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
141
|
-
web_search: "web_search";
|
|
142
|
-
image_generation: "image_generation";
|
|
143
|
-
code_interpreter: "code_interpreter";
|
|
144
|
-
}>>>;
|
|
145
|
-
costTier: z.ZodOptional<z.ZodEnum<{
|
|
146
|
-
high: "high";
|
|
147
|
-
medium: "medium";
|
|
148
|
-
low: "low";
|
|
149
|
-
free: "free";
|
|
150
|
-
}>>;
|
|
151
|
-
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
152
|
-
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
153
|
-
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
154
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
155
|
-
type: z.ZodLiteral<"openai-compatible">;
|
|
156
|
-
model: z.ZodString;
|
|
157
|
-
baseUrl: z.ZodString;
|
|
158
|
-
apiKey: z.ZodOptional<z.ZodString>;
|
|
159
|
-
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
160
|
-
effort: z.ZodOptional<z.ZodEnum<{
|
|
161
|
-
high: "high";
|
|
162
|
-
medium: "medium";
|
|
163
|
-
low: "low";
|
|
164
|
-
none: "none";
|
|
165
|
-
}>>;
|
|
166
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
167
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
168
|
-
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
169
|
-
none: "none";
|
|
170
|
-
"cwd-only": "cwd-only";
|
|
171
|
-
}>>;
|
|
172
|
-
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
173
|
-
web_search: "web_search";
|
|
174
|
-
image_generation: "image_generation";
|
|
175
|
-
code_interpreter: "code_interpreter";
|
|
176
|
-
}>>>;
|
|
177
|
-
costTier: z.ZodOptional<z.ZodEnum<{
|
|
178
|
-
high: "high";
|
|
179
|
-
medium: "medium";
|
|
180
|
-
low: "low";
|
|
181
|
-
free: "free";
|
|
182
|
-
}>>;
|
|
183
|
-
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
184
|
-
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
185
|
-
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
186
|
-
}, z.core.$strip>], "type">;
|
|
187
3
|
export declare const multiModelConfigSchema: z.ZodObject<{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
4
|
+
agents: z.ZodObject<{
|
|
5
|
+
standard: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
model: z.ZodString;
|
|
7
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
8
|
+
web_search: "web_search";
|
|
9
|
+
web_fetch: "web_fetch";
|
|
10
|
+
}>>>;
|
|
11
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
high: "high";
|
|
13
|
+
medium: "medium";
|
|
14
|
+
low: "low";
|
|
15
|
+
none: "none";
|
|
16
|
+
}>>;
|
|
17
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
none: "none";
|
|
23
|
+
"cwd-only": "cwd-only";
|
|
24
|
+
}>>;
|
|
25
|
+
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
type: z.ZodLiteral<"openai-compatible">;
|
|
27
|
+
baseUrl: z.ZodString;
|
|
28
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
29
|
+
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
30
|
+
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
31
|
+
web_search: "web_search";
|
|
32
|
+
}>>>;
|
|
33
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
34
|
+
model: z.ZodString;
|
|
35
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
36
|
+
web_search: "web_search";
|
|
37
|
+
web_fetch: "web_fetch";
|
|
38
|
+
}>>>;
|
|
39
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
high: "high";
|
|
41
|
+
medium: "medium";
|
|
42
|
+
low: "low";
|
|
43
|
+
none: "none";
|
|
44
|
+
}>>;
|
|
45
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
50
|
+
none: "none";
|
|
51
|
+
"cwd-only": "cwd-only";
|
|
52
|
+
}>>;
|
|
53
|
+
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
type: z.ZodLiteral<"claude">;
|
|
55
|
+
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
56
|
+
web_search: "web_search";
|
|
57
|
+
image_generation: "image_generation";
|
|
58
|
+
code_interpreter: "code_interpreter";
|
|
59
|
+
}>>>;
|
|
60
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
61
|
+
model: z.ZodString;
|
|
62
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
63
|
+
web_search: "web_search";
|
|
64
|
+
web_fetch: "web_fetch";
|
|
65
|
+
}>>>;
|
|
66
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
high: "high";
|
|
68
|
+
medium: "medium";
|
|
69
|
+
low: "low";
|
|
70
|
+
none: "none";
|
|
71
|
+
}>>;
|
|
72
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
none: "none";
|
|
78
|
+
"cwd-only": "cwd-only";
|
|
79
|
+
}>>;
|
|
80
|
+
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
type: z.ZodLiteral<"codex">;
|
|
82
|
+
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
83
|
+
web_search: "web_search";
|
|
84
|
+
image_generation: "image_generation";
|
|
85
|
+
code_interpreter: "code_interpreter";
|
|
86
|
+
}>>>;
|
|
87
|
+
}, z.core.$strict>], "type">;
|
|
88
|
+
complex: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
89
|
+
model: z.ZodString;
|
|
90
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
91
|
+
web_search: "web_search";
|
|
92
|
+
web_fetch: "web_fetch";
|
|
93
|
+
}>>>;
|
|
94
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
high: "high";
|
|
96
|
+
medium: "medium";
|
|
97
|
+
low: "low";
|
|
98
|
+
none: "none";
|
|
99
|
+
}>>;
|
|
100
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
105
|
+
none: "none";
|
|
106
|
+
"cwd-only": "cwd-only";
|
|
107
|
+
}>>;
|
|
108
|
+
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
type: z.ZodLiteral<"openai-compatible">;
|
|
110
|
+
baseUrl: z.ZodString;
|
|
111
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
112
|
+
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
113
|
+
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
114
|
+
web_search: "web_search";
|
|
115
|
+
}>>>;
|
|
116
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
117
|
+
model: z.ZodString;
|
|
118
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
119
|
+
web_search: "web_search";
|
|
120
|
+
web_fetch: "web_fetch";
|
|
121
|
+
}>>>;
|
|
122
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
123
|
+
high: "high";
|
|
124
|
+
medium: "medium";
|
|
125
|
+
low: "low";
|
|
126
|
+
none: "none";
|
|
127
|
+
}>>;
|
|
128
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
133
|
+
none: "none";
|
|
134
|
+
"cwd-only": "cwd-only";
|
|
135
|
+
}>>;
|
|
136
|
+
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
type: z.ZodLiteral<"claude">;
|
|
138
|
+
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
139
|
+
web_search: "web_search";
|
|
140
|
+
image_generation: "image_generation";
|
|
141
|
+
code_interpreter: "code_interpreter";
|
|
142
|
+
}>>>;
|
|
143
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
144
|
+
model: z.ZodString;
|
|
145
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
146
|
+
web_search: "web_search";
|
|
147
|
+
web_fetch: "web_fetch";
|
|
148
|
+
}>>>;
|
|
149
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
high: "high";
|
|
151
|
+
medium: "medium";
|
|
152
|
+
low: "low";
|
|
153
|
+
none: "none";
|
|
154
|
+
}>>;
|
|
155
|
+
inputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
outputCostPerMTok: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
sandboxPolicy: z.ZodOptional<z.ZodEnum<{
|
|
160
|
+
none: "none";
|
|
161
|
+
"cwd-only": "cwd-only";
|
|
162
|
+
}>>;
|
|
163
|
+
inputTokenSoftLimit: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
type: z.ZodLiteral<"codex">;
|
|
165
|
+
hostedTools: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
166
|
+
web_search: "web_search";
|
|
167
|
+
image_generation: "image_generation";
|
|
168
|
+
code_interpreter: "code_interpreter";
|
|
169
|
+
}>>>;
|
|
170
|
+
}, z.core.$strict>], "type">;
|
|
171
|
+
}, z.core.$strip>;
|
|
279
172
|
defaults: z.ZodDefault<z.ZodObject<{
|
|
280
173
|
maxTurns: z.ZodDefault<z.ZodNumber>;
|
|
281
174
|
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,gBAAgB,EACjB,MAAM,aAAa,CAAC;AA+DrB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMjC,CAAC;AAEH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,gBAAgB,CAAA;IACxB,OAAO,EAAE,IAAI,CAAA;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,KAAK,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,GAAG,mBAAmB,CAAA;AAEzE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CAE1D"}
|
package/dist/config/schema.js
CHANGED
|
@@ -1,59 +1,47 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
// ===
|
|
2
|
+
// === Shared field schemas ===
|
|
3
3
|
const effortSchema = z.enum(['none', 'low', 'medium', 'high']);
|
|
4
|
-
const costTierSchema = z.enum(['free', 'low', 'medium', 'high']);
|
|
5
4
|
const hostedToolsSchema = z.array(z.enum(['web_search', 'image_generation', 'code_interpreter']));
|
|
5
|
+
const openAICompatibleHostedToolsSchema = z.array(z.enum(['web_search']));
|
|
6
6
|
const sandboxPolicySchema = z.enum(['none', 'cwd-only']).optional();
|
|
7
7
|
// Per-million-token pricing for cost computation. Must be non-negative; zero
|
|
8
|
-
// is allowed (free
|
|
8
|
+
// is allowed (free agents can set both rates to 0 to get a deterministic
|
|
9
9
|
// costUSD: 0 instead of null).
|
|
10
10
|
const tokenCostSchema = z.number().nonnegative().finite().optional();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
model: z.string(),
|
|
11
|
+
const capabilitiesSchema = z.array(z.enum(['web_search', 'web_fetch'])).optional();
|
|
12
|
+
const baseAgentFields = {
|
|
13
|
+
model: z.string().min(1),
|
|
14
|
+
capabilities: capabilitiesSchema,
|
|
14
15
|
effort: effortSchema.optional(),
|
|
15
|
-
maxTurns: z.number().int().positive().optional(),
|
|
16
|
-
timeoutMs: z.number().int().positive().optional(),
|
|
17
|
-
sandboxPolicy: sandboxPolicySchema,
|
|
18
|
-
hostedTools: hostedToolsSchema.optional(),
|
|
19
|
-
costTier: costTierSchema.optional(),
|
|
20
16
|
inputCostPerMTok: tokenCostSchema,
|
|
21
17
|
outputCostPerMTok: tokenCostSchema,
|
|
22
|
-
inputTokenSoftLimit: z.number().int().positive().optional(),
|
|
23
|
-
});
|
|
24
|
-
export const claudeProviderConfigSchema = z.object({
|
|
25
|
-
type: z.literal('claude'),
|
|
26
|
-
model: z.string(),
|
|
27
|
-
effort: effortSchema.optional(),
|
|
28
18
|
maxTurns: z.number().int().positive().optional(),
|
|
29
19
|
timeoutMs: z.number().int().positive().optional(),
|
|
30
20
|
sandboxPolicy: sandboxPolicySchema,
|
|
31
|
-
hostedTools: hostedToolsSchema.optional(),
|
|
32
|
-
costTier: costTierSchema.optional(),
|
|
33
|
-
inputCostPerMTok: tokenCostSchema,
|
|
34
|
-
outputCostPerMTok: tokenCostSchema,
|
|
35
21
|
inputTokenSoftLimit: z.number().int().positive().optional(),
|
|
36
|
-
}
|
|
37
|
-
|
|
22
|
+
};
|
|
23
|
+
const openAICompatibleAgentSchema = z.object({
|
|
38
24
|
type: z.literal('openai-compatible'),
|
|
39
|
-
|
|
40
|
-
baseUrl: z.string().min(1, 'baseUrl is required for openai-compatible providers'),
|
|
25
|
+
baseUrl: z.string().min(1, 'baseUrl is required for openai-compatible agents'),
|
|
41
26
|
apiKey: z.string().optional(),
|
|
42
27
|
apiKeyEnv: z.string().optional(),
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
timeoutMs: z.number().int().positive().optional(),
|
|
46
|
-
sandboxPolicy: sandboxPolicySchema,
|
|
47
|
-
hostedTools: hostedToolsSchema.optional(),
|
|
48
|
-
costTier: costTierSchema.optional(),
|
|
49
|
-
inputCostPerMTok: tokenCostSchema,
|
|
50
|
-
outputCostPerMTok: tokenCostSchema,
|
|
51
|
-
inputTokenSoftLimit: z.number().int().positive().optional(),
|
|
28
|
+
hostedTools: openAICompatibleHostedToolsSchema.optional(),
|
|
29
|
+
...baseAgentFields,
|
|
52
30
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
31
|
+
const claudeAgentSchema = z.object({
|
|
32
|
+
type: z.literal('claude'),
|
|
33
|
+
hostedTools: hostedToolsSchema.optional(),
|
|
34
|
+
...baseAgentFields,
|
|
35
|
+
}).strict();
|
|
36
|
+
const codexAgentSchema = z.object({
|
|
37
|
+
type: z.literal('codex'),
|
|
38
|
+
hostedTools: hostedToolsSchema.optional(),
|
|
39
|
+
...baseAgentFields,
|
|
40
|
+
}).strict();
|
|
41
|
+
const agentConfigSchema = z.discriminatedUnion('type', [
|
|
42
|
+
openAICompatibleAgentSchema,
|
|
43
|
+
claudeAgentSchema,
|
|
44
|
+
codexAgentSchema,
|
|
57
45
|
]);
|
|
58
46
|
// === MultiModelConfig schema ===
|
|
59
47
|
const defaultsSchema = z.object({
|
|
@@ -63,7 +51,10 @@ const defaultsSchema = z.object({
|
|
|
63
51
|
largeResponseThresholdChars: z.number().int().positive().optional(),
|
|
64
52
|
}).default(() => ({ maxTurns: 200, timeoutMs: 600_000, tools: 'full' }));
|
|
65
53
|
export const multiModelConfigSchema = z.object({
|
|
66
|
-
|
|
54
|
+
agents: z.object({
|
|
55
|
+
standard: agentConfigSchema,
|
|
56
|
+
complex: agentConfigSchema,
|
|
57
|
+
}),
|
|
67
58
|
defaults: defaultsSchema,
|
|
68
59
|
});
|
|
69
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,+BAA+B;AAE/B,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAClG,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAC1E,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAA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AE,MAAe,EAAE,CAAC,CAAC,CAAC;AAElF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,iBAAiB;QAC3B,OAAO,EAAE,iBAAiB;KAC3B,CAAC;IACF,QAAQ,EAAE,cAAc;CACzB,CAAC,CAAC;AAcH;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,GAAY;IACtC,OAAO,sBAAsB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface CostMeterOptions {
|
|
2
|
+
ceiling?: number;
|
|
3
|
+
}
|
|
4
|
+
export declare class CostMeter {
|
|
5
|
+
private spent;
|
|
6
|
+
private readonly ceiling;
|
|
7
|
+
constructor(options?: CostMeterOptions);
|
|
8
|
+
add(amount: number): void;
|
|
9
|
+
total(): number;
|
|
10
|
+
canProceed(nextCost: number): boolean;
|
|
11
|
+
remaining(): number;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=cost-meter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cost-meter.d.ts","sourceRoot":"","sources":["../../src/cost/cost-meter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAErB,OAAO,GAAE,gBAAqB;IAI1C,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIzB,KAAK,IAAI,MAAM;IAIf,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAIrC,SAAS,IAAI,MAAM;CAGpB"}
|