- frontend: src/features/{agent,recipes,discover,settings,usage,plugins,setup,logs,dashboard}; src/ui reduced to primitives; src/components retired; agent trees merged (lib/agent + hooks/agent + app/agent/_components -> features/agent) - controller: RouteRegistrar type across modules, core/validation.ts body helpers, studio provider routes split out - shared API route helpers (app/api/_lib/route-helpers.ts), themes data/API split, lib/types consolidated to recipes.ts + system.ts - structure validator rewritten to enforce the new layering Verified: check:quality (incl. production build), controller integration 49/49, frontend e2e 155/155, contracts check.
Showing the changes to controller/src/modules/proxy (4 of 334 files). Show all
Unified · Split
| @@ -1,4 +1 @@ | ||
| 1 | −import type { Hono } from "hono"; | |
| 2 | −import type { AppContext } from "../../types/context"; | |
| 3 | − | |
| 4 | −export type ProxyRouteRegistrar = (app: Hono, context: AppContext) => void; | |
| 1 | +export type { RouteRegistrar as ProxyRouteRegistrar } from "../../http/route-registrar"; | |
| @@ -1,9 +1,8 @@ | ||
| 1 | 1 | import { performance } from "node:perf_hooks"; |
| 2 | −import type { Hono } from "hono"; | |
| 3 | 2 | import { HttpStatus, notFound, serviceUnavailable } from "../../core/errors"; |
| 4 | 3 | import { isRecipeRunning } from "../models/recipes/recipe-matching"; |
| 5 | 4 | import { buildSseHeaders } from "../../http/sse"; |
| 6 | −import type { AppContext } from "../../types/context"; | |
| 5 | +import type { RouteRegistrar } from "../../http/route-registrar"; | |
| 7 | 6 | import type { Recipe } from "../models/types"; |
| 8 | 7 | import { getDefaultReasoningParser } from "../engines/process/model-runtime-defaults"; |
| 9 | 8 | import { buildInferenceUrl } from "../../services/inference/inference-client"; |
| @@ -89,7 +88,7 @@ const shouldBufferImplicitReasoningContent = ( · 79 unmodified lines | ||
| 89 | 88 | ); |
| 90 | 89 | }; |
| 91 | 90 | |
| 92 | −export const registerOpenAIRoutes = (app: Hono, context: AppContext): void => { | |
| 91 | +export const registerOpenAIRoutes: RouteRegistrar = (app, context) => { | |
| 93 | 92 | const nonRunningModelWarnings = new Map<string, NonRunningModelWarningState>(); |
| 94 | 93 | |
| 95 | 94 | const warnNonRunningModel = (details: { |
| @@ -1,9 +1,8 @@ | ||
| 1 | −import type { Hono } from "hono"; | |
| 2 | −import type { AppContext } from "../../types/context"; | |
| 1 | +import type { RouteRegistrar } from "../../http/route-registrar"; | |
| 3 | 2 | import { registerOpenAIRoutes } from "./openai-routes"; |
| 4 | 3 | import { registerTokenizationRoutes } from "./tokenization-routes"; |
| 5 | 4 | |
| 6 | −export const registerAllProxyRoutes = (app: Hono, context: AppContext): void => { | |
| 5 | +export const registerAllProxyRoutes: RouteRegistrar = (app, context) => { | |
| 7 | 6 | registerOpenAIRoutes(app, context); |
| 8 | 7 | registerTokenizationRoutes(app, context); |
| 9 | 8 | }; |
| @@ -1,9 +1,8 @@ | ||
| 1 | −import type { Hono } from "hono"; | |
| 2 | 1 | import { observeControllerFunction } from "../../core/function-observability"; |
| 3 | −import type { AppContext } from "../../types/context"; | |
| 2 | +import type { RouteRegistrar } from "../../http/route-registrar"; | |
| 4 | 3 | import { fetchInference } from "../../services/inference/inference-client"; |
| 5 | 4 | |
| 6 | −export const registerTokenizationRoutes = (app: Hono, context: AppContext): void => { | |
| 5 | +export const registerTokenizationRoutes: RouteRegistrar = (app, context) => { | |
| 7 | 6 | app.post("/v1/tokenize", async (ctx) => { |
| 8 | 7 | const current = await observeControllerFunction(context, "tokenize.findInferenceProcess", () => |
| 9 | 8 | context.processManager.findInferenceProcess(context.config.inference_port) |