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>
38 lines
1.2 KiB
TypeScript
38 lines
1.2 KiB
TypeScript
import { z } from 'zod';
|
|
import { makeCodecontextTool } from './factory.js';
|
|
|
|
export const GetRoutesInput = z.object({
|
|
framework: z.string().trim().optional(),
|
|
});
|
|
export type GetRoutesInputT = z.infer<typeof GetRoutesInput>;
|
|
|
|
const DESCRIPTION =
|
|
'Extracts HTTP routes from the project via tree-sitter AST analysis. ' +
|
|
'Detects Fastify and Express route registrations (app.get, app.post, app.route, router.use, etc.) ' +
|
|
'with method, path, file, line number, and inferred tags (db, auth, cache). ' +
|
|
'Optional framework filter narrows to "fastify" or "express".';
|
|
|
|
const { toolDef: getRoutes, execute: executeGetRoutes } =
|
|
makeCodecontextTool<GetRoutesInputT>({
|
|
name: 'get_routes',
|
|
schema: GetRoutesInput,
|
|
description: DESCRIPTION,
|
|
jsonParameters: {
|
|
type: 'object',
|
|
properties: {
|
|
framework: {
|
|
type: 'string',
|
|
description: 'Filter to a specific framework: "fastify" or "express". Omit for all.',
|
|
},
|
|
},
|
|
additionalProperties: false,
|
|
},
|
|
mapArgs: (input) => {
|
|
const args: Record<string, unknown> = {};
|
|
if (input.framework) args.framework = input.framework;
|
|
return args;
|
|
},
|
|
});
|
|
|
|
export { getRoutes, executeGetRoutes };
|