@withpica/mcp-server 2.56.0 → 2.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/README.md +9 -9
  3. package/dist/lib/changelog.generated.d.ts +2 -2
  4. package/dist/lib/changelog.generated.d.ts.map +1 -1
  5. package/dist/lib/changelog.generated.js +2 -2
  6. package/dist/lib/changelog.generated.js.map +1 -1
  7. package/dist/prompts/index.js +1 -1
  8. package/dist/prompts/index.js.map +1 -1
  9. package/dist/resources/index.d.ts.map +1 -1
  10. package/dist/resources/index.js +5 -0
  11. package/dist/resources/index.js.map +1 -1
  12. package/dist/resources/required-schemas.generated.d.ts +13 -1
  13. package/dist/resources/required-schemas.generated.d.ts.map +1 -1
  14. package/dist/resources/required-schemas.generated.js +23 -1
  15. package/dist/resources/required-schemas.generated.js.map +1 -1
  16. package/dist/resources/required-schemas.source.d.ts.map +1 -1
  17. package/dist/resources/required-schemas.source.js +17 -1
  18. package/dist/resources/required-schemas.source.js.map +1 -1
  19. package/dist/server-instructions.d.ts +4 -3
  20. package/dist/server-instructions.d.ts.map +1 -1
  21. package/dist/server-instructions.js +4 -1
  22. package/dist/server-instructions.js.map +1 -1
  23. package/dist/server.js +2 -2
  24. package/dist/skills/skills.generated.d.ts.map +1 -1
  25. package/dist/skills/skills.generated.js +11 -2
  26. package/dist/skills/skills.generated.js.map +1 -1
  27. package/dist/tools/agreement-types.d.ts.map +1 -1
  28. package/dist/tools/agreement-types.js +5 -1
  29. package/dist/tools/agreement-types.js.map +1 -1
  30. package/dist/tools/analytics.d.ts.map +1 -1
  31. package/dist/tools/analytics.js +6 -7
  32. package/dist/tools/analytics.js.map +1 -1
  33. package/dist/tools/assets.d.ts.map +1 -1
  34. package/dist/tools/assets.js +34 -2
  35. package/dist/tools/assets.js.map +1 -1
  36. package/dist/tools/collaborations.d.ts +19 -0
  37. package/dist/tools/collaborations.d.ts.map +1 -0
  38. package/dist/tools/collaborations.js +45 -0
  39. package/dist/tools/collaborations.js.map +1 -0
  40. package/dist/tools/collaborators.d.ts +8 -0
  41. package/dist/tools/collaborators.d.ts.map +1 -1
  42. package/dist/tools/collaborators.js +345 -8
  43. package/dist/tools/collaborators.js.map +1 -1
  44. package/dist/tools/credits.d.ts +1 -0
  45. package/dist/tools/credits.d.ts.map +1 -1
  46. package/dist/tools/credits.js +110 -1
  47. package/dist/tools/credits.js.map +1 -1
  48. package/dist/tools/dashboard.d.ts.map +1 -1
  49. package/dist/tools/dashboard.js +59 -7
  50. package/dist/tools/dashboard.js.map +1 -1
  51. package/dist/tools/discovery.d.ts.map +1 -1
  52. package/dist/tools/discovery.js +26 -1
  53. package/dist/tools/discovery.js.map +1 -1
  54. package/dist/tools/explainability.d.ts.map +1 -1
  55. package/dist/tools/explainability.js +43 -15
  56. package/dist/tools/explainability.js.map +1 -1
  57. package/dist/tools/exports.d.ts.map +1 -1
  58. package/dist/tools/exports.js +14 -4
  59. package/dist/tools/exports.js.map +1 -1
  60. package/dist/tools/feedback.d.ts.map +1 -1
  61. package/dist/tools/feedback.js +70 -26
  62. package/dist/tools/feedback.js.map +1 -1
  63. package/dist/tools/index.d.ts.map +1 -1
  64. package/dist/tools/index.js +46 -2
  65. package/dist/tools/index.js.map +1 -1
  66. package/dist/tools/metadata.d.ts.map +1 -1
  67. package/dist/tools/metadata.js +115 -0
  68. package/dist/tools/metadata.js.map +1 -1
  69. package/dist/tools/onboarding.js +2 -2
  70. package/dist/tools/onboarding.js.map +1 -1
  71. package/dist/tools/recovery-hints.d.ts.map +1 -1
  72. package/dist/tools/recovery-hints.js +164 -0
  73. package/dist/tools/recovery-hints.js.map +1 -1
  74. package/dist/tools/report-issue.d.ts.map +1 -1
  75. package/dist/tools/report-issue.js +1 -0
  76. package/dist/tools/report-issue.js.map +1 -1
  77. package/dist/tools/settings.js +3 -3
  78. package/dist/tools/settings.js.map +1 -1
  79. package/dist/tools/split-sheets.d.ts.map +1 -1
  80. package/dist/tools/split-sheets.js +19 -2
  81. package/dist/tools/split-sheets.js.map +1 -1
  82. package/dist/tools/telegram.js +1 -1
  83. package/dist/tools/telegram.js.map +1 -1
  84. package/dist/tools/users.d.ts +38 -0
  85. package/dist/tools/users.d.ts.map +1 -0
  86. package/dist/tools/users.js +192 -0
  87. package/dist/tools/users.js.map +1 -0
  88. package/dist/tools/works.d.ts +6 -0
  89. package/dist/tools/works.d.ts.map +1 -1
  90. package/dist/tools/works.js +112 -5
  91. package/dist/tools/works.js.map +1 -1
  92. package/package.json +8 -5
  93. package/server.json +2 -2
package/CHANGELOG.md CHANGED
@@ -11,6 +11,68 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ## [Unreleased]
13
13
 
14
+ ## [2.57.0] - 2026-05-18
15
+
16
+ Closes the ADR-241 substrate sprint — agent-side orientation skill, dashboard coherence with SQL-side `NOT EXISTS`, and 4 sister bug fixes that the agents themselves filed via `pica_report_issue` over the preceding 72 hours.
17
+
18
+ ### Added
19
+
20
+ - **`first-session` skill (ADR-241).** Agent-side counterpart of `set-up-workspace`. Five phases: identity recognition → reporting-discipline opening note → context load → priority ranking + routing → close-out sweep. Names the right specialist skill per priority class and hands the steering wheel over — does NOT invoke the specialist itself. Discoverable via `pica_skill_list` + the `skill://withpica/first-session/SKILL.md` Resource per the SEP-2640 bridge.
21
+ - **`SERVER_INSTRUCTIONS` coaching line.** Directs the agent to call `pica_skill_get("first-session")` on the first user message of a session unless the prompt is already task-specific. Char budget bumped 2300 → 2400 to fit the addition; final length 2337.
22
+ - **`pica_issue_agent_grant.scopes.items.enum`** — the 15 `VALID_SCOPES` are now declared inline in the JSON Schema, surfacing through `pica_tool_details` introspection. Closes ops_issue `3a65aa71` (agents trial-and-erroring on `write:works` / `write:credits` / `write:enrichment` which aren't valid; only `write:catalog` is).
23
+ - **`pica_dashboard_attention` gains a `class` filter** taking one of `works_without_credits | works_without_registrations | audio_pending | unenriched_writers | recordings_without_splits | disputed_credits`. Specialist skills now have a single-call entry to the top-of-their-own-queue (ADR-242).
24
+ - **`pica_count_explain` taxonomy mode** — omit `count_source` to get the full actionable-issue taxonomy as `sources[]` with `drill_down_skill` named per class. Machine-readable routing table that ADR-241's `first-session` skill reads to pick its next step.
25
+
26
+ ### Changed
27
+
28
+ - **`pica_dashboard_briefing` / `_attention` / `pica_count_explain` are now coherent projections of a single shared source.** Implements ADR-242 § Decision: new `lib/services/dashboard-actionable.ts` (`getActionableIssues()` with a per-class registry); three projection helpers shape its output for the three tool handlers. `sum(count_explain.sources[].count) === briefing.critical_issues_total` for the same org/moment, by construction. Closes ops_issue `4042e806` (briefing 1495, count_explain 338, attention 0 — three tools, three numbers, no path through).
29
+ - **`pica_works_query health_filter='needs_attention'` no longer errors.** Hardens `getWorksHealth()` with per-work try/catch; restores `needs_attention` routing in the assembled-truth path. Closes ops_issue `4da6a869`.
30
+ - **`pica_split_sheet_generate` "No credits found" surfaces as 400, not 500.** Routes through the user-input-error classifier so agents see an actionable message instead of an opaque server error. Closes ops_issue `899a3d63`.
31
+ - **`pica_submit_feedback` dedups by content-hash, not session-time.** Distinct content within the same session now passes; identical resubmissions still dedup within the rate-limit window. SDK errors propagate to `mcp_audit_log` via the error envelope (was silent generic error). Closes ops_issues `4bab716a` + `808e5fa0`.
32
+ - **`pica_memory_save` accepts both kebab-case slugs and UUIDs.** Root cause: validator used `apiKey.keyId` (not a valid `user_id` FK) for the `user_id` field; row insert failed silently and surfaced as `"invalid id format"`. Closes ops_issue `315ef479`.
33
+
34
+ ### Dependencies
35
+
36
+ - `@withpica/mcp-sdk` `^1.27.1` → `^1.28.0` (new `DashboardResource.actionableItems` + `CountExplainResource.taxonomy` methods).
37
+ - `@withpica/mcp-utils` `^1.21.1` → `^1.22.0` (workspace-version-alignment fix; develop's Vercel deploy was failing since 2026-05-17 because the `^1.21.1` range that 2.56.1 introduced was not satisfied by the local `1.21.0` workspace, forcing CI/Vercel to pull a duplicate copy from npm registry and breaking type identity).
38
+
39
+ ### Database (staging applied; production applies on develop → main promote)
40
+
41
+ - Migration `20260517220000_adr242_actionable_issues_rpcs.sql` — 4 Postgres functions (`dashboard_actionable_works_without_credits`, `..._works_without_registrations`, `..._recordings_without_splits`, `..._unenriched_writers`) using SQL-side `NOT EXISTS`. PICA builds for scale; the fetch-all + filter-in-JS pattern was rejected by the founder. All four `LANGUAGE sql STABLE SECURITY INVOKER SET search_path = ''` per the 2026-05-11 function-hardening sweep.
42
+
43
+ ## [2.56.1] - 2026-05-17
44
+
45
+ ### Changed
46
+
47
+ - Brand consistency: "PICA" → "withPICA" in package metadata, keywords (added `"withpica"`, `"music-catalog"`, `"music-rights"`), README, JSDoc headers, and customer-visible tool descriptions: `pica_delete_my_account`, `pica_gdpr_export_my_data` (description + completion message), `pica_telegram_connect`, `pica_onboarding_complete` (description + `intent_notes` field), and the `new-catalog-setup` prompt.
48
+ - Registered `pica_works_attest` and `pica_credits_send_for_attestation` in `REQUIRED_SCHEMAS_SOURCE` companion_calls (both tools declared workflow membership but weren't referenced — pre-existing drift caught by `lint:required-schemas`).
49
+
50
+ ### Fixed
51
+
52
+ - **`pica_submit_feedback` + `pica_physical_assets_create` no longer leak SDK errors to the user (PRs #453 + #457, 2026-05-15).**
53
+ Both executors had naked SDK calls — when the upstream API errored, the
54
+ framework's outer catch in `tools/index.ts` JSON-stringified the error
55
+ body straight to the conversation (`{error: "UNKNOWN_ERROR", message: "..."}`).
56
+ Wrap each SDK call in `try/catch`: on throw, fire-and-forget
57
+ `pica.opsIssues.reportIssue({ kind: "tool_failure", ... })` with the
58
+ underlying message + status + parameter shape in `context`, return
59
+ neutral text (`"couldn't <verb> right now — the team has been alerted."`).
60
+ Input-validation early-returns are preserved — those carry actionable
61
+ text and aren't server failures. PR #457 added `tool_failure` to the
62
+ `OpsIssueExplicitKind` taxonomy and retagged both wrappers (PR #453
63
+ shipped as `kind: "data_issue"` because `tool_failure` didn't exist
64
+ yet). 12 new unit tests across `feedback.test.ts` (new file) +
65
+ `assets.test.ts`. **Note:** the auto-audit upsert path is bypassed
66
+ because returning `isError: true` logs as `result_status: "success"`
67
+ (`tools/index.ts:1859`) — the executor reports manually instead.
68
+
69
+ ### Added
70
+
71
+ - **`pica_report_issue` accepts `kind: "tool_failure"` (PR #457, 2026-05-15).**
72
+ Sixth value in the agent-explicit kinds enum. Lets agents file SDK /
73
+ upstream-tool failures directly via the report-issue tool, mirroring
74
+ the new fail-quiet wrappers.
75
+
14
76
  ## [2.56.0] - 2026-05-14
15
77
 
16
78
  ### Added
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # PICA MCP Server
1
+ # withPICA MCP Server
2
2
 
3
- Model Context Protocol (MCP) server for the PICA Platform. Enables **any MCP-compatible AI assistant** to interact with your PICA music catalog.
3
+ Model Context Protocol (MCP) server for withPICA. Enables **any MCP-compatible AI assistant** to interact with your withPICA music catalog.
4
4
 
5
5
  ## What is MCP?
6
6
 
7
- The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely access external data and functionality. With this MCP server, any MCP-compatible AI can interact with your PICA catalog.
7
+ The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely access external data and functionality. With this MCP server, any MCP-compatible AI can interact with your withPICA catalog.
8
8
 
9
9
  ## Compatible AI Assistants
10
10
 
@@ -89,9 +89,9 @@ npm link
89
89
 
90
90
  ## Configuration
91
91
 
92
- ### Get Your PICA API Key
92
+ ### Get Your withPICA API Key
93
93
 
94
- 1. Log into PICA at https://withpica.com
94
+ 1. Log into withPICA at https://withpica.com
95
95
  2. Go to Settings → API Keys
96
96
  3. Generate a new API key
97
97
  4. Copy the key for use below
@@ -123,7 +123,7 @@ The setup process is similar for any MCP-compatible tool:
123
123
 
124
124
  1. Configure the MCP server command: `npx -y @withpica/mcp-server`
125
125
  2. Set the `PICA_API_KEY` environment variable
126
- 3. The AI can now access all PICA tools and resources
126
+ 3. The AI can now access all withPICA tools and resources
127
127
 
128
128
  ## Usage Examples
129
129
 
@@ -267,7 +267,7 @@ Make sure you've set the API key in your MCP server configuration:
267
267
  ## Architecture
268
268
 
269
269
  ```
270
- MCP Server for PICA
270
+ MCP Server for withPICA
271
271
  ├── Protocol Handler (MCP standard)
272
272
  ├── Authentication (API key)
273
273
  ├── Tools (24 AI-callable functions)
@@ -281,7 +281,7 @@ MCP Server for PICA
281
281
 
282
282
  ## Security
283
283
 
284
- - All requests require a valid PICA API key
284
+ - All requests require a valid withPICA API key
285
285
  - API keys are transmitted securely over HTTPS
286
286
  - Data access is scoped to your organization
287
287
  - No data is stored by the MCP server
@@ -301,4 +301,4 @@ MIT
301
301
  Built with:
302
302
 
303
303
  - [@modelcontextprotocol/sdk](https://github.com/modelcontextprotocol/sdk) - MCP SDK
304
- - [@withpica/sdk](https://www.npmjs.com/package/@withpica/sdk) - PICA TypeScript SDK
304
+ - [@withpica/sdk](https://www.npmjs.com/package/@withpica/sdk) - withPICA TypeScript SDK