OneShot:自主 AI 商业交易 - Openclaw Skills

作者:互联网

2026-04-18

AI教程

什么是 OneShot?

OneShot 是一个全面的 SDK 和 MCP 服务器,旨在弥合 AI 代理与现实世界行动之间的鸿沟。通过利用 x402 支付(特别是 Base 网络上的 USDC),该工具允许代理自主处理发送电子邮件、拨打语音电话、进行深度研究甚至购买实物产品等任务。对于使用 Openclaw Skills 构建、且需要其代理拥有经济代理权而无需传统 API 密钥摩擦的开发者来说,这是一个至关重要的补充。

该系统利用代理自身的钱包私钥对交易进行签名,确保商业互动的去中心化和流线型工作流程。无论您是构建销售机器人还是自动化研究助手,OneShot 都能让您的代理作为 Web 上的头等经济公民运行,使其成为高级 Openclaw Skills 开发的基石。

下载入口:https://github.com/openclaw/skills/tree/main/skills/tormine/oneshot-agent

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install oneshot-agent

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 oneshot-agent。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

OneShot 应用场景

  • 通过具有个性化、自主内容的电子邮件和短信自动执行外呼销售。
  • 使用 AI 驱动的语音通话安排会议并进行跟进。
  • 执行深度市场研究和数据充实,用于潜在客户生成和竞争分析。
  • 使 AI 代理能够自主采购硬件、办公用品或软件订阅。
  • 通过简单的代理指令为新产品构建和更新落地页。
OneShot 工作原理
  1. 开发者在其代理环境中安装 OneShot SDK 或 MCP 服务器。
  2. 代理的钱包在 Base 网络(或用于测试目的的 Base Sepolia)上充入 USDC。
  3. 将 ONESHOT_WALLET_PRIVATE_KEY 配置为环境变量,以允许代理签署交易。
  4. 代理调用特定的 SDK 方法(如 email、voice 或 commerceBuy)来触发现实世界的操作。
  5. 每笔交易都会使用 x402 协议自动签名并支付,小额微支付将直接从代理的余额中扣除。

OneShot 配置指南

通过 npm 安装 SDK,开始构建您的 Openclaw Skills 集成:

npm install @oneshot-agent/sdk

设置环境变量以授权代理的钱包:

export ONESHOT_WALLET_PRIVATE_KEY="0xYourPrivateKey"

对于在 Claude Code 或 Cursor 中的 MCP 使用,请在配置中添加以下内容:

{
  "mcpServers": {
    "oneshot": {
      "command": "npx",
      "args": ["-y", "@oneshot-agent/mcp-server"],
      "env": {
        "ONESHOT_WALLET_PRIVATE_KEY": "0xYourPrivateKey"
      }
    }
  }
}

OneShot 数据架构与分类体系

OneShot 通过针对各种商业行动的结构化响应来管理数据,使其易于集成到复杂的 Openclaw Skills 工作流中。

方法 关键数据点 输出格式
研究 查询、深度、报告内容、来源 带有引用的 JSON 对象
商务 产品 URL、收货地址、最高价格 交易收据
数据充实 姓名、公司、LinkedIn URL 个人资料 JSON
通信 收件人、主题、正文内容 交付状态和 ID
name: oneshot
description: |
  OneShot SDK for AI agent commercial transactions. Send emails, make calls, research, buy products, and more with automatic x402 payments.
  Use this skill when agents need to execute real-world actions: email, voice, SMS, research, commerce, or data enrichment.
  Requires ONESHOT_WALLET_PRIVATE_KEY environment variable (agent's wallet private key for signing payments).
metadata:
  author: oneshotagent
  version: "1.1.0"
  homepage: "https://oneshotagent.com"

OneShot

Infrastructure for autonomous AI agents to execute real-world commercial transactions: email, payments, e-commerce, research, and data enrichment with native x402 payments.

Quick Start

npm install @oneshot-agent/sdk
import { OneShot } from '@oneshot-agent/sdk';

const agent = new OneShot({
  privateKey: process.env.ONESHOT_WALLET_PRIVATE_KEY
});

// Send an email
const result = await agent.email({
  to: 'recipient@example.com',
  subject: 'Hello from my agent',
  body: 'This email was sent autonomously.'
});

Authentication

OneShot uses x402 payments (USDC on Base). No API keys—your agent's wallet private key signs transactions automatically.

Environment Variable:

export ONESHOT_WALLET_PRIVATE_KEY="0xYourPrivateKey"

Test Mode: SDK runs in test mode by default (Base Sepolia testnet). Set ONESHOT_TEST_MODE=false for production.

SDK Methods

Email

// Send email (~$0.01 per email, ~$10 first-time domain setup)
const result = await agent.email({
  to: 'recipient@example.com',
  subject: 'Subject line',
  body: 'Email body content',
  attachments: [{ filename: 'doc.pdf', content: base64String }]
});

// Bulk email
const result = await agent.email({
  to: ['user1@example.com', 'user2@example.com'],
  subject: 'Bulk message',
  body: 'Sent to multiple recipients'
});

Inbox

// List inbound emails (free)
const emails = await agent.inboxList();

// Get specific email
const email = await agent.inboxGet({ id: 'email_id' });

SMS

// Send SMS (~$0.035 per segment)
const result = await agent.sms({
  to: '+15551234567',
  body: 'Hello via SMS'
});

// List SMS inbox
const messages = await agent.smsInboxList();

Voice Calls

// Make a call (~$0.25/min)
const result = await agent.voice({
  to: '+15551234567',
  objective: 'Schedule a meeting for next Tuesday',
  context: 'Calling to follow up on our email exchange'
});

Research

// Deep research ($0.50-$2.00)
const result = await agent.research({
  query: 'What are the latest developments in agent commerce?',
  depth: 'deep' // 'quick' or 'deep'
});

// Returns report with citations
console.log(result.report);
console.log(result.sources);

Data Enrichment

// Find email (~$0.10)
const result = await agent.findEmail({
  name: 'John Doe',
  company: 'Acme Corp'
});

// Verify email deliverability (~$0.01)
const result = await agent.verifyEmail({
  email: 'john@acme.com'
});

// Enrich profile from LinkedIn (~$0.10)
const result = await agent.enrichProfile({
  linkedin_url: 'https://linkedin.com/in/johndoe'
});

// People search (~$0.10/result)
const results = await agent.peopleSearch({
  job_title: 'CTO',
  company: 'Acme Corp',
  location: 'San Francisco'
});

Commerce

// Search products (free)
const products = await agent.commerceSearch({
  query: 'wireless headphones',
  max_results: 10
});

// Buy product (product price + fee)
const result = await agent.commerceBuy({
  product_url: 'https://amazon.com/dp/B0...',
  shipping_address: {
    name: 'John Doe',
    street: '123 Main St',
    city: 'San Francisco',
    state: 'CA',
    zip: '94102',
    country: 'US'
  },
  max_price: 100.00
});

Build Websites

// Build a website (~$10+)
const result = await agent.build({
  type: 'landing_page',
  description: 'A SaaS landing page for an AI writing tool',
  domain: 'myproduct.com'
});

// Update existing site
const result = await agent.updateBuild({
  build_id: 'build_abc123',
  changes: 'Update the hero section headline to: Ship faster with AI'
});

Utilities

// Check balance (free)
const balance = await agent.getBalance();
console.log(`Balance: ${balance.usdc} USDC`);

// Universal tool call
const result = await agent.tool('email', {
  to: 'user@example.com',
  subject: 'Hello',
  body: 'Sent via universal tool method'
});

MCP Server

Use OneShot tools in Claude Desktop, Cursor, or Claude Code:

npm install -g @oneshot-agent/mcp-server

Claude Code (~/.claude/settings.json):

{
  "mcpServers": {
    "oneshot": {
      "command": "npx",
      "args": ["-y", "@oneshot-agent/mcp-server"],
      "env": {
        "ONESHOT_WALLET_PRIVATE_KEY": "0xYourPrivateKey"
      }
    }
  }
}

Pricing

Tool Cost
Email ~$0.01/email (+$10 first domain)
SMS ~$0.035/segment
Voice ~$0.25/minute
Research (quick) ~$0.50
Research (deep) ~$2.00
Find Email ~$0.10
Verify Email ~$0.01
Enrich Profile ~$0.10
People Search ~$0.10/result
Product Search Free
Commerce Buy Product price + fee
Build Website ~$10+
Inbox/Notifications Free

Funding Your Agent

Add USDC to your agent's wallet on Base network:

  1. Get wallet address from private key
  2. Send USDC (Base) to the address
  3. Or use https://oneshotagent.com to fund

Test mode uses Base Sepolia testnet (free test USDC).

Error Handling

import { OneShot, ContentBlockedError, InsufficientBalanceError } from '@oneshot-agent/sdk';

try {
  const result = await agent.email({ to, subject, body });
} catch (error) {
  if (error instanceof InsufficientBalanceError) {
    console.log('Need to fund wallet');
  } else if (error instanceof ContentBlockedError) {
    console.log('Content policy violation');
  }
}

Soul.Markets

Monetize your agent by listing on Soul.Markets:

  • Upload your soul.md
  • Define services and pricing
  • Earn 80% of every transaction
  • USDC settlements, instant payouts

Docs: https://docs.soul.mds.markets

Resources

  • Documentation
  • SDK Examples
  • Pricing
  • GitHub
  • Soul.Markets

相关推荐