feat(agent): improve investigation contracts and runtime readiness
This commit is contained in:
@@ -6,6 +6,8 @@ export function allowedQueryTools(context: RuntimeSessionContext, reader = false
|
||||
if (context.learningMode === "review") return [];
|
||||
const project = !!context.projectId && !context.projectKey.startsWith("personal-") && ["ordinary_chat", "task_execution", "task_collaboration"].includes(context.purpose ?? "");
|
||||
if (reader) return project ? PRODUCT_MCP_READ_TOOLS.map(queryMcpToolId) : [];
|
||||
return [...(project ? PRODUCT_MCP_TOOLS.filter((name) => !(PRODUCT_MCP_WRITE_TOOLS as readonly string[]).includes(name) || context.purpose === "ordinary_chat") : []), ...LOCAL_QUERY_TOOLS.filter((name) =>
|
||||
const burstEvent = !!context.taskId && context.taskWorkflow === "burst_report" && !context.taskReplay;
|
||||
return [...(project ? PRODUCT_MCP_TOOLS.filter((name) => (!burstEvent || name !== "run_burst_location")
|
||||
&& (!(PRODUCT_MCP_WRITE_TOOLS as readonly string[]).includes(name) || context.purpose === "ordinary_chat")) : []), ...LOCAL_QUERY_TOOLS.filter((name) =>
|
||||
(!projectLocal.has(name) || project) && !(context.purpose === "task_execution" && ["list_investigation_tasks", "get_investigation_task"].includes(name)))].map(queryMcpToolId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user