@senpi/runtime 3.0.173 → 3.0.181
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/dist/actions/close-position/close-position.action.d.ts.map +1 -1
- package/dist/actions/close-position/close-position.action.js +48 -3
- package/dist/actions/close-position/close-position.action.js.map +1 -1
- package/dist/actions/llm-decision/openclaw-llm-decision.d.ts +8 -0
- package/dist/actions/llm-decision/openclaw-llm-decision.d.ts.map +1 -1
- package/dist/actions/llm-decision/openclaw-llm-decision.js +56 -1
- package/dist/actions/llm-decision/openclaw-llm-decision.js.map +1 -1
- package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
- package/dist/actions/open-position/open-position.action.js +42 -6
- package/dist/actions/open-position/open-position.action.js.map +1 -1
- package/dist/actions/open-position/resolve-margin.d.ts +1 -1
- package/dist/actions/open-position/resolve-margin.d.ts.map +1 -1
- package/dist/actions/open-position/resolve-margin.js +7 -0
- package/dist/actions/open-position/resolve-margin.js.map +1 -1
- package/dist/approvals/approval-store.d.ts +37 -7
- package/dist/approvals/approval-store.d.ts.map +1 -1
- package/dist/approvals/approval-store.js +127 -23
- package/dist/approvals/approval-store.js.map +1 -1
- package/dist/approvals/manifest.d.ts.map +1 -1
- package/dist/approvals/manifest.js +0 -5
- package/dist/approvals/manifest.js.map +1 -1
- package/dist/approvals/telemetry.d.ts +27 -3
- package/dist/approvals/telemetry.d.ts.map +1 -1
- package/dist/approvals/telemetry.js +8 -4
- package/dist/approvals/telemetry.js.map +1 -1
- package/dist/approvals/tool-approval-gate.d.ts +79 -0
- package/dist/approvals/tool-approval-gate.d.ts.map +1 -1
- package/dist/approvals/tool-approval-gate.js +184 -21
- package/dist/approvals/tool-approval-gate.js.map +1 -1
- package/dist/approvals/tool-approvals-manifest.json +0 -2
- package/dist/approvals/turn-context.d.ts +271 -0
- package/dist/approvals/turn-context.d.ts.map +1 -0
- package/dist/approvals/turn-context.js +551 -0
- package/dist/approvals/turn-context.js.map +1 -0
- package/dist/cli/guide-commands.d.ts.map +1 -1
- package/dist/cli/guide-commands.js +43 -8
- package/dist/cli/guide-commands.js.map +1 -1
- package/dist/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +91 -12
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/constants/dsl/index.d.ts +2 -0
- package/dist/constants/dsl/index.d.ts.map +1 -1
- package/dist/constants/dsl/index.js +2 -0
- package/dist/constants/dsl/index.js.map +1 -1
- package/dist/constants/order-types.d.ts.map +1 -1
- package/dist/constants/order-types.js +4 -1
- package/dist/constants/order-types.js.map +1 -1
- package/dist/deploy/job.d.ts +32 -0
- package/dist/deploy/job.d.ts.map +1 -1
- package/dist/deploy/job.js +72 -7
- package/dist/deploy/job.js.map +1 -1
- package/dist/deploy/messages.d.ts +15 -1
- package/dist/deploy/messages.d.ts.map +1 -1
- package/dist/deploy/messages.js +78 -0
- package/dist/deploy/messages.js.map +1 -1
- package/dist/deploy/orchestrator.d.ts +11 -1
- package/dist/deploy/orchestrator.d.ts.map +1 -1
- package/dist/deploy/orchestrator.js +111 -15
- package/dist/deploy/orchestrator.js.map +1 -1
- package/dist/deploy/register.d.ts +18 -0
- package/dist/deploy/register.d.ts.map +1 -1
- package/dist/deploy/register.js +93 -2
- package/dist/deploy/register.js.map +1 -1
- package/dist/dsl/engine/exchange-stop.d.ts +21 -1
- package/dist/dsl/engine/exchange-stop.d.ts.map +1 -1
- package/dist/dsl/engine/exchange-stop.js +27 -1
- package/dist/dsl/engine/exchange-stop.js.map +1 -1
- package/dist/dsl/engine/floors.d.ts +2 -1
- package/dist/dsl/engine/floors.d.ts.map +1 -1
- package/dist/dsl/engine/floors.js +2 -1
- package/dist/dsl/engine/floors.js.map +1 -1
- package/dist/dsl/engine/index.d.ts +1 -1
- package/dist/dsl/engine/index.d.ts.map +1 -1
- package/dist/dsl/engine/index.js +1 -1
- package/dist/dsl/engine/index.js.map +1 -1
- package/dist/dsl/engine/tick.d.ts.map +1 -1
- package/dist/dsl/engine/tick.js +4 -3
- package/dist/dsl/engine/tick.js.map +1 -1
- package/dist/dsl/events/handlers.d.ts +7 -3
- package/dist/dsl/events/handlers.d.ts.map +1 -1
- package/dist/dsl/events/handlers.js +10 -4
- package/dist/dsl/events/handlers.js.map +1 -1
- package/dist/dsl/events/initial-state.d.ts.map +1 -1
- package/dist/dsl/events/initial-state.js +2 -0
- package/dist/dsl/events/initial-state.js.map +1 -1
- package/dist/dsl/monitor/exchange-sync.d.ts +1 -0
- package/dist/dsl/monitor/exchange-sync.d.ts.map +1 -1
- package/dist/dsl/monitor/exchange-sync.js +7 -14
- package/dist/dsl/monitor/exchange-sync.js.map +1 -1
- package/dist/dsl/monitor/process-one-position.d.ts.map +1 -1
- package/dist/dsl/monitor/process-one-position.js +108 -17
- package/dist/dsl/monitor/process-one-position.js.map +1 -1
- package/dist/dsl/notifications/formatter.d.ts +2 -1
- package/dist/dsl/notifications/formatter.d.ts.map +1 -1
- package/dist/dsl/notifications/formatter.js +18 -1
- package/dist/dsl/notifications/formatter.js.map +1 -1
- package/dist/health/types.d.ts +6 -1
- package/dist/health/types.d.ts.map +1 -1
- package/dist/health/types.js.map +1 -1
- package/dist/host/openclaw-host.d.ts +138 -0
- package/dist/host/openclaw-host.d.ts.map +1 -0
- package/dist/host/openclaw-host.js +177 -0
- package/dist/host/openclaw-host.js.map +1 -0
- package/dist/index.d.ts +46 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +318 -38
- package/dist/index.js.map +1 -1
- package/dist/leverage/max-leverage-cache.d.ts +25 -0
- package/dist/leverage/max-leverage-cache.d.ts.map +1 -1
- package/dist/leverage/max-leverage-cache.js +77 -0
- package/dist/leverage/max-leverage-cache.js.map +1 -1
- package/dist/runtime/auto-update/coordinator.d.ts +203 -0
- package/dist/runtime/auto-update/coordinator.d.ts.map +1 -1
- package/dist/runtime/auto-update/coordinator.js +621 -12
- package/dist/runtime/auto-update/coordinator.js.map +1 -1
- package/dist/runtime/auto-update/gateway-restart.d.ts +60 -1
- package/dist/runtime/auto-update/gateway-restart.d.ts.map +1 -1
- package/dist/runtime/auto-update/gateway-restart.js +95 -21
- package/dist/runtime/auto-update/gateway-restart.js.map +1 -1
- package/dist/runtime/auto-update/idle-gate.d.ts +139 -0
- package/dist/runtime/auto-update/idle-gate.d.ts.map +1 -0
- package/dist/runtime/auto-update/idle-gate.js +217 -0
- package/dist/runtime/auto-update/idle-gate.js.map +1 -0
- package/dist/runtime/auto-update/install-results.d.ts +130 -0
- package/dist/runtime/auto-update/install-results.d.ts.map +1 -0
- package/dist/runtime/auto-update/install-results.js +264 -0
- package/dist/runtime/auto-update/install-results.js.map +1 -0
- package/dist/runtime/auto-update/money-call-tracker.d.ts +36 -0
- package/dist/runtime/auto-update/money-call-tracker.d.ts.map +1 -0
- package/dist/runtime/auto-update/money-call-tracker.js +129 -0
- package/dist/runtime/auto-update/money-call-tracker.js.map +1 -0
- package/dist/runtime/auto-update/register-idle-gate.d.ts +70 -0
- package/dist/runtime/auto-update/register-idle-gate.d.ts.map +1 -0
- package/dist/runtime/auto-update/register-idle-gate.js +123 -0
- package/dist/runtime/auto-update/register-idle-gate.js.map +1 -0
- package/dist/runtime/auto-update/run-update-command.d.ts +13 -0
- package/dist/runtime/auto-update/run-update-command.d.ts.map +1 -1
- package/dist/runtime/auto-update/run-update-command.js +18 -0
- package/dist/runtime/auto-update/run-update-command.js.map +1 -1
- package/dist/runtime/auto-update/state-store.d.ts +14 -1
- package/dist/runtime/auto-update/state-store.d.ts.map +1 -1
- package/dist/runtime/auto-update/state-store.js +37 -3
- package/dist/runtime/auto-update/state-store.js.map +1 -1
- package/dist/runtime/auto-update/types.d.ts +51 -0
- package/dist/runtime/auto-update/types.d.ts.map +1 -1
- package/dist/runtime/auto-update/types.js.map +1 -1
- package/dist/runtime/auto-update/update-marker.d.ts +95 -0
- package/dist/runtime/auto-update/update-marker.d.ts.map +1 -0
- package/dist/runtime/auto-update/update-marker.js +185 -0
- package/dist/runtime/auto-update/update-marker.js.map +1 -0
- package/dist/runtime/auto-update/update-schedule.d.ts +57 -0
- package/dist/runtime/auto-update/update-schedule.d.ts.map +1 -0
- package/dist/runtime/auto-update/update-schedule.js +75 -0
- package/dist/runtime/auto-update/update-schedule.js.map +1 -0
- package/dist/runtime/create-scanner-module.d.ts +1 -1
- package/dist/runtime/create-scanner-module.d.ts.map +1 -1
- package/dist/runtime/create-scanner-module.js +2 -1
- package/dist/runtime/create-scanner-module.js.map +1 -1
- package/dist/runtime/decision-errors.d.ts +7 -0
- package/dist/runtime/decision-errors.d.ts.map +1 -1
- package/dist/runtime/decision-errors.js +15 -0
- package/dist/runtime/decision-errors.js.map +1 -1
- package/dist/runtime/lifecycle-events.d.ts +1 -1
- package/dist/runtime/lifecycle-events.d.ts.map +1 -1
- package/dist/runtime/lifecycle-events.js +10 -1
- package/dist/runtime/lifecycle-events.js.map +1 -1
- package/dist/runtime/runtime-descriptor.d.ts +11 -2
- package/dist/runtime/runtime-descriptor.d.ts.map +1 -1
- package/dist/runtime/runtime-descriptor.js +11 -2
- package/dist/runtime/runtime-descriptor.js.map +1 -1
- package/dist/runtime/runtime.d.ts.map +1 -1
- package/dist/runtime/runtime.js +4 -3
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/strategy-lifecycle.js +1 -1
- package/dist/runtime/strategy-lifecycle.js.map +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.js +1 -1
- package/dist/runtime/supervisor/long-running-supervisor.js.map +1 -1
- package/dist/runtime-api/intake/acceptance-record.d.ts +17 -3
- package/dist/runtime-api/intake/acceptance-record.d.ts.map +1 -1
- package/dist/runtime-api/intake/acceptance-record.js +57 -32
- package/dist/runtime-api/intake/acceptance-record.js.map +1 -1
- package/dist/runtime-api/intake/intake-events.d.ts +6 -5
- package/dist/runtime-api/intake/intake-events.d.ts.map +1 -1
- package/dist/runtime-api/intake/intake-events.js +9 -3
- package/dist/runtime-api/intake/intake-events.js.map +1 -1
- package/dist/runtime-api/intake/process-signal-post.d.ts +1 -1
- package/dist/runtime-api/intake/process-signal-post.d.ts.map +1 -1
- package/dist/runtime-api/intake/process-signal-post.js +34 -31
- package/dist/runtime-api/intake/process-signal-post.js.map +1 -1
- package/dist/runtime-api/intake/scaffold-error-router.d.ts +8 -0
- package/dist/runtime-api/intake/scaffold-error-router.d.ts.map +1 -1
- package/dist/runtime-api/intake/scaffold-error-router.js +9 -0
- package/dist/runtime-api/intake/scaffold-error-router.js.map +1 -1
- package/dist/runtime-api/intake/types.d.ts +9 -0
- package/dist/runtime-api/intake/types.d.ts.map +1 -1
- package/dist/runtime-api/intake/types.js +5 -1
- package/dist/runtime-api/intake/types.js.map +1 -1
- package/dist/runtime-api/routes/signals.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.js +25 -1
- package/dist/runtime-api/routes/signals.js.map +1 -1
- package/dist/runtime-api/routes/signals.schema.d.ts +2 -0
- package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
- package/dist/runtime-api/routes/signals.schema.js +4 -0
- package/dist/runtime-api/routes/signals.schema.js.map +1 -1
- package/dist/scanners/engine/data-providers.d.ts +6 -0
- package/dist/scanners/engine/data-providers.d.ts.map +1 -1
- package/dist/scanners/engine/data-providers.js.map +1 -1
- package/dist/scanners/engine/engine.d.ts +9 -0
- package/dist/scanners/engine/engine.d.ts.map +1 -1
- package/dist/scanners/engine/engine.js +29 -6
- package/dist/scanners/engine/engine.js.map +1 -1
- package/dist/scanners/external/scaffold/ctx.py +55 -1
- package/dist/scanners/external/scaffold/delivery.py +92 -28
- package/dist/scanners/external/scaffold/preflight.py +1 -1
- package/dist/scanners/external/scaffold/scaffold.py +75 -2
- package/dist/scanners/runtime-module.d.ts +2 -0
- package/dist/scanners/runtime-module.d.ts.map +1 -1
- package/dist/scanners/runtime-module.js +14 -0
- package/dist/scanners/runtime-module.js.map +1 -1
- package/dist/senpi/client.d.ts +36 -1
- package/dist/senpi/client.d.ts.map +1 -1
- package/dist/senpi/client.js +100 -8
- package/dist/senpi/client.js.map +1 -1
- package/dist/senpi/types.d.ts +54 -2
- package/dist/senpi/types.d.ts.map +1 -1
- package/dist/telemetry/metrics.d.ts +15 -1
- package/dist/telemetry/metrics.d.ts.map +1 -1
- package/dist/telemetry/metrics.js +25 -1
- package/dist/telemetry/metrics.js.map +1 -1
- package/dist/telemetry/otel-sdk.d.ts +12 -0
- package/dist/telemetry/otel-sdk.d.ts.map +1 -1
- package/dist/telemetry/otel-sdk.js +47 -1
- package/dist/telemetry/otel-sdk.js.map +1 -1
- package/dist/telemetry/spans/span-hooks.d.ts +18 -1
- package/dist/telemetry/spans/span-hooks.d.ts.map +1 -1
- package/dist/telemetry/spans/span-hooks.js +306 -96
- package/dist/telemetry/spans/span-hooks.js.map +1 -1
- package/dist/telemetry/tool-plane.d.ts +2 -0
- package/dist/telemetry/tool-plane.d.ts.map +1 -1
- package/dist/telemetry/tool-plane.js +1 -0
- package/dist/telemetry/tool-plane.js.map +1 -1
- package/dist/tool-surface/crib-cache.d.ts +21 -0
- package/dist/tool-surface/crib-cache.d.ts.map +1 -0
- package/dist/tool-surface/crib-cache.js +54 -0
- package/dist/tool-surface/crib-cache.js.map +1 -0
- package/dist/tool-surface/crib-hook.d.ts +78 -0
- package/dist/tool-surface/crib-hook.d.ts.map +1 -0
- package/dist/tool-surface/crib-hook.js +217 -0
- package/dist/tool-surface/crib-hook.js.map +1 -0
- package/dist/tool-surface/crib-sheet.d.ts +56 -0
- package/dist/tool-surface/crib-sheet.d.ts.map +1 -0
- package/dist/tool-surface/crib-sheet.js +129 -0
- package/dist/tool-surface/crib-sheet.js.map +1 -0
- package/dist/tool-surface/mcp-tool-source.d.ts +64 -0
- package/dist/tool-surface/mcp-tool-source.d.ts.map +1 -0
- package/dist/tool-surface/mcp-tool-source.js +189 -0
- package/dist/tool-surface/mcp-tool-source.js.map +1 -0
- package/dist/types/dsl/index.d.ts +4 -0
- package/dist/types/dsl/index.d.ts.map +1 -1
- package/dist/utils/event-catalog.d.ts +141 -10
- package/dist/utils/event-catalog.d.ts.map +1 -1
- package/dist/utils/event-catalog.js +23 -1
- package/dist/utils/event-catalog.js.map +1 -1
- package/dist/utils/perp-coin.d.ts.map +1 -1
- package/dist/utils/perp-coin.js +2 -1
- package/dist/utils/perp-coin.js.map +1 -1
- package/dist/utils/resolve-order-type.d.ts.map +1 -1
- package/dist/utils/resolve-order-type.js +5 -1
- package/dist/utils/resolve-order-type.js.map +1 -1
- package/dist/validate/codes.d.ts +2 -0
- package/dist/validate/codes.d.ts.map +1 -1
- package/dist/validate/codes.js +6 -0
- package/dist/validate/codes.js.map +1 -1
- package/dist/validate/index.d.ts +1 -1
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +1 -1
- package/dist/validate/index.js.map +1 -1
- package/dist/validate/recipe-checks.d.ts +7 -0
- package/dist/validate/recipe-checks.d.ts.map +1 -1
- package/dist/validate/recipe-checks.js +18 -0
- package/dist/validate/recipe-checks.js.map +1 -1
- package/dist/validate/recipe.d.ts.map +1 -1
- package/dist/validate/recipe.js +2 -1
- package/dist/validate/recipe.js.map +1 -1
- package/dist/widgets/tool.d.ts +9 -0
- package/dist/widgets/tool.d.ts.map +1 -1
- package/dist/widgets/tool.js +1 -0
- package/dist/widgets/tool.js.map +1 -1
- package/examples/strategies/README.md +2 -1
- package/examples/strategies/iguana/README.md +3 -3
- package/examples/strategies/raptor/README.md +3 -3
- package/openclaw.plugin.json +11 -1
- package/package.json +5 -2
|
@@ -25,11 +25,14 @@ Quick commands:
|
|
|
25
25
|
senpi guide actions Action types and decision modes
|
|
26
26
|
senpi guide dsl DSL exit: phases, lock modes, tiers, time-based cuts
|
|
27
27
|
senpi validate <pkg> Prove a strategy runs before funding it (static → import → live)
|
|
28
|
+
Testing a strategy? validate IS the shadow run (one real tick, no wallet); then run it LIVE at the
|
|
29
|
+
$10 floor. There is no paper-trading mode, and never an agent-turn cron to
|
|
30
|
+
watch it: every cron firing is a model call, the runtime watches for free.
|
|
28
31
|
senpi deploy -p <pkg> Take a proven package live: create+fund → install → observe it running
|
|
29
32
|
senpi update <pkg> Change a LIVE strategy's recipe in place — plans by default, --apply commits
|
|
30
33
|
senpi quant run <addr> The quant desk on any Hyperliquid wallet — score, leaks, next steps (read-only)
|
|
31
34
|
senpi guide quant Quant desk verbs, run ids, exit and refusal codes
|
|
32
|
-
senpi scanner Per-scanner health: runs, errors, liveness, "(no signals yet)" flag
|
|
35
|
+
senpi scanner Per-scanner health: runs (interval), errors, signals, liveness, "(no signals yet)" flag
|
|
33
36
|
senpi events Local domain-event log — the trade narrative
|
|
34
37
|
senpi explain <asset> Stitch one asset's position lifecycle from the event log
|
|
35
38
|
senpi dsl positions Active DSL positions (CLI inspection)
|
|
@@ -171,6 +174,9 @@ external_scanner (v2 supervised)
|
|
|
171
174
|
marginPct / leverage ride at the TOP LEVEL of the signal dict — the runtime
|
|
172
175
|
reads them directly. Omit them to size/lever from the recipe config.
|
|
173
176
|
|
|
177
|
+
Tick summary: ctx.set_summary(text) sets one line about the tick. Older
|
|
178
|
+
runtimes lack it: get it with getattr(ctx, "set_summary", None) first.
|
|
179
|
+
|
|
174
180
|
Prompt/context access stays namespaced:
|
|
175
181
|
{{signal_<scanner_name>}}
|
|
176
182
|
`.trim();
|
|
@@ -265,6 +271,8 @@ Phase 1 — Fixed floor + high-water trailing
|
|
|
265
271
|
retrace_threshold: 10 # ROE % retrace from HWM in phase 1 (required when enabled)
|
|
266
272
|
consecutive_breaches_required: 3 # ticks below floor before exit, both phases (required when enabled)
|
|
267
273
|
# Exchange SL in Phase 1: max_loss absolute floor only; tighter engine floors use closePosition.
|
|
274
|
+
# A LONG floor of exactly 0 (1× with max_loss_pct 100) places no exchange stop;
|
|
275
|
+
# the runtime still closes on its floor, with a MARKET order.
|
|
268
276
|
|
|
269
277
|
──────────────────────────────────────────────────────────────────────────────
|
|
270
278
|
Phase 2 — Tier floors (no per-tier breaches or retrace YAML)
|
|
@@ -272,7 +280,8 @@ Phase 2 — Tier floors (no per-tier breaches or retrace YAML)
|
|
|
272
280
|
the full effective floor (editPosition on tier/phase and moves), and that stop is
|
|
273
281
|
normally what exits. When price breaches the floor for consecutive_breaches_required
|
|
274
282
|
consecutive ticks AND no exchange stop is resting at or beyond the floor (it was
|
|
275
|
-
never placed,
|
|
283
|
+
never placed, the venue rejected it, or the venue reports it still triggered on
|
|
284
|
+
consecutive ticks), the runtime closes with dsl_breach itself —
|
|
276
285
|
including for backend-owned positions, since dsl-engine cannot close a position.
|
|
277
286
|
|
|
278
287
|
phase2:
|
|
@@ -561,6 +570,14 @@ senpi deploy — Take a strategy package live, end to end (the strategy lifecycl
|
|
|
561
570
|
sharing one runtime directory are refused outright
|
|
562
571
|
([INVALID_REQUEST]): a proof lives beside its recipe, one
|
|
563
572
|
file per directory, so it cannot speak for both.
|
|
573
|
+
Every new wallet is one strategy: when the user's strategy
|
|
574
|
+
limits leave fewer running slots or new-strategy starts than
|
|
575
|
+
the wallets this run creates, the WHOLE package is refused
|
|
576
|
+
[STRATEGY_LIMIT_PREFLIGHT] before any create — never half
|
|
577
|
+
deployed. Quote its lines; the way forward is closing a
|
|
578
|
+
running strategy (running limit) or waiting for the reset /
|
|
579
|
+
upgrading (starts limit). An unreadable limits read does
|
|
580
|
+
not stop the deploy.
|
|
564
581
|
Budget is two-tier: BELOW the $10/wallet floor it refuses
|
|
565
582
|
[E_FUNDS_BELOW_FLOOR]; and when the split leaves a wallet
|
|
566
583
|
under its OWN sizing it DEPLOYS and warns
|
|
@@ -705,7 +722,8 @@ senpi status — Lightweight runtime health digest
|
|
|
705
722
|
Scanner health is fail-closed: a push-driven scanner
|
|
706
723
|
never proven by a recent tick reads "unknown", not
|
|
707
724
|
"healthy". Each non-healthy scanner gets its own line
|
|
708
|
-
with restart count + crash-loop cause
|
|
725
|
+
with restart count + reason (crash-loop cause or
|
|
726
|
+
last tick error); when scanners
|
|
709
727
|
never wired the summary reads "running — NO ENTRY
|
|
710
728
|
SCANNERS (<phase> failed; see events)"
|
|
711
729
|
-r, --runtime <id> Filter by runtime ID
|
|
@@ -723,9 +741,23 @@ senpi auto-update — Plugin auto-update (the runtime package's own version chec
|
|
|
723
741
|
(exit 1, UNAVAILABLE) when auto-update is off in
|
|
724
742
|
config or the coordinator is not running. A forced
|
|
725
743
|
check also runs the
|
|
726
|
-
skills-manager tick
|
|
727
|
-
update
|
|
728
|
-
return nothing at all
|
|
744
|
+
skills-manager tick. On OpenClaw 5.x the path that
|
|
745
|
+
installs an update requests a gateway restart, so the
|
|
746
|
+
call may return nothing at all. On 10.x nothing is
|
|
747
|
+
installed in the call: the update waits for this box's
|
|
748
|
+
spread slot and an idle box (no user turn, approval,
|
|
749
|
+
money call or deploy in flight, no user message for
|
|
750
|
+
15 min), then requests a gateway restart, and the box
|
|
751
|
+
installs it as the gateway comes back.
|
|
752
|
+
The snapshot reason says where it is:
|
|
753
|
+
pending-idle:<v> = waiting for the slot or idle (the
|
|
754
|
+
snapshot's pendingBlockers say why; normal, do not
|
|
755
|
+
re-run check-now to push it);
|
|
756
|
+
updated-restart-requested:<v> / awaiting-restart:<v> =
|
|
757
|
+
restart requested, not loaded yet;
|
|
758
|
+
update-not-loaded:<v> = the restart did not load it
|
|
759
|
+
(retried; after 3 tries parked until a newer release:
|
|
760
|
+
report it, do not loop check-now)
|
|
729
761
|
--json Raw JSON output
|
|
730
762
|
|
|
731
763
|
senpi dsl — Inspect DSL exit engine
|
|
@@ -836,7 +868,9 @@ senpi.listRuntimes
|
|
|
836
868
|
other way — deploy installs by content, so source reads "(inline)"), or null when the
|
|
837
869
|
entry is unreadable: { name, group, version, description, hasExit, dslPreset, dsl }.
|
|
838
870
|
dsl is the enforced ladder { hard_stop_roe_pct, arm_at_roe_pct, tiers[], has_phase2 },
|
|
839
|
-
or null when no ladder is running — read a null dsl as unprotected, never as unknown
|
|
871
|
+
or null when no ladder is running — read a null dsl as unprotected, never as unknown.
|
|
872
|
+
hard_stop_roe_pct is always a number on a rendered ladder: the max_loss_pct floor, live
|
|
873
|
+
from entry. phase1.enabled: false turns off the retrace trailing only, not that floor
|
|
840
874
|
|
|
841
875
|
senpi.deleteRuntime
|
|
842
876
|
Params: id (string) OR address (string)
|
|
@@ -851,7 +885,8 @@ senpi.listDslPositions
|
|
|
851
885
|
|
|
852
886
|
senpi.getDslPositionState
|
|
853
887
|
Params: asset (string, required), runtimeId? (string), address? (string)
|
|
854
|
-
Success: { positions: [{ runtimeId, address, state: <full DslState
|
|
888
|
+
Success: { positions: [{ runtimeId, address, state: <full DslState>, exchangeStop }] }
|
|
889
|
+
exchangeStop: "stop" | "none" | "invalid" (derived per response, not stored)
|
|
855
890
|
Errors: INVALID_REQUEST (no asset), NOT_FOUND
|
|
856
891
|
|
|
857
892
|
senpi.listDslArchives
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide-commands.js","sourceRoot":"","sources":["../../src/cli/guide-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,aAAa,GACjB,0EAA0E,CAAC;AAE7E,+EAA+E;AAE/E,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;qBACtB,OAAO
|
|
1
|
+
{"version":3,"file":"guide-commands.js","sourceRoot":"","sources":["../../src/cli/guide-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,aAAa,GACjB,0EAA0E,CAAC;AAE7E,+EAA+E;AAE/E,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;qBACtB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B3B,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AU,GAAG,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,UAAU,CAAsB;SAC5C,WAAW,CAAC,uCAAuC,CAAC;SACpD,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAsB;SAC1C,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,SAAS,CAAsB;SAC3C,WAAW,CAAC,kCAAkC,CAAC;SAC/C,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,OAAO,KAAK,aAAa,IAAI,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"senpi-commands.d.ts","sourceRoot":"","sources":["../../src/cli/senpi-commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"senpi-commands.d.ts","sourceRoot":"","sources":["../../src/cli/senpi-commands.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAsBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAe/D;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE;IAAE,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,gBAAgB,GAAG,OAAO,CAAA;CAAE,GAChF,IAAI,CAy7CN;AAk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AAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GACzE,gBAAgB,CAAC;CACrB"}
|
|
@@ -326,7 +326,15 @@ export function registerSenpiCli(program) {
|
|
|
326
326
|
console.log(`Floor: ${s.floorPrice} | Tier Floor: ${s.tierFloorPrice} | Trailing Floor: ${s.trailingFloor}`);
|
|
327
327
|
console.log(`Current ROE: ${fmtPct(s.currentROE)} | Peak ROE: ${fmtPct(s.peakROE)} | Retrace: ${fmtPct(s.retracePct)}`);
|
|
328
328
|
console.log(`Breaches: ${s.currentBreachCount}/${s.breachesRequired} | Distance to Floor: ${fmtPct(s.distancePct)} | Next tier ROE: ${s.distanceToNextTierPct == null ? "—" : fmtPct(s.distanceToNextTierPct)}`);
|
|
329
|
-
|
|
329
|
+
if (row.exchangeStop === "none") {
|
|
330
|
+
console.log("Exchange SL: none (no stop at 1× with max_loss_pct 100)");
|
|
331
|
+
}
|
|
332
|
+
else if (row.exchangeStop === "invalid") {
|
|
333
|
+
console.log("Exchange SL: invalid (exchange stop not set: entry, leverage or floor cannot produce a stop)");
|
|
334
|
+
}
|
|
335
|
+
else {
|
|
336
|
+
console.log(`Exchange SL: ${s.lastSyncedFloorPrice ?? "—"} (synced ${s.slOrderIdUpdatedAt ?? "—"}) | SL Order: ${s.slOrderId ?? "—"}`);
|
|
337
|
+
}
|
|
330
338
|
console.log(`Ticks: ${s.tickCount} | Elapsed: ${s.elapsedMinutes}m | Created: ${s.createdAt}`);
|
|
331
339
|
if (rows.length > 1)
|
|
332
340
|
console.log("");
|
|
@@ -686,9 +694,21 @@ export function registerSenpiCli(program) {
|
|
|
686
694
|
const payload = (data.payload ?? data);
|
|
687
695
|
const statuses = selectMany(payload.status, payload.statuses ?? []);
|
|
688
696
|
if (opts.json) {
|
|
689
|
-
writeJson({ ok: true, statuses });
|
|
697
|
+
writeJson({ ok: true, statuses, ...(payload.approvals ? { approvals: payload.approvals } : {}) });
|
|
690
698
|
return;
|
|
691
699
|
}
|
|
700
|
+
// A box-level fact, printed whatever the runtimes say: without run
|
|
701
|
+
// classification the approval gate asks in every run (D15). Only a case the
|
|
702
|
+
// box can fix is a warning. On 5.x (`hostLimit`) every run is asked exactly
|
|
703
|
+
// as before this release and nothing on the box changes that, so the human
|
|
704
|
+
// output says nothing; `--json` still carries it.
|
|
705
|
+
if (payload.approvals?.turnClassification === "unavailable" && payload.approvals.hostLimit !== true) {
|
|
706
|
+
// The reason is printed as its own sentence: wrapping it in brackets doubled the ones
|
|
707
|
+
// a reason may carry.
|
|
708
|
+
const reason = payload.approvals.reason?.trim().replace(/[.\s]+$/, "");
|
|
709
|
+
console.log("WARNING trade approvals: this box cannot tell chat turns from scheduled runs, so every run is asked, scheduled ones included." +
|
|
710
|
+
(reason ? ` Reason: ${reason}.` : ""));
|
|
711
|
+
}
|
|
692
712
|
if (statuses.length === 0) {
|
|
693
713
|
console.log("No running runtime health status.");
|
|
694
714
|
return;
|
|
@@ -736,7 +756,7 @@ export function registerSenpiCli(program) {
|
|
|
736
756
|
});
|
|
737
757
|
senpi
|
|
738
758
|
.command("scanner")
|
|
739
|
-
.description("Per-scanner supervisor health: runs, errors, liveness, barren detection")
|
|
759
|
+
.description("Per-scanner supervisor health: runs (interval), errors, signals, liveness, barren detection")
|
|
740
760
|
.option("-r, --runtime <id>", "Filter by runtime id")
|
|
741
761
|
.option("--json", "Print raw JSON from the gateway")
|
|
742
762
|
.action(async (opts) => {
|
|
@@ -1406,8 +1426,10 @@ const DEPLOY_STATUS_STATE_UNKNOWN_HINT = " This says nothing about the deploy it
|
|
|
1406
1426
|
* `openclaw gateway call` collapses two different worlds into one process status: it catches
|
|
1407
1427
|
* everything its RPC throws, prints `Gateway call failed: <error>` to stderr, and exits **1** —
|
|
1408
1428
|
* whether the gateway was never reachable or the gateway answered `respond(false, undefined, error)`
|
|
1409
|
-
* and the client rethrew that answer as a `GatewayClientRequestError`.
|
|
1410
|
-
* read: stdout carries the payload only on success, and the exit code is a constant.
|
|
1429
|
+
* and the client rethrew that answer as a `GatewayClientRequestError`. On 5.x there is no second
|
|
1430
|
+
* signal to read: stdout carries the payload only on success, and the exit code is a constant. (10.x
|
|
1431
|
+
* puts the same failure in a JSON envelope on stdout instead; `readGatewayErrorEnvelope` reads it and
|
|
1432
|
+
* hands its message to this same classifier.)
|
|
1411
1433
|
*
|
|
1412
1434
|
* What DOES separate them is this plugin's own message taxonomy. Every refusal these gateway methods
|
|
1413
1435
|
* produce leads with its bracketed code — `[INVALID_REQUEST]`, `[E_UNIVERSE_NOT_LIVE]`,
|
|
@@ -1429,6 +1451,49 @@ function gatewayAnsweredRefusal(stderr) {
|
|
|
1429
1451
|
}
|
|
1430
1452
|
return false;
|
|
1431
1453
|
}
|
|
1454
|
+
/**
|
|
1455
|
+
* Read the 10.x failure envelope a failed `openclaw gateway call --json` writes to STDOUT.
|
|
1456
|
+
*
|
|
1457
|
+
* The two host lines report a failed call differently. 5.x prints
|
|
1458
|
+
* `Gateway call failed: <ErrorName>: <message>` on stderr and nothing on stdout. 10.x (since its
|
|
1459
|
+
* `--json` mode started preserving structured gateway errors) prints `{"ok":false,"error":{…}}` on
|
|
1460
|
+
* stdout and nothing on stderr, still exiting 1. `error.type` names the failure:
|
|
1461
|
+
* `gateway_request_error` (the gateway ANSWERED `respond(false, …)`; carries `code` and `message`),
|
|
1462
|
+
* `gateway_transport_error`, `gateway_credentials_required`, or `cli_error`. Each has a `message`.
|
|
1463
|
+
*
|
|
1464
|
+
* Returns null for anything else — including the empty stdout of every 5.x failure, which is why no
|
|
1465
|
+
* version gate is needed. The document is normally the whole stdout; if something printed ahead of
|
|
1466
|
+
* it, the parse falls back to the first line that opens an object (the envelope is pretty-printed,
|
|
1467
|
+
* so only its own opening brace sits at column 0).
|
|
1468
|
+
*/
|
|
1469
|
+
function readGatewayErrorEnvelope(stdout) {
|
|
1470
|
+
const text = stdout.trim();
|
|
1471
|
+
if (!text)
|
|
1472
|
+
return null;
|
|
1473
|
+
const candidates = [text];
|
|
1474
|
+
const start = text.search(/^\{/m);
|
|
1475
|
+
if (start > 0)
|
|
1476
|
+
candidates.push(text.slice(start));
|
|
1477
|
+
for (const candidate of candidates) {
|
|
1478
|
+
let parsed;
|
|
1479
|
+
try {
|
|
1480
|
+
parsed = JSON.parse(candidate);
|
|
1481
|
+
}
|
|
1482
|
+
catch {
|
|
1483
|
+
continue;
|
|
1484
|
+
}
|
|
1485
|
+
if (!parsed || typeof parsed !== "object")
|
|
1486
|
+
return null;
|
|
1487
|
+
const doc = parsed;
|
|
1488
|
+
if (doc.ok !== false || !doc.error || typeof doc.error !== "object")
|
|
1489
|
+
return null;
|
|
1490
|
+
const error = doc.error;
|
|
1491
|
+
if (typeof error.message !== "string")
|
|
1492
|
+
return null;
|
|
1493
|
+
return { type: typeof error.type === "string" ? error.type : "", message: error.message };
|
|
1494
|
+
}
|
|
1495
|
+
return null;
|
|
1496
|
+
}
|
|
1432
1497
|
/**
|
|
1433
1498
|
* The answer for a `gateway call` that produced nothing this CLI could read.
|
|
1434
1499
|
*
|
|
@@ -1490,7 +1555,17 @@ function callGatewayJson(method, params, onFailure, opts) {
|
|
|
1490
1555
|
process.stderr.write(stderr.endsWith("\n") ? stderr : `${stderr}\n`);
|
|
1491
1556
|
}
|
|
1492
1557
|
if (result.status !== 0) {
|
|
1493
|
-
|
|
1558
|
+
// 10.x writes the failure as a JSON envelope on stdout instead (see
|
|
1559
|
+
// `readGatewayErrorEnvelope`). Its message is re-emitted on stderr — where the 5.x line puts
|
|
1560
|
+
// it — so both host lines leave the reader the same text, then classified exactly as the 5.x
|
|
1561
|
+
// stderr is. Only a `gateway_request_error` can be a refusal: it is the one type that means the
|
|
1562
|
+
// gateway answered. Every other type (transport, credentials, cli_error) keeps the exit-1 path.
|
|
1563
|
+
const envelope = readGatewayErrorEnvelope(typeof result.stdout === "string" ? result.stdout : "");
|
|
1564
|
+
if (envelope) {
|
|
1565
|
+
process.stderr.write(envelope.message.endsWith("\n") ? envelope.message : `${envelope.message}\n`);
|
|
1566
|
+
}
|
|
1567
|
+
const envelopeRefused = envelope?.type === "gateway_request_error" && gatewayAnsweredRefusal(envelope.message);
|
|
1568
|
+
if (envelopeRefused || gatewayAnsweredRefusal(stderr)) {
|
|
1494
1569
|
// The gateway answered, and it refused. D-12: `2 = refused` — the code agents branch on to
|
|
1495
1570
|
// OBEY rather than retry. Reported as 1 (internal/transport) these read as "try again", and
|
|
1496
1571
|
// a delisted instrument, a package with no DSL exit, or a wallet another package's stamp
|
|
@@ -1551,7 +1626,8 @@ function printHealthStatus(status) {
|
|
|
1551
1626
|
else {
|
|
1552
1627
|
console.log(`Scanners: ${scannerSummary} (enabled ${enabled}/${registered}${degradedSuffix})`);
|
|
1553
1628
|
// One line per non-healthy scanner (healthy/disabled stay unlisted — keep output cheap),
|
|
1554
|
-
// with restart
|
|
1629
|
+
// with the restart count and the row's degradedReason printed as-is: the supervisor's
|
|
1630
|
+
// crash-loop cause or the last tick error.
|
|
1555
1631
|
for (const row of scanners?.scanners ?? []) {
|
|
1556
1632
|
if (row.health === "healthy" || row.health === "disabled")
|
|
1557
1633
|
continue;
|
|
@@ -1560,7 +1636,7 @@ function printHealthStatus(status) {
|
|
|
1560
1636
|
if (restarts > 0)
|
|
1561
1637
|
parts.push(`${restarts} restarts`);
|
|
1562
1638
|
if (row.degradedReason)
|
|
1563
|
-
parts.push(
|
|
1639
|
+
parts.push(row.degradedReason);
|
|
1564
1640
|
const detail = parts.length > 0 ? ` (${parts.join(" — ")})` : "";
|
|
1565
1641
|
console.log(` - ${row.scannerId}: ${row.health}${detail}`);
|
|
1566
1642
|
}
|
|
@@ -1778,12 +1854,13 @@ function printScanners(state) {
|
|
|
1778
1854
|
console.log(`Runtime: ${state.runtimeId ?? state.runtimeName ?? "unknown"}`);
|
|
1779
1855
|
console.log(`Scanners: ${rows.length}`);
|
|
1780
1856
|
for (const s of rows) {
|
|
1857
|
+
const external = s.scheduleMode === "external";
|
|
1781
1858
|
// Barren = wired and running but never emitted a signal — a real "alive but producing nothing" gap.
|
|
1782
1859
|
const barren = s.health !== "disabled" && (s.runCount ?? 0) > 0 && (s.signalsProduced ?? 0) === 0;
|
|
1783
1860
|
// Liveness clock is external-only: n/a for interval scanners, — for an external one not yet heard from.
|
|
1784
1861
|
const alive = s.lastAliveAt != null
|
|
1785
|
-
?
|
|
1786
|
-
:
|
|
1862
|
+
? formatRelativeAgo(s.lastAliveAt).replace(" ", "_")
|
|
1863
|
+
: external
|
|
1787
1864
|
? "—"
|
|
1788
1865
|
: "n/a";
|
|
1789
1866
|
console.log([
|
|
@@ -1793,12 +1870,14 @@ function printScanners(state) {
|
|
|
1793
1870
|
`health=${s.health ?? "unknown"}`,
|
|
1794
1871
|
`enabled=${String(s.enabled ?? false)}`,
|
|
1795
1872
|
`inFlight=${String(s.inFlight ?? false)}`,
|
|
1796
|
-
|
|
1873
|
+
// An external scanner records a run only per accepted signal or per error, so the count
|
|
1874
|
+
// is not a liveness signal; its liveness is `alive`.
|
|
1875
|
+
...(external ? [] : [`runs=${s.runCount ?? 0}`]),
|
|
1797
1876
|
`errors=${s.errorCount ?? 0}`,
|
|
1798
1877
|
`consec_errors=${s.consecutiveErrorCount ?? 0}`,
|
|
1799
1878
|
`signals=${s.signalsProduced ?? 0}`,
|
|
1800
1879
|
`alive=${alive}`,
|
|
1801
|
-
`next=${s.nextRunAt == null ? "—" : String(s.nextRunAt)}
|
|
1880
|
+
...(external ? [] : [`next=${s.nextRunAt == null ? "—" : String(s.nextRunAt)}`]),
|
|
1802
1881
|
`last=${s.lastRunStatus ?? "—"}`,
|
|
1803
1882
|
...(s.lastRunReason ? [`reason=${s.lastRunReason}`] : []),
|
|
1804
1883
|
...(barren ? ["(no signals yet)"] : []),
|