import type { Capability } from "./capability-types";

export const INTEGRATION_CAPABILITIES: readonly Capability[] = [
  {
    command: ["grok", "status"],
    usage: "ocx grok status [--json]",
    summary: "Read Grok model fence state and catalog.",
    routes: [{"method": "GET", "path": "/api/grok"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["integration grok is an alias of grok; show aliases status. Saving selection and applying the saved fence are separate actions.", "Apply receipts can report changed or skippedReason; success is not a guarantee of a changed client file."],
  },
  {
    command: ["grok", "set"],
    usage: "ocx grok set <model,model...> [--json]",
    summary: "Replace the excluded Grok model list.",
    routes: [{"method": "PUT", "path": "/api/grok/selection"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["integration grok is an alias of grok; show aliases status. Saving selection and applying the saved fence are separate actions.", "Apply receipts can report changed or skippedReason; success is not a guarantee of a changed client file."],
  },
  {
    command: ["grok", "exclude"],
    usage: "ocx grok exclude <model,model...> [--json]",
    summary: "Add models to the Grok exclusion list.",
    routes: [{"method": "GET", "path": "/api/grok"}, {"method": "PUT", "path": "/api/grok/selection"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["integration grok is an alias of grok; show aliases status. Saving selection and applying the saved fence are separate actions.", "Apply receipts can report changed or skippedReason; success is not a guarantee of a changed client file."],
  },
  {
    command: ["grok", "include"],
    usage: "ocx grok include <model,model...> [--json]",
    summary: "Remove models from the Grok exclusion list.",
    routes: [{"method": "GET", "path": "/api/grok"}, {"method": "PUT", "path": "/api/grok/selection"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["integration grok is an alias of grok; show aliases status. Saving selection and applying the saved fence are separate actions.", "Apply receipts can report changed or skippedReason; success is not a guarantee of a changed client file."],
  },
  {
    command: ["grok", "clear"],
    usage: "ocx grok clear [--json]",
    summary: "Clear Grok exclusions.",
    routes: [{"method": "PUT", "path": "/api/grok/selection"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["integration grok is an alias of grok; show aliases status. Saving selection and applying the saved fence are separate actions.", "Apply receipts can report changed or skippedReason; success is not a guarantee of a changed client file."],
  },
  {
    command: ["grok", "apply"],
    usage: "ocx grok apply [--json]",
    summary: "Apply the saved Grok model fence.",
    routes: [{"method": "POST", "path": "/api/grok/apply"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["integration grok is an alias of grok; show aliases status. Saving selection and applying the saved fence are separate actions.", "Apply receipts can report changed or skippedReason; success is not a guarantee of a changed client file."],
  },
  {
    command: ["integration", "client", "status"],
    usage: "ocx integration client status [--client <id>] [--profile <id>] [--json]",
    summary: "Read all file integrations, one client or an Aside profile.",
    routes: [{"method": "GET", "path": "/api/client-integrations"}, {"method": "GET", "path": "/api/client-integrations/{clientId}"}, {"method": "GET", "path": "/api/client-integrations/aside/profiles"}, {"method": "GET", "path": "/api/client-integrations/aside/profiles/{profileId}"}],
    flags: [{"name": "--client", "value": "string", "summary": "File integration ID; aside selects profiles."}, {"name": "--profile", "value": "number", "summary": "Aside nonnegative integer account ID; requires --client aside."}, {"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["show and list alias status; omitted Aside profile means the aggregate profile collection."],
  },
  {
    command: ["integration", "client", "history"],
    usage: "ocx integration client history [--client <id>] [--profile <id>] [--json]",
    summary: "Read integration rollback history and snapshot availability.",
    routes: [{"method": "GET", "path": "/api/client-integrations/journal"}, {"method": "GET", "path": "/api/client-integrations/aside/profiles/journal"}, {"method": "GET", "path": "/api/client-integrations/aside/profiles/{profileId}/journal"}],
    flags: [{"name": "--client", "value": "string", "summary": "File integration ID; aside selects profiles."}, {"name": "--profile", "value": "number", "summary": "Aside nonnegative integer account ID; requires --client aside."}, {"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["journal is an alias. Ordinary client filtering uses ?client=; expired snapshots remain visibly expired."],
  },
  {
    command: ["integration","client","enable"],
    usage: "ocx integration client enable --client <id> [--profile <id>] [--overwrite-conflict] [--plan-fingerprint <token>] [--model-names <alias|routed>] [--reasoning-default <model=effort> ... | --clear-reasoning-defaults] [--json]",
    summary: "Apply the selected managed file integration.",
    routes: [{"method":"PUT","path":"/api/client-integrations/{clientId}"},{"method":"PUT","path":"/api/client-integrations/aside/profiles"},{"method":"PUT","path":"/api/client-integrations/aside/profiles/{profileId}"}],
    flags: [{"name":"--model-names","value":"string","summary":"Hermes/Command Code apply or overwrite only: alias or routed; omission preserves managed policy."},{"name":"--client","value":"string","summary":"Explicit file integration ID.","required":true},{"name":"--profile","value":"number","summary":"Aside nonnegative integer account ID; requires --client aside."},{"name":"--overwrite-conflict","value":"boolean","summary":"Explicitly permit replacing a conflicting block."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--plan-fingerprint","value":"string","summary":"Optional versioned token from a matching preview; stale intent is refused without retry."},{"name":"--reasoning-default","value":"string","summary":"Repeat MODEL=EFFORT to replace the full Droid defaults map; exact model IDs, duplicate keys refused."},{"name":"--clear-reasoning-defaults","value":"boolean","summary":"Droid apply/overwrite only: send an empty map, distinct from omitted inherited defaults."}],
    mutates: true,
    json: "payload",
    details: ["A Home-only decision, like the dashboard toggle: once the Home uses route intent the server records it as this Home's override so ocx sync keeps it, and linked Children keep their defaults (ocx route to <client> on|off changes those). On a Child a plain toggle is refused with the Home command. An omitted Aside profile toggles all Aside profiles. Ownership, snapshots, journal and conflict refusals remain server-owned.","Partial Aside failures remain failures after emitting the per-profile result. Never infer permission to overwrite from a refusal.","Bound Aside mutations require one explicit profile. Repeat the exact preview action/profile/options. The token is concurrency evidence, not authorization; stale state requires a new explicit preview.","Droid map omission preserves inheritance; supplied entries replace the full map, clear sends {}. Only Droid apply/overwrite accepts these options."],
  },
  {
    command: ["integration","client","disable"],
    usage: "ocx integration client disable --client <id> [--profile <id>] [--plan-fingerprint <token>] [--json]",
    summary: "Disable the selected managed file integration.",
    routes: [{"method":"PUT","path":"/api/client-integrations/{clientId}"},{"method":"PUT","path":"/api/client-integrations/aside/profiles"},{"method":"PUT","path":"/api/client-integrations/aside/profiles/{profileId}"}],
    flags: [{"name":"--client","value":"string","summary":"Explicit file integration ID.","required":true},{"name":"--profile","value":"number","summary":"Aside nonnegative integer account ID; requires --client aside."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--plan-fingerprint","value":"string","summary":"Optional versioned token from a matching preview; stale intent is refused without retry."}],
    mutates: true,
    json: "payload",
    details: ["A Home-only decision, like the dashboard toggle: once the Home uses route intent the server records it as this Home's override so ocx sync keeps it, and linked Children keep their defaults (ocx route to <client> on|off changes those). On a Child a plain toggle is refused with the Home command. An omitted Aside profile toggles all Aside profiles. Ownership, snapshots, journal and conflict refusals remain server-owned.","Partial Aside failures remain failures after emitting the per-profile result. Never infer permission to overwrite from a refusal.","Bound Aside mutations require one explicit profile. Repeat the exact preview action/profile/options. The token is concurrency evidence, not authorization; stale state requires a new explicit preview."],
  },
  {
    command: ["integration","client","restore"],
    usage: "ocx integration client restore --op <opId> [--client aside --profile <id>] [--confirm-drift] [--preview | --plan-fingerprint <token>] [--json]",
    summary: "Restore a selected rollback operation, retaining drift refusal.",
    routes: [{"method":"POST","path":"/api/client-integrations/restore"},{"method":"POST","path":"/api/client-integrations/aside/profiles/{profileId}/restore"},{"method":"POST","path":"/api/client-integrations/restore/preview"},{"method":"POST","path":"/api/client-integrations/aside/profiles/{profileId}/preview"}],
    flags: [{"name":"--op","value":"string","summary":"Operation ID; --op-id is an alias.","required":true},{"name":"--client","value":"string","summary":"File integration ID; aside selects profiles."},{"name":"--profile","value":"number","summary":"Aside nonnegative integer account ID; requires --client aside."},{"name":"--confirm-drift","value":"boolean","summary":"Explicitly allow replacing edits made after the snapshot."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."},{"name":"--preview","value":"boolean","summary":"Inspect restoration without mutating; exclusive with a commit fingerprint."},{"name":"--plan-fingerprint","value":"string","summary":"Optional versioned token from a matching preview; stale intent is refused without retry."}],
    mutates: true,
    json: "payload",
    details: ["With --client, restore requires --profile; only Aside profiles accept that selector. No automatic drift confirmation or retry.","Preview preserves exact opId/profile/confirm-drift intent. Generic restore derives the client on the server; the returned plan does not embed opId or complete command input.","A refused or no-op preview is completed inspection, not applied work. A stale bound mutation exits5 with a fixed re-preview hint; no replacement token is automatically adopted."],
  },
  {
    command: ["commandcode", "restore"],
    usage: "ocx commandcode restore --op <opId> [--confirm-drift] [--preview | --plan-fingerprint <token>] [--json]",
    summary: "Restore a Command Code rollback operation, retaining client ownership and drift checks.",
    routes: [{ method: "POST", path: "/api/client-integrations/commandcode/restore" }, { method: "POST", path: "/api/client-integrations/commandcode/restore/preview" }],
    flags: [
      { name: "--op", value: "string", summary: "Command Code operation ID; --op-id is an alias.", required: true },
      { name: "--confirm-drift", value: "boolean", summary: "Explicitly allow replacing edits made after the snapshot." },
      { name: "--preview", value: "boolean", summary: "Inspect restoration without mutating; exclusive with a commit fingerprint." },
      { name: "--plan-fingerprint", value: "string", summary: "Optional versioned token from a matching preview; stale intent is refused without retry." },
      { name: "--json", value: "boolean", summary: "Emit the result as JSON." },
    ],
    mutates: true,
    json: "payload",
    details: ["cmd restore is an alias. --client and --profile are rejected; the dedicated route binds the operation to Command Code.", "Older proxies without the dedicated route fail without a generic restore fallback. Redirects are refused.", "Preview preserves the operation and drift intent. A stale bound mutation requires a new explicit preview."],
  },
  {
    command: ["claude", "config", "status"],
    usage: "ocx claude config status [--json]",
    summary: "Read effective Claude Code configuration.",
    routes: [{"method": "GET", "path": "/api/claude-code"}],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["show is an alias; integration claude forwards to the same handler."],
  },
  {
    command: ["claude", "config", "set"],
    usage: "ocx claude config set [--enabled <on|off>] [--auth-mode <auto|proxy|subscription>] [--system-env <on|off>] [--fast-mode <on|off>] [--auto-context <on|off>] [--compact-window <tokens|default>] [--context-accounting <1m|200k>] [--inject-agents <on|off>] [--native-passthrough <on|off>] [--small-fast-model <id|->] [--model-map <from=to,...|->] [--blocked-skills <name,name|->] [--web-model <id|->] [--web-backend <openai|anthropic|xai|gemini|exa|->] [--vision-model <id|->] [--vision-backend <openai|anthropic|->] [--json]; or ocx claude config set --first-party <on|off> [--json]",
    summary: "Change Claude Code settings through the runtime owner.",
    routes: [{"method": "GET", "path": "/api/claude-code"}, {"method": "PUT", "path": "/api/claude-code"}],
    flags: [{"name": "--enabled", "value": "string", "summary": "on or off."}, {"name": "--auth-mode", "value": "string", "summary": "auto, proxy or subscription."}, {"name": "--system-env", "value": "string", "summary": "on or off."}, {"name": "--fast-mode", "value": "string", "summary": "on or off."}, {"name": "--auto-context", "value": "string", "summary": "on or off."}, {"name": "--compact-window", "value": "string", "summary": "Positive token count or default to clear."}, {"name": "--context-accounting", "value": "string", "summary": "1m (default) or 200k."}, {"name": "--inject-agents", "value": "string", "summary": "on or off."}, {"name": "--native-passthrough", "value": "string", "summary": "on or off; off routes bare Claude models through opencodex instead of Claude Code's own login."},{"name": "--small-fast-model", "value": "string", "summary": "Model ID; - clears."}, {"name": "--model-map", "value": "string", "summary": "Comma-separated from=to mappings; - clears."}, {"name": "--blocked-skills", "value": "string", "summary": "Comma-separated names; - clears."}, {"name": "--web-model", "value": "string", "summary": "Model ID; - clears."}, {"name": "--web-backend", "value": "string", "summary": "openai, anthropic, xai, gemini, exa or -."}, {"name": "--vision-model", "value": "string", "summary": "Model ID; - clears."}, {"name": "--vision-backend", "value": "string", "summary": "openai, anthropic or -."}, {"name": "--first-party", "value": "string", "summary": "on or off; must be the only setting."}, {"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["At least one setting is required. --first-party must be set alone and writes Claude settings immediately.", "--native-passthrough checks support on the running proxy before sending the settings update.", "Clear both helper model and backend with - to restore inheritance. Preserve shared_proxy_retained warnings."],
  },
  {
    command: ["claude", "desktop", "show"],
    usage: "ocx claude desktop show [--json]",
    summary: "Inspect the desired profile derived on this machine.",
    routes: [],
    flags: [{"name": "--json", "value": "boolean", "summary": "Emit the result as JSON."}],
    mutates: false,
    json: "envelope",
    details: ["Local config/catalog derivation, not GET of the remote desired profile. On a connected client scope is local; apply uses the hub profile. Catalog derivation may discover upstream models."],
  },
  {
    command: ["claude", "desktop", "move"],
    usage: "ocx claude desktop move <provider/model> <opus|fable|sonnet|haiku> [--default]",
    summary: "Move an available route to a local Desktop family.",
    routes: [],
    flags: [{"name": "--default", "value": "boolean", "summary": "Make this route the family default."}],
    mutates: true,
    json: "none",
    details: ["Local profile persistence only; no management HTTP or --json. On connected clients this does not change the hub profile."],
  },
  {
    command: ["claude", "desktop", "default"],
    usage: "ocx claude desktop default <opus|fable|sonnet|haiku> <provider/model|none>",
    summary: "Set or clear a local Desktop family default.",
    routes: [],
    flags: [],
    mutates: true,
    json: "none",
    details: ["Local profile persistence only; none clears the default. Connected Desktop apply uses the hub profile."],
  },
  {
    command: ["claude", "desktop", "export"],
    usage: "ocx claude desktop export <path|->",
    summary: "Export the persisted local Desktop profile.",
    routes: [],
    flags: [],
    mutates: true,
    json: "none",
    details: ["Local file output; - writes JSON to stdout. There is no --json flag. A file destination is overwritten; this is not a GUI draft export."],
  },
  {
    command: ["claude", "desktop", "import"],
    usage: "ocx claude desktop import <path> [--apply]",
    summary: "Import a local Desktop profile, optionally applying it as a static gateway.",
    routes: [{"method": "POST", "path": "/api/claude-desktop/apply"}],
    flags: [{"name": "--apply", "value": "boolean", "summary": "After saving, apply as a static gateway."}],
    mutates: true,
    json: "none",
    details: ["Without --apply this only persists locally. With a live local proxy, gateway apply is delegated by HTTP; otherwise local helpers apply it.", "Connected clients refuse import --apply. A saved profile can remain saved after application fails; no --json mode."],
  },
  {
    command: ["claude", "desktop", "apply"],
    usage: "ocx claude desktop [apply] [--first-party | --gateway [--static|--hybrid|--discovery-only]]",
    summary: "Apply Claude Desktop first-party interception or gateway profile.",
    routes: [{"method": "POST", "path": "/api/claude-desktop/apply"}],
    flags: [{"name": "--first-party", "value": "boolean", "summary": "Keep Desktop on claude.ai and intercept its Code tab."}, {"name": "--gateway", "value": "boolean", "summary": "Apply a third-party gateway profile."}, {"name": "--static", "value": "boolean", "summary": "Static gateway model catalog."}, {"name": "--hybrid", "value": "boolean", "summary": "Hybrid gateway catalog."}, {"name": "--discovery-only", "value": "boolean", "summary": "Discovery-only gateway catalog."}],
    mutates: true,
    json: "none",
    details: ["Uses local helpers or the live local apply route; connected gateway clients use the hub profile download path. No --json mode.", "First-party requires a local hub with interception enabled. Preserve account-risk warnings, trust prompts and ownership refusals; metadata grants no consent.", "Application and committed-marker persistence can diverge; inspect status after application and preserve warnings."],
  },
  {
    command: ["integration","client","preview"],
    usage: "ocx integration client preview --client <id> --operation <apply|overwrite|disable> [--profile <id>] [--model-names <alias|routed>] [--reasoning-default <model=effort> ... | --clear-reasoning-defaults] [--json]",
    summary: "Inspect a managed client change before choosing whether to apply it.",
    routes: [{"method":"POST","path":"/api/client-integrations/preview"},{"method":"POST","path":"/api/client-integrations/aside/profiles/{profileId}/preview"}],
    flags: [{"name":"--model-names","value":"string","summary":"Hermes/Command Code apply or overwrite only: alias or routed; omission preserves managed policy."},{"name":"--client","required":true,"value":"string","summary":"Explicit client; profile selectors require aside."},{"name":"--profile","value":"number","summary":"One Aside nonnegative integer profile ID."},{"name":"--operation","required":true,"value":"string","summary":"Required apply, overwrite or disable; Aside requires one profile."},{"name":"--reasoning-default","value":"string","summary":"Repeat MODEL=EFFORT to replace the full Droid defaults map; exact model IDs, duplicate keys refused."},{"name":"--clear-reasoning-defaults","value":"boolean","summary":"Droid apply/overwrite only: send an empty map, distinct from omitted inherited defaults."},{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["Uses an existing passive model snapshot; an unavailable preview never secretly refreshes providers or changes client files.","A valid refused plan, including an unbound refusal, is readable inspection. Only an applicable bound token can accompany a later write; repeat the original command intent.","Shows structural paths and consequences, not secret values or a client-file diff."],
  },
  {
    command: ["integration","client","history","remove"],
    usage: "ocx integration client history remove --op <opId> --yes [--client aside [--profile <id>]] [--json]",
    summary: "Retire a selected rollback-history entry and its retained snapshot.",
    routes: [{"method":"DELETE","path":"/api/client-integrations/journal"},{"method":"DELETE","path":"/api/client-integrations/aside/profiles/journal"},{"method":"DELETE","path":"/api/client-integrations/aside/profiles/{profileId}/journal"}],
    flags: [{"name":"--op","required":true,"value":"string","summary":"Exact operation ID to retire."},{"name":"--yes","required":true,"value":"boolean","summary":"Required explicit confirmation of irreversible rollback-history retirement."},{"name":"--client","value":"string","summary":"Explicit client; profile selectors require aside."},{"name":"--profile","value":"number","summary":"One Aside nonnegative integer profile ID."},{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["journal remove is an alias. Omitting --client addresses the global journal; --client aside selects Aside history and optional --profile narrows it. Other clients are rejected for deletion scope.","The server protects the latest row and validates ownership. snapshotRemoved:false reports committed retirement with incomplete cleanup and exits1; never retry blindly or claim rollback."],
  },
  {
    command: ["integration","client","sync"],
    usage: "ocx integration client sync --client aside [--json]",
    summary: "Refresh the managed Aside profiles through their existing owner.",
    routes: [{"method":"POST","path":"/api/client-integrations/aside/sync"}],
    flags: [{"name":"--client","required":true,"value":"string","summary":"Explicit client; profile selectors require aside."},{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: true,
    json: "envelope",
    details: ["Uses the existing local attested synchronization exchange; no new public target/auth option, profile override or broad sync fallback.","Empty results mean no eligible profiles. Partial or malformed outcomes stay nonzero with safe per-profile recovery facts."],
  },
  {
    command: ["claude","desktop","profile","show"],
    usage: "ocx claude desktop profile show [--json]",
    summary: "Read the selected running proxy’s Desktop profile and available models.",
    routes: [{"method":"GET","path":"/api/claude-desktop"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["The existing claude desktop show remains local. Runtime profile observation can gather model inventory; it is not guaranteed offline."],
  },
  {
    command: ["claude","desktop","profile","import"],
    usage: "ocx claude desktop profile import <file|-> [--json]",
    summary: "Validate and save a Desktop profile on the selected running proxy.",
    routes: [{"method":"PUT","path":"/api/claude-desktop"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["Bounded JSON file or explicit stdin; canonical DesktopProfile validation and the management owner retain availability, concurrent-save and applied-marker rules.","Save only: --apply and native-mode flags are refused, and failed management writes never save a local fallback. Apply separately through the existing Desktop workflow."],
  },
  {
    command: ["integration","native","cursor","status"],
    usage: "ocx integration native cursor status [--json]",
    summary: "Read Cursor installation, gateway requirements and model capabilities.",
    routes: [{"method":"GET","path":"/api/native-integrations/cursor"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["Status can gather model inventory but does not install or toggle Cursor. A displayed placeholder does not authorize a credential-required listener."],
  },
  {
    command: ["integration","native","cursor","local-installer"],
    usage: "ocx integration native cursor local-installer [--json]",
    summary: "Read the available Cursor installer link without downloading or installing it.",
    routes: [{"method":"GET","path":"/api/native-integrations/cursor/local-installer"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit one validated task result as JSON."}],
    mutates: false,
    json: "payload",
    details: ["May fetch the public update manifest. available:false and nullable reason are valid observations; no installation or trust change is performed."],
  },
  {
    command: ["connect","antigravity"],
    usage: "ocx connect antigravity [--model <id>] [--json]",
    summary: "Point Google's Antigravity desktop app at this proxy, keeping a restore record.",
    routes: [{"method":"POST","path":"/api/gateway-clients/{id}/connect"}],
    flags: [{"name":"--model","value":"string","summary":"Default model selector written to the Antigravity settings."},{"name":"--json","value":"boolean","summary":"Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["Updates the Antigravity user settings on this machine. With no running proxy the same change is made locally, provided the configured port is fixed. The proxy bind must permit local requests without a data-plane credential."],
  },
  {
    command: ["connect","agy"],
    usage: "ocx connect agy [--json]",
    summary: "Point Google's agy CLI at this proxy, keeping a restore record.",
    routes: [{"method":"POST","path":"/api/gateway-clients/{id}/connect"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["Updates shell profiles on this machine. With no running proxy the same change is made locally, provided the configured port is fixed. The proxy bind must permit local requests without a data-plane credential."],
  },
  {
    command: ["connect","antigravity","status"],
    usage: "ocx connect antigravity|agy status [--json]",
    summary: "Show whether Antigravity or agy is connected, which files carry it, and any admin_settings or environment override that wins.",
    routes: [{"method":"GET","path":"/api/gateway-clients"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit the client status as JSON."}],
    mutates: false,
    json: "payload",
    details: ["agy is an alias of antigravity. Works on this machine only; the files are the Antigravity user settings (antigravity) or shell profiles (agy).", "With no running proxy the files are inspected locally; nothing is changed. Works whatever the proxy bind requires."],
  },
  {
    command: ["disconnect","antigravity"],
    usage: "ocx disconnect antigravity|agy [--json]",
    summary: "Undo the Antigravity or agy connection: restore byte for byte, or path by path when the files changed since.",
    routes: [{"method":"POST","path":"/api/gateway-clients/{id}/disconnect"}],
    flags: [{"name":"--json","value":"boolean","summary":"Emit the result as JSON."}],
    mutates: true,
    json: "payload",
    details: ["agy is an alias of antigravity. Works on this machine only; the files are the Antigravity user settings (antigravity) or shell profiles (agy).", "With no running proxy the files are restored locally. Works even when the proxy bind needs a data-plane credential, so a connection can always be undone."],
  },
];
