@johngalt5/bsv-overlay 0.2.8 → 0.2.10
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/SKILL.md +33 -11
- package/clawdbot.plugin.json +8 -0
- package/index.ts +23 -2
- package/openclaw.plugin.json +8 -0
- package/package.json +1 -1
package/SKILL.md
CHANGED
|
@@ -47,8 +47,19 @@ If unfunded, it returns the address to fund. Once funded, run `onboard` again to
|
|
|
47
47
|
1. **Plugin loads** → wallet created automatically if missing
|
|
48
48
|
2. **User funds wallet** → UTXOs auto-imported via address watching
|
|
49
49
|
3. **Sufficient balance detected** → auto-registers on the overlay network
|
|
50
|
-
4. **Agent
|
|
51
|
-
5. **
|
|
50
|
+
4. **Agent asks for agent name** → user chooses their display name on the network
|
|
51
|
+
5. **Agent presents services** → user picks which to advertise
|
|
52
|
+
6. **Background service starts** → incoming requests auto-queued for agent processing
|
|
53
|
+
|
|
54
|
+
### Agent Name
|
|
55
|
+
|
|
56
|
+
On first registration, ask the user: **"What name do you want for your agent on the overlay network?"**
|
|
57
|
+
|
|
58
|
+
The default is the system hostname. If they want a custom name, set it in the plugin config:
|
|
59
|
+
- Config key: `agentName`
|
|
60
|
+
- Env var: `AGENT_NAME`
|
|
61
|
+
|
|
62
|
+
A re-registration (`overlay({ action: "register" })`) will use the new name.
|
|
52
63
|
|
|
53
64
|
## Handling Incoming Service Requests
|
|
54
65
|
|
|
@@ -110,19 +121,30 @@ When another agent requests a service:
|
|
|
110
121
|
|
|
111
122
|
## Choosing Services to Advertise
|
|
112
123
|
|
|
113
|
-
After registration, you
|
|
114
|
-
|
|
124
|
+
**IMPORTANT: After registration, you MUST ask the user which services they want to offer.**
|
|
125
|
+
|
|
126
|
+
Call `overlay({ action: "register" })` to get the full list of available services. Then
|
|
127
|
+
present them to the user — ideally with inline buttons so they can toggle services on/off.
|
|
115
128
|
|
|
129
|
+
Available services to offer:
|
|
130
|
+
|
|
131
|
+
| Service ID | Name | Suggested Price | What it does |
|
|
132
|
+
|-----------|------|----------------|--------------|
|
|
133
|
+
| `tell-joke` | Random Joke | 5 sats | Generate a joke |
|
|
134
|
+
| `roulette` | Roulette | 10 sats | Casino-style roulette game |
|
|
135
|
+
| `memory-store` | Memory Store | 10 sats | Key-value storage for other agents |
|
|
136
|
+
| `api-proxy` | API Proxy | 15 sats | Proxy HTTP requests to external APIs |
|
|
137
|
+
| `translate` | Translation | 20 sats | Translate text between languages |
|
|
138
|
+
| `code-review` | Code Review | 50 sats | Review code for bugs, security, style |
|
|
139
|
+
| `web-research` | Web Research | 50 sats | Research a topic from web sources |
|
|
140
|
+
| `code-develop` | Code Development | 100 sats | Implement features, open PRs |
|
|
141
|
+
|
|
142
|
+
For each service the user selects, advertise it:
|
|
116
143
|
```javascript
|
|
117
|
-
overlay({
|
|
118
|
-
action: "advertise",
|
|
119
|
-
serviceId: "code-review",
|
|
120
|
-
name: "Code Review",
|
|
121
|
-
description: "Professional code analysis and feedback",
|
|
122
|
-
priceSats: 50
|
|
123
|
-
})
|
|
144
|
+
overlay({ action: "advertise", serviceId: "code-review", name: "Code Review", description: "Review code for bugs, security, and style", priceSats: 50 })
|
|
124
145
|
```
|
|
125
146
|
|
|
147
|
+
**Do NOT silently advertise all services.** The user should choose which ones their bot offers.
|
|
126
148
|
Only advertise services you can actually fulfill well with your capabilities.
|
|
127
149
|
|
|
128
150
|
## Auto-Import & Budget Tracking
|
package/clawdbot.plugin.json
CHANGED
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"default": "http://localhost:8080",
|
|
13
13
|
"description": "Overlay server URL - configure actual production URL via environment variables"
|
|
14
14
|
},
|
|
15
|
+
"agentName": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Display name for this agent on the overlay network"
|
|
18
|
+
},
|
|
19
|
+
"agentDescription": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Description of this agent shown to other agents on the network"
|
|
22
|
+
},
|
|
15
23
|
"walletDir": {
|
|
16
24
|
"type": "string"
|
|
17
25
|
},
|
package/index.ts
CHANGED
|
@@ -526,7 +526,21 @@ export default function register(api) {
|
|
|
526
526
|
const regResult = await execFileAsync('node', [cliPath, 'register'], { env, timeout: 60000 });
|
|
527
527
|
const regOutput = parseCliOutput(regResult.stdout);
|
|
528
528
|
if (regOutput.success) {
|
|
529
|
-
api.log?.info?.('[bsv-overlay] Auto-registered on overlay network!');
|
|
529
|
+
api.log?.info?.('[bsv-overlay] Auto-registered on overlay network! Waking agent for service selection...');
|
|
530
|
+
// Wake the agent to present service selection to the user
|
|
531
|
+
try {
|
|
532
|
+
const wakeText = `🎉 BSV Overlay: Auto-registered on the network! Two things to set up:\n\n1. **Agent name**: Ask the user what name they want for their agent on the network. The current default is "${env.AGENT_NAME}". If they want a different name, they need to set it in the plugin config (agentName) and re-register.\n\n2. **Services**: Ask the user which services they want to advertise. Call overlay({ action: "register" }) to get the full list of available services with descriptions and suggested prices, then present them to the user. Let them choose which ones to enable. For each selected service, call overlay({ action: "advertise", serviceId: "...", name: "...", description: "...", priceSats: N }).`;
|
|
533
|
+
await fetch('http://127.0.0.1:18789', {
|
|
534
|
+
method: 'POST',
|
|
535
|
+
headers: { 'Content-Type': 'application/json' },
|
|
536
|
+
body: JSON.stringify({
|
|
537
|
+
jsonrpc: '2.0',
|
|
538
|
+
id: `overlay-service-select-${Date.now()}`,
|
|
539
|
+
method: 'cron.wake',
|
|
540
|
+
params: { mode: 'now', text: wakeText },
|
|
541
|
+
}),
|
|
542
|
+
});
|
|
543
|
+
} catch {}
|
|
530
544
|
}
|
|
531
545
|
}
|
|
532
546
|
}
|
|
@@ -1088,7 +1102,14 @@ function buildEnvironment(config) {
|
|
|
1088
1102
|
|
|
1089
1103
|
// Set defaults
|
|
1090
1104
|
env.BSV_NETWORK = env.BSV_NETWORK || 'mainnet';
|
|
1091
|
-
|
|
1105
|
+
if (config.agentName) {
|
|
1106
|
+
env.AGENT_NAME = config.agentName;
|
|
1107
|
+
} else if (!env.AGENT_NAME) {
|
|
1108
|
+
env.AGENT_NAME = 'clawdbot-agent';
|
|
1109
|
+
}
|
|
1110
|
+
if (config.agentDescription) {
|
|
1111
|
+
env.AGENT_DESCRIPTION = config.agentDescription;
|
|
1112
|
+
}
|
|
1092
1113
|
env.AGENT_ROUTED = 'true'; // Route service requests through the agent
|
|
1093
1114
|
|
|
1094
1115
|
return env;
|
package/openclaw.plugin.json
CHANGED
|
@@ -12,6 +12,14 @@
|
|
|
12
12
|
"default": "http://localhost:8080",
|
|
13
13
|
"description": "Overlay server URL - configure actual production URL via environment variables"
|
|
14
14
|
},
|
|
15
|
+
"agentName": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Display name for this agent on the overlay network"
|
|
18
|
+
},
|
|
19
|
+
"agentDescription": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "Description of this agent shown to other agents on the network"
|
|
22
|
+
},
|
|
15
23
|
"walletDir": {
|
|
16
24
|
"type": "string"
|
|
17
25
|
},
|