Expose VoidBot MCP schema fingerprint
This commit is contained in:
parent
aa454ff1a2
commit
df83123c96
8 changed files with 95 additions and 3 deletions
|
|
@ -48,6 +48,8 @@ export const applyRepoFaceStateOperationInputSchema = {
|
|||
operation: z.record(z.unknown()),
|
||||
};
|
||||
|
||||
export const runtimeInfoInputSchema = {};
|
||||
|
||||
export const searchSourcesInputSchema = {
|
||||
query: z.string().min(1).max(240),
|
||||
limit: z.number().int().min(1).max(MAX_RETRIEVAL_RESULT_LIMIT).optional(),
|
||||
|
|
@ -105,6 +107,10 @@ export interface ApplyRepoFaceStateOperationArgs {
|
|||
operation: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface RuntimeInfoArgs {
|
||||
[key: string]: never;
|
||||
}
|
||||
|
||||
export interface ListIndexedReposArgs {
|
||||
[key: string]: never;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import {
|
|||
renderFaceIdentityDoctrine,
|
||||
resolveFaceStatePath,
|
||||
resolveRepoFaceStatePath,
|
||||
VOID_SELF_STATE_SCHEMA_DOCUMENT_TYPES,
|
||||
VOID_SELF_STATE_SCHEMA_FINGERPRINT,
|
||||
} from "@voidbot/core";
|
||||
|
||||
import { type VoidbotMcpContext } from "./mcp-server-context";
|
||||
|
|
@ -27,6 +29,7 @@ import {
|
|||
type PostDiscordMessageArgs,
|
||||
type PostRepoIdentityMessageArgs,
|
||||
type RepoFaceStateArgs,
|
||||
type RuntimeInfoArgs,
|
||||
type SearchHistoryArgs,
|
||||
type SearchSourcesArgs,
|
||||
type SourceContextArgs,
|
||||
|
|
@ -40,6 +43,7 @@ import {
|
|||
postRepoIdentityMessageInputSchema,
|
||||
repoFaceStateInputSchema,
|
||||
renderJsonBlock,
|
||||
runtimeInfoInputSchema,
|
||||
searchHistoryInputSchema,
|
||||
searchSourcesInputSchema,
|
||||
sourceContextInputSchema,
|
||||
|
|
@ -56,6 +60,37 @@ export function registerVoidbotTools(
|
|||
server: McpServer,
|
||||
context: VoidbotMcpContext,
|
||||
): void {
|
||||
server.registerTool(
|
||||
"get_voidbot_runtime_info",
|
||||
{
|
||||
title: "Get VoidBot Runtime Info",
|
||||
description:
|
||||
"Return the running VoidBot MCP server runtime and typed self-state schema identity. Use this to detect stale MCP processes after schema changes.",
|
||||
inputSchema: runtimeInfoInputSchema,
|
||||
annotations: READ_ONLY_ANNOTATIONS,
|
||||
},
|
||||
async (_input: RuntimeInfoArgs): Promise<CallToolResult> => {
|
||||
const runtimeInfo = {
|
||||
serverName: "voidbot",
|
||||
serverVersion: "0.1.0",
|
||||
pid: process.pid,
|
||||
workspaceRoot: process.cwd(),
|
||||
selfStateSchemaFingerprint: VOID_SELF_STATE_SCHEMA_FINGERPRINT,
|
||||
selfStateDocumentTypes: VOID_SELF_STATE_SCHEMA_DOCUMENT_TYPES,
|
||||
};
|
||||
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text: renderJsonBlock(runtimeInfo),
|
||||
},
|
||||
],
|
||||
structuredContent: runtimeInfo,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
server.registerTool(
|
||||
"search_history",
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue