@archal/cli 0.6.2 → 0.6.3
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/index.js +781 -633
- package/harnesses/_lib/providers.mjs +26 -1
- package/package.json +9 -2
|
@@ -228,6 +228,31 @@ export function extractTokenUsage(provider, body) {
|
|
|
228
228
|
|
|
229
229
|
// ── Tool formatting ─────────────────────────────────────────────────
|
|
230
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Recursively strip JSON Schema keywords that the Gemini API rejects.
|
|
233
|
+
* Gemini does not support: additionalProperties, $schema, anyOf, oneOf, allOf.
|
|
234
|
+
*/
|
|
235
|
+
function sanitizeSchemaForGemini(schema) {
|
|
236
|
+
if (!schema || typeof schema !== 'object') return schema;
|
|
237
|
+
if (Array.isArray(schema)) return schema.map(sanitizeSchemaForGemini);
|
|
238
|
+
|
|
239
|
+
const cleaned = {};
|
|
240
|
+
for (const [key, value] of Object.entries(schema)) {
|
|
241
|
+
if (key === 'additionalProperties' || key === '$schema') continue;
|
|
242
|
+
// Gemini doesn't support anyOf/oneOf/allOf — flatten single-element unions,
|
|
243
|
+
// otherwise drop the keyword entirely (Gemini treats it as unknown).
|
|
244
|
+
if (key === 'anyOf' || key === 'oneOf' || key === 'allOf') {
|
|
245
|
+
if (Array.isArray(value) && value.length === 1) {
|
|
246
|
+
Object.assign(cleaned, sanitizeSchemaForGemini(value[0]));
|
|
247
|
+
}
|
|
248
|
+
// Multi-element unions are unsupported; skip the keyword
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
cleaned[key] = sanitizeSchemaForGemini(value);
|
|
252
|
+
}
|
|
253
|
+
return cleaned;
|
|
254
|
+
}
|
|
255
|
+
|
|
231
256
|
/**
|
|
232
257
|
* Convert MCP tool schemas to the format expected by each provider.
|
|
233
258
|
*/
|
|
@@ -238,7 +263,7 @@ export function formatToolsForProvider(provider, mcpTools) {
|
|
|
238
263
|
functionDeclarations: mcpTools.map((t) => ({
|
|
239
264
|
name: t.name,
|
|
240
265
|
description: t.description,
|
|
241
|
-
parameters: t.inputSchema,
|
|
266
|
+
parameters: sanitizeSchemaForGemini(t.inputSchema),
|
|
242
267
|
})),
|
|
243
268
|
}];
|
|
244
269
|
case 'openai':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@archal/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Pre-deployment testing for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -51,7 +51,14 @@
|
|
|
51
51
|
"tsx": "^4.19.0",
|
|
52
52
|
"typescript": "^5.9.0",
|
|
53
53
|
"vitest": "^2.1.0",
|
|
54
|
-
"@archal/twin-core": "0.1.0"
|
|
54
|
+
"@archal/twin-core": "0.1.0",
|
|
55
|
+
"@archal/twin-google-workspace": "0.1.0",
|
|
56
|
+
"@archal/twin-supabase": "0.1.0",
|
|
57
|
+
"@archal/twin-github": "0.1.0",
|
|
58
|
+
"@archal/twin-linear": "0.1.0",
|
|
59
|
+
"@archal/twin-stripe": "0.1.0",
|
|
60
|
+
"@archal/twin-slack": "0.1.0",
|
|
61
|
+
"@archal/twin-jira": "0.1.0"
|
|
55
62
|
},
|
|
56
63
|
"scripts": {
|
|
57
64
|
"build": "tsup src/index.ts --format esm --dts",
|