@agentproto/adapter-antigravity 0.2.1 → 0.2.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.d.ts CHANGED
@@ -44,10 +44,14 @@ declare function antigravityRuntime(): AgentCliRuntime;
44
44
  /**
45
45
  * Antigravity exposes no per-provider api-key store to discover (auth is a
46
46
  * keyring-backed Google login), so there are no providers to enrich — the
47
- * capability report stays the manifest projection. The one honest override is
48
- * the print arm's application contract: model/posture are baked into the spawn
49
- * argv (`--model`, options), applied per fresh subprocess, so a live switch is
50
- * `arg`-based and uncoupled — same as the `mastracode` print arm.
47
+ * manifest projection for providers/models/authStores stays untouched. The
48
+ * one honest override is the print arm's application contract: model/posture
49
+ * are baked into the spawn argv (`--model`, options), applied per fresh
50
+ * subprocess, so a live switch is `arg`-based and uncoupled — same as the
51
+ * `mastracode` print arm. The strategy still ran and returned real adapter
52
+ * knowledge (not a caught throw), so `source` is `"discovered"` — but nothing
53
+ * here came from probing disk/env/process, so `discoverable` stays
54
+ * `"declared"`.
51
55
  */
52
56
  declare const antigravityCapabilities: CapabilityStrategy;
53
57
 
package/dist/index.mjs CHANGED
@@ -148,6 +148,8 @@ var antigravityCapabilities = async (def) => {
148
148
  const base = deriveDeclaredCapabilities(def);
149
149
  return {
150
150
  ...base,
151
+ source: "discovered",
152
+ discoverable: "declared",
151
153
  application: { modelApply: "arg", postureApply: "arg", coupled: false }
152
154
  };
153
155
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAgDO,IAAM,cAA8B,cAAA,CAAe;AAAA,EACxD,IAAA,EAAM,aAAA;AAAA,EACN,EAAA,EAAI,aAAA;AAAA,EACJ,WAAA,EACE,qRAAA;AAAA,EAIF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA;AAAA;AAAA,EAGL,OAAA,EAAS;AAAA,IACP,EAAE,MAAA,EAAQ,MAA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ACE;AAAA,KAMJ;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,OAAA,EAAS,YAAA;AAAA,MACT,MAAA,EACE;AAAA;AAGJ,GACF;AAAA,EACA,MAAM,CAAC,aAAA,EAAe,OAAO,QAAA,EAAU,OAAA,EAAS,iBAAiB,QAAQ;AAC3E,CAAC;AAEM,SAAS,kBAAA,GAAsC;AACpD,EAAA,OAAO,sBAAsB,WAAW,CAAA;AAC1C;AAUO,IAAM,uBAAA,GAA8C,OAAO,GAAA,KAAQ;AACxE,EAAA,MAAM,IAAA,GAAO,2BAA2B,GAAG,CAAA;AAC3C,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,aAAa,EAAE,UAAA,EAAY,OAAO,YAAA,EAAc,KAAA,EAAO,SAAS,KAAA;AAAM,GACxE;AACF","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-antigravity — AIP-45 adapter for Google Antigravity.\n *\n * Antigravity ships a headless CLI, `agy`, but NO ACP mode (open feature\n * request google-antigravity/antigravity-cli#31). So — exactly like the\n * `mastracode` adapter — this is a `protocol: \"print\"` (headless) arm, not\n * an ACP one. We spawn `agy -p \"<prompt>\" --output-format stream-json` per\n * turn and map its NDJSON events.\n *\n * import { antigravity, antigravityRuntime } from \"@agentproto/adapter-antigravity\"\n * const session = await antigravityRuntime().start()\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n *\n * ## Why a bespoke event schema (`antigravity-stream-json`)\n *\n * `agy`'s headless FLAG surface visibly mirrors Claude Code's (`-p`,\n * `--output-format stream-json`, `--continue`), which is a trap: the WIRE\n * events do NOT match Claude's `{ type: \"system\" | \"assistant\" | \"result\",\n * session_id }` taxonomy. Verified against the sample outputs at\n * antigravity.google/docs/cli/headless, every `agy` stream-json line is:\n *\n * {\"event\":\"init\",\"conversation_id\":\"…\",\"init\":{…}}\n * {\"event\":\"step_update\",\"step_update\":{conversation_id,step_index,state,\n * step_type,text_delta?,tool_name?,tool_info?,…}}\n * {\"event\":\"result\",\"result\":{conversation_id,status,response,error?,usage}}\n *\n * i.e. discriminated by `event` (not `type`), payload nested under a matching\n * key, session id a nested `conversation_id`, text as incremental\n * `text_delta` fragments. That is a genuinely different taxonomy, so the\n * print arm carries a dedicated `event_schema: \"antigravity-stream-json\"`\n * mapper (packages/driver/agent-cli/src/protocol/print-arm.ts) rather than\n * reusing the Claude one.\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\nimport {\n deriveDeclaredCapabilities,\n type CapabilityStrategy,\n} from \"@agentproto/provider-kit\"\n\nexport const antigravity: AgentCliHandle = defineAgentCli({\n name: \"antigravity\",\n id: \"antigravity\",\n description:\n \"Google Antigravity's headless CLI (`agy`) — a multi-model coding agent \" +\n \"(Gemini 3.x, Claude, GPT-OSS) run non-interactively via `agy -p \" +\n \"--output-format stream-json`. No ACP mode yet (feature request \" +\n \"google-antigravity/antigravity-cli#31), so this is a print/headless arm.\",\n version: \"0.1.0\",\n bin: \"agy\",\n // Not on npm — the only documented install is the official curl installer,\n // which drops `agy` into ~/.local/bin (antigravity.google/docs/cli/headless).\n install: [\n { method: \"curl\", url: \"https://antigravity.google/cli/install.sh\" },\n ],\n // `agy --version` is the conventional probe; the exact stdout is UNVERIFIED\n // (the headless flag table doesn't document a --version flag), so the range\n // is deliberately permissive. Tighten once a real version string is known.\n version_check: {\n cmd: \"agy --version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.1.0\",\n timeout_ms: 15_000,\n },\n // Antigravity authenticates through the OS keyring + a Google Sign-In\n // browser flow ONLY — there is no documented API-key environment variable.\n // Headless runs reuse the cached credentials, so the user must have run\n // `agy` interactively once on this machine; a non-interactive run with no\n // cached login exits with an \"authentication required\" error. Nothing to\n // inject or scrub here — see ./SECRETS.md.\n auth: {\n ref: \"./SECRETS.md\",\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"print\",\n print: {\n // `agy -p \"<prompt>\"` runs a single prompt non-interactively.\n prompt_flag: \"-p\",\n output_format: [\"--output-format\", \"stream-json\"],\n // No Claude-style `--no-interactive`; `-p` already selects headless.\n pre_prompt: [],\n // `--conversation <id>` resumes a specific prior run by its\n // `conversation_id`. (`--continue`/`-c` resumes the *most recent*, but a\n // value-carrying flag is what the print arm wires from the captured id.)\n resume: { flag: \"--conversation\", kind: \"value\" },\n // See the file header + print-arm.ts: agy's events are `{event: …}`\n // envelopes, NOT Claude's `{type: …}` — hence its own mapper.\n event_schema: \"antigravity-stream-json\",\n },\n session: {\n // The print arm spawns a fresh `agy` per turn; continuity comes from\n // `--conversation <id>`, not a long-lived process.\n mode: \"ephemeral\",\n idle_timeout_ms: 1_800_000,\n context_carryover: false,\n },\n // No `models` block by design. The docs' `agy models` output shows real\n // slugs (e.g. `gemini-3.5-flash-medium`, `claude-sonnet-4-6`), but the list\n // is version-dependent and only partially documented, and every model is\n // served through Antigravity's own backend under ONE Google identity — not\n // a per-provider api-key route the catalog could bill. Declaring a fixed\n // `models.allowed`/`provider` here would assert routing facts we haven't\n // verified; the honest surface is the free-form `model` option below, which\n // forwards any slug from `agy models` straight to `--model`.\n capabilities: {\n streaming: true,\n tool_calls: true,\n // agy runs subagents (`agy agents`, background tasks); step_updates carry\n // `subagent_info`. We don't surface each subagent as its own StreamEvent,\n // but the capability is real.\n sub_agents: true,\n file_io: true,\n // Unverified — declared false rather than overclaiming.\n multimodal: false,\n // `agy --conversation <id>` genuinely resumes a prior conversation\n // (docs: \"Resume prior context with --continue … or --conversation with\n // an ID from a previous run's conversation_id\"). `print.resume` drives it.\n resumable: true,\n bidirectional: false,\n },\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Model slug for this run (see `agy models`), e.g. \" +\n \"`gemini-3.5-flash-medium` or `claude-sonnet-4-6`. Forwarded to \" +\n \"`--model`. Headless mode fails loudly on an unknown slug rather than \" +\n \"silently falling back.\",\n bin_args_template: [\"--model\", \"{value}\"],\n },\n {\n id: \"effort\",\n type: \"enum\",\n enum: [\"low\", \"medium\", \"high\"],\n description: \"Reasoning effort passed to `agy --effort`.\",\n bin_args_template: [\"--effort\", \"{value}\"],\n },\n {\n id: \"agent\",\n type: \"string\",\n description:\n \"Agent to run this prompt as (see `agy agents`). Forwarded to `--agent`.\",\n bin_args_template: [\"--agent\", \"{value}\"],\n },\n {\n id: \"print_timeout\",\n type: \"string\",\n description:\n \"Maximum time `agy` waits for a response, as a duration string \" +\n \"(e.g. `15m`). Forwarded to `--print-timeout` (default 5m).\",\n bin_args_template: [\"--print-timeout\", \"{value}\"],\n },\n {\n id: \"dangerously_skip_permissions\",\n type: \"boolean\",\n description:\n \"Auto-approve EVERY tool call (file writes, command execution) for \" +\n \"this run via `--dangerously-skip-permissions`. Off by default; \" +\n \"prefer scoped `permissions.allow` rules in agy's settings.json.\",\n bin_args_append_when_true: [\"--dangerously-skip-permissions\"],\n },\n {\n id: \"terminal_sandbox\",\n type: \"boolean\",\n description:\n \"Run agy with its terminal sandbox restrictions enabled (`--sandbox`).\",\n bin_args_append_when_true: [\"--sandbox\"],\n },\n ],\n continuation: {\n default: \"none\",\n supported: [\"none\", \"transcript\", \"native-resume\"],\n },\n metadata: {\n acp: {\n checked: \"2026-08-06\",\n result:\n \"Antigravity has no ACP mode. Tracked upstream as feature request \" +\n \"google-antigravity/antigravity-cli#31; until it ships this adapter \" +\n \"stays a print/headless arm.\",\n },\n models: {\n checked: \"2026-08-06\",\n result:\n \"`agy models` (per antigravity.google/docs/models + the headless docs) \" +\n \"lists slugs like gemini-3.6-flash-high, gemini-3.6-flash-medium, \" +\n \"gemini-3.5-flash-medium, gemini-3.1-pro-high, claude-sonnet-4-6 — \" +\n \"plus GPT-OSS variants. The full list is version-dependent and only \" +\n \"partially documented, so no fixed `models.allowed` is declared; pass \" +\n \"any slug through the `model` option.\",\n },\n auth: {\n checked: \"2026-08-06\",\n result:\n \"OS keyring + Google Sign-In browser flow only; no documented API-key \" +\n \"env var. Run `agy` interactively once to cache credentials before any \" +\n \"headless run.\",\n },\n },\n tags: [\"antigravity\", \"agy\", \"google\", \"print\", \"agent-runtime\", \"coding\"],\n})\n\nexport function antigravityRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(antigravity)\n}\n\n/**\n * Antigravity exposes no per-provider api-key store to discover (auth is a\n * keyring-backed Google login), so there are no providers to enrich — the\n * capability report stays the manifest projection. The one honest override is\n * the print arm's application contract: model/posture are baked into the spawn\n * argv (`--model`, options), applied per fresh subprocess, so a live switch is\n * `arg`-based and uncoupled — same as the `mastracode` print arm.\n */\nexport const antigravityCapabilities: CapabilityStrategy = async (def) => {\n const base = deriveDeclaredCapabilities(def)\n return {\n ...base,\n application: { modelApply: \"arg\", postureApply: \"arg\", coupled: false },\n }\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAgDO,IAAM,cAA8B,cAAA,CAAe;AAAA,EACxD,IAAA,EAAM,aAAA;AAAA,EACN,EAAA,EAAI,aAAA;AAAA,EACJ,WAAA,EACE,qRAAA;AAAA,EAIF,OAAA,EAAS,OAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA;AAAA;AAAA,EAGL,OAAA,EAAS;AAAA,IACP,EAAE,MAAA,EAAQ,MAAA,EAAQ,GAAA,EAAK,2CAAA;AAA4C,GACrE;AAAA;AAAA;AAAA;AAAA,EAIA,aAAA,EAAe;AAAA,IACb,GAAA,EAAK,eAAA;AAAA,IACL,KAAA,EAAO,sBAAA;AAAA,IACP,KAAA,EAAO,SAAA;AAAA,IACP,UAAA,EAAY;AAAA,GACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAA,EAAM;AAAA,IACJ,GAAA,EAAK;AAAA,GACP;AAAA,EACA,OAAA,EAAS,cAAA;AAAA,EACT,QAAA,EAAU,OAAA;AAAA,EAC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AAA;AAC3C,EAAA,OAAO;AAAA,IACL,GAAG,IAAA;AAAA,IACH,MAAA,EAAQ,YAAA;AAAA,IACR,YAAA,EAAc,UAAA;AAAA,IACd,aAAa,EAAE,UAAA,EAAY,OAAO,YAAA,EAAc,KAAA,EAAO,SAAS,KAAA;AAAM,GACxE;AACF","file":"index.mjs","sourcesContent":["/**\n * @agentproto/adapter-antigravity — AIP-45 adapter for Google Antigravity.\n *\n * Antigravity ships a headless CLI, `agy`, but NO ACP mode (open feature\n * request google-antigravity/antigravity-cli#31). So — exactly like the\n * `mastracode` adapter — this is a `protocol: \"print\"` (headless) arm, not\n * an ACP one. We spawn `agy -p \"<prompt>\" --output-format stream-json` per\n * turn and map its NDJSON events.\n *\n * import { antigravity, antigravityRuntime } from \"@agentproto/adapter-antigravity\"\n * const session = await antigravityRuntime().start()\n * for await (const evt of session.send({ role: \"user\", content: \"...\" })) {\n * console.log(evt)\n * }\n * await session.close()\n *\n * ## Why a bespoke event schema (`antigravity-stream-json`)\n *\n * `agy`'s headless FLAG surface visibly mirrors Claude Code's (`-p`,\n * `--output-format stream-json`, `--continue`), which is a trap: the WIRE\n * events do NOT match Claude's `{ type: \"system\" | \"assistant\" | \"result\",\n * session_id }` taxonomy. Verified against the sample outputs at\n * antigravity.google/docs/cli/headless, every `agy` stream-json line is:\n *\n * {\"event\":\"init\",\"conversation_id\":\"…\",\"init\":{…}}\n * {\"event\":\"step_update\",\"step_update\":{conversation_id,step_index,state,\n * step_type,text_delta?,tool_name?,tool_info?,…}}\n * {\"event\":\"result\",\"result\":{conversation_id,status,response,error?,usage}}\n *\n * i.e. discriminated by `event` (not `type`), payload nested under a matching\n * key, session id a nested `conversation_id`, text as incremental\n * `text_delta` fragments. That is a genuinely different taxonomy, so the\n * print arm carries a dedicated `event_schema: \"antigravity-stream-json\"`\n * mapper (packages/driver/agent-cli/src/protocol/print-arm.ts) rather than\n * reusing the Claude one.\n */\n\nimport {\n createAgentCliRuntime,\n defineAgentCli,\n type AgentCliHandle,\n type AgentCliRuntime,\n} from \"@agentproto/driver-agent-cli\"\nimport {\n deriveDeclaredCapabilities,\n type CapabilityStrategy,\n} from \"@agentproto/provider-kit\"\n\nexport const antigravity: AgentCliHandle = defineAgentCli({\n name: \"antigravity\",\n id: \"antigravity\",\n description:\n \"Google Antigravity's headless CLI (`agy`) — a multi-model coding agent \" +\n \"(Gemini 3.x, Claude, GPT-OSS) run non-interactively via `agy -p \" +\n \"--output-format stream-json`. No ACP mode yet (feature request \" +\n \"google-antigravity/antigravity-cli#31), so this is a print/headless arm.\",\n version: \"0.1.0\",\n bin: \"agy\",\n // Not on npm — the only documented install is the official curl installer,\n // which drops `agy` into ~/.local/bin (antigravity.google/docs/cli/headless).\n install: [\n { method: \"curl\", url: \"https://antigravity.google/cli/install.sh\" },\n ],\n // `agy --version` is the conventional probe; the exact stdout is UNVERIFIED\n // (the headless flag table doesn't document a --version flag), so the range\n // is deliberately permissive. Tighten once a real version string is known.\n version_check: {\n cmd: \"agy --version\",\n parse: \"(\\\\d+\\\\.\\\\d+\\\\.\\\\d+)\",\n range: \">=0.1.0\",\n timeout_ms: 15_000,\n },\n // Antigravity authenticates through the OS keyring + a Google Sign-In\n // browser flow ONLY — there is no documented API-key environment variable.\n // Headless runs reuse the cached credentials, so the user must have run\n // `agy` interactively once on this machine; a non-interactive run with no\n // cached login exits with an \"authentication required\" error. Nothing to\n // inject or scrub here — see ./SECRETS.md.\n auth: {\n ref: \"./SECRETS.md\",\n },\n sandbox: \"./SANDBOX.md\",\n protocol: \"print\",\n print: {\n // `agy -p \"<prompt>\"` runs a single prompt non-interactively.\n prompt_flag: \"-p\",\n output_format: [\"--output-format\", \"stream-json\"],\n // No Claude-style `--no-interactive`; `-p` already selects headless.\n pre_prompt: [],\n // `--conversation <id>` resumes a specific prior run by its\n // `conversation_id`. (`--continue`/`-c` resumes the *most recent*, but a\n // value-carrying flag is what the print arm wires from the captured id.)\n resume: { flag: \"--conversation\", kind: \"value\" },\n // See the file header + print-arm.ts: agy's events are `{event: …}`\n // envelopes, NOT Claude's `{type: …}` — hence its own mapper.\n event_schema: \"antigravity-stream-json\",\n },\n session: {\n // The print arm spawns a fresh `agy` per turn; continuity comes from\n // `--conversation <id>`, not a long-lived process.\n mode: \"ephemeral\",\n idle_timeout_ms: 1_800_000,\n context_carryover: false,\n },\n // No `models` block by design. The docs' `agy models` output shows real\n // slugs (e.g. `gemini-3.5-flash-medium`, `claude-sonnet-4-6`), but the list\n // is version-dependent and only partially documented, and every model is\n // served through Antigravity's own backend under ONE Google identity — not\n // a per-provider api-key route the catalog could bill. Declaring a fixed\n // `models.allowed`/`provider` here would assert routing facts we haven't\n // verified; the honest surface is the free-form `model` option below, which\n // forwards any slug from `agy models` straight to `--model`.\n capabilities: {\n streaming: true,\n tool_calls: true,\n // agy runs subagents (`agy agents`, background tasks); step_updates carry\n // `subagent_info`. We don't surface each subagent as its own StreamEvent,\n // but the capability is real.\n sub_agents: true,\n file_io: true,\n // Unverified — declared false rather than overclaiming.\n multimodal: false,\n // `agy --conversation <id>` genuinely resumes a prior conversation\n // (docs: \"Resume prior context with --continue … or --conversation with\n // an ID from a previous run's conversation_id\"). `print.resume` drives it.\n resumable: true,\n bidirectional: false,\n },\n options: [\n {\n id: \"model\",\n type: \"string\",\n description:\n \"Model slug for this run (see `agy models`), e.g. \" +\n \"`gemini-3.5-flash-medium` or `claude-sonnet-4-6`. Forwarded to \" +\n \"`--model`. Headless mode fails loudly on an unknown slug rather than \" +\n \"silently falling back.\",\n bin_args_template: [\"--model\", \"{value}\"],\n },\n {\n id: \"effort\",\n type: \"enum\",\n enum: [\"low\", \"medium\", \"high\"],\n description: \"Reasoning effort passed to `agy --effort`.\",\n bin_args_template: [\"--effort\", \"{value}\"],\n },\n {\n id: \"agent\",\n type: \"string\",\n description:\n \"Agent to run this prompt as (see `agy agents`). Forwarded to `--agent`.\",\n bin_args_template: [\"--agent\", \"{value}\"],\n },\n {\n id: \"print_timeout\",\n type: \"string\",\n description:\n \"Maximum time `agy` waits for a response, as a duration string \" +\n \"(e.g. `15m`). Forwarded to `--print-timeout` (default 5m).\",\n bin_args_template: [\"--print-timeout\", \"{value}\"],\n },\n {\n id: \"dangerously_skip_permissions\",\n type: \"boolean\",\n description:\n \"Auto-approve EVERY tool call (file writes, command execution) for \" +\n \"this run via `--dangerously-skip-permissions`. Off by default; \" +\n \"prefer scoped `permissions.allow` rules in agy's settings.json.\",\n bin_args_append_when_true: [\"--dangerously-skip-permissions\"],\n },\n {\n id: \"terminal_sandbox\",\n type: \"boolean\",\n description:\n \"Run agy with its terminal sandbox restrictions enabled (`--sandbox`).\",\n bin_args_append_when_true: [\"--sandbox\"],\n },\n ],\n continuation: {\n default: \"none\",\n supported: [\"none\", \"transcript\", \"native-resume\"],\n },\n metadata: {\n acp: {\n checked: \"2026-08-06\",\n result:\n \"Antigravity has no ACP mode. Tracked upstream as feature request \" +\n \"google-antigravity/antigravity-cli#31; until it ships this adapter \" +\n \"stays a print/headless arm.\",\n },\n models: {\n checked: \"2026-08-06\",\n result:\n \"`agy models` (per antigravity.google/docs/models + the headless docs) \" +\n \"lists slugs like gemini-3.6-flash-high, gemini-3.6-flash-medium, \" +\n \"gemini-3.5-flash-medium, gemini-3.1-pro-high, claude-sonnet-4-6 — \" +\n \"plus GPT-OSS variants. The full list is version-dependent and only \" +\n \"partially documented, so no fixed `models.allowed` is declared; pass \" +\n \"any slug through the `model` option.\",\n },\n auth: {\n checked: \"2026-08-06\",\n result:\n \"OS keyring + Google Sign-In browser flow only; no documented API-key \" +\n \"env var. Run `agy` interactively once to cache credentials before any \" +\n \"headless run.\",\n },\n },\n tags: [\"antigravity\", \"agy\", \"google\", \"print\", \"agent-runtime\", \"coding\"],\n})\n\nexport function antigravityRuntime(): AgentCliRuntime {\n return createAgentCliRuntime(antigravity)\n}\n\n/**\n * Antigravity exposes no per-provider api-key store to discover (auth is a\n * keyring-backed Google login), so there are no providers to enrich — the\n * manifest projection for providers/models/authStores stays untouched. The\n * one honest override is the print arm's application contract: model/posture\n * are baked into the spawn argv (`--model`, options), applied per fresh\n * subprocess, so a live switch is `arg`-based and uncoupled — same as the\n * `mastracode` print arm. The strategy still ran and returned real adapter\n * knowledge (not a caught throw), so `source` is `\"discovered\"` — but nothing\n * here came from probing disk/env/process, so `discoverable` stays\n * `\"declared\"`.\n */\nexport const antigravityCapabilities: CapabilityStrategy = async (def) => {\n const base = deriveDeclaredCapabilities(def)\n return {\n ...base,\n source: \"discovered\",\n discoverable: \"declared\",\n application: { modelApply: \"arg\", postureApply: \"arg\", coupled: false },\n }\n}\n\nexport type { AgentCliHandle, AgentCliRuntime }\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentproto/adapter-antigravity",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "@agentproto/adapter-antigravity — AIP-45 AGENT-CLI adapter for Google Antigravity's headless CLI (`agy`). Spawns `agy -p --output-format stream-json`; Antigravity has no ACP mode yet (feature request google-antigravity/antigravity-cli#31).",
5
5
  "keywords": [
6
6
  "agentproto",
@@ -42,7 +42,7 @@
42
42
  "access": "public"
43
43
  },
44
44
  "dependencies": {
45
- "@agentproto/driver-agent-cli": "2.2.1",
45
+ "@agentproto/driver-agent-cli": "2.3.0",
46
46
  "@agentproto/provider-kit": "0.4.1"
47
47
  },
48
48
  "devDependencies": {