Files
Lyu 10b74fd921 feat(ai): show why the Model Gateway is unavailable, and hide it for partners
Cloud now gates AI on the org, but the dashboard had no way to say so: a free
or partner project just watched every widget on the page fail its own way
against a 403.

- New useAiEntitlement resolves the reason from the instance-info bridge.
- Free orgs get the whole page replaced by an upgrade CTA wired to
  host.onShowUpgradeDialog, matching how BackupsPage gates scheduled backups.
- Partner orgs lose the AI tab from the sidebar entirely, with a
  not-supported state on the page as a backstop for a deep link.
- Self-hosting is always allowed; it brings its own key.

Partner-ness is carried explicitly as isPartnerOrg rather than derived from
planName, because cloud reports partner orgs as 'team' — indistinguishable
from a real Team customer.

The hook fails OPEN while loading and on bridge errors: cloud still enforces
the real gate, so the worst case is a page that renders and then 403s, versus
flashing an upgrade wall at a paying customer on a transient blip.

Requires the matching insforge-cloud change to send isPartnerOrg in
INSTANCE_INFO; until then partner orgs fall back to today's behaviour and the
free-plan case works on its own, since planName is already sent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 17:18:21 -07:00
..
2025-09-26 23:05:47 -07:00
2025-07-28 22:54:06 -07:00
2026-06-03 14:46:17 +05:30