Move project and host queries into native MCP with host-owned OAuth/context, while retaining memory, skills, actions and publication plugins. Add nearby-model queries and explicit chat/task/learning model defaults. Adopt Responses HTTP/SSE and native steer/queue inbox delivery, preserving scoped session ownership, pending input edits and investigation communication. Disable local-provider discovery: Server /health allowed native vLLM to probe /v1/models on port 8000. A native before/after regression prevents recurrence. Validation: 170 focused Bun tests; service/plugin typechecks; native discovery, provider-discovery and input-inbox smoke checks; no paid model inference.
26 lines
1.7 KiB
TypeScript
26 lines
1.7 KiB
TypeScript
import { tool } from "../tool.js";
|
|
import { getInternalBridgeConfig } from "../internalBridge.js";
|
|
import { taskProgressSchema } from "../../src/product/investigation-report.js";
|
|
import { taskPublicationProgressSchema } from "./task-publication-schema.js";
|
|
|
|
export default tool({
|
|
description: "Publish the complete current investigation progress from a task execution session. Publish before starting a real investigation step and when changing direction. The summary and optional Mermaid diagram describe actual activity for people; they never schedule the Agent or derive status from todo. The entire diagram may be redrawn, and only explicitly running nodes indicate current activity. Map targets reference known supply features. Use a stable UUID request_id and reuse it on retries. Publishing progress does not complete the run or confirm any human work.",
|
|
args: {
|
|
request_id: tool.schema.string().uuid().describe("Stable UUID idempotency key; reuse for retries of this progress publication"),
|
|
progress: taskPublicationProgressSchema,
|
|
},
|
|
async execute(args, context) {
|
|
const progress = taskProgressSchema.parse(args.progress);
|
|
const { baseUrl, internalToken } = getInternalBridgeConfig();
|
|
const response = await fetch(`${baseUrl}/internal/operational-task/artifacts`, {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json", "x-agent-internal-token": internalToken },
|
|
signal: context.signal,
|
|
body: JSON.stringify({ session_id: context.sessionID, request_id: args.request_id, progress }),
|
|
});
|
|
const text = await response.text();
|
|
if (!response.ok) throw new Error(`task progress publish failed (${response.status}): ${text}`);
|
|
return text;
|
|
},
|
|
});
|