@payloadcms/plugin-mcp 4.0.0-internal.a0ef1b8 → 4.0.0-internal.a1317b2
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/LICENSE.md +1 -1
- package/bin.js +7 -0
- package/dist/defaultAccess.d.ts +3 -0
- package/dist/defaultAccess.d.ts.map +1 -0
- package/dist/defaultAccess.js +3 -0
- package/dist/defaultAccess.js.map +1 -0
- package/dist/defineTool.d.ts +8 -8
- package/dist/defineTool.d.ts.map +1 -1
- package/dist/endpoint/access.d.ts +12 -5
- package/dist/endpoint/access.d.ts.map +1 -1
- package/dist/endpoint/access.js +75 -88
- package/dist/endpoint/access.js.map +1 -1
- package/dist/endpoint/index.d.ts +1 -1
- package/dist/endpoint/index.d.ts.map +1 -1
- package/dist/endpoint/index.js +68 -17
- package/dist/endpoint/index.js.map +1 -1
- package/dist/exports/client.d.ts +1 -1
- package/dist/exports/client.d.ts.map +1 -1
- package/dist/exports/client.js +1 -1
- package/dist/exports/client.js.map +1 -1
- package/dist/exports/internal.d.ts +2 -0
- package/dist/exports/internal.d.ts.map +1 -0
- package/dist/exports/internal.js +3 -0
- package/dist/exports/internal.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -20
- package/dist/index.js.map +1 -1
- package/dist/mcp/buildMcpServer.d.ts +5 -5
- package/dist/mcp/buildMcpServer.d.ts.map +1 -1
- package/dist/mcp/buildMcpServer.js +145 -80
- package/dist/mcp/buildMcpServer.js.map +1 -1
- package/dist/mcp/builtin/collections/authTools.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/authTools.js +122 -61
- package/dist/mcp/builtin/collections/authTools.js.map +1 -1
- package/dist/mcp/builtin/collections/countTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/countTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/countTool.js +63 -0
- package/dist/mcp/builtin/collections/countTool.js.map +1 -0
- package/dist/mcp/builtin/collections/countVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/countVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/countVersionsTool.js +60 -0
- package/dist/mcp/builtin/collections/countVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/collections/createTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/createTool.js +111 -68
- package/dist/mcp/builtin/collections/createTool.js.map +1 -1
- package/dist/mcp/builtin/collections/deleteTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/deleteTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/deleteTool.js +51 -61
- package/dist/mcp/builtin/collections/deleteTool.js.map +1 -1
- package/dist/mcp/builtin/collections/duplicateTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/duplicateTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/duplicateTool.js +86 -0
- package/dist/mcp/builtin/collections/duplicateTool.js.map +1 -0
- package/dist/mcp/builtin/collections/fileInput.d.ts +28 -0
- package/dist/mcp/builtin/collections/fileInput.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/fileInput.js +123 -0
- package/dist/mcp/builtin/collections/fileInput.js.map +1 -0
- package/dist/mcp/builtin/collections/fileInput.spec.js +86 -0
- package/dist/mcp/builtin/collections/fileInput.spec.js.map +1 -0
- package/dist/mcp/builtin/collections/findDistinctTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/findDistinctTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findDistinctTool.js +77 -0
- package/dist/mcp/builtin/collections/findDistinctTool.js.map +1 -0
- package/dist/mcp/builtin/collections/findTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/findTool.js +55 -72
- package/dist/mcp/builtin/collections/findTool.js.map +1 -1
- package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/findVersionByIDTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findVersionByIDTool.js +74 -0
- package/dist/mcp/builtin/collections/findVersionByIDTool.js.map +1 -0
- package/dist/mcp/builtin/collections/findVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/findVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/findVersionsTool.js +84 -0
- package/dist/mcp/builtin/collections/findVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +87 -0
- package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.js +69 -0
- package/dist/mcp/builtin/collections/restoreVersionTool.js.map +1 -0
- package/dist/mcp/builtin/collections/updateTool.d.ts +1 -1
- package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/collections/updateTool.js +104 -136
- package/dist/mcp/builtin/collections/updateTool.js.map +1 -1
- package/dist/mcp/builtin/collections/uploadInstructionsTool.d.ts +2 -0
- package/dist/mcp/builtin/collections/uploadInstructionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/collections/uploadInstructionsTool.js +55 -0
- package/dist/mcp/builtin/collections/uploadInstructionsTool.js.map +1 -0
- package/dist/mcp/builtin/formatEntityError.d.ts +16 -0
- package/dist/mcp/builtin/formatEntityError.d.ts.map +1 -0
- package/dist/mcp/builtin/formatEntityError.js +55 -0
- package/dist/mcp/builtin/formatEntityError.js.map +1 -0
- package/dist/mcp/builtin/getConfigInfoTool.d.ts +2 -0
- package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -0
- package/dist/mcp/builtin/getConfigInfoTool.js +69 -0
- package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -0
- package/dist/mcp/builtin/globals/countVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/countVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/countVersionsTool.js +60 -0
- package/dist/mcp/builtin/globals/countVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/globals/findTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/findTool.js +27 -36
- package/dist/mcp/builtin/globals/findTool.js.map +1 -1
- package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/findVersionByIDTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/findVersionByIDTool.js +68 -0
- package/dist/mcp/builtin/globals/findVersionByIDTool.js.map +1 -0
- package/dist/mcp/builtin/globals/findVersionsTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/findVersionsTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/findVersionsTool.js +78 -0
- package/dist/mcp/builtin/globals/findVersionsTool.js.map +1 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +65 -0
- package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.d.ts +2 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.d.ts.map +1 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.js +70 -0
- package/dist/mcp/builtin/globals/restoreVersionTool.js.map +1 -0
- package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -1
- package/dist/mcp/builtin/globals/updateTool.js +44 -62
- package/dist/mcp/builtin/globals/updateTool.js.map +1 -1
- package/dist/mcp/builtinTools.d.ts +150 -19
- package/dist/mcp/builtinTools.d.ts.map +1 -1
- package/dist/mcp/builtinTools.js +125 -20
- package/dist/mcp/builtinTools.js.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.d.ts +0 -1
- package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -1
- package/dist/mcp/sanitizeMCPConfig.js +124 -58
- package/dist/mcp/sanitizeMCPConfig.js.map +1 -1
- package/dist/stdio.d.ts +3 -3
- package/dist/stdio.d.ts.map +1 -1
- package/dist/stdio.js +84 -46
- package/dist/stdio.js.map +1 -1
- package/dist/types.d.ts +114 -112
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -4
- package/dist/types.js.map +1 -1
- package/dist/utils/camelCase.d.ts.map +1 -1
- package/dist/utils/getPluginConfig.d.ts +1 -1
- package/dist/utils/getPluginConfig.js +1 -1
- package/dist/utils/getPluginConfig.js.map +1 -1
- package/dist/utils/resolveProjectRoot.d.ts.map +1 -1
- package/dist/utils/toStandardSchema.d.ts.map +1 -1
- package/package.json +11 -18
- package/src/defaultAccess.ts +3 -0
- package/src/endpoint/access.ts +80 -101
- package/src/endpoint/index.ts +58 -16
- package/src/exports/client.ts +2 -1
- package/src/exports/internal.ts +1 -0
- package/src/index.ts +12 -20
- package/src/mcp/buildMcpServer.ts +179 -114
- package/src/mcp/builtin/collections/authTools.ts +119 -75
- package/src/mcp/builtin/collections/countTool.ts +61 -0
- package/src/mcp/builtin/collections/countVersionsTool.ts +60 -0
- package/src/mcp/builtin/collections/createTool.ts +104 -88
- package/src/mcp/builtin/collections/deleteTool.ts +48 -74
- package/src/mcp/builtin/collections/duplicateTool.ts +83 -0
- package/src/mcp/builtin/collections/fileInput.spec.ts +93 -0
- package/src/mcp/builtin/collections/fileInput.ts +169 -0
- package/src/mcp/builtin/collections/findDistinctTool.ts +67 -0
- package/src/mcp/builtin/collections/findTool.ts +55 -108
- package/src/mcp/builtin/collections/findVersionByIDTool.ts +66 -0
- package/src/mcp/builtin/collections/findVersionsTool.ts +83 -0
- package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +80 -0
- package/src/mcp/builtin/collections/restoreVersionTool.ts +65 -0
- package/src/mcp/builtin/collections/updateTool.ts +101 -142
- package/src/mcp/builtin/collections/uploadInstructionsTool.ts +64 -0
- package/src/mcp/builtin/formatEntityError.ts +77 -0
- package/src/mcp/builtin/getConfigInfoTool.ts +68 -0
- package/src/mcp/builtin/globals/countVersionsTool.ts +60 -0
- package/src/mcp/builtin/globals/findTool.ts +27 -57
- package/src/mcp/builtin/globals/findVersionByIDTool.ts +64 -0
- package/src/mcp/builtin/globals/findVersionsTool.ts +69 -0
- package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +63 -0
- package/src/mcp/builtin/globals/restoreVersionTool.ts +68 -0
- package/src/mcp/builtin/globals/updateTool.ts +51 -79
- package/src/mcp/builtinTools.ts +118 -41
- package/src/mcp/sanitizeMCPConfig.ts +120 -78
- package/src/stdio.ts +79 -46
- package/src/types.ts +130 -117
- package/src/utils/getPluginConfig.ts +1 -1
- package/dist/@types/assets.d.js +0 -2
- package/dist/@types/assets.d.js.map +0 -1
- package/dist/collection/getAccessField.d.ts +0 -12
- package/dist/collection/getAccessField.d.ts.map +0 -1
- package/dist/collection/getAccessField.js +0 -57
- package/dist/collection/getAccessField.js.map +0 -1
- package/dist/collection/index.d.ts +0 -6
- package/dist/collection/index.d.ts.map +0 -1
- package/dist/collection/index.js +0 -60
- package/dist/collection/index.js.map +0 -1
- package/dist/components/AccessField/index.client.d.ts +0 -10
- package/dist/components/AccessField/index.client.d.ts.map +0 -1
- package/dist/components/AccessField/index.client.js +0 -305
- package/dist/components/AccessField/index.client.js.map +0 -1
- package/dist/components/AccessField/index.css +0 -93
- package/dist/utils/getVirtualFieldNames.d.ts +0 -14
- package/dist/utils/getVirtualFieldNames.d.ts.map +0 -1
- package/dist/utils/getVirtualFieldNames.js +0 -35
- package/dist/utils/getVirtualFieldNames.js.map +0 -1
- package/dist/utils/localAPIDefaults.d.ts +0 -20
- package/dist/utils/localAPIDefaults.d.ts.map +0 -1
- package/dist/utils/localAPIDefaults.js +0 -19
- package/dist/utils/localAPIDefaults.js.map +0 -1
- package/dist/utils/schemaConversion/buildToolInput.d.ts +0 -29
- package/dist/utils/schemaConversion/buildToolInput.d.ts.map +0 -1
- package/dist/utils/schemaConversion/buildToolInput.js +0 -51
- package/dist/utils/schemaConversion/buildToolInput.js.map +0 -1
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts +0 -7
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js +0 -20
- package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +0 -15
- package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js +0 -464
- package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +0 -1
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +0 -158
- package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js.map +0 -1
- package/dist/utils/transformPointDataToPayload.d.ts +0 -7
- package/dist/utils/transformPointDataToPayload.d.ts.map +0 -1
- package/dist/utils/transformPointDataToPayload.js +0 -28
- package/dist/utils/transformPointDataToPayload.js.map +0 -1
- package/src/@types/assets.d.ts +0 -3
- package/src/collection/getAccessField.ts +0 -64
- package/src/collection/index.ts +0 -64
- package/src/components/AccessField/index.client.tsx +0 -344
- package/src/components/AccessField/index.css +0 -93
- package/src/utils/getVirtualFieldNames.ts +0 -53
- package/src/utils/localAPIDefaults.ts +0 -22
- package/src/utils/schemaConversion/buildToolInput.ts +0 -68
- package/src/utils/schemaConversion/removeVirtualFieldsFromSchema.ts +0 -27
- package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +0 -103
- package/src/utils/schemaConversion/sanitizeEntitySchema.ts +0 -529
- package/src/utils/transformPointDataToPayload.ts +0 -40
|
@@ -1,95 +1,77 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getGlobalVirtualFieldNames, stripVirtualFields, transformPointDataToPayload, updateGlobalInputSchema, validateGlobalData } from 'payload';
|
|
2
|
+
import { defaultAccess } from '../../../defaultAccess.js';
|
|
2
3
|
import { defineGlobalTool } from '../../../defineTool.js';
|
|
3
4
|
import { getLogger } from '../../../utils/getLogger.js';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import { buildToolInput } from '../../../utils/schemaConversion/buildToolInput.js';
|
|
7
|
-
import { sanitizeEntitySchema } from '../../../utils/schemaConversion/sanitizeEntitySchema.js';
|
|
8
|
-
const DEFAULT_DESCRIPTION = 'Update a Payload global singleton configuration.';
|
|
5
|
+
import { formatEntityError } from '../formatEntityError.js';
|
|
6
|
+
const DEFAULT_DESCRIPTION = 'Update any Payload global by passing the global slug and data.';
|
|
9
7
|
export const updateGlobalTool = defineGlobalTool({
|
|
8
|
+
access: (args)=>defaultAccess(args) && Boolean(args.permissions?.globals?.[args.slug]?.update),
|
|
9
|
+
annotations: {
|
|
10
|
+
destructiveHint: true,
|
|
11
|
+
idempotentHint: false,
|
|
12
|
+
openWorldHint: false,
|
|
13
|
+
readOnlyHint: false,
|
|
14
|
+
title: 'Update Global'
|
|
15
|
+
},
|
|
10
16
|
description: DEFAULT_DESCRIPTION,
|
|
11
|
-
input:
|
|
12
|
-
|
|
13
|
-
// Global updates do not require all required fields to be passed => delete .required.
|
|
14
|
-
//
|
|
15
|
-
// Local API equivalent: packages/payload/src/global/operations/local/update.ts#BaseOptions#data:
|
|
16
|
-
// data: DeepPartial<Omit<DataFromGlobalSlug<TSlug>, 'id'>>
|
|
17
|
-
delete partialSchema.required;
|
|
18
|
-
return buildToolInput({
|
|
19
|
-
controls: {
|
|
20
|
-
depth: z.number().describe('Optional: Depth of relationships to populate').optional().default(0),
|
|
21
|
-
draft: z.boolean().describe('Optional: Whether to save as draft (default: false)').optional().default(false),
|
|
22
|
-
fallbackLocale: z.string().describe('Optional: fallback locale code to use when requested locale is not available').optional(),
|
|
23
|
-
locale: z.string().describe('Optional: locale code to update data in (e.g., "en", "es"). Use "all" to update all locales for localized fields').optional(),
|
|
24
|
-
select: z.string().describe('Optional: define exactly which fields you\'d like to return in the response (JSON), e.g., \'{"siteName": "My Site"}\'').optional()
|
|
25
|
-
},
|
|
26
|
-
dataDescription: 'The fields to update',
|
|
27
|
-
dataSchema: partialSchema
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
}).handler(async ({ authorizedMCP, globalSlug, input, req })=>{
|
|
17
|
+
input: updateGlobalInputSchema
|
|
18
|
+
}).handler(async ({ slug, authorizedMCP, input, req })=>{
|
|
31
19
|
const payload = req.payload;
|
|
32
20
|
const logger = getLogger({
|
|
33
21
|
payload
|
|
34
22
|
});
|
|
35
|
-
const { data, depth, draft, fallbackLocale, locale, select } = input;
|
|
36
|
-
logger.info(`Updating global: ${
|
|
23
|
+
const { data, depth, draft, fallbackLocale, locale, overrideLock, populate, publishAllLocales, select, unpublishAllLocales } = input;
|
|
24
|
+
logger.info(`Updating global: ${slug}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`);
|
|
37
25
|
try {
|
|
38
|
-
const virtualFieldNames = getGlobalVirtualFieldNames(payload.config,
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return {
|
|
47
|
-
content: [
|
|
48
|
-
{
|
|
49
|
-
type: 'text',
|
|
50
|
-
text: 'Error: Invalid JSON in select clause'
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
}
|
|
26
|
+
const virtualFieldNames = getGlobalVirtualFieldNames(payload.config, slug);
|
|
27
|
+
const inputData = stripVirtualFields(data, virtualFieldNames);
|
|
28
|
+
validateGlobalData({
|
|
29
|
+
slug,
|
|
30
|
+
data: inputData,
|
|
31
|
+
req
|
|
32
|
+
});
|
|
33
|
+
const parsedData = transformPointDataToPayload(inputData);
|
|
56
34
|
const updateOptions = {
|
|
57
|
-
slug
|
|
35
|
+
slug,
|
|
58
36
|
data: parsedData,
|
|
59
37
|
depth,
|
|
60
38
|
draft,
|
|
61
|
-
|
|
39
|
+
overrideAccess: authorizedMCP.overrideAccess,
|
|
40
|
+
overrideLock,
|
|
41
|
+
populate,
|
|
42
|
+
publishAllLocales,
|
|
43
|
+
req,
|
|
44
|
+
unpublishAllLocales
|
|
62
45
|
};
|
|
63
46
|
if (locale) {
|
|
64
47
|
updateOptions.locale = locale;
|
|
65
48
|
}
|
|
66
|
-
if (fallbackLocale) {
|
|
49
|
+
if (fallbackLocale !== undefined) {
|
|
67
50
|
updateOptions.fallbackLocale = fallbackLocale;
|
|
68
51
|
}
|
|
69
|
-
if (
|
|
70
|
-
updateOptions.select =
|
|
52
|
+
if (select) {
|
|
53
|
+
updateOptions.select = select;
|
|
71
54
|
}
|
|
72
55
|
const result = await payload.updateGlobal(updateOptions);
|
|
73
56
|
return {
|
|
74
57
|
content: [
|
|
75
58
|
{
|
|
76
59
|
type: 'text',
|
|
77
|
-
text: `Global "${
|
|
60
|
+
text: `Global "${slug}" updated successfully!\n\`\`\`json\n${JSON.stringify(result)}\n\`\`\``
|
|
78
61
|
}
|
|
79
62
|
],
|
|
80
63
|
doc: result
|
|
81
64
|
};
|
|
82
65
|
} catch (error) {
|
|
83
|
-
const
|
|
84
|
-
logger.error(`Error updating global ${
|
|
85
|
-
return {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
66
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
67
|
+
logger.error(`Error updating global ${slug}: ${message}`);
|
|
68
|
+
return formatEntityError({
|
|
69
|
+
slug,
|
|
70
|
+
action: 'updating',
|
|
71
|
+
entity: 'global',
|
|
72
|
+
error,
|
|
73
|
+
req
|
|
74
|
+
});
|
|
93
75
|
}
|
|
94
76
|
});
|
|
95
77
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/mcp/builtin/globals/updateTool.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../../../src/mcp/builtin/globals/updateTool.ts"],"sourcesContent":["import {\n getGlobalVirtualFieldNames,\n stripVirtualFields,\n transformPointDataToPayload,\n updateGlobalInputSchema,\n validateGlobalData,\n} from 'payload'\n\nimport { defaultAccess } from '../../../defaultAccess.js'\nimport { defineGlobalTool } from '../../../defineTool.js'\nimport { getLogger } from '../../../utils/getLogger.js'\nimport { formatEntityError } from '../formatEntityError.js'\n\nconst DEFAULT_DESCRIPTION = 'Update any Payload global by passing the global slug and data.'\n\nexport const updateGlobalTool = defineGlobalTool({\n access: (args) => defaultAccess(args) && Boolean(args.permissions?.globals?.[args.slug]?.update),\n annotations: {\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: false,\n readOnlyHint: false,\n title: 'Update Global',\n },\n description: DEFAULT_DESCRIPTION,\n input: updateGlobalInputSchema,\n}).handler(async ({ slug, authorizedMCP, input, req }) => {\n const payload = req.payload\n const logger = getLogger({ payload })\n\n const {\n data,\n depth,\n draft,\n fallbackLocale,\n locale,\n overrideLock,\n populate,\n publishAllLocales,\n select,\n unpublishAllLocales,\n } = input\n\n logger.info(`Updating global: ${slug}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`)\n\n try {\n const virtualFieldNames = getGlobalVirtualFieldNames(payload.config, slug)\n const inputData = stripVirtualFields(data, virtualFieldNames)\n validateGlobalData({ slug, data: inputData, req })\n\n const parsedData = transformPointDataToPayload(inputData)\n\n const updateOptions: Parameters<typeof payload.updateGlobal>[0] = {\n slug,\n data: parsedData,\n depth,\n draft,\n overrideAccess: authorizedMCP.overrideAccess,\n overrideLock,\n populate,\n publishAllLocales,\n req,\n unpublishAllLocales,\n }\n\n if (locale) {\n updateOptions.locale = locale\n }\n if (fallbackLocale !== undefined) {\n updateOptions.fallbackLocale = fallbackLocale\n }\n if (select) {\n updateOptions.select = select\n }\n\n const result = await payload.updateGlobal(updateOptions)\n\n return {\n content: [\n {\n type: 'text',\n text: `Global \"${slug}\" updated successfully!\\n\\`\\`\\`json\\n${JSON.stringify(result)}\\n\\`\\`\\``,\n },\n ],\n doc: result as Record<string, unknown>,\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error'\n logger.error(`Error updating global ${slug}: ${message}`)\n return formatEntityError({ slug, action: 'updating', entity: 'global', error, req })\n }\n})\n"],"names":["getGlobalVirtualFieldNames","stripVirtualFields","transformPointDataToPayload","updateGlobalInputSchema","validateGlobalData","defaultAccess","defineGlobalTool","getLogger","formatEntityError","DEFAULT_DESCRIPTION","updateGlobalTool","access","args","Boolean","permissions","globals","slug","update","annotations","destructiveHint","idempotentHint","openWorldHint","readOnlyHint","title","description","input","handler","authorizedMCP","req","payload","logger","data","depth","draft","fallbackLocale","locale","overrideLock","populate","publishAllLocales","select","unpublishAllLocales","info","virtualFieldNames","config","inputData","parsedData","updateOptions","overrideAccess","undefined","result","updateGlobal","content","type","text","JSON","stringify","doc","error","message","Error","action","entity"],"mappings":"AAAA,SACEA,0BAA0B,EAC1BC,kBAAkB,EAClBC,2BAA2B,EAC3BC,uBAAuB,EACvBC,kBAAkB,QACb,UAAS;AAEhB,SAASC,aAAa,QAAQ,4BAA2B;AACzD,SAASC,gBAAgB,QAAQ,yBAAwB;AACzD,SAASC,SAAS,QAAQ,8BAA6B;AACvD,SAASC,iBAAiB,QAAQ,0BAAyB;AAE3D,MAAMC,sBAAsB;AAE5B,OAAO,MAAMC,mBAAmBJ,iBAAiB;IAC/CK,QAAQ,CAACC,OAASP,cAAcO,SAASC,QAAQD,KAAKE,WAAW,EAAEC,SAAS,CAACH,KAAKI,IAAI,CAAC,EAAEC;IACzFC,aAAa;QACXC,iBAAiB;QACjBC,gBAAgB;QAChBC,eAAe;QACfC,cAAc;QACdC,OAAO;IACT;IACAC,aAAaf;IACbgB,OAAOtB;AACT,GAAGuB,OAAO,CAAC,OAAO,EAAEV,IAAI,EAAEW,aAAa,EAAEF,KAAK,EAAEG,GAAG,EAAE;IACnD,MAAMC,UAAUD,IAAIC,OAAO;IAC3B,MAAMC,SAASvB,UAAU;QAAEsB;IAAQ;IAEnC,MAAM,EACJE,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,cAAc,EACdC,MAAM,EACNC,YAAY,EACZC,QAAQ,EACRC,iBAAiB,EACjBC,MAAM,EACNC,mBAAmB,EACpB,GAAGf;IAEJK,OAAOW,IAAI,CAAC,CAAC,iBAAiB,EAAEzB,KAAK,SAAS,EAAEiB,QAAQE,SAAS,CAAC,UAAU,EAAEA,QAAQ,GAAG,IAAI;IAE7F,IAAI;QACF,MAAMO,oBAAoB1C,2BAA2B6B,QAAQc,MAAM,EAAE3B;QACrE,MAAM4B,YAAY3C,mBAAmB8B,MAAMW;QAC3CtC,mBAAmB;YAAEY;YAAMe,MAAMa;YAAWhB;QAAI;QAEhD,MAAMiB,aAAa3C,4BAA4B0C;QAE/C,MAAME,gBAA4D;YAChE9B;YACAe,MAAMc;YACNb;YACAC;YACAc,gBAAgBpB,cAAcoB,cAAc;YAC5CX;YACAC;YACAC;YACAV;YACAY;QACF;QAEA,IAAIL,QAAQ;YACVW,cAAcX,MAAM,GAAGA;QACzB;QACA,IAAID,mBAAmBc,WAAW;YAChCF,cAAcZ,cAAc,GAAGA;QACjC;QACA,IAAIK,QAAQ;YACVO,cAAcP,MAAM,GAAGA;QACzB;QAEA,MAAMU,SAAS,MAAMpB,QAAQqB,YAAY,CAACJ;QAE1C,OAAO;YACLK,SAAS;gBACP;oBACEC,MAAM;oBACNC,MAAM,CAAC,QAAQ,EAAErC,KAAK,qCAAqC,EAAEsC,KAAKC,SAAS,CAACN,QAAQ,QAAQ,CAAC;gBAC/F;aACD;YACDO,KAAKP;QACP;IACF,EAAE,OAAOQ,OAAO;QACd,MAAMC,UAAUD,iBAAiBE,QAAQF,MAAMC,OAAO,GAAG;QACzD5B,OAAO2B,KAAK,CAAC,CAAC,sBAAsB,EAAEzC,KAAK,EAAE,EAAE0C,SAAS;QACxD,OAAOlD,kBAAkB;YAAEQ;YAAM4C,QAAQ;YAAYC,QAAQ;YAAUJ;YAAO7B;QAAI;IACpF;AACF,GAAE"}
|
|
@@ -1,37 +1,168 @@
|
|
|
1
|
-
import type { CollectionTool, GlobalTool } from '../types.js';
|
|
1
|
+
import type { CollectionTool, GlobalTool, Tool } from '../types.js';
|
|
2
|
+
type CollectionBuiltin = {
|
|
3
|
+
mcpName: string;
|
|
4
|
+
requiresDuplicateEnabled?: boolean;
|
|
5
|
+
requiresUpload?: boolean;
|
|
6
|
+
requiresVersions?: boolean;
|
|
7
|
+
tool: CollectionTool;
|
|
8
|
+
};
|
|
9
|
+
type GlobalBuiltin = {
|
|
10
|
+
mcpName: string;
|
|
11
|
+
requiresVersions?: boolean;
|
|
12
|
+
tool: GlobalTool;
|
|
13
|
+
};
|
|
14
|
+
export declare const TOOL_BUILTINS: {
|
|
15
|
+
getConfigInfo: {
|
|
16
|
+
mcpName: string;
|
|
17
|
+
tool: Tool;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
2
20
|
/**
|
|
3
21
|
* The static built-in collection CRUD tools. Keys here are the source of truth
|
|
4
22
|
* for `MCPCollectionBuiltinName` — adding/removing an entry updates the type
|
|
5
23
|
* automatically.
|
|
6
24
|
*/
|
|
7
|
-
export declare const COLLECTION_BUILTINS:
|
|
25
|
+
export declare const COLLECTION_BUILTINS: {
|
|
26
|
+
count: {
|
|
27
|
+
mcpName: string;
|
|
28
|
+
tool: CollectionTool;
|
|
29
|
+
};
|
|
30
|
+
countVersions: {
|
|
31
|
+
mcpName: string;
|
|
32
|
+
requiresVersions: true;
|
|
33
|
+
tool: CollectionTool;
|
|
34
|
+
};
|
|
35
|
+
create: {
|
|
36
|
+
mcpName: string;
|
|
37
|
+
tool: CollectionTool;
|
|
38
|
+
};
|
|
39
|
+
delete: {
|
|
40
|
+
mcpName: string;
|
|
41
|
+
tool: CollectionTool;
|
|
42
|
+
};
|
|
43
|
+
duplicate: {
|
|
44
|
+
mcpName: string;
|
|
45
|
+
requiresDuplicateEnabled: true;
|
|
46
|
+
tool: CollectionTool;
|
|
47
|
+
};
|
|
48
|
+
find: {
|
|
49
|
+
mcpName: string;
|
|
50
|
+
tool: CollectionTool;
|
|
51
|
+
};
|
|
52
|
+
findDistinct: {
|
|
53
|
+
mcpName: string;
|
|
54
|
+
tool: CollectionTool;
|
|
55
|
+
};
|
|
56
|
+
findVersionByID: {
|
|
57
|
+
mcpName: string;
|
|
58
|
+
requiresVersions: true;
|
|
59
|
+
tool: CollectionTool;
|
|
60
|
+
};
|
|
61
|
+
findVersions: {
|
|
62
|
+
mcpName: string;
|
|
63
|
+
requiresVersions: true;
|
|
64
|
+
tool: CollectionTool;
|
|
65
|
+
};
|
|
66
|
+
getCollectionSchema: {
|
|
67
|
+
mcpName: string;
|
|
68
|
+
tool: CollectionTool;
|
|
69
|
+
};
|
|
70
|
+
getUploadInstructions: {
|
|
71
|
+
mcpName: string;
|
|
72
|
+
requiresUpload: true;
|
|
73
|
+
tool: CollectionTool;
|
|
74
|
+
};
|
|
75
|
+
restoreVersion: {
|
|
76
|
+
mcpName: string;
|
|
77
|
+
requiresVersions: true;
|
|
78
|
+
tool: CollectionTool;
|
|
79
|
+
};
|
|
80
|
+
update: {
|
|
81
|
+
mcpName: string;
|
|
82
|
+
tool: CollectionTool;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
8
85
|
/**
|
|
9
|
-
* The static auth tools surfaced under auth-enabled collections.
|
|
10
|
-
*
|
|
11
|
-
* for `MCPCollectionAuthToolName`.
|
|
86
|
+
* The static auth tools surfaced under auth-enabled collections. Keys are the
|
|
87
|
+
* source of truth for `MCPCollectionAuthToolName`.
|
|
12
88
|
*/
|
|
13
|
-
export declare const COLLECTION_AUTH_BUILTINS:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
89
|
+
export declare const COLLECTION_AUTH_BUILTINS: {
|
|
90
|
+
auth: {
|
|
91
|
+
mcpName: string;
|
|
92
|
+
tool: CollectionTool;
|
|
93
|
+
};
|
|
94
|
+
forgotPassword: {
|
|
95
|
+
mcpName: string;
|
|
96
|
+
tool: CollectionTool;
|
|
97
|
+
};
|
|
98
|
+
login: {
|
|
99
|
+
mcpName: string;
|
|
100
|
+
tool: CollectionTool;
|
|
101
|
+
};
|
|
102
|
+
resetPassword: {
|
|
103
|
+
mcpName: string;
|
|
104
|
+
tool: CollectionTool;
|
|
105
|
+
};
|
|
106
|
+
unlock: {
|
|
107
|
+
mcpName: string;
|
|
108
|
+
tool: CollectionTool;
|
|
109
|
+
};
|
|
110
|
+
verify: {
|
|
111
|
+
mcpName: string;
|
|
112
|
+
tool: CollectionTool;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
17
115
|
/**
|
|
18
116
|
* The static built-in global tools. Keys are the source of truth for
|
|
19
117
|
* `MCPGlobalBuiltinName`.
|
|
20
118
|
*/
|
|
21
|
-
export declare const GLOBAL_BUILTINS:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
119
|
+
export declare const GLOBAL_BUILTINS: {
|
|
120
|
+
countGlobalVersions: {
|
|
121
|
+
mcpName: string;
|
|
122
|
+
requiresVersions: true;
|
|
123
|
+
tool: GlobalTool;
|
|
124
|
+
};
|
|
125
|
+
find: {
|
|
126
|
+
mcpName: string;
|
|
127
|
+
tool: GlobalTool;
|
|
128
|
+
};
|
|
129
|
+
findGlobalVersionByID: {
|
|
130
|
+
mcpName: string;
|
|
131
|
+
requiresVersions: true;
|
|
132
|
+
tool: GlobalTool;
|
|
133
|
+
};
|
|
134
|
+
findGlobalVersions: {
|
|
135
|
+
mcpName: string;
|
|
136
|
+
requiresVersions: true;
|
|
137
|
+
tool: GlobalTool;
|
|
138
|
+
};
|
|
139
|
+
getGlobalSchema: {
|
|
140
|
+
mcpName: string;
|
|
141
|
+
tool: GlobalTool;
|
|
142
|
+
};
|
|
143
|
+
restoreGlobalVersion: {
|
|
144
|
+
mcpName: string;
|
|
145
|
+
requiresVersions: true;
|
|
146
|
+
tool: GlobalTool;
|
|
147
|
+
};
|
|
148
|
+
update: {
|
|
149
|
+
mcpName: string;
|
|
150
|
+
tool: GlobalTool;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
export type MCPCollectionBuiltinName = keyof typeof COLLECTION_BUILTINS;
|
|
154
|
+
export type MCPCollectionAuthToolName = keyof typeof COLLECTION_AUTH_BUILTINS;
|
|
155
|
+
export type MCPGlobalBuiltinName = keyof typeof GLOBAL_BUILTINS;
|
|
156
|
+
export type MCPTopLevelBuiltinName = keyof typeof TOOL_BUILTINS;
|
|
25
157
|
/**
|
|
26
158
|
* Pre-typed `Object.entries` for each registry. The cast from `string` to the
|
|
27
159
|
* literal key union lives here once so consumers can iterate without their own
|
|
28
160
|
* cast — TypeScript's `Object.entries` always widens keys to `string`, which
|
|
29
161
|
* defeats the narrow type lookups on `MCPCollectionToolsMap`.
|
|
30
162
|
*/
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
export declare const GLOBAL_BUILTIN_ENTRIES: Array<[MCPGlobalBuiltinName, GlobalTool]>;
|
|
163
|
+
export declare const TOOL_BUILTIN_ENTRIES: Array<[MCPTopLevelBuiltinName, (typeof TOOL_BUILTINS)[MCPTopLevelBuiltinName]]>;
|
|
164
|
+
export declare const COLLECTION_BUILTIN_ENTRIES: Array<[MCPCollectionBuiltinName, CollectionBuiltin]>;
|
|
165
|
+
export declare const COLLECTION_AUTH_BUILTIN_ENTRIES: Array<[MCPCollectionAuthToolName, (typeof COLLECTION_AUTH_BUILTINS)[MCPCollectionAuthToolName]]>;
|
|
166
|
+
export declare const GLOBAL_BUILTIN_ENTRIES: Array<[MCPGlobalBuiltinName, GlobalBuiltin]>;
|
|
167
|
+
export {};
|
|
37
168
|
//# sourceMappingURL=builtinTools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtinTools.d.ts","sourceRoot":"","sources":["../../src/mcp/builtinTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"builtinTools.d.ts","sourceRoot":"","sources":["../../src/mcp/builtinTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAgCnE,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,cAAc,CAAA;CACrB,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,IAAI,EAAE,UAAU,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,aAAa;;QACP,OAAO;QAAmB,IAAI;;CACU,CAAA;AAE3D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;QACrB,OAAO;QAAoB,IAAI;;;;;;;;QAE9B,OAAO;QAAqB,IAAI;;;QAChC,OAAO;QAAqB,IAAI;;;;;;;;QAMlC,OAAO;QAAmB,IAAI;;;QACtB,OAAO;QAAkB,IAAI;;;;;;;;;;;;;QAOtB,OAAO;QAAyB,IAAI;;;;;;;;;;;;;QAOjD,OAAO;QAAoB,IAAI;;CACE,CAAA;AAE7C;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;QAC3B,OAAO;QAAU,IAAI;;;QAE3B,OAAO;QACP,IAAI;;;QAEG,OAAO;QAAW,IAAI;;;QAE7B,OAAO;QACP,IAAI;;;QAEI,OAAO;QAAY,IAAI;;;QACvB,OAAO;QAAY,IAAI;;CACkC,CAAA;AAErE;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;QAMlB,OAAO;QAAgB,IAAI;;;;;;;;;;;;;QAWhB,OAAO;QAAqB,IAAI;;;;;;;;QAMzC,OAAO;QAAkB,IAAI;;CACA,CAAA;AAEzC,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,mBAAmB,CAAA;AAEvE,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,wBAAwB,CAAA;AAE7E,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,eAAe,CAAA;AAE/D,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,aAAa,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAoC,KAAK,CACxE,CAAC,sBAAsB,EAAE,CAAC,OAAO,aAAa,CAAC,CAAC,sBAAsB,CAAC,CAAC,CACzE,CAAA;AAED,eAAO,MAAM,0BAA0B,EAA0C,KAAK,CACpF,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,CAC9C,CAAA;AAED,eAAO,MAAM,+BAA+B,EAA+C,KAAK,CAC9F,CAAC,yBAAyB,EAAE,CAAC,OAAO,wBAAwB,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAC1F,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAsC,KAAK,CAC5E,CAAC,oBAAoB,EAAE,aAAa,CAAC,CACtC,CAAA"}
|
package/dist/mcp/builtinTools.js
CHANGED
|
@@ -1,47 +1,121 @@
|
|
|
1
1
|
import { authCollectionTool, forgotPasswordCollectionTool, loginCollectionTool, resetPasswordCollectionTool, unlockCollectionTool, verifyCollectionTool } from './builtin/collections/authTools.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { countDocumentsTool } from './builtin/collections/countTool.js';
|
|
3
|
+
import { countVersionsTool } from './builtin/collections/countVersionsTool.js';
|
|
4
|
+
import { createDocumentsTool } from './builtin/collections/createTool.js';
|
|
5
|
+
import { deleteDocumentsTool } from './builtin/collections/deleteTool.js';
|
|
6
|
+
import { duplicateDocumentTool } from './builtin/collections/duplicateTool.js';
|
|
7
|
+
import { findDistinctTool } from './builtin/collections/findDistinctTool.js';
|
|
8
|
+
import { findDocumentsTool } from './builtin/collections/findTool.js';
|
|
9
|
+
import { findVersionByIDTool } from './builtin/collections/findVersionByIDTool.js';
|
|
10
|
+
import { findVersionsTool } from './builtin/collections/findVersionsTool.js';
|
|
11
|
+
import { getCollectionSchemaTool } from './builtin/collections/getCollectionSchemaTool.js';
|
|
12
|
+
import { restoreVersionTool } from './builtin/collections/restoreVersionTool.js';
|
|
13
|
+
import { updateDocumentTool } from './builtin/collections/updateTool.js';
|
|
14
|
+
import { getUploadInstructionsTool } from './builtin/collections/uploadInstructionsTool.js';
|
|
15
|
+
import { getConfigInfoTool } from './builtin/getConfigInfoTool.js';
|
|
16
|
+
import { countGlobalVersionsTool } from './builtin/globals/countVersionsTool.js';
|
|
6
17
|
import { findGlobalTool } from './builtin/globals/findTool.js';
|
|
18
|
+
import { findGlobalVersionByIDTool } from './builtin/globals/findVersionByIDTool.js';
|
|
19
|
+
import { findGlobalVersionsTool } from './builtin/globals/findVersionsTool.js';
|
|
20
|
+
import { getGlobalSchemaTool } from './builtin/globals/getGlobalSchemaTool.js';
|
|
21
|
+
import { restoreGlobalVersionTool } from './builtin/globals/restoreVersionTool.js';
|
|
7
22
|
import { updateGlobalTool } from './builtin/globals/updateTool.js';
|
|
23
|
+
export const TOOL_BUILTINS = {
|
|
24
|
+
getConfigInfo: {
|
|
25
|
+
mcpName: 'getConfigInfo',
|
|
26
|
+
tool: getConfigInfoTool
|
|
27
|
+
}
|
|
28
|
+
};
|
|
8
29
|
/**
|
|
9
30
|
* The static built-in collection CRUD tools. Keys here are the source of truth
|
|
10
31
|
* for `MCPCollectionBuiltinName` — adding/removing an entry updates the type
|
|
11
32
|
* automatically.
|
|
12
33
|
*/ export const COLLECTION_BUILTINS = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
34
|
+
count: {
|
|
35
|
+
mcpName: 'countDocuments',
|
|
36
|
+
tool: countDocumentsTool
|
|
37
|
+
},
|
|
38
|
+
countVersions: {
|
|
39
|
+
mcpName: 'countVersions',
|
|
40
|
+
requiresVersions: true,
|
|
41
|
+
tool: countVersionsTool
|
|
42
|
+
},
|
|
43
|
+
create: {
|
|
44
|
+
mcpName: 'createDocuments',
|
|
45
|
+
tool: createDocumentsTool
|
|
46
|
+
},
|
|
47
|
+
delete: {
|
|
48
|
+
mcpName: 'deleteDocuments',
|
|
49
|
+
tool: deleteDocumentsTool
|
|
50
|
+
},
|
|
51
|
+
duplicate: {
|
|
52
|
+
mcpName: 'duplicateDocument',
|
|
53
|
+
requiresDuplicateEnabled: true,
|
|
54
|
+
tool: duplicateDocumentTool
|
|
55
|
+
},
|
|
56
|
+
find: {
|
|
57
|
+
mcpName: 'findDocuments',
|
|
58
|
+
tool: findDocumentsTool
|
|
59
|
+
},
|
|
60
|
+
findDistinct: {
|
|
61
|
+
mcpName: 'findDistinct',
|
|
62
|
+
tool: findDistinctTool
|
|
63
|
+
},
|
|
64
|
+
findVersionByID: {
|
|
65
|
+
mcpName: 'findVersionByID',
|
|
66
|
+
requiresVersions: true,
|
|
67
|
+
tool: findVersionByIDTool
|
|
68
|
+
},
|
|
69
|
+
findVersions: {
|
|
70
|
+
mcpName: 'findVersions',
|
|
71
|
+
requiresVersions: true,
|
|
72
|
+
tool: findVersionsTool
|
|
73
|
+
},
|
|
74
|
+
getCollectionSchema: {
|
|
75
|
+
mcpName: 'getCollectionSchema',
|
|
76
|
+
tool: getCollectionSchemaTool
|
|
77
|
+
},
|
|
78
|
+
getUploadInstructions: {
|
|
79
|
+
mcpName: 'getUploadInstructions',
|
|
80
|
+
requiresUpload: true,
|
|
81
|
+
tool: getUploadInstructionsTool
|
|
82
|
+
},
|
|
83
|
+
restoreVersion: {
|
|
84
|
+
mcpName: 'restoreVersion',
|
|
85
|
+
requiresVersions: true,
|
|
86
|
+
tool: restoreVersionTool
|
|
87
|
+
},
|
|
88
|
+
update: {
|
|
89
|
+
mcpName: 'updateDocument',
|
|
90
|
+
tool: updateDocumentTool
|
|
91
|
+
}
|
|
17
92
|
};
|
|
18
93
|
/**
|
|
19
|
-
* The static auth tools surfaced under auth-enabled collections.
|
|
20
|
-
*
|
|
21
|
-
* for `MCPCollectionAuthToolName`.
|
|
94
|
+
* The static auth tools surfaced under auth-enabled collections. Keys are the
|
|
95
|
+
* source of truth for `MCPCollectionAuthToolName`.
|
|
22
96
|
*/ export const COLLECTION_AUTH_BUILTINS = {
|
|
23
97
|
auth: {
|
|
24
|
-
|
|
98
|
+
mcpName: 'auth',
|
|
25
99
|
tool: authCollectionTool
|
|
26
100
|
},
|
|
27
101
|
forgotPassword: {
|
|
28
|
-
|
|
102
|
+
mcpName: 'forgotPassword',
|
|
29
103
|
tool: forgotPasswordCollectionTool
|
|
30
104
|
},
|
|
31
105
|
login: {
|
|
32
|
-
|
|
106
|
+
mcpName: 'login',
|
|
33
107
|
tool: loginCollectionTool
|
|
34
108
|
},
|
|
35
109
|
resetPassword: {
|
|
36
|
-
|
|
110
|
+
mcpName: 'resetPassword',
|
|
37
111
|
tool: resetPasswordCollectionTool
|
|
38
112
|
},
|
|
39
113
|
unlock: {
|
|
40
|
-
|
|
114
|
+
mcpName: 'unlock',
|
|
41
115
|
tool: unlockCollectionTool
|
|
42
116
|
},
|
|
43
117
|
verify: {
|
|
44
|
-
|
|
118
|
+
mcpName: 'verify',
|
|
45
119
|
tool: verifyCollectionTool
|
|
46
120
|
}
|
|
47
121
|
};
|
|
@@ -49,15 +123,46 @@ import { updateGlobalTool } from './builtin/globals/updateTool.js';
|
|
|
49
123
|
* The static built-in global tools. Keys are the source of truth for
|
|
50
124
|
* `MCPGlobalBuiltinName`.
|
|
51
125
|
*/ export const GLOBAL_BUILTINS = {
|
|
52
|
-
|
|
53
|
-
|
|
126
|
+
countGlobalVersions: {
|
|
127
|
+
mcpName: 'countGlobalVersions',
|
|
128
|
+
requiresVersions: true,
|
|
129
|
+
tool: countGlobalVersionsTool
|
|
130
|
+
},
|
|
131
|
+
find: {
|
|
132
|
+
mcpName: 'findGlobal',
|
|
133
|
+
tool: findGlobalTool
|
|
134
|
+
},
|
|
135
|
+
findGlobalVersionByID: {
|
|
136
|
+
mcpName: 'findGlobalVersionByID',
|
|
137
|
+
requiresVersions: true,
|
|
138
|
+
tool: findGlobalVersionByIDTool
|
|
139
|
+
},
|
|
140
|
+
findGlobalVersions: {
|
|
141
|
+
mcpName: 'findGlobalVersions',
|
|
142
|
+
requiresVersions: true,
|
|
143
|
+
tool: findGlobalVersionsTool
|
|
144
|
+
},
|
|
145
|
+
getGlobalSchema: {
|
|
146
|
+
mcpName: 'getGlobalSchema',
|
|
147
|
+
tool: getGlobalSchemaTool
|
|
148
|
+
},
|
|
149
|
+
restoreGlobalVersion: {
|
|
150
|
+
mcpName: 'restoreGlobalVersion',
|
|
151
|
+
requiresVersions: true,
|
|
152
|
+
tool: restoreGlobalVersionTool
|
|
153
|
+
},
|
|
154
|
+
update: {
|
|
155
|
+
mcpName: 'updateGlobal',
|
|
156
|
+
tool: updateGlobalTool
|
|
157
|
+
}
|
|
54
158
|
};
|
|
55
159
|
/**
|
|
56
160
|
* Pre-typed `Object.entries` for each registry. The cast from `string` to the
|
|
57
161
|
* literal key union lives here once so consumers can iterate without their own
|
|
58
162
|
* cast — TypeScript's `Object.entries` always widens keys to `string`, which
|
|
59
163
|
* defeats the narrow type lookups on `MCPCollectionToolsMap`.
|
|
60
|
-
*/ export const
|
|
164
|
+
*/ export const TOOL_BUILTIN_ENTRIES = Object.entries(TOOL_BUILTINS);
|
|
165
|
+
export const COLLECTION_BUILTIN_ENTRIES = Object.entries(COLLECTION_BUILTINS);
|
|
61
166
|
export const COLLECTION_AUTH_BUILTIN_ENTRIES = Object.entries(COLLECTION_AUTH_BUILTINS);
|
|
62
167
|
export const GLOBAL_BUILTIN_ENTRIES = Object.entries(GLOBAL_BUILTINS);
|
|
63
168
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/mcp/builtinTools.ts"],"sourcesContent":["import type { CollectionTool, GlobalTool } from '../types.js'\n\nimport {\n authCollectionTool,\n forgotPasswordCollectionTool,\n loginCollectionTool,\n resetPasswordCollectionTool,\n unlockCollectionTool,\n verifyCollectionTool,\n} from './builtin/collections/authTools.js'\nimport { createCollectionTool } from './builtin/collections/createTool.js'\nimport { deleteCollectionTool } from './builtin/collections/deleteTool.js'\nimport { findCollectionTool } from './builtin/collections/findTool.js'\nimport { updateCollectionTool } from './builtin/collections/updateTool.js'\nimport { findGlobalTool } from './builtin/globals/findTool.js'\nimport { updateGlobalTool } from './builtin/globals/updateTool.js'\n\n/**\n * The static built-in collection CRUD tools. Keys here are the source of truth\n * for `MCPCollectionBuiltinName` — adding/removing an entry updates the type\n * automatically.\n */\nexport const COLLECTION_BUILTINS: Record<MCPCollectionBuiltinName, CollectionTool> = {\n create: createCollectionTool,\n delete: deleteCollectionTool,\n find: findCollectionTool,\n update: updateCollectionTool,\n}\n\n/**\n * The static auth tools surfaced under auth-enabled collections. Each entry\n * carries the admin-UI label alongside the tool. Keys are the source of truth\n * for `MCPCollectionAuthToolName`.\n */\nexport const COLLECTION_AUTH_BUILTINS: Record<\n MCPCollectionAuthToolName,\n { label: string; tool: CollectionTool }\n> = {\n auth: { label: 'Check Auth Status', tool: authCollectionTool },\n forgotPassword: { label: 'Forgot Password', tool: forgotPasswordCollectionTool },\n login: { label: 'User Login', tool: loginCollectionTool },\n resetPassword: { label: 'Reset Password', tool: resetPasswordCollectionTool },\n unlock: { label: 'Unlock Account', tool: unlockCollectionTool },\n verify: { label: 'Email Verification', tool: verifyCollectionTool },\n}\n\n/**\n * The static built-in global tools. Keys are the source of truth for\n * `MCPGlobalBuiltinName`.\n */\nexport const GLOBAL_BUILTINS: Record<MCPGlobalBuiltinName, GlobalTool> = {\n find: findGlobalTool,\n update: updateGlobalTool,\n}\n\nexport type MCPCollectionBuiltinName = 'create' | 'delete' | 'find' | 'update'\n\nexport type MCPCollectionAuthToolName =\n | 'auth'\n | 'forgotPassword'\n | 'login'\n | 'resetPassword'\n | 'unlock'\n | 'verify'\n\nexport type MCPGlobalBuiltinName = 'find' | 'update'\n\n/**\n * Pre-typed `Object.entries` for each registry. The cast from `string` to the\n * literal key union lives here once so consumers can iterate without their own\n * cast — TypeScript's `Object.entries` always widens keys to `string`, which\n * defeats the narrow type lookups on `MCPCollectionToolsMap`.\n */\nexport const COLLECTION_BUILTIN_ENTRIES = Object.entries(COLLECTION_BUILTINS) as Array<\n [MCPCollectionBuiltinName, CollectionTool]\n>\n\nexport const COLLECTION_AUTH_BUILTIN_ENTRIES = Object.entries(COLLECTION_AUTH_BUILTINS) as Array<\n [MCPCollectionAuthToolName, { label: string; tool: CollectionTool }]\n>\n\nexport const GLOBAL_BUILTIN_ENTRIES = Object.entries(GLOBAL_BUILTINS) as Array<\n [MCPGlobalBuiltinName, GlobalTool]\n>\n"],"names":["authCollectionTool","forgotPasswordCollectionTool","loginCollectionTool","resetPasswordCollectionTool","unlockCollectionTool","verifyCollectionTool","createCollectionTool","deleteCollectionTool","findCollectionTool","updateCollectionTool","findGlobalTool","updateGlobalTool","COLLECTION_BUILTINS","create","delete","find","update","COLLECTION_AUTH_BUILTINS","auth","label","tool","forgotPassword","login","resetPassword","unlock","verify","GLOBAL_BUILTINS","COLLECTION_BUILTIN_ENTRIES","Object","entries","COLLECTION_AUTH_BUILTIN_ENTRIES","GLOBAL_BUILTIN_ENTRIES"],"mappings":"AAEA,SACEA,kBAAkB,EAClBC,4BAA4B,EAC5BC,mBAAmB,EACnBC,2BAA2B,EAC3BC,oBAAoB,EACpBC,oBAAoB,QACf,qCAAoC;AAC3C,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,oBAAoB,QAAQ,sCAAqC;AAC1E,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,gBAAgB,QAAQ,kCAAiC;AAElE;;;;CAIC,GACD,OAAO,MAAMC,sBAAwE;IACnFC,QAAQP;IACRQ,QAAQP;IACRQ,MAAMP;IACNQ,QAAQP;AACV,EAAC;AAED;;;;CAIC,GACD,OAAO,MAAMQ,2BAGT;IACFC,MAAM;QAAEC,OAAO;QAAqBC,MAAMpB;IAAmB;IAC7DqB,gBAAgB;QAAEF,OAAO;QAAmBC,MAAMnB;IAA6B;IAC/EqB,OAAO;QAAEH,OAAO;QAAcC,MAAMlB;IAAoB;IACxDqB,eAAe;QAAEJ,OAAO;QAAkBC,MAAMjB;IAA4B;IAC5EqB,QAAQ;QAAEL,OAAO;QAAkBC,MAAMhB;IAAqB;IAC9DqB,QAAQ;QAAEN,OAAO;QAAsBC,MAAMf;IAAqB;AACpE,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMqB,kBAA4D;IACvEX,MAAML;IACNM,QAAQL;AACV,EAAC;AAcD;;;;;CAKC,GACD,OAAO,MAAMgB,6BAA6BC,OAAOC,OAAO,CAACjB,qBAExD;AAED,OAAO,MAAMkB,kCAAkCF,OAAOC,OAAO,CAACZ,0BAE7D;AAED,OAAO,MAAMc,yBAAyBH,OAAOC,OAAO,CAACH,iBAEpD"}
|
|
1
|
+
{"version":3,"sources":["../../src/mcp/builtinTools.ts"],"sourcesContent":["import type { CollectionTool, GlobalTool, Tool } from '../types.js'\n\nimport {\n authCollectionTool,\n forgotPasswordCollectionTool,\n loginCollectionTool,\n resetPasswordCollectionTool,\n unlockCollectionTool,\n verifyCollectionTool,\n} from './builtin/collections/authTools.js'\nimport { countDocumentsTool } from './builtin/collections/countTool.js'\nimport { countVersionsTool } from './builtin/collections/countVersionsTool.js'\nimport { createDocumentsTool } from './builtin/collections/createTool.js'\nimport { deleteDocumentsTool } from './builtin/collections/deleteTool.js'\nimport { duplicateDocumentTool } from './builtin/collections/duplicateTool.js'\nimport { findDistinctTool } from './builtin/collections/findDistinctTool.js'\nimport { findDocumentsTool } from './builtin/collections/findTool.js'\nimport { findVersionByIDTool } from './builtin/collections/findVersionByIDTool.js'\nimport { findVersionsTool } from './builtin/collections/findVersionsTool.js'\nimport { getCollectionSchemaTool } from './builtin/collections/getCollectionSchemaTool.js'\nimport { restoreVersionTool } from './builtin/collections/restoreVersionTool.js'\nimport { updateDocumentTool } from './builtin/collections/updateTool.js'\nimport { getUploadInstructionsTool } from './builtin/collections/uploadInstructionsTool.js'\nimport { getConfigInfoTool } from './builtin/getConfigInfoTool.js'\nimport { countGlobalVersionsTool } from './builtin/globals/countVersionsTool.js'\nimport { findGlobalTool } from './builtin/globals/findTool.js'\nimport { findGlobalVersionByIDTool } from './builtin/globals/findVersionByIDTool.js'\nimport { findGlobalVersionsTool } from './builtin/globals/findVersionsTool.js'\nimport { getGlobalSchemaTool } from './builtin/globals/getGlobalSchemaTool.js'\nimport { restoreGlobalVersionTool } from './builtin/globals/restoreVersionTool.js'\nimport { updateGlobalTool } from './builtin/globals/updateTool.js'\n\ntype CollectionBuiltin = {\n mcpName: string\n requiresDuplicateEnabled?: boolean\n requiresUpload?: boolean\n requiresVersions?: boolean\n tool: CollectionTool\n}\n\ntype GlobalBuiltin = {\n mcpName: string\n requiresVersions?: boolean\n tool: GlobalTool\n}\n\nexport const TOOL_BUILTINS = {\n getConfigInfo: { mcpName: 'getConfigInfo', tool: getConfigInfoTool },\n} satisfies Record<string, { mcpName: string; tool: Tool }>\n\n/**\n * The static built-in collection CRUD tools. Keys here are the source of truth\n * for `MCPCollectionBuiltinName` — adding/removing an entry updates the type\n * automatically.\n */\nexport const COLLECTION_BUILTINS = {\n count: { mcpName: 'countDocuments', tool: countDocumentsTool },\n countVersions: { mcpName: 'countVersions', requiresVersions: true, tool: countVersionsTool },\n create: { mcpName: 'createDocuments', tool: createDocumentsTool },\n delete: { mcpName: 'deleteDocuments', tool: deleteDocumentsTool },\n duplicate: {\n mcpName: 'duplicateDocument',\n requiresDuplicateEnabled: true,\n tool: duplicateDocumentTool,\n },\n find: { mcpName: 'findDocuments', tool: findDocumentsTool },\n findDistinct: { mcpName: 'findDistinct', tool: findDistinctTool },\n findVersionByID: {\n mcpName: 'findVersionByID',\n requiresVersions: true,\n tool: findVersionByIDTool,\n },\n findVersions: { mcpName: 'findVersions', requiresVersions: true, tool: findVersionsTool },\n getCollectionSchema: { mcpName: 'getCollectionSchema', tool: getCollectionSchemaTool },\n getUploadInstructions: {\n mcpName: 'getUploadInstructions',\n requiresUpload: true,\n tool: getUploadInstructionsTool,\n },\n restoreVersion: { mcpName: 'restoreVersion', requiresVersions: true, tool: restoreVersionTool },\n update: { mcpName: 'updateDocument', tool: updateDocumentTool },\n} satisfies Record<string, CollectionBuiltin>\n\n/**\n * The static auth tools surfaced under auth-enabled collections. Keys are the\n * source of truth for `MCPCollectionAuthToolName`.\n */\nexport const COLLECTION_AUTH_BUILTINS = {\n auth: { mcpName: 'auth', tool: authCollectionTool },\n forgotPassword: {\n mcpName: 'forgotPassword',\n tool: forgotPasswordCollectionTool,\n },\n login: { mcpName: 'login', tool: loginCollectionTool },\n resetPassword: {\n mcpName: 'resetPassword',\n tool: resetPasswordCollectionTool,\n },\n unlock: { mcpName: 'unlock', tool: unlockCollectionTool },\n verify: { mcpName: 'verify', tool: verifyCollectionTool },\n} satisfies Record<string, { mcpName: string; tool: CollectionTool }>\n\n/**\n * The static built-in global tools. Keys are the source of truth for\n * `MCPGlobalBuiltinName`.\n */\nexport const GLOBAL_BUILTINS = {\n countGlobalVersions: {\n mcpName: 'countGlobalVersions',\n requiresVersions: true,\n tool: countGlobalVersionsTool,\n },\n find: { mcpName: 'findGlobal', tool: findGlobalTool },\n findGlobalVersionByID: {\n mcpName: 'findGlobalVersionByID',\n requiresVersions: true,\n tool: findGlobalVersionByIDTool,\n },\n findGlobalVersions: {\n mcpName: 'findGlobalVersions',\n requiresVersions: true,\n tool: findGlobalVersionsTool,\n },\n getGlobalSchema: { mcpName: 'getGlobalSchema', tool: getGlobalSchemaTool },\n restoreGlobalVersion: {\n mcpName: 'restoreGlobalVersion',\n requiresVersions: true,\n tool: restoreGlobalVersionTool,\n },\n update: { mcpName: 'updateGlobal', tool: updateGlobalTool },\n} satisfies Record<string, GlobalBuiltin>\n\nexport type MCPCollectionBuiltinName = keyof typeof COLLECTION_BUILTINS\n\nexport type MCPCollectionAuthToolName = keyof typeof COLLECTION_AUTH_BUILTINS\n\nexport type MCPGlobalBuiltinName = keyof typeof GLOBAL_BUILTINS\n\nexport type MCPTopLevelBuiltinName = keyof typeof TOOL_BUILTINS\n\n/**\n * Pre-typed `Object.entries` for each registry. The cast from `string` to the\n * literal key union lives here once so consumers can iterate without their own\n * cast — TypeScript's `Object.entries` always widens keys to `string`, which\n * defeats the narrow type lookups on `MCPCollectionToolsMap`.\n */\nexport const TOOL_BUILTIN_ENTRIES = Object.entries(TOOL_BUILTINS) as Array<\n [MCPTopLevelBuiltinName, (typeof TOOL_BUILTINS)[MCPTopLevelBuiltinName]]\n>\n\nexport const COLLECTION_BUILTIN_ENTRIES = Object.entries(COLLECTION_BUILTINS) as Array<\n [MCPCollectionBuiltinName, CollectionBuiltin]\n>\n\nexport const COLLECTION_AUTH_BUILTIN_ENTRIES = Object.entries(COLLECTION_AUTH_BUILTINS) as Array<\n [MCPCollectionAuthToolName, (typeof COLLECTION_AUTH_BUILTINS)[MCPCollectionAuthToolName]]\n>\n\nexport const GLOBAL_BUILTIN_ENTRIES = Object.entries(GLOBAL_BUILTINS) as Array<\n [MCPGlobalBuiltinName, GlobalBuiltin]\n>\n"],"names":["authCollectionTool","forgotPasswordCollectionTool","loginCollectionTool","resetPasswordCollectionTool","unlockCollectionTool","verifyCollectionTool","countDocumentsTool","countVersionsTool","createDocumentsTool","deleteDocumentsTool","duplicateDocumentTool","findDistinctTool","findDocumentsTool","findVersionByIDTool","findVersionsTool","getCollectionSchemaTool","restoreVersionTool","updateDocumentTool","getUploadInstructionsTool","getConfigInfoTool","countGlobalVersionsTool","findGlobalTool","findGlobalVersionByIDTool","findGlobalVersionsTool","getGlobalSchemaTool","restoreGlobalVersionTool","updateGlobalTool","TOOL_BUILTINS","getConfigInfo","mcpName","tool","COLLECTION_BUILTINS","count","countVersions","requiresVersions","create","delete","duplicate","requiresDuplicateEnabled","find","findDistinct","findVersionByID","findVersions","getCollectionSchema","getUploadInstructions","requiresUpload","restoreVersion","update","COLLECTION_AUTH_BUILTINS","auth","forgotPassword","login","resetPassword","unlock","verify","GLOBAL_BUILTINS","countGlobalVersions","findGlobalVersionByID","findGlobalVersions","getGlobalSchema","restoreGlobalVersion","TOOL_BUILTIN_ENTRIES","Object","entries","COLLECTION_BUILTIN_ENTRIES","COLLECTION_AUTH_BUILTIN_ENTRIES","GLOBAL_BUILTIN_ENTRIES"],"mappings":"AAEA,SACEA,kBAAkB,EAClBC,4BAA4B,EAC5BC,mBAAmB,EACnBC,2BAA2B,EAC3BC,oBAAoB,EACpBC,oBAAoB,QACf,qCAAoC;AAC3C,SAASC,kBAAkB,QAAQ,qCAAoC;AACvE,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,mBAAmB,QAAQ,sCAAqC;AACzE,SAASC,qBAAqB,QAAQ,yCAAwC;AAC9E,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,iBAAiB,QAAQ,oCAAmC;AACrE,SAASC,mBAAmB,QAAQ,+CAA8C;AAClF,SAASC,gBAAgB,QAAQ,4CAA2C;AAC5E,SAASC,uBAAuB,QAAQ,mDAAkD;AAC1F,SAASC,kBAAkB,QAAQ,8CAA6C;AAChF,SAASC,kBAAkB,QAAQ,sCAAqC;AACxE,SAASC,yBAAyB,QAAQ,kDAAiD;AAC3F,SAASC,iBAAiB,QAAQ,iCAAgC;AAClE,SAASC,uBAAuB,QAAQ,yCAAwC;AAChF,SAASC,cAAc,QAAQ,gCAA+B;AAC9D,SAASC,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,sBAAsB,QAAQ,wCAAuC;AAC9E,SAASC,mBAAmB,QAAQ,2CAA0C;AAC9E,SAASC,wBAAwB,QAAQ,0CAAyC;AAClF,SAASC,gBAAgB,QAAQ,kCAAiC;AAgBlE,OAAO,MAAMC,gBAAgB;IAC3BC,eAAe;QAAEC,SAAS;QAAiBC,MAAMX;IAAkB;AACrE,EAA2D;AAE3D;;;;CAIC,GACD,OAAO,MAAMY,sBAAsB;IACjCC,OAAO;QAAEH,SAAS;QAAkBC,MAAMxB;IAAmB;IAC7D2B,eAAe;QAAEJ,SAAS;QAAiBK,kBAAkB;QAAMJ,MAAMvB;IAAkB;IAC3F4B,QAAQ;QAAEN,SAAS;QAAmBC,MAAMtB;IAAoB;IAChE4B,QAAQ;QAAEP,SAAS;QAAmBC,MAAMrB;IAAoB;IAChE4B,WAAW;QACTR,SAAS;QACTS,0BAA0B;QAC1BR,MAAMpB;IACR;IACA6B,MAAM;QAAEV,SAAS;QAAiBC,MAAMlB;IAAkB;IAC1D4B,cAAc;QAAEX,SAAS;QAAgBC,MAAMnB;IAAiB;IAChE8B,iBAAiB;QACfZ,SAAS;QACTK,kBAAkB;QAClBJ,MAAMjB;IACR;IACA6B,cAAc;QAAEb,SAAS;QAAgBK,kBAAkB;QAAMJ,MAAMhB;IAAiB;IACxF6B,qBAAqB;QAAEd,SAAS;QAAuBC,MAAMf;IAAwB;IACrF6B,uBAAuB;QACrBf,SAAS;QACTgB,gBAAgB;QAChBf,MAAMZ;IACR;IACA4B,gBAAgB;QAAEjB,SAAS;QAAkBK,kBAAkB;QAAMJ,MAAMd;IAAmB;IAC9F+B,QAAQ;QAAElB,SAAS;QAAkBC,MAAMb;IAAmB;AAChE,EAA6C;AAE7C;;;CAGC,GACD,OAAO,MAAM+B,2BAA2B;IACtCC,MAAM;QAAEpB,SAAS;QAAQC,MAAM9B;IAAmB;IAClDkD,gBAAgB;QACdrB,SAAS;QACTC,MAAM7B;IACR;IACAkD,OAAO;QAAEtB,SAAS;QAASC,MAAM5B;IAAoB;IACrDkD,eAAe;QACbvB,SAAS;QACTC,MAAM3B;IACR;IACAkD,QAAQ;QAAExB,SAAS;QAAUC,MAAM1B;IAAqB;IACxDkD,QAAQ;QAAEzB,SAAS;QAAUC,MAAMzB;IAAqB;AAC1D,EAAqE;AAErE;;;CAGC,GACD,OAAO,MAAMkD,kBAAkB;IAC7BC,qBAAqB;QACnB3B,SAAS;QACTK,kBAAkB;QAClBJ,MAAMV;IACR;IACAmB,MAAM;QAAEV,SAAS;QAAcC,MAAMT;IAAe;IACpDoC,uBAAuB;QACrB5B,SAAS;QACTK,kBAAkB;QAClBJ,MAAMR;IACR;IACAoC,oBAAoB;QAClB7B,SAAS;QACTK,kBAAkB;QAClBJ,MAAMP;IACR;IACAoC,iBAAiB;QAAE9B,SAAS;QAAmBC,MAAMN;IAAoB;IACzEoC,sBAAsB;QACpB/B,SAAS;QACTK,kBAAkB;QAClBJ,MAAML;IACR;IACAsB,QAAQ;QAAElB,SAAS;QAAgBC,MAAMJ;IAAiB;AAC5D,EAAyC;AAUzC;;;;;CAKC,GACD,OAAO,MAAMmC,uBAAuBC,OAAOC,OAAO,CAACpC,eAElD;AAED,OAAO,MAAMqC,6BAA6BF,OAAOC,OAAO,CAAChC,qBAExD;AAED,OAAO,MAAMkC,kCAAkCH,OAAOC,OAAO,CAACf,0BAE7D;AAED,OAAO,MAAMkB,yBAAyBJ,OAAOC,OAAO,CAACR,iBAEpD"}
|
|
@@ -5,7 +5,6 @@ import type { MCPPluginConfig, SanitizedMCPPluginConfig } from '../types.js';
|
|
|
5
5
|
* - Flattens `tools` / `prompts` / `resources` / per-collection / per-global
|
|
6
6
|
* tool maps into a single `items` array.
|
|
7
7
|
* - Applies built-in tools for collections and globals, respecting opt-out user overrides.
|
|
8
|
-
* - Applies the `userCollection` default
|
|
9
8
|
*
|
|
10
9
|
* Called once during plugin init. After that, `plugins['@payloadcms/plugin-mcp']
|
|
11
10
|
* ?.options` holds the sanitized result
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitizeMCPConfig.d.ts","sourceRoot":"","sources":["../../src/mcp/sanitizeMCPConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EAGN,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAMV,eAAe,
|
|
1
|
+
{"version":3,"file":"sanitizeMCPConfig.d.ts","sourceRoot":"","sources":["../../src/mcp/sanitizeMCPConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,MAAM,EAGN,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAMV,eAAe,EACf,wBAAwB,EACzB,MAAM,aAAa,CAAA;AAcpB;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,8BAG3B;IACD,MAAM,EAAE,MAAM,GAAG,eAAe,CAAA;IAChC,YAAY,EAAE,eAAe,CAAA;CAC9B,KAAG,wBA6DH,CAAA"}
|