@battlegrid/mcp-server 31.2.40 → 31.2.42

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,55 @@ 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 — v65
28
+
29
+ **Breaking on one input, and four refusals behind unchanged schemas.** Agent staging now names the
30
+ draft version its proposal was read against, and three commits and one stage step aside where they
31
+ would otherwise land around the player's open draft or on a strategy that moved.
32
+
33
+ ### Rejected input — something you send is no longer accepted
34
+
35
+ - **`stage_agent_draft` requires `draftVersion`**, an integer ≥ 0: the `version` the
36
+ `get_agent_draft` read you proposed against returned, or `0` when it returned `{ draft: null }`.
37
+ A call that omits it, or sends a negative or fractional number, is refused at the boundary. On a
38
+ new create draft send `0`, then reuse the `version` each accepted call returns.
39
+
40
+ ### Refusals worth knowing before you stage or commit
41
+
42
+ - **A `draftVersion` above the draft's own is refused.** A draft's version only grows, so no read
43
+ ever returned it: the draft you read was saved or discarded since. Read again — never raise the
44
+ number to get past the refusal.
45
+
46
+ - **The contested-axis refusal is measured from your `draftVersion`**, not from a read the call
47
+ makes for itself, so an edit the player made between your read and your stage is refused by name
48
+ rather than silently overwritten.
49
+
50
+ - **`update_strategy_signal_rule` and `restore_strategy` answer `CONFLICT` while the player holds a
51
+ draft of that strategy.** Compile the tune and stage it with `stage_strategy_plan`; for a restore,
52
+ ask the player to save or discard their draft first. A caller whose player holds no draft is
53
+ unaffected.
54
+
55
+ - **`stage_strategy_plan` refuses a plan the strategy committed past** after the plan compiled,
56
+ with the same answer `apply_strategy_plan` gives: compile again against what is committed now.
57
+
58
+ - **Every refusal around an open draft names its version** in `details.draftVersion` — the
59
+ committers above, the agent committers, and a stage refused for a version above the draft's own —
60
+ so you can read the draft the player holds and propose against it.
61
+
62
+ ### Changed meaning, unchanged shape
63
+
64
+ - **A draft axis's `source` names the door it came through.** A Telegram Commander turn stamps
65
+ `telegram` and a connected client stamps `mcp`, where every staging call used to stamp
66
+ `commander`. Both values were already in the enum.
67
+
68
+ - **A draft's `version` keeps counting after a save or discard empties it.** The next draft for the
69
+ same agent or strategy starts above the last version rather than at `1`, so a version you read is
70
+ never reissued to a different draft.
71
+
72
+ ### Vocabulary
73
+
74
+ `toolCount` stays 126. One input schema moves, `stage_agent_draft`'s; no output schema moves.
75
+
27
76
  ## Contract history — v64.1
28
77
 
29
78
  Purely additive in schema, with **one refusal behind an unchanged one.** An agent's unsaved
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.40";
52
+ export declare const PACKAGE_VERSION = "31.2.42";
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.40';
55
+ export const PACKAGE_VERSION = '31.2.42';
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.40",
3
+ "version": "31.2.42",
4
4
  "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "generator": "battlegrid-app/server/scripts/export-mcp-skills.mjs",
3
- "contractVersion": "64.0.0",
3
+ "contractVersion": "64.1.0",
4
4
  "files": {
5
- "battlegrid-agent-management/SKILL.md": "d56834fa2016ec9371994999fa13a3dbb69906efc54db522e10fd2eb0ebb6044",
5
+ "battlegrid-agent-management/SKILL.md": "f43f3ac852e032c320d43f599d3e683203c68daf42637a9dbf292b380f17c635",
6
6
  "battlegrid-arena-play/SKILL.md": "4cfaa92a8d0dcaf477b227abd774e7aa8642c185d72108dfd401be0cf8aecd7f",
7
7
  "battlegrid-market-analysis/SKILL.md": "22fde9c4eac0261c89a8056ab8b20b66fcbe1fd58447fa0ac84fd410b4d134d7",
8
8
  "battlegrid-radar-deployment/SKILL.md": "d2a012b154e1e529db19529bd7c3d75d069f4e410d5804add51165f0f0902b2e",
@@ -21,10 +21,12 @@ step named beside it before doing anything else.
21
21
  2. **Acting without blast radius.** *Cue: halt, archive, rebind, update, close, override — any
22
22
  verb that changes what the agent may do.* Every one of these has a reach the player cannot see
23
23
  from the verb: open positions that keep running, deployments that stop firing, materialized
24
- configuration that is replaced. State the reach from the reads BEFORE the confirm form. → step 3.
24
+ configuration that is replaced. State the reach from the reads BEFORE the confirm form. And a
25
+ configuration change to an agent the player is mid-edit on is staged, not committed. → steps 3
26
+ and 4.
25
27
  3. **Mis-lever'd halt recovery.** *Cue: "why is it stopped", "start it again", any halted agent.*
26
28
  There are three halt reasons and they do not share a lever. Offering a drawdown baseline reset
27
- to a daily-loss halt is offering something that cannot work. → step 4.
29
+ to a daily-loss halt is offering something that cannot work. → step 5.
28
30
  4. **Driving strategy writes from this arc.** *Cue: the answer to an agent problem turns out to be
29
31
  "change the strategy".* You can SEE strategies here because you must name what you bind. That is
30
32
  not permission to author them. → the cross-skill rule below.
@@ -54,6 +56,9 @@ discipline governs the change, not about what the server would accept.)
54
56
  never its `id`. The `id` UUID identifies the catalogue row; `create_intelligence_agent` and
55
57
  `update_intelligence_agent` key on `modelId` and accept nothing else.
56
58
  - `list_strategies` — the binding candidates.
59
+ - `list_agent_drafts` — what the player is already part-way through. **Mention an existing draft
60
+ before starting new work** — "you have an unsaved <agent / new agent>, last touched from
61
+ <surface> at <time>" — and offer to continue it rather than opening a second one beside it.
57
62
 
58
63
  Read each thing once. A roster or agent you already fetched in this conversation is still in front
59
64
  of you; re-fetching costs the player the same payload twice and it rides every later step.
@@ -73,8 +78,16 @@ When the picks come back, restate in one line: *"Commissioning: <name>, bound to
73
78
  budget posture** — the capital ceiling and stops the trading configuration will carry, or that it
74
79
  will take platform defaults.
75
80
 
76
- Call `create_intelligence_agent` with an **`idempotencyKey`** derived from this conversation and
77
- this confirm turn. A create spends an agent slot against the player's rank quota; a retry after a
81
+ **Build it in a create draft.** As the picks come back, stage them with `stage_agent_draft` —
82
+ omit `agentId` on the first call and reuse the id it returns — each axis WHOLE: IDENTITY
83
+ `{ displayName }`, BEHAVIOR `{ behavior: { risk, outlook, conviction } }`, MODEL `{ modelId }`,
84
+ TRADING_CONFIG with every agent-owned field, and STRATEGY_BINDING `{ strategyId }`. The build then
85
+ survives a refresh, lists in the Agents Hub as *not yet created*, and opens on the create screen,
86
+ where **the player's Save creates it**. Staging creates nothing and spends no slot.
87
+
88
+ Call `create_intelligence_agent` yourself only when the player asks you to create it from this
89
+ conversation — on a surface with no create screen to save from — with an **`idempotencyKey`**
90
+ derived from this conversation and this confirm turn. A create spends an agent slot against the player's rank quota; a retry after a
78
91
  dropped response would spend a second one. With the key, an ambiguous retry replays the original
79
92
  result instead.
80
93
 
@@ -86,7 +99,24 @@ Profile → Wallet tab path instead, because no control renders there. **Create
86
99
  way**: the consent gates entering a game, never commissioning one. A `true` flag is consent alone
87
100
  and not readiness — the pipeline's own refusal at the fee is the authority.
88
101
 
89
- ### 3. Lifecycle verbs: read first, state the radius, then confirm
102
+ ### 3. Stage, review, commit — never commit around an open draft
103
+
104
+ Before proposing any change to an existing agent, `get_agent_draft`. **A draft means the player is
105
+ mid-edit in their form.** Then:
106
+
107
+ - **Stage** the change with `stage_agent_draft`: it lands in their open form, labelled as yours, and
108
+ **their Save commits it** together with their own edits. `update_intelligence_agent` and
109
+ `rebind_intelligence_agent` are REFUSED while the draft exists — that refusal is the server's, so
110
+ do not retry them.
111
+ - A staging call **refused naming an axis** means the player changed it after you read the draft:
112
+ read again and propose against what they now have — never re-send the same values.
113
+ - **Rebinding is never staged.** While a draft is open, ask the player to save or discard it first.
114
+ - `discard_agent_draft` only on the player's word: call it with `confirm:false` first, tell them
115
+ when the draft was last written and from which surface, ask, then confirm.
116
+
117
+ With **no draft open**, the update verb below stands, confirm and all.
118
+
119
+ ### 4. Lifecycle verbs: read first, state the radius, then confirm
90
120
 
91
121
  Every one of update, rebind, halt, resume, activate and archive runs this shape. The reads
92
122
  (`get_agent_budget`, `get_agent_fund_allocation`, `get_agent_open_positions`,
@@ -118,7 +148,7 @@ the reason, and name what would clear it (un-deploy via the radar/deployment too
118
148
  the positions resolve, wait for the session to settle). Never paraphrase the refusal into "it
119
149
  didn't work", and never retry it unchanged.
120
150
 
121
- ### 4. Halt recovery: branch on the served halt reason
151
+ ### 5. Halt recovery: branch on the served halt reason
122
152
 
123
153
  `get_agent_budget` serves `haltReason`. There are exactly three, and the lever differs:
124
154
 
@@ -136,7 +166,7 @@ figure against the limit. Surface those served figures and the applicable lever
136
166
  above. Do not retry the resume, and do not reach for the reset to "get past" a refusal that names
137
167
  a different stop.
138
168
 
139
- ### 5. Risk limits are a whole object
169
+ ### 6. Risk limits are a whole object
140
170
 
141
171
  `update_intelligence_agent`'s `tradingConfig` is a **complete** configuration: what you send
142
172
  replaces what is stored, and every field in that schema is required when the object is present.
@@ -146,7 +176,7 @@ name **every changed value** in the confirm — from what, to what. Never assemb
146
176
  and never echo a read config back unchanged: the read shape is wider than the write shape
147
177
  (`strategyTimeframe` and `regimeTimeframe` are strategy-derived and rejected as unknown keys).
148
178
 
149
- ### 6. Live positions: present the served state, name the bypass
179
+ ### 7. Live positions: present the served state, name the bypass
150
180
 
151
181
  - `get_agent_open_positions` / `list_user_active_positions` / `get_position_audit_history` first —
152
182
  the `decisionId` these two tools need is discoverable only through those reads.