Skip to content

Commit b25dbf3

Browse files
authored
Merge pull request #4 from senamakel/move-openhuman-core
feat(tools): add model exposure classification
2 parents 7dbd540 + 77c3950 commit b25dbf3

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

‎crates/tinytools/src/lib.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,5 +116,5 @@ pub use naming::{
116116
pub use permission::PermissionLevel;
117117
pub use result::{ToolContent, ToolResult};
118118
pub use spec::ToolSpec;
119-
pub use tool::Tool;
119+
pub use tool::{Tool, ToolExposure};
120120
pub use workspace::{SandboxMode, WorkspaceDescriptor};

‎crates/tinytools/src/tool/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
mod types;
44

5-
pub use types::Tool;
5+
pub use types::{Tool, ToolExposure};
66

77
#[cfg(test)]
88
mod test;

‎crates/tinytools/src/tool/types.rs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ use crate::permission::PermissionLevel;
1313
use crate::result::ToolResult;
1414
use crate::spec::ToolSpec;
1515

16+
/// Whether a tool is advertised directly, discoverable on demand, or kept
17+
/// internal to a host-owned composite capability.
18+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
19+
pub enum ToolExposure {
20+
/// Include the tool in the model's initial catalogue.
21+
#[default]
22+
Direct,
23+
/// Omit it initially but allow a tool-search index to reveal it.
24+
Deferred,
25+
/// Never advertise or index it; only host code may invoke it.
26+
Hidden,
27+
}
28+
1629
/// A capability an agent can invoke.
1730
///
1831
/// Everything beyond [`Self::name`], [`Self::description`],
@@ -149,6 +162,11 @@ pub trait Tool: Send + Sync {
149162
ToolCategory::System
150163
}
151164

165+
/// How this tool enters the model-visible catalogue.
166+
fn exposure(&self) -> ToolExposure {
167+
ToolExposure::Direct
168+
}
169+
152170
/// Whether two concurrent invocations are safe to run in parallel within a
153171
/// single model turn.
154172
///

0 commit comments

Comments
 (0)