History

refactor(repo): adopt src/features convention, controller RouteRegistrar, shared validation

- 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.

seroxdesign committed 5 months ago

Commit c9d1ea51 parent 8d0aacf334 files · +2556 −2495Browse files

Showing the changes to controller/src/modules/proxy (4 of 334 files). Show all

Unified · Split

4 files
  1. controller/src/modules/proxy/interfaces.ts +1 −4
  2. controller/src/modules/proxy/openai-routes.ts +2 −3
  3. controller/src/modules/proxy/routes.ts +2 −3
  4. controller/src/modules/proxy/tokenization-routes.ts +2 −3
controller/src/modules/proxy/interfaces.ts+1−4
@@ -1,4 +1 @@
1import type { Hono } from "hono";1export type { RouteRegistrar as ProxyRouteRegistrar } from "../../http/route-registrar";
2import type { AppContext } from "../../types/context";
3
4export type ProxyRouteRegistrar = (app: Hono, context: AppContext) => void;
controller/src/modules/proxy/openai-routes.ts+2−3
@@ -1,9 +1,8 @@
1import { performance } from "node:perf_hooks";1import { performance } from "node:perf_hooks";
2import type { Hono } from "hono";
3import { HttpStatus, notFound, serviceUnavailable } from "../../core/errors";2import { HttpStatus, notFound, serviceUnavailable } from "../../core/errors";
4import { isRecipeRunning } from "../models/recipes/recipe-matching";3import { isRecipeRunning } from "../models/recipes/recipe-matching";
5import { buildSseHeaders } from "../../http/sse";4import { buildSseHeaders } from "../../http/sse";
6import type { AppContext } from "../../types/context";5import type { RouteRegistrar } from "../../http/route-registrar";
7import type { Recipe } from "../models/types";6import type { Recipe } from "../models/types";
8import { getDefaultReasoningParser } from "../engines/process/model-runtime-defaults";7import { getDefaultReasoningParser } from "../engines/process/model-runtime-defaults";
9import { buildInferenceUrl } from "../../services/inference/inference-client";8import { buildInferenceUrl } from "../../services/inference/inference-client";
@@ -89,7 +88,7 @@ const shouldBufferImplicitReasoningContent = ( · 79 unmodified lines
89 );88 );
90};89};
91 90
92export const registerOpenAIRoutes = (app: Hono, context: AppContext): void => {91export const registerOpenAIRoutes: RouteRegistrar = (app, context) => {
93 const nonRunningModelWarnings = new Map<string, NonRunningModelWarningState>();92 const nonRunningModelWarnings = new Map<string, NonRunningModelWarningState>();
94 93
95 const warnNonRunningModel = (details: {94 const warnNonRunningModel = (details: {
controller/src/modules/proxy/routes.ts+2−3
@@ -1,9 +1,8 @@
1import type { Hono } from "hono";1import type { RouteRegistrar } from "../../http/route-registrar";
2import type { AppContext } from "../../types/context";
3import { registerOpenAIRoutes } from "./openai-routes";2import { registerOpenAIRoutes } from "./openai-routes";
4import { registerTokenizationRoutes } from "./tokenization-routes";3import { registerTokenizationRoutes } from "./tokenization-routes";
5 4
6export const registerAllProxyRoutes = (app: Hono, context: AppContext): void => {5export const registerAllProxyRoutes: RouteRegistrar = (app, context) => {
7 registerOpenAIRoutes(app, context);6 registerOpenAIRoutes(app, context);
8 registerTokenizationRoutes(app, context);7 registerTokenizationRoutes(app, context);
9};8};
controller/src/modules/proxy/tokenization-routes.ts+2−3
@@ -1,9 +1,8 @@
1import type { Hono } from "hono";
2import { observeControllerFunction } from "../../core/function-observability";1import { observeControllerFunction } from "../../core/function-observability";
3import type { AppContext } from "../../types/context";2import type { RouteRegistrar } from "../../http/route-registrar";
4import { fetchInference } from "../../services/inference/inference-client";3import { fetchInference } from "../../services/inference/inference-client";
5 4
6export const registerTokenizationRoutes = (app: Hono, context: AppContext): void => {5export const registerTokenizationRoutes: RouteRegistrar = (app, context) => {
7 app.post("/v1/tokenize", async (ctx) => {6 app.post("/v1/tokenize", async (ctx) => {
8 const current = await observeControllerFunction(context, "tokenize.findInferenceProcess", () =>7 const current = await observeControllerFunction(context, "tokenize.findInferenceProcess", () =>
9 context.processManager.findInferenceProcess(context.config.inference_port)8 context.processManager.findInferenceProcess(context.config.inference_port)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t