@withpica/mcp-server 2.23.0 → 2.24.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 +21 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -8
- package/dist/config.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +3 -1
- package/dist/prompts/index.js.map +1 -1
- package/dist/server-instructions.d.ts +1 -1
- package/dist/server-instructions.d.ts.map +1 -1
- package/dist/server-instructions.js +13 -15
- package/dist/server-instructions.js.map +1 -1
- package/dist/tools/agent-identity.d.ts +36 -0
- package/dist/tools/agent-identity.d.ts.map +1 -0
- package/dist/tools/agent-identity.js +269 -0
- package/dist/tools/agent-identity.js.map +1 -0
- package/dist/tools/agreements.d.ts.map +1 -1
- package/dist/tools/agreements.js +6 -2
- package/dist/tools/agreements.js.map +1 -1
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +13 -1
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/feedback.d.ts +22 -0
- package/dist/tools/feedback.d.ts.map +1 -0
- package/dist/tools/feedback.js +99 -0
- package/dist/tools/feedback.js.map +1 -0
- package/dist/tools/gap-hints.d.ts +53 -0
- package/dist/tools/gap-hints.d.ts.map +1 -0
- package/dist/tools/gap-hints.js +245 -0
- package/dist/tools/gap-hints.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +19 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.d.ts +5 -1
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +44 -25
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +209 -0
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +1 -1
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +20 -3
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +1 -1
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/settings.d.ts +2 -0
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +93 -1
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +6 -1
- package/dist/tools/works.js.map +1 -1
- package/package.json +2 -2
- package/server.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
+
## [2.24.0] - 2026-04-21
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **`pica_integrations_status` no longer tells users to "connect Spotify".** Two real-user failures on Claude Desktop (2026-04-21) traced back to the tool lumping platform-level Spotify/YouTube (PICA has its own credentials; no per-user OAuth exists or has ever existed) into the same "Available to connect" list as genuine user-OAuth peer connectors (Google/Notion/Airtable/Telegram). Failure modes observed: (1) user pasted a Spotify track URL → agent replied "head to your Pica dashboard and add Spotify as an integration"; (2) user asked "what songs do I have in pica" with a catalog holding 1 work → agent replied "you currently have no connections set up in Pica — so there are no songs or any other data accessible." Reshape: the tool now returns `peerConnectors` (the 4 actual OAuth services) separately from `platformReads` (Spotify, YouTube, MusicBrainz, MLC, ISNI, Discogs, with the tool name for each). Summary leads with "PICA catalog is ALWAYS accessible via pica_works_query, pica_people_query, pica_dashboard_briefing, pica_search_all — no setup required." The dead `connectedProviders.includes("spotify")` check that could never evaluate true was removed.
|
|
19
|
+
- **Server instructions: catalog-is-always-accessible guidance.** Handshake now explicitly states (a) the catalog is always accessible via the read tools with zero setup, (b) `pica_integrations_status` showing "0 connected" refers to optional peer connectors, NOT the catalog — call `pica_works_query` to check, (c) Spotify/YouTube URLs go through `pica_import_streaming_link` / `pica_import_youtube_link` directly; no per-user Spotify/YouTube OAuth exists to set up, do not tell the user to "connect Spotify in your dashboard". Replaces earlier copy that left the agent free to hallucinate a dashboard-integration flow. `lib/mcp/server-instructions.ts` parity copy updated in lockstep; the HTTP transport at `/api/mcp` picks up the new text on next handshake without requiring a redeploy of this package. Under the 2000-char token budget at 1833 chars.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **ADR-180 Phase 3: full TOOL_METADATA coverage.** 29 tools retrofitted in `mcp-server/src/tools/metadata.ts` across eight family-scoped commits — resolve (3), cascade (3), enrichment proposals (4), collaborators (4), notify-user scheduling (3), physical-assets links (4), misc singletons (5), and the ADR-185 Part 1 agent-identity drift (3). `scripts/mcp-tool-lint-baseline.json` is deleted; MCP Tool Lint now runs in fully-strict mode. No behaviour change — tool discovery, audit categorisation, and risk-tier gating now classify the same 29 tools they couldn't classify before. `credits_required` deliberately omitted from new entries (credit gating is a no-op pass-through since ADR-162). Retry-safety follows ADR-180's `risk × retry_safe` table — e.g. `pica_enrichment_proposal_apply` is `retry_safe: false` (writes to entity columns), `_reject` is `retry_safe: true` (content-hash suppression is set-once). ADR-180 flipped from `Proposed` to `Accepted`.
|
|
24
|
+
- **ADR-193 Surfaces 1+3: peer-connector coaching + URI source conventions (server-instructions addendum).** Handshake copy coaches agents to check peer MCPs (email / drive / notes / calendar / DAW) before asking users to paste or type data, and to cite findings via `pica_enrichment_propose` `sources[].url` using URI schemes — `gmail://` `gdrive://` `notion://` `file://` `telegram://` `calendar://` `daw://` `user://` `web://`. See `docs/mcp-source-uri-conventions.md` in the main repo for shapes. First concrete build for ADR-190 Principles 2 + 3 (Agent-Mediated Source Discovery). A latent HTTP-transport gap was fixed in the same develop commit (`63eef17f8`) — `/api/mcp/route.ts` was not wiring `SERVER_INSTRUCTIONS` into its Server constructor, so remote agentic clients (ChatGPT Apps, Claude Desktop remote, Cursor) saw zero coaching. The stdio transport in this package was always serving instructions correctly; only the remote transport was affected.
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **ADR-193 Surface 2: `gap_hints` envelope on 4 read tools.** `pica_works_inspect`, `pica_agreements_inspect`, `pica_people_inspect`, and `pica_enrichment_proposals_list` now emit an optional `gap_hints[]` field on `structuredContent` when a real gap is present. Each hint is capability-named (ADR-190 Principle 2 — `email_search` / `drive_search` / `filesystem_search` / `notes_search` / `calendar_search` / `web_search`, never vendor names), carries a concrete `query_shape`, and pre-fills the `then_call: "pica_enrichment_propose"` with the exact `then_args_shape` the agent should emit back (including URI-citation scaffolding from Surface 3). Gated by `MCP_GAP_HINTS_ENABLED=1` — off by default in prod. Empty array / omitted envelope when there's no real gap. Flat additive — the existing `CompletionHint` pipeline on `works_inspect` is untouched. Bundled: `enrich-metadata` prompt references the peer-connector pattern and points the agent at `gap_hints`.
|
|
29
|
+
- **ADR-185 Part 1: three new session-auth-only tools.** `pica_create_agent_identity`, `pica_issue_agent_grant`, `pica_list_my_agent_grants`. Back a user-issued agent-identity + scoped-grant primitive — the substrate for Parts 2 (settings UI) and 3 (per-write provenance stamping). All three require `write:agent_identity` scope AND session-auth (raw API key / OAuth); the HTTP MCP dispatcher refuses `pica_grant_` callers with a structured `reason: "session_auth_required"` error before execution per AC 12. Subject is always the authenticated user — caller-supplied `user_id` is dropped per ADR-184 rule 2 / ADR-185 rule 1. Grant tokens use the format `pica_grant_<64 hex>` and are hashed at rest with HMAC-SHA256 + `API_KEY_HASH_PEPPER` (same scheme as api_keys per ADR-185 line 193 + ADR-167 D-5).
|
|
30
|
+
- **ADR-185 Part 2: two new session-auth-only tools.** `pica_revoke_agent_grant` (DELETE `/admin/agent-grants/:id`, idempotent, 404 masks ownership failures) and `pica_get_agent_activity` (GET `/admin/agent-activity`, paginated, optionally filtered by identity or grant). Both appended to `SESSION_AUTH_ONLY_TOOLS` in the HTTP MCP dispatcher and to the `write:agent_identity` scope bucket. Together with the Part 1 trio this completes the five-tool agent-identity surface the ADR Scope requires. Revocation takes effect on the next request (AC: within 60s — `resolveGrantToken` checks `revoked_at` on every call, no cache layer).
|
|
31
|
+
- **ADR-185 Part 3 passes 1-5: agent-action provenance stamping wraps 27 write-tool families.** Part 3 layers two complementary wrappers over existing write tools so every per-grant write records a row in `mcp_agent_actions` for audit + revoke-replay. `withAgentActionStamp` (compensation-after): handler runs, stamps; on stamp failure, compensation undoes the write via captured prior state — used for creates and updates (soft-delete families get meaningful delete compensation — flip `is_deleted` back). `withAgentActionStampFirst` (stamp-first, pass 4): stamp commits BEFORE the destructive op; stamp-ok + handler-fail logs a "ghost stamp" at error level — used for hard-delete families where compensation is impossible. Both wrappers are no-ops when the caller is not an agent grant (session-auth / raw API key writes are unaffected). Families covered across the five passes: works/recordings/people/agreements/releases/notes creates; notes_delete; sessions_create; share_links_create; projects_create; multimedia_create; recording_splits_create; works_update; recordings_update; people_update; agreements_update; projects_update; notes_update; releases_update; people_delete; publishers_create; the six hard-delete families (works/recordings/agreements/projects/sessions/releases) via the stamp-first variant; and pass 5's `pica_projects_attach_works` (project_works insert wrapped, GET + POST migrated from `requireAuth` + `getUserProfile` to `withOrgContext` for consistency). `pica_sessions_update` remains deferred — action-branching route (start/complete/cancel + participant add/remove + regular update) needs a dedicated design slice before wrapping.
|
|
32
|
+
- **New tool** `pica_submit_feedback`: agent-native feedback submission. Routes bug_report→devops, feature_request→ceo, question→comms, other→category-mapped. Requires `write:feedback` scope. Subject is always the authenticated user per ADR-184 rule 2. (ADR-184 slice 8 — landed on develop 2026-04-19 post-2.23.0 publish.)
|
|
33
|
+
- **ADR-189 Phase 3: two new identity-capture tools.** `pica_update_my_identity` (stage_name / IPI / ISNI / IPN / PRO) and `pica_update_organisation_profile` (org_type / display_name / tagline / ipi_number). Both admin-scoped, both `retry_safe: true` (idempotent upserts — re-applying the same IPI leaves the row in the same state). Subject derived from auth (no `user_id` / `organisation_id` parameters — ADR-184 rule 2). After the identity write, `pica_update_my_identity` re-runs cross-org discovery and returns the count of newly-visible credits / custody / artist-link rows so the agent can surface "found N more — claim them?" in the same conversation turn. Rate-limited at 20 writes/hour/user via `checkActionRateLimit` (R1 mitigation). Admin routes (`POST /api/admin/my-identity`, `POST /api/admin/organisation-profile`) wrap in `withAgentActionStamp` when the caller presents an agent grant (ADR-185 Part 3) — UPDATE compensation captures pre-write state via read-before-write and PATCHes the row back on stamp failure, or deletes a lazy-created person row.
|
|
34
|
+
|
|
14
35
|
## [2.23.0] - 2026-04-19
|
|
15
36
|
|
|
16
37
|
### Added
|
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,wBAAgB,UAAU,IAAI,YAAY,CAwCzC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAWzD"}
|
package/dist/config.js
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
* MCP Server Configuration
|
|
4
4
|
*/
|
|
5
5
|
import { readCredentials, getDefaultCredentialsPath, } from "@withpica/mcp-utils";
|
|
6
|
+
// Single TS-side source of truth for the customer MCP server version.
|
|
7
|
+
// Keep in sync with mcp-server/package.json; scripts/lint-mcp-tools.ts
|
|
8
|
+
// enforces that and blocks literal version strings elsewhere. Surfaces
|
|
9
|
+
// on stdio via the boot banner + MCP `initialize` handshake (loadConfig
|
|
10
|
+
// below) and on HTTP via app/api/mcp/route.ts, which imports this const
|
|
11
|
+
// from mcp-server/dist/config.js. Past drift incidents: 2026-04-08
|
|
12
|
+
// (banner 2.5.0 vs npm 2.6.1), 2026-04-19 ADR-181 Phase 2 (banner 2.6.2
|
|
13
|
+
// vs npm 2.22.0). ADR-180 Phase 2 collapses the duplication.
|
|
14
|
+
export const VERSION = "2.24.0";
|
|
6
15
|
export function loadConfig() {
|
|
7
16
|
const credentialsPath = process.env.PICA_CREDENTIALS_PATH || getDefaultCredentialsPath();
|
|
8
17
|
const debug = process.env.DEBUG === "true" || process.env.DEBUG === "1";
|
|
@@ -30,14 +39,7 @@ export function loadConfig() {
|
|
|
30
39
|
picaApiKey,
|
|
31
40
|
picaApiUrl: process.env.PICA_API_URL || "https://withpica.com/api",
|
|
32
41
|
serverName: "pica-mcp-server",
|
|
33
|
-
|
|
34
|
-
// string surfaces in the boot banner ([MCP Server] Version: ...) and
|
|
35
|
-
// in the MCP `initialize` handshake response under `serverInfo.version`,
|
|
36
|
-
// which is what clients display in their connector UIs. Drift from
|
|
37
|
-
// package.json was caught 2026-04-08 — banner read 2.5.0 long after
|
|
38
|
-
// npm was on 2.6.1. Caught again 2026-04-19 during ADR-181 Phase 2 —
|
|
39
|
-
// banner read 2.6.2 long after npm was on 2.22.0; fixed here.
|
|
40
|
-
version: "2.23.0",
|
|
42
|
+
version: VERSION,
|
|
41
43
|
debug,
|
|
42
44
|
lobbyMode,
|
|
43
45
|
credentialsPath,
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,yBAAyB,GAC1B,MA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B;IA+B/B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAkC/B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgC5B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IA+BpC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAkC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAsChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAuC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAmChC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IA+CnC;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAoChC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -192,7 +192,9 @@ For each enrichment opportunity:
|
|
|
192
192
|
- Suggest potential sources (ISNI, MusicBrainz, etc.)
|
|
193
193
|
- Prioritize the most impactful enrichment opportunities
|
|
194
194
|
|
|
195
|
-
Focus on people and works where enrichment would add the most value
|
|
195
|
+
Focus on people and works where enrichment would add the most value.
|
|
196
|
+
|
|
197
|
+
ADR-193 — before asking the user to paste facts, check your other connected MCPs (email, drive, notes, calendar) for evidence first. When you find it, cite the source via pica_enrichment_propose with a URI-style source (gmail://thread-id/..., gdrive://file-id/..., notion://page-id/..., file:///..., etc). PICA read tools surface gap_hints pointing at the exact capability + query shape to use — follow them when present.`,
|
|
196
198
|
},
|
|
197
199
|
},
|
|
198
200
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AA6B7D,MAAM,OAAO,cAAc;IACzB;;OAEG;IACH,WAAW;QACT,OAAO;YACL;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EACT,+FAA+F;gBACjG,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EACT,kEAAkE;gBACpE,SAAS,EAAE,EAAE;aACd;YACD;gBACE,IAAI,EAAE,iBAAiB;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AAM,eAAe,GAAG,MAAM;YAC5B,CAAC,CAAC,+BAA+B,MAAM,oCAAoC,MAAM,IAAI,KAAK,mCAAmC;YAC7H,CAAC,CAAC,iJAAiJ,CAAC;QAEtJ,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;EAEhB,eAAe;;;;;;;;;;;;;;;;;;;uGAmBsF;qBAC5F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;mDAqBiC;qBACxC;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,2BAA2B;QACjC,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAiC8G;qBACrH;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,uBAAuB;QAC7B,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;0GAuBwF;qBAC/F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* Block playbook: "document the high level of your server"
|
|
6
6
|
* Lowin: "instructions are context — design them as context"
|
|
7
7
|
*/
|
|
8
|
-
export declare const SERVER_INSTRUCTIONS = "PICA manages music catalog metadata \u2014 works, recordings, people, credits, agreements,
|
|
8
|
+
export declare const SERVER_INSTRUCTIONS = "PICA manages music catalog metadata \u2014 works, recordings, people, credits, agreements, rights.\n\nStart here:\n- pica_dashboard_briefing \u2014 daily summary of what needs attention\n- pica_search_all \u2014 find any entity by name, ISWC, ISRC, or IPI\n- pica_works_query / pica_people_query \u2014 browse the catalog\n\nThe catalog is ALWAYS accessible via the tools above \u2014 zero setup, no integration required. If pica_integrations_status shows \"0 connected\" that refers to optional peer connectors (Google/Notion/Airtable/Telegram), NOT the catalog; call pica_works_query to check what's there.\n\nSpotify/YouTube URLs: call pica_import_streaming_link (Spotify/Deezer) or pica_import_youtube_link directly. PICA reads these at platform level \u2014 there is no per-user Spotify/YouTube OAuth; do not tell the user to \"connect Spotify\".\n\nKey patterns:\n- Read tools are safe to call freely (readOnlyHint=true)\n- _inspect tools take sections (e.g., pica_works_inspect sections: [\"health\", \"completeness\"])\n- Write tools confirm what changed; destructive tools (delete/merge) need two-step confirmation with a token\n- Errors include \"suggestion\" and \"next_tool\" for recovery\n- Enrichment (pica_enrich_*) pulls from Spotify, MusicBrainz, MLC, ISNI, Discogs, YouTube \u2014 agent picks sources from available identifiers\n\nQuery endpoints accept \"limit\" (default 50) and paginate. IDs are UUIDs \u2014 use a _query tool first when unsure.\n\nWrite tools: announce intent, confirm result. Destructive tools: describe impact, require explicit user confirmation.\n\nPeer connectors (email, drive, notes, calendar, DAW MCPs): when PICA shows missing data, check peer MCPs before asking the user. Cite via pica_enrichment_propose sources[].url with URI schemes \u2014 gmail:// gdrive:// notion:// file:// telegram:// calendar:// daw:// user:// web://. See docs/mcp-source-uri-conventions.md.";
|
|
9
9
|
//# sourceMappingURL=server-instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,+3DAsB+R,CAAC"}
|
|
@@ -6,29 +6,27 @@
|
|
|
6
6
|
* Block playbook: "document the high level of your server"
|
|
7
7
|
* Lowin: "instructions are context — design them as context"
|
|
8
8
|
*/
|
|
9
|
-
export const SERVER_INSTRUCTIONS = `PICA manages music catalog metadata — works, recordings, people, credits, agreements,
|
|
9
|
+
export const SERVER_INSTRUCTIONS = `PICA manages music catalog metadata — works, recordings, people, credits, agreements, rights.
|
|
10
10
|
|
|
11
11
|
Start here:
|
|
12
12
|
- pica_dashboard_briefing — daily summary of what needs attention
|
|
13
13
|
- pica_search_all — find any entity by name, ISWC, ISRC, or IPI
|
|
14
14
|
- pica_works_query / pica_people_query — browse the catalog
|
|
15
15
|
|
|
16
|
+
The catalog is ALWAYS accessible via the tools above — zero setup, no integration required. If pica_integrations_status shows "0 connected" that refers to optional peer connectors (Google/Notion/Airtable/Telegram), NOT the catalog; call pica_works_query to check what's there.
|
|
17
|
+
|
|
18
|
+
Spotify/YouTube URLs: call pica_import_streaming_link (Spotify/Deezer) or pica_import_youtube_link directly. PICA reads these at platform level — there is no per-user Spotify/YouTube OAuth; do not tell the user to "connect Spotify".
|
|
19
|
+
|
|
16
20
|
Key patterns:
|
|
17
|
-
- Read tools are safe to call freely (
|
|
18
|
-
-
|
|
19
|
-
- Write tools (
|
|
20
|
-
-
|
|
21
|
-
-
|
|
21
|
+
- Read tools are safe to call freely (readOnlyHint=true)
|
|
22
|
+
- _inspect tools take sections (e.g., pica_works_inspect sections: ["health", "completeness"])
|
|
23
|
+
- Write tools confirm what changed; destructive tools (delete/merge) need two-step confirmation with a token
|
|
24
|
+
- Errors include "suggestion" and "next_tool" for recovery
|
|
25
|
+
- Enrichment (pica_enrich_*) pulls from Spotify, MusicBrainz, MLC, ISNI, Discogs, YouTube — agent picks sources from available identifiers
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
Use pica_dashboard_attention for items needing action.
|
|
25
|
-
Use pica_works_inspect with sections: ["health", "completeness"] to check data quality.
|
|
26
|
-
Enrichment tools (pica_enrich_work_*) pull from external sources — Spotify, MusicBrainz, MLC, ISNI, Discogs, YouTube.
|
|
27
|
-
The agent orchestrates enrichment — try sources based on available identifiers, follow recovery hints.
|
|
27
|
+
Query endpoints accept "limit" (default 50) and paginate. IDs are UUIDs — use a _query tool first when unsure.
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
IDs are UUIDs. When unsure of an ID, use a _query tool first.
|
|
29
|
+
Write tools: announce intent, confirm result. Destructive tools: describe impact, require explicit user confirmation.
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
When calling destructive tools: describe exactly what will be deleted/merged and get explicit user confirmation before calling.`;
|
|
31
|
+
Peer connectors (email, drive, notes, calendar, DAW MCPs): when PICA shows missing data, check peer MCPs before asking the user. Cite via pica_enrichment_propose sources[].url with URI schemes — gmail:// gdrive:// notion:// file:// telegram:// calendar:// daw:// user:// web://. See docs/mcp-source-uri-conventions.md.`;
|
|
34
32
|
//# sourceMappingURL=server-instructions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG
|
|
1
|
+
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;+TAsB4R,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Identity Tools — MCP surface for ADR-185 Parts 1+2.
|
|
3
|
+
*
|
|
4
|
+
* Five session-auth-only tools (Part 1 shipped 1-3, Part 2 adds 4-5):
|
|
5
|
+
* - pica_create_agent_identity
|
|
6
|
+
* - pica_issue_agent_grant
|
|
7
|
+
* - pica_list_my_agent_grants
|
|
8
|
+
* - pica_revoke_agent_grant (Part 2)
|
|
9
|
+
* - pica_get_agent_activity (Part 2)
|
|
10
|
+
*
|
|
11
|
+
* All five route through the PICA HTTP API. The backing routes refuse
|
|
12
|
+
* `pica_grant_` callers with 403 `session_auth_required` per AC 12, so
|
|
13
|
+
* the session-auth-only guarantee is enforced once at the API layer and
|
|
14
|
+
* honoured by both stdio and HTTP MCP transports automatically. The
|
|
15
|
+
* HTTP dispatcher in app/api/mcp/route.ts also rejects at the tool layer
|
|
16
|
+
* via the SESSION_AUTH_ONLY_TOOLS set (belt-and-braces).
|
|
17
|
+
*
|
|
18
|
+
* Subject (user_id) is derived from the auth context — never from tool
|
|
19
|
+
* arguments (ADR-184 rule 1 / ADR-185 rule 1).
|
|
20
|
+
*/
|
|
21
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
22
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
23
|
+
export declare class AgentIdentityTools {
|
|
24
|
+
private pica;
|
|
25
|
+
constructor(pica: PicaClient);
|
|
26
|
+
getTools(): Array<{
|
|
27
|
+
definition: ToolDefinition;
|
|
28
|
+
executor: ToolExecutor;
|
|
29
|
+
}>;
|
|
30
|
+
private createIdentity;
|
|
31
|
+
private issueGrant;
|
|
32
|
+
private listMyGrants;
|
|
33
|
+
private revokeGrant;
|
|
34
|
+
private getActivity;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=agent-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-identity.d.ts","sourceRoot":"","sources":["../../src/tools/agent-identity.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAa/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAEtE,qBAAa,kBAAkB;IAC7B,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;YAsE3D,cAAc;YAmCd,UAAU;YAsEV,YAAY;YAmCZ,WAAW;YA8BX,WAAW;CAgD1B"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
+
import { CREATE_AGENT_IDENTITY_WRITE_PROPERTIES, CREATE_AGENT_IDENTITY_REQUIRED, ISSUE_AGENT_GRANT_WRITE_PROPERTIES, ISSUE_AGENT_GRANT_REQUIRED, LIST_MY_AGENT_GRANTS_WRITE_PROPERTIES, LIST_MY_AGENT_GRANTS_REQUIRED, REVOKE_AGENT_GRANT_WRITE_PROPERTIES, REVOKE_AGENT_GRANT_REQUIRED, GET_AGENT_ACTIVITY_WRITE_PROPERTIES, GET_AGENT_ACTIVITY_REQUIRED, } from "@withpica/mcp-utils";
|
|
3
|
+
export class AgentIdentityTools {
|
|
4
|
+
pica;
|
|
5
|
+
constructor(pica) {
|
|
6
|
+
this.pica = pica;
|
|
7
|
+
}
|
|
8
|
+
getTools() {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
definition: {
|
|
12
|
+
name: "pica_create_agent_identity",
|
|
13
|
+
description: "Create a named agent identity (e.g. 'Claude on laptop') that grants can be issued against. Session-auth only — refused if called with a pica_grant_ token. Subject is the authenticated user; caller-supplied user_id is dropped.",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: CREATE_AGENT_IDENTITY_WRITE_PROPERTIES,
|
|
17
|
+
required: CREATE_AGENT_IDENTITY_REQUIRED,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
executor: this.createIdentity.bind(this),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
definition: {
|
|
24
|
+
name: "pica_issue_agent_grant",
|
|
25
|
+
description: "Issue a capability grant against an identity you own. Returns a one-time grant_token (format pica_grant_<random>) — save it immediately; it is never shown again. Default expiry 90 days, max 365. Session-auth only.",
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: ISSUE_AGENT_GRANT_WRITE_PROPERTIES,
|
|
29
|
+
required: ISSUE_AGENT_GRANT_REQUIRED,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
executor: this.issueGrant.bind(this),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
definition: {
|
|
36
|
+
name: "pica_list_my_agent_grants",
|
|
37
|
+
description: "List your active agent grants. Returns non-secret fields only — tokens are never re-exposed after issue. Session-auth only.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: LIST_MY_AGENT_GRANTS_WRITE_PROPERTIES,
|
|
41
|
+
required: LIST_MY_AGENT_GRANTS_REQUIRED,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
executor: this.listMyGrants.bind(this),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
definition: {
|
|
48
|
+
name: "pica_revoke_agent_grant",
|
|
49
|
+
description: "Revoke one of your agent grants. Idempotent — revoking an already-revoked grant returns the same row. Revocation takes effect on the next request (within 60s). Session-auth only.",
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: REVOKE_AGENT_GRANT_WRITE_PROPERTIES,
|
|
53
|
+
required: REVOKE_AGENT_GRANT_REQUIRED,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
executor: this.revokeGrant.bind(this),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
definition: {
|
|
60
|
+
name: "pica_get_agent_activity",
|
|
61
|
+
description: "List agent_action_log rows whose grant's identity you own — your own provenance-stamped agent writes, sorted newest first. Optionally narrow by agent_identity_id or agent_grant_id. Paginated (default 50, max 500 per call). Session-auth only.",
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: "object",
|
|
64
|
+
properties: GET_AGENT_ACTIVITY_WRITE_PROPERTIES,
|
|
65
|
+
required: GET_AGENT_ACTIVITY_REQUIRED,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
executor: this.getActivity.bind(this),
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
async createIdentity(args) {
|
|
73
|
+
const displayName = typeof args.display_name === "string" ? args.display_name.trim() : "";
|
|
74
|
+
if (!displayName) {
|
|
75
|
+
return {
|
|
76
|
+
content: [{ type: "text", text: "Error: display_name is required." }],
|
|
77
|
+
isError: true,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const clientFingerprint = typeof args.client_fingerprint === "string" &&
|
|
81
|
+
args.client_fingerprint.trim()
|
|
82
|
+
? args.client_fingerprint.trim()
|
|
83
|
+
: null;
|
|
84
|
+
const result = await this.pica.agentIdentity.createIdentity({
|
|
85
|
+
displayName,
|
|
86
|
+
clientFingerprint,
|
|
87
|
+
});
|
|
88
|
+
const data = result?.data ?? result;
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{
|
|
92
|
+
type: "text",
|
|
93
|
+
text: `Agent identity created: "${displayName}" (id: ${data?.id ?? "unknown"}). Issue a grant with pica_issue_agent_grant to start using it.`,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
structuredContent: {
|
|
97
|
+
kind: "pica.card.agent_identity_created",
|
|
98
|
+
version: 1,
|
|
99
|
+
data,
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async issueGrant(args) {
|
|
104
|
+
const agentIdentityId = typeof args.agent_identity_id === "string"
|
|
105
|
+
? args.agent_identity_id.trim()
|
|
106
|
+
: "";
|
|
107
|
+
if (!agentIdentityId) {
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{ type: "text", text: "Error: agent_identity_id is required." },
|
|
111
|
+
],
|
|
112
|
+
isError: true,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (!Array.isArray(args.scopes) || args.scopes.length === 0) {
|
|
116
|
+
return {
|
|
117
|
+
content: [
|
|
118
|
+
{
|
|
119
|
+
type: "text",
|
|
120
|
+
text: "Error: scopes must be a non-empty array of strings.",
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
isError: true,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const scopes = args.scopes.filter((s) => typeof s === "string");
|
|
127
|
+
if (scopes.length !== args.scopes.length) {
|
|
128
|
+
return {
|
|
129
|
+
content: [{ type: "text", text: "Error: scopes must be strings." }],
|
|
130
|
+
isError: true,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const expiresAt = typeof args.expires_at === "string" && args.expires_at.trim()
|
|
134
|
+
? args.expires_at
|
|
135
|
+
: null;
|
|
136
|
+
const result = await this.pica.agentIdentity.issueGrant({
|
|
137
|
+
agentIdentityId,
|
|
138
|
+
scopes,
|
|
139
|
+
expiresAt,
|
|
140
|
+
});
|
|
141
|
+
const data = result?.data ?? result;
|
|
142
|
+
// The plaintext token is in data.grant_token and is shown once.
|
|
143
|
+
// Surface it prominently in the text block so the caller (and
|
|
144
|
+
// through it the user) sees it without having to drill into the
|
|
145
|
+
// structured card.
|
|
146
|
+
return {
|
|
147
|
+
content: [
|
|
148
|
+
{
|
|
149
|
+
type: "text",
|
|
150
|
+
text: `Grant issued (id: ${data?.id ?? "unknown"}). ` +
|
|
151
|
+
`Expires: ${data?.expires_at ?? "n/a"}. ` +
|
|
152
|
+
`Scopes: ${scopes.join(", ")}.\n\n` +
|
|
153
|
+
`grant_token: ${data?.grant_token ?? ""}\n\n` +
|
|
154
|
+
`Save this token now — it will not be shown again. ` +
|
|
155
|
+
`Present it as Authorization: Bearer <token> on MCP requests.`,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
structuredContent: {
|
|
159
|
+
kind: "pica.card.agent_grant_issued",
|
|
160
|
+
version: 1,
|
|
161
|
+
data,
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
async listMyGrants(_args) {
|
|
166
|
+
const result = await this.pica.agentIdentity.listMyGrants();
|
|
167
|
+
const data = result?.data ?? result;
|
|
168
|
+
const rows = Array.isArray(data) ? data : [];
|
|
169
|
+
const lines = rows.length
|
|
170
|
+
? rows
|
|
171
|
+
.map((row) => {
|
|
172
|
+
const name = row?.identity?.display_name ?? "unnamed";
|
|
173
|
+
const scopes = Array.isArray(row?.scopes)
|
|
174
|
+
? row.scopes.join(", ")
|
|
175
|
+
: "";
|
|
176
|
+
const expiry = row?.expires_at
|
|
177
|
+
? `expires ${row.expires_at}`
|
|
178
|
+
: "no expiry";
|
|
179
|
+
const revoked = row?.revoked_at ? " [revoked]" : "";
|
|
180
|
+
return `- ${name} (${row?.id ?? "unknown"}): ${scopes}; ${expiry}${revoked}`;
|
|
181
|
+
})
|
|
182
|
+
.join("\n")
|
|
183
|
+
: "(no grants)";
|
|
184
|
+
return {
|
|
185
|
+
content: [
|
|
186
|
+
{
|
|
187
|
+
type: "text",
|
|
188
|
+
text: `Your agent grants (${rows.length}):\n${lines}`,
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
structuredContent: {
|
|
192
|
+
kind: "pica.card.agent_grants_list",
|
|
193
|
+
version: 1,
|
|
194
|
+
data: rows,
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
async revokeGrant(args) {
|
|
199
|
+
const grantId = typeof args.grant_id === "string" ? args.grant_id.trim() : "";
|
|
200
|
+
if (!grantId) {
|
|
201
|
+
return {
|
|
202
|
+
content: [{ type: "text", text: "Error: grant_id is required." }],
|
|
203
|
+
isError: true,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
const result = await this.pica.agentIdentity.revokeGrant({ grantId });
|
|
207
|
+
const data = result?.data ?? result;
|
|
208
|
+
return {
|
|
209
|
+
content: [
|
|
210
|
+
{
|
|
211
|
+
type: "text",
|
|
212
|
+
text: `Grant ${data?.id ?? grantId} revoked at ${data?.revoked_at ?? "now"}. ` +
|
|
213
|
+
`The next request using this token will be refused with 401 ` +
|
|
214
|
+
`within 60 seconds.`,
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
structuredContent: {
|
|
218
|
+
kind: "pica.card.agent_grant_revoked",
|
|
219
|
+
version: 1,
|
|
220
|
+
data,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
async getActivity(args) {
|
|
225
|
+
const agentIdentityId = typeof args.agent_identity_id === "string" &&
|
|
226
|
+
args.agent_identity_id.trim()
|
|
227
|
+
? args.agent_identity_id.trim()
|
|
228
|
+
: null;
|
|
229
|
+
const agentGrantId = typeof args.agent_grant_id === "string" && args.agent_grant_id.trim()
|
|
230
|
+
? args.agent_grant_id.trim()
|
|
231
|
+
: null;
|
|
232
|
+
const limit = typeof args.limit === "number" ? args.limit : undefined;
|
|
233
|
+
const offset = typeof args.offset === "number" ? args.offset : undefined;
|
|
234
|
+
const result = await this.pica.agentIdentity.getActivity({
|
|
235
|
+
agentIdentityId,
|
|
236
|
+
agentGrantId,
|
|
237
|
+
limit,
|
|
238
|
+
offset,
|
|
239
|
+
});
|
|
240
|
+
const data = result?.data ?? result;
|
|
241
|
+
const rows = Array.isArray(data) ? data : [];
|
|
242
|
+
const lines = rows.length
|
|
243
|
+
? rows
|
|
244
|
+
.map((row) => {
|
|
245
|
+
const name = row?.grant?.identity?.display_name ?? "unnamed";
|
|
246
|
+
const action = row?.action ?? "?";
|
|
247
|
+
const table = row?.target_table ?? "?";
|
|
248
|
+
const tool = row?.tool_name ?? "?";
|
|
249
|
+
const when = row?.created_at ?? "";
|
|
250
|
+
return `- ${when} ${name} ${action} ${table} via ${tool}`;
|
|
251
|
+
})
|
|
252
|
+
.join("\n")
|
|
253
|
+
: "(no activity yet — provenance is stamped once Part 3 wraps write tools)";
|
|
254
|
+
return {
|
|
255
|
+
content: [
|
|
256
|
+
{
|
|
257
|
+
type: "text",
|
|
258
|
+
text: `Your agent activity (${rows.length}):\n${lines}`,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
structuredContent: {
|
|
262
|
+
kind: "pica.card.agent_activity",
|
|
263
|
+
version: 1,
|
|
264
|
+
data: rows,
|
|
265
|
+
},
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=agent-identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-identity.js","sourceRoot":"","sources":["../../src/tools/agent-identity.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAwB7D,OAAO,EACL,sCAAsC,EACtC,8BAA8B,EAC9B,kCAAkC,EAClC,0BAA0B,EAC1B,qCAAqC,EACrC,6BAA6B,EAC7B,mCAAmC,EACnC,2BAA2B,EAC3B,mCAAmC,EACnC,2BAA2B,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,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,4BAA4B;oBAClC,WAAW,EACT,mOAAmO;oBACrO,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,sCAAsC;wBAClD,QAAQ,EAAE,8BAA8B;qBACzC;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;aACzC;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,wBAAwB;oBAC9B,WAAW,EACT,uNAAuN;oBACzN,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,kCAAkC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AC;gBACnC,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK,MAAM,IAAI,KAAK,QAAQ,IAAI,EAAE,CAAC;YAC9D,CAAC,CAAC;iBACD,IAAI,CAAC,IAAI,CAAC;YACf,CAAC,CAAC,yEAAyE,CAAC;QAE9E,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,wBAAwB,IAAI,CAAC,MAAM,OAAO,KAAK,EAAE;iBACxD;aACF;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,0BAA0B;gBAChC,OAAO,EAAE,CAAC;gBACV,IAAI,EAAE,IAAI;aACX;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreements.d.ts","sourceRoot":"","sources":["../../src/tools/agreements.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"agreements.d.ts","sourceRoot":"","sources":["../../src/tools/agreements.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA4BtE,qBAAa,eAAe;IAC1B,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;YAkK3D,eAAe;YAef,gBAAgB;YA8DhB,eAAe;YAyBf,eAAe;YAQf,eAAe;YAOf,QAAQ;CAQvB"}
|
package/dist/tools/agreements.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
2
|
import { formatList, formatSuccess, notifyParties, summarizeNotifications, AGREEMENTS_WRITE_PROPERTIES, AGREEMENTS_CREATE_REQUIRED, AGREEMENTS_UPDATE_REQUIRED, } from "@withpica/mcp-utils";
|
|
3
|
+
import { computeAgreementGapHints } from "./gap-hints.js";
|
|
3
4
|
const AGREEMENT_TYPE_ENUM = [
|
|
4
5
|
"master_recording",
|
|
5
6
|
"library_music",
|
|
@@ -127,7 +128,7 @@ export class AgreementsTools {
|
|
|
127
128
|
{
|
|
128
129
|
definition: {
|
|
129
130
|
name: "pica_agreements_delete",
|
|
130
|
-
description: "Delete an agreement",
|
|
131
|
+
description: "Delete an agreement (destructive — also removes linked work and party records).",
|
|
131
132
|
inputSchema: {
|
|
132
133
|
type: "object",
|
|
133
134
|
properties: {
|
|
@@ -222,7 +223,10 @@ export class AgreementsTools {
|
|
|
222
223
|
payment_terms: agreement.payment_terms,
|
|
223
224
|
};
|
|
224
225
|
}
|
|
225
|
-
|
|
226
|
+
// ADR-193 Surface 2 — proactive peer-MCP hints when gaps are real.
|
|
227
|
+
const gap_hints = computeAgreementGapHints(result);
|
|
228
|
+
const enriched = gap_hints.length > 0 ? { ...result, gap_hints } : result;
|
|
229
|
+
return formatSuccess("Agreement details", enriched);
|
|
226
230
|
}
|
|
227
231
|
async createAgreement(args) {
|
|
228
232
|
const agreement = await this.pica.agreements.create(args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreements.js","sourceRoot":"","sources":["../../src/tools/agreements.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAEL,UAAU,EACV,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"agreements.js","sourceRoot":"","sources":["../../src/tools/agreements.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO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M,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE;YAClE,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;YACvD,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;QACH,OAAO,aAAa,CAAC,0BAA0B,EAAE,IAAI,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrichment.d.ts","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"enrichment.d.ts","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAKtE,qBAAa,eAAe;IAC1B,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;YAglB3D,oBAAoB;IAOlC;;;;;;;;OAQG;YACW,WAAW;IAiCzB;;;;OAIG;YACW,gBAAgB;IAgC9B;;;;;;OAMG;YACW,aAAa;IA4B3B;;;;;;;;;;;OAWG;YACW,aAAa;YAQb,qBAAqB;YAUrB,iBAAiB;YAUjB,iBAAiB;YAUjB,iBAAiB;YAUjB,cAAc;YAQd,gBAAgB;YAUhB,aAAa;YASb,uBAAuB;YA6BvB,uBAAuB;YAiBvB,wBAAwB;IAatC;;;;;;;;;OASG;YACW,oBAAoB;CA2CnC"}
|