MCPcopy Create free account
hub / github.com/Qinbf/groundmap / validatePaths

Function validatePaths

tools/debug-console/lib/kb-http-client.ts:52–71  ·  view source on GitHub ↗
(
  paths: string[],
)

Source from the content-addressed store, hash-verified

50
51/** 批量验证文件是否存在(只读 check,不返回内容) */
52export async function validatePaths(
53 paths: string[],
54): Promise<Map<string, boolean>> {
55 const results = new Map<string, boolean>();
56 await Promise.all(
57 paths.map(async (p) => {
58 try {
59 const res = await fetch(`${kbApiBase()}/api/agent-tool`, {
60 method: "POST",
61 headers: buildHeaders(),
62 body: JSON.stringify({ tool: "read_page", args: { path: p } }),
63 });
64 results.set(p, res.ok);
65 } catch {
66 results.set(p, false);
67 }
68 }),
69 );
70 return results;
71}
72
73export async function executeTool(
74 name: string,

Callers 1

validateAnswerRefsFunction · 0.90

Calls 2

buildHeadersFunction · 0.85
kbApiBaseFunction · 0.70

Tested by

no test coverage detected