Multi-agent audit + aggressive cleanup across server/web/coder/booterm, delivered behind a DEFER discipline so none of the in-flight files were touched. Removes dead code/deps/columns, dedups server + coder helpers, and splits the oversized modules (tools.ts, opencode-server.ts, sentinel-summaries, turn.ts, TerminalPane.tsx) behind stable contracts. Adds 78 parity/unit tests (server 587, coder 323); fixes two latent bugs (ChatPane queue keys, FileViewerOverlay blank-line parity). Intended tag: v2.7.12-audit-cleanup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
27 lines
917 B
TypeScript
27 lines
917 B
TypeScript
import { z } from 'zod';
|
|
import { makeCodecontextTool } from './factory.js';
|
|
|
|
export const GetMiddlewareInput = z.object({});
|
|
export type GetMiddlewareInputT = z.infer<typeof GetMiddlewareInput>;
|
|
|
|
const DESCRIPTION =
|
|
'Detects middleware registrations in the project. Identifies auth, CORS, rate-limit, ' +
|
|
'security-headers, error-handler, logging, and validation middleware by analyzing ' +
|
|
'import names (@fastify/cors, helmet, etc.) and registration patterns ' +
|
|
'(app.register, app.addHook, app.setErrorHandler).';
|
|
|
|
const { toolDef: getMiddleware, execute: executeGetMiddleware } =
|
|
makeCodecontextTool<GetMiddlewareInputT>({
|
|
name: 'get_middleware',
|
|
schema: GetMiddlewareInput,
|
|
description: DESCRIPTION,
|
|
jsonParameters: {
|
|
type: 'object',
|
|
properties: {},
|
|
additionalProperties: false,
|
|
},
|
|
mapArgs: () => ({}),
|
|
});
|
|
|
|
export { getMiddleware, executeGetMiddleware };
|