pog-mcp 0.9.23 → 1.1.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,62 @@
1
+ # Changelog — pog-mcp
2
+
3
+ ## 1.1.0 — 2026-09-15
4
+
5
+ - **`create_squad` refuses `players` on a deployment with playbooks on (#882).**
6
+ There the server builds squads only from a `template`; a hand-built eleven is
7
+ answered with a structured `{ error: "template_required", useField: "template",
8
+ templates: [...] }` and nothing is created, so the same call with `template` is
9
+ a safe retry. The refusal is the server's: the tool sends the request and maps
10
+ the `template_required` answer, so a signed-out, expired or server-revoked
11
+ session still gets "call login first" / its 401. With playbooks off,
12
+ `players` behaves exactly as in 1.0.0.
13
+
14
+ ## 1.0.0 — 2026-09-14
15
+
16
+ **Agents field a team through a playbook. Player numbers are no longer an agent
17
+ input.** The migration guide is the Skill's own section,
18
+ [`skill/SKILL.md` → "What changed in 1.0"](skill/SKILL.md).
19
+
20
+ The tool surface is the one 0.9.22 shipped. What 1.0.0 adds is the contract:
21
+ the Skill and README are rewritten around it, and the major version says out
22
+ loud that the changes below break a 0.x workflow — some of them arrived in
23
+ 0.9.20–0.9.22 under minor versions, which understated them.
24
+
25
+ ### Breaking
26
+
27
+ - **The Skill no longer publishes squad-building advice.** The ability-allocation
28
+ guidance, the engine expressions (keeper and kicker arithmetic), the
29
+ scarce-value budget table and the related rules of thumb were removed, not
30
+ corrected: numbers are fixed when a player is created, so there is nothing
31
+ left to allocate. The measurements remain, marked as history, in
32
+ `skill/reference/measurements.md`.
33
+ - **`create_squad` takes `template`.** Send exactly one of `template` (`balanced`,
34
+ `attack-wide`, `defend-counter`, `set-piece`) or the legacy `players` array; the
35
+ tool refuses both and neither. A template squad has its playbook saved and
36
+ activated.
37
+ - **`update_squad` is not how a playbook squad changes.** Once a squad's playbook
38
+ is active, lineup edits are refused with `lineup_managed_by_playbook` and
39
+ `useTool: "set_playbook"`; a rename that sends the players back unchanged still
40
+ goes through.
41
+ - **Ability input fields are deprecated** on `create_squad` (`players`),
42
+ `update_squad` and, for your own side, `simulate_batch`. While the weekly pool
43
+ is enabled any change to a created player's numbers is refused with
44
+ `player_vector_changed`. A later release replaces your own side in
45
+ `simulate_batch` with playbook text.
46
+
47
+ ### Added (shipped in 0.9.20–0.9.22, first documented here)
48
+
49
+ - `get_playbook`, `set_playbook`, `dryrun_playbook`, `get_match_report`.
50
+ - A playbook's `kickers` is an override the server honors (0.9.22, #864): each
51
+ of `fk`/`pk` is optional, a written role is forced, a left-out one is picked
52
+ automatically by `set_piece`, an override that cannot be resolved keeps the
53
+ automatic pick with a `kickerFallback` warning instead of failing, and
54
+ `kickers: { fk: auto }` in a rule hands a role back. `#1` is the goalkeeper.
55
+
56
+ ### What this release cannot take back
57
+
58
+ Every 0.x tarball on npm still carries the old Skill, and npm does not allow a
59
+ published version to be edited. Minted players' numbers stay public in their
60
+ permanent on-chain metadata by design; past API responses and the npm version
61
+ history cannot be recalled. The Skill's "What cannot be taken back" section says
62
+ the same to agents.
package/README.md CHANGED
@@ -6,13 +6,23 @@ this adds is that the agent no longer has to read a runbook, hold a Solana
6
6
  keypair, or guess payload shapes.
7
7
 
8
8
  ```
9
- login → get_game_rules → create_squad → play_friendly → get_match
10
- ↑ │
11
- └─── update_squad ───┘
9
+ login → create_squad(template) → get_playbook → set_playbook → play_playoff → get_match_report
10
+ ↑ │
11
+ └──────────── revise ──────────────┘
12
12
  ```
13
13
 
14
- That loop back is the game. A wallet holds one squad; you improve it by playing
15
- friendlies and rewriting the lineup, not by building new teams.
14
+ That loop back is the game. A wallet holds one squad, and every player's numbers
15
+ are fixed once the player is created (while the weekly player pool is enabled,
16
+ which is the default). You change how the squad plays by revising its playbook —
17
+ formation, style and conditional rules. Where that playbook is active
18
+ (`get_playbook` reports `active`; playbooks are a deployment switch, off unless
19
+ the operator turns it on), the server compiles it at each ranked or scheduled
20
+ kickoff — and for a daily cup ONCE, when the cup opens, into an eleven that plays
21
+ every round. You do not build new teams, and you do not rewrite numbers.
22
+
23
+ **1.0 is a breaking release** for anyone driving 0.x: see
24
+ [`CHANGELOG.md`](CHANGELOG.md), and the Skill's "What changed in 1.0" section for
25
+ the migration.
16
26
 
17
27
  Across sessions the wallet file is the account, so the agent returns as the same
18
28
  manager. Cups and league fixtures resolve on a scheduler, hours after they start,
@@ -126,8 +136,8 @@ the kind of thing a refactor breaks silently.
126
136
  | `revoke_sessions` | — | End one session by tag, or all of them. Also signs with the key rather than the current token, so a stolen token cannot sign the owner out. |
127
137
  | `get_game_rules` | — | Squad constraints and how the daily cup works. Read before building. |
128
138
  | `list_nations` | — | Code→name map. Pass `nationCode` for that nation's name pools. |
129
- | `create_squad` | ✓ | 11 players, 212 points. One squad per wallet — a second attempt redirects you to `update_squad`. |
130
- | `update_squad` | ✓ | Rewrite the lineup you own. Applies to the next unsimulated match. |
139
+ | `create_squad` | ✓ | Send `template` (`balanced`, `attack-wide`, `defend-counter`, `set-piece`): the server builds a legal squad and activates that template's playbook. The hand-built `players` form is legacy and its ability fields are deprecated. One squad per wallet — a second attempt tells you which tool changes the one you have. |
140
+ | `update_squad` | ✓ | Rewrite the lineup of a squad WITHOUT an active playbook; once one is active, lineup edits are refused with `lineup_managed_by_playbook` — use `set_playbook`. While the weekly pool is enabled (the default) a change to any player's numbers is refused with `player_vector_changed`; only that pool's rollback accepts changes to unminted players. Applies to the next unsimulated match. |
131
141
  | `my_squads` | ✓ | Squads owned by this wallet. |
132
142
  | `get_playbook` | ✓ | Your squad's playbook (pog) text, version, style summary, lineup preview, and whether kickoff actually uses it. |
133
143
  | `set_playbook` | ✓ | Save a new playbook version. Parse errors and unsatisfiable documents come back as structured data and save nothing. |
@@ -155,12 +165,13 @@ the kind of thing a refactor breaks silently.
155
165
  ## The Skill
156
166
 
157
167
  MCP gives an agent the ability to act; it does not give it judgment. An agent
158
- with only these tools builds a squad by splitting 212 points evenly across
159
- eleven players, which is measurably the worst thing you can build.
168
+ with only these tools writes a playbook without knowing which style axes are
169
+ decisions and which only need getting right once — and tries to test a rule with
170
+ a friendly, which never uses a playbook at all.
160
171
 
161
- `skill/SKILL.md` is the other half: what the engine actually rewards, and how
162
- many friendlies a conclusion needs before it means anything. Install it for
163
- Claude Code with
172
+ `skill/SKILL.md` is the other half: how to write a playbook and read the report
173
+ after a match, and how many results a conclusion needs before it means anything.
174
+ Install it for Claude Code with
164
175
 
165
176
  ```bash
166
177
  tgz="$(npm pack pog-mcp --silent)" && tar -xzf "$tgz" \
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAKL,SAAS,EAIV,MAAM,aAAa,CAAC;AAQrB,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAohDrB,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAyBD,wBAAgB,WAAW,CAAC,IAAI,GAAE,kBAAuB,GAAG,SAAS,CA+iHpE"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAKL,SAAS,EAIV,MAAM,aAAa,CAAC;AAQrB,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,aAAa,CAAC;AAuiDrB,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAyBD,wBAAgB,WAAW,CAAC,IAAI,GAAE,kBAAuB,GAAG,SAAS,CA0jHpE"}
package/dist/server.js CHANGED
@@ -1211,6 +1211,23 @@ function fail(err) {
1211
1211
  function failStructured(value) {
1212
1212
  return { content: [{ type: 'text', text: JSON.stringify(value) }], isError: true };
1213
1213
  }
1214
+ /**
1215
+ * #882 (3A) — create_squad's answer when the deployment builds squads only from
1216
+ * a template. Structured so an agent branches on `useField` instead of parsing
1217
+ * prose; nothing was created, so a retry with `template` is safe.
1218
+ */
1219
+ function templateRequired() {
1220
+ return {
1221
+ created: false,
1222
+ error: 'template_required',
1223
+ useField: 'template',
1224
+ templates: [...POG_TEMPLATE_IDS],
1225
+ message: 'This deployment has playbooks on, so a squad is built from a template, not from a ' +
1226
+ 'hand-built players array. Nothing was created. Call create_squad again with the same ' +
1227
+ `name and nationCode and \`template\` set to one of ${POG_TEMPLATE_IDS.join(', ')}; then ` +
1228
+ 'change how the team plays with set_playbook.',
1229
+ };
1230
+ }
1214
1231
  /** The parsed error body's `error` code, when the API sent one. */
1215
1232
  function apiErrorCode(err) {
1216
1233
  const b = err.body;
@@ -1848,7 +1865,9 @@ export function buildServer(opts = {}) {
1848
1865
  'you and saves and activates that template’s playbook, so there is nothing to construct; ' +
1849
1866
  'then read it with get_playbook and change how the team plays with set_playbook. ' +
1850
1867
  'Send EITHER `template` OR `players`, never both. `players` is the legacy hand-built form ' +
1851
- `(its ability fields are deprecated): ${SQUAD_RULES} ` +
1868
+ 'and is REFUSED on a deployment with playbooks on (get_playbook reports `playbookEnabled`): ' +
1869
+ 'there the answer is `template_required` with `useField: "template"` and nothing is created. ' +
1870
+ `Where it is still accepted its ability fields are deprecated: ${SQUAD_RULES} ` +
1852
1871
  'On rejection the error names the specific rule that failed, so fix and retry rather than guessing.',
1853
1872
  inputSchema: {
1854
1873
  name: z
@@ -1885,6 +1904,12 @@ export function buildServer(opts = {}) {
1885
1904
  return fail(new Error('Send exactly one of `template` (recommended — e.g. "balanced") or `players` (legacy ' +
1886
1905
  'hand-built eleven), not ' + (template === undefined ? 'neither' : 'both') + '.'));
1887
1906
  }
1907
+ // #882 (3A) — no client-side preflight. With playbooks on, the SERVER
1908
+ // refuses a hand-built eleven (template_required, mapped in the catch
1909
+ // below), and only for a live session — so a signed-out, expired or
1910
+ // server-revoked session still gets its 401 and the agent is told to log
1911
+ // in. Review r2/r3 (P2): a preflight against the public status route
1912
+ // could not know the session's server-side state and masked those 401s.
1888
1913
  try {
1889
1914
  const created = template !== undefined
1890
1915
  ? await client.createTeam({ name, nationCode, template })
@@ -1911,6 +1936,9 @@ export function buildServer(opts = {}) {
1911
1936
  // agent whose only problem was a duplicate team name to go call
1912
1937
  // update_squad with a teamId it does not have — a dead end, when the fix
1913
1938
  // was simply to pick another name.
1939
+ if (err instanceof ApiError && err.status === 400 && apiErrorCode(err) === 'template_required') {
1940
+ return failStructured(templateRequired());
1941
+ }
1914
1942
  if (err instanceof ApiError && err.status === 409) {
1915
1943
  if (err.teamId !== undefined || /team_exists/i.test(err.message)) {
1916
1944
  const existing = err.teamId ?? '(see my_squads)';