mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
- Cowork: ComboFormModal
- BaseUrlSelect: add cloud endpoint option, custom URL local state, always default to first option; new cliEndpointMatch helper; CLI tool cards refactor - API: new /v1/audio/voices and /v1/models/info; /v1/models filters disabled models, drop unused timestamp - initializeApp: guard tunnel/tailscale auto-resume to once-per-process - geminiHelper: ensureObjectType for schemas with properties but no type - skills: minor SKILL.md tweaks (chat/embeddings/image/stt/tts/web-*)
This commit is contained in:
@@ -270,6 +270,13 @@ function flattenTypeArrays(obj) {
|
||||
}
|
||||
}
|
||||
|
||||
// Infer missing type=object when properties exist (Gemini requires explicit type)
|
||||
function ensureObjectType(obj) {
|
||||
if (!obj || typeof obj !== "object") return;
|
||||
if (obj.properties && !obj.type) obj.type = "object";
|
||||
for (const v of Object.values(obj)) if (v && typeof v === "object") ensureObjectType(v);
|
||||
}
|
||||
|
||||
// Clean JSON Schema for Antigravity API compatibility - removes unsupported keywords recursively
|
||||
export function cleanJSONSchemaForAntigravity(schema) {
|
||||
if (!schema || typeof schema !== "object") return schema;
|
||||
@@ -286,6 +293,9 @@ export function cleanJSONSchemaForAntigravity(schema) {
|
||||
flattenAnyOfOneOf(cleaned);
|
||||
flattenTypeArrays(cleaned);
|
||||
|
||||
// Phase 2.5: Infer missing type=object when properties exist (Gemini requirement)
|
||||
ensureObjectType(cleaned);
|
||||
|
||||
// Phase 3: Remove all unsupported keywords at ALL levels (including inside arrays)
|
||||
removeUnsupportedKeywords(cleaned, UNSUPPORTED_SCHEMA_CONSTRAINTS);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user