feat: Domain 2 Phase 3-4 — wiki article tool, DCP compress toggle, Go sidecar deprecation
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.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
// DEPRECATED (Phase 4, Domain 2, v2.8.14): This HTTP client routes through
|
||||||
|
// the Go codecontext sidecar (http://codecontext:8080). Superseded by the
|
||||||
|
// boocontext MCP server. New callers should use boocontext MCP tool wrappers
|
||||||
|
// directly. Keep this file for backward compatibility — the 16 existing
|
||||||
|
// codecontext tool wrappers (under tools/codecontext/) still call through
|
||||||
|
// callCodecontext(). Remove after full migration.
|
||||||
|
//
|
||||||
// v1.12 Track B.2: shared HTTP client for the codecontext sidecar. The 8
|
// v1.12 Track B.2: shared HTTP client for the codecontext sidecar. The 8
|
||||||
// per-tool wrappers under tools/codecontext/ all funnel through callCodecontext
|
// per-tool wrappers under tools/codecontext/ all funnel through callCodecontext
|
||||||
// — they're thin adapters that supply toolName + args + projectPath. The
|
// — they're thin adapters that supply toolName + args + projectPath. The
|
||||||
@@ -112,6 +119,11 @@ export async function callCodecontext(
|
|||||||
req: CodecontextRequest,
|
req: CodecontextRequest,
|
||||||
fetcher: typeof fetch = fetch,
|
fetcher: typeof fetch = fetch,
|
||||||
): Promise<CodecontextResponse> {
|
): Promise<CodecontextResponse> {
|
||||||
|
// DEPRECATED: This function routes through the Go codecontext sidecar at
|
||||||
|
// http://codecontext:8080. New callers should use boocontext MCP instead.
|
||||||
|
console.warn(
|
||||||
|
`[deprecated] callCodecontext("${req.toolName}") — route through boocontext MCP instead`,
|
||||||
|
);
|
||||||
// Step 1: realpath the project root, then realpath the requested target_dir
|
// Step 1: realpath the project root, then realpath the requested target_dir
|
||||||
// (defaulting to projectPath when the caller didn't pass one — the 12 wrappers
|
// (defaulting to projectPath when the caller didn't pass one — the 12 wrappers
|
||||||
// never pass target_dir; tests can override). A non-existent target_dir
|
// never pass target_dir; tests can override). A non-existent target_dir
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ import { z } from 'zod';
|
|||||||
import type { ToolDef } from '../types.js';
|
import type { ToolDef } from '../types.js';
|
||||||
import { callCodecontext, type CodecontextResponse } from '../../codecontext_client.js';
|
import { callCodecontext, type CodecontextResponse } from '../../codecontext_client.js';
|
||||||
|
|
||||||
|
// DEPRECATED (Phase 4, Domain 2, v2.8.14): This factory builds ToolDefs that
|
||||||
|
// route through the Go codecontext sidecar via callCodecontext(). Superseded
|
||||||
|
// by direct boocontext MCP tool wrappers. Keep functional for backward
|
||||||
|
// compatibility — old codecontext tools still use HTTP. New tools should use
|
||||||
|
// the boocontext MCP server instead of adding entries here.
|
||||||
|
//
|
||||||
// Shared factory for the 12 codecontext shim ToolDefs.
|
// Shared factory for the 12 codecontext shim ToolDefs.
|
||||||
// Each shim provides name/schema/description/jsonParameters/mapArgs; the
|
// Each shim provides name/schema/description/jsonParameters/mapArgs; the
|
||||||
// factory builds the ToolDef and returns both the ToolDef and the standalone
|
// factory builds the ToolDef and returns both the ToolDef and the standalone
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { makeCodecontextTool } from './factory.js';
|
|||||||
|
|
||||||
export const GetCodebaseOverviewInput = z.object({
|
export const GetCodebaseOverviewInput = z.object({
|
||||||
include_stats: z.boolean().optional(),
|
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>;
|
export type GetCodebaseOverviewInputT = z.infer<typeof GetCodebaseOverviewInput>;
|
||||||
|
|
||||||
@@ -24,10 +25,18 @@ const { toolDef: getCodebaseOverview, execute: executeGetCodebaseOverview } =
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
description: 'Include file count, symbol count, language stats. Defaults to true.',
|
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,
|
additionalProperties: false,
|
||||||
},
|
},
|
||||||
mapArgs: (input) => ({ include_stats: input.include_stats ?? true }),
|
mapArgs: (input) => {
|
||||||
|
const args: Record<string, unknown> = { include_stats: input.include_stats ?? true };
|
||||||
|
if (input.compress) args['compress'] = true;
|
||||||
|
return args;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export { getCodebaseOverview, executeGetCodebaseOverview };
|
export { getCodebaseOverview, executeGetCodebaseOverview };
|
||||||
|
|||||||
@@ -18,3 +18,4 @@ export { getCodeHealth } from './get_code_health.js';
|
|||||||
export { getCodeImpact } from './get_code_impact.js';
|
export { getCodeImpact } from './get_code_impact.js';
|
||||||
export { getTypeInfo } from './get_type_info.js';
|
export { getTypeInfo } from './get_type_info.js';
|
||||||
export { getCodeMap } from './get_code_map.js';
|
export { getCodeMap } from './get_code_map.js';
|
||||||
|
export { getWikiArticle } from './get_wiki_article.js';
|
||||||
|
|||||||
31
codecontext/README.md
Normal file
31
codecontext/README.md
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# codecontext — Go sidecar (DEPRECATED)
|
||||||
|
|
||||||
|
> **Deprecated** (Phase 4, Domain 2, v2.8.14).
|
||||||
|
>
|
||||||
|
> Superseded by the **boocontext MCP server** (`apps/coder`). Do not add new
|
||||||
|
> callers. The 16 codecontext tool wrappers still use this sidecar via HTTP at
|
||||||
|
> `http://codecontext:8080/v1/{toolName}` for backward compatibility.
|
||||||
|
|
||||||
|
## Migration path
|
||||||
|
|
||||||
|
1. Existing tool wrappers in `apps/server/src/services/tools/codecontext/` route
|
||||||
|
through `callCodecontext()` in `codecontext_client.ts`, which calls this
|
||||||
|
Go sidecar over HTTP.
|
||||||
|
2. New callers should use the boocontext MCP server instead (reachable via the
|
||||||
|
`boocontext` tool wrappers).
|
||||||
|
3. After all callers have migrated, remove this directory, the `codecontext`
|
||||||
|
service block from `docker-compose.yml`, and the
|
||||||
|
`codecontext_client.ts`/`factory.ts` files.
|
||||||
|
|
||||||
|
## What it does
|
||||||
|
|
||||||
|
A Go HTTP shim wrapping the boocontext MCP server's stdio interface. Provides
|
||||||
|
code-graph analysis (symbols, callers, callees, file overview, etc.) over a
|
||||||
|
REST API at `/v1/{toolName}`.
|
||||||
|
|
||||||
|
## Files
|
||||||
|
|
||||||
|
- `shim.go` — HTTP server that wraps the boocontext MCP stdio process
|
||||||
|
- `Dockerfile` — container build
|
||||||
|
- `fork.tar.gz` — vendored boocontext source (gitignored)
|
||||||
|
- `.codecontextignore.template` — default ignore patterns deployed per project
|
||||||
@@ -95,6 +95,13 @@ services:
|
|||||||
# HTTP shim (see ./codecontext/). No host port — reached from boocode at
|
# HTTP shim (see ./codecontext/). No host port — reached from boocode at
|
||||||
# http://codecontext:8080 over the boocode_net bridge.
|
# http://codecontext:8080 over the boocode_net bridge.
|
||||||
#
|
#
|
||||||
|
# DEPRECATED (Phase 4, Domain 2, v2.8.14): Superseded by the boocontext
|
||||||
|
# MCP server. The 16 codecontext tool wrappers still use this sidecar via
|
||||||
|
# HTTP but should route through the boocontext MCP instead. Keep the
|
||||||
|
# service running for backward compatibility until all callers migrate.
|
||||||
|
# Remove this block after full migration — see codecontext_client.ts and
|
||||||
|
# factory.ts for deprecation markers.
|
||||||
|
#
|
||||||
# Mounts /opt:/opt:ro (not just /opt/projects:ro): BooCode projects live
|
# Mounts /opt:/opt:ro (not just /opt/projects:ro): BooCode projects live
|
||||||
# at /opt/<slug> on the host, not exclusively under /opt/projects. The
|
# at /opt/<slug> on the host, not exclusively under /opt/projects. The
|
||||||
# mount must cover anywhere a project.path could resolve to. Read-only
|
# mount must cover anywhere a project.path could resolve to. Read-only
|
||||||
|
|||||||
Reference in New Issue
Block a user