@withpica/mcp-sdk 3.20.0 → 3.22.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,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [3.22.0] - 2026-09-30
15
+
16
+ ### Added
17
+
18
+ - `integrity.waive` accepts `kind` (`not_applicable` | `restricted`) for the
19
+ platform-presence codes `PLATFORM_SPOTIFY` / `PLATFORM_YOUTUBE` /
20
+ `PLATFORM_APPLE_MUSIC`, and returns the work's re-scored `completeness`
21
+ for them; `integrity.revokeWaiver` now returns the route's answer
22
+ (`{ id, revoked, completeness? }`) instead of `void`.
23
+ - `PlatformWaiverCode` / `PlatformWaiverKind` types; `IntegrityGapCode` gains
24
+ `WORK_NO_MASTER`, `WORK_SPLITS_ABSENT`, `WORK_SPLITS_INVALID`.
25
+
26
+ ### Deprecated
27
+
28
+ - `Work.is_verified` is now optional and deprecated. `works` has no such
29
+ column (no applied migration adds one), so works responses do not carry it;
30
+ PICA keeps no work-level verified flag. Remove at the next major, with
31
+ `works.verify`.
32
+ - `rights.statements()`, `rights.statement(incomeId)`, `rights.recordIncome(body)`,
33
+ `rights.societyChecks(workId)` and `rights.measures()` — ADR-321 Phase 3
34
+ (distribution, computed and not paid), over `GET/POST /admin/rights-income`,
35
+ `GET /admin/rights-income/{id}`, `GET /admin/rights-statements/society` and
36
+ `GET /admin/rights-statements/measures`. All need finance access.
37
+
38
+ ## [3.21.0] - 2026-09-29
39
+
40
+ ### Added
41
+
42
+ - `rights.propose(workId, body)`, `rights.status(ruleId)` and
43
+ `rights.inspect(workId)` — ADR-321 Phase 2, over
44
+ `POST /admin/works/{id}/rights/propose`, `GET /admin/rights/rules/{id}` and
45
+ `GET /admin/works/{id}/rights`.
46
+
14
47
  ## [3.20.0] - 2026-09-26
15
48
 
16
49
  ### Changed
package/dist/index.d.ts CHANGED
@@ -306,7 +306,13 @@ interface Work {
306
306
  isrc?: string;
307
307
  primary_artist?: string;
308
308
  duration_seconds?: number;
309
- is_verified: boolean;
309
+ /**
310
+ * @deprecated `works` has no `is_verified` column (no applied migration
311
+ * adds one), so works responses do not carry this field. PICA keeps no
312
+ * work-level verified flag (see `WorksResource.verify`). Kept only so the
313
+ * published SDK's surface does not break; remove at the next major.
314
+ */
315
+ is_verified?: boolean;
310
316
  lyrics?: string;
311
317
  genre?: string;
312
318
  mood?: string;
@@ -1025,6 +1031,13 @@ declare class WorksResource extends BaseResource {
1025
1031
  }): Promise<Work>;
1026
1032
  update(id: string, updates: Partial<Work>): Promise<Work>;
1027
1033
  delete(id: string): Promise<DeletionResult>;
1034
+ /**
1035
+ * @deprecated `works` has no `is_verified` column, so PATCH /admin/works/[id]
1036
+ * refuses this body (VALIDATION_ERROR "unknown field 'is_verified'") on every
1037
+ * call. PICA keeps no work-level verified flag; the MCP tool
1038
+ * `pica_works_verify` no longer calls this. Kept only so the published SDK's
1039
+ * surface does not break; remove at the next major.
1040
+ */
1028
1041
  verify(id: string): Promise<Work>;
1029
1042
  bulkDelete(ids: string[]): Promise<void>;
1030
1043
  bulkMoveToPerformances(ids: string[]): Promise<unknown>;
@@ -1471,7 +1484,14 @@ declare class PicaScoreResource extends BaseResource {
1471
1484
  * exported shapes (the SDK does not import from `lib/`, mcp<->lib
1472
1485
  * isolation). Keep in sync by hand if the service's exported types change.
1473
1486
  */
1474
- export type IntegrityGapCode = "WORK_NO_RECORDING" | "RECORDING_NO_WORK" | "RECORDING_NO_RELEASE" | "WORK_NO_WRITER" | "RECORDING_NO_OWNER" | "COLLABORATOR_NOT_INVITED" | "COLLABORATOR_NOT_ATTESTED";
1487
+ export type IntegrityGapCode = "WORK_NO_RECORDING" | "RECORDING_NO_WORK" | "RECORDING_NO_RELEASE" | "WORK_NO_WRITER" | "RECORDING_NO_OWNER" | "COLLABORATOR_NOT_INVITED" | "COLLABORATOR_NOT_ATTESTED" | "WORK_NO_MASTER" | "WORK_SPLITS_ABSENT" | "WORK_SPLITS_INVALID";
1488
+ /**
1489
+ * Platform-presence codes a work may be waived on (mig 20260929163712):
1490
+ * the platform is not applicable to it, or restricted. Identifiers and
1491
+ * registrations are never waivable.
1492
+ */
1493
+ export type PlatformWaiverCode = "PLATFORM_SPOTIFY" | "PLATFORM_YOUTUBE" | "PLATFORM_APPLE_MUSIC";
1494
+ export type PlatformWaiverKind = "not_applicable" | "restricted";
1475
1495
  export type IntegrityEntityType = "work" | "recording" | "release" | "person";
1476
1496
  export interface AttestationProposal {
1477
1497
  kind: "send_attestation_invites";
@@ -1532,11 +1552,28 @@ declare class IntegrityResource extends BaseResource {
1532
1552
  entity_type: string;
1533
1553
  entity_id: string;
1534
1554
  reason: string;
1555
+ /** Required for a platform code (PLATFORM_*); omitted otherwise. */
1556
+ kind?: PlatformWaiverKind;
1535
1557
  }): Promise<{
1536
1558
  id: string;
1559
+ kind?: PlatformWaiverKind;
1560
+ completeness?: {
1561
+ score: number | null;
1562
+ platforms: number | null;
1563
+ };
1564
+ }>;
1565
+ /**
1566
+ * PATCH /admin/integrity/waivers { waiver_id, revoke: true }. No un-revoke
1567
+ * path. A platform waiver answers with the work's re-scored `completeness`.
1568
+ */
1569
+ revokeWaiver(waiverId: string): Promise<{
1570
+ id: string;
1571
+ revoked: boolean;
1572
+ completeness?: {
1573
+ score: number | null;
1574
+ platforms: number | null;
1575
+ };
1537
1576
  }>;
1538
- /** PATCH /admin/integrity/waivers { waiver_id, revoke: true }. No un-revoke path. */
1539
- revokeWaiver(waiverId: string): Promise<void>;
1540
1577
  }
1541
1578
  interface PresignedUploadResult {
1542
1579
  uploadUrl: string;
@@ -2206,10 +2243,17 @@ declare class EnrichmentResource extends BaseResource {
2206
2243
  * `artist_title_to_youtube` recording-create), a uniqueness check
2207
2244
  * runs instead; conflicts return `{ status: 'create_conflict' }` and
2208
2245
  * cannot be forced.
2246
+ *
2247
+ * File-type questions (`entity_type: 'audio_file'`) take the owner's own
2248
+ * answer: `file_type` (master / version / instrumental / demo / stem) and,
2249
+ * for a stem, an optional `stem_label`. A refused answer is a 400 with
2250
+ * `code: 'INVALID_FILE_TYPE_ANSWER'`.
2209
2251
  */
2210
2252
  applyEnrichmentProposal(proposalId: string, options?: {
2211
2253
  force?: boolean;
2212
2254
  resolution_note?: string;
2255
+ file_type?: "master" | "version" | "instrumental" | "demo" | "stem";
2256
+ stem_label?: string;
2213
2257
  }): Promise<any>;
2214
2258
  /**
2215
2259
  * Reject a pending proposal. Content-hash suppression (ADR-163)
@@ -4697,6 +4741,46 @@ declare class WorkForHireResource extends BaseResource {
4697
4741
  update(id: string, data: Record<string, any>): Promise<any>;
4698
4742
  delete(id: string): Promise<void>;
4699
4743
  }
4744
+ /**
4745
+ * ADR-321 Phase 2 — programmable rights. `propose` only proposes: the route
4746
+ * never activates a rule on an API key, and each party confirms by email.
4747
+ */
4748
+ declare class RightsResource extends BaseResource {
4749
+ /**
4750
+ * POST /admin/works/{id}/rights/propose. Body is one of
4751
+ * `{ rule: "song" }`, `{ rule: "master", recording_id }` or
4752
+ * `{ rule: "share", side?, recording_id?, subject_person_id, kind,
4753
+ * parties: [{ person_id, share_bp }], effective_from, effective_to? }`.
4754
+ * A refusal is a 422 carrying `details.reasons`.
4755
+ */
4756
+ propose(workId: string, body: Record<string, unknown>): Promise<any>;
4757
+ /** GET /admin/rights/rules/{id} — one rule's status and confirmations. */
4758
+ status(ruleId: string): Promise<any>;
4759
+ /** GET /admin/works/{id}/rights — every rule on a song, history, holds. */
4760
+ inspect(workId: string): Promise<any>;
4761
+ /**
4762
+ * ADR-321 Phase 3 — GET /admin/rights-income. Statements: direct income
4763
+ * and what it WOULD pay (no money moves). Needs finance access.
4764
+ */
4765
+ statements(params?: {
4766
+ workId?: string;
4767
+ limit?: number;
4768
+ before?: string;
4769
+ }): Promise<any>;
4770
+ /** GET /admin/rights-income/{id} — one income event, recomputed now. */
4771
+ statement(incomeId: string): Promise<any>;
4772
+ /**
4773
+ * POST /admin/rights-income — record direct income. Body is
4774
+ * `{ work_id, side, recording_id?, income_type, fee_kind, currency,
4775
+ * amount: "1250.00", earned_on, description? }` or
4776
+ * `{ enquiry_id, side, recording_id?, earned_on }`.
4777
+ */
4778
+ recordIncome(body: Record<string, unknown>): Promise<any>;
4779
+ /** GET /admin/rights-statements/society?work_id= — society statements checked against the split. */
4780
+ societyChecks(workId: string): Promise<any>;
4781
+ /** GET /admin/rights-statements/measures — the four measures (ADR-321 §7a). */
4782
+ measures(): Promise<any>;
4783
+ }
4700
4784
  declare class RoyaltiesResource extends BaseResource {
4701
4785
  payments(params?: {
4702
4786
  source?: string;
@@ -5212,6 +5296,8 @@ export declare class PicaClient {
5212
5296
  producerAgreements: ProducerAgreementsResource;
5213
5297
  workForHire: WorkForHireResource;
5214
5298
  royalties: RoyaltiesResource;
5299
+ /** ADR-321 Phase 2 — programmable rights (propose / status / inspect). */
5300
+ rights: RightsResource;
5215
5301
  statements: StatementsResource;
5216
5302
  /** ADR-319 — saved catalog selections. */
5217
5303
  selections: SelectionsResource;