@withpica/mcp-server 2.51.0 → 2.52.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/.claude/settings.local.json +5 -0
- package/CHANGELOG.md +0 -41
- package/dist/prompts/index.d.ts +0 -32
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +0 -235
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/index.d.ts +0 -10
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +1 -134
- package/dist/resources/index.js.map +1 -1
- package/dist/server-instructions.d.ts +3 -4
- package/dist/server-instructions.d.ts.map +1 -1
- package/dist/server-instructions.js +1 -4
- package/dist/server-instructions.js.map +1 -1
- package/dist/server.d.ts +0 -26
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -108
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-identity.d.ts.map +1 -1
- package/dist/tools/agent-identity.js +0 -15
- package/dist/tools/agent-identity.js.map +1 -1
- package/dist/tools/agreement-types.d.ts.map +1 -1
- package/dist/tools/agreement-types.js +0 -24
- package/dist/tools/agreement-types.js.map +1 -1
- package/dist/tools/agreements.d.ts.map +1 -1
- package/dist/tools/agreements.js +3 -21
- package/dist/tools/agreements.js.map +1 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/analytics.js +1 -19
- package/dist/tools/analytics.js.map +1 -1
- package/dist/tools/app-tools.d.ts.map +1 -1
- package/dist/tools/app-tools.js +2 -11
- package/dist/tools/app-tools.js.map +1 -1
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +0 -33
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/audio-files.d.ts +0 -5
- package/dist/tools/audio-files.d.ts.map +1 -1
- package/dist/tools/audio-files.js +0 -91
- package/dist/tools/audio-files.js.map +1 -1
- package/dist/tools/audit.d.ts.map +1 -1
- package/dist/tools/audit.js +2 -11
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +0 -6
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +0 -6
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +0 -3
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/collaborators.d.ts.map +1 -1
- package/dist/tools/collaborators.js +3 -24
- package/dist/tools/collaborators.js.map +1 -1
- package/dist/tools/comparisons.d.ts.map +1 -1
- package/dist/tools/comparisons.js +0 -6
- package/dist/tools/comparisons.js.map +1 -1
- package/dist/tools/credits.d.ts +0 -18
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +4 -344
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/custody.d.ts.map +1 -1
- package/dist/tools/custody.js +2 -23
- package/dist/tools/custody.js.map +1 -1
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +7 -43
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/directory.d.ts.map +1 -1
- package/dist/tools/directory.js +0 -3
- package/dist/tools/directory.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +7 -94
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +1 -4
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +0 -3
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/duplicates.d.ts.map +1 -1
- package/dist/tools/duplicates.js +0 -6
- package/dist/tools/duplicates.js.map +1 -1
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +0 -33
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/exports.js +3 -18
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/feedback.d.ts.map +1 -1
- package/dist/tools/feedback.js +0 -3
- package/dist/tools/feedback.js.map +1 -1
- package/dist/tools/files.d.ts +30 -0
- package/dist/tools/files.d.ts.map +1 -0
- package/dist/tools/files.js +98 -0
- package/dist/tools/files.js.map +1 -0
- package/dist/tools/groups.d.ts.map +1 -1
- package/dist/tools/groups.js +0 -12
- package/dist/tools/groups.js.map +1 -1
- package/dist/tools/import-documents.d.ts.map +1 -1
- package/dist/tools/import-documents.js +1 -10
- package/dist/tools/import-documents.js.map +1 -1
- package/dist/tools/import.d.ts.map +1 -1
- package/dist/tools/import.js +3 -36
- package/dist/tools/import.js.map +1 -1
- package/dist/tools/index.d.ts +6 -142
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +115 -269
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +8 -28
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/labels.d.ts.map +1 -1
- package/dist/tools/labels.js +0 -3
- package/dist/tools/labels.js.map +1 -1
- package/dist/tools/licensing.d.ts.map +1 -1
- package/dist/tools/licensing.js +0 -15
- package/dist/tools/licensing.js.map +1 -1
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/memory.js +3 -15
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +15 -77
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/multimedia.d.ts.map +1 -1
- package/dist/tools/multimedia.js +0 -15
- package/dist/tools/multimedia.js.map +1 -1
- package/dist/tools/my-reported-issues.d.ts.map +1 -1
- package/dist/tools/my-reported-issues.js +0 -3
- package/dist/tools/my-reported-issues.js.map +1 -1
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +0 -12
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/notifications.d.ts.map +1 -1
- package/dist/tools/notifications.js +1 -25
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/onboarding.d.ts.map +1 -1
- package/dist/tools/onboarding.js +0 -3
- package/dist/tools/onboarding.js.map +1 -1
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +1 -16
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +0 -18
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/publishers.d.ts.map +1 -1
- package/dist/tools/publishers.js +0 -6
- package/dist/tools/publishers.js.map +1 -1
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +0 -15
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/recovery-hints.d.ts.map +1 -1
- package/dist/tools/recovery-hints.js +2 -28
- package/dist/tools/recovery-hints.js.map +1 -1
- package/dist/tools/release-rich.d.ts.map +1 -1
- package/dist/tools/release-rich.js +2 -4
- package/dist/tools/release-rich.js.map +1 -1
- package/dist/tools/releases.d.ts.map +1 -1
- package/dist/tools/releases.js +0 -55
- package/dist/tools/releases.js.map +1 -1
- package/dist/tools/report-issue.d.ts.map +1 -1
- package/dist/tools/report-issue.js +0 -3
- package/dist/tools/report-issue.js.map +1 -1
- package/dist/tools/royalties.d.ts.map +1 -1
- package/dist/tools/royalties.js +3 -18
- package/dist/tools/royalties.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +1 -10
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/send.d.ts.map +1 -1
- package/dist/tools/send.js +0 -9
- package/dist/tools/send.js.map +1 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +0 -12
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +3 -30
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/share-links.d.ts.map +1 -1
- package/dist/tools/share-links.js +0 -15
- package/dist/tools/share-links.js.map +1 -1
- package/dist/tools/signup.d.ts.map +1 -1
- package/dist/tools/signup.js +0 -3
- package/dist/tools/signup.js.map +1 -1
- package/dist/tools/split-sheets.d.ts.map +1 -1
- package/dist/tools/split-sheets.js +1 -22
- package/dist/tools/split-sheets.js.map +1 -1
- package/dist/tools/storage-config.d.ts.map +1 -1
- package/dist/tools/storage-config.js +0 -6
- package/dist/tools/storage-config.js.map +1 -1
- package/dist/tools/subscription.d.ts.map +1 -1
- package/dist/tools/subscription.js +10 -9
- package/dist/tools/subscription.js.map +1 -1
- package/dist/tools/sync-placements.d.ts.map +1 -1
- package/dist/tools/sync-placements.js +2 -20
- package/dist/tools/sync-placements.js.map +1 -1
- package/dist/tools/team.d.ts.map +1 -1
- package/dist/tools/team.js +0 -15
- package/dist/tools/team.js.map +1 -1
- package/dist/tools/telegram.d.ts.map +1 -1
- package/dist/tools/telegram.js +0 -9
- package/dist/tools/telegram.js.map +1 -1
- package/dist/tools/uploads.d.ts.map +1 -1
- package/dist/tools/uploads.js +0 -6
- package/dist/tools/uploads.js.map +1 -1
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +3 -37
- package/dist/tools/works.js.map +1 -1
- package/package.json +6 -7
- package/server.json +2 -2
- package/dist/prompts/creator-question-atlas.d.ts +0 -48
- package/dist/prompts/creator-question-atlas.d.ts.map +0 -1
- package/dist/prompts/creator-question-atlas.js +0 -618
- package/dist/prompts/creator-question-atlas.js.map +0 -1
- package/dist/skills/index.d.ts +0 -42
- package/dist/skills/index.d.ts.map +0 -1
- package/dist/skills/index.js +0 -59
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/skills.generated.d.ts +0 -25
- package/dist/skills/skills.generated.d.ts.map +0 -1
- package/dist/skills/skills.generated.js +0 -86
- package/dist/skills/skills.generated.js.map +0 -1
- package/dist/tools/access-simulate.d.ts +0 -23
- package/dist/tools/access-simulate.d.ts.map +0 -1
- package/dist/tools/access-simulate.js +0 -165
- package/dist/tools/access-simulate.js.map +0 -1
- package/dist/tools/explainability.d.ts +0 -24
- package/dist/tools/explainability.d.ts.map +0 -1
- package/dist/tools/explainability.js +0 -137
- package/dist/tools/explainability.js.map +0 -1
- package/dist/tools/my-recent-questions.d.ts +0 -25
- package/dist/tools/my-recent-questions.d.ts.map +0 -1
- package/dist/tools/my-recent-questions.js +0 -186
- package/dist/tools/my-recent-questions.js.map +0 -1
- package/dist/tools/share-send.d.ts +0 -28
- package/dist/tools/share-send.d.ts.map +0 -1
- package/dist/tools/share-send.js +0 -131
- package/dist/tools/share-send.js.map +0 -1
- package/dist/tools/sharing.d.ts +0 -29
- package/dist/tools/sharing.d.ts.map +0 -1
- package/dist/tools/sharing.js +0 -131
- package/dist/tools/sharing.js.map +0 -1
- package/dist/tools/skills.d.ts +0 -25
- package/dist/tools/skills.d.ts.map +0 -1
- package/dist/tools/skills.js +0 -144
- package/dist/tools/skills.js.map +0 -1
- package/scripts/build-skills.ts +0 -229
package/CHANGELOG.md
CHANGED
|
@@ -11,47 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
|
|
12
12
|
## [Unreleased]
|
|
13
13
|
|
|
14
|
-
### Added
|
|
15
|
-
|
|
16
|
-
- **ADR-214 follow-up: cross-transport resource parity lint (`scripts/lint-resource-coverage.ts`).**
|
|
17
|
-
Asserts that `ResourceRegistry.listResources()` (stdio) and `UI_RESOURCE_DEFS` / the
|
|
18
|
-
anonymous-lobby handler (HTTP, `app/api/mcp/route.ts`) expose the same resource URIs.
|
|
19
|
-
Catches the W2 drift class — resources added to one transport only — before publish.
|
|
20
|
-
Four assertions: stdio-lobby ⊆ HTTP-lobby, HTTP-lobby ⊆ stdio-lobby,
|
|
21
|
-
stdio-authenticated \ ADR-152-carve-out ⊆ HTTP-authenticated, and the inverse
|
|
22
|
-
HTTP-authenticated ⊆ stdio-authenticated. Wired into `prepublishOnly` (after
|
|
23
|
-
`lint:agent-guide`) and `.github/workflows/mcp-tool-lint.yml`.
|
|
24
|
-
|
|
25
|
-
**Pre-existing drift detected:** `pica://schemas/sync-placement-required` is present
|
|
26
|
-
in `UI_RESOURCE_DEFS` (added in 2.47.0 per CHANGELOG) but absent from
|
|
27
|
-
`ResourceRegistry.listResources()`. The lint correctly flags this; see the PR for
|
|
28
|
-
the fix path.
|
|
29
|
-
|
|
30
|
-
### Changed
|
|
31
|
-
|
|
32
|
-
- **Tool registry catch path now forwards `error_message` to the audit log (PR #308).**
|
|
33
|
-
When a tool throws, the registry calls `formatError()` and now passes the
|
|
34
|
-
parsed `message` through to `logToolExecution` as `error_message`. Pre-fix,
|
|
35
|
-
every error row in `mcp_audit_log` landed with `error_message=null` because
|
|
36
|
-
the wire shape stripped the field — even when the wrapper held the
|
|
37
|
-
underlying cause. Net effect for diagnostics: rows like the 116 silent
|
|
38
|
-
`pica_merge_duplicates` failures on 2026-04-09 (which couldn't be
|
|
39
|
-
attributed to any specific cause) will now carry the message going forward.
|
|
40
|
-
Sister change in `@withpica/mcp-utils` adds the field to `McpAuditEntry`.
|
|
41
|
-
|
|
42
|
-
- **`pica_integrations_status` advertisement updated to current tools (PR #308).**
|
|
43
|
-
ADR-179 (commit `dc1bfca72`, 2026-04-21) folded the six per-source
|
|
44
|
-
`pica_enrich_*` tools into `pica_resolve_work` / `pica_resolve_person` /
|
|
45
|
-
`pica_resolve_recording` with a `sources:[...]` parameter, then removed
|
|
46
|
-
them. But `mcp-server/src/tools/integrations.ts` continued to advertise
|
|
47
|
-
the removed names in the `platformReads` list, the tool description, and
|
|
48
|
-
the summary prose. Agents reading the advertisement called names that no
|
|
49
|
-
longer existed → UNKNOWN_ERROR loops on every catalog-enrichment ask
|
|
50
|
-
routed through MLC/Spotify/MusicBrainz/YouTube/Discogs/ISNI. Now points
|
|
51
|
-
at the surviving tools with the correct source value. Two regression
|
|
52
|
-
tests in `integrations.test.ts` lock down that no removed
|
|
53
|
-
`pica_enrich_*` tool name appears in the advertised `use_via` strings.
|
|
54
|
-
|
|
55
14
|
## [2.48.0] - 2026-05-03
|
|
56
15
|
|
|
57
16
|
### Changed
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Prompt Registry for MCP Server
|
|
3
3
|
* Manages pre-configured prompts for common workflows
|
|
4
|
-
*
|
|
5
|
-
* ADR-226 Phase 5: optionally takes a `PicaClient` so dynamic prompts
|
|
6
|
-
* (currently `pica_continue`) can read from the Phase 4 substrate at fetch
|
|
7
|
-
* time. Other prompts continue to render statically.
|
|
8
4
|
*/
|
|
9
|
-
import { PicaClient } from "@withpica/mcp-sdk";
|
|
10
5
|
export interface PromptDefinition {
|
|
11
6
|
name: string;
|
|
12
7
|
description: string;
|
|
@@ -27,8 +22,6 @@ export interface PromptResult {
|
|
|
27
22
|
messages: PromptMessage[];
|
|
28
23
|
}
|
|
29
24
|
export declare class PromptRegistry {
|
|
30
|
-
private pica?;
|
|
31
|
-
constructor(pica?: PicaClient | undefined);
|
|
32
25
|
/**
|
|
33
26
|
* List all available prompts
|
|
34
27
|
*/
|
|
@@ -89,30 +82,5 @@ export declare class PromptRegistry {
|
|
|
89
82
|
* Set recording splits — guided master ownership split assignment with verify gate
|
|
90
83
|
*/
|
|
91
84
|
private getSetRecordingSplitsPrompt;
|
|
92
|
-
/**
|
|
93
|
-
* What's new — Atlas funnel for "what's new?", "any updates?", "catch me up".
|
|
94
|
-
*/
|
|
95
|
-
private getWhatsNewPrompt;
|
|
96
|
-
/**
|
|
97
|
-
* What's wrong — Atlas funnel for "what's wrong with my songs?", "what
|
|
98
|
-
* needs fixing?", "anything urgent?", "what should I do?".
|
|
99
|
-
*/
|
|
100
|
-
private getWhatsWrongPrompt;
|
|
101
|
-
/**
|
|
102
|
-
* How much has this earned — Atlas-resolved royalties summary with
|
|
103
|
-
* fallback nudge when no statements exist for the work.
|
|
104
|
-
*/
|
|
105
|
-
private getHowMuchHasThisEarnedPrompt;
|
|
106
|
-
/**
|
|
107
|
-
* Who owes me something — multi-tool orchestration aggregating pending
|
|
108
|
-
* invites, outstanding signatures, and open disputes into one view.
|
|
109
|
-
*/
|
|
110
|
-
private getWhoOwesMeSomethingPrompt;
|
|
111
|
-
/**
|
|
112
|
-
* Pica continue — pick-up-where-you-left-off. Reads recent assistant_interactions
|
|
113
|
-
* for the calling user, surfaces specific named open loops per ADR Decision 4
|
|
114
|
-
* example, falls through to a clean "nothing in flight" message when empty.
|
|
115
|
-
*/
|
|
116
|
-
private getPicaContinuePrompt;
|
|
117
85
|
}
|
|
118
86
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,qBAAa,cAAc;IACzB;;OAEG;IACH,WAAW,IAAI,gBAAgB,EAAE;IAuGjC;;OAEG;IACG,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IA8CvE;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAgC/B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA+B/B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAqC/B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAgC5B;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAiCpC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAoC7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAyChC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA0C7B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAqChC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAiDnC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAuC/B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAsC5B;;OAEG;IACH,OAAO,CAAC,2BAA2B;CA6CpC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
2
|
export class PromptRegistry {
|
|
3
|
-
pica;
|
|
4
|
-
constructor(pica) {
|
|
5
|
-
this.pica = pica;
|
|
6
|
-
}
|
|
7
3
|
/**
|
|
8
4
|
* List all available prompts
|
|
9
5
|
*/
|
|
@@ -92,42 +88,6 @@ export class PromptRegistry {
|
|
|
92
88
|
},
|
|
93
89
|
],
|
|
94
90
|
},
|
|
95
|
-
{
|
|
96
|
-
name: "whats-new",
|
|
97
|
-
description: "Daily-briefing funnel — surfaces what's changed since the user last looked",
|
|
98
|
-
arguments: [],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: "whats-wrong",
|
|
102
|
-
description: "Attention funnel — surfaces what's broken, blocked, or needs the user's input",
|
|
103
|
-
arguments: [],
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
name: "how-much-has-this-earned",
|
|
107
|
-
description: "Earnings lookup for a specific work — falls back to a statement-import nudge when no royalties have been imported",
|
|
108
|
-
arguments: [
|
|
109
|
-
{
|
|
110
|
-
name: "work_id",
|
|
111
|
-
description: "The work to summarise earnings for — required so the prompt can pull statements for the right song",
|
|
112
|
-
required: true,
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: "who-owes-me-something",
|
|
118
|
-
description: "Aggregates outstanding work owed to the user — pending invites, open disputes, and outstanding signatures — into a single 'what's outstanding' view",
|
|
119
|
-
arguments: [],
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "am-i-ready-to-register",
|
|
123
|
-
description: "Alias of register-my-works — check registration status across PROs and prepare ready works for submission",
|
|
124
|
-
arguments: [],
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: "pica_continue",
|
|
128
|
-
description: "Pick up where you left off — surfaces specific open loops from your recent assistant_interactions (unconfirmed writes, mid-flow drop-offs, mutations with no follow-up read)",
|
|
129
|
-
arguments: [],
|
|
130
|
-
},
|
|
131
91
|
];
|
|
132
92
|
}
|
|
133
93
|
/**
|
|
@@ -161,20 +121,6 @@ export class PromptRegistry {
|
|
|
161
121
|
return this.getLogASessionPrompt(args?.work_id);
|
|
162
122
|
case "set-recording-splits":
|
|
163
123
|
return this.getSetRecordingSplitsPrompt(args?.recording_id);
|
|
164
|
-
case "whats-new":
|
|
165
|
-
return this.getWhatsNewPrompt();
|
|
166
|
-
case "whats-wrong":
|
|
167
|
-
return this.getWhatsWrongPrompt();
|
|
168
|
-
case "how-much-has-this-earned":
|
|
169
|
-
return this.getHowMuchHasThisEarnedPrompt(args?.work_id);
|
|
170
|
-
case "who-owes-me-something":
|
|
171
|
-
return this.getWhoOwesMeSomethingPrompt();
|
|
172
|
-
case "am-i-ready-to-register":
|
|
173
|
-
// Alias — falls through to the same handler so existing
|
|
174
|
-
// `register-my-works` callers keep working.
|
|
175
|
-
return this.getRegisterMyWorksPrompt();
|
|
176
|
-
case "pica_continue":
|
|
177
|
-
return this.getPicaContinuePrompt();
|
|
178
124
|
default:
|
|
179
125
|
throw new Error(`Prompt not found: ${name}`);
|
|
180
126
|
}
|
|
@@ -695,186 +641,5 @@ If at any point the totals are off or I waver, stop and re-confirm. Splits are n
|
|
|
695
641
|
],
|
|
696
642
|
};
|
|
697
643
|
}
|
|
698
|
-
/**
|
|
699
|
-
* What's new — Atlas funnel for "what's new?", "any updates?", "catch me up".
|
|
700
|
-
*/
|
|
701
|
-
getWhatsNewPrompt() {
|
|
702
|
-
return {
|
|
703
|
-
messages: [
|
|
704
|
-
{
|
|
705
|
-
role: "user",
|
|
706
|
-
content: {
|
|
707
|
-
type: "text",
|
|
708
|
-
text: `The user just asked "what's new?" or one of its synonyms (any updates, catch me up, what's been happening).
|
|
709
|
-
|
|
710
|
-
Invoke pica_dashboard_briefing and surface the result. The briefing groups recent activity into deltas the user cares about — new credits, registration progress, statements imported, collaborators that joined, etc.
|
|
711
|
-
|
|
712
|
-
If the briefing returns no items (empty or "nothing new"), say so explicitly. Don't fabricate updates and don't pad with stale information. A clean "nothing new since you last looked" is the right answer when the substrate is quiet.
|
|
713
|
-
|
|
714
|
-
Format the response as a tight summary — group by category, lead with what changed, don't recapitulate the whole catalog. The user asked for the diff, not the snapshot.`,
|
|
715
|
-
},
|
|
716
|
-
},
|
|
717
|
-
],
|
|
718
|
-
};
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* What's wrong — Atlas funnel for "what's wrong with my songs?", "what
|
|
722
|
-
* needs fixing?", "anything urgent?", "what should I do?".
|
|
723
|
-
*/
|
|
724
|
-
getWhatsWrongPrompt() {
|
|
725
|
-
return {
|
|
726
|
-
messages: [
|
|
727
|
-
{
|
|
728
|
-
role: "user",
|
|
729
|
-
content: {
|
|
730
|
-
type: "text",
|
|
731
|
-
text: `The user just asked "what's wrong with my songs?" or one of its synonyms (what's broken, what needs fixing, what should I do, anything urgent).
|
|
732
|
-
|
|
733
|
-
Invoke pica_dashboard_attention and surface the result. The attention queue lists items that need the user's input or judgement — works missing required fields for registration, splits that don't total 100%, collaborators awaiting confirmation, disputes that have been open too long.
|
|
734
|
-
|
|
735
|
-
For each attention item, include a one-line "why it matters" and the canonical next tool to fix it. Don't bury the action — the user asked what's wrong because they want to fix it.
|
|
736
|
-
|
|
737
|
-
If the attention queue is empty, say so explicitly: "nothing urgent right now". That is itself a valuable answer — don't pad it.`,
|
|
738
|
-
},
|
|
739
|
-
},
|
|
740
|
-
],
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
/**
|
|
744
|
-
* How much has this earned — Atlas-resolved royalties summary with
|
|
745
|
-
* fallback nudge when no statements exist for the work.
|
|
746
|
-
*/
|
|
747
|
-
getHowMuchHasThisEarnedPrompt(workId) {
|
|
748
|
-
const workInstruction = workId
|
|
749
|
-
? `The work in question is ${workId}.`
|
|
750
|
-
: `Ask me which song I'm asking about. Use pica_search_all({ kind: 'work', query: <name> }) to resolve a name to a work_id if I name the song instead of giving you an ID.`;
|
|
751
|
-
return {
|
|
752
|
-
messages: [
|
|
753
|
-
{
|
|
754
|
-
role: "user",
|
|
755
|
-
content: {
|
|
756
|
-
type: "text",
|
|
757
|
-
text: `The user wants to know how much a specific song has earned.
|
|
758
|
-
|
|
759
|
-
${workInstruction}
|
|
760
|
-
|
|
761
|
-
Step 1 — call pica_royalties_summary({ work_id: <id> }) to pull cumulative earnings broken down by source (PRO, NRO, sync, mechanical, neighbouring rights).
|
|
762
|
-
|
|
763
|
-
Step 2 — IF the summary returns zero rows or "no statements found":
|
|
764
|
-
- Say so plainly. "I don't see any earnings statements for this song yet."
|
|
765
|
-
- Offer the import path: "Would you like to import a recent PRO, NRO, or sync statement?" — this maps to pica_ingest_statement, which accepts CSV / PDF / JSON exports from PRS, BMI, ASCAP, MLC, Songtrust, distributors, and sync agencies.
|
|
766
|
-
- Do NOT fabricate earnings. Empty is empty.
|
|
767
|
-
|
|
768
|
-
Step 3 — IF the summary returns data:
|
|
769
|
-
- Lead with the total figure in the user's preferred currency.
|
|
770
|
-
- Break it down by source and by year (most recent year first).
|
|
771
|
-
- Surface anomalies: a sudden drop, a missing quarter, a new platform that started paying.
|
|
772
|
-
- Offer pica_statements_list as the natural next step if they want to drill into a specific statement.
|
|
773
|
-
|
|
774
|
-
Step 4 — close with the right next action:
|
|
775
|
-
- If earnings look wrong, suggest pica_disputes_create to flag it.
|
|
776
|
-
- If earnings look right, suggest pica_export_industry_ready to generate a registration package that captures the work's earning history.`,
|
|
777
|
-
},
|
|
778
|
-
},
|
|
779
|
-
],
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Who owes me something — multi-tool orchestration aggregating pending
|
|
784
|
-
* invites, outstanding signatures, and open disputes into one view.
|
|
785
|
-
*/
|
|
786
|
-
getWhoOwesMeSomethingPrompt() {
|
|
787
|
-
return {
|
|
788
|
-
messages: [
|
|
789
|
-
{
|
|
790
|
-
role: "user",
|
|
791
|
-
content: {
|
|
792
|
-
type: "text",
|
|
793
|
-
text: `The user just asked "who owes me something?" or one of its synonyms (who hasn't responded, what's outstanding, who owes me a reply).
|
|
794
|
-
|
|
795
|
-
This is a multi-tool aggregation — there is no single "outstanding" tool. Pull from three substrates and merge into a single view:
|
|
796
|
-
|
|
797
|
-
1. pica_collaborators_invites_list — collaborators you invited who haven't accepted yet. Include sent_at so the user can see how long each has been outstanding.
|
|
798
|
-
|
|
799
|
-
2. pica_disputes_list — disputes that are open, awaiting the other party's response. Include opened_at and the disputed claim's summary.
|
|
800
|
-
|
|
801
|
-
3. Outstanding signatures — call pica_split_sheets_list (or pica_agreements_query if split sheets aren't applicable) to find documents that have been sent for signature but not all parties have signed. Surface each pending signer with the document title.
|
|
802
|
-
|
|
803
|
-
Render the aggregated output grouped by person where possible — if "Alice Smith" appears in two of the three buckets (e.g., invited collaborator AND awaiting signature), collapse them into one entry under her name. Otherwise group by category.
|
|
804
|
-
|
|
805
|
-
For each outstanding item, include:
|
|
806
|
-
- Who owes the response
|
|
807
|
-
- What they owe (accept invite, sign document, respond to dispute)
|
|
808
|
-
- How long they've been sitting on it
|
|
809
|
-
- The canonical next action: "Want me to nudge them?" → pica_collaborators_remind / pica_split_sheet_send (resend) / pica_disputes_nudge
|
|
810
|
-
|
|
811
|
-
If all three buckets are empty: say "nothing outstanding right now — everyone you're waiting on has responded." That is the right answer; don't pad it.`,
|
|
812
|
-
},
|
|
813
|
-
},
|
|
814
|
-
],
|
|
815
|
-
};
|
|
816
|
-
}
|
|
817
|
-
/**
|
|
818
|
-
* Pica continue — pick-up-where-you-left-off. Reads recent assistant_interactions
|
|
819
|
-
* for the calling user, surfaces specific named open loops per ADR Decision 4
|
|
820
|
-
* example, falls through to a clean "nothing in flight" message when empty.
|
|
821
|
-
*/
|
|
822
|
-
async getPicaContinuePrompt() {
|
|
823
|
-
let openLoops = [];
|
|
824
|
-
let fetchFailed = false;
|
|
825
|
-
if (this.pica) {
|
|
826
|
-
try {
|
|
827
|
-
openLoops = await this.pica.assistantInteractions.detectOpenLoops();
|
|
828
|
-
}
|
|
829
|
-
catch {
|
|
830
|
-
// Substrate read failed (network blip, RLS rejection, partition
|
|
831
|
-
// missing). Render the static fallback so the prompt still works.
|
|
832
|
-
fetchFailed = true;
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
const intro = `The user wants to pick up where they left off.
|
|
836
|
-
|
|
837
|
-
`;
|
|
838
|
-
let body;
|
|
839
|
-
if (fetchFailed || !this.pica) {
|
|
840
|
-
body = `I couldn't read your recent activity right now. Ask the user what they were last working on, or invoke pica_my_recent_questions to refresh and try again.`;
|
|
841
|
-
}
|
|
842
|
-
else if (openLoops.length === 0) {
|
|
843
|
-
body =
|
|
844
|
-
`No recent open loops were found in your assistant_interactions history (last 3 days). ` +
|
|
845
|
-
`Tell the user "nothing in flight right now — what would you like to start on?" and offer pica_dashboard_briefing as a starting point.`;
|
|
846
|
-
}
|
|
847
|
-
else {
|
|
848
|
-
const offers = openLoops.slice(0, 5).map(formatOpenLoopOffer).join("\n");
|
|
849
|
-
const more = openLoops.length > 5
|
|
850
|
-
? `\n\n_+${openLoops.length - 5} more open loops — ask the user if they want the full list._`
|
|
851
|
-
: "";
|
|
852
|
-
body =
|
|
853
|
-
`Here are the user's open loops from the last 3 days. Render each as a concrete continuation offer — name the entity, name the partial action, end with "Continue?".\n\n` +
|
|
854
|
-
`${offers}${more}\n\n` +
|
|
855
|
-
`Pick the most recent or highest-priority offer and lead with it. Do NOT dump all five at once — work one at a time. After the user picks one, invoke the canonical follow-up tool for that intent (e.g. pica_works_inspect to re-orient on a half-imported work, pica_credits_list to resume a credits sweep, pica_ingest_statement to resume a statement import).`;
|
|
856
|
-
}
|
|
857
|
-
return {
|
|
858
|
-
messages: [
|
|
859
|
-
{
|
|
860
|
-
role: "user",
|
|
861
|
-
content: {
|
|
862
|
-
type: "text",
|
|
863
|
-
text: intro + body,
|
|
864
|
-
},
|
|
865
|
-
},
|
|
866
|
-
],
|
|
867
|
-
};
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
function formatOpenLoopOffer(loop) {
|
|
871
|
-
const reasonLabel = loop.reason === "unconfirmed_write"
|
|
872
|
-
? "awaiting your confirmation"
|
|
873
|
-
: "stopped mid-flow";
|
|
874
|
-
const summary = loop.result_summary || loop.intent;
|
|
875
|
-
const entity = loop.entity_type && loop.entity_ids && loop.entity_ids.length > 0
|
|
876
|
-
? ` on ${loop.entity_type} ${loop.entity_ids[0]}`
|
|
877
|
-
: "";
|
|
878
|
-
return `▎ "${summary}"${entity} — ${reasonLabel} (session ${loop.session_id.slice(0, 8)}, ${new Date(loop.created_at).toISOString().slice(0, 16)}). Continue?`;
|
|
879
644
|
}
|
|
880
645
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AA6B7D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EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAmC8G;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;;;;;;;;;;;;;;;;;;;;;;;;;0GAyBwF;qBAC/F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,oBAAoB,CAAC,MAAe;QAC1C,MAAM,eAAe,GAAG,MAAM;YAC5B,CAAC,CAAC,iCAAiC,MAAM,GAAG;YAC5C,CAAC,CAAC,wHAAwH,CAAC;QAE7H,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;EAIhB,eAAe;;;;;;;;;;;;;;;;6HAgB4G;qBAClH;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,2BAA2B,CAAC,WAAoB;QACtD,MAAM,oBAAoB,GAAG,WAAW;YACtC,CAAC,CAAC,qBAAqB,WAAW,GAAG;YACrC,CAAC,CAAC,oIAAoI,CAAC;QAEzI,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;EAIhB,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;0IAwBoH;qBAC/H;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -21,7 +21,6 @@ export type ResourceResult = any;
|
|
|
21
21
|
export declare class ResourceRegistry {
|
|
22
22
|
private pica;
|
|
23
23
|
private config?;
|
|
24
|
-
private skills;
|
|
25
24
|
constructor(pica: PicaClient | null, config?: ServerConfig);
|
|
26
25
|
/**
|
|
27
26
|
* List all available resources
|
|
@@ -31,15 +30,6 @@ export declare class ResourceRegistry {
|
|
|
31
30
|
* Read a resource by URI
|
|
32
31
|
*/
|
|
33
32
|
readResource(uri: string): Promise<any>;
|
|
34
|
-
/**
|
|
35
|
-
* Resolve a skill:// URI to its content. Two URI shapes are accepted:
|
|
36
|
-
* - skill://withpica/index.json → enumeration JSON
|
|
37
|
-
* - skill://withpica/<name>/SKILL.md → per-skill markdown (frontmatter + body)
|
|
38
|
-
*
|
|
39
|
-
* ADR-140 Phase 2b. SEP-2640 bridge pattern — these URIs are the
|
|
40
|
-
* forward-compatible lane for when the MCP skill primitive lands.
|
|
41
|
-
*/
|
|
42
|
-
private readSkillResource;
|
|
43
33
|
/**
|
|
44
34
|
* Get OpenAPI specification resource
|
|
45
35
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/index.ts"],"names":[],"mappings":"AAEA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAU/C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAM5C,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC,CAAC;CACJ;AAED,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AAEjC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,MAAM,CAAC,CAAe;gBAElB,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,YAAY;IAK1D;;OAEG;IACH,aAAa,IAAI,kBAAkB,EAAE;IA8MrC;;OAEG;IACG,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAyJ7C;;OAEG;IACH,OAAO,CAAC,cAAc;IA6BtB;;OAEG;YACW,YAAY;IA4B1B;;OAEG;YACW,aAAa;IA4B3B;;OAEG;YACW,iBAAiB;IA2B/B;;OAEG;YACW,eAAe;IAoD7B;;OAEG;YACW,gBAAgB;IAc9B;;OAEG;YACW,mBAAmB;IAcjC;;OAEG;YACW,eAAe;CAa9B"}
|
package/dist/resources/index.js
CHANGED
|
@@ -6,7 +6,6 @@ import { WITHPICA_PRIMER } from "./llms-primer.js";
|
|
|
6
6
|
import { WELCOME_MARKDOWN } from "./welcome.js";
|
|
7
7
|
import { AGENT_GUIDE_AUTHENTICATED, AGENT_GUIDE_LOBBY } from "./agent-guide.js";
|
|
8
8
|
import { REQUIRED_SCHEMAS } from "./required-schemas.generated.js";
|
|
9
|
-
import { SkillsRegistry } from "../skills/index.js";
|
|
10
9
|
import { UPLOAD_HTML } from "../apps/upload.js";
|
|
11
10
|
import { DOWNLOAD_HTML } from "../apps/download.js";
|
|
12
11
|
import { RELEASE_HTML } from "../apps/release.js";
|
|
@@ -14,11 +13,9 @@ import { PICA_STORAGE_CONNECT_DOMAINS } from "../apps/shared.js";
|
|
|
14
13
|
export class ResourceRegistry {
|
|
15
14
|
pica;
|
|
16
15
|
config;
|
|
17
|
-
skills;
|
|
18
16
|
constructor(pica, config) {
|
|
19
17
|
this.pica = pica;
|
|
20
18
|
this.config = config;
|
|
21
|
-
this.skills = new SkillsRegistry();
|
|
22
19
|
}
|
|
23
20
|
/**
|
|
24
21
|
* List all available resources
|
|
@@ -41,66 +38,7 @@ export class ResourceRegistry {
|
|
|
41
38
|
if (this.config?.lobbyMode || !this.pica) {
|
|
42
39
|
return resources;
|
|
43
40
|
}
|
|
44
|
-
// ADR-140 Phase 2b — skills exposed as SEP-2640-shaped resources.
|
|
45
|
-
// index.json enumerates; per-skill SKILL.md URIs return frontmatter+body.
|
|
46
|
-
//
|
|
47
|
-
// URIs are HARDCODED literals (not generated from this.skills.listSkills())
|
|
48
|
-
// because scripts/lint-resource-coverage.ts regex-scans the first push
|
|
49
|
-
// block after the lobbyMode guard — dynamic URIs from a loop wouldn't be
|
|
50
|
-
// detected, breaking the cross-transport parity check (ADR-152). When
|
|
51
|
-
// adding a new skill, register its URI here AND in app/api/mcp/route.ts
|
|
52
|
-
// UI_RESOURCE_DEFS in the same commit.
|
|
53
41
|
resources.push({
|
|
54
|
-
uri: "skill://withpica/index.json",
|
|
55
|
-
name: "PICA Skills Index",
|
|
56
|
-
description: "Enumeration of downloadable PICA skill methodologies (SEP-2640 bridge). Each entry maps a kebab-case name to its skill:// URI, description, trigger phrases, and audience.",
|
|
57
|
-
mimeType: "application/json",
|
|
58
|
-
}, {
|
|
59
|
-
uri: "skill://withpica/catalog-audit/SKILL.md",
|
|
60
|
-
name: "Skill — catalog-audit",
|
|
61
|
-
description: "Audit a music catalog for completeness, quality, and registration readiness using PICA's MCP tools.",
|
|
62
|
-
mimeType: "text/markdown",
|
|
63
|
-
}, {
|
|
64
|
-
uri: "skill://withpica/register-my-works/SKILL.md",
|
|
65
|
-
name: "Skill — register-my-works",
|
|
66
|
-
description: "Check registration status across collection societies (PRS, MCPS, PPL, MLC) and prepare works for registration.",
|
|
67
|
-
mimeType: "text/markdown",
|
|
68
|
-
}, {
|
|
69
|
-
uri: "skill://withpica/prepare-for-sync/SKILL.md",
|
|
70
|
-
name: "Skill — prepare-for-sync",
|
|
71
|
-
description: "Make a catalog sync-ready — audio uploaded and analysed, mood and genre tagged, works findable by music supervisors.",
|
|
72
|
-
mimeType: "text/markdown",
|
|
73
|
-
}, {
|
|
74
|
-
uri: "skill://withpica/set-up-workspace/SKILL.md",
|
|
75
|
-
name: "Skill — set-up-workspace",
|
|
76
|
-
description: "Guide a new or returning user through PICA workspace setup — org profile, identifiers, privacy, storage, billing, team.",
|
|
77
|
-
mimeType: "text/markdown",
|
|
78
|
-
}, {
|
|
79
|
-
uri: "skill://withpica/close-the-loop/SKILL.md",
|
|
80
|
-
name: "Skill — close-the-loop",
|
|
81
|
-
description: "Walk through a single work's gaps one at a time, offering the specific tool call to fix each.",
|
|
82
|
-
mimeType: "text/markdown",
|
|
83
|
-
}, {
|
|
84
|
-
uri: "skill://withpica/set-recording-splits/SKILL.md",
|
|
85
|
-
name: "Skill — set-recording-splits",
|
|
86
|
-
description: "Guided master ownership split assignment on a recording — propose, dry-run preview, confirm, commit, verify.",
|
|
87
|
-
mimeType: "text/markdown",
|
|
88
|
-
}, {
|
|
89
|
-
uri: "skill://withpica/audit-credits/SKILL.md",
|
|
90
|
-
name: "Skill — audit-credits",
|
|
91
|
-
description: "Sweep across the catalog for credit gaps and split issues — works with no credits, splits not totalling 100%, missing identifiers.",
|
|
92
|
-
mimeType: "text/markdown",
|
|
93
|
-
}, {
|
|
94
|
-
uri: "skill://withpica/log-a-session/SKILL.md",
|
|
95
|
-
name: "Skill — log-a-session",
|
|
96
|
-
description: "Capture a studio session conversationally — what was made, when, where, who was there, what happened.",
|
|
97
|
-
mimeType: "text/markdown",
|
|
98
|
-
}, {
|
|
99
|
-
uri: "skill://withpica/enrich-from-peer-mcps/SKILL.md",
|
|
100
|
-
name: "Skill — enrich-from-peer-mcps",
|
|
101
|
-
description: "Fill PICA catalog gaps by composing across the user's other connected MCPs (Gmail, Drive, Notion, calendar, DAW).",
|
|
102
|
-
mimeType: "text/markdown",
|
|
103
|
-
}, {
|
|
104
42
|
uri: "llms://primer",
|
|
105
43
|
name: "PICA Domain Primer",
|
|
106
44
|
description: "Plain-language description of PICA's domain model, entity relationships, and recommended agent workflows. Read this first.",
|
|
@@ -230,11 +168,6 @@ export class ResourceRegistry {
|
|
|
230
168
|
name: "Required Fields — Assign Master Ownership Splits",
|
|
231
169
|
description: "Required + recommended fields for pica_recording_splits_create. Includes recording_splits split_type + role CHECK enums. Distinct from publishing splits on works.",
|
|
232
170
|
mimeType: "application/json",
|
|
233
|
-
}, {
|
|
234
|
-
uri: "pica://schemas/sync-placement-required",
|
|
235
|
-
name: "Required Fields — Register a Sync Placement",
|
|
236
|
-
description: "Required + recommended fields for pica_sync_placements_create — atomic placement + draft sync_license agreement + at least one contact + recordings + evidence sources. Includes sync_placements status / verification_status / confidentiality_level CHECK enums.",
|
|
237
|
-
mimeType: "application/json",
|
|
238
171
|
});
|
|
239
172
|
return resources;
|
|
240
173
|
}
|
|
@@ -271,10 +204,6 @@ export class ResourceRegistry {
|
|
|
271
204
|
if (!this.pica) {
|
|
272
205
|
throw new ResourceError(`Resource not available in lobby mode: ${uri}`);
|
|
273
206
|
}
|
|
274
|
-
// ADR-140 Phase 2b — skill:// URIs.
|
|
275
|
-
if (uri.startsWith("skill://withpica/")) {
|
|
276
|
-
return this.readSkillResource(uri);
|
|
277
|
-
}
|
|
278
207
|
switch (uri) {
|
|
279
208
|
case "llms://primer":
|
|
280
209
|
return {
|
|
@@ -359,8 +288,7 @@ export class ResourceRegistry {
|
|
|
359
288
|
case "pica://schemas/claim-required":
|
|
360
289
|
case "pica://schemas/session-required":
|
|
361
290
|
case "pica://schemas/split-sheet-required":
|
|
362
|
-
case "pica://schemas/recording-splits-required":
|
|
363
|
-
case "pica://schemas/sync-placement-required": {
|
|
291
|
+
case "pica://schemas/recording-splits-required": {
|
|
364
292
|
const key = uri.replace("pica://schemas/", "");
|
|
365
293
|
const body = REQUIRED_SCHEMAS[key];
|
|
366
294
|
if (!body)
|
|
@@ -379,67 +307,6 @@ export class ResourceRegistry {
|
|
|
379
307
|
throw new ResourceError(`Resource not found: ${uri}`);
|
|
380
308
|
}
|
|
381
309
|
}
|
|
382
|
-
/**
|
|
383
|
-
* Resolve a skill:// URI to its content. Two URI shapes are accepted:
|
|
384
|
-
* - skill://withpica/index.json → enumeration JSON
|
|
385
|
-
* - skill://withpica/<name>/SKILL.md → per-skill markdown (frontmatter + body)
|
|
386
|
-
*
|
|
387
|
-
* ADR-140 Phase 2b. SEP-2640 bridge pattern — these URIs are the
|
|
388
|
-
* forward-compatible lane for when the MCP skill primitive lands.
|
|
389
|
-
*/
|
|
390
|
-
readSkillResource(uri) {
|
|
391
|
-
if (uri === "skill://withpica/index.json") {
|
|
392
|
-
const index = this.skills.listSkills().map((s) => ({
|
|
393
|
-
name: s.name,
|
|
394
|
-
uri: `skill://withpica/${s.name}/SKILL.md`,
|
|
395
|
-
description: s.description,
|
|
396
|
-
triggers: s.triggers,
|
|
397
|
-
audience: s.audience,
|
|
398
|
-
}));
|
|
399
|
-
return {
|
|
400
|
-
contents: [
|
|
401
|
-
{
|
|
402
|
-
uri,
|
|
403
|
-
mimeType: "application/json",
|
|
404
|
-
text: JSON.stringify({ skills: index }, null, 2),
|
|
405
|
-
},
|
|
406
|
-
],
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
const match = uri.match(/^skill:\/\/withpica\/([a-z0-9-]+)\/SKILL\.md$/);
|
|
410
|
-
if (!match) {
|
|
411
|
-
throw new ResourceError(`Malformed skill URI: ${uri}`);
|
|
412
|
-
}
|
|
413
|
-
const name = match[1];
|
|
414
|
-
if (!this.skills.has(name)) {
|
|
415
|
-
throw new ResourceError(`Skill not found: ${name}`);
|
|
416
|
-
}
|
|
417
|
-
const skill = this.skills.getSkill(name);
|
|
418
|
-
// Reconstruct the SKILL.md shape: frontmatter + body, so the reader sees
|
|
419
|
-
// exactly what an external user would download from a `npx skills add` repo.
|
|
420
|
-
const frontmatter = [
|
|
421
|
-
"---",
|
|
422
|
-
`name: ${skill.name}`,
|
|
423
|
-
`description: ${skill.description}`,
|
|
424
|
-
"triggers:",
|
|
425
|
-
...skill.triggers.map((t) => ` - ${t}`),
|
|
426
|
-
`audience: ${skill.audience}`,
|
|
427
|
-
"tools_required:",
|
|
428
|
-
...skill.tools_required.map((t) => ` - ${t}`),
|
|
429
|
-
`output: ${skill.output}`,
|
|
430
|
-
"---",
|
|
431
|
-
"",
|
|
432
|
-
].join("\n");
|
|
433
|
-
return {
|
|
434
|
-
contents: [
|
|
435
|
-
{
|
|
436
|
-
uri,
|
|
437
|
-
mimeType: "text/markdown",
|
|
438
|
-
text: frontmatter + skill.body,
|
|
439
|
-
},
|
|
440
|
-
],
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
310
|
/**
|
|
444
311
|
* Get OpenAPI specification resource
|
|
445
312
|
*/
|