@withpica/mcp-server 2.4.2 → 2.5.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/dist/__mocks__/mppx-mcp-sdk-server.d.ts +6 -0
- package/dist/__mocks__/mppx-mcp-sdk-server.d.ts.map +1 -0
- package/dist/__mocks__/mppx-mcp-sdk-server.js +6 -0
- package/dist/__mocks__/mppx-mcp-sdk-server.js.map +1 -0
- package/dist/__mocks__/mppx-server.d.ts +12 -0
- package/dist/__mocks__/mppx-server.d.ts.map +1 -0
- package/dist/__mocks__/mppx-server.js +12 -0
- package/dist/__mocks__/mppx-server.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/pica-sdk.d.ts +990 -1038
- package/dist/pica-sdk.d.ts.map +1 -1
- package/dist/pica-sdk.js +34 -5
- package/dist/pica-sdk.js.map +1 -1
- package/dist/prompts/index.d.ts +64 -64
- package/dist/resources/index.d.ts +52 -52
- package/dist/server.d.ts +32 -32
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +12 -8
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +8 -3
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +57 -5
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/exports.js +24 -2
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/index.d.ts +36 -36
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +2 -15
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/people.d.ts +46 -46
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +3 -9
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/releases.d.ts.map +1 -1
- package/dist/tools/releases.js +6 -14
- package/dist/tools/releases.js.map +1 -1
- package/dist/tools/search.d.ts +20 -20
- package/dist/tools/send.d.ts.map +1 -1
- package/dist/tools/send.js +6 -0
- package/dist/tools/send.js.map +1 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +15 -5
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/share-links.js +2 -2
- package/dist/tools/share-links.js.map +1 -1
- package/dist/tools/split-sheets.d.ts.map +1 -1
- package/dist/tools/split-sheets.js +6 -1
- package/dist/tools/split-sheets.js.map +1 -1
- package/dist/tools/works.d.ts +46 -46
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +34 -1
- package/dist/tools/works.js.map +1 -1
- package/dist/utils/errors.d.ts +9 -9
- package/dist/utils/formatting.d.ts +16 -35
- package/package.json +1 -1
package/dist/prompts/index.d.ts
CHANGED
|
@@ -3,76 +3,76 @@
|
|
|
3
3
|
* Manages pre-configured prompts for common workflows
|
|
4
4
|
*/
|
|
5
5
|
export interface PromptDefinition {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
arguments?: Array<{
|
|
9
6
|
name: string;
|
|
10
7
|
description: string;
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
arguments?: Array<{
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
}>;
|
|
13
13
|
}
|
|
14
14
|
export interface PromptMessage {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
role: "user" | "assistant";
|
|
16
|
+
content: {
|
|
17
|
+
type: string;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
20
|
}
|
|
21
21
|
export interface PromptResult {
|
|
22
|
-
|
|
22
|
+
messages: PromptMessage[];
|
|
23
23
|
}
|
|
24
24
|
export declare class PromptRegistry {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
25
|
+
/**
|
|
26
|
+
* List all available prompts
|
|
27
|
+
*/
|
|
28
|
+
listPrompts(): PromptDefinition[];
|
|
29
|
+
/**
|
|
30
|
+
* Get a prompt by name
|
|
31
|
+
*/
|
|
32
|
+
getPrompt(name: string, args?: Record<string, any>): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Analyze catalog prompt
|
|
35
|
+
*/
|
|
36
|
+
private getAnalyzeCatalogPrompt;
|
|
37
|
+
/**
|
|
38
|
+
* Find duplicates prompt
|
|
39
|
+
*/
|
|
40
|
+
private getFindDuplicatesPrompt;
|
|
41
|
+
/**
|
|
42
|
+
* Enrich metadata prompt
|
|
43
|
+
*/
|
|
44
|
+
private getEnrichMetadataPrompt;
|
|
45
|
+
/**
|
|
46
|
+
* Verify works prompt
|
|
47
|
+
*/
|
|
48
|
+
private getVerifyWorksPrompt;
|
|
49
|
+
/**
|
|
50
|
+
* Assess catalog health prompt
|
|
51
|
+
*/
|
|
52
|
+
private getAssessCatalogHealthPrompt;
|
|
53
|
+
/**
|
|
54
|
+
* Audit credits prompt
|
|
55
|
+
*/
|
|
56
|
+
private getAuditCreditsPrompt;
|
|
57
|
+
/**
|
|
58
|
+
* New catalog setup prompt — first-time onboarding
|
|
59
|
+
*/
|
|
60
|
+
private getNewCatalogSetupPrompt;
|
|
61
|
+
/**
|
|
62
|
+
* Close the loop — check a specific work's gaps and offer to fix each one
|
|
63
|
+
*/
|
|
64
|
+
private getCloseTheLoopPrompt;
|
|
65
|
+
/**
|
|
66
|
+
* Register my works — check registration status and prepare for PRO submission
|
|
67
|
+
*/
|
|
68
|
+
private getRegisterMyWorksPrompt;
|
|
69
|
+
/**
|
|
70
|
+
* Workspace autopilot — assess state and route to the right workflow
|
|
71
|
+
*/
|
|
72
|
+
private getWorkspaceAutopilotPrompt;
|
|
73
|
+
/**
|
|
74
|
+
* Prepare for sync — get catalog sync-ready
|
|
75
|
+
*/
|
|
76
|
+
private getPrepareForSyncPrompt;
|
|
77
77
|
}
|
|
78
|
-
//# sourceMappingURL=index.d.ts.map
|
|
78
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,61 +4,61 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { PicaClient } from "../pica-sdk.js";
|
|
6
6
|
export interface ResourceDefinition {
|
|
7
|
-
uri: string;
|
|
8
|
-
name: string;
|
|
9
|
-
description: string;
|
|
10
|
-
mimeType: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ResourceContent {
|
|
13
|
-
contents: Array<{
|
|
14
7
|
uri: string;
|
|
8
|
+
name: string;
|
|
9
|
+
description: string;
|
|
15
10
|
mimeType: string;
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
}
|
|
12
|
+
export interface ResourceContent {
|
|
13
|
+
contents: Array<{
|
|
14
|
+
uri: string;
|
|
15
|
+
mimeType: string;
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
18
|
}
|
|
19
19
|
export type ResourceResult = any;
|
|
20
20
|
export declare class ResourceRegistry {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
21
|
+
private pica;
|
|
22
|
+
constructor(pica: PicaClient);
|
|
23
|
+
/**
|
|
24
|
+
* List all available resources
|
|
25
|
+
*/
|
|
26
|
+
listResources(): ResourceDefinition[];
|
|
27
|
+
/**
|
|
28
|
+
* Read a resource by URI
|
|
29
|
+
*/
|
|
30
|
+
readResource(uri: string): Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Get OpenAPI specification resource
|
|
33
|
+
*/
|
|
34
|
+
private getOpenAPISpec;
|
|
35
|
+
/**
|
|
36
|
+
* Get works list resource
|
|
37
|
+
*/
|
|
38
|
+
private getWorksList;
|
|
39
|
+
/**
|
|
40
|
+
* Get people list resource
|
|
41
|
+
*/
|
|
42
|
+
private getPeopleList;
|
|
43
|
+
/**
|
|
44
|
+
* Get recordings list resource
|
|
45
|
+
*/
|
|
46
|
+
private getRecordingsList;
|
|
47
|
+
/**
|
|
48
|
+
* Get catalog statistics resource
|
|
49
|
+
*/
|
|
50
|
+
private getCatalogStats;
|
|
51
|
+
/**
|
|
52
|
+
* Get catalog health (PICA Score) resource
|
|
53
|
+
*/
|
|
54
|
+
private getCatalogHealth;
|
|
55
|
+
/**
|
|
56
|
+
* Get workspace context resource — aggregated orientation for agents
|
|
57
|
+
*/
|
|
58
|
+
private getWorkspaceContext;
|
|
59
|
+
/**
|
|
60
|
+
* Get recent events resource — webhook deliveries
|
|
61
|
+
*/
|
|
62
|
+
private getRecentEvents;
|
|
63
63
|
}
|
|
64
|
-
//# sourceMappingURL=index.d.ts.map
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/server.d.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { ServerConfig } from "./config.js";
|
|
2
2
|
export declare class PicaMcpServer {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
3
|
+
private server;
|
|
4
|
+
private pica;
|
|
5
|
+
private toolRegistry;
|
|
6
|
+
private resourceRegistry;
|
|
7
|
+
private promptRegistry;
|
|
8
|
+
private config;
|
|
9
|
+
private httpServer?;
|
|
10
|
+
constructor(config: ServerConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Set up MCP protocol handlers on the main server instance (for stdio)
|
|
13
|
+
*/
|
|
14
|
+
private setupHandlers;
|
|
15
|
+
/**
|
|
16
|
+
* Start the MCP server.
|
|
17
|
+
*
|
|
18
|
+
* Transport is selected by environment:
|
|
19
|
+
* - MCP_TRANSPORT=http → HTTP server on MCP_PORT (default 3100)
|
|
20
|
+
* - Otherwise → stdio (default, for Claude Code / Cursor / VS Code)
|
|
21
|
+
*/
|
|
22
|
+
start(): Promise<void>;
|
|
23
|
+
private startStdio;
|
|
24
|
+
private startHttp;
|
|
25
|
+
/**
|
|
26
|
+
* Register protocol handlers on a server instance.
|
|
27
|
+
* Used by both the main server (stdio) and per-request servers (HTTP).
|
|
28
|
+
*/
|
|
29
|
+
private registerHandlers;
|
|
30
|
+
/**
|
|
31
|
+
* Stop the MCP server
|
|
32
|
+
*/
|
|
33
|
+
stop(): Promise<void>;
|
|
34
34
|
}
|
|
35
|
-
//# sourceMappingURL=server.d.ts.map
|
|
35
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/tools/assets.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAOtE,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/tools/assets.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAOtE,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAwL3D,UAAU;YAWV,QAAQ;YAKR,WAAW;YAKX,WAAW;YAMX,WAAW;YAKX,UAAU;YAKV,eAAe;YAOf,gBAAgB;YAOhB,WAAW;CAI1B"}
|
package/dist/tools/assets.js
CHANGED
|
@@ -52,6 +52,10 @@ export class AssetsTools {
|
|
|
52
52
|
type: "string",
|
|
53
53
|
description: "Asset name (e.g. 'Fender Stratocaster 1962')",
|
|
54
54
|
},
|
|
55
|
+
asset_type: {
|
|
56
|
+
type: "string",
|
|
57
|
+
description: "Asset type (required). Valid values: instrument, equipment, software, studio_space, other",
|
|
58
|
+
},
|
|
55
59
|
category: {
|
|
56
60
|
type: "string",
|
|
57
61
|
description: "Category: instrument, equipment, studio, software, other",
|
|
@@ -64,19 +68,19 @@ export class AssetsTools {
|
|
|
64
68
|
type: "string",
|
|
65
69
|
description: "Serial number if available",
|
|
66
70
|
},
|
|
67
|
-
|
|
71
|
+
acquisition_price: {
|
|
68
72
|
type: "number",
|
|
69
|
-
description: "Original purchase price",
|
|
73
|
+
description: "Original purchase/acquisition price",
|
|
70
74
|
},
|
|
71
|
-
|
|
75
|
+
acquired_at: {
|
|
72
76
|
type: "string",
|
|
73
|
-
description: "
|
|
77
|
+
description: "Acquisition date (YYYY-MM-DD)",
|
|
74
78
|
},
|
|
75
|
-
|
|
79
|
+
current_valuation: {
|
|
76
80
|
type: "number",
|
|
77
81
|
description: "Estimated current value",
|
|
78
82
|
},
|
|
79
|
-
|
|
83
|
+
valuation_currency: {
|
|
80
84
|
type: "string",
|
|
81
85
|
description: "Currency code (default: GBP)",
|
|
82
86
|
},
|
|
@@ -84,7 +88,7 @@ export class AssetsTools {
|
|
|
84
88
|
type: "string",
|
|
85
89
|
description: "Condition: excellent, good, fair, poor",
|
|
86
90
|
},
|
|
87
|
-
|
|
91
|
+
address: {
|
|
88
92
|
type: "string",
|
|
89
93
|
description: "Where the asset is stored",
|
|
90
94
|
},
|
|
@@ -93,7 +97,7 @@ export class AssetsTools {
|
|
|
93
97
|
description: "Whether the asset is insured",
|
|
94
98
|
},
|
|
95
99
|
},
|
|
96
|
-
required: ["name"],
|
|
100
|
+
required: ["name", "asset_type"],
|
|
97
101
|
additionalProperties: true,
|
|
98
102
|
},
|
|
99
103
|
},
|
package/dist/tools/assets.js.map
C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IAEO,KAAK,CAAC,gBAAgB,CAC5B,IAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3D,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA0B;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAClD,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF"}
|
package/dist/tools/bulk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.d.ts","sourceRoot":"","sources":["../../src/tools/bulk.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,SAAS;IACpB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"bulk.d.ts","sourceRoot":"","sources":["../../src/tools/bulk.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,SAAS;IACpB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YA0D3D,eAAe;YAkBf,qBAAqB;CAmBpC"}
|
package/dist/tools/bulk.js
CHANGED
|
@@ -41,13 +41,18 @@ export class BulkTools {
|
|
|
41
41
|
items: { type: "string" },
|
|
42
42
|
description: "Array of person IDs to update",
|
|
43
43
|
},
|
|
44
|
+
action: {
|
|
45
|
+
type: "string",
|
|
46
|
+
enum: ["add", "remove"],
|
|
47
|
+
description: "Whether to add or remove the specified roles",
|
|
48
|
+
},
|
|
44
49
|
roles: {
|
|
45
50
|
type: "array",
|
|
46
51
|
items: { type: "string" },
|
|
47
|
-
description: "Roles to
|
|
52
|
+
description: "Roles to add/remove (e.g. ['writer', 'composer', 'performer'])",
|
|
48
53
|
},
|
|
49
54
|
},
|
|
50
|
-
required: ["person_ids", "roles"],
|
|
55
|
+
required: ["person_ids", "action", "roles"],
|
|
51
56
|
},
|
|
52
57
|
},
|
|
53
58
|
executor: this.bulkUpdatePeopleRoles.bind(this),
|
|
@@ -73,7 +78,7 @@ export class BulkTools {
|
|
|
73
78
|
if (!args.roles?.length) {
|
|
74
79
|
return formatValidationError({ roles: "must be a non-empty array" });
|
|
75
80
|
}
|
|
76
|
-
const result = await this.pica.bulk.updatePeopleRoles(args.person_ids, args.roles);
|
|
81
|
+
const result = await this.pica.bulk.updatePeopleRoles(args.person_ids, args.roles, args.action || "add");
|
|
77
82
|
return formatSuccess(`Bulk updated roles for ${args.person_ids.length} people`, result);
|
|
78
83
|
}
|
|
79
84
|
}
|
package/dist/tools/bulk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../../src/tools/bulk.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,MAAM,OAAO,SAAS;IACZ,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ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ools/enrichment.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAItE,qBAAa,eAAe;IAC1B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"enrichment.d.ts","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAItE,qBAAa,eAAe;IAC1B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAwM3D,UAAU;YAQV,YAAY;YAQZ,gBAAgB;YAShB,oBAAoB;YAOpB,aAAa;YAQb,qBAAqB;YASrB,iBAAiB;YAOjB,iBAAiB;YAgEjB,iBAAiB;CAShC"}
|
package/dist/tools/enrichment.js
CHANGED
|
@@ -130,8 +130,13 @@ export class EnrichmentTools {
|
|
|
130
130
|
{
|
|
131
131
|
definition: {
|
|
132
132
|
name: "pica_enrich_work_spotify",
|
|
133
|
-
description: "Enrich
|
|
134
|
-
"
|
|
133
|
+
description: "Enrich works from Spotify. Accepts a work ID, a Spotify URL, or both.\n\n" +
|
|
134
|
+
"• work_id only — enriches that work (must have spotify_track_uri linked already)\n" +
|
|
135
|
+
"• spotify_url only — accepts any Spotify URL (track, album, or playlist). " +
|
|
136
|
+
"Matches tracks against existing catalog works, enriches matches, creates new works for unmatched tracks. " +
|
|
137
|
+
"Two-step: omit confirm to preview, set confirm: true to execute.\n" +
|
|
138
|
+
"• work_id + spotify_url — links the track URI to the work, then enriches it (no pre-link needed)\n\n" +
|
|
139
|
+
"→ then: pica_work_completeness (check gaps), pica_credits_update (add songwriting credits)",
|
|
135
140
|
inputSchema: {
|
|
136
141
|
type: "object",
|
|
137
142
|
properties: {
|
|
@@ -139,8 +144,17 @@ export class EnrichmentTools {
|
|
|
139
144
|
type: "string",
|
|
140
145
|
description: "The work ID to enrich from Spotify",
|
|
141
146
|
},
|
|
147
|
+
spotify_url: {
|
|
148
|
+
type: "string",
|
|
149
|
+
description: "Any Spotify URL or URI — track, album, or playlist. " +
|
|
150
|
+
"Examples: https://open.spotify.com/album/4aawyAB9vmqN3uQ7FjRGTy, " +
|
|
151
|
+
"spotify:track:6rqhFgbbKwnb9MLmUQDhG6",
|
|
152
|
+
},
|
|
153
|
+
confirm: {
|
|
154
|
+
type: "boolean",
|
|
155
|
+
description: "For URL mode: set true to execute import/enrich. Omit or false to preview first.",
|
|
156
|
+
},
|
|
142
157
|
},
|
|
143
|
-
required: ["work_id"],
|
|
144
158
|
},
|
|
145
159
|
},
|
|
146
160
|
executor: this.enrichWorkSpotify.bind(this),
|
|
@@ -194,8 +208,46 @@ export class EnrichmentTools {
|
|
|
194
208
|
return formatAsText(result);
|
|
195
209
|
}
|
|
196
210
|
async enrichWorkSpotify(args) {
|
|
197
|
-
const
|
|
198
|
-
|
|
211
|
+
const workId = args.work_id;
|
|
212
|
+
const spotifyUrl = args.spotify_url;
|
|
213
|
+
const confirm = args.confirm;
|
|
214
|
+
if (!workId && !spotifyUrl) {
|
|
215
|
+
return {
|
|
216
|
+
content: [
|
|
217
|
+
{
|
|
218
|
+
type: "text",
|
|
219
|
+
text: "Either work_id or spotify_url is required.",
|
|
220
|
+
},
|
|
221
|
+
],
|
|
222
|
+
isError: true,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
// Mode 1: work_id + spotify_url — link the track URI then enrich
|
|
226
|
+
if (workId && spotifyUrl) {
|
|
227
|
+
const result = await this.pica.enrichment.linkAndEnrichSpotify(workId, spotifyUrl);
|
|
228
|
+
return formatSuccess(`Linked Spotify track and enriched work ${workId}`, result);
|
|
229
|
+
}
|
|
230
|
+
// Mode 2: spotify_url only — delegate to streaming-link (preview/execute)
|
|
231
|
+
if (spotifyUrl) {
|
|
232
|
+
if (confirm) {
|
|
233
|
+
const result = await this.pica.enrichment.spotifyUrlExecute(spotifyUrl);
|
|
234
|
+
const data = result.data ?? result;
|
|
235
|
+
return formatSuccess(`Spotify import complete: ${data.worksCreated ?? 0} works created, ` +
|
|
236
|
+
`${data.worksEnriched ?? data.enrichResults?.length ?? 0} works enriched, ` +
|
|
237
|
+
`${data.duplicatesSkipped ?? 0} duplicates skipped`, data);
|
|
238
|
+
}
|
|
239
|
+
const result = await this.pica.enrichment.spotifyUrlPreview(spotifyUrl);
|
|
240
|
+
const data = result.data ?? result;
|
|
241
|
+
const trackCount = data.tracks?.length ?? 0;
|
|
242
|
+
const newCount = data.newTracks?.length ?? 0;
|
|
243
|
+
const dupCount = data.duplicates?.length ?? 0;
|
|
244
|
+
return formatSuccess(`Spotify preview: ${trackCount} tracks found. ` +
|
|
245
|
+
`${newCount} new (will be created), ${dupCount} already in catalog (will be enriched). ` +
|
|
246
|
+
`Call again with confirm: true to execute.`, data);
|
|
247
|
+
}
|
|
248
|
+
// Mode 3: work_id only — existing single-work enrichment
|
|
249
|
+
const result = await this.pica.enrichment.enrichWorkSpotify(workId);
|
|
250
|
+
return formatSuccess(`Spotify enrichment complete for work ${workId}`, result);
|
|
199
251
|
}
|
|
200
252
|
async enrichWorkYouTube(args) {
|
|
201
253
|
const result = await this.pica.enrichment.enrichWorkYouTube(args.work_id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrichment.js","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAAA,6DAA6D;AA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AM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,IAAI,CAAC,CAAC;YAC9C,OAAO,aAAa,CAClB,oBAAoB,UAAU,iBAAiB;gBAC7C,GAAG,QAAQ,2BAA2B,QAAQ,0CAA0C;gBACxF,2CAA2C,EAC7C,IAAI,CACL,CAAC;QACJ,CAAC;QAED,yDAAyD;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,MAAO,CAAC,CAAC;QACrE,OAAO,aAAa,CAClB,wCAAwC,MAAM,EAAE,EAChD,MAAM,CACP,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,iBAAiB,CAC7B,IAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1E,OAAO,aAAa,CAClB,wCAAwC,IAAI,CAAC,OAAO,EAAE,EACtD,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAItE,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAuH3D,gBAAgB;YAShB,sBAAsB;
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAItE,qBAAa,WAAW;IACtB,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAuH3D,gBAAgB;YAShB,sBAAsB;YAyBtB,mBAAmB;YAOnB,wBAAwB;YAgDxB,eAAe;CAS9B"}
|
package/dist/tools/exports.js
CHANGED
|
@@ -108,7 +108,19 @@ export class ExportTools {
|
|
|
108
108
|
}
|
|
109
109
|
async exportSongRegistration(_args) {
|
|
110
110
|
const result = await this.pica.exports.songRegistration();
|
|
111
|
-
|
|
111
|
+
const data = result?.data ?? result;
|
|
112
|
+
// ADR-146: Surface export gate warnings
|
|
113
|
+
const parts = ["Song registration export generated"];
|
|
114
|
+
if (data?.exportReadiness?.blockers?.length > 0) {
|
|
115
|
+
parts.push(`\n--- export gate (${data.exportReadiness.mode} mode) ---`);
|
|
116
|
+
for (const b of data.exportReadiness.blockers) {
|
|
117
|
+
parts.push(`${b.type}: ${b.workTitle} — ${b.resolutionHint}`);
|
|
118
|
+
}
|
|
119
|
+
if (data.exportReadiness.mode === "advisory") {
|
|
120
|
+
parts.push("These issues will block export when enforcement mode is enabled.");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return formatSuccess(parts.join("\n"), data);
|
|
112
124
|
}
|
|
113
125
|
async exportIndustryReady(_args) {
|
|
114
126
|
const result = await this.pica.exports.industryReady();
|
|
@@ -131,7 +143,7 @@ export class ExportTools {
|
|
|
131
143
|
},
|
|
132
144
|
});
|
|
133
145
|
const data = result?.data ?? result;
|
|
134
|
-
|
|
146
|
+
let summary = [
|
|
135
147
|
`Catalog Asset Report generated`,
|
|
136
148
|
`Stage: ${data.stage ?? "unknown"}`,
|
|
137
149
|
`PICA Score: ${data.pica_score ?? "N/A"}${data.pica_grade ? ` (${data.pica_grade})` : ""}`,
|
|
@@ -143,6 +155,16 @@ export class ExportTools {
|
|
|
143
155
|
]
|
|
144
156
|
.filter(Boolean)
|
|
145
157
|
.join("\n");
|
|
158
|
+
// ADR-146: Surface export gate warnings
|
|
159
|
+
if (data?.exportReadiness?.blockers?.length > 0) {
|
|
160
|
+
summary += `\nExport gate (${data.exportReadiness.mode} mode): ${data.exportReadiness.blockers.length} blocker(s)`;
|
|
161
|
+
for (const b of data.exportReadiness.blockers.slice(0, 5)) {
|
|
162
|
+
summary += `\n ${b.type}: ${b.workTitle} — ${b.resolutionHint}`;
|
|
163
|
+
}
|
|
164
|
+
if (data.exportReadiness.blockers.length > 5) {
|
|
165
|
+
summary += `\n ... and ${data.exportReadiness.blockers.length - 5} more`;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
146
168
|
return formatSuccess(summary, data);
|
|
147
169
|
}
|
|
148
170
|
async exportAiConsent(_args) {
|