@withpica/mcp-sdk 1.3.0 → 1.7.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,237 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@withpica/mcp-sdk` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ > **Rule of the road:** every version bump to this package MUST land with a
9
+ > matching entry here in the same commit. See the project's "npm publish
10
+ > discipline" memory entry for the enforcement rationale.
11
+
12
+ ## [Unreleased]
13
+
14
+ ## [1.7.0] - 2026-04-18
15
+
16
+ ### Fixed
17
+
18
+ - **ADR-179 Phase 3 SDK gap: `EnrichmentResource.resolveRecording` method
19
+ added.** The type `ResolveRecordingResult` shipped with commit
20
+ `63d97dd28` but the method itself was missing — `mcp-server/` stdio
21
+ tool `pica_resolve_recording` called `this.pica.enrichment.resolveRecording(...)`
22
+ against a method that didn't exist, breaking sub-package typecheck and
23
+ runtime. Signature mirrors `resolveWork` / `resolvePerson`:
24
+ `resolveRecording(recordingId, { sources?, includeFuzzy? })`. Routes to
25
+ `POST /admin/recordings/{id}/resolve`.
26
+
27
+ ### Added
28
+
29
+ - **ADR-174 Phase 2 item 7 follow-up: `ProjectsResource.attachWork`.** New
30
+ SDK method wrapping `POST /admin/projects/{id}/works` — closes the
31
+ `work_ids` gap on `pica_projects_create` / `_update` where the admin
32
+ route silently dropped the field. Signature:
33
+ `attachWork(projectId, { work_id, project_day?, notes? })`. Backs the
34
+ new `pica_projects_attach_works` batch MCP tool (loops one SDK call
35
+ per item) in `@withpica/mcp-server`.
36
+
37
+ ### Changed
38
+
39
+ - **ADR-174 Phase 2 item 22: `PublishersResource.create` signature widened
40
+ to `Record<string, unknown>`.** Pre-slice the method was typed
41
+ `{ name: string; ipi?: string }` and returned 404 at runtime (the route
42
+ did not exist). With the new `POST /api/admin/publishers` route shipped
43
+ in the companion commit, the SDK now accepts the full audit-row-22
44
+ surface (name, ipi_number, legal_name, country, isni, publisher_type,
45
+ wikidata_id, parent_publisher_id, founded_date, headquarters). The
46
+ `ipi → ipi_number` rename is explicit at the route layer — callers
47
+ still passing `ipi` get a PHANTOM_FIELD error with a rename hint.
48
+
49
+ ### Added
50
+
51
+ - **ADR-179 Phase 1: `EnrichmentResource.resolveWork(workId, options?)`.**
52
+ Outcome-shaped resolver that fans a work out across every eligible
53
+ enrichment source in one call. Wraps the new `POST /admin/works/{id}/resolve`
54
+ endpoint. Accepts an optional `sources` whitelist (`mlc` | `spotify` |
55
+ `youtube` | `musicbrainz` | `discogs`) and `includeFuzzy` flag.
56
+ Returns `ResolveWorkResult` with `applied[]` (Tier A writes),
57
+ `proposals[]` (Tier B review queue rows), `errors[]` (per-source
58
+ failures with circuit-breaker retry hints), and `recovery_hints[]`.
59
+ `ResolveWorkResult` is exported from the SDK's public surface.
60
+ The five per-source `enrichWorkMlc` / `enrichWorkSpotify` /
61
+ `enrichWorkYouTube` / `enrichWorkMusicBrainz` / `enrichWorkDiscogs`
62
+ methods remain available this release but are deprecated at the MCP
63
+ tool layer; the next minor will remove them from the SDK.
64
+ - **ADR-179 Phase 2: `EnrichmentResource.resolvePerson(personId, options?)`.**
65
+ Outcome-shaped person resolver mirroring `resolveWork`. Wraps the new
66
+ `POST /admin/people/{id}/resolve` endpoint. Accepts an optional
67
+ `sources` whitelist (`isni` | `musicbrainz`) and `includeFuzzy` flag.
68
+ Returns `ResolvePersonResult` with the same applied/proposals/errors
69
+ shape. The legacy `PeopleResource.enrichFromISNI` /
70
+ `enrichFromMusicBrainz` methods remain available this release but
71
+ are deprecated at the MCP tool layer; the next minor will remove
72
+ them from the SDK.
73
+ - **ADR-179 Phase 3: `EnrichmentResource.resolveRecording(recordingId, options?)`.**
74
+ Outcome-shaped recording resolver mirroring `resolveWork` /
75
+ `resolvePerson`. Wraps the new `POST /admin/recordings/{id}/resolve`
76
+ endpoint. Accepts an optional `sources` whitelist (`spotify` |
77
+ `youtube` | `musicbrainz` | `discogs`) and `includeFuzzy` flag.
78
+ Returns `ResolveRecordingResult` with the same applied/proposals/
79
+ errors shape. First recording-side enrichment surface on the SDK.
80
+ MusicBrainz + Discogs adapters are stubs server-side for now —
81
+ they surface eligibility via `sources_run` but make no external
82
+ calls until their corresponding cascade rules ship.
83
+ - `/resolve` path added to `LONG_TIMEOUT_PATTERNS` so the fan-out (up
84
+ to five sequential external API calls) gets the 120s long-timeout
85
+ instead of the default 30s. Covers both the work and person resolver
86
+ routes.
87
+
88
+ ## [1.7.0] — 2026-04-16
89
+
90
+ ### Added
91
+
92
+ - **ADR-178: `EnrichmentResource.proposeAgentResearch(input)`.** New
93
+ SDK method wraps the `POST /admin/enrichment-proposals` route that
94
+ backs the `pica_enrichment_propose` MCP tool (stdio in
95
+ `@withpica/mcp-server@2.17.0`, HTTP in
96
+ `@withpica/mcp-server-business@1.5.0`). Input is snake_case through-
97
+ out (matches the REST route, matches the agent-facing tool schema —
98
+ no case-translation layer). Response on success is `{ proposal_id,
99
+ source: 'agent_research', rule_id: 'agent_research', status:
100
+ 'pending' }`. Five documented client-error shapes surface through
101
+ `ApiError`: `MISSING_SOURCE` (400), `MISSING_FIELDS` (400),
102
+ `INVALID_SOURCE_SHAPE` (400), `ENTITY_NOT_FOUND` (404),
103
+ `DUPLICATE_SUPPRESSED` (409). Consumers parse the error code from
104
+ the JSON response body inside the thrown `ApiError` — the MCP tool
105
+ layer lifts it into `structuredContent.code` so agents can reason
106
+ about failure shape without free-text parsing.
107
+
108
+ ## [1.6.0] — 2026-04-14
109
+
110
+ ### Added
111
+
112
+ - **ADR-173: release-track primitives on `ReleasesResource`.** Five new
113
+ methods back the ADR-173 MCP tools: `attachTrack`, `listTracks`,
114
+ `detachTrack`, `reorderTracks`, `attachRecordingWithWork`. Routes map
115
+ to new admin endpoints under `/admin/releases/[id]/tracks` (and
116
+ sub-paths `/reorder`, `/detach`, `/attach-recording-with-work`).
117
+ - **`WorksResource.listReleases` + `RecordingsResource.listReleases`.**
118
+ Back the new `releases` section on `pica_works_inspect` and
119
+ `pica_recordings_inspect` — each returns every release the entity
120
+ appears on with its track position.
121
+
122
+ ## [1.5.0] — 2026-04-14
123
+
124
+ ### Added
125
+
126
+ - **ADR-174 Phase 2: `LabelsResource`** — new read-only SDK resource for
127
+ resolving label names to `organisations.id` (used as
128
+ `releases.label_organization_id`). `pica.labels.list({ query?, limit? })`
129
+ returns an array of `LabelOrganisation` rows (organisations with
130
+ `org_type='label'`). Exports the `LabelOrganisation` type.
131
+
132
+ ## [1.4.0] — 2026-04-11
133
+
134
+ ### Added
135
+
136
+ - **ADR-166: YouTube import SDK methods** (`78da58344`)
137
+ - `ImportResource.youtubeLinkPreview(url)` — POSTs to
138
+ `/admin/import/youtube-link` with just `url`. Returns the preview
139
+ payload (items + classification + work match).
140
+ - `ImportResource.youtubeLinkImport(url, options)` — POSTs with
141
+ `confirm: true` plus optional `selectedVideoIds`, `targetWorkId`,
142
+ `overrideVersionType`. Returns the import result.
143
+ - **ADR-163: Tier B enrichment proposal review SDK methods** (`ff9cf265a`)
144
+ - `EnrichmentResource.listEnrichmentProposals(params)` — GETs
145
+ `/admin/enrichment-proposals` with filter query params (`entity_type`,
146
+ `entity_id`, `rule_id`, `source`, `limit`, `offset`). Returns the
147
+ page of pending proposals.
148
+ - `EnrichmentResource.applyEnrichmentProposal(id, options)` — POSTs to
149
+ `/admin/enrichment-proposals/:id/apply` with `{ force, resolution_note }`.
150
+ For update proposals, drift detection runs first; if the entity has
151
+ changed since the proposal was created, the response is
152
+ `{ status: 'drift_detected', conflicts }` and nothing is written —
153
+ pass `force: true` on retry after reviewing the conflicts. For
154
+ create proposals a uniqueness check runs and cannot be forced.
155
+ - `EnrichmentResource.rejectEnrichmentProposal(id, options)` — POSTs
156
+ to `/admin/enrichment-proposals/:id/reject` with `{ resolution_note }`.
157
+ Content-hash suppression permanently blocks re-proposal of the same
158
+ exact content.
159
+
160
+ ### Notes
161
+
162
+ - Two additive changes, no signature changes to existing methods. Minor
163
+ bump per semver.
164
+ - Consumer packages pin `"@withpica/mcp-sdk": "^1.0.0"`, so the caret
165
+ range picks up `1.4.0` automatically.
166
+ - Source additions landed earlier: YouTube methods in `78da58344`
167
+ (feat(adr-166): phase 4 — pica_import_youtube_link MCP tool + SDK
168
+ methods), Tier B proposal methods in `ff9cf265a` (feat(adr-163) phase
169
+ 3c+3d).
170
+ - Version bump carried in `ff97faa56` (feat(adr-163 phase 6): MCP HTTP
171
+ transport parity + version bumps). That commit shipped the bump
172
+ without its matching changelog entry — this is the follow-up commit
173
+ closing the discipline gap.
174
+
175
+ ## [1.3.0] — 2026-04-11
176
+
177
+ ### Added
178
+
179
+ - **ADR-164: cascade control + observability SDK methods.**
180
+ - `runWorkCascade(workId)` — manually re-evaluate a work against every
181
+ ADR-164 cascade rule. POSTs to `/admin/works/:id/cascade-run`. Agents
182
+ can retry enrichment after a fix without waiting for the daily sweep.
183
+ - `runPersonCascade(personId)` — same for people. POSTs to
184
+ `/admin/people/:id/cascade-run`.
185
+ - `getCascadeHealth()` — snapshot of the in-process cascade failure +
186
+ outcome counters. GETs `/admin/cascade-health` (org-auth twin of the
187
+ operator-only `/api/internal/cascade-health` endpoint that uses
188
+ `CRON_SECRET`).
189
+
190
+ ### Notes
191
+
192
+ - All three additions are backwards-compatible. Minor bump per semver.
193
+ - All `@withpica/*` consumer packages pin `"@withpica/mcp-sdk": "^1.0.0"`,
194
+ so a `1.3.0` caret range picks up automatically — no transitive bumps.
195
+ - Tagged in commit `edfbcb07b` (`chore(mcp-sdk): bump to 1.3.0`), which
196
+ also carried the matching `mcp-server@2.9.0` bump + rebuilt dist.
197
+ - Source additions landed earlier in `38901f281` (ADR-164 audit
198
+ follow-ups).
199
+
200
+ ## [1.2.0] — 2026-04-10
201
+
202
+ ### Changed
203
+
204
+ - Version bump carried in `7c4f5d24a` (`chore(adr-162): version bumps for
205
+ npm publish`) alongside the ADR-162 subscription-based billing rollout.
206
+ No user-visible SDK API changes — the bump reflects the coupled release
207
+ of all `@withpica/*` packages under the new billing contract.
208
+
209
+ ## [1.1.0] — 2026-04-08
210
+
211
+ ### Changed
212
+
213
+ - Carried in `91dd1c275` (`chore(adr-158c): version bumps for custody
214
+ tool release (Phase 6b)`). Releases the custody-claim / custody-respond
215
+ / custody-history tool surface via coupled bumps across the MCP package
216
+ set.
217
+
218
+ ## [1.0.0] — 2026-04-07
219
+
220
+ ### Added
221
+
222
+ - Initial public release. Package split out from the legacy monolithic
223
+ `mcp-server` in `e235aed40` (`feat(mcp): ADR-155 launch — publish 6
224
+ packages, lobby-mode connect copy`). Provides the shared `PicaClient`
225
+ class that every `@withpica/mcp-server-*` package consumes for REST
226
+ access to PICA.
227
+
228
+ > **Pre-changelog era:** before `1.0.0`, the SDK lived inline in
229
+ > `@withpica/mcp-server` source. Version history for that era is
230
+ > reconstructable via `git log --follow -- mcp-server-shared/mcp-sdk/`.
231
+
232
+ [Unreleased]: https://github.com/withpica/pica/compare/ff97faa56...HEAD
233
+ [1.4.0]: https://github.com/withpica/pica/compare/edfbcb07b...ff97faa56
234
+ [1.3.0]: https://github.com/withpica/pica/compare/7c4f5d24a...edfbcb07b
235
+ [1.2.0]: https://github.com/withpica/pica/compare/91dd1c275...7c4f5d24a
236
+ [1.1.0]: https://github.com/withpica/pica/compare/e235aed40...91dd1c275
237
+ [1.0.0]: https://github.com/withpica/pica/commit/e235aed40