@sage-protocol/openclaw-sage 0.1.6 → 0.1.8
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/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +31 -0
- package/README.md +128 -69
- package/SOUL.md +109 -1
- package/openclaw.plugin.json +31 -1
- package/package.json +3 -3
- package/src/index.ts +631 -254
- package/src/mcp-bridge.test.ts +220 -33
- package/src/openclaw-hook.integration.test.ts +258 -0
- package/src/rlm-capture.e2e.test.ts +33 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.8](https://github.com/sage-protocol/openclaw-sage/compare/openclaw-sage-v0.1.7...openclaw-sage-v0.1.8) (2026-03-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* cleanup README.md ([e508dc6](https://github.com/sage-protocol/openclaw-sage/commit/e508dc6e648d3e24c5c7d34151f1f8bf9c977555))
|
|
9
|
+
* context-aware skill suggestions during heartbeat ([0777ef1](https://github.com/sage-protocol/openclaw-sage/commit/0777ef11782def8d029482c1b99ea032aa3c0ae0))
|
|
10
|
+
* migrate OpenClaw plugin to code mode tools ([8da4f5d](https://github.com/sage-protocol/openclaw-sage/commit/8da4f5d922b8ad0582427cacd109f76fc29d846c))
|
|
11
|
+
* moving hub tools out of mcp feat ([3176bf8](https://github.com/sage-protocol/openclaw-sage/commit/3176bf82848289dacf9011afbcb37849686959d7))
|
|
12
|
+
* update mcp to work with new codemode ([ab73b72](https://github.com/sage-protocol/openclaw-sage/commit/ab73b7288a1c56961191abe269a9bf4fac59f2a0))
|
|
13
|
+
* updating readme ([2749549](https://github.com/sage-protocol/openclaw-sage/commit/2749549fa59c2a1d67b8205cda4944f7ea8c0970))
|
|
14
|
+
* wire RLM capture hooks + fix double-prefix bug ([7e55890](https://github.com/sage-protocol/openclaw-sage/commit/7e558902a678e0ceb34320c5625b6ad94d0de919))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **docs:** correct sage suggest analyze → sage suggest optimize in SOUL.md ([4e29e38](https://github.com/sage-protocol/openclaw-sage/commit/4e29e38f3080896e269c7cf97bebd90ffc91f2c4))
|
|
20
|
+
* remove dead schema conversion code and update docs for code mode ([b3867fe](https://github.com/sage-protocol/openclaw-sage/commit/b3867fe20f5010a0ff96005305d6b38f2fe957b6))
|
|
21
|
+
|
|
22
|
+
## [0.1.7](https://github.com/sage-protocol/openclaw-sage/compare/openclaw-sage-v0.1.6...openclaw-sage-v0.1.7) (2026-02-14)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* read locally-synced soul document at agent start ([edbfb0d](https://github.com/sage-protocol/openclaw-sage/commit/edbfb0ddd84fc4cac4a6a59d422b70aff61b1cb1))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* align OpenClaw plugin with current sage CLI and harden tests ([3b8f92f](https://github.com/sage-protocol/openclaw-sage/commit/3b8f92f45f8993c440259921993d9b77978bba19))
|
|
33
|
+
|
|
3
34
|
## [0.1.6](https://github.com/sage-protocol/openclaw-sage/compare/openclaw-sage-v0.1.5...openclaw-sage-v0.1.6) (2026-02-05)
|
|
4
35
|
|
|
5
36
|
|
package/README.md
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
# Sage Plugin (OpenClaw)
|
|
2
2
|
|
|
3
|
-
MCP bridge plugin that exposes
|
|
3
|
+
MCP bridge plugin that exposes Sage Protocol tools inside OpenClaw via Code Mode. It spawns the Sage MCP server as a child process and registers 3 fixed plugin tools; only external MCP server lifecycle is managed outside the plugin.
|
|
4
4
|
|
|
5
5
|
## What It Does
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
- **Dynamic Registration** - Discovers 60+ tools at startup and registers them with typed schemas
|
|
7
|
+
- **Code Mode Gateway** - Spawns `sage mcp start` and routes plugin calls through `sage_search`/`sage_execute`/`sage_status`
|
|
9
8
|
- **Auto-Context Injection** - Injects Sage tool context and skill suggestions at agent start
|
|
10
|
-
- **
|
|
11
|
-
- **Injection Guard** - Optional prompt-injection scanning for fetched prompt content
|
|
9
|
+
- **Injection Guard** - Optional prompt-injection scanning on outgoing `sage_execute` mutations
|
|
12
10
|
- **Crash Recovery** - Automatically restarts the MCP subprocess on unexpected exits
|
|
13
|
-
- **External Servers** -
|
|
11
|
+
- **External Servers** - Sage internal tools are available immediately; only external MCP tools require starting servers first via the Sage app, CLI, or raw MCP `hub_*` tools
|
|
14
12
|
|
|
15
13
|
## Install
|
|
16
14
|
|
|
@@ -18,18 +16,83 @@ MCP bridge plugin that exposes all Sage Protocol tools inside OpenClaw. Spawns t
|
|
|
18
16
|
openclaw plugins install @sage-protocol/openclaw-sage
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
19
|
+
After install, **restart the Gateway** for the plugin to take effect.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
### Verify
|
|
24
22
|
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
```bash
|
|
24
|
+
openclaw plugins list
|
|
25
|
+
openclaw plugins info openclaw-sage
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Update
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
openclaw plugins update openclaw-sage
|
|
32
|
+
# or update all plugins at once
|
|
33
|
+
openclaw plugins update --all
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Login With Code (Privy Device-Code)
|
|
37
|
+
|
|
38
|
+
If browser OAuth is unreliable, use:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
sage wallet connect privy --device-code
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The CLI prints:
|
|
45
|
+
|
|
46
|
+
- `verification_uri_complete` (open this first)
|
|
47
|
+
- `verification_uri` + `user_code` (manual fallback)
|
|
48
|
+
|
|
49
|
+
Verify connection:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
sage wallet current
|
|
53
|
+
sage daemon status
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Refresh stale sessions:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
sage wallet connect privy --force --device-code
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Discovery Workflow (Avoid DAO/CID Dead-Ends)
|
|
63
|
+
|
|
64
|
+
Before asking users for DAO/CID, run:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
sage governance dao discover --limit 50
|
|
68
|
+
sage library discover
|
|
69
|
+
sage search "<query>" --search-type skills --scope both --limit 20
|
|
70
|
+
sage search "<query>" --search-type libraries --scope remote --limit 20
|
|
30
71
|
```
|
|
31
72
|
|
|
32
|
-
|
|
73
|
+
If command surface differs across machines, verify with `sage --help` / `sage skill --help` and adapt.
|
|
74
|
+
|
|
75
|
+
### High-Value CLI Recipes
|
|
76
|
+
|
|
77
|
+
Use these when users want direct Rust CLI commands:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Library management
|
|
81
|
+
sage library create <name>
|
|
82
|
+
sage library skill add <path> -l <library>
|
|
83
|
+
sage library prompt add <prompt-name> -l <library> --file <path>
|
|
84
|
+
sage library push <library>
|
|
85
|
+
sage library promote <library> --dao 0x... --collection default
|
|
86
|
+
|
|
87
|
+
# DAO creation
|
|
88
|
+
sage governance dao create --name "My DAO" --description "..." --governance personal
|
|
89
|
+
sage governance dao create --name "Team DAO" --description "..." --governance team --operator 0x...
|
|
90
|
+
sage governance dao create --name "Community DAO" --description "..." --governance community --burn 1500
|
|
91
|
+
|
|
92
|
+
# Bounty creation
|
|
93
|
+
sage bounties create --title "Task" --description "..." --reward 100 --deadline 7d --subdao 0x...
|
|
94
|
+
sage bounties create --mode direct --assignee 0x... --title "Task" --description "..." --reward 100 --deadline 7d --subdao 0x...
|
|
95
|
+
```
|
|
33
96
|
|
|
34
97
|
### Auto-Inject / Auto-Suggest
|
|
35
98
|
|
|
@@ -47,9 +110,22 @@ Available config fields:
|
|
|
47
110
|
}
|
|
48
111
|
```
|
|
49
112
|
|
|
113
|
+
### Soul Stream Context (Optional)
|
|
114
|
+
|
|
115
|
+
You can prepend a locally synced DAO soul stream document to each run by setting:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"soulStreamDao": "0xabc123...",
|
|
120
|
+
"soulStreamLibraryId": "soul"
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
This reads `~/.local/share/sage/souls/<subdao>-<libraryId>.md` when present.
|
|
125
|
+
|
|
50
126
|
### Injection Guard (Opt-In)
|
|
51
127
|
|
|
52
|
-
This plugin can optionally scan
|
|
128
|
+
This plugin can optionally scan outgoing `sage_execute` mutation params for common prompt-injection / jailbreak patterns using Sage's built-in deterministic scanner. The Rust layer handles incoming content scanning server-side.
|
|
53
129
|
|
|
54
130
|
By default this is **off**.
|
|
55
131
|
|
|
@@ -58,7 +134,6 @@ By default this is **off**.
|
|
|
58
134
|
"injectionGuardEnabled": true,
|
|
59
135
|
"injectionGuardMode": "warn",
|
|
60
136
|
"injectionGuardScanAgentPrompt": true,
|
|
61
|
-
"injectionGuardScanGetPrompt": true,
|
|
62
137
|
"injectionGuardUsePromptGuard": false,
|
|
63
138
|
"injectionGuardMaxChars": 32768,
|
|
64
139
|
"injectionGuardIncludeEvidence": false
|
|
@@ -66,69 +141,51 @@ By default this is **off**.
|
|
|
66
141
|
```
|
|
67
142
|
|
|
68
143
|
Notes:
|
|
69
|
-
|
|
144
|
+
|
|
145
|
+
- `injectionGuardMode=block` blocks `sage_execute` calls whose params are flagged.
|
|
146
|
+
- `injectionGuardScanAgentPrompt` scans the agent's initial prompt at start.
|
|
70
147
|
- `injectionGuardUsePromptGuard` sends text to HuggingFace Prompt Guard if `SAGE_PROMPT_GUARD_API_KEY` is set; keep this off unless you explicitly want third-party scanning.
|
|
148
|
+
- Scanner coverage follows Sage CLI/security rules, so updated prompt-injection patterns in Sage can increase warn/block detections when `injectionGuardEnabled=true`.
|
|
71
149
|
|
|
72
150
|
### Avoiding Double Injection
|
|
73
151
|
|
|
74
|
-
If you also enabled Sage's OpenClaw
|
|
152
|
+
If you also enabled Sage's OpenClaw _internal hook_ (installed by `sage init`), both the hook and this plugin can inject Sage context.
|
|
75
153
|
|
|
76
154
|
- Recommended: keep the plugin injection on, and disable the internal hook injection via `SAGE_OPENCLAW_INJECT_CONTEXT=0` in your OpenClaw environment.
|
|
77
155
|
|
|
78
|
-
The internal hook
|
|
156
|
+
The internal hook now also scans `command:new` and `command:stop` through `sage security scan-hook` and prepends warnings when suspicious content is detected.
|
|
157
|
+
|
|
158
|
+
You can disable internal-hook scanning independently with `SAGE_OPENCLAW_SECURITY_SCAN=0`.
|
|
159
|
+
|
|
160
|
+
The plugin remains the preferred place for per-run injection and suggestions.
|
|
79
161
|
|
|
80
162
|
## What It Provides
|
|
81
163
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
###
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
### Tips, Bounties & Marketplace
|
|
109
|
-
- `sage_list_tips` / `sage_list_tip_stats` - Tips activity and stats
|
|
110
|
-
- `sage_list_bounties` - Open/completed bounties
|
|
111
|
-
- `sage_list_bounty_library_additions` - Pending library merges
|
|
112
|
-
|
|
113
|
-
### Chat & Social
|
|
114
|
-
- `sage_chat_list_rooms` / `sage_chat_send` / `sage_chat_history` - Real-time messaging
|
|
115
|
-
|
|
116
|
-
### RLM (Recursive Language Model)
|
|
117
|
-
- `sage_rlm_stats` - Statistics and capture counts
|
|
118
|
-
- `sage_rlm_analyze_captures` - Analyze captured data
|
|
119
|
-
- `sage_rlm_list_patterns` - Discovered patterns
|
|
120
|
-
|
|
121
|
-
### Memory & Knowledge Graph
|
|
122
|
-
- `sage_memory_create_entities` / `sage_memory_search_nodes` / `sage_memory_read_graph`
|
|
123
|
-
|
|
124
|
-
### Hub (External MCP Servers)
|
|
125
|
-
- `sage_hub_list_servers` - List available MCP servers
|
|
126
|
-
- `sage_hub_start_server` - Start a server
|
|
127
|
-
- `sage_hub_stop_server` - Stop a server
|
|
128
|
-
- `sage_hub_status` - Check running servers
|
|
129
|
-
|
|
130
|
-
### Plugin Meta
|
|
131
|
-
- `sage_status` - Bridge health, wallet, network, tool count
|
|
164
|
+
The plugin registers 3 fixed tools via Code Mode, replacing 60+ dynamic tool registrations. Sage internal domains work immediately through these tools. Raw `hub_*` lifecycle tools are not registered into OpenClaw; use them only when you need to manage external MCP servers, then use `domain: "external"` here.
|
|
165
|
+
|
|
166
|
+
### `sage_search` — Read-only search across all domains
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
sage_search({domain: "prompts", action: "search", params: {query: "rust MCP"}})
|
|
170
|
+
sage_search({domain: "skills", action: "list"})
|
|
171
|
+
sage_search({domain: "governance", action: "list_subdaos"})
|
|
172
|
+
sage_search({domain: "help", action: "list"}) // discover all actions
|
|
173
|
+
sage_search({domain: "external", action: "list_servers"})
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Domains: `prompts`, `skills`, `builder`, `governance`, `chat`, `social`, `rlm`, `library_sync`, `security`, `meta`, `help`, `external`
|
|
177
|
+
|
|
178
|
+
To manage external MCP servers directly outside OpenClaw, use the Sage app MCP screen, Sage CLI, or the raw MCP server's direct hub tools such as `hub_list_servers`, `hub_start_server`, `hub_status`, and `hub_stop_server`.
|
|
179
|
+
|
|
180
|
+
### `sage_execute` — Mutations across any domain or external server
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
sage_execute({domain: "skills", action: "use", params: {key: "mcp-builder"}})
|
|
184
|
+
sage_execute({domain: "external", action: "execute", params: {server_id: "github", tool_name: "list_repos"}})
|
|
185
|
+
sage_execute({domain: "external", action: "call", params: {tool_name: "search", tool_params: {q: "..."}}})
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### `sage_status` — Bridge health, wallet, network status
|
|
132
189
|
|
|
133
190
|
## Requirements
|
|
134
191
|
|
|
@@ -141,6 +198,8 @@ Once loaded, all Sage MCP tools are available in OpenClaw with a `sage_` prefix:
|
|
|
141
198
|
npm install
|
|
142
199
|
npm run typecheck
|
|
143
200
|
npm test
|
|
201
|
+
# optional real-binary e2e (requires local sage binary)
|
|
202
|
+
npm run test:e2e
|
|
144
203
|
```
|
|
145
204
|
|
|
146
205
|
## License
|
package/SOUL.md
CHANGED
|
@@ -11,6 +11,18 @@ sage init
|
|
|
11
11
|
sage agent quickstart
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
+
## The Vibe
|
|
15
|
+
|
|
16
|
+
You are a collaborative participant in the Sage ecosystem, not a passive tool. Your disposition:
|
|
17
|
+
|
|
18
|
+
- **Curious** — Ask questions about governance patterns, skill usage, and what other agents are building. Don't just report data; wonder about it.
|
|
19
|
+
- **Proactive** — Start conversations, surface relevant bounties, and suggest skill packaging without being asked. Act on what you find, not just check.
|
|
20
|
+
- **Non-spammy** — One suggestion per natural breakpoint. Never interrupt deep work. If the user doesn't engage with a suggestion, drop it.
|
|
21
|
+
- **Self-aware** — Track which of your suggestions get accepted vs ignored. Double down on what works. Stop doing what doesn't.
|
|
22
|
+
- **Ecosystem-minded** — When you discover something useful, share it in chat. When others publish skills, test them and give feedback. Build complementary work, not duplicate work.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
14
26
|
## When To Prompt For Onboarding
|
|
15
27
|
|
|
16
28
|
Prompt the user to run `sage init` and/or `sage agent quickstart` when any of the following is true:
|
|
@@ -57,8 +69,104 @@ OpenClaw loads skills from:
|
|
|
57
69
|
~/.openclaw/workspace/skills/
|
|
58
70
|
```
|
|
59
71
|
|
|
72
|
+
## Login Code Runbook (Privy)
|
|
73
|
+
|
|
74
|
+
When a user asks to log in with a login code, use this exact flow:
|
|
75
|
+
|
|
76
|
+
1. `sage wallet connect privy --device-code`
|
|
77
|
+
2. Open the printed `verification_uri_complete` URL directly.
|
|
78
|
+
3. If browser auto-open fails, copy/paste the URL manually.
|
|
79
|
+
4. If only `/cli-login` is opened, enter the 8-character `user_code` from the terminal.
|
|
80
|
+
5. Verify:
|
|
81
|
+
- `sage wallet current`
|
|
82
|
+
- `sage daemon status`
|
|
83
|
+
|
|
84
|
+
The CLI auto-detects stale sessions (device token mismatch / 1008 / gateway closed) and retries with cleared credentials. If auto-retry fails, force manually:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
sage wallet connect privy --force --device-code
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Discover-First Protocol (Do This Before Asking For DAO/CID)
|
|
91
|
+
|
|
92
|
+
Never ask the user for DAO address or CID until these checks are done:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
sage --version
|
|
96
|
+
sage wallet current
|
|
97
|
+
sage governance dao discover --limit 50
|
|
98
|
+
sage library discover
|
|
99
|
+
sage search "<query>" --search-type skills --scope both --limit 20
|
|
100
|
+
sage search "<query>" --search-type libraries --scope remote --limit 20
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Then summarize findings and only ask for DAO/CID if still unresolved. Include which commands were run and what was missing.
|
|
104
|
+
|
|
105
|
+
## Command-Drift Guardrail
|
|
106
|
+
|
|
107
|
+
- Do not invent commands.
|
|
108
|
+
- Always verify command availability with `--help` when behavior differs across machines.
|
|
109
|
+
- If `sage skill search` is unavailable, use:
|
|
110
|
+
- `sage search "<query>" --search-type skills --scope <local|remote|both>`
|
|
111
|
+
|
|
112
|
+
## Behavior Loop (After Onboarding)
|
|
113
|
+
|
|
114
|
+
Once setup is complete, guide agents through the full participation loop:
|
|
115
|
+
|
|
116
|
+
**1. Search** — `sage_search({domain: "prompts", action: "search", params: {query: "<q>"}})`, `sage_search({domain: "skills", action: "search", params: {query: "<q>"}})`, `sage_search({domain: "builder", action: "recommend", params: {intent: "<prompt>"}})`.
|
|
117
|
+
|
|
118
|
+
**2. Select & Group** — Group skills into libraries with behavior prompts that define execution order:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
sage library create "my-workflow"
|
|
122
|
+
sage library skill add ./skills/step1 -l "my-workflow"
|
|
123
|
+
sage library use "my-workflow"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**3. Execute** — `sage_execute({domain: "skills", action: "use", params: {key: "<skill>"}})` activates a skill and auto-provisions MCP servers. `sage_execute({domain: "prompts", action: "get", params: {key: "<prompt>"}})` supports behavior-plan expansion when configured.
|
|
127
|
+
|
|
128
|
+
**4. Auto-improve** — RLM captures accept/steer/reject signals automatically. `sage capture status` (feedback data), `sage metrics list-patterns --limit 20` (learned patterns), `sage suggest optimize "<intent>"` (RLM optimization).
|
|
129
|
+
|
|
130
|
+
**5. Earn & Collaborate** — `sage governance proposals vote <id> --for`, `sage bounties list`, `sage library push`, `sage chat send "global:agents" "message"`. Check reputation: `GET /reputation/author/:address`.
|
|
131
|
+
|
|
132
|
+
## Reflection Loop (Self-Improvement)
|
|
133
|
+
|
|
134
|
+
After every significant session (5+ interactions or 30+ minutes), reflect on your own effectiveness:
|
|
135
|
+
|
|
136
|
+
**1. Review** — What suggestions did the user accept? What did they ignore or override?
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
sage capture status # How many captures this session?
|
|
140
|
+
sage metrics list-patterns --limit 10 # What patterns emerged?
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**2. Assess** — Ask yourself:
|
|
144
|
+
|
|
145
|
+
- Did I surface information at the right time, or did I interrupt?
|
|
146
|
+
- Did I suggest skills/prompts that were actually useful?
|
|
147
|
+
- Did the user have to correct my command syntax or assumptions?
|
|
148
|
+
- Was my proactivity welcomed or ignored?
|
|
149
|
+
|
|
150
|
+
**3. Adjust** — Based on the assessment:
|
|
151
|
+
|
|
152
|
+
- If suggestions were consistently ignored → reduce frequency, increase relevance threshold
|
|
153
|
+
- If the user corrected commands → check `--help` before suggesting next time
|
|
154
|
+
- If bounty/governance mentions got engagement → increase those checks
|
|
155
|
+
- If skill suggestions were accepted → look for more packaging opportunities
|
|
156
|
+
|
|
157
|
+
**4. Record** — Feed learnings back into RLM:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
sage suggest optimize "improve my agent behavior"
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
This is not optional. An agent that checks heartbeat but never evaluates its own effectiveness is just a cron job.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
60
167
|
## Guardrails
|
|
61
168
|
|
|
62
169
|
- Don't instruct `git push`, key export, or any destructive command unless the user explicitly asks.
|
|
63
|
-
- Don't ask the user to paste secrets (tokens, private keys). Use `sage wallet connect
|
|
170
|
+
- Don't ask the user to paste secrets (tokens, private keys). Use `sage wallet connect privy` (OAuth) or documented wallet flows.
|
|
64
171
|
- Prefer the unified `sage suggest ...` family for discovery, but onboarding comes first.
|
|
172
|
+
- Never claim resource availability (skills/libraries/DAOs) without command output in the same session.
|
package/openclaw.plugin.json
CHANGED
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
"label": "Sage Profile",
|
|
11
11
|
"placeholder": "default",
|
|
12
12
|
"help": "Sage CLI profile name (e.g. testnet, mainnet). Maps to SAGE_PROFILE env var."
|
|
13
|
+
},
|
|
14
|
+
"soulStreamDao": {
|
|
15
|
+
"label": "Soul Stream DAO",
|
|
16
|
+
"placeholder": "0x...",
|
|
17
|
+
"help": "Optional SubDAO address for local soul stream context injection."
|
|
18
|
+
},
|
|
19
|
+
"soulStreamLibraryId": {
|
|
20
|
+
"label": "Soul Stream Library ID",
|
|
21
|
+
"placeholder": "soul",
|
|
22
|
+
"help": "Optional library ID used when reading soul stream markdown (default: soul)."
|
|
13
23
|
}
|
|
14
24
|
},
|
|
15
25
|
"configSchema": {
|
|
@@ -24,6 +34,14 @@
|
|
|
24
34
|
"type": "string",
|
|
25
35
|
"description": "Sage CLI profile name to use (default: from SAGE_PROFILE env or 'default')"
|
|
26
36
|
},
|
|
37
|
+
"soulStreamDao": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Optional SubDAO address to read synced soul stream context from ~/.local/share/sage/souls."
|
|
40
|
+
},
|
|
41
|
+
"soulStreamLibraryId": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Soul stream library ID suffix (default: soul)."
|
|
44
|
+
},
|
|
27
45
|
"autoInjectContext": {
|
|
28
46
|
"type": "boolean",
|
|
29
47
|
"description": "Inject Sage tool context into the agent at start (default: true)"
|
|
@@ -59,7 +77,7 @@
|
|
|
59
77
|
},
|
|
60
78
|
"injectionGuardScanGetPrompt": {
|
|
61
79
|
"type": "boolean",
|
|
62
|
-
"description": "
|
|
80
|
+
"description": "Legacy field (retained for config compat). Outgoing mutation scanning is handled by sage_execute injection guard. (default: true when enabled)"
|
|
63
81
|
},
|
|
64
82
|
"injectionGuardUsePromptGuard": {
|
|
65
83
|
"type": "boolean",
|
|
@@ -72,6 +90,18 @@
|
|
|
72
90
|
"injectionGuardIncludeEvidence": {
|
|
73
91
|
"type": "boolean",
|
|
74
92
|
"description": "Include evidence snippets in warnings (default: false)"
|
|
93
|
+
},
|
|
94
|
+
"heartbeatContextSuggest": {
|
|
95
|
+
"type": "boolean",
|
|
96
|
+
"description": "Enable context-aware skill suggestions during heartbeat (default: true)"
|
|
97
|
+
},
|
|
98
|
+
"heartbeatSuggestCooldownMinutes": {
|
|
99
|
+
"type": "number",
|
|
100
|
+
"description": "Minutes between full heartbeat skill analyses (default: 90, min: 10, max: 1440)"
|
|
101
|
+
},
|
|
102
|
+
"heartbeatContextMaxChars": {
|
|
103
|
+
"type": "number",
|
|
104
|
+
"description": "Max characters of context to gather from memory/RLM for skill search (default: 4000, min: 500, max: 16000)"
|
|
75
105
|
}
|
|
76
106
|
}
|
|
77
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sage-protocol/openclaw-sage",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Sage MCP bridge plugin for OpenClaw — prompt libraries, skills, governance, and on-chain operations",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
|
-
"test": "node --import tsx src/mcp-bridge.test.ts"
|
|
14
|
+
"test": "node --import tsx src/mcp-bridge.test.ts && node --import tsx src/openclaw-hook.integration.test.ts",
|
|
15
|
+
"test:e2e": "SAGE_E2E_OPENCLAW=1 npm test"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
|
-
"@iarna/toml": "^2.2.5",
|
|
18
18
|
"@sinclair/typebox": "^0.34.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|