picoclaw/pkg/tools
admin-mf 93fb7b8794 Merge upstream/main into sync/upstream-2026-05-07
Sync with sipeed/picoclaw upstream/main (~1095 commits since last merge),
including major restructures:

- Launcher migrated to web/backend (#1275): cmd/picoclaw-launcher/* removed.
  Our launcher is dropped (MagicForm doesn't use it; web/backend is the
  upstream replacement when needed).
- Agent loop split (#2585, 12d5421c): pkg/agent/loop.go deleted, replaced by
  pkg/agent/agent_*.go files. Multi-tenancy customizations to be forward-ported
  in follow-up commits on this branch.
- Tool packages reorganized (4c133dc2): pkg/tools/{filesystem,web}.go moved
  to pkg/tools/{fs,integration}/. Customizations to be forward-ported.
- Channels switched to map+Settings model: MagicFormConfig → MagicFormSettings
  registered in config_channel.go alongside other channels; channel constructor
  updated to (channelName, channelType, *Config, *MessageBus) factory pattern.
- Config schema updates: removed deprecated AgentDefaults.Model field;
  removed Config.Bindings (legacy migration in upstream); SessionConfig now
  uses Dimensions instead of DMScope; ExecConfig adds AllowRemote.

Conflicts resolved:
- pkg/agent/loop.go + loop_test.go: accepted upstream deletion (split)
- pkg/tools/{filesystem,web}.go: accepted upstream deletion (moved)
- cmd/picoclaw-launcher/*: dropped (deps deleted upstream, unused by MagicForm)
- cmd/picoclaw/internal/gateway/helpers.go: accepted upstream deletion
- pkg/channels/manager.go: switched to upstream's map-driven channel init
- pkg/config/config.go: merged AgentDefaults fields, kept WorkspaceRoot,
  removed deprecated Model
- pkg/bus/types.go: merged OutboundMessage with upstream's new fields
  (Context, AgentID, SessionKey, Scope, ContextUsage) plus our magicform
  callback fields (Type, Metrics, Progress, Escalation)
- pkg/tools/{cron,shell}.go: combined our customizations with upstream changes
- pkg/skills/installer.go: dropped our LimitReader path (upstream now uses
  chunked DownloadToFile which is size-bounded)

The magicform channel was rebuilt to match upstream's new API:
- *config.MagicFormSettings (SecureString token) instead of MagicFormConfig
- Send returns ([]string, error) per upstream Channel interface
- InboundMessage built with Context (with Raw map for tenancy hints) instead
  of bus.Peer + Metadata field which were removed.

Multi-tenancy hints (workspace_override, config_dir, allowed_tools,
allowed_skills) are still flowing via Context.Raw — the agent loop side of
the integration is forward-ported in a follow-up commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 12:12:44 -05:00
..
fs fix(feishu): fix image download with API fallback and post image support (#2708) 2026-04-30 11:08:00 +08:00
hardware fix(serial_windows): remove unused import (#2697) 2026-04-28 16:19:59 +08:00
integration Merge upstream/main into sync/upstream-2026-05-07 2026-05-07 12:12:44 -05:00
shared feat(agent): migrate tool prompts to capability slots 2026-04-24 19:36:46 +08:00
cron.go Merge upstream/main into sync/upstream-2026-05-07 2026-05-07 12:12:44 -05:00
cron_test.go fix(cron): propagate sessionKey to prevent duplicate tool responses 2026-04-27 13:17:25 +02:00
delegate.go fix(tools): normalize agent_id before self-check and delegation 2026-04-15 22:23:17 +08:00
delegate_test.go test(tools): verify normalization prevents self-delegation bypass 2026-04-15 22:23:47 +08:00
facade_compat_test.go feat(tools): add cross-platform serial hardware tool 2026-04-28 12:54:28 +08:00
fs_facade.go fix(providers,tools): address linter issues after reorg 2026-04-17 14:16:18 +08:00
fs_registry_compat_test.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
hardware_facade.go feat(tools): add cross-platform serial hardware tool 2026-04-28 12:54:28 +08:00
identifier_compat.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
integration_facade.go Keep launcher locale changes from mutating shared web-search routing (#2573) 2026-04-24 13:45:25 +08:00
load_image_compat_test.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
normalization.go fix(tool): route binary outputs through the media pipeline. 2026-03-22 12:05:28 +01:00
path_compat.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
registry.go feat(agent): migrate tool prompts to capability slots 2026-04-24 19:36:46 +08:00
registry_test.go feat(agent): migrate tool prompts to capability slots 2026-04-24 19:36:46 +08:00
result_test.go fix(tool): route binary outputs through the media pipeline. 2026-03-22 12:05:28 +01:00
search_tool.go feat(agent): migrate tool prompts to capability slots 2026-04-24 19:36:46 +08:00
search_tools_test.go feat(mcp): tool search tools (#1243) 2026-03-09 18:21:49 +01:00
session.go refactor(tools): reorganize tool packages and facades 2026-04-17 13:44:31 +08:00
session_process_unix.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
session_process_windows.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
session_test.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
shared_facade.go feat(agent): migrate tool prompts to capability slots 2026-04-24 19:36:46 +08:00
shell.go Merge upstream/main into sync/upstream-2026-05-07 2026-05-07 12:12:44 -05: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 feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
shell_timeout_unix_test.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
spawn.go refactor: improve code readability and consistency across multiple files 2026-03-21 17:12:45 +08:00
spawn_status.go feat(tools): add SpawnStatusTool for reporting subagent statuses (#1540) 2026-03-17 14:41:43 +08:00
spawn_status_test.go feat(tools): add SpawnStatusTool for reporting subagent statuses (#1540) 2026-03-17 14:41:43 +08:00
spawn_test.go fix(tools): prevent nil pointer dereference in spawn tools 2026-03-19 13:51:11 +08:00
subagent.go feat(agent): add TargetAgentID to SubTurnConfig for cross-agent delegation 2026-04-15 21:27:13 +08:00
subagent_tool_test.go fix(tools): prevent nil pointer dereference in spawn tools 2026-03-19 13:51:11 +08:00
sysproc_unix.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
sysproc_windows.go feat(tools): add exec tool enhancement with background execution and PTY support (#1752) 2026-03-25 21:02:49 +08:00
toolloop.go feat: add load_image tool for local file vision (#2116) 2026-04-01 21:32:10 +08:00
validate.go feat(tools): add tool argument schema validation before execution (#1877) 2026-03-24 18:35:56 +08:00
validate_test.go feat(tools): add tool argument schema validation before execution (#1877) 2026-03-24 18:35:56 +08:00