()
| 41 | }; |
| 42 | |
| 43 | pub fn router() -> Router<Arc<ServerState>> { |
| 44 | Router::new() |
| 45 | .route("/", get(web_index)) |
| 46 | .route("/health", get(health)) |
| 47 | .route("/event", get(event_stream)) |
| 48 | .route("/path", get(get_paths)) |
| 49 | .route("/vcs", get(get_vcs_info)) |
| 50 | .route("/command", get(list_commands)) |
| 51 | .route("/agent", get(list_agents)) |
| 52 | .route("/skill", get(list_skills)) |
| 53 | .route("/lsp", get(get_lsp_status)) |
| 54 | .route("/formatter", get(get_formatter_status)) |
| 55 | .route("/auth/{id}", put(set_auth).delete(delete_auth)) |
| 56 | .route("/doc", get(get_doc)) |
| 57 | .route("/log", post(write_log)) |
| 58 | .nest("/session", session_routes().layer(middleware::from_fn(inject_opencode_directory))) |
| 59 | .nest("/provider", provider_routes()) |
| 60 | .nest("/config", config_routes()) |
| 61 | .nest("/mcp", mcp_routes()) |
| 62 | .nest("/file", file_routes()) |
| 63 | .nest("/find", find_routes()) |
| 64 | .nest("/permission", permission_routes()) |
| 65 | .nest("/project", project_routes()) |
| 66 | .nest("/pty", pty_routes()) |
| 67 | .nest("/question", question_routes()) |
| 68 | .nest("/tui", tui_routes()) |
| 69 | .nest("/global", global_routes()) |
| 70 | .nest("/experimental", experimental_routes()) |
| 71 | .nest("/plugin", plugin_auth_routes()) |
| 72 | } |
| 73 | |
| 74 | /// Injected by middleware from x-opencode-directory header for session create. |
| 75 | #[derive(Clone)] |
no test coverage detected