@withpica/mcp-server 1.3.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 (347) hide show
  1. package/.claude/settings.local.json +5 -0
  2. package/CHANGELOG.md +1850 -0
  3. package/README.md +304 -0
  4. package/assets/fonts/GeistSans-Light.woff2 +0 -0
  5. package/assets/fonts/InstrumentSerif-Italic.woff2 +0 -0
  6. package/assets/fonts/InstrumentSerif-Regular.woff2 +0 -0
  7. package/dist/apps/download.d.ts +2 -0
  8. package/dist/apps/download.d.ts.map +1 -0
  9. package/dist/apps/download.js +125 -0
  10. package/dist/apps/download.js.map +1 -0
  11. package/dist/apps/generated/shared-bundle.d.ts +5 -0
  12. package/dist/apps/generated/shared-bundle.d.ts.map +1 -0
  13. package/dist/apps/generated/shared-bundle.js +7 -0
  14. package/dist/apps/generated/shared-bundle.js.map +1 -0
  15. package/dist/apps/release.d.ts +2 -0
  16. package/dist/apps/release.d.ts.map +1 -0
  17. package/dist/apps/release.js +69 -0
  18. package/dist/apps/release.js.map +1 -0
  19. package/dist/apps/shared.d.ts +15 -0
  20. package/dist/apps/shared.d.ts.map +1 -0
  21. package/dist/apps/shared.js +480 -0
  22. package/dist/apps/shared.js.map +1 -0
  23. package/dist/apps/upload.d.ts +2 -0
  24. package/dist/apps/upload.d.ts.map +1 -0
  25. package/dist/apps/upload.js +280 -0
  26. package/dist/apps/upload.js.map +1 -0
  27. package/dist/config.d.ts +14 -0
  28. package/dist/config.d.ts.map +1 -0
  29. package/dist/config.js +73 -0
  30. package/dist/config.js.map +1 -0
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +35 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/prompts/index.d.ts +86 -0
  36. package/dist/prompts/index.d.ts.map +1 -0
  37. package/dist/prompts/index.js +645 -0
  38. package/dist/prompts/index.js.map +1 -0
  39. package/dist/resources/agent-guide.d.ts +15 -0
  40. package/dist/resources/agent-guide.d.ts.map +1 -0
  41. package/dist/resources/agent-guide.js +284 -0
  42. package/dist/resources/agent-guide.js.map +1 -0
  43. package/dist/resources/index.d.ts +66 -0
  44. package/dist/resources/index.d.ts.map +1 -0
  45. package/dist/resources/index.js +510 -0
  46. package/dist/resources/index.js.map +1 -0
  47. package/dist/resources/llms-primer.d.ts +2 -0
  48. package/dist/resources/llms-primer.d.ts.map +1 -0
  49. package/dist/resources/llms-primer.js +68 -0
  50. package/dist/resources/llms-primer.js.map +1 -0
  51. package/dist/resources/required-schemas.generated.d.ts +455 -0
  52. package/dist/resources/required-schemas.generated.d.ts.map +1 -0
  53. package/dist/resources/required-schemas.generated.js +1041 -0
  54. package/dist/resources/required-schemas.generated.js.map +1 -0
  55. package/dist/resources/required-schemas.source.d.ts +53 -0
  56. package/dist/resources/required-schemas.source.d.ts.map +1 -0
  57. package/dist/resources/required-schemas.source.js +493 -0
  58. package/dist/resources/required-schemas.source.js.map +1 -0
  59. package/dist/resources/welcome.d.ts +14 -0
  60. package/dist/resources/welcome.d.ts.map +1 -0
  61. package/dist/resources/welcome.js +26 -0
  62. package/dist/resources/welcome.js.map +1 -0
  63. package/dist/server-instructions.d.ts +60 -0
  64. package/dist/server-instructions.d.ts.map +1 -0
  65. package/dist/server-instructions.js +93 -0
  66. package/dist/server-instructions.js.map +1 -0
  67. package/dist/server.d.ts +52 -0
  68. package/dist/server.d.ts.map +1 -0
  69. package/dist/server.js +334 -0
  70. package/dist/server.js.map +1 -0
  71. package/dist/tools/access-simulate.d.ts +23 -0
  72. package/dist/tools/access-simulate.d.ts.map +1 -0
  73. package/dist/tools/access-simulate.js +162 -0
  74. package/dist/tools/access-simulate.js.map +1 -0
  75. package/dist/tools/agent-identity.d.ts +36 -0
  76. package/dist/tools/agent-identity.d.ts.map +1 -0
  77. package/dist/tools/agent-identity.js +274 -0
  78. package/dist/tools/agent-identity.js.map +1 -0
  79. package/dist/tools/agreement-types.d.ts +27 -0
  80. package/dist/tools/agreement-types.d.ts.map +1 -0
  81. package/dist/tools/agreement-types.js +281 -0
  82. package/dist/tools/agreement-types.js.map +1 -0
  83. package/dist/tools/agreements.d.ts +20 -0
  84. package/dist/tools/agreements.d.ts.map +1 -0
  85. package/dist/tools/agreements.js +282 -0
  86. package/dist/tools/agreements.js.map +1 -0
  87. package/dist/tools/analytics.d.ts +20 -0
  88. package/dist/tools/analytics.d.ts.map +1 -0
  89. package/dist/tools/analytics.js +130 -0
  90. package/dist/tools/analytics.js.map +1 -0
  91. package/dist/tools/app-tools.d.ts +15 -0
  92. package/dist/tools/app-tools.d.ts.map +1 -0
  93. package/dist/tools/app-tools.js +388 -0
  94. package/dist/tools/app-tools.js.map +1 -0
  95. package/dist/tools/assets.d.ts +25 -0
  96. package/dist/tools/assets.d.ts.map +1 -0
  97. package/dist/tools/assets.js +454 -0
  98. package/dist/tools/assets.js.map +1 -0
  99. package/dist/tools/audio-files.d.ts +20 -0
  100. package/dist/tools/audio-files.d.ts.map +1 -0
  101. package/dist/tools/audio-files.js +409 -0
  102. package/dist/tools/audio-files.js.map +1 -0
  103. package/dist/tools/audit.d.ts +19 -0
  104. package/dist/tools/audit.d.ts.map +1 -0
  105. package/dist/tools/audit.js +58 -0
  106. package/dist/tools/audit.js.map +1 -0
  107. package/dist/tools/auth.d.ts +22 -0
  108. package/dist/tools/auth.d.ts.map +1 -0
  109. package/dist/tools/auth.js +212 -0
  110. package/dist/tools/auth.js.map +1 -0
  111. package/dist/tools/bulk.d.ts +22 -0
  112. package/dist/tools/bulk.d.ts.map +1 -0
  113. package/dist/tools/bulk.js +164 -0
  114. package/dist/tools/bulk.js.map +1 -0
  115. package/dist/tools/calendar.d.ts +15 -0
  116. package/dist/tools/calendar.d.ts.map +1 -0
  117. package/dist/tools/calendar.js +68 -0
  118. package/dist/tools/calendar.js.map +1 -0
  119. package/dist/tools/collaborators.d.ts +21 -0
  120. package/dist/tools/collaborators.d.ts.map +1 -0
  121. package/dist/tools/collaborators.js +381 -0
  122. package/dist/tools/collaborators.js.map +1 -0
  123. package/dist/tools/comparisons.d.ts +22 -0
  124. package/dist/tools/comparisons.d.ts.map +1 -0
  125. package/dist/tools/comparisons.js +80 -0
  126. package/dist/tools/comparisons.js.map +1 -0
  127. package/dist/tools/credits.d.ts +39 -0
  128. package/dist/tools/credits.d.ts.map +1 -0
  129. package/dist/tools/credits.js +541 -0
  130. package/dist/tools/credits.js.map +1 -0
  131. package/dist/tools/custody-hints.d.ts +16 -0
  132. package/dist/tools/custody-hints.d.ts.map +1 -0
  133. package/dist/tools/custody-hints.js +27 -0
  134. package/dist/tools/custody-hints.js.map +1 -0
  135. package/dist/tools/custody.d.ts +38 -0
  136. package/dist/tools/custody.d.ts.map +1 -0
  137. package/dist/tools/custody.js +281 -0
  138. package/dist/tools/custody.js.map +1 -0
  139. package/dist/tools/dashboard.d.ts +22 -0
  140. package/dist/tools/dashboard.d.ts.map +1 -0
  141. package/dist/tools/dashboard.js +258 -0
  142. package/dist/tools/dashboard.js.map +1 -0
  143. package/dist/tools/directory.d.ts +15 -0
  144. package/dist/tools/directory.d.ts.map +1 -0
  145. package/dist/tools/directory.js +107 -0
  146. package/dist/tools/directory.js.map +1 -0
  147. package/dist/tools/discovery.d.ts +49 -0
  148. package/dist/tools/discovery.d.ts.map +1 -0
  149. package/dist/tools/discovery.js +851 -0
  150. package/dist/tools/discovery.js.map +1 -0
  151. package/dist/tools/disputes.d.ts +18 -0
  152. package/dist/tools/disputes.d.ts.map +1 -0
  153. package/dist/tools/disputes.js +62 -0
  154. package/dist/tools/disputes.js.map +1 -0
  155. package/dist/tools/documents.d.ts +15 -0
  156. package/dist/tools/documents.d.ts.map +1 -0
  157. package/dist/tools/documents.js +37 -0
  158. package/dist/tools/documents.js.map +1 -0
  159. package/dist/tools/duplicates.d.ts +25 -0
  160. package/dist/tools/duplicates.d.ts.map +1 -0
  161. package/dist/tools/duplicates.js +108 -0
  162. package/dist/tools/duplicates.js.map +1 -0
  163. package/dist/tools/enrichment.d.ts +56 -0
  164. package/dist/tools/enrichment.d.ts.map +1 -0
  165. package/dist/tools/enrichment.js +616 -0
  166. package/dist/tools/enrichment.js.map +1 -0
  167. package/dist/tools/exports.d.ts +19 -0
  168. package/dist/tools/exports.d.ts.map +1 -0
  169. package/dist/tools/exports.js +184 -0
  170. package/dist/tools/exports.js.map +1 -0
  171. package/dist/tools/feedback.d.ts +22 -0
  172. package/dist/tools/feedback.d.ts.map +1 -0
  173. package/dist/tools/feedback.js +100 -0
  174. package/dist/tools/feedback.js.map +1 -0
  175. package/dist/tools/forbidden-keywords.d.ts +62 -0
  176. package/dist/tools/forbidden-keywords.d.ts.map +1 -0
  177. package/dist/tools/forbidden-keywords.js +99 -0
  178. package/dist/tools/forbidden-keywords.js.map +1 -0
  179. package/dist/tools/gap-hints.d.ts +53 -0
  180. package/dist/tools/gap-hints.d.ts.map +1 -0
  181. package/dist/tools/gap-hints.js +245 -0
  182. package/dist/tools/gap-hints.js.map +1 -0
  183. package/dist/tools/groups.d.ts +29 -0
  184. package/dist/tools/groups.d.ts.map +1 -0
  185. package/dist/tools/groups.js +186 -0
  186. package/dist/tools/groups.js.map +1 -0
  187. package/dist/tools/import-documents.d.ts +21 -0
  188. package/dist/tools/import-documents.d.ts.map +1 -0
  189. package/dist/tools/import-documents.js +206 -0
  190. package/dist/tools/import-documents.js.map +1 -0
  191. package/dist/tools/import.d.ts +31 -0
  192. package/dist/tools/import.d.ts.map +1 -0
  193. package/dist/tools/import.js +610 -0
  194. package/dist/tools/import.js.map +1 -0
  195. package/dist/tools/index.d.ts +293 -0
  196. package/dist/tools/index.d.ts.map +1 -0
  197. package/dist/tools/index.js +1182 -0
  198. package/dist/tools/index.js.map +1 -0
  199. package/dist/tools/integrations.d.ts +19 -0
  200. package/dist/tools/integrations.d.ts.map +1 -0
  201. package/dist/tools/integrations.js +120 -0
  202. package/dist/tools/integrations.js.map +1 -0
  203. package/dist/tools/labels.d.ts +20 -0
  204. package/dist/tools/labels.d.ts.map +1 -0
  205. package/dist/tools/labels.js +48 -0
  206. package/dist/tools/labels.js.map +1 -0
  207. package/dist/tools/licensing.d.ts +40 -0
  208. package/dist/tools/licensing.d.ts.map +1 -0
  209. package/dist/tools/licensing.js +436 -0
  210. package/dist/tools/licensing.js.map +1 -0
  211. package/dist/tools/memory.d.ts +21 -0
  212. package/dist/tools/memory.d.ts.map +1 -0
  213. package/dist/tools/memory.js +120 -0
  214. package/dist/tools/memory.js.map +1 -0
  215. package/dist/tools/metadata.d.ts +15 -0
  216. package/dist/tools/metadata.d.ts.map +1 -0
  217. package/dist/tools/metadata.js +1532 -0
  218. package/dist/tools/metadata.js.map +1 -0
  219. package/dist/tools/multimedia.d.ts +19 -0
  220. package/dist/tools/multimedia.d.ts.map +1 -0
  221. package/dist/tools/multimedia.js +371 -0
  222. package/dist/tools/multimedia.js.map +1 -0
  223. package/dist/tools/my-reported-issues.d.ts +32 -0
  224. package/dist/tools/my-reported-issues.d.ts.map +1 -0
  225. package/dist/tools/my-reported-issues.js +123 -0
  226. package/dist/tools/my-reported-issues.js.map +1 -0
  227. package/dist/tools/notes.d.ts +21 -0
  228. package/dist/tools/notes.d.ts.map +1 -0
  229. package/dist/tools/notes.js +115 -0
  230. package/dist/tools/notes.js.map +1 -0
  231. package/dist/tools/notifications.d.ts +28 -0
  232. package/dist/tools/notifications.d.ts.map +1 -0
  233. package/dist/tools/notifications.js +417 -0
  234. package/dist/tools/notifications.js.map +1 -0
  235. package/dist/tools/onboarding.d.ts +24 -0
  236. package/dist/tools/onboarding.d.ts.map +1 -0
  237. package/dist/tools/onboarding.js +81 -0
  238. package/dist/tools/onboarding.js.map +1 -0
  239. package/dist/tools/people.d.ts +254 -0
  240. package/dist/tools/people.d.ts.map +1 -0
  241. package/dist/tools/people.js +481 -0
  242. package/dist/tools/people.js.map +1 -0
  243. package/dist/tools/projects.d.ts +20 -0
  244. package/dist/tools/projects.d.ts.map +1 -0
  245. package/dist/tools/projects.js +316 -0
  246. package/dist/tools/projects.js.map +1 -0
  247. package/dist/tools/public-filter.d.ts +43 -0
  248. package/dist/tools/public-filter.d.ts.map +1 -0
  249. package/dist/tools/public-filter.js +356 -0
  250. package/dist/tools/public-filter.js.map +1 -0
  251. package/dist/tools/publishers.d.ts +30 -0
  252. package/dist/tools/publishers.d.ts.map +1 -0
  253. package/dist/tools/publishers.js +105 -0
  254. package/dist/tools/publishers.js.map +1 -0
  255. package/dist/tools/purchases.d.ts +27 -0
  256. package/dist/tools/purchases.d.ts.map +1 -0
  257. package/dist/tools/purchases.js +9 -0
  258. package/dist/tools/purchases.js.map +1 -0
  259. package/dist/tools/recording-attribution-hints.d.ts +24 -0
  260. package/dist/tools/recording-attribution-hints.d.ts.map +1 -0
  261. package/dist/tools/recording-attribution-hints.js +27 -0
  262. package/dist/tools/recording-attribution-hints.js.map +1 -0
  263. package/dist/tools/recordings.d.ts +96 -0
  264. package/dist/tools/recordings.d.ts.map +1 -0
  265. package/dist/tools/recordings.js +564 -0
  266. package/dist/tools/recordings.js.map +1 -0
  267. package/dist/tools/recovery-hints.d.ts +40 -0
  268. package/dist/tools/recovery-hints.d.ts.map +1 -0
  269. package/dist/tools/recovery-hints.js +827 -0
  270. package/dist/tools/recovery-hints.js.map +1 -0
  271. package/dist/tools/release-rich.d.ts +31 -0
  272. package/dist/tools/release-rich.d.ts.map +1 -0
  273. package/dist/tools/release-rich.js +245 -0
  274. package/dist/tools/release-rich.js.map +1 -0
  275. package/dist/tools/releases.d.ts +36 -0
  276. package/dist/tools/releases.d.ts.map +1 -0
  277. package/dist/tools/releases.js +649 -0
  278. package/dist/tools/releases.js.map +1 -0
  279. package/dist/tools/report-issue.d.ts +21 -0
  280. package/dist/tools/report-issue.d.ts.map +1 -0
  281. package/dist/tools/report-issue.js +101 -0
  282. package/dist/tools/report-issue.js.map +1 -0
  283. package/dist/tools/royalties.d.ts +23 -0
  284. package/dist/tools/royalties.d.ts.map +1 -0
  285. package/dist/tools/royalties.js +262 -0
  286. package/dist/tools/royalties.js.map +1 -0
  287. package/dist/tools/search.d.ts +30 -0
  288. package/dist/tools/search.d.ts.map +1 -0
  289. package/dist/tools/search.js +115 -0
  290. package/dist/tools/search.js.map +1 -0
  291. package/dist/tools/send.d.ts +17 -0
  292. package/dist/tools/send.d.ts.map +1 -0
  293. package/dist/tools/send.js +188 -0
  294. package/dist/tools/send.js.map +1 -0
  295. package/dist/tools/sessions.d.ts +18 -0
  296. package/dist/tools/sessions.d.ts.map +1 -0
  297. package/dist/tools/sessions.js +153 -0
  298. package/dist/tools/sessions.js.map +1 -0
  299. package/dist/tools/settings.d.ts +23 -0
  300. package/dist/tools/settings.d.ts.map +1 -0
  301. package/dist/tools/settings.js +365 -0
  302. package/dist/tools/settings.js.map +1 -0
  303. package/dist/tools/share-links.d.ts +22 -0
  304. package/dist/tools/share-links.d.ts.map +1 -0
  305. package/dist/tools/share-links.js +188 -0
  306. package/dist/tools/share-links.js.map +1 -0
  307. package/dist/tools/signup.d.ts +26 -0
  308. package/dist/tools/signup.d.ts.map +1 -0
  309. package/dist/tools/signup.js +266 -0
  310. package/dist/tools/signup.js.map +1 -0
  311. package/dist/tools/split-sheets.d.ts +25 -0
  312. package/dist/tools/split-sheets.d.ts.map +1 -0
  313. package/dist/tools/split-sheets.js +309 -0
  314. package/dist/tools/split-sheets.js.map +1 -0
  315. package/dist/tools/storage-config.d.ts +13 -0
  316. package/dist/tools/storage-config.d.ts.map +1 -0
  317. package/dist/tools/storage-config.js +245 -0
  318. package/dist/tools/storage-config.js.map +1 -0
  319. package/dist/tools/subscription.d.ts +60 -0
  320. package/dist/tools/subscription.d.ts.map +1 -0
  321. package/dist/tools/subscription.js +440 -0
  322. package/dist/tools/subscription.js.map +1 -0
  323. package/dist/tools/sync-placements.d.ts +31 -0
  324. package/dist/tools/sync-placements.d.ts.map +1 -0
  325. package/dist/tools/sync-placements.js +431 -0
  326. package/dist/tools/sync-placements.js.map +1 -0
  327. package/dist/tools/team.d.ts +22 -0
  328. package/dist/tools/team.d.ts.map +1 -0
  329. package/dist/tools/team.js +144 -0
  330. package/dist/tools/team.js.map +1 -0
  331. package/dist/tools/telegram.d.ts +21 -0
  332. package/dist/tools/telegram.d.ts.map +1 -0
  333. package/dist/tools/telegram.js +144 -0
  334. package/dist/tools/telegram.js.map +1 -0
  335. package/dist/tools/uploads.d.ts +17 -0
  336. package/dist/tools/uploads.d.ts.map +1 -0
  337. package/dist/tools/uploads.js +165 -0
  338. package/dist/tools/uploads.js.map +1 -0
  339. package/dist/tools/works.d.ts +71 -0
  340. package/dist/tools/works.d.ts.map +1 -0
  341. package/dist/tools/works.js +694 -0
  342. package/dist/tools/works.js.map +1 -0
  343. package/package.json +54 -0
  344. package/scripts/build-required-schemas.ts +233 -0
  345. package/scripts/bundle-apps.ts +61 -0
  346. package/scripts/refresh-schema-mirror.ts +182 -0
  347. package/server.json +20 -0
@@ -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. ~232 tools are available. fourteen 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- see `pica://schemas/audio-upload-required`.\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 `pica_enrichment_proposal_reject` \u2014 dismiss with content-hash suppression.\n- see `pica://schemas/enrichment-resolve-required`.\n\n### create an agreement\n1. `pica_agreements_create` \u2014 title + agreement_type + other_party_name\n required. prefer counterparty_org_id (FK) over free-text other_party_name.\n2. `pica_agreements_link_work` \u2014 attach works (optional royalty_split per work).\n3. `pica_agreement_templates_render` \u2014 template-driven alternative.\n- see `pica://schemas/agreement-required`.\n\n### add multimedia\n- `pica_multimedia_create` \u2014 title + content_type required.\n- `pica_multimedia_link_youtube` \u2014 YouTube videos (auto-enriched).\n- `pica_multimedia_import_url` \u2014 external image / video URL (downloads\n into PICA storage).\n- `pica_multimedia_link_work` \u2014 attach to a work (relationship_type required).\n- see `pica://schemas/multimedia-required`.\n\n### log a studio session\n1. (optional) `pica_sessions_types` \u2014 pre-flight to discover valid\n `session_type_id` values for this org. Lookup table; org-scoped.\n2. `pica_sessions_create` \u2014 title + start_time + end_time (ISO 8601).\n session_type_id, location, work_id, recording_id, participants are\n all optional inline fields.\n3. `pica_sessions_get` / `pica_sessions_list` \u2014 read-back / browse.\n- the `status` enum (scheduled / in_progress / completed / cancelled) is\n documented but NOT enforced by a DB CHECK \u2014 values may evolve.\n- see `pica://schemas/session-required`.\n\n### generate a split sheet (publishing royalties on a work)\n1. **pre-condition:** writer credits on the work must already total 100%\n via `pica_credits_update`. `pica_split_sheet_generate` returns 400\n otherwise.\n2. `pica_split_sheet_generate` \u2014 work_id only; snapshots current splits.\n3. `pica_split_sheet_send` \u2014 notify each credited writer for signature\n via in-app + Telegram + email. Non-PICA-user writers get a\n collaboration invite email instead. Per-writer soft-fails.\n4. `pica_split_sheet_get` / `pica_split_sheet_list` \u2014 read-back.\n- see `pica://schemas/split-sheet-required`.\n\n### assign master ownership splits (recording rights)\n- DISTINCT from publishing splits above. Recording splits live on\n `recording_splits`, not `work_credits`. Drives master royalty payouts\n + downstream credit gating.\n1. `pica_recording_splits_create` \u2014 recording_id + split_type\n (master / mechanical / performance / sync) + percentage required.\n role / person_id / territory / start_date / end_date optional.\n Use `dry_run: true` for a no-op preview before committing.\n ADR-200 form-confirmation gate fires on connectors that support\n `elicitation/url`.\n2. `pica_recording_splits_verify` \u2014 explicitly mark a split as agreed.\n3. `pica_recording_splits_list` \u2014 list all splits on a recording.\n- see `pica://schemas/recording-splits-required`.\n\n### assign an industry identifier (iswc / isrc / isni / ipi / etc.)\n**there is no standalone identifier-assign tool.** every identifier is\nan inline field on the entity's update tool. don't search for a\ngeneric identifier-assign verb \u2014 set the field on `pica_works_update`\n/ `pica_recordings_update` / `pica_people_update` directly.\n\n- **work identifiers** \u2192 `pica_works_update`: `iswc`, `isrc`,\n `tunecode`, `prs_work_id`, `spotify_track_uri`.\n- **recording identifiers** \u2192 `pica_recordings_update`: `isrc`,\n `isrc_source`, `musicbrainz_recording_id`, `mlc_recording_id`,\n `mlc_song_code`, `spotify_track_uri`, `spotify_track_id`,\n `youtube_video_id`, `youtube_url`, `apple_music_url`,\n `deezer_track_id`, `ppl_recording_id`.\n- **person identifiers** \u2192 `pica_people_update`: `cae_ipi_number`,\n `ipn_number`, `prs_number`, `ppl_number`, `mcps_member_number`,\n `pro_name` + `pro_member_number`, plus the satellite-routed\n identifiers below.\n\n**satellite-routed person identifiers (set them inline anyway):**\n`isni`, `musicbrainz_id`, `wikidata_id`, `discogs_artist_id`,\n`deezer_artist_id` are stored on the `person_enrichment` satellite\ntable under the hood, NOT on `people`. **don't think about that.**\nset them as inline fields on `pica_people_update` exactly like the\nnon-satellite identifiers above; the service fans out automatically.\nthe surface is uniform \u2014 satellites are an implementation detail.\n\nfield-name notes \u2014 these names are surface-precise; the route's\nallow-list rejects the abbreviated forms:\n- `cae_ipi_number` (NOT `cae_ipi`)\n- `ipn_number` (NOT `ipn`)\n- `pro_member_number` (the generic non-PRO/PPL/MCPS variant) is paired\n with `pro_name` to specify which PRO.\n\n**examples:**\n- `pica_works_update { id: \"<uuid>\", iswc: \"T-123.456.789-0\" }`\n- `pica_people_update { id: \"<uuid>\", cae_ipi_number: \"00000000001\",\n isni: \"0000000123456789\" }`\n\n### export the catalog\n- one of: `pica_export_catalog_csv` (broadest, ungated) /\n `pica_export_song_registration` (CWR for PRO/CMO) /\n `pica_export_industry_ready` (publisher / label / sync) /\n `pica_export_catalog_asset_report` (CAR \u2014 finance / insurance / diligence) /\n `pica_export_ai_consent` (AI-consent matrix).\n- see `pica://schemas/export-required` for which export matches which destination.\n\n### claim a discovery\n1. `pica_discoveries_query` \u2014 list pending; row carries\n `type: 'credit' | 'custody' | 'artist'`.\n2. typed claim: `pica_claim_credit` / `pica_claim_custody` /\n `pica_claim_artist`. or `pica_discoveries_review` for generic accept/reject.\n- see `pica://schemas/claim-required`.\n\n## reading the catalog\n\nwrite-flows above assume you already know what to write. these read-\npatterns help you find the right entity / gap / duplicate first.\n\n### find duplicates and merge them\n1. `pica_find_duplicates` \u2014 `entity_type: \"works\" | \"people\"`. returns\n groups + suggested winners.\n2. `pica_merge_duplicates` \u2014 `entity_type` accepts both forms; the\n canonical plural (`\"works\" | \"people\"`) matches `pica_find_duplicates`\n and is preferred. legacy singular (`\"work\" | \"person\"`) still works\n for backwards compatibility. max 25 loser_ids per call. requires\n admin scope.\n- if you need to merge but don't have admin scope, ping a workspace\n owner \u2014 there is no agent-side workaround.\n\n### audit catalog completeness\n1. `pica_dashboard_briefing` \u2014 high-level state: counts of\n needs_attention works, recent activity, unresolved discoveries.\n start here, not at `*_query`.\n2. `pica_dashboard_pulse` \u2014 trend / velocity companion.\n3. drill into specifics from the briefing's pointers \u2014 usually a\n `pica_*_query` filtered by health, then `pica_*_inspect` per row.\n\n### find gaps and fill them\n1. `pica_works_query { health_filter: \"needs_attention\" | \"low_completeness\" }`\n \u2014 under-used. surfaces works missing credits / iswc / metadata.\n parallel filters exist on `pica_recordings_query` /\n `pica_people_query` (`pica_people_query` is full-text only \u2014 no\n typed health_filter yet).\n2. `pica_works_inspect { id, sections: [\"health\", \"completeness\", \"enrichment\"] }`\n \u2014 request only the sections you need. sections=[] (omit) returns\n everything which is noisy.\n3. if the gap is identifier-shaped (missing ISWC / ISRC / ISNI /\n MusicBrainz id) \u2014 `pica_resolve_work` / `_recording` / `_person`\n fans the cascade. tier B fuzzy matches queue as proposals \u2014 drain\n via `pica_enrichment_proposals_list` \u2192 `_apply` / `_reject`.\n\n### look up a person by industry identifier\n- `pica_people_query` accepts a free-text `query` field that matches\n name, email, OR identifier (IPI / ISNI / etc.). there is NO typed\n filter (`pica_people_query { isni: \"...\" }` does not work) \u2014 use\n the `query` string.\n- if no match, fall back to `pica_search_all` for a cross-entity scan.\n- if still no match, the person isn't in the catalog yet \u2014\n `pica_people_create` (set the identifier inline; see the\n identifier-assign section above) \u2192 `pica_resolve_person` to fan\n enrichment across ISNI + MusicBrainz.\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.** every identifier (ISWC,\n ISRC, ISNI, CAE/IPI, MusicBrainz id, etc.) is an inline field on the\n entity's update tool \u2014 see the \"assign an industry identifier\"\n section above for the surface-precise field names.\n- **two write surfaces for collaborators.** `pica_credits_update` is\n canonical for work splits; `pica_recording_credits_update` is the\n recording-side variant with a different role enum (MainArtist /\n FeaturedArtist / Producer / etc.). don't cross them.\n- **people identifiers \u2014 treat as one inline surface.** `pica_people_update`\n accepts every identifier as an inline field; some route to the\n `person_enrichment` satellite under the hood (see the identifier\n section above) \u2014 the surface stays uniform.\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.** writes are org-scoped; iswc\n 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- `pica://schemas/audio-upload-required` \u2014 3-step audio chain.\n- `pica://schemas/enrichment-resolve-required` \u2014 resolve \u2192 proposals chain.\n- `pica://schemas/agreement-required` \u2014 backs `pica_agreements_create`.\n- `pica://schemas/multimedia-required` \u2014 backs `pica_multimedia_create`.\n- `pica://schemas/export-required` \u2014 five export destinations.\n- `pica://schemas/claim-required` \u2014 three discovery claim verbs.\n- `pica://schemas/session-required` \u2014 backs `pica_sessions_create`.\n- `pica://schemas/split-sheet-required` \u2014 backs `pica_split_sheet_generate` (publishing splits on works).\n- `pica://schemas/recording-splits-required` \u2014 backs `pica_recording_splits_create` (master ownership splits on recordings).\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~232 tools across catalog (works, recordings, people, credits, sessions,\nsplits), enrichment, exports, agreements, multimedia, analytics, and\naudio. fourteen required-fields schema resources at\n`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,88ZAqPrC,CAAC;AAEF,eAAO,MAAM,iBAAiB,k6BAuB7B,CAAC"}
@@ -0,0 +1,284 @@
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. ~232 tools are available. fourteen 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
+ - see \`pica://schemas/audio-upload-required\`.
46
+
47
+ ### add recording credits
48
+ - \`pica_recording_credits_update\` — batch. role enum is DISTINCT from
49
+ work credits (MainArtist / FeaturedArtist / Producer / Engineer / etc.).
50
+ - person_id is OPTIONAL — credits can carry just credited_name when the
51
+ person isn't in the catalog yet.
52
+ - see \`pica://schemas/recording-credits-required\`.
53
+
54
+ ### enrich existing metadata
55
+ 1. \`pica_resolve_work\` / \`pica_resolve_person\` / \`pica_resolve_recording\` —
56
+ tier A identifier matches apply directly; tier B fuzzy matches queue
57
+ as proposals.
58
+ 2. \`pica_enrichment_proposals_list\` — view pending proposals.
59
+ 3. \`pica_enrichment_proposal_apply\` — commit a proposal you've reviewed.
60
+ \`pica_enrichment_proposal_reject\` — dismiss with content-hash suppression.
61
+ - see \`pica://schemas/enrichment-resolve-required\`.
62
+
63
+ ### create an agreement
64
+ 1. \`pica_agreements_create\` — title + agreement_type + other_party_name
65
+ required. prefer counterparty_org_id (FK) over free-text other_party_name.
66
+ 2. \`pica_agreements_link_work\` — attach works (optional royalty_split per work).
67
+ 3. \`pica_agreement_templates_render\` — template-driven alternative.
68
+ - see \`pica://schemas/agreement-required\`.
69
+
70
+ ### add multimedia
71
+ - \`pica_multimedia_create\` — title + content_type required.
72
+ - \`pica_multimedia_link_youtube\` — YouTube videos (auto-enriched).
73
+ - \`pica_multimedia_import_url\` — external image / video URL (downloads
74
+ into PICA storage).
75
+ - \`pica_multimedia_link_work\` — attach to a work (relationship_type required).
76
+ - see \`pica://schemas/multimedia-required\`.
77
+
78
+ ### log a studio session
79
+ 1. (optional) \`pica_sessions_types\` — pre-flight to discover valid
80
+ \`session_type_id\` values for this org. Lookup table; org-scoped.
81
+ 2. \`pica_sessions_create\` — title + start_time + end_time (ISO 8601).
82
+ session_type_id, location, work_id, recording_id, participants are
83
+ all optional inline fields.
84
+ 3. \`pica_sessions_get\` / \`pica_sessions_list\` — read-back / browse.
85
+ - the \`status\` enum (scheduled / in_progress / completed / cancelled) is
86
+ documented but NOT enforced by a DB CHECK — values may evolve.
87
+ - see \`pica://schemas/session-required\`.
88
+
89
+ ### generate a split sheet (publishing royalties on a work)
90
+ 1. **pre-condition:** writer credits on the work must already total 100%
91
+ via \`pica_credits_update\`. \`pica_split_sheet_generate\` returns 400
92
+ otherwise.
93
+ 2. \`pica_split_sheet_generate\` — work_id only; snapshots current splits.
94
+ 3. \`pica_split_sheet_send\` — notify each credited writer for signature
95
+ via in-app + Telegram + email. Non-PICA-user writers get a
96
+ collaboration invite email instead. Per-writer soft-fails.
97
+ 4. \`pica_split_sheet_get\` / \`pica_split_sheet_list\` — read-back.
98
+ - see \`pica://schemas/split-sheet-required\`.
99
+
100
+ ### assign master ownership splits (recording rights)
101
+ - DISTINCT from publishing splits above. Recording splits live on
102
+ \`recording_splits\`, not \`work_credits\`. Drives master royalty payouts
103
+ + downstream credit gating.
104
+ 1. \`pica_recording_splits_create\` — recording_id + split_type
105
+ (master / mechanical / performance / sync) + percentage required.
106
+ role / person_id / territory / start_date / end_date optional.
107
+ Use \`dry_run: true\` for a no-op preview before committing.
108
+ ADR-200 form-confirmation gate fires on connectors that support
109
+ \`elicitation/url\`.
110
+ 2. \`pica_recording_splits_verify\` — explicitly mark a split as agreed.
111
+ 3. \`pica_recording_splits_list\` — list all splits on a recording.
112
+ - see \`pica://schemas/recording-splits-required\`.
113
+
114
+ ### assign an industry identifier (iswc / isrc / isni / ipi / etc.)
115
+ **there is no standalone identifier-assign tool.** every identifier is
116
+ an inline field on the entity's update tool. don't search for a
117
+ generic identifier-assign verb — set the field on \`pica_works_update\`
118
+ / \`pica_recordings_update\` / \`pica_people_update\` directly.
119
+
120
+ - **work identifiers** → \`pica_works_update\`: \`iswc\`, \`isrc\`,
121
+ \`tunecode\`, \`prs_work_id\`, \`spotify_track_uri\`.
122
+ - **recording identifiers** → \`pica_recordings_update\`: \`isrc\`,
123
+ \`isrc_source\`, \`musicbrainz_recording_id\`, \`mlc_recording_id\`,
124
+ \`mlc_song_code\`, \`spotify_track_uri\`, \`spotify_track_id\`,
125
+ \`youtube_video_id\`, \`youtube_url\`, \`apple_music_url\`,
126
+ \`deezer_track_id\`, \`ppl_recording_id\`.
127
+ - **person identifiers** → \`pica_people_update\`: \`cae_ipi_number\`,
128
+ \`ipn_number\`, \`prs_number\`, \`ppl_number\`, \`mcps_member_number\`,
129
+ \`pro_name\` + \`pro_member_number\`, plus the satellite-routed
130
+ identifiers below.
131
+
132
+ **satellite-routed person identifiers (set them inline anyway):**
133
+ \`isni\`, \`musicbrainz_id\`, \`wikidata_id\`, \`discogs_artist_id\`,
134
+ \`deezer_artist_id\` are stored on the \`person_enrichment\` satellite
135
+ table under the hood, NOT on \`people\`. **don't think about that.**
136
+ set them as inline fields on \`pica_people_update\` exactly like the
137
+ non-satellite identifiers above; the service fans out automatically.
138
+ the surface is uniform — satellites are an implementation detail.
139
+
140
+ field-name notes — these names are surface-precise; the route's
141
+ allow-list rejects the abbreviated forms:
142
+ - \`cae_ipi_number\` (NOT \`cae_ipi\`)
143
+ - \`ipn_number\` (NOT \`ipn\`)
144
+ - \`pro_member_number\` (the generic non-PRO/PPL/MCPS variant) is paired
145
+ with \`pro_name\` to specify which PRO.
146
+
147
+ **examples:**
148
+ - \`pica_works_update { id: "<uuid>", iswc: "T-123.456.789-0" }\`
149
+ - \`pica_people_update { id: "<uuid>", cae_ipi_number: "00000000001",
150
+ isni: "0000000123456789" }\`
151
+
152
+ ### export the catalog
153
+ - one of: \`pica_export_catalog_csv\` (broadest, ungated) /
154
+ \`pica_export_song_registration\` (CWR for PRO/CMO) /
155
+ \`pica_export_industry_ready\` (publisher / label / sync) /
156
+ \`pica_export_catalog_asset_report\` (CAR — finance / insurance / diligence) /
157
+ \`pica_export_ai_consent\` (AI-consent matrix).
158
+ - see \`pica://schemas/export-required\` for which export matches which destination.
159
+
160
+ ### claim a discovery
161
+ 1. \`pica_discoveries_query\` — list pending; row carries
162
+ \`type: 'credit' | 'custody' | 'artist'\`.
163
+ 2. typed claim: \`pica_claim_credit\` / \`pica_claim_custody\` /
164
+ \`pica_claim_artist\`. or \`pica_discoveries_review\` for generic accept/reject.
165
+ - see \`pica://schemas/claim-required\`.
166
+
167
+ ## reading the catalog
168
+
169
+ write-flows above assume you already know what to write. these read-
170
+ patterns help you find the right entity / gap / duplicate first.
171
+
172
+ ### find duplicates and merge them
173
+ 1. \`pica_find_duplicates\` — \`entity_type: "works" | "people"\`. returns
174
+ groups + suggested winners.
175
+ 2. \`pica_merge_duplicates\` — \`entity_type\` accepts both forms; the
176
+ canonical plural (\`"works" | "people"\`) matches \`pica_find_duplicates\`
177
+ and is preferred. legacy singular (\`"work" | "person"\`) still works
178
+ for backwards compatibility. max 25 loser_ids per call. requires
179
+ admin scope.
180
+ - if you need to merge but don't have admin scope, ping a workspace
181
+ owner — there is no agent-side workaround.
182
+
183
+ ### audit catalog completeness
184
+ 1. \`pica_dashboard_briefing\` — high-level state: counts of
185
+ needs_attention works, recent activity, unresolved discoveries.
186
+ start here, not at \`*_query\`.
187
+ 2. \`pica_dashboard_pulse\` — trend / velocity companion.
188
+ 3. drill into specifics from the briefing's pointers — usually a
189
+ \`pica_*_query\` filtered by health, then \`pica_*_inspect\` per row.
190
+
191
+ ### find gaps and fill them
192
+ 1. \`pica_works_query { health_filter: "needs_attention" | "low_completeness" }\`
193
+ — under-used. surfaces works missing credits / iswc / metadata.
194
+ parallel filters exist on \`pica_recordings_query\` /
195
+ \`pica_people_query\` (\`pica_people_query\` is full-text only — no
196
+ typed health_filter yet).
197
+ 2. \`pica_works_inspect { id, sections: ["health", "completeness", "enrichment"] }\`
198
+ — request only the sections you need. sections=[] (omit) returns
199
+ everything which is noisy.
200
+ 3. if the gap is identifier-shaped (missing ISWC / ISRC / ISNI /
201
+ MusicBrainz id) — \`pica_resolve_work\` / \`_recording\` / \`_person\`
202
+ fans the cascade. tier B fuzzy matches queue as proposals — drain
203
+ via \`pica_enrichment_proposals_list\` → \`_apply\` / \`_reject\`.
204
+
205
+ ### look up a person by industry identifier
206
+ - \`pica_people_query\` accepts a free-text \`query\` field that matches
207
+ name, email, OR identifier (IPI / ISNI / etc.). there is NO typed
208
+ filter (\`pica_people_query { isni: "..." }\` does not work) — use
209
+ the \`query\` string.
210
+ - if no match, fall back to \`pica_search_all\` for a cross-entity scan.
211
+ - if still no match, the person isn't in the catalog yet —
212
+ \`pica_people_create\` (set the identifier inline; see the
213
+ identifier-assign section above) → \`pica_resolve_person\` to fan
214
+ enrichment across ISNI + MusicBrainz.
215
+
216
+ ## common gotchas
217
+
218
+ - **duration units differ.** \`works.duration_seconds\` (integer seconds);
219
+ \`recordings.duration_ms\` (integer milliseconds);
220
+ \`audio_files.duration_seconds\` (seconds again).
221
+ - **no standalone identifier-assign tool.** every identifier (ISWC,
222
+ ISRC, ISNI, CAE/IPI, MusicBrainz id, etc.) is an inline field on the
223
+ entity's update tool — see the "assign an industry identifier"
224
+ section above for the surface-precise field names.
225
+ - **two write surfaces for collaborators.** \`pica_credits_update\` is
226
+ canonical for work splits; \`pica_recording_credits_update\` is the
227
+ recording-side variant with a different role enum (MainArtist /
228
+ FeaturedArtist / Producer / etc.). don't cross them.
229
+ - **people identifiers — treat as one inline surface.** \`pica_people_update\`
230
+ accepts every identifier as an inline field; some route to the
231
+ \`person_enrichment\` satellite under the hood (see the identifier
232
+ section above) — the surface stays uniform.
233
+ - **audio analysis is async + explicit.** \`pica_audio_complete_upload\`
234
+ does NOT auto-trigger analysis. call \`pica_audio_analyze\` and poll.
235
+ - **lyrics from analysis don't auto-write back to \`works.lyrics\`.**
236
+ whisper transcripts land on the analysis row; copy is a separate step.
237
+ - **org scoping + duplicate prevention.** writes are org-scoped; iswc
238
+ and isrc duplicates are blocked at write.
239
+
240
+ ## schema resources (pre-flight before each workflow)
241
+
242
+ - \`pica://schemas/work-required\` — backs \`pica_works_create\`.
243
+ - \`pica://schemas/recording-required\` — backs \`pica_recordings_create\`.
244
+ - \`pica://schemas/work-credits-required\` — backs \`pica_credits_update\`.
245
+ - \`pica://schemas/recording-credits-required\` — backs \`pica_recording_credits_update\`.
246
+ - \`pica://schemas/person-required\` — backs \`pica_people_create\`.
247
+ - \`pica://schemas/audio-upload-required\` — 3-step audio chain.
248
+ - \`pica://schemas/enrichment-resolve-required\` — resolve → proposals chain.
249
+ - \`pica://schemas/agreement-required\` — backs \`pica_agreements_create\`.
250
+ - \`pica://schemas/multimedia-required\` — backs \`pica_multimedia_create\`.
251
+ - \`pica://schemas/export-required\` — five export destinations.
252
+ - \`pica://schemas/claim-required\` — three discovery claim verbs.
253
+ - \`pica://schemas/session-required\` — backs \`pica_sessions_create\`.
254
+ - \`pica://schemas/split-sheet-required\` — backs \`pica_split_sheet_generate\` (publishing splits on works).
255
+ - \`pica://schemas/recording-splits-required\` — backs \`pica_recording_splits_create\` (master ownership splits on recordings).
256
+
257
+ each schema returns a json contract: required fields, recommended fields,
258
+ CHECK enum values, companion-call orchestration, and an example payload.
259
+ `;
260
+ export const AGENT_GUIDE_LOBBY = `# pica — sign in to begin
261
+
262
+ you are in lobby mode. three tools are available; the rest unlock after
263
+ sign-in.
264
+
265
+ ## lobby tools
266
+ - \`pica_signup_start\` — create a new organisation and get a magic link
267
+ for first-time setup.
268
+ - \`pica_sign_in\` — request a magic link for an existing user.
269
+ - \`pica_sign_out\` — drop session.
270
+
271
+ ## to sign in
272
+ 1. ask the user for an email address.
273
+ 2. call \`pica_signup_start\` (new user) or \`pica_sign_in\` (returning).
274
+ 3. user clicks the magic link. on the next request, the catalog tool
275
+ surface unlocks automatically — no config to refresh.
276
+
277
+ ## what unlocks after sign-in
278
+ ~232 tools across catalog (works, recordings, people, credits, sessions,
279
+ splits), enrichment, exports, agreements, multimedia, analytics, and
280
+ audio. fourteen required-fields schema resources at
281
+ \`pica://schemas/<workflow>-required\`.
282
+ the full agent-guide replaces this lobby content.
283
+ `;
284
+ //# 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqPxC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBhC,CAAC"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Resource Registry for MCP Server
3
+ * Manages read-only data resources that AI assistants can access
4
+ */
5
+ import { PicaClient } from "@withpica/mcp-sdk";
6
+ import { ServerConfig } from "../config.js";
7
+ export interface ResourceDefinition {
8
+ uri: string;
9
+ name: string;
10
+ description: string;
11
+ mimeType: string;
12
+ }
13
+ export interface ResourceContent {
14
+ contents: Array<{
15
+ uri: string;
16
+ mimeType: string;
17
+ text: string;
18
+ }>;
19
+ }
20
+ export type ResourceResult = any;
21
+ export declare class ResourceRegistry {
22
+ private pica;
23
+ private config?;
24
+ constructor(pica: PicaClient | null, config?: ServerConfig);
25
+ /**
26
+ * List all available resources
27
+ */
28
+ listResources(): ResourceDefinition[];
29
+ /**
30
+ * Read a resource by URI
31
+ */
32
+ readResource(uri: string): Promise<any>;
33
+ /**
34
+ * Get OpenAPI specification resource
35
+ */
36
+ private getOpenAPISpec;
37
+ /**
38
+ * Get works list resource
39
+ */
40
+ private getWorksList;
41
+ /**
42
+ * Get people list resource
43
+ */
44
+ private getPeopleList;
45
+ /**
46
+ * Get recordings list resource
47
+ */
48
+ private getRecordingsList;
49
+ /**
50
+ * Get catalog statistics resource
51
+ */
52
+ private getCatalogStats;
53
+ /**
54
+ * Get catalog health (PICA Score) resource
55
+ */
56
+ private getCatalogHealth;
57
+ /**
58
+ * Get workspace context resource — aggregated orientation for agents
59
+ */
60
+ private getWorkspaceContext;
61
+ /**
62
+ * Get recent events resource — webhook deliveries
63
+ */
64
+ private getRecentEvents;
65
+ }
66
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;AAU/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;IA8MrC;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAyJ7C;;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"}