chore: disable external and frontend tools
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { existsSync } from "node:fs";
|
||||
|
||||
const disabledServerTools = [
|
||||
"geocode",
|
||||
"get_project_context",
|
||||
"list_scada_assets",
|
||||
"query_scada_readings",
|
||||
"web_search",
|
||||
];
|
||||
|
||||
describe("disabled opencode tools", () => {
|
||||
it("does not expose Server-dependent or frontend-action tools", () => {
|
||||
for (const toolName of disabledServerTools) {
|
||||
expect(existsSync(`.opencode/tools/${toolName}.ts`)).toBeFalse();
|
||||
}
|
||||
expect(existsSync(".opencode/tools/server_api_shared.ts")).toBeFalse();
|
||||
expect(existsSync(".opencode/tools/zoom_to_map.ts")).toBeFalse();
|
||||
expect(existsSync(".opencode/tools/frontend_action.ts")).toBeFalse();
|
||||
expect(existsSync(".opencode/plugins/frontend-action-call-id.ts")).toBeFalse();
|
||||
});
|
||||
});
|
||||
@@ -1,19 +0,0 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { readFileSync } from "node:fs";
|
||||
|
||||
describe("SCADA opencode tools", () => {
|
||||
it("documents asset listing and reading query parameters", () => {
|
||||
const listTool = readFileSync(".opencode/tools/list_scada_assets.ts", "utf8");
|
||||
const queryTool = readFileSync(".opencode/tools/query_scada_readings.ts", "utf8");
|
||||
|
||||
expect(listTool).toContain("无请求参数");
|
||||
expect(listTool).toContain("assets[].scada_id");
|
||||
expect(queryTool).toContain("asset_ids");
|
||||
expect(queryTool).toContain("observed_from");
|
||||
expect(queryTool).toContain("observed_to");
|
||||
expect(queryTool).toContain("granularity");
|
||||
expect(queryTool).toContain("metrics");
|
||||
expect(queryTool).toContain("半开区间");
|
||||
expect(queryTool).toContain("不要使用 GeoServer feature id/fid、external_id 或 site_external_id");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user