Skill: neocryptoquant/sona (version 1.0.3)

--- name: sona description: Autonomous Solana wallet agent — AI reasons, Rust signs. Transfers, swaps, staking, chat, and mode switching under constitutional spend limits. license: MIT-0 metadata: openclaw: requires: env: - SONA_TOKEN bins: [] config: [] primaryEnv: SONA_TOKEN homepage: https://www.sonawallet.xyz repository: https://github.com/Ubuntu-Technologies/sona emoji: "\U0001F4B0" os: - darwin - linux - win32 --- # SONA — Agentic Wallet Skill **Category**: Blockchain / AI Wallet **Networks**: Solana (Devnet) **Install**: `clawhub install sona` **Version**: 1.0.1 --- ## What is SONA? SONA is an autonomous Solana wallet agent. It watches your on-chain wallet, reasons against your YAML policy rules, and executes trades and transfers — governed by four Constitutional Laws that no AI decision can ever override. ``` Observe → Reason → Decide → Execute ``` Every action is bounded by Constitutional Law: 50M lamports max per action (Rust-enforced), with an on-chain Memo receipt attached to every transaction. --- ## Plugin Tools (10) | Tool | Parameters | Description | |------|------------|-------------| | `get_wallet_status` | — | SOL balance, address, mode, cycle stats | | `get_sol_price` | — | Live SOL/USD from Pyth Hermes oracle | | `get_agent_status` | — | Mode, brain, cycles run, last cycle time | | `set_mode` | `mode`, `acknowledgment?` | Switch standard / assisted / god mode (auth required) | | `get_policy` | — | Current YAML policy rules + spend limits | | `transfer_sol` | `to`, `amount_sol` | Transfer SOL — all Constitutional Laws enforced (auth required) | | `get_pending_actions` | — | Approval queue in assisted mode (auth required) | | `approve_action` | `cycle_id` | Approve a queued action to execute (auth required) | | `chat` | `message` | Natural language command to the SONA AI (auth required) | | `get_activity` | `limit?` | Recent agent activity summary | --- ## Setup ### 1. Start SONA ```bash git clone <repo> cd <repo> bun install bun run sona init # set passphrase, create wallet bun run sona start # agent starts on port 3000 ``` ### 2. Get a session token ```bash curl -s -c cookies.txt -X POST http://localhost:3000/api/auth/login \ -H "Content-Type: application/json" \ -d '{"username":"your_user","password":"your_pass"}' | jq -r '.token' ``` ### 3. Set environment variables ```bash export SONA_API_URL=http://localhost:3000 export SONA_TOKEN=<token-from-step-2> ``` ### 4. Install the skill ```bash clawhub install sona ``` --- ## Constitutional Laws All actions are governed by four immutable laws. No tool call can bypass them: | Law | Name | Enforcement | |-----|------|-------------| | I | Owner Supremacy | Your YAML policy overrides all AI reasoning | | II | Bounded Expenditure | 50M lamports/action hard cap (enforced in Rust) | | III | Radical Transparency | On-chain Memo receipt on every executed transaction | | IV | Fail-Safe Halting | Simulation failure → agent halts, funds stay put | --- ## Example Agent Flow ``` Agent: "Check SONA's wallet balance" → calls get_wallet_status → returns: 4.82 SOL, god mode, 142 cycles run Agent: "Transfer 0.1 SOL to vault" → calls transfer_sol { to: "vault", amount_sol: 0.1 } → SONA reasons, simulates, executes within Law II limit → returns: tx confirmed, Memo logged on-chain Agent: "What is the current SOL price?" → calls get_sol_price → returns: $142.30 USD (Pyth Hermes) ``` --- ## Required Environment Variables | Variable | Required | Default | Description | |----------|----------|---------|-------------| | `SONA_API_URL` | No | `http://localhost:3000` | SONA dashboard base URL | | `SONA_TOKEN` | Yes | — | JWT session token (required for all state-changing operations: transfers, chat, mode switching, approvals) | Read-only tools (`get_wallet_status`, `get_sol_price`, `get_agent_status`, `get_policy`, `get_activity`) work without a token. All state-changing tools require `SONA_TOKEN`.

path: README.md
content: # @sona/openclaw

OpenClaw plugin adapter for **SONA** — The Next-Gen Wallet.

Installs SONA's autonomous wallet capabilities as an OpenClaw skill,
making it discoverable and installable from the ClaWHub marketplace.

```bash
clawhub install sona
```

---

## What this package does

This package exports a single `register(api)` function that wires 10 tools
into any OpenClaw-compatible agent framework. The tools call SONA's HTTP API
(running locally on port 3000) — no changes to the SONA core are required.

```
OpenClaw Agent
     │
     │  natural language
     ▼
 plugin.ts (this package)
     │
     │  HTTP  →  localhost:3000
     ▼
 SONA Dashboard API
     │
     ├─ /api/status         (balance, mode, cycles)
     ├─ /api/policy         (YAML rules)
     ├─ /api/mode           (switch modes)
     ├─ /api/chat           (AI agent command)
     └─ /api/actions/*      (pending + approve)
```

---

## Quick start

### 1. Start SONA

```bash
bun run sona init   # first-time setup
bun run sona start  # dashboard on :3000, agent on :3001
```

### 2. Get a session token

```bash
[REDACTED_SECRET] -s -X POST http://localhost:3000/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"you","password":"yourpass"}' | jq -r '.token')
```

### 3. Configure environment

```bash
export SONA_API_URL=http://localhost:3000
export SONA_TOKEN=$TOKEN
```

### 4. Install via ClaWHub

```bash
clawhub install sona
```

Or load directly in your agent:

```typescript
import register from "@sona/openclaw/plugin.ts"

register({
  registerTool(tool) {
    // your OpenClaw agent framework handles tool dispatch
    console.log("registered:", tool.name)
  },
})
```

---

## Tools

| Tool | Auth required | Description |
|------|:---:|-------------|
| `get_wallet_status` | No | SOL balance, mode, cycle stats |
| `get_sol_price` | No | Live SOL/USD from Pyth Hermes |
| `get_agent_status` | No | Full agent status |
| `set_mode` | Yes | Switch standard/assisted/god |
| `get_policy` | No | Current YAML policy |
| `transfer_sol` | Yes | Transfer SOL via chat command |
| `chat` | Yes | Natural language command |
| `get_activity` | No | Recent activity summary |
| `get_pending_actions` | Yes | Assisted mode queue |
| `approve_action` | Yes | Approve a queued action |

Auth required for all state-changing operations (transfers, chat commands, mode switching, approvals). `SONA_TOKEN` is passed as `Cookie: sona_session=<token>`. Read-only tools work without a token.

**Security**: The plugin only connects to localhost URLs (`localhost`, `127.0.0.1`, `::1`). If `SONA_API_URL` points to a remote host, the plugin refuses to send credentials and falls back to `http://localhost:3000`.

---

## Smoke test

```bash
SONA_API_URL=http://localhost:3000 \
SONA_TOKEN=<token> \
bun -e "
  import register from './plugin.ts'
  const tools = {}
  register({ registerTool(t) { tools[t.name] = t } })
  const r = await tools.get_wallet_status.execute('test', {})
  console.log(r.content[0].text)
"
```

Expected output:
```
SONA Wallet Status
  Agent:       SONA Agent
  Mode:        god
  Balance:     4.8200 SOL
  Cycles run:  142
  Executions:  7
  SOL price:   $142.30
```

---

## Constitutional Laws

All tool calls pass through SONA's four immutable laws:

1. **Owner Supremacy** — your YAML policy overrides AI reasoning
2. **Bounded Expenditure** — 50M lamports/action (Rust-enforced, non-bypassable)
3. **Radical Transparency** — on-chain Memo on every executed transaction
4. **Fail-Safe Halting** — simulation failure = halt

No OpenClaw tool can bypass these. They are enforced at the Rust signing layer.

---

## Publishing to ClaWHub

1. Push the repo to GitHub (public)
2. Go to [clawhub.ai](https://clawhub.ai) → Publish Skill
3. Point to `packages/openclaw/` as the skill root
4. Skill ID: `sona`, version `0.1.0`
5. Users install with: `clawhub install sona`


path: package.json
content: {
  "name": "@sona/openclaw",
  "version": "1.0.1",
  "description": "OpenClaw plugin adapter for SONA autonomous wallet agent",
  "type": "module",
  "main": "plugin.ts",
  "homepage": "https://www.sonawallet.xyz",
  "repository": {
    "type": "git",
    "url": "https://github.com/Ubuntu-Technologies/sona",
    "directory": "packages/openclaw"
  },
  "license": "MIT-0",
  "keywords": ["solana", "wallet", "autonomous", "ai-agent", "openclaw"],
  "openclaw": {
    "primaryEnv": "SONA_TOKEN",
    "requiredEnv": ["SONA_TOKEN"],
    "optionalEnv": ["SONA_API_URL"]
  },
  "scripts": {},
  "dependencies": {}
}


Security scan verdicts — ClawScan: suspicious | static analysis: suspicious | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)