A provider set under Settings (OpenAI-compatible; key encrypted in flow-data/ai.json) turns on an Assistant panel in the sidebar. Each turn runs the FastMCP tools in-process as the person chatting, streams the rounds over SSE and keeps one transcript per user. The panel floats on any screen and shares the editor's lane: a settings panel keeps the top half, the chat the bottom. The MCP client is now built once, for the endpoint and the chat.
58 lines
1.7 KiB
Python
58 lines
1.7 KiB
Python
from fastapi import APIRouter
|
|
|
|
from fluksio.api.routes import (
|
|
ai,
|
|
alerts,
|
|
artifacts,
|
|
cloud,
|
|
dashboards,
|
|
flavors,
|
|
flows,
|
|
login,
|
|
messages,
|
|
modules,
|
|
oauth,
|
|
observability,
|
|
panels,
|
|
private,
|
|
runs,
|
|
search,
|
|
secrets,
|
|
users,
|
|
utils,
|
|
workers,
|
|
)
|
|
|
|
api_router = APIRouter()
|
|
api_router.include_router(login.router)
|
|
api_router.include_router(users.router)
|
|
api_router.include_router(utils.router)
|
|
api_router.include_router(flavors.router)
|
|
api_router.include_router(flows.router)
|
|
api_router.include_router(flows.ws_router)
|
|
api_router.include_router(secrets.router)
|
|
api_router.include_router(alerts.router)
|
|
api_router.include_router(dashboards.router)
|
|
api_router.include_router(panels.router)
|
|
api_router.include_router(messages.router)
|
|
api_router.include_router(modules.router)
|
|
api_router.include_router(observability.router)
|
|
api_router.include_router(runs.router)
|
|
api_router.include_router(artifacts.router)
|
|
api_router.include_router(workers.router)
|
|
api_router.include_router(search.router)
|
|
# Remote access through a portal. Always mounted; with no enrolment the
|
|
# endpoints only ever report that there is none.
|
|
api_router.include_router(cloud.router)
|
|
# Always mounted so the generated SDK stays the same shape; the endpoints
|
|
# themselves refuse to work unless MCP is switched on.
|
|
api_router.include_router(oauth.router)
|
|
|
|
|
|
# Always mounted like oauth, so the generated SDK keeps its shape; the
|
|
# endpoints refuse to work unless the private API is explicitly enabled.
|
|
api_router.include_router(private.router)
|
|
# The assistant. Always mounted for the same reason; without a provider
|
|
# configured the status says so and the chat answers 404.
|
|
api_router.include_router(ai.router)
|