Files
larksuite-cli/agents
liuxinyang.lxy e2b7ef0967 feat: environment-scoped agent visibility and capability gating
The set of agents and the capabilities each exposes can be scoped to the
resolved account environment, so discovery and gating reflect only what the
current account can actually use.

SPI (internal/agents):
- AgentSpec and Op gain an optional scope field (empty = unrestricted);
  Register fail-fasts on an unknown scope value and on a scope declared on an
  unwired operation.
- DeriveCapabilities and BuildCard take the resolved environment: an
  operation-backed capability is exposed only when wired AND in scope; the card
  echoes the environment it was rendered for.
- Provider.ListCatalog filters the catalog to the in-scope agents.

Command layer (cmd/agents):
- The resolved environment defaults offline (nil-safe) so the gates hold before
  config init. Every verb path gates offline before the client is built: the
  whole-agent gate fires before the per-verb capability nil-gate, so an
  out-of-scope agent uniformly returns a single dedicated validation error
  (exit 2) for every verb instead of a misleading "unsupported" on an
  incidentally-unwired one; the per-operation gate follows the nil-gate. List
  filtering mirrors the same rule.

The example provider demonstrates the per-capability scope end to end; skill
docs updated accordingly.
2026-07-17 14:29:13 +08:00
..