@withpica/mcp-sdk 3.21.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/dist/index.js CHANGED
@@ -559,6 +559,25 @@ class PeopleResource extends BaseResource {
559
559
  async bulkDelete(ids) {
560
560
  return this.request("POST", "/admin/people/bulk-delete", { ids });
561
561
  }
562
+ /**
563
+ * GET /admin/people/{id}/split-identity — what giving this person a new
564
+ * global identity would touch: who shares their current one, unattributed
565
+ * split rows naming it, open custody legs naming it, and which of their
566
+ * own identifiers equal it. Read-only.
567
+ */
568
+ async splitIdentityPreview(id) {
569
+ return this.request("GET", `/admin/people/${encodeURIComponent(id)}/split-identity`);
570
+ }
571
+ /**
572
+ * POST /admin/people/{id}/split-identity — give this person a NEW global
573
+ * identity. Body: `{ move_identifiers?, relink_split_ids?,
574
+ * clear_person_identifiers?, undo_external_ids? }`; every list defaults to
575
+ * empty (nothing moves, nothing is relinked). A refusal is a 4xx carrying
576
+ * a `SPLIT_*` code.
577
+ */
578
+ async splitIdentity(id, body) {
579
+ return this.request("POST", `/admin/people/${encodeURIComponent(id)}/split-identity`, body);
580
+ }
562
581
  /**
563
582
  * List a person's artist projects — per-stage-name Spotify/YouTube
564
583
  * identity + enrichment status (ADR-289 Wave B2 item 4, ports the
@@ -830,6 +849,7 @@ class CreditsResource extends BaseResource {
830
849
  work_id: env.work_id ?? workId,
831
850
  credit: env.data,
832
851
  allocation: env.allocation,
852
+ ...(env.person_change && { person_change: env.person_change }),
833
853
  };
834
854
  }
835
855
  /**
@@ -879,9 +899,15 @@ class IntegrityResource extends BaseResource {
879
899
  async waive(input) {
880
900
  return this.request("POST", "/admin/integrity/waivers", input);
881
901
  }
882
- /** PATCH /admin/integrity/waivers { waiver_id, revoke: true }. No un-revoke path. */
902
+ /**
903
+ * PATCH /admin/integrity/waivers { waiver_id, revoke: true }. No un-revoke
904
+ * path. A platform waiver answers with the work's re-scored `completeness`.
905
+ */
883
906
  async revokeWaiver(waiverId) {
884
- await this.request("PATCH", "/admin/integrity/waivers", { waiver_id: waiverId, revoke: true });
907
+ return this.request("PATCH", "/admin/integrity/waivers", {
908
+ waiver_id: waiverId,
909
+ revoke: true,
910
+ });
885
911
  }
886
912
  }
887
913
  class AudioFilesResource extends BaseResource {
@@ -1202,8 +1228,13 @@ class SyncPlacementsResource extends BaseResource {
1202
1228
  : "";
1203
1229
  await this.request("DELETE", `/admin/sync-placements/${id}${query}`);
1204
1230
  }
1231
+ /**
1232
+ * Attach a citation source (POST /api/admin/sync-placements/[id]/cite).
1233
+ * This used to post to `/sources`, which has never existed, so every
1234
+ * pica_sync_placements_cite call answered 404.
1235
+ */
1205
1236
  async addSource(id, source) {
1206
- return this.request("POST", `/admin/sync-placements/${id}/sources`, source);
1237
+ return this.request("POST", `/admin/sync-placements/${id}/cite`, source);
1207
1238
  }
1208
1239
  }
1209
1240
  class WorkspaceResource extends BaseResource {
@@ -1256,9 +1287,24 @@ class AuditResource extends BaseResource {
1256
1287
  }
1257
1288
  }
1258
1289
  class MemoryResource extends BaseResource {
1290
+ /**
1291
+ * The FIRST page of memories only (newest first, the route's default page
1292
+ * size) — since 2026-10-02 the route pages. Kept for existing callers; use
1293
+ * `listPage` to reach the rest.
1294
+ */
1259
1295
  async list() {
1260
1296
  return this.request("GET", "/admin/memory");
1261
1297
  }
1298
+ /** One page of memories, most recently changed first, with the total. */
1299
+ async listPage(params) {
1300
+ const query = new URLSearchParams();
1301
+ if (params?.limit)
1302
+ query.set("limit", String(params.limit));
1303
+ if (params?.offset)
1304
+ query.set("offset", String(params.offset));
1305
+ const qs = query.toString();
1306
+ return this.requestPaginated("GET", `/admin/memory${qs ? `?${qs}` : ""}`);
1307
+ }
1262
1308
  async search(query) {
1263
1309
  return this.request("GET", `/admin/memory/search?q=${encodeURIComponent(query)}`);
1264
1310
  }
@@ -2708,8 +2754,12 @@ class AssetsResource extends BaseResource {
2708
2754
  async exportAll() {
2709
2755
  return this.request("GET", "/admin/assets/export");
2710
2756
  }
2757
+ /**
2758
+ * AI-assisted price estimate for the asset's make/model. The route is
2759
+ * POST-only (it spends an AI call each time); this sent GET and got 405.
2760
+ */
2711
2761
  async marketCheck(id) {
2712
- return this.request("GET", `/admin/assets/${id}/market-check`);
2762
+ return this.request("POST", `/admin/assets/${id}/market-check`);
2713
2763
  }
2714
2764
  // --- Production-asset links (ADR-156 operating principle #3) ---
2715
2765
  // Typed edges between physical_assets and works/recordings, with
@@ -2806,6 +2856,24 @@ class ImportResource extends BaseResource {
2806
2856
  throw new Error(`Template fetch failed: ${response.status}`);
2807
2857
  return response.text();
2808
2858
  }
2859
+ /**
2860
+ * Emails that reached the organisation's forwarding address, newest first,
2861
+ * with what PICA did with each (stored on arrival, waiting for review,
2862
+ * dismissed, failed). Owners and admins only.
2863
+ */
2864
+ async listForwardedEmails(options) {
2865
+ const params = new URLSearchParams();
2866
+ if (options?.limit !== undefined)
2867
+ params.set("limit", String(options.limit));
2868
+ if (options?.offset !== undefined)
2869
+ params.set("offset", String(options.offset));
2870
+ const qs = params.toString();
2871
+ return this.request("GET", `/admin/email-intake/forwarded${qs ? `?${qs}` : ""}`);
2872
+ }
2873
+ /** One forwarded email, with its text body when PICA kept one. */
2874
+ async getForwardedEmail(id) {
2875
+ return this.request("GET", `/admin/email-intake/forwarded/${encodeURIComponent(id)}`);
2876
+ }
2809
2877
  }
2810
2878
  // --- Documents Resource ---
2811
2879
  class DocumentsResource extends BaseResource {
@@ -3343,6 +3411,22 @@ class RecordingSplitsResource extends BaseResource {
3343
3411
  async delete(recordingId, splitId) {
3344
3412
  return this.request("DELETE", `/admin/recordings/${recordingId}/splits/${splitId}`);
3345
3413
  }
3414
+ /**
3415
+ * Edit a split and keep the route's whole envelope: `data` is the row, and
3416
+ * `previous` / `changed_fields` / `verification_cleared` sit beside it —
3417
+ * `request()` would drop them. verification_cleared is true when the edit
3418
+ * cleared the holder's confirmation.
3419
+ */
3420
+ async edit(recordingId, splitId, data) {
3421
+ return this.requestWithEnvelope("PATCH", `/admin/recordings/${recordingId}/splits/${splitId}`, data);
3422
+ }
3423
+ /**
3424
+ * End a split: sets end_date (default today) so it stops counting toward
3425
+ * the 100% total; the row is kept. Same envelope as `edit`.
3426
+ */
3427
+ async end(recordingId, splitId, data = {}) {
3428
+ return this.requestWithEnvelope("POST", `/admin/recordings/${recordingId}/splits/${splitId}/end`, data);
3429
+ }
3346
3430
  async verify(recordingId, splitId) {
3347
3431
  return this.request("POST", `/admin/recordings/${recordingId}/splits/${splitId}/verify`);
3348
3432
  }
@@ -3424,6 +3508,36 @@ class PartyClaimsResource extends BaseResource {
3424
3508
  return (res?.data ?? []);
3425
3509
  }
3426
3510
  }
3511
+ /**
3512
+ * Claim your profile: invite people to claim their profile (a preview
3513
+ * unless `confirm`), and read where people stand.
3514
+ */
3515
+ class ProfileClaimsResource extends BaseResource {
3516
+ async invite(params) {
3517
+ const res = await this.request("POST", "/admin/people/claim-invites", params);
3518
+ if (res && typeof res === "object" && "data" in res && res.data) {
3519
+ return res.data;
3520
+ }
3521
+ return (res ?? null);
3522
+ }
3523
+ async status(params) {
3524
+ const q = new URLSearchParams();
3525
+ for (const id of params?.person_ids ?? [])
3526
+ q.append("person_id", id);
3527
+ if (params?.state)
3528
+ q.set("state", params.state);
3529
+ if (params?.limit)
3530
+ q.set("limit", String(params.limit));
3531
+ const qs = q.toString();
3532
+ const res = await this.request("GET", `/admin/profile-claims${qs ? `?${qs}` : ""}`);
3533
+ const body = res;
3534
+ const inner = body?.people ? body : body?.data;
3535
+ return {
3536
+ people: inner?.people ?? [],
3537
+ truncated: inner?.truncated === true,
3538
+ };
3539
+ }
3540
+ }
3427
3541
  class ReleasesResource extends BaseResource {
3428
3542
  async list(params) {
3429
3543
  const parts = [];
@@ -3667,6 +3781,42 @@ class RightsResource extends BaseResource {
3667
3781
  async inspect(workId) {
3668
3782
  return this.request("GET", `/admin/works/${encodeURIComponent(workId)}/rights`);
3669
3783
  }
3784
+ /**
3785
+ * ADR-321 Phase 3 — GET /admin/rights-income. Statements: direct income
3786
+ * and what it WOULD pay (no money moves). Needs finance access.
3787
+ */
3788
+ async statements(params) {
3789
+ const qp = new URLSearchParams();
3790
+ if (params?.workId)
3791
+ qp.set("work_id", params.workId);
3792
+ if (params?.limit)
3793
+ qp.set("limit", String(params.limit));
3794
+ if (params?.before)
3795
+ qp.set("before", params.before);
3796
+ const qs = qp.toString();
3797
+ return this.request("GET", `/admin/rights-income${qs ? `?${qs}` : ""}`);
3798
+ }
3799
+ /** GET /admin/rights-income/{id} — one income event, recomputed now. */
3800
+ async statement(incomeId) {
3801
+ return this.request("GET", `/admin/rights-income/${encodeURIComponent(incomeId)}`);
3802
+ }
3803
+ /**
3804
+ * POST /admin/rights-income — record direct income. Body is
3805
+ * `{ work_id, side, recording_id?, income_type, fee_kind, currency,
3806
+ * amount: "1250.00", earned_on, description? }` or
3807
+ * `{ enquiry_id, side, recording_id?, earned_on }`.
3808
+ */
3809
+ async recordIncome(body) {
3810
+ return this.request("POST", "/admin/rights-income", body);
3811
+ }
3812
+ /** GET /admin/rights-statements/society?work_id= — society statements checked against the split. */
3813
+ async societyChecks(workId) {
3814
+ return this.request("GET", `/admin/rights-statements/society?work_id=${encodeURIComponent(workId)}`);
3815
+ }
3816
+ /** GET /admin/rights-statements/measures — the four measures (ADR-321 §7a). */
3817
+ async measures() {
3818
+ return this.request("GET", "/admin/rights-statements/measures");
3819
+ }
3670
3820
  }
3671
3821
  class RoyaltiesResource extends BaseResource {
3672
3822
  async payments(params) {
@@ -4157,6 +4307,7 @@ export class PicaClient {
4157
4307
  publishers;
4158
4308
  labels;
4159
4309
  partyClaims;
4310
+ profileClaims;
4160
4311
  agreementTemplates;
4161
4312
  producerAgreements;
4162
4313
  workForHire;
@@ -4275,6 +4426,7 @@ export class PicaClient {
4275
4426
  this.publishers = new PublishersResource(baseUrl, config.apiKey, debug);
4276
4427
  this.labels = new LabelsResource(baseUrl, config.apiKey, debug);
4277
4428
  this.partyClaims = new PartyClaimsResource(baseUrl, config.apiKey, debug);
4429
+ this.profileClaims = new ProfileClaimsResource(baseUrl, config.apiKey, debug);
4278
4430
  this.agreementTemplates = new AgreementTemplatesResource(baseUrl, config.apiKey, debug);
4279
4431
  this.producerAgreements = new ProducerAgreementsResource(baseUrl, config.apiKey, debug);
4280
4432
  this.workForHire = new WorkForHireResource(baseUrl, config.apiKey, debug);