feat(agent): unify MCP tools and adopt Responses delivery

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.
This commit is contained in:
2026-10-19 18:46:58 +08:00
parent f5c3cde2c2
commit 6a49d2209e
164 changed files with 12286 additions and 2368 deletions
+12
View File
@@ -1,4 +1,5 @@
import { z } from "zod";
import { supplyLayerSchema } from "./task-presentation.js";
const text = z.string().trim().min(1);
export const investigationDiagramSchema = z.object({
@@ -12,12 +13,23 @@ export const investigationDiagramSchema = z.object({
label: text,
evidence_refs: z.array(text).default([]),
action_refs: z.array(z.string().uuid()).default([]),
status: z.enum(["pending", "running", "completed", "waiting_human", "failed", "skipped", "cancelled"]).nullish(),
map_targets: z.array(z.object({
source_id: supplyLayerSchema,
feature_id: text.max(128),
}).strict()).max(100).default([]),
}).strict()).max(100).default([]),
}).strict().superRefine((diagram, ctx) => {
if (new Set(diagram.node_refs.map((node) => node.node_id)).size !== diagram.node_refs.length) {
ctx.addIssue({ code: z.ZodIssueCode.custom, message: "调查图节点引用重复" });
}
});
export const taskProgressSchema = z.object({
summary: text.max(20000),
diagram: investigationDiagramSchema.nullable().default(null),
}).strict();
export type TaskProgress = z.infer<typeof taskProgressSchema>;
const dataGapSchema = z.object({
gap_id: text,
node_id: text.nullish(),