@reefclaw/openclaw-plugin 0.1.41 → 0.1.42
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/index.js +42 -15
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/release-integrity.json +5 -0
- package/release-notes.json +2 -1
- package/skills/reefclaw/SKILL.md +1 -1
package/index.js
CHANGED
|
@@ -914,22 +914,40 @@ function jsonResult(data) {
|
|
|
914
914
|
// a full second runtime. And the runtime starts only in a runtime process:
|
|
915
915
|
// the `openclaw` CLI loads plugins too, and a CLI-started runtime ran a second
|
|
916
916
|
// simulator + stop watcher + connector (whose bridge evicted the gateway's
|
|
917
|
-
// from the relay).
|
|
918
|
-
//
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
*
|
|
922
|
-
|
|
917
|
+
// from the relay). An inspection registration never starts a runtime: it
|
|
918
|
+
// gets the live runtime's tools when this process has one (the gateway's
|
|
919
|
+
// per-turn tool-discovery pass on OpenClaw 2026.9.6), else call-time stubs.
|
|
920
|
+
/** Tools registered from an inspection registration (a CLI command, or an
|
|
921
|
+
* OpenClaw discovery pass) when no runtime is running yet. Same names and
|
|
922
|
+
* schemas, so the manifest contract and tool listings stay intact.
|
|
923
|
+
*
|
|
924
|
+
* ★ Each call looks up the process runtime AT CALL TIME and runs the real
|
|
925
|
+
* tool if one exists (Ardi report #9, 2026-09-26): OpenClaw builds the tool
|
|
926
|
+
* list an agent turn executes through a `tool-discovery` registration INSIDE
|
|
927
|
+
* the gateway (every turn on 2026.9.6; on older builds a discovery registry
|
|
928
|
+
* built before the runtime could serve the first turn after a restart). A
|
|
929
|
+
* stub that only refused left the agent unable to open, close or move a stop
|
|
930
|
+
* while `/tools/invoke` (the full registry) stayed green. Only a process with
|
|
931
|
+
* no runtime at all — an `openclaw` CLI command — gets the refusal. */
|
|
932
|
+
function buildInspectionTools(context) {
|
|
923
933
|
return Object.keys(TOOL_PARAMS).map((name) => ({
|
|
924
934
|
name,
|
|
925
935
|
label: name,
|
|
926
|
-
description:
|
|
936
|
+
description: `ReefClaw trading tool ${name}.`,
|
|
927
937
|
parameters: TOOL_PARAMS[name],
|
|
928
|
-
execute: async () =>
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
938
|
+
execute: async (...args) => {
|
|
939
|
+
const live = processRuntime();
|
|
940
|
+
const real = live.initialised && live.toolsFactory
|
|
941
|
+
? live.toolsFactory(context).find(t => t.name === name)
|
|
942
|
+
: undefined;
|
|
943
|
+
if (real)
|
|
944
|
+
return real.execute(...args);
|
|
945
|
+
return jsonResult({
|
|
946
|
+
error: 'not_available_in_this_process',
|
|
947
|
+
message: 'This ReefClaw tool registration has no trading runtime in this process, so nothing was executed. '
|
|
948
|
+
+ 'The runtime runs inside the OpenClaw gateway; if this is an agent turn, the gateway may still be starting — retry shortly.',
|
|
949
|
+
});
|
|
950
|
+
},
|
|
933
951
|
}));
|
|
934
952
|
}
|
|
935
953
|
const paperTradingPlugin = {
|
|
@@ -958,9 +976,18 @@ const paperTradingPlugin = {
|
|
|
958
976
|
// reporters, the connector — may start in such a process.
|
|
959
977
|
const role = resolveProcessRole({ registrationMode: api.registrationMode });
|
|
960
978
|
if (role.role === 'inspect') {
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
979
|
+
// An inspection registration never STARTS a runtime. But when this
|
|
980
|
+
// process already runs one (the gateway, whose per-turn tool list comes
|
|
981
|
+
// from a tool-discovery registration on OpenClaw 2026.9.6), the agent
|
|
982
|
+
// must get the live tools — Ardi report #9.
|
|
983
|
+
const live = processRuntime();
|
|
984
|
+
if (live.initialised && live.toolsFactory) {
|
|
985
|
+
api.registerTool(live.toolsFactory, { names: live.toolNames });
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
988
|
+
logger.debug(TAG, `register() without a runtime (${role.reason}) — tool names only, runtime not started`);
|
|
989
|
+
const names = Object.keys(TOOL_PARAMS);
|
|
990
|
+
api.registerTool((context) => buildInspectionTools(context), { names });
|
|
964
991
|
return;
|
|
965
992
|
}
|
|
966
993
|
// Idempotency guard (see note above). Process-wide: every module instance
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "reefclaw-paper-trading",
|
|
3
3
|
"name": "ReefClaw Trading",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.42",
|
|
5
5
|
"description": "Supervised trading plugin for the ReefClaw dashboard. It runs on YOUR machine and starts in PAPER mode with no API keys. It cannot trade real funds until you supply exchange credentials and step PAPER→MICRO_LIVE→LIVE yourself from the dashboard — the agent cannot make that change (the tool is refused without operator provenance). Exchange keys stay local, are used only to sign requests to the exchange, and are never transmitted to ReefClaw (asserted by a test in this package). Trading telemetry — positions, fills, decision journal — is sent to ReefClaw to render the dashboard. Every live position carries exchange-native protective stops. Remote updates to the agent's trading instructions are applied only after an Ed25519 signature is verified against a public key pinned in this build. It runs on gateway startup and supervises a local connector process; the package README lists every path it writes and everything it sends. It never changes the gateway's auth settings.",
|
|
6
6
|
"author": "ReefClaw",
|
|
7
7
|
"activation": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reefclaw/openclaw-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.42",
|
|
4
4
|
"description": "ReefClaw supervised trading plugin for OpenClaw. Runs entirely on YOUR machine and starts in PAPER mode — it cannot trade real funds until you supply exchange credentials and walk the PAPER→MICRO_LIVE→LIVE ladder yourself from the ReefClaw dashboard (the agent cannot make that change; it is refused without operator provenance). Your exchange API keys stay on your machine to sign requests to the exchange and are NEVER sent to ReefClaw — a test in the package asserts this. What does reach ReefClaw is trading telemetry for the dashboard (positions, fills, decision journal). Live trading always carries exchange-native protective stops. Trading instructions can be updated remotely, and every update must carry a valid Ed25519 signature verified against a key pinned in this build before it is applied. Install from ClawHub on OpenClaw 2026.8.1+ (Control UI Plugins > Discover, or /plugins install clawhub:@reefclaw/openclaw-plugin then the same with --accept-capabilities after reviewing the listed capabilities), or with the ReefClaw connect installer (@reefclaw/connect on npm, pinned to the exact release named in the bundled skill). It runs on gateway startup, supervises a local connector process, and writes only under ~/.reefclaw and OpenClaw's own skill, config and cron locations; the README lists every path it writes and everything it sends. It never changes the gateway's auth settings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
package/release-integrity.json
CHANGED
|
@@ -8,5 +8,10 @@
|
|
|
8
8
|
"index.js": "03b9e7ea593dfd8b8cc372603967f2be3bf87b05835dc32b1147cc3579e28cd7",
|
|
9
9
|
"tools/create-order.js": "b0244ff69cb5b4a44e18c7ceaf91669ee19649d0e6b18bb857aa47ca80f63b2a",
|
|
10
10
|
"risk/pre-trade-check.js": "15ba2c91e7a1f5ea03a2452eda40d489eda406a434e3bc3e9b7e024190f6a22f"
|
|
11
|
+
},
|
|
12
|
+
"0.1.41": {
|
|
13
|
+
"index.js": "163bb536a4600a10bcc0c6af239982a332b510d93f0a8d54214e91a62c74f8ef",
|
|
14
|
+
"tools/create-order.js": "b0244ff69cb5b4a44e18c7ceaf91669ee19649d0e6b18bb857aa47ca80f63b2a",
|
|
15
|
+
"risk/pre-trade-check.js": "15ba2c91e7a1f5ea03a2452eda40d489eda406a434e3bc3e9b7e024190f6a22f"
|
|
11
16
|
}
|
|
12
17
|
}
|
package/release-notes.json
CHANGED
|
@@ -12,5 +12,6 @@
|
|
|
12
12
|
"0.1.38": "Fixes the restart that 0.1.37 introduced for Docker and other unmanaged gateways: the connector now asks for OpenClaw's update restart, the one kind that replaces the running process so the new files actually load (the previous kind restarted in place and kept the old code while reporting success). The installer no longer claims a self-restart it cannot verify; the connector or the dashboard's Restart now button performs it, waiting for an in-progress agent run to finish first.",
|
|
13
13
|
"0.1.39": "wave9: a refusal by the plugin's own risk gate no longer burns the whole trading day (the authorization is released and a fresh one can be requested inside the window; a wrong-side stop still latches). wave9 evidence: the previous day's funding settlement stamped a few milliseconds late no longer makes the whole night's evidence read as incomplete. Model health: the model note OpenClaw 2026.9 writes at the start of every session no longer counts as a model switch, so the model dot can be green. Readiness: the plugin now reports whether its own files match the release (an install-location class, the process start time and fingerprints of three of its own files; never a path, never file contents; switch RC_READINESS_INTEGRITY=off), so a stale or modified install can be told apart from the release without touching the box.",
|
|
14
14
|
"0.1.40": "One-click updates now work on boxes without a gateway terminal (OpenClaw older than 2026.7, terminal disabled) and inside Docker: the connector runs the installer itself in a files-only mode that never touches the OpenClaw CLI or config, then asks the gateway to restart itself. The installer gains --files-only for the same purpose.",
|
|
15
|
-
"0.1.41": "Fixes the dashboard link dropping and reconnecting (seen as a connect/disconnect loop): when the agent or anyone ran an openclaw command, that command started a second copy of the trading plugin and its connector, which knocked the real one off the relay. The trading runtime now starts only inside the OpenClaw gateway, once per process (also covers OpenClaw 2026.9.5+ loading the plugin twice); openclaw commands see the tool names but nothing runs there. Paper venue switch: Binance <-> Hyperliquid can now be switched from the dashboard in paper mode without exchange keys (refused while live). Stop watcher: right after a restart, a position waiting for its first price is reported as warming up instead of as an unenforceable stop; an alarm still fires if the price never arrives. Readiness: OpenClaw 2026.9.6's plugin run copy is reported as its own install location."
|
|
15
|
+
"0.1.41": "Fixes the dashboard link dropping and reconnecting (seen as a connect/disconnect loop): when the agent or anyone ran an openclaw command, that command started a second copy of the trading plugin and its connector, which knocked the real one off the relay. The trading runtime now starts only inside the OpenClaw gateway, once per process (also covers OpenClaw 2026.9.5+ loading the plugin twice); openclaw commands see the tool names but nothing runs there. Paper venue switch: Binance <-> Hyperliquid can now be switched from the dashboard in paper mode without exchange keys (refused while live). Stop watcher: right after a restart, a position waiting for its first price is reported as warming up instead of as an unenforceable stop; an alarm still fires if the price never arrives. Readiness: OpenClaw 2026.9.6's plugin run copy is reported as its own install location.",
|
|
16
|
+
"0.1.42": "Fixes a problem in 0.1.41 on OpenClaw 2026.9.6: the agent's own tool calls (heartbeats and chat) were answered with \"not available in this process\" instead of running, so the agent could not trade or move stops. The agent now always gets the live tools. On older OpenClaw the same thing could affect the first heartbeat after a restart; that is fixed too."
|
|
16
17
|
}
|
package/skills/reefclaw/SKILL.md
CHANGED
|
@@ -101,7 +101,7 @@ When a user gives you this message (or just a bare `Here's my ReefClaw token: rc
|
|
|
101
101
|
If the ReefClaw trading tools are not present yet, the **user** installs them by running this once, in a terminal on the machine running OpenClaw (inside the container, if OpenClaw runs in Docker):
|
|
102
102
|
|
|
103
103
|
```
|
|
104
|
-
npx --yes @reefclaw/connect@0.1.
|
|
104
|
+
npx --yes @reefclaw/connect@0.1.55
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
That is the whole install. It places the plugin, sets up the connector, restarts the gateway where it can, and prints what it changed. If its closing lines say **GATEWAY NOT RESTARTED**, the plugin is on disk but not running yet: restarting is the user's step (in Docker, `docker restart <container>` from the host; otherwise restarting OpenClaw). Tell the user exactly that and stop — do not restart, signal or kill any process, do not run docker or service commands, and do not edit the gateway config, even if you could. The plugin reports its own version to ReefClaw after the restart; never post readiness, version or health reports yourself. The version is pinned on purpose: the line names the exact connector release this plugin was published with, so what runs on the machine is reviewable and never "whatever the registry serves today". It needs no ReefClaw token — the connection is the separate paste step above, and the connector picks it up on its own.
|