@battlegrid/mcp-server 31.2.66 → 31.2.68

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,6 +24,84 @@ 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 — v87 (a fork's create resolves its source again)
28
+
29
+ **Breaking at v87: a fork's create can now be refused where it committed.** v87 is the contract on top of
30
+ v86. No schema, description or tool changes.
31
+
32
+ ### Narrowed acceptance
33
+
34
+ A create draft that `fork_strategy` opened is committed by `commit_strategy_draft` with
35
+ `expectedRevision: null`, or by the builder's Create. That create now resolves the strategy it copied
36
+ again. It uses only the source id and revision in the draft's `ORIGIN`, by the same rule the fork applied:
37
+
38
+ - **A source that moved past the forked revision** refuses the create with `CONFLICT` and **no
39
+ `details.nextAct`**. Reading the draft again cannot cure it; the message says to discard the draft and
40
+ fork again. `get_strategy_draft` and `stage_strategy_draft` report the same refusal in the draft's
41
+ diagnostics.
42
+ - **A source you can no longer see** — archived, or neither yours nor SYSTEM — answers `NOT_FOUND`.
43
+
44
+ ### Widened acceptance
45
+
46
+ - **Neither `fork_strategy` nor the create reads the source's stored revision snapshot.** A strategy whose
47
+ stored snapshot predates the current shape — every SYSTEM template among them — now forks and creates
48
+ from its live state, where both were refused.
49
+
50
+ ## Contract history — v86 (a refusal hint belongs to the operation that can act on it)
51
+
52
+ **Breaking at v86: refusals on most tools lose `details.nextAct`, two refusals change code, and one
53
+ draft read is reshaped.** v86 is the contract on top of v85.
54
+
55
+ ### Narrowed refusal details
56
+
57
+ - **`details.nextAct` follows the refusal's meaning.** `DRAFT_VERSION_MOVED` and `DRAFT_AXIS_CONTESTED`
58
+ still carry `get_draft` from every tool. A revision `CONFLICT` and the in-flight commit refusal
59
+ (`get_draft`) and a validation refusal (`stage`) now carry a hint only from `stage_<kind>_draft` and
60
+ `commit_<kind>_draft` of the strategy and agent kinds.
61
+ - **Removed from every other tool's validation refusal and revision `CONFLICT`**: `submit_market_grid`,
62
+ `fork_strategy`, `archive_strategy`, `restore_strategy`, and the arena and radar commit, pause, resume
63
+ and delete tools, and from the malformed-cursor refusal of `list_agent_drafts` and
64
+ `list_strategy_drafts`. The arena and radar `commit_*_draft` stale-revision refusals lose `get_draft`
65
+ too. A client that branched on `nextAct` from those tools reads the code instead.
66
+
67
+ ### Changed error codes
68
+
69
+ - **The strategy active-quota refusal is `FORBIDDEN`**, as the agent slot quota is, where it was
70
+ `VALIDATION_ERROR` with `nextAct: 'stage'`: on `commit_strategy_draft` and `restore_strategy`.
71
+ - **A create naming an id that is already the caller's strategy or agent is `DRAFT_VERSION_MOVED`**,
72
+ carrying the caller's draft version at that id, where it was `NOT_FOUND`. An agent create naming a
73
+ SYSTEM agent is `FORBIDDEN`, where it was `NOT_FOUND`.
74
+ - **The moved-draft refusals end "Read the draft again and show the player what it now holds before
75
+ committing."**, where they said to commit what it now holds. Read the draft again and show the player
76
+ before committing; never commit the re-read draft on your own.
77
+
78
+ ### Reshaped output
79
+
80
+ - **`get_agent_draft.impact` is a union on `operation`**: `{ operation: 'CREATE', capital }` for a create
81
+ draft, where it was `null`, and `{ operation: 'UPDATE', deployedPresetCount, openPositionCount,
82
+ radarArmedCoinCount, capital, rebind }` for an edit draft, where the counts sat at the top level. A
83
+ create draft's `capital` reads its trading configuration — drafted, or the platform's seed — over the
84
+ bound strategy's band, as the commit's capital check reads it.
85
+
86
+ ### Widened read
87
+
88
+ - **`get_strategy` with `includeInactive: true`** serves your own strategy in any state, and otherwise
89
+ the visible set the default read serves — every SYSTEM strategy among it — where it answered
90
+ `NOT_FOUND` for anything but an owned PRIVATE strategy. Another user's PRIVATE strategy is still
91
+ `NOT_FOUND`.
92
+
93
+ ### Behaviour behind unchanged schemas
94
+
95
+ - **The stage and commit descriptions** state the draft content cap (256,000 UTF-8 bytes) and its
96
+ refusal, what a commit reaches — it closes no position, and the one refusal an open position can cause
97
+ — and that a moved draft is shown to the player before any commit.
98
+ - **A stage's `DRAFT_VERSION_MOVED`** fires only for a version the draft never reached — read from a draft
99
+ since committed or discarded. A stage naming an older version than the draft holds is composed over the
100
+ newer draft.
101
+
102
+ A strict client re-reads the `get_agent_draft` output schema; list the tools again after the server
103
+ deploys.
104
+
27
105
  ## Contract history — v85 (agents and strategies change only through their drafts)
28
106
 
29
107
  **Breaking at v85: seven tools are retired, and a surviving tool refuses an input it accepted at v84.**
package/SKILL.md CHANGED
@@ -68,8 +68,9 @@ than about authoring:
68
68
  is `null` for an entity not created yet. Commit only after the player has seen the diff and impact
69
69
  and said yes. `discard_<kind>_draft({ request: { <id>, draftVersion } })` is the same fence.
70
70
  - **The proxy forwards numbers and `null` unchanged.** It never fills in a version, never retries a
71
- refused call and never rebuilds a request: a `DRAFT_VERSION_MOVED`, `DRAFT_AXIS_CONTESTED` or
72
- revision `CONFLICT` refusal carries `details.nextAct`, and the next act is the caller's.
71
+ refused call and never rebuilds a request. A `DRAFT_VERSION_MOVED` or `DRAFT_AXIS_CONTESTED` refusal
72
+ carries `details.nextAct` from every tool, and a revision `CONFLICT` or validation refusal carries it
73
+ from a stage or commit; the next act is the caller's.
73
74
 
74
75
  `fork_strategy` copies a revision into a new create draft and creates nothing until that draft is
75
76
  committed. An agent binds to a strategy through its draft's `STRATEGY_BINDING` axis, on a create or
@@ -98,9 +99,9 @@ The `play-market-grid` prompt (discover via `prompts/list`) provides a guided en
98
99
  | `API key must start with "bg_live_"` | Invalid key format | Generate a new key at battlegrid.trade → Profile → MCP |
99
100
  | Authentication failed (401/403) | Key revoked/rotated | Generate a new key and **restart** the proxy (keys read once at startup) |
100
101
  | `"account" parameter is required` | Multi-account call missing `account` | Add the outer `account`; keep `request` unchanged |
101
- | `DRAFT_VERSION_MOVED` | The draft changed after you read it, or no draft is held (`details.draftVersion` null) | Call `get_<kind>_draft` again and commit what it now holds |
102
+ | `DRAFT_VERSION_MOVED` | The draft changed after you read it, or no draft is held (`details.draftVersion` null) | Call `get_<kind>_draft` again, show the player what it now holds, and commit only on their word |
102
103
  | `DRAFT_AXIS_CONTESTED` | The player changed `details.contestedAxes` in their open form after the version you staged against | Read the draft again and propose against what they now have |
103
- | `CONFLICT` on a commit | The live revision moved after the draft read | Read the draft again; commit at the new `committedRevision` |
104
+ | `CONFLICT` on a commit | The live revision moved after the draft read | Read the draft again, show the player the new diff and impact, and commit at the new `committedRevision` only on their word |
104
105
  | Required at allocation Off | A rule flags `required` on a signal weighted `0` (contract 34) | Read `details.inertRequiredSignalIds`; per signal either raise `allocation` or set `required: false` |
105
106
  | Method not found | Calling a retired/unknown tool | Re-run `tools/list`; stage, read and commit through the entity's draft |
106
107
  | `Wager scope required` | `mcp:wager` not enabled | Enable Server-Signed Wagers in Profile → MCP |
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.66";
52
+ export declare const PACKAGE_VERSION = "31.2.68";
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.66';
55
+ export const PACKAGE_VERSION = '31.2.68';
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.66",
3
+ "version": "31.2.68",
4
4
  "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "generator": "battlegrid-app/server/scripts/export-mcp-skills.mjs",
3
- "contractVersion": "85.0.0",
3
+ "contractVersion": "87.0.0",
4
4
  "files": {
5
- "battlegrid-agent-management/SKILL.md": "708a37732e822184f99e58fc96b87780e61155e792482fcd56ae56aa7064cd5b",
5
+ "battlegrid-agent-management/SKILL.md": "b2f04d76480de2f9fdbd00f8cb25610d2b72fcaa4f87ca57a09bd9ffc78fdbba",
6
6
  "battlegrid-arena-play/SKILL.md": "4cfaa92a8d0dcaf477b227abd774e7aa8642c185d72108dfd401be0cf8aecd7f",
7
7
  "battlegrid-market-analysis/SKILL.md": "3a9943de9f482a8230fb2983efd2f2d8b8c17d49c242e49b68e7243c20c3aa7b",
8
8
  "battlegrid-radar-deployment/SKILL.md": "17301fa66f4b128154435462ffa967efcb3d016df671b03c485d0f8b840fc891",
9
- "battlegrid-strategy-authoring/SKILL.md": "4c708dc90029e0b991c4c154d9c74a366a29c2d3a827b78936f2f344df3efeb4",
9
+ "battlegrid-strategy-authoring/SKILL.md": "a5066740d7d57f095545fd812b0228a8eef6e3b08c87047596a0e1639ae4971d",
10
10
  "battlegrid-strategy-doctor/SKILL.md": "14f20bff9e2b5a59d11634fe3615b1298d672d5e2eba06d3dc8698b571b3bee3",
11
11
  "battlegrid-strategy-examples/SKILL.md": "3c11942f7327e00208d48a7a256faf83d80faf568bd0181b707657bace3c1ef9",
12
12
  "battlegrid-strategy-examples/references/playbooks.md": "63aa07f3d55f97e53b2bf6401528807ab23bd093a4bbc37e598158249db24a59",
@@ -88,11 +88,14 @@ Create creates it**. Staging creates nothing and spends no slot.
88
88
 
89
89
  **Then read it, confirm it, and commit it.** `get_agent_draft` serves the draft, its
90
90
  `draftVersion`, a `committedRevision` of `null` and the diagnostics: a missing or invalid axis is
91
- an error there, named, before anything is spent. A create draft has no impact. Then one
92
- confirmation naming **the strategy, the model, and the budget posture** — the capital ceiling and
93
- stops the trading configuration will carry, or that it will take the platform seed — and on the
94
- player's explicit pick call `commit_agent_draft` with the `agentId`, that read's `draftVersion` and
95
- `expectedRevision: null`. Where the player has the create screen open, their own Create is the
91
+ an error there, named, before anything is spent. Its impact is `operation: CREATE` with the
92
+ create's capital reading: the smallest order its configuration — drafted, or the platform seed —
93
+ places, against the order floor, and whether that is `feasible`. Then one confirmation naming **the
94
+ strategy, the model, and the budget posture** — the capital ceiling and stops the trading
95
+ configuration will carry, or that it will take the platform seed, with the smallest order against
96
+ the floor — and on the player's explicit pick call `commit_agent_draft` with the `agentId`, that
97
+ read's `draftVersion` and `expectedRevision: null`. A reading with `feasible: false` is a create the
98
+ commit will refuse: say so, and stage a larger ceiling or a looser configuration first. Where the player has the create screen open, their own Create is the
96
99
  other way to commit it.
97
100
 
98
101
  A create spends an agent slot against the player's rank quota, decided by the commit itself: a
@@ -205,8 +205,8 @@ diagnostics you have not explained to them.
205
205
  - **`DRAFT_AXIS_CONTESTED`** names the axes the player's own hand changed after the version you
206
206
  named. Their edit is newer than your proposal: read the draft, tell them so, and propose again
207
207
  only when they ask. Never re-send the same values.
208
- - **`DRAFT_VERSION_MOVED`** — the version you named is not the draft's. Read it again and propose
209
- against what the player now has.
208
+ - **`DRAFT_VERSION_MOVED`** — the version you named is one the draft never reached: it was read from
209
+ a draft since committed or discarded. Read it again and propose against what the player now has.
210
210
 
211
211
  Never raise the number to get past either refusal.
212
212
 
@@ -335,9 +335,9 @@ offered, and nothing else is.
335
335
 
336
336
  ## When the server refuses
337
337
 
338
- Each refusal is a specific typed code, and a draft refusal names its next act in
339
- `details.nextAct` — `get_draft` or `stage`. Read it and take the cheapest correct step — never
340
- retry the same call blindly.
338
+ Each refusal is a specific typed code, and a refusal of a draft's stage or commit names its next
339
+ act in `details.nextAct` — `get_draft` or `stage`; a moved or contested draft names `get_draft`
340
+ from any tool. Read it and take the cheapest correct step — never retry the same call blindly.
341
341
 
342
342
  - **`DRAFT_VERSION_MOVED`** (`nextAct: get_draft`) — the draft changed after your read: the
343
343
  player's form saved an edit, another surface staged, or a human-paced review outlived it. Read
@@ -353,8 +353,8 @@ retry the same call blindly.
353
353
  - **A validation error** (`nextAct: stage`) — the error the diagnostics named, with its own
354
354
  `field` and `details`. Nothing was written. Return to step 4: fix the axis, stage, read, and
355
355
  confirm again.
356
- - **A refusal with no `nextAct`** — the strategy quota, a name already in use, `REPAIR_REQUIRED`,
357
- viability, or a `CONFLICT` whose `details.reason` is `RADAR_DEPLOYMENT_MOVED`. The draft is
356
+ - **A refusal with no `nextAct`** — the strategy quota (`FORBIDDEN`), a name already in use,
357
+ `REPAIR_REQUIRED`, viability, or a `CONFLICT` whose `details.reason` is `RADAR_DEPLOYMENT_MOVED`. The draft is
358
358
  untouched. Clear the cause with the player — a rename is an IDENTITY stage, which makes a new
359
359
  version to read and confirm — then commit the draft they confirmed. A moved radar deployment is
360
360
  a race, not a decision: read and commit again.