@kaleidorg/mind 0.0.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities.d.ts +34 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +34 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/context/budget.d.ts +29 -0
- package/dist/context/budget.d.ts.map +1 -0
- package/dist/context/budget.js +36 -0
- package/dist/context/budget.js.map +1 -0
- package/dist/context/builder.d.ts +39 -0
- package/dist/context/builder.d.ts.map +1 -0
- package/dist/context/builder.js +77 -0
- package/dist/context/builder.js.map +1 -0
- package/dist/engine.d.ts +9 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +18 -2
- package/dist/engine.js.map +1 -1
- package/dist/fastpath/fastpath.d.ts +38 -0
- package/dist/fastpath/fastpath.d.ts.map +1 -0
- package/dist/fastpath/fastpath.js +52 -0
- package/dist/fastpath/fastpath.js.map +1 -0
- package/dist/funnel.d.ts +111 -0
- package/dist/funnel.d.ts.map +1 -0
- package/dist/funnel.js +175 -0
- package/dist/funnel.js.map +1 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -1
- package/dist/knowledge/bitcoin-copilot.d.ts +11 -0
- package/dist/knowledge/bitcoin-copilot.d.ts.map +1 -0
- package/dist/knowledge/bitcoin-copilot.js +155 -0
- package/dist/knowledge/bitcoin-copilot.js.map +1 -0
- package/dist/knowledge/merchants.d.ts +24 -0
- package/dist/knowledge/merchants.d.ts.map +1 -0
- package/dist/knowledge/merchants.js +34 -0
- package/dist/knowledge/merchants.js.map +1 -0
- package/dist/knowledge/wallet.d.ts +34 -0
- package/dist/knowledge/wallet.d.ts.map +1 -0
- package/dist/knowledge/wallet.js +63 -0
- package/dist/knowledge/wallet.js.map +1 -0
- package/dist/memory/store.d.ts +34 -0
- package/dist/memory/store.d.ts.map +1 -0
- package/dist/memory/store.js +103 -0
- package/dist/memory/store.js.map +1 -0
- package/dist/memory/tool.d.ts +9 -0
- package/dist/memory/tool.d.ts.map +1 -0
- package/dist/memory/tool.js +70 -0
- package/dist/memory/tool.js.map +1 -0
- package/dist/memory/types.d.ts +56 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/memory/types.js +14 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/rag/retriever.d.ts +30 -0
- package/dist/rag/retriever.d.ts.map +1 -0
- package/dist/rag/retriever.js +72 -0
- package/dist/rag/retriever.js.map +1 -0
- package/dist/rag/tool.d.ts +15 -0
- package/dist/rag/tool.d.ts.map +1 -0
- package/dist/rag/tool.js +42 -0
- package/dist/rag/tool.js.map +1 -0
- package/dist/rag/types.d.ts +44 -0
- package/dist/rag/types.d.ts.map +1 -0
- package/dist/rag/types.js +11 -0
- package/dist/rag/types.js.map +1 -0
- package/dist/rag/vector-store.d.ts +23 -0
- package/dist/rag/vector-store.d.ts.map +1 -0
- package/dist/rag/vector-store.js +72 -0
- package/dist/rag/vector-store.js.map +1 -0
- package/dist/recipe/asset-send.d.ts +15 -0
- package/dist/recipe/asset-send.d.ts.map +1 -0
- package/dist/recipe/asset-send.js +83 -0
- package/dist/recipe/asset-send.js.map +1 -0
- package/dist/recipe/payments.d.ts +15 -0
- package/dist/recipe/payments.d.ts.map +1 -0
- package/dist/recipe/payments.js +119 -0
- package/dist/recipe/payments.js.map +1 -0
- package/dist/recipe/receive.d.ts +14 -0
- package/dist/recipe/receive.d.ts.map +1 -0
- package/dist/recipe/receive.js +109 -0
- package/dist/recipe/receive.js.map +1 -0
- package/dist/recipe/runner.d.ts +42 -0
- package/dist/recipe/runner.d.ts.map +1 -0
- package/dist/recipe/runner.js +94 -0
- package/dist/recipe/runner.js.map +1 -0
- package/dist/recipe/swap.d.ts +16 -0
- package/dist/recipe/swap.d.ts.map +1 -0
- package/dist/recipe/swap.js +73 -0
- package/dist/recipe/swap.js.map +1 -0
- package/dist/recipe/types.d.ts +71 -0
- package/dist/recipe/types.d.ts.map +1 -0
- package/dist/recipe/types.js +13 -0
- package/dist/recipe/types.js.map +1 -0
- package/dist/skills/bundle.d.ts +30 -0
- package/dist/skills/bundle.d.ts.map +1 -0
- package/dist/skills/bundle.js +24 -0
- package/dist/skills/bundle.js.map +1 -0
- package/dist/skills/loader.d.ts +33 -0
- package/dist/skills/loader.d.ts.map +1 -0
- package/dist/skills/loader.js +59 -0
- package/dist/skills/loader.js.map +1 -0
- package/dist/skills/reference-source.d.ts +18 -0
- package/dist/skills/reference-source.d.ts.map +1 -0
- package/dist/skills/reference-source.js +53 -0
- package/dist/skills/reference-source.js.map +1 -0
- package/dist/skills/registry.d.ts +41 -0
- package/dist/skills/registry.d.ts.map +1 -0
- package/dist/skills/registry.js +167 -0
- package/dist/skills/registry.js.map +1 -0
- package/dist/skills/types.d.ts +53 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +18 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/tools/cli.d.ts +43 -0
- package/dist/tools/cli.d.ts.map +1 -0
- package/dist/tools/cli.js +61 -0
- package/dist/tools/cli.js.map +1 -0
- package/dist/tools/l402.d.ts +47 -0
- package/dist/tools/l402.d.ts.map +1 -0
- package/dist/tools/l402.js +84 -0
- package/dist/tools/l402.js.map +1 -0
- package/dist/tools/mcp.d.ts +3 -2
- package/dist/tools/mcp.d.ts.map +1 -1
- package/dist/tools/mcp.js +3 -2
- package/dist/tools/mcp.js.map +1 -1
- package/dist/wallet/contract.d.ts +57 -0
- package/dist/wallet/contract.d.ts.map +1 -0
- package/dist/wallet/contract.js +113 -0
- package/dist/wallet/contract.js.map +1 -0
- package/package.json +16 -5
- package/scripts/bundle-skills.mjs +84 -0
- package/skills/README.md +74 -0
- package/skills/bitrefill/SKILL.md +66 -0
- package/skills/bitrefill/references/api.md +99 -0
- package/skills/bitrefill/references/browse.md +71 -0
- package/skills/bitrefill/references/capability-matrix.md +115 -0
- package/skills/bitrefill/references/cli-headless-auth.md +133 -0
- package/skills/bitrefill/references/cli.md +237 -0
- package/skills/bitrefill/references/host-openclaw.md +167 -0
- package/skills/bitrefill/references/mcp.md +150 -0
- package/skills/bitrefill/references/safeguards.md +138 -0
- package/skills/bitrefill/references/troubleshooting.md +182 -0
- package/skills/kaleido-trading/SKILL.md +31 -0
- package/skills/kaleido-wallet/SKILL.md +28 -0
- package/src/capabilities.ts +67 -0
- package/src/context/budget.ts +46 -0
- package/src/context/builder.ts +100 -0
- package/src/context/context.test.ts +83 -0
- package/src/engine.test.ts +204 -0
- package/src/engine.ts +27 -2
- package/src/fastpath/fastpath.test.ts +34 -0
- package/src/fastpath/fastpath.ts +70 -0
- package/src/funnel.test.ts +207 -0
- package/src/funnel.ts +260 -0
- package/src/index.ts +102 -0
- package/src/knowledge/bitcoin-copilot.ts +177 -0
- package/src/knowledge/knowledge.test.ts +63 -0
- package/src/knowledge/merchants.ts +49 -0
- package/src/knowledge/wallet.ts +84 -0
- package/src/memory/memory.test.ts +85 -0
- package/src/memory/store.ts +129 -0
- package/src/memory/tool.ts +76 -0
- package/src/memory/types.ts +63 -0
- package/src/rag/rag.test.ts +85 -0
- package/src/rag/retriever.ts +94 -0
- package/src/rag/tool.ts +55 -0
- package/src/rag/types.ts +49 -0
- package/src/rag/vector-store.ts +78 -0
- package/src/recipe/asset-send.ts +79 -0
- package/src/recipe/payments.ts +116 -0
- package/src/recipe/receive.ts +98 -0
- package/src/recipe/recipe.test.ts +193 -0
- package/src/recipe/runner.ts +122 -0
- package/src/recipe/swap.ts +74 -0
- package/src/recipe/types.ts +76 -0
- package/src/skills/bundle.ts +42 -0
- package/src/skills/loader.ts +63 -0
- package/src/skills/reference-source.ts +60 -0
- package/src/skills/registry.ts +183 -0
- package/src/skills/skills.test.ts +191 -0
- package/src/skills/types.ts +55 -0
- package/src/tools/cli.test.ts +53 -0
- package/src/tools/cli.ts +98 -0
- package/src/tools/l402.test.ts +113 -0
- package/src/tools/l402.ts +122 -0
- package/src/tools/mcp.ts +3 -2
- package/src/wallet/contract.test.ts +89 -0
- package/src/wallet/contract.ts +157 -0
- package/dist/providers/qvac.d.ts +0 -89
- package/dist/providers/qvac.d.ts.map +0 -1
- package/dist/providers/qvac.js +0 -150
- package/dist/providers/qvac.js.map +0 -1
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Capability Matrix
|
|
2
|
+
|
|
3
|
+
Per-host cheat sheet. Each entry = viable paths in priority order + one-line reason. Pick the first that fits, fall back as needed.
|
|
4
|
+
|
|
5
|
+
Legend:
|
|
6
|
+
|
|
7
|
+
- **MCP** → [mcp.md](mcp.md)
|
|
8
|
+
- **CLI** → [cli.md](cli.md) (≥ 0.3.0: `login`/`verify`, not API key)
|
|
9
|
+
- **API** → [api.md](api.md)
|
|
10
|
+
- **Browse** → [browse.md](browse.md) (residential IP required)
|
|
11
|
+
- **OpenClaw** → [host-openclaw.md](host-openclaw.md)
|
|
12
|
+
|
|
13
|
+
## Anthropic
|
|
14
|
+
|
|
15
|
+
### Claude.ai web — Free
|
|
16
|
+
|
|
17
|
+
- No MCP custom URLs (Pro+ only). No shell. No residential browser.
|
|
18
|
+
- **Path**: none viable for purchases. For browse: only if user installs Claude-for-Chrome extension → Browse.
|
|
19
|
+
- **Fallback**: send user `bitrefill.com` link.
|
|
20
|
+
|
|
21
|
+
### Claude.ai web — Pro / Max / Team / Enterprise / Cowork
|
|
22
|
+
|
|
23
|
+
- MCP custom URLs allowed. Cowork adds desktop shell.
|
|
24
|
+
- **Paths**: MCP first → Browse via Claude-for-Chrome ext.
|
|
25
|
+
- Cowork only: + CLI via desktop shell.
|
|
26
|
+
|
|
27
|
+
### Claude Desktop
|
|
28
|
+
|
|
29
|
+
- MCP first-class (stdio + remote). No native shell, no native FS, no native HTTP — wire via MCP servers.
|
|
30
|
+
- **Paths**: MCP first → CLI via stdio MCP wrapping `npx @bitrefill/cli` → Browse via Chrome ext or Computer Use.
|
|
31
|
+
|
|
32
|
+
### Claude Code (CLI)
|
|
33
|
+
|
|
34
|
+
- Most flexible. Full host shell, MCP, WebFetch, Chrome ext.
|
|
35
|
+
- **Paths**: MCP first → CLI second → API via WebFetch / curl → Browse via Chrome ext or browser-use skill.
|
|
36
|
+
- Tighten: sandbox allowlist `api.bitrefill.com`, `registry.npmjs.org`. Deny `~/.ssh`, `.env`.
|
|
37
|
+
|
|
38
|
+
## OpenAI
|
|
39
|
+
|
|
40
|
+
### ChatGPT web — Free
|
|
41
|
+
|
|
42
|
+
- No custom MCP, no shell, datacenter browser → Cloudflare 403.
|
|
43
|
+
- **Path**: none. Send user `bitrefill.com` link.
|
|
44
|
+
|
|
45
|
+
### ChatGPT web — Plus / Pro / Business / Enterprise / Edu
|
|
46
|
+
|
|
47
|
+
- Custom MCP via Apps & Connectors (Developer Mode for write tools). Code Interpreter has no network.
|
|
48
|
+
- **Path**: MCP only. Browser is OpenAI datacenter — **do NOT route to Browse** (Cloudflare).
|
|
49
|
+
|
|
50
|
+
### ChatGPT Desktop
|
|
51
|
+
|
|
52
|
+
- Same as ChatGPT web. "Work with Apps" can read IDE/terminal panes but not execute.
|
|
53
|
+
- **Path**: MCP only.
|
|
54
|
+
|
|
55
|
+
### ChatGPT Atlas
|
|
56
|
+
|
|
57
|
+
- Built-in Chromium with **residential IP** (user's network). Inherits account connectors. No shell.
|
|
58
|
+
- **Paths**: Browse first (its superpower) → MCP via account connectors.
|
|
59
|
+
|
|
60
|
+
### ChatGPT Agent (formerly Operator)
|
|
61
|
+
|
|
62
|
+
- Sandboxed Linux + code interpreter. Hosted browser uses **OpenAI datacenter IP**.
|
|
63
|
+
- **Paths**: MCP via account connectors → CLI inside sandbox shell → API via curl. **Do NOT route to Browse** (Cloudflare).
|
|
64
|
+
|
|
65
|
+
### OpenAI Codex CLI
|
|
66
|
+
|
|
67
|
+
- Full host shell (Seatbelt/Landlock sandboxable). MCP stdio + HTTP. Profiles in `config.toml`.
|
|
68
|
+
- **Paths**: MCP first → CLI second → API via curl. Browser via MCP only.
|
|
69
|
+
- Tighten: `--sandbox workspace-write --ask-for-approval on-request`. API key in profile, not committed config.
|
|
70
|
+
|
|
71
|
+
## Google
|
|
72
|
+
|
|
73
|
+
### Gemini consumer — Free
|
|
74
|
+
|
|
75
|
+
- No MCP. No shell. No residential browser.
|
|
76
|
+
- **Path**: none. Send user `bitrefill.com` link.
|
|
77
|
+
|
|
78
|
+
### Gemini consumer — AI Pro / Ultra (US)
|
|
79
|
+
|
|
80
|
+
- "Auto Browse" runs from Google IPs → likely Cloudflare-blocked on bitrefill.com.
|
|
81
|
+
- **Path**: try Auto Browse + bitrefill.com URL; if blocked, send user the link.
|
|
82
|
+
|
|
83
|
+
### Gemini CLI
|
|
84
|
+
|
|
85
|
+
- Full host shell (sandboxable: Seatbelt / Docker / gVisor). MCP stdio + SSE + streamable-http.
|
|
86
|
+
- **Paths**: MCP first → CLI second → API via `web_fetch` or curl. Browser via MCP (Chrome DevTools / Playwright).
|
|
87
|
+
|
|
88
|
+
### Jules (async coding agent)
|
|
89
|
+
|
|
90
|
+
- Ephemeral Ubuntu VM, Google IPs, no MCP exposed to user, no residential browser.
|
|
91
|
+
- **Paths**: CLI inside VM → API via curl. **Not interactive** — best for batch tasks. No purchases recommended.
|
|
92
|
+
|
|
93
|
+
## Other
|
|
94
|
+
|
|
95
|
+
### Cursor IDE
|
|
96
|
+
|
|
97
|
+
- Built-in browser tool, terminal tool, MCP (40-tool cap across servers). Cloud Agents in isolated VM.
|
|
98
|
+
- **Paths**: MCP first → CLI in terminal → API via shell or built-in browser → Browse via built-in browser.
|
|
99
|
+
- Tighten: keep `buy-products` out of `autoApprove` in `.cursor/mcp.json`.
|
|
100
|
+
|
|
101
|
+
### OpenCode (sst/opencode)
|
|
102
|
+
|
|
103
|
+
- Full host shell. MCP stdio + HTTP. Permission model per agent (`allow`/`ask`/`deny`).
|
|
104
|
+
- **Paths**: MCP first → CLI second → API via `webfetch` or shell. Browser via MCP.
|
|
105
|
+
|
|
106
|
+
### OpenClaw — superset host
|
|
107
|
+
|
|
108
|
+
- Agentskills.io loader. MCP via `openclaw mcp set`. Full host shell + FS. `browser` tool uses host IP. Mobile nodes (camera, canvas, voice). Cron. Multi-channel chat (Telegram, WhatsApp, Slack, Discord, iMessage, Signal, Matrix, Teams, etc.).
|
|
109
|
+
- **Paths**: read [host-openclaw.md](host-openclaw.md) **first**. **Guest CLI via `exec`** (preferred) → signed-in CLI (`balance`, cashback) → MCP → API → Browse.
|
|
110
|
+
- Default agent: **Pi** (Anthropic / OpenAI / Google compatible via API key).
|
|
111
|
+
- Unique scenarios: chat-channel purchase from phone, cron auto-renew top-ups, mobile camera OCR of receipts, multi-channel handoff.
|
|
112
|
+
|
|
113
|
+
## Quick decision
|
|
114
|
+
|
|
115
|
+
If user says "what host am I in?": run `command -v openclaw` and check `~/.openclaw/`. OpenClaw → guest CLI first. Else: MCP first (most hosts), fall back to CLI, then API.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# Headless CLI auth (agents)
|
|
2
|
+
|
|
3
|
+
Use when: agent must **sign up / sign in** without human at keyboard — unlock `balance`, cashback, order history.
|
|
4
|
+
|
|
5
|
+
**Guest checkout needs no inbox** — pass `--email` on `buy-products` and pay crypto. Fastest first try; see [cli.md](cli.md) § Guest checkout.
|
|
6
|
+
|
|
7
|
+
Use this doc when graduating guest → signed-in account with AgentMail or equivalent inbox.
|
|
8
|
+
|
|
9
|
+
Requires `@bitrefill/cli` ≥ 0.3.0. Agent-owned inbox via **AgentMail or equivalent** — any provider with programmatic receive (list messages, parse body).
|
|
10
|
+
|
|
11
|
+
## Why AgentMail or equivalent
|
|
12
|
+
|
|
13
|
+
Bitrefill `login` sends magic-link code to email. Agent needs inbox API or MCP to poll/read messages without human. [AgentMail](https://www.agentmail.to/) is the reference implementation below; equivalent = Gmail API, IMAP, Mailgun inbound, etc. if your runtime already has access.
|
|
14
|
+
|
|
15
|
+
## One-time inbox setup (AgentMail example)
|
|
16
|
+
|
|
17
|
+
Human verifies provider account once. Agent handles Bitrefill after. Substitute your equivalent provider's sign-up + list/receive commands.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install -g agentmail-cli
|
|
21
|
+
|
|
22
|
+
agentmail agent sign-up \
|
|
23
|
+
--human-email you@example.com \
|
|
24
|
+
--username bitrefill-agent
|
|
25
|
+
# → api_key, inbox_id (e.g. bitrefill-agent@agentmail.to)
|
|
26
|
+
|
|
27
|
+
export AGENTMAIL_API_KEY="am_..." # from sign-up response
|
|
28
|
+
|
|
29
|
+
agentmail agent verify --otp-code 123456 # human reads OTP from you@example.com
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Official refs: [quickstart](https://docs.agentmail.to/quickstart.md), [agent onboarding](https://docs.agentmail.to/agent-onboarding.md).
|
|
33
|
+
|
|
34
|
+
Optional (AgentMail): [AgentMail MCP](https://docs.agentmail.to/agent-onboarding.md) (`npx -y agentmail-mcp`) with `AGENTMAIL_API_KEY` — tools `list_threads`, `get_thread`, `get_message`. Equivalent providers: use their MCP/API instead.
|
|
35
|
+
|
|
36
|
+
## Bitrefill auth flow
|
|
37
|
+
|
|
38
|
+
Use agent inbox address as Bitrefill email (`inbox_id` from AgentMail or equivalent). Signup = login (same command).
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g @bitrefill/cli
|
|
42
|
+
|
|
43
|
+
bitrefill init --openclaw # optional
|
|
44
|
+
|
|
45
|
+
bitrefill login --email bitrefill-agent@agentmail.to
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Poll inbox for Bitrefill verification email. AgentMail ([official list command](https://docs.agentmail.to/messages)):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
agentmail inboxes:messages list --inbox-id bitrefill-agent@agentmail.to
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Parse `extracted_text` or `text` from latest message for numeric code. Then:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
bitrefill verify --code 123456
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
If Bitrefill account has TOTP, add `--otp` ([1Password](#totp-via-1password) below).
|
|
61
|
+
|
|
62
|
+
Confirm:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
bitrefill whoami --json
|
|
66
|
+
# → { "identity": "registered", "email": "bitrefill-agent@agentmail.to", ... }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then run catalog/purchase commands per [cli.md](cli.md).
|
|
70
|
+
|
|
71
|
+
## End-to-end script sketch
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
INBOX="bitrefill-agent@agentmail.to"
|
|
75
|
+
|
|
76
|
+
bitrefill login --email "$INBOX"
|
|
77
|
+
sleep 5 # allow delivery
|
|
78
|
+
|
|
79
|
+
CODE=$(agentmail inboxes:messages list --inbox-id "$INBOX" \
|
|
80
|
+
| jq -r '.messages[0].extracted_text // .messages[0].text' \
|
|
81
|
+
| grep -oE '[0-9]{6,8}' | head -1)
|
|
82
|
+
|
|
83
|
+
bitrefill verify --code "$CODE"
|
|
84
|
+
bitrefill whoami --json
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Adjust regex/poll loop for your environment. Codes expire (~12–20 min server-side); on expiry re-run `login`.
|
|
88
|
+
|
|
89
|
+
## TOTP via 1Password
|
|
90
|
+
|
|
91
|
+
When Bitrefill account has authenticator enrolled, pass TOTP on verify.
|
|
92
|
+
|
|
93
|
+
Secret reference ([official `op read`](https://www.1password.dev/cli/reference/commands/read)):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
bitrefill verify --code "$CODE" \
|
|
97
|
+
--otp "$(op read 'op://Vault/Bitrefill/one-time password?attribute=otp')"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Item flag ([official `op item get --otp`](https://developer.1password.com/llms-cli.txt)):
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
bitrefill verify --code "$CODE" --otp "$(op item get Bitrefill --otp)"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Requires 1Password desktop app integration or service account. See [Get started with 1Password CLI](https://www.1password.dev/cli/get-started).
|
|
107
|
+
|
|
108
|
+
## Safeguards
|
|
109
|
+
|
|
110
|
+
- Dedicated low-balance Bitrefill account tied to agent inbox — not human primary email.
|
|
111
|
+
- Agent inbox (AgentMail or equivalent) = auth surface; restrict who can read it.
|
|
112
|
+
- `bitrefill reset` + re-login to rotate after compromise.
|
|
113
|
+
- Never log magic-link codes or redemption codes to shared transcripts.
|
|
114
|
+
|
|
115
|
+
Spending policy → [safeguards.md](safeguards.md).
|
|
116
|
+
|
|
117
|
+
## Troubleshooting
|
|
118
|
+
|
|
119
|
+
| Symptom | Fix |
|
|
120
|
+
|---------|-----|
|
|
121
|
+
| `Access token is required for login/verify` | Run any CLI command first (MCP connect mints token), or `bitrefill reset` then retry |
|
|
122
|
+
| `No pending login` | Re-run `login --email` before `verify` |
|
|
123
|
+
| Code invalid / expired | Re-run `login --email`; poll inbox again |
|
|
124
|
+
| `browser_url` in login response | Passkey/WebAuthn — human opens URL, then retry |
|
|
125
|
+
| Inbox empty after login | Wait + re-list; check spam; confirm inbox address matches provider setup |
|
|
126
|
+
|
|
127
|
+
More CLI errors → [troubleshooting.md](troubleshooting.md).
|
|
128
|
+
|
|
129
|
+
## Source of truth
|
|
130
|
+
|
|
131
|
+
- AgentMail (reference): <https://docs.agentmail.to/quickstart.md>, <https://docs.agentmail.to/messages>
|
|
132
|
+
- Bitrefill CLI: <https://github.com/bitrefill/cli> (≥ 0.3.0)
|
|
133
|
+
- 1Password CLI: <https://www.1password.dev/cli/reference/commands/read>
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
# Path: CLI
|
|
2
|
+
|
|
3
|
+
Use when: shell + `npm install` available, **host has no MCP client** (CLI talks to Bitrefill MCP under the hood). Runtimes: Claude Code, Codex CLI, Cursor terminal, Gemini CLI, OpenCode, OpenClaw, Jules (ephemeral VM), ChatGPT Agent (sandbox).
|
|
4
|
+
|
|
5
|
+
Requires **`@bitrefill/cli` ≥ 0.3.0**. Sandboxed shells must allowlist `registry.npmjs.org` and `api.bitrefill.com`.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @bitrefill/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
From source: `git clone https://github.com/bitrefill/cli.git && cd cli && pnpm install && pnpm build && npm link`.
|
|
14
|
+
|
|
15
|
+
## Guest checkout (fastest first try)
|
|
16
|
+
|
|
17
|
+
**No `login` / `verify`.** Works while `whoami` shows `identity: unregistered`. Fastest path for autonomous agents to try Bitrefill — search, quote, create invoice, pay crypto or open payment link.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
bitrefill search-products --query "Amazon" --country IT
|
|
21
|
+
bitrefill get-product-details --product_id "amazon_it-italy"
|
|
22
|
+
|
|
23
|
+
bitrefill buy-products \
|
|
24
|
+
--cart_items '[{"product_id":"amazon_it-italy","package_id":"10"}]' \
|
|
25
|
+
--payment_method lightning \
|
|
26
|
+
--return_payment_link true \
|
|
27
|
+
--email "agent@example.com"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Response: `invoice_id`, `payment_link`, optional `x402_payment_url` / Lightning invoice. Poll `get-invoice-by-id --invoice_id <uuid>`. Receipt goes to `--email`. Invoice expires in ~30 minutes.
|
|
31
|
+
|
|
32
|
+
Guest payment methods: crypto (`lightning`, `usdc_base`, `bitcoin`, …) or `--return_payment_link true` (human/browser checkout, x402). **`balance` and `cashback` require a signed-in account** (below).
|
|
33
|
+
|
|
34
|
+
## Sign up / sign in (balance, cashback, order history)
|
|
35
|
+
|
|
36
|
+
After guest try, sign in when human wants **managed agent spending** or **rewards**:
|
|
37
|
+
|
|
38
|
+
| Signed-in benefit | Why |
|
|
39
|
+
|-------------------|-----|
|
|
40
|
+
| **`--payment_method balance`** | Instant pay from store credit human pre-funds — natural spending cap, no on-chain wait |
|
|
41
|
+
| **`--payment_method cashback`** | Pay from accumulated rewards balance (BTC) |
|
|
42
|
+
| **Cashback on purchases** | Eligible products earn rewards back to account |
|
|
43
|
+
| **`list-orders` / `list-invoices`** | Full order history + redemption codes in one place |
|
|
44
|
+
|
|
45
|
+
Same `login` for new + existing accounts. Headless inbox → [cli-headless-auth.md](cli-headless-auth.md).
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
bitrefill login --email you@example.com
|
|
49
|
+
bitrefill verify --code GGWK87DR # email magic-link code
|
|
50
|
+
bitrefill verify --code GGWK87DR --otp 122407 # + TOTP when account has 2FA
|
|
51
|
+
bitrefill whoami --json
|
|
52
|
+
|
|
53
|
+
# signed-in buy — instant from balance
|
|
54
|
+
bitrefill buy-products \
|
|
55
|
+
--cart_items '[{"product_id":"amazon_it-italy","package_id":"10"}]' \
|
|
56
|
+
--payment_method balance \
|
|
57
|
+
--email "you@example.com"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Verify gotchas** (from real agent sessions):
|
|
61
|
+
|
|
62
|
+
- Email code → `verify --code <value>`, **not** `login --code` (unknown option).
|
|
63
|
+
- `--otp` = **authenticator TOTP only** when account has 2FA — not the email code. Need both `--code` and `--otp` when enrolled.
|
|
64
|
+
- After sign-in, `login` disappears from `--help`; run `logout` first to switch accounts or sign up another email.
|
|
65
|
+
|
|
66
|
+
## Bootstrap (optional)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
bitrefill init # optional OpenClaw wiring only
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`init` no longer stores API keys. OpenClaw only: merges MCP config + generates `~/.openclaw/skills/bitrefill/SKILL.md`.
|
|
73
|
+
|
|
74
|
+
## Auth
|
|
75
|
+
|
|
76
|
+
CLI 0.3.0: **guest checkout needs no sign-in.** Account auth = OAuth client_credentials (automatic on first MCP connect) + email magic-link. No `--api-key`, no `credentials.json`.
|
|
77
|
+
|
|
78
|
+
| Step | Command | Notes |
|
|
79
|
+
|------|---------|-------|
|
|
80
|
+
| Register client | any command (or `login`) | MCP connect mints `access_token`; stored in `~/.config/bitrefill-cli/<host>.v1.json` |
|
|
81
|
+
| Sign up or sign in | `login --email <addr>` | same command for new + existing accounts |
|
|
82
|
+
| Complete auth | `verify --code <code> [--otp <totp>]` | code from email; `--otp` when account has TOTP |
|
|
83
|
+
| Check session | `whoami [--json]` | `identity: registered` + `email` when signed in |
|
|
84
|
+
| Sign out | `logout` | revokes session; keeps `client_id` |
|
|
85
|
+
| Full reset | `reset` | clears all local state + revokes session |
|
|
86
|
+
|
|
87
|
+
**TOTP via 1Password** ([official `op read`](https://www.1password.dev/cli/reference/commands/read)):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
bitrefill verify --code "$CODE" --otp "$(op read 'op://Vault/Bitrefill/one-time password?attribute=otp')"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Shorthand ([official `op item get --otp`](https://developer.1password.com/llms-cli.txt)):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
bitrefill verify --code "$CODE" --otp "$(op item get Bitrefill --otp)"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Server may return `browser_url` for passkey/WebAuthn — open in browser, then retry.
|
|
100
|
+
|
|
101
|
+
**Developer API keys** (Personal REST / key-in-path MCP) are separate from CLI auth. See [mcp.md](mcp.md) and [api.md](api.md).
|
|
102
|
+
|
|
103
|
+
## Global flags
|
|
104
|
+
|
|
105
|
+
Place **before** the subcommand:
|
|
106
|
+
|
|
107
|
+
- **`--json`** — stdout is a single JSON value per run (TOON decoded to JSON); status/errors on **stderr**. Use with `jq`.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
bitrefill --json search-products --query "Amazon" --per_page 1 | jq '.products[0].name'
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Agent discovery
|
|
114
|
+
|
|
115
|
+
`manifest` emits JSON schema for every built-in + MCP command:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
bitrefill manifest --json | jq '.commands[].name'
|
|
119
|
+
bitrefill manifest -o bitrefill-manifest.json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
`llm-context` embeds the same manifest in a fenced JSON block.
|
|
123
|
+
|
|
124
|
+
## `llm-context`
|
|
125
|
+
|
|
126
|
+
Regenerates Markdown from live MCP `tools/list` (params, JSON Schema, example invocations). Use for **CLAUDE.md**, Cursor rules, or **`.github/copilot-instructions.md`**. Connection line shows redacted MCP URL — safe to commit.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bitrefill llm-context -o BITREFILL-MCP.md
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## OpenClaw quick-bootstrap
|
|
133
|
+
|
|
134
|
+
Optional `bitrefill init --openclaw`: merges MCP stub into `~/.openclaw/openclaw.json` + emits skill SKILL.md. **Not required for guest CLI** — install CLI and run guest checkout directly via `exec`. OpenClaw prefers guest CLI first; see [host-openclaw.md](host-openclaw.md). Hardening → exec-approvals for `bitrefill buy-products`.
|
|
135
|
+
|
|
136
|
+
## Workflow
|
|
137
|
+
|
|
138
|
+
Subcommands discovered from remote MCP (`bitrefill --help` after connect). Core flow:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
search-products → get-product-details → buy-products → get-invoice-by-id
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### 1. Search
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
bitrefill search-products --query "Netflix" --country US
|
|
148
|
+
bitrefill --json search-products --query "Netflix" --country US --per_page 5 | jq '.products'
|
|
149
|
+
bitrefill search-products --query "eSIM" --product_type esim --country IT
|
|
150
|
+
bitrefill search-products --query "*" --category games --country US
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`--country` = uppercase Alpha-2. `--product_type` = `giftcard` or `esim` (singular). Discover categories: `--query "*"` returns a `categories` array with slugs.
|
|
154
|
+
|
|
155
|
+
### 2. Details
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
bitrefill get-product-details --product_id "steam-usa" --currency USDC
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Returns `packages` array. Each entry has `package_value` — that's the `package_id` for `buy-products`. Ignore the `<&>` compound key.
|
|
162
|
+
|
|
163
|
+
Three denomination types:
|
|
164
|
+
|
|
165
|
+
- **Numeric**: `5`, `50`, `200` (pass as number).
|
|
166
|
+
- **Duration**: `"1 Month"`, `"12 Months"` (exact, case-sensitive).
|
|
167
|
+
- **Named**: `"1GB, 7 Days"`, `"PUBG New State 300 NC"` (exact, case-sensitive).
|
|
168
|
+
|
|
169
|
+
Only values from `get-product-details` accepted. Arbitrary amounts rejected.
|
|
170
|
+
|
|
171
|
+
### 3. Buy
|
|
172
|
+
|
|
173
|
+
`--cart_items` = JSON **array**, even single item. Max 15 items. **`--email`** = receipt address (required for guest; optional when signed in).
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Guest — crypto + payment link (no login)
|
|
177
|
+
bitrefill buy-products \
|
|
178
|
+
--cart_items '[{"product_id":"amazon_it-italy","package_id":"10"}]' \
|
|
179
|
+
--payment_method lightning \
|
|
180
|
+
--return_payment_link true \
|
|
181
|
+
--email "agent@example.com"
|
|
182
|
+
|
|
183
|
+
# Signed-in — instant from store credit
|
|
184
|
+
bitrefill buy-products \
|
|
185
|
+
--cart_items '[{"product_id": "steam-usa", "package_id": 5}]' \
|
|
186
|
+
--payment_method balance \
|
|
187
|
+
--email "you@example.com"
|
|
188
|
+
|
|
189
|
+
# Signed-in — crypto via x402
|
|
190
|
+
bitrefill buy-products \
|
|
191
|
+
--cart_items '[{"product_id": "steam-usa", "package_id": 5}]' \
|
|
192
|
+
--payment_method usdc_base
|
|
193
|
+
|
|
194
|
+
# Duration package
|
|
195
|
+
bitrefill buy-products \
|
|
196
|
+
--cart_items '[{"product_id": "spotify-usa", "package_id": "1 Month"}]' \
|
|
197
|
+
--payment_method balance
|
|
198
|
+
|
|
199
|
+
# Named eSIM
|
|
200
|
+
bitrefill buy-products \
|
|
201
|
+
--cart_items '[{"product_id": "bitrefill-esim-europe", "package_id": "1GB, 7 Days"}]' \
|
|
202
|
+
--payment_method usdc_base
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Response: `invoice_id`, `payment_link`, `x402_payment_url`, `payment_info` (`address`, `paymentUri`, `altcoinPrice`).
|
|
206
|
+
|
|
207
|
+
### 4. Track / Redeem
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
bitrefill get-invoice-by-id --invoice_id "UUID" # works guest (save invoice_id from buy response)
|
|
211
|
+
bitrefill list-orders --include_redemption_info true # signed-in only
|
|
212
|
+
bitrefill get-order-by-id --order_id "ID" # signed-in only
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Invoices expire after 180 minutes. Expired = create new one.
|
|
216
|
+
|
|
217
|
+
## Critical gotchas
|
|
218
|
+
|
|
219
|
+
- `--cart_items` must be **array** `[...]`, not object `{...}`. Shell quoting matters: single quotes outside, double inside.
|
|
220
|
+
- Use `package_value` after `<&>`, not the compound key. WRONG `"steam-usa<&>5"`. RIGHT `5`.
|
|
221
|
+
- Named/duration `package_id` exact and case-sensitive. WRONG `"1GB"`. RIGHT `"1GB, 7 Days"`.
|
|
222
|
+
- Country code uppercase Alpha-2. WRONG `us`, `USA`, `"United States"`. RIGHT `US`.
|
|
223
|
+
- `login` / `verify` only when not signed in. After verify, `logout` before switching accounts.
|
|
224
|
+
- Guest: `--payment_method balance` / `cashback` fail — use crypto or sign in first.
|
|
225
|
+
- Signed-in + 2FA: `verify` needs **both** `--code` (email) and `--otp` (authenticator).
|
|
226
|
+
|
|
227
|
+
## Recommended payment methods (for agents)
|
|
228
|
+
|
|
229
|
+
**Guest (try first):** `lightning` or `usdc_base` + `x402_payment_url` → `--return_payment_link true` for human/browser pay.
|
|
230
|
+
|
|
231
|
+
**Signed-in (production):** `balance` (instant, human caps spend via store credit) → `cashback` (rewards balance) → `usdc_base` x402 → `lightning`. Full list: `bitrefill buy-products --help`.
|
|
232
|
+
|
|
233
|
+
## Source of truth
|
|
234
|
+
|
|
235
|
+
- <https://github.com/bitrefill/cli> — full command reference, options, flags
|
|
236
|
+
- <https://docs.bitrefill.com/docs/crypto-payments> — payment methods
|
|
237
|
+
- `bitrefill manifest --json` / `bitrefill llm-context` — live tool list + schemas
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Host: OpenClaw
|
|
2
|
+
|
|
3
|
+
[OpenClaw](https://docs.openclaw.ai/) is a self-hosted Gateway that bridges chat apps (Telegram, WhatsApp, Slack, Discord, iMessage, Signal, Matrix, Teams, etc.) to coding agents like **Pi**. It is a **superset host**: full host shell, agentskills.io-compatible skill loader, first-class MCP, mobile-node camera/canvas, cron, and multi-channel routing.
|
|
4
|
+
|
|
5
|
+
This file explains how to install + harden the Bitrefill skill inside OpenClaw and lists scenarios no other host can do. After setup, use the regular path files for the actual workflow.
|
|
6
|
+
|
|
7
|
+
**OpenClaw path priority:** **guest CLI via `exec`** (no auth, fastest try) → signed-in CLI (`login`/`verify`, `balance`, cashback) → MCP → API → Browse. OpenClaw has shell + MCP — prefer guest CLI for purchases unless you need typed MCP tool calls or are already signed in for `balance`.
|
|
8
|
+
|
|
9
|
+
## 1. Detect OpenClaw
|
|
10
|
+
|
|
11
|
+
Check **any** of:
|
|
12
|
+
|
|
13
|
+
- File: `~/.openclaw/openclaw.json` exists.
|
|
14
|
+
- Dir: `~/.openclaw/skills/` exists.
|
|
15
|
+
- Binary: `command -v openclaw` succeeds.
|
|
16
|
+
- Tools in agent loop: `gateway`, `cron`, `nodes`, `canvas`, `sessions_*` (OpenClaw-only).
|
|
17
|
+
|
|
18
|
+
If yes → continue here. Otherwise → return to [SKILL.md](../SKILL.md) and pick a path.
|
|
19
|
+
|
|
20
|
+
## 2. Install this skill
|
|
21
|
+
|
|
22
|
+
Loader paths (increasing precedence): `skills.load.extraDirs` → bundled → `~/.openclaw/skills/` → `~/.agents/skills/` → `<workspace>/.agents/skills/` → `<workspace>/skills/`.
|
|
23
|
+
|
|
24
|
+
Manual:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cp -r path/to/bitrefill ~/.openclaw/skills/bitrefill
|
|
28
|
+
openclaw skills list # verify
|
|
29
|
+
openclaw gateway restart # or /new in chat
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
ClawHub (if/when published):
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
openclaw skills install bitrefill
|
|
36
|
+
openclaw skills update --all
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Skill is **agentskills.io-compatible** — no rewriting needed. Source: <https://docs.openclaw.ai/tools/skills.md>.
|
|
40
|
+
|
|
41
|
+
## 3. Install Bitrefill CLI (preferred — guest checkout)
|
|
42
|
+
|
|
43
|
+
Pi has first-class `exec` tool on Gateway host (sandboxing **off** by default). **Start here:** no login, no MCP config — search, buy, pay crypto or send payment link.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
exec: npm install -g @bitrefill/cli
|
|
47
|
+
exec: bitrefill search-products --query "Netflix" --country US
|
|
48
|
+
exec: bitrefill buy-products \
|
|
49
|
+
--cart_items '[{"product_id":"steam-usa","package_id":10}]' \
|
|
50
|
+
--payment_method lightning \
|
|
51
|
+
--return_payment_link true \
|
|
52
|
+
--email "user@example.com"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Guest flow → [cli.md](cli.md) § Guest checkout. Optional: `bitrefill init --openclaw` (skill + MCP stub only — not required for guest).
|
|
56
|
+
|
|
57
|
+
**Upgrade to signed-in** when human wants store-credit cap (`balance`), cashback, or order history:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
exec: bitrefill login --email you@example.com
|
|
61
|
+
exec: bitrefill verify --code <email-code> [--otp <totp>]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Headless sign-in inbox → [cli-headless-auth.md](cli-headless-auth.md) (AgentMail or equivalent).
|
|
65
|
+
|
|
66
|
+
Docker sandbox: `setupCommand: "npm install -g @bitrefill/cli"`, `network` not `none`. Source: <https://docs.openclaw.ai/gateway/sandboxing.md>.
|
|
67
|
+
|
|
68
|
+
## 4. Install Bitrefill MCP (optional)
|
|
69
|
+
|
|
70
|
+
Use when: typed MCP tool calls in Pi loop without shell, or MCP-native integrations. **Not required for guest try** — guest CLI is faster (zero config).
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
openclaw mcp set bitrefill --url "https://api.bitrefill.com/mcp"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Or hand-edit `~/.openclaw/openclaw.json`:
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"mcp": {
|
|
81
|
+
"servers": {
|
|
82
|
+
"bitrefill": {
|
|
83
|
+
"url": "https://api.bitrefill.com/mcp"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Developer API key (optional): see [mcp.md](mcp.md). Guest MCP checkout may still need OAuth; **guest CLI avoids this.**
|
|
91
|
+
|
|
92
|
+
Transport: SSE/HTTP or `transport: "streamable-http"`. Restrict per-agent via `agents.list[].tools.allow`/`deny`. Source: <https://docs.openclaw.ai/cli/mcp.md>.
|
|
93
|
+
|
|
94
|
+
Then: see [mcp.md](mcp.md).
|
|
95
|
+
|
|
96
|
+
## 5. Raw API path
|
|
97
|
+
|
|
98
|
+
`exec` + `curl`, or built-in `web_fetch` tool. No special config. See [api.md](api.md).
|
|
99
|
+
|
|
100
|
+
## 6. Browser
|
|
101
|
+
|
|
102
|
+
Pi has `browser` tool. **It uses the Gateway host's IP** — usually residential when Gateway runs on user's machine, but a VPS will hit Cloudflare 403. For richer DOM control attach a Playwright/Chrome MCP. The Mac menubar app drives user's actual Chrome and is fully residential. See [browse.md](browse.md).
|
|
103
|
+
|
|
104
|
+
## 7. OpenClaw-only scenarios
|
|
105
|
+
|
|
106
|
+
These are the differentiators. None of the other hosts can do them.
|
|
107
|
+
|
|
108
|
+
### Buy a gift card from Telegram (away from desk)
|
|
109
|
+
|
|
110
|
+
User DMs the bot: "buy a $50 Steam US card for me". Pi runs guest CLI via `exec` (or signed-in CLI with `balance` if human pre-funded account), prompts confirmation in chat, returns payment link or redemption code after poll.
|
|
111
|
+
|
|
112
|
+
**Risk**: redemption codes are cash-like. Never deliver to group chats or via `MEDIA:` URLs. Lock down channel:
|
|
113
|
+
|
|
114
|
+
```jsonc
|
|
115
|
+
{
|
|
116
|
+
"channels": {
|
|
117
|
+
"telegram": {
|
|
118
|
+
"botToken": "${TELEGRAM_BOT_TOKEN}",
|
|
119
|
+
"dmPolicy": "pairing",
|
|
120
|
+
"allowFrom": ["123456789"],
|
|
121
|
+
"groups": { "*": { "requireMention": true } }
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Source: <https://docs.openclaw.ai/channels/telegram>.
|
|
128
|
+
|
|
129
|
+
### Auto-renew mobile top-up monthly
|
|
130
|
+
|
|
131
|
+
Use `cron` + `exec: bitrefill buy-products ...` for fixed SKU. Guest: crypto + poll `get-invoice-by-id`. Signed-in: `--payment_method balance` for instant pay without on-chain wait.
|
|
132
|
+
|
|
133
|
+
### Multi-channel handoff
|
|
134
|
+
|
|
135
|
+
Trigger purchase from Slack, deliver redemption code only to user's private Signal DM. Same Gateway, isolated session per channel/sender.
|
|
136
|
+
|
|
137
|
+
### Mobile camera context
|
|
138
|
+
|
|
139
|
+
Paired iOS/Android node exposes `camera.snap` and `canvas.*`. User photographs a request ("100 EUR Decathlon France"), Pi OCRs/parses, runs `exec: bitrefill search-products` + `exec: bitrefill buy-products` (guest or signed-in). Source: <https://docs.openclaw.ai/nodes/index.md>.
|
|
140
|
+
|
|
141
|
+
### Heartbeat-driven invoice polling
|
|
142
|
+
|
|
143
|
+
Default 30-min heartbeat or custom `cron` runs `exec: bitrefill get-invoice-by-id` until `status: complete`, then pushes redemption code to originating channel.
|
|
144
|
+
|
|
145
|
+
## 8. OpenClaw-specific safeguards
|
|
146
|
+
|
|
147
|
+
OpenClaw defaults are permissive: sandboxing off, `security: full`, `ask: off`. **Tighten before letting an agent buy on your behalf.**
|
|
148
|
+
|
|
149
|
+
- **Restrict who triggers purchases**: `channels.<ch>.allowFrom: ["<your_id>"]` + `dmPolicy: "pairing"`. Same for WhatsApp, Signal, Slack, Discord.
|
|
150
|
+
- **Require approval for buys**: `~/.openclaw/exec-approvals.json` with `security: allowlist` + `ask: on-miss`. Allowlist read-only CLI (`bitrefill search-products`, `bitrefill get-product-details`, `bitrefill get-invoice-by-id`); force `/approve` for `bitrefill buy-products`. Same pattern if using MCP `buy-products`.
|
|
151
|
+
- **Isolate Bitrefill agent**: under `agents.list[]` declare a Bitrefill-scoped persona with `tools.deny: ["gateway"]` so the agent **cannot rewrite Gateway config** to bypass approvals. Source: <https://docs.openclaw.ai/tools/exec-approvals.md>.
|
|
152
|
+
- **Guest first, balance when ready**: guest CLI + payment link = lowest friction; human pre-funds account + `login`/`verify` when agent needs capped `balance` spend. **Never** give the agent crypto wallet seeds. Skill is not a wallet.
|
|
153
|
+
- **No voice readback of codes**: disable `audio_as_voice` / TTS for the Bitrefill agent. Pi's media pipeline could otherwise speak a cash-like code aloud over Telegram voice notes.
|
|
154
|
+
- **No `MEDIA:<url>` for redemption codes**: enforce text-only delivery for the redemption tool output.
|
|
155
|
+
|
|
156
|
+
## Source of truth
|
|
157
|
+
|
|
158
|
+
- OpenClaw docs: <https://docs.openclaw.ai/>
|
|
159
|
+
- Skills loader: <https://docs.openclaw.ai/tools/skills.md>
|
|
160
|
+
- Creating skills: <https://docs.openclaw.ai/tools/creating-skills.md>
|
|
161
|
+
- MCP CLI: <https://docs.openclaw.ai/cli/mcp.md>
|
|
162
|
+
- Exec tool: <https://docs.openclaw.ai/tools/exec.md>
|
|
163
|
+
- Sandboxing: <https://docs.openclaw.ai/gateway/sandboxing.md>
|
|
164
|
+
- Exec approvals: <https://docs.openclaw.ai/tools/exec-approvals.md>
|
|
165
|
+
- Nodes: <https://docs.openclaw.ai/nodes/index.md>
|
|
166
|
+
- Channels: <https://docs.openclaw.ai/channels/telegram>
|
|
167
|
+
- Bitrefill skill paths: [mcp.md](mcp.md), [cli.md](cli.md), [api.md](api.md), [browse.md](browse.md), [safeguards.md](safeguards.md)
|