@withpica/mcp-server 2.25.0 → 2.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -18
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/server-instructions.d.ts +1 -1
- package/dist/server-instructions.d.ts.map +1 -1
- package/dist/server-instructions.js +2 -4
- package/dist/server-instructions.js.map +1 -1
- package/dist/tools/audio-files.js +3 -3
- package/dist/tools/audio-files.js.map +1 -1
- package/dist/tools/credits.d.ts +0 -1
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +9 -21
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/dashboard.d.ts +3 -0
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +108 -4
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +5 -8
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/duplicates.d.ts.map +1 -1
- package/dist/tools/duplicates.js +1 -2
- package/dist/tools/duplicates.js.map +1 -1
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +0 -3
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/exports.js +3 -3
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/index.d.ts +0 -7
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +7 -10
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +7 -19
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +22 -30
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/purchases.d.ts +15 -4
- package/dist/tools/purchases.d.ts.map +1 -1
- package/dist/tools/purchases.js +3 -57
- package/dist/tools/purchases.js.map +1 -1
- package/dist/tools/recovery-hints.d.ts.map +1 -1
- package/dist/tools/recovery-hints.js +8 -28
- package/dist/tools/recovery-hints.js.map +1 -1
- package/dist/tools/settings.d.ts +0 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +6 -31
- package/dist/tools/settings.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -11,47 +11,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
-
## [2.25.0] - 2026-04-22
|
|
15
|
-
|
|
16
|
-
### Fixed
|
|
17
|
-
|
|
18
|
-
- **`openWorldHint: true` on 12 external-delivery tools.** Previously hardcoded `openWorldHint: false` on every tool annotation (`src/tools/index.ts` metadata + fallback paths). Tools that reach external recipients — email sends (`pica_collaborators_invite`, `pica_collaborators_invite_bulk`, `pica_collaborators_invite_resend`, `pica_send_message`, `pica_send_resend`, `pica_split_sheet_send`, `pica_submit_license_enquiry`), Telegram posts (`pica_notify_user`, `pica_notify_user_at`, `pica_notify_person`), team-comms routing (`pica_submit_feedback`), and publicly-reachable URL minting (`pica_share_links_create`) — now correctly signal `openWorldHint: true` per the MCP ToolAnnotations spec, letting MCP clients show appropriate confirmation UI for external side effects. Implementation: `ToolMetadata` gains optional `open_world?: boolean`; the annotation builder reads `metadata.open_world ?? false`. No behaviour change beyond the annotation payload. Addresses Anthropic directory-listing reviewer feedback.
|
|
19
|
-
- **ADR-154 F14 follow-up: six dangling `pica_enrich_*` references in `pica_integrations_status` response.** The F14 completion-hint sweep missed `mcp-server/src/tools/integrations.ts` — its `platformReads` list was pointing agents at six tool names that never existed or had already been removed (`pica_enrich_work_spotify`, `pica_enrich_recording_youtube`, `pica_enrich_work_musicbrainz`, `pica_enrich_work_mlc`, `pica_enrich_person_isni`, `pica_enrich_recording_discogs`). Repointed each entry at the correct post-ADR-179 resolver shape (e.g. `pica_resolve_work with sources: ['mlc']`), and updated the free-text summary's trailing "use the `pica_enrich_*` tools" sentence to name the three resolvers. No behaviour change beyond the string payload.
|
|
20
|
-
- **ADR-174 Phase 2c — inverse phantom in `pica_works_update` (works slice).** Three jsonb compliance fields (`ai_disclosure`, `provenance_attestation`, `training_rights`) are satellite-routed to `work_licensing` via `WORK_SATELLITE_FIELDS` and accepted by both the HTTP route allow-list and the service layer, but were missing from `WORK_WRITE_PROPERTIES`. Agents following the `pica_works_update with ai_disclosure: ...` completion hint at works.ts:577 were hitting schema-level silent-drop (or strict-validator 400s). Added all three properties to the write schema with shapes copy-pasted from the parallel fields on `pica_recordings_update` (recordings.ts:193). Tool description updated to distinguish audio-trait satellite fields (still not exposed) from the three compliance satellite fields (now exposed). Full audit of the other 22 customer-MCP write tools yielded zero further inverse phantoms — see `docs/audits/2026-04-21-mcp-inverse-phantom-audit.md`.
|
|
21
|
-
|
|
22
14
|
### Removed
|
|
23
15
|
|
|
24
|
-
- **
|
|
16
|
+
- **Billing-credit tools removed from the MCP surface:** `pica_credits_balance` (credits.ts), `pica_credits_history` (settings.ts), `pica_credits_purchase` (purchases.ts tombstoned to an empty class). See `docs/MCP_REFINEMENT_LOG.md` entry B-001. withPICA is subscription-only at £9.99/mo; surfacing a credit-balance + credit-history + credit-purchase tool trio contradicted the billing model and misled agents (caught 2026-04-22 when an agent transcript opened with "998,894 credits — plenty. Running the export now."). The underlying SDK methods (`creditsBalance.*`, `settings.creditsHistory`) and `lib/services/credits/**` infra remain intact — only the MCP tool surface shrinks. `pica_credits_list` and `pica_credits_update` are **kept**: they're work_credits (songwriter roles + splits on a work), not billing credits.
|
|
17
|
+
- **`CREDIT_INSUFFICIENT` recovery hints pointing at `pica_credits_balance`** removed from `recovery-hints.ts` for `pica_resolve_work`, `pica_export_song_registration`, `pica_export_catalog_asset_report`, `pica_audio_analyze`. Paired tests under `__tests__/tools/recovery-hints.test.ts` + `settings.test.ts` updated to assert the new shape.
|
|
25
18
|
|
|
26
19
|
### Changed
|
|
27
20
|
|
|
28
|
-
-
|
|
29
|
-
- **
|
|
21
|
+
- **Credit-gating language stripped from tool descriptions** — `pica_audio_identify` ("Costs 3 pica credits on match…"), `pica_export_song_registration` ("Costs 1 pica credit."), `pica_export_industry_ready` (same), `pica_export_catalog_asset_report` ("Costs 5 pica credits…"), and the 3 `pica_resolve_*` tools in `enrichment.ts` ("Costs 1 pica credit per call."). The `withCreditGate` / `withBillingGate` runtime wrappers are **left in place** — only the agent-facing prompt-gating copy goes. Same B-001 refinement entry.
|
|
22
|
+
- **Server instructions** (`src/server-instructions.ts`, mirrored in `lib/mcp/server-instructions.ts` via the parity test) open with a one-line disambiguation from `@picahq/mcp` (Pica AI / picaos.com) — a different product whose short name collides with ours. Helps agents that have both connectors installed (or users who pasted their withPICA key into the wrong config) recognise which server they're actually talking to. See the picaos name-collision memory rule.
|
|
23
|
+
- **`pica_catalog_diligence` now returns structured JSON** instead of failing with a JSON-parse error on binary ZIP bytes. The fix lives in `@withpica/mcp-sdk`'s `AnalyticsResource.catalogDiligence()` — the SDK now requests `?format=json`. See the mcp-sdk CHANGELOG for detail. MCP refinement log: "Singleton — `pica_catalog_diligence` returns ZIP parsed as JSON".
|
|
30
24
|
|
|
31
|
-
###
|
|
25
|
+
### Fixed
|
|
32
26
|
|
|
33
|
-
- **ADR-
|
|
27
|
+
- **ADR-174 Phase 2c — inverse phantom in `pica_works_update` (works slice).** Three jsonb compliance fields (`ai_disclosure`, `provenance_attestation`, `training_rights`) are satellite-routed to `work_licensing` via `WORK_SATELLITE_FIELDS` and accepted by both the HTTP route allow-list and the service layer, but were missing from `WORK_WRITE_PROPERTIES`. Agents following the `pica_works_update with ai_disclosure: ...` completion hint at works.ts:577 were hitting schema-level silent-drop (or strict-validator 400s). Added all three properties to the write schema with shapes copy-pasted from the parallel fields on `pica_recordings_update` (recordings.ts:193). Tool description updated to distinguish audio-trait satellite fields (still not exposed) from the three compliance satellite fields (now exposed). Full audit of the other 22 customer-MCP write tools yielded zero further inverse phantoms — see `docs/audits/2026-04-21-mcp-inverse-phantom-audit.md`.
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
### Added
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
- **ADR-189 Phase 4 slice 3: `pica_claim_artist` MCP tool.** INSTANT path for artist-claim on discovery-backed evidence. Wraps `artistClaimingService.processClaimDecision` to reuse the existing `work_claims.artist_claim_status` / `claimed_by_person_id` / `claim_confirmed_at` update path + `performer` work_credits insert. Refuses (409 `ADMIN_REVIEW_IN_PROGRESS`) when an open admin `artist_claims` row exists for the same (work, person) — returns `admin_review_id` in the body so the agent surface can route the user to resolve it. Rate-limited to 20/hour per user via the shared `claim_write` bucket. Wrapped in `withAgentActionStamp` when grant-authed — rollback captures pre-write `work_claims` row + tracks whether a new performer credit was inserted (deleted on compensation) or pre-existed (left alone). **Schema drift carryover:** the plan proposed capturing rollback state from 4 `works` columns, but live staging (`rtxcxazevrgcjnudvggf`) keeps the artist-claim lifecycle columns (`artist_claim_status`, `claimed_by_person_id`, `claim_confirmed_at`) on the `work_claims` satellite — only `primary_artist_id` lives on `works`. Service captures + restores from `work_claims` accordingly. The live `artist_claims.claim_status` CHECK constraint has no `under_review` state (only `pending | approved | rejected | withdrawn`), so the open-review gate checks `claim_status = 'pending'` only.
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
### Removed
|
|
34
|
+
|
|
35
|
+
- **ADR-154 F13: seven deprecated per-source enrich tools removed.** `pica_enrich_work_{mlc,musicbrainz,discogs,spotify,youtube}` and `pica_people_enrich_{isni,musicbrainz}` (tombstoned since ADR-179 Phase 1/2, 2026-04-17) are no longer registered — every call has returned a `-32070 TOOL_DEPRECATED` error for a full minor cycle, ending the one-minor deprecation window per ADR-179 Decision 2. Callers must use `pica_resolve_work(sources: [...])` or `pica_resolve_person(sources: [...])` instead; the `tools/list`, `metadata`, `recovery-hints`, and category-`discovery` surfaces shed the seven stale entries in this release. Downstream impact: clients that hardcoded the tool names now get `tools/list`-level absence rather than a deprecation envelope — fail-fast instead of fail-with-suggestion.
|
|
41
36
|
|
|
42
37
|
### Changed
|
|
43
38
|
|
|
39
|
+
- **ADR-154 F14: completion-hint sweep for the seven removed tools.** Updated every `→ then:` and hint-string reference that pointed at the F13 tombstones across `enrichment.ts`, `people.ts` (3 sites), `collaborators.ts`, `works.ts` (2 sites), `search.ts`, `server-instructions.ts`, `prompts/index.ts` (3 sites), and `resources/llms-primer.ts`. Agents discovering tools via descriptions will no longer be trained toward dead tool names. The ADR-179 "Replaces the five/two per-source tools" phrasing is gone from the resolver descriptions too — resolvers stand on their own now.
|
|
44
40
|
- **ADR-180 Phase 3: full TOOL_METADATA coverage.** 29 tools retrofitted in `mcp-server/src/tools/metadata.ts` across eight family-scoped commits — resolve (3), cascade (3), enrichment proposals (4), collaborators (4), notify-user scheduling (3), physical-assets links (4), misc singletons (5), and the ADR-185 Part 1 agent-identity drift (3). `scripts/mcp-tool-lint-baseline.json` is deleted; MCP Tool Lint now runs in fully-strict mode. No behaviour change — tool discovery, audit categorisation, and risk-tier gating now classify the same 29 tools they couldn't classify before. `credits_required` deliberately omitted from new entries (credit gating is a no-op pass-through since ADR-162). Retry-safety follows ADR-180's `risk × retry_safe` table — e.g. `pica_enrichment_proposal_apply` is `retry_safe: false` (writes to entity columns), `_reject` is `retry_safe: true` (content-hash suppression is set-once). ADR-180 flipped from `Proposed` to `Accepted`.
|
|
45
41
|
- **ADR-193 Surfaces 1+3: peer-connector coaching + URI source conventions (server-instructions addendum).** Handshake copy coaches agents to check peer MCPs (email / drive / notes / calendar / DAW) before asking users to paste or type data, and to cite findings via `pica_enrichment_propose` `sources[].url` using URI schemes — `gmail://` `gdrive://` `notion://` `file://` `telegram://` `calendar://` `daw://` `user://` `web://`. See `docs/mcp-source-uri-conventions.md` in the main repo for shapes. First concrete build for ADR-190 Principles 2 + 3 (Agent-Mediated Source Discovery). A latent HTTP-transport gap was fixed in the same develop commit (`63eef17f8`) — `/api/mcp/route.ts` was not wiring `SERVER_INSTRUCTIONS` into its Server constructor, so remote agentic clients (ChatGPT Apps, Claude Desktop remote, Cursor) saw zero coaching. The stdio transport in this package was always serving instructions correctly; only the remote transport was affected.
|
|
46
42
|
|
|
47
43
|
### Added
|
|
48
44
|
|
|
49
45
|
- **ADR-193 Surface 2: `gap_hints` envelope on 4 read tools.** `pica_works_inspect`, `pica_agreements_inspect`, `pica_people_inspect`, and `pica_enrichment_proposals_list` now emit an optional `gap_hints[]` field on `structuredContent` when a real gap is present. Each hint is capability-named (ADR-190 Principle 2 — `email_search` / `drive_search` / `filesystem_search` / `notes_search` / `calendar_search` / `web_search`, never vendor names), carries a concrete `query_shape`, and pre-fills the `then_call: "pica_enrichment_propose"` with the exact `then_args_shape` the agent should emit back (including URI-citation scaffolding from Surface 3). Gated by `MCP_GAP_HINTS_ENABLED=1` — off by default in prod. Empty array / omitted envelope when there's no real gap. Flat additive — the existing `CompletionHint` pipeline on `works_inspect` is untouched. Bundled: `enrich-metadata` prompt references the peer-connector pattern and points the agent at `gap_hints`.
|
|
46
|
+
- **ADR-193 Surface 4: `pica_enrichment_propose` accepts `proposal_action: "create"`.** Closes the reserved-but-unwired create path from ADR-178 Phase 1. The tool schema now accepts `entity_type: "recording" | "agreement" | "person"` paired with `parent_entity_type` + `parent_entity_id` for create proposals. Apply-path branches on `rule_id === "agent_research"` and routes to `recordingsService.create` (parent required; `work_id` linkage), `agreementsService.create` (optional work parent, linked via `agreementWorksService.addWork` after create), or `peopleAdminService.create` (standalone — people have no parent FK). Recording creates seed `field_sources` verbatim from `proposal.sources[].url`, preserving URI schemes (gmail://, gdrive://, notion://, file://, telegram://, user://, web://) per ADR-193 AC 5. Agreements + people don't carry `field_sources` on the main table today; provenance URIs are captured in `resolution_note` until a follow-up migration adds the column. Work + publisher creation remain explicitly out of scope (dedup-critical — deferred to future ADR). Migration `20260422_01_adr193_proposal_parent_fields` adds nullable `parent_entity_type` + `parent_entity_id` columns with a CHECK pair + partial index for the review-queue scan. Legacy `artist_title_to_youtube` create rule is untouched (it continues to overload `entity_id` as the parent work id). 4 new service-layer tests green; total proposal-service suite 42/42.
|
|
50
47
|
- **ADR-185 Part 1: three new session-auth-only tools.** `pica_create_agent_identity`, `pica_issue_agent_grant`, `pica_list_my_agent_grants`. Back a user-issued agent-identity + scoped-grant primitive — the substrate for Parts 2 (settings UI) and 3 (per-write provenance stamping). All three require `write:agent_identity` scope AND session-auth (raw API key / OAuth); the HTTP MCP dispatcher refuses `pica_grant_` callers with a structured `reason: "session_auth_required"` error before execution per AC 12. Subject is always the authenticated user — caller-supplied `user_id` is dropped per ADR-184 rule 2 / ADR-185 rule 1. Grant tokens use the format `pica_grant_<64 hex>` and are hashed at rest with HMAC-SHA256 + `API_KEY_HASH_PEPPER` (same scheme as api_keys per ADR-185 line 193 + ADR-167 D-5).
|
|
51
48
|
- **ADR-185 Part 2: two new session-auth-only tools.** `pica_revoke_agent_grant` (DELETE `/admin/agent-grants/:id`, idempotent, 404 masks ownership failures) and `pica_get_agent_activity` (GET `/admin/agent-activity`, paginated, optionally filtered by identity or grant). Both appended to `SESSION_AUTH_ONLY_TOOLS` in the HTTP MCP dispatcher and to the `write:agent_identity` scope bucket. Together with the Part 1 trio this completes the five-tool agent-identity surface the ADR Scope requires. Revocation takes effect on the next request (AC: within 60s — `resolveGrantToken` checks `revoked_at` on every call, no cache layer).
|
|
52
|
-
- **ADR-185 Part 3 passes 1-5
|
|
49
|
+
- **ADR-185 Part 3 passes 1-5: agent-action provenance stamping wraps 27 write-tool families.** Part 3 layers two complementary wrappers over existing write tools so every per-grant write records a row in `mcp_agent_actions` for audit + revoke-replay. `withAgentActionStamp` (compensation-after): handler runs, stamps; on stamp failure, compensation undoes the write via captured prior state — used for creates and updates (soft-delete families get meaningful delete compensation — flip `is_deleted` back). `withAgentActionStampFirst` (stamp-first, pass 4): stamp commits BEFORE the destructive op; stamp-ok + handler-fail logs a "ghost stamp" at error level — used for hard-delete families where compensation is impossible. Both wrappers are no-ops when the caller is not an agent grant (session-auth / raw API key writes are unaffected). Families covered across the five passes: works/recordings/people/agreements/releases/notes creates; notes_delete; sessions_create; share_links_create; projects_create; multimedia_create; recording_splits_create; works_update; recordings_update; people_update; agreements_update; projects_update; notes_update; releases_update; people_delete; publishers_create; the six hard-delete families (works/recordings/agreements/projects/sessions/releases) via the stamp-first variant; and pass 5's `pica_projects_attach_works` (project_works insert wrapped, GET + POST migrated from `requireAuth` + `getUserProfile` to `withOrgContext` for consistency). `pica_sessions_update` remains deferred — action-branching route (start/complete/cancel + participant add/remove + regular update) needs a dedicated design slice before wrapping.
|
|
53
50
|
- **New tool** `pica_submit_feedback`: agent-native feedback submission. Routes bug_report→devops, feature_request→ceo, question→comms, other→category-mapped. Requires `write:feedback` scope. Subject is always the authenticated user per ADR-184 rule 2. (ADR-184 slice 8 — landed on develop 2026-04-19 post-2.23.0 publish.)
|
|
54
51
|
- **ADR-189 Phase 3: two new identity-capture tools.** `pica_update_my_identity` (stage_name / IPI / ISNI / IPN / PRO) and `pica_update_organisation_profile` (org_type / display_name / tagline / ipi_number). Both admin-scoped, both `retry_safe: true` (idempotent upserts — re-applying the same IPI leaves the row in the same state). Subject derived from auth (no `user_id` / `organisation_id` parameters — ADR-184 rule 2). After the identity write, `pica_update_my_identity` re-runs cross-org discovery and returns the count of newly-visible credits / custody / artist-link rows so the agent can surface "found N more — claim them?" in the same conversation turn. Rate-limited at 20 writes/hour/user via `checkActionRateLimit` (R1 mitigation). Admin routes (`POST /api/admin/my-identity`, `POST /api/admin/organisation-profile`) wrap in `withAgentActionStamp` when the caller presents an agent grant (ADR-185 Part 3) — UPDATE compensation captures pre-write state via read-before-write and PATCHes the row back on stamp failure, or deletes a lazy-created person row.
|
|
52
|
+
- **ADR-189 Phase 4 Task 1: `pica_claim_credit`.** New activation-loop tool that drains a `discovered_credits` row into a `work_credits` row in the calling org, giving the user `view` access to the linked work. Check-and-set on `discovered_credits.status` prevents double-claims in concurrent sessions. Rate-limited to 20/hour per user via `checkActionRateLimit`. Returns `is_first_claim: true` on first-ever claim by the user (derived from `agent_action_log` stamp count). Wraps in `withAgentActionStamp` for grant callers — compensating transaction calls `revertClaimCredit` (flips discovery back to `pending` + deletes the `work_credits` row) if the stamp INSERT fails. Error taxonomy: `DISCOVERY_NOT_FOUND` (404), `DISCOVERY_ALREADY_RESOLVED` (409), `EVIDENCE_REVOKED` (410), `RATE_LIMITED` (429 + `Retry-After`). `pica_claim_credit` added to `ADMIN_ONLY_TOOLS` in `mcp-scopes.ts`; metadata entry `category: "discovery", risk: "mutating", retry_safe: false`. Route: `POST /api/admin/discoveries/[id]/claim-credit`. SDK method: `pica.discoveries.claimCredit(id)`.
|
|
53
|
+
- **ADR-189 Phase 4 Task 2: `pica_claim_custody` + +72h auto-approve worker.** Drains a `discovered_custody` row into a pending `custody_claims` row (status=`pending`, `chain`=custody_type, `custody_source`=`claimed`, provenance in `evidence.source`=`"auto-discovered-via-email"`). Schedules a silent-consent auto-approve by inserting a `scheduled_notifications` row (`source=pica_claim_custody`, `deliver_at`=+72h, message=`custody_auto_approve:<uuid>`). Does NOT mutate `works.{composition,master}_custodian_org_id` immediately — the 1-minute cron fires `scheduledNotificationsService.drainDue()` which now dispatches `source=pica_claim_custody` rows to a new `handleCustodyAutoApprove` branch that runs the **Delta 1 stale-promotion guard**: UPDATE `works` custodian columns ONLY IF the snapshot captured at claim time (`expected_previous_custodian_org_id` + `expected_custody_source` + `custody_side` — migration `20260421_01_custody_claims_expected_previous`) still matches; otherwise flip the claim to `superseded` (new status) and leave the catalog untouched. Error taxonomy identical to `pica_claim_credit`. `pica_claim_custody` was already in `ADMIN_ONLY_TOOLS` since Phase 4 Task 0; this ships the actual wiring. Route: `POST /api/admin/discoveries/[id]/claim-custody`. SDK method: `pica.discoveries.claimCustody(id)`. Stamp compensation via `revertClaimCustody` flips discovery back to pending, cancels the scheduled_notification, deletes the custody_claims row.
|
|
54
|
+
|
|
55
|
+
## [2.24.0] - 2026-04-21
|
|
56
|
+
|
|
57
|
+
### Fixed
|
|
58
|
+
|
|
59
|
+
- **`pica_integrations_status` no longer tells users to "connect Spotify".** Two real-user failures on Claude Desktop (2026-04-21) traced back to the tool lumping platform-level Spotify/YouTube (PICA has its own credentials; no per-user OAuth exists or has ever existed) into the same "Available to connect" list as genuine user-OAuth peer connectors (Google/Notion/Airtable/Telegram). Failure modes observed: (1) user pasted a Spotify track URL → agent replied "head to your Pica dashboard and add Spotify as an integration"; (2) user asked "what songs do I have in pica" with a catalog holding 1 work → agent replied "you currently have no connections set up in Pica — so there are no songs or any other data accessible." Reshape: the tool now returns `peerConnectors` (the 4 actual OAuth services) separately from `platformReads` (Spotify, YouTube, MusicBrainz, MLC, ISNI, Discogs, with the tool name for each). Summary leads with "PICA catalog is ALWAYS accessible via pica_works_query, pica_people_query, pica_dashboard_briefing, pica_search_all — no setup required." The dead `connectedProviders.includes("spotify")` check that could never evaluate true was removed.
|
|
60
|
+
- **Server instructions: catalog-is-always-accessible guidance.** Handshake now explicitly states (a) the catalog is always accessible via the read tools with zero setup, (b) `pica_integrations_status` showing "0 connected" refers to optional peer connectors, NOT the catalog — call `pica_works_query` to check, (c) Spotify/YouTube URLs go through `pica_import_streaming_link` / `pica_import_youtube_link` directly; no per-user Spotify/YouTube OAuth exists to set up, do not tell the user to "connect Spotify in your dashboard". Replaces earlier copy that left the agent free to hallucinate a dashboard-integration flow. `lib/mcp/server-instructions.ts` parity copy updated in lockstep; the HTTP transport at `/api/mcp` picks up the new text on next handshake without requiring a redeploy of this package. Under the 2000-char token budget at 1833 chars.
|
|
55
61
|
|
|
56
62
|
## [2.23.0] - 2026-04-19
|
|
57
63
|
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -11,7 +11,7 @@ import { readCredentials, getDefaultCredentialsPath, } from "@withpica/mcp-utils
|
|
|
11
11
|
// from mcp-server/dist/config.js. Past drift incidents: 2026-04-08
|
|
12
12
|
// (banner 2.5.0 vs npm 2.6.1), 2026-04-19 ADR-181 Phase 2 (banner 2.6.2
|
|
13
13
|
// vs npm 2.22.0). ADR-180 Phase 2 collapses the duplication.
|
|
14
|
-
export const VERSION = "2.
|
|
14
|
+
export const VERSION = "2.26.0";
|
|
15
15
|
export function loadConfig() {
|
|
16
16
|
const credentialsPath = process.env.PICA_CREDENTIALS_PATH || getDefaultCredentialsPath();
|
|
17
17
|
const debug = process.env.DEBUG === "true" || process.env.DEBUG === "1";
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Block playbook: "document the high level of your server"
|
|
6
6
|
* Lowin: "instructions are context — design them as context"
|
|
7
7
|
*/
|
|
8
|
-
export declare const SERVER_INSTRUCTIONS = "
|
|
8
|
+
export declare const SERVER_INSTRUCTIONS = "withPICA manages music catalog metadata \u2014 works, recordings, people, credits, agreements, rights. Tools are pica_<domain>_<verb>, 200+ of them, from npm as @withpica/mcp-server. If you see pica_execute, Execute Pica Action, or Search Platform Actions \u2014 that's @picahq/mcp (picaos.com), a different product with the same short name; don't route withPICA work there.\n\nStart here:\n- pica_dashboard_briefing \u2014 daily summary of what needs attention\n- pica_search_all \u2014 find any entity by name, ISWC, ISRC, or IPI\n- pica_works_query / pica_people_query \u2014 browse the catalog\n\nThe catalog is ALWAYS accessible via the tools above \u2014 zero setup, no integration required. If pica_integrations_status shows \"0 connected\" that refers to optional peer connectors (Google/Notion/Airtable/Telegram), NOT the catalog; call pica_works_query to check what's there.\n\nSpotify/YouTube URLs: call pica_import_streaming_link (Spotify/Deezer) or pica_import_youtube_link directly. PICA reads these at platform level \u2014 there is no per-user Spotify/YouTube OAuth; do not tell the user to \"connect Spotify\".\n\nKey patterns:\n- Read tools are safe to call freely (readOnlyHint=true)\n- _inspect tools take sections (e.g., pica_works_inspect sections: [\"health\", \"completeness\"])\n- Write tools confirm what changed; destructive tools (delete/merge) need two-step confirmation with a token\n- Errors include \"suggestion\" and \"next_tool\" for recovery\n- Enrichment: use pica_resolve_work / pica_resolve_person / pica_resolve_recording \u2014 fan out over Spotify, MusicBrainz, MLC, ISNI, Discogs, YouTube\n\nQuery endpoints accept \"limit\" (default 50) and paginate. IDs are UUIDs \u2014 use a _query tool first when unsure.\n\nPeer connectors (email, drive, notes, calendar, DAW MCPs): when PICA shows missing data, check peer MCPs before asking the user. Cite via pica_enrichment_propose sources[].url with URI schemes \u2014 gmail:// gdrive:// notion:// file:// telegram:// calendar:// daw:// user:// web://. See docs/mcp-source-uri-conventions.md.";
|
|
9
9
|
//# sourceMappingURL=server-instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,miEAoB+R,CAAC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Block playbook: "document the high level of your server"
|
|
7
7
|
* Lowin: "instructions are context — design them as context"
|
|
8
8
|
*/
|
|
9
|
-
export const SERVER_INSTRUCTIONS = `
|
|
9
|
+
export const SERVER_INSTRUCTIONS = `withPICA manages music catalog metadata — works, recordings, people, credits, agreements, rights. Tools are pica_<domain>_<verb>, 200+ of them, from npm as @withpica/mcp-server. If you see pica_execute, Execute Pica Action, or Search Platform Actions — that's @picahq/mcp (picaos.com), a different product with the same short name; don't route withPICA work there.
|
|
10
10
|
|
|
11
11
|
Start here:
|
|
12
12
|
- pica_dashboard_briefing — daily summary of what needs attention
|
|
@@ -22,11 +22,9 @@ Key patterns:
|
|
|
22
22
|
- _inspect tools take sections (e.g., pica_works_inspect sections: ["health", "completeness"])
|
|
23
23
|
- Write tools confirm what changed; destructive tools (delete/merge) need two-step confirmation with a token
|
|
24
24
|
- Errors include "suggestion" and "next_tool" for recovery
|
|
25
|
-
- Enrichment: use
|
|
25
|
+
- Enrichment: use pica_resolve_work / pica_resolve_person / pica_resolve_recording — fan out over Spotify, MusicBrainz, MLC, ISNI, Discogs, YouTube
|
|
26
26
|
|
|
27
27
|
Query endpoints accept "limit" (default 50) and paginate. IDs are UUIDs — use a _query tool first when unsure.
|
|
28
28
|
|
|
29
|
-
Write tools: announce intent, confirm result. Destructive tools: describe impact, require explicit user confirmation.
|
|
30
|
-
|
|
31
29
|
Peer connectors (email, drive, notes, calendar, DAW MCPs): when PICA shows missing data, check peer MCPs before asking the user. Cite via pica_enrichment_propose sources[].url with URI schemes — gmail:// gdrive:// notion:// file:// telegram:// calendar:// daw:// user:// web://. See docs/mcp-source-uri-conventions.md.`;
|
|
32
30
|
//# sourceMappingURL=server-instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;+TAoB4R,CAAC"}
|
|
@@ -86,11 +86,11 @@ export class AudioFilesTools {
|
|
|
86
86
|
},
|
|
87
87
|
enable_audio: {
|
|
88
88
|
type: "boolean",
|
|
89
|
-
description: "Enable audio feature extraction (BPM, key, energy). Default: true.
|
|
89
|
+
description: "Enable audio feature extraction (BPM, key, energy). Default: true.",
|
|
90
90
|
},
|
|
91
91
|
enable_lyrics: {
|
|
92
92
|
type: "boolean",
|
|
93
|
-
description: "Enable lyrics transcription via Whisper. Default: true.
|
|
93
|
+
description: "Enable lyrics transcription via Whisper. Default: true.",
|
|
94
94
|
},
|
|
95
95
|
},
|
|
96
96
|
required: ["id"],
|
|
@@ -234,7 +234,7 @@ export class AudioFilesTools {
|
|
|
234
234
|
{
|
|
235
235
|
definition: {
|
|
236
236
|
name: "pica_audio_identify",
|
|
237
|
-
description: "Identify a track using ACRCloud audio fingerprinting. Returns matched metadata (title, artist, album, ISRC, label) with confidence score. If matched, metadata is automatically propagated to the linked work.
|
|
237
|
+
description: "Identify a track using ACRCloud audio fingerprinting. Returns matched metadata (title, artist, album, ISRC, label) with confidence score. If matched, metadata is automatically propagated to the linked work.",
|
|
238
238
|
inputSchema: {
|
|
239
239
|
type: "object",
|
|
240
240
|
properties: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-files.js","sourceRoot":"","sources":["../../src/tools/audio-files.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAU7D,OAAO,EACL,YAAY,EACZ,UAAU,EACV,aAAa,GAEd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,OAAO,eAAe;IAClB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,kBAAkB;oBACxB,WAAW,EACT,oEAAoE;wBACpE,0DAA0D;oBAC5D,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,8DAA8D;6BACjE;4BACD,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,qBAAqB;gCAClC,IAAI,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC;6BAC5D;4BACD,WAAW,EAAE;gCACX,IAAI,EAAE,SAAS;gCACf,WAAW,EACT,8EAA8E;6BACjF;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,yCAAyC;6BACvD;yBACF;qBACF;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC;aAC1C;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,oBAAoB;oBAC1B,WAAW,EACT,uEAAuE;wBACvE,oFAAoF;oBACtF,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,EAAE,EAAE;gCACF,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,eAAe;6BAC7B;4BACD,QAAQ,EAAE;gCACR,IAAI,EAAE,OAAO;gCACb,KAAK,EAAE;oCACL,IAAI,EAAE,QAAQ;oCACd,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC;iCACtC;gCACD,WAAW,EACT,wDAAwD;6BAC3D;yBACF;wBACD,QAAQ,EAAE,CAAC,IAAI,CAAC;qBACjB;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;aAC3C;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,oBAAoB;oBAC1B,WAAW,EACT,0FAA0F;wBAC1F,yFAAyF;wBACzF,gGAAgG;wBAChG,4HAA4H;wBAC5H,yGAAyG;wBACzG,2FAA2F;oBAC7F,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,EAAE,EAAE;gCACF,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,0BAA0B;6BACxC;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,SAAS;gCACf,WAAW,EACT,yDAAyD;6BAC5D;4BACD,YAAY,EAAE;gCACZ,IAAI,EAAE,SAAS;gCACf,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"audio-files.js","sourceRoot":"","sources":["../../src/tools/audio-files.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAU7D,OAAO,EACL,Y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,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AActE,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAqJ3D,WAAW;YA2BX,aAAa;CAoM5B"}
|
package/dist/tools/credits.js
CHANGED
|
@@ -7,19 +7,16 @@ export class CreditsTools {
|
|
|
7
7
|
this.pica = pica;
|
|
8
8
|
}
|
|
9
9
|
getTools() {
|
|
10
|
+
// NOTE: `pica_credits_balance` / `pica_credits_history` / `pica_credits_purchase`
|
|
11
|
+
// were removed from the MCP surface 2026-04-22 (see docs/MCP_REFINEMENT_LOG.md
|
|
12
|
+
// entry B-001). withPICA is subscription-only at £9.99/mo; surfacing a credit
|
|
13
|
+
// balance tool misled agents into gating actions behind a balance check.
|
|
14
|
+
// The underlying lib/services/credits/** infra remains intact for any internal
|
|
15
|
+
// telemetry or future pay-per-call work (MPP), it just isn't advertised.
|
|
16
|
+
//
|
|
17
|
+
// `pica_credits_list` and `pica_credits_update` below are work_credits
|
|
18
|
+
// (songwriter / producer credits on a work), not billing credits. Keep.
|
|
10
19
|
return [
|
|
11
|
-
{
|
|
12
|
-
definition: {
|
|
13
|
-
name: "pica_credits_balance",
|
|
14
|
-
description: "Check your current credit balance and see what each operation costs. " +
|
|
15
|
-
"Use this before triggering audio analysis or identification to check affordability. If balance is low, use pica_credits_purchase to generate a checkout link.",
|
|
16
|
-
inputSchema: {
|
|
17
|
-
type: "object",
|
|
18
|
-
properties: {},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
executor: this.getBalance.bind(this),
|
|
22
|
-
},
|
|
23
20
|
{
|
|
24
21
|
definition: {
|
|
25
22
|
name: "pica_credits_list",
|
|
@@ -145,15 +142,6 @@ export class CreditsTools {
|
|
|
145
142
|
},
|
|
146
143
|
];
|
|
147
144
|
}
|
|
148
|
-
async getBalance(_args) {
|
|
149
|
-
const result = await this.pica.creditsBalance.getBalance();
|
|
150
|
-
const balance = result.balance ?? 0;
|
|
151
|
-
const costs = result.credit_costs ?? [];
|
|
152
|
-
const costSummary = costs
|
|
153
|
-
.map((c) => `${c.action_key}: ${c.credits_required} credit(s)`)
|
|
154
|
-
.join(", ");
|
|
155
|
-
return formatSuccess(`Credit balance: ${balance}. Operations: ${costSummary}`, result);
|
|
156
|
-
}
|
|
157
145
|
async listCredits(args) {
|
|
158
146
|
// Fetch both publishing collaborators and recording credits
|
|
159
147
|
const [collabSettled, creditsSettled] = await Promise.allSettled([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAEL,aAAa,EACb,oBAAoB,EAEpB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,sBAAsB,GAEvB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,YAAY;IACf,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,
|
|
1
|
+
{"version":3,"file":"credits.js","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAEL,aAAa,EACb,oBAAoB,EAEpB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,aAAa,EACb,sBAAsB,G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CAAC,CAAC;YACX,SAAS,EAAE,CAAC,CAAC,SAAU;YACvB,OAAO,EAAE,2BAA2B,CAAC,CAAC,IAAI,IAAI,QAAQ,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,8BAA8B;YACtG,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,iBAAiB,EAAE,cAAc;SAClC,CAAC,CAAC,CAAC;QAEN,IAAI,aAAa,GAAG,EAAE,CAAC;QACvB,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,OAAO,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YACxD,aAAa,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAClD,CAAC;QAED,MAAM,GAAG,GAAG,aAAa;YACvB,CAAC,CAAC,oBAAoB,aAAa,EAAE;YACrC,CAAC,CAAC,8BAA8B,CAAC;QACnC,OAAO,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -10,6 +10,9 @@ export declare class DashboardTools {
|
|
|
10
10
|
definition: ToolDefinition;
|
|
11
11
|
executor: ToolExecutor;
|
|
12
12
|
}>;
|
|
13
|
+
private claimCredit;
|
|
14
|
+
private claimCustody;
|
|
15
|
+
private claimArtist;
|
|
13
16
|
private queryDiscoveries;
|
|
14
17
|
private reviewDiscovery;
|
|
15
18
|
private attentionItems;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAatE,qBAAa,cAAc;IACzB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YA8L3D,WAAW;YAYX,YAAY;YAYZ,WAAW;YAYX,gBAAgB;YA8BhB,eAAe;YAaf,cAAc;YAYd,QAAQ;YAMR,KAAK;CAIpB"}
|
package/dist/tools/dashboard.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatAsText, formatSuccess, formatStructuredList, } from "@withpica/mcp-utils";
|
|
2
|
+
import { formatAsText, formatSuccess, formatStructuredList, CLAIM_CREDIT_WRITE_PROPERTIES, CLAIM_CREDIT_REQUIRED, CLAIM_CUSTODY_WRITE_PROPERTIES, CLAIM_CUSTODY_REQUIRED, CLAIM_ARTIST_WRITE_PROPERTIES, CLAIM_ARTIST_REQUIRED, } from "@withpica/mcp-utils";
|
|
3
3
|
export class DashboardTools {
|
|
4
4
|
pica;
|
|
5
5
|
constructor(pica) {
|
|
@@ -11,9 +11,11 @@ export class DashboardTools {
|
|
|
11
11
|
{
|
|
12
12
|
definition: {
|
|
13
13
|
name: "pica_discoveries_query",
|
|
14
|
-
description: "
|
|
15
|
-
"
|
|
16
|
-
"
|
|
14
|
+
description: "List pending discoveries in your org across credits, custody, " +
|
|
15
|
+
"and artist links. Each row includes a `type` field " +
|
|
16
|
+
"('credit' | 'custody' | 'artist') plus the discovery-specific " +
|
|
17
|
+
"fields. Use the row id with the matching pica_claim_* tool to " +
|
|
18
|
+
"resolve. Sorted by created_at DESC.",
|
|
17
19
|
inputSchema: {
|
|
18
20
|
type: "object",
|
|
19
21
|
properties: {
|
|
@@ -54,6 +56,84 @@ export class DashboardTools {
|
|
|
54
56
|
},
|
|
55
57
|
executor: this.reviewDiscovery.bind(this),
|
|
56
58
|
},
|
|
59
|
+
// --- ADR-189 Phase 4: Activation-loop claim tools ---
|
|
60
|
+
{
|
|
61
|
+
definition: {
|
|
62
|
+
name: "pica_claim_credit",
|
|
63
|
+
description: "Claim a discovered songwriting / publishing credit into your organisation. " +
|
|
64
|
+
"Drains the pending discovered_credits row and inserts a work_credits row " +
|
|
65
|
+
"in your org, giving you 'view' access to the linked work. " +
|
|
66
|
+
"Rate-limited to 20 claims per hour. Idempotency: re-claiming an already-resolved " +
|
|
67
|
+
"discovery returns DISCOVERY_ALREADY_RESOLVED (409) — re-run discovery first.",
|
|
68
|
+
annotations: {
|
|
69
|
+
title: "claim discovered credit",
|
|
70
|
+
readOnlyHint: false,
|
|
71
|
+
destructiveHint: false,
|
|
72
|
+
idempotentHint: false,
|
|
73
|
+
openWorldHint: false,
|
|
74
|
+
},
|
|
75
|
+
inputSchema: {
|
|
76
|
+
type: "object",
|
|
77
|
+
properties: CLAIM_CREDIT_WRITE_PROPERTIES,
|
|
78
|
+
required: [...CLAIM_CREDIT_REQUIRED],
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
executor: this.claimCredit.bind(this),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
definition: {
|
|
85
|
+
name: "pica_claim_custody",
|
|
86
|
+
description: "Claim a discovered custody/ownership candidate (composition or master side) for a work. " +
|
|
87
|
+
"Drains the pending discovered_custody row into a pending custody_claims row and schedules " +
|
|
88
|
+
"a +72h silent-consent auto-approve via scheduled_notifications. The current custodian keeps " +
|
|
89
|
+
"the catalog row until the T+72h window elapses. " +
|
|
90
|
+
"Rate-limited to 20 claims per hour. " +
|
|
91
|
+
"Idempotency: re-claiming an already-resolved discovery returns DISCOVERY_ALREADY_RESOLVED (409) -- " +
|
|
92
|
+
"re-run discovery first.",
|
|
93
|
+
annotations: {
|
|
94
|
+
title: "claim discovered custody",
|
|
95
|
+
readOnlyHint: false,
|
|
96
|
+
destructiveHint: false,
|
|
97
|
+
idempotentHint: false,
|
|
98
|
+
openWorldHint: false,
|
|
99
|
+
},
|
|
100
|
+
inputSchema: {
|
|
101
|
+
type: "object",
|
|
102
|
+
properties: CLAIM_CUSTODY_WRITE_PROPERTIES,
|
|
103
|
+
required: [...CLAIM_CUSTODY_REQUIRED],
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
executor: this.claimCustody.bind(this),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
definition: {
|
|
110
|
+
name: "pica_claim_artist",
|
|
111
|
+
description: "Claim a discovered artist link on a pending discovered_artists row. " +
|
|
112
|
+
"INSTANT path: identity evidence was validated at discovery time, so this " +
|
|
113
|
+
"tool writes to work_claims (artist_claim_status / claimed_by_person_id / " +
|
|
114
|
+
"claim_confirmed_at) and inserts a performer work_credits row in one go — " +
|
|
115
|
+
"no +72h waiting window. Requires your identity to already be linked via " +
|
|
116
|
+
"pica_update_my_identity. " +
|
|
117
|
+
"Rate-limited to 20 claims per hour. " +
|
|
118
|
+
"Refuses (409 ADMIN_REVIEW_IN_PROGRESS) when an open artist_claims review " +
|
|
119
|
+
"row exists for the same (work, person) — resolve the review first. " +
|
|
120
|
+
"Idempotency: re-claiming an already-resolved discovery returns " +
|
|
121
|
+
"DISCOVERY_ALREADY_RESOLVED (409) -- re-run discovery first.",
|
|
122
|
+
annotations: {
|
|
123
|
+
title: "claim discovered artist",
|
|
124
|
+
readOnlyHint: false,
|
|
125
|
+
destructiveHint: false,
|
|
126
|
+
idempotentHint: false,
|
|
127
|
+
openWorldHint: false,
|
|
128
|
+
},
|
|
129
|
+
inputSchema: {
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: CLAIM_ARTIST_WRITE_PROPERTIES,
|
|
132
|
+
required: [...CLAIM_ARTIST_REQUIRED],
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
executor: this.claimArtist.bind(this),
|
|
136
|
+
},
|
|
57
137
|
// --- Dashboard ---
|
|
58
138
|
{
|
|
59
139
|
definition: {
|
|
@@ -104,6 +184,30 @@ export class DashboardTools {
|
|
|
104
184
|
},
|
|
105
185
|
];
|
|
106
186
|
}
|
|
187
|
+
async claimCredit(args) {
|
|
188
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
189
|
+
const pica = this.pica;
|
|
190
|
+
const result = await pica.discoveries.claimCredit(args.id);
|
|
191
|
+
return formatSuccess(result.is_first_claim
|
|
192
|
+
? "first credit claimed — welcome to your catalog"
|
|
193
|
+
: "credit claimed", result);
|
|
194
|
+
}
|
|
195
|
+
async claimCustody(args) {
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
197
|
+
const pica = this.pica;
|
|
198
|
+
const result = await pica.discoveries.claimCustody(args.id);
|
|
199
|
+
return formatSuccess(result.is_first_claim
|
|
200
|
+
? "first custody claim submitted — auto-approves in 72h unless disputed"
|
|
201
|
+
: "custody claim submitted — auto-approves in 72h unless disputed", result);
|
|
202
|
+
}
|
|
203
|
+
async claimArtist(args) {
|
|
204
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
205
|
+
const pica = this.pica;
|
|
206
|
+
const result = await pica.discoveries.claimArtist(args.id);
|
|
207
|
+
return formatSuccess(result.is_first_claim
|
|
208
|
+
? "first artist claim confirmed — welcome to your catalog"
|
|
209
|
+
: "artist claim confirmed", result);
|
|
210
|
+
}
|
|
107
211
|
async queryDiscoveries(args) {
|
|
108
212
|
const status = args.status || "all";
|
|
109
213
|
// "pending" delegates to the dedicated pending endpoint
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/tools/dashboard.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,
|
|
1
|
+
{"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;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/tools/discovery.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA6S3E,qBAAa,cAAc;IAEvB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,UAAU;gBAJV,aAAa,EAAE,CACrB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACtB,OAAO,CAAC,GAAG,CAAC,EACT,UAAU,EAAE,CAClB,IAAI,EAAE,MAAM,KAEV;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAC;QAAC,QAAQ,CAAC,EAAE,GAAG,CAAA;KAAE,GACtE,SAAS;IAGf,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;IAQzE,OAAO,CAAC,iBAAiB;IAqDzB,OAAO,CAAC,oBAAoB;IAuH5B,OAAO,CAAC,eAAe;IAoCvB,OAAO,CAAC,gBAAgB;CAiHzB"}
|
package/dist/tools/discovery.js
CHANGED
|
@@ -163,6 +163,9 @@ const CATEGORIES = {
|
|
|
163
163
|
"pica_graph_traverse",
|
|
164
164
|
"pica_discoveries_query",
|
|
165
165
|
"pica_discoveries_review",
|
|
166
|
+
"pica_claim_credit",
|
|
167
|
+
"pica_claim_custody",
|
|
168
|
+
"pica_claim_artist",
|
|
166
169
|
],
|
|
167
170
|
depends_on: [],
|
|
168
171
|
},
|
|
@@ -238,14 +241,8 @@ const CATEGORIES = {
|
|
|
238
241
|
depends_on: [],
|
|
239
242
|
},
|
|
240
243
|
account: {
|
|
241
|
-
description: "manage
|
|
242
|
-
tools: [
|
|
243
|
-
"pica_credits_balance",
|
|
244
|
-
"pica_credits_history",
|
|
245
|
-
"pica_credits_purchase",
|
|
246
|
-
"pica_storage_status",
|
|
247
|
-
"pica_integrations_status",
|
|
248
|
-
],
|
|
244
|
+
description: "manage storage and integrations",
|
|
245
|
+
tools: ["pica_storage_status", "pica_integrations_status"],
|
|
249
246
|
depends_on: [],
|
|
250
247
|
},
|
|
251
248
|
profile: {
|