@withpica/mcp-server 2.11.0 → 2.22.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 +617 -1
- package/dist/config.d.ts +9 -9
- package/dist/index.d.ts +1 -1
- package/dist/prompts/index.d.ts +66 -34
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +320 -607
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/index.d.ts +53 -53
- package/dist/server.d.ts +49 -49
- package/dist/tools/agreement-types.d.ts.map +1 -1
- package/dist/tools/agreement-types.js +14 -129
- package/dist/tools/agreement-types.js.map +1 -1
- package/dist/tools/agreements.d.ts.map +1 -1
- package/dist/tools/agreements.js +11 -109
- package/dist/tools/agreements.js.map +1 -1
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +17 -257
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/bulk.d.ts +7 -1
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +24 -2
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +27 -13
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/discovery.d.ts.map +1 -1
- package/dist/tools/discovery.js +8 -0
- package/dist/tools/discovery.js.map +1 -1
- package/dist/tools/enrichment.d.ts +47 -0
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +416 -19
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/index.d.ts +88 -72
- package/dist/tools/labels.d.ts +20 -0
- package/dist/tools/labels.d.ts.map +1 -0
- package/dist/tools/labels.js +47 -0
- package/dist/tools/labels.js.map +1 -0
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +37 -0
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/multimedia.d.ts.map +1 -1
- package/dist/tools/multimedia.js +86 -11
- package/dist/tools/multimedia.js.map +1 -1
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +4 -1
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/people.d.ts +38 -38
- package/dist/tools/projects.d.ts +1 -0
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +188 -17
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/publishers.d.ts +15 -1
- package/dist/tools/publishers.d.ts.map +1 -1
- package/dist/tools/publishers.js +43 -9
- package/dist/tools/publishers.js.map +1 -1
- package/dist/tools/recordings.d.ts +30 -30
- package/dist/tools/recovery-hints.d.ts.map +1 -1
- package/dist/tools/recovery-hints.js +49 -0
- package/dist/tools/recovery-hints.js.map +1 -1
- package/dist/tools/releases.d.ts +14 -1
- package/dist/tools/releases.d.ts.map +1 -1
- package/dist/tools/releases.js +247 -36
- package/dist/tools/releases.js.map +1 -1
- package/dist/tools/search.d.ts +20 -20
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +42 -8
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts +1 -0
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +51 -1
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/share-links.d.ts.map +1 -1
- package/dist/tools/share-links.js +19 -53
- 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 +3 -42
- package/dist/tools/split-sheets.js.map +1 -1
- package/dist/tools/team.d.ts.map +1 -1
- package/dist/tools/team.js +9 -4
- package/dist/tools/team.js.map +1 -1
- package/dist/tools/works.d.ts +38 -38
- package/package.json +1 -1
|
@@ -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,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MAAM;YAC5B,CAAC,CAAC,+BAA+B,MAAM,oCAAoC,MAAM,IAAI,KAAK,mCAAmC;YAC7H,CAAC,CAAC,iJAAiJ,CAAC;QAEtJ,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;EAEhB,eAAe;;;;;;;;;;;;;;;;;;;uGAmBsF;qBAC5F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,wBAAwB;QAC9B,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;mDAqBiC;qBACxC;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,2BAA2B;QACjC,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gIAiC8G;qBACrH;iBACF;aACF;SACF,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,uBAAuB;QAC7B,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE;wBACP,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;0GAuBwF;qBAC/F;iBACF;aACF;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -5,62 +5,62 @@
|
|
|
5
5
|
import { PicaClient } from "@withpica/mcp-sdk";
|
|
6
6
|
import { ServerConfig } from "../config.js";
|
|
7
7
|
export interface ResourceDefinition {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
uri: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
mimeType: string;
|
|
12
12
|
}
|
|
13
13
|
export interface ResourceContent {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
contents: Array<{
|
|
15
|
+
uri: string;
|
|
16
|
+
mimeType: string;
|
|
17
|
+
text: string;
|
|
18
|
+
}>;
|
|
19
19
|
}
|
|
20
20
|
export type ResourceResult = any;
|
|
21
21
|
export declare class ResourceRegistry {
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
22
|
+
private pica;
|
|
23
|
+
private config?;
|
|
24
|
+
constructor(pica: PicaClient | null, config?: ServerConfig);
|
|
25
|
+
/**
|
|
26
|
+
* List all available resources
|
|
27
|
+
*/
|
|
28
|
+
listResources(): ResourceDefinition[];
|
|
29
|
+
/**
|
|
30
|
+
* Read a resource by URI
|
|
31
|
+
*/
|
|
32
|
+
readResource(uri: string): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Get OpenAPI specification resource
|
|
35
|
+
*/
|
|
36
|
+
private getOpenAPISpec;
|
|
37
|
+
/**
|
|
38
|
+
* Get works list resource
|
|
39
|
+
*/
|
|
40
|
+
private getWorksList;
|
|
41
|
+
/**
|
|
42
|
+
* Get people list resource
|
|
43
|
+
*/
|
|
44
|
+
private getPeopleList;
|
|
45
|
+
/**
|
|
46
|
+
* Get recordings list resource
|
|
47
|
+
*/
|
|
48
|
+
private getRecordingsList;
|
|
49
|
+
/**
|
|
50
|
+
* Get catalog statistics resource
|
|
51
|
+
*/
|
|
52
|
+
private getCatalogStats;
|
|
53
|
+
/**
|
|
54
|
+
* Get catalog health (PICA Score) resource
|
|
55
|
+
*/
|
|
56
|
+
private getCatalogHealth;
|
|
57
|
+
/**
|
|
58
|
+
* Get workspace context resource — aggregated orientation for agents
|
|
59
|
+
*/
|
|
60
|
+
private getWorkspaceContext;
|
|
61
|
+
/**
|
|
62
|
+
* Get recent events resource — webhook deliveries
|
|
63
|
+
*/
|
|
64
|
+
private getRecentEvents;
|
|
65
65
|
}
|
|
66
|
-
//# sourceMappingURL=index.d.ts.map
|
|
66
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/server.d.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
+
* Reinitialize server with new credentials (called after successful auth)
|
|
13
|
+
*/
|
|
14
|
+
reinitialize(apiKey: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Reset the server back to lobby mode (called after sign_out).
|
|
17
|
+
* Mirrors reinitialize() but in reverse: clears the PicaClient,
|
|
18
|
+
* sets lobbyMode=true, and rebuilds the tool/resource registries so
|
|
19
|
+
* the next tools/list call returns only [pica_sign_in, pica_sign_out].
|
|
20
|
+
*
|
|
21
|
+
* Without this the server would keep advertising the full authenticated
|
|
22
|
+
* tool surface after sign_out until the process is restarted, which
|
|
23
|
+
* lies about what's actually available — every privileged tool call
|
|
24
|
+
* would still fail at the API layer (no PicaClient), but the surface
|
|
25
|
+
* itself shouldn't pretend the catalog is reachable.
|
|
26
|
+
*/
|
|
27
|
+
signOut(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Set up MCP protocol handlers on the main server instance (for stdio)
|
|
30
|
+
*/
|
|
31
|
+
private setupHandlers;
|
|
32
|
+
/**
|
|
33
|
+
* Start the MCP server.
|
|
34
|
+
*
|
|
35
|
+
* Transport is selected by environment:
|
|
36
|
+
* - MCP_TRANSPORT=http → HTTP server on MCP_PORT (default 3100)
|
|
37
|
+
* - Otherwise → stdio (default, for Claude Code / Cursor / VS Code)
|
|
38
|
+
*/
|
|
39
|
+
start(): Promise<void>;
|
|
40
|
+
private startStdio;
|
|
41
|
+
private startHttp;
|
|
42
|
+
/**
|
|
43
|
+
* Register protocol handlers on a server instance.
|
|
44
|
+
* Used by both the main server (stdio) and per-request servers (HTTP).
|
|
45
|
+
*/
|
|
46
|
+
private registerHandlers;
|
|
47
|
+
/**
|
|
48
|
+
* Stop the MCP server
|
|
49
|
+
*/
|
|
50
|
+
stop(): Promise<void>;
|
|
51
51
|
}
|
|
52
|
-
//# sourceMappingURL=server.d.ts.map
|
|
52
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreement-types.d.ts","sourceRoot":"","sources":["../../src/tools/agreement-types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"agreement-types.d.ts","sourceRoot":"","sources":["../../src/tools/agreement-types.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAWtE,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,QAAQ;IAWhB,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAqL3D,KAAK;YAML,OAAO;YAMP,MAAM;YA8CN,MAAM;YAON,MAAM;YASN,cAAc;YAMd,iBAAiB;YAOjB,kBAAkB;CAMjC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
2
|
import { formatAsText, formatList, formatSuccess } from "@withpica/mcp-utils";
|
|
3
3
|
import { notifyParties, summarizeNotifications } from "@withpica/mcp-utils";
|
|
4
|
+
import { AGREEMENT_TYPES_WRITE_PROPERTIES, AGREEMENT_TYPES_CREATE_REQUIRED, AGREEMENT_TYPES_UPDATE_REQUIRED, } from "@withpica/mcp-utils";
|
|
4
5
|
export class AgreementTypesTools {
|
|
5
6
|
pica;
|
|
6
7
|
constructor(pica) {
|
|
@@ -78,100 +79,15 @@ export class AgreementTypesTools {
|
|
|
78
79
|
{
|
|
79
80
|
definition: {
|
|
80
81
|
name: "pica_agreement_types_create",
|
|
81
|
-
description: "Create a new agreement of the specified type.
|
|
82
|
-
"
|
|
83
|
-
"
|
|
82
|
+
description: "Create a new agreement of the specified type. Three branches dispatched via 'type': " +
|
|
83
|
+
"template (→ agreement_templates, needs name + category + templateText), " +
|
|
84
|
+
"producer (→ producer_agreements, needs producer_id + royalty_points + deliverables + work_id|recording_id), " +
|
|
85
|
+
"work_for_hire (→ work_for_hire_agreements, needs contractor_id + contractor_role + fee_amount + services_description + work_id|recording_id). " +
|
|
86
|
+
"Per-branch field applicability is documented on each property; see ADR-174 Phase 2 items 16+17 for the reconciliation table.",
|
|
84
87
|
inputSchema: {
|
|
85
88
|
type: "object",
|
|
86
|
-
properties:
|
|
87
|
-
|
|
88
|
-
type: "string",
|
|
89
|
-
enum: ["template", "producer", "work_for_hire"],
|
|
90
|
-
description: "Agreement sub-type to create",
|
|
91
|
-
},
|
|
92
|
-
// Template fields
|
|
93
|
-
name: {
|
|
94
|
-
type: "string",
|
|
95
|
-
description: "Template name (templates only)",
|
|
96
|
-
},
|
|
97
|
-
template_type: {
|
|
98
|
-
type: "string",
|
|
99
|
-
description: "Type of agreement this template produces (templates only)",
|
|
100
|
-
},
|
|
101
|
-
body: {
|
|
102
|
-
type: "string",
|
|
103
|
-
description: "Template body with {{placeholders}} (templates only)",
|
|
104
|
-
},
|
|
105
|
-
description: {
|
|
106
|
-
type: "string",
|
|
107
|
-
description: "Short description",
|
|
108
|
-
},
|
|
109
|
-
is_default: {
|
|
110
|
-
type: "boolean",
|
|
111
|
-
description: "Set as default for its type (templates only)",
|
|
112
|
-
},
|
|
113
|
-
// Producer + work-for-hire shared
|
|
114
|
-
title: {
|
|
115
|
-
type: "string",
|
|
116
|
-
description: "Agreement title (producer / work-for-hire)",
|
|
117
|
-
},
|
|
118
|
-
work_id: {
|
|
119
|
-
type: "string",
|
|
120
|
-
description: "Work this agreement covers",
|
|
121
|
-
},
|
|
122
|
-
status: {
|
|
123
|
-
type: "string",
|
|
124
|
-
enum: ["draft", "active", "completed", "terminated"],
|
|
125
|
-
description: "Agreement status",
|
|
126
|
-
},
|
|
127
|
-
notes: {
|
|
128
|
-
type: "string",
|
|
129
|
-
description: "Internal notes",
|
|
130
|
-
},
|
|
131
|
-
// Producer-specific
|
|
132
|
-
producer_id: {
|
|
133
|
-
type: "string",
|
|
134
|
-
description: "Person ID of the producer (producer only)",
|
|
135
|
-
},
|
|
136
|
-
recording_id: {
|
|
137
|
-
type: "string",
|
|
138
|
-
description: "Recording this agreement covers (producer only)",
|
|
139
|
-
},
|
|
140
|
-
advance_amount: {
|
|
141
|
-
type: "number",
|
|
142
|
-
description: "Advance amount (producer only)",
|
|
143
|
-
},
|
|
144
|
-
advance_currency: {
|
|
145
|
-
type: "string",
|
|
146
|
-
description: "Currency code (producer only)",
|
|
147
|
-
},
|
|
148
|
-
points_percentage: {
|
|
149
|
-
type: "number",
|
|
150
|
-
description: "Producer points percentage (producer only)",
|
|
151
|
-
},
|
|
152
|
-
recoupment_terms: {
|
|
153
|
-
type: "string",
|
|
154
|
-
description: "Recoupment terms (producer only)",
|
|
155
|
-
},
|
|
156
|
-
// Work-for-hire-specific
|
|
157
|
-
contractor_id: {
|
|
158
|
-
type: "string",
|
|
159
|
-
description: "Person ID of the contractor (work-for-hire only)",
|
|
160
|
-
},
|
|
161
|
-
fee_amount: {
|
|
162
|
-
type: "number",
|
|
163
|
-
description: "Flat fee amount (work-for-hire only)",
|
|
164
|
-
},
|
|
165
|
-
fee_currency: {
|
|
166
|
-
type: "string",
|
|
167
|
-
description: "Currency code (work-for-hire only)",
|
|
168
|
-
},
|
|
169
|
-
rights_assigned: {
|
|
170
|
-
type: "string",
|
|
171
|
-
description: "Rights being assigned (work-for-hire only)",
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
required: ["type"],
|
|
89
|
+
properties: AGREEMENT_TYPES_WRITE_PROPERTIES,
|
|
90
|
+
required: [...AGREEMENT_TYPES_CREATE_REQUIRED],
|
|
175
91
|
},
|
|
176
92
|
},
|
|
177
93
|
executor: this.create.bind(this),
|
|
@@ -179,45 +95,14 @@ export class AgreementTypesTools {
|
|
|
179
95
|
{
|
|
180
96
|
definition: {
|
|
181
97
|
name: "pica_agreement_types_update",
|
|
182
|
-
description: "Update an existing agreement by type and ID."
|
|
98
|
+
description: "Update an existing agreement by type and ID. " +
|
|
99
|
+
"Note: PATCH on producer_agreements and work_for_hire_agreements is action-only " +
|
|
100
|
+
"(send_for_signature / countersign / mark_advance_paid / mark_paid / record_recoupment / " +
|
|
101
|
+
"calculate_royalty), not generic field-level. Template branch accepts field updates.",
|
|
183
102
|
inputSchema: {
|
|
184
103
|
type: "object",
|
|
185
|
-
properties:
|
|
186
|
-
|
|
187
|
-
type: "string",
|
|
188
|
-
enum: ["template", "producer", "work_for_hire"],
|
|
189
|
-
description: "Agreement sub-type",
|
|
190
|
-
},
|
|
191
|
-
id: {
|
|
192
|
-
type: "string",
|
|
193
|
-
description: "Agreement ID",
|
|
194
|
-
},
|
|
195
|
-
// All possible update fields (same as create minus type/id)
|
|
196
|
-
name: { type: "string", description: "Agreement name" },
|
|
197
|
-
template_type: { type: "string", description: "Template sub-type" },
|
|
198
|
-
body: { type: "string", description: "Agreement body text or markdown" },
|
|
199
|
-
description: { type: "string", description: "Short description of the agreement" },
|
|
200
|
-
is_default: { type: "boolean", description: "Whether this is the default template for its type" },
|
|
201
|
-
title: { type: "string", description: "Agreement title" },
|
|
202
|
-
work_id: { type: "string", description: "UUID of the associated work" },
|
|
203
|
-
status: {
|
|
204
|
-
type: "string",
|
|
205
|
-
enum: ["draft", "active", "completed", "terminated"],
|
|
206
|
-
description: "Agreement status",
|
|
207
|
-
},
|
|
208
|
-
notes: { type: "string", description: "Internal notes" },
|
|
209
|
-
producer_id: { type: "string", description: "UUID of the producer (person)" },
|
|
210
|
-
recording_id: { type: "string", description: "UUID of the associated recording" },
|
|
211
|
-
advance_amount: { type: "number", description: "Advance payment amount" },
|
|
212
|
-
advance_currency: { type: "string", description: "Currency code for the advance (e.g. GBP, USD)" },
|
|
213
|
-
points_percentage: { type: "number", description: "Points/royalty percentage (0-100)" },
|
|
214
|
-
recoupment_terms: { type: "string", description: "Recoupment terms description" },
|
|
215
|
-
contractor_id: { type: "string", description: "UUID of the contractor (person)" },
|
|
216
|
-
fee_amount: { type: "number", description: "Fee amount for work-for-hire" },
|
|
217
|
-
fee_currency: { type: "string", description: "Currency code for the fee" },
|
|
218
|
-
rights_assigned: { type: "string", description: "Description of rights being assigned" },
|
|
219
|
-
},
|
|
220
|
-
required: ["type", "id"],
|
|
104
|
+
properties: AGREEMENT_TYPES_WRITE_PROPERTIES,
|
|
105
|
+
required: [...AGREEMENT_TYPES_UPDATE_REQUIRED],
|
|
221
106
|
},
|
|
222
107
|
},
|
|
223
108
|
executor: this.update.bind(this),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreement-types.js","sourceRoot":"","sources":["../../src/tools/agreement-types.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAW7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"agreement-types.js","sourceRoot":"","sources":["../../src/tools/agreement-types.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAW7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,O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,CAAC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxE,OAAO,aAAa,CAAC,qBAAqB,EAAE,SAAS,CAAC,CAAC;IACzD,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAC9B,IAAyB;QAEzB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACtE,OAAO,aAAa,CAAC,sCAAsC,EAAE,MAAM,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agreements.d.ts","sourceRoot":"","sources":["../../src/tools/agreements.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"agreements.d.ts","sourceRoot":"","sources":["../../src/tools/agreements.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AA2BtE,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;YAiK3D,eAAe;YAef,gBAAgB;YA0DhB,eAAe;YAyBf,eAAe;YAQf,eAAe;YAOf,QAAQ;CAQvB"}
|
package/dist/tools/agreements.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatList, formatSuccess } from "@withpica/mcp-utils";
|
|
3
|
-
import { notifyParties, summarizeNotifications } from "@withpica/mcp-utils";
|
|
2
|
+
import { formatList, formatSuccess, notifyParties, summarizeNotifications, AGREEMENTS_WRITE_PROPERTIES, AGREEMENTS_CREATE_REQUIRED, AGREEMENTS_UPDATE_REQUIRED, } from "@withpica/mcp-utils";
|
|
4
3
|
const AGREEMENT_TYPE_ENUM = [
|
|
5
4
|
"master_recording",
|
|
6
5
|
"library_music",
|
|
@@ -100,64 +99,14 @@ export class AgreementsTools {
|
|
|
100
99
|
{
|
|
101
100
|
definition: {
|
|
102
101
|
name: "pica_agreements_create",
|
|
103
|
-
description: "Create a new agreement. Requires title
|
|
102
|
+
description: "Create a new agreement. Requires title + agreement_type + other_party_name. " +
|
|
103
|
+
"Prefer resolving the counterparty to a linked org via `counterparty_org_id` " +
|
|
104
|
+
"(use pica_search_all to look up the org UUID) over free-text other_party_name — " +
|
|
105
|
+
"the FK form is ADR-176-aligned and enables aggregate reporting by counterparty.",
|
|
104
106
|
inputSchema: {
|
|
105
107
|
type: "object",
|
|
106
|
-
properties:
|
|
107
|
-
|
|
108
|
-
type: "string",
|
|
109
|
-
description: "Agreement title",
|
|
110
|
-
},
|
|
111
|
-
agreement_type: {
|
|
112
|
-
type: "string",
|
|
113
|
-
description: "Type of agreement",
|
|
114
|
-
enum: [...AGREEMENT_TYPE_ENUM],
|
|
115
|
-
},
|
|
116
|
-
other_party_name: {
|
|
117
|
-
type: "string",
|
|
118
|
-
description: "Name of the other party (label, publisher, etc.)",
|
|
119
|
-
},
|
|
120
|
-
status: {
|
|
121
|
-
type: "string",
|
|
122
|
-
description: "Initial status (default: draft)",
|
|
123
|
-
enum: [
|
|
124
|
-
"draft",
|
|
125
|
-
"pending_signature",
|
|
126
|
-
"partially_signed",
|
|
127
|
-
"fully_executed",
|
|
128
|
-
"active",
|
|
129
|
-
"completed",
|
|
130
|
-
"terminated",
|
|
131
|
-
"expired",
|
|
132
|
-
"cancelled",
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
other_party_type: {
|
|
136
|
-
type: "string",
|
|
137
|
-
description: "Type of the other party (e.g., label, publisher, distributor)",
|
|
138
|
-
},
|
|
139
|
-
signing_date: {
|
|
140
|
-
type: "string",
|
|
141
|
-
description: "Date the agreement was signed (ISO 8601)",
|
|
142
|
-
},
|
|
143
|
-
start_date: {
|
|
144
|
-
type: "string",
|
|
145
|
-
description: "Start date of the agreement term (ISO 8601)",
|
|
146
|
-
},
|
|
147
|
-
end_date: {
|
|
148
|
-
type: "string",
|
|
149
|
-
description: "End date of the agreement term (ISO 8601)",
|
|
150
|
-
},
|
|
151
|
-
description: {
|
|
152
|
-
type: "string",
|
|
153
|
-
description: "Description of the agreement",
|
|
154
|
-
},
|
|
155
|
-
notes: {
|
|
156
|
-
type: "string",
|
|
157
|
-
description: "Internal notes",
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
required: ["title", "agreement_type", "other_party_name"],
|
|
108
|
+
properties: AGREEMENTS_WRITE_PROPERTIES,
|
|
109
|
+
required: [...AGREEMENTS_CREATE_REQUIRED],
|
|
161
110
|
},
|
|
162
111
|
},
|
|
163
112
|
executor: this.createAgreement.bind(this),
|
|
@@ -165,59 +114,12 @@ export class AgreementsTools {
|
|
|
165
114
|
{
|
|
166
115
|
definition: {
|
|
167
116
|
name: "pica_agreements_update",
|
|
168
|
-
description: "Update an existing agreement. Status changes trigger notifications
|
|
117
|
+
description: "Update an existing agreement. Status changes trigger notifications; " +
|
|
118
|
+
"counterparty_org_id changes require the linked-org check at the route layer.",
|
|
169
119
|
inputSchema: {
|
|
170
120
|
type: "object",
|
|
171
|
-
properties:
|
|
172
|
-
|
|
173
|
-
type: "string",
|
|
174
|
-
description: "Agreement ID",
|
|
175
|
-
},
|
|
176
|
-
title: {
|
|
177
|
-
type: "string",
|
|
178
|
-
description: "Updated title",
|
|
179
|
-
},
|
|
180
|
-
status: {
|
|
181
|
-
type: "string",
|
|
182
|
-
description: "Updated status",
|
|
183
|
-
enum: [
|
|
184
|
-
"draft",
|
|
185
|
-
"pending_signature",
|
|
186
|
-
"partially_signed",
|
|
187
|
-
"fully_executed",
|
|
188
|
-
"active",
|
|
189
|
-
"completed",
|
|
190
|
-
"terminated",
|
|
191
|
-
"expired",
|
|
192
|
-
"cancelled",
|
|
193
|
-
],
|
|
194
|
-
},
|
|
195
|
-
other_party_name: {
|
|
196
|
-
type: "string",
|
|
197
|
-
description: "Updated other party name",
|
|
198
|
-
},
|
|
199
|
-
signing_date: {
|
|
200
|
-
type: "string",
|
|
201
|
-
description: "Updated signing date (ISO 8601)",
|
|
202
|
-
},
|
|
203
|
-
start_date: {
|
|
204
|
-
type: "string",
|
|
205
|
-
description: "Updated start date (ISO 8601)",
|
|
206
|
-
},
|
|
207
|
-
end_date: {
|
|
208
|
-
type: "string",
|
|
209
|
-
description: "Updated end date (ISO 8601)",
|
|
210
|
-
},
|
|
211
|
-
description: {
|
|
212
|
-
type: "string",
|
|
213
|
-
description: "Updated description",
|
|
214
|
-
},
|
|
215
|
-
notes: {
|
|
216
|
-
type: "string",
|
|
217
|
-
description: "Updated internal notes",
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
required: ["id"],
|
|
121
|
+
properties: AGREEMENTS_WRITE_PROPERTIES,
|
|
122
|
+
required: [...AGREEMENTS_UPDATE_REQUIRED],
|
|
221
123
|
},
|
|
222
124
|
},
|
|
223
125
|
executor: this.updateAgreement.bind(this),
|