@withpica/mcp-server 2.56.0 → 2.57.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.
Files changed (93) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +9 -9
  3. package/dist/lib/changelog.generated.d.ts +2 -2
  4. package/dist/lib/changelog.generated.d.ts.map +1 -1
  5. package/dist/lib/changelog.generated.js +2 -2
  6. package/dist/lib/changelog.generated.js.map +1 -1
  7. package/dist/prompts/index.js +1 -1
  8. package/dist/prompts/index.js.map +1 -1
  9. package/dist/resources/index.d.ts.map +1 -1
  10. package/dist/resources/index.js +5 -0
  11. package/dist/resources/index.js.map +1 -1
  12. package/dist/resources/required-schemas.generated.d.ts +13 -1
  13. package/dist/resources/required-schemas.generated.d.ts.map +1 -1
  14. package/dist/resources/required-schemas.generated.js +23 -1
  15. package/dist/resources/required-schemas.generated.js.map +1 -1
  16. package/dist/resources/required-schemas.source.d.ts.map +1 -1
  17. package/dist/resources/required-schemas.source.js +17 -1
  18. package/dist/resources/required-schemas.source.js.map +1 -1
  19. package/dist/server-instructions.d.ts +4 -3
  20. package/dist/server-instructions.d.ts.map +1 -1
  21. package/dist/server-instructions.js +4 -1
  22. package/dist/server-instructions.js.map +1 -1
  23. package/dist/server.js +2 -2
  24. package/dist/skills/skills.generated.d.ts.map +1 -1
  25. package/dist/skills/skills.generated.js +11 -2
  26. package/dist/skills/skills.generated.js.map +1 -1
  27. package/dist/tools/agreement-types.d.ts.map +1 -1
  28. package/dist/tools/agreement-types.js +5 -1
  29. package/dist/tools/agreement-types.js.map +1 -1
  30. package/dist/tools/analytics.d.ts.map +1 -1
  31. package/dist/tools/analytics.js +6 -7
  32. package/dist/tools/analytics.js.map +1 -1
  33. package/dist/tools/assets.d.ts.map +1 -1
  34. package/dist/tools/assets.js +34 -2
  35. package/dist/tools/assets.js.map +1 -1
  36. package/dist/tools/collaborations.d.ts +19 -0
  37. package/dist/tools/collaborations.d.ts.map +1 -0
  38. package/dist/tools/collaborations.js +45 -0
  39. package/dist/tools/collaborations.js.map +1 -0
  40. package/dist/tools/collaborators.d.ts +8 -0
  41. package/dist/tools/collaborators.d.ts.map +1 -1
  42. package/dist/tools/collaborators.js +345 -8
  43. package/dist/tools/collaborators.js.map +1 -1
  44. package/dist/tools/credits.d.ts +1 -0
  45. package/dist/tools/credits.d.ts.map +1 -1
  46. package/dist/tools/credits.js +110 -1
  47. package/dist/tools/credits.js.map +1 -1
  48. package/dist/tools/dashboard.d.ts.map +1 -1
  49. package/dist/tools/dashboard.js +59 -7
  50. package/dist/tools/dashboard.js.map +1 -1
  51. package/dist/tools/discovery.d.ts.map +1 -1
  52. package/dist/tools/discovery.js +26 -1
  53. package/dist/tools/discovery.js.map +1 -1
  54. package/dist/tools/explainability.d.ts.map +1 -1
  55. package/dist/tools/explainability.js +43 -15
  56. package/dist/tools/explainability.js.map +1 -1
  57. package/dist/tools/exports.d.ts.map +1 -1
  58. package/dist/tools/exports.js +14 -4
  59. package/dist/tools/exports.js.map +1 -1
  60. package/dist/tools/feedback.d.ts.map +1 -1
  61. package/dist/tools/feedback.js +70 -26
  62. package/dist/tools/feedback.js.map +1 -1
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +46 -2
  65. package/dist/tools/index.js.map +1 -1
  66. package/dist/tools/metadata.d.ts.map +1 -1
  67. package/dist/tools/metadata.js +115 -0
  68. package/dist/tools/metadata.js.map +1 -1
  69. package/dist/tools/onboarding.js +2 -2
  70. package/dist/tools/onboarding.js.map +1 -1
  71. package/dist/tools/recovery-hints.d.ts.map +1 -1
  72. package/dist/tools/recovery-hints.js +164 -0
  73. package/dist/tools/recovery-hints.js.map +1 -1
  74. package/dist/tools/report-issue.d.ts.map +1 -1
  75. package/dist/tools/report-issue.js +1 -0
  76. package/dist/tools/report-issue.js.map +1 -1
  77. package/dist/tools/settings.js +3 -3
  78. package/dist/tools/settings.js.map +1 -1
  79. package/dist/tools/split-sheets.d.ts.map +1 -1
  80. package/dist/tools/split-sheets.js +19 -2
  81. package/dist/tools/split-sheets.js.map +1 -1
  82. package/dist/tools/telegram.js +1 -1
  83. package/dist/tools/telegram.js.map +1 -1
  84. package/dist/tools/users.d.ts +38 -0
  85. package/dist/tools/users.d.ts.map +1 -0
  86. package/dist/tools/users.js +192 -0
  87. package/dist/tools/users.js.map +1 -0
  88. package/dist/tools/works.d.ts +6 -0
  89. package/dist/tools/works.d.ts.map +1 -1
  90. package/dist/tools/works.js +112 -5
  91. package/dist/tools/works.js.map +1 -1
  92. package/package.json +8 -5
  93. package/server.json +2 -2
@@ -12,7 +12,7 @@ export class CollaboratorsTools {
12
12
  name: "pica_collaborators_invite",
13
13
  tier: "write",
14
14
  description: "Use when the user asks: 'let's notify the people on this song', 'ask everyone to verify', 'get my collaborators to confirm'. " +
15
- "Invite a collaborator to a work by email. Creates the person if they don't exist, sends an invite email, and sets up their credit on the work. Requires the work ID, person details (name + email), the inviter's person ID, and credit details.",
15
+ "Invite a collaborator to a work. Pass EITHER `email` (direct) OR `handle` (PICA public handle, cross-org) — when `handle` is set, PICA resolves to the recipient's email server-side; the sender's agent never learns the email. Creates the person if they don't exist, sends an invite email, and sets up their credit on the work.",
16
16
  workflows: "infrastructure",
17
17
  vernacular_kind: "creator-entry",
18
18
  inputSchema: {
@@ -28,7 +28,11 @@ export class CollaboratorsTools {
28
28
  },
29
29
  email: {
30
30
  type: "string",
31
- description: "Email address of the collaborator",
31
+ description: "Email address of the collaborator. Either this OR `handle` must be set. When `handle` is set, leave this empty — PICA resolves server-side.",
32
+ },
33
+ handle: {
34
+ type: "string",
35
+ description: "PICA public handle (e.g. 'josh-allen'). Resolved server-side to the recipient's email — sender's agent never learns the email. Use `pica_users_find_by_handle` first to confirm the handle and the recipient's `handle_accepts_invites` flag. Either this OR `email` must be set.",
32
36
  },
33
37
  role: {
34
38
  type: "string",
@@ -47,7 +51,7 @@ export class CollaboratorsTools {
47
51
  description: "Percentage split for this credit (0-100)",
48
52
  },
49
53
  },
50
- required: ["work_id", "name", "email", "invited_by", "credit_type"],
54
+ required: ["work_id", "invited_by", "credit_type"],
51
55
  },
52
56
  },
53
57
  executor: this.inviteCollaborator.bind(this),
@@ -253,14 +257,252 @@ export class CollaboratorsTools {
253
257
  },
254
258
  executor: this.resendInvite.bind(this),
255
259
  },
260
+ // ADR-236 — code-based recipient claim / decline + sender status/revoke
261
+ {
262
+ definition: {
263
+ name: "pica_collaborators_claim_by_code",
264
+ tier: "write",
265
+ description: "Use when the user asks: 'I have a code from someone', 'accept the invite ABCD-23N7', 'preview the invite, then accept'. " +
266
+ "Recipient-side: preview or accept a collaboration invite by its one-time claim code (8 chars, hyphen-grouped for display). " +
267
+ "Call with `accept: false` first to see the proposed credit; call again with `accept: true` to confirm. The accept call atomically re-resolves the code, so the preview is informational only.",
268
+ workflows: "infrastructure",
269
+ vernacular_kind: "creator-entry",
270
+ inputSchema: {
271
+ type: "object",
272
+ properties: {
273
+ code: {
274
+ type: "string",
275
+ description: "8-char claim code (hyphenated form like DKZH-4N7P is fine; normalised server-side)",
276
+ },
277
+ accept: {
278
+ type: "boolean",
279
+ description: "false (default) → preview only, no mutation; true → atomically accept the invite and write the work_credits row in the inviter's org scope.",
280
+ },
281
+ },
282
+ required: ["code"],
283
+ },
284
+ },
285
+ executor: this.claimByCode.bind(this),
286
+ },
287
+ {
288
+ definition: {
289
+ name: "pica_collaborators_decline_by_code",
290
+ tier: "write",
291
+ description: "Use when the user asks: 'decline the invite ABCD-23N7', 'I don't want this credit'. " +
292
+ "Recipient-side: decline a collaboration invite by claim code. Optional free-text reason (max 500 chars) — surfaced to the sender via discovery event.",
293
+ workflows: "infrastructure",
294
+ vernacular_kind: "creator-entry",
295
+ inputSchema: {
296
+ type: "object",
297
+ properties: {
298
+ code: {
299
+ type: "string",
300
+ description: "8-char claim code",
301
+ },
302
+ reason: {
303
+ type: "string",
304
+ description: "Optional free-text reason for declining (max 500 chars). Sent to the inviter; helps avoid re-invitation loops.",
305
+ },
306
+ },
307
+ required: ["code"],
308
+ },
309
+ },
310
+ executor: this.declineByCode.bind(this),
311
+ },
312
+ {
313
+ definition: {
314
+ name: "pica_collaborators_invite_status",
315
+ tier: "read",
316
+ description: "Use when the user asks: 'has Josh accepted yet?', 'what's the status of the invite I just sent?', 'when does that invite expire?', 'show me the negotiation history on that invite'. " +
317
+ "Sender-side: look up the status of a collaboration invite. One of invite_id or work_id is required; with work_id only, returns the most recently created invite for that work. Pass include_history: true to also return the chronological counter-proposal chain (the auditable negotiation trail).",
318
+ workflows: "infrastructure",
319
+ vernacular_kind: "creator-entry",
320
+ inputSchema: {
321
+ type: "object",
322
+ properties: {
323
+ invite_id: {
324
+ type: "string",
325
+ description: "The invite ID to look up",
326
+ },
327
+ work_id: {
328
+ type: "string",
329
+ description: "Work ID — returns the most recently created invite for this work in the caller's org",
330
+ },
331
+ include_history: {
332
+ type: "boolean",
333
+ default: false,
334
+ description: "When true, response includes `counters` — the chronological counter-proposal chain (each entry: proposed_by_user_id, proposed_at, credit_type, percentage_split, message, status, decided_at, decided_by_user_id). Defaults to false for backwards compatibility.",
335
+ },
336
+ },
337
+ },
338
+ },
339
+ executor: this.inviteStatus.bind(this),
340
+ },
341
+ {
342
+ definition: {
343
+ name: "pica_collaborators_invite_revoke",
344
+ tier: "destructive",
345
+ description: "Use when the user asks: 'cancel that invite', 'revoke the invite I just sent', 'pull the invite to Josh'. " +
346
+ "Sender-side: revoke a pending collaboration invite. Two-step destructive — first call returns a confirmation_token + summary, second call with that token flips status to revoked and invalidates both the URL and the code. " +
347
+ "Notifies an existing-user recipient via discovery event so their agent surfaces the revocation on next prompt.",
348
+ workflows: "infrastructure",
349
+ vernacular_kind: "creator-entry",
350
+ inputSchema: {
351
+ type: "object",
352
+ properties: {
353
+ invite_id: {
354
+ type: "string",
355
+ description: "The invite ID to revoke",
356
+ },
357
+ confirmation_token: {
358
+ type: "string",
359
+ description: "Second-call confirmation token returned by the first call. Required to actually mutate.",
360
+ },
361
+ },
362
+ required: ["invite_id"],
363
+ },
364
+ },
365
+ executor: this.revokeInvite.bind(this),
366
+ },
367
+ // ADR-238 — agent-mediated counter-proposals on collaboration invites
368
+ {
369
+ definition: {
370
+ name: "pica_collaborators_counter_propose",
371
+ tier: "write",
372
+ description: "Use when the user asks: 'I want 40 not 50', 'counter that invite at 35 percent', 'propose a different split on the invite from Josh'. " +
373
+ "Recipient-side: counter-propose new terms on an active invite by its claim code. Pass the new credit_type, percentage_split, and an optional short message. The sender is notified; they can accept_counter, decline_counter, or counter_back. Round cap: 5 counters per invite across both directions.",
374
+ workflows: "infrastructure",
375
+ vernacular_kind: "creator-entry",
376
+ inputSchema: {
377
+ type: "object",
378
+ properties: {
379
+ code: {
380
+ type: "string",
381
+ description: "8-char claim code from the invite (hyphenated form like DKZH-4N7P is fine; normalised server-side)",
382
+ },
383
+ credit_type: {
384
+ type: "string",
385
+ description: "The counter-proposed credit role (writer, composer, lyricist, arranger, producer, performer, engineer, etc.). May differ from the original.",
386
+ },
387
+ percentage_split: {
388
+ type: "number",
389
+ description: "Counter-proposed split, 0-100",
390
+ },
391
+ message: {
392
+ type: "string",
393
+ description: "Optional free-text reasoning (max 500 chars). Surfaced to the sender alongside the counter values.",
394
+ },
395
+ },
396
+ required: ["code", "credit_type", "percentage_split"],
397
+ },
398
+ },
399
+ executor: this.proposeCounter.bind(this),
400
+ },
401
+ {
402
+ definition: {
403
+ name: "pica_collaborators_accept_counter",
404
+ tier: "write",
405
+ description: "Use when the user asks: 'accept their counter', 'yes, agree to 40 percent', 'take the counter from Josh'. " +
406
+ "Counter-party-side: accept the pending counter — atomically writes the work_credit using the counter's values (not the original invite's), supersedes earlier counters, and confirms the invite. The original recipient remains the credit-bearer regardless of which party proposed the accepted counter.",
407
+ workflows: "infrastructure",
408
+ vernacular_kind: "creator-entry",
409
+ inputSchema: {
410
+ type: "object",
411
+ properties: {
412
+ counter_id: {
413
+ type: "string",
414
+ description: "UUID of the pending counter to accept (returned by counter_propose / counter_back; also surfaced in pica_collaborators_invite_status with include_history)",
415
+ },
416
+ },
417
+ required: ["counter_id"],
418
+ },
419
+ },
420
+ executor: this.acceptCounter.bind(this),
421
+ },
422
+ {
423
+ definition: {
424
+ name: "pica_collaborators_decline_counter",
425
+ tier: "write",
426
+ description: "Use when the user asks: 'decline that counter', 'no, 35 is too low', 'reject the counter from Josh'. " +
427
+ "Counter-party-side: decline the pending counter. The invite reverts to pending — the original proposal is implicitly back on the table. Either party may then act again (counter_back, accept original via claim_by_code, revoke, etc.). Optional reason (max 500 chars) is surfaced to the proposer.",
428
+ workflows: "infrastructure",
429
+ vernacular_kind: "creator-entry",
430
+ inputSchema: {
431
+ type: "object",
432
+ properties: {
433
+ counter_id: {
434
+ type: "string",
435
+ description: "UUID of the pending counter to decline",
436
+ },
437
+ reason: {
438
+ type: "string",
439
+ description: "Optional free-text reason (max 500 chars). Surfaced to the proposer via discovery event.",
440
+ },
441
+ },
442
+ required: ["counter_id"],
443
+ },
444
+ },
445
+ executor: this.declineCounter.bind(this),
446
+ },
447
+ {
448
+ definition: {
449
+ name: "pica_collaborators_counter_back",
450
+ tier: "write",
451
+ description: "Use when the user asks: 'counter back at 45', 'meet them halfway, propose 45 percent', 'come back at 42'. " +
452
+ "Sender-side: respond to a recipient's pending or declined counter with a new sender-proposed counter. Supersedes the prior counter, inserts a new pending counter, and notifies the recipient. Round cap: 5 counters per invite across both directions.",
453
+ workflows: "infrastructure",
454
+ vernacular_kind: "creator-entry",
455
+ inputSchema: {
456
+ type: "object",
457
+ properties: {
458
+ counter_id: {
459
+ type: "string",
460
+ description: "UUID of the recipient's counter to respond to (pending or recently declined)",
461
+ },
462
+ credit_type: {
463
+ type: "string",
464
+ description: "Sender's new proposed credit role (writer, composer, producer, etc.)",
465
+ },
466
+ percentage_split: {
467
+ type: "number",
468
+ description: "Sender's new proposed split, 0-100",
469
+ },
470
+ message: {
471
+ type: "string",
472
+ description: "Optional free-text reasoning (max 500 chars). Surfaced to the recipient alongside the counter values.",
473
+ },
474
+ },
475
+ required: ["counter_id", "credit_type", "percentage_split"],
476
+ },
477
+ },
478
+ executor: this.counterBack.bind(this),
479
+ },
256
480
  ];
257
481
  }
258
482
  async inviteCollaborator(args) {
259
- const result = await this.pica.collaborators.invite({
483
+ // ADR-237: discriminated-union recipient. Exactly one of `handle`
484
+ // or `email` must be set. When `handle` is set, the SDK forwards
485
+ // it to the route handler which resolves to email server-side.
486
+ const handle = typeof args.handle === "string" && args.handle.trim() !== ""
487
+ ? args.handle.trim()
488
+ : null;
489
+ const email = typeof args.email === "string" && args.email.trim() !== ""
490
+ ? args.email.trim()
491
+ : null;
492
+ if (handle && email) {
493
+ throw new Error("Pass either `handle` or `email`, not both. Use `handle` for ADR-237 cross-org discovery (PICA resolves to email server-side).");
494
+ }
495
+ if (!handle && !email) {
496
+ throw new Error("One of `handle` or `email` is required.");
497
+ }
498
+ const inviteParams = {
260
499
  workId: args.work_id,
261
500
  personData: {
262
501
  name: args.name,
263
- email: args.email,
502
+ // Email is intentionally omitted when handle is the source —
503
+ // sendInvite resolves via handleService and splices in the
504
+ // canonical workspace_email.
505
+ ...(email ? { email } : {}),
264
506
  role: args.role,
265
507
  },
266
508
  invitedBy: args.invited_by,
@@ -268,15 +510,40 @@ export class CollaboratorsTools {
268
510
  credit_type: args.credit_type,
269
511
  percentage_split: args.percentage_split,
270
512
  },
271
- });
513
+ };
514
+ if (handle) {
515
+ inviteParams.recipient = { kind: "handle", value: handle };
516
+ }
517
+ else if (email) {
518
+ inviteParams.recipient = { kind: "email", value: email };
519
+ }
520
+ const result = await this.pica.collaborators.invite(inviteParams);
272
521
  const hints = [
273
522
  {
274
523
  gap: "collaborator_missing_identifiers",
275
- suggestion: `Enrich ${args.name} with ISNI or IPI for royalty collection (pica_resolve_person)`,
524
+ suggestion: `Enrich ${args.name ?? "the recipient"} with ISNI or IPI for royalty collection (pica_resolve_person)`,
276
525
  severity: "important",
277
526
  },
278
527
  ];
279
- return formatSuccess(`Invite sent to ${args.name} (${args.email}) for credit "${args.credit_type}" on work ${args.work_id}.`, result, hints);
528
+ // ADR-237: when handle was the source, never echo email back in
529
+ // the success message — the sender's agent must not learn the
530
+ // recipient's email. The route handler is responsible for
531
+ // stripping email from `result` too; we belt-and-brace at the
532
+ // tool layer.
533
+ const recipientLabel = handle
534
+ ? `@${handle}`
535
+ : `${args.name ?? "recipient"} (${email})`;
536
+ if (handle && result && typeof result === "object") {
537
+ // Defensive scrub of common email fields the underlying invite
538
+ // payload may carry. Display fields (handle, display_name)
539
+ // stay; PII does not.
540
+ const r = result;
541
+ delete r.email;
542
+ if (r.person_data && typeof r.person_data === "object") {
543
+ delete r.person_data.email;
544
+ }
545
+ }
546
+ return formatSuccess(`Invite sent to ${recipientLabel} for credit "${args.credit_type}" on work ${args.work_id}.`, result, hints);
280
547
  }
281
548
  async listInvites(args) {
282
549
  // ADR-157 sub-step 4b (superseded form): the original plan surfaced
@@ -398,5 +665,75 @@ export class CollaboratorsTools {
398
665
  const failCount = results.length - okCount;
399
666
  return formatSuccess(`Bulk invite complete: ${okCount} sent, ${failCount} failed.`, { results, ok: okCount, failed: failCount });
400
667
  }
668
+ // ADR-236 — code-based recipient claim / decline + sender status/revoke
669
+ async claimByCode(args) {
670
+ const accept = args.accept === true;
671
+ if (!accept) {
672
+ const preview = await this.pica.collaborators.previewByCode(args.code);
673
+ return formatSuccess(`Invite preview for code ${args.code}: "${preview.work_title ?? "(work)"}" — ${preview.credit_type}${preview.percentage_split ? ` at ${preview.percentage_split}%` : ""} from ${preview.inviter_display_name ?? "the inviter"}. Call again with accept=true to confirm.`, preview);
674
+ }
675
+ const result = await this.pica.collaborators.acceptByCode(args.code);
676
+ const hints = [
677
+ {
678
+ gap: "credit_attested",
679
+ suggestion: "Your credit is now live on the inviter's work. Use pica_collaborations_received to see all works you're credited on across orgs.",
680
+ severity: "nice_to_have",
681
+ },
682
+ ];
683
+ return formatSuccess(`Invite claimed by code ${args.code}. Credit written in the inviter's catalog.`, result, hints);
684
+ }
685
+ async declineByCode(args) {
686
+ const result = await this.pica.collaborators.declineByCode(args.code, args.reason);
687
+ return formatSuccess(`Invite declined by code ${args.code}. The inviter's agent will surface the decline on their next prompt.`, result);
688
+ }
689
+ async inviteStatus(args) {
690
+ const result = await this.pica.collaborators.inviteStatus({
691
+ invite_id: args.invite_id,
692
+ work_id: args.work_id,
693
+ include_history: args.include_history === true,
694
+ });
695
+ return formatSuccess(`Invite status retrieved.`, result);
696
+ }
697
+ async revokeInvite(args) {
698
+ // The two-step confirmation_token gate is enforced upstream in the
699
+ // tool dispatcher (mcp-server/src/tools/index.ts) for any tool with
700
+ // tier: "destructive". By the time this executor runs, the token has
701
+ // been validated and consumed; we just do the mutation.
702
+ const result = await this.pica.collaborators.revokeInvite(args.invite_id);
703
+ return formatSuccess(`Invite ${args.invite_id} revoked. Both URL and code claim paths are dead.`, result);
704
+ }
705
+ // ADR-238 — counter-proposal executors. Each delegates to the matching
706
+ // SDK method, which POSTs to the corresponding /counters/* route. Error
707
+ // mapping (invalid_code / not_recipient / not_counter_party /
708
+ // counter_no_longer_pending / counter_not_actionable / not_sender /
709
+ // invite_no_longer_valid / negotiation_limit_reached) is owned by the
710
+ // routes; recovery hints in mcp-server/src/tools/recovery-hints.ts pair
711
+ // each error_code with an agent-friendly suggestion + next_tool.
712
+ async proposeCounter(args) {
713
+ const result = await this.pica.collaborators.proposeCounter({
714
+ code: args.code,
715
+ credit_type: args.credit_type,
716
+ percentage_split: args.percentage_split,
717
+ message: args.message,
718
+ });
719
+ return formatSuccess(`Counter proposed on invite (${args.credit_type} · ${args.percentage_split}%). The sender has been notified — they can accept, decline, or counter back.`, result);
720
+ }
721
+ async acceptCounter(args) {
722
+ const result = await this.pica.collaborators.acceptCounter(args.counter_id);
723
+ return formatSuccess(`Counter ${args.counter_id} accepted. Credit written with the counter's values; the invite is now confirmed.`, result);
724
+ }
725
+ async declineCounter(args) {
726
+ const result = await this.pica.collaborators.declineCounter(args.counter_id, args.reason);
727
+ return formatSuccess(`Counter ${args.counter_id} declined. The invite reverts to pending — the original proposal is back on the table.`, result);
728
+ }
729
+ async counterBack(args) {
730
+ const result = await this.pica.collaborators.counterBack({
731
+ counter_id: args.counter_id,
732
+ credit_type: args.credit_type,
733
+ percentage_split: args.percentage_split,
734
+ message: args.message,
735
+ });
736
+ return formatSuccess(`Counter-back proposed (${args.credit_type} · ${args.percentage_split}%). The recipient has been notified.`, result);
737
+ }
401
738
  }
402
739
  //# sourceMappingURL=collaborators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collaborators.js","sourceRoot":"","sources":["../../src/tools/collaborators.ts"],"names":[],"mappings":"AAAA,6DAA6D;AA0B7D,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,kBAAkB;IACrB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,2BAA2B;oBACjC,IAAI,EAAE,OAAO;oBACb,WAAW,EACT,+HAA+H;wBAC/H,kPAAkP;oBACpP,SAAS,EAAE,gBAAgB;oBAC3B,eAAe,EAAE,eAAe;oBAChC,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,2CAA2C;6BACzD;4BACD,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,+BAA+B;6BAC7C;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,mCAAmC;6BACjD;4BACD,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,yEAAyE;6BAC5E;4BACD,UAAU,EAAE;gCACV,IAAI,EAAE,QAAQ;gCACd,W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AU,SAAS,UAAU,EAC7D,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,CAC5C,CAAC;IACJ,CAAC;CACF"}
1
+ {"version":3,"file":"collaborators.js","sourceRoot":"","sources":["../../src/tools/collaborators.ts"],"names":[],"mappings":"AAAA,6DAA6D;AA0B7D,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,UAAU,GAEX,MAAM,qBAAqB,CAAC;AAE7B,MAAM,OAAO,kBAAkB;IACrB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,2BAA2B;oBACjC,IAAI,EAAE,OAAO;oBACb,WAAW,EACT,+HAA+H;wBAC/H,uUAAuU;oBACzU,SAAS,EAAE,gBAAgB;oBAC3B,eAAe,EAAE,eAAe;oBAChC,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,2CAA2C;6BACzD;4BACD,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,+BAA+B;6BAC7C;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,6IAA6I;6BAChJ;4BACD,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,mRAAmR;6BACtR;4BACD,IAAI,EAAE;gCACJ,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,yEAAyE;6BAC5E;4BACD,UAAU,EAAE;gCACV,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,wGAAwG;6BAC3G;4BACD,WAAW,EAAE;gCACX,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,gFAAgF;6BACnF;4BACD,gBAAgB,EAAE;gCAChB,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C7G,MAAM,CACP,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,IAAyB;QACpD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,cAAc,CACzD,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,MAAM,CACZ,CAAC;QACF,OAAO,aAAa,CAClB,WAAW,IAAI,CAAC,UAAU,wFAAwF,EAClH,MAAM,CACP,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,IAAyB;QACjD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC;YACvD,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,OAAO,EAAE,IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QACH,OAAO,aAAa,CAClB,0BAA0B,IAAI,CAAC,WAAW,MAAM,IAAI,CAAC,gBAAgB,sCAAsC,EAC3G,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
@@ -18,6 +18,7 @@ export declare class CreditsTools {
18
18
  definition: ToolDefinition;
19
19
  executor: ToolExecutor;
20
20
  }>;
21
+ private sendForAttestation;
21
22
  private listCredits;
22
23
  private updateCredits;
23
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA6DtE,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAia3D,WAAW;YA2BX,aAAa;IAqM3B;;;;;;;;;;;;;OAaG;YACW,sBAAsB;IA+GpC;;;;;;;;OAQG;YACW,SAAS;IAwIvB;;;;;;OAMG;YACW,YAAY;CA2D3B"}
1
+ {"version":3,"file":"credits.d.ts","sourceRoot":"","sources":["../../src/tools/credits.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA6DtE,qBAAa,YAAY;IACvB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAye3D,kBAAkB;YA8DlB,WAAW;YA2BX,aAAa;IAqM3B;;;;;;;;;;;;;OAaG;YACW,sBAAsB;IA+GpC;;;;;;;;OAQG;YACW,SAAS;IAwIvB;;;;;;OAMG;YACW,YAAY;CA2D3B"}
@@ -103,7 +103,7 @@ export class CreditsTools {
103
103
  "15 roles: writer, composer, arranger, lyricist, producer, performer, engineer, mixer, mastering, owner, vocalist, instrumentalist, conductor, programmer, remixer. " +
104
104
  "For publishing credits, pass publisher_id (resolve a publisher name/IPI to an id via pica_publishers_query, or create one via pica_publishers_create). " +
105
105
  "Supports territory/rights metadata plus is_primary / notes / attestation_status. " +
106
- "IMPORTANT: After updating, call pica_credits_list to verify the credits actually persisted — silent failures are possible if roles are invalid. " +
106
+ "IMPORTANT: After updating, ask the user: do you want to send these credits to the collaborators to verify? Should we generate a split sheet for sign-off? Is anyone on this work bound by a work-for-hire agreement or a producer agreement (producer takes points off the top of master royalties)? Each credited person can carry their own AI disclosure — a co-writer can be human while another collaborator used AI. Then call pica_credits_list to confirm the credits persisted — silent failures are possible if roles are invalid. " +
107
107
  "After several mutations, surface a pica_dashboard_briefing to the user. " +
108
108
  "→ then: pica_credits_list (verify saved), pica_works_inspect (check progress)",
109
109
  workflows: ["work-required", "work-credits-required"],
@@ -213,6 +213,16 @@ export class CreditsTools {
213
213
  reason: "Check the work's completeness score now that credits are in place.",
214
214
  when: "on_success",
215
215
  },
216
+ {
217
+ tool: "pica_split_sheet_generate",
218
+ reason: "Formalise the splits with a split sheet for collaborator sign-off.",
219
+ when: "on_success",
220
+ },
221
+ {
222
+ tool: "pica_agreement_types_create",
223
+ reason: "If any collaborators are subject to special terms (producer points, flat fee), create the matching agreement.",
224
+ when: "on_success",
225
+ },
216
226
  ],
217
227
  },
218
228
  executor: withBillingGate(this.pica, "credit update", this.updateCredits.bind(this)),
@@ -288,6 +298,56 @@ export class CreditsTools {
288
298
  // ADR-232 — atomic credit primitives. Composable verbs over the same
289
299
  // substrate as pica_credits_update / pica_recording_credits_update,
290
300
  // but discrete: add one row, remove one row, no replace-semantics.
301
+ {
302
+ definition: {
303
+ name: "pica_credits_send_for_attestation",
304
+ tier: "write",
305
+ description: "Use when the user asks: 'send these credits to my collaborators to confirm', 'ask Mary to verify her songwriter credit', 'remind everyone to confirm their credits'. " +
306
+ "Lightweight alternative to pica_split_sheet_send when you only need credit-level confirmation, not a formal signed document. Notifies each credited person (in-app + telegram + email) that they have a pending credit awaiting their attestation. Recipients click through to confirm or dispute — this tool only sends the prompt; it does NOT flip attestation_status. " +
307
+ "Pass reminder_type='reminder' to nudge recipients who haven't responded yet. Use pica_split_sheet_generate + pica_split_sheet_send when you want a signed formal split-sheet document instead. " +
308
+ "→ then: pica_credits_list (re-check who's attested), pica_works_inspect (verify the work's overall attestation health)",
309
+ workflows: ["work-required", "work-credits-required"],
310
+ vernacular_kind: "creator-entry",
311
+ inputSchema: {
312
+ type: "object",
313
+ properties: {
314
+ work_id: {
315
+ type: "string",
316
+ description: "The work whose pending credits should be sent.",
317
+ },
318
+ credit_ids: {
319
+ type: "array",
320
+ items: { type: "string" },
321
+ description: "Optional list of specific credit row IDs (from pica_credits_list) to filter to. Omit to send all pending credits on the work.",
322
+ },
323
+ reminder_type: {
324
+ type: "string",
325
+ enum: ["initial", "reminder"],
326
+ description: "'initial' (default) for first-time send; 'reminder' for nudging recipients who haven't responded. The notification copy + email subject differ.",
327
+ },
328
+ },
329
+ required: ["work_id"],
330
+ },
331
+ nextSteps: [
332
+ {
333
+ tool: "pica_credits_list",
334
+ reason: "After recipients respond, re-list credits to see whose attestation_status flipped from pending to attested.",
335
+ when: "on_success",
336
+ },
337
+ {
338
+ tool: "pica_works_inspect",
339
+ reason: "Check the work's overall attestation summary now that prompts are out.",
340
+ when: "on_success",
341
+ },
342
+ {
343
+ tool: "pica_split_sheet_generate",
344
+ reason: "If the user actually wants a signed formal split sheet (not just credit confirmation), generate one and call pica_split_sheet_send instead.",
345
+ when: "on_success",
346
+ },
347
+ ],
348
+ },
349
+ executor: withBillingGate(this.pica, "credit attestation send", this.sendForAttestation.bind(this)),
350
+ },
291
351
  {
292
352
  definition: {
293
353
  name: "pica_credit_add",
@@ -405,6 +465,55 @@ export class CreditsTools {
405
465
  },
406
466
  ];
407
467
  }
468
+ async sendForAttestation(args) {
469
+ const workId = args.work_id;
470
+ if (!workId) {
471
+ return {
472
+ content: [{ type: "text", text: "work_id is required." }],
473
+ isError: true,
474
+ };
475
+ }
476
+ const creditIds = Array.isArray(args.credit_ids)
477
+ ? args.credit_ids.filter((v) => typeof v === "string")
478
+ : undefined;
479
+ const reminderType = args.reminder_type === "reminder" ? "reminder" : "initial";
480
+ try {
481
+ const result = await this.pica.credits.sendForAttestation(workId, {
482
+ credit_ids: creditIds,
483
+ reminder_type: reminderType,
484
+ });
485
+ const delivered = (result.results || []).filter((r) => r.delivered);
486
+ const notPicaUsers = (result.results || []).filter((r) => r.reason === "not_a_pica_user");
487
+ const failed = (result.results || []).filter((r) => !r.delivered && r.reason !== "not_a_pica_user");
488
+ const summary = [
489
+ `Sent attestation prompt to ${delivered.length}/${result.results?.length ?? 0} credited people`,
490
+ delivered.length > 0
491
+ ? `Delivered: ${delivered.map((r) => r.person_name || r.person_id).join(", ")}`
492
+ : null,
493
+ notPicaUsers.length > 0
494
+ ? `Not PICA users (use pica_collaborators_invite): ${notPicaUsers.map((r) => r.person_name || r.person_id).join(", ")}`
495
+ : null,
496
+ failed.length > 0
497
+ ? `Failed: ${failed.map((r) => r.person_name || r.person_id).join(", ")}`
498
+ : null,
499
+ ]
500
+ .filter(Boolean)
501
+ .join(". ");
502
+ return formatSuccess(summary, result);
503
+ }
504
+ catch (err) {
505
+ const errorMessage = err instanceof Error ? err.message : String(err);
506
+ return {
507
+ content: [
508
+ {
509
+ type: "text",
510
+ text: `Failed to send credits for attestation: ${errorMessage}`,
511
+ },
512
+ ],
513
+ isError: true,
514
+ };
515
+ }
516
+ }
408
517
  async listCredits(args) {
409
518
  // Fetch both publishing collaborators and recording credits
410
519
  const [collabSettled, creditsSettled] = await Promise.allSettled([