@reefclaw/openclaw-plugin 0.1.50 → 0.1.53
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/README.md +6 -2
- package/bridge/config.js +10 -3
- package/bridge/gateway/heartbeat-cron.d.ts +96 -2
- package/bridge/gateway/heartbeat-cron.js +274 -16
- package/bridge/gateway/tool-discovery.d.ts +1 -1
- package/bridge/gateway/tool-discovery.js +4 -0
- package/bridge/heartbeat-runs.d.ts +24 -0
- package/bridge/heartbeat-runs.js +106 -5
- package/bridge/heartbeat-transcript.d.ts +18 -1
- package/bridge/heartbeat-transcript.js +103 -19
- package/bridge/index.js +2 -2
- package/bridge/providers/emergency-commands.d.ts +26 -1
- package/bridge/providers/emergency-commands.js +74 -4
- package/bridge/providers/gateway.d.ts +27 -0
- package/bridge/providers/gateway.js +155 -14
- package/bridge/setup.js +6 -3
- package/bridge/types.d.ts +12 -0
- package/bridge/utils/relay-host.d.ts +16 -0
- package/bridge/utils/relay-host.js +30 -1
- package/config/late-wiring.d.ts +37 -0
- package/config/late-wiring.js +111 -0
- package/config/operator-halt.d.ts +60 -0
- package/config/operator-halt.js +160 -0
- package/config/plugin-config-io.d.ts +7 -0
- package/config/tool-gate.js +3 -0
- package/index.js +255 -45
- package/openclaw.plugin.json +8 -2
- package/package.json +1 -1
- package/release-integrity.json +15 -0
- package/release-notes.json +4 -1
- package/skills/reefclaw/SKILL.md +1 -1
- package/strategy/builtin-strategies.js +2 -2
- package/tools/get-market-intel.js +2 -1
- package/tools/get-risk-summary.d.ts +5 -0
- package/tools/get-risk-summary.js +5 -0
- package/tools/intel-api.d.ts +10 -0
- package/tools/intel-api.js +13 -1
- package/tools/score-setup.js +4 -2
package/tools/intel-api.js
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
// All intelligence tools use Bearer token auth against intel.reefclaw.com.
|
|
3
3
|
import { keepAliveFetch } from '../http/keepalive-fetch.js';
|
|
4
4
|
import { HL_INTEL_PREFIX, fromIntelSymbol, toIntelSymbol } from '../venues/symbols.js';
|
|
5
|
+
/** Returned by every token-gated tool while this plugin has no connection.
|
|
6
|
+
* Written for the AGENT: it says what to do, and that no restart is needed
|
|
7
|
+
* (config/late-wiring.ts picks the connection up live). The first sentence is
|
|
8
|
+
* a stable prefix — fleet monitoring matches on it; do not reword it. The
|
|
9
|
+
* old text ("requires a reefclaw.com account") was false for an onboarded
|
|
10
|
+
* user whose plugin simply started before the connection was saved, and gave
|
|
11
|
+
* the agent nothing to act on. */
|
|
12
|
+
export const NO_CONNECTION_TOKEN_ERROR = 'No ReefClaw connection token configured. This plugin has not found a saved connection yet. ' +
|
|
13
|
+
'Save the connection from reefclaw.com/onboarding (token, userId, relayUrl) under ' +
|
|
14
|
+
'skills.entries.reefclaw.config in ~/.openclaw/openclaw.json — these tools normally pick it up ' +
|
|
15
|
+
'within a minute, no restart needed. If it is already saved there and this error is still ' +
|
|
16
|
+
'returned after two minutes, tell your operator: the OpenClaw gateway process needs a full restart.';
|
|
5
17
|
// ─── Venue-aware intel-symbol mapping (plan §5.3: the agent keeps using
|
|
6
18
|
// canonical symbols like BTC/USDC; these helpers translate at the intel
|
|
7
19
|
// boundary). All three FAIL OPEN — unmappable input passes through
|
|
@@ -80,7 +92,7 @@ export const enc = encodeURIComponent;
|
|
|
80
92
|
export async function fetchIntelApi(path, deps, options) {
|
|
81
93
|
const { connectionToken, intelligenceUrl } = deps;
|
|
82
94
|
if (!connectionToken) {
|
|
83
|
-
return { error:
|
|
95
|
+
return { error: NO_CONNECTION_TOKEN_ERROR };
|
|
84
96
|
}
|
|
85
97
|
if (!intelligenceUrl) {
|
|
86
98
|
return { error: 'No intelligence URL configured. Set intelligenceUrl in openclaw.json plugin config.' };
|
package/tools/score-setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Tool: score_setup — Pre-trade setup scorecard.
|
|
2
2
|
// Consolidates regime, feedback, and flow data into a single scored verdict.
|
|
3
3
|
// Forces the agent to only trade high-quality setups.
|
|
4
|
-
import { fetchIntelApi, enc } from './intel-api.js';
|
|
4
|
+
import { fetchIntelApi, enc, resolveIntelSymbol } from './intel-api.js';
|
|
5
5
|
import { getTradingParams } from '../trading-params-cache.js';
|
|
6
6
|
export async function scoreSetupTool(args, deps) {
|
|
7
7
|
const { symbol, direction, setup_type, entry_price, stop_price, target_price } = args;
|
|
@@ -13,7 +13,9 @@ export async function scoreSetupTool(args, deps) {
|
|
|
13
13
|
return { error: 'For SHORT: stop_price must be above entry_price' };
|
|
14
14
|
}
|
|
15
15
|
// Fetch all intelligence data + trading params in parallel
|
|
16
|
-
|
|
16
|
+
// The venue pair an agent passes (BTC/USDC on Hyperliquid) must reach intel
|
|
17
|
+
// in its own spelling (HL_BTC), or every intel dimension falls back to 5.
|
|
18
|
+
const s = enc(resolveIntelSymbol(deps, symbol));
|
|
17
19
|
const [regimeData, feedbackData, flowData, tp] = await Promise.all([
|
|
18
20
|
fetchIntelApi(`/api/regime/${s}`, deps),
|
|
19
21
|
fetchIntelApi(`/api/analytics/${s}/feedback`, deps),
|