@withpica/mcp-server 2.35.0 → 2.40.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.
Files changed (215) hide show
  1. package/CHANGELOG.md +289 -1
  2. package/dist/apps/release.d.ts +2 -0
  3. package/dist/apps/release.d.ts.map +1 -0
  4. package/dist/apps/release.js +69 -0
  5. package/dist/apps/release.js.map +1 -0
  6. package/dist/resources/agent-guide.d.ts +15 -0
  7. package/dist/resources/agent-guide.d.ts.map +1 -0
  8. package/dist/resources/agent-guide.js +120 -0
  9. package/dist/resources/agent-guide.js.map +1 -0
  10. package/dist/resources/index.d.ts.map +1 -1
  11. package/dist/resources/index.js +80 -0
  12. package/dist/resources/index.js.map +1 -1
  13. package/dist/resources/required-schemas.generated.d.ts +128 -0
  14. package/dist/resources/required-schemas.generated.d.ts.map +1 -0
  15. package/dist/resources/required-schemas.generated.js +344 -0
  16. package/dist/resources/required-schemas.generated.js.map +1 -0
  17. package/dist/resources/required-schemas.source.d.ts +53 -0
  18. package/dist/resources/required-schemas.source.d.ts.map +1 -0
  19. package/dist/resources/required-schemas.source.js +127 -0
  20. package/dist/resources/required-schemas.source.js.map +1 -0
  21. package/dist/server-instructions.d.ts +28 -0
  22. package/dist/server-instructions.d.ts.map +1 -1
  23. package/dist/server-instructions.js +34 -0
  24. package/dist/server-instructions.js.map +1 -1
  25. package/dist/server.d.ts.map +1 -1
  26. package/dist/server.js +11 -2
  27. package/dist/server.js.map +1 -1
  28. package/dist/tools/agent-identity.d.ts.map +1 -1
  29. package/dist/tools/agent-identity.js +5 -0
  30. package/dist/tools/agent-identity.js.map +1 -1
  31. package/dist/tools/agreement-types.d.ts.map +1 -1
  32. package/dist/tools/agreement-types.js +8 -0
  33. package/dist/tools/agreement-types.js.map +1 -1
  34. package/dist/tools/agreements.d.ts.map +1 -1
  35. package/dist/tools/agreements.js +6 -0
  36. package/dist/tools/agreements.js.map +1 -1
  37. package/dist/tools/analytics.d.ts.map +1 -1
  38. package/dist/tools/analytics.js +6 -0
  39. package/dist/tools/analytics.js.map +1 -1
  40. package/dist/tools/app-tools.d.ts.map +1 -1
  41. package/dist/tools/app-tools.js +3 -0
  42. package/dist/tools/app-tools.js.map +1 -1
  43. package/dist/tools/assets.d.ts.map +1 -1
  44. package/dist/tools/assets.js +11 -0
  45. package/dist/tools/assets.js.map +1 -1
  46. package/dist/tools/audio-files.d.ts.map +1 -1
  47. package/dist/tools/audio-files.js +6 -0
  48. package/dist/tools/audio-files.js.map +1 -1
  49. package/dist/tools/audit.d.ts +1 -1
  50. package/dist/tools/audit.d.ts.map +1 -1
  51. package/dist/tools/audit.js +2 -1
  52. package/dist/tools/audit.js.map +1 -1
  53. package/dist/tools/auth.d.ts.map +1 -1
  54. package/dist/tools/auth.js +2 -0
  55. package/dist/tools/auth.js.map +1 -1
  56. package/dist/tools/bulk.d.ts.map +1 -1
  57. package/dist/tools/bulk.js +2 -0
  58. package/dist/tools/bulk.js.map +1 -1
  59. package/dist/tools/calendar.d.ts.map +1 -1
  60. package/dist/tools/calendar.js +1 -0
  61. package/dist/tools/calendar.js.map +1 -1
  62. package/dist/tools/collaborators.d.ts.map +1 -1
  63. package/dist/tools/collaborators.js +7 -0
  64. package/dist/tools/collaborators.js.map +1 -1
  65. package/dist/tools/comparisons.d.ts.map +1 -1
  66. package/dist/tools/comparisons.js +2 -0
  67. package/dist/tools/comparisons.js.map +1 -1
  68. package/dist/tools/credits.d.ts +23 -0
  69. package/dist/tools/credits.d.ts.map +1 -1
  70. package/dist/tools/credits.js +202 -0
  71. package/dist/tools/credits.js.map +1 -1
  72. package/dist/tools/custody.d.ts.map +1 -1
  73. package/dist/tools/custody.js +6 -0
  74. package/dist/tools/custody.js.map +1 -1
  75. package/dist/tools/dashboard.d.ts.map +1 -1
  76. package/dist/tools/dashboard.js +8 -0
  77. package/dist/tools/dashboard.js.map +1 -1
  78. package/dist/tools/directory.d.ts.map +1 -1
  79. package/dist/tools/directory.js +1 -0
  80. package/dist/tools/directory.js.map +1 -1
  81. package/dist/tools/discovery.d.ts.map +1 -1
  82. package/dist/tools/discovery.js +27 -2
  83. package/dist/tools/discovery.js.map +1 -1
  84. package/dist/tools/disputes.d.ts.map +1 -1
  85. package/dist/tools/disputes.js +1 -0
  86. package/dist/tools/disputes.js.map +1 -1
  87. package/dist/tools/documents.d.ts.map +1 -1
  88. package/dist/tools/documents.js +1 -0
  89. package/dist/tools/documents.js.map +1 -1
  90. package/dist/tools/duplicates.d.ts.map +1 -1
  91. package/dist/tools/duplicates.js +2 -0
  92. package/dist/tools/duplicates.js.map +1 -1
  93. package/dist/tools/enrichment.d.ts.map +1 -1
  94. package/dist/tools/enrichment.js +11 -0
  95. package/dist/tools/enrichment.js.map +1 -1
  96. package/dist/tools/exports.d.ts.map +1 -1
  97. package/dist/tools/exports.js +5 -0
  98. package/dist/tools/exports.js.map +1 -1
  99. package/dist/tools/feedback.d.ts.map +1 -1
  100. package/dist/tools/feedback.js +1 -0
  101. package/dist/tools/feedback.js.map +1 -1
  102. package/dist/tools/import-documents.d.ts.map +1 -1
  103. package/dist/tools/import-documents.js +3 -0
  104. package/dist/tools/import-documents.js.map +1 -1
  105. package/dist/tools/import.d.ts.map +1 -1
  106. package/dist/tools/import.js +8 -0
  107. package/dist/tools/import.js.map +1 -1
  108. package/dist/tools/index.d.ts +21 -0
  109. package/dist/tools/index.d.ts.map +1 -1
  110. package/dist/tools/index.js +34 -1
  111. package/dist/tools/index.js.map +1 -1
  112. package/dist/tools/integrations.d.ts.map +1 -1
  113. package/dist/tools/integrations.js +1 -0
  114. package/dist/tools/integrations.js.map +1 -1
  115. package/dist/tools/labels.d.ts.map +1 -1
  116. package/dist/tools/labels.js +1 -0
  117. package/dist/tools/labels.js.map +1 -1
  118. package/dist/tools/licensing.d.ts.map +1 -1
  119. package/dist/tools/licensing.js +5 -0
  120. package/dist/tools/licensing.js.map +1 -1
  121. package/dist/tools/memory.d.ts.map +1 -1
  122. package/dist/tools/memory.js +4 -0
  123. package/dist/tools/memory.js.map +1 -1
  124. package/dist/tools/metadata.d.ts.map +1 -1
  125. package/dist/tools/metadata.js +39 -0
  126. package/dist/tools/metadata.js.map +1 -1
  127. package/dist/tools/multimedia.d.ts.map +1 -1
  128. package/dist/tools/multimedia.js +5 -0
  129. package/dist/tools/multimedia.js.map +1 -1
  130. package/dist/tools/my-reported-issues.d.ts.map +1 -1
  131. package/dist/tools/my-reported-issues.js +1 -0
  132. package/dist/tools/my-reported-issues.js.map +1 -1
  133. package/dist/tools/notes.d.ts.map +1 -1
  134. package/dist/tools/notes.js +4 -0
  135. package/dist/tools/notes.js.map +1 -1
  136. package/dist/tools/notifications.d.ts.map +1 -1
  137. package/dist/tools/notifications.js +6 -0
  138. package/dist/tools/notifications.js.map +1 -1
  139. package/dist/tools/onboarding.d.ts.map +1 -1
  140. package/dist/tools/onboarding.js +1 -0
  141. package/dist/tools/onboarding.js.map +1 -1
  142. package/dist/tools/people.d.ts.map +1 -1
  143. package/dist/tools/people.js +5 -0
  144. package/dist/tools/people.js.map +1 -1
  145. package/dist/tools/projects.d.ts.map +1 -1
  146. package/dist/tools/projects.js +6 -0
  147. package/dist/tools/projects.js.map +1 -1
  148. package/dist/tools/public-filter.d.ts.map +1 -1
  149. package/dist/tools/public-filter.js +2 -0
  150. package/dist/tools/public-filter.js.map +1 -1
  151. package/dist/tools/publishers.d.ts.map +1 -1
  152. package/dist/tools/publishers.js +2 -0
  153. package/dist/tools/publishers.js.map +1 -1
  154. package/dist/tools/recording-attribution-hints.d.ts +24 -0
  155. package/dist/tools/recording-attribution-hints.d.ts.map +1 -0
  156. package/dist/tools/recording-attribution-hints.js +27 -0
  157. package/dist/tools/recording-attribution-hints.js.map +1 -0
  158. package/dist/tools/recordings.d.ts.map +1 -1
  159. package/dist/tools/recordings.js +35 -3
  160. package/dist/tools/recordings.js.map +1 -1
  161. package/dist/tools/release-rich.d.ts +31 -0
  162. package/dist/tools/release-rich.d.ts.map +1 -0
  163. package/dist/tools/release-rich.js +241 -0
  164. package/dist/tools/release-rich.js.map +1 -0
  165. package/dist/tools/releases.d.ts.map +1 -1
  166. package/dist/tools/releases.js +14 -0
  167. package/dist/tools/releases.js.map +1 -1
  168. package/dist/tools/report-issue.d.ts.map +1 -1
  169. package/dist/tools/report-issue.js +1 -0
  170. package/dist/tools/report-issue.js.map +1 -1
  171. package/dist/tools/royalties.d.ts.map +1 -1
  172. package/dist/tools/royalties.js +5 -0
  173. package/dist/tools/royalties.js.map +1 -1
  174. package/dist/tools/search.d.ts.map +1 -1
  175. package/dist/tools/search.js +3 -0
  176. package/dist/tools/search.js.map +1 -1
  177. package/dist/tools/send.d.ts.map +1 -1
  178. package/dist/tools/send.js +3 -0
  179. package/dist/tools/send.js.map +1 -1
  180. package/dist/tools/sessions.d.ts.map +1 -1
  181. package/dist/tools/sessions.js +4 -0
  182. package/dist/tools/sessions.js.map +1 -1
  183. package/dist/tools/settings.d.ts.map +1 -1
  184. package/dist/tools/settings.js +9 -0
  185. package/dist/tools/settings.js.map +1 -1
  186. package/dist/tools/share-links.d.ts.map +1 -1
  187. package/dist/tools/share-links.js +5 -0
  188. package/dist/tools/share-links.js.map +1 -1
  189. package/dist/tools/signup.d.ts +26 -0
  190. package/dist/tools/signup.d.ts.map +1 -0
  191. package/dist/tools/signup.js +266 -0
  192. package/dist/tools/signup.js.map +1 -0
  193. package/dist/tools/split-sheets.d.ts.map +1 -1
  194. package/dist/tools/split-sheets.js +7 -0
  195. package/dist/tools/split-sheets.js.map +1 -1
  196. package/dist/tools/subscription.d.ts +60 -0
  197. package/dist/tools/subscription.d.ts.map +1 -0
  198. package/dist/tools/subscription.js +442 -0
  199. package/dist/tools/subscription.js.map +1 -0
  200. package/dist/tools/team.d.ts.map +1 -1
  201. package/dist/tools/team.js +5 -0
  202. package/dist/tools/team.js.map +1 -1
  203. package/dist/tools/telegram.d.ts.map +1 -1
  204. package/dist/tools/telegram.js +3 -0
  205. package/dist/tools/telegram.js.map +1 -1
  206. package/dist/tools/uploads.d.ts.map +1 -1
  207. package/dist/tools/uploads.js +2 -0
  208. package/dist/tools/uploads.js.map +1 -1
  209. package/dist/tools/works.d.ts.map +1 -1
  210. package/dist/tools/works.js +7 -0
  211. package/dist/tools/works.js.map +1 -1
  212. package/package.json +9 -5
  213. package/scripts/build-required-schemas.ts +233 -0
  214. package/scripts/refresh-schema-mirror.ts +182 -0
  215. package/server.json +2 -2
package/CHANGELOG.md CHANGED
@@ -11,6 +11,294 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [2.40.0] - 2026-04-30
15
+
16
+ ### Changed
17
+
18
+ - **ADR-214 W4 — `workflows` field is now required on `ToolDefinition`.**
19
+ Flips the optional `workflows?: WorkflowTag | WorkflowTag[]` field
20
+ introduced in W1 to a required `workflows: WorkflowTag | WorkflowTag[]`.
21
+ TypeScript compilation now enforces that every new tool authored
22
+ declares its workflow membership at the source site — no escape
23
+ hatch except the explicit `"infrastructure"` opt-out. Drift
24
+ prevention mechanism #1 from ADR-214 §"Drift prevention" is now
25
+ fully load-bearing. `lint-required-schemas.ts` hardened: the
26
+ parallel-window warning for untagged tools becomes a hard error
27
+ (defence-in-depth in case a tool somehow reaches the registry
28
+ without a `workflows` field at runtime).
29
+
30
+ ### Added
31
+
32
+ - **ADR-214 W2 — agent-guide + required-fields schema resources.**
33
+ Two new resource families on the catalog `mcp-server`:
34
+ - `pica://docs/agent-guide` — workflow narrative for agents. Visible
35
+ in both lobby and authenticated modes; content branches on
36
+ `lobbyMode`. Lobby variant (~865 bytes) covers the signup → magic
37
+ link flow + what unlocks. Authenticated variant (~4.3 KB) lists the
38
+ five core workflows (register a work, add a recording, add audio,
39
+ add recording credits, enrich metadata) with verbatim tool sequences
40
+ and 8 common gotchas — verified against the live tool registry on
41
+ 2026-04-30.
42
+ - `pica://schemas/work-required`, `pica://schemas/recording-required`,
43
+ `pica://schemas/work-credits-required`,
44
+ `pica://schemas/recording-credits-required`,
45
+ `pica://schemas/person-required` — JSON contracts derived at build
46
+ time from each tool's `inputSchema` (in `ToolRegistry`) joined with
47
+ `schema-mirror.json` for live CHECK constraint enums. Authenticated
48
+ mode only.
49
+ - **Build-time generator + schema mirror.**
50
+ - `mcp-server/scripts/build-required-schemas.ts` — runs as part of
51
+ `npm run prebuild` (chained after `bundle-apps.ts`); reads
52
+ `required-schemas.source.ts` + `ToolRegistry` + `schema-mirror.json`
53
+ and emits the deterministic `required-schemas.generated.ts`
54
+ (committed to git so PR diffs surface drift, per
55
+ `feedback_type_regen_cumulative_drift`).
56
+ - `mcp-server/src/resources/schema-mirror.json` — committed snapshot
57
+ of CHECK constraint enums for `works`, `recordings`, `work_credits`,
58
+ `recording_credits`, `audio_files`. Refresh via
59
+ `mcp-server/scripts/refresh-schema-mirror.ts` (humans only; CI never
60
+ auto-regenerates).
61
+ - **Inverse-coverage CI lint (`scripts/lint-required-schemas.ts`).**
62
+ Walks `ToolRegistry` and `REQUIRED_SCHEMAS_SOURCE` from both
63
+ directions: every tool whose `workflows` field tags it for a workflow
64
+ must appear in the source file; every source reference must resolve
65
+ to a real tool. During the parallel-development window (W1 still in
66
+ flight), tools missing the `workflows` field emit a single summary
67
+ warning (per coordinator decision Stage 1 §R2). Once W4 makes the
68
+ field required, the warning becomes an error.
69
+ - **Agent-guide drift lint (`scripts/lint-agent-guide.ts`).** Greps
70
+ every `pica_*` token in `agent-guide.ts` against `ToolRegistry` (in
71
+ both `discoveryMode` settings, so meta-tools like `pica_discover` are
72
+ resolvable). Catches stale references after tool renames.
73
+ - **Meta-tests** for both lints (per `feedback_meta_test_load_bearing`):
74
+ 3 / 3 regressions caught and reverted before ship — see
75
+ `docs/follow-ups/2026-04-30-adr214-w2-meta-test-outcomes.md`.
76
+
77
+ ### Changed
78
+
79
+ - `mcp-server/package.json` — `prebuild` now chains
80
+ `bundle-apps.ts && build-required-schemas.ts`. New scripts
81
+ `lint:required-schemas` and `lint:agent-guide` added; both wired into
82
+ `prepublishOnly` after the existing checks.
83
+ - `mcp-server/src/resources/index.ts` — registers 6 new URIs across
84
+ `listResources()` (1 in the lobby branch, 5 in the authenticated
85
+ branch) and `readResource()` (1 case for the agent-guide variant
86
+ branch, 5 cases for the schema URIs).
87
+
88
+ ### Dependencies
89
+
90
+ - `pg` + `@types/pg` added as devDependencies (used only by
91
+ `refresh-schema-mirror.ts` for direct Postgres CHECK-constraint pulls
92
+ against staging).
93
+
94
+ ### Internal
95
+
96
+ - **ADR-214 W1 — `WorkflowTag` type + optional `workflows` field on tool
97
+ definitions.** Adds a union type
98
+ (`"work-required" | "recording-required" | "work-credits-required"
99
+ | "recording-credits-required" | "person-required" | "infrastructure"`)
100
+ and a `workflows?: WorkflowTag | WorkflowTag[]` field to
101
+ `ToolDefinition` at `mcp-server/src/tools/index.ts`. All 231 tools now
102
+ carry the field — 8 catalog-core tools (`pica_works_create`,
103
+ `pica_works_update`, `pica_recordings_create`,
104
+ `pica_recordings_update`, `pica_people_create`, `pica_people_update`,
105
+ `pica_credits_update`, `pica_recording_credits_update`) reference one
106
+ or more Phase 1 workflows; the remaining 223 carry
107
+ `"infrastructure"`. Field is optional in W1 to keep the rollout
108
+ additive; W4 (post-merge of W1 + W2 resource scaffolding) flips it to
109
+ required so every future tool is forced to declare its workflow at
110
+ compile time. No runtime behaviour change in this release.
111
+
112
+ ## [2.39.0] - 2026-04-30
113
+
114
+ ### Added
115
+
116
+ - **ADR-211 Phase 1 — `pica_signup_start` unauthenticated tool.** New
117
+ agent-discoverable signup verb available without a connection key on
118
+ both stdio (lobby mode) and HTTP `/api/mcp` (anonymous mode). Mints
119
+ nothing locally — every invocation calls
120
+ `POST /api/public/onboarding/signup-start` so the
121
+ `ONBOARDING_TOKEN_SECRET` signing secret stays on the backend, never
122
+ in customer-distributed binaries. Returns a 15-minute JWT-bound
123
+ `/onboard/<token>` URL via `resource_link` (universal floor) +
124
+ capability-gated `elicitation/create url` (mode: "url"). Constructor
125
+ takes `{apiUrl, transport, clientId?}` — stdio binary stamps
126
+ `transport: "stdio"`, the HTTP carve-out stamps `transport: "http"`
127
+ and threads through any DCR `client_id` for OAuth resume.
128
+
129
+ - **`SERVER_INSTRUCTIONS_UNAUTHENTICATED` lobby variant.** Short
130
+ ~600-char handshake text pointing the agent at the 3 lobby tools
131
+ (`pica_signup_start`, `pica_sign_in`, `pica_sign_out`) instead of the
132
+ full 200+ catalog surface. Selected at boot when `lobbyMode === true`
133
+ (stdio binary without `PICA_API_KEY`) and at handshake when
134
+ `/api/mcp` is invoked without a Bearer token. Catalog-tool guidance
135
+ omitted because no catalog tools are reachable in lobby mode.
136
+
137
+ - **`SERVER_INSTRUCTIONS_AUTHENTICATED` alias** of the legacy
138
+ `SERVER_INSTRUCTIONS` export — the unaliased symbol stays exported
139
+ unchanged for backward compatibility.
140
+
141
+ ### Changed
142
+
143
+ - **Lobby surface is now THREE tools** (was two): `pica_signup_start`
144
+ joins the existing `pica_sign_in` + `pica_sign_out` pair. Additive,
145
+ not replacement — Phase 1 evaluates consolidation in Phase 2 once
146
+ the `/onboard/<token>` page is live and the JWT-bound flow is the
147
+ preferred path. ADR-211 § Primitive A editorial amendment 2026-04-30
148
+ reflects this.
149
+
150
+ ### Notes
151
+
152
+ - **`ONBOARDING_TOKEN_SECRET` env var required** on backend
153
+ environments (preview + prod already provisioned 2026-04-30). The
154
+ `lib/auth/scoped-jwt.ts` substrate gained an additive
155
+ `options.secretEnvVar` parameter so each scoped-JWT consumer
156
+ (upload-token, onboarding-token, future ADR-214 storage-config) can
157
+ rotate its signing secret independently. SUPABASE_JWT_SECRET still
158
+ serves as the local-dev fallback in both modes.
159
+
160
+ - **No new exports in `@withpica/mcp-utils` or `@withpica/mcp-sdk`** —
161
+ Phase 1 consumes existing exports (`clientSupportsUrlElicitation`,
162
+ `CallerContext`) only. Per
163
+ `feedback_workspace_package_publish_discipline.md`: no bumps needed
164
+ upstream of this release.
165
+
166
+ ## [2.38.0] - 2026-04-30
167
+
168
+ ### Added
169
+
170
+ - **ADR-208 Phase 3 Primitive D — `pica_release_show` rich-render tool.**
171
+ The catalog's first MCP tool returning `image` + `text` content blocks
172
+ in a single agent turn. Cover art ships as a base64 JPEG ≤512px;
173
+ markdown summary covers title, year, primary artists, label name, UPC,
174
+ catalog number, and tracklist with ISRCs and durations. Read-only
175
+ (`readOnlyHint: true`). Registered in
176
+ `mcp-server/src/tools/discovery.ts` `CATEGORIES.releases.tools` in
177
+ the same commit as the `ToolRegistry` registration per the layered-
178
+ discovery completeness rule.
179
+ - **`_meta.ui.resourceUri = "ui://pica/release"`** — MCP Apps clients
180
+ (Claude Desktop, Cursor) render the iframe via the new resource at
181
+ `mcp-server/src/apps/release.ts`. Phase 3 ships the resource stub
182
+ (title + markdown + cover image binding); full interactive iframe
183
+ with track-list expand and inline streaming embeds is queued under
184
+ the ADR-200 Phase 1.x backlog.
185
+ - **`structuredContent`** envelope — `{ title, markdown, cover_base64,
186
+ cover_mime_type, resource_link_uri }`. Apps clients prefer this over
187
+ re-decoding the image content block; non-Apps clients ignore it.
188
+
189
+ ### Notes
190
+
191
+ - **Universal floor is `image + text` only in Phase 3.** A `resource_link`
192
+ block is intentionally omitted because no release UI page exists in
193
+ the codebase yet (verified — neither `/portal/releases/[id]` nor
194
+ `/admin/releases/[id]`). Building one is queued under
195
+ `docs/follow-ups/2026-04-30-adr208-phase3-5-release-detail-page.md`
196
+ and ADR-208 § Primitive D was editorially amended on develop
197
+ (`30ceefc9d`) to reflect the deferral.
198
+ - **"Key credits" deferred from the markdown body.** The existing
199
+ `releasesService.listTracks()` join surfaces work + recording artist
200
+ but not `work_credits`; adding the join widens Phase 3 scope. Will
201
+ land alongside ADR-213 when credit-attribution surfaces consume the
202
+ data cheaply.
203
+ - **Sharp lives in the main Next.js app, not in this stdio binary.**
204
+ Cover-art bytes come from the new `/api/admin/releases/[id]/cover-art-thumbnail`
205
+ endpoint that does the resize + cache server-side, so the
206
+ customer-distributed `@withpica/mcp-server` install stays free of
207
+ sharp's ~50MB platform-specific native binaries.
208
+
209
+ ### Changed
210
+
211
+ - **Bumps `@withpica/mcp-sdk` peer to ^1.17.0** to consume the new
212
+ `ReleasesResource.getCoverArtThumbnail()` method.
213
+ `@withpica/mcp-utils` stays at ^1.12.0 (T2.4's bump absorbed via the rebase).
214
+
215
+ ## [2.37.0] - 2026-04-30
216
+
217
+ ### Added
218
+
219
+ - **ADR-210 Phase 2 — `pica_subscription_status` and `pica_subscription_manage`.**
220
+ Two new tools shipping the explicit billing read + action surface
221
+ that complements Phase 1's ambient `_meta.session_state.billing_slice`.
222
+ - `pica_subscription_status` (`readOnlyHint: true`) wraps the
223
+ existing `GET /api/admin/subscription` route and flattens it into
224
+ the 9-field shape ADR-210 § Phase 2 specifies (`billing_state`,
225
+ `trial_days_remaining`, `trial_ends_at`, `current_tier`,
226
+ `capacity_used`, `capacity_limit`, `capacity_pct`,
227
+ `recommended_tier`, `summary`). The `summary` line is a
228
+ server-side template the agent uses verbatim — predictable
229
+ wording, less variance across connectors.
230
+ - `pica_subscription_manage` (`readOnlyHint: false`) is a single-verb
231
+ dispatcher over the existing `POST /api/admin/subscription`
232
+ (subscribe / upgrade) and `POST /api/admin/subscription/portal`
233
+ (manage / cancel) routes. Returns `{url, expires_at, surface}`.
234
+ Subscribe / upgrade without `tier` returns a recoverable error
235
+ with `next_tool: pica_subscription_status` so the agent can
236
+ chain to read `recommended_tier` first rather than auto-pick.
237
+ Universal-floor `resource_link` content block ships on every
238
+ success response per ADR-200 Phase 1; `elicitation/create url`
239
+ fires only when `clientSupportsUrlElicitation(server)` (the
240
+ capability gate is mandatory because `elicitInput` with
241
+ `mode: "url"` throws synchronously against non-supporters per
242
+ `feedback_mcp_sdk_capability_gates_elicitation.md`).
243
+ - **`subscription` category in `discovery.ts:CATEGORIES`** ("view your
244
+ billing state, manage your subscription, and pick a tier"). Lint
245
+ enforced by `scripts/lint-mcp-tools.ts` per
246
+ `feedback_mcp_taxonomy_completeness.md`.
247
+
248
+ ### Changed
249
+
250
+ - **Bumps `@withpica/mcp-sdk` peer to ^1.16.0** to consume the new
251
+ `SubscriptionResource`. `@withpica/mcp-utils` stays at ^1.12.0
252
+ (T2.4's bump absorbed via the rebase).
253
+
254
+ ## [2.36.0] - 2026-04-30
255
+
256
+ ### Added
257
+
258
+ - **ADR-213 Primitive A — `pica_recordings_create` post-create attribution hints.**
259
+ Every successful create call now appends up to three Important-severity
260
+ hints via the new `buildRecordingAttributionHints(recording)` helper
261
+ (`mcp-server/src/tools/recording-attribution-hints.ts`). Mirror of
262
+ `buildCustodyHints` for works:
263
+ - `recording_ownership_unset` — fires when `ownership_percentage IS NULL`.
264
+ Suggests `pica_recordings_update ownership_percentage:N`.
265
+ - `recording_no_credits` — always fires (we never know credits from a
266
+ single fresh row). Suggests the new `pica_recording_credits_update`.
267
+ - `recording_master_unclaimed` — fires when `ownership_percentage IS NULL`.
268
+ Alternative path for multi-party master claims via `pica_custody_claim`.
269
+ NULL-only triggers: `0` is "explicit zero", no hint. Negative-path
270
+ covered by jest at `recording-attribution-hints.test.ts` per
271
+ `feedback_meta_test_load_bearing.md`.
272
+ - **ADR-213 Primitive B — `pica_recording_credits_update`.** First-party
273
+ recording-side write tool; closes the work/recording credit-write
274
+ asymmetry. Writes to `recording_credits` (NOT the trade-secret
275
+ enrichment-cascade-fed `credits` table — see `.claude/rules/ip-protection.md`).
276
+ Uses the 16-role `RECORDING_CREDIT_ROLES` enum (`MainArtist`,
277
+ `FeaturedArtist`, `Producer`, `Mixer`, `Engineer`, ... `Other`).
278
+ Songwriting credits (Writer, Composer, Lyricist, Arranger as a publishing
279
+ role) continue to route through `pica_credits_update` on the parent work.
280
+ Registered in `discovery.ts` `CATEGORIES.credits` in the same commit per
281
+ `feedback_mcp_taxonomy_completeness.md`. Listed under `write:catalog` scope
282
+ in `lib/services/mcp-scopes.ts`. `nextSteps` points at
283
+ `pica_recordings_inspect sections:["recording_credits"]` for ADR-198
284
+ round-trip verification.
285
+ - **ADR-213 Primitive A.1 — `pica_recordings_inspect recording_credits`
286
+ section.** Additive (not replacement). The existing `credits` section
287
+ (work-side credits via parent work) keeps its current behaviour. New
288
+ `recording_credits` section reads first-party operator-authored credits
289
+ directly from the `recording_credits` table via the new
290
+ `pica.recordingCredits.list()` SDK method.
291
+ - **`TOOL_METADATA` entry for `pica_recording_credits_update`** in
292
+ `mcp-server/src/tools/metadata.ts` (catalog/mutating/non-retry-safe).
293
+
294
+ ### Changed
295
+
296
+ - **Bumps `@withpica/mcp-sdk` peer to ^1.15.0** and `@withpica/mcp-utils` to
297
+ ^1.12.0 to consume the new `RecordingCreditsResource` and the metadata
298
+ entry shipped alongside ADR-213.
299
+ - **Tool count moves from 224 → 225** with the addition of
300
+ `pica_recording_credits_update`.
301
+
14
302
  ## [2.35.0] - 2026-04-29
15
303
 
16
304
  ### Added
@@ -69,7 +357,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
69
357
  missing (HTTP-discovery without bearer scope), or when the SDK response
70
358
  is missing `billing_slice` (older server pre-Phase-1), the fetcher
71
359
  emits a conservative `{ billing_state: "trial", trial_days_remaining:
72
- null, current_tier: null, capacity_pct: 0 }` rather than fabricating
360
+ null, current_tier: null, capacity_pct: 0 }` rather than fabricating
73
361
  "active" — the agent never sees misleading "active" billing for an
74
362
  uninitialized context.
75
363
 
@@ -0,0 +1,2 @@
1
+ export declare const RELEASE_HTML: string;
2
+ //# sourceMappingURL=release.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.d.ts","sourceRoot":"","sources":["../../src/apps/release.ts"],"names":[],"mappings":"AAwEA,eAAO,MAAM,YAAY,QAIxB,CAAC"}
@@ -0,0 +1,69 @@
1
+ // Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
2
+ /**
3
+ * pica_release_show MCP App card — Phase 3 stub render.
4
+ *
5
+ * Renders three fields from `structuredContent`: title, markdown summary,
6
+ * cover image. No interactive affordances yet — full track-list expand,
7
+ * inline streaming embeds, and per-track agent links are queued under
8
+ * the ADR-200 Phase 1.x backlog.
9
+ *
10
+ * MCP Apps clients (Claude Desktop, Cursor) iframe this. Every other
11
+ * client ignores `_meta.ui` and renders the universal floor (image +
12
+ * text content blocks) per the 2025-11-25 image primitive.
13
+ *
14
+ * DOM API only — never innerHTML.
15
+ */
16
+ import { buildAppHtml } from "./shared.js";
17
+ const RELEASE_BODY = `
18
+ <div class="stack gap-6">
19
+ <div id="rel-cover-wrap" style="display: none; text-align: center;">
20
+ <img id="rel-cover" alt="release cover art"
21
+ style="max-width: 320px; max-height: 320px; border-radius: 12px; border: 1px solid var(--card-border);" />
22
+ </div>
23
+
24
+ <header>
25
+ <h1 class="heading heading-lg" id="rel-title">release</h1>
26
+ </header>
27
+
28
+ <article id="rel-summary" class="card-flat" style="padding: 16px 20px;">
29
+ <div id="rel-markdown" class="text-primary" style="white-space: pre-wrap; font-size: 14px; line-height: 1.6;"></div>
30
+ </article>
31
+ </div>
32
+
33
+ <style>
34
+ #rel-cover { display: block; margin: 0 auto; }
35
+ #rel-markdown { font-family: inherit; }
36
+ #rel-summary { background: rgba(255,255,255,0.03); }
37
+ </style>
38
+ `;
39
+ const RELEASE_JS = `
40
+ var relState = { title: null, markdown: null, cover_base64: null, cover_mime_type: null };
41
+
42
+ function relRender() {
43
+ var titleEl = document.getElementById("rel-title");
44
+ if (titleEl && relState.title) titleEl.textContent = relState.title;
45
+
46
+ var mdEl = document.getElementById("rel-markdown");
47
+ if (mdEl && relState.markdown) mdEl.textContent = relState.markdown;
48
+
49
+ if (relState.cover_base64 && relState.cover_mime_type) {
50
+ var coverEl = document.getElementById("rel-cover");
51
+ var wrapEl = document.getElementById("rel-cover-wrap");
52
+ if (coverEl && wrapEl) {
53
+ coverEl.src = "data:" + relState.cover_mime_type + ";base64," + relState.cover_base64;
54
+ wrapEl.style.display = "block";
55
+ }
56
+ }
57
+ }
58
+
59
+ window.onPicaToolResult = function (data) {
60
+ if (!data) return;
61
+ if (data.title) relState.title = data.title;
62
+ if (data.markdown) relState.markdown = data.markdown;
63
+ if (data.cover_base64) relState.cover_base64 = data.cover_base64;
64
+ if (data.cover_mime_type) relState.cover_mime_type = data.cover_mime_type;
65
+ relRender();
66
+ };
67
+ `;
68
+ export const RELEASE_HTML = buildAppHtml("pica — release", RELEASE_BODY, RELEASE_JS);
69
+ //# sourceMappingURL=release.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release.js","sourceRoot":"","sources":["../../src/apps/release.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;CAqBpB,CAAC;AAEF,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BlB,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,YAAY,CACtC,gBAAgB,EAChB,YAAY,EACZ,UAAU,CACX,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * ADR-214 — workflow narrative for agents.
3
+ *
4
+ * Two markdown constants. ResourceRegistry serves AGENT_GUIDE_LOBBY when
5
+ * config.lobbyMode || !pica, AGENT_GUIDE_AUTHENTICATED otherwise.
6
+ *
7
+ * Tool sequences are verbatim from ADR-214 Decision section "Top
8
+ * workflows" — audit-verified 2026-04-30 against the live ToolRegistry.
9
+ *
10
+ * Edits to this file are linted by scripts/lint-agent-guide.ts: every
11
+ * `pica_*` token must resolve to a real tool in ToolRegistry.
12
+ */
13
+ export declare const AGENT_GUIDE_AUTHENTICATED = "# pica \u2014 agent guide\n\npica manages a music catalog: works (compositions), recordings (masters),\npeople (writers, performers, publishers), credits, agreements, exports.\nmulti-tenant per organisation; every write is org-scoped automatically.\n\nyou are signed in. ~227 tools are available. five core workflows below\ncover most of the surface; for anything not listed, fall back to\n`pica_discover` (mode: list_categories \u2192 list_tools) \u2192 `pica_tool_details`.\n\n## top workflows\n\n### register a new work\n1. `pica_works_create` \u2014 title required; iswc settable inline.\n2. `pica_credits_update` \u2014 batch; attach writer/composer credits.\n writer_split_percentage values must sum to 100 across all writer rows.\n see `pica://schemas/work-required` and `pica://schemas/work-credits-required`.\n\n### add a recording to an existing work\n- `pica_recordings_create` \u2014 title + artist_name + version_type required\n (version_type defaults to `master`). isrc and duration_ms are inline.\n- see `pica://schemas/recording-required`.\n\n### add audio to a recording\n1. `pica_audio_presigned_upload` \u2014 returns a signed url + token.\n2. uploader (browser, curl, sdk) PUTs the file to that url.\n3. `pica_audio_complete_upload` \u2014 registers the upload in the catalog.\n4. (optional) `pica_audio_analyze` \u2014 async; extracts bpm, key, mood, and\n transcribes lyrics via whisper.\n5. `pica_audio_inspect` (sections: [\"analysis\", \"status\"]) \u2014 poll for\n analysis results when you called step 4.\n\n### add recording credits\n- `pica_recording_credits_update` \u2014 batch. role enum is DISTINCT from\n work credits (MainArtist / FeaturedArtist / Producer / Engineer / etc.).\n- person_id is OPTIONAL \u2014 credits can carry just credited_name when the\n person isn't in the catalog yet.\n- see `pica://schemas/recording-credits-required`.\n\n### enrich existing metadata\n1. `pica_resolve_work` / `pica_resolve_person` / `pica_resolve_recording` \u2014\n tier A identifier matches apply directly; tier B fuzzy matches queue\n as proposals.\n2. `pica_enrichment_proposals_list` \u2014 view pending proposals.\n3. `pica_enrichment_proposal_apply` \u2014 commit a proposal you've reviewed.\n\n## common gotchas\n\n- **duration units differ.** `works.duration_seconds` (integer seconds);\n `recordings.duration_ms` (integer milliseconds);\n `audio_files.duration_seconds` (seconds again).\n- **no standalone identifier-assign tool.** iswc on works, isrc on\n recordings, ipi/pro/ppl/mcps numbers on people \u2014 all inline at create\n or update. there is no separate identifier tool family; don't search\n for one.\n- **two write surfaces for work collaborators.** `pica_credits_update`\n is canonical (writer/publisher splits + attestation). `work_collaborators`\n is a simpler legacy surface still used by some flows.\n- **recording credits are a separate surface** with a different role\n enum. use `pica_recording_credits_update`, not `pica_credits_update`.\n- **people identifier sprawl.** inline columns: `cae_ipi_number`,\n `ipn_number`, `prs_number`, `ppl_number`, `pro_member_number`,\n `mcps_member_number`. satellite (settable through the same create/update\n call): `isni`, `musicbrainz_id`, `wikidata_id`, `discogs_artist_id`,\n `imdb_id`, `viaf_id`, `deezer_artist_id`. treat as one inline surface.\n- **audio analysis is async + explicit.** `pica_audio_complete_upload`\n does NOT auto-trigger analysis. call `pica_audio_analyze` and poll.\n- **lyrics from analysis don't auto-write back to `works.lyrics`.**\n whisper transcripts land on the analysis row; copy is a separate step.\n- **org scoping + duplicate prevention.** every write is scoped to the\n caller's organisation. iswc and isrc duplicates are blocked at write.\n\n## schema resources (pre-flight before each workflow)\n\n- `pica://schemas/work-required` \u2014 backs `pica_works_create`.\n- `pica://schemas/recording-required` \u2014 backs `pica_recordings_create`.\n- `pica://schemas/work-credits-required` \u2014 backs `pica_credits_update`.\n- `pica://schemas/recording-credits-required` \u2014 backs `pica_recording_credits_update`.\n- `pica://schemas/person-required` \u2014 backs `pica_people_create`.\n\neach schema returns a json contract: required fields, recommended fields,\nCHECK enum values, companion-call orchestration, and an example payload.\n";
14
+ export declare const AGENT_GUIDE_LOBBY = "# pica \u2014 sign in to begin\n\nyou are in lobby mode. three tools are available; the rest unlock after\nsign-in.\n\n## lobby tools\n- `pica_signup_start` \u2014 create a new organisation and get a magic link\n for first-time setup.\n- `pica_sign_in` \u2014 request a magic link for an existing user.\n- `pica_sign_out` \u2014 drop session.\n\n## to sign in\n1. ask the user for an email address.\n2. call `pica_signup_start` (new user) or `pica_sign_in` (returning).\n3. user clicks the magic link. on the next request, the catalog tool\n surface unlocks automatically \u2014 no config to refresh.\n\n## what unlocks after sign-in\n~227 tools across catalog (works, recordings, people, credits),\nenrichment, exports, agreements, multimedia, analytics, and audio. five\nrequired-fields schema resources at `pica://schemas/<workflow>-required`.\nthe full agent-guide replaces this lobby content.\n";
15
+ //# sourceMappingURL=agent-guide.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-guide.d.ts","sourceRoot":"","sources":["../../src/resources/agent-guide.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,eAAO,MAAM,yBAAyB,2zIAkFrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,24BAsB7B,CAAC"}
@@ -0,0 +1,120 @@
1
+ // Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
2
+ /**
3
+ * ADR-214 — workflow narrative for agents.
4
+ *
5
+ * Two markdown constants. ResourceRegistry serves AGENT_GUIDE_LOBBY when
6
+ * config.lobbyMode || !pica, AGENT_GUIDE_AUTHENTICATED otherwise.
7
+ *
8
+ * Tool sequences are verbatim from ADR-214 Decision section "Top
9
+ * workflows" — audit-verified 2026-04-30 against the live ToolRegistry.
10
+ *
11
+ * Edits to this file are linted by scripts/lint-agent-guide.ts: every
12
+ * `pica_*` token must resolve to a real tool in ToolRegistry.
13
+ */
14
+ export const AGENT_GUIDE_AUTHENTICATED = `# pica — agent guide
15
+
16
+ pica manages a music catalog: works (compositions), recordings (masters),
17
+ people (writers, performers, publishers), credits, agreements, exports.
18
+ multi-tenant per organisation; every write is org-scoped automatically.
19
+
20
+ you are signed in. ~227 tools are available. five core workflows below
21
+ cover most of the surface; for anything not listed, fall back to
22
+ \`pica_discover\` (mode: list_categories → list_tools) → \`pica_tool_details\`.
23
+
24
+ ## top workflows
25
+
26
+ ### register a new work
27
+ 1. \`pica_works_create\` — title required; iswc settable inline.
28
+ 2. \`pica_credits_update\` — batch; attach writer/composer credits.
29
+ writer_split_percentage values must sum to 100 across all writer rows.
30
+ see \`pica://schemas/work-required\` and \`pica://schemas/work-credits-required\`.
31
+
32
+ ### add a recording to an existing work
33
+ - \`pica_recordings_create\` — title + artist_name + version_type required
34
+ (version_type defaults to \`master\`). isrc and duration_ms are inline.
35
+ - see \`pica://schemas/recording-required\`.
36
+
37
+ ### add audio to a recording
38
+ 1. \`pica_audio_presigned_upload\` — returns a signed url + token.
39
+ 2. uploader (browser, curl, sdk) PUTs the file to that url.
40
+ 3. \`pica_audio_complete_upload\` — registers the upload in the catalog.
41
+ 4. (optional) \`pica_audio_analyze\` — async; extracts bpm, key, mood, and
42
+ transcribes lyrics via whisper.
43
+ 5. \`pica_audio_inspect\` (sections: ["analysis", "status"]) — poll for
44
+ analysis results when you called step 4.
45
+
46
+ ### add recording credits
47
+ - \`pica_recording_credits_update\` — batch. role enum is DISTINCT from
48
+ work credits (MainArtist / FeaturedArtist / Producer / Engineer / etc.).
49
+ - person_id is OPTIONAL — credits can carry just credited_name when the
50
+ person isn't in the catalog yet.
51
+ - see \`pica://schemas/recording-credits-required\`.
52
+
53
+ ### enrich existing metadata
54
+ 1. \`pica_resolve_work\` / \`pica_resolve_person\` / \`pica_resolve_recording\` —
55
+ tier A identifier matches apply directly; tier B fuzzy matches queue
56
+ as proposals.
57
+ 2. \`pica_enrichment_proposals_list\` — view pending proposals.
58
+ 3. \`pica_enrichment_proposal_apply\` — commit a proposal you've reviewed.
59
+
60
+ ## common gotchas
61
+
62
+ - **duration units differ.** \`works.duration_seconds\` (integer seconds);
63
+ \`recordings.duration_ms\` (integer milliseconds);
64
+ \`audio_files.duration_seconds\` (seconds again).
65
+ - **no standalone identifier-assign tool.** iswc on works, isrc on
66
+ recordings, ipi/pro/ppl/mcps numbers on people — all inline at create
67
+ or update. there is no separate identifier tool family; don't search
68
+ for one.
69
+ - **two write surfaces for work collaborators.** \`pica_credits_update\`
70
+ is canonical (writer/publisher splits + attestation). \`work_collaborators\`
71
+ is a simpler legacy surface still used by some flows.
72
+ - **recording credits are a separate surface** with a different role
73
+ enum. use \`pica_recording_credits_update\`, not \`pica_credits_update\`.
74
+ - **people identifier sprawl.** inline columns: \`cae_ipi_number\`,
75
+ \`ipn_number\`, \`prs_number\`, \`ppl_number\`, \`pro_member_number\`,
76
+ \`mcps_member_number\`. satellite (settable through the same create/update
77
+ call): \`isni\`, \`musicbrainz_id\`, \`wikidata_id\`, \`discogs_artist_id\`,
78
+ \`imdb_id\`, \`viaf_id\`, \`deezer_artist_id\`. treat as one inline surface.
79
+ - **audio analysis is async + explicit.** \`pica_audio_complete_upload\`
80
+ does NOT auto-trigger analysis. call \`pica_audio_analyze\` and poll.
81
+ - **lyrics from analysis don't auto-write back to \`works.lyrics\`.**
82
+ whisper transcripts land on the analysis row; copy is a separate step.
83
+ - **org scoping + duplicate prevention.** every write is scoped to the
84
+ caller's organisation. iswc and isrc duplicates are blocked at write.
85
+
86
+ ## schema resources (pre-flight before each workflow)
87
+
88
+ - \`pica://schemas/work-required\` — backs \`pica_works_create\`.
89
+ - \`pica://schemas/recording-required\` — backs \`pica_recordings_create\`.
90
+ - \`pica://schemas/work-credits-required\` — backs \`pica_credits_update\`.
91
+ - \`pica://schemas/recording-credits-required\` — backs \`pica_recording_credits_update\`.
92
+ - \`pica://schemas/person-required\` — backs \`pica_people_create\`.
93
+
94
+ each schema returns a json contract: required fields, recommended fields,
95
+ CHECK enum values, companion-call orchestration, and an example payload.
96
+ `;
97
+ export const AGENT_GUIDE_LOBBY = `# pica — sign in to begin
98
+
99
+ you are in lobby mode. three tools are available; the rest unlock after
100
+ sign-in.
101
+
102
+ ## lobby tools
103
+ - \`pica_signup_start\` — create a new organisation and get a magic link
104
+ for first-time setup.
105
+ - \`pica_sign_in\` — request a magic link for an existing user.
106
+ - \`pica_sign_out\` — drop session.
107
+
108
+ ## to sign in
109
+ 1. ask the user for an email address.
110
+ 2. call \`pica_signup_start\` (new user) or \`pica_sign_in\` (returning).
111
+ 3. user clicks the magic link. on the next request, the catalog tool
112
+ surface unlocks automatically — no config to refresh.
113
+
114
+ ## what unlocks after sign-in
115
+ ~227 tools across catalog (works, recordings, people, credits),
116
+ enrichment, exports, agreements, multimedia, analytics, and audio. five
117
+ required-fields schema resources at \`pica://schemas/<workflow>-required\`.
118
+ the full agent-guide replaces this lobby content.
119
+ `;
120
+ //# sourceMappingURL=agent-guide.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-guide.js","sourceRoot":"","sources":["../../src/resources/agent-guide.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;;;;;;;;;;GAWG;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFxC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsBhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAO/C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAK5C,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AAEjC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,MAAM,CAAC,CAAe;gBAElB,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,YAAY;IAK1D;;OAEG;IACH,aAAa,IAAI,kBAAkB,EAAE;IA8FrC;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IA8G7C;;OAEG;IACH,OAAO,CAAC,cAAc;IA6BtB;;OAEG;YACW,YAAY;IA4B1B;;OAEG;YACW,aAAa;IA4B3B;;OAEG;YACW,iBAAiB;IA2B/B;;OAEG;YACW,eAAe;IAoD7B;;OAEG;YACW,gBAAgB;IAc9B;;OAEG;YACW,mBAAmB;IAcjC;;OAEG;YACW,eAAe;CAa9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAY/C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM5C,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AAEjC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,MAAM,CAAC,CAAe;gBAElB,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,YAAY;IAK1D;;OAEG;IACH,aAAa,IAAI,kBAAkB,EAAE;IA+IrC;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IA4J7C;;OAEG;IACH,OAAO,CAAC,cAAc;IA6BtB;;OAEG;YACW,YAAY;IA4B1B;;OAEG;YACW,aAAa;IA4B3B;;OAEG;YACW,iBAAiB;IA2B/B;;OAEG;YACW,eAAe;IAoD7B;;OAEG;YACW,gBAAgB;IAc9B;;OAEG;YACW,mBAAmB;IAcjC;;OAEG;YACW,eAAe;CAa9B"}
@@ -3,8 +3,11 @@ import { ResourceError } from "@withpica/mcp-utils";
3
3
  import { readFileSync } from "fs";
4
4
  import { join } from "path";
5
5
  import { WITHPICA_PRIMER } from "./llms-primer.js";
6
+ import { AGENT_GUIDE_AUTHENTICATED, AGENT_GUIDE_LOBBY, } from "./agent-guide.js";
7
+ import { REQUIRED_SCHEMAS } from "./required-schemas.generated.js";
6
8
  import { UPLOAD_HTML } from "../apps/upload.js";
7
9
  import { DOWNLOAD_HTML } from "../apps/download.js";
10
+ import { RELEASE_HTML } from "../apps/release.js";
8
11
  import { PICA_STORAGE_CONNECT_DOMAINS } from "../apps/shared.js";
9
12
  export class ResourceRegistry {
10
13
  pica;
@@ -24,6 +27,12 @@ export class ResourceRegistry {
24
27
  description: "Getting started guide — how to sign in and what you can do",
25
28
  mimeType: "text/markdown",
26
29
  },
30
+ {
31
+ uri: "pica://docs/agent-guide",
32
+ name: "Agent Guide — How to Use PICA",
33
+ description: "Workflow-by-workflow guide for agents — what tools to call in what order, common gotchas, pointers to schema resources. Lobby mode returns a sign-in-focused variant; authenticated mode returns the full workflow map.",
34
+ mimeType: "text/markdown",
35
+ },
27
36
  ];
28
37
  if (this.config?.lobbyMode || !this.pica) {
29
38
  return resources;
@@ -83,6 +92,36 @@ export class ResourceRegistry {
83
92
  name: "Download File",
84
93
  description: "File download card — shows file metadata and a download button",
85
94
  mimeType: "text/html;profile=mcp-app",
95
+ }, {
96
+ uri: "ui://pica/release",
97
+ name: "Release Card",
98
+ description: "Release rich-render card — cover art + markdown summary (ADR-208 Phase 3 Primitive D, Phase 3 stub)",
99
+ mimeType: "text/html;profile=mcp-app",
100
+ }, {
101
+ uri: "pica://schemas/work-required",
102
+ name: "Required Fields — Register a Work",
103
+ description: "Required + recommended fields, CHECK enums, and companion-call orchestration for pica_works_create. Read before calling the work-create workflow.",
104
+ mimeType: "application/json",
105
+ }, {
106
+ uri: "pica://schemas/recording-required",
107
+ name: "Required Fields — Register a Recording",
108
+ description: "Required + recommended fields, CHECK enums, and companion-call orchestration for pica_recordings_create.",
109
+ mimeType: "application/json",
110
+ }, {
111
+ uri: "pica://schemas/work-credits-required",
112
+ name: "Required Fields — Attach Work Credits",
113
+ description: "Per-row required fields and CHECK enums for pica_credits_update (writer/composer/publisher splits, sum to 100).",
114
+ mimeType: "application/json",
115
+ }, {
116
+ uri: "pica://schemas/recording-credits-required",
117
+ name: "Required Fields — Attach Recording Credits",
118
+ description: "Per-row required fields and the role enum for pica_recording_credits_update (MainArtist / FeaturedArtist / Producer / Engineer / etc.).",
119
+ mimeType: "application/json",
120
+ }, {
121
+ uri: "pica://schemas/person-required",
122
+ name: "Required Fields — Register a Person",
123
+ description: "Required + recommended fields for pica_people_create (writers, performers, publishers; identifiers settable inline).",
124
+ mimeType: "application/json",
86
125
  });
87
126
  return resources;
88
127
  }
@@ -112,6 +151,18 @@ export class ResourceRegistry {
112
151
  },
113
152
  ],
114
153
  };
154
+ case "pica://docs/agent-guide": {
155
+ const lobby = this.config?.lobbyMode || !this.pica;
156
+ return {
157
+ contents: [
158
+ {
159
+ uri: "pica://docs/agent-guide",
160
+ mimeType: "text/markdown",
161
+ text: lobby ? AGENT_GUIDE_LOBBY : AGENT_GUIDE_AUTHENTICATED,
162
+ },
163
+ ],
164
+ };
165
+ }
115
166
  default:
116
167
  break;
117
168
  }
@@ -179,6 +230,35 @@ export class ResourceRegistry {
179
230
  },
180
231
  ],
181
232
  };
233
+ case "ui://pica/release":
234
+ return {
235
+ contents: [
236
+ {
237
+ uri: "ui://pica/release",
238
+ mimeType: "text/html;profile=mcp-app",
239
+ text: RELEASE_HTML,
240
+ },
241
+ ],
242
+ };
243
+ case "pica://schemas/work-required":
244
+ case "pica://schemas/recording-required":
245
+ case "pica://schemas/work-credits-required":
246
+ case "pica://schemas/recording-credits-required":
247
+ case "pica://schemas/person-required": {
248
+ const key = uri.replace("pica://schemas/", "");
249
+ const body = REQUIRED_SCHEMAS[key];
250
+ if (!body)
251
+ throw new ResourceError(`Schema not found: ${uri}`);
252
+ return {
253
+ contents: [
254
+ {
255
+ uri,
256
+ mimeType: "application/json",
257
+ text: JSON.stringify(body, null, 2),
258
+ },
259
+ ],
260
+ };
261
+ }
182
262
  default:
183
263
  throw new ResourceError(`Resource not found: ${uri}`);
184
264
  }