@strapi/content-manager 5.46.0 → 5.47.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/dist/admin/constants/hooks.js +5 -0
- package/dist/admin/constants/hooks.js.map +1 -1
- package/dist/admin/constants/hooks.mjs +5 -0
- package/dist/admin/constants/hooks.mjs.map +1 -1
- package/dist/admin/history/components/VersionInputRenderer.js +64 -26
- package/dist/admin/history/components/VersionInputRenderer.js.map +1 -1
- package/dist/admin/history/components/VersionInputRenderer.mjs +63 -27
- package/dist/admin/history/components/VersionInputRenderer.mjs.map +1 -1
- package/dist/admin/pages/ComponentConfigurationPage.js +2 -45
- package/dist/admin/pages/ComponentConfigurationPage.js.map +1 -1
- package/dist/admin/pages/ComponentConfigurationPage.mjs +3 -46
- package/dist/admin/pages/ComponentConfigurationPage.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js +4 -4
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs +4 -4
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -1
- package/dist/admin/pages/ListConfiguration/ListConfigurationPage.js +11 -3
- package/dist/admin/pages/ListConfiguration/ListConfigurationPage.js.map +1 -1
- package/dist/admin/pages/ListConfiguration/ListConfigurationPage.mjs +11 -3
- package/dist/admin/pages/ListConfiguration/ListConfigurationPage.mjs.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.js +1 -0
- package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.mjs +1 -0
- package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
- package/dist/admin/pages/ListView/components/Filters.js +38 -4
- package/dist/admin/pages/ListView/components/Filters.js.map +1 -1
- package/dist/admin/pages/ListView/components/Filters.mjs +39 -5
- package/dist/admin/pages/ListView/components/Filters.mjs.map +1 -1
- package/dist/admin/pages/formatComponentConfigurationEditLayout.js +58 -0
- package/dist/admin/pages/formatComponentConfigurationEditLayout.js.map +1 -0
- package/dist/admin/pages/formatComponentConfigurationEditLayout.mjs +56 -0
- package/dist/admin/pages/formatComponentConfigurationEditLayout.mjs.map +1 -0
- package/dist/admin/src/constants/hooks.d.ts +23 -0
- package/dist/admin/src/exports.d.ts +1 -0
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +27 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations/Relations.d.ts +9 -5
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +4 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +38 -6
- package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +27 -5
- package/dist/admin/src/pages/ListView/components/Filters.d.ts +3 -4
- package/dist/admin/src/pages/formatComponentConfigurationEditLayout.d.ts +15 -0
- package/dist/admin/translations/cs.json.js +0 -1
- package/dist/admin/translations/cs.json.js.map +1 -1
- package/dist/admin/translations/cs.json.mjs +0 -1
- package/dist/admin/translations/cs.json.mjs.map +1 -1
- package/dist/admin/translations/de.json.js +0 -1
- package/dist/admin/translations/de.json.js.map +1 -1
- package/dist/admin/translations/de.json.mjs +0 -1
- package/dist/admin/translations/de.json.mjs.map +1 -1
- package/dist/admin/translations/en.json.js +0 -1
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +0 -1
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/translations/es.json.js +0 -1
- package/dist/admin/translations/es.json.js.map +1 -1
- package/dist/admin/translations/es.json.mjs +0 -1
- package/dist/admin/translations/es.json.mjs.map +1 -1
- package/dist/admin/translations/fr.json.js +0 -1
- package/dist/admin/translations/fr.json.js.map +1 -1
- package/dist/admin/translations/fr.json.mjs +0 -1
- package/dist/admin/translations/fr.json.mjs.map +1 -1
- package/dist/admin/translations/nl.json.js +0 -1
- package/dist/admin/translations/nl.json.js.map +1 -1
- package/dist/admin/translations/nl.json.mjs +0 -1
- package/dist/admin/translations/nl.json.mjs.map +1 -1
- package/dist/admin/translations/pl.json.js +0 -1
- package/dist/admin/translations/pl.json.js.map +1 -1
- package/dist/admin/translations/pl.json.mjs +0 -1
- package/dist/admin/translations/pl.json.mjs.map +1 -1
- package/dist/admin/translations/ru.json.js +0 -1
- package/dist/admin/translations/ru.json.js.map +1 -1
- package/dist/admin/translations/ru.json.mjs +0 -1
- package/dist/admin/translations/ru.json.mjs.map +1 -1
- package/dist/admin/translations/sk.json.js +175 -9
- package/dist/admin/translations/sk.json.js.map +1 -1
- package/dist/admin/translations/sk.json.mjs +175 -9
- package/dist/admin/translations/sk.json.mjs.map +1 -1
- package/dist/admin/translations/uk.json.js +0 -1
- package/dist/admin/translations/uk.json.js.map +1 -1
- package/dist/admin/translations/uk.json.mjs +0 -1
- package/dist/admin/translations/uk.json.mjs.map +1 -1
- package/dist/admin/translations/zh-Hans.json.js +0 -1
- package/dist/admin/translations/zh-Hans.json.js.map +1 -1
- package/dist/admin/translations/zh-Hans.json.mjs +0 -1
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -1
- package/dist/server/bootstrap.js +4 -0
- package/dist/server/bootstrap.js.map +1 -1
- package/dist/server/bootstrap.mjs +4 -0
- package/dist/server/bootstrap.mjs.map +1 -1
- package/dist/server/controllers/collection-types.js +9 -5
- package/dist/server/controllers/collection-types.js.map +1 -1
- package/dist/server/controllers/collection-types.mjs +10 -6
- package/dist/server/controllers/collection-types.mjs.map +1 -1
- package/dist/server/mcp/derive-content-type-mcp-tools.js +524 -0
- package/dist/server/mcp/derive-content-type-mcp-tools.js.map +1 -0
- package/dist/server/mcp/derive-content-type-mcp-tools.mjs +518 -0
- package/dist/server/mcp/derive-content-type-mcp-tools.mjs.map +1 -0
- package/dist/server/mcp/handlers/collection-handlers.js +404 -0
- package/dist/server/mcp/handlers/collection-handlers.js.map +1 -0
- package/dist/server/mcp/handlers/collection-handlers.mjs +395 -0
- package/dist/server/mcp/handlers/collection-handlers.mjs.map +1 -0
- package/dist/server/mcp/handlers/constants.js +10 -0
- package/dist/server/mcp/handlers/constants.js.map +1 -0
- package/dist/server/mcp/handlers/constants.mjs +6 -0
- package/dist/server/mcp/handlers/constants.mjs.map +1 -0
- package/dist/server/mcp/handlers/single-type-handlers.js +344 -0
- package/dist/server/mcp/handlers/single-type-handlers.js.map +1 -0
- package/dist/server/mcp/handlers/single-type-handlers.mjs +336 -0
- package/dist/server/mcp/handlers/single-type-handlers.mjs.map +1 -0
- package/dist/server/mcp/permissions.js +138 -0
- package/dist/server/mcp/permissions.js.map +1 -0
- package/dist/server/mcp/permissions.mjs +131 -0
- package/dist/server/mcp/permissions.mjs.map +1 -0
- package/dist/server/mcp/register-content-manager-mcp-tools.js +30 -0
- package/dist/server/mcp/register-content-manager-mcp-tools.js.map +1 -0
- package/dist/server/mcp/register-content-manager-mcp-tools.mjs +28 -0
- package/dist/server/mcp/register-content-manager-mcp-tools.mjs.map +1 -0
- package/dist/server/mcp/schemas/blocks-schema.js +124 -0
- package/dist/server/mcp/schemas/blocks-schema.js.map +1 -0
- package/dist/server/mcp/schemas/blocks-schema.mjs +122 -0
- package/dist/server/mcp/schemas/blocks-schema.mjs.map +1 -0
- package/dist/server/mcp/schemas/data-schema.js +252 -0
- package/dist/server/mcp/schemas/data-schema.js.map +1 -0
- package/dist/server/mcp/schemas/data-schema.mjs +248 -0
- package/dist/server/mcp/schemas/data-schema.mjs.map +1 -0
- package/dist/server/mcp/schemas/filters-schema.js +111 -0
- package/dist/server/mcp/schemas/filters-schema.js.map +1 -0
- package/dist/server/mcp/schemas/filters-schema.mjs +107 -0
- package/dist/server/mcp/schemas/filters-schema.mjs.map +1 -0
- package/dist/server/mcp/schemas/input-schemas.js +18 -0
- package/dist/server/mcp/schemas/input-schemas.js.map +1 -0
- package/dist/server/mcp/schemas/input-schemas.mjs +13 -0
- package/dist/server/mcp/schemas/input-schemas.mjs.map +1 -0
- package/dist/server/mcp/schemas/output-schemas.js +48 -0
- package/dist/server/mcp/schemas/output-schemas.js.map +1 -0
- package/dist/server/mcp/schemas/output-schemas.mjs +44 -0
- package/dist/server/mcp/schemas/output-schemas.mjs.map +1 -0
- package/dist/server/mcp/schemas/sort-schema.js +80 -0
- package/dist/server/mcp/schemas/sort-schema.js.map +1 -0
- package/dist/server/mcp/schemas/sort-schema.mjs +76 -0
- package/dist/server/mcp/schemas/sort-schema.mjs.map +1 -0
- package/dist/server/mcp/utils.js +43 -0
- package/dist/server/mcp/utils.js.map +1 -0
- package/dist/server/mcp/utils.mjs +39 -0
- package/dist/server/mcp/utils.mjs.map +1 -0
- package/dist/server/services/index.js +1 -1
- package/dist/server/services/index.js.map +1 -1
- package/dist/server/services/permission-checker.js +4 -1
- package/dist/server/services/permission-checker.js.map +1 -1
- package/dist/server/services/permission-checker.mjs +1 -1
- package/dist/server/services/permission-checker.mjs.map +1 -1
- package/dist/server/services/utils/populate.js +3 -3
- package/dist/server/services/utils/populate.js.map +1 -1
- package/dist/server/services/utils/populate.mjs +3 -3
- package/dist/server/services/utils/populate.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +3 -3
- package/dist/server/src/mcp/derive-content-type-mcp-tools.d.ts +12 -0
- package/dist/server/src/mcp/derive-content-type-mcp-tools.d.ts.map +1 -0
- package/dist/server/src/mcp/handlers/collection-handlers.d.ts +69 -0
- package/dist/server/src/mcp/handlers/collection-handlers.d.ts.map +1 -0
- package/dist/server/src/mcp/handlers/constants.d.ts +4 -0
- package/dist/server/src/mcp/handlers/constants.d.ts.map +1 -0
- package/dist/server/src/mcp/handlers/index.d.ts +3 -0
- package/dist/server/src/mcp/handlers/index.d.ts.map +1 -0
- package/dist/server/src/mcp/handlers/single-type-handlers.d.ts +66 -0
- package/dist/server/src/mcp/handlers/single-type-handlers.d.ts.map +1 -0
- package/dist/server/src/mcp/permissions.d.ts +49 -0
- package/dist/server/src/mcp/permissions.d.ts.map +1 -0
- package/dist/server/src/mcp/register-content-manager-mcp-tools.d.ts +8 -0
- package/dist/server/src/mcp/register-content-manager-mcp-tools.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/blocks-schema.d.ts +8 -0
- package/dist/server/src/mcp/schemas/blocks-schema.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/data-schema.d.ts +36 -0
- package/dist/server/src/mcp/schemas/data-schema.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/filters-schema.d.ts +22 -0
- package/dist/server/src/mcp/schemas/filters-schema.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/index.d.ts +7 -0
- package/dist/server/src/mcp/schemas/index.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/input-schemas.d.ts +10 -0
- package/dist/server/src/mcp/schemas/input-schemas.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/output-schemas.d.ts +18 -0
- package/dist/server/src/mcp/schemas/output-schemas.d.ts.map +1 -0
- package/dist/server/src/mcp/schemas/sort-schema.d.ts +24 -0
- package/dist/server/src/mcp/schemas/sort-schema.d.ts.map +1 -0
- package/dist/server/src/mcp/types.d.ts +31 -0
- package/dist/server/src/mcp/types.d.ts.map +1 -0
- package/dist/server/src/mcp/utils.d.ts +21 -0
- package/dist/server/src/mcp/utils.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +3 -3
- package/dist/server/src/services/permission-checker.d.ts +13 -3
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +10 -8
|
@@ -284,19 +284,19 @@ declare const _default: () => {
|
|
|
284
284
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
285
285
|
}) => {
|
|
286
286
|
create: ({ userAbility, model }: {
|
|
287
|
-
userAbility: any
|
|
287
|
+
userAbility: import("@casl/ability").Ability<import("@casl/ability").AbilityTuple, any>;
|
|
288
288
|
model: string;
|
|
289
289
|
}) => {
|
|
290
290
|
can: (action: string, entity?: ({
|
|
291
291
|
id: import("@strapi/types/dist/data").ID;
|
|
292
292
|
} & {
|
|
293
293
|
[key: string]: any;
|
|
294
|
-
}) | undefined, field: string) =>
|
|
294
|
+
}) | undefined, field: string) => boolean;
|
|
295
295
|
cannot: (action: string, entity?: ({
|
|
296
296
|
id: import("@strapi/types/dist/data").ID;
|
|
297
297
|
} & {
|
|
298
298
|
[key: string]: any;
|
|
299
|
-
}) | undefined, field: string) =>
|
|
299
|
+
}) | undefined, field: string) => boolean;
|
|
300
300
|
requiresEntity: (action: string) => boolean;
|
|
301
301
|
sanitizeOutput: (data: {
|
|
302
302
|
id: import("@strapi/types/dist/data").ID;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Core } from '@strapi/types';
|
|
2
|
+
import type { ContentManagerModelForMcp, McpToolsBuildContext, DerivedTool } from './types';
|
|
3
|
+
export type { ContentManagerModelForMcp };
|
|
4
|
+
export { slugifyUidForMcpToolName } from './utils';
|
|
5
|
+
export { buildSortSchema, buildFiltersSchema, buildDataSchema } from './schemas';
|
|
6
|
+
export { getComponentLeafPaths } from './permissions';
|
|
7
|
+
/**
|
|
8
|
+
* Builds MCP tool definitions for displayed content-manager models.
|
|
9
|
+
* Visibility is enforced separately via static auth on each tool and MCP session capability sync.
|
|
10
|
+
*/
|
|
11
|
+
export declare const deriveDisplayedContentTypeMcpToolDefinitions: (strapi: Core.Strapi, models: ContentManagerModelForMcp[], ctx?: McpToolsBuildContext) => DerivedTool[];
|
|
12
|
+
//# sourceMappingURL=derive-content-type-mcp-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive-content-type-mcp-tools.d.ts","sourceRoot":"","sources":["../../../../server/src/mcp/derive-content-type-mcp-tools.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAIxD,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAmC5F,YAAY,EAAE,yBAAyB,EAAE,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AA2dtD;;;GAGG;AACH,eAAO,MAAM,4CAA4C,WAC/C,KAAK,MAAM,UACX,yBAAyB,EAAE,QAC9B,oBAAoB,KACxB,WAAW,EAYb,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Core, Modules, UID } from '@strapi/types';
|
|
2
|
+
type CollectionListArgs = {
|
|
3
|
+
locale?: string;
|
|
4
|
+
status?: 'draft' | 'published';
|
|
5
|
+
page?: number;
|
|
6
|
+
pageSize?: number;
|
|
7
|
+
sort?: unknown;
|
|
8
|
+
filters?: unknown;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Creates a handler for listing (paginated) documents of a collection-type.
|
|
12
|
+
* Enforces RBAC read permission and sanitizes query + output via permissionChecker.
|
|
13
|
+
*/
|
|
14
|
+
export declare const createCollectionListHandler: (uid: UID.CollectionType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args }: {
|
|
15
|
+
args: CollectionListArgs;
|
|
16
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a handler for fetching a single collection-type document by `documentId`.
|
|
19
|
+
* Enforces RBAC read permission; returns available locale metadata when the locale is missing.
|
|
20
|
+
*/
|
|
21
|
+
export declare const createCollectionGetHandler: (uid: UID.CollectionType) => (_strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
22
|
+
args: Record<string, unknown>;
|
|
23
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a handler for creating a new collection-type document.
|
|
26
|
+
* Enforces RBAC create permission; sanitizes input and stamps creator fields.
|
|
27
|
+
*/
|
|
28
|
+
export declare const createCollectionCreateHandler: (uid: UID.CollectionType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
29
|
+
args: Record<string, unknown>;
|
|
30
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a handler for updating an existing collection-type document draft.
|
|
33
|
+
* Creates a new locale version when the target locale does not yet exist for the document.
|
|
34
|
+
* Enforces RBAC update (or create) permission accordingly.
|
|
35
|
+
*/
|
|
36
|
+
export declare const createCollectionUpdateHandler: (uid: UID.CollectionType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
37
|
+
args: Record<string, unknown>;
|
|
38
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a handler for deleting a collection-type document (or a specific locale).
|
|
41
|
+
* Enforces RBAC delete permission on every locale version before deletion.
|
|
42
|
+
*/
|
|
43
|
+
export declare const createCollectionDeleteHandler: (uid: UID.CollectionType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
44
|
+
args: Record<string, unknown>;
|
|
45
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates a handler for publishing a collection-type document draft.
|
|
48
|
+
* Enforces RBAC publish permission; throws NotFound when the draft or document is missing.
|
|
49
|
+
*/
|
|
50
|
+
export declare const createCollectionPublishHandler: (uid: UID.CollectionType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
51
|
+
args: Record<string, unknown>;
|
|
52
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a handler for unpublishing a collection-type document.
|
|
55
|
+
* Optionally discards the draft in the same transaction when `discardDraft` is true.
|
|
56
|
+
* Enforces RBAC unpublish (and discard) permission.
|
|
57
|
+
*/
|
|
58
|
+
export declare const createCollectionUnpublishHandler: (uid: UID.CollectionType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
59
|
+
args: Record<string, unknown>;
|
|
60
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a handler for discarding the draft of a collection-type document.
|
|
63
|
+
* Restores the published version as the draft. Enforces RBAC discard permission.
|
|
64
|
+
*/
|
|
65
|
+
export declare const createCollectionDiscardDraftHandler: (uid: UID.CollectionType) => (_strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
66
|
+
args: Record<string, unknown>;
|
|
67
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=collection-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-handlers.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/handlers/collection-handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AA+BxD,KAAK,kBAAkB,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA4BF;;;GAGG;AACH,eAAO,MA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GzD;IACD,IAAI,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,KAAG,QAAQ,QAAQ,GAAG,CAAC,oBAAoB,CA+C3C,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,QACrC,IAAI,cAAc,cACf,KAAK,MAAM,WAAW,QAAQ,GAAG,CAAC,iBAAiB,iBAGzD;IACD,IAAI,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,KAAG,QAAQ,QAAQ,GAAG,CAAC,oBAAoB,CAoD3C,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,mCAAmC,QACxC,IAAI,cAAc,eACd,KAAK,MAAM,WAAW,QAAQ,GAAG,CAAC,iBAAiB,iBAG1D;IACD,IAAI,EAAE,OAAO,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B,KAAG,QAAQ,QAAQ,GAAG,CAAC,oBAAoB,CAuC3C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const MCP_NOT_FOUND_DOCUMENT = "Document not found.";
|
|
2
|
+
export declare const MCP_NOT_FOUND_LOCALE = "Document locale not found.";
|
|
3
|
+
export declare const MCP_NOT_FOUND_OR_PUBLISHED = "Document not found or already published.";
|
|
4
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/handlers/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAC5D,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AACjE,eAAO,MAAM,0BAA0B,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { createCollectionListHandler, createCollectionGetHandler, createCollectionCreateHandler, createCollectionUpdateHandler, createCollectionDeleteHandler, createCollectionPublishHandler, createCollectionUnpublishHandler, createCollectionDiscardDraftHandler, } from './collection-handlers';
|
|
2
|
+
export { singleCreateOrUpdate, createSingleGetHandler, createSingleWriteHandler, createSingleDeleteHandler, createSinglePublishHandler, createSingleUnpublishHandler, createSingleDiscardDraftHandler, } from './single-type-handlers';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/handlers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,EAC9B,gCAAgC,EAChC,mCAAmC,GACpC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,4BAA4B,EAC5B,+BAA+B,GAChC,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Core, Modules, UID } from '@strapi/types';
|
|
2
|
+
type SingleLocaleArgs = {
|
|
3
|
+
locale?: string;
|
|
4
|
+
};
|
|
5
|
+
type SingleGetArgs = SingleLocaleArgs & {
|
|
6
|
+
status?: 'draft' | 'published';
|
|
7
|
+
};
|
|
8
|
+
type SingleUnpublishArgs = SingleLocaleArgs & {
|
|
9
|
+
discardDraft?: boolean;
|
|
10
|
+
};
|
|
11
|
+
type SingleWriteArgs = {
|
|
12
|
+
data: Record<string, unknown>;
|
|
13
|
+
locale?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Core write logic shared by the single-type write handler.
|
|
17
|
+
* Creates the document when none exists; updates the existing draft otherwise.
|
|
18
|
+
* Enforces RBAC create/update permission and sanitizes input + output.
|
|
19
|
+
*/
|
|
20
|
+
export declare const singleCreateOrUpdate: (strapi: Core.Strapi, uid: UID.SingleType, context: Modules.MCP.McpHandlerContext, args: SingleWriteArgs) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
21
|
+
/**
|
|
22
|
+
* Creates a handler for reading the single-type document.
|
|
23
|
+
* Returns available locale metadata when the requested locale version does not exist.
|
|
24
|
+
* Enforces RBAC read permission.
|
|
25
|
+
*/
|
|
26
|
+
export declare const createSingleGetHandler: (uid: UID.SingleType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args }: {
|
|
27
|
+
args: SingleGetArgs;
|
|
28
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a handler for creating or updating the single-type document.
|
|
31
|
+
* Delegates to `singleCreateOrUpdate`; enforces RBAC create/update permission.
|
|
32
|
+
*/
|
|
33
|
+
export declare const createSingleWriteHandler: (uid: UID.SingleType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args, }: {
|
|
34
|
+
args: Record<string, unknown>;
|
|
35
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a handler for deleting the single-type document (or a specific locale).
|
|
38
|
+
* Enforces RBAC delete permission on every locale version before deletion.
|
|
39
|
+
*/
|
|
40
|
+
export declare const createSingleDeleteHandler: (uid: UID.SingleType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args }: {
|
|
41
|
+
args: SingleLocaleArgs;
|
|
42
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
43
|
+
/**
|
|
44
|
+
* Creates a handler for publishing the single-type document draft.
|
|
45
|
+
* Enforces RBAC publish permission; throws NotFound when the draft is missing.
|
|
46
|
+
*/
|
|
47
|
+
export declare const createSinglePublishHandler: (uid: UID.SingleType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args }: {
|
|
48
|
+
args: SingleLocaleArgs;
|
|
49
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
50
|
+
/**
|
|
51
|
+
* Creates a handler for unpublishing the single-type document.
|
|
52
|
+
* Optionally discards the draft in the same transaction when `discardDraft` is true.
|
|
53
|
+
* Enforces RBAC unpublish (and discard) permission.
|
|
54
|
+
*/
|
|
55
|
+
export declare const createSingleUnpublishHandler: (uid: UID.SingleType) => (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args }: {
|
|
56
|
+
args: SingleUnpublishArgs;
|
|
57
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a handler for discarding the draft of the single-type document.
|
|
60
|
+
* Restores the published version as the draft. Enforces RBAC discard permission.
|
|
61
|
+
*/
|
|
62
|
+
export declare const createSingleDiscardDraftHandler: (uid: UID.SingleType) => (_strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext) => ({ args }: {
|
|
63
|
+
args: SingleLocaleArgs;
|
|
64
|
+
}) => Promise<Modules.MCP.McpToolHandlerReturn>;
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=single-type-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-type-handlers.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/handlers/single-type-handlers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AA0BxD,KAAK,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC5C,KAAK,aAAa,GAAG,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,GAAG,WAAW,CAAA;CAAE,CAAC;AAC3E,KAAK,mBAAmB,GAAG,gBAAgB,GAAG;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AACzE,KAAK,eAAe,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AA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,oBAAoB,CAwDxF,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,+BAA+B,QACpC,IAAI,UAAU,eACV,KAAK,MAAM,WAAW,QAAQ,GAAG,CAAC,iBAAiB,gBAC5C;IAAE,IAAI,EAAE,gBAAgB,CAAA;CAAE,KAAG,QAAQ,QAAQ,GAAG,CAAC,oBAAoB,CA4CrF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
import type { Core, Modules, Struct } from '@strapi/types';
|
|
3
|
+
import type { ContentManagerModelForMcp } from './types';
|
|
4
|
+
/** Returns true if the content type identified by `uid` has the i18n `localized` plugin option enabled. */
|
|
5
|
+
export declare const isContentTypeLocalized: (strapi: Core.Strapi, uid: string) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Builds the base locale Zod schema for a derived MCP tool input.
|
|
8
|
+
* When `localeCodes` is provided, constrains the field to a `z.enum` of available codes
|
|
9
|
+
* with an optional default; otherwise falls back to a plain optional string.
|
|
10
|
+
*/
|
|
11
|
+
export declare const buildLocaleSchema: (localeCodes: [string, ...string[]] | null, defaultLocale: string | null) => z.ZodTypeAny;
|
|
12
|
+
/**
|
|
13
|
+
* Narrows the base locale schema to only locales the session is permitted to access
|
|
14
|
+
* for the given action + uid combination.
|
|
15
|
+
*
|
|
16
|
+
* Returns the base schema unchanged when:
|
|
17
|
+
* - localeCodes is null (i18n not installed)
|
|
18
|
+
* - the content type is not localized
|
|
19
|
+
* - all installed locales are permitted for this action
|
|
20
|
+
*
|
|
21
|
+
* Returns z.never().optional() when no locales are permitted, keeping the tool
|
|
22
|
+
* registered but signalling no valid locale input.
|
|
23
|
+
*/
|
|
24
|
+
export declare const resolvePermittedLocaleSchema: (strapi: Core.Strapi, context: Modules.MCP.McpHandlerContext, action: string, uid: string, localeCodes: [string, ...string[]] | null, defaultLocale: string | null, baseLocaleSchema: z.ZodTypeAny) => z.ZodTypeAny;
|
|
25
|
+
/**
|
|
26
|
+
* Recursively resolves leaf field paths for a component, matching the nested
|
|
27
|
+
* path format used by CASL rules (e.g. 'SEO.title', 'SEO.og.image').
|
|
28
|
+
*
|
|
29
|
+
* The admin RBAC system decomposes component attrs into nested paths and removes
|
|
30
|
+
* the parent key — so checking `ability.can(action, uid, 'SEO')` returns false
|
|
31
|
+
* even when the user has full access to the component's sub-fields.
|
|
32
|
+
*/
|
|
33
|
+
export declare const getComponentLeafPaths: (strapi: Core.Strapi, componentUid: string, prefix: string, visited?: Set<string>) => string[];
|
|
34
|
+
/**
|
|
35
|
+
* Returns the subset of attribute keys the session may access for `action` on `uid`.
|
|
36
|
+
* Returns `null` when all fields are permitted (caller should skip field filtering).
|
|
37
|
+
* Component attributes are resolved to their nested leaf paths before checking CASL rules.
|
|
38
|
+
*/
|
|
39
|
+
export declare const getPermittedFields: (strapi: Core.Strapi, userAbility: Modules.MCP.McpHandlerContext['userAbility'], action: string, uid: string, attributes: Struct.SchemaAttributes) => Set<string> | null;
|
|
40
|
+
/**
|
|
41
|
+
* Filters `localeCodes` to only those the session may access for `action`.
|
|
42
|
+
* Returns `null` when all locales are permitted (caller should use the unfiltered base schema).
|
|
43
|
+
* Returns an empty tuple-like array when no locale is permitted.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getPermittedLocales: (permissionChecker: {
|
|
46
|
+
cannot: (action: string, entity?: unknown) => boolean;
|
|
47
|
+
}, action: string, localeCodes: [string, ...string[]]) => [string, ...string[]] | null;
|
|
48
|
+
export type { ContentManagerModelForMcp };
|
|
49
|
+
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../../server/src/mcp/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAO,MAAM,eAAe,CAAC;AAGhE,OAAO,K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core } from '@strapi/types';
|
|
2
|
+
/**
|
|
3
|
+
* Registers derived content-type MCP tools during plugin bootstrap, before the MCP HTTP server starts.
|
|
4
|
+
*/
|
|
5
|
+
export declare const registerContentManagerMcpTools: ({ strapi, }: {
|
|
6
|
+
strapi: Core.Strapi;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
//# sourceMappingURL=register-content-manager-mcp-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-content-manager-mcp-tools.d.ts","sourceRoot":"","sources":["../../../../server/src/mcp/register-content-manager-mcp-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C;;GAEG;AACH,eAAO,MAAM,8BAA8B,gBAExC;IACD,MAAM,EAAE,KAAK,MAAM,CAAC;CACrB,KAAG,QAAQ,IAAI,CAyBf,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the Zod schema for a Strapi Blocks (rich-text) field input.
|
|
4
|
+
* Accepts an array of block nodes — paragraph, heading, quote, code, image, and list —
|
|
5
|
+
* matching Strapi's internal blocks data model.
|
|
6
|
+
*/
|
|
7
|
+
export declare const buildBlocksInputSchema: () => z.ZodArray<z.ZodTypeAny>;
|
|
8
|
+
//# sourceMappingURL=blocks-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks-schema.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/blocks-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAgIlC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAO,EAAE,QAAQ,CAAC,EAAE,UAAU,CAOkB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
import type { Core, Schema, Struct } from '@strapi/types';
|
|
3
|
+
import type { ContentManagerModelForMcp } from '../types';
|
|
4
|
+
/**
|
|
5
|
+
* Builds a structured Zod object schema for a Strapi component UID.
|
|
6
|
+
* Declared as a regular function so it is hoisted above `attributeToInputSchema`
|
|
7
|
+
* — the two functions are mutually recursive (component attrs recurse into
|
|
8
|
+
* attributeToInputSchema; attributeToInputSchema calls this for 'component' cases).
|
|
9
|
+
*
|
|
10
|
+
* @param strapi - Strapi instance (components registry available post-load).
|
|
11
|
+
* @param componentUid - e.g. "common.seo".
|
|
12
|
+
* @param visited - cycle-guard; prevents infinite recursion on self-referencing components.
|
|
13
|
+
*/
|
|
14
|
+
export declare function buildComponentInputSchema(strapi: Core.Strapi, componentUid: string, visited?: Set<string>): z.ZodTypeAny;
|
|
15
|
+
/**
|
|
16
|
+
* Maps a single Strapi attribute to a Zod input schema, carrying constraints
|
|
17
|
+
* (min, max, minLength, maxLength, required, enum values, etc.).
|
|
18
|
+
*
|
|
19
|
+
* Mirrors the `mapAttributeToInputSchema` logic from
|
|
20
|
+
* `packages/core/core/src/core-api/routes/validation/mappers.ts` — kept inline
|
|
21
|
+
* here to avoid a cross-package import from @strapi/content-manager into
|
|
22
|
+
* @strapi/core (which is not a listed dependency).
|
|
23
|
+
*
|
|
24
|
+
* TODO — custom fields call `strapi.get('custom-fields')` at schema-build
|
|
25
|
+
* time; confirm with an integration test that the registry is populated when MCP
|
|
26
|
+
* tools are registered (post-bootstrap).
|
|
27
|
+
*/
|
|
28
|
+
export declare const attributeToInputSchema: (strapi: Core.Strapi, attr: Schema.Attribute.AnyAttribute, visited?: Set<string>) => z.ZodTypeAny;
|
|
29
|
+
/**
|
|
30
|
+
* Derives a per-content-type `data` Zod schema from the model's writable attributes.
|
|
31
|
+
* Uses `contentTypes.isWritableAttribute` to filter system-managed keys
|
|
32
|
+
* (id, documentId, timestamps, createdBy, updatedBy, localizations, locale, etc.).
|
|
33
|
+
* Unknown keys are rejected (strict mode) — invalid field names fail at the MCP boundary.
|
|
34
|
+
*/
|
|
35
|
+
export declare const buildDataSchema: (strapi: Core.Strapi, schema: Struct.ContentTypeSchema | ContentManagerModelForMcp, attributes: Struct.SchemaAttributes, permittedFields?: Set<string> | null) => z.ZodTypeAny;
|
|
36
|
+
//# sourceMappingURL=data-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-schema.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/data-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,CAAC,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG1D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAc1D;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,CAAC,CAAC,UAAU,CA2Bd;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,WACzB,KAAK,MAAM,QACb,OAAO,SAAS,CAAC,YAAY,YAC1B,IAAI,MAAM,CAAC,KACnB,EAAE,UAiNJ,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,WAClB,KAAK,MAAM,UACX,OAAO,iBAAiB,GAAG,yBAAyB,cAChD,OAAO,gBAAgB,oBACjB,IAAI,MAAM,CAAC,GAAG,IAAI,KACnC,EAAE,UAmBJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
import type { Schema, Struct } from '@strapi/types';
|
|
3
|
+
/**
|
|
4
|
+
* Maps a scalar Strapi attribute type to the appropriate Zod leaf value schema
|
|
5
|
+
* used inside filter operator objects (e.g. { $eq: <value> }).
|
|
6
|
+
*/
|
|
7
|
+
export declare const attributeTypeToFilterValue: (attr: Schema.Attribute.AnyAttribute) => z.ZodTypeAny;
|
|
8
|
+
/** All supported Strapi filter operators (excludes the experimental `$jsonSupersetOf`). */
|
|
9
|
+
export declare const FILTER_OPERATORS: readonly ["$eq", "$eqi", "$ne", "$nei", "$in", "$notIn", "$lt", "$lte", "$gt", "$gte", "$between", "$contains", "$notContains", "$containsi", "$notContainsi", "$startsWith", "$startsWithi", "$endsWith", "$endsWithi", "$null", "$notNull"];
|
|
10
|
+
/**
|
|
11
|
+
* Builds a per-content-type recursive filters Zod schema.
|
|
12
|
+
*
|
|
13
|
+
* Shape:
|
|
14
|
+
* - Logical operators: $and, $or accept an array of filter objects.
|
|
15
|
+
* - Logical operator: $not accepts a single filter object.
|
|
16
|
+
* - Field keys (scalar attrs only): accept either a direct value (implicit $eq)
|
|
17
|
+
* or an operator object { $eq, $contains, $gt, … }.
|
|
18
|
+
*
|
|
19
|
+
* If the model has no scalar attributes, the schema is z.never() (filters not allowed).
|
|
20
|
+
*/
|
|
21
|
+
export declare const buildFiltersSchema: (attributes: Struct.SchemaAttributes, permittedFields?: Set<string> | null) => z.ZodTypeAny;
|
|
22
|
+
//# sourceMappingURL=filters-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-schema.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/filters-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAGpD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,SAAU,OAAO,SAAS,CAAC,YAAY,KAAG,EAAE,UAuBlF,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,+OAsBnB,CAAC;AAEX;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,eACjB,OAAO,gBAAgB,oBACjB,IAAI,MAAM,CAAC,GAAG,IAAI,KACnC,EAAE,UAqCJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { buildBlocksInputSchema } from './blocks-schema';
|
|
2
|
+
export { localeSchema, statusSchema, documentIdSchema, pageSchema, pageSizeSchema, } from './input-schemas';
|
|
3
|
+
export { buildDataSchema, buildComponentInputSchema, attributeToInputSchema } from './data-schema';
|
|
4
|
+
export { buildSortSchema, getScalarAttributeKeys, SCALAR_ATTRIBUTE_TYPES } from './sort-schema';
|
|
5
|
+
export { buildFiltersSchema, FILTER_OPERATORS, attributeTypeToFilterValue } from './filters-schema';
|
|
6
|
+
export { buildDocumentOutputSchema, buildListOutputSchema, buildDeleteOutputSchema, } from './output-schemas';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,GACf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
export declare const localeSchema: z.ZodOptional<z.ZodString>;
|
|
3
|
+
export declare const statusSchema: z.ZodOptional<z.ZodEnum<{
|
|
4
|
+
draft: "draft";
|
|
5
|
+
published: "published";
|
|
6
|
+
}>>;
|
|
7
|
+
export declare const documentIdSchema: z.ZodString;
|
|
8
|
+
export declare const pageSchema: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
export declare const pageSizeSchema: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
//# sourceMappingURL=input-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-schemas.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/input-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElC,eAAO,MAAM,YAAY,4BAGoD,CAAC;AAE9E,eAAO,MAAM,YAAY;;;GAG2D,CAAC;AAErF,eAAO,MAAM,gBAAgB,aAK1B,CAAC;AAEJ,eAAO,MAAM,UAAU,4BAK4B,CAAC;AAEpD,eAAO,MAAM,cAAc,4BAM2B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
import type { Struct } from '@strapi/types';
|
|
3
|
+
/**
|
|
4
|
+
* Builds the MCP output schema for a single-document response (`{ data, meta }`).
|
|
5
|
+
* Field shape is constrained to `readFields` when non-null (RBAC field filtering).
|
|
6
|
+
*/
|
|
7
|
+
export declare const buildDocumentOutputSchema: (attributes: Struct.SchemaAttributes, readFields: Set<string> | null) => z.ZodObject<z.ZodRawShape>;
|
|
8
|
+
/**
|
|
9
|
+
* Builds the MCP output schema for a paginated list response (`{ results, pagination }`).
|
|
10
|
+
* Field shape is constrained to `readFields` when non-null (RBAC field filtering).
|
|
11
|
+
*/
|
|
12
|
+
export declare const buildListOutputSchema: (attributes: Struct.SchemaAttributes, readFields: Set<string> | null) => z.ZodObject<z.ZodRawShape>;
|
|
13
|
+
/**
|
|
14
|
+
* Builds the MCP output schema for a delete response (`{ data }`).
|
|
15
|
+
* Field shape is constrained to `readFields` when non-null (RBAC field filtering).
|
|
16
|
+
*/
|
|
17
|
+
export declare const buildDeleteOutputSchema: (attributes: Struct.SchemaAttributes, readFields: Set<string> | null) => z.ZodObject<z.ZodRawShape>;
|
|
18
|
+
//# sourceMappingURL=output-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-schemas.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/output-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAmB5C;;;GAGG;AACH,eAAO,MAAM,yBAAyB,eACxB,OAAO,gBAAgB,cACvB,IAAI,MAAM,CAAC,GAAG,IAAI,KAC7B,EAAE,SAAS,CAAC,EAAE,WAAW,CAWhB,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,qBAAqB,eACpB,OAAO,gBAAgB,cACvB,IAAI,MAAM,CAAC,GAAG,IAAI,KAC7B,EAAE,SAAS,CAAC,EAAE,WAAW,CAWhB,CAAC;AAEb;;;GAGG;AACH,eAAO,MAAM,uBAAuB,eACtB,OAAO,gBAAgB,cACvB,IAAI,MAAM,CAAC,GAAG,IAAI,KAC7B,EAAE,SAAS,CAAC,EAAE,WAAW,CAKhB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from '@strapi/utils';
|
|
2
|
+
import type { Struct } from '@strapi/types';
|
|
3
|
+
/** Attribute types considered scalar for sorting and filtering (excludes relations, components, media, json, blocks). */
|
|
4
|
+
export declare const SCALAR_ATTRIBUTE_TYPES: Set<string>;
|
|
5
|
+
/**
|
|
6
|
+
* Returns the list of scalar attribute keys from a content type's attributes.
|
|
7
|
+
* Relation, component, dynamiczone, media, json, and blocks are excluded because
|
|
8
|
+
* they cannot be meaningfully sorted or filtered via simple operators.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getScalarAttributeKeys: (attributes: Struct.SchemaAttributes, permittedFields?: Set<string> | null) => string[];
|
|
11
|
+
/**
|
|
12
|
+
* Builds a per-content-type sort Zod schema constrained to the model's scalar fields.
|
|
13
|
+
*
|
|
14
|
+
* Supports all four Strapi sort notations:
|
|
15
|
+
* - string: "title:asc"
|
|
16
|
+
* - string[]: ["title:asc", "createdAt:desc"]
|
|
17
|
+
* - object: { title: "asc" }
|
|
18
|
+
* - object[]: [{ title: "asc" }, { createdAt: "desc" }]
|
|
19
|
+
*
|
|
20
|
+
* Object forms have their keys constrained to known scalar attribute names.
|
|
21
|
+
* If the model has no scalar attributes, the schema is z.never() (sort not allowed).
|
|
22
|
+
*/
|
|
23
|
+
export declare const buildSortSchema: (attributes: Struct.SchemaAttributes, permittedFields?: Set<string> | null) => z.ZodTypeAny;
|
|
24
|
+
//# sourceMappingURL=sort-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sort-schema.d.ts","sourceRoot":"","sources":["../../../../../server/src/mcp/schemas/sort-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,aAiBjC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,eACrB,OAAO,gBAAgB,oBACjB,IAAI,MAAM,CAAC,GAAG,IAAI,KACnC,MAAM,EAaR,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,eAAe,eACd,OAAO,gBAAgB,oBACjB,IAAI,MAAM,CAAC,GAAG,IAAI,KACnC,EAAE,UAqCJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Struct, Modules } from '@strapi/types';
|
|
2
|
+
import type { z } from '@strapi/utils';
|
|
3
|
+
export type ContentManagerModelForMcp = Pick<Struct.ContentTypeSchema, 'uid' | 'kind' | 'options'> & {
|
|
4
|
+
/** Present on content-manager DTOs from data-mapper.toContentManagerModel */
|
|
5
|
+
apiID: string;
|
|
6
|
+
/**
|
|
7
|
+
* Formatted attributes from data-mapper.toContentManagerModel (includes id, documentId,
|
|
8
|
+
* timestamps, creator fields).
|
|
9
|
+
*/
|
|
10
|
+
attributes: Struct.SchemaAttributes;
|
|
11
|
+
};
|
|
12
|
+
export type McpToolsBuildContext = {
|
|
13
|
+
/** Installed locale codes from i18n plugin. null when i18n is not installed. */
|
|
14
|
+
localeCodes: [string, ...string[]] | null;
|
|
15
|
+
/** Default locale from i18n plugin. null when i18n is not installed or unknown. */
|
|
16
|
+
defaultLocale: string | null;
|
|
17
|
+
};
|
|
18
|
+
export type DerivedTool = {
|
|
19
|
+
name: string;
|
|
20
|
+
telemetry: {
|
|
21
|
+
source: 'content-manager';
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
auth: Modules.MCP.McpCapabilityAuth;
|
|
27
|
+
resolveInputSchema: (context: Modules.MCP.McpHandlerContext) => z.ZodObject<z.ZodRawShape>;
|
|
28
|
+
resolveOutputSchema: (context: Modules.MCP.McpHandlerContext) => z.ZodObject<z.ZodRawShape>;
|
|
29
|
+
createHandler: (strapi: import('@strapi/types').Core.Strapi, context: Modules.MCP.McpHandlerContext) => Modules.MCP.McpToolHandler<z.ZodObject<z.ZodRawShape>, z.ZodObject<z.ZodRawShape>>;
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../server/src/mcp/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAEvC,MAAM,MAAM,yBAAyB,GAAG,IAAI,CA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
|
|
|
1
|
+
import type { Modules } from '@strapi/types';
|
|
2
|
+
/**
|
|
3
|
+
* Converts a Strapi content-type UID into a safe MCP tool-name segment.
|
|
4
|
+
* `api::article.article` → `article`; `plugin::i18n.locale` → `plugin-i18n_locale`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const slugifyUidForMcpToolName: (uid: string) => string;
|
|
7
|
+
/** Wraps a plain object into the dual-representation MCP tool return value (text + structuredContent). */
|
|
8
|
+
export declare const ok: (structuredContent: Record<string, unknown>) => Modules.MCP.McpToolHandlerReturn;
|
|
9
|
+
/**
|
|
10
|
+
* Generates the `title` and `description` metadata for a derived MCP tool.
|
|
11
|
+
* Appends operation-specific notes for write/publish/unpublish/discard_draft operations.
|
|
12
|
+
*/
|
|
13
|
+
export declare const describeTool: (params: {
|
|
14
|
+
apiID: string;
|
|
15
|
+
uid: string;
|
|
16
|
+
operation: string;
|
|
17
|
+
}) => {
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../server/src/mcp/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,MAOtD,CAAC;AAEF,0GAA0G;AAC1G,eAAO,MAAM,EAAE,sBACM,OAAO,MAAM,EAAE,OAAO,CAAC,KACzC,QAAQ,GAAG,CAAC,oBAGb,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,YAAY,WAAY;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,KAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAiBvC,CAAC"}
|
|
@@ -175,19 +175,19 @@ declare const _default: {
|
|
|
175
175
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
176
176
|
}) => {
|
|
177
177
|
create: ({ userAbility, model }: {
|
|
178
|
-
userAbility: any
|
|
178
|
+
userAbility: import("@casl/ability").Ability<import("@casl/ability").AbilityTuple, any>;
|
|
179
179
|
model: string;
|
|
180
180
|
}) => {
|
|
181
181
|
can: (action: string, entity?: ({
|
|
182
182
|
id: import("@strapi/types/dist/data").ID;
|
|
183
183
|
} & {
|
|
184
184
|
[key: string]: any;
|
|
185
|
-
}) | undefined, field: string) =>
|
|
185
|
+
}) | undefined, field: string) => boolean;
|
|
186
186
|
cannot: (action: string, entity?: ({
|
|
187
187
|
id: import("@strapi/types/dist/data").ID;
|
|
188
188
|
} & {
|
|
189
189
|
[key: string]: any;
|
|
190
|
-
}) | undefined, field: string) =>
|
|
190
|
+
}) | undefined, field: string) => boolean;
|
|
191
191
|
requiresEntity: (action: string) => boolean;
|
|
192
192
|
sanitizeOutput: (data: {
|
|
193
193
|
id: import("@strapi/types/dist/data").ID;
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import type { Ability } from '@casl/ability';
|
|
1
2
|
import type { Core } from '@strapi/types';
|
|
3
|
+
export declare const ACTIONS: {
|
|
4
|
+
readonly read: "plugin::content-manager.explorer.read";
|
|
5
|
+
readonly create: "plugin::content-manager.explorer.create";
|
|
6
|
+
readonly update: "plugin::content-manager.explorer.update";
|
|
7
|
+
readonly delete: "plugin::content-manager.explorer.delete";
|
|
8
|
+
readonly publish: "plugin::content-manager.explorer.publish";
|
|
9
|
+
readonly unpublish: "plugin::content-manager.explorer.publish";
|
|
10
|
+
readonly discard: "plugin::content-manager.explorer.update";
|
|
11
|
+
};
|
|
2
12
|
type Query = {
|
|
3
13
|
page?: string;
|
|
4
14
|
pageSize?: string;
|
|
@@ -8,19 +18,19 @@ declare const _default: ({ strapi }: {
|
|
|
8
18
|
strapi: Core.Strapi;
|
|
9
19
|
}) => {
|
|
10
20
|
create: ({ userAbility, model }: {
|
|
11
|
-
userAbility: any
|
|
21
|
+
userAbility: Ability<import("@casl/ability").AbilityTuple, any>;
|
|
12
22
|
model: string;
|
|
13
23
|
}) => {
|
|
14
24
|
can: (action: string, entity?: ({
|
|
15
25
|
id: import("@strapi/types/dist/data").ID;
|
|
16
26
|
} & {
|
|
17
27
|
[key: string]: any;
|
|
18
|
-
}) | undefined, field: string) =>
|
|
28
|
+
}) | undefined, field: string) => boolean;
|
|
19
29
|
cannot: (action: string, entity?: ({
|
|
20
30
|
id: import("@strapi/types/dist/data").ID;
|
|
21
31
|
} & {
|
|
22
32
|
[key: string]: any;
|
|
23
|
-
}) | undefined, field: string) =>
|
|
33
|
+
}) | undefined, field: string) => boolean;
|
|
24
34
|
requiresEntity: (action: string) => boolean;
|
|
25
35
|
sanitizeOutput: (data: {
|
|
26
36
|
id: import("@strapi/types/dist/data").ID;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-checker.d.ts","sourceRoot":"","sources":["../../../../server/src/services/permission-checker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"permission-checker.d.ts","sourceRoot":"","sources":["../../../../server/src/services/permission-checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,OAAO,KAAK,EAAE,IAAI,EAAgB,MAAM,eAAe,CAAC;AAExD,eAAO,MAAM,OAAO;;;;;;;;CAQV,CAAC;AAGX,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;qCA6I0B;IAAE,MAAM,EAAE,KAAK,MAAM,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAnD,wBAEG"}
|
|
@@ -2,15 +2,15 @@ declare function createDefaultConfiguration(schema: any): Promise<{
|
|
|
2
2
|
settings: any;
|
|
3
3
|
metadatas: any;
|
|
4
4
|
layouts: {
|
|
5
|
-
edit: any;
|
|
6
5
|
list: any;
|
|
6
|
+
edit: any;
|
|
7
7
|
};
|
|
8
8
|
}>;
|
|
9
9
|
declare function syncConfiguration(conf: any, schema: any): Promise<{
|
|
10
10
|
settings: any;
|
|
11
11
|
layouts: {
|
|
12
|
-
edit: any;
|
|
13
12
|
list: any;
|
|
13
|
+
edit: any;
|
|
14
14
|
} | {
|
|
15
15
|
list: any;
|
|
16
16
|
edit: any;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
declare function createDefaultLayouts(schema: any): Promise<{
|
|
2
|
-
edit: any;
|
|
3
2
|
list: any;
|
|
3
|
+
edit: any;
|
|
4
4
|
}>;
|
|
5
5
|
/** Synchronisation functions */
|
|
6
6
|
declare function syncLayouts(configuration: any, schema: any): Promise<{
|
|
7
|
-
edit: any;
|
|
8
7
|
list: any;
|
|
8
|
+
edit: any;
|
|
9
9
|
}> | {
|
|
10
10
|
list: any;
|
|
11
11
|
edit: any;
|