@withpica/mcp-server 2.10.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 +838 -0
- package/dist/config.d.ts +9 -9
- package/dist/index.d.ts +1 -1
- package/dist/prompts/index.d.ts +64 -64
- 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 -128
- 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/app-tools.d.ts.map +1 -1
- package/dist/tools/app-tools.js +30 -8
- package/dist/tools/app-tools.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/audio-files.d.ts.map +1 -1
- package/dist/tools/audio-files.js +10 -2
- package/dist/tools/audio-files.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/collaborators.js +7 -7
- package/dist/tools/collaborators.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/custody.d.ts.map +1 -1
- package/dist/tools/custody.js +2 -1
- package/dist/tools/custody.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 +418 -21
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/exports.js +5 -1
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/import.js +3 -3
- package/dist/tools/import.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/uploads.d.ts.map +1 -1
- package/dist/tools/uploads.js +9 -2
- package/dist/tools/uploads.js.map +1 -1
- package/dist/tools/works.d.ts +38 -38
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export interface ServerConfig {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
picaApiKey: string | null;
|
|
3
|
+
picaApiUrl: string;
|
|
4
|
+
serverName: string;
|
|
5
|
+
version: string;
|
|
6
|
+
debug: boolean;
|
|
7
|
+
lobbyMode: boolean;
|
|
8
|
+
credentialsPath: string;
|
|
9
|
+
discoveryMode: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare function loadConfig(): ServerConfig;
|
|
12
12
|
export declare function validateConfig(config: ServerConfig): void;
|
|
13
|
-
//# sourceMappingURL=config.d.ts.map
|
|
13
|
+
//# sourceMappingURL=config.d.ts.map
|
package/dist/index.d.ts
CHANGED
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<{
|
|
6
9
|
name: string;
|
|
7
10
|
description: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
description: string;
|
|
11
|
-
required?: boolean;
|
|
12
|
-
}>;
|
|
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
|
|
@@ -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,44 +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" },
|
|
197
|
-
template_type: { type: "string" },
|
|
198
|
-
body: { type: "string" },
|
|
199
|
-
description: { type: "string" },
|
|
200
|
-
is_default: { type: "boolean" },
|
|
201
|
-
title: { type: "string" },
|
|
202
|
-
work_id: { type: "string" },
|
|
203
|
-
status: {
|
|
204
|
-
type: "string",
|
|
205
|
-
enum: ["draft", "active", "completed", "terminated"],
|
|
206
|
-
},
|
|
207
|
-
notes: { type: "string" },
|
|
208
|
-
producer_id: { type: "string" },
|
|
209
|
-
recording_id: { type: "string" },
|
|
210
|
-
advance_amount: { type: "number" },
|
|
211
|
-
advance_currency: { type: "string" },
|
|
212
|
-
points_percentage: { type: "number" },
|
|
213
|
-
recoupment_terms: { type: "string" },
|
|
214
|
-
contractor_id: { type: "string" },
|
|
215
|
-
fee_amount: { type: "number" },
|
|
216
|
-
fee_currency: { type: "string" },
|
|
217
|
-
rights_assigned: { type: "string" },
|
|
218
|
-
},
|
|
219
|
-
required: ["type", "id"],
|
|
104
|
+
properties: AGREEMENT_TYPES_WRITE_PROPERTIES,
|
|
105
|
+
required: [...AGREEMENT_TYPES_UPDATE_REQUIRED],
|
|
220
106
|
},
|
|
221
107
|
},
|
|
222
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,OAAO,EACL,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,qBAAqB,CAAC;AAI7B,MAAM,OAAO,mBAAmB;IACtB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEO,WAAW,CAAC,IAAmB;QACrC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,UAAU;gBACb,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC;YACtC,KAAK,UAAU;gBACb,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC;YACtC,KAAK,eAAe;gBAClB,OAAO,IAAI,C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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"}
|