@withpica/mcp-sdk 1.39.1 → 1.40.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,8 +11,56 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
- ### Added
14
+ ## [1.40.0] - 2026-06-12
15
+
16
+ ADR-264 WS2 verify-before-assert + WS4 bulk recording credits + ADR-268 WS1
17
+ party claims / WS2 label identifiers / WS5 ownership transfer types. Removes
18
+ the never-functional `TeamResource`.
19
+
20
+ ### Changed
21
+
22
+ - **`RecordingCustodyResource.assign`** now accepts the ownership transfer
23
+ types `assignment` and `full_transfer` (ADR-268 WS5, the ADR-262
24
+ fast-follow): the `transfer_type` union widens from
25
+ `delivery|license|admin_grant` to all five types. Ownership legs also move
26
+ the recording's master ownership splits append-only inside the same
27
+ transaction (the transferor's active era closes, the transferee's opens;
28
+ the credit layer never moves). Ambiguous or over-share partial transfers
29
+ are refused as client-recoverable 400s
30
+ (`PARTIAL_TRANSFER_AMBIGUOUS` / `INSUFFICIENT_TRANSFEROR_SHARE` /
31
+ `INVALID_PERCENTAGE`).
32
+ - **`LabelsResource.create`** accepts an optional `identifiers` object
33
+ (`musicbrainz_label_id` / `isni` / `label_code` / `discogs_label_id` /
34
+ `wikidata_id` / `deezer_label_id`) — ADR-268 WS2 identifier-first dedup;
35
+ `LabelOrganisation` gains `global_label_id` (the bridge to the resolved
36
+ global label identity).
37
+
38
+ ### Removed
15
39
 
40
+ - **`TeamResource` (`client.team.*` — list/get/invite/update/remove)** —
41
+ existed solely to back the `pica_team_*` MCP tools, which were removed
42
+ 2026-06-11 (founder decision). `/api/admin/team/*` is session-only by
43
+ design (ADR-248: team membership is human-only), so every bearer SDK call
44
+ through this resource always received a hard 401; removal is honesty, not
45
+ a regression. Team membership is managed by humans in `/settings`.
46
+
47
+ ### Added
48
+
49
+ - **`PartyClaimsResource` (`client.partyClaims.*`)** — ADR-268 WS1.
50
+ `invite({target_organisation_id, invited_email, release_id?, recording_id?})`
51
+ POSTs `/admin/party-claims` (send a claim invite for an unclaimed party
52
+ org; resolves the unwrapped `{invite, disputed, claim_url}` object) and
53
+ `list({target_organisation_id?, status?, limit?})` GETs the calling org's
54
+ sent claims. Backs the new `pica_party_claim_invite` /
55
+ `pica_party_claim_status` tools.
56
+
57
+ - **`RecordingCreditsResource.bulkUpdate(input)`** — ADR-264 WS4 prerequisite.
58
+ POST `/admin/recording-credits/bulk` with exactly one of `release_id`
59
+ (targets every recording on the release's tracklist) / `recording_ids`,
60
+ plus the `credits[]` set applied to every target recording and optional
61
+ `dry_run`. Returns per-row `created` / `skipped_existing` (or
62
+ `would_create` / `would_skip_existing` on dry-run) results plus summary
63
+ counts. Typed against the unwrapped route payload.
16
64
  - **`WorksResource.verifyRegistrations(input)`** — ADR-264 WS2 verify-before-assert.
17
65
  POST `/admin/works/verify-registrations` with `work_ids` (1-25), `mode`
18
66
  (`"check"` runs an MLC lookup per work; `"confirm_unregistered"` records the
package/dist/index.d.ts CHANGED
@@ -1124,13 +1124,6 @@ declare class NotesResource extends BaseResource {
1124
1124
  }): Promise<any>;
1125
1125
  delete(id: string): Promise<void>;
1126
1126
  }
1127
- declare class TeamResource extends BaseResource {
1128
- list(): Promise<any>;
1129
- get(id: string): Promise<any>;
1130
- invite(data: Record<string, any>): Promise<any>;
1131
- update(id: string, data: Record<string, any>): Promise<any>;
1132
- remove(id: string): Promise<any>;
1133
- }
1134
1127
  declare class RecordingsResource extends BaseResource {
1135
1128
  list(params?: {
1136
1129
  limit?: number;
@@ -1405,8 +1398,8 @@ declare class DashboardResource extends BaseResource {
1405
1398
  /**
1406
1399
  * Actionable items projection — `{class, entity_id, entity_type,
1407
1400
  * entity_label, failure_mode, urgency: {score, components,
1408
- * model_version}, drill_down_skill, suggested_skill (alias, slated
1409
- * for removal)}` per row, sorted by `urgency.score` desc, capped at
1401
+ * model_version}, drill_down_skill}` per row (the suggested_skill
1402
+ * alias was removed 2026-06-11), sorted by `urgency.score` desc, capped at
1410
1403
  * `limit`. Backed by the shared actionable-items source so counts
1411
1404
  * agree with `pica_dashboard_briefing.critical_issues_total` and
1412
1405
  * `pica_count_explain.sources[].count` for the same org/moment.
@@ -2784,6 +2777,42 @@ export interface RecordingCreditCreateInput {
2784
2777
  display_order?: number;
2785
2778
  notes?: string | null;
2786
2779
  }
2780
+ export interface RecordingCreditsBulkCreditInput {
2781
+ credited_name: string;
2782
+ role: string;
2783
+ person_id?: string | null;
2784
+ split_percentage?: number | null;
2785
+ split_type?: string | null;
2786
+ display_order?: number;
2787
+ notes?: string | null;
2788
+ }
2789
+ export interface RecordingCreditsBulkUpdateInput {
2790
+ /** Target every recording on this release. Exactly one of release_id / recording_ids. */
2791
+ release_id?: string;
2792
+ recording_ids?: string[];
2793
+ /** The credit set applied to EVERY target recording. */
2794
+ credits: RecordingCreditsBulkCreditInput[];
2795
+ /** Preview the create/skip decision set without writing. */
2796
+ dry_run?: boolean;
2797
+ }
2798
+ export type RecordingCreditsBulkRowStatus = "created" | "skipped_existing" | "would_create" | "would_skip_existing";
2799
+ export interface RecordingCreditsBulkRowResult {
2800
+ recording_id: string;
2801
+ credited_name: string;
2802
+ role: string;
2803
+ status: RecordingCreditsBulkRowStatus;
2804
+ credit_id?: string;
2805
+ }
2806
+ export interface RecordingCreditsBulkUpdateResult {
2807
+ dry_run: boolean;
2808
+ target_recording_count: number;
2809
+ total_rows: number;
2810
+ created: number;
2811
+ skipped_existing: number;
2812
+ would_create: number;
2813
+ would_skip_existing: number;
2814
+ results: RecordingCreditsBulkRowResult[];
2815
+ }
2787
2816
  declare class RecordingCreditsResource extends BaseResource {
2788
2817
  list(recordingId: string): Promise<RecordingCredit[]>;
2789
2818
  create(recordingId: string, input: RecordingCreditCreateInput): Promise<RecordingCredit>;
@@ -2799,6 +2828,13 @@ declare class RecordingCreditsResource extends BaseResource {
2799
2828
  * success. AC-2 strict semantics for pica_credit_remove.
2800
2829
  */
2801
2830
  atomicRemove(recordingId: string, creditId: string): Promise<AtomicCreditResult>;
2831
+ /**
2832
+ * ADR-264 WS4 prerequisite — apply one credit set across many recordings
2833
+ * (a release's tracklist via release_id, or an explicit recording_ids
2834
+ * list) in a single call. Existing (recording, credited_name, role) rows
2835
+ * are skipped, never overwritten; dry_run previews the same decision set.
2836
+ */
2837
+ bulkUpdate(input: RecordingCreditsBulkUpdateInput): Promise<RecordingCreditsBulkUpdateResult>;
2802
2838
  }
2803
2839
  export type ShareTraceEntityType = "work" | "recording" | "person";
2804
2840
  export interface ShareTraceQuery {
@@ -2955,6 +2991,17 @@ export interface LabelOrganisation {
2955
2991
  verification_status: string | null;
2956
2992
  org_type: string;
2957
2993
  contact_email?: string | null;
2994
+ /** ADR-268 WS2 bridge to the enrichment-side global label identity. */
2995
+ global_label_id?: string | null;
2996
+ }
2997
+ /** External label identifiers accepted by labels.create (ADR-268 WS2). */
2998
+ export interface LabelIdentifiers {
2999
+ musicbrainz_label_id?: string;
3000
+ isni?: string;
3001
+ label_code?: string;
3002
+ discogs_label_id?: string;
3003
+ wikidata_id?: string;
3004
+ deezer_label_id?: string;
2958
3005
  }
2959
3006
  declare class LabelsResource extends BaseResource {
2960
3007
  list(params?: {
@@ -2968,11 +3015,63 @@ declare class LabelsResource extends BaseResource {
2968
3015
  country?: string;
2969
3016
  website?: string;
2970
3017
  contact_email?: string;
3018
+ /**
3019
+ * ADR-268 WS2: when supplied, server-side dedup is identifier-based —
3020
+ * an org already bridged to the resolved global label identity is
3021
+ * returned (already_existed) even if the name differs.
3022
+ */
3023
+ identifiers?: LabelIdentifiers;
2971
3024
  }): Promise<(LabelOrganisation & {
2972
3025
  org_type: string;
2973
3026
  already_existed?: boolean;
2974
3027
  }) | null>;
2975
3028
  }
3029
+ export interface PartyClaimInviteSummary {
3030
+ id: string;
3031
+ organisation_id: string;
3032
+ source: "invite" | "unsolicited";
3033
+ invited_by_organisation_id: string | null;
3034
+ invited_email: string;
3035
+ status: string;
3036
+ expires_at: string | null;
3037
+ claimed_at: string | null;
3038
+ claim_code: string | null;
3039
+ release_id: string | null;
3040
+ recording_id: string | null;
3041
+ created_at: string;
3042
+ organisation?: {
3043
+ id: string;
3044
+ name: string;
3045
+ org_type: string;
3046
+ verification_status: string | null;
3047
+ };
3048
+ }
3049
+ export interface PartyClaimInviteResult {
3050
+ invite: PartyClaimInviteSummary;
3051
+ disputed: boolean;
3052
+ claim_url: string | null;
3053
+ }
3054
+ /**
3055
+ * ADR-268 WS1 — party org claim flow. `invite()` sends an artist-anchored
3056
+ * claim invite for an unclaimed label/distributor/publisher org;
3057
+ * `list()` reads the claims the calling org has sent.
3058
+ *
3059
+ * Typed against the UNWRAPPED reality (ADR-265 lesson): BaseResource.request
3060
+ * auto-unwraps the `{success,data}` envelope, so methods see `data` itself.
3061
+ */
3062
+ declare class PartyClaimsResource extends BaseResource {
3063
+ invite(params: {
3064
+ target_organisation_id: string;
3065
+ invited_email: string;
3066
+ release_id?: string;
3067
+ recording_id?: string;
3068
+ }): Promise<PartyClaimInviteResult | null>;
3069
+ list(params?: {
3070
+ target_organisation_id?: string;
3071
+ status?: string;
3072
+ limit?: number;
3073
+ }): Promise<PartyClaimInviteSummary[]>;
3074
+ }
2976
3075
  declare class ReleasesResource extends BaseResource {
2977
3076
  list(params?: {
2978
3077
  limit?: number;
@@ -3234,17 +3333,19 @@ declare class CustodyResource extends BaseResource {
3234
3333
  }
3235
3334
  declare class RecordingCustodyResource extends BaseResource {
3236
3335
  /**
3237
- * Assign (transfer) custody of a recording. Admin/owner only. v1 supports
3238
- * control/possession transfer types only (delivery|license|admin_grant);
3239
- * ownership transfer (assignment|full_transfer) is a fast-follow and the
3240
- * route/service reject it. At least one custodian target must be supplied
3241
- * (org, global publisher, or global creator).
3336
+ * Assign (transfer) custody of a recording. Admin/owner only.
3337
+ * Control/possession types (delivery|license|admin_grant) leave ownership
3338
+ * unchanged. Ownership types (assignment|full_transfer ADR-268 WS5) also
3339
+ * move the master ownership splits append-only in the same transaction:
3340
+ * the transferor's active era closes, the transferee's opens; ambiguous or
3341
+ * over-share partial transfers are refused (400). At least one custodian
3342
+ * target must be supplied (org, global publisher, or global creator).
3242
3343
  */
3243
3344
  assign(body: {
3244
3345
  recording_id: string;
3245
3346
  percentage: number;
3246
3347
  territory: string;
3247
- transfer_type: "delivery" | "license" | "admin_grant";
3348
+ transfer_type: "delivery" | "license" | "admin_grant" | "assignment" | "full_transfer";
3248
3349
  reason: string;
3249
3350
  new_custodian_org_id?: string | null;
3250
3351
  new_custodian_global_publisher_id?: string | null;
@@ -3421,7 +3522,6 @@ export declare class PicaClient {
3421
3522
  sessions: SessionsResource;
3422
3523
  assets: AssetsResource;
3423
3524
  notes: NotesResource;
3424
- team: TeamResource;
3425
3525
  projects: ProjectsResource;
3426
3526
  releases: ReleasesResource;
3427
3527
  splitSheets: SplitSheetsResource;
@@ -3432,6 +3532,7 @@ export declare class PicaClient {
3432
3532
  audioPipelineStatus: AudioPipelineStatusResource;
3433
3533
  publishers: PublishersResource;
3434
3534
  labels: LabelsResource;
3535
+ partyClaims: PartyClaimsResource;
3435
3536
  agreementTemplates: AgreementTemplatesResource;
3436
3537
  producerAgreements: ProducerAgreementsResource;
3437
3538
  workForHire: WorkForHireResource;