feat(agent): align investigation reports and selected context

This commit is contained in:
2026-10-10 16:02:47 +08:00
parent d58bd19039
commit a31b76a793
18 changed files with 1172 additions and 44 deletions
@@ -3,11 +3,12 @@ import { getInternalBridgeConfig } from "../internalBridge.js";
export default tool({
description: "Read the current operational task's authorized task, plan, report, evidence and scoped investigation data from TJWater Server. Use this before investigating a task. It is read-only and does not expose credentials.",
args: {},
async execute(_args, context) {
args: { report_revision: tool.schema.number().int().positive().optional().describe("Read this persisted report revision alongside the current task when explaining a historical report") },
async execute(args, context) {
const { baseUrl, internalToken } = getInternalBridgeConfig();
const url = new URL("/internal/operational-task/context", baseUrl);
url.searchParams.set("session_id", context.sessionID);
if (args.report_revision != null) url.searchParams.set("report_revision", String(args.report_revision));
const response = await fetch(url, {
headers: { Accept: "application/json", "x-agent-internal-token": internalToken },
});