5.0 KiB
summary, read_when
| summary | read_when | ||
|---|---|---|---|
| Agent tool surface for Clawdis (browser, canvas, nodes, cron) replacing clawdis-* skills |
|
Tools (Clawdis)
Clawdis exposes first-class agent tools for browser, canvas, nodes, and cron.
These replace the old clawdis-* skills: the tools are typed, no shelling,
and the agent should rely on them directly.
Tool inventory
bash
Run shell commands in the workspace.
Core parameters:
command(required)yieldMs(auto-background after timeout, default 20000)background(immediate background)timeout(seconds; kills the process if exceeded, default 1800)
Notes:
- Returns
status: "running"with asessionIdwhen backgrounded. - Use
processto poll/log/write/kill/clear background sessions.
process
Manage background bash sessions.
Core actions:
list,poll,log,write,kill,clear,remove
Notes:
pollreturns new output and exit status when complete.logsupports line-basedoffset/limit(omitoffsetto grab the last N lines).
clawdis_browser
Control the dedicated clawd browser.
Core actions:
status,start,stop,tabs,open,focus,closesnapshot(aria/ai)screenshot(returns image block +MEDIA:<path>)act(UI actions: click/type/press/hover/drag/select/fill/resize/wait/evaluate)navigate,console,pdf,upload,dialog
Notes:
- Requires
browser.enabled=truein~/.clawdis/clawdis.json. - Uses
browser.controlUrlunlesscontrolUrlis passed explicitly. snapshotdefaults toai; useariafor the accessibility tree.actrequiresreffromsnapshot --format ai; useevaluatefor rare CSS selector needs.
clawdis_canvas
Drive the node Canvas (present, eval, snapshot, A2UI).
Core actions:
present,hide,navigate,evalsnapshot(returns image block +MEDIA:<path>)a2ui_push,a2ui_reset
Notes:
- Uses gateway
node.invokeunder the hood. - If no
nodeis provided, the tool picks a default (single connected node or local mac node). - A2UI is v0.8 only (no
createSurface); the CLI rejects v0.9 JSONL with line errors. - Quick smoke:
clawdis canvas a2ui push --text "Hello from A2UI".
clawdis_nodes
Discover and target paired nodes; send notifications; capture camera/screen.
Core actions:
status,describepending,approve,reject(pairing)notify(macOSsystem.notify)camera_snap,camera_clip,screen_record
Notes:
- Camera/screen commands require the node app to be foregrounded.
- Images return image blocks +
MEDIA:<path>. - Videos return
FILE:<path>(mp4).
clawdis_cron
Manage Gateway cron jobs and wakeups.
Core actions:
status,listadd,update,remove,run,runswake(enqueue system event + optional immediate heartbeat)
Notes:
addexpects a full cron job object (same schema ascron.addRPC).updateuses{ jobId, patch }.
clawdis_gateway
Restart the running Gateway process (in-place).
Core actions:
restart(sendsSIGUSR1to the current process;clawdis gateway/gateway-daemonrestart in-place)
Notes:
- Use
delayMs(defaults to 2000) to avoid interrupting an in-flight reply.
Parameters (common)
Gateway-backed tools (clawdis_canvas, clawdis_nodes, clawdis_cron):
gatewayUrl(defaultws://127.0.0.1:18789)gatewayToken(if auth enabled)timeoutMs
Browser tool:
controlUrl(defaults from config)
Recommended agent flows
Browser automation:
clawdis_browser→status/startsnapshot(ai or aria)act(click/type/press)screenshotif you need visual confirmation
Canvas render:
clawdis_canvas→presenta2ui_push(optional)snapshot
Node targeting:
clawdis_nodes→statusdescribeon the chosen nodenotify/camera_snap/screen_record
Safety
- Avoid
system.run(not exposed as a tool). - Respect user consent for camera/screen capture.
- Use
status/describeto ensure permissions before invoking media commands.
How the model sees tools (pi-mono internals)
Tools are exposed to the model in two parallel channels:
- System prompt text: a human-readable list + guidelines.
- Provider tool schema: the actual function/tool declarations sent to the model API.
In pi-mono:
- System prompt builder:
packages/coding-agent/src/core/system-prompt.ts- Builds the
Available tools:list fromtoolDescriptions. - Appends skills and project context.
- Builds the
- Tool schemas passed to providers:
- OpenAI:
packages/ai/src/providers/openai-responses.ts(convertTools) - Anthropic:
packages/ai/src/providers/anthropic.ts(convertTools) - Gemini:
packages/ai/src/providers/google-shared.ts(convertTools)
- OpenAI:
- Tool execution loop:
- Agent loop:
packages/ai/src/agent/agent-loop.ts - Validates tool arguments and executes tools, then appends
toolResultmessages.
- Agent loop:
In Clawdis:
- System prompt append:
src/agents/system-prompt.ts - Tool list injected via
createClawdisCodingTools()insrc/agents/pi-tools.ts