@withpica/mcp-server 2.1.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/README.md +305 -0
- package/dist/config.d.ts +34 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +33 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/pica-sdk.d.ts +1162 -0
- package/dist/pica-sdk.d.ts.map +1 -0
- package/dist/pica-sdk.js +1371 -0
- package/dist/pica-sdk.js.map +1 -0
- package/dist/prompts/index.d.ts +78 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +513 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/resources/index.d.ts +64 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +310 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/resources/llms-primer.d.ts +2 -0
- package/dist/resources/llms-primer.d.ts.map +1 -0
- package/dist/resources/llms-primer.js +67 -0
- package/dist/resources/llms-primer.js.map +1 -0
- package/dist/server.d.ts +27 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +140 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/agreement-types.d.ts +37 -0
- package/dist/tools/agreement-types.d.ts.map +1 -0
- package/dist/tools/agreement-types.js +579 -0
- package/dist/tools/agreement-types.js.map +1 -0
- package/dist/tools/agreements.d.ts +21 -0
- package/dist/tools/agreements.d.ts.map +1 -0
- package/dist/tools/agreements.js +328 -0
- package/dist/tools/agreements.js.map +1 -0
- package/dist/tools/analytics.d.ts +20 -0
- package/dist/tools/analytics.d.ts.map +1 -0
- package/dist/tools/analytics.js +126 -0
- package/dist/tools/analytics.js.map +1 -0
- package/dist/tools/assets.d.ts +23 -0
- package/dist/tools/assets.d.ts.map +1 -0
- package/dist/tools/assets.js +220 -0
- package/dist/tools/assets.js.map +1 -0
- package/dist/tools/audio-files.d.ts +21 -0
- package/dist/tools/audio-files.d.ts.map +1 -0
- package/dist/tools/audio-files.js +358 -0
- package/dist/tools/audio-files.js.map +1 -0
- package/dist/tools/bulk.d.ts +16 -0
- package/dist/tools/bulk.d.ts.map +1 -0
- package/dist/tools/bulk.js +82 -0
- package/dist/tools/bulk.js.map +1 -0
- package/dist/tools/calendar.d.ts +15 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +69 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/collaborators.d.ts +17 -0
- package/dist/tools/collaborators.d.ts.map +1 -0
- package/dist/tools/collaborators.js +133 -0
- package/dist/tools/collaborators.js.map +1 -0
- package/dist/tools/comparisons.d.ts +22 -0
- package/dist/tools/comparisons.d.ts.map +1 -0
- package/dist/tools/comparisons.js +86 -0
- package/dist/tools/comparisons.js.map +1 -0
- package/dist/tools/credits.d.ts +17 -0
- package/dist/tools/credits.d.ts.map +1 -0
- package/dist/tools/credits.js +136 -0
- package/dist/tools/credits.js.map +1 -0
- package/dist/tools/dashboard.d.ts +20 -0
- package/dist/tools/dashboard.d.ts.map +1 -0
- package/dist/tools/dashboard.js +156 -0
- package/dist/tools/dashboard.js.map +1 -0
- package/dist/tools/directory.d.ts +15 -0
- package/dist/tools/directory.d.ts.map +1 -0
- package/dist/tools/directory.js +108 -0
- package/dist/tools/directory.js.map +1 -0
- package/dist/tools/disputes.d.ts +18 -0
- package/dist/tools/disputes.d.ts.map +1 -0
- package/dist/tools/disputes.js +66 -0
- package/dist/tools/disputes.js.map +1 -0
- package/dist/tools/documents.d.ts +15 -0
- package/dist/tools/documents.d.ts.map +1 -0
- package/dist/tools/documents.js +38 -0
- package/dist/tools/documents.js.map +1 -0
- package/dist/tools/duplicates.d.ts +16 -0
- package/dist/tools/duplicates.d.ts.map +1 -0
- package/dist/tools/duplicates.js +72 -0
- package/dist/tools/duplicates.js.map +1 -0
- package/dist/tools/enrichment.d.ts +23 -0
- package/dist/tools/enrichment.d.ts.map +1 -0
- package/dist/tools/enrichment.js +207 -0
- package/dist/tools/enrichment.js.map +1 -0
- package/dist/tools/exports.d.ts +19 -0
- package/dist/tools/exports.d.ts.map +1 -0
- package/dist/tools/exports.js +155 -0
- package/dist/tools/exports.js.map +1 -0
- package/dist/tools/health.d.ts +17 -0
- package/dist/tools/health.d.ts.map +1 -0
- package/dist/tools/health.js +69 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/import-documents.d.ts +21 -0
- package/dist/tools/import-documents.d.ts.map +1 -0
- package/dist/tools/import-documents.js +191 -0
- package/dist/tools/import-documents.js.map +1 -0
- package/dist/tools/import.d.ts +29 -0
- package/dist/tools/import.d.ts.map +1 -0
- package/dist/tools/import.js +404 -0
- package/dist/tools/import.js.map +1 -0
- package/dist/tools/index.d.ts +48 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +394 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/integrations.d.ts +15 -0
- package/dist/tools/integrations.d.ts.map +1 -0
- package/dist/tools/integrations.js +102 -0
- package/dist/tools/integrations.js.map +1 -0
- package/dist/tools/licensing.d.ts +40 -0
- package/dist/tools/licensing.d.ts.map +1 -0
- package/dist/tools/licensing.js +436 -0
- package/dist/tools/licensing.js.map +1 -0
- package/dist/tools/memory.d.ts +21 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +121 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/multimedia.d.ts +19 -0
- package/dist/tools/multimedia.d.ts.map +1 -0
- package/dist/tools/multimedia.js +293 -0
- package/dist/tools/multimedia.js.map +1 -0
- package/dist/tools/notes.d.ts +21 -0
- package/dist/tools/notes.d.ts.map +1 -0
- package/dist/tools/notes.js +126 -0
- package/dist/tools/notes.js.map +1 -0
- package/dist/tools/notifications.d.ts +17 -0
- package/dist/tools/notifications.d.ts.map +1 -0
- package/dist/tools/notifications.js +117 -0
- package/dist/tools/notifications.js.map +1 -0
- package/dist/tools/people.d.ts +53 -0
- package/dist/tools/people.d.ts.map +1 -0
- package/dist/tools/people.js +534 -0
- package/dist/tools/people.js.map +1 -0
- package/dist/tools/pica-score.d.ts +15 -0
- package/dist/tools/pica-score.d.ts.map +1 -0
- package/dist/tools/pica-score.js +30 -0
- package/dist/tools/pica-score.js.map +1 -0
- package/dist/tools/projects.d.ts +19 -0
- package/dist/tools/projects.d.ts.map +1 -0
- package/dist/tools/projects.js +142 -0
- package/dist/tools/projects.js.map +1 -0
- package/dist/tools/purchases.d.ts +15 -0
- package/dist/tools/purchases.d.ts.map +1 -0
- package/dist/tools/purchases.js +65 -0
- package/dist/tools/purchases.js.map +1 -0
- package/dist/tools/recordings.d.ts +41 -0
- package/dist/tools/recordings.d.ts.map +1 -0
- package/dist/tools/recordings.js +293 -0
- package/dist/tools/recordings.js.map +1 -0
- package/dist/tools/registration.d.ts +16 -0
- package/dist/tools/registration.d.ts.map +1 -0
- package/dist/tools/registration.js +52 -0
- package/dist/tools/registration.js.map +1 -0
- package/dist/tools/releases.d.ts +18 -0
- package/dist/tools/releases.d.ts.map +1 -0
- package/dist/tools/releases.js +138 -0
- package/dist/tools/releases.js.map +1 -0
- package/dist/tools/royalties.d.ts +23 -0
- package/dist/tools/royalties.d.ts.map +1 -0
- package/dist/tools/royalties.js +263 -0
- package/dist/tools/royalties.js.map +1 -0
- package/dist/tools/search.d.ts +30 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +117 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/send.d.ts +18 -0
- package/dist/tools/send.d.ts.map +1 -0
- package/dist/tools/send.js +189 -0
- package/dist/tools/send.js.map +1 -0
- package/dist/tools/sessions.d.ts +18 -0
- package/dist/tools/sessions.d.ts.map +1 -0
- package/dist/tools/sessions.js +107 -0
- package/dist/tools/sessions.js.map +1 -0
- package/dist/tools/settings.d.ts +18 -0
- package/dist/tools/settings.d.ts.map +1 -0
- package/dist/tools/settings.js +98 -0
- package/dist/tools/settings.js.map +1 -0
- package/dist/tools/share-links.d.ts +19 -0
- package/dist/tools/share-links.d.ts.map +1 -0
- package/dist/tools/share-links.js +126 -0
- package/dist/tools/share-links.js.map +1 -0
- package/dist/tools/split-sheets.d.ts +24 -0
- package/dist/tools/split-sheets.d.ts.map +1 -0
- package/dist/tools/split-sheets.js +189 -0
- package/dist/tools/split-sheets.js.map +1 -0
- package/dist/tools/team.d.ts +22 -0
- package/dist/tools/team.d.ts.map +1 -0
- package/dist/tools/team.js +139 -0
- package/dist/tools/team.js.map +1 -0
- package/dist/tools/telegram.d.ts +20 -0
- package/dist/tools/telegram.d.ts.map +1 -0
- package/dist/tools/telegram.js +94 -0
- package/dist/tools/telegram.js.map +1 -0
- package/dist/tools/uploads.d.ts +17 -0
- package/dist/tools/uploads.d.ts.map +1 -0
- package/dist/tools/uploads.js +159 -0
- package/dist/tools/uploads.js.map +1 -0
- package/dist/tools/works.d.ts +53 -0
- package/dist/tools/works.d.ts.map +1 -0
- package/dist/tools/works.js +517 -0
- package/dist/tools/works.js.map +1 -0
- package/dist/utils/credit-gate.d.ts +17 -0
- package/dist/utils/credit-gate.d.ts.map +1 -0
- package/dist/utils/credit-gate.js +111 -0
- package/dist/utils/credit-gate.js.map +1 -0
- package/dist/utils/errors.d.ts +29 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +114 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/formatting.d.ts +63 -0
- package/dist/utils/formatting.d.ts.map +1 -0
- package/dist/utils/formatting.js +130 -0
- package/dist/utils/formatting.js.map +1 -0
- package/dist/utils/mpp.d.ts +78 -0
- package/dist/utils/mpp.d.ts.map +1 -0
- package/dist/utils/mpp.js +136 -0
- package/dist/utils/mpp.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Send Tools - MCP tools for sending messages, invites, and file requests through PICA's Send Hub
|
|
3
|
+
*/
|
|
4
|
+
import { formatSuccess, formatList, } from "../utils/formatting.js";
|
|
5
|
+
export class SendTools {
|
|
6
|
+
pica;
|
|
7
|
+
constructor(pica) {
|
|
8
|
+
this.pica = pica;
|
|
9
|
+
}
|
|
10
|
+
getTools() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
definition: {
|
|
14
|
+
name: "pica_send_message",
|
|
15
|
+
description: "Send a message through PICA's Send Hub. Supports portal invites, team invites, " +
|
|
16
|
+
"project invites, file requests, and audio shares. Each send_type requires different fields.",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
send_type: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Type of message to send",
|
|
23
|
+
enum: [
|
|
24
|
+
"portal_invite",
|
|
25
|
+
"team_invite",
|
|
26
|
+
"project_invite",
|
|
27
|
+
"file_request",
|
|
28
|
+
"audio_share",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
// Portal invite fields
|
|
32
|
+
person_id: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "Person ID to send to (required for portal_invite, optional for file_request/audio_share)",
|
|
35
|
+
},
|
|
36
|
+
email: {
|
|
37
|
+
type: "string",
|
|
38
|
+
description: "Email address (required for portal_invite, team_invite)",
|
|
39
|
+
},
|
|
40
|
+
message: {
|
|
41
|
+
type: "string",
|
|
42
|
+
description: "Optional personal message to include",
|
|
43
|
+
},
|
|
44
|
+
// Team invite fields
|
|
45
|
+
name: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Recipient name (for team_invite)",
|
|
48
|
+
},
|
|
49
|
+
permissions: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Permission level for team_invite (e.g. 'admin', 'editor', 'viewer')",
|
|
52
|
+
},
|
|
53
|
+
// Project invite fields
|
|
54
|
+
project_id: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Project ID (required for project_invite)",
|
|
57
|
+
},
|
|
58
|
+
participant_ids: {
|
|
59
|
+
type: "array",
|
|
60
|
+
items: { type: "string" },
|
|
61
|
+
description: "List of person IDs to invite to the project",
|
|
62
|
+
},
|
|
63
|
+
// File request fields
|
|
64
|
+
title: {
|
|
65
|
+
type: "string",
|
|
66
|
+
description: "Title for file_request",
|
|
67
|
+
},
|
|
68
|
+
recipient_email: {
|
|
69
|
+
type: "string",
|
|
70
|
+
description: "Recipient email for file_request/audio_share",
|
|
71
|
+
},
|
|
72
|
+
recipient_name: {
|
|
73
|
+
type: "string",
|
|
74
|
+
description: "Recipient name for file_request/audio_share",
|
|
75
|
+
},
|
|
76
|
+
// Audio share fields
|
|
77
|
+
work_id: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Work ID (required for audio_share)",
|
|
80
|
+
},
|
|
81
|
+
allow_download: {
|
|
82
|
+
type: "boolean",
|
|
83
|
+
description: "Allow downloading shared audio files",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ["send_type"],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
executor: this.sendMessage.bind(this),
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
definition: {
|
|
93
|
+
name: "pica_send_list",
|
|
94
|
+
description: "List items from the Send Hub with optional filters. Returns sent messages, " +
|
|
95
|
+
"invites, file requests, and audio shares.",
|
|
96
|
+
inputSchema: {
|
|
97
|
+
type: "object",
|
|
98
|
+
properties: {
|
|
99
|
+
type: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Filter by type (comma-separated for multiple)",
|
|
102
|
+
enum: [
|
|
103
|
+
"portal_invite",
|
|
104
|
+
"team_invite",
|
|
105
|
+
"project_invite",
|
|
106
|
+
"file_request",
|
|
107
|
+
"audio_share",
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
status: {
|
|
111
|
+
type: "string",
|
|
112
|
+
description: "Filter by status (e.g. 'pending', 'sent', 'accepted', 'expired')",
|
|
113
|
+
},
|
|
114
|
+
person_id: {
|
|
115
|
+
type: "string",
|
|
116
|
+
description: "Filter by recipient person ID",
|
|
117
|
+
},
|
|
118
|
+
work_id: {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "Filter by related work ID",
|
|
121
|
+
},
|
|
122
|
+
limit: {
|
|
123
|
+
type: "number",
|
|
124
|
+
description: "Max results (default: 50)",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
executor: this.listSent.bind(this),
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
definition: {
|
|
133
|
+
name: "pica_send_pending",
|
|
134
|
+
description: "List pending Send Hub items awaiting response (invites not yet accepted, " +
|
|
135
|
+
"file requests not yet fulfilled, etc.).",
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
executor: this.listPending.bind(this),
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
definition: {
|
|
145
|
+
name: "pica_send_resend",
|
|
146
|
+
description: "Resend a Send Hub item (re-send an invite, file request, or audio share).",
|
|
147
|
+
inputSchema: {
|
|
148
|
+
type: "object",
|
|
149
|
+
properties: {
|
|
150
|
+
id: {
|
|
151
|
+
type: "string",
|
|
152
|
+
description: "Send Hub item ID to resend",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
required: ["id"],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
executor: this.resendItem.bind(this),
|
|
159
|
+
},
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
async sendMessage(args) {
|
|
163
|
+
const result = await this.pica.send.send(args);
|
|
164
|
+
return formatSuccess(`${args.send_type} sent successfully.`, result);
|
|
165
|
+
}
|
|
166
|
+
async listSent(args) {
|
|
167
|
+
const result = await this.pica.send.list({
|
|
168
|
+
type: args.type,
|
|
169
|
+
status: args.status,
|
|
170
|
+
personId: args.person_id,
|
|
171
|
+
workId: args.work_id,
|
|
172
|
+
limit: args.limit,
|
|
173
|
+
});
|
|
174
|
+
return formatList(result.items, {
|
|
175
|
+
total: result.total,
|
|
176
|
+
type: args.type,
|
|
177
|
+
status: args.status,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async listPending(_args) {
|
|
181
|
+
const items = await this.pica.send.listPending();
|
|
182
|
+
return formatList(items, { status: "pending" });
|
|
183
|
+
}
|
|
184
|
+
async resendItem(args) {
|
|
185
|
+
const result = await this.pica.send.resend(args.id);
|
|
186
|
+
return formatSuccess(`Item ${args.id} resent.`, result);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/tools/send.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,aAAa,EAEb,UAAU,GACX,MAAM,wBAAwB,CAAC;AAEhC,MAAM,OAAO,SAAS;IACZ,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,mBAAmB;oBACzB,WAAW,EACT,iFAAiF;wBACjF,6FAA6F;oBAC/F,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,yBAAyB;gCACtC,IAAI,EAAE;oCACJ,eAAe;oCACf,aAAa;oCACb,gBAAgB;oCAChB,cAAc;oCACd,aAAa;iCACd;6BACF;4BACD,uBAAuB;4BACvB,SAAS,EAAE;gCACT,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,0FAA0F;6BAC7F;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,yDAAyD;6BAC5D;4BACD,O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ition, ToolExecutor } from "./index.js";
|
|
6
|
+
export declare class SessionsTools {
|
|
7
|
+
private pica;
|
|
8
|
+
constructor(pica: PicaClient);
|
|
9
|
+
getTools(): Array<{
|
|
10
|
+
definition: ToolDefinition;
|
|
11
|
+
executor: ToolExecutor;
|
|
12
|
+
}>;
|
|
13
|
+
private listSessions;
|
|
14
|
+
private getSession;
|
|
15
|
+
private createSession;
|
|
16
|
+
private getSessionTypes;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../src/tools/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAOtE,qBAAa,aAAa;IACxB,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;YAsF3D,YAAY;YAQZ,UAAU;YAKV,aAAa;YAKb,eAAe;CAM9B"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Work Sessions Tools - MCP tools for tracking studio sessions
|
|
3
|
+
*/
|
|
4
|
+
import { formatAsText, formatSuccess, formatStructuredList, } from "../utils/formatting.js";
|
|
5
|
+
export class SessionsTools {
|
|
6
|
+
pica;
|
|
7
|
+
constructor(pica) {
|
|
8
|
+
this.pica = pica;
|
|
9
|
+
}
|
|
10
|
+
getTools() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
definition: {
|
|
14
|
+
name: "pica_sessions_list",
|
|
15
|
+
description: "List studio sessions — recording, mixing, mastering, writing sessions. Shows who was there, what was recorded, and when.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
limit: {
|
|
20
|
+
type: "number",
|
|
21
|
+
description: "Max results (default 50)",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
executor: this.listSessions.bind(this),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
definition: {
|
|
30
|
+
name: "pica_sessions_get",
|
|
31
|
+
description: "Get details of a specific studio session — participants, works recorded, audio files, documents.",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
id: { type: "string", description: "Session ID" },
|
|
36
|
+
},
|
|
37
|
+
required: ["id"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
executor: this.getSession.bind(this),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
definition: {
|
|
44
|
+
name: "pica_sessions_create",
|
|
45
|
+
description: "Log a new studio session — who was there, what was worked on, where it happened. Session types: recording, mixing, mastering, writing, production, rehearsal.",
|
|
46
|
+
inputSchema: {
|
|
47
|
+
type: "object",
|
|
48
|
+
properties: {
|
|
49
|
+
title: {
|
|
50
|
+
type: "string",
|
|
51
|
+
description: "Session title (e.g. 'Vocal recording — Track 3')",
|
|
52
|
+
},
|
|
53
|
+
session_type: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "Type: recording, mixing, mastering, writing, production, rehearsal",
|
|
56
|
+
},
|
|
57
|
+
date: {
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Session date (YYYY-MM-DD)",
|
|
60
|
+
},
|
|
61
|
+
location: {
|
|
62
|
+
type: "string",
|
|
63
|
+
description: "Studio or location name",
|
|
64
|
+
},
|
|
65
|
+
notes: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "Session notes — what happened, what was achieved",
|
|
68
|
+
},
|
|
69
|
+
work_id: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "Work this session was for (optional)",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
required: ["title"],
|
|
75
|
+
additionalProperties: true,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
executor: this.createSession.bind(this),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
definition: {
|
|
82
|
+
name: "pica_sessions_types",
|
|
83
|
+
description: "Get available session types (recording, mixing, mastering, etc.)",
|
|
84
|
+
inputSchema: { type: "object", properties: {} },
|
|
85
|
+
},
|
|
86
|
+
executor: this.getSessionTypes.bind(this),
|
|
87
|
+
},
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
async listSessions(args) {
|
|
91
|
+
const sessions = await this.pica.sessions.list({ limit: args.limit });
|
|
92
|
+
return formatStructuredList(Array.isArray(sessions) ? sessions : sessions?.data || [], "session");
|
|
93
|
+
}
|
|
94
|
+
async getSession(args) {
|
|
95
|
+
const session = await this.pica.sessions.get(args.id);
|
|
96
|
+
return formatSuccess(`Session: ${session?.title || args.id}`, session);
|
|
97
|
+
}
|
|
98
|
+
async createSession(args) {
|
|
99
|
+
const session = await this.pica.sessions.create(args);
|
|
100
|
+
return formatSuccess("Studio session logged successfully", session);
|
|
101
|
+
}
|
|
102
|
+
async getSessionTypes(_args) {
|
|
103
|
+
const types = await this.pica.sessions.getTypes();
|
|
104
|
+
return formatAsText(types);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=sessions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../src/tools/sessions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,OAAO,aAAa;IAChB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAA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,CAAC;IACtE,CAAC;IAEO,KAAK,CAAC,eAAe,CAC3B,KAA0B;QAE1B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAClD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings & Usage Tools — credit history, storage, organisation profile
|
|
3
|
+
*/
|
|
4
|
+
import { PicaClient } from "../pica-sdk.js";
|
|
5
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
6
|
+
export declare class SettingsTools {
|
|
7
|
+
private pica;
|
|
8
|
+
constructor(pica: PicaClient);
|
|
9
|
+
getTools(): Array<{
|
|
10
|
+
definition: ToolDefinition;
|
|
11
|
+
executor: ToolExecutor;
|
|
12
|
+
}>;
|
|
13
|
+
private creditsHistory;
|
|
14
|
+
private storageStatus;
|
|
15
|
+
private orgProfile;
|
|
16
|
+
private userProfile;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/tools/settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAOtE,qBAAa,aAAa;IACxB,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;YAqE3D,cAAc;YAYd,aAAa;YAWb,UAAU;YASV,WAAW;CAQ1B"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings & Usage Tools — credit history, storage, organisation profile
|
|
3
|
+
*/
|
|
4
|
+
import { formatSuccess, formatStructuredList, } from "../utils/formatting.js";
|
|
5
|
+
export class SettingsTools {
|
|
6
|
+
pica;
|
|
7
|
+
constructor(pica) {
|
|
8
|
+
this.pica = pica;
|
|
9
|
+
}
|
|
10
|
+
getTools() {
|
|
11
|
+
return [
|
|
12
|
+
{
|
|
13
|
+
definition: {
|
|
14
|
+
name: "pica_credits_history",
|
|
15
|
+
description: "View credit transaction history — what you've spent credits on, " +
|
|
16
|
+
"grants received, bonuses, and refunds. " +
|
|
17
|
+
'Answers "what did I spend my credits on?"',
|
|
18
|
+
inputSchema: {
|
|
19
|
+
type: "object",
|
|
20
|
+
properties: {
|
|
21
|
+
type: {
|
|
22
|
+
type: "string",
|
|
23
|
+
description: "Filter by type: spend, grant, bonus, refund, starter, collaboration, contribution, adjustment",
|
|
24
|
+
},
|
|
25
|
+
limit: {
|
|
26
|
+
type: "number",
|
|
27
|
+
description: "Max results (default 20)",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
executor: this.creditsHistory.bind(this),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
definition: {
|
|
36
|
+
name: "pica_storage_status",
|
|
37
|
+
description: "Check storage configuration and usage — which cloud provider is active " +
|
|
38
|
+
"(PICA default, your own S3, GCS, Azure, R2, or Backblaze), " +
|
|
39
|
+
"bucket names, and how much storage you've used.",
|
|
40
|
+
inputSchema: {
|
|
41
|
+
type: "object",
|
|
42
|
+
properties: {},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
executor: this.storageStatus.bind(this),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
definition: {
|
|
49
|
+
name: "pica_organisation_profile",
|
|
50
|
+
description: "Get your organisation profile — display name, tagline, IPI number, " +
|
|
51
|
+
"default currency, social links, and carbon tracking status.",
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: "object",
|
|
54
|
+
properties: {},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
executor: this.orgProfile.bind(this),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
definition: {
|
|
61
|
+
name: "pica_user_profile",
|
|
62
|
+
description: "Get your user profile — name, email, role, creative types, " +
|
|
63
|
+
"AI disclosure defaults, and onboarding status.",
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: "object",
|
|
66
|
+
properties: {},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
executor: this.userProfile.bind(this),
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
async creditsHistory(args) {
|
|
74
|
+
const result = await this.pica.settings.creditsHistory({
|
|
75
|
+
type: args.type,
|
|
76
|
+
limit: args.limit,
|
|
77
|
+
});
|
|
78
|
+
const transactions = result?.data || result || [];
|
|
79
|
+
return formatStructuredList(Array.isArray(transactions) ? transactions : [], "transaction");
|
|
80
|
+
}
|
|
81
|
+
async storageStatus(_args) {
|
|
82
|
+
const result = await this.pica.settings.storageConfig();
|
|
83
|
+
const config = result?.data || result;
|
|
84
|
+
const provider = config?.storage_provider || "pica_s3";
|
|
85
|
+
return formatSuccess(`Storage provider: ${provider}${provider === "pica_s3" ? " (PICA default)" : " (your own)"}`, config);
|
|
86
|
+
}
|
|
87
|
+
async orgProfile(_args) {
|
|
88
|
+
const result = await this.pica.settings.orgProfile();
|
|
89
|
+
const org = result?.data || result;
|
|
90
|
+
return formatSuccess(`Organisation: ${org?.display_name || "unnamed"}`, org);
|
|
91
|
+
}
|
|
92
|
+
async userProfile(_args) {
|
|
93
|
+
const result = await this.pica.settings.userProfile();
|
|
94
|
+
const profile = result?.data || result;
|
|
95
|
+
return formatSuccess(`User: ${profile?.full_name || profile?.email || "unknown"}`, profile);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AI,MAAM,CAAC;QACnC,OAAO,aAAa,CAClB,iBAAiB,GAAG,EAAE,YAAY,IAAI,SAAS,EAAE,EACjD,GAAG,CACJ,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,KAA0B;QAClD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;QACtD,MAAM,OAAO,GAAG,MAAM,EAAE,IAAI,IAAI,MAAM,CAAC;QACvC,OAAO,aAAa,CAClB,SAAS,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,EAC5D,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Share Links MCP Tools — ADR-139 Step 3
|
|
3
|
+
*
|
|
4
|
+
* "Share my song with Tony" or "Send a link to Mark to upload stems"
|
|
5
|
+
* — conversational actions that need MCP tools.
|
|
6
|
+
*/
|
|
7
|
+
import { PicaClient } from "../pica-sdk.js";
|
|
8
|
+
import type { ToolDefinition, ToolExecutor } from "./index.js";
|
|
9
|
+
export declare class ShareLinksTools {
|
|
10
|
+
private pica;
|
|
11
|
+
constructor(pica: PicaClient);
|
|
12
|
+
getTools(): Array<{
|
|
13
|
+
definition: ToolDefinition;
|
|
14
|
+
executor: ToolExecutor;
|
|
15
|
+
}>;
|
|
16
|
+
private listShareLinks;
|
|
17
|
+
private createShareLink;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=share-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-links.d.ts","sourceRoot":"","sources":["../../src/tools/share-links.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAG3E,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;YA+E3D,cAAc;YAoBd,eAAe;CAiC9B"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Share Links MCP Tools — ADR-139 Step 3
|
|
3
|
+
*
|
|
4
|
+
* "Share my song with Tony" or "Send a link to Mark to upload stems"
|
|
5
|
+
* — conversational actions that need MCP tools.
|
|
6
|
+
*/
|
|
7
|
+
import { formatSuccess } from "../utils/formatting.js";
|
|
8
|
+
export class ShareLinksTools {
|
|
9
|
+
pica;
|
|
10
|
+
constructor(pica) {
|
|
11
|
+
this.pica = pica;
|
|
12
|
+
}
|
|
13
|
+
getTools() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
definition: {
|
|
17
|
+
name: "pica_share_links_list",
|
|
18
|
+
description: "List existing share links, optionally filtered by work. " +
|
|
19
|
+
"Shows active links with view/download counts and expiry status.",
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object",
|
|
22
|
+
properties: {
|
|
23
|
+
work_id: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Filter share links for a specific work (UUID)",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
executor: this.listShareLinks.bind(this),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
definition: {
|
|
34
|
+
name: "pica_share_links_create",
|
|
35
|
+
description: "Create a share link for a work, playlist, or release. " +
|
|
36
|
+
"The link can be password-protected, have a view limit, and expire. " +
|
|
37
|
+
"Returns a URL the recipient can use to access the shared content.",
|
|
38
|
+
inputSchema: {
|
|
39
|
+
type: "object",
|
|
40
|
+
properties: {
|
|
41
|
+
work_id: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Single work ID to share (use this OR work_ids OR release_id)",
|
|
44
|
+
},
|
|
45
|
+
work_ids: {
|
|
46
|
+
type: "array",
|
|
47
|
+
items: { type: "string" },
|
|
48
|
+
description: "Multiple work IDs for a playlist share link",
|
|
49
|
+
},
|
|
50
|
+
release_id: {
|
|
51
|
+
type: "string",
|
|
52
|
+
description: "Release ID for sharing an entire release",
|
|
53
|
+
},
|
|
54
|
+
name: {
|
|
55
|
+
type: "string",
|
|
56
|
+
description: "Display name for the share link (e.g. 'Demo for Tony')",
|
|
57
|
+
},
|
|
58
|
+
password: {
|
|
59
|
+
type: "string",
|
|
60
|
+
description: "Optional password to protect the link",
|
|
61
|
+
},
|
|
62
|
+
expires_at: {
|
|
63
|
+
type: "string",
|
|
64
|
+
description: "Expiry date (ISO format). Link becomes invalid after this date.",
|
|
65
|
+
},
|
|
66
|
+
max_views: {
|
|
67
|
+
type: "number",
|
|
68
|
+
description: "Maximum number of views before the link expires",
|
|
69
|
+
},
|
|
70
|
+
allow_download: {
|
|
71
|
+
type: "boolean",
|
|
72
|
+
description: "Whether recipients can download files (default: false)",
|
|
73
|
+
},
|
|
74
|
+
message: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "Optional message shown to the recipient",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
executor: this.createShareLink.bind(this),
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
async listShareLinks(args) {
|
|
86
|
+
const data = await this.pica.shareLinks.list({
|
|
87
|
+
work_id: args.work_id,
|
|
88
|
+
});
|
|
89
|
+
const links = Array.isArray(data) ? data : [];
|
|
90
|
+
const hints = [];
|
|
91
|
+
if (!links.length && args.work_id) {
|
|
92
|
+
hints.push({
|
|
93
|
+
gap: "no_share_links",
|
|
94
|
+
suggestion: "Create a share link for this work (pica_share_links_create)",
|
|
95
|
+
severity: "nice_to_have",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return formatSuccess(`Found ${links.length} share link(s)`, links, hints);
|
|
99
|
+
}
|
|
100
|
+
async createShareLink(args) {
|
|
101
|
+
if (!args.work_id && !args.work_ids?.length && !args.release_id) {
|
|
102
|
+
return formatSuccess("Please provide a work_id, work_ids (array), or release_id to create a share link", null);
|
|
103
|
+
}
|
|
104
|
+
const data = await this.pica.shareLinks.create({
|
|
105
|
+
work_id: args.work_id,
|
|
106
|
+
work_ids: args.work_ids,
|
|
107
|
+
release_id: args.release_id,
|
|
108
|
+
name: args.name,
|
|
109
|
+
password: args.password,
|
|
110
|
+
expires_at: args.expires_at,
|
|
111
|
+
max_views: args.max_views,
|
|
112
|
+
allow_download: args.allow_download ?? false,
|
|
113
|
+
message: args.message,
|
|
114
|
+
});
|
|
115
|
+
const hints = [];
|
|
116
|
+
if (data?.token) {
|
|
117
|
+
hints.push({
|
|
118
|
+
gap: "share_link_created",
|
|
119
|
+
suggestion: `Share link created — send the URL to the recipient`,
|
|
120
|
+
severity: "nice_to_have",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return formatSuccess("Share link created", data, hints);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=share-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-links.js","sourceRoot":"","sources":["../../src/tools/share-links.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,aAAa,EAAuB,MAAM,wBAAwB,CAAC;AAE5E,MAAM,OAAO,eAAe;IAClB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,uBAAuB;oBAC7B,WAAW,EACT,0DAA0D;wBAC1D,iEAAiE;oBACnE,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAA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IAAI,CAAC,OAAO;SACtB,CAAC,CAAC;QAEH,MAAM,KAAK,GAAqB,EAAE,CAAC;QACnC,IAAI,IAAI,EAAE,KAAK,EAAE,CAAC;YAChB,KAAK,CAAC,IAAI,CAAC;gBACT,GAAG,EAAE,oBAAoB;gBACzB,UAAU,EAAE,oDAAoD;gBAChE,QAAQ,EAAE,cAAc;aACzB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,aAAa,CAAC,oBAAoB,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split Sheets & Recording Splits Tools
|
|
3
|
+
* MCP tools for managing publishing split sheets and master recording ownership splits
|
|
4
|
+
*/
|
|
5
|
+
import { PicaClient } from "../pica-sdk.js";
|
|
6
|
+
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
7
|
+
export declare class SplitSheetsTools {
|
|
8
|
+
private pica;
|
|
9
|
+
constructor(pica: PicaClient);
|
|
10
|
+
/**
|
|
11
|
+
* Get all split sheet and recording split tools
|
|
12
|
+
*/
|
|
13
|
+
getTools(): Array<{
|
|
14
|
+
definition: ToolDefinition;
|
|
15
|
+
executor: ToolExecutor;
|
|
16
|
+
}>;
|
|
17
|
+
private listSplitSheets;
|
|
18
|
+
private generateSplitSheet;
|
|
19
|
+
private getSplitSheet;
|
|
20
|
+
private listRecordingSplits;
|
|
21
|
+
private createRecordingSplit;
|
|
22
|
+
private verifyRecordingSplit;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=split-sheets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-sheets.d.ts","sourceRoot":"","sources":["../../src/tools/split-sheets.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAOtE,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAa;gBAEb,IAAI,EAAE,UAAU;IAI5B;;OAEG;IACH,QAAQ,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,cAAc,CAAC;QAAC,QAAQ,EAAE,YAAY,CAAA;KAAE,CAAC;YAqJ3D,eAAe;YAWf,kBAAkB;YAOlB,aAAa;YAUb,mBAAmB;YAWnB,oBAAoB;YAQpB,oBAAoB;CASnC"}
|