@withpica/mcp-sdk 1.19.0 → 1.22.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 +58 -3
- package/dist/index.d.ts +378 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +208 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,61 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [1.22.0] - 2026-05-06
|
|
15
|
+
|
|
16
|
+
### Removed
|
|
17
|
+
|
|
18
|
+
- **`CreditsBalanceResource.purchase()` — credit-pack one-time purchase entry point.**
|
|
19
|
+
Retired with the move to capacity-tier subscriptions (ADR-205). The Stripe
|
|
20
|
+
Checkout endpoint, `lib/services/billing.createCreditPurchaseSession`, and
|
|
21
|
+
the `get_credit_packages` AI tool were removed in the same change. Any
|
|
22
|
+
external consumer calling `client.creditsBalance.purchase({...})` will get
|
|
23
|
+
a TypeScript compile error after upgrading.
|
|
24
|
+
- **Migration:** redirect users to the tier-subscription flow (`POST
|
|
25
|
+
/admin/subscription`, exposed by the `pica_subscription_*` MCP tools or
|
|
26
|
+
the `/pricing` page CTA).
|
|
27
|
+
- **Defensive note:** the Stripe webhook handler still recognises legacy
|
|
28
|
+
`type === "credit_purchase"` metadata and awards credits if any stale
|
|
29
|
+
checkout session completes after deploy.
|
|
30
|
+
- **Breaking** — minor bump per Keep-a-Changelog convention because the
|
|
31
|
+
method has been a tombstone on the MCP surface since 2026-04-22 (B-001)
|
|
32
|
+
and was already considered an internal-only escape hatch; downstream
|
|
33
|
+
`mcp-server` (workspace consumer) was the only known caller and its
|
|
34
|
+
`purchases.ts` tool already returned `[]`. Bump if you have an external
|
|
35
|
+
consumer.
|
|
36
|
+
|
|
37
|
+
## [1.21.0] - 2026-05-02
|
|
38
|
+
|
|
39
|
+
### Added
|
|
40
|
+
|
|
41
|
+
- **ADR-222 — `pica.syncPlacements` resource (W3, paired with W4 REST routes).**
|
|
42
|
+
Six methods on `PicaClient.syncPlacements`:
|
|
43
|
+
- `list(params?)` → `PaginatedResult<SyncPlacement>` — `GET /admin/sync-placements?<filters>`
|
|
44
|
+
- `get(id)` → `SyncPlacementWithRelations` — `GET /admin/sync-placements/{id}`
|
|
45
|
+
- `create(payload)` → `SyncPlacement` — `POST /admin/sync-placements`
|
|
46
|
+
- `update(id, patch)` → `SyncPlacement` — `PATCH /admin/sync-placements/{id}`
|
|
47
|
+
- `delete(id, opts?)` → `void` — `DELETE /admin/sync-placements/{id}`, optional `confirmation_token` query param
|
|
48
|
+
- `addSource(id, source)` → `{ placement, source }` — `POST /admin/sync-placements/{id}/sources`
|
|
49
|
+
|
|
50
|
+
- **14 new exported types** mirroring `lib/services/sync-placements.ts`: `SyncPlacement`, `SyncPlacementSource`, `SyncPlacementRecording`, `SyncPlacementWithRelations`, `SyncPlacementContactInput`, `SyncPlacementRecordingInput`, `SyncPlacementSourceInput`, `CreateSyncPlacementInput`, `UpdateSyncPlacementInput`, `SyncPlacementQueryParams`, plus 4 union types (`SyncPlacementStatus`, `SyncPlacementVerificationStatus`, `SyncPlacementConfidentialityLevel`, `SyncPlacementSourceKind`). Per the SDK convention noted at top-of-file, types are duplicated across the package boundary; drift is caught by the holdout suite.
|
|
51
|
+
|
|
52
|
+
- **`groups` resource (ADR-223).** New `PicaClient.groups` with four
|
|
53
|
+
methods routing to the new `/admin/groups/*` and
|
|
54
|
+
`/admin/people/{id}/groups` HTTP routes:
|
|
55
|
+
- `addMember({ group_person_id, member_person_id, role?, role_label?,
|
|
56
|
+
joined_at?, receive_notifications?, notification_filter? })` —
|
|
57
|
+
server enforces parent.is_group=true via trigger; surfaces friendly
|
|
58
|
+
"is_group=true" / "already an active member" / "cannot be a member
|
|
59
|
+
of themselves" errors at 400.
|
|
60
|
+
- `removeMember({ group_person_id, member_person_id, left_at? })` —
|
|
61
|
+
sets left_at on the active row; preserves history.
|
|
62
|
+
- `listMembers(groupPersonId, { include_inactive? })` — joins to
|
|
63
|
+
people for member display fields.
|
|
64
|
+
- `listGroupsForPerson(personId, { include_inactive? })` — inverse.
|
|
65
|
+
Role enum: `member` | `founder` | `lead` | `touring_member` |
|
|
66
|
+
`session` | `guest` | `producer_in_residence`. Default
|
|
67
|
+
`receive_notifications=true` (opt-out per membership).
|
|
68
|
+
|
|
14
69
|
## [1.19.0] - 2026-04-30
|
|
15
70
|
|
|
16
71
|
### Added
|
|
@@ -50,7 +105,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
50
105
|
- Returns a discriminated union — `{ has_artwork: false }` when the
|
|
51
106
|
release has no artwork on file, otherwise
|
|
52
107
|
`{ has_artwork: true, base64, mime_type: "image/jpeg", width, height,
|
|
53
|
-
|
|
108
|
+
source_url_sha256, cache_hit }`. The discriminator avoids the
|
|
54
109
|
`data.data || data` falsy-unwrap trap in `BaseResource.request<T>()`
|
|
55
110
|
when the server returns "no artwork" as a known state rather than a
|
|
56
111
|
null payload.
|
|
@@ -93,7 +148,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
93
148
|
- **`RecordingCredit`, `RecordingCreditCreateInput`** exported as types.
|
|
94
149
|
Mirror of `lib/services/recording-credits.ts` shape:
|
|
95
150
|
`{recording_id, person_id?, credited_name, role, split_percentage?,
|
|
96
|
-
|
|
151
|
+
split_type?, display_order?, notes?}`. Roles use the 16-entry
|
|
97
152
|
`RECORDING_CREDIT_ROLES` enum (no Writer/Composer — those route via
|
|
98
153
|
work_credits).
|
|
99
154
|
|
|
@@ -124,7 +179,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
124
179
|
- **ADR-210 Phase 1 — `BillingSlice` + `BillingTier` types + `CatalogStats.billing_slice` field.**
|
|
125
180
|
`CatalogStats` (the `pica.catalogStats()` return type) gains a four-field
|
|
126
181
|
`billing_slice` object: `{ billing_state, trial_days_remaining,
|
|
127
|
-
|
|
182
|
+
current_tier, capacity_pct }`. Powers the symmetric stdio + HTTP fetcher
|
|
128
183
|
path for `_meta.session_state`'s billing fields without forcing a new SDK
|
|
129
184
|
method or endpoint into Phase 1 (see ADR-210 Stage 1 worker report Q6
|
|
130
185
|
Option A). `current_tier` is `BillingTier | null` covering the full
|
package/dist/index.d.ts
CHANGED
|
@@ -380,6 +380,134 @@ interface AgreementWorkLink {
|
|
|
380
380
|
royalty_split_percentage?: number;
|
|
381
381
|
notes?: string;
|
|
382
382
|
}
|
|
383
|
+
type SyncPlacementStatus = "licensed" | "aired" | "expired" | "renewed" | "terminated";
|
|
384
|
+
type SyncPlacementVerificationStatus = "unverified" | "self_attested" | "evidence_attached" | "operator_verified" | "disputed";
|
|
385
|
+
type SyncPlacementConfidentialityLevel = "public" | "redacted_in_public_car" | "private";
|
|
386
|
+
type SyncPlacementSourceKind = "user_attestation" | "agreement_pdf" | "cue_sheet" | "invoice" | "email" | "screenshot" | "web" | "spreadsheet_import";
|
|
387
|
+
interface SyncPlacement {
|
|
388
|
+
id: string;
|
|
389
|
+
organisation_id: string;
|
|
390
|
+
work_id: string;
|
|
391
|
+
agreement_id: string | null;
|
|
392
|
+
source_license_enquiry_id: string | null;
|
|
393
|
+
production_title: string;
|
|
394
|
+
production_type: string | null;
|
|
395
|
+
brand: string | null;
|
|
396
|
+
production_company: string | null;
|
|
397
|
+
status: SyncPlacementStatus;
|
|
398
|
+
verification_status: SyncPlacementVerificationStatus;
|
|
399
|
+
confidentiality_level: SyncPlacementConfidentialityLevel;
|
|
400
|
+
fee_amount: number | null;
|
|
401
|
+
fee_currency: string | null;
|
|
402
|
+
use_start_date: string | null;
|
|
403
|
+
use_end_date: string | null;
|
|
404
|
+
territory: string[] | null;
|
|
405
|
+
media_channels: string[] | null;
|
|
406
|
+
notes: string | null;
|
|
407
|
+
backend_expected: boolean;
|
|
408
|
+
source: string;
|
|
409
|
+
created_at: string;
|
|
410
|
+
updated_at: string;
|
|
411
|
+
created_by: string | null;
|
|
412
|
+
verified_by: string | null;
|
|
413
|
+
verified_at: string | null;
|
|
414
|
+
}
|
|
415
|
+
interface SyncPlacementSource {
|
|
416
|
+
id: string;
|
|
417
|
+
sync_placement_id: string;
|
|
418
|
+
url: string;
|
|
419
|
+
kind: SyncPlacementSourceKind;
|
|
420
|
+
agent_id: string | null;
|
|
421
|
+
field_coverage: string[] | null;
|
|
422
|
+
notes: string | null;
|
|
423
|
+
created_at: string;
|
|
424
|
+
}
|
|
425
|
+
interface SyncPlacementRecording {
|
|
426
|
+
id: string;
|
|
427
|
+
sync_placement_id: string;
|
|
428
|
+
recording_id: string;
|
|
429
|
+
role: string;
|
|
430
|
+
master_fee: number | null;
|
|
431
|
+
master_share_licensed_pct: number | null;
|
|
432
|
+
notes: string | null;
|
|
433
|
+
}
|
|
434
|
+
interface SyncPlacementWithRelations extends SyncPlacement {
|
|
435
|
+
recordings: SyncPlacementRecording[];
|
|
436
|
+
sources: SyncPlacementSource[];
|
|
437
|
+
agreement?: Agreement | null;
|
|
438
|
+
}
|
|
439
|
+
interface SyncPlacementContactInput {
|
|
440
|
+
person_id?: string;
|
|
441
|
+
person_name?: string;
|
|
442
|
+
role: string;
|
|
443
|
+
email?: string;
|
|
444
|
+
company?: string;
|
|
445
|
+
position?: string;
|
|
446
|
+
split_percentage?: number;
|
|
447
|
+
}
|
|
448
|
+
interface SyncPlacementRecordingInput {
|
|
449
|
+
recording_id: string;
|
|
450
|
+
role: string;
|
|
451
|
+
master_fee?: number;
|
|
452
|
+
master_share_licensed_pct?: number;
|
|
453
|
+
notes?: string;
|
|
454
|
+
}
|
|
455
|
+
interface SyncPlacementSourceInput {
|
|
456
|
+
url: string;
|
|
457
|
+
kind: SyncPlacementSourceKind;
|
|
458
|
+
agent_id?: string;
|
|
459
|
+
field_coverage?: string[];
|
|
460
|
+
notes?: string;
|
|
461
|
+
}
|
|
462
|
+
interface CreateSyncPlacementInput {
|
|
463
|
+
work_id: string;
|
|
464
|
+
production_title: string;
|
|
465
|
+
production_type?: string;
|
|
466
|
+
brand?: string;
|
|
467
|
+
production_company?: string;
|
|
468
|
+
status?: SyncPlacementStatus;
|
|
469
|
+
fee_amount?: number;
|
|
470
|
+
fee_currency?: string;
|
|
471
|
+
use_start_date?: string;
|
|
472
|
+
use_end_date?: string;
|
|
473
|
+
territory?: string[];
|
|
474
|
+
media_channels?: string[];
|
|
475
|
+
notes?: string;
|
|
476
|
+
confidentiality_level?: SyncPlacementConfidentialityLevel;
|
|
477
|
+
contacts: SyncPlacementContactInput[];
|
|
478
|
+
recordings?: SyncPlacementRecordingInput[];
|
|
479
|
+
sources?: SyncPlacementSourceInput[];
|
|
480
|
+
}
|
|
481
|
+
interface UpdateSyncPlacementInput {
|
|
482
|
+
status?: SyncPlacementStatus;
|
|
483
|
+
verification_status?: SyncPlacementVerificationStatus;
|
|
484
|
+
confidentiality_level?: SyncPlacementConfidentialityLevel;
|
|
485
|
+
production_title?: string;
|
|
486
|
+
production_type?: string;
|
|
487
|
+
brand?: string;
|
|
488
|
+
production_company?: string;
|
|
489
|
+
fee_amount?: number;
|
|
490
|
+
fee_currency?: string;
|
|
491
|
+
use_start_date?: string;
|
|
492
|
+
use_end_date?: string;
|
|
493
|
+
territory?: string[];
|
|
494
|
+
media_channels?: string[];
|
|
495
|
+
notes?: string;
|
|
496
|
+
}
|
|
497
|
+
interface SyncPlacementQueryParams {
|
|
498
|
+
work_id?: string;
|
|
499
|
+
status?: SyncPlacementStatus;
|
|
500
|
+
verification_status?: SyncPlacementVerificationStatus;
|
|
501
|
+
brand?: string;
|
|
502
|
+
production_company?: string;
|
|
503
|
+
person_id?: string;
|
|
504
|
+
recording_id?: string;
|
|
505
|
+
source_license_enquiry_id?: string;
|
|
506
|
+
min_fee?: number;
|
|
507
|
+
currency?: string;
|
|
508
|
+
limit?: number;
|
|
509
|
+
offset?: number;
|
|
510
|
+
}
|
|
383
511
|
interface SyncSearchParams {
|
|
384
512
|
mood?: string;
|
|
385
513
|
genre?: string;
|
|
@@ -580,18 +708,38 @@ declare class LicensingResource extends BaseResource {
|
|
|
580
708
|
*/
|
|
581
709
|
updateEnquiryStatus(id: string, status: string, notes?: string): Promise<LicenseEnquiry>;
|
|
582
710
|
}
|
|
711
|
+
export interface WorkCreditAtomicAddInput {
|
|
712
|
+
person_id: string;
|
|
713
|
+
credit_type?: "writer" | "composer" | "arranger" | "lyricist" | "producer" | "performer" | "engineer" | "mixer" | "mastering" | "owner" | "vocalist" | "instrumentalist" | "conductor" | "programmer" | "remixer";
|
|
714
|
+
share_pct?: number;
|
|
715
|
+
notes?: string;
|
|
716
|
+
}
|
|
717
|
+
export interface AtomicCreditResult {
|
|
718
|
+
credit_id: string;
|
|
719
|
+
credit?: Record<string, unknown>;
|
|
720
|
+
work_id?: string;
|
|
721
|
+
recording_id?: string;
|
|
722
|
+
}
|
|
583
723
|
declare class CreditsResource extends BaseResource {
|
|
584
724
|
listForWork(workId: string): Promise<WorkCredit[]>;
|
|
585
725
|
updateForWork(workId: string, credits: WorkCreditsInput): Promise<WorkCredit[]>;
|
|
586
726
|
listCollaborators(workId: string): Promise<WorkCredit[]>;
|
|
587
727
|
updateCollaborators(workId: string, collaborators: WorkCreditsInput): Promise<WorkCredit[]>;
|
|
728
|
+
/**
|
|
729
|
+
* ADR-232 atomic add — INSERT a single work credit. Race-safe under
|
|
730
|
+
* concurrent writes (replace_work_credits is read-modify-write and
|
|
731
|
+
* therefore not atomic for this verb). Returns the new credit_id.
|
|
732
|
+
*/
|
|
733
|
+
atomicAdd(workId: string, input: WorkCreditAtomicAddInput): Promise<AtomicCreditResult>;
|
|
734
|
+
/**
|
|
735
|
+
* ADR-232 atomic remove — DELETE…RETURNING with 0-row → 403
|
|
736
|
+
* INSUFFICIENT_SCOPE. No SELECT pre-probe (constant-time existence
|
|
737
|
+
* semantics — never leaks 404 vs 403 via latency).
|
|
738
|
+
*/
|
|
739
|
+
atomicRemove(workId: string, creditId: string): Promise<AtomicCreditResult>;
|
|
588
740
|
}
|
|
589
741
|
declare class CreditsBalanceResource extends BaseResource {
|
|
590
742
|
getBalance(): Promise<any>;
|
|
591
|
-
purchase(params: {
|
|
592
|
-
package_id: string;
|
|
593
|
-
currency?: string;
|
|
594
|
-
}): Promise<any>;
|
|
595
743
|
}
|
|
596
744
|
declare class PicaScoreResource extends BaseResource {
|
|
597
745
|
get(): Promise<PicaScore>;
|
|
@@ -731,6 +879,19 @@ declare class AgreementsResource extends BaseResource {
|
|
|
731
879
|
notes?: string;
|
|
732
880
|
}): Promise<AgreementWorkLink>;
|
|
733
881
|
}
|
|
882
|
+
declare class SyncPlacementsResource extends BaseResource {
|
|
883
|
+
list(params?: SyncPlacementQueryParams): Promise<PaginatedResult<SyncPlacement>>;
|
|
884
|
+
get(id: string): Promise<SyncPlacementWithRelations>;
|
|
885
|
+
create(data: CreateSyncPlacementInput): Promise<SyncPlacement>;
|
|
886
|
+
update(id: string, updates: UpdateSyncPlacementInput): Promise<SyncPlacement>;
|
|
887
|
+
delete(id: string, opts?: {
|
|
888
|
+
confirmation_token?: string;
|
|
889
|
+
}): Promise<void>;
|
|
890
|
+
addSource(id: string, source: SyncPlacementSourceInput): Promise<{
|
|
891
|
+
placement: SyncPlacement;
|
|
892
|
+
source: SyncPlacementSource;
|
|
893
|
+
}>;
|
|
894
|
+
}
|
|
734
895
|
declare class WorkspaceResource extends BaseResource {
|
|
735
896
|
getContext(): Promise<{
|
|
736
897
|
organisation: {
|
|
@@ -756,6 +917,12 @@ declare class AuditResource extends BaseResource {
|
|
|
756
917
|
since?: string;
|
|
757
918
|
tool_name?: string;
|
|
758
919
|
risk_level?: string;
|
|
920
|
+
/**
|
|
921
|
+
* ADR-230 — filter by declared authority tier ("read" | "draft" |
|
|
922
|
+
* "write" | "destructive"). The 4-value tier is PICA's authority
|
|
923
|
+
* detail; risk_level remains the MCP-standard 3-value hint.
|
|
924
|
+
*/
|
|
925
|
+
tier?: string;
|
|
759
926
|
result_status?: string;
|
|
760
927
|
}): Promise<any[]>;
|
|
761
928
|
}
|
|
@@ -1428,6 +1595,57 @@ declare class OpsIssuesResource extends BaseResource {
|
|
|
1428
1595
|
limit?: number;
|
|
1429
1596
|
}): Promise<MyReportedIssue[]>;
|
|
1430
1597
|
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Reads from the Phase 4 substrate — `assistant_interactions` and
|
|
1600
|
+
* `mcp_sessions`. Powers `pica_my_recent_questions` (the auditability tool)
|
|
1601
|
+
* and the `pica_continue` prompt's open-loop offers.
|
|
1602
|
+
*
|
|
1603
|
+
* Strictly user-scoped: the API routes assert a non-null userId from the
|
|
1604
|
+
* auth context and rely on RLS `(user_id = auth.uid())` for defence in depth.
|
|
1605
|
+
*/
|
|
1606
|
+
export interface RecentInteractionEntry {
|
|
1607
|
+
id: string;
|
|
1608
|
+
session_id: string;
|
|
1609
|
+
intent: string;
|
|
1610
|
+
tools_used: string[] | null;
|
|
1611
|
+
prompt_excerpt: string | null;
|
|
1612
|
+
result_summary: string | null;
|
|
1613
|
+
success: boolean;
|
|
1614
|
+
was_confirmed: boolean | null;
|
|
1615
|
+
required_confirmation: boolean | null;
|
|
1616
|
+
created_at: string;
|
|
1617
|
+
client_name: string | null;
|
|
1618
|
+
client_version: string | null;
|
|
1619
|
+
transport: string;
|
|
1620
|
+
}
|
|
1621
|
+
export interface OpenLoopEntry {
|
|
1622
|
+
session_id: string;
|
|
1623
|
+
reason: "unconfirmed_write" | "incomplete_multi_step";
|
|
1624
|
+
intent: string;
|
|
1625
|
+
result_summary: string | null;
|
|
1626
|
+
entity_type: string | null;
|
|
1627
|
+
entity_ids: string[] | null;
|
|
1628
|
+
created_at: string;
|
|
1629
|
+
}
|
|
1630
|
+
declare class AssistantInteractionsResource extends BaseResource {
|
|
1631
|
+
listRecent(params?: {
|
|
1632
|
+
sessionId?: string;
|
|
1633
|
+
since?: string;
|
|
1634
|
+
success?: boolean;
|
|
1635
|
+
intent?: string;
|
|
1636
|
+
limit?: number;
|
|
1637
|
+
}): Promise<RecentInteractionEntry[]>;
|
|
1638
|
+
detectOpenLoops(): Promise<OpenLoopEntry[]>;
|
|
1639
|
+
/**
|
|
1640
|
+
* ADR-226 Phase 6 — fetch the user's vocabulary context as a single
|
|
1641
|
+
* pre-rendered string (or null when the user has no entries). Hit by
|
|
1642
|
+
* the stdio MCP server during start(), before transport.connect, to
|
|
1643
|
+
* compose handshake-time server-instructions.
|
|
1644
|
+
*/
|
|
1645
|
+
getVocabularyContext(): Promise<{
|
|
1646
|
+
instructions: string | null;
|
|
1647
|
+
}>;
|
|
1648
|
+
}
|
|
1431
1649
|
/**
|
|
1432
1650
|
* Session-auth-only surface: the three HTTP routes backing these
|
|
1433
1651
|
* methods refuse `pica_grant_` callers with 403 `session_auth_required`
|
|
@@ -1984,6 +2202,133 @@ export interface RecordingCreditCreateInput {
|
|
|
1984
2202
|
declare class RecordingCreditsResource extends BaseResource {
|
|
1985
2203
|
list(recordingId: string): Promise<RecordingCredit[]>;
|
|
1986
2204
|
create(recordingId: string, input: RecordingCreditCreateInput): Promise<RecordingCredit>;
|
|
2205
|
+
/**
|
|
2206
|
+
* ADR-232 atomic add — semantically identical to `create` (a recording
|
|
2207
|
+
* credit INSERT is already atomic) but reads more naturally next to
|
|
2208
|
+
* CreditsResource.atomicAdd in the pica_credit_add tool implementation.
|
|
2209
|
+
*/
|
|
2210
|
+
atomicAdd(recordingId: string, input: RecordingCreditCreateInput): Promise<AtomicCreditResult>;
|
|
2211
|
+
/**
|
|
2212
|
+
* ADR-232 atomic remove — DELETE with `?atomic=1` so the route returns 403
|
|
2213
|
+
* INSUFFICIENT_SCOPE on 0-row instead of the legacy lenient silent
|
|
2214
|
+
* success. AC-2 strict semantics for pica_credit_remove.
|
|
2215
|
+
*/
|
|
2216
|
+
atomicRemove(recordingId: string, creditId: string): Promise<AtomicCreditResult>;
|
|
2217
|
+
}
|
|
2218
|
+
export type ShareTraceEntityType = "work" | "recording" | "person";
|
|
2219
|
+
export interface ShareTraceQuery {
|
|
2220
|
+
entity_type: ShareTraceEntityType;
|
|
2221
|
+
entity_id: string;
|
|
2222
|
+
viewer_user_id?: string;
|
|
2223
|
+
viewer_org_id?: string;
|
|
2224
|
+
}
|
|
2225
|
+
export interface ShareTraceReason {
|
|
2226
|
+
kind: "org_membership" | "custody_chain" | "share_link" | "cross_org_grant";
|
|
2227
|
+
directness: 1 | 2 | 3 | 4;
|
|
2228
|
+
via_org_id?: string;
|
|
2229
|
+
via_org_name?: string | null;
|
|
2230
|
+
chain_hops?: Array<{
|
|
2231
|
+
custodian_org_id: string;
|
|
2232
|
+
custodian_org_name?: string | null;
|
|
2233
|
+
percentage: number;
|
|
2234
|
+
territory: string;
|
|
2235
|
+
}>;
|
|
2236
|
+
share_link_id?: string;
|
|
2237
|
+
expires_at?: string | null;
|
|
2238
|
+
grant_id?: string;
|
|
2239
|
+
scope?: string[];
|
|
2240
|
+
granted_at?: string | null;
|
|
2241
|
+
}
|
|
2242
|
+
export interface ShareTraceResult {
|
|
2243
|
+
entity: {
|
|
2244
|
+
type: ShareTraceEntityType;
|
|
2245
|
+
id: string;
|
|
2246
|
+
name: string;
|
|
2247
|
+
};
|
|
2248
|
+
viewer: {
|
|
2249
|
+
type: "user" | "org";
|
|
2250
|
+
id: string;
|
|
2251
|
+
name: string | null;
|
|
2252
|
+
};
|
|
2253
|
+
has_access: boolean;
|
|
2254
|
+
reasons: ShareTraceReason[];
|
|
2255
|
+
}
|
|
2256
|
+
export interface CountExplainQuery {
|
|
2257
|
+
count_source: string;
|
|
2258
|
+
observed_value?: number;
|
|
2259
|
+
}
|
|
2260
|
+
export interface CountExplainResult {
|
|
2261
|
+
source: {
|
|
2262
|
+
name: string;
|
|
2263
|
+
query: string;
|
|
2264
|
+
description: string;
|
|
2265
|
+
};
|
|
2266
|
+
computed_value: number;
|
|
2267
|
+
observed_value: number | null;
|
|
2268
|
+
delta: number | null;
|
|
2269
|
+
delta_breakdown?: Array<{
|
|
2270
|
+
reason: string;
|
|
2271
|
+
count: number;
|
|
2272
|
+
sample_ids: string[];
|
|
2273
|
+
}>;
|
|
2274
|
+
}
|
|
2275
|
+
declare class CountExplainResource extends BaseResource {
|
|
2276
|
+
/**
|
|
2277
|
+
* GET /admin/count-explain — explains a single dashboard / briefing
|
|
2278
|
+
* count by reproducing the canonical query and (optionally) breaking
|
|
2279
|
+
* down the delta against an observed value.
|
|
2280
|
+
*/
|
|
2281
|
+
explain(query: CountExplainQuery): Promise<CountExplainResult>;
|
|
2282
|
+
}
|
|
2283
|
+
export interface AudioPipelineStatusQuery {
|
|
2284
|
+
window_days?: number;
|
|
2285
|
+
}
|
|
2286
|
+
export interface AudioPipelineByState {
|
|
2287
|
+
pending: number;
|
|
2288
|
+
complete: number;
|
|
2289
|
+
failed: number;
|
|
2290
|
+
stuck_over_24h: number;
|
|
2291
|
+
}
|
|
2292
|
+
export interface AudioPipelineStatusResult {
|
|
2293
|
+
window_days: number;
|
|
2294
|
+
by_state: AudioPipelineByState;
|
|
2295
|
+
samples: {
|
|
2296
|
+
pending: Array<{
|
|
2297
|
+
audio_file_id: string;
|
|
2298
|
+
work_id: string | null;
|
|
2299
|
+
queued_at: string;
|
|
2300
|
+
}>;
|
|
2301
|
+
failed: Array<{
|
|
2302
|
+
audio_file_id: string;
|
|
2303
|
+
work_id: string | null;
|
|
2304
|
+
error: string | null;
|
|
2305
|
+
last_attempt: string | null;
|
|
2306
|
+
}>;
|
|
2307
|
+
stuck_over_24h: Array<{
|
|
2308
|
+
audio_file_id: string;
|
|
2309
|
+
work_id: string | null;
|
|
2310
|
+
queued_at: string;
|
|
2311
|
+
last_attempt: string | null;
|
|
2312
|
+
}>;
|
|
2313
|
+
};
|
|
2314
|
+
}
|
|
2315
|
+
declare class AudioPipelineStatusResource extends BaseResource {
|
|
2316
|
+
/**
|
|
2317
|
+
* GET /admin/audio-pipeline-status — operational read of the audio
|
|
2318
|
+
* analysis pipeline state for the calling org. AC-7: every bucket is
|
|
2319
|
+
* an integer (zero-org reports structured zeros, not nulls).
|
|
2320
|
+
*/
|
|
2321
|
+
status(query?: AudioPipelineStatusQuery): Promise<AudioPipelineStatusResult>;
|
|
2322
|
+
}
|
|
2323
|
+
declare class ShareTraceResource extends BaseResource {
|
|
2324
|
+
/**
|
|
2325
|
+
* GET /admin/share-trace — returns the unioned chain of reasons a
|
|
2326
|
+
* viewer can see an entity. AC-3: 403 + INSUFFICIENT_SCOPE if the
|
|
2327
|
+
* caller doesn't own the entity (existence-leak protection). AC-4:
|
|
2328
|
+
* has_access:false with reasons:[] when the caller IS the owner but
|
|
2329
|
+
* the viewer can't see.
|
|
2330
|
+
*/
|
|
2331
|
+
trace(query: ShareTraceQuery): Promise<ShareTraceResult>;
|
|
1987
2332
|
}
|
|
1988
2333
|
declare class RecordingSplitsResource extends BaseResource {
|
|
1989
2334
|
list(recordingId: string): Promise<any>;
|
|
@@ -2276,6 +2621,28 @@ declare class DisputesResource extends BaseResource {
|
|
|
2276
2621
|
status?: string;
|
|
2277
2622
|
}): Promise<any>;
|
|
2278
2623
|
}
|
|
2624
|
+
declare class GroupsResource extends BaseResource {
|
|
2625
|
+
addMember(body: {
|
|
2626
|
+
group_person_id: string;
|
|
2627
|
+
member_person_id: string;
|
|
2628
|
+
role?: "member" | "founder" | "lead" | "touring_member" | "session" | "guest" | "producer_in_residence";
|
|
2629
|
+
role_label?: string;
|
|
2630
|
+
joined_at?: string;
|
|
2631
|
+
receive_notifications?: boolean;
|
|
2632
|
+
notification_filter?: string[];
|
|
2633
|
+
}): Promise<any>;
|
|
2634
|
+
removeMember(body: {
|
|
2635
|
+
group_person_id: string;
|
|
2636
|
+
member_person_id: string;
|
|
2637
|
+
left_at?: string;
|
|
2638
|
+
}): Promise<any>;
|
|
2639
|
+
listMembers(groupPersonId: string, params?: {
|
|
2640
|
+
include_inactive?: boolean;
|
|
2641
|
+
}): Promise<any>;
|
|
2642
|
+
listGroupsForPerson(personId: string, params?: {
|
|
2643
|
+
include_inactive?: boolean;
|
|
2644
|
+
}): Promise<any>;
|
|
2645
|
+
}
|
|
2279
2646
|
declare class ChainResource extends BaseResource {
|
|
2280
2647
|
search(params: {
|
|
2281
2648
|
q: string;
|
|
@@ -2312,6 +2679,7 @@ export declare class PicaClient {
|
|
|
2312
2679
|
audioFiles: AudioFilesResource;
|
|
2313
2680
|
multimedia: MultimediaResource;
|
|
2314
2681
|
agreements: AgreementsResource;
|
|
2682
|
+
syncPlacements: SyncPlacementsResource;
|
|
2315
2683
|
workspace: WorkspaceResource;
|
|
2316
2684
|
memory: MemoryResource;
|
|
2317
2685
|
audit: AuditResource;
|
|
@@ -2345,6 +2713,9 @@ export declare class PicaClient {
|
|
|
2345
2713
|
splitSheets: SplitSheetsResource;
|
|
2346
2714
|
recordingSplits: RecordingSplitsResource;
|
|
2347
2715
|
recordingCredits: RecordingCreditsResource;
|
|
2716
|
+
shareTrace: ShareTraceResource;
|
|
2717
|
+
countExplain: CountExplainResource;
|
|
2718
|
+
audioPipelineStatus: AudioPipelineStatusResource;
|
|
2348
2719
|
publishers: PublishersResource;
|
|
2349
2720
|
labels: LabelsResource;
|
|
2350
2721
|
agreementTemplates: AgreementTemplatesResource;
|
|
@@ -2365,11 +2736,13 @@ export declare class PicaClient {
|
|
|
2365
2736
|
discoveries: DiscoveriesResource;
|
|
2366
2737
|
agentIdentity: AgentIdentityResource;
|
|
2367
2738
|
uploads: UploadsResource;
|
|
2739
|
+
groups: GroupsResource;
|
|
2740
|
+
assistantInteractions: AssistantInteractionsResource;
|
|
2368
2741
|
/**
|
|
2369
2742
|
* Get accurate catalog stats via SQL counts (no pagination limits)
|
|
2370
2743
|
*/
|
|
2371
2744
|
catalogStats(): Promise<CatalogStats>;
|
|
2372
2745
|
constructor(config: PicaClientConfig);
|
|
2373
2746
|
}
|
|
2374
|
-
export type { Work, Person, Recording, PaginatedResult, PicaClientConfig, SyncSearchParams, SyncTrack, SyncSearchResult, LicenseEnquiryInput, LicenseEnquiry, WorkCredit, WorkCreditsInput, PicaScore, PicaScorePillar, AudioFile, AudioAnalysisStatus, PresignedUploadResult, CompleteUploadResult, IdentifyResult, MultimediaItem, Agreement, AgreementWorkLink, CatalogStats, NotificationsSummary, CreateUploadSessionInput, CreateUploadSessionResult, };
|
|
2747
|
+
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, };
|
|
2375
2748
|
//# sourceMappingURL=index.d.ts.map
|