@battlegrid/mcp-server 31.2.8 → 31.2.9

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 CHANGED
@@ -24,7 +24,7 @@ Seeing package `31.x` alongside handshake `battlegrid@33.x` — the package **be
24
24
 
25
25
  **What this changes for you:** nothing about how you call anything. Upgrading the package no longer waits on a server deploy, and a server deploy no longer strands you on a package that names the wrong contract — reconnect and the announcement follows. **Contract breaking-change notes are no longer keyed to package versions**, since a contract move is no longer a release here; the v11-and-earlier notes below are kept as history, and the live vocabulary is always discovery.
26
26
 
27
- ## Contract history — v37 → v51
27
+ ## Contract history — v37 → v52
28
28
 
29
29
  Eleven majors reached authors while this section stopped at v36. That gap is the mechanism, not an
30
30
  oversight: since v31 a contract move needs no release here, so nothing forced a note to be written —
@@ -112,6 +112,21 @@ refuse is now stored. Listed because a client that special-cased the refusal can
112
112
 
113
113
  ### Rejected input — something you author is no longer accepted
114
114
 
115
+ - **`entry.levelSource` is refused — the level is derived, never authored** (52.0.0,
116
+ `derive-entry-level`). The strict `entry` object on `compile_strategy_plan`, `apply_strategy_plan`
117
+ and `fork_strategy` is six keys — `trigger`, `confirmTf`, `closes`, `bandAtrMultiple`,
118
+ `levelOffsetAtrMultiple`, `validForBars` — and a body carrying `levelSource` is refused naming
119
+ the key where 51.0.0 accepted it. `STOP_THROUGH_LEVEL` rests a stop past the swing channel's
120
+ CURRENT edge in the trade's direction (the 20-bar high for a long, the 20-bar low for a short);
121
+ `ON_RETEST` rests a limit in front of the edge a close most recently BROKE. Your two dials are the
122
+ unsigned distance from that edge (`levelOffsetAtrMultiple`, 0–2 ATR; a long adds, a short
123
+ subtracts) and the bar validity (`validForBars`, 1–24). A meaningful `validForBars` under
124
+ `AT_SIGNAL` or `ON_CANDLE_CLOSE` is now refused as `PARAMETER_NOT_HONOURED` like the other level
125
+ dials.
126
+
127
+ **Drop the key.** That is the whole migration for what you send; the six-key example below is
128
+ the current shape.
129
+
115
130
  - **`update_strategy_signal_rule` requires `confirm: true` when the strategy has bound agents**
116
131
  (51.0.0, `fix-signal-rule-patch-semantics`). The write re-materializes scoring configuration onto
117
132
  every bound agent immediately — including agents holding open USDC positions — and until now
@@ -201,11 +216,11 @@ refuse is now stored. Listed because a client that special-cased the refusal can
201
216
  that clause into its own LIVE condition and `conditionRef` it. `exit: true` is legal only under
202
217
  `clock: "CLOSE"` — an exit fired on a forming bar is an intrabar exit.
203
218
 
204
- - **A strategy requires a seven-key `entry` object** (44.0.0 for four keys, 47.0.0 for three more —
205
- `add-entry-on-close`, `add-level-trigger-execution`). Required on every CREATE, on
206
- `compile_strategy_plan`, `apply_strategy_plan` and `update_intelligence_agent`. A client sending
207
- 44.0.0's four-key object is refused under 47 with `entry.levelSource: Required` without one byte of
208
- it changing.
219
+ - **A strategy requires a six-key `entry` object** (44.0.0 for four keys, 47.0.0 for three more —
220
+ `add-entry-on-close`, `add-level-trigger-execution` — and 52.0.0 removed `levelSource`,
221
+ `derive-entry-level`). Required on every CREATE, on `compile_strategy_plan`, `apply_strategy_plan`
222
+ and `update_intelligence_agent`. A client sending 44.0.0's four-key object is refused with
223
+ `entry.levelOffsetAtrMultiple: Required` without one byte of it changing.
209
224
 
210
225
  ```jsonc
211
226
  "entry": {
@@ -213,14 +228,13 @@ refuse is now stored. Listed because a client that special-cased the refusal can
213
228
  "confirmTf": "4h", // the strategy timeframe or the rung below it — nothing else
214
229
  "closes": 1, // 1–5; must be 1 unless ON_CANDLE_CLOSE
215
230
  "bandAtrMultiple": 1.0, // > 0, and <= the platform's entry-deviation gate
216
- "levelSource": "SWING_HIGH", // | SWING_LOW | BOLLINGER_UPPER | BOLLINGER_LOWER
217
- "levelOffsetAtrMultiple": 0, // 0–2, UNSIGNED; must be 0 unless a level trigger
218
- "validForBars": 4 // 1–24 of the strategy's own bars
231
+ "levelOffsetAtrMultiple": 0, // 0–2, UNSIGNED distance from the derived edge; 0 unless a level trigger
232
+ "validForBars": 4 // 1–24 of the strategy's own bars; 4 unless a level trigger
219
233
  }
220
234
  ```
221
235
 
222
236
  `AT_SIGNAL` with those values is byte-identical to pre-44 behaviour. The legality matrix runs one
223
- way: all seven keys are always present, so a MEANINGFUL value under a trigger that ignores it is
237
+ way: all six keys are always present, so a MEANINGFUL value under a trigger that ignores it is
224
238
  refused rather than accepted-and-dropped — a dial never silently does nothing.
225
239
 
226
240
  - **A `strategyTimeframe` the platform does not ingest is refused** (39.0.0,
@@ -257,6 +271,15 @@ refuse is now stored. Listed because a client that special-cased the refusal can
257
271
 
258
272
  ### Reshaped output — the same call returns a different shape
259
273
 
274
+ - **The stored entry discipline no longer names a level source** (52.0.0, `derive-entry-level`).
275
+ `StrategyDTO.entry` (`get_strategy`, `list_strategies`, the `fork_strategy` / `archive_strategy` /
276
+ `restore_strategy` envelopes) and the apply envelope's `postState.entry` lose `levelSource`.
277
+ `TradeOutcomeDTO.entryDiscipline` (`get_trade_outcome_by_decision`, `list_trade_outcomes`) loses
278
+ it and gains `levelOffsetAtrMultiple: number | null` — the offset in force at the fire, `null` on
279
+ rows written before its column existed. A reader that rendered the level source renders the
280
+ geometry from `trigger` and the outcome's `direction` instead: which edge and which order shape
281
+ are a pure function of those two fields, so no stored copy is served.
282
+
260
283
  - **`update_strategy_signal_rule` gains its own response envelope** (51.0.0,
261
284
  `fix-signal-rule-patch-semantics`). It no longer shares `{ strategy }` with its siblings. The
262
285
  response is `{ strategy, ruleChanges }`, where `ruleChanges` is the server's own before/after
@@ -317,6 +340,13 @@ refuse is now stored. Listed because a client that special-cased the refusal can
317
340
 
318
341
  ### Widened enum — new members your own copy rejects
319
342
 
343
+ - **`TradeExecutionFailureReason` gains `LEVEL_NOT_RESTABLE`** (52.0.0, `derive-entry-level`): a
344
+ level entry refused at placement because its resting price sat on the wrong side of the exchange
345
+ mid — a buy stop at or below it, a buy limit at or above it, and the mirror for a sell. It appears
346
+ on the `list_signal_logs` failure-reason filter input and on the signal-pipeline execution
347
+ summary's `failureReason`, with origin `CLIENT_GATE`. There is no distance limit: a level far from
348
+ the mark rests until its bar validity expires.
349
+
320
350
  - **The authorable metric vocabulary widens by 29 keys** (46.1.0, `add-indicator-catalog-coverage`):
321
351
  Keltner (`KC_UPPER`/`KC_MID`/`KC_LOWER`), Supertrend (`ST_LINE`/`ST_DIR`), Hull (`HMA20`),
322
352
  WaveTrend (`WT1`/`WT2`), QQE (`QQE_RSI_MA`/`QQE_STOP`), Parabolic SAR (`PSAR`), Ichimoku
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ import { type Implementation, type Prompt, type Resource } from '@modelcontextpr
49
49
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
50
50
  * correction. Never move it to track the server.
51
51
  */
52
- export declare const PACKAGE_VERSION = "31.2.8";
52
+ export declare const PACKAGE_VERSION = "31.2.9";
53
53
  export declare const DEFAULT_URL = "https://mcp.battlegrid.trade/mcp";
54
54
  export interface EnvConfig {
55
55
  apiKeys: string[];
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema, ListPromptsRequestSchema
52
52
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
53
53
  * correction. Never move it to track the server.
54
54
  */
55
- export const PACKAGE_VERSION = '31.2.8';
55
+ export const PACKAGE_VERSION = '31.2.9';
56
56
  export const DEFAULT_URL = 'https://mcp.battlegrid.trade/mcp';
57
57
  const MAX_RETRIES = 3;
58
58
  const RETRY_DELAYS_MS = [2000, 4000, 8000];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@battlegrid/mcp-server",
3
- "version": "31.2.8",
3
+ "version": "31.2.9",
4
4
  "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",