acosmi-sdk 2.9.0

Acosmi Rust SDK:模型网关、Agent Run Gateway 与 Compliance 统一客户端。双格式(Anthropic + OpenAI)。端口自 acosmi-sdk-ts。
Documentation
//! 统一工具(Unified Tools)业务方法。端口自 `skills/tools.ts`
//! (declaration-merging → 此处 `impl Client` 块)。

use super::types::{ToolListResponse, ToolView};
use crate::billing::entitlements::urlencoding;
use crate::core::client::Client;
use crate::shared::Result;
use tokio_util::sync::CancellationToken;

impl Client {
    /// 获取当前用户租户下的所有工具(Skill 优先 + Plugin 兜底)。对应 TS `listTools`。
    pub async fn list_tools(&self, signal: Option<CancellationToken>) -> Result<Vec<ToolView>> {
        let resp: ToolListResponse = self.billing_get("/tools", signal).await?;
        Ok(resp.skills)
    }

    /// 获取单个工具详情。对应 TS `getTool`。
    pub async fn get_tool(
        &self,
        tool_id: &str,
        signal: Option<CancellationToken>,
    ) -> Result<ToolView> {
        self.billing_get(&format!("/tools/{}", urlencoding(tool_id)), signal)
            .await
    }
}