Phase 3: get_wiki_article tool wraps codesight_get_wiki_article MCP (cached, persistent codebase wiki). DCP compress toggle on get_codebase_overview (compress=true for large projects >50 files). Phase 4: Deprecation markers on Go codecontext sidecar. Warning log in callCodecontext(), deprecation comments in factory.ts and docker-compose.yml. Sidecar remains functional — removal deferred.
43 lines
1.7 KiB
TypeScript
43 lines
1.7 KiB
TypeScript
import { z } from 'zod';
|
|
import { makeCodecontextTool } from './factory.js';
|
|
|
|
export const GetCodebaseOverviewInput = z.object({
|
|
include_stats: z.boolean().optional(),
|
|
compress: z.boolean().optional().describe('Apply DCP compression for large projects (>50 files)'),
|
|
});
|
|
export type GetCodebaseOverviewInputT = z.infer<typeof GetCodebaseOverviewInput>;
|
|
|
|
const DESCRIPTION =
|
|
'Returns a structured overview of the codebase: file count, symbol count, primary languages, and top-level architecture. ' +
|
|
'Use this before deeper investigation to orient yourself in an unfamiliar codebase. ' +
|
|
'Tree-sitter coverage: full for JS/Python/Java/Go/Rust/C++. TypeScript symbols are approximate (uses JS grammar). ' +
|
|
'PHP and SQL are not supported — fall back to view_file/grep for those.';
|
|
|
|
const { toolDef: getCodebaseOverview, execute: executeGetCodebaseOverview } =
|
|
makeCodecontextTool<GetCodebaseOverviewInputT>({
|
|
name: 'get_codebase_overview',
|
|
schema: GetCodebaseOverviewInput,
|
|
description: DESCRIPTION,
|
|
jsonParameters: {
|
|
type: 'object',
|
|
properties: {
|
|
include_stats: {
|
|
type: 'boolean',
|
|
description: 'Include file count, symbol count, language stats. Defaults to true.',
|
|
},
|
|
compress: {
|
|
type: 'boolean',
|
|
description: 'Apply DCP compression for large projects (>50 files)',
|
|
},
|
|
},
|
|
additionalProperties: false,
|
|
},
|
|
mapArgs: (input) => {
|
|
const args: Record<string, unknown> = { include_stats: input.include_stats ?? true };
|
|
if (input.compress) args['compress'] = true;
|
|
return args;
|
|
},
|
|
});
|
|
|
|
export { getCodebaseOverview, executeGetCodebaseOverview };
|