@withpica/mcp-sdk 1.27.0 → 1.28.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,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [1.28.0] - 2026-05-18
15
+
16
+ > Skipped `1.27.1` — that version was a brand-consistency-only publish
17
+ > (description/author fields, no source change) shipped via a parallel
18
+ > branch and never made it into this CHANGELOG. Sister of the
19
+ > `1.23.0 → 1.25.0` and `1.25.0 → 1.27.0` hops noted in the
20
+ > `feedback_npm_publish_chain_order` memory entry.
21
+
22
+ ### Added
23
+
24
+ - **`DashboardResource.actionableItems({ class?, limit? })` (ADR-242, PR #477, 2026-05-18).**
25
+ Backed by `GET /admin/dashboard/actionable-items` — returns per-row shape
26
+ `{class, entity_id, entity_type, entity_label, suggested_skill, urgency_score}`
27
+ sorted by `urgency_score` desc, capped at `limit` (default 20). Drawn from
28
+ the shared `getActionableIssues()` source of truth, so values agree with
29
+ `pica_dashboard_briefing.critical_issues_total` and
30
+ `pica_count_explain.sources[].count` for the same org/moment.
31
+ - **`CountExplainResource.taxonomy()` (ADR-242, PR #477, 2026-05-18).**
32
+ Backed by `GET /admin/count-explain` (no `count_source`) — returns the
33
+ full actionable taxonomy as `sources[]` with `drill_down_skill` named
34
+ per class. Machine-readable routing table for ADR-241's `first-session`
35
+ skill — reads `count_explain.sources[].drill_down_skill` to pick the next step.
36
+ - **`ActionableTaxonomySource` + `ActionableTaxonomyResult` types** —
37
+ `{ name, count, drill_down_skill }` row shape + envelope `{ sources, critical_issues_total }`.
38
+ - **`OpsIssueExplicitKind` union widened with `"tool_failure"` (PR #457, 2026-05-15).**
39
+ Sixth member of the explicit-kind enum on `OpsIssuesResource.reportIssue`,
40
+ alongside `workflow_gap | inconsistent_result | missing_step | data_issue
41
+ | ux_confusion`. Mirrored by a first-ever CHECK constraint on
42
+ `ops_issues.kind` (the column was previously free-text in Postgres).
43
+ Use this kind for SDK / upstream-tool failures the agent decides are
44
+ worth reporting — the fail-quiet wrappers on `pica_submit_feedback` and
45
+ `pica_physical_assets_create` are the canonical callers. Backlogged
46
+ from the `[Unreleased]` block on develop; shipped in this publish.
47
+
14
48
  ## [1.27.0] - 2026-05-13
15
49
 
16
50
  > 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>;
@@ -1235,6 +1289,17 @@ declare class DashboardResource extends BaseResource {
1235
1289
  }): Promise<any>;
1236
1290
  briefing(): Promise<any>;
1237
1291
  pulse(): Promise<any>;
1292
+ /**
1293
+ * ADR-242 — actionable items projection.
1294
+ * Calls /admin/dashboard/actionable-items which is backed by the
1295
+ * shared getActionableIssues() source of truth. Returns per-row shape
1296
+ * with {class, entity_id, entity_type, entity_label, suggested_skill,
1297
+ * urgency_score}, sorted by urgency_score desc, capped at limit.
1298
+ */
1299
+ actionableItems(params?: {
1300
+ class?: string;
1301
+ limit?: number;
1302
+ }): Promise<any>;
1238
1303
  }
1239
1304
  declare class IntegrationsResource extends BaseResource {
1240
1305
  oauthConnections(): Promise<any>;
@@ -1624,7 +1689,7 @@ declare class OpsIssuesResource extends BaseResource {
1624
1689
  * audit trigger can't see.
1625
1690
  */
1626
1691
  reportIssue(params: {
1627
- kind: "workflow_gap" | "inconsistent_result" | "missing_step" | "data_issue" | "ux_confusion";
1692
+ kind: "workflow_gap" | "inconsistent_result" | "missing_step" | "data_issue" | "tool_failure" | "ux_confusion";
1628
1693
  summary: string;
1629
1694
  attempted?: string;
1630
1695
  expected?: string;
@@ -1773,7 +1838,9 @@ declare class ExportResource extends BaseResource {
1773
1838
  catalogCsv(params?: {
1774
1839
  format?: string;
1775
1840
  }): Promise<any>;
1776
- songRegistration(): Promise<any>;
1841
+ songRegistration(params?: {
1842
+ iswc_status?: "missing" | "present" | "all";
1843
+ }): Promise<any>;
1777
1844
  industryReady(): Promise<any>;
1778
1845
  catalogAssetReport(params: {
1779
1846
  sections: {
@@ -2207,6 +2274,178 @@ declare class CollaboratorsResource extends BaseResource {
2207
2274
  error?: string;
2208
2275
  email: string;
2209
2276
  }>>;
2277
+ /**
2278
+ * ADR-236 — preview an active invite by its one-time claim_code.
2279
+ * Returns the proposed credit shape WITHOUT mutating. The preview is
2280
+ * informational; a subsequent acceptByCode() atomically re-resolves and
2281
+ * may return `invite_terms_changed` if the sender modified the row.
2282
+ */
2283
+ previewByCode(code: string): Promise<{
2284
+ invite_id: string;
2285
+ work_id: string;
2286
+ work_title: string | null;
2287
+ credit_type: string;
2288
+ percentage_split: number | null;
2289
+ inviter_display_name: string | null;
2290
+ inviter_org_id: string | null;
2291
+ expires_at: string;
2292
+ claim_code: string | null;
2293
+ }>;
2294
+ /**
2295
+ * ADR-236 — accept an invite by its one-time claim_code. Atomically
2296
+ * re-resolves, writes the work_credit row in the inviter's org scope,
2297
+ * flips status to `confirmed`, and invalidates both invite_token and
2298
+ * claim_code. Throws on `invite_no_longer_valid`, `not_recipient`,
2299
+ * `invalid_code`.
2300
+ */
2301
+ acceptByCode(code: string): Promise<Record<string, unknown>>;
2302
+ /**
2303
+ * ADR-236 — recipient declines an invite by claim_code. Optional reason,
2304
+ * max 500 chars. Emits a discovery event to the inviter's org so the
2305
+ * sender's agent surfaces the decline.
2306
+ */
2307
+ declineByCode(code: string, reason?: string): Promise<Record<string, unknown>>;
2308
+ /**
2309
+ * ADR-236 — sender-side invite-status check. Returns status, claim
2310
+ * attempts, recipient resolution, and confirmed_user_id (if claimed).
2311
+ * One of invite_id or work_id is required.
2312
+ *
2313
+ * ADR-238 — `include_history: true` extends the response with `counters:
2314
+ * CollaborationInviteCounter[]` ordered chronologically. The counter
2315
+ * chain is the auditable negotiation trail.
2316
+ */
2317
+ inviteStatus(params: {
2318
+ invite_id?: string;
2319
+ work_id?: string;
2320
+ include_history?: boolean;
2321
+ }): Promise<Record<string, unknown>>;
2322
+ /**
2323
+ * ADR-238 — recipient proposes a counter on an active invite by code.
2324
+ * Server validates the recipient identity (workspace_email match),
2325
+ * round cap (5 per invite across both directions), and supersedes any
2326
+ * prior pending counter. Inserts a new pending counter; flips invite
2327
+ * to counter_proposed; emits counter_proposed event to sender.
2328
+ */
2329
+ proposeCounter(params: {
2330
+ code: string;
2331
+ credit_type: string;
2332
+ percentage_split: number;
2333
+ message?: string;
2334
+ }): Promise<Record<string, unknown>>;
2335
+ /**
2336
+ * ADR-238 — counter-party accepts a pending counter. Atomically writes
2337
+ * work_collaborators with COUNTER's values, flips counter to accepted,
2338
+ * supersedes earlier counters, flips invite to confirmed.
2339
+ * confirmed_user_id is the original recipient regardless of which
2340
+ * party proposed the accepted counter (credit-bearer invariant).
2341
+ */
2342
+ acceptCounter(counterId: string): Promise<Record<string, unknown>>;
2343
+ /**
2344
+ * ADR-238 — counter-party declines a pending counter. Reverts invite
2345
+ * to pending; the original proposal is implicitly back on the table.
2346
+ */
2347
+ declineCounter(counterId: string, reason?: string): Promise<Record<string, unknown>>;
2348
+ /**
2349
+ * ADR-238 — sender counters-back against a recipient's pending or
2350
+ * declined counter. Supersedes prior pending counters; inserts a new
2351
+ * sender-proposed pending counter; invite stays counter_proposed.
2352
+ * Round-cap counts (5 across both directions).
2353
+ */
2354
+ counterBack(params: {
2355
+ counter_id: string;
2356
+ credit_type: string;
2357
+ percentage_split: number;
2358
+ message?: string;
2359
+ }): Promise<Record<string, unknown>>;
2360
+ /**
2361
+ * ADR-236 — sender revokes a pending invite. Destructive tier — the
2362
+ * MCP layer enforces the two-step confirmation_token gate via
2363
+ * @withpica/mcp-utils; the SDK call assumes confirmation has already
2364
+ * been validated.
2365
+ */
2366
+ revokeInvite(inviteId: string): Promise<Record<string, unknown>>;
2367
+ }
2368
+ /**
2369
+ * ADR-236 — cross-org credit visibility for the recipient. Returns works
2370
+ * the caller is credited on in OTHER organisations.
2371
+ */
2372
+ declare class CollaborationsResource extends BaseResource {
2373
+ received(params?: {
2374
+ limit?: number;
2375
+ offset?: number;
2376
+ }): Promise<{
2377
+ works: Array<{
2378
+ work_id: string;
2379
+ title: string;
2380
+ owner_org_id: string;
2381
+ owner_org_name: string;
2382
+ my_role: string;
2383
+ my_split_percentage: number | null;
2384
+ accepted_at: string | null;
2385
+ collaboration_invite_id: string | null;
2386
+ }>;
2387
+ total: number;
2388
+ }>;
2389
+ }
2390
+ /**
2391
+ * ADR-237 — opt-in public handles + user-authored bio + avatar.
2392
+ * Cross-org discovery surface that lets the sender's agent invite a
2393
+ * collaborator by `@handle` without ever learning the recipient's
2394
+ * email (resolution happens server-side).
2395
+ */
2396
+ declare class UsersResource extends BaseResource {
2397
+ /**
2398
+ * Exact-match handle lookup. Same `{ found: false }` shape for
2399
+ * unclaimed | nonexistent | non-string input — never reveals
2400
+ * "exists but private". On a match, the public profile includes
2401
+ * `handle_accepts_invites` so the caller can decide whether to
2402
+ * proceed with an invite.
2403
+ */
2404
+ findByHandle(handle: string): Promise<{
2405
+ found: true;
2406
+ profile: {
2407
+ handle: string;
2408
+ display_name: string | null;
2409
+ avatar_url: string | null;
2410
+ bio: string | null;
2411
+ handle_accepts_invites: boolean;
2412
+ };
2413
+ } | {
2414
+ found: false;
2415
+ }>;
2416
+ setHandle(handle: string): Promise<{
2417
+ handle: string;
2418
+ }>;
2419
+ clearHandle(): Promise<void>;
2420
+ getMyProfile(): Promise<{
2421
+ user_id: string;
2422
+ workspace_email: string | null;
2423
+ full_name: string | null;
2424
+ public_handle: string | null;
2425
+ handle_accepts_invites: boolean;
2426
+ avatar_url: string | null;
2427
+ bio: string | null;
2428
+ linked_person_id: string | null;
2429
+ }>;
2430
+ setBio(bio: string | null): Promise<{
2431
+ bio: string | null;
2432
+ }>;
2433
+ setAvatarUrl(avatarUrl: string | null): Promise<{
2434
+ avatar_url: string | null;
2435
+ }>;
2436
+ /**
2437
+ * Copy `people.biography` into `user_profiles.bio`. Returns the new
2438
+ * bio on success. On `would_overwrite` (existing bio + overwrite
2439
+ * false), surfaces both the existing and proposed bios so the agent
2440
+ * can present a yes/no to the user before re-calling with
2441
+ * `overwrite: true`.
2442
+ */
2443
+ importBioFromPerson(params?: {
2444
+ overwrite?: boolean;
2445
+ }): Promise<{
2446
+ ok?: true;
2447
+ bio?: string;
2448
+ }>;
2210
2449
  }
2211
2450
  interface DirectorySettings {
2212
2451
  organisation_id: string;
@@ -2340,6 +2579,15 @@ export interface CountExplainResult {
2340
2579
  sample_ids: string[];
2341
2580
  }>;
2342
2581
  }
2582
+ export interface ActionableTaxonomySource {
2583
+ name: string;
2584
+ count: number;
2585
+ drill_down_skill: string | null;
2586
+ }
2587
+ export interface ActionableTaxonomyResult {
2588
+ sources: ActionableTaxonomySource[];
2589
+ critical_issues_total: number;
2590
+ }
2343
2591
  declare class CountExplainResource extends BaseResource {
2344
2592
  /**
2345
2593
  * GET /admin/count-explain — explains a single dashboard / briefing
@@ -2347,6 +2595,14 @@ declare class CountExplainResource extends BaseResource {
2347
2595
  * down the delta against an observed value.
2348
2596
  */
2349
2597
  explain(query: CountExplainQuery): Promise<CountExplainResult>;
2598
+ /**
2599
+ * ADR-242 — GET /admin/count-explain (no count_source)
2600
+ *
2601
+ * Returns the full actionable taxonomy as sources[] with drill_down_skill.
2602
+ * This is the coherence surface that ties pica_dashboard_briefing.critical_issues_total
2603
+ * to the per-class breakdown, making pica_count_explain a machine-readable routing table.
2604
+ */
2605
+ taxonomy(): Promise<ActionableTaxonomyResult>;
2350
2606
  }
2351
2607
  export interface AudioPipelineStatusQuery {
2352
2608
  window_days?: number;
@@ -2813,6 +3069,8 @@ export declare class PicaClient {
2813
3069
  exports: ExportResource;
2814
3070
  duplicates: DuplicatesResource;
2815
3071
  collaborators: CollaboratorsResource;
3072
+ collaborations: CollaborationsResource;
3073
+ users: UsersResource;
2816
3074
  entityContext: EntityContextResource;
2817
3075
  comparisons: ComparisonsResource;
2818
3076
  send: SendResource;