Files
ai-agent/backend/toolproxy/__init__.py
gabrielvidalandClaude Opus 5.5 11ef9615f5 feat(toolproxy): the lab's paid tools for guests and the Macs, keys kept in the hub
/proxy/tools/… (outside /api, bearer-only): Nano Banana (Gemini
generateContent with the hub's GEMINI_API_KEY, priced from usageMetadata
at Google's list price), an allowlist of the 3d-gen API as guest-<uid> on
their own jobs and folders only, and video-extract / 3d-render run by the
host sidecar's new /tools/ routes (a video library per guest, the EVOX2
woken first, sources limited to URLs and the caller's own uploads).

- Callers: a guest run's token (aiat1.<uid>.<exp>.<hmac>, minted into the
  run's scope → AIA_TOOLS_URL / AIA_TOOLS_TOKEN) or a worker's proxy token
  (guest computer = its guest, owner's worker = the owner, unlimited).
- Per guest, off by default: users.json tools {groups, pro, budgetUsd} —
  images / video / 3d, Nano Banana Pro, a monthly tools budget apart from
  the Claude budget. EVOX2 / CPU jobs are free but counted.
- A tool ledger of its own (PROXY_LEDGER_DIR/tools/); a call from the
  caller's own conversation stamps meta.tools for the card's chip.
- Guest runs get the hub editions as shared:<name>; guest computers and
  the owner's workers get them through the lab sync with a hub.json
  (their URL + proxy token, 0600 on the worker).
- The new scope key 'tools' needs the host sidecar restarted first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 17:07:59 +01:00

2 lines
86 B
Python

"""The tool proxy — the lab's paid tools for guests and workers, keys kept here."""