mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
Merge branch 'inspector'
This commit is contained in:
@@ -20,8 +20,7 @@ const sectionDataSchema = z.object({
|
||||
found: z.boolean(),
|
||||
error: z.string().optional(),
|
||||
sectionTitle: z.string().optional(),
|
||||
partIndex: z.number().optional(),
|
||||
totalParts: z.number().optional(),
|
||||
childrensectionids: z.array(z.string()).optional(),
|
||||
});
|
||||
|
||||
const getSectionContentOutputSchema = z.object({
|
||||
@@ -87,8 +86,7 @@ export function createGetSectionContentTool(table: Table) {
|
||||
{
|
||||
content: string[];
|
||||
title?: string;
|
||||
partIndex?: number;
|
||||
totalParts?: number;
|
||||
childrenSectionIds?: string[];
|
||||
}
|
||||
>();
|
||||
const queue: string[] = [...sectionIds];
|
||||
@@ -121,18 +119,18 @@ export function createGetSectionContentTool(table: Table) {
|
||||
totalparts?: number;
|
||||
};
|
||||
|
||||
// Get or create section data
|
||||
let section = sectionsData.get(currentId);
|
||||
if (!section) {
|
||||
section = {
|
||||
content: [],
|
||||
title: typedResult.sectiontitle,
|
||||
childrenSectionIds: typedResult.childrensectionids,
|
||||
};
|
||||
sectionsData.set(currentId, section);
|
||||
}
|
||||
|
||||
if (typedResult.text) {
|
||||
// Get or create section data
|
||||
let section = sectionsData.get(currentId);
|
||||
if (!section) {
|
||||
section = {
|
||||
content: [],
|
||||
title: typedResult.sectiontitle,
|
||||
partIndex: typedResult.partindex ?? undefined,
|
||||
totalParts: typedResult.totalparts ?? undefined,
|
||||
};
|
||||
sectionsData.set(currentId, section);
|
||||
}
|
||||
section.content.push(typedResult.text);
|
||||
}
|
||||
|
||||
@@ -157,8 +155,7 @@ export function createGetSectionContentTool(table: Table) {
|
||||
content: data.content.join("\n\n"),
|
||||
found: true,
|
||||
sectionTitle: data.title,
|
||||
partIndex: data.partIndex,
|
||||
totalParts: data.totalParts,
|
||||
childrensectionids: data.childrenSectionIds,
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -284,7 +284,10 @@ export async function main() {
|
||||
|
||||
// MCP Inspector at root path - auto-connects to /mcp
|
||||
// Mounted AFTER /mcp so specific routes take precedence
|
||||
const mcpPublicUrl = process.env.COOLIFY_URL || process.env.MCP_PUBLIC_URL || `http://localhost:${PORT}`;
|
||||
const mcpPublicUrl =
|
||||
process.env.COOLIFY_URL ||
|
||||
process.env.MCP_PUBLIC_URL ||
|
||||
`http://localhost:${PORT}`;
|
||||
mountInspector(app, {
|
||||
autoConnectUrl: `${mcpPublicUrl}/mcp`,
|
||||
devMode: process.env.NODE_ENV !== "production",
|
||||
|
||||
Reference in New Issue
Block a user