The current chat panel has 5 providers but a flat text-in/text-out model. Rewrite the chat layer so it can do what Zed, VSCode Copilot Chat, and Cursor do.
What it should do
- Model picker inline in the composer. No Settings detour.
@-mentions for tables, schemas, current query, query results, saved queries.
- Slash commands:
/explain, /fix, /optimize, plus user-defined.
- Tool calling that re-uses the existing MCP tools in
TablePro/Core/MCP/Protocol/Tools/. Chat consumes its own MCP layer instead of duplicating schema fetch and query exec.
- Per-turn provider attribution. Switching mid-conversation is tracked.
- Opt-in context. No auto-shoveling schema into every prompt.
Architecture target
Replace AIProvider (text only) with three abstractions:
ChatTransport. Sends [ChatTurn] with content blocks (.text, .toolUse, .toolResult, .attachment). Yields ChatStreamEvent.
ContextItem. Discriminated union for @-mention attachments. Rendered as chips in the message bubble.
ChatTool. Wraps the existing MCP tools so chat and external MCP clients share one implementation.
Apple Intelligence (Foundation Models on macOS 26+) becomes another ChatTransport once this lands.
Out of scope
Apple Intelligence integration. Tracked separately.
The current chat panel has 5 providers but a flat text-in/text-out model. Rewrite the chat layer so it can do what Zed, VSCode Copilot Chat, and Cursor do.
What it should do
@-mentions for tables, schemas, current query, query results, saved queries./explain,/fix,/optimize, plus user-defined.TablePro/Core/MCP/Protocol/Tools/. Chat consumes its own MCP layer instead of duplicating schema fetch and query exec.Architecture target
Replace
AIProvider(text only) with three abstractions:ChatTransport. Sends[ChatTurn]with content blocks (.text,.toolUse,.toolResult,.attachment). YieldsChatStreamEvent.ContextItem. Discriminated union for@-mention attachments. Rendered as chips in the message bubble.ChatTool. Wraps the existing MCP tools so chat and external MCP clients share one implementation.Apple Intelligence (Foundation Models on macOS 26+) becomes another
ChatTransportonce this lands.Out of scope
Apple Intelligence integration. Tracked separately.