chore: carry toolset MCP hosting state in its own struct
Merged
DA
4d ago+431+431+012345678901234567890123456789-706-706-012345678901234567890123456789
AIM-731 (1 of 3). Stacked on #8021.
Summary
- Adds
hostingstate.Hosting(enabled, public, session issuer) andhostingstate.Address(preferred slug and custom domain). Hosting state now travels in these values instead of being written into the generatedtoolsetsrepo.Toolsetfields.hostedmcp.WithServerStateis nowServerHostingand returnsHosting.LoadServerStatereturnsHostingtoo.hostingstate.Apply*is nowDerive, and the unusedWithServerStatesis gone.
- Every reader now takes the hosting value next to the toolset instead of reading the toolset row's hosting fields: MCP serving (legacy slug path, wrapper path, gateway members), install pages and export, toolset views, plugin attach, user-session mint, attach-impact preview, toolset update/delete/external OAuth, external MCP migration, and telemetry.
- Every read of the legacy
/mcp/<slug>alias (toolsets.mcp_slug/custom_domain_id, owned by AIM-670) goes throughhostingstate.LegacyAlias. - Behavior is unchanged. Toolsets without a canonical server still read their own columns through
hostingstate.ToolsetColumns.
Motivation
AIM-671 drops the five toolset MCP hosting columns, and code must stop naming them first. The generated Toolset struct carried derived wrapper state under the column names, so every hosting read looked like a column read. Now each column read is in one of two places:
ToolsetColumns, the wrapperless fallback. The next PR removes it.LegacyAlias, which AIM-670 retires. The last PR moves it into its own sqlc package and proves nothing else reads the columns.
š¤ Generated with Claude Code