zeroclaw/src/tools
Argenis 8e81d44d54
fix(gateway): address critical security and reliability bugs in Live Canvas (#4196)
* feat(gateway): add Live Canvas (A2UI) tool and real-time web viewer

Add a Live Canvas system that enables the agent to push rendered content
(HTML, SVG, Markdown, text) to a web-visible canvas in real time.

Backend:
- src/tools/canvas.rs: CanvasTool with render/snapshot/clear/eval actions,
  backed by a shared CanvasStore (Arc<RwLock<HashMap>>) with per-canvas
  broadcast channels for real-time updates
- src/gateway/canvas.rs: REST endpoints (GET/POST/DELETE /api/canvas/:id,
  GET /api/canvas/:id/history, GET /api/canvas) and WebSocket endpoint
  (WS /ws/canvas/:id) for real-time frame delivery

Frontend:
- web/src/pages/Canvas.tsx: Canvas viewer page with WebSocket connection,
  iframe sandbox rendering, canvas switcher, frame history panel

Registration:
- CanvasTool registered in all_tools_with_runtime (always available)
- Canvas routes wired into gateway router
- CanvasStore added to AppState
- Canvas page added to App.tsx router and Sidebar navigation
- i18n keys added for en/zh/tr locales

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): fix pre-existing test compilation errors in schema.rs

- Remove #[cfg(unix)] gate on `use tempfile::TempDir` import since
  TempDir is used unconditionally in bootstrap file tests
- Add explicit type annotations on tokio::fs::* calls to resolve
  type inference failures (create_dir_all, write, read_to_string)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(gateway): share CanvasStore between tool and REST API

The CanvasTool and gateway AppState each created their own CanvasStore,
so content rendered via the tool never appeared in the REST API.

Create the CanvasStore once in the gateway, pass it to
all_tools_with_runtime via a new optional parameter, and reuse the
same instance in AppState.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(gateway): address critical security and reliability bugs in Live Canvas

- Validate content_type in REST POST endpoint against allowed set,
  preventing injection of "eval" frames via the REST API
- Enforce MAX_CONTENT_SIZE (256KB) limit on REST POST endpoint,
  matching tool-side validation to prevent memory exhaustion
- Add MAX_CANVAS_COUNT (100) limit to prevent unbounded canvas creation
  and memory exhaustion from CanvasStore
- Handle broadcast RecvError::Lagged in WebSocket handler gracefully
  instead of disconnecting the client
- Make MAX_CONTENT_SIZE and ALLOWED_CONTENT_TYPES pub for gateway reuse
- Update CanvasStore::render and subscribe to return Option for
  canvas count enforcement

---------

Co-authored-by: Giulio V <vannini.gv@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: rareba <rareba@users.noreply.github.com>
2026-03-21 20:59:18 -04:00
..
microsoft365 feat(tools): add Microsoft 365 integration via Graph API (#3653) 2026-03-16 01:44:39 -04:00
backup_tool.rs feat(tools): add backup/restore and data management tools (#3662) 2026-03-16 02:35:44 -04:00
browser_delegate.rs feat(tools): add browser delegation tool (#3610) 2026-03-16 18:32:20 -04:00
browser_open.rs fix(security): harden redirect/browser_open and restore masked secrets 2026-02-24 16:03:01 +08:00
browser.rs fix(tools): qualify is_service_environment with super:: inside mod native_backend (#3659) 2026-03-16 00:35:09 -04:00
calculator.rs feat(tools): add calculator tool with arithmetic and statistical functions (#4012) 2026-03-19 21:40:27 -04:00
canvas.rs fix(gateway): address critical security and reliability bugs in Live Canvas (#4196) 2026-03-21 20:59:18 -04:00
claude_code.rs fix(tools): use kill_on_drop for ClaudeCodeTool subprocess timeout 2026-03-21 07:46:24 -04:00
cli_discovery.rs feat(tools): add Google Workspace CLI (gws) integration (#3616) 2026-03-17 00:52:59 -04:00
cloud_ops.rs feat(tools): add cloud transformation accelerator tools (#3663) 2026-03-16 02:43:55 -04:00
cloud_patterns.rs feat(tools): add cloud transformation accelerator tools (#3663) 2026-03-16 02:43:55 -04:00
composio.rs fix(security): harden redirect/browser_open and restore masked secrets 2026-02-24 16:03:01 +08:00
content_search.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
cron_add.rs fix(cron): persist delivery for api-created cron jobs (#4087) 2026-03-20 15:42:00 -04:00
cron_list.rs style: apply rustfmt to async fs updates 2026-02-19 14:52:29 +08:00
cron_remove.rs fix(security): unify cron shell validation across API/CLI/scheduler (#3270) 2026-03-12 12:48:13 +00:00
cron_run.rs fix(cron): persist delivery for api-created cron jobs (#4087) 2026-03-20 15:42:00 -04:00
cron_runs.rs style: apply rustfmt to async fs updates 2026-02-19 14:52:29 +08:00
cron_update.rs fix(cron): persist allowed_tools for agent jobs (#3993) 2026-03-19 14:37:55 -04:00
data_management.rs feat(tools): add backup/restore and data management tools (#3662) 2026-03-16 02:35:44 -04:00
delegate.rs feat(config): add configurable pacing controls for slow/local LLM workloads (#3343) 2026-03-21 08:54:08 -04:00
file_edit.rs Merge pull request #3288 from Alix-007/fix-2400-block-config-self-mutation 2026-03-19 15:16:48 -04:00
file_read.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
file_write.rs Merge pull request #3288 from Alix-007/fix-2400-block-config-self-mutation 2026-03-19 15:16:48 -04:00
git_operations.rs feat(channel): stream LLM responses to Telegram via draft message edits 2026-02-18 16:33:33 +08:00
glob_search.rs fix(security): respect allowed_roots in tool-level path pre-checks (#3434) 2026-03-13 16:15:30 -04:00
google_workspace.rs feat(tool): google_workspace operation-level allowlist (#4010) 2026-03-20 11:46:22 -04:00
hardware_board_info.rs fix: resolve all clippy warnings, formatting, and Mistral endpoint 2026-02-17 20:00:08 +08:00
hardware_memory_map.rs fix: resolve all clippy warnings, formatting, and Mistral endpoint 2026-02-17 20:00:08 +08:00
hardware_memory_read.rs fix(security): resolve rebase conflicts and provider regressions 2026-02-17 19:19:06 +08:00
http_request.rs feat(tool): add allow_private_hosts option to http_request tool (#3568) 2026-03-15 14:23:54 -04:00
image_gen.rs fix(tools): harden image_gen security enforcement and model validation 2026-03-21 20:08:51 -04:00
image_info.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
jira_tool.rs feat(tool): add myself and list_projects actions to jira tool (#4061) 2026-03-20 15:11:53 -04:00
knowledge_tool.rs feat(knowledge): add knowledge graph for expertise capture and reuse (#3596) 2026-03-17 01:11:29 -04:00
linkedin_client.rs feat(multi): LinkedIn tool, WhatsApp voice notes, and Anthropic OAuth fix (#3604) 2026-03-17 01:55:05 -04:00
linkedin.rs feat(multi): LinkedIn tool, WhatsApp voice notes, and Anthropic OAuth fix (#3604) 2026-03-17 01:55:05 -04:00
mcp_client.rs fix: use cfg-conditional AtomicU32 fallback for 32-bit targets in mcp_client (#3432) 2026-03-13 15:33:31 -04:00
mcp_deferred.rs fix(tool): include descriptions in deferred MCP tools system prompt (#4018) 2026-03-19 22:35:55 -04:00
mcp_protocol.rs feat(tools/mcp): add MCP subsystem tools layer with multi-transport client (#3394) 2026-03-13 14:23:48 -04:00
mcp_tool.rs feat(tools/mcp): add MCP subsystem tools layer with multi-transport client (#3394) 2026-03-13 14:23:48 -04:00
mcp_transport.rs feat(tools/mcp): add MCP subsystem tools layer with multi-transport client (#3394) 2026-03-13 14:23:48 -04:00
memory_forget.rs fix(policy): standardize side-effect tool autonomy gates 2026-02-18 12:42:56 +08:00
memory_recall.rs feat(memory): add time range filter to recall (since/until) 2026-03-21 07:46:34 -04:00
memory_store.rs fix(channels): recover malformed invoke/tool_call output in daemon mode 2026-02-18 17:01:36 +08:00
mod.rs fix(gateway): address critical security and reliability bugs in Live Canvas (#4196) 2026-03-21 20:59:18 -04:00
model_routing_config.rs feat(tool): enrich delegate sub-agent system prompt and add skills_directory config key (#3344) 2026-03-21 07:53:02 -04:00
model_switch.rs feat(agent): add runtime model switching via model_switch tool (#3853) 2026-03-18 14:17:52 -04:00
node_tool.rs feat(gateway): add dynamic node discovery and capability advertisement (#3448) 2026-03-13 18:23:48 -04:00
notion_tool.rs feat(notion): add Notion database poller channel and API tool (#3650) 2026-03-16 00:55:23 -04:00
pdf_read.rs fix(tools): use resolve_tool_path for consistent path resolution (#3937) 2026-03-18 23:51:35 -04:00
project_intel.rs feat(tools): add Microsoft 365 integration via Graph API (#3653) 2026-03-16 01:44:39 -04:00
proxy_config.rs feat(channels): add Reddit, Bluesky, and generic Webhook adapters (#3598) 2026-03-17 01:26:58 -04:00
pushover.rs chore: Remove blocking read strings 2026-02-19 14:52:29 +08:00
read_skill.rs feat(skills): add read_skill for compact mode 2026-03-19 17:53:40 +08:00
report_templates.rs feat(tools): add Microsoft 365 integration via Graph API (#3653) 2026-03-16 01:44:39 -04:00
schedule.rs fix(cron): persist delivery for api-created cron jobs (#4087) 2026-03-20 15:42:00 -04:00
schema.rs fix(build): complete strict lint and test cleanup (replacement for #476) 2026-02-18 00:18:54 +08:00
screenshot.rs Addressed clippy lint issues 2026-03-10 01:48:19 -04:00
security_ops.rs feat(security): add MCSS security operations tool (#3657) 2026-03-16 02:28:54 -04:00
shell.rs fix(security): wire sandbox into shell command execution (#3989) 2026-03-19 14:21:42 -04:00
sop_advance.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_approve.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_execute.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_list.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
sop_status.rs fix(web): call doctor endpoint with authenticated POST 2026-02-24 16:02:59 +08:00
swarm.rs feat(tool): enrich delegate sub-agent system prompt and add skills_directory config key (#3344) 2026-03-21 07:53:02 -04:00
text_browser.rs feat(tools): add text browser tool for headless environments (#4031) 2026-03-20 01:59:43 -04:00
tool_search.rs fix(tools): include tool_search instruction in deferred tools system prompt (#3826) (#3914) 2026-03-18 15:13:58 -04:00
traits.rs test: deepen and complete project-wide test coverage (#297) 2026-02-16 05:58:24 -05:00
verifiable_intent.rs feat(verifiable_intent): add native verifiable intent lifecycle module (#2938) 2026-03-20 17:52:55 -04:00
weather_tool.rs feat(tools): add WeatherTool with wttr.in integration (#4104) 2026-03-21 05:32:28 -04:00
web_fetch.rs Harden config secret masking and web_fetch limits 2026-02-24 16:03:01 +08:00
web_search_provider_routing.rs feat(tools): route web_search providers with alias fallback (#4038) 2026-03-20 18:22:32 -04:00
web_search_tool.rs feat(tools): route web_search providers with alias fallback (#4038) 2026-03-20 18:22:32 -04:00
workspace_tool.rs feat(workspace): add multi-client workspace isolation 2026-03-15 22:41:18 -04:00