diff --git a/examples/wasm-tools/slack/.gitignore b/examples/wasm-tools/slack/.gitignore new file mode 100644 index 00000000..1e7caa9e --- /dev/null +++ b/examples/wasm-tools/slack/.gitignore @@ -0,0 +1,2 @@ +Cargo.lock +target/ diff --git a/examples/wasm-tools/slack/slack.capabilities.json b/examples/wasm-tools/slack/slack-tool.capabilities.json similarity index 100% rename from examples/wasm-tools/slack/slack.capabilities.json rename to examples/wasm-tools/slack/slack-tool.capabilities.json diff --git a/examples/wasm-tools/slack/src/api.rs b/examples/wasm-tools/slack/src/api.rs index 8f1470fa..5fd56f37 100644 --- a/examples/wasm-tools/slack/src/api.rs +++ b/examples/wasm-tools/slack/src/api.rs @@ -4,7 +4,7 @@ //! credential injection and rate limiting. The WASM tool never sees //! the actual bot token. -use crate::bindings::near::agent::host; +use crate::near::agent::host; use crate::types::*; const SLACK_API_BASE: &str = "https://slack.com/api"; diff --git a/examples/wasm-tools/slack/src/lib.rs b/examples/wasm-tools/slack/src/lib.rs index 3d680375..432ba31f 100644 --- a/examples/wasm-tools/slack/src/lib.rs +++ b/examples/wasm-tools/slack/src/lib.rs @@ -42,11 +42,11 @@ impl exports::near::agent::tool::Guest for SlackTool { fn execute(req: exports::near::agent::tool::Request) -> exports::near::agent::tool::Response { match execute_inner(&req.params) { Ok(result) => exports::near::agent::tool::Response { - result: Some(result), + output: Some(result), error: None, }, Err(e) => exports::near::agent::tool::Response { - result: None, + output: None, error: Some(e), }, } @@ -147,7 +147,7 @@ impl exports::near::agent::tool::Guest for SlackTool { /// Inner execution logic with proper error handling. fn execute_inner(params: &str) -> Result { // Check if the Slack token is configured - if !bindings::near::agent::host::secret_exists("slack_bot_token") { + if !crate::near::agent::host::secret_exists("slack_bot_token") { return Err( "Slack bot token not configured. Please add the 'slack_bot_token' secret.".to_string(), ); @@ -157,8 +157,8 @@ fn execute_inner(params: &str) -> Result { let action: SlackAction = serde_json::from_str(params).map_err(|e| format!("Invalid parameters: {}", e))?; - bindings::near::agent::host::log( - bindings::near::agent::host::LogLevel::Info, + crate::near::agent::host::log( + crate::near::agent::host::LogLevel::Info, &format!("Executing Slack action: {:?}", action), );