@withpica/mcp-server 2.48.0 → 2.49.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 +25 -0
- package/dist/apps/generated/shared-bundle.d.ts +1 -1
- package/dist/apps/generated/shared-bundle.d.ts.map +1 -1
- package/dist/apps/generated/shared-bundle.js +1 -1
- package/dist/apps/generated/shared-bundle.js.map +1 -1
- package/dist/prompts/creator-question-atlas.d.ts +48 -0
- package/dist/prompts/creator-question-atlas.d.ts.map +1 -0
- package/dist/prompts/creator-question-atlas.js +586 -0
- package/dist/prompts/creator-question-atlas.js.map +1 -0
- package/dist/prompts/index.d.ts +32 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +235 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/server.d.ts +26 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +108 -10
- package/dist/server.js.map +1 -1
- package/dist/tools/agent-identity.d.ts.map +1 -1
- package/dist/tools/agent-identity.js +15 -0
- 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 +24 -0
- package/dist/tools/agreement-types.js.map +1 -1
- package/dist/tools/agreements.d.ts.map +1 -1
- package/dist/tools/agreements.js +21 -3
- package/dist/tools/agreements.js.map +1 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/analytics.js +19 -1
- package/dist/tools/analytics.js.map +1 -1
- package/dist/tools/app-tools.d.ts.map +1 -1
- package/dist/tools/app-tools.js +11 -2
- package/dist/tools/app-tools.js.map +1 -1
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +33 -0
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/audio-files.d.ts +5 -0
- package/dist/tools/audio-files.d.ts.map +1 -1
- package/dist/tools/audio-files.js +91 -0
- package/dist/tools/audio-files.js.map +1 -1
- package/dist/tools/audit.d.ts.map +1 -1
- package/dist/tools/audit.js +11 -2
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/auth.d.ts.map +1 -1
- package/dist/tools/auth.js +6 -0
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +6 -0
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +3 -0
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/collaborators.d.ts.map +1 -1
- package/dist/tools/collaborators.js +24 -3
- package/dist/tools/collaborators.js.map +1 -1
- package/dist/tools/comparisons.d.ts.map +1 -1
- package/dist/tools/comparisons.js +6 -0
- package/dist/tools/comparisons.js.map +1 -1
- package/dist/tools/credits.d.ts +18 -0
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +344 -4
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/custody.d.ts.map +1 -1
- package/dist/tools/custody.js +23 -2
- package/dist/tools/custody.js.map +1 -1
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +43 -7
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/directory.d.ts.map +1 -1
- package/dist/tools/directory.js +3 -0
- package/dist/tools/directory.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +77 -2
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +4 -1
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +3 -0
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/duplicates.d.ts.map +1 -1
- package/dist/tools/duplicates.js +6 -0
- package/dist/tools/duplicates.js.map +1 -1
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +33 -0
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/explainability.d.ts +24 -0
- package/dist/tools/explainability.d.ts.map +1 -0
- package/dist/tools/explainability.js +137 -0
- package/dist/tools/explainability.js.map +1 -0
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/exports.js +18 -3
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/feedback.d.ts.map +1 -1
- package/dist/tools/feedback.js +3 -0
- package/dist/tools/feedback.js.map +1 -1
- package/dist/tools/groups.d.ts.map +1 -1
- package/dist/tools/groups.js +12 -0
- package/dist/tools/groups.js.map +1 -1
- package/dist/tools/import-documents.d.ts.map +1 -1
- package/dist/tools/import-documents.js +10 -1
- package/dist/tools/import-documents.js.map +1 -1
- package/dist/tools/import.d.ts.map +1 -1
- package/dist/tools/import.js +36 -3
- package/dist/tools/import.js.map +1 -1
- package/dist/tools/index.d.ts +99 -4
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +170 -98
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +28 -8
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/labels.d.ts.map +1 -1
- package/dist/tools/labels.js +3 -0
- package/dist/tools/labels.js.map +1 -1
- package/dist/tools/licensing.d.ts.map +1 -1
- package/dist/tools/licensing.js +15 -0
- package/dist/tools/licensing.js.map +1 -1
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/memory.js +15 -3
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +50 -0
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/multimedia.d.ts.map +1 -1
- package/dist/tools/multimedia.js +15 -0
- package/dist/tools/multimedia.js.map +1 -1
- package/dist/tools/my-recent-questions.d.ts +25 -0
- package/dist/tools/my-recent-questions.d.ts.map +1 -0
- package/dist/tools/my-recent-questions.js +186 -0
- package/dist/tools/my-recent-questions.js.map +1 -0
- package/dist/tools/my-reported-issues.d.ts.map +1 -1
- package/dist/tools/my-reported-issues.js +3 -0
- package/dist/tools/my-reported-issues.js.map +1 -1
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +12 -0
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/notifications.d.ts.map +1 -1
- package/dist/tools/notifications.js +25 -1
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/onboarding.d.ts.map +1 -1
- package/dist/tools/onboarding.js +3 -0
- package/dist/tools/onboarding.js.map +1 -1
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +16 -1
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +18 -0
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/publishers.d.ts.map +1 -1
- package/dist/tools/publishers.js +6 -0
- package/dist/tools/publishers.js.map +1 -1
- package/dist/tools/purchases.d.ts +11 -10
- package/dist/tools/purchases.d.ts.map +1 -1
- package/dist/tools/purchases.js.map +1 -1
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +15 -0
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/recovery-hints.d.ts.map +1 -1
- package/dist/tools/recovery-hints.js +25 -0
- 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 +4 -2
- package/dist/tools/release-rich.js.map +1 -1
- package/dist/tools/releases.d.ts.map +1 -1
- package/dist/tools/releases.js +42 -0
- package/dist/tools/releases.js.map +1 -1
- package/dist/tools/report-issue.d.ts.map +1 -1
- package/dist/tools/report-issue.js +3 -0
- package/dist/tools/report-issue.js.map +1 -1
- package/dist/tools/royalties.d.ts.map +1 -1
- package/dist/tools/royalties.js +18 -3
- package/dist/tools/royalties.js.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +10 -1
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/send.d.ts.map +1 -1
- package/dist/tools/send.js +9 -0
- package/dist/tools/send.js.map +1 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +12 -0
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +30 -3
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/share-links.d.ts.map +1 -1
- package/dist/tools/share-links.js +15 -0
- package/dist/tools/share-links.js.map +1 -1
- package/dist/tools/sharing.d.ts +29 -0
- package/dist/tools/sharing.d.ts.map +1 -0
- package/dist/tools/sharing.js +131 -0
- package/dist/tools/sharing.js.map +1 -0
- package/dist/tools/signup.d.ts.map +1 -1
- package/dist/tools/signup.js +3 -0
- package/dist/tools/signup.js.map +1 -1
- package/dist/tools/split-sheets.d.ts.map +1 -1
- package/dist/tools/split-sheets.js +22 -1
- 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 +6 -0
- package/dist/tools/storage-config.js.map +1 -1
- package/dist/tools/subscription.d.ts.map +1 -1
- package/dist/tools/subscription.js +9 -10
- package/dist/tools/subscription.js.map +1 -1
- package/dist/tools/sync-placements.d.ts.map +1 -1
- package/dist/tools/sync-placements.js +20 -2
- package/dist/tools/sync-placements.js.map +1 -1
- package/dist/tools/team.d.ts.map +1 -1
- package/dist/tools/team.js +15 -0
- package/dist/tools/team.js.map +1 -1
- package/dist/tools/telegram.d.ts.map +1 -1
- package/dist/tools/telegram.js +9 -0
- package/dist/tools/telegram.js.map +1 -1
- package/dist/tools/uploads.d.ts.map +1 -1
- package/dist/tools/uploads.js +6 -0
- package/dist/tools/uploads.js.map +1 -1
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +24 -3
- package/dist/tools/works.js.map +1 -1
- package/package.json +4 -4
- package/server.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creator-question-atlas.js","sourceRoot":"","sources":["../../src/prompts/creator-question-atlas.ts"],"names":[],"mappings":"AA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AS;QACzB,oFAAoF;QACpF,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE;KAC1D;IAED,oEAAoE;IACpE,cAAc;IACd,oEAAoE;IACpE;QACE,QAAQ,EAAE,sBAAsB;QAChC,QAAQ,EAAE,CAAC,cAAc,EAAE,qBAAqB,CAAC;QACjD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,EAAE;KAClE;IACD;QACE,QAAQ,EAAE,0BAA0B;QACpC,QAAQ,EAAE,CAAC,mBAAmB,EAAE,sBAAsB,CAAC;QACvD,cAAc,EAAE,eAAe;QAC/B,WAAW,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE;KAC1D;CACF,CAAC"}
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
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.
|
|
4
8
|
*/
|
|
9
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
5
10
|
export interface PromptDefinition {
|
|
6
11
|
name: string;
|
|
7
12
|
description: string;
|
|
@@ -22,6 +27,8 @@ export interface PromptResult {
|
|
|
22
27
|
messages: PromptMessage[];
|
|
23
28
|
}
|
|
24
29
|
export declare class PromptRegistry {
|
|
30
|
+
private pica?;
|
|
31
|
+
constructor(pica?: PicaClient | undefined);
|
|
25
32
|
/**
|
|
26
33
|
* List all available prompts
|
|
27
34
|
*/
|
|
@@ -82,5 +89,30 @@ export declare class PromptRegistry {
|
|
|
82
89
|
* Set recording splits — guided master ownership split assignment with verify gate
|
|
83
90
|
*/
|
|
84
91
|
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;
|
|
85
117
|
}
|
|
86
118
|
//# 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;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAiB,MAAM,mBAAmB,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC;QAChB,I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;OAGG;IACH,OAAO,CAAC,6BAA6B;IAqCrC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAgCnC;;;;OAIG;YACW,qBAAqB;CAgDpC"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
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
|
+
}
|
|
3
7
|
/**
|
|
4
8
|
* List all available prompts
|
|
5
9
|
*/
|
|
@@ -88,6 +92,42 @@ export class PromptRegistry {
|
|
|
88
92
|
},
|
|
89
93
|
],
|
|
90
94
|
},
|
|
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
|
+
},
|
|
91
131
|
];
|
|
92
132
|
}
|
|
93
133
|
/**
|
|
@@ -121,6 +161,20 @@ export class PromptRegistry {
|
|
|
121
161
|
return this.getLogASessionPrompt(args?.work_id);
|
|
122
162
|
case "set-recording-splits":
|
|
123
163
|
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();
|
|
124
178
|
default:
|
|
125
179
|
throw new Error(`Prompt not found: ${name}`);
|
|
126
180
|
}
|
|
@@ -641,5 +695,186 @@ If at any point the totals are off or I waver, stop and re-confirm. Splits are n
|
|
|
641
695
|
],
|
|
642
696
|
};
|
|
643
697
|
}
|
|
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?`;
|
|
644
879
|
}
|
|
645
880
|
//# 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;AAmC7D,MAAM,OAAO,cAAc;IACL;IAApB,YAAoB,IAAiB;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAEzC;;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;gBACvB,WAAW,EACT,2FAA2F;gBAC7F,SAAS,EAAE,EAAE;aACd;YACD;gBAC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C,CAAC,EAAE,CAAC;YACT,IAAI;gBACF,yKAAyK;oBACzK,GAAG,MAAM,GAAG,IAAI,MAAM;oBACtB,oWAAoW,CAAC;QACzW,CAAC;QAED,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,KAAK,GAAG,IAAI;qBACnB;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAED,SAAS,mBAAmB,CAAC,IAAmB;IAC9C,MAAM,WAAW,GACf,IAAI,CAAC,MAAM,KAAK,mBAAmB;QACjC,CAAC,CAAC,4BAA4B;QAC9B,CAAC,CAAC,kBAAkB,CAAC;IACzB,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,MAAM,CAAC;IACnD,MAAM,MAAM,GACV,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QAC/D,CAAC,CAAC,OAAO,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;QACjD,CAAC,CAAC,EAAE,CAAC;IACT,OAAO,MAAM,OAAO,IAAI,MAAM,MAAM,WAAW,aAAa,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC;AACjK,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -7,7 +7,25 @@ export declare class PicaMcpServer {
|
|
|
7
7
|
private promptRegistry;
|
|
8
8
|
private config;
|
|
9
9
|
private httpServer?;
|
|
10
|
+
private readonly sessionId;
|
|
10
11
|
constructor(config: ServerConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Construct the dual-relay McpAuditLogger.
|
|
14
|
+
*
|
|
15
|
+
* One callback, two policies:
|
|
16
|
+
* - mcp_audit_log (via /api/mcp/audit): write-tool only — preserves
|
|
17
|
+
* ADR-154 F5's audit-log shape unchanged.
|
|
18
|
+
* - assistant_interactions + mcp_sessions (via
|
|
19
|
+
* /api/mcp/internal/log-interaction): EVERY tool call —
|
|
20
|
+
* ADR-226 Decision 8.
|
|
21
|
+
*
|
|
22
|
+
* `logReads: true` is mandatory: the McpAuditLogger short-circuits on
|
|
23
|
+
* `risk_level === "safe"` by default, which would block read-tool
|
|
24
|
+
* calls from reaching the substrate relay. The mcp_audit_log endpoint
|
|
25
|
+
* itself stays write-tool-only via a `risk_level !== "safe"` gate
|
|
26
|
+
* inside the callback.
|
|
27
|
+
*/
|
|
28
|
+
private buildAuditLogger;
|
|
11
29
|
/**
|
|
12
30
|
* Reinitialize server with new credentials (called after successful auth)
|
|
13
31
|
*/
|
|
@@ -37,6 +55,14 @@ export declare class PicaMcpServer {
|
|
|
37
55
|
* - Otherwise → stdio (default, for Claude Code / Cursor / VS Code)
|
|
38
56
|
*/
|
|
39
57
|
start(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* ADR-226 Phase 6 — fetch the user's vocabulary and append it to the
|
|
60
|
+
* SDK Server's static instructions string. Bails silently on lobby
|
|
61
|
+
* mode (no apiKey-to-user mapping yet) or any fetch failure (the base
|
|
62
|
+
* instructions are still valid; vocabulary is a layer on top, not a
|
|
63
|
+
* gate). Runs at most once per server instance.
|
|
64
|
+
*/
|
|
65
|
+
private injectVocabularyInstructions;
|
|
40
66
|
private startStdio;
|
|
41
67
|
private startHttp;
|
|
42
68
|
/**
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAiB3C,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAoB;IAChC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,gBAAgB,CAAmB;IAC3C,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,UAAU,CAAC,CAAkC;IAKrD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwB;gBAEtC,MAAM,EAAE,YAAY;IAmEhC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,gBAAgB;IAsCxB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IA8ClC;;;;;;;;;;;OAWG;IACH,OAAO,IAAI,IAAI;IAmCf;;OAEG;IACH,OAAO,CAAC,aAAa;IAIrB;;;;;;OAMG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC5B;;;;;;OAMG;YACW,4BAA4B;YAuB5B,UAAU;YAKV,SAAS;IA6HvB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAkDxB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAS5B"}
|
package/dist/server.js
CHANGED
|
@@ -8,13 +8,13 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
8
8
|
import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
|
|
9
9
|
import { CallToolRequestSchema, ListToolsRequestSchema, ListResourcesRequestSchema, ReadResourceRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
10
10
|
import { createServer } from "node:http";
|
|
11
|
-
import { timingSafeEqual } from "node:crypto";
|
|
11
|
+
import { timingSafeEqual, randomUUID } from "node:crypto";
|
|
12
12
|
import { PicaClient } from "@withpica/mcp-sdk";
|
|
13
13
|
import { ToolRegistry } from "./tools/index.js";
|
|
14
14
|
import { ResourceRegistry } from "./resources/index.js";
|
|
15
15
|
import { PromptRegistry } from "./prompts/index.js";
|
|
16
16
|
import { logError } from "@withpica/mcp-utils";
|
|
17
|
-
import { makeStdioCallerContext, makeHttpAuditFn, McpAuditLogger, } from "@withpica/mcp-utils";
|
|
17
|
+
import { makeStdioCallerContext, makeHttpAuditFn, makeHttpInteractionFn, McpAuditLogger, } from "@withpica/mcp-utils";
|
|
18
18
|
import { SERVER_INSTRUCTIONS_AUTHENTICATED, SERVER_INSTRUCTIONS_UNAUTHENTICATED, } from "./server-instructions.js";
|
|
19
19
|
export class PicaMcpServer {
|
|
20
20
|
server;
|
|
@@ -24,6 +24,11 @@ export class PicaMcpServer {
|
|
|
24
24
|
promptRegistry;
|
|
25
25
|
config;
|
|
26
26
|
httpServer;
|
|
27
|
+
// ADR-226 Phase 4 PR-B.5 — session UUID generated at process start and
|
|
28
|
+
// carried through every tool call's interaction relay. Decision 8 source
|
|
29
|
+
// rule for stdio: UUID generated at server initialize for the process
|
|
30
|
+
// lifetime.
|
|
31
|
+
sessionId = randomUUID();
|
|
27
32
|
constructor(config) {
|
|
28
33
|
this.config = config;
|
|
29
34
|
// Initialize PICA SDK client (null in lobby mode)
|
|
@@ -67,14 +72,62 @@ export class PicaMcpServer {
|
|
|
67
72
|
// Initialize registries with stdio caller context (api key hash)
|
|
68
73
|
this.toolRegistry = new ToolRegistry(this.pica, config, (apiKey) => this.reinitialize(apiKey), makeStdioCallerContext(config.picaApiKey), () => this.signOut());
|
|
69
74
|
this.resourceRegistry = new ResourceRegistry(this.pica, config);
|
|
70
|
-
this.promptRegistry = new PromptRegistry();
|
|
71
|
-
// Wire audit logger — fire-and-forget POST to /api/mcp/audit
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
this.promptRegistry = new PromptRegistry(this.pica ?? undefined);
|
|
76
|
+
// Wire audit logger — fire-and-forget POST to /api/mcp/audit AND
|
|
77
|
+
// /api/mcp/internal/log-interaction. ADR-226 Phase 4 PR-B.5: every
|
|
78
|
+
// tool call (read + write) writes one assistant_interactions row +
|
|
79
|
+
// bumps mcp_sessions; the original audit endpoint stays write-tool-only.
|
|
80
|
+
this.toolRegistry.setAuditLogger(this.buildAuditLogger(config.picaApiKey, config.picaApiUrl));
|
|
76
81
|
this.setupHandlers();
|
|
77
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Construct the dual-relay McpAuditLogger.
|
|
85
|
+
*
|
|
86
|
+
* One callback, two policies:
|
|
87
|
+
* - mcp_audit_log (via /api/mcp/audit): write-tool only — preserves
|
|
88
|
+
* ADR-154 F5's audit-log shape unchanged.
|
|
89
|
+
* - assistant_interactions + mcp_sessions (via
|
|
90
|
+
* /api/mcp/internal/log-interaction): EVERY tool call —
|
|
91
|
+
* ADR-226 Decision 8.
|
|
92
|
+
*
|
|
93
|
+
* `logReads: true` is mandatory: the McpAuditLogger short-circuits on
|
|
94
|
+
* `risk_level === "safe"` by default, which would block read-tool
|
|
95
|
+
* calls from reaching the substrate relay. The mcp_audit_log endpoint
|
|
96
|
+
* itself stays write-tool-only via a `risk_level !== "safe"` gate
|
|
97
|
+
* inside the callback.
|
|
98
|
+
*/
|
|
99
|
+
buildAuditLogger(apiKey, baseUrl) {
|
|
100
|
+
const interactionCtx = {
|
|
101
|
+
sessionId: this.sessionId,
|
|
102
|
+
// Stdio doesn't have access to clientInfo at construction time —
|
|
103
|
+
// the SDK's `getClientVersion()` only returns after `initialize`
|
|
104
|
+
// has been received. For now we send nulls; the relay endpoint
|
|
105
|
+
// upserts mcp_sessions with NULL agent identity, and an enrichment
|
|
106
|
+
// pass after `oninitialized` could update later.
|
|
107
|
+
clientName: null,
|
|
108
|
+
clientVersion: null,
|
|
109
|
+
// user_agent on stdio is "stdio:<pid>" — distinct from HTTP's
|
|
110
|
+
// browser-style UA but useful for grouping per-process activity.
|
|
111
|
+
userAgent: `stdio:${process.pid}`,
|
|
112
|
+
};
|
|
113
|
+
const auditFn = makeHttpAuditFn({ baseUrl, apiKey });
|
|
114
|
+
const interactionFn = makeHttpInteractionFn({
|
|
115
|
+
baseUrl,
|
|
116
|
+
apiKey,
|
|
117
|
+
context: interactionCtx,
|
|
118
|
+
});
|
|
119
|
+
return new McpAuditLogger(async (entry) => {
|
|
120
|
+
// Both fire-and-forget; failures swallowed by Promise.allSettled +
|
|
121
|
+
// McpAuditLogger's own try/catch wrapper. Telemetry must not break
|
|
122
|
+
// tool execution.
|
|
123
|
+
await Promise.allSettled([
|
|
124
|
+
// mcp_audit_log: write tools only (preserves ADR-154 F5 behaviour).
|
|
125
|
+
entry.risk_level !== "safe" ? auditFn(entry) : Promise.resolve(),
|
|
126
|
+
// assistant_interactions: EVERY tool call (ADR-226 Decision 8).
|
|
127
|
+
interactionFn(entry),
|
|
128
|
+
]);
|
|
129
|
+
}, /* logReads */ true);
|
|
130
|
+
}
|
|
78
131
|
/**
|
|
79
132
|
* Reinitialize server with new credentials (called after successful auth)
|
|
80
133
|
*/
|
|
@@ -86,7 +139,7 @@ export class PicaMcpServer {
|
|
|
86
139
|
});
|
|
87
140
|
this.config = { ...this.config, picaApiKey: apiKey, lobbyMode: false };
|
|
88
141
|
this.toolRegistry = new ToolRegistry(this.pica, this.config, (key) => this.reinitialize(key), makeStdioCallerContext(apiKey), () => this.signOut());
|
|
89
|
-
this.toolRegistry.setAuditLogger(
|
|
142
|
+
this.toolRegistry.setAuditLogger(this.buildAuditLogger(apiKey, this.config.picaApiUrl));
|
|
90
143
|
this.resourceRegistry = new ResourceRegistry(this.pica, this.config);
|
|
91
144
|
console.error("[MCP Server] Reinitialized with new credentials");
|
|
92
145
|
// Tell the client the tool + resource lists have changed so it
|
|
@@ -124,7 +177,7 @@ export class PicaMcpServer {
|
|
|
124
177
|
this.pica = null;
|
|
125
178
|
this.config = { ...this.config, picaApiKey: "", lobbyMode: true };
|
|
126
179
|
this.toolRegistry = new ToolRegistry(this.pica, this.config, (key) => this.reinitialize(key), makeStdioCallerContext(""), () => this.signOut());
|
|
127
|
-
this.toolRegistry.setAuditLogger(
|
|
180
|
+
this.toolRegistry.setAuditLogger(this.buildAuditLogger("", this.config.picaApiUrl));
|
|
128
181
|
this.resourceRegistry = new ResourceRegistry(this.pica, this.config);
|
|
129
182
|
console.error("[MCP Server] Reset to lobby mode after sign_out");
|
|
130
183
|
// Same listChanged story as reinitialize() — without these the
|
|
@@ -153,6 +206,24 @@ export class PicaMcpServer {
|
|
|
153
206
|
* - Otherwise → stdio (default, for Claude Code / Cursor / VS Code)
|
|
154
207
|
*/
|
|
155
208
|
async start() {
|
|
209
|
+
// ADR-226 Phase 6 — vocabulary context-prepend at handshake.
|
|
210
|
+
// Mutate the SDK's `_instructions` field BEFORE `connect(transport)`
|
|
211
|
+
// so the InitializeResult sent to the client includes the user's
|
|
212
|
+
// vocabulary preferences appended to the base ADR-208 instructions.
|
|
213
|
+
//
|
|
214
|
+
// This is a controlled coupling to the SDK's private `_instructions`
|
|
215
|
+
// field declared in
|
|
216
|
+
// node_modules/@modelcontextprotocol/sdk/dist/cjs/server/index.d.ts:78
|
|
217
|
+
// The field has been stable since SDK 1.0; the SDK is pinned in
|
|
218
|
+
// package.json so a future minor bump won't silently break this.
|
|
219
|
+
// A unit test at __tests__/server-vocabulary-injection.test.ts
|
|
220
|
+
// catches a rename within one CI cycle.
|
|
221
|
+
//
|
|
222
|
+
// Gated on `this.pica && !lobbyMode` because vocabulary is per-user
|
|
223
|
+
// and only stdio (one process = one user) maps cleanly to a single
|
|
224
|
+
// static instructions string. HTTP / lobby skip the mutation; their
|
|
225
|
+
// initialize-time instructions stay as the static catalog version.
|
|
226
|
+
await this.injectVocabularyInstructions();
|
|
156
227
|
const mode = process.env.MCP_TRANSPORT;
|
|
157
228
|
if (mode === "http") {
|
|
158
229
|
await this.startHttp();
|
|
@@ -167,6 +238,33 @@ export class PicaMcpServer {
|
|
|
167
238
|
console.error(`[MCP Server] API URL: ${this.config.picaApiUrl}`);
|
|
168
239
|
console.error("[MCP Server] Ready to accept connections");
|
|
169
240
|
}
|
|
241
|
+
/**
|
|
242
|
+
* ADR-226 Phase 6 — fetch the user's vocabulary and append it to the
|
|
243
|
+
* SDK Server's static instructions string. Bails silently on lobby
|
|
244
|
+
* mode (no apiKey-to-user mapping yet) or any fetch failure (the base
|
|
245
|
+
* instructions are still valid; vocabulary is a layer on top, not a
|
|
246
|
+
* gate). Runs at most once per server instance.
|
|
247
|
+
*/
|
|
248
|
+
async injectVocabularyInstructions() {
|
|
249
|
+
if (!this.pica || this.config.lobbyMode)
|
|
250
|
+
return;
|
|
251
|
+
try {
|
|
252
|
+
const result = await this.pica.assistantInteractions.getVocabularyContext();
|
|
253
|
+
const vocab = result?.instructions;
|
|
254
|
+
if (!vocab)
|
|
255
|
+
return;
|
|
256
|
+
const server = this.server;
|
|
257
|
+
const base = server._instructions ?? "";
|
|
258
|
+
server._instructions = base ? `${base}\n\n${vocab}` : vocab;
|
|
259
|
+
}
|
|
260
|
+
catch (err) {
|
|
261
|
+
// Vocabulary injection is best-effort — never block boot on it.
|
|
262
|
+
// Logged at warn so a transient network blip doesn't generate a
|
|
263
|
+
// Sentry error event per feedback_auth_handler_log_level.md.
|
|
264
|
+
const cause = err instanceof Error ? err.message : String(err);
|
|
265
|
+
console.error(`[MCP Server] Vocabulary injection failed (continuing with base instructions): ${cause}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
170
268
|
async startStdio() {
|
|
171
269
|
const transport = new StdioServerTransport();
|
|
172
270
|
await this.server.connect(transport);
|