Skip to main content

zeroclaw_runtime/tools/
attribution.rs

1//! Centralized `Attributable` impls for every concrete `Tool` defined
2//! in `zeroclaw-runtime`. See the sibling file in `zeroclaw-tools` for
3//! the rationale; same pattern.
4
5use zeroclaw_api::attribution::{Attributable, Role, ToolKind};
6use zeroclaw_api::tool_attribution;
7
8use crate::tools::ArcToolRef;
9use crate::tools::cron_add::CronAddTool;
10use crate::tools::cron_list::CronListTool;
11use crate::tools::cron_remove::CronRemoveTool;
12use crate::tools::cron_run::CronRunTool;
13use crate::tools::cron_runs::CronRunsTool;
14use crate::tools::cron_update::CronUpdateTool;
15use crate::tools::delegate::DelegateTool;
16use crate::tools::file_read::FileReadTool;
17use crate::tools::model_switch::ModelSwitchTool;
18use crate::tools::read_skill::ReadSkillTool;
19use crate::tools::schedule::ScheduleTool;
20use crate::tools::security_ops::SecurityOpsTool;
21use crate::tools::send_message_to_peer::SendMessageToPeerTool;
22use crate::tools::shell::ShellTool;
23use crate::tools::skill_http::SkillHttpTool;
24use crate::tools::skill_tool::{SkillBuiltinTool, SkillShellTool};
25use crate::tools::sop_advance::SopAdvanceTool;
26use crate::tools::sop_approve::SopApproveTool;
27use crate::tools::sop_execute::SopExecuteTool;
28use crate::tools::sop_list::SopListTool;
29use crate::tools::sop_status::SopStatusTool;
30use crate::tools::spawn_subagent::SpawnSubagentTool;
31use crate::tools::verifiable_intent::VerifiableIntentTool;
32
33tool_attribution!(CronAddTool, ToolKind::Plugin);
34tool_attribution!(CronListTool, ToolKind::Plugin);
35tool_attribution!(CronRemoveTool, ToolKind::Plugin);
36tool_attribution!(CronRunTool, ToolKind::Plugin);
37tool_attribution!(CronRunsTool, ToolKind::Plugin);
38tool_attribution!(CronUpdateTool, ToolKind::Plugin);
39tool_attribution!(DelegateTool, ToolKind::Plugin);
40tool_attribution!(FileReadTool, ToolKind::Plugin);
41tool_attribution!(ModelSwitchTool, ToolKind::Plugin);
42tool_attribution!(ReadSkillTool, ToolKind::Plugin);
43tool_attribution!(ScheduleTool, ToolKind::Plugin);
44tool_attribution!(SecurityOpsTool, ToolKind::Plugin);
45tool_attribution!(SendMessageToPeerTool, ToolKind::Plugin);
46tool_attribution!(ShellTool, ToolKind::Shell);
47tool_attribution!(SkillHttpTool, ToolKind::Plugin);
48tool_attribution!(SkillBuiltinTool, ToolKind::Plugin);
49tool_attribution!(SkillShellTool, ToolKind::Plugin);
50tool_attribution!(SopAdvanceTool, ToolKind::SopAdvance);
51tool_attribution!(SopApproveTool, ToolKind::SopApprove);
52tool_attribution!(SopExecuteTool, ToolKind::SopExecute);
53tool_attribution!(SopListTool, ToolKind::SopList);
54tool_attribution!(SopStatusTool, ToolKind::SopStatus);
55tool_attribution!(SpawnSubagentTool, ToolKind::SpawnSubagent);
56tool_attribution!(VerifiableIntentTool, ToolKind::Plugin);
57
58// Arc-wrapping shell: surface the inner tool's attribution so the
59// registered tool reports its real identity, not a generic mask.
60// Private wrappers (`ArcDelegatingTool`, `ToolArcRef`) carry their
61// own impls next to their `impl Tool` blocks in `mod.rs` and
62// `delegate.rs` respectively, since the structs aren't `pub`.
63impl Attributable for ArcToolRef {
64    fn role(&self) -> Role {
65        self.0.role()
66    }
67    fn alias(&self) -> &str {
68        self.0.alias()
69    }
70}