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