@withpica/mcp-sdk 3.11.0 → 3.13.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 +51 -0
- package/dist/index.d.ts +361 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +180 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,57 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [3.13.0] - 2026-08-26
|
|
15
|
+
|
|
16
|
+
The MPP pay rail (spec 2026-08-24 WS-B): a new resource to mint a pay link,
|
|
17
|
+
and two optional fields on the existing subscription-status response so a
|
|
18
|
+
client can say what pica costs and what it is holding.
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- **`BillingResource.mintPayLink()` on `PicaClient.billing`.** Wraps
|
|
23
|
+
`POST /admin/billing/pay-link`. Takes `{ offer: PayOffer; entity_id?: string }`
|
|
24
|
+
and returns a `PayLinkResponse` (`pay_url`, `expires_at`, `offer`, `offers`,
|
|
25
|
+
`held`, `how`) — the route's own envelope, since this route has no
|
|
26
|
+
`{success, data}` wrapper. Minting is not charging: the link is a capability
|
|
27
|
+
an agent POSTs with a Machine Payments credential, or a person opens in a
|
|
28
|
+
browser and pays by card. Refusals arrive as `ApiError` (403 billing not
|
|
29
|
+
enabled; 400 `nothing_held_for_entity` / entity_id required; 409
|
|
30
|
+
`offer_no_longer_applies` with the offers that do apply) and are
|
|
31
|
+
deliberately not caught inside the resource — callers decide what each
|
|
32
|
+
refusal means.
|
|
33
|
+
- **New exported types**: `PayOffer` (`"resident_month" | "unlock" | "settle"`),
|
|
34
|
+
`PayLinkOffer` (`{ offer, amount_minor, currency, label }`), `PayLinkResponse`,
|
|
35
|
+
`HeldSummary` (`{ count, entities }`), `PricingSummary` (`currency`,
|
|
36
|
+
`freeRunwayDeepProcesses`, `residentFeeMinorUnits`,
|
|
37
|
+
`residentIncludedDeepProcesses`, `overagePerSongMinorUnits`,
|
|
38
|
+
`overageCurrency`, `unlockMinorUnits`).
|
|
39
|
+
- **`SubscriptionStatusResponse` gains optional `pricing?: PricingSummary | null`
|
|
40
|
+
and `held?: HeldSummary | null`.** Both are `null` when billing enforcement
|
|
41
|
+
is off on the deployment, and absent entirely against a deployment whose
|
|
42
|
+
route predates the fields — consumers must read "no pricing" as "do not
|
|
43
|
+
state a price," never as "free."
|
|
44
|
+
|
|
45
|
+
## [3.12.0] - 2026-08-25
|
|
46
|
+
|
|
47
|
+
Adds the ADR-314 import continuation surface (below); everything else is documentation — no other method signature, request path or response shape changes.
|
|
48
|
+
|
|
49
|
+
### Added
|
|
50
|
+
|
|
51
|
+
- `ImportResult.rowRange` and `imports.execute()` options `rowOffset` / `rowLimit` — the ADR-314 continuation cursor: the server imports one slice per call (default 2,000 rows) and returns `nextOffset` until the file is done.
|
|
52
|
+
- `ImportResult.partial` — set by `POST /admin/import/execute` when a live run wrote rows and some rows failed (a batch import is not transactional; the written rows are committed). `imports.execute()` options gain `conflictStrategy?: "skip" | "error"` (server default now `"skip"`). Error entries are typed with the server's real `error` field alongside `message`, and `severity`.
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- **Five docstrings described a table that was dropped 2026-05-29.** ADR-252 WS-A DB-M3 dropped both the `work_credits` view and the `work_credits_legacy` table, but these docstrings still told the reader a row lands there. Each now names the canonical home the code actually writes to:
|
|
57
|
+
- `CreditsResource.atomicAdd` cited `replace_work_credits` — a retired RPC — as the non-atomic alternative. It now names the live comparison (the work-level `POST /credits` additive upsert) and says where the row lands: publishing roles to `work_collaborators`, master attribution to `recording_credits`, owner to `recording_splits`.
|
|
58
|
+
- `DiscoveriesResource.claimCredit` said it drains a `discovered_credits` row **into a `work_credits` row**. It does not write a credit row anywhere — the claim is a status transition on `discovered_credits`, which is what the backing route's own provenance stamp records.
|
|
59
|
+
- `DiscoveriesResource.claimArtist` said `work_claims` + `work_credits`. `work_claims` is right; the claimed performer credit is a MASTER credit and lands in `recording_credits` with role `Performer` on the work's sole recording.
|
|
60
|
+
- `CollaboratorsResource.accept` said it "writes a real `work_credits` row". The credit write is grain-routed (ADR-265): a composition-grain invite writes `work_collaborators`, a master/owner-grain invite attests the person's pending `recording_credits`.
|
|
61
|
+
- The `RecordingCredit` orientation comment distinguished this resource from "CreditsResource (`work_credits` / `work_collaborators`)" — now `work_collaborators` / `recording_splits`.
|
|
62
|
+
|
|
63
|
+
> Verified by sweep, not by eye: every snake_case identifier in a comment in `src/index.ts` was cross-checked against the 398 tables and views in the generated database types. `work_credits` was the **only** name with no schema entry, at exactly these sites. Every other table named in a docstring exists, and each write claim was re-read against the route it calls.
|
|
64
|
+
|
|
14
65
|
## [3.11.0] - 2026-07-28
|
|
15
66
|
|
|
16
67
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -175,7 +175,14 @@ export interface ResolvePersonResult {
|
|
|
175
175
|
export type BillingTier = "solo" | "indie" | "pro" | "established" | "enterprise";
|
|
176
176
|
export interface BillingSlice {
|
|
177
177
|
billing_state: "trial" | "active" | "hibernated";
|
|
178
|
-
|
|
178
|
+
/**
|
|
179
|
+
* free_runway (walked in, never charged, no clock) | resident (paying one
|
|
180
|
+
* flat fee per 30-day cycle) | paused (a cycle lapsed, deep-processing off).
|
|
181
|
+
*
|
|
182
|
+
* ⚠️ Replaced `trial_days_remaining` on 2026-08-21 — pica has no trial, and
|
|
183
|
+
* that field reported null for every organisation while implying one existed.
|
|
184
|
+
*/
|
|
185
|
+
plan: "free_runway" | "resident" | "paused";
|
|
179
186
|
current_tier: BillingTier | null;
|
|
180
187
|
capacity_pct: number;
|
|
181
188
|
}
|
|
@@ -1215,6 +1222,83 @@ declare class BookingsResource extends BaseResource {
|
|
|
1215
1222
|
followUpDate?: string;
|
|
1216
1223
|
}): Promise<BookingEnquiry>;
|
|
1217
1224
|
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Payload accepted by `POST /admin/shows` — a dated show (venue + date +
|
|
1227
|
+
* setlist) OR a tour credit (act + year + role); the route picks which by
|
|
1228
|
+
* which fields are present. Mirrors `ShowPayload` in
|
|
1229
|
+
* app/api/admin/shows/route.ts (not imported — this package is standalone).
|
|
1230
|
+
*/
|
|
1231
|
+
interface ShowLogPayload {
|
|
1232
|
+
venue?: string;
|
|
1233
|
+
city?: string;
|
|
1234
|
+
country?: string;
|
|
1235
|
+
date?: string;
|
|
1236
|
+
act?: string;
|
|
1237
|
+
performed_by_person_id?: string;
|
|
1238
|
+
slot?: string;
|
|
1239
|
+
setlist?: string[];
|
|
1240
|
+
set_number?: number;
|
|
1241
|
+
attendance?: number;
|
|
1242
|
+
logged_as?: "act" | "contributor";
|
|
1243
|
+
year?: number;
|
|
1244
|
+
role?: string;
|
|
1245
|
+
tour_name?: string;
|
|
1246
|
+
person_id?: string;
|
|
1247
|
+
email?: string;
|
|
1248
|
+
contributors?: Array<{
|
|
1249
|
+
name?: string;
|
|
1250
|
+
email?: string;
|
|
1251
|
+
person_id?: string;
|
|
1252
|
+
role: string;
|
|
1253
|
+
is_crew?: boolean;
|
|
1254
|
+
}>;
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* `GET /admin/shows` query params — list the org's shows (newest first,
|
|
1258
|
+
* optionally filtered), or fetch one show plus its folded-in setlist when
|
|
1259
|
+
* `id` is given. Mirrors the route's `queryShows` filter set.
|
|
1260
|
+
*/
|
|
1261
|
+
interface ShowQueryParams {
|
|
1262
|
+
id?: string;
|
|
1263
|
+
from?: string;
|
|
1264
|
+
to?: string;
|
|
1265
|
+
venue?: string;
|
|
1266
|
+
city?: string;
|
|
1267
|
+
country?: string;
|
|
1268
|
+
unfiled_only?: boolean;
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* `PATCH /admin/setlist-items/[id]` payload — confirms what a setlist line
|
|
1272
|
+
* actually was (work match, cover flag, performer) and, when `venue_id` +
|
|
1273
|
+
* `show_id` are both present, the show's venue candidate. Both are applied
|
|
1274
|
+
* when both are supplied; the response carries `venue` and `item`, either of
|
|
1275
|
+
* which may be null.
|
|
1276
|
+
*/
|
|
1277
|
+
interface SetlistItemConfirmPayload {
|
|
1278
|
+
work_id?: string;
|
|
1279
|
+
is_cover?: boolean;
|
|
1280
|
+
performed_by?: string;
|
|
1281
|
+
venue_id?: string;
|
|
1282
|
+
show_id?: string;
|
|
1283
|
+
}
|
|
1284
|
+
/**
|
|
1285
|
+
* Live shows and tour credits (ADR-313). Wraps `/admin/shows` and
|
|
1286
|
+
* `/admin/setlist-items/[id]`.
|
|
1287
|
+
*/
|
|
1288
|
+
declare class ShowsResource extends BaseResource {
|
|
1289
|
+
/** POST /admin/shows — log a dated show, or a tour credit. */
|
|
1290
|
+
log(payload: ShowLogPayload): Promise<unknown>;
|
|
1291
|
+
/**
|
|
1292
|
+
* GET /admin/shows — list shows for the org (newest first), or the single
|
|
1293
|
+
* show + its folded-in setlist when `id` is given.
|
|
1294
|
+
*/
|
|
1295
|
+
query(params?: ShowQueryParams): Promise<unknown>;
|
|
1296
|
+
/**
|
|
1297
|
+
* PATCH /admin/setlist-items/[id] — confirm a setlist match, a cover, a
|
|
1298
|
+
* performer, or (with `venue_id` + `show_id`) a venue candidate.
|
|
1299
|
+
*/
|
|
1300
|
+
matchItem(id: string, payload: SetlistItemConfirmPayload): Promise<unknown>;
|
|
1301
|
+
}
|
|
1218
1302
|
export interface WorkCreditAtomicAddInput {
|
|
1219
1303
|
person_id: string;
|
|
1220
1304
|
credit_type?: "writer" | "composer" | "arranger" | "lyricist" | "producer" | "performer" | "engineer" | "mixer" | "mastering" | "owner" | "vocalist" | "instrumentalist" | "conductor" | "programmer" | "remixer";
|
|
@@ -1233,9 +1317,14 @@ declare class CreditsResource extends BaseResource {
|
|
|
1233
1317
|
listCollaborators(workId: string): Promise<WorkCredit[]>;
|
|
1234
1318
|
updateCollaborators(workId: string, collaborators: WorkCreditsInput): Promise<WorkCredit[]>;
|
|
1235
1319
|
/**
|
|
1236
|
-
* ADR-232 atomic add — INSERT a single work credit.
|
|
1237
|
-
*
|
|
1238
|
-
*
|
|
1320
|
+
* ADR-232 atomic add — INSERT a single work credit. NOT replace
|
|
1321
|
+
* semantics: the work-level POST /credits is an additive upsert that
|
|
1322
|
+
* re-reads and re-writes the whole set, so it is not atomic for this
|
|
1323
|
+
* verb. createWorkCredit routes the row to its canonical home —
|
|
1324
|
+
* publishing roles to work_collaborators, master attribution to
|
|
1325
|
+
* recording_credits, owner to recording_splits (ADR-252 WS-A; the
|
|
1326
|
+
* legacy work_credits table was dropped at DB-M3). Returns the new
|
|
1327
|
+
* credit_id.
|
|
1239
1328
|
*/
|
|
1240
1329
|
atomicAdd(workId: string, input: WorkCreditAtomicAddInput): Promise<AtomicCreditResult>;
|
|
1241
1330
|
/**
|
|
@@ -1902,6 +1991,14 @@ declare class EnrichmentResource extends BaseResource {
|
|
|
1902
1991
|
* `pending` rows are visible — applied/rejected/expired are hidden
|
|
1903
1992
|
* regardless of filter. See ADR-163 for the design.
|
|
1904
1993
|
*
|
|
1994
|
+
* ⚠️ `pending` is not the same as "still worth asking". A finding the
|
|
1995
|
+
* catalogue has since ANSWERED by another route keeps that status — nothing
|
|
1996
|
+
* re-asks the question after mint time — and applying it refuses. Those are
|
|
1997
|
+
* excluded, matching what `/inspect/found` shows, and
|
|
1998
|
+
* `data.excluded_stale` ({count, reasons}) reports the drop so a short page
|
|
1999
|
+
* is distinguishable from a filtered one. Applied after pagination, so a
|
|
2000
|
+
* page may return fewer rows than `limit`.
|
|
2001
|
+
*
|
|
1905
2002
|
* ADR-264 C1: supports min_confidence, max_confidence, created_after
|
|
1906
2003
|
* for filtering by confidence band and recency.
|
|
1907
2004
|
*/
|
|
@@ -1918,6 +2015,16 @@ declare class EnrichmentResource extends BaseResource {
|
|
|
1918
2015
|
max_confidence?: number;
|
|
1919
2016
|
/** ADR-264 C1: only return proposals created at or after this ISO timestamp */
|
|
1920
2017
|
created_after?: string;
|
|
2018
|
+
/**
|
|
2019
|
+
* Additionally return `groups` — the interpreted review shape the
|
|
2020
|
+
* /inspect/found page renders (grouped, confidence-banded, before/after
|
|
2021
|
+
* field changes, evidence lines, external refs, per-item actionable /
|
|
2022
|
+
* bulkEligible), read through the FOUND_SOURCES registry.
|
|
2023
|
+
*
|
|
2024
|
+
* ⚠️ `groups` is the WHOLE reviewable queue and is NOT narrowed by the
|
|
2025
|
+
* filters above, which only apply to `proposals`.
|
|
2026
|
+
*/
|
|
2027
|
+
review_shape?: boolean;
|
|
1921
2028
|
}): Promise<any>;
|
|
1922
2029
|
/**
|
|
1923
2030
|
* Apply a pending proposal. For update proposals, drift detection
|
|
@@ -1963,6 +2070,48 @@ declare class EnrichmentResource extends BaseResource {
|
|
|
1963
2070
|
rejected: number;
|
|
1964
2071
|
skipped: string[];
|
|
1965
2072
|
}>;
|
|
2073
|
+
/**
|
|
2074
|
+
* Apply many pending proposals in one call — the accept side of the
|
|
2075
|
+
* /inspect/found queue.
|
|
2076
|
+
*
|
|
2077
|
+
* Takes ids only; unlike `bulkRejectProposals` there is deliberately no
|
|
2078
|
+
* `filter` form, because a filter that bulk-ACCEPTS is a different kind of
|
|
2079
|
+
* thing from one that bulk-dismisses: rejecting a mis-filtered set costs a
|
|
2080
|
+
* re-proposal, accepting one writes to the catalogue.
|
|
2081
|
+
*
|
|
2082
|
+
* Caps at 100 per call. ⚠️ **Partial success is normal** — apply branches
|
|
2083
|
+
* into four different update/create paths and each id is applied
|
|
2084
|
+
* independently, so `failed` being non-empty alongside a non-zero `applied`
|
|
2085
|
+
* is the expected shape, not an error. Never report a partial as a success.
|
|
2086
|
+
*
|
|
2087
|
+
* Returns `{ applied, failed: [{ id, error }], skipped }`. `skipped` is
|
|
2088
|
+
* always empty here (a non-pending id arrives as a `failed` entry carrying
|
|
2089
|
+
* its own message); the key exists so one client shape reads apply, reject
|
|
2090
|
+
* and undo alike.
|
|
2091
|
+
*/
|
|
2092
|
+
bulkApplyProposals(input: {
|
|
2093
|
+
proposal_ids: string[];
|
|
2094
|
+
/**
|
|
2095
|
+
* ADR-180 Rule 12 preview. When true the server writes NOTHING and answers
|
|
2096
|
+
* `{ dry_run: true, would_affect, not_pending }` instead of the apply
|
|
2097
|
+
* shape — so callers must branch on `dry_run` rather than reading
|
|
2098
|
+
* `applied`, which is absent from a preview.
|
|
2099
|
+
*/
|
|
2100
|
+
dry_run?: boolean;
|
|
2101
|
+
}): Promise<{
|
|
2102
|
+
applied?: number;
|
|
2103
|
+
failed?: Array<{
|
|
2104
|
+
id: string;
|
|
2105
|
+
error: string;
|
|
2106
|
+
}>;
|
|
2107
|
+
skipped?: string[];
|
|
2108
|
+
dry_run?: boolean;
|
|
2109
|
+
would_affect?: number;
|
|
2110
|
+
not_pending?: Array<{
|
|
2111
|
+
id: string;
|
|
2112
|
+
error: string;
|
|
2113
|
+
}>;
|
|
2114
|
+
}>;
|
|
1966
2115
|
/**
|
|
1967
2116
|
* ADR-178: File a proposal sourced from open-web agent research.
|
|
1968
2117
|
*
|
|
@@ -2022,6 +2171,17 @@ declare class RegistrationResource extends BaseResource {
|
|
|
2022
2171
|
export interface CatalogHealthItem {
|
|
2023
2172
|
grain: "work" | "recording" | "release" | "person";
|
|
2024
2173
|
issue: string;
|
|
2174
|
+
/**
|
|
2175
|
+
* A sentence a person would recognise ("recordings sharing an ISRC with
|
|
2176
|
+
* another recording"), or null when the issue has no wording yet.
|
|
2177
|
+
*
|
|
2178
|
+
* ⚠️ SAY THIS, NOT `issue`. A bare key relayed to a user reads as
|
|
2179
|
+
* "junk_person" — the failure recorded in `.claude/rules/canonical-model.md`,
|
|
2180
|
+
* where an agent said "WORK_NO_WRITER" out loud because a narrowing adapter
|
|
2181
|
+
* dropped the only human-readable field. `issue` stays for arguments
|
|
2182
|
+
* (`catalogHealthPlan({only: [...]})` selects on it); label is for prose.
|
|
2183
|
+
*/
|
|
2184
|
+
label: string | null;
|
|
2025
2185
|
dimension: "completeness" | "cleanliness";
|
|
2026
2186
|
severity: "high" | "medium" | "low";
|
|
2027
2187
|
count: number;
|
|
@@ -2036,6 +2196,11 @@ export interface CatalogHealthVerdict {
|
|
|
2036
2196
|
completeness: number | null;
|
|
2037
2197
|
cleanliness: number | null;
|
|
2038
2198
|
};
|
|
2199
|
+
/** entities considered per dimension — what each dimension score is a share of; null iff that score is null (2026-08-26) */
|
|
2200
|
+
dimensionConsidered: {
|
|
2201
|
+
completeness: number | null;
|
|
2202
|
+
cleanliness: number | null;
|
|
2203
|
+
};
|
|
2039
2204
|
assessed: string[];
|
|
2040
2205
|
notAssessed: string[];
|
|
2041
2206
|
items: CatalogHealthItem[];
|
|
@@ -2305,10 +2470,12 @@ export interface AcknowledgeNotificationsResponse {
|
|
|
2305
2470
|
}
|
|
2306
2471
|
declare class DiscoveriesResource extends BaseResource {
|
|
2307
2472
|
/**
|
|
2308
|
-
*
|
|
2309
|
-
*
|
|
2310
|
-
*
|
|
2311
|
-
*
|
|
2473
|
+
* Claim a pending discovered_credits row in the caller's org. ADR-252
|
|
2474
|
+
* WS-A: this is a STATUS TRANSITION on discovered_credits — no credit
|
|
2475
|
+
* row is written anywhere by this call. Check-and-set on status —
|
|
2476
|
+
* returns DISCOVERY_ALREADY_RESOLVED (409) if another session won the
|
|
2477
|
+
* race. is_first_claim=true triggers the checkout pill on the agent
|
|
2478
|
+
* surface.
|
|
2312
2479
|
*/
|
|
2313
2480
|
claimCredit(id: string): Promise<ClaimCreditResponse>;
|
|
2314
2481
|
/**
|
|
@@ -2322,10 +2489,13 @@ declare class DiscoveriesResource extends BaseResource {
|
|
|
2322
2489
|
*/
|
|
2323
2490
|
claimCustody(id: string): Promise<ClaimCustodyResponse>;
|
|
2324
2491
|
/**
|
|
2325
|
-
* INSTANT path — drain a pending discovered_artists row
|
|
2326
|
-
*
|
|
2327
|
-
*
|
|
2328
|
-
*
|
|
2492
|
+
* INSTANT path — drain a pending discovered_artists row via
|
|
2493
|
+
* artistClaimingService.processClaimDecision: CAS-updates work_claims
|
|
2494
|
+
* and inserts the claimed performer credit. ADR-252 WS-A: a performer
|
|
2495
|
+
* credit is a MASTER credit, so it lands in recording_credits (role
|
|
2496
|
+
* 'Performer') on the work's sole recording — NOT the dropped
|
|
2497
|
+
* work_credits table. No +72h window; identity evidence was validated
|
|
2498
|
+
* at discovery time.
|
|
2329
2499
|
*
|
|
2330
2500
|
* Refuses with 409 ADMIN_REVIEW_IN_PROGRESS when an open artist_claims
|
|
2331
2501
|
* row exists for the same (work, person) — see response body
|
|
@@ -2507,6 +2677,97 @@ export interface SubscriptionStatusResponse {
|
|
|
2507
2677
|
recommendedTier: BillingTier;
|
|
2508
2678
|
} | null;
|
|
2509
2679
|
organisationId: string;
|
|
2680
|
+
/**
|
|
2681
|
+
* The org's price card, in its own billing currency. `null` when billing
|
|
2682
|
+
* enforcement is off on this deployment, and ABSENT against a deployment
|
|
2683
|
+
* whose route predates the field — hence both `?` and `| null`. Consumers
|
|
2684
|
+
* must read "no pricing" as "do not state a price", never as "free".
|
|
2685
|
+
*/
|
|
2686
|
+
pricing?: PricingSummary | null;
|
|
2687
|
+
/**
|
|
2688
|
+
* How much enrichment is being withheld pending payment. Same two-shaped
|
|
2689
|
+
* absence as `pricing` above.
|
|
2690
|
+
*/
|
|
2691
|
+
held?: HeldSummary | null;
|
|
2692
|
+
}
|
|
2693
|
+
/**
|
|
2694
|
+
* The three things a caller can be asked to pay for. Mirrors `PayOffer` in
|
|
2695
|
+
* `lib/services/billing-engine/pay-link.ts`; the route 400s on anything else,
|
|
2696
|
+
* so this union is the wire contract rather than a convenience.
|
|
2697
|
+
*/
|
|
2698
|
+
export type PayOffer = "resident_month" | "unlock" | "settle";
|
|
2699
|
+
/**
|
|
2700
|
+
* One priced offer as the routes publish it. The server composes `label`,
|
|
2701
|
+
* which already carries the formatted money — a client that re-words the
|
|
2702
|
+
* amount out of `amount_minor` becomes a second home for the price, which is
|
|
2703
|
+
* what `publicOffer` exists to prevent on the server side.
|
|
2704
|
+
*/
|
|
2705
|
+
export interface PayLinkOffer {
|
|
2706
|
+
offer: PayOffer;
|
|
2707
|
+
amount_minor: number;
|
|
2708
|
+
currency: string;
|
|
2709
|
+
label: string;
|
|
2710
|
+
}
|
|
2711
|
+
/** Findings pica is holding: `count` proposals across `entities` works. */
|
|
2712
|
+
export interface HeldSummary {
|
|
2713
|
+
count: number;
|
|
2714
|
+
entities: number;
|
|
2715
|
+
}
|
|
2716
|
+
/**
|
|
2717
|
+
* Every figure a reader of "what does pica cost" needs, derived server-side
|
|
2718
|
+
* from the constants that are actually charged (`pricingSummary()`).
|
|
2719
|
+
*
|
|
2720
|
+
* `overagePerSongMinorUnits` is denominated in `overageCurrency`, NOT
|
|
2721
|
+
* `currency` — the overage is charged in the canonical currency until
|
|
2722
|
+
* per-currency event pricing lands. The two fields are separate for that
|
|
2723
|
+
* reason; collapsing them would misprice every non-GBP org.
|
|
2724
|
+
*/
|
|
2725
|
+
export interface PricingSummary {
|
|
2726
|
+
currency: string;
|
|
2727
|
+
freeRunwayDeepProcesses: number;
|
|
2728
|
+
residentFeeMinorUnits: number;
|
|
2729
|
+
residentIncludedDeepProcesses: number;
|
|
2730
|
+
overagePerSongMinorUnits: number;
|
|
2731
|
+
overageCurrency: string;
|
|
2732
|
+
unlockMinorUnits: number;
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* `POST /admin/billing/pay-link`. There is no `{success, data}` envelope on
|
|
2736
|
+
* this route — the body IS the response, so `BaseResource.request`'s
|
|
2737
|
+
* `data.data || data` returns it whole.
|
|
2738
|
+
*/
|
|
2739
|
+
export interface PayLinkResponse {
|
|
2740
|
+
pay_url: string;
|
|
2741
|
+
expires_at: string;
|
|
2742
|
+
offer: PayOffer;
|
|
2743
|
+
/** Every offer that currently applies, including the one minted. */
|
|
2744
|
+
offers: PayLinkOffer[];
|
|
2745
|
+
held: HeldSummary;
|
|
2746
|
+
/** One sentence naming both ways the link can be paid. */
|
|
2747
|
+
how: string;
|
|
2748
|
+
}
|
|
2749
|
+
declare class BillingResource extends BaseResource {
|
|
2750
|
+
/**
|
|
2751
|
+
* Mint a pay link for one offer. Minting is not charging: the link is a
|
|
2752
|
+
* capability an agent POSTs with a Machine Payments credential, or a person
|
|
2753
|
+
* opens in a browser and pays by card.
|
|
2754
|
+
*
|
|
2755
|
+
* Refusals arrive as `ApiError` carrying the route's status with its JSON
|
|
2756
|
+
* body embedded in the message (the shape `duplicates.ts` and
|
|
2757
|
+
* `integrity.ts` already parse): 403 `billing not enabled`; 400
|
|
2758
|
+
* `nothing_held_for_entity` / `entity_id is required to unlock`; 409
|
|
2759
|
+
* `offer_no_longer_applies`, whose body lists the offers that DO apply.
|
|
2760
|
+
* A 403 can ALSO come from the auth wrapper in front of the route rather
|
|
2761
|
+
* than the route itself (`{ error: { code: "INSUFFICIENT_SCOPE", … } }`),
|
|
2762
|
+
* so status alone never identifies which refusal this is — read the body.
|
|
2763
|
+
* They are deliberately not caught here — the MCP tool turns each into a
|
|
2764
|
+
* structured refusal, and a resource that swallowed them would leave every
|
|
2765
|
+
* other caller unable to tell a refusal from an outage.
|
|
2766
|
+
*/
|
|
2767
|
+
mintPayLink(params: {
|
|
2768
|
+
offer: PayOffer;
|
|
2769
|
+
entity_id?: string;
|
|
2770
|
+
}): Promise<PayLinkResponse>;
|
|
2510
2771
|
}
|
|
2511
2772
|
/**
|
|
2512
2773
|
* ADR-210 Phase 2 — Stripe Checkout session output for
|
|
@@ -2826,6 +3087,47 @@ declare class ExportResource extends BaseResource {
|
|
|
2826
3087
|
work_id?: string;
|
|
2827
3088
|
work_ids?: string[];
|
|
2828
3089
|
}): Promise<any>;
|
|
3090
|
+
/**
|
|
3091
|
+
* The three diligence documents that had no agent path at all until
|
|
3092
|
+
* 2026-07-30 (ADR-303). Each has had a working route and a fully-styled PDF
|
|
3093
|
+
* for months, reachable only by typing the URL, because the buttons that
|
|
3094
|
+
* opened them lived in the `/admin` page tree ADR-251 retired.
|
|
3095
|
+
*
|
|
3096
|
+
* `delivery=url` is the default here for the same reason PR 3 moved the other
|
|
3097
|
+
* exports onto it: `request()` calls `response.json()`, so an inline binary ZIP
|
|
3098
|
+
* cannot cross this transport. `inline` swaps to `format=json` for a sandboxed
|
|
3099
|
+
* agent that cannot fetch a signed S3 URL.
|
|
3100
|
+
*/
|
|
3101
|
+
/**
|
|
3102
|
+
* The ADR-100 catalogue snapshot: score, financials, ownership coverage, gaps
|
|
3103
|
+
* with a suggested action for each, physical and production assets, and a
|
|
3104
|
+
* "what to do next" list.
|
|
3105
|
+
*
|
|
3106
|
+
* It had no agent path and no UI control — its buttons lived on the
|
|
3107
|
+
* `/admin/catalog` pages ADR-251 retired, which is why an 80%-implemented
|
|
3108
|
+
* "replace the nine fragments with one document" decision quietly stopped
|
|
3109
|
+
* being reachable at all. Restored 2026-07-30 rather than deleted: the
|
|
3110
|
+
* roadmap and the production-asset provenance exist nowhere else.
|
|
3111
|
+
*/
|
|
3112
|
+
picaSnapshot(params?: {
|
|
3113
|
+
scope?: "everything" | "selected" | "work";
|
|
3114
|
+
work_ids?: string[];
|
|
3115
|
+
}): Promise<any>;
|
|
3116
|
+
ownershipRecord(params?: {
|
|
3117
|
+
inline?: boolean;
|
|
3118
|
+
}): Promise<any>;
|
|
3119
|
+
rightsProof(params?: {
|
|
3120
|
+
inline?: boolean;
|
|
3121
|
+
}): Promise<any>;
|
|
3122
|
+
/**
|
|
3123
|
+
* The diligence PACK (the ZIP with its PDF). Distinct from
|
|
3124
|
+
* `analytics.catalogDiligence()`, which reads the same data as JSON and stays
|
|
3125
|
+
* the right tool for "am I ready to register?" — a question that wants an
|
|
3126
|
+
* answer, not a document.
|
|
3127
|
+
*/
|
|
3128
|
+
diligencePack(params?: {
|
|
3129
|
+
inline?: boolean;
|
|
3130
|
+
}): Promise<any>;
|
|
2829
3131
|
songRegistration(params?: {
|
|
2830
3132
|
iswc_status?: "missing" | "present" | "all";
|
|
2831
3133
|
work_ids?: string[];
|
|
@@ -3013,11 +3315,33 @@ interface ImportResult {
|
|
|
3013
3315
|
errors: Array<{
|
|
3014
3316
|
row: number;
|
|
3015
3317
|
field: string;
|
|
3016
|
-
message
|
|
3318
|
+
/** The server's ValidationError carries the text in `error`; `message`
|
|
3319
|
+
* is kept for callers that normalised it. Read `error ?? message`. */
|
|
3320
|
+
error?: string;
|
|
3321
|
+
message?: string;
|
|
3322
|
+
/** "error" = the row did not land; "warning" = skipped duplicate etc. */
|
|
3017
3323
|
severity: string;
|
|
3018
3324
|
}>;
|
|
3019
3325
|
summary: string;
|
|
3020
3326
|
dryRun: boolean;
|
|
3327
|
+
/**
|
|
3328
|
+
* True when a LIVE run wrote rows AND some rows failed with severity
|
|
3329
|
+
* "error" (a batch import is not transactional — the written rows are
|
|
3330
|
+
* committed). Set by POST /admin/import/execute; false for a clean run,
|
|
3331
|
+
* a dry run, or a run whose only "errors" are warnings.
|
|
3332
|
+
*/
|
|
3333
|
+
partial?: boolean;
|
|
3334
|
+
/**
|
|
3335
|
+
* Which slice of the file this call imported (ADR-314). `nextOffset` is
|
|
3336
|
+
* the `rowOffset` to pass next, or null when the file is done.
|
|
3337
|
+
*/
|
|
3338
|
+
rowRange?: {
|
|
3339
|
+
offset: number;
|
|
3340
|
+
limit: number;
|
|
3341
|
+
count: number;
|
|
3342
|
+
totalRowsInFile: number;
|
|
3343
|
+
nextOffset: number | null;
|
|
3344
|
+
};
|
|
3021
3345
|
}
|
|
3022
3346
|
/**
|
|
3023
3347
|
* Source of CSV content — exactly one must be provided:
|
|
@@ -3072,6 +3396,14 @@ declare class ImportResource extends BaseResource {
|
|
|
3072
3396
|
dryRun?: boolean;
|
|
3073
3397
|
skipInvalidRows?: boolean;
|
|
3074
3398
|
batchSize?: number;
|
|
3399
|
+
/** "skip" (server default): a row that trips a unique constraint
|
|
3400
|
+
* becomes a warning, the rest of its batch still lands.
|
|
3401
|
+
* "error": one collision fails the whole batch. */
|
|
3402
|
+
conflictStrategy?: "skip" | "error";
|
|
3403
|
+
/** First data row to import, 0-based (default 0). ADR-314 cursor. */
|
|
3404
|
+
rowOffset?: number;
|
|
3405
|
+
/** Rows to import in this call (server default 2,000, max 10,000). */
|
|
3406
|
+
rowLimit?: number;
|
|
3075
3407
|
};
|
|
3076
3408
|
}): Promise<ImportResult>;
|
|
3077
3409
|
getFields(domain: ImportDomain): Promise<Array<{
|
|
@@ -3304,7 +3636,11 @@ declare class CollaboratorsResource extends BaseResource {
|
|
|
3304
3636
|
}>>;
|
|
3305
3637
|
/**
|
|
3306
3638
|
* ADR-157 warm path — accept an invite addressed to the authenticated
|
|
3307
|
-
* user
|
|
3639
|
+
* user, and flip its status to confirmed. The credit write is
|
|
3640
|
+
* grain-routed (ADR-265): a composition-grain invite writes
|
|
3641
|
+
* work_collaborators, a master/owner-grain invite attests the person's
|
|
3642
|
+
* pending recording_credits. ADR-252 WS-A dropped work_credits at
|
|
3643
|
+
* DB-M3, so no row is written there.
|
|
3308
3644
|
*/
|
|
3309
3645
|
accept(inviteId: string): Promise<Record<string, unknown>>;
|
|
3310
3646
|
/**
|
|
@@ -3670,9 +4006,14 @@ declare class RecordingCreditsResource extends BaseResource {
|
|
|
3670
4006
|
*/
|
|
3671
4007
|
atomicAdd(recordingId: string, input: RecordingCreditCreateInput): Promise<AtomicCreditResult>;
|
|
3672
4008
|
/**
|
|
3673
|
-
* ADR-232 atomic remove —
|
|
3674
|
-
*
|
|
3675
|
-
*
|
|
4009
|
+
* ADR-232 atomic remove — the route returns 403 INSUFFICIENT_SCOPE on a
|
|
4010
|
+
* 0-row delete. AC-2 strict semantics for pica_credit_remove.
|
|
4011
|
+
*
|
|
4012
|
+
* As of 2026-08-24 that is the route's behaviour for every caller, flagged
|
|
4013
|
+
* or not; `?atomic=1` is kept only so an older published server keeps
|
|
4014
|
+
* working, and is accepted-and-ignored server-side. **Remove when
|
|
4015
|
+
* `@withpica/mcp-server` 2.96.0 ships (the alias-removal release)**, together
|
|
4016
|
+
* with the route's param handling — the two must go in the same release.
|
|
3676
4017
|
*/
|
|
3677
4018
|
atomicRemove(recordingId: string, creditId: string): Promise<AtomicCreditResult>;
|
|
3678
4019
|
/**
|
|
@@ -4418,6 +4759,7 @@ export declare class PicaClient {
|
|
|
4418
4759
|
recordings: RecordingsResource;
|
|
4419
4760
|
licensing: LicensingResource;
|
|
4420
4761
|
bookings: BookingsResource;
|
|
4762
|
+
shows: ShowsResource;
|
|
4421
4763
|
credits: CreditsResource;
|
|
4422
4764
|
creditsBalance: CreditsBalanceResource;
|
|
4423
4765
|
picaScore: PicaScoreResource;
|
|
@@ -4486,6 +4828,8 @@ export declare class PicaClient {
|
|
|
4486
4828
|
workflowOutcomes: WorkflowOutcomesResource;
|
|
4487
4829
|
feedback: FeedbackResource;
|
|
4488
4830
|
subscription: SubscriptionResource;
|
|
4831
|
+
/** MPP pay rail (WS-B) — mints pay links; never charges. */
|
|
4832
|
+
billing: BillingResource;
|
|
4489
4833
|
opsIssues: OpsIssuesResource;
|
|
4490
4834
|
discoveries: DiscoveriesResource;
|
|
4491
4835
|
agentIdentity: AgentIdentityResource;
|