feat(agent): support Responses steering and project-aware tools

Use the dedicated TJWATER_AGENT_URL and Responses stream protocol. Keep running
turns active while users steer or queue follow-ups and edit pending delivery.
Refresh the model catalog before generation and preserve approval mode selection.

Integrate scoped investigation messaging/presentation, geographic place selection,
current Agent composer styles and supporting workbench contracts.

Validation: 77 focused Vitest checks, 21 browser cases, lint, typecheck and
production build. Preserve direct Server/Agent routing and project authentication.
This commit is contained in:
2026-10-19 18:46:58 +08:00
parent 2c5bf15cce
commit ec23d44b02
131 changed files with 6663 additions and 1204 deletions
+27 -4
View File
@@ -43,7 +43,7 @@ test("dragging the Agent edge keeps the workspace attached and preserves the dra
const panel = page.getByRole("complementary", { name: "Agent 命令面板" });
const workspace = page.locator("#main-workspace");
const handle = page.getByRole("separator", { name: "调整 Agent 面板宽度" });
const prompt = panel.getByPlaceholder("输入调度问题,Agent 将通过后端会话流式响应");
const prompt = panel.getByPlaceholder("询问供水问题,或描述需要处理的任务");
await expect(panel.getByText("当前上下文", { exact: true })).toHaveCount(0);
await prompt.fill("保留尚未发送的诊断问题");
await expect(panel).toHaveCSS("width", "500px");
@@ -231,7 +231,7 @@ test("the floating condition feed coordinates with the docked Agent", async ({ p
.poll(async () => Math.round((await workspace.boundingBox())?.x ?? 0))
.toBeGreaterThan(400);
const expandedOffset = Math.round((await workspace.boundingBox())?.x ?? 0);
const prompt = page.getByPlaceholder("输入调度问题,Agent 将通过后端会话流式响应");
const prompt = page.getByPlaceholder("询问供水问题,或描述需要处理的任务");
await prompt.fill("保留尚未发送的诊断问题");
const conditionToggle = page
.locator("header.acrylic-navigation")
@@ -286,10 +286,33 @@ test.describe("mobile touch layout", () => {
test("mobile alert summary opens the Agent conversation panel", async ({ page }) => {
await page.clock.setFixedTime(new Date("2026-07-21T10:40:00+08:00"));
await page.setViewportSize({ width: 375, height: 812 });
await mockWorkbenchContext(page, {
availability: "ready",
source: "none",
scenario_availability: "not_configured",
artifact_availability: "not_configured",
schedule_availability: "not_configured",
work_order_availability: "not_configured",
alert_availability: "ready",
generated_at: "2026-07-21T02:40:00Z",
conditions: [],
alerts: [{
id: "test-alert",
condition_id: null,
source: { task_type: "other_task", task_id: "test-task", run_id: "test-run" },
title: "供水压力告警",
description: "待核对压力异常。",
occurred_at: "2026-07-21T02:30:00Z",
severity: "warning"
}],
scenarios: [],
latest_analysis: null,
work_orders: []
});
await page.goto("/", { waitUntil: "domcontentloaded" });
await page.getByRole("button", { name: /查看异常处置面板/ }).click();
await expect(page.getByText("来源:工况演示回退", { exact: true })).toBeVisible();
await page.getByRole("button", { name: "查看待办与告警,当前 1 条待处理事项" }).click();
await expect(page.getByText("业务告警来源:后端运行态", { exact: true })).toBeVisible();
await page.getByRole("button", { name: "工况汇总" }).click();
await expect(