@withpica/mcp-sdk 3.16.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [3.17.0] - 2026-09-13
15
+
16
+ ### Fixed
17
+
18
+ - **`credits.atomicUpdate()` now returns what its type declares.** It went
19
+ through `request()`, whose `return data.data || data` narrowed the route's
20
+ `{ data, credit_id, work_id, allocation }` envelope to the bare credit row —
21
+ so `allocation` (the work's writer allocation after the edit, which
22
+ `pica_credit_update` promises in its description) was always `undefined`,
23
+ and the tool's `allocation.status` completion hints were dead code. It now
24
+ uses `requestWithEnvelope` and returns `{ credit_id, work_id, credit,
25
+ allocation }`. Callers that read credit fields off the top-level result
26
+ should read `result.credit` — the declared shape never promised them there.
27
+
14
28
  ## [3.16.0] - 2026-09-09
15
29
 
16
30
  ### Added
package/dist/index.d.ts CHANGED
@@ -1347,6 +1347,22 @@ export interface WorkCreditAtomicAddInput {
1347
1347
  share_pct?: number;
1348
1348
  notes?: string;
1349
1349
  }
1350
+ /**
1351
+ * In-place edit of ONE credit (2026-09-11). Every field optional; only the
1352
+ * fields present are written. `share_pct: null` records the share as
1353
+ * UNKNOWN, never as 0. `instrument` applies to a recording (master) credit.
1354
+ */
1355
+ export interface WorkCreditAtomicUpdateInput {
1356
+ credit_type?: WorkCreditAtomicAddInput["credit_type"];
1357
+ share_pct?: number | null;
1358
+ credited_name?: string | null;
1359
+ notes?: string | null;
1360
+ instrument?: string | null;
1361
+ }
1362
+ export interface AtomicCreditUpdateResult extends AtomicCreditResult {
1363
+ /** The work's writer allocation AFTER this change — closed / open / incomplete / no_writers / unscalable. */
1364
+ allocation?: Record<string, unknown>;
1365
+ }
1350
1366
  export interface AtomicCreditResult {
1351
1367
  credit_id: string;
1352
1368
  credit?: Record<string, unknown>;
@@ -1375,6 +1391,20 @@ declare class CreditsResource extends BaseResource {
1375
1391
  * semantics — never leaks 404 vs 403 via latency).
1376
1392
  */
1377
1393
  atomicRemove(workId: string, creditId: string): Promise<AtomicCreditResult>;
1394
+ /**
1395
+ * Edit one credit in place — the verb between add and remove.
1396
+ *
1397
+ * Goes through `requestWithEnvelope`, not `request()`: the route answers
1398
+ * `{ success, data: <credit row>, credit_id, work_id, allocation }` with
1399
+ * `allocation` as a SIBLING of `data`, and `request()`'s
1400
+ * `return data.data || data` narrowed that to the bare credit row — so
1401
+ * every caller received an object that matched none of this method's
1402
+ * declared return type, and `allocation` (which `pica_credit_update`
1403
+ * promises in its description) was always undefined. Measured 2026-09-12
1404
+ * on the #2210 preview; pinned by the holdout contract
1405
+ * `scenarios/contracts/credit-update.spec.ts` leg 4.
1406
+ */
1407
+ atomicUpdate(workId: string, creditId: string, patch: WorkCreditAtomicUpdateInput): Promise<AtomicCreditUpdateResult>;
1378
1408
  /**
1379
1409
  * Send pending credits on a work to their recipients for attestation.
1380
1410
  * Lightweight alternative to pica_split_sheet_send — fans out the
@@ -3248,7 +3278,12 @@ declare class ExportResource extends BaseResource {
3248
3278
  }): Promise<any>;
3249
3279
  }
3250
3280
  declare class DuplicatesResource extends BaseResource {
3251
- findDuplicates(entityType: "works" | "people" | "releases" | "recordings"): Promise<any>;
3281
+ /**
3282
+ * ⚠️ `audio_files` is findable but NOT mergeable — `merge` below keeps the
3283
+ * narrower union deliberately. Re-uploaded audio is resolved by a person
3284
+ * deleting a file, never by a merge (ops issue dcea642b, 2026-09-10).
3285
+ */
3286
+ findDuplicates(entityType: "works" | "people" | "releases" | "recordings" | "audio_files"): Promise<any>;
3252
3287
  merge(entityType: "work" | "person" | "recording" | "release", winnerId: string, loserIds: string[]): Promise<any>;
3253
3288
  }
3254
3289
  declare class EntityContextResource extends BaseResource {