@withpica/mcp-server 2.5.2 → 2.6.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/assets/fonts/GeistSans-Light.woff2 +0 -0
- package/assets/fonts/InstrumentSerif-Italic.woff2 +0 -0
- package/assets/fonts/InstrumentSerif-Regular.woff2 +0 -0
- package/dist/apps/download.d.ts +2 -0
- package/dist/apps/download.d.ts.map +1 -0
- package/dist/apps/download.js +125 -0
- package/dist/apps/download.js.map +1 -0
- package/dist/apps/generated/shared-bundle.d.ts +5 -0
- package/dist/apps/generated/shared-bundle.d.ts.map +1 -0
- package/dist/apps/generated/shared-bundle.js +7 -0
- package/dist/apps/generated/shared-bundle.js.map +1 -0
- package/dist/apps/shared.d.ts +15 -0
- package/dist/apps/shared.d.ts.map +1 -0
- package/dist/apps/shared.js +480 -0
- package/dist/apps/shared.js.map +1 -0
- package/dist/apps/upload.d.ts +2 -0
- package/dist/apps/upload.d.ts.map +1 -0
- package/dist/apps/upload.js +280 -0
- package/dist/apps/upload.js.map +1 -0
- package/dist/config.d.ts +4 -25
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +30 -12
- package/dist/config.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/prompts/index.js +24 -24
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/index.d.ts +4 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +133 -54
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/llms-primer.d.ts +1 -1
- package/dist/resources/llms-primer.d.ts.map +1 -1
- package/dist/resources/llms-primer.js +4 -4
- package/dist/server-instructions.d.ts +9 -0
- package/dist/server-instructions.d.ts.map +1 -0
- package/dist/server-instructions.js +34 -0
- package/dist/server-instructions.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +46 -12
- package/dist/server.js.map +1 -1
- package/dist/tools/agreement-types.d.ts +10 -20
- package/dist/tools/agreement-types.d.ts.map +1 -1
- package/dist/tools/agreement-types.js +203 -419
- package/dist/tools/agreement-types.js.map +1 -1
- package/dist/tools/agreements.d.ts +3 -4
- package/dist/tools/agreements.d.ts.map +1 -1
- package/dist/tools/agreements.js +72 -52
- package/dist/tools/agreements.js.map +1 -1
- package/dist/tools/analytics.d.ts +1 -1
- package/dist/tools/analytics.d.ts.map +1 -1
- package/dist/tools/analytics.js +1 -1
- package/dist/tools/analytics.js.map +1 -1
- package/dist/tools/app-tools.d.ts +21 -0
- package/dist/tools/app-tools.d.ts.map +1 -0
- package/dist/tools/app-tools.js +248 -0
- package/dist/tools/app-tools.js.map +1 -0
- package/dist/tools/assets.d.ts +2 -4
- package/dist/tools/assets.d.ts.map +1 -1
- package/dist/tools/assets.js +278 -59
- package/dist/tools/assets.js.map +1 -1
- package/dist/tools/audio-files.d.ts +3 -4
- package/dist/tools/audio-files.d.ts.map +1 -1
- package/dist/tools/audio-files.js +63 -35
- package/dist/tools/audio-files.js.map +1 -1
- package/dist/tools/auth.d.ts +20 -0
- package/dist/tools/auth.d.ts.map +1 -0
- package/dist/tools/auth.js +200 -0
- package/dist/tools/auth.js.map +1 -0
- package/dist/tools/bulk.d.ts +1 -1
- package/dist/tools/bulk.d.ts.map +1 -1
- package/dist/tools/bulk.js +1 -1
- package/dist/tools/bulk.js.map +1 -1
- package/dist/tools/calendar.d.ts +1 -1
- package/dist/tools/calendar.d.ts.map +1 -1
- package/dist/tools/calendar.js +1 -1
- package/dist/tools/calendar.js.map +1 -1
- package/dist/tools/collaborators.d.ts +1 -1
- package/dist/tools/collaborators.d.ts.map +1 -1
- package/dist/tools/collaborators.js +2 -2
- package/dist/tools/collaborators.js.map +1 -1
- package/dist/tools/comparisons.d.ts +1 -1
- package/dist/tools/comparisons.d.ts.map +1 -1
- package/dist/tools/comparisons.js +1 -1
- package/dist/tools/comparisons.js.map +1 -1
- package/dist/tools/credits.d.ts +1 -1
- package/dist/tools/credits.d.ts.map +1 -1
- package/dist/tools/credits.js +130 -20
- package/dist/tools/credits.js.map +1 -1
- package/dist/tools/dashboard.d.ts +2 -3
- package/dist/tools/dashboard.d.ts.map +1 -1
- package/dist/tools/dashboard.js +20 -28
- package/dist/tools/dashboard.js.map +1 -1
- package/dist/tools/directory.d.ts +1 -1
- package/dist/tools/directory.d.ts.map +1 -1
- package/dist/tools/directory.js +1 -1
- package/dist/tools/directory.js.map +1 -1
- package/dist/tools/discovery.d.ts +28 -0
- package/dist/tools/discovery.d.ts.map +1 -0
- package/dist/tools/discovery.js +560 -0
- package/dist/tools/discovery.js.map +1 -0
- package/dist/tools/disputes.d.ts +1 -1
- package/dist/tools/disputes.d.ts.map +1 -1
- package/dist/tools/disputes.js +1 -1
- package/dist/tools/disputes.js.map +1 -1
- package/dist/tools/documents.d.ts +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +1 -1
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/duplicates.d.ts +1 -1
- package/dist/tools/duplicates.d.ts.map +1 -1
- package/dist/tools/duplicates.js +18 -1
- package/dist/tools/duplicates.js.map +1 -1
- package/dist/tools/enrichment.d.ts +1 -4
- package/dist/tools/enrichment.d.ts.map +1 -1
- package/dist/tools/enrichment.js +19 -122
- package/dist/tools/enrichment.js.map +1 -1
- package/dist/tools/exports.d.ts +1 -1
- package/dist/tools/exports.d.ts.map +1 -1
- package/dist/tools/exports.js +2 -2
- package/dist/tools/exports.js.map +1 -1
- package/dist/tools/import-documents.d.ts +4 -4
- package/dist/tools/import-documents.d.ts.map +1 -1
- package/dist/tools/import-documents.js +65 -51
- package/dist/tools/import-documents.js.map +1 -1
- package/dist/tools/import.d.ts +2 -1
- package/dist/tools/import.d.ts.map +1 -1
- package/dist/tools/import.js +64 -2
- package/dist/tools/import.js.map +1 -1
- package/dist/tools/index.d.ts +50 -5
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +440 -84
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/integrations.d.ts +1 -1
- package/dist/tools/integrations.d.ts.map +1 -1
- package/dist/tools/integrations.js +1 -1
- package/dist/tools/integrations.js.map +1 -1
- package/dist/tools/licensing.d.ts +1 -1
- package/dist/tools/licensing.d.ts.map +1 -1
- package/dist/tools/licensing.js +1 -1
- package/dist/tools/licensing.js.map +1 -1
- package/dist/tools/memory.d.ts +1 -1
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/memory.js +1 -1
- package/dist/tools/memory.js.map +1 -1
- package/dist/tools/metadata.d.ts +15 -0
- package/dist/tools/metadata.d.ts.map +1 -0
- package/dist/tools/metadata.js +1069 -0
- package/dist/tools/metadata.js.map +1 -0
- package/dist/tools/multimedia.d.ts +1 -1
- package/dist/tools/multimedia.d.ts.map +1 -1
- package/dist/tools/multimedia.js +1 -1
- package/dist/tools/multimedia.js.map +1 -1
- package/dist/tools/notes.d.ts +1 -1
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +1 -1
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/notifications.d.ts +1 -1
- package/dist/tools/notifications.d.ts.map +1 -1
- package/dist/tools/notifications.js +1 -1
- package/dist/tools/notifications.js.map +1 -1
- package/dist/tools/people.d.ts +5 -13
- package/dist/tools/people.d.ts.map +1 -1
- package/dist/tools/people.js +148 -109
- package/dist/tools/people.js.map +1 -1
- package/dist/tools/projects.d.ts +1 -1
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +1 -1
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/publishers.d.ts +16 -0
- package/dist/tools/publishers.d.ts.map +1 -0
- package/dist/tools/publishers.js +69 -0
- package/dist/tools/publishers.js.map +1 -0
- package/dist/tools/purchases.d.ts +1 -1
- package/dist/tools/purchases.d.ts.map +1 -1
- package/dist/tools/purchases.js +1 -1
- package/dist/tools/purchases.js.map +1 -1
- package/dist/tools/recordings.d.ts +9 -9
- package/dist/tools/recordings.d.ts.map +1 -1
- package/dist/tools/recordings.js +121 -48
- package/dist/tools/recordings.js.map +1 -1
- package/dist/tools/recovery-hints.d.ts +14 -0
- package/dist/tools/recovery-hints.d.ts.map +1 -0
- package/dist/tools/recovery-hints.js +277 -0
- package/dist/tools/recovery-hints.js.map +1 -0
- package/dist/tools/releases.d.ts +1 -1
- package/dist/tools/releases.d.ts.map +1 -1
- package/dist/tools/releases.js +1 -1
- package/dist/tools/releases.js.map +1 -1
- package/dist/tools/royalties.d.ts +1 -1
- package/dist/tools/royalties.d.ts.map +1 -1
- package/dist/tools/royalties.js +2 -2
- package/dist/tools/royalties.js.map +1 -1
- package/dist/tools/search.d.ts +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +3 -3
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/send.d.ts +2 -3
- package/dist/tools/send.d.ts.map +1 -1
- package/dist/tools/send.js +20 -28
- package/dist/tools/send.js.map +1 -1
- package/dist/tools/sessions.d.ts +1 -1
- package/dist/tools/sessions.d.ts.map +1 -1
- package/dist/tools/sessions.js +1 -1
- package/dist/tools/sessions.js.map +1 -1
- package/dist/tools/settings.d.ts +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +1 -1
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/share-links.d.ts +1 -1
- package/dist/tools/share-links.d.ts.map +1 -1
- package/dist/tools/share-links.js +1 -1
- package/dist/tools/share-links.js.map +1 -1
- package/dist/tools/split-sheets.d.ts +1 -1
- package/dist/tools/split-sheets.d.ts.map +1 -1
- package/dist/tools/split-sheets.js +13 -1
- package/dist/tools/split-sheets.js.map +1 -1
- package/dist/tools/team.d.ts +1 -1
- package/dist/tools/team.d.ts.map +1 -1
- package/dist/tools/team.js +1 -1
- package/dist/tools/team.js.map +1 -1
- package/dist/tools/telegram.d.ts +1 -1
- package/dist/tools/telegram.d.ts.map +1 -1
- package/dist/tools/telegram.js +1 -1
- package/dist/tools/telegram.js.map +1 -1
- package/dist/tools/uploads.d.ts +1 -1
- package/dist/tools/uploads.d.ts.map +1 -1
- package/dist/tools/uploads.js +1 -1
- package/dist/tools/uploads.js.map +1 -1
- package/dist/tools/works.d.ts +5 -13
- package/dist/tools/works.d.ts.map +1 -1
- package/dist/tools/works.js +201 -116
- package/dist/tools/works.js.map +1 -1
- package/package.json +5 -1
- package/scripts/bundle-apps.ts +61 -0
- package/.mcpregistry_github_token +0 -1
- package/.mcpregistry_registry_token +0 -1
- package/dist/pica-sdk.d.ts +0 -1170
- package/dist/pica-sdk.d.ts.map +0 -1
- package/dist/pica-sdk.js +0 -1403
- package/dist/pica-sdk.js.map +0 -1
- package/dist/tools/health.d.ts +0 -17
- package/dist/tools/health.d.ts.map +0 -1
- package/dist/tools/health.js +0 -67
- package/dist/tools/health.js.map +0 -1
- package/dist/tools/pica-score.d.ts +0 -15
- package/dist/tools/pica-score.d.ts.map +0 -1
- package/dist/tools/pica-score.js +0 -28
- package/dist/tools/pica-score.js.map +0 -1
- package/dist/tools/registration.d.ts +0 -16
- package/dist/tools/registration.d.ts.map +0 -1
- package/dist/tools/registration.js +0 -50
- package/dist/tools/registration.js.map +0 -1
- package/dist/utils/credit-gate.d.ts +0 -17
- package/dist/utils/credit-gate.d.ts.map +0 -1
- package/dist/utils/credit-gate.js +0 -100
- package/dist/utils/credit-gate.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -29
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -115
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/formatting.d.ts +0 -63
- package/dist/utils/formatting.d.ts.map +0 -1
- package/dist/utils/formatting.js +0 -125
- package/dist/utils/formatting.js.map +0 -1
- package/dist/utils/mpp.d.ts +0 -63
- package/dist/utils/mpp.d.ts.map +0 -1
- package/dist/utils/mpp.js +0 -137
- package/dist/utils/mpp.js.map +0 -1
- package/dist/utils/notify-parties.d.ts +0 -35
- package/dist/utils/notify-parties.d.ts.map +0 -1
- package/dist/utils/notify-parties.js +0 -59
- package/dist/utils/notify-parties.js.map +0 -1
- package/server.json +0 -30
package/dist/tools/duplicates.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatAsText, formatSuccess, formatValidationError, } from "
|
|
2
|
+
import { formatAsText, formatSuccess, formatValidationError, } from "@withpica/mcp-utils";
|
|
3
3
|
export class DuplicatesTools {
|
|
4
4
|
pica;
|
|
5
5
|
constructor(pica) {
|
|
@@ -63,6 +63,23 @@ export class DuplicatesTools {
|
|
|
63
63
|
if (!args.loser_ids?.length) {
|
|
64
64
|
return formatValidationError({ loser_ids: "must be a non-empty array" });
|
|
65
65
|
}
|
|
66
|
+
const loserIds = args.loser_ids;
|
|
67
|
+
if (loserIds && loserIds.length > 25) {
|
|
68
|
+
return {
|
|
69
|
+
content: [
|
|
70
|
+
{
|
|
71
|
+
type: "text",
|
|
72
|
+
text: JSON.stringify({
|
|
73
|
+
error: "VALIDATION_ERROR",
|
|
74
|
+
message: `maximum 25 loser IDs per merge — received ${loserIds.length}`,
|
|
75
|
+
retry_safe: false,
|
|
76
|
+
suggestion: "split into multiple merge operations with 25 or fewer IDs each",
|
|
77
|
+
}, null, 2),
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
isError: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
66
83
|
const result = await this.pica.duplicates.merge(args.entity_type, args.winner_id, args.loser_ids);
|
|
67
84
|
return formatSuccess(`Merged ${args.loser_ids.length} duplicate ${args.entity_type}(s) into ${args.winner_id}`, result);
|
|
68
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicates.js","sourceRoot":"","sources":["../../src/tools/duplicates.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EACL,YAAY,EACZ,aAAa,EACb,qBAAqB,GACtB,MAAM,
|
|
1
|
+
{"version":3,"file":"duplicates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ACP,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Enrichment Tools - MCP tools for triggering and checking enrichment
|
|
3
3
|
*/
|
|
4
|
-
import { PicaClient } from "
|
|
4
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
5
5
|
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
6
6
|
export declare class EnrichmentTools {
|
|
7
7
|
private pica;
|
|
@@ -10,9 +10,6 @@ export declare class EnrichmentTools {
|
|
|
10
10
|
definition: ToolDefinition;
|
|
11
11
|
executor: ToolExecutor;
|
|
12
12
|
}>;
|
|
13
|
-
private enrichWork;
|
|
14
|
-
private enrichPerson;
|
|
15
|
-
private enrichmentStatus;
|
|
16
13
|
private enrichmentCandidates;
|
|
17
14
|
private enrichWorkMlc;
|
|
18
15
|
private enrichWorkMusicBrainz;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrichment.d.ts","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"enrichment.d.ts","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAKtE,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;YA4H3D,oBAAoB;YAOpB,aAAa;YAKb,qBAAqB;YASrB,iBAAiB;YAOjB,iBAAiB;YAuBjB,iBAAiB;CAMhC"}
|
package/dist/tools/enrichment.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatAsText, formatSuccess } from "
|
|
3
|
-
import { withCreditGate } from "
|
|
2
|
+
import { formatAsText, formatSuccess } from "@withpica/mcp-utils";
|
|
3
|
+
import { withCreditGate } from "@withpica/mcp-utils";
|
|
4
|
+
import { formatEnrichmentResult } from "@withpica/mcp-utils";
|
|
4
5
|
export class EnrichmentTools {
|
|
5
6
|
pica;
|
|
6
7
|
constructor(pica) {
|
|
@@ -8,64 +9,11 @@ export class EnrichmentTools {
|
|
|
8
9
|
}
|
|
9
10
|
getTools() {
|
|
10
11
|
return [
|
|
11
|
-
{
|
|
12
|
-
definition: {
|
|
13
|
-
name: "pica_enrich_work",
|
|
14
|
-
description: "Trigger enrichment for a work (fetches data from MLC, MusicBrainz, etc.). " +
|
|
15
|
-
"→ then: pica_enrichment_status (check results), pica_work_completeness (verify improvement) Costs 1 pica credit (MLC lookup).",
|
|
16
|
-
inputSchema: {
|
|
17
|
-
type: "object",
|
|
18
|
-
properties: {
|
|
19
|
-
work_id: {
|
|
20
|
-
type: "string",
|
|
21
|
-
description: "The work ID to enrich",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
required: ["work_id"],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
executor: withCreditGate(this.pica, "external_mlc_lookup", "work enrichment (MLC)", this.enrichWork.bind(this)),
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
definition: {
|
|
31
|
-
name: "pica_enrich_person",
|
|
32
|
-
description: "Trigger enrichment for a person (fetches data from ISNI, MusicBrainz, etc.). " +
|
|
33
|
-
"→ then: pica_people_get_full (verify results) Costs 1 pica credit (MLC lookup). ISNI and MusicBrainz are free.",
|
|
34
|
-
inputSchema: {
|
|
35
|
-
type: "object",
|
|
36
|
-
properties: {
|
|
37
|
-
person_id: {
|
|
38
|
-
type: "string",
|
|
39
|
-
description: "The person ID to enrich",
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
required: ["person_id"],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
executor: withCreditGate(this.pica, "external_mlc_lookup", "person enrichment", this.enrichPerson.bind(this)),
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
definition: {
|
|
49
|
-
name: "pica_enrichment_status",
|
|
50
|
-
description: "Check the enrichment status for a specific work (what sources have been checked, what data was found)",
|
|
51
|
-
inputSchema: {
|
|
52
|
-
type: "object",
|
|
53
|
-
properties: {
|
|
54
|
-
work_id: {
|
|
55
|
-
type: "string",
|
|
56
|
-
description: "The work ID to check",
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
required: ["work_id"],
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
executor: this.enrichmentStatus.bind(this),
|
|
63
|
-
},
|
|
64
12
|
{
|
|
65
13
|
definition: {
|
|
66
14
|
name: "pica_enrichment_candidates",
|
|
67
15
|
description: "Find works and people that are candidates for enrichment (missing external identifiers or metadata). " +
|
|
68
|
-
"→ then:
|
|
16
|
+
"→ then: pica_enrich_work_spotify (enrich from Spotify), pica_enrich_work_mlc (enrich from MLC)",
|
|
69
17
|
inputSchema: {
|
|
70
18
|
type: "object",
|
|
71
19
|
properties: {},
|
|
@@ -95,7 +43,7 @@ export class EnrichmentTools {
|
|
|
95
43
|
definition: {
|
|
96
44
|
name: "pica_enrich_work_musicbrainz",
|
|
97
45
|
description: "Look up MusicBrainz for release data, artist info, and cross-references for a work. " +
|
|
98
|
-
"Returns
|
|
46
|
+
"Returns release data, artist info, and cross-references.",
|
|
99
47
|
inputSchema: {
|
|
100
48
|
type: "object",
|
|
101
49
|
properties: {
|
|
@@ -113,7 +61,7 @@ export class EnrichmentTools {
|
|
|
113
61
|
definition: {
|
|
114
62
|
name: "pica_enrich_work_discogs",
|
|
115
63
|
description: "Search Discogs for release data, label, format, and catalogue numbers for a work. " +
|
|
116
|
-
"Returns a preview of matches
|
|
64
|
+
"Returns a preview of matches.",
|
|
117
65
|
inputSchema: {
|
|
118
66
|
type: "object",
|
|
119
67
|
properties: {
|
|
@@ -130,13 +78,9 @@ export class EnrichmentTools {
|
|
|
130
78
|
{
|
|
131
79
|
definition: {
|
|
132
80
|
name: "pica_enrich_work_spotify",
|
|
133
|
-
description: "Enrich
|
|
134
|
-
"
|
|
135
|
-
"
|
|
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)",
|
|
81
|
+
description: "Enrich a work from Spotify — pulls track metadata, popularity, and streaming data. " +
|
|
82
|
+
"Optionally pass spotify_url to link the track URI before enriching. " +
|
|
83
|
+
"→ then: pica_works_inspect (check what changed), pica_credits_update (add credits)",
|
|
140
84
|
inputSchema: {
|
|
141
85
|
type: "object",
|
|
142
86
|
properties: {
|
|
@@ -146,15 +90,10 @@ export class EnrichmentTools {
|
|
|
146
90
|
},
|
|
147
91
|
spotify_url: {
|
|
148
92
|
type: "string",
|
|
149
|
-
description: "
|
|
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.",
|
|
93
|
+
description: "Optional Spotify URL or URI to link before enriching",
|
|
156
94
|
},
|
|
157
95
|
},
|
|
96
|
+
required: ["work_id"],
|
|
158
97
|
},
|
|
159
98
|
},
|
|
160
99
|
executor: this.enrichWorkSpotify.bind(this),
|
|
@@ -179,79 +118,37 @@ export class EnrichmentTools {
|
|
|
179
118
|
},
|
|
180
119
|
];
|
|
181
120
|
}
|
|
182
|
-
async enrichWork(args) {
|
|
183
|
-
const result = await this.pica.enrichment.enrichWork(args.work_id);
|
|
184
|
-
return formatSuccess(`Enrichment triggered for work ${args.work_id}`, result);
|
|
185
|
-
}
|
|
186
|
-
async enrichPerson(args) {
|
|
187
|
-
const result = await this.pica.enrichment.enrichPerson(args.person_id);
|
|
188
|
-
return formatSuccess(`Enrichment triggered for person ${args.person_id}`, result);
|
|
189
|
-
}
|
|
190
|
-
async enrichmentStatus(args) {
|
|
191
|
-
const result = await this.pica.enrichment.getWorkEnrichmentStatus(args.work_id);
|
|
192
|
-
return formatAsText(result);
|
|
193
|
-
}
|
|
194
121
|
async enrichmentCandidates(_args) {
|
|
195
122
|
const result = await this.pica.enrichment.getCandidates();
|
|
196
123
|
return formatAsText(result);
|
|
197
124
|
}
|
|
198
125
|
async enrichWorkMlc(args) {
|
|
199
126
|
const result = await this.pica.enrichment.enrichWorkMlc(args.work_id);
|
|
200
|
-
return
|
|
127
|
+
return formatEnrichmentResult("work", args.work_id, "MLC", result);
|
|
201
128
|
}
|
|
202
129
|
async enrichWorkMusicBrainz(args) {
|
|
203
130
|
const result = await this.pica.enrichment.enrichWorkMusicBrainz(args.work_id);
|
|
204
|
-
return
|
|
131
|
+
return formatEnrichmentResult("work", args.work_id, "MusicBrainz", result);
|
|
205
132
|
}
|
|
206
133
|
async enrichWorkDiscogs(args) {
|
|
207
134
|
const result = await this.pica.enrichment.enrichWorkDiscogs(args.work_id);
|
|
208
|
-
return
|
|
135
|
+
return formatEnrichmentResult("work", args.work_id, "Discogs", result);
|
|
209
136
|
}
|
|
210
137
|
async enrichWorkSpotify(args) {
|
|
211
138
|
const workId = args.work_id;
|
|
212
139
|
const spotifyUrl = args.spotify_url;
|
|
213
|
-
|
|
214
|
-
if (
|
|
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) {
|
|
140
|
+
// If spotify_url provided, link it to the work first, then enrich
|
|
141
|
+
if (spotifyUrl) {
|
|
227
142
|
const result = await this.pica.enrichment.linkAndEnrichSpotify(workId, spotifyUrl);
|
|
228
143
|
return formatSuccess(`Linked Spotify track and enriched work ${workId}`, result);
|
|
229
144
|
}
|
|
230
|
-
//
|
|
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
|
|
145
|
+
// work_id only — enrich from already-linked Spotify data
|
|
249
146
|
const result = await this.pica.enrichment.enrichWorkSpotify(workId);
|
|
250
|
-
return
|
|
147
|
+
return formatEnrichmentResult("work", workId, "Spotify", result);
|
|
251
148
|
}
|
|
252
149
|
async enrichWorkYouTube(args) {
|
|
253
150
|
const result = await this.pica.enrichment.enrichWorkYouTube(args.work_id);
|
|
254
|
-
return
|
|
151
|
+
return formatEnrichmentResult("work", args.work_id, "YouTube", result);
|
|
255
152
|
}
|
|
256
153
|
}
|
|
257
154
|
//# sourceMappingURL=enrichment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enrichment.js","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"enrichment.js","sourceRoot":"","sources":["../../src/tools/enrichment.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,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,4BAA4B;oBAClC,WAAW,EACT,uGAAuG;wBACvG,gGAAgG;oBAClG,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE,EAAE;qBACf;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;aAC/C;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,sBAAsB;oBAC5B,WAAW,EACT,kHAAkH;wBAClH,iGAAiG;oBACnG,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,OAAO,EAAE;gCACP,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,8BAA8B;6BAC5C;yB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icaClient } from "
|
|
4
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
5
5
|
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
6
6
|
export declare class ExportTools {
|
|
7
7
|
private pica;
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,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;YAuBtB,mBAAmB;YAOnB,wBAAwB;YAgDxB,eAAe;CAS9B"}
|
package/dist/tools/exports.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatAsText, formatSuccess } from "
|
|
3
|
-
import { withCreditGate } from "
|
|
2
|
+
import { formatAsText, formatSuccess } from "@withpica/mcp-utils";
|
|
3
|
+
import { withCreditGate } from "@withpica/mcp-utils";
|
|
4
4
|
export class ExportTools {
|
|
5
5
|
pica;
|
|
6
6
|
constructor(pica) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../src/tools/exports.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MA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,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Import Documents Tools - MCP tools for canonical ingestion documents
|
|
3
3
|
*/
|
|
4
|
-
import { PicaClient } from "
|
|
4
|
+
import { PicaClient } from "@withpica/mcp-sdk";
|
|
5
5
|
import { ToolDefinition, ToolExecutor } from "./index.js";
|
|
6
6
|
export declare class ImportDocumentTools {
|
|
7
7
|
private pica;
|
|
@@ -13,9 +13,9 @@ export declare class ImportDocumentTools {
|
|
|
13
13
|
definition: ToolDefinition;
|
|
14
14
|
executor: ToolExecutor;
|
|
15
15
|
}>;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
16
|
+
private queryImportDocuments;
|
|
17
|
+
private inspectImportDocument;
|
|
18
18
|
private ingestStatement;
|
|
19
|
-
private
|
|
19
|
+
private computeDiff;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=import-documents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-documents.d.ts","sourceRoot":"","sources":["../../src/tools/import-documents.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"import-documents.d.ts","sourceRoot":"","sources":["../../src/tools/import-documents.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAc,MAAM,YAAY,CAAC;AAGtE,qBAAa,mBAAmB;IAC9B,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;YA0F3D,oBAAoB;YAOpB,qBAAqB;YA+DrB,eAAe;IAgB7B,OAAO,CAAC,WAAW;CAyDpB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Copyright (c) 2024-2026 Withpica Ltd. All rights reserved.
|
|
2
|
-
import { formatStructuredList, formatSuccess } from "
|
|
2
|
+
import { formatStructuredList, formatSuccess } from "@withpica/mcp-utils";
|
|
3
3
|
export class ImportDocumentTools {
|
|
4
4
|
pica;
|
|
5
5
|
constructor(pica) {
|
|
@@ -12,8 +12,8 @@ export class ImportDocumentTools {
|
|
|
12
12
|
return [
|
|
13
13
|
{
|
|
14
14
|
definition: {
|
|
15
|
-
name: "
|
|
16
|
-
description: "List canonical ingestion documents — the readable, diffable record of every statement import. Filter by source (prs, distrokid, ascap, etc.), period (Q1 2024), or document type (statement, csv_import). Returns summaries without full body text. Use
|
|
15
|
+
name: "pica_import_documents_query",
|
|
16
|
+
description: "List canonical ingestion documents — the readable, diffable record of every statement import. Filter by source (prs, distrokid, ascap, etc.), period (Q1 2024), or document type (statement, csv_import). Returns summaries without full body text. Use pica_import_documents_inspect for the full document.",
|
|
17
17
|
inputSchema: {
|
|
18
18
|
type: "object",
|
|
19
19
|
properties: {
|
|
@@ -36,12 +36,14 @@ export class ImportDocumentTools {
|
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
|
-
executor: this.
|
|
39
|
+
executor: this.queryImportDocuments.bind(this),
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
definition: {
|
|
43
|
-
name: "
|
|
44
|
-
description: "
|
|
43
|
+
name: "pica_import_documents_inspect",
|
|
44
|
+
description: "Inspect a specific import document. By default returns the full canonical document " +
|
|
45
|
+
"(summary, identity extractions, line items, field mapping, warnings). " +
|
|
46
|
+
"Include 'diff' in sections to compare with a second document.",
|
|
45
47
|
inputSchema: {
|
|
46
48
|
type: "object",
|
|
47
49
|
properties: {
|
|
@@ -49,32 +51,23 @@ export class ImportDocumentTools {
|
|
|
49
51
|
type: "string",
|
|
50
52
|
description: "Import document ID",
|
|
51
53
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
definition: {
|
|
60
|
-
name: "pica_import_documents_diff",
|
|
61
|
-
description: "Compare two canonical import documents — typically the same source across different periods (e.g. PRS Q1 2024 vs PRS Q2 2024). Returns a structured diff showing: new works, removed works, amount changes, new writers, and summary deltas.",
|
|
62
|
-
inputSchema: {
|
|
63
|
-
type: "object",
|
|
64
|
-
properties: {
|
|
65
|
-
document_id_a: {
|
|
66
|
-
type: "string",
|
|
67
|
-
description: "ID of the first (earlier) import document",
|
|
54
|
+
sections: {
|
|
55
|
+
type: "array",
|
|
56
|
+
items: {
|
|
57
|
+
type: "string",
|
|
58
|
+
enum: ["basic", "diff"],
|
|
59
|
+
},
|
|
60
|
+
description: "Which sections to return (default: ['basic']). Add 'diff' to compare with compare_id.",
|
|
68
61
|
},
|
|
69
|
-
|
|
62
|
+
compare_id: {
|
|
70
63
|
type: "string",
|
|
71
|
-
description: "ID
|
|
64
|
+
description: "Second document ID for diff comparison (required when sections includes 'diff')",
|
|
72
65
|
},
|
|
73
66
|
},
|
|
74
|
-
required: ["
|
|
67
|
+
required: ["id"],
|
|
75
68
|
},
|
|
76
69
|
},
|
|
77
|
-
executor: this.
|
|
70
|
+
executor: this.inspectImportDocument.bind(this),
|
|
78
71
|
},
|
|
79
72
|
{
|
|
80
73
|
definition: {
|
|
@@ -95,18 +88,57 @@ export class ImportDocumentTools {
|
|
|
95
88
|
},
|
|
96
89
|
];
|
|
97
90
|
}
|
|
98
|
-
async
|
|
91
|
+
async queryImportDocuments(args) {
|
|
99
92
|
const docs = await this.pica.importDocuments.list(args);
|
|
100
93
|
return formatStructuredList(docs, "import document");
|
|
101
94
|
}
|
|
102
|
-
async
|
|
95
|
+
async inspectImportDocument(args) {
|
|
103
96
|
if (!args.id) {
|
|
104
97
|
return {
|
|
105
98
|
content: [{ type: "text", text: "id is required" }],
|
|
106
99
|
isError: true,
|
|
107
100
|
};
|
|
108
101
|
}
|
|
102
|
+
const sections = args.sections || ["basic"];
|
|
109
103
|
const doc = await this.pica.importDocuments.get(args.id);
|
|
104
|
+
// If diff is requested, compute and append the diff
|
|
105
|
+
if (sections.includes("diff")) {
|
|
106
|
+
if (!args.compare_id) {
|
|
107
|
+
return {
|
|
108
|
+
content: [
|
|
109
|
+
{
|
|
110
|
+
type: "text",
|
|
111
|
+
text: "compare_id is required when sections includes 'diff'",
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
isError: true,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
const docB = await this.pica.importDocuments.get(args.compare_id);
|
|
118
|
+
const diffResult = this.computeDiff(args.id, doc, args.compare_id, docB);
|
|
119
|
+
if (sections.includes("basic")) {
|
|
120
|
+
// Return both basic + diff
|
|
121
|
+
const basicText = doc.body ?? JSON.stringify(doc, null, 2);
|
|
122
|
+
return {
|
|
123
|
+
content: [
|
|
124
|
+
{
|
|
125
|
+
type: "text",
|
|
126
|
+
text: basicText + "\n\n" + diffResult.text,
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
structuredContent: {
|
|
130
|
+
document: doc,
|
|
131
|
+
diff: diffResult.structured,
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
// Diff only
|
|
136
|
+
return {
|
|
137
|
+
content: [{ type: "text", text: diffResult.text }],
|
|
138
|
+
structuredContent: diffResult.structured,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
// Basic only (default)
|
|
110
142
|
return {
|
|
111
143
|
content: [
|
|
112
144
|
{ type: "text", text: doc.body ?? JSON.stringify(doc, null, 2) },
|
|
@@ -124,22 +156,7 @@ export class ImportDocumentTools {
|
|
|
124
156
|
const result = await this.pica.importDocuments.ingest(args.markdown);
|
|
125
157
|
return formatSuccess(`Statement ingested successfully. Document ID: ${result.id}`, result);
|
|
126
158
|
}
|
|
127
|
-
|
|
128
|
-
if (!args.document_id_a || !args.document_id_b) {
|
|
129
|
-
return {
|
|
130
|
-
content: [
|
|
131
|
-
{
|
|
132
|
-
type: "text",
|
|
133
|
-
text: "document_id_a and document_id_b are required",
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
isError: true,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
const [docA, docB] = await Promise.all([
|
|
140
|
-
this.pica.importDocuments.get(args.document_id_a),
|
|
141
|
-
this.pica.importDocuments.get(args.document_id_b),
|
|
142
|
-
]);
|
|
159
|
+
computeDiff(idA, docA, idB, docB) {
|
|
143
160
|
const summaryA = docA.summary ?? {};
|
|
144
161
|
const summaryB = docB.summary ?? {};
|
|
145
162
|
const lineItemsDelta = (summaryB.line_count ?? 0) - (summaryA.line_count ?? 0);
|
|
@@ -160,15 +177,15 @@ export class ImportDocumentTools {
|
|
|
160
177
|
`| matched works | ${summaryA.matched_works ?? "—"} | ${summaryB.matched_works ?? "—"} | ${sign(matchedWorksDelta)} |`,
|
|
161
178
|
`| warnings | ${summaryA.warning_count ?? "—"} | ${summaryB.warning_count ?? "—"} | ${sign(warningsDelta)} |`,
|
|
162
179
|
].join("\n");
|
|
163
|
-
const
|
|
180
|
+
const structured = {
|
|
164
181
|
document_a: {
|
|
165
|
-
id:
|
|
182
|
+
id: idA,
|
|
166
183
|
source: docA.source,
|
|
167
184
|
period: docA.period,
|
|
168
185
|
summary: summaryA,
|
|
169
186
|
},
|
|
170
187
|
document_b: {
|
|
171
|
-
id:
|
|
188
|
+
id: idB,
|
|
172
189
|
source: docB.source,
|
|
173
190
|
period: docB.period,
|
|
174
191
|
summary: summaryB,
|
|
@@ -180,10 +197,7 @@ export class ImportDocumentTools {
|
|
|
180
197
|
warning_count: warningsDelta,
|
|
181
198
|
},
|
|
182
199
|
};
|
|
183
|
-
return {
|
|
184
|
-
content: [{ type: "text", text: table }],
|
|
185
|
-
structuredContent: deltas,
|
|
186
|
-
};
|
|
200
|
+
return { text: table, structured };
|
|
187
201
|
}
|
|
188
202
|
}
|
|
189
203
|
//# sourceMappingURL=import-documents.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-documents.js","sourceRoot":"","sources":["../../src/tools/import-documents.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"import-documents.js","sourceRoot":"","sources":["../../src/tools/import-documents.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAQ7D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE1E,MAAM,OAAO,mBAAmB;IACtB,IAAI,CAAa;IAEzB,YAAY,IAAgB;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,QAAQ;QACN,OAAO;YACL;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,6BAA6B;oBACnC,WAAW,EACT,8SAA8S;oBAChT,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,uMAAuM;6BAC1M;4BACD,MAAM,EAAE;gCACN,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,gDAAgD;6BAC9D;4BACD,aAAa,EAAE;gCACb,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,sDAAsD;6BACzD;4BACD,KAAK,EAAE;gCACL,IAAI,EAAE,QAAQ;gCACd,WAAW,EACT,mDAAmD;6BACtD;yBACF;qBACF;iBACF;gBACD,QAAQ,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;aAC/C;YACD;gBACE,UAAU,EAAE;oBACV,IAAI,EAAE,+BAA+B;oBACrC,WAAW,EACT,qFAAqF;wBACrF,wEAAwE;wBACxE,+DAA+D;oBACjE,WAAW,EAAE;wBACX,IAAI,EAAE,QAAQ;wBACd,UAAU,EAAE;4BACV,E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