refactor(agent)!: focus tools on SCADA

This commit is contained in:
2026-07-15 18:30:58 +08:00
parent 8a21908785
commit 155513fdbc
47 changed files with 503 additions and 2910 deletions
+8 -8
View File
@@ -8,13 +8,13 @@ import {
} from "../../src/routes/chatUiState.js";
describe("appendBackendToolArtifact", () => {
it("persists show_chart tool calls as chart artifacts", () => {
it("persists removed visual tool calls as generic tool artifacts", () => {
const artifacts = appendBackendToolArtifact([], {
session_id: "session-1",
tool: "show_chart",
reason: "测试折线图渲染",
params: {
title: "压力曲线",
title: "液位曲线",
chart_type: "line",
x_data: ["00:00", "01:00"],
series: [{ name: "P-101", data: [0.42, 0.41] }],
@@ -24,8 +24,8 @@ describe("appendBackendToolArtifact", () => {
expect(artifacts).toHaveLength(1);
expect(artifacts[0]).toMatchObject({
tool: "show_chart",
kind: "chart",
title: "压力曲线",
kind: "tool",
title: "液位曲线",
description: "测试折线图渲染",
params: {
chart_type: "line",
@@ -50,9 +50,9 @@ describe("appendBackendUiEnvelope", () => {
envelope: {
kind: "map_action",
schemaVersion: "agent-ui@1",
action: "locate_features",
action: "zoom_to_map",
surface: "map_overlay",
params: { ids: ["J-1"], feature_type: "junction" },
params: { x: 121.47, y: 31.23, source_crs: "EPSG:4326" },
},
});
@@ -63,9 +63,9 @@ describe("appendBackendUiEnvelope", () => {
envelope: {
kind: "map_action",
schemaVersion: "agent-ui@1",
action: "locate_features",
action: "zoom_to_map",
surface: "map_overlay",
params: { ids: ["J-1"], feature_type: "junction" },
params: { x: 121.47, y: 31.23, source_crs: "EPSG:4326" },
},
renderStatus: "pending",
},