picoclaw/pkg/tools
0x5487 19c698356c
fix(security): workspace sandbox avoid time-of-check/time-of-use (TOCTOU) races (#464)
* chore: Update default host bindings from 0.0.0.0 to 127.0.0.1 for various services and examples.

* config: Update default host bindings to 0.0.0.0 for improved Docker accessibility and add related documentation.

* refactor: reimplement filesystem tools with `os.OpenRoot` for enhanced security and simplified path validation.

* chore: revert other PR content from this branch

* docs: Update Chinese README.

* docs: Update Chinese README.

* docs: Update Chinese README.

* refactor: Reorder filesystem helper functions, extract directory entry formatting logic, and enhance `WriteFileTool`'s result message.

* feat: Enhance `mkdirAllInRoot` to prevent creating directories over existing files and add tests for directory creation functionality.

* Refactor filesystem tools to use a `fileReadWriter` interface for both host and sandboxed I/O, improving atomic writes and error handling.

* refactor: unify filesystem read/write operations with atomic write guarantees and clearer naming.

* refactor: rename `appendFileWithRW` function to `appendFile`

* refactor: unify filesystem access by introducing a `fileSystem` interface and updating tools to use it directly, removing `os.Root` dependency from `sandboxFs`.

* chore: run make fmt

* fix: `validatePath` now returns an error when the workspace is empty.
2026-02-23 20:09:53 +11:00
..
base.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
cron.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
edit.go fix(security): workspace sandbox avoid time-of-check/time-of-use (TOCTOU) races (#464) 2026-02-23 20:09:53 +11:00
edit_test.go fix(security): workspace sandbox avoid time-of-check/time-of-use (TOCTOU) races (#464) 2026-02-23 20:09:53 +11:00
filesystem.go fix(security): workspace sandbox avoid time-of-check/time-of-use (TOCTOU) races (#464) 2026-02-23 20:09:53 +11:00
filesystem_test.go fix(security): workspace sandbox avoid time-of-check/time-of-use (TOCTOU) races (#464) 2026-02-23 20:09:53 +11:00
i2c.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
i2c_linux.go feat(linter): Fix govet linter 2026-02-20 22:35:16 +02:00
i2c_other.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
message.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
message_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
registry.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
registry_test.go feat: integrate Tavily search (#340) 2026-02-23 00:30:14 +08:00
result.go feat: US-002 - Modify Tool interface to return *ToolResult 2026-02-12 19:28:56 +08:00
result_test.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
shell.go fix (security): ExecTool working_dir sandbox escape (#478) 2026-02-21 08:15:46 +08:00
shell_process_unix.go fix(exec): terminate process tree on timeout 2026-02-18 02:01:29 +08:00
shell_process_windows.go fix(exec): terminate process tree on timeout 2026-02-18 02:01:29 +08:00
shell_test.go fix: golangci-lint run --fix 2026-02-21 16:20:15 +08:00
shell_timeout_unix_test.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_install.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_install_test.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_search.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
skills_search_test.go feat(fmt): Fix formatting 2026-02-20 20:03:11 +02:00
spawn.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
spi.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
spi_linux.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
spi_other.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
subagent.go Merge branch 'main' into fix-formatting 2026-02-19 22:04:48 +02:00
subagent_tool_test.go feat(fmt): Fix formatting 2026-02-19 22:05:15 +02:00
toolloop.go Merge branch 'main' into fix-formatting 2026-02-20 20:02:53 +02:00
types.go feat(fmt): Run formatters 2026-02-18 21:48:23 +02:00
web.go Fix: missing Tavily config in loop.go, and the invalid config param in web_search (#660) 2026-02-23 12:12:34 +08:00
web_test.go feat: integrate Tavily search (#340) 2026-02-23 00:30:14 +08:00