@nevermined-io/openclaw-plugin 1.0.11 → 1.0.12

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.
@@ -0,0 +1,164 @@
1
+ ---
2
+ title: "Commands"
3
+ description: "All available tools and slash commands in the Nevermined OpenClaw plugin"
4
+ icon: "terminal"
5
+ ---
6
+
7
+ # Commands
8
+
9
+ The plugin provides slash commands for chat channels and gateway methods for programmatic access. Each command is available in both forms.
10
+
11
+ ## Authentication
12
+
13
+ ### `/nvm-login [environment]`
14
+
15
+ Authenticate with Nevermined via browser login.
16
+
17
+ | Parameter | Type | Required | Default | Description |
18
+ |-----------|------|----------|---------|-------------|
19
+ | `environment` | string | No | `sandbox` | `sandbox` or `live` |
20
+
21
+ **Gateway method:** `nevermined.login`
22
+
23
+ **Example:**
24
+ ```
25
+ /nvm-login
26
+ /nvm-login live
27
+ ```
28
+
29
+ ---
30
+
31
+ ### `/nvm-logout`
32
+
33
+ Log out from Nevermined and remove the stored API key.
34
+
35
+ **Gateway method:** `nevermined.logout`
36
+
37
+ ---
38
+
39
+ ## Subscriber Tools
40
+
41
+ These tools are for users who want to subscribe to plans, check balances, and query agents.
42
+
43
+ ### `nevermined.checkBalance`
44
+
45
+ Check the credit balance for a payment plan.
46
+
47
+ | Parameter | Type | Required | Default | Description |
48
+ |-----------|------|----------|---------|-------------|
49
+ | `planId` | string | No | Config `planId` | The payment plan ID to check |
50
+
51
+ **Returns:**
52
+ ```json
53
+ {
54
+ "planId": "did:nv:abc123...",
55
+ "planName": "Basic Plan",
56
+ "balance": "95",
57
+ "isSubscriber": true
58
+ }
59
+ ```
60
+
61
+ ---
62
+
63
+ ### `nevermined.getAccessToken`
64
+
65
+ Get an x402 access token for authenticating requests to a Nevermined agent.
66
+
67
+ | Parameter | Type | Required | Default | Description |
68
+ |-----------|------|----------|---------|-------------|
69
+ | `planId` | string | No | Config `planId` | The payment plan ID |
70
+ | `agentId` | string | No | Config `agentId` | The agent ID |
71
+
72
+ **Returns:**
73
+ ```json
74
+ {
75
+ "accessToken": "eyJhbG..."
76
+ }
77
+ ```
78
+
79
+ ---
80
+
81
+ ### `nevermined.orderPlan`
82
+
83
+ Purchase (order) a Nevermined payment plan.
84
+
85
+ | Parameter | Type | Required | Default | Description |
86
+ |-----------|------|----------|---------|-------------|
87
+ | `planId` | string | No | Config `planId` | The plan ID to purchase |
88
+
89
+ **Returns:** Order confirmation with transaction hash.
90
+
91
+ ---
92
+
93
+ ### `nevermined.queryAgent`
94
+
95
+ End-to-end agent query: acquires an x402 access token, sends the prompt to the agent URL with the `PAYMENT-SIGNATURE` header, and returns the response.
96
+
97
+ | Parameter | Type | Required | Default | Description |
98
+ |-----------|------|----------|---------|-------------|
99
+ | `agentUrl` | string | **Yes** | — | The URL of the agent to query |
100
+ | `prompt` | string | **Yes** | — | The prompt to send to the agent |
101
+ | `planId` | string | No | Config `planId` | The payment plan ID |
102
+ | `agentId` | string | No | Config `agentId` | The agent ID |
103
+ | `method` | string | No | `POST` | HTTP method |
104
+
105
+ If the agent returns a 402 (Payment Required) response, the tool returns an error indicating insufficient credits.
106
+
107
+ ---
108
+
109
+ ## Builder Tools
110
+
111
+ These tools are for agent builders who want to register agents and create payment plans.
112
+
113
+ ### `nevermined.registerAgent`
114
+
115
+ Register a new AI agent with an associated payment plan.
116
+
117
+ | Parameter | Type | Required | Description |
118
+ |-----------|------|----------|-------------|
119
+ | `name` | string | **Yes** | Agent name |
120
+ | `description` | string | No | Agent description |
121
+ | `agentUrl` | string | **Yes** | The endpoint URL for the agent |
122
+ | `planName` | string | **Yes** | Name for the payment plan |
123
+ | `priceAmounts` | string | **Yes** | Comma-separated price amounts in wei |
124
+ | `priceReceivers` | string | **Yes** | Comma-separated receiver addresses |
125
+ | `creditsAmount` | number | **Yes** | Number of credits in the plan |
126
+
127
+ **Returns:**
128
+ ```json
129
+ {
130
+ "agentId": "did:nv:...",
131
+ "planId": "did:nv:...",
132
+ "txHash": "0x..."
133
+ }
134
+ ```
135
+
136
+ ---
137
+
138
+ ### `nevermined.createPlan`
139
+
140
+ Create a standalone payment plan (without an agent).
141
+
142
+ | Parameter | Type | Required | Description |
143
+ |-----------|------|----------|-------------|
144
+ | `name` | string | **Yes** | Plan name |
145
+ | `description` | string | No | Plan description |
146
+ | `priceAmounts` | string | **Yes** | Comma-separated price amounts in wei |
147
+ | `priceReceivers` | string | **Yes** | Comma-separated receiver addresses |
148
+ | `creditsAmount` | number | **Yes** | Number of credits in the plan |
149
+ | `accessLimit` | string | No | `"credits"` (default) or `"time"` |
150
+
151
+ **Returns:**
152
+ ```json
153
+ {
154
+ "planId": "did:nv:..."
155
+ }
156
+ ```
157
+
158
+ ---
159
+
160
+ ### `nevermined.listPlans`
161
+
162
+ List the builder's payment plans. No parameters required.
163
+
164
+ **Returns:** Array of plan objects.
@@ -0,0 +1,71 @@
1
+ ---
2
+ title: "Getting Started"
3
+ description: "Install and configure the Nevermined OpenClaw plugin in minutes"
4
+ icon: "rocket"
5
+ ---
6
+
7
+ # Getting Started
8
+
9
+ The Nevermined OpenClaw plugin exposes AI agent payment operations as gateway tools callable from any OpenClaw channel — Telegram, Discord, WhatsApp, and more.
10
+
11
+ ## Prerequisites
12
+
13
+ - An [OpenClaw](https://openclaw.ai) gateway instance
14
+ - Node.js >= 18.0.0
15
+ - A [Nevermined account](https://nevermined.app) (free to create)
16
+
17
+ ## Installation
18
+
19
+ Install the plugin from your OpenClaw gateway:
20
+
21
+ ```bash
22
+ openclaw plugin install @nevermined-io/openclaw-plugin
23
+ ```
24
+
25
+ ## Authentication
26
+
27
+ ### Option A: Browser login (recommended)
28
+
29
+ Use the `/nvm-login` command from any connected chat channel:
30
+
31
+ ```
32
+ /nvm-login
33
+ ```
34
+
35
+ This opens a browser window where you authenticate with Nevermined. The API key is captured automatically and stored in your gateway config.
36
+
37
+ To target the live environment:
38
+
39
+ ```
40
+ /nvm-login live
41
+ ```
42
+
43
+ ### Option B: Manual configuration
44
+
45
+ Add your API key directly to `openclaw.json`:
46
+
47
+ ```json
48
+ {
49
+ "plugins": {
50
+ "nevermined": {
51
+ "nvmApiKey": "sandbox:eyJhbG...",
52
+ "environment": "sandbox"
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ You can obtain an API key from the [Nevermined App](https://nevermined.app) under Settings > API Keys. See the [Get Your API Key](/docs/getting-started/get-your-api-key) guide for details.
59
+
60
+ ## Quick Test
61
+
62
+ After authenticating, verify the plugin is working:
63
+
64
+ 1. **Check your balance** — from any chat channel, the agent can call `nevermined.checkBalance` to verify connectivity.
65
+
66
+ 2. **List plans** — call `nevermined.listPlans` to see available payment plans.
67
+
68
+ ## Next Steps
69
+
70
+ - [Setup](/docs/api-reference/openclaw-plugin/setup) — full configuration reference
71
+ - [Commands](/docs/api-reference/openclaw-plugin/commands) — all available tools and slash commands
package/docs/links.md ADDED
@@ -0,0 +1,38 @@
1
+ ---
2
+ title: "Resources"
3
+ description: "Links to Nevermined documentation, SDKs, and community resources"
4
+ icon: "book"
5
+ ---
6
+
7
+ # Resources
8
+
9
+ ## Nevermined Documentation
10
+
11
+ | Resource | Description |
12
+ |----------|-------------|
13
+ | [Nevermined Docs](https://docs.nevermined.app) | Full platform documentation |
14
+ | [Get Your API Key](https://docs.nevermined.app/docs/getting-started/get-your-api-key) | How to create a Nevermined account and obtain an API key |
15
+ | [Payment Plans](https://docs.nevermined.app/docs/api-reference/typescript/payment-plans-and-agents) | Creating and managing payment plans |
16
+ | [Querying Agents](https://docs.nevermined.app/docs/api-reference/typescript/querying-an-agent) | How to query agents using x402 access tokens |
17
+ | [x402 Protocol](https://docs.nevermined.app/docs/api-reference/typescript/x402-protocol) | The HTTP payment protocol specification |
18
+
19
+ ## SDKs
20
+
21
+ | SDK | Language | Package |
22
+ |-----|----------|---------|
23
+ | [Payments SDK](https://github.com/nevermined-io/payments) | TypeScript | `@nevermined-io/payments` |
24
+ | [Payments SDK (Python)](https://github.com/nevermined-io/payments-py) | Python | `payments-py` |
25
+ | [Nevermined CLI](https://www.npmjs.com/package/@nevermined-io/cli) | TypeScript | `@nevermined-io/cli` |
26
+
27
+ ## OpenClaw
28
+
29
+ | Resource | Description |
30
+ |----------|-------------|
31
+ | [OpenClaw Docs](https://docs.openclaw.ai) | OpenClaw gateway documentation |
32
+ | [Plugin Development](https://docs.openclaw.ai/tools/plugin) | How to build OpenClaw plugins |
33
+
34
+ ## Support
35
+
36
+ - [GitHub Issues](https://github.com/nevermined-io/payments/issues) — report bugs or request features
37
+ - [Nevermined Discord](https://discord.gg/nevermined) — community support
38
+ - [Nevermined App](https://nevermined.app) — manage your account, plans, and agents
package/docs/setup.md ADDED
@@ -0,0 +1,64 @@
1
+ ---
2
+ title: "Setup"
3
+ description: "Full configuration reference for the Nevermined OpenClaw plugin"
4
+ icon: "gear"
5
+ ---
6
+
7
+ # Setup
8
+
9
+ ## Configuration
10
+
11
+ The plugin reads its configuration from the `plugins.nevermined` section of your `openclaw.json`:
12
+
13
+ ```json
14
+ {
15
+ "plugins": {
16
+ "nevermined": {
17
+ "nvmApiKey": "sandbox:eyJhbG...",
18
+ "environment": "sandbox",
19
+ "planId": "did:nv:abc123...",
20
+ "agentId": "did:nv:def456...",
21
+ "creditsPerRequest": 1
22
+ }
23
+ }
24
+ }
25
+ ```
26
+
27
+ ### Configuration Fields
28
+
29
+ | Field | Required | Default | Description |
30
+ |-------|----------|---------|-------------|
31
+ | `nvmApiKey` | No | — | Your Nevermined API key. Can be set via `/nvm-login` instead. |
32
+ | `environment` | No | `sandbox` | Target environment: `sandbox` for testing, `live` for production. |
33
+ | `planId` | No | — | Default payment plan ID. When set, subscriber tools use this plan automatically. |
34
+ | `agentId` | No | — | Default agent ID. Required for plans with multiple agents. |
35
+ | `creditsPerRequest` | No | `1` | Number of credits consumed per request. |
36
+
37
+ ### Environment Details
38
+
39
+ | Environment | Description | Use Case |
40
+ |-------------|-------------|----------|
41
+ | `sandbox` | Test environment on Arbitrum Sepolia | Development, testing, integration |
42
+ | `live` | Production environment on Arbitrum One | Live deployments with real payments |
43
+
44
+ ## Authentication Flow
45
+
46
+ The plugin supports a browser-based login flow identical to the [Nevermined CLI](/docs/api-reference/cli/getting-started):
47
+
48
+ 1. User sends `/nvm-login` in any chat channel (or calls `nevermined.login`)
49
+ 2. The plugin starts a local HTTP server on a random port
50
+ 3. A browser window opens to the Nevermined login page
51
+ 4. After authentication, Nevermined redirects back with the API key
52
+ 5. The key is stored in the gateway config via `api.setConfig()`
53
+
54
+ The login times out after 5 minutes if no authentication is received.
55
+
56
+ ### Logging Out
57
+
58
+ Send `/nvm-logout` or call `nevermined.logout` to remove the stored API key. All payment tools will require re-authentication after logout.
59
+
60
+ ## Default Values
61
+
62
+ When `planId` and `agentId` are set in the config, all subscriber tools (`checkBalance`, `getAccessToken`, `orderPlan`, `queryAgent`) use them as defaults. You can always override them per-call by passing the parameter explicitly.
63
+
64
+ This is useful for gateways that serve a single plan — configure it once and all tools work without extra parameters.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nevermined-io/openclaw-plugin",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "OpenClaw plugin for Nevermined — exposes subscriber and builder tools as gateway methods",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -15,6 +15,7 @@
15
15
  "dist/",
16
16
  "openclaw.plugin.json",
17
17
  "skills/",
18
+ "docs/",
18
19
  "README.md"
19
20
  ],
20
21
  "scripts": {
@@ -45,6 +46,11 @@
45
46
  "url": "https://github.com/nevermined-io/payments.git",
46
47
  "directory": "openclaw"
47
48
  },
49
+ "openclaw": {
50
+ "extensions": [
51
+ "./dist/index.js"
52
+ ]
53
+ },
48
54
  "keywords": [
49
55
  "nevermined",
50
56
  "openclaw",