Coverage for app / router / app / router.py: 100%
96 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-10-31 11:21 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-10-31 11:21 +0000
1from fastapi import APIRouter, Depends
2from app.dependency.base import get_db
3from app.router.app.models.router import model_router
4from app.router.app.users.router import user_router
5from app.router.app.invites.router import invite_router
6from app.router.app.ownership.router import ownership_router
7from app.dependency.workspace import capture_workspace
8from app.router.app.access.router import access_router
9from app.router.app.workspaces.router import workspace_router
10from app.router.app.resources.router import resources_router
11from app.router.app.agents.router import agent_router
12from app.router.app.agents.setup import agent_setup_router
13from app.router.app.projects.router import project_router
14from app.router.app.organisations.router import organisation_router
15from app.router.app.favicons.router import favicon_router
16from app.router.app.knowledge.figures import knowledge_figures_router
17from app.router.app.knowledge.router import knowledge_router
18from app.router.app.knowledge.setup import knowledge_setup_router
19from app.router.app.repositories.figures import repository_figures_router
20from app.router.app.repositories.router import repository_router
21from app.router.app.tools.router import tool_router
22from app.router.app.skills.router import skill_router
23from app.router.app.skills.setup import skill_setup_router
24from app.router.app.skillsets.router import skillset_router
25from app.router.app.skillsets.setup import skillset_setup_router
26from app.router.app.toolkits.router import toolkit_router
27from app.router.app.toolkits.setup import toolkit_setup_router
28from app.router.app.workers.router import worker_router
29from app.router.app.stats.router import stats_router
30from app.router.app.conversations.router import conversation_router
31from app.router.app.evaluations.router import evaluation_router
32from app.router.app.mcp_servers.router import mcp_server_router
33from app.router.app.simulations.router import simulation_router
34from app.router.app.files.router import files_router
35from app.router.app.reviews.router import reviews_router
36from app.router.app.rules.router import rules_router
37from app.router.app.rules.setup import rule_setup_router
38from app.router.app.dashboards.router import dashboard_router
39from app.router.app.dashboards.setup import dashboard_setup_router
40from app.router.app.generations.router import generations_router
41from app.router.app.activity.router import activity_router
42from app.router.app.network.router import network_router
43from app.router.app.turns.router import turn_router
44from app.router.app.decisions.router import decisions_router
45from app.router.app.budgets.router import budgets_router
46from app.router.app.statements.router import statements_router
47from app.router.app.notifications.router import notifications_router
48from app.router.app.scenario_runs.router import scenario_runs_router
49from app.router.app.swarms.router import swarms_router
51# Every request names the workspace it was made in; ``capture_workspace``
52# keeps it for the paths that create something (app/dependency/workspace.py).
53app_router = APIRouter(
54 prefix="/app", dependencies=[Depends(get_db), Depends(capture_workspace)]
55)
56app_router.include_router(stats_router)
57app_router.include_router(budgets_router)
58app_router.include_router(statements_router)
59app_router.include_router(notifications_router)
60# knowledge_setup_router registers /knowledge/generate and
61# /knowledge/create-from-config; it precedes knowledge_router so its
62# literal paths win over /knowledge/{knowledge_id}.
63app_router.include_router(knowledge_setup_router)
64# Before the routers they share a prefix with: ``/knowledge/stats`` would
65# otherwise be read as a source's id (``figures.py``).
66app_router.include_router(knowledge_figures_router)
67app_router.include_router(repository_figures_router)
68app_router.include_router(knowledge_router)
69app_router.include_router(repository_router)
70app_router.include_router(tool_router)
71# skill_setup_router registers /skills/generate and /skills/create-from-config;
72# it precedes skill_router so its literal paths win over /skills/{skill_id}.
73app_router.include_router(skill_setup_router)
74app_router.include_router(skill_router)
75# skillset_setup_router registers /skillsets/generate and
76# /skillsets/create-from-config; it precedes skillset_router so its literal
77# paths win over /skillsets/{skillset_id}.
78app_router.include_router(skillset_setup_router)
79app_router.include_router(skillset_router)
80# toolkit_setup_router registers /toolkits/generate and
81# /toolkits/create-from-config; it precedes toolkit_router so its literal
82# paths win over /toolkits/{toolkit_id}.
83app_router.include_router(toolkit_setup_router)
84app_router.include_router(toolkit_router)
85app_router.include_router(worker_router)
86app_router.include_router(model_router)
87# agent_setup_router registers /agents/generate and /agents/create-from-config;
88# it precedes agent_router so its literal paths win over /agents/{agent_id}.
89app_router.include_router(agent_setup_router)
90app_router.include_router(agent_router)
91app_router.include_router(project_router)
92app_router.include_router(organisation_router)
93app_router.include_router(user_router)
94app_router.include_router(invite_router)
95app_router.include_router(ownership_router)
96app_router.include_router(access_router)
97app_router.include_router(workspace_router)
98app_router.include_router(resources_router)
99app_router.include_router(conversation_router)
100app_router.include_router(evaluation_router)
101app_router.include_router(mcp_server_router)
102app_router.include_router(simulation_router)
103app_router.include_router(files_router)
104# rule_setup_router registers /rules/generate and
105# /rules/create-from-config; it precedes rules_router so its literal paths
106# win over /rules/{rule_id}.
107app_router.include_router(rule_setup_router)
108app_router.include_router(rules_router)
109# The other half of flag_for_review: the queue the audit action feeds.
110app_router.include_router(reviews_router)
111# dashboard_setup_router registers /dashboards/generate; it precedes
112# dashboard_router so its literal path wins over /dashboards/{dashboard_id}.
113app_router.include_router(dashboard_setup_router)
114app_router.include_router(dashboard_router)
115app_router.include_router(generations_router)
116app_router.include_router(favicon_router)
117app_router.include_router(activity_router)
118app_router.include_router(network_router)
119app_router.include_router(turn_router)
120app_router.include_router(decisions_router)
121app_router.include_router(scenario_runs_router)
122app_router.include_router(swarms_router)