@battlegrid/mcp-server 31.2.39 → 31.2.41

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,57 @@ 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 — v64.1
28
+
29
+ Purely additive in schema, with **one refusal behind an unchanged one.** An agent's unsaved
30
+ configuration now has a server home — the same owner-scoped *draft* strategies gained in v63.1 — so
31
+ the agent form, Telegram and a connected client all see one set of unsaved values. These tools are
32
+ how a conversation reaches it, and the two agent committers now step aside while it is open.
33
+
34
+ ### Wider surface — four tools added
35
+
36
+ - **`stage_agent_draft({ request: { agentId?, axes } })`** writes proposed axes into the player's
37
+ draft for an agent and commits **nothing**: the values become the agent's configuration only when
38
+ the player saves. Unlike `stage_strategy_plan` it takes the axis *values* — `IDENTITY`,
39
+ `BEHAVIOR`, `MODEL`, `TRADING_CONFIG`, and for an agent not yet created `STRATEGY_BINDING` — each
40
+ written **whole**, so `BEHAVIOR` carries all three of risk, outlook and conviction and
41
+ `TRADING_CONFIG` the complete agent-owned configuration. Axes you omit keep their values.
42
+ Structure is checked on the way in; ranges are checked only when the player saves.
43
+
44
+ - **Omit `agentId` to open a create draft.** The server mints the id and the response carries it;
45
+ name that id on every later call so one draft accumulates rather than a second opening beside it.
46
+
47
+ - **`get_agent_draft({ request: { agentId } })`** reads one draft, or answers `{ draft: null }` —
48
+ not part-way through that agent is a value, not an error. `baseRevision` is `null` for an agent not
49
+ yet created, and `baseMoved` reports an agent committed past the revision the draft was written
50
+ against.
51
+
52
+ - **`list_agent_drafts({ request: { cursor? } })`** answers "what am I part-way through?" for a
53
+ conversation holding no agent id, newest first. Offer to continue one of these before starting a
54
+ second.
55
+
56
+ - **`discard_agent_draft({ request: { agentId, confirm } })`** destroys one draft on the player's
57
+ word. Called with `confirm: false` it destroys nothing and is refused with when the draft was last
58
+ written and which surface wrote it — tell the player that, then ask.
59
+
60
+ ### Refusals worth knowing before you stage or save
61
+
62
+ - **A staged proposal refuses the axes the player typed after your call read the draft.** The
63
+ refusal names the axes; read the draft again and propose against what they now have. Another
64
+ surface's write to a *different* axis is retried once for you, then reported as a conflict.
65
+
66
+ - **`STRATEGY_BINDING` is refused on an agent that exists.** Rebinding replaces an agent's
67
+ configuration and stays its own confirmed call, `rebind_intelligence_agent`.
68
+
69
+ - **`update_intelligence_agent` and `rebind_intelligence_agent` answer `CONFLICT` while the player
70
+ holds a draft for that agent**, naming staging as the act available. Nothing about their input or
71
+ output changed, and a caller whose player holds no draft is unaffected — this is the one change
72
+ existing code can observe.
73
+
74
+ ### Vocabulary
75
+
76
+ `toolCount` 122 → 126. No input or output schema of an existing tool moves.
77
+
27
78
  ## Contract history — v64
28
79
 
29
80
  **Breaking, and it is a removal you will feel on two tools.** A vocabulary that never depended on
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.39";
52
+ export declare const PACKAGE_VERSION = "31.2.41";
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.39';
55
+ export const PACKAGE_VERSION = '31.2.41';
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.39",
3
+ "version": "31.2.41",
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.