@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,616 @@
1
+ // Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
2
+ import { formatAsText, formatSuccess } from "@withpica/mcp-utils";
3
+ import { withBillingGate } from "@withpica/mcp-utils";
4
+ import { computeProposalListGapHints } from "./gap-hints.js";
5
+ export class EnrichmentTools {
6
+ pica;
7
+ constructor(pica) {
8
+ this.pica = pica;
9
+ }
10
+ getTools() {
11
+ return [
12
+ // ============================================================
13
+ // ADR-179: outcome-shaped resolver (replaces 5 per-source tools)
14
+ // ============================================================
15
+ {
16
+ definition: {
17
+ name: "pica_resolve_recording",
18
+ description: "Resolve a recording against every eligible external source in one call — Spotify, YouTube, MusicBrainz, Discogs. " +
19
+ "First recording-side enrichment tool in the MCP. Returns a structured receipt: " +
20
+ "`applied[]` (identifier-matched Tier A writes), `proposals[]` (Tier B fuzzy matches — reserved for future cascade rules), " +
21
+ "`errors[]` (per-source failures with retry hints). Partial failure is not an error — isError is set only when EVERY " +
22
+ "eligible source errored. " +
23
+ "Spotify adapter fetches Spotify track metadata (triggered by spotify_track_uri / spotify_track_id on the recording) " +
24
+ "and writes preview_url, duration_ms, isrc, and the URL set to NULL columns only — non-destructive. " +
25
+ "YouTube adapter fetches video metadata (triggered by youtube_video_id) and wires the version-classification heuristic " +
26
+ "to populate version_type when it\'s NULL (satisfies the recordings.version_type CHECK constraint). An existing version_type " +
27
+ "is never overwritten. " +
28
+ "MusicBrainz + Discogs sources are stubs for now. " +
29
+ "→ then: pica_recordings_inspect (see what changed)",
30
+ workflows: ["enrichment-resolve-required"],
31
+ inputSchema: {
32
+ type: "object",
33
+ properties: {
34
+ recording_id: {
35
+ type: "string",
36
+ description: "The recording ID to resolve",
37
+ },
38
+ sources: {
39
+ type: "array",
40
+ items: {
41
+ type: "string",
42
+ enum: ["spotify", "youtube", "musicbrainz", "discogs"],
43
+ },
44
+ description: "Optional whitelist of sources to run. Omit to fan out to every eligible source.",
45
+ },
46
+ include_fuzzy: {
47
+ type: "boolean",
48
+ description: "Default true. Set false to skip Tier B fuzzy-match rules.",
49
+ },
50
+ },
51
+ required: ["recording_id"],
52
+ },
53
+ },
54
+ executor: withBillingGate(this.pica, "Recording resolver", this.resolveRecording.bind(this)),
55
+ },
56
+ {
57
+ definition: {
58
+ name: "pica_resolve_person",
59
+ description: "Resolve a person against every eligible identity-graph source in one call — ISNI, MusicBrainz, Wikidata (downstream of both). " +
60
+ "Returns a structured receipt: " +
61
+ "`applied[]` (identifier-matched Tier A writes — wikidata_id, awards, biography), " +
62
+ "`proposals[]` (fuzzy Tier B matches filed to the review queue), " +
63
+ "`errors[]` (per-source failures with retry hints). Partial failure is not an error — isError is set only when EVERY " +
64
+ "eligible source errored. " +
65
+ "Sources list is optional; omit to fan out to every source whose trigger identifiers are present on the person. " +
66
+ "Narrow to a single source with e.g. `sources: ['isni']` to call just one. " +
67
+ "Set `include_fuzzy: false` to skip Tier B rules entirely (identifier-only pass, no review proposals queued). " +
68
+ "→ then: pica_enrichment_proposals_list (review fuzzy matches), pica_people_inspect (see what changed), pica_enrichment_proposal_apply (accept a proposal)",
69
+ workflows: ["enrichment-resolve-required"],
70
+ inputSchema: {
71
+ type: "object",
72
+ properties: {
73
+ person_id: {
74
+ type: "string",
75
+ description: "The person ID to resolve",
76
+ },
77
+ sources: {
78
+ type: "array",
79
+ items: {
80
+ type: "string",
81
+ enum: ["isni", "musicbrainz"],
82
+ },
83
+ description: "Optional whitelist of sources to run. Omit to fan out to every eligible source.",
84
+ },
85
+ include_fuzzy: {
86
+ type: "boolean",
87
+ description: "Default true. Set false to skip Tier B fuzzy-match rules (no review proposals queued).",
88
+ },
89
+ },
90
+ required: ["person_id"],
91
+ },
92
+ },
93
+ executor: withBillingGate(this.pica, "Person resolver", this.resolvePerson.bind(this)),
94
+ },
95
+ {
96
+ definition: {
97
+ name: "pica_resolve_work",
98
+ description: "Resolve a work against every eligible external source in one call — MLC, Spotify, YouTube, MusicBrainz, Discogs. " +
99
+ "Returns a structured receipt: " +
100
+ "`applied[]` (identifier-matched Tier A writes), `proposals[]` (fuzzy Tier B matches filed to the review queue), " +
101
+ "`errors[]` (per-source failures with retry hints). Partial failure is not an error — isError is set only when EVERY " +
102
+ "eligible source errored. " +
103
+ "Sources list is optional; omit to fan out to every source whose trigger identifiers are present on the work. " +
104
+ "Narrow to a single source with e.g. `sources: ['spotify']` to call just one. " +
105
+ "Set `include_fuzzy: false` to skip Tier B rules entirely (identifier-only pass, no review proposals queued). " +
106
+ "→ then: pica_enrichment_proposals_list (review fuzzy matches), pica_works_inspect (see what changed), pica_enrichment_proposal_apply (accept a proposal)",
107
+ workflows: ["enrichment-resolve-required"],
108
+ inputSchema: {
109
+ type: "object",
110
+ properties: {
111
+ work_id: {
112
+ type: "string",
113
+ description: "The work ID to resolve",
114
+ },
115
+ sources: {
116
+ type: "array",
117
+ items: {
118
+ type: "string",
119
+ enum: ["mlc", "spotify", "youtube", "musicbrainz", "discogs"],
120
+ },
121
+ description: "Optional whitelist of sources to run. Omit to fan out to every eligible source.",
122
+ },
123
+ include_fuzzy: {
124
+ type: "boolean",
125
+ description: "Default true. Set false to skip Tier B fuzzy-match rules (no review proposals queued).",
126
+ },
127
+ },
128
+ required: ["work_id"],
129
+ },
130
+ },
131
+ executor: withBillingGate(this.pica, "Work resolver", this.resolveWork.bind(this)),
132
+ },
133
+ {
134
+ definition: {
135
+ name: "pica_enrichment_candidates",
136
+ description: "Find works and people that are candidates for enrichment (missing external identifiers or metadata). " +
137
+ "→ then: pica_resolve_work (fan out across every eligible source), pica_resolve_person (same for people)",
138
+ workflows: "infrastructure",
139
+ inputSchema: {
140
+ type: "object",
141
+ properties: {},
142
+ },
143
+ },
144
+ executor: this.enrichmentCandidates.bind(this),
145
+ },
146
+ {
147
+ definition: {
148
+ name: "pica_run_work_cascade",
149
+ description: "Re-evaluate a work against every cascade rule and fire those whose preconditions are satisfied. " +
150
+ "Use after a tool or direct edit that bypassed the cascade, or to retry enrichment after adding a missing identifier. " +
151
+ "Idempotent: rules whose output is already present skip. Runs fire-and-forget; check results via pica_works_inspect. " +
152
+ "→ then: pica_works_inspect (see what changed), pica_cascade_health (spot-check failures)",
153
+ workflows: "infrastructure",
154
+ inputSchema: {
155
+ type: "object",
156
+ properties: {
157
+ work_id: {
158
+ type: "string",
159
+ description: "The work ID to re-evaluate",
160
+ },
161
+ },
162
+ required: ["work_id"],
163
+ },
164
+ },
165
+ executor: withBillingGate(this.pica, "Work cascade run", this.runWorkCascade.bind(this)),
166
+ },
167
+ {
168
+ definition: {
169
+ name: "pica_run_person_cascade",
170
+ description: "Re-evaluate a person against every cascade rule. Fires ipi_to_mlc_works (pulls MLC writer/publisher splits), " +
171
+ "mbid/isni→wikidata crosswalks, wikidata_to_awards, wikidata_to_biography, and the Google contact suggestion. " +
172
+ "Idempotent. Fire-and-forget. → then: pica_people_inspect (see what the cascade wrote)",
173
+ workflows: "infrastructure",
174
+ inputSchema: {
175
+ type: "object",
176
+ properties: {
177
+ person_id: {
178
+ type: "string",
179
+ description: "The person ID to re-evaluate",
180
+ },
181
+ },
182
+ required: ["person_id"],
183
+ },
184
+ },
185
+ executor: withBillingGate(this.pica, "Person cascade run", this.runPersonCascade.bind(this)),
186
+ },
187
+ {
188
+ definition: {
189
+ name: "pica_cascade_health",
190
+ description: "Snapshot of the in-process enrichment cascade counters. " +
191
+ "Returns per-rule failure counts bucketed by reason (empty_result, timeout, auth_error, rate_limit, schema_error, unknown) " +
192
+ "plus outcome totals (wrote / no_match / already_enriched / error / proposed / suppressed). " +
193
+ "Process-global and not persistent across serverless cold starts — treat as a spot-check, not a historical ledger. " +
194
+ "Use when cascade enrichment looks unhealthy or after shipping new rules.",
195
+ workflows: "infrastructure",
196
+ inputSchema: {
197
+ type: "object",
198
+ properties: {},
199
+ },
200
+ },
201
+ executor: this.cascadeHealth.bind(this),
202
+ },
203
+ // ============================================================
204
+ // ADR-163: Tier B enrichment proposal review tools
205
+ // ============================================================
206
+ {
207
+ definition: {
208
+ name: "pica_enrichment_proposals_list",
209
+ description: "List pending enrichment proposals awaiting review (Tier B fuzzy matches). " +
210
+ "These are matches from fuzzy-match cascade rules (MLC writer splits, " +
211
+ "Spotify artist+title, YouTube recording classification) that the cascade " +
212
+ "holds for human review instead of writing through automatically. " +
213
+ "Only pending proposals are returned — applied, rejected, and expired " +
214
+ "rows are invisible. Default order: newest first, limit 20 (max 100). " +
215
+ "→ then: pica_enrichment_proposal_apply (accept a proposal), " +
216
+ "pica_enrichment_proposal_reject (dismiss a proposal)",
217
+ workflows: ["enrichment-resolve-required"],
218
+ inputSchema: {
219
+ type: "object",
220
+ properties: {
221
+ entity_type: {
222
+ type: "string",
223
+ enum: ["work", "person", "recording"],
224
+ description: "Filter to proposals anchored on a specific entity type",
225
+ },
226
+ entity_id: {
227
+ type: "string",
228
+ description: "Filter to proposals anchored on a specific entity (pairs with entity_type)",
229
+ },
230
+ rule_id: {
231
+ type: "string",
232
+ description: "Filter by cascade rule id (e.g. 'ipi_to_mlc_works', 'artist_title_to_spotify', 'artist_title_to_youtube')",
233
+ },
234
+ source: {
235
+ type: "string",
236
+ description: "Filter by source ('mlc', 'spotify', 'youtube', 'wikidata', etc.)",
237
+ },
238
+ limit: {
239
+ type: "integer",
240
+ description: "Max results, 1..100 (default 20)",
241
+ },
242
+ offset: {
243
+ type: "integer",
244
+ description: "Pagination offset (default 0)",
245
+ },
246
+ },
247
+ },
248
+ },
249
+ executor: this.listEnrichmentProposals.bind(this),
250
+ },
251
+ {
252
+ definition: {
253
+ name: "pica_enrichment_proposal_apply",
254
+ description: "Apply a pending Tier B enrichment proposal. " +
255
+ "For update proposals (e.g. MLC writer splits on a work), drift " +
256
+ "detection runs first: if the entity has changed since the proposal " +
257
+ "was created, the response is { status: 'drift_detected', conflicts } " +
258
+ "and nothing is written. On drift, show the conflicts to the user " +
259
+ "before retrying with force=true. For create proposals (e.g. creating " +
260
+ "a YouTube recording on a work), a uniqueness check runs instead and " +
261
+ "cannot be forced. → then: pica_works_inspect (see the resolved work) " +
262
+ "or pica_recordings_inspect (see the resolved recording)",
263
+ workflows: ["enrichment-resolve-required"],
264
+ inputSchema: {
265
+ type: "object",
266
+ properties: {
267
+ proposal_id: {
268
+ type: "string",
269
+ description: "The proposal id to apply",
270
+ },
271
+ force: {
272
+ type: "boolean",
273
+ description: "Bypass drift detection (update proposals only). Only set after the user has reviewed the conflicts from a prior drift_detected response.",
274
+ },
275
+ resolution_note: {
276
+ type: "string",
277
+ description: "Optional note recorded on the resolved row (free-form text)",
278
+ },
279
+ },
280
+ required: ["proposal_id"],
281
+ },
282
+ },
283
+ executor: withBillingGate(this.pica, "Enrichment proposal apply", this.applyEnrichmentProposal.bind(this)),
284
+ },
285
+ {
286
+ definition: {
287
+ name: "pica_enrichment_proposal_reject",
288
+ description: "Reject a pending Tier B enrichment proposal. " +
289
+ "Content-hash suppression permanently blocks re-proposal of the " +
290
+ "same exact content — the cascade will only re-propose if the " +
291
+ "source data genuinely changes (different MLC record, different " +
292
+ "Spotify match). No cooldown, no timer. Use when the proposal is " +
293
+ "wrong (homonym collision, stale source data, etc.) and you want " +
294
+ "the cascade to stop suggesting it.",
295
+ workflows: ["enrichment-resolve-required"],
296
+ inputSchema: {
297
+ type: "object",
298
+ properties: {
299
+ proposal_id: {
300
+ type: "string",
301
+ description: "The proposal id to reject",
302
+ },
303
+ resolution_note: {
304
+ type: "string",
305
+ description: "Optional reason recorded on the rejected row (e.g. 'wrong writer — homonym')",
306
+ },
307
+ },
308
+ required: ["proposal_id"],
309
+ },
310
+ },
311
+ executor: withBillingGate(this.pica, "Enrichment proposal reject", this.rejectEnrichmentProposal.bind(this)),
312
+ },
313
+ // ============================================================
314
+ // ADR-178: Agent-proposed enrichment from open-web research
315
+ // ============================================================
316
+ {
317
+ definition: {
318
+ name: "pica_enrichment_propose",
319
+ description: "File an enrichment proposal sourced from open-web research. " +
320
+ "Use when you've found a fact about a work, recording, or person " +
321
+ "from an external site (Audiomack, Songdata, MusicBrainz page, " +
322
+ "label portal, artist bio, etc.) and want PICA to hold it pending " +
323
+ "review. Every proposed field MUST cite at least one source URL — " +
324
+ "unsourced claims are rejected. The server hard-codes source and " +
325
+ "rule_id to 'agent_research'; you do not set them. " +
326
+ "IN-SESSION APPROVAL IS THE CANONICAL FLOW: if the user is in " +
327
+ "this chat, ask for their approval directly, then call " +
328
+ "pica_enrichment_proposal_apply after their confirmation. Do not " +
329
+ "wait for the dashboard. The proposal row is the receipt, not " +
330
+ "the workflow. " +
331
+ "→ then: pica_enrichment_proposal_apply (apply after user approves), " +
332
+ "pica_enrichment_proposal_reject (dismiss if user disagrees)",
333
+ workflows: "infrastructure",
334
+ inputSchema: {
335
+ type: "object",
336
+ properties: {
337
+ entity_type: {
338
+ type: "string",
339
+ enum: ["work", "person", "recording", "agreement"],
340
+ description: "For update: what kind of entity this proposal anchors on. For create: what TYPE is being created (recording / agreement / person). Work + publisher creation are deferred.",
341
+ },
342
+ entity_id: {
343
+ type: "string",
344
+ description: "The entity id in the caller's org. Required for update proposals; omit for create — parent_entity_id carries the attach point instead.",
345
+ },
346
+ proposed_fields: {
347
+ type: "object",
348
+ description: "The fields to propose writing. Every key here must appear in at least one sources[].fields array — otherwise MISSING_SOURCE is returned. Example: { tempo_bpm: 110, musical_key: 'D minor' }",
349
+ additionalProperties: true,
350
+ },
351
+ sources: {
352
+ type: "array",
353
+ description: "Per-field URL citations. Each entry names the fields it sources. One URL can cite multiple fields; one field can be cited by multiple URLs. Non-HTTP URIs (gmail:// gdrive:// notion:// file:// telegram:// user://) are accepted verbatim for sources behind paywalls or in private channels.",
354
+ items: {
355
+ type: "object",
356
+ properties: {
357
+ url: {
358
+ type: "string",
359
+ description: "The URL the fact was retrieved from",
360
+ },
361
+ fields: {
362
+ type: "array",
363
+ items: { type: "string" },
364
+ description: "Which proposed_fields keys this URL sources (non-empty)",
365
+ },
366
+ accessed_at: {
367
+ type: "string",
368
+ description: "ISO 8601 timestamp of when you accessed the URL",
369
+ },
370
+ },
371
+ required: ["url", "fields", "accessed_at"],
372
+ },
373
+ },
374
+ confidence: {
375
+ type: "number",
376
+ description: "Self-reported confidence 0..1 (optional). Surface cross-source agreement, match uncertainty, or source quality here.",
377
+ },
378
+ rationale: {
379
+ type: "string",
380
+ description: "Freeform explanation of how the facts were cross-referenced. Shown on the review surface alongside the sources.",
381
+ },
382
+ proposal_action: {
383
+ type: "string",
384
+ enum: ["update", "create"],
385
+ description: "Defaults to 'update'. 'create' spawns a new recording / agreement / person on a parent entity; pair with parent_entity_type + parent_entity_id. Review queue is mandatory — no silent auto-apply.",
386
+ },
387
+ parent_entity_type: {
388
+ type: "string",
389
+ enum: ["work", "recording", "agreement", "person"],
390
+ description: "For create proposals: the parent entity type. Recording creates MUST set parent_entity_type='work'; agreement creates may optionally link to a work; person creates can omit parent.",
391
+ },
392
+ parent_entity_id: {
393
+ type: "string",
394
+ description: "For create proposals: the parent entity id. Paired with parent_entity_type.",
395
+ },
396
+ },
397
+ required: ["entity_type", "proposed_fields", "sources"],
398
+ },
399
+ },
400
+ executor: withBillingGate(this.pica, "Enrichment agent-research propose", this.proposeAgentResearch.bind(this)),
401
+ },
402
+ ];
403
+ }
404
+ async enrichmentCandidates(_args) {
405
+ const result = await this.pica.enrichment.getCandidates();
406
+ return formatAsText(result);
407
+ }
408
+ /**
409
+ * ADR-179 `pica_resolve_work` executor — fan a work out across
410
+ * eligible enrichment sources and return the structured receipt.
411
+ *
412
+ * `isError` is set only when every source that ran errored. Empty
413
+ * applied[] + empty proposals[] + empty errors[] is a valid result
414
+ * (e.g. work has no trigger identifiers) and surfaces as a
415
+ * non-error response with a human-readable note.
416
+ */
417
+ async resolveWork(args) {
418
+ const workId = args.work_id;
419
+ const sources = args.sources;
420
+ const includeFuzzy = typeof args.include_fuzzy === "boolean" ? args.include_fuzzy : undefined;
421
+ const result = await this.pica.enrichment.resolveWork(workId, {
422
+ sources,
423
+ includeFuzzy,
424
+ });
425
+ // isError semantics per ADR-179 Decision 1: partial failure is not
426
+ // an error. Only when every source that actually ran errored do we
427
+ // flip the flag.
428
+ const ranCount = result.sources_run.length;
429
+ const errorCount = result.errors.length;
430
+ const allErrored = ranCount > 0 && errorCount >= ranCount;
431
+ const summary = `resolve work ${workId} — ` +
432
+ `${result.applied.length} applied, ` +
433
+ `${result.proposals.length} proposals, ` +
434
+ `${errorCount} errors (ran: ${result.sources_run.join(", ") || "none"})`;
435
+ return {
436
+ content: [{ type: "text", text: summary }],
437
+ structuredContent: result,
438
+ isError: allErrored,
439
+ };
440
+ }
441
+ /**
442
+ * ADR-179 Phase 3 `pica_resolve_recording` executor — fan a recording
443
+ * out across eligible platform sources and return the structured
444
+ * receipt. Same isError semantics as resolveWork / resolvePerson.
445
+ */
446
+ async resolveRecording(args) {
447
+ const recordingId = args.recording_id;
448
+ const sources = args.sources;
449
+ const includeFuzzy = typeof args.include_fuzzy === "boolean" ? args.include_fuzzy : undefined;
450
+ const result = await this.pica.enrichment.resolveRecording(recordingId, {
451
+ sources,
452
+ includeFuzzy,
453
+ });
454
+ const ranCount = result.sources_run.length;
455
+ const errorCount = result.errors.length;
456
+ const allErrored = ranCount > 0 && errorCount >= ranCount;
457
+ const summary = `resolve recording ${recordingId} — ` +
458
+ `${result.applied.length} applied, ` +
459
+ `${result.proposals.length} proposals, ` +
460
+ `${errorCount} errors (ran: ${result.sources_run.join(", ") || "none"})`;
461
+ return {
462
+ content: [{ type: "text", text: summary }],
463
+ structuredContent: result,
464
+ isError: allErrored,
465
+ };
466
+ }
467
+ /**
468
+ * ADR-179 Phase 2 `pica_resolve_person` executor — fan a person out
469
+ * across eligible identity-graph sources and return the structured
470
+ * receipt. Mirrors `resolveWork`'s isError semantics: partial failure
471
+ * is a non-error; isError only flips when every source that actually
472
+ * ran errored.
473
+ */
474
+ async resolvePerson(args) {
475
+ const personId = args.person_id;
476
+ const sources = args.sources;
477
+ const includeFuzzy = typeof args.include_fuzzy === "boolean" ? args.include_fuzzy : undefined;
478
+ const result = await this.pica.enrichment.resolvePerson(personId, {
479
+ sources,
480
+ includeFuzzy,
481
+ });
482
+ const ranCount = result.sources_run.length;
483
+ const errorCount = result.errors.length;
484
+ const allErrored = ranCount > 0 && errorCount >= ranCount;
485
+ const summary = `resolve person ${personId} — ` +
486
+ `${result.applied.length} applied, ` +
487
+ `${result.proposals.length} proposals, ` +
488
+ `${errorCount} errors (ran: ${result.sources_run.join(", ") || "none"})`;
489
+ return {
490
+ content: [{ type: "text", text: summary }],
491
+ structuredContent: result,
492
+ isError: allErrored,
493
+ };
494
+ }
495
+ async runWorkCascade(args) {
496
+ const result = await this.pica.enrichment.runWorkCascade(args.work_id);
497
+ return formatSuccess(`Cascade re-evaluation queued for work ${args.work_id}`, result);
498
+ }
499
+ async runPersonCascade(args) {
500
+ const result = await this.pica.enrichment.runPersonCascade(args.person_id);
501
+ return formatSuccess(`Cascade re-evaluation queued for person ${args.person_id}`, result);
502
+ }
503
+ async cascadeHealth(_args) {
504
+ const result = await this.pica.enrichment.getCascadeHealth();
505
+ return formatAsText(result);
506
+ }
507
+ // ============================================================
508
+ // ADR-163 Tier B proposal executors
509
+ // ============================================================
510
+ async listEnrichmentProposals(args) {
511
+ const result = await this.pica.enrichment.listEnrichmentProposals({
512
+ entity_type: args.entity_type,
513
+ entity_id: args.entity_id,
514
+ rule_id: args.rule_id,
515
+ source: args.source,
516
+ limit: args.limit,
517
+ offset: args.offset,
518
+ });
519
+ // ADR-193 Surface 2 — gap hints on empty-list so the agent is
520
+ // reminded it can seed proposals from peer-MCP evidence rather
521
+ // than leaving the user to type.
522
+ const listForHints = Array.isArray(result)
523
+ ? result
524
+ : undefined;
525
+ const gap_hints = computeProposalListGapHints(listForHints);
526
+ const payload = gap_hints.length > 0 ? { proposals: result, gap_hints } : result;
527
+ const summary = Array.isArray(result) && result.length === 0
528
+ ? "No pending proposals"
529
+ : `${Array.isArray(result) ? result.length : "?"} pending proposal(s)`;
530
+ return formatSuccess(summary, payload);
531
+ }
532
+ async applyEnrichmentProposal(args) {
533
+ const proposalId = args.proposal_id;
534
+ const result = await this.pica.enrichment.applyEnrichmentProposal(proposalId, {
535
+ force: args.force === true,
536
+ resolution_note: args.resolution_note,
537
+ });
538
+ return formatSuccess(`Enrichment proposal ${proposalId} — apply result`, result);
539
+ }
540
+ async rejectEnrichmentProposal(args) {
541
+ const proposalId = args.proposal_id;
542
+ const result = await this.pica.enrichment.rejectEnrichmentProposal(proposalId, {
543
+ resolution_note: args.resolution_note,
544
+ });
545
+ return formatSuccess(`Enrichment proposal ${proposalId} rejected`, result);
546
+ }
547
+ /**
548
+ * ADR-178: pica_enrichment_propose.
549
+ *
550
+ * Delegates to PicaClient.enrichment.proposeAgentResearch(). Errors
551
+ * surface from the SDK as `ApiError` with the raw JSON response in
552
+ * the message. We extract the service-layer error code (MISSING_SOURCE,
553
+ * DUPLICATE_SUPPRESSED, etc.) from the parsed body and surface it
554
+ * in structuredContent so the agent can reason about the failure
555
+ * without parsing free-text.
556
+ */
557
+ async proposeAgentResearch(args) {
558
+ try {
559
+ const result = await this.pica.enrichment.proposeAgentResearch({
560
+ entity_type: args.entity_type,
561
+ entity_id: args.entity_id,
562
+ proposed_fields: args.proposed_fields,
563
+ sources: args.sources,
564
+ confidence_score: args.confidence ?? null,
565
+ rationale: args.rationale,
566
+ proposal_action: args.proposal_action,
567
+ parent_entity_type: args.parent_entity_type,
568
+ parent_entity_id: args.parent_entity_id,
569
+ });
570
+ return formatSuccess(`Enrichment proposal ${result.proposal_id} filed (pending review)`, result);
571
+ }
572
+ catch (err) {
573
+ const parsed = extractApiErrorBody(err);
574
+ const code = parsed?.code ??
575
+ (err instanceof Error && err.message.includes("409")
576
+ ? "DUPLICATE_SUPPRESSED"
577
+ : "REQUEST_FAILED");
578
+ const humanMessage = parsed?.error ?? (err instanceof Error ? err.message : "unknown error");
579
+ return {
580
+ content: [
581
+ {
582
+ type: "text",
583
+ text: `enrichment_propose failed — ${code}: ${humanMessage}`,
584
+ },
585
+ ],
586
+ structuredContent: {
587
+ code,
588
+ error: humanMessage,
589
+ details: parsed?.details ?? null,
590
+ },
591
+ isError: true,
592
+ };
593
+ }
594
+ }
595
+ }
596
+ /**
597
+ * Extract a structured error body from an SDK thrown error. The SDK's
598
+ * ApiError wraps the response body text in the message as
599
+ * "API request failed: {status} {body}". We pull the trailing JSON
600
+ * object out and parse it. Returns null on anything we can't parse —
601
+ * the caller falls back to the raw message.
602
+ */
603
+ function extractApiErrorBody(err) {
604
+ if (!(err instanceof Error))
605
+ return null;
606
+ const match = err.message.match(/\{[\s\S]*\}/);
607
+ if (!match)
608
+ return null;
609
+ try {
610
+ return JSON.parse(match[0]);
611
+ }
612
+ catch {
613
+ return null;
614
+ }
615
+ }
616
+ //# sourceMappingURL=enrichment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enrichment.js","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC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