refactor!: drop clawdis_ tool prefix
This commit is contained in:
@@ -2,17 +2,17 @@ import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { createClawdisTools } from "./clawdis-tools.js";
|
||||
|
||||
describe("clawdis_gateway tool", () => {
|
||||
describe("gateway tool", () => {
|
||||
it("schedules SIGUSR1 restart", async () => {
|
||||
vi.useFakeTimers();
|
||||
const kill = vi.spyOn(process, "kill").mockImplementation(() => true);
|
||||
|
||||
try {
|
||||
const tool = createClawdisTools().find(
|
||||
(candidate) => candidate.name === "clawdis_gateway",
|
||||
(candidate) => candidate.name === "gateway",
|
||||
);
|
||||
expect(tool).toBeDefined();
|
||||
if (!tool) throw new Error("missing clawdis_gateway tool");
|
||||
if (!tool) throw new Error("missing gateway tool");
|
||||
|
||||
const result = await tool.execute("call1", {
|
||||
action: "restart",
|
||||
|
||||
@@ -12,7 +12,7 @@ vi.mock("../media/image-ops.js", () => ({
|
||||
|
||||
import { createClawdisTools } from "./clawdis-tools.js";
|
||||
|
||||
describe("clawdis_nodes camera_snap", () => {
|
||||
describe("nodes camera_snap", () => {
|
||||
beforeEach(() => {
|
||||
callGateway.mockReset();
|
||||
});
|
||||
@@ -36,9 +36,9 @@ describe("clawdis_nodes camera_snap", () => {
|
||||
});
|
||||
|
||||
const tool = createClawdisTools().find(
|
||||
(candidate) => candidate.name === "clawdis_nodes",
|
||||
(candidate) => candidate.name === "nodes",
|
||||
);
|
||||
if (!tool) throw new Error("missing clawdis_nodes tool");
|
||||
if (!tool) throw new Error("missing nodes tool");
|
||||
|
||||
const result = await tool.execute("call1", {
|
||||
action: "camera_snap",
|
||||
@@ -76,9 +76,9 @@ describe("clawdis_nodes camera_snap", () => {
|
||||
});
|
||||
|
||||
const tool = createClawdisTools().find(
|
||||
(candidate) => candidate.name === "clawdis_nodes",
|
||||
(candidate) => candidate.name === "nodes",
|
||||
);
|
||||
if (!tool) throw new Error("missing clawdis_nodes tool");
|
||||
if (!tool) throw new Error("missing nodes tool");
|
||||
|
||||
await tool.execute("call1", {
|
||||
action: "camera_snap",
|
||||
|
||||
@@ -577,8 +577,8 @@ const BrowserToolSchema = Type.Union([
|
||||
|
||||
function createBrowserTool(): AnyAgentTool {
|
||||
return {
|
||||
label: "Clawdis Browser",
|
||||
name: "clawdis_browser",
|
||||
label: "Browser",
|
||||
name: "browser",
|
||||
description:
|
||||
"Control clawd's dedicated browser (status/start/stop/tabs/open/snapshot/screenshot/actions). Use snapshot+act for UI automation. Avoid act:wait by default; use only in exceptional cases when no reliable UI state exists.",
|
||||
parameters: BrowserToolSchema,
|
||||
@@ -837,8 +837,8 @@ const CanvasToolSchema = Type.Union([
|
||||
|
||||
function createCanvasTool(): AnyAgentTool {
|
||||
return {
|
||||
label: "Clawdis Canvas",
|
||||
name: "clawdis_canvas",
|
||||
label: "Canvas",
|
||||
name: "canvas",
|
||||
description:
|
||||
"Control node canvases (present/hide/navigate/eval/snapshot/A2UI). Use snapshot to capture the rendered UI.",
|
||||
parameters: CanvasToolSchema,
|
||||
@@ -1088,8 +1088,8 @@ const NodesToolSchema = Type.Union([
|
||||
|
||||
function createNodesTool(): AnyAgentTool {
|
||||
return {
|
||||
label: "Clawdis Nodes",
|
||||
name: "clawdis_nodes",
|
||||
label: "Nodes",
|
||||
name: "nodes",
|
||||
description:
|
||||
"Discover and control paired nodes (status/describe/pairing/notify/camera/screen).",
|
||||
parameters: NodesToolSchema,
|
||||
@@ -1454,8 +1454,8 @@ const CronToolSchema = Type.Union([
|
||||
|
||||
function createCronTool(): AnyAgentTool {
|
||||
return {
|
||||
label: "Clawdis Cron",
|
||||
name: "clawdis_cron",
|
||||
label: "Cron",
|
||||
name: "cron",
|
||||
description:
|
||||
"Manage Gateway cron jobs (status/list/add/update/remove/run/runs) and send wake events.",
|
||||
parameters: CronToolSchema,
|
||||
@@ -1736,7 +1736,7 @@ const DiscordToolSchema = Type.Union([
|
||||
|
||||
function createDiscordTool(): AnyAgentTool {
|
||||
return {
|
||||
label: "Clawdis Discord",
|
||||
label: "Discord",
|
||||
name: "discord",
|
||||
description: "Manage Discord messages, reactions, and moderation.",
|
||||
parameters: DiscordToolSchema,
|
||||
@@ -2264,8 +2264,8 @@ function createDiscordTool(): AnyAgentTool {
|
||||
|
||||
function createGatewayTool(): AnyAgentTool {
|
||||
return {
|
||||
label: "Clawdis Gateway",
|
||||
name: "clawdis_gateway",
|
||||
label: "Gateway",
|
||||
name: "gateway",
|
||||
description:
|
||||
"Restart the running gateway process in-place (SIGUSR1) without needing an external supervisor. Use delayMs to avoid interrupting an in-flight reply.",
|
||||
parameters: GatewayToolSchema,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { createClawdisCodingTools } from "./pi-tools.js";
|
||||
describe("createClawdisCodingTools", () => {
|
||||
it("merges properties for union tool schemas", () => {
|
||||
const tools = createClawdisCodingTools();
|
||||
const browser = tools.find((tool) => tool.name === "clawdis_browser");
|
||||
const browser = tools.find((tool) => tool.name === "browser");
|
||||
expect(browser).toBeDefined();
|
||||
const parameters = browser?.parameters as {
|
||||
anyOf?: unknown[];
|
||||
@@ -26,9 +26,7 @@ describe("createClawdisCodingTools", () => {
|
||||
|
||||
it("preserves union action values in merged schema", () => {
|
||||
const tools = createClawdisCodingTools();
|
||||
const toolNames = tools
|
||||
.filter((tool) => tool.name.startsWith("clawdis_"))
|
||||
.map((tool) => tool.name);
|
||||
const toolNames = ["browser", "canvas", "nodes", "cron", "gateway"];
|
||||
|
||||
for (const name of toolNames) {
|
||||
const tool = tools.find((candidate) => candidate.name === name);
|
||||
|
||||
@@ -62,10 +62,10 @@ export function buildAgentSystemPromptAppend(params: {
|
||||
"- bash: run shell commands (supports background via yieldMs/background)",
|
||||
"- process: manage background bash sessions",
|
||||
"- whatsapp_login: generate a WhatsApp QR code and wait for linking",
|
||||
"- clawdis_browser: control clawd's dedicated browser",
|
||||
"- clawdis_canvas: present/eval/snapshot the Canvas",
|
||||
"- clawdis_nodes: list/describe/notify/camera/screen on paired nodes",
|
||||
"- clawdis_cron: manage cron jobs and wake events",
|
||||
"- browser: control clawd's dedicated browser",
|
||||
"- canvas: present/eval/snapshot the Canvas",
|
||||
"- nodes: list/describe/notify/camera/screen on paired nodes",
|
||||
"- cron: manage cron jobs and wake events",
|
||||
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
|
||||
"",
|
||||
"## Workspace",
|
||||
|
||||
Reference in New Issue
Block a user