@senpi/runtime 3.0.3-dev.runtime-phase-2.20260625210428 → 3.0.4-dev.openclaw-upgrade-mai.20260626010610

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.
Files changed (55) hide show
  1. package/dist/actions/decision-engine.js +1 -1
  2. package/dist/actions/open-position/open-position.action.d.ts.map +1 -1
  3. package/dist/actions/open-position/open-position.action.js +21 -12
  4. package/dist/actions/open-position/open-position.action.js.map +1 -1
  5. package/dist/actions/open-position/resolve-margin.d.ts +18 -3
  6. package/dist/actions/open-position/resolve-margin.d.ts.map +1 -1
  7. package/dist/actions/open-position/resolve-margin.js +22 -9
  8. package/dist/actions/open-position/resolve-margin.js.map +1 -1
  9. package/dist/cli/guide-commands.d.ts.map +1 -1
  10. package/dist/cli/guide-commands.js +21 -3
  11. package/dist/cli/guide-commands.js.map +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/runtime-api/intake/intake-mount.d.ts.map +1 -1
  16. package/dist/runtime-api/intake/intake-mount.js +10 -1
  17. package/dist/runtime-api/intake/intake-mount.js.map +1 -1
  18. package/dist/runtime-api/intake/types.d.ts +5 -6
  19. package/dist/runtime-api/intake/types.d.ts.map +1 -1
  20. package/dist/runtime-api/routes/signals.d.ts.map +1 -1
  21. package/dist/runtime-api/routes/signals.js +3 -2
  22. package/dist/runtime-api/routes/signals.js.map +1 -1
  23. package/dist/runtime-api/routes/signals.schema.d.ts +1 -2
  24. package/dist/runtime-api/routes/signals.schema.d.ts.map +1 -1
  25. package/dist/runtime-api/routes/signals.schema.js +5 -3
  26. package/dist/runtime-api/routes/signals.schema.js.map +1 -1
  27. package/dist/scanners/external/scaffold/delivery.py +19 -0
  28. package/dist/scanners/external/scaffold/signal_envelope.py +57 -19
  29. package/dist/scanners/external-scanner-receiver.d.ts +9 -3
  30. package/dist/scanners/external-scanner-receiver.d.ts.map +1 -1
  31. package/dist/scanners/external-scanner-receiver.js +13 -5
  32. package/dist/scanners/external-scanner-receiver.js.map +1 -1
  33. package/dist/scanners/providers/factory.js +7 -2
  34. package/dist/scanners/providers/factory.js.map +1 -1
  35. package/dist/strategy/strategy-state.js +5 -0
  36. package/dist/strategy/strategy-state.js.map +1 -1
  37. package/dist/types/scanner.d.ts +12 -3
  38. package/dist/types/scanner.d.ts.map +1 -1
  39. package/examples/strategies/iguana/README.md +4 -4
  40. package/examples/strategies/iguana/recipe.yaml +1 -1
  41. package/examples/strategies/iguana/scanners/scan.py +4 -5
  42. package/examples/strategies/raptor/README.md +2 -2
  43. package/examples/strategies/raptor/recipe.yaml +1 -1
  44. package/examples/strategies/raptor/scanners/scan.py +5 -6
  45. package/examples/strategies/spider/README.md +3 -3
  46. package/examples/strategies/spider/scalp/recipe.yaml +1 -1
  47. package/examples/strategies/spider/scalp/scanners/scan.py +1 -1
  48. package/examples/strategies/spider/swing/recipe.yaml +1 -1
  49. package/examples/strategies/spider/swing/scanners/scan.py +3 -3
  50. package/examples/strategies/turbine/README.md +12 -9
  51. package/examples/strategies/turbine/recipe-runners.yaml +2 -2
  52. package/examples/strategies/turbine/recipe-volume.yaml +2 -2
  53. package/examples/strategies/turbine/scanners/scan.py +10 -6
  54. package/openclaw.plugin.json +1 -1
  55. package/package.json +1 -1
@@ -7,7 +7,7 @@ ONE scanner, TWO recipes. Turbine's two legs (volume + runners) ran the IDENTICA
7
7
  rotation alpha on the source; only the DSL exit preset and the per-slot sizing differed, and
8
8
  those live entirely in the recipe YAMLs. So both recipe-volume.yaml and recipe-runners.yaml
9
9
  point `path: ./scanners` + `entrypoint: scan.py` at THIS one module. The `inputs` block carries
10
- the per-leg sizing (marginUsd, leverage, slots) so the same code emits correctly-sized signals
10
+ the per-leg sizing (marginPct, leverage, slots) so the same code emits correctly-sized signals
11
11
  for whichever leg supervises it.
12
12
 
13
13
  What stayed faithful to the source (see scoring.py — ported verbatim):
@@ -39,9 +39,10 @@ FLAGS — behaviors that changed under the v2 contract (do NOT read as silent dr
39
39
  computed effective_slots = min(maxSlots, account_value / margin_per_slot) and emitted at
40
40
  most that many signals per tick. In v2 the runtime owns slot count (strategy.slots) and
41
41
  affordability (risk gates), so scan() emits ALL candidates clearing the gates (held +
42
- cooldown + spread), carrying marginUsd + leverage at each signal's TOP LEVEL. We still emit
43
- at most `maxSlots` candidates per tick (the rotation only advances that many times) so the
44
- scanner doesn't flood the queue, but the runtime makes the final open/skip decision.
42
+ cooldown + spread), carrying marginPct (percent of withdrawable) + leverage at each signal's
43
+ TOP LEVEL. We still emit at most `maxSlots` candidates per tick (the rotation only advances
44
+ that many times) so the scanner doesn't flood the queue, but the runtime makes the final
45
+ open/skip decision.
45
46
 
46
47
  3. random pool/direction picks are non-deterministic — kept verbatim (this is the source's
47
48
  design: rotation desync + neutral-regime coin flip). Tests assert STRUCTURE (valid gated
@@ -186,7 +187,10 @@ def scan(inputs, ctx):
186
187
  spread_main_bps = float(inputs.get("spreadMainBps", 3))
187
188
  spread_xyz_bps = float(inputs.get("spreadXyzBps", 10))
188
189
  leg_leverage = float(inputs.get("leverage", 5))
189
- margin_usd = float(inputs.get("marginUsd", 700))
190
+ # marginPct: percent of withdrawable to size each slot (0–100). Default 20 is
191
+ # an example; the old fixed-USD intent can't be preserved as a percent without
192
+ # knowing account size. Set this in the recipe inputs: block.
193
+ margin_pct = float(inputs.get("marginPct", 20))
190
194
  max_slots = int(inputs.get("maxSlots", 7))
191
195
 
192
196
  held_set, _account_value = _get_held(ctx)
@@ -246,7 +250,7 @@ def scan(inputs, ctx):
246
250
  out.append({
247
251
  "asset": asset,
248
252
  "direction": direction,
249
- "marginUsd": float(margin_usd),
253
+ "marginPct": float(margin_pct),
250
254
  "leverage": float(leverage),
251
255
  "data": {
252
256
  "thesis": thesis,
@@ -2,7 +2,7 @@
2
2
  "id": "runtime",
3
3
  "name": "Senpi Runtime",
4
4
  "description": "Senpi runtime plugin for OpenClaw. Orchestrates scanners, LLM-based trade decisions, and a DSL trailing stop-loss exit engine.",
5
- "version": "3.0.3",
5
+ "version": "3.0.4",
6
6
  "commandAliases": [{ "name": "senpi" }],
7
7
  "activation": {
8
8
  "onStartup": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@senpi/runtime",
3
- "version": "3.0.3-dev.runtime-phase-2.20260625210428",
3
+ "version": "3.0.4-dev.openclaw-upgrade-mai.20260626010610",
4
4
  "description": "Senpi runtime plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",