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 @@
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";
controller/src/modules/proxy/openai-routes.ts+2−3
@@ -1,9 +1,8 @@
11 import { performance } from "node:perf_hooks";
2−import type { Hono } from "hono";
32 import { HttpStatus, notFound, serviceUnavailable } from "../../core/errors";
43 import { isRecipeRunning } from "../models/recipes/recipe-matching";
54 import { buildSseHeaders } from "../../http/sse";
6−import type { AppContext } from "../../types/context";
5+import type { RouteRegistrar } from "../../http/route-registrar";
76 import type { Recipe } from "../models/types";
87 import { getDefaultReasoningParser } from "../engines/process/model-runtime-defaults";
98 import { buildInferenceUrl } from "../../services/inference/inference-client";
@@ -89,7 +88,7 @@ const shouldBufferImplicitReasoningContent = ( · 79 unmodified lines
8988 );
9089 };
9190
92−export const registerOpenAIRoutes = (app: Hono, context: AppContext): void => {
91+export const registerOpenAIRoutes: RouteRegistrar = (app, context) => {
9392 const nonRunningModelWarnings = new Map<string, NonRunningModelWarningState>();
9493
9594 const warnNonRunningModel = (details: {
controller/src/modules/proxy/routes.ts+2−3
@@ -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";
32 import { registerOpenAIRoutes } from "./openai-routes";
43 import { registerTokenizationRoutes } from "./tokenization-routes";
54
6−export const registerAllProxyRoutes = (app: Hono, context: AppContext): void => {
5+export const registerAllProxyRoutes: RouteRegistrar = (app, context) => {
76 registerOpenAIRoutes(app, context);
87 registerTokenizationRoutes(app, context);
98 };
controller/src/modules/proxy/tokenization-routes.ts+2−3
@@ -1,9 +1,8 @@
1−import type { Hono } from "hono";
21 import { observeControllerFunction } from "../../core/function-observability";
3−import type { AppContext } from "../../types/context";
2+import type { RouteRegistrar } from "../../http/route-registrar";
43 import { fetchInference } from "../../services/inference/inference-client";
54
6−export const registerTokenizationRoutes = (app: Hono, context: AppContext): void => {
5+export const registerTokenizationRoutes: RouteRegistrar = (app, context) => {
76 app.post("/v1/tokenize", async (ctx) => {
87 const current = await observeControllerFunction(context, "tokenize.findInferenceProcess", () =>
98 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