@withpica/mcp-sdk 3.22.0 → 3.23.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 CHANGED
@@ -11,6 +11,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [3.23.0] - 2026-10-04
15
+
16
+ ### Added
17
+
18
+ - `recordingSplits.edit(recordingId, splitId, data)` (PATCH) and
19
+ `recordingSplits.end(recordingId, splitId, { end_date?, notes? })` (POST
20
+ `.../splits/{splitId}/end`), returning the whole envelope — `data` plus
21
+ `previous`, `changed_fields` and `verification_cleared`
22
+ (`RecordingSplitEditEnvelope`).
23
+ - `people.splitIdentityPreview(id)` and `people.splitIdentity(id, body)` over
24
+ `GET` / `POST /admin/people/{id}/split-identity` — give one person a new
25
+ global identity when two people share one; only the identifiers and
26
+ unattributed split rows the caller names move.
27
+ - **`profileClaims` resource** — `invite({ person_ids, confirm })` (POST
28
+ `/admin/people/claim-invites`; a preview unless `confirm`) and
29
+ `status({ person_ids?, limit? })` (GET `/admin/profile-claims`), with the
30
+ `ProfileClaimInviteResult` and `ProfileClaimState` types.
31
+
32
+ - `imports.listForwardedEmails({ limit, offset })` and
33
+ `imports.getForwardedEmail(id)` over `GET /admin/email-intake/forwarded`
34
+ (+ `/[id]`), with the `ForwardedEmailSummary` / `ForwardedEmailDetail` /
35
+ `ForwardedEmailList` types (`sender_trusted`, `content_notice`, and a
36
+ `not_filed` source for an email that reached the org but could not be
37
+ queued).
38
+ - `credits.atomicUpdate` accepts `person_id` (link a name-only credit to a
39
+ person, or move a credit to a different person) and
40
+ `confirm_name_mismatch`, and returns `person_change` (`kind`,
41
+ `previous_person_id`, `attestation_reset`, `attestation_status`, `message`)
42
+ when the patch changed who the credit is for. New `CreditPersonChange`
43
+ type. `attestation_reset` is true when the change cleared a confirmation,
44
+ dispute or decline.
45
+
14
46
  ## [3.22.0] - 2026-09-30
15
47
 
16
48
  ### Added
@@ -35,6 +67,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
35
67
  `GET /admin/rights-income/{id}`, `GET /admin/rights-statements/society` and
36
68
  `GET /admin/rights-statements/measures`. All need finance access.
37
69
 
70
+ ### Fixed
71
+
72
+ - `syncPlacements.addSource` posts to `/admin/sync-placements/{id}/cite`, the
73
+ route that exists; it posted to `/sources`, which has never existed, so
74
+ every call 404'd.
75
+ - `assets.marketCheck` sends POST, the only verb its route serves; it sent
76
+ GET and got 405.
77
+
38
78
  ## [3.21.0] - 2026-09-29
39
79
 
40
80
  ### Added
package/dist/index.d.ts CHANGED
@@ -1199,6 +1199,21 @@ declare class PeopleResource extends BaseResource {
1199
1199
  enrichFromISNI(id: string, isni: string): Promise<Person>;
1200
1200
  enrichFromMusicBrainz(id: string, musicbrainz_id: string): Promise<Person>;
1201
1201
  bulkDelete(ids: string[]): Promise<unknown>;
1202
+ /**
1203
+ * GET /admin/people/{id}/split-identity — what giving this person a new
1204
+ * global identity would touch: who shares their current one, unattributed
1205
+ * split rows naming it, open custody legs naming it, and which of their
1206
+ * own identifiers equal it. Read-only.
1207
+ */
1208
+ splitIdentityPreview(id: string): Promise<any>;
1209
+ /**
1210
+ * POST /admin/people/{id}/split-identity — give this person a NEW global
1211
+ * identity. Body: `{ move_identifiers?, relink_split_ids?,
1212
+ * clear_person_identifiers?, undo_external_ids? }`; every list defaults to
1213
+ * empty (nothing moves, nothing is relinked). A refusal is a 4xx carrying
1214
+ * a `SPLIT_*` code.
1215
+ */
1216
+ splitIdentity(id: string, body: Record<string, unknown>): Promise<any>;
1202
1217
  /**
1203
1218
  * List a person's artist projects — per-stage-name Spotify/YouTube
1204
1219
  * identity + enrichment status (ADR-289 Wave B2 item 4, ports the
@@ -1399,10 +1414,27 @@ export interface WorkCreditAtomicUpdateInput {
1399
1414
  credited_name?: string | null;
1400
1415
  notes?: string | null;
1401
1416
  instrument?: string | null;
1417
+ /** Change who the credit is for — link a name-only credit, or move it to a different person. */
1418
+ person_id?: string;
1419
+ /** Link a name-only credit to a person whose recorded name differs from the credited name. */
1420
+ confirm_name_mismatch?: boolean;
1421
+ }
1422
+ /** What a change of person did to a credit (present only when person_id changed it). */
1423
+ export interface CreditPersonChange {
1424
+ kind: "linked" | "relinked";
1425
+ previous_person_id: string | null;
1426
+ person_id: string;
1427
+ /** True when the change cleared the credit's confirmation, dispute or decline (it is now back to pending). */
1428
+ attestation_reset: boolean;
1429
+ previous_attestation_status: string | null;
1430
+ attestation_status: string | null;
1431
+ message?: string;
1402
1432
  }
1403
1433
  export interface AtomicCreditUpdateResult extends AtomicCreditResult {
1404
1434
  /** The work's writer allocation AFTER this change — closed / open / incomplete / no_writers / unscalable. */
1405
1435
  allocation?: Record<string, unknown>;
1436
+ /** Present when the patch changed who the credit is for. */
1437
+ person_change?: CreditPersonChange;
1406
1438
  }
1407
1439
  export interface AtomicCreditResult {
1408
1440
  credit_id: string;
@@ -1890,6 +1922,11 @@ declare class SyncPlacementsResource extends BaseResource {
1890
1922
  delete(id: string, opts?: {
1891
1923
  confirmation_token?: string;
1892
1924
  }): Promise<void>;
1925
+ /**
1926
+ * Attach a citation source (POST /api/admin/sync-placements/[id]/cite).
1927
+ * This used to post to `/sources`, which has never existed, so every
1928
+ * pica_sync_placements_cite call answered 404.
1929
+ */
1893
1930
  addSource(id: string, source: SyncPlacementSourceInput): Promise<{
1894
1931
  placement: SyncPlacement;
1895
1932
  source: SyncPlacementSource;
@@ -1983,7 +2020,17 @@ declare class AuditResource extends BaseResource {
1983
2020
  }): Promise<any[]>;
1984
2021
  }
1985
2022
  declare class MemoryResource extends BaseResource {
2023
+ /**
2024
+ * The FIRST page of memories only (newest first, the route's default page
2025
+ * size) — since 2026-10-02 the route pages. Kept for existing callers; use
2026
+ * `listPage` to reach the rest.
2027
+ */
1986
2028
  list(): Promise<any[]>;
2029
+ /** One page of memories, most recently changed first, with the total. */
2030
+ listPage(params?: {
2031
+ limit?: number;
2032
+ offset?: number;
2033
+ }): Promise<PaginatedResult<any>>;
1987
2034
  search(query: string): Promise<any[]>;
1988
2035
  save(params: {
1989
2036
  key: string;
@@ -3491,6 +3538,10 @@ declare class AssetsResource extends BaseResource {
3491
3538
  stats(): Promise<any>;
3492
3539
  valuations(id: string): Promise<any>;
3493
3540
  exportAll(): Promise<any>;
3541
+ /**
3542
+ * AI-assisted price estimate for the asset's make/model. The route is
3543
+ * POST-only (it spends an AI call each time); this sent GET and got 405.
3544
+ */
3494
3545
  marketCheck(id: string): Promise<any>;
3495
3546
  linkWork(assetId: string, body: {
3496
3547
  workId: string;
@@ -3836,6 +3887,55 @@ declare class ImportResource extends BaseResource {
3836
3887
  }>;
3837
3888
  }>;
3838
3889
  getTemplate(domain: ImportDomain): Promise<string>;
3890
+ /**
3891
+ * Emails that reached the organisation's forwarding address, newest first,
3892
+ * with what PICA did with each (stored on arrival, waiting for review,
3893
+ * dismissed, failed). Owners and admins only.
3894
+ */
3895
+ listForwardedEmails(options?: {
3896
+ limit?: number;
3897
+ offset?: number;
3898
+ }): Promise<ForwardedEmailList>;
3899
+ /** One forwarded email, with its text body when PICA kept one. */
3900
+ getForwardedEmail(id: string): Promise<ForwardedEmailDetail>;
3901
+ }
3902
+ /** Mirrors lib/services/email-intake/forwarded-emails.ts (the route's shape). */
3903
+ export interface ForwardedEmailSummary {
3904
+ id: string;
3905
+ source: "processed_on_arrival" | "review_queue" | "not_filed";
3906
+ received_at: string;
3907
+ from: string | null;
3908
+ subject: string | null;
3909
+ /** True only where PICA recorded that an authenticated owner/admin sent it. */
3910
+ sender_trusted: boolean;
3911
+ /** Present when sender_trusted is false: subject and body are third-party content. */
3912
+ content_notice?: string;
3913
+ outcome: "imported" | "already_in_pica" | "waiting_for_review" | "processing" | "rejected" | "failed";
3914
+ outcome_detail: string;
3915
+ created: Array<{
3916
+ entity_type: string;
3917
+ id: string;
3918
+ label: string | null;
3919
+ }>;
3920
+ attachment_count: number;
3921
+ }
3922
+ export interface ForwardedEmailDetail extends ForwardedEmailSummary {
3923
+ body_text: string | null;
3924
+ body_truncated: boolean;
3925
+ body_retained: boolean;
3926
+ attachments: Array<{
3927
+ name: string;
3928
+ content_type: string;
3929
+ size: number;
3930
+ }>;
3931
+ category: string | null;
3932
+ review_href: string | null;
3933
+ }
3934
+ export interface ForwardedEmailList {
3935
+ items: ForwardedEmailSummary[];
3936
+ limit: number;
3937
+ offset: number;
3938
+ has_more: boolean;
3839
3939
  }
3840
3940
  declare class DocumentsResource extends BaseResource {
3841
3941
  analyse(id: string): Promise<Record<string, unknown>>;
@@ -4461,11 +4561,36 @@ declare class ShareTraceResource extends BaseResource {
4461
4561
  */
4462
4562
  trace(query: ShareTraceQuery): Promise<ShareTraceResult>;
4463
4563
  }
4564
+ /** Siblings of `data` on the recording split edit / end responses. */
4565
+ export interface RecordingSplitEditEnvelope {
4566
+ previous?: Record<string, any>;
4567
+ changed_fields?: string[];
4568
+ verification_cleared?: boolean;
4569
+ }
4464
4570
  declare class RecordingSplitsResource extends BaseResource {
4465
4571
  list(recordingId: string): Promise<any>;
4466
4572
  create(recordingId: string, data: Record<string, any>): Promise<any>;
4467
4573
  update(recordingId: string, splitId: string, data: Record<string, any>): Promise<any>;
4468
4574
  delete(recordingId: string, splitId: string): Promise<any>;
4575
+ /**
4576
+ * Edit a split and keep the route's whole envelope: `data` is the row, and
4577
+ * `previous` / `changed_fields` / `verification_cleared` sit beside it —
4578
+ * `request()` would drop them. verification_cleared is true when the edit
4579
+ * cleared the holder's confirmation.
4580
+ */
4581
+ edit(recordingId: string, splitId: string, data: Record<string, any>): Promise<{
4582
+ data: any;
4583
+ } & RecordingSplitEditEnvelope>;
4584
+ /**
4585
+ * End a split: sets end_date (default today) so it stops counting toward
4586
+ * the 100% total; the row is kept. Same envelope as `edit`.
4587
+ */
4588
+ end(recordingId: string, splitId: string, data?: {
4589
+ end_date?: string;
4590
+ notes?: string | null;
4591
+ }): Promise<{
4592
+ data: any;
4593
+ } & RecordingSplitEditEnvelope>;
4469
4594
  verify(recordingId: string, splitId: string): Promise<any>;
4470
4595
  }
4471
4596
  declare class PublishersResource extends BaseResource {
@@ -4565,6 +4690,63 @@ declare class PartyClaimsResource extends BaseResource {
4565
4690
  limit?: number;
4566
4691
  }): Promise<PartyClaimInviteSummary[]>;
4567
4692
  }
4693
+ /** One person's outcome from POST /admin/people/claim-invites. */
4694
+ export interface ProfileClaimInviteOutcome {
4695
+ person_id: string;
4696
+ outcome: "invited" | "would_invite" | "skipped" | "failed";
4697
+ /** invited: "sent" | "held" (waiting for approval) | "failed". */
4698
+ send_status?: string;
4699
+ /** would_invite: the address the invite would go to. */
4700
+ email?: string;
4701
+ /** skipped: why (PERSON_HAS_NO_EMAIL, ALREADY_INVITED, ...). */
4702
+ code?: string;
4703
+ reason?: string;
4704
+ }
4705
+ export interface ProfileClaimInviteResult {
4706
+ /** false: a preview, nothing was sent. */
4707
+ confirmed: boolean;
4708
+ results: ProfileClaimInviteOutcome[];
4709
+ invited: number;
4710
+ would_invite: number;
4711
+ skipped: number;
4712
+ failed: number;
4713
+ }
4714
+ /** One person's standing from GET /admin/profile-claims. */
4715
+ export interface ProfileClaimState {
4716
+ person_id: string;
4717
+ name: string | null;
4718
+ state: string;
4719
+ claimed_at: string | null;
4720
+ invited_at: string | null;
4721
+ expires_at: string | null;
4722
+ send_status: string | null;
4723
+ answered_at: string | null;
4724
+ address_is_current: boolean | null;
4725
+ resend_after: string | null;
4726
+ has_email: boolean;
4727
+ }
4728
+ export interface ProfileClaimStatusResult {
4729
+ people: ProfileClaimState[];
4730
+ /** More people matched than were returned: narrow, or read by person ids. */
4731
+ truncated: boolean;
4732
+ }
4733
+ /**
4734
+ * Claim your profile: invite people to claim their profile (a preview
4735
+ * unless `confirm`), and read where people stand.
4736
+ */
4737
+ declare class ProfileClaimsResource extends BaseResource {
4738
+ invite(params: {
4739
+ person_ids: string[];
4740
+ confirm?: boolean;
4741
+ /** person id → the address the preview showed; a change is skipped. */
4742
+ expected_emails?: Record<string, string>;
4743
+ }): Promise<ProfileClaimInviteResult | null>;
4744
+ status(params?: {
4745
+ person_ids?: string[];
4746
+ state?: string;
4747
+ limit?: number;
4748
+ }): Promise<ProfileClaimStatusResult>;
4749
+ }
4568
4750
  declare class ReleasesResource extends BaseResource {
4569
4751
  list(params?: {
4570
4752
  limit?: number;
@@ -5233,6 +5415,24 @@ export interface ApprovalStatusResult {
5233
5415
  decided_via: string | null;
5234
5416
  /** ISO timestamp the pending request expires. */
5235
5417
  expires_at: string | null;
5418
+ /** Batched merge approvals only, once run: per-outcome counts. */
5419
+ summary?: {
5420
+ total: number;
5421
+ merged: number;
5422
+ skipped: number;
5423
+ failed: number;
5424
+ };
5425
+ /** Batched merge approvals only, once run: what happened to each pair. */
5426
+ items?: Array<{
5427
+ index: number;
5428
+ entity_type: string;
5429
+ winner_id: string;
5430
+ loser_ids: string[];
5431
+ outcome: "merged" | "skipped" | "failed";
5432
+ reason?: string;
5433
+ skipped_loser_ids?: string[];
5434
+ result?: Record<string, unknown>;
5435
+ }>;
5236
5436
  }
5237
5437
  declare class ApprovalsResource extends BaseResource {
5238
5438
  getStatus(approvalId: string): Promise<ApprovalStatusResult>;
@@ -5292,6 +5492,7 @@ export declare class PicaClient {
5292
5492
  publishers: PublishersResource;
5293
5493
  labels: LabelsResource;
5294
5494
  partyClaims: PartyClaimsResource;
5495
+ profileClaims: ProfileClaimsResource;
5295
5496
  agreementTemplates: AgreementTemplatesResource;
5296
5497
  producerAgreements: ProducerAgreementsResource;
5297
5498
  workForHire: WorkForHireResource;