Matteo Benedetto a0f94c8811 feat(images): direct Antigravity image API for image tools with CLI fallback
Replace the agent/CLI image path with a direct call to the Antigravity
Cloud Code gateway (same OAuth token and project discovery already used by
the provider), keeping the CLI as an automatic fallback.

Protocol validated with 15 live probes on 2026-09-13:
- POST v1internal:generateContent (non-streaming), requestType "image_gen",
  responseModalities ["IMAGE"], imageConfig {aspectRatio, imageSize}
- image returned as candidates[0].content.parts[].inlineData (base64, jpeg);
  parts with thought=true are intermediate images and must be skipped
- 512/2K/4K verified (512x512 .. 5504x3072, 7-25s, 1.1-2.9K output tokens)
- image input works (single, multiple) and editing honours the input when
  imageConfig.aspectRatio is supplied; HTTP 200 without images carries a
  finishMessage explaining the refusal
- gemini-3-pro-image is not entitled on this account (HTTP 404)
- the image model quota is shared and can be exhausted (429 QUOTA_EXHAUSTED
  with a "reset after" delay)

Changes:
- add antgGenerateImages(): direct client with token refresh retry, image
  part parsing and finishMessage surfacing
- add antgSaveImages() and agyImageTask(): direct-first runner with automatic
  CLI fallback, reporting engine, imagePaths, usage and fallback reason
- add antgParseQuotaDelayMs() + blocked-until guard so an exhausted image
  quota skips the direct attempt instead of retrying it every time
- route agy_generate, agy_edit, agy_inpaint, agy_style_transfer, agy_compose
  and agy_character through agyImageTask; add imageSize to agy_generate
- fix extractImagePath(): it matched the IMAGE_PATH placeholder echoed from
  the prompt and returned a bogus path on CLI failures; now only existing
  absolute image paths are accepted

Verified: module loads, tools invoke agy_generate through the direct engine
(8.6s, 1199 output tokens, file saved to outputDir), the CLI fallback fires
with an explicit reason on 429, and extractImagePath passes 5/5 cases tested
against the real function extracted from this file.
2026-09-13 19:49:18 +02:00
2026-09-08 11:11:06 +02:00
2026-09-08 11:11:06 +02:00

agy-pi

Estensione per pi che integra il client OAuth Google Antigravity (agy) come subagent multimodale. Non usa né gestisce chiavi Google AI Studio/Gemini API.

Capacità

  • chat e ragionamento multi-turno;
  • generazione, editing, composizione e analisi immagini;
  • analisi video;
  • trascrizione audio e input vocale F12 tramite Antigravity;
  • analisi qualitativa di effetti audio con waveform e metadati locali;
  • catalogo modelli e stato conversazione Antigravity.

Strumenti principali: agy, agy_generate, agy_edit, agy_inpaint, agy_style_transfer, agy_compose, agy_character, agy_analyze, agy_transcribe, agy_analyze_audio, agy_video, agy_models, agy_conversation, antigravity_chat.

Non include TTS interno né generazione immagini verificata iterativa.

Audio e F12

Premi F12 per avviare/fermare la registrazione. L'audio viene ottimizzato, convertito in Opus/OGG e inviato al modello voiceModel tramite il gateway Antigravity OAuth. Il workflow genera trascrizione e prompt pulito; con vocalPlanningMode=true richiede una conferma nell'overlay prima dell'invio a pi.

agy_analyze_audio aggiunge un percorso separato per gli effetti non vocali: misura il file con ffprobe, genera una waveform con ffmpeg e invia audio, immagine e contesto locale insieme a Gemini tramite inlineData. Non richiede una chiave Gemini esterna e non assume che l'audio contenga parlato.

agy_transcribe usa la stessa pipeline Antigravity. Non esistono fallback a servizi con chiave API esterna. I suoni di start/stop/done sono effetti locali, non sintesi vocale.

Configurazione

/agy:config
/agy:config set voiceModel gemini-3.7-flash-medium
/agy:status

Le impostazioni sono in ~/.config/agy-pi/config.json. Serve solo completare il login OAuth del client agy.

Installazione

pi install git:git.enne2.net/enne2/agy-pi
# oppure
pi -e /percorso/a/agy-pi

Consulta docs/configuration.md, docs/tools.md e docs/vocal-workflow.md per i dettagli.

S
Description
Estensione pi per Google Antigravity CLI (agy) come subagent multimodale
Readme
5.1 MiB
Languages
TypeScript 96.4%
Shell 3.4%
Python 0.2%