@withpica/mcp-sdk 1.27.0 → 1.27.1

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,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [1.27.1] - 2026-05-16
15
+
16
+ ### Changed
17
+
18
+ - Brand consistency: "PICA" → "withPICA" in package metadata (description, author).
19
+
20
+ ### Added
21
+
22
+ - **`OpsIssueExplicitKind` union widened with `"tool_failure"` (PR #457, 2026-05-15).**
23
+ Sixth member of the explicit-kind enum on `OpsIssuesResource.reportIssue`,
24
+ alongside `workflow_gap | inconsistent_result | missing_step | data_issue
25
+ | ux_confusion`. Mirrored by a first-ever CHECK constraint on
26
+ `ops_issues.kind` (the column was previously free-text in Postgres).
27
+ Use this kind for SDK / upstream-tool failures the agent decides are
28
+ worth reporting — the fail-quiet wrappers on `pica_submit_feedback` and
29
+ `pica_physical_assets_create` are the canonical callers.
30
+
14
31
  ## [1.27.0] - 2026-05-13
15
32
 
16
33
  > Skipped `1.26.0` — that version was claimed by a parallel publish on
package/dist/index.d.ts CHANGED
@@ -663,6 +663,35 @@ declare class WorksResource extends BaseResource {
663
663
  track_number: number;
664
664
  disc_number: number | null;
665
665
  }>>;
666
+ /**
667
+ * Stamp a human-creation provenance attestation. Complement to the
668
+ * AI-disclosure side — captures who signed, when, the attestation
669
+ * method, supporting-evidence flags, and an optional sha256 signature
670
+ * hash (raw signature is never persisted). Writes to the
671
+ * `work_licensing.provenance_attestation` jsonb.
672
+ */
673
+ attest(workId: string, input?: {
674
+ method?: "self_declaration" | "collaborator_verified" | "third_party";
675
+ supporting_evidence?: {
676
+ session_files?: boolean;
677
+ stems_available?: boolean;
678
+ creation_timeline?: boolean;
679
+ witness_collaborators?: string[];
680
+ };
681
+ signature?: string;
682
+ }): Promise<{
683
+ work_id: string;
684
+ attestation: {
685
+ human_created: boolean;
686
+ attested_by: string;
687
+ attested_at: string;
688
+ attestation_method: string | null;
689
+ supporting_evidence: Record<string, unknown>;
690
+ ip_address?: string;
691
+ signature_hash?: string;
692
+ certificate_id?: string;
693
+ } | null;
694
+ }>;
666
695
  }
667
696
  declare class PeopleResource extends BaseResource {
668
697
  list(params?: {
@@ -739,6 +768,31 @@ declare class CreditsResource extends BaseResource {
739
768
  * semantics — never leaks 404 vs 403 via latency).
740
769
  */
741
770
  atomicRemove(workId: string, creditId: string): Promise<AtomicCreditResult>;
771
+ /**
772
+ * Send pending credits on a work to their recipients for attestation.
773
+ * Lightweight alternative to pica_split_sheet_send — fans out the
774
+ * notification rails (in-app + telegram + email) without generating
775
+ * a formal split-sheet document. Recipients click through to
776
+ * confirm/dispute; this call only sends the prompt.
777
+ */
778
+ sendForAttestation(workId: string, input?: {
779
+ credit_ids?: string[];
780
+ reminder_type?: "initial" | "reminder";
781
+ }): Promise<{
782
+ sent: number;
783
+ failed: number;
784
+ results: Array<{
785
+ person_id: string;
786
+ person_name?: string;
787
+ delivered: boolean;
788
+ reason?: string;
789
+ channels?: {
790
+ in_app: boolean;
791
+ telegram: boolean;
792
+ email: boolean;
793
+ };
794
+ }>;
795
+ }>;
742
796
  }
743
797
  declare class CreditsBalanceResource extends BaseResource {
744
798
  getBalance(): Promise<any>;
@@ -1624,7 +1678,7 @@ declare class OpsIssuesResource extends BaseResource {
1624
1678
  * audit trigger can't see.
1625
1679
  */
1626
1680
  reportIssue(params: {
1627
- kind: "workflow_gap" | "inconsistent_result" | "missing_step" | "data_issue" | "ux_confusion";
1681
+ kind: "workflow_gap" | "inconsistent_result" | "missing_step" | "data_issue" | "tool_failure" | "ux_confusion";
1628
1682
  summary: string;
1629
1683
  attempted?: string;
1630
1684
  expected?: string;
@@ -1773,7 +1827,9 @@ declare class ExportResource extends BaseResource {
1773
1827
  catalogCsv(params?: {
1774
1828
  format?: string;
1775
1829
  }): Promise<any>;
1776
- songRegistration(): Promise<any>;
1830
+ songRegistration(params?: {
1831
+ iswc_status?: "missing" | "present" | "all";
1832
+ }): Promise<any>;
1777
1833
  industryReady(): Promise<any>;
1778
1834
  catalogAssetReport(params: {
1779
1835
  sections: {
@@ -2207,6 +2263,178 @@ declare class CollaboratorsResource extends BaseResource {
2207
2263
  error?: string;
2208
2264
  email: string;
2209
2265
  }>>;
2266
+ /**
2267
+ * ADR-236 — preview an active invite by its one-time claim_code.
2268
+ * Returns the proposed credit shape WITHOUT mutating. The preview is
2269
+ * informational; a subsequent acceptByCode() atomically re-resolves and
2270
+ * may return `invite_terms_changed` if the sender modified the row.
2271
+ */
2272
+ previewByCode(code: string): Promise<{
2273
+ invite_id: string;
2274
+ work_id: string;
2275
+ work_title: string | null;
2276
+ credit_type: string;
2277
+ percentage_split: number | null;
2278
+ inviter_display_name: string | null;
2279
+ inviter_org_id: string | null;
2280
+ expires_at: string;
2281
+ claim_code: string | null;
2282
+ }>;
2283
+ /**
2284
+ * ADR-236 — accept an invite by its one-time claim_code. Atomically
2285
+ * re-resolves, writes the work_credit row in the inviter's org scope,
2286
+ * flips status to `confirmed`, and invalidates both invite_token and
2287
+ * claim_code. Throws on `invite_no_longer_valid`, `not_recipient`,
2288
+ * `invalid_code`.
2289
+ */
2290
+ acceptByCode(code: string): Promise<Record<string, unknown>>;
2291
+ /**
2292
+ * ADR-236 — recipient declines an invite by claim_code. Optional reason,
2293
+ * max 500 chars. Emits a discovery event to the inviter's org so the
2294
+ * sender's agent surfaces the decline.
2295
+ */
2296
+ declineByCode(code: string, reason?: string): Promise<Record<string, unknown>>;
2297
+ /**
2298
+ * ADR-236 — sender-side invite-status check. Returns status, claim
2299
+ * attempts, recipient resolution, and confirmed_user_id (if claimed).
2300
+ * One of invite_id or work_id is required.
2301
+ *
2302
+ * ADR-238 — `include_history: true` extends the response with `counters:
2303
+ * CollaborationInviteCounter[]` ordered chronologically. The counter
2304
+ * chain is the auditable negotiation trail.
2305
+ */
2306
+ inviteStatus(params: {
2307
+ invite_id?: string;
2308
+ work_id?: string;
2309
+ include_history?: boolean;
2310
+ }): Promise<Record<string, unknown>>;
2311
+ /**
2312
+ * ADR-238 — recipient proposes a counter on an active invite by code.
2313
+ * Server validates the recipient identity (workspace_email match),
2314
+ * round cap (5 per invite across both directions), and supersedes any
2315
+ * prior pending counter. Inserts a new pending counter; flips invite
2316
+ * to counter_proposed; emits counter_proposed event to sender.
2317
+ */
2318
+ proposeCounter(params: {
2319
+ code: string;
2320
+ credit_type: string;
2321
+ percentage_split: number;
2322
+ message?: string;
2323
+ }): Promise<Record<string, unknown>>;
2324
+ /**
2325
+ * ADR-238 — counter-party accepts a pending counter. Atomically writes
2326
+ * work_collaborators with COUNTER's values, flips counter to accepted,
2327
+ * supersedes earlier counters, flips invite to confirmed.
2328
+ * confirmed_user_id is the original recipient regardless of which
2329
+ * party proposed the accepted counter (credit-bearer invariant).
2330
+ */
2331
+ acceptCounter(counterId: string): Promise<Record<string, unknown>>;
2332
+ /**
2333
+ * ADR-238 — counter-party declines a pending counter. Reverts invite
2334
+ * to pending; the original proposal is implicitly back on the table.
2335
+ */
2336
+ declineCounter(counterId: string, reason?: string): Promise<Record<string, unknown>>;
2337
+ /**
2338
+ * ADR-238 — sender counters-back against a recipient's pending or
2339
+ * declined counter. Supersedes prior pending counters; inserts a new
2340
+ * sender-proposed pending counter; invite stays counter_proposed.
2341
+ * Round-cap counts (5 across both directions).
2342
+ */
2343
+ counterBack(params: {
2344
+ counter_id: string;
2345
+ credit_type: string;
2346
+ percentage_split: number;
2347
+ message?: string;
2348
+ }): Promise<Record<string, unknown>>;
2349
+ /**
2350
+ * ADR-236 — sender revokes a pending invite. Destructive tier — the
2351
+ * MCP layer enforces the two-step confirmation_token gate via
2352
+ * @withpica/mcp-utils; the SDK call assumes confirmation has already
2353
+ * been validated.
2354
+ */
2355
+ revokeInvite(inviteId: string): Promise<Record<string, unknown>>;
2356
+ }
2357
+ /**
2358
+ * ADR-236 — cross-org credit visibility for the recipient. Returns works
2359
+ * the caller is credited on in OTHER organisations.
2360
+ */
2361
+ declare class CollaborationsResource extends BaseResource {
2362
+ received(params?: {
2363
+ limit?: number;
2364
+ offset?: number;
2365
+ }): Promise<{
2366
+ works: Array<{
2367
+ work_id: string;
2368
+ title: string;
2369
+ owner_org_id: string;
2370
+ owner_org_name: string;
2371
+ my_role: string;
2372
+ my_split_percentage: number | null;
2373
+ accepted_at: string | null;
2374
+ collaboration_invite_id: string | null;
2375
+ }>;
2376
+ total: number;
2377
+ }>;
2378
+ }
2379
+ /**
2380
+ * ADR-237 — opt-in public handles + user-authored bio + avatar.
2381
+ * Cross-org discovery surface that lets the sender's agent invite a
2382
+ * collaborator by `@handle` without ever learning the recipient's
2383
+ * email (resolution happens server-side).
2384
+ */
2385
+ declare class UsersResource extends BaseResource {
2386
+ /**
2387
+ * Exact-match handle lookup. Same `{ found: false }` shape for
2388
+ * unclaimed | nonexistent | non-string input — never reveals
2389
+ * "exists but private". On a match, the public profile includes
2390
+ * `handle_accepts_invites` so the caller can decide whether to
2391
+ * proceed with an invite.
2392
+ */
2393
+ findByHandle(handle: string): Promise<{
2394
+ found: true;
2395
+ profile: {
2396
+ handle: string;
2397
+ display_name: string | null;
2398
+ avatar_url: string | null;
2399
+ bio: string | null;
2400
+ handle_accepts_invites: boolean;
2401
+ };
2402
+ } | {
2403
+ found: false;
2404
+ }>;
2405
+ setHandle(handle: string): Promise<{
2406
+ handle: string;
2407
+ }>;
2408
+ clearHandle(): Promise<void>;
2409
+ getMyProfile(): Promise<{
2410
+ user_id: string;
2411
+ workspace_email: string | null;
2412
+ full_name: string | null;
2413
+ public_handle: string | null;
2414
+ handle_accepts_invites: boolean;
2415
+ avatar_url: string | null;
2416
+ bio: string | null;
2417
+ linked_person_id: string | null;
2418
+ }>;
2419
+ setBio(bio: string | null): Promise<{
2420
+ bio: string | null;
2421
+ }>;
2422
+ setAvatarUrl(avatarUrl: string | null): Promise<{
2423
+ avatar_url: string | null;
2424
+ }>;
2425
+ /**
2426
+ * Copy `people.biography` into `user_profiles.bio`. Returns the new
2427
+ * bio on success. On `would_overwrite` (existing bio + overwrite
2428
+ * false), surfaces both the existing and proposed bios so the agent
2429
+ * can present a yes/no to the user before re-calling with
2430
+ * `overwrite: true`.
2431
+ */
2432
+ importBioFromPerson(params?: {
2433
+ overwrite?: boolean;
2434
+ }): Promise<{
2435
+ ok?: true;
2436
+ bio?: string;
2437
+ }>;
2210
2438
  }
2211
2439
  interface DirectorySettings {
2212
2440
  organisation_id: string;
@@ -2813,6 +3041,8 @@ export declare class PicaClient {
2813
3041
  exports: ExportResource;
2814
3042
  duplicates: DuplicatesResource;
2815
3043
  collaborators: CollaboratorsResource;
3044
+ collaborations: CollaborationsResource;
3045
+ users: UsersResource;
2816
3046
  entityContext: EntityContextResource;
2817
3047
  comparisons: ComparisonsResource;
2818
3048
  send: SendResource;