@withpica/mcp-sdk 3.1.1 → 3.2.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,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [3.2.0] - 2026-07-04
15
+
16
+ ### Added
17
+
18
+ - `agreements.sendForSignature(id, { expires_in_days })` — dispatch per-signer
19
+ signing-link emails for an agreement (ADR-289 Wave A).
20
+ - `BookingsResource` — query/detail/update for booking enquiries (ADR-289 Wave C).
21
+ - Project participant + multimedia management methods on `ProjectsResource`,
22
+ and work detach support (ADR-289 Wave C).
23
+ - Artist-projects and people-triangulate methods (ADR-289 Wave B).
24
+ - `agreements.getSignatureStatusWithSigners(id)` — per-signer signature status
25
+ (ADR-289 Wave B).
26
+ - Memory update, telegram notification config, and send-hub cancel methods
27
+ (ADR-289 Wave C).
28
+
29
+ ### Changed
30
+
31
+ - `Work` type declares the licensing fields (`training_rights`, `is_licensable`,
32
+ `available_for_licensing`, `licensing_terms`, `licensing_price_usd`,
33
+ `licensing_notes`); `Person` declares `name`. Types-only, additive.
34
+
14
35
  ## [3.1.1] - 2026-07-01
15
36
 
16
37
  ### Added
package/dist/index.d.ts CHANGED
@@ -306,11 +306,19 @@ interface Work {
306
306
  completeness_score?: number | null;
307
307
  ai_disclosure?: Record<string, unknown>;
308
308
  provenance_attestation?: Record<string, unknown>;
309
+ training_rights?: Record<string, unknown>;
310
+ is_licensable?: boolean | null;
311
+ available_for_licensing?: boolean | null;
312
+ licensing_terms?: string | null;
313
+ licensing_price_usd?: number | null;
314
+ licensing_notes?: string | null;
309
315
  created_at: string;
310
316
  updated_at: string;
311
317
  }
312
318
  interface Person {
313
319
  id: string;
320
+ /** Canonical display name (people.name — often a stage name). */
321
+ name?: string;
314
322
  first_name?: string;
315
323
  last_name?: string;
316
324
  email?: string;
@@ -464,6 +472,24 @@ interface AgreementWorkLink {
464
472
  royalty_split_percentage?: number;
465
473
  notes?: string;
466
474
  }
475
+ /** ADR-289 — why a required signer was NOT sent a ready-to-sign email. */
476
+ type AgreementSendForSignatureSkipReason = "no_email_on_file" | "already_signed" | "link_mint_failed" | "email_send_failed";
477
+ interface AgreementSendForSignatureSentEntry {
478
+ person_id: string;
479
+ name: string;
480
+ }
481
+ interface AgreementSendForSignatureSkippedEntry {
482
+ person_id: string;
483
+ name: string;
484
+ reason: AgreementSendForSignatureSkipReason;
485
+ }
486
+ /** ADR-289 — every required signer lands in exactly one of sent/skipped. */
487
+ interface AgreementSendForSignatureResult {
488
+ agreement_id: string;
489
+ status: string;
490
+ sent: AgreementSendForSignatureSentEntry[];
491
+ skipped: AgreementSendForSignatureSkippedEntry[];
492
+ }
467
493
  type SyncPlacementStatus = "licensed" | "aired" | "expired" | "renewed" | "terminated";
468
494
  type SyncPlacementVerificationStatus = "unverified" | "self_attested" | "evidence_attached" | "operator_verified" | "disputed";
469
495
  type SyncPlacementConfidentialityLevel = "public" | "redacted_in_public_car" | "private";
@@ -671,6 +697,40 @@ interface LicenseEnquiry {
671
697
  created_at: string;
672
698
  updated_at: string;
673
699
  }
700
+ /**
701
+ * ADR-289 Wave C1 — ports the bespoke assistant's booking-enquiry tools
702
+ * (search_booking_inquiries / get_booking_enquiry_details /
703
+ * update_booking_enquiry_status / record_booking_response /
704
+ * set_booking_follow_up). Mirrors `lib/services/booking.ts`'s
705
+ * `BookingEnquiry` shape.
706
+ */
707
+ interface BookingEnquiry {
708
+ id: string;
709
+ created_at: string;
710
+ updated_at: string;
711
+ organisation_id: string;
712
+ name: string;
713
+ email: string;
714
+ phone: string | null;
715
+ enquiry_type: string;
716
+ service_id: string | null;
717
+ project_title: string | null;
718
+ project_description: string;
719
+ budget_range: string | null;
720
+ timeline: string | null;
721
+ deadline: string | null;
722
+ status: string;
723
+ priority: string;
724
+ response_sent_at: string | null;
725
+ response_content: string | null;
726
+ responded_by: string | null;
727
+ follow_up_required: boolean;
728
+ follow_up_date: string | null;
729
+ internal_notes: string | null;
730
+ source: string | null;
731
+ referrer: string | null;
732
+ metadata: Record<string, unknown> | null;
733
+ }
674
734
  export declare class ApiError extends Error {
675
735
  status: number;
676
736
  retryable: boolean;
@@ -878,6 +938,40 @@ declare class PeopleResource extends BaseResource {
878
938
  enrichFromISNI(id: string, isni: string): Promise<Person>;
879
939
  enrichFromMusicBrainz(id: string, musicbrainz_id: string): Promise<Person>;
880
940
  bulkDelete(ids: string[]): Promise<unknown>;
941
+ /**
942
+ * List a person's artist projects — per-stage-name Spotify/YouTube
943
+ * identity + enrichment status (ADR-289 Wave B2 item 4, ports the
944
+ * bespoke assistant's `get_person_artist_projects`).
945
+ */
946
+ listArtistProjects(personId: string): Promise<{
947
+ projects: unknown[];
948
+ total: number;
949
+ }>;
950
+ /**
951
+ * Trigger enrichment for every stage name on a person — matches each
952
+ * against Spotify/YouTube artist identity, auto-applying confident
953
+ * matches and flagging ambiguous ones for disambiguation (ADR-289
954
+ * Wave B2 item 4, ports `enrich_artist_projects`).
955
+ */
956
+ enrichArtistProjects(personId: string): Promise<Record<string, unknown>>;
957
+ /**
958
+ * Mark one of a person's artist projects as primary (unsets any other
959
+ * primary project for the same person server-side) (ADR-289 Wave B2
960
+ * item 4, ports `set_primary_artist_project`).
961
+ */
962
+ setPrimaryArtistProject(artistProjectId: string): Promise<Record<string, unknown>>;
963
+ /**
964
+ * Check whether an external artist name already matches an existing
965
+ * person — exact MusicBrainz-id match, then ISNI-via-MusicBrainz, then
966
+ * a fuzzy name fallback. Read-only (ADR-289 Wave B2 item 5, ports the
967
+ * bespoke assistant's `triangulate_artist` — verdict: NOT subsumed by
968
+ * `pica_resolve_person`, which requires an existing person_id and
969
+ * writes identifiers rather than searching for a match by bare name).
970
+ */
971
+ triangulate(params: {
972
+ artist_name: string;
973
+ musicbrainz_id?: string;
974
+ }): Promise<Record<string, unknown>>;
881
975
  }
882
976
  declare class LicensingResource extends BaseResource {
883
977
  /**
@@ -907,6 +1001,48 @@ declare class LicensingResource extends BaseResource {
907
1001
  * Update a license enquiry status
908
1002
  */
909
1003
  updateEnquiryStatus(id: string, status: string, notes?: string): Promise<LicenseEnquiry>;
1004
+ /**
1005
+ * Set a counter offer on a license enquiry (ADR-289 Wave B1 item 6 —
1006
+ * counter-offer fields on `pica_update_license_enquiry_status`, ports
1007
+ * the bespoke assistant's `set_license_counter_offer`). Setting a counter
1008
+ * offer also moves the enquiry to status "quoted" server-side.
1009
+ */
1010
+ setLicenseEnquiryCounterOffer(id: string, counterOffer: number, notes?: string): Promise<LicenseEnquiry>;
1011
+ }
1012
+ /**
1013
+ * ADR-289 Wave C1 — booking enquiries (internal-team session/production
1014
+ * bookings, distinct from `LicensingResource`'s sync-license enquiries).
1015
+ * Wraps `/admin/bookings` + `/admin/bookings/[id]`.
1016
+ */
1017
+ declare class BookingsResource extends BaseResource {
1018
+ /**
1019
+ * List/search booking enquiries. `GET /admin/bookings` returns the raw
1020
+ * array (not `{data, count}`) — `request()` unwraps to that array.
1021
+ */
1022
+ list(params?: {
1023
+ status?: string;
1024
+ priority?: string;
1025
+ query?: string;
1026
+ enquiry_type?: string;
1027
+ follow_up_required?: boolean;
1028
+ limit?: number;
1029
+ offset?: number;
1030
+ }): Promise<BookingEnquiry[]>;
1031
+ get(id: string): Promise<BookingEnquiry>;
1032
+ /**
1033
+ * `PATCH /admin/bookings/[id]` only processes ONE update mode per call
1034
+ * (status, OR responseContent+respondedBy, OR followUp — the route
1035
+ * returns on the first matching branch). Callers needing multiple
1036
+ * independent updates in one tool invocation must call this once per
1037
+ * mode (mirrors the bespoke assistant's three separate handlers).
1038
+ */
1039
+ update(id: string, data: {
1040
+ status?: string;
1041
+ responseContent?: string;
1042
+ respondedBy?: "pica" | "manual";
1043
+ followUp?: boolean;
1044
+ followUpDate?: string;
1045
+ }): Promise<BookingEnquiry>;
910
1046
  }
911
1047
  export interface WorkCreditAtomicAddInput {
912
1048
  person_id: string;
@@ -1099,6 +1235,14 @@ declare class AgreementsResource extends BaseResource {
1099
1235
  status?: string;
1100
1236
  party_name?: string;
1101
1237
  includeWorkCounts?: boolean;
1238
+ /**
1239
+ * ADR-289 Wave B1 item 4 — filter to agreements in `pending_signature`
1240
+ * or `partially_signed` (ports the bespoke assistant's
1241
+ * `list_pending_signatures`). Maps to `?awaiting_signature=true` on the
1242
+ * route, which already had multi-status filtering (`statuses[]`) under
1243
+ * the hood.
1244
+ */
1245
+ awaiting_signature?: boolean;
1102
1246
  limit?: number;
1103
1247
  offset?: number;
1104
1248
  }): Promise<Agreement[]>;
@@ -1116,11 +1260,46 @@ declare class AgreementsResource extends BaseResource {
1116
1260
  royalty_split_percentage?: number;
1117
1261
  notes?: string;
1118
1262
  }): Promise<AgreementWorkLink>;
1263
+ /**
1264
+ * Unlink (detach) a work from an agreement (ADR-289 Wave B1 item 5 —
1265
+ * `detach` mode on `pica_agreements_link_work`, ports the bespoke
1266
+ * assistant's `unlink_agreement_from_work`).
1267
+ */
1268
+ unlinkWork(id: string, workId: string): Promise<void>;
1269
+ /**
1270
+ * Per-signer signature status: name, signed/pending, signed_at
1271
+ * (ADR-289 Wave B1 item 3 — backs the `signatures` section on
1272
+ * `pica_agreements_inspect`, ports the bespoke assistant's
1273
+ * `get_agreement_signature_status`).
1274
+ */
1275
+ getSignatureStatusWithSigners(id: string): Promise<{
1276
+ agreementId: string;
1277
+ status: string;
1278
+ requiredSignatureCount: number;
1279
+ signatureCount: number;
1280
+ isFullySigned: boolean;
1281
+ expiresAt: string | null;
1282
+ daysUntilExpiry: number | null;
1283
+ signers: Array<{
1284
+ person_id: string;
1285
+ name: string | null;
1286
+ status: "signed" | "pending";
1287
+ signed_at: string | null;
1288
+ }>;
1289
+ }>;
1119
1290
  sourceAgreementSplits(workId: string, agreementId: string, extractedSplits: Array<{
1120
1291
  person_id?: string;
1121
1292
  name?: string;
1122
1293
  percentage: number;
1123
1294
  }>, confidence: number, confirm?: boolean): Promise<any>;
1295
+ /**
1296
+ * ADR-289 — mint a per-signer `/sign/<token>` link and email every required
1297
+ * signer of a draft agreement. Every signer lands in exactly one of
1298
+ * `sent`/`skipped` (with a reason) — never silently half-done.
1299
+ */
1300
+ sendForSignature(id: string, params?: {
1301
+ expires_in_days?: number;
1302
+ }): Promise<AgreementSendForSignatureResult>;
1124
1303
  }
1125
1304
  declare class SyncPlacementsResource extends BaseResource {
1126
1305
  list(params?: SyncPlacementQueryParams): Promise<PaginatedResult<SyncPlacement>>;
@@ -1226,6 +1405,9 @@ declare class MemoryResource extends BaseResource {
1226
1405
  type?: string;
1227
1406
  }): Promise<any>;
1228
1407
  delete(id: string): Promise<void>;
1408
+ update(id: string, params: {
1409
+ content: string;
1410
+ }): Promise<any>;
1229
1411
  }
1230
1412
  declare class NotesResource extends BaseResource {
1231
1413
  list(params?: {
@@ -2393,6 +2575,7 @@ declare class SendResource extends BaseResource {
2393
2575
  }>;
2394
2576
  listPending(): Promise<Array<Record<string, unknown>>>;
2395
2577
  resend(id: string): Promise<Record<string, unknown>>;
2578
+ cancel(id: string): Promise<Record<string, unknown>>;
2396
2579
  }
2397
2580
  declare class AssetsResource extends BaseResource {
2398
2581
  list(params?: {
@@ -2678,11 +2861,18 @@ declare class ImportResource extends BaseResource {
2678
2861
  selectedVideoIds?: string[];
2679
2862
  targetWorkId?: string;
2680
2863
  overrideVersionType?: string;
2864
+ /**
2865
+ * ADR-289 Wave B2 item 1 — when true, a video already linked to a
2866
+ * recording in this org has its stats re-fetched and updated
2867
+ * instead of being re-imported as a duplicate.
2868
+ */
2869
+ refresh?: boolean;
2681
2870
  }): Promise<{
2682
2871
  recordingsCreated: number;
2683
2872
  worksCreated: number;
2684
2873
  worksMatched: number;
2685
2874
  multimediaLinked: number;
2875
+ refreshed: number;
2686
2876
  workIds: string[];
2687
2877
  items: Array<{
2688
2878
  videoId: string;
@@ -2690,7 +2880,7 @@ declare class ImportResource extends BaseResource {
2690
2880
  recordingId: string | null;
2691
2881
  versionType: string;
2692
2882
  matched: boolean;
2693
- status: "created" | "skipped" | "error";
2883
+ status: "created" | "skipped" | "refreshed" | "error";
2694
2884
  error?: string;
2695
2885
  }>;
2696
2886
  }>;
@@ -3033,6 +3223,52 @@ declare class ProjectsResource extends BaseResource {
3033
3223
  project_day?: number | null;
3034
3224
  notes?: string | null;
3035
3225
  }): Promise<any>;
3226
+ /**
3227
+ * Detach (remove) a work from a project (ADR-289 Wave B2 item 2 —
3228
+ * `detach` mode on `pica_projects_attach_works`, ports the bespoke
3229
+ * assistant's `remove_work_from_project`). The work itself is not
3230
+ * deleted — only the `project_works` junction row.
3231
+ */
3232
+ detachWork(projectId: string, workId: string): Promise<void>;
3233
+ listParticipants(projectId: string): Promise<any>;
3234
+ addParticipant(projectId: string, data: {
3235
+ person_id: string;
3236
+ role?: string;
3237
+ notes?: string;
3238
+ }): Promise<any>;
3239
+ addParticipantsBulk(projectId: string, participants: Array<{
3240
+ person_id: string;
3241
+ role?: string;
3242
+ notes?: string;
3243
+ }>): Promise<any>;
3244
+ /** `participantId` is the `project_participants` row id. */
3245
+ updateParticipant(projectId: string, participantId: string, data: {
3246
+ role?: string | null;
3247
+ status?: string;
3248
+ notes?: string;
3249
+ }): Promise<any>;
3250
+ /** `personId` — the route's `[participantId]` segment is actually person_id here. */
3251
+ removeParticipant(projectId: string, personId: string): Promise<void>;
3252
+ listMultimedia(projectId: string, day?: number): Promise<any>;
3253
+ addMultimedia(projectId: string, data: {
3254
+ multimedia_id: string;
3255
+ project_day?: number;
3256
+ notes?: string;
3257
+ allow_download?: boolean;
3258
+ }): Promise<any>;
3259
+ addMultimediaBulk(projectId: string, multimediaIds: string[], options?: {
3260
+ project_day?: number;
3261
+ allow_download?: boolean;
3262
+ }): Promise<any>;
3263
+ /** `multimediaLinkId` is the `project_multimedia` join row's own id. */
3264
+ updateMultimediaLink(projectId: string, multimediaLinkId: string, data: {
3265
+ project_day?: number | null;
3266
+ notes?: string | null;
3267
+ display_order?: number;
3268
+ allow_download?: boolean;
3269
+ }): Promise<any>;
3270
+ /** `multimediaId` — the route's `[multimediaId]` segment on DELETE is the underlying multimedia_items id, not the join row id. */
3271
+ removeMultimediaLink(projectId: string, multimediaId: string): Promise<void>;
3036
3272
  }
3037
3273
  declare class SplitSheetsResource extends BaseResource {
3038
3274
  listForWork(workId: string): Promise<any>;
@@ -3754,6 +3990,14 @@ declare class TelegramResource extends BaseResource {
3754
3990
  getStatus(): Promise<any>;
3755
3991
  sendNotification(message: string): Promise<any>;
3756
3992
  getPreferences(): Promise<any>;
3993
+ setPreferences(params: {
3994
+ event_type?: string;
3995
+ is_enabled?: boolean;
3996
+ bulk_config?: Array<{
3997
+ event_type: string;
3998
+ is_enabled: boolean;
3999
+ }>;
4000
+ }): Promise<any>;
3757
4001
  connect(): Promise<any>;
3758
4002
  }
3759
4003
  declare class ImportDocumentsResource extends BaseResource {
@@ -3838,6 +4082,7 @@ export declare class PicaClient {
3838
4082
  people: PeopleResource;
3839
4083
  recordings: RecordingsResource;
3840
4084
  licensing: LicensingResource;
4085
+ bookings: BookingsResource;
3841
4086
  credits: CreditsResource;
3842
4087
  creditsBalance: CreditsBalanceResource;
3843
4088
  picaScore: PicaScoreResource;
@@ -3920,5 +4165,5 @@ export declare class PicaClient {
3920
4165
  catalogStats(): Promise<CatalogStats>;
3921
4166
  constructor(config: PicaClientConfig);
3922
4167
  }
3923
- export type { Work, Person, Recording, PaginatedResult, PicaClientConfig, SyncSearchParams, SyncTrack, SyncSearchResult, LicenseEnquiryInput, LicenseEnquiry, WorkCredit, WorkCreditsInput, PicaScore, PicaScorePillar, AudioFile, AudioAnalysisStatus, PresignedUploadResult, CompleteUploadResult, IdentifyResult, MultimediaItem, Agreement, AgreementWorkLink, SyncPlacement, SyncPlacementSource, SyncPlacementRecording, SyncPlacementWithRelations, SyncPlacementContactInput, SyncPlacementRecordingInput, SyncPlacementSourceInput, CreateSyncPlacementInput, UpdateSyncPlacementInput, SyncPlacementQueryParams, SyncPlacementStatus, SyncPlacementVerificationStatus, SyncPlacementConfidentialityLevel, SyncPlacementSourceKind, CatalogStats, NotificationsSummary, CreateUploadSessionInput, CreateUploadSessionResult, };
4168
+ export type { Work, Person, Recording, PaginatedResult, PicaClientConfig, SyncSearchParams, SyncTrack, SyncSearchResult, LicenseEnquiryInput, LicenseEnquiry, BookingEnquiry, WorkCredit, WorkCreditsInput, PicaScore, PicaScorePillar, AudioFile, AudioAnalysisStatus, PresignedUploadResult, CompleteUploadResult, IdentifyResult, MultimediaItem, Agreement, AgreementWorkLink, AgreementSendForSignatureResult, AgreementSendForSignatureSentEntry, AgreementSendForSignatureSkippedEntry, AgreementSendForSignatureSkipReason, SyncPlacement, SyncPlacementSource, SyncPlacementRecording, SyncPlacementWithRelations, SyncPlacementContactInput, SyncPlacementRecordingInput, SyncPlacementSourceInput, CreateSyncPlacementInput, UpdateSyncPlacementInput, SyncPlacementQueryParams, SyncPlacementStatus, SyncPlacementVerificationStatus, SyncPlacementConfidentialityLevel, SyncPlacementSourceKind, CatalogStats, NotificationsSummary, CreateUploadSessionInput, CreateUploadSessionResult, };
3924
4169
  //# sourceMappingURL=index.d.ts.map