@contentful/mcp-tools 0.12.8 → 0.12.10
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/index.d.ts +353 -208
- package/dist/index.js +699 -512
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -391,7 +391,8 @@ var RESOURCE_DISPLAY_NAME = {
|
|
|
391
391
|
experience: "experience",
|
|
392
392
|
experienceFragment: "experience fragment",
|
|
393
393
|
experienceTemplate: "experience template",
|
|
394
|
-
dataAssembly: "data assembly"
|
|
394
|
+
dataAssembly: "data assembly",
|
|
395
|
+
designToken: "design token"
|
|
395
396
|
};
|
|
396
397
|
function buildConfirmationPreview(resource, id, details, confirmToken) {
|
|
397
398
|
const displayName = RESOURCE_DISPLAY_NAME[resource];
|
|
@@ -5727,7 +5728,7 @@ function createUsageTools(config) {
|
|
|
5727
5728
|
};
|
|
5728
5729
|
}
|
|
5729
5730
|
|
|
5730
|
-
// src/tools/jobs/space-to-space-migration/
|
|
5731
|
+
// src/tools/jobs/space-to-space-migration/types.ts
|
|
5731
5732
|
import { z as z82 } from "zod";
|
|
5732
5733
|
|
|
5733
5734
|
// src/types/querySchema.ts
|
|
@@ -5749,8 +5750,22 @@ var AssetQuerySchema = z81.object({
|
|
|
5749
5750
|
order: z81.string().optional().describe("Order assets by this field")
|
|
5750
5751
|
});
|
|
5751
5752
|
|
|
5752
|
-
// src/tools/jobs/space-to-space-migration/
|
|
5753
|
-
var
|
|
5753
|
+
// src/tools/jobs/space-to-space-migration/types.ts
|
|
5754
|
+
var DYNAMIC_QUERY_KEY_PATTERN = /^(fields|sys|metadata)\./;
|
|
5755
|
+
function stripUnsupportedQueryKeys(knownKeys) {
|
|
5756
|
+
const knownKeySet = new Set(knownKeys);
|
|
5757
|
+
return (value) => {
|
|
5758
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
5759
|
+
return value;
|
|
5760
|
+
}
|
|
5761
|
+
return Object.fromEntries(
|
|
5762
|
+
Object.entries(value).filter(
|
|
5763
|
+
([key]) => knownKeySet.has(key) || DYNAMIC_QUERY_KEY_PATTERN.test(key)
|
|
5764
|
+
)
|
|
5765
|
+
);
|
|
5766
|
+
};
|
|
5767
|
+
}
|
|
5768
|
+
var ExportParamsSchema = BaseToolSchema.extend({
|
|
5754
5769
|
exportDir: z82.string().optional().describe(
|
|
5755
5770
|
"Directory to save the exported space data (optional, defaults to current directory)"
|
|
5756
5771
|
),
|
|
@@ -5766,17 +5781,34 @@ var ExportSpaceToolParams = BaseToolSchema.extend({
|
|
|
5766
5781
|
skipWebhooks: z82.boolean().optional().default(false).describe("Skip exporting webhooks"),
|
|
5767
5782
|
stripTags: z82.boolean().optional().default(false).describe("Untag assets and entries"),
|
|
5768
5783
|
contentOnly: z82.boolean().optional().default(false).describe("Only export assets and entries"),
|
|
5769
|
-
queryEntries: EntryQuerySchema.optional().describe(
|
|
5770
|
-
|
|
5771
|
-
),
|
|
5772
|
-
queryAssets: AssetQuerySchema.optional().describe(
|
|
5773
|
-
"Export only assets that match query parameters"
|
|
5774
|
-
),
|
|
5784
|
+
queryEntries: EntryQuerySchema.passthrough().transform(stripUnsupportedQueryKeys(Object.keys(EntryQuerySchema.shape))).optional().describe("Export only entries that match query parameters"),
|
|
5785
|
+
queryAssets: AssetQuerySchema.passthrough().transform(stripUnsupportedQueryKeys(Object.keys(AssetQuerySchema.shape))).optional().describe("Export only assets that match query parameters"),
|
|
5775
5786
|
downloadAssets: z82.boolean().optional().default(false).describe("Download actual asset files"),
|
|
5776
5787
|
maxAllowedLimit: z82.number().optional().default(1e3).describe("Maximum number of items per request"),
|
|
5777
5788
|
errorLogFile: z82.string().optional().describe("Path to error log output file"),
|
|
5778
5789
|
useVerboseRenderer: z82.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
5779
5790
|
});
|
|
5791
|
+
var ImportParamsSchema = BaseToolSchema.extend({
|
|
5792
|
+
contentFile: z82.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5793
|
+
content: z82.record(z82.any()).optional().describe(
|
|
5794
|
+
"JS object containing import content (must match expected structure)"
|
|
5795
|
+
),
|
|
5796
|
+
contentModelOnly: z82.boolean().optional().default(false).describe("Import only content types"),
|
|
5797
|
+
skipContentModel: z82.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
5798
|
+
skipLocales: z82.boolean().optional().default(false).describe("Skip importing locales"),
|
|
5799
|
+
skipContentUpdates: z82.boolean().optional().default(false).describe("Do not update existing content"),
|
|
5800
|
+
skipContentPublishing: z82.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
5801
|
+
uploadAssets: z82.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
5802
|
+
skipAssetUpdates: z82.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
5803
|
+
assetsDirectory: z82.string().optional().describe("Path to directory containing exported asset files"),
|
|
5804
|
+
timeout: z82.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
5805
|
+
retryLimit: z82.number().optional().default(10).describe("Max retries for asset processing"),
|
|
5806
|
+
rateLimit: z82.number().optional().default(7).describe("Max requests per second to the API"),
|
|
5807
|
+
errorLogFile: z82.string().optional().describe("Path to error log file"),
|
|
5808
|
+
useVerboseRenderer: z82.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
5809
|
+
});
|
|
5810
|
+
|
|
5811
|
+
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5780
5812
|
function createExportSpaceTool(config) {
|
|
5781
5813
|
async function tool2(args) {
|
|
5782
5814
|
const clientConfig = createClientConfig(config);
|
|
@@ -5784,15 +5816,18 @@ function createExportSpaceTool(config) {
|
|
|
5784
5816
|
if (!managementToken) {
|
|
5785
5817
|
throw new Error("Contentful management token is not configured");
|
|
5786
5818
|
}
|
|
5787
|
-
const
|
|
5819
|
+
const safeOptions = ExportParamsSchema.parse({
|
|
5788
5820
|
...args,
|
|
5789
|
-
managementToken,
|
|
5790
|
-
host: config.host ?? "api.contentful.com",
|
|
5791
|
-
...config.deliveryToken && { deliveryToken: config.deliveryToken },
|
|
5792
|
-
...config.hostDelivery && { hostDelivery: config.hostDelivery },
|
|
5793
5821
|
environmentId: args.environmentId || "master",
|
|
5794
5822
|
exportDir: args.exportDir || process.cwd(),
|
|
5795
5823
|
contentFile: args.contentFile || `contentful-export-${args.spaceId}.json`
|
|
5824
|
+
});
|
|
5825
|
+
const exportOptions = {
|
|
5826
|
+
...safeOptions,
|
|
5827
|
+
managementToken,
|
|
5828
|
+
host: config.host ?? "api.contentful.com",
|
|
5829
|
+
...config.deliveryToken && { deliveryToken: config.deliveryToken },
|
|
5830
|
+
...config.hostDelivery && { hostDelivery: config.hostDelivery }
|
|
5796
5831
|
};
|
|
5797
5832
|
try {
|
|
5798
5833
|
const contentfulExport = await import("contentful-export");
|
|
@@ -5828,66 +5863,8 @@ var ParamCollectionToolParams = BaseToolSchema.extend({
|
|
|
5828
5863
|
confirmation: z83.boolean().optional().describe(
|
|
5829
5864
|
"User confirmation that they are ready to proceed with the workflow"
|
|
5830
5865
|
),
|
|
5831
|
-
export:
|
|
5832
|
-
|
|
5833
|
-
environmentId: z83.string().optional().describe("ID of the environment in the source space"),
|
|
5834
|
-
deliveryToken: z83.string().optional().describe("CDA token to export only published content (excludes tags)"),
|
|
5835
|
-
exportDir: z83.string().optional().describe("Path to export JSON output"),
|
|
5836
|
-
saveFile: z83.boolean().optional().describe("Save the export as a JSON file"),
|
|
5837
|
-
contentFile: z83.string().optional().describe("Filename for exported data"),
|
|
5838
|
-
includeDrafts: z83.boolean().optional().describe("Include drafts in exported entries"),
|
|
5839
|
-
includeArchived: z83.boolean().optional().describe("Include archived entries"),
|
|
5840
|
-
skipContentModel: z83.boolean().optional().describe("Skip exporting content models"),
|
|
5841
|
-
skipEditorInterfaces: z83.boolean().optional().describe("Skip exporting editor interfaces"),
|
|
5842
|
-
skipContent: z83.boolean().optional().describe("Skip exporting entries and assets"),
|
|
5843
|
-
skipRoles: z83.boolean().optional().describe("Skip exporting roles and permissions"),
|
|
5844
|
-
skipTags: z83.boolean().optional().describe("Skip exporting tags"),
|
|
5845
|
-
skipWebhooks: z83.boolean().optional().describe("Skip exporting webhooks"),
|
|
5846
|
-
stripTags: z83.boolean().optional().describe("Remove tags from entries and assets"),
|
|
5847
|
-
contentOnly: z83.boolean().optional().describe("Export only entries and assets"),
|
|
5848
|
-
queryEntries: EntryQuerySchema.optional().describe(
|
|
5849
|
-
"Export only entries that match query parameters"
|
|
5850
|
-
),
|
|
5851
|
-
queryAssets: AssetQuerySchema.optional().describe(
|
|
5852
|
-
"Export only assets that match query parameters"
|
|
5853
|
-
),
|
|
5854
|
-
downloadAssets: z83.boolean().optional().describe("Download asset files to disk"),
|
|
5855
|
-
host: z83.string().optional().describe("Management API host"),
|
|
5856
|
-
hostDelivery: z83.string().optional().describe("Delivery API host"),
|
|
5857
|
-
proxy: z83.string().optional().describe("HTTP/HTTPS proxy config"),
|
|
5858
|
-
rawProxy: z83.boolean().optional().describe("Pass raw proxy config directly to Axios"),
|
|
5859
|
-
maxAllowedLimit: z83.number().optional().describe("Page size for requests"),
|
|
5860
|
-
headers: z83.record(z83.any()).optional().describe("Additional headers to include in requests"),
|
|
5861
|
-
errorLogFile: z83.string().optional().describe("Path to error log output file"),
|
|
5862
|
-
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line logging, useful for CI"),
|
|
5863
|
-
config: z83.string().optional().describe("Path to a JSON config file with all options")
|
|
5864
|
-
}).optional(),
|
|
5865
|
-
import: z83.object({
|
|
5866
|
-
spaceId: z83.string().optional().describe("ID of the space to import into"),
|
|
5867
|
-
environmentId: z83.string().optional().describe("Target environment in destination space"),
|
|
5868
|
-
contentFile: z83.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5869
|
-
content: z83.record(z83.any()).optional().describe(
|
|
5870
|
-
"JS object containing import content (must match expected structure)"
|
|
5871
|
-
),
|
|
5872
|
-
contentModelOnly: z83.boolean().optional().describe("Import only content types"),
|
|
5873
|
-
skipContentModel: z83.boolean().optional().describe("Skip importing content types and locales"),
|
|
5874
|
-
skipLocales: z83.boolean().optional().describe("Skip importing locales"),
|
|
5875
|
-
skipContentUpdates: z83.boolean().optional().describe("Do not update existing content"),
|
|
5876
|
-
skipContentPublishing: z83.boolean().optional().describe("Create but do not publish content"),
|
|
5877
|
-
uploadAssets: z83.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
|
|
5878
|
-
skipAssetUpdates: z83.boolean().optional().describe("Do not update existing assets"),
|
|
5879
|
-
assetsDirectory: z83.string().optional().describe("Path to directory containing exported asset files"),
|
|
5880
|
-
timeout: z83.number().optional().describe("Time between retries during asset processing (ms)"),
|
|
5881
|
-
retryLimit: z83.number().optional().describe("Max retries for asset processing"),
|
|
5882
|
-
host: z83.string().optional().describe("Management API host"),
|
|
5883
|
-
proxy: z83.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
|
|
5884
|
-
rawProxy: z83.boolean().optional().describe("Pass proxy config directly to Axios"),
|
|
5885
|
-
rateLimit: z83.number().optional().describe("Max requests per second to the API"),
|
|
5886
|
-
headers: z83.record(z83.any()).optional().describe("Additional headers to attach to requests"),
|
|
5887
|
-
errorLogFile: z83.string().optional().describe("Path to error log file"),
|
|
5888
|
-
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line progress output (good for CI)"),
|
|
5889
|
-
config: z83.string().optional().describe("Path to config JSON file (merged with CLI args)")
|
|
5890
|
-
}).optional()
|
|
5866
|
+
export: ExportParamsSchema.partial().optional(),
|
|
5867
|
+
import: ImportParamsSchema.partial().optional()
|
|
5891
5868
|
});
|
|
5892
5869
|
var paramCollectionConfig = {
|
|
5893
5870
|
export: {
|
|
@@ -5896,8 +5873,6 @@ spaceId // [string] [required] - ID of the space with source dat
|
|
|
5896
5873
|
`,
|
|
5897
5874
|
optionalParams: `
|
|
5898
5875
|
environmentId // [string] [default: 'master'] - ID of the environment in the source space
|
|
5899
|
-
deliveryToken // [string] - CDA token to export only published content (excludes tags)
|
|
5900
|
-
|
|
5901
5876
|
exportDir // [string] [default: process.cwd()] - Path to export JSON output
|
|
5902
5877
|
saveFile // [boolean] [default: true] - Save the export as a JSON file
|
|
5903
5878
|
contentFile // [string] - Filename for exported data
|
|
@@ -5917,22 +5892,15 @@ queryEntries // [array] - Export only entries that match query parame
|
|
|
5917
5892
|
queryAssets // [array] - Export only assets that match query parameters
|
|
5918
5893
|
downloadAssets // [boolean] - Download asset files to disk
|
|
5919
5894
|
|
|
5920
|
-
host // [string] [default: 'api.contentful.com'] - Management API host
|
|
5921
|
-
hostDelivery // [string] [default: 'cdn.contentful.com'] - Delivery API host
|
|
5922
|
-
proxy // [string] - HTTP/HTTPS proxy config
|
|
5923
|
-
rawProxy // [boolean] - Pass raw proxy config directly to Axios
|
|
5924
5895
|
maxAllowedLimit // [number] [default: 1000] - Page size for requests
|
|
5925
|
-
headers // [object] - Additional headers to include in requests
|
|
5926
5896
|
|
|
5927
5897
|
errorLogFile // [string] - Path to error log output file
|
|
5928
5898
|
useVerboseRenderer // [boolean] [default: false] - Line-by-line logging, useful for CI
|
|
5929
|
-
config // [string] - Path to a JSON config file with all options
|
|
5930
5899
|
`
|
|
5931
5900
|
},
|
|
5932
5901
|
import: {
|
|
5933
5902
|
requiredParams: `
|
|
5934
5903
|
spaceId // [string] [required] - ID of the space to import into
|
|
5935
|
-
managementToken // [string] [required] - Contentful Management API token
|
|
5936
5904
|
`,
|
|
5937
5905
|
optionalParams: `
|
|
5938
5906
|
environmentId // [string] [default: 'master'] - Target environment in destination space
|
|
@@ -5951,25 +5919,16 @@ assetsDirectory // [string] - Path to directory containing exported asse
|
|
|
5951
5919
|
timeout // [number] [default: 3000] - Time between retries during asset processing (ms)
|
|
5952
5920
|
retryLimit // [number] [default: 10] - Max retries for asset processing
|
|
5953
5921
|
|
|
5954
|
-
host // [string] [default: 'api.contentful.com'] - Management API host
|
|
5955
|
-
proxy // [string] - HTTP/HTTPS proxy string (host:port or user:pass@host:port)
|
|
5956
|
-
rawProxy // [boolean] - Pass proxy config directly to Axios
|
|
5957
5922
|
rateLimit // [number] [default: 7] - Max requests per second to the API
|
|
5958
|
-
headers // [object] - Additional headers to attach to requests
|
|
5959
5923
|
|
|
5960
5924
|
errorLogFile // [string] - Path to error log file
|
|
5961
5925
|
useVerboseRenderer // [boolean] [default: false] - Line-by-line progress output (good for CI)
|
|
5962
|
-
config // [string] - Path to config JSON file (merged with CLI args)
|
|
5963
5926
|
`
|
|
5964
5927
|
}
|
|
5965
5928
|
};
|
|
5966
5929
|
async function tool(args) {
|
|
5967
|
-
const exportParams = args.export ?
|
|
5968
|
-
|
|
5969
|
-
) : {};
|
|
5970
|
-
const importParams = args.import ? Object.fromEntries(
|
|
5971
|
-
Object.entries(args.import).filter(([, value]) => value !== void 0)
|
|
5972
|
-
) : {};
|
|
5930
|
+
const exportParams = args.export ? ExportParamsSchema.partial().parse(args.export) : {};
|
|
5931
|
+
const importParams = args.import ? ImportParamsSchema.partial().parse(args.import) : {};
|
|
5973
5932
|
const params = {
|
|
5974
5933
|
export: Object.keys(exportParams).length > 0 ? exportParams : void 0,
|
|
5975
5934
|
import: Object.keys(importParams).length > 0 ? importParams : void 0
|
|
@@ -6002,26 +5961,6 @@ var createParamCollectionTool = withErrorHandling(
|
|
|
6002
5961
|
);
|
|
6003
5962
|
|
|
6004
5963
|
// src/tools/jobs/space-to-space-migration/importSpace.ts
|
|
6005
|
-
import { z as z84 } from "zod";
|
|
6006
|
-
var ImportSpaceToolParams = BaseToolSchema.extend({
|
|
6007
|
-
contentFile: z84.string().optional().describe("Path to JSON file containing the content to import"),
|
|
6008
|
-
content: z84.record(z84.any()).optional().describe(
|
|
6009
|
-
"JS object containing import content (must match expected structure)"
|
|
6010
|
-
),
|
|
6011
|
-
contentModelOnly: z84.boolean().optional().default(false).describe("Import only content types"),
|
|
6012
|
-
skipContentModel: z84.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
6013
|
-
skipLocales: z84.boolean().optional().default(false).describe("Skip importing locales"),
|
|
6014
|
-
skipContentUpdates: z84.boolean().optional().default(false).describe("Do not update existing content"),
|
|
6015
|
-
skipContentPublishing: z84.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
6016
|
-
uploadAssets: z84.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
6017
|
-
skipAssetUpdates: z84.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
6018
|
-
assetsDirectory: z84.string().optional().describe("Path to directory containing exported asset files"),
|
|
6019
|
-
timeout: z84.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
6020
|
-
retryLimit: z84.number().optional().default(10).describe("Max retries for asset processing"),
|
|
6021
|
-
rateLimit: z84.number().optional().default(7).describe("Max requests per second to the API"),
|
|
6022
|
-
errorLogFile: z84.string().optional().describe("Path to error log file"),
|
|
6023
|
-
useVerboseRenderer: z84.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
6024
|
-
});
|
|
6025
5964
|
function createImportSpaceTool(config) {
|
|
6026
5965
|
async function tool2(args) {
|
|
6027
5966
|
const targetEnvironmentId = args.environmentId || "master";
|
|
@@ -6034,11 +5973,14 @@ function createImportSpaceTool(config) {
|
|
|
6034
5973
|
if (!managementToken) {
|
|
6035
5974
|
throw new Error("Contentful management token is not configured");
|
|
6036
5975
|
}
|
|
6037
|
-
const
|
|
5976
|
+
const safeOptions = ImportParamsSchema.parse({
|
|
6038
5977
|
...args,
|
|
6039
|
-
managementToken,
|
|
6040
|
-
host: config.host ?? "api.contentful.com",
|
|
6041
5978
|
environmentId: targetEnvironmentId
|
|
5979
|
+
});
|
|
5980
|
+
const importOptions = {
|
|
5981
|
+
...safeOptions,
|
|
5982
|
+
managementToken,
|
|
5983
|
+
host: config.host ?? "api.contentful.com"
|
|
6042
5984
|
};
|
|
6043
5985
|
try {
|
|
6044
5986
|
const contentfulImport = await import("contentful-import");
|
|
@@ -6063,7 +6005,7 @@ function createImportSpaceTool(config) {
|
|
|
6063
6005
|
}
|
|
6064
6006
|
|
|
6065
6007
|
// src/tools/jobs/space-to-space-migration/migrationHandler.ts
|
|
6066
|
-
import { z as
|
|
6008
|
+
import { z as z84 } from "zod";
|
|
6067
6009
|
|
|
6068
6010
|
// src/tools/jobs/space-to-space-migration/instructions.ts
|
|
6069
6011
|
var S2S_MIGRATION_INSTRUCTIONS = `
|
|
@@ -6106,7 +6048,7 @@ The space to space migration workflow has been concluded and all related tools h
|
|
|
6106
6048
|
The workflow is now complete. You can start a new migration workflow by calling space_to_space_migration_handler with enableWorkflow=true if needed.
|
|
6107
6049
|
`;
|
|
6108
6050
|
var SpaceToSpaceMigrationHandlerToolParams = BaseToolSchema.extend({
|
|
6109
|
-
enableWorkflow:
|
|
6051
|
+
enableWorkflow: z84.boolean().describe(
|
|
6110
6052
|
"Set to true to enable the workflow tools, false to disable them and conclude the workflow"
|
|
6111
6053
|
)
|
|
6112
6054
|
});
|
|
@@ -6168,7 +6110,7 @@ function createJobTools(config) {
|
|
|
6168
6110
|
exportSpace: {
|
|
6169
6111
|
title: "export_space",
|
|
6170
6112
|
description: "Export a space to a file",
|
|
6171
|
-
inputParams:
|
|
6113
|
+
inputParams: ExportParamsSchema.shape,
|
|
6172
6114
|
annotations: {
|
|
6173
6115
|
readOnlyHint: true,
|
|
6174
6116
|
destructiveHint: false,
|
|
@@ -6179,7 +6121,7 @@ function createJobTools(config) {
|
|
|
6179
6121
|
importSpace: {
|
|
6180
6122
|
title: "import_space",
|
|
6181
6123
|
description: "Import a space from a file. Step 4 of the space to space migration workflow.",
|
|
6182
|
-
inputParams:
|
|
6124
|
+
inputParams: ImportParamsSchema.shape,
|
|
6183
6125
|
annotations: {
|
|
6184
6126
|
readOnlyHint: false,
|
|
6185
6127
|
destructiveHint: false,
|
|
@@ -6204,9 +6146,9 @@ function createJobTools(config) {
|
|
|
6204
6146
|
}
|
|
6205
6147
|
|
|
6206
6148
|
// src/tools/exo/components/getComponent.ts
|
|
6207
|
-
import { z as
|
|
6149
|
+
import { z as z85 } from "zod";
|
|
6208
6150
|
var GetComponentToolParams = BaseToolSchema.extend({
|
|
6209
|
-
componentId:
|
|
6151
|
+
componentId: z85.string().describe("The ID of the component to retrieve details for")
|
|
6210
6152
|
});
|
|
6211
6153
|
function getComponentTool(config) {
|
|
6212
6154
|
async function tool2(args) {
|
|
@@ -6224,12 +6166,12 @@ function getComponentTool(config) {
|
|
|
6224
6166
|
}
|
|
6225
6167
|
|
|
6226
6168
|
// src/tools/exo/components/listComponents.ts
|
|
6227
|
-
import { z as
|
|
6169
|
+
import { z as z86 } from "zod";
|
|
6228
6170
|
var ListComponentsToolParams = BaseToolSchema.extend({
|
|
6229
|
-
limit:
|
|
6230
|
-
pageNext:
|
|
6231
|
-
pagePrev:
|
|
6232
|
-
order:
|
|
6171
|
+
limit: z86.number().optional().describe("Maximum number of components to return (max 10)"),
|
|
6172
|
+
pageNext: z86.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6173
|
+
pagePrev: z86.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6174
|
+
order: z86.string().optional().describe("Order components by this field (e.g. sys.createdAt)")
|
|
6233
6175
|
});
|
|
6234
6176
|
function listComponentsTool(config) {
|
|
6235
6177
|
async function tool2(args) {
|
|
@@ -6259,10 +6201,10 @@ function listComponentsTool(config) {
|
|
|
6259
6201
|
}
|
|
6260
6202
|
|
|
6261
6203
|
// src/tools/exo/components/createComponent.ts
|
|
6262
|
-
import { z as
|
|
6204
|
+
import { z as z88 } from "zod";
|
|
6263
6205
|
|
|
6264
6206
|
// src/types/exoSchemas.ts
|
|
6265
|
-
import { z as
|
|
6207
|
+
import { z as z87 } from "zod";
|
|
6266
6208
|
var URN_EXAMPLES = {
|
|
6267
6209
|
"Contentful:Component": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/components/{id}",
|
|
6268
6210
|
"Contentful:ExperienceFragment": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/experienceFragments/{id}",
|
|
@@ -6272,19 +6214,19 @@ var URN_EXAMPLES = {
|
|
|
6272
6214
|
var resourceLinkSchema2 = (linkType) => {
|
|
6273
6215
|
const example = URN_EXAMPLES[linkType];
|
|
6274
6216
|
const urnDesc = example ? `URN of the linked resource (e.g. "${example}")` : "URN of the linked resource";
|
|
6275
|
-
return
|
|
6276
|
-
sys:
|
|
6277
|
-
type:
|
|
6278
|
-
linkType:
|
|
6279
|
-
urn:
|
|
6217
|
+
return z87.object({
|
|
6218
|
+
sys: z87.object({
|
|
6219
|
+
type: z87.literal("ResourceLink"),
|
|
6220
|
+
linkType: z87.literal(linkType),
|
|
6221
|
+
urn: z87.string().describe(urnDesc)
|
|
6280
6222
|
})
|
|
6281
6223
|
});
|
|
6282
6224
|
};
|
|
6283
|
-
var linkSchema2 = (linkType) =>
|
|
6284
|
-
sys:
|
|
6285
|
-
type:
|
|
6286
|
-
linkType:
|
|
6287
|
-
id:
|
|
6225
|
+
var linkSchema2 = (linkType) => z87.object({
|
|
6226
|
+
sys: z87.object({
|
|
6227
|
+
type: z87.literal("Link"),
|
|
6228
|
+
linkType: z87.literal(linkType),
|
|
6229
|
+
id: z87.string()
|
|
6288
6230
|
})
|
|
6289
6231
|
});
|
|
6290
6232
|
var ComponentResourceLinkSchema = resourceLinkSchema2(
|
|
@@ -6296,71 +6238,71 @@ var ExperienceFragmentResourceLinkSchema = resourceLinkSchema2(
|
|
|
6296
6238
|
var ExperienceTemplateResourceLinkSchema = resourceLinkSchema2(
|
|
6297
6239
|
"Contentful:ExperienceTemplate"
|
|
6298
6240
|
);
|
|
6299
|
-
var ViewportSchema =
|
|
6300
|
-
id:
|
|
6301
|
-
query:
|
|
6302
|
-
displayName:
|
|
6303
|
-
previewSize:
|
|
6304
|
-
});
|
|
6305
|
-
var DataTypeDefinitionSchema =
|
|
6306
|
-
() =>
|
|
6307
|
-
|
|
6308
|
-
type:
|
|
6309
|
-
name:
|
|
6310
|
-
required:
|
|
6241
|
+
var ViewportSchema = z87.object({
|
|
6242
|
+
id: z87.string().describe("Viewport identifier"),
|
|
6243
|
+
query: z87.string().describe("CSS media query string"),
|
|
6244
|
+
displayName: z87.string().describe("Human-readable viewport name"),
|
|
6245
|
+
previewSize: z87.string().describe('Preview size (e.g. "1024px")')
|
|
6246
|
+
});
|
|
6247
|
+
var DataTypeDefinitionSchema = z87.lazy(
|
|
6248
|
+
() => z87.discriminatedUnion("type", [
|
|
6249
|
+
z87.object({
|
|
6250
|
+
type: z87.enum(["String", "Number", "Integer", "Boolean"]),
|
|
6251
|
+
name: z87.string().optional(),
|
|
6252
|
+
required: z87.boolean().optional()
|
|
6311
6253
|
}),
|
|
6312
|
-
|
|
6313
|
-
type:
|
|
6314
|
-
name:
|
|
6315
|
-
required:
|
|
6254
|
+
z87.object({
|
|
6255
|
+
type: z87.literal("RichText"),
|
|
6256
|
+
name: z87.string().optional(),
|
|
6257
|
+
required: z87.boolean().optional()
|
|
6316
6258
|
}),
|
|
6317
|
-
|
|
6318
|
-
type:
|
|
6319
|
-
name:
|
|
6320
|
-
required:
|
|
6259
|
+
z87.object({
|
|
6260
|
+
type: z87.literal("Array"),
|
|
6261
|
+
name: z87.string().optional(),
|
|
6262
|
+
required: z87.boolean().optional(),
|
|
6321
6263
|
items: DataTypeDefinitionSchema
|
|
6322
6264
|
}),
|
|
6323
|
-
|
|
6324
|
-
type:
|
|
6325
|
-
name:
|
|
6326
|
-
required:
|
|
6327
|
-
fields:
|
|
6265
|
+
z87.object({
|
|
6266
|
+
type: z87.literal("Record"),
|
|
6267
|
+
name: z87.string().optional(),
|
|
6268
|
+
required: z87.boolean().optional(),
|
|
6269
|
+
fields: z87.record(z87.string(), DataTypeDefinitionSchema)
|
|
6328
6270
|
}),
|
|
6329
|
-
|
|
6330
|
-
type:
|
|
6331
|
-
name:
|
|
6332
|
-
required:
|
|
6333
|
-
ref:
|
|
6334
|
-
sys:
|
|
6335
|
-
type:
|
|
6336
|
-
linkType:
|
|
6337
|
-
urn:
|
|
6271
|
+
z87.object({
|
|
6272
|
+
type: z87.literal("TypeRef"),
|
|
6273
|
+
name: z87.string().optional(),
|
|
6274
|
+
required: z87.boolean().optional(),
|
|
6275
|
+
ref: z87.object({
|
|
6276
|
+
sys: z87.object({
|
|
6277
|
+
type: z87.literal("ResourceLink"),
|
|
6278
|
+
linkType: z87.string(),
|
|
6279
|
+
urn: z87.string()
|
|
6338
6280
|
})
|
|
6339
6281
|
})
|
|
6340
6282
|
}),
|
|
6341
|
-
|
|
6342
|
-
type:
|
|
6343
|
-
name:
|
|
6344
|
-
required:
|
|
6345
|
-
value:
|
|
6283
|
+
z87.object({
|
|
6284
|
+
type: z87.literal("Literal"),
|
|
6285
|
+
name: z87.string().optional(),
|
|
6286
|
+
required: z87.boolean().optional(),
|
|
6287
|
+
value: z87.custom().describe("JSON literal value"),
|
|
6346
6288
|
valueType: DataTypeDefinitionSchema
|
|
6347
6289
|
}),
|
|
6348
|
-
|
|
6349
|
-
type:
|
|
6350
|
-
name:
|
|
6351
|
-
required:
|
|
6352
|
-
discriminator:
|
|
6353
|
-
members:
|
|
6290
|
+
z87.object({
|
|
6291
|
+
type: z87.literal("DiscriminatedUnion"),
|
|
6292
|
+
name: z87.string().optional(),
|
|
6293
|
+
required: z87.boolean().optional(),
|
|
6294
|
+
discriminator: z87.string(),
|
|
6295
|
+
members: z87.array(DataTypeDefinitionSchema)
|
|
6354
6296
|
})
|
|
6355
6297
|
])
|
|
6356
6298
|
);
|
|
6357
|
-
var ContentPropertySchema =
|
|
6299
|
+
var ContentPropertySchema = z87.intersection(
|
|
6358
6300
|
DataTypeDefinitionSchema,
|
|
6359
|
-
|
|
6360
|
-
id:
|
|
6361
|
-
name:
|
|
6362
|
-
required:
|
|
6363
|
-
defaultValue:
|
|
6301
|
+
z87.object({
|
|
6302
|
+
id: z87.string().describe("Content property identifier"),
|
|
6303
|
+
name: z87.string().describe("Human-readable name"),
|
|
6304
|
+
required: z87.boolean().describe("Whether the property is required"),
|
|
6305
|
+
defaultValue: z87.unknown().optional().describe("Default value")
|
|
6364
6306
|
})
|
|
6365
6307
|
);
|
|
6366
6308
|
var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
@@ -6378,186 +6320,189 @@ var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
|
6378
6320
|
"DTCG.Gradient",
|
|
6379
6321
|
"DTCG.Typography"
|
|
6380
6322
|
];
|
|
6381
|
-
var DesignPropertyCommonFieldsSchema =
|
|
6382
|
-
id:
|
|
6383
|
-
name:
|
|
6384
|
-
description:
|
|
6323
|
+
var DesignPropertyCommonFieldsSchema = z87.object({
|
|
6324
|
+
id: z87.string().describe("Design property identifier"),
|
|
6325
|
+
name: z87.string().describe("Human-readable name"),
|
|
6326
|
+
description: z87.string().optional().describe("Optional description")
|
|
6385
6327
|
});
|
|
6386
6328
|
var StringDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6387
|
-
type:
|
|
6388
|
-
fallbackValue:
|
|
6389
|
-
type:
|
|
6390
|
-
value:
|
|
6329
|
+
type: z87.literal("String"),
|
|
6330
|
+
fallbackValue: z87.object({
|
|
6331
|
+
type: z87.literal("ManualDesignValue"),
|
|
6332
|
+
value: z87.string()
|
|
6391
6333
|
}).optional().describe("Manual fallback value for this design property"),
|
|
6392
|
-
validations:
|
|
6393
|
-
|
|
6394
|
-
regexp:
|
|
6395
|
-
pattern:
|
|
6334
|
+
validations: z87.array(
|
|
6335
|
+
z87.object({
|
|
6336
|
+
regexp: z87.object({
|
|
6337
|
+
pattern: z87.string().describe("Regular expression pattern")
|
|
6396
6338
|
})
|
|
6397
6339
|
})
|
|
6398
6340
|
).optional().describe("Regexp validations constraining allowed string values")
|
|
6399
6341
|
});
|
|
6400
6342
|
var BooleanDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6401
|
-
type:
|
|
6402
|
-
fallbackValue:
|
|
6403
|
-
type:
|
|
6404
|
-
value:
|
|
6343
|
+
type: z87.literal("Boolean"),
|
|
6344
|
+
fallbackValue: z87.object({
|
|
6345
|
+
type: z87.literal("ManualDesignValue"),
|
|
6346
|
+
value: z87.boolean()
|
|
6405
6347
|
}).optional().describe("Manual fallback value for this design property")
|
|
6406
6348
|
});
|
|
6407
|
-
var DesignTokenValueSchema =
|
|
6408
|
-
type:
|
|
6409
|
-
value:
|
|
6349
|
+
var DesignTokenValueSchema = z87.object({
|
|
6350
|
+
type: z87.literal("DesignToken"),
|
|
6351
|
+
value: z87.string().min(1).describe("Design token reference (non-empty)")
|
|
6410
6352
|
});
|
|
6411
6353
|
var TokenBackedDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend(
|
|
6412
6354
|
{
|
|
6413
|
-
type:
|
|
6355
|
+
type: z87.enum(DTCG_DESIGN_PROPERTY_TYPES),
|
|
6414
6356
|
fallbackValue: DesignTokenValueSchema.optional().describe(
|
|
6415
6357
|
"Design-token-backed fallback value for this design property"
|
|
6416
6358
|
),
|
|
6417
|
-
allowedResources:
|
|
6418
|
-
|
|
6419
|
-
type:
|
|
6420
|
-
value:
|
|
6421
|
-
name:
|
|
6359
|
+
allowedResources: z87.array(
|
|
6360
|
+
z87.object({
|
|
6361
|
+
type: z87.literal("DesignToken"),
|
|
6362
|
+
value: z87.string(),
|
|
6363
|
+
name: z87.string().optional()
|
|
6422
6364
|
})
|
|
6423
6365
|
).optional().describe("Allowed design token resources")
|
|
6424
6366
|
}
|
|
6425
6367
|
);
|
|
6426
|
-
var DesignPropertySchema =
|
|
6368
|
+
var DesignPropertySchema = z87.union([
|
|
6427
6369
|
StringDesignPropertySchema,
|
|
6428
6370
|
BooleanDesignPropertySchema,
|
|
6429
6371
|
TokenBackedDesignPropertySchema
|
|
6430
6372
|
]);
|
|
6431
|
-
var ManualDesignValueSchema =
|
|
6432
|
-
type:
|
|
6433
|
-
value:
|
|
6373
|
+
var ManualDesignValueSchema = z87.object({
|
|
6374
|
+
type: z87.literal("ManualDesignValue"),
|
|
6375
|
+
value: z87.union([z87.string(), z87.number(), z87.boolean()])
|
|
6434
6376
|
});
|
|
6435
|
-
var DesignPropertyValueSchema =
|
|
6377
|
+
var DesignPropertyValueSchema = z87.union([
|
|
6436
6378
|
ManualDesignValueSchema,
|
|
6437
6379
|
DesignTokenValueSchema
|
|
6438
6380
|
]);
|
|
6439
|
-
var DesignPropertyPointerValueSchema =
|
|
6381
|
+
var DesignPropertyPointerValueSchema = z87.custom(
|
|
6440
6382
|
(val) => typeof val === "string" && /^\$designProperties\//.test(val),
|
|
6441
6383
|
{ message: 'Must be a "$designProperties/..." pointer' }
|
|
6442
6384
|
);
|
|
6443
|
-
var DimensionedDesignPropertyValueSchema =
|
|
6444
|
-
|
|
6385
|
+
var DimensionedDesignPropertyValueSchema = z87.record(
|
|
6386
|
+
z87.string(),
|
|
6445
6387
|
DesignPropertyValueSchema
|
|
6446
6388
|
);
|
|
6447
|
-
var ComponentTreeDesignPropertyValueSchema =
|
|
6389
|
+
var ComponentTreeDesignPropertyValueSchema = z87.union([
|
|
6448
6390
|
DesignPropertyValueSchema,
|
|
6449
6391
|
DesignPropertyPointerValueSchema,
|
|
6450
6392
|
DimensionedDesignPropertyValueSchema
|
|
6451
6393
|
]);
|
|
6452
6394
|
var COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE = "crn:contentful:::experience:spaces/$self/environments/$self";
|
|
6453
|
-
var SlotDefinitionSchema =
|
|
6454
|
-
id:
|
|
6455
|
-
name:
|
|
6456
|
-
required:
|
|
6457
|
-
validations:
|
|
6458
|
-
|
|
6459
|
-
size:
|
|
6460
|
-
min:
|
|
6461
|
-
max:
|
|
6395
|
+
var SlotDefinitionSchema = z87.object({
|
|
6396
|
+
id: z87.string().describe("Slot identifier"),
|
|
6397
|
+
name: z87.string().describe("Human-readable name"),
|
|
6398
|
+
required: z87.boolean().describe("Whether the slot must be filled"),
|
|
6399
|
+
validations: z87.array(
|
|
6400
|
+
z87.object({
|
|
6401
|
+
size: z87.object({
|
|
6402
|
+
min: z87.number().optional(),
|
|
6403
|
+
max: z87.number().optional()
|
|
6462
6404
|
}).optional()
|
|
6463
6405
|
})
|
|
6464
6406
|
).describe("Slot cardinality validations"),
|
|
6465
|
-
allowedResources:
|
|
6466
|
-
|
|
6467
|
-
type:
|
|
6468
|
-
source:
|
|
6469
|
-
allowedTypes:
|
|
6407
|
+
allowedResources: z87.array(
|
|
6408
|
+
z87.object({
|
|
6409
|
+
type: z87.literal("Contentful:Component"),
|
|
6410
|
+
source: z87.literal(COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE),
|
|
6411
|
+
allowedTypes: z87.array(z87.string()).describe("IDs of components allowed in this slot")
|
|
6470
6412
|
})
|
|
6471
6413
|
).optional().describe("Constrains which components may be placed in this slot")
|
|
6472
6414
|
});
|
|
6473
|
-
var ExperienceFragmentNodeSchema =
|
|
6474
|
-
id:
|
|
6475
|
-
name:
|
|
6476
|
-
nodeType:
|
|
6415
|
+
var ExperienceFragmentNodeSchema = z87.object({
|
|
6416
|
+
id: z87.string().describe("Node identifier"),
|
|
6417
|
+
name: z87.string().optional().describe("Optional display name"),
|
|
6418
|
+
nodeType: z87.literal("ExperienceFragment").describe('Must be "ExperienceFragment"'),
|
|
6477
6419
|
experienceFragment: ExperienceFragmentResourceLinkSchema.describe(
|
|
6478
6420
|
"Resource link to the referenced experience fragment"
|
|
6479
6421
|
)
|
|
6480
6422
|
});
|
|
6481
|
-
var SlotNodeSchema =
|
|
6482
|
-
id:
|
|
6483
|
-
nodeType:
|
|
6484
|
-
slotId:
|
|
6423
|
+
var SlotNodeSchema = z87.object({
|
|
6424
|
+
id: z87.string().describe("Node identifier"),
|
|
6425
|
+
nodeType: z87.literal("Slot").describe('Must be "Slot"'),
|
|
6426
|
+
slotId: z87.string().describe("ID of the slot definition to render")
|
|
6485
6427
|
});
|
|
6486
|
-
var TreeNodeSchema =
|
|
6487
|
-
() =>
|
|
6428
|
+
var TreeNodeSchema = z87.lazy(
|
|
6429
|
+
() => z87.union([ComponentNodeSchema, ExperienceFragmentNodeSchema, SlotNodeSchema])
|
|
6488
6430
|
);
|
|
6489
|
-
var ComponentNodeSchema =
|
|
6490
|
-
() =>
|
|
6491
|
-
id:
|
|
6492
|
-
name:
|
|
6493
|
-
nodeType:
|
|
6431
|
+
var ComponentNodeSchema = z87.lazy(
|
|
6432
|
+
() => z87.object({
|
|
6433
|
+
id: z87.string().describe("Node identifier"),
|
|
6434
|
+
name: z87.string().optional().describe("Optional display name"),
|
|
6435
|
+
nodeType: z87.literal("Component").describe('Must be "Component"'),
|
|
6494
6436
|
component: ComponentResourceLinkSchema.describe(
|
|
6495
6437
|
"Resource link to the component to render"
|
|
6496
6438
|
),
|
|
6497
|
-
contentProperties:
|
|
6498
|
-
|
|
6499
|
-
|
|
6439
|
+
contentProperties: z87.union([
|
|
6440
|
+
z87.record(z87.string(), z87.unknown()),
|
|
6441
|
+
z87.string().describe('"$contentProperties/..." pointer')
|
|
6500
6442
|
]).describe(
|
|
6501
6443
|
'Content property bindings \u2014 values or "$contentProperties/..." pointers'
|
|
6502
6444
|
),
|
|
6503
|
-
designProperties:
|
|
6445
|
+
designProperties: z87.record(z87.string(), ComponentTreeDesignPropertyValueSchema).describe(
|
|
6504
6446
|
'Design property values \u2014 ManualDesignValue, DesignTokenValue, or "$designProperties/..." pointers'
|
|
6505
6447
|
),
|
|
6506
|
-
slots:
|
|
6448
|
+
slots: z87.record(z87.string(), z87.array(TreeNodeSchema)).describe("Child tree nodes keyed by slot ID")
|
|
6507
6449
|
})
|
|
6508
6450
|
);
|
|
6509
6451
|
var TagLinkSchema = linkSchema2("Tag");
|
|
6510
6452
|
var ConceptLinkSchema = linkSchema2("TaxonomyConcept");
|
|
6511
|
-
var ExoMetadataSchema =
|
|
6512
|
-
tags:
|
|
6513
|
-
concepts:
|
|
6453
|
+
var ExoMetadataSchema = z87.object({
|
|
6454
|
+
tags: z87.array(TagLinkSchema).optional().describe("Tags attached to this entity"),
|
|
6455
|
+
concepts: z87.array(ConceptLinkSchema).optional().describe("Taxonomy concepts attached to this entity")
|
|
6514
6456
|
});
|
|
6515
6457
|
var ExperienceMetadataSchema = ExoMetadataSchema.extend({
|
|
6516
|
-
name:
|
|
6458
|
+
name: z87.string().optional().describe("Variant label for this metadata entry")
|
|
6517
6459
|
});
|
|
6518
6460
|
var DataAssemblyResourceLinkSchema = resourceLinkSchema2(
|
|
6519
6461
|
"Contentful:DataAssembly"
|
|
6520
6462
|
);
|
|
6521
|
-
var ExperienceContentBindingsSchema =
|
|
6463
|
+
var ExperienceContentBindingsSchema = z87.object({
|
|
6522
6464
|
sys: DataAssemblyResourceLinkSchema.shape.sys,
|
|
6523
|
-
parameters:
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
sys:
|
|
6527
|
-
type:
|
|
6528
|
-
linkType:
|
|
6529
|
-
urn:
|
|
6465
|
+
parameters: z87.record(
|
|
6466
|
+
z87.string(),
|
|
6467
|
+
z87.object({
|
|
6468
|
+
sys: z87.object({
|
|
6469
|
+
type: z87.literal("ResourceLink"),
|
|
6470
|
+
linkType: z87.string(),
|
|
6471
|
+
urn: z87.string()
|
|
6530
6472
|
})
|
|
6531
6473
|
})
|
|
6532
6474
|
).describe("Parameter bindings keyed by parameter ID")
|
|
6533
6475
|
});
|
|
6534
|
-
var InlineExperienceFragmentNodeSchema =
|
|
6535
|
-
() =>
|
|
6536
|
-
id:
|
|
6537
|
-
nodeType:
|
|
6476
|
+
var InlineExperienceFragmentNodeSchema = z87.lazy(
|
|
6477
|
+
() => z87.object({
|
|
6478
|
+
id: z87.string().describe("Node identifier"),
|
|
6479
|
+
nodeType: z87.literal("InlineExperienceFragment").describe('Must be "InlineExperienceFragment"'),
|
|
6538
6480
|
component: ComponentResourceLinkSchema.describe(
|
|
6539
6481
|
"Resource link to the component this inline experience fragment renders"
|
|
6540
6482
|
),
|
|
6541
|
-
designProperties:
|
|
6483
|
+
designProperties: z87.record(z87.string(), DimensionedDesignPropertyValueSchema).describe("Design property values for this inline experience fragment"),
|
|
6542
6484
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6543
6485
|
"Optional content bindings linking this inline experience fragment to a data assembly"
|
|
6544
6486
|
),
|
|
6545
|
-
slots:
|
|
6487
|
+
slots: z87.record(z87.string(), z87.array(ExperienceSlotNodeSchema)).optional().describe("Child slot contents keyed by slot ID")
|
|
6546
6488
|
})
|
|
6547
6489
|
);
|
|
6548
|
-
var ExperienceSlotNodeSchema =
|
|
6549
|
-
() =>
|
|
6490
|
+
var ExperienceSlotNodeSchema = z87.lazy(
|
|
6491
|
+
() => z87.union([ExperienceFragmentNodeSchema, InlineExperienceFragmentNodeSchema])
|
|
6550
6492
|
);
|
|
6551
6493
|
|
|
6552
6494
|
// src/tools/exo/components/createComponent.ts
|
|
6553
6495
|
var CreateComponentToolParams = BaseToolSchema.extend({
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6496
|
+
componentId: z88.string().optional().describe(
|
|
6497
|
+
"Optional ID for the component. If provided, will use upsert (create via PUT) with this ID"
|
|
6498
|
+
),
|
|
6499
|
+
name: z88.string().describe("The name of the component"),
|
|
6500
|
+
description: z88.string().describe("Description of the component"),
|
|
6501
|
+
viewports: z88.array(ViewportSchema).describe("Viewport definitions for the component (may be empty)"),
|
|
6502
|
+
contentProperties: z88.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
6503
|
+
designProperties: z88.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
6504
|
+
componentTree: z88.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
6505
|
+
slots: z88.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
6561
6506
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6562
6507
|
"Optional ExO metadata (tags, concepts)"
|
|
6563
6508
|
)
|
|
@@ -6569,18 +6514,29 @@ function createComponentTool(config) {
|
|
|
6569
6514
|
config.protectedEnvironments
|
|
6570
6515
|
);
|
|
6571
6516
|
const contentfulClient = createExoToolClient(config, args);
|
|
6572
|
-
const
|
|
6573
|
-
|
|
6517
|
+
const componentData = {
|
|
6518
|
+
name: args.name,
|
|
6519
|
+
description: args.description,
|
|
6520
|
+
viewports: args.viewports,
|
|
6521
|
+
contentProperties: args.contentProperties,
|
|
6522
|
+
designProperties: args.designProperties,
|
|
6523
|
+
...args.componentTree && { componentTree: args.componentTree },
|
|
6524
|
+
...args.slots && { slots: args.slots },
|
|
6525
|
+
...args.metadata && { metadata: args.metadata }
|
|
6526
|
+
};
|
|
6527
|
+
const component = args.componentId ? await contentfulClient.component.upsert(
|
|
6574
6528
|
{
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
...
|
|
6582
|
-
...args.metadata && { metadata: args.metadata }
|
|
6529
|
+
spaceId: args.spaceId,
|
|
6530
|
+
environmentId: args.environmentId,
|
|
6531
|
+
componentId: args.componentId
|
|
6532
|
+
},
|
|
6533
|
+
{
|
|
6534
|
+
sys: { id: args.componentId, type: "Component" },
|
|
6535
|
+
...componentData
|
|
6583
6536
|
}
|
|
6537
|
+
) : await contentfulClient.component.create(
|
|
6538
|
+
{ spaceId: args.spaceId, environmentId: args.environmentId },
|
|
6539
|
+
componentData
|
|
6584
6540
|
);
|
|
6585
6541
|
return createSuccessResponse("Component created successfully", {
|
|
6586
6542
|
component
|
|
@@ -6590,19 +6546,19 @@ function createComponentTool(config) {
|
|
|
6590
6546
|
}
|
|
6591
6547
|
|
|
6592
6548
|
// src/tools/exo/components/upsertComponent.ts
|
|
6593
|
-
import { z as
|
|
6549
|
+
import { z as z89 } from "zod";
|
|
6594
6550
|
var UpsertComponentToolParams = BaseToolSchema.extend({
|
|
6595
|
-
componentId:
|
|
6596
|
-
version:
|
|
6551
|
+
componentId: z89.string().describe("The ID of the component to update"),
|
|
6552
|
+
version: z89.number().describe(
|
|
6597
6553
|
"REQUIRED. The component's sys.version as returned by get_component. You must call get_component first to read the current state and version. The update is rejected if this does not match the current version, which means the component changed since you read it."
|
|
6598
6554
|
),
|
|
6599
|
-
name:
|
|
6600
|
-
description:
|
|
6601
|
-
viewports:
|
|
6602
|
-
contentProperties:
|
|
6603
|
-
designProperties:
|
|
6604
|
-
componentTree:
|
|
6605
|
-
slots:
|
|
6555
|
+
name: z89.string().optional().describe("The name of the component"),
|
|
6556
|
+
description: z89.string().optional().describe("Description of the component"),
|
|
6557
|
+
viewports: z89.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6558
|
+
contentProperties: z89.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
6559
|
+
designProperties: z89.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
6560
|
+
componentTree: z89.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
6561
|
+
slots: z89.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
6606
6562
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6607
6563
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6608
6564
|
)
|
|
@@ -6649,13 +6605,13 @@ function upsertComponentTool(config) {
|
|
|
6649
6605
|
}
|
|
6650
6606
|
|
|
6651
6607
|
// src/tools/exo/components/deleteComponent.ts
|
|
6652
|
-
import { z as
|
|
6608
|
+
import { z as z90 } from "zod";
|
|
6653
6609
|
var DeleteComponentToolParams = BaseToolSchema.extend({
|
|
6654
|
-
componentId:
|
|
6655
|
-
confirm:
|
|
6610
|
+
componentId: z90.string().describe("The ID of the component to delete"),
|
|
6611
|
+
confirm: z90.boolean().optional().describe(
|
|
6656
6612
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
6657
6613
|
),
|
|
6658
|
-
confirmToken:
|
|
6614
|
+
confirmToken: z90.string().optional().describe(
|
|
6659
6615
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
6660
6616
|
)
|
|
6661
6617
|
});
|
|
@@ -6697,10 +6653,10 @@ function deleteComponentTool(config) {
|
|
|
6697
6653
|
}
|
|
6698
6654
|
|
|
6699
6655
|
// src/tools/exo/components/publishComponent.ts
|
|
6700
|
-
import { z as
|
|
6656
|
+
import { z as z91 } from "zod";
|
|
6701
6657
|
var PublishComponentToolParams = BaseToolSchema.extend({
|
|
6702
|
-
componentId:
|
|
6703
|
-
version:
|
|
6658
|
+
componentId: z91.string().describe("The ID of the component to publish"),
|
|
6659
|
+
version: z91.number().describe(
|
|
6704
6660
|
"REQUIRED. The component's sys.version as returned by get_component. You must call get_component first to read the current state and version. The publish is rejected if this does not match the current version, which means the component changed since you read it."
|
|
6705
6661
|
)
|
|
6706
6662
|
});
|
|
@@ -6734,10 +6690,10 @@ function publishComponentTool(config) {
|
|
|
6734
6690
|
}
|
|
6735
6691
|
|
|
6736
6692
|
// src/tools/exo/components/unpublishComponent.ts
|
|
6737
|
-
import { z as
|
|
6693
|
+
import { z as z92 } from "zod";
|
|
6738
6694
|
var UnpublishComponentToolParams = BaseToolSchema.extend({
|
|
6739
|
-
componentId:
|
|
6740
|
-
version:
|
|
6695
|
+
componentId: z92.string().describe("The ID of the component to unpublish"),
|
|
6696
|
+
version: z92.number().describe(
|
|
6741
6697
|
"REQUIRED. The component's sys.version as returned by get_component. You must call get_component first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the component changed since you read it."
|
|
6742
6698
|
)
|
|
6743
6699
|
});
|
|
@@ -6866,9 +6822,9 @@ function createComponentTools(config) {
|
|
|
6866
6822
|
}
|
|
6867
6823
|
|
|
6868
6824
|
// src/tools/exo/experience-fragments/getExperienceFragment.ts
|
|
6869
|
-
import { z as
|
|
6825
|
+
import { z as z93 } from "zod";
|
|
6870
6826
|
var GetExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6871
|
-
experienceFragmentId:
|
|
6827
|
+
experienceFragmentId: z93.string().describe("The ID of the experience fragment to retrieve details for")
|
|
6872
6828
|
});
|
|
6873
6829
|
function getExperienceFragmentTool(config) {
|
|
6874
6830
|
async function tool2(args) {
|
|
@@ -6886,12 +6842,12 @@ function getExperienceFragmentTool(config) {
|
|
|
6886
6842
|
}
|
|
6887
6843
|
|
|
6888
6844
|
// src/tools/exo/experience-fragments/listExperienceFragments.ts
|
|
6889
|
-
import { z as
|
|
6845
|
+
import { z as z94 } from "zod";
|
|
6890
6846
|
var ListExperienceFragmentsToolParams = BaseToolSchema.extend({
|
|
6891
|
-
limit:
|
|
6892
|
-
pageNext:
|
|
6893
|
-
pagePrev:
|
|
6894
|
-
order:
|
|
6847
|
+
limit: z94.number().optional().describe("Maximum number of experience fragments to return (max 10)"),
|
|
6848
|
+
pageNext: z94.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6849
|
+
pagePrev: z94.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6850
|
+
order: z94.string().optional().describe("Order experience fragments by this field (e.g. sys.createdAt)")
|
|
6895
6851
|
});
|
|
6896
6852
|
function listExperienceFragmentsTool(config) {
|
|
6897
6853
|
async function tool2(args) {
|
|
@@ -6921,21 +6877,21 @@ function listExperienceFragmentsTool(config) {
|
|
|
6921
6877
|
}
|
|
6922
6878
|
|
|
6923
6879
|
// src/tools/exo/experience-fragments/createExperienceFragment.ts
|
|
6924
|
-
import { z as
|
|
6880
|
+
import { z as z95 } from "zod";
|
|
6925
6881
|
var CreateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6926
|
-
name:
|
|
6927
|
-
description:
|
|
6882
|
+
name: z95.string().describe("The name of the experience fragment"),
|
|
6883
|
+
description: z95.string().describe("Description of the experience fragment"),
|
|
6928
6884
|
component: ComponentResourceLinkSchema.describe(
|
|
6929
6885
|
"Resource link to the component this experience fragment is based on"
|
|
6930
6886
|
),
|
|
6931
|
-
viewports:
|
|
6932
|
-
designProperties:
|
|
6887
|
+
viewports: z95.array(ViewportSchema).describe("Viewport definitions (may be empty)"),
|
|
6888
|
+
designProperties: z95.record(z95.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
6933
6889
|
"Design property values keyed by property ID (may be empty object)"
|
|
6934
6890
|
),
|
|
6935
6891
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6936
6892
|
"Optional content bindings for the experience fragment"
|
|
6937
6893
|
),
|
|
6938
|
-
slots:
|
|
6894
|
+
slots: z95.record(z95.string(), z95.array(ExperienceSlotNodeSchema)).optional().describe("Optional slot node definitions keyed by slot ID"),
|
|
6939
6895
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6940
6896
|
"Optional ExO metadata (tags, concepts)"
|
|
6941
6897
|
)
|
|
@@ -6968,20 +6924,20 @@ function createExperienceFragmentTool(config) {
|
|
|
6968
6924
|
}
|
|
6969
6925
|
|
|
6970
6926
|
// src/tools/exo/experience-fragments/updateExperienceFragment.ts
|
|
6971
|
-
import { z as
|
|
6927
|
+
import { z as z96 } from "zod";
|
|
6972
6928
|
var UpdateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6973
|
-
experienceFragmentId:
|
|
6974
|
-
version:
|
|
6929
|
+
experienceFragmentId: z96.string().describe("The ID of the experience fragment to update"),
|
|
6930
|
+
version: z96.number().describe(
|
|
6975
6931
|
"REQUIRED. The experience fragment's sys.version as returned by get_experience_fragment. You must call get_experience_fragment first to read the current state and version. The update is rejected if this does not match the current version, which means the experience fragment changed since you read it."
|
|
6976
6932
|
),
|
|
6977
|
-
name:
|
|
6978
|
-
description:
|
|
6979
|
-
viewports:
|
|
6980
|
-
designProperties:
|
|
6933
|
+
name: z96.string().optional().describe("The name of the experience fragment"),
|
|
6934
|
+
description: z96.string().optional().describe("Description of the experience fragment"),
|
|
6935
|
+
viewports: z96.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6936
|
+
designProperties: z96.record(z96.string(), DimensionedDesignPropertyValueSchema).optional().describe("Design property values; replaces existing if provided"),
|
|
6981
6937
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6982
6938
|
"Content bindings; replaces existing if provided"
|
|
6983
6939
|
),
|
|
6984
|
-
slots:
|
|
6940
|
+
slots: z96.record(z96.string(), z96.array(ExperienceSlotNodeSchema)).optional().describe("Slot node definitions; replaces existing if provided"),
|
|
6985
6941
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6986
6942
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6987
6943
|
)
|
|
@@ -7029,13 +6985,13 @@ function updateExperienceFragmentTool(config) {
|
|
|
7029
6985
|
}
|
|
7030
6986
|
|
|
7031
6987
|
// src/tools/exo/experience-fragments/deleteExperienceFragment.ts
|
|
7032
|
-
import { z as
|
|
6988
|
+
import { z as z97 } from "zod";
|
|
7033
6989
|
var DeleteExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
7034
|
-
experienceFragmentId:
|
|
7035
|
-
confirm:
|
|
6990
|
+
experienceFragmentId: z97.string().describe("The ID of the experience fragment to delete"),
|
|
6991
|
+
confirm: z97.boolean().optional().describe(
|
|
7036
6992
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7037
6993
|
),
|
|
7038
|
-
confirmToken:
|
|
6994
|
+
confirmToken: z97.string().optional().describe(
|
|
7039
6995
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7040
6996
|
)
|
|
7041
6997
|
});
|
|
@@ -7077,10 +7033,10 @@ function deleteExperienceFragmentTool(config) {
|
|
|
7077
7033
|
}
|
|
7078
7034
|
|
|
7079
7035
|
// src/tools/exo/experience-fragments/publishExperienceFragment.ts
|
|
7080
|
-
import { z as
|
|
7036
|
+
import { z as z98 } from "zod";
|
|
7081
7037
|
var PublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
7082
|
-
experienceFragmentId:
|
|
7083
|
-
version:
|
|
7038
|
+
experienceFragmentId: z98.string().describe("The ID of the experience fragment to publish"),
|
|
7039
|
+
version: z98.number().describe(
|
|
7084
7040
|
"REQUIRED. The experience fragment's sys.version as returned by get_experience_fragment. You must call get_experience_fragment first to read the current state and version. The publish is rejected if this does not match the current version, which means the experience fragment changed since you read it."
|
|
7085
7041
|
)
|
|
7086
7042
|
});
|
|
@@ -7114,10 +7070,10 @@ function publishExperienceFragmentTool(config) {
|
|
|
7114
7070
|
}
|
|
7115
7071
|
|
|
7116
7072
|
// src/tools/exo/experience-fragments/unpublishExperienceFragment.ts
|
|
7117
|
-
import { z as
|
|
7073
|
+
import { z as z99 } from "zod";
|
|
7118
7074
|
var UnpublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
7119
|
-
experienceFragmentId:
|
|
7120
|
-
version:
|
|
7075
|
+
experienceFragmentId: z99.string().describe("The ID of the experience fragment to unpublish"),
|
|
7076
|
+
version: z99.number().describe(
|
|
7121
7077
|
"REQUIRED. The experience fragment's sys.version as returned by get_experience_fragment. You must call get_experience_fragment first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the experience fragment changed since you read it."
|
|
7122
7078
|
)
|
|
7123
7079
|
});
|
|
@@ -7249,9 +7205,9 @@ function createExperienceFragmentTools(config) {
|
|
|
7249
7205
|
}
|
|
7250
7206
|
|
|
7251
7207
|
// src/tools/exo/experience-templates/getExperienceTemplate.ts
|
|
7252
|
-
import { z as
|
|
7208
|
+
import { z as z100 } from "zod";
|
|
7253
7209
|
var GetExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7254
|
-
experienceTemplateId:
|
|
7210
|
+
experienceTemplateId: z100.string().describe("The ID of the experience template to retrieve details for")
|
|
7255
7211
|
});
|
|
7256
7212
|
function getExperienceTemplateTool(config) {
|
|
7257
7213
|
async function tool2(args) {
|
|
@@ -7269,12 +7225,12 @@ function getExperienceTemplateTool(config) {
|
|
|
7269
7225
|
}
|
|
7270
7226
|
|
|
7271
7227
|
// src/tools/exo/experience-templates/listExperienceTemplates.ts
|
|
7272
|
-
import { z as
|
|
7228
|
+
import { z as z101 } from "zod";
|
|
7273
7229
|
var ListExperienceTemplatesToolParams = BaseToolSchema.extend({
|
|
7274
|
-
limit:
|
|
7275
|
-
pageNext:
|
|
7276
|
-
pagePrev:
|
|
7277
|
-
order:
|
|
7230
|
+
limit: z101.number().optional().describe("Maximum number of experience templates to return (max 10)"),
|
|
7231
|
+
pageNext: z101.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7232
|
+
pagePrev: z101.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7233
|
+
order: z101.string().optional().describe("Order experience templates by this field (e.g. sys.createdAt)")
|
|
7278
7234
|
});
|
|
7279
7235
|
function listExperienceTemplatesTool(config) {
|
|
7280
7236
|
async function tool2(args) {
|
|
@@ -7304,17 +7260,17 @@ function listExperienceTemplatesTool(config) {
|
|
|
7304
7260
|
}
|
|
7305
7261
|
|
|
7306
7262
|
// src/tools/exo/experience-templates/createExperienceTemplate.ts
|
|
7307
|
-
import { z as
|
|
7263
|
+
import { z as z102 } from "zod";
|
|
7308
7264
|
var CreateExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7309
|
-
name:
|
|
7310
|
-
description:
|
|
7311
|
-
viewports:
|
|
7265
|
+
name: z102.string().describe("The name of the experience template"),
|
|
7266
|
+
description: z102.string().describe("Description of the experience template"),
|
|
7267
|
+
viewports: z102.array(ViewportSchema).describe(
|
|
7312
7268
|
"Viewport definitions for the experience template (may be empty)"
|
|
7313
7269
|
),
|
|
7314
|
-
contentProperties:
|
|
7315
|
-
designProperties:
|
|
7316
|
-
componentTree:
|
|
7317
|
-
slots:
|
|
7270
|
+
contentProperties: z102.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
7271
|
+
designProperties: z102.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
7272
|
+
componentTree: z102.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
7273
|
+
slots: z102.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
7318
7274
|
metadata: ExoMetadataSchema.optional().describe(
|
|
7319
7275
|
"Optional ExO metadata (tags, concepts)"
|
|
7320
7276
|
)
|
|
@@ -7347,19 +7303,19 @@ function createExperienceTemplateTool(config) {
|
|
|
7347
7303
|
}
|
|
7348
7304
|
|
|
7349
7305
|
// src/tools/exo/experience-templates/upsertExperienceTemplate.ts
|
|
7350
|
-
import { z as
|
|
7306
|
+
import { z as z103 } from "zod";
|
|
7351
7307
|
var UpsertExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7352
|
-
experienceTemplateId:
|
|
7353
|
-
version:
|
|
7308
|
+
experienceTemplateId: z103.string().describe("The ID of the experience template to update"),
|
|
7309
|
+
version: z103.number().describe(
|
|
7354
7310
|
"REQUIRED. The experience template's sys.version as returned by get_experience_template. You must call get_experience_template first to read the current state and version. The update is rejected if this does not match the current version, which means the experience template changed since you read it."
|
|
7355
7311
|
),
|
|
7356
|
-
name:
|
|
7357
|
-
description:
|
|
7358
|
-
viewports:
|
|
7359
|
-
contentProperties:
|
|
7360
|
-
designProperties:
|
|
7361
|
-
componentTree:
|
|
7362
|
-
slots:
|
|
7312
|
+
name: z103.string().optional().describe("The name of the experience template"),
|
|
7313
|
+
description: z103.string().optional().describe("Description of the experience template"),
|
|
7314
|
+
viewports: z103.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7315
|
+
contentProperties: z103.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
7316
|
+
designProperties: z103.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
7317
|
+
componentTree: z103.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
7318
|
+
slots: z103.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
7363
7319
|
metadata: ExoMetadataSchema.optional().describe(
|
|
7364
7320
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7365
7321
|
)
|
|
@@ -7409,13 +7365,13 @@ function upsertExperienceTemplateTool(config) {
|
|
|
7409
7365
|
}
|
|
7410
7366
|
|
|
7411
7367
|
// src/tools/exo/experience-templates/deleteExperienceTemplate.ts
|
|
7412
|
-
import { z as
|
|
7368
|
+
import { z as z104 } from "zod";
|
|
7413
7369
|
var DeleteExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7414
|
-
experienceTemplateId:
|
|
7415
|
-
confirm:
|
|
7370
|
+
experienceTemplateId: z104.string().describe("The ID of the experience template to delete"),
|
|
7371
|
+
confirm: z104.boolean().optional().describe(
|
|
7416
7372
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7417
7373
|
),
|
|
7418
|
-
confirmToken:
|
|
7374
|
+
confirmToken: z104.string().optional().describe(
|
|
7419
7375
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7420
7376
|
)
|
|
7421
7377
|
});
|
|
@@ -7457,10 +7413,10 @@ function deleteExperienceTemplateTool(config) {
|
|
|
7457
7413
|
}
|
|
7458
7414
|
|
|
7459
7415
|
// src/tools/exo/experience-templates/publishExperienceTemplate.ts
|
|
7460
|
-
import { z as
|
|
7416
|
+
import { z as z105 } from "zod";
|
|
7461
7417
|
var PublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7462
|
-
experienceTemplateId:
|
|
7463
|
-
version:
|
|
7418
|
+
experienceTemplateId: z105.string().describe("The ID of the experience template to publish"),
|
|
7419
|
+
version: z105.number().describe(
|
|
7464
7420
|
"REQUIRED. The experience template's sys.version as returned by get_experience_template. You must call get_experience_template first to read the current state and version. The publish is rejected if this does not match the current version, which means the experience template changed since you read it."
|
|
7465
7421
|
)
|
|
7466
7422
|
});
|
|
@@ -7494,10 +7450,10 @@ function publishExperienceTemplateTool(config) {
|
|
|
7494
7450
|
}
|
|
7495
7451
|
|
|
7496
7452
|
// src/tools/exo/experience-templates/unpublishExperienceTemplate.ts
|
|
7497
|
-
import { z as
|
|
7453
|
+
import { z as z106 } from "zod";
|
|
7498
7454
|
var UnpublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7499
|
-
experienceTemplateId:
|
|
7500
|
-
version:
|
|
7455
|
+
experienceTemplateId: z106.string().describe("The ID of the experience template to unpublish"),
|
|
7456
|
+
version: z106.number().describe(
|
|
7501
7457
|
"REQUIRED. The experience template's sys.version as returned by get_experience_template. You must call get_experience_template first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the experience template changed since you read it."
|
|
7502
7458
|
)
|
|
7503
7459
|
});
|
|
@@ -7629,9 +7585,9 @@ function createExperienceTemplateTools(config) {
|
|
|
7629
7585
|
}
|
|
7630
7586
|
|
|
7631
7587
|
// src/tools/exo/experiences/getExperience.ts
|
|
7632
|
-
import { z as
|
|
7588
|
+
import { z as z107 } from "zod";
|
|
7633
7589
|
var GetExperienceToolParams = BaseToolSchema.extend({
|
|
7634
|
-
experienceId:
|
|
7590
|
+
experienceId: z107.string().describe("The ID of the experience to retrieve")
|
|
7635
7591
|
});
|
|
7636
7592
|
function getExperienceTool(config) {
|
|
7637
7593
|
async function tool2(args) {
|
|
@@ -7649,12 +7605,12 @@ function getExperienceTool(config) {
|
|
|
7649
7605
|
}
|
|
7650
7606
|
|
|
7651
7607
|
// src/tools/exo/experiences/listExperiences.ts
|
|
7652
|
-
import { z as
|
|
7608
|
+
import { z as z108 } from "zod";
|
|
7653
7609
|
var ListExperiencesToolParams = BaseToolSchema.extend({
|
|
7654
|
-
limit:
|
|
7655
|
-
pageNext:
|
|
7656
|
-
pagePrev:
|
|
7657
|
-
order:
|
|
7610
|
+
limit: z108.number().optional().describe("Maximum number of experiences to return (max 10)"),
|
|
7611
|
+
pageNext: z108.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7612
|
+
pagePrev: z108.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7613
|
+
order: z108.string().optional().describe("Order experiences by this field (e.g. sys.createdAt)")
|
|
7658
7614
|
});
|
|
7659
7615
|
function listExperiencesTool(config) {
|
|
7660
7616
|
async function tool2(args) {
|
|
@@ -7684,21 +7640,21 @@ function listExperiencesTool(config) {
|
|
|
7684
7640
|
}
|
|
7685
7641
|
|
|
7686
7642
|
// src/tools/exo/experiences/createExperience.ts
|
|
7687
|
-
import { z as
|
|
7643
|
+
import { z as z109 } from "zod";
|
|
7688
7644
|
var CreateExperienceToolParams = BaseToolSchema.extend({
|
|
7689
|
-
name:
|
|
7690
|
-
description:
|
|
7645
|
+
name: z109.string().describe("The name of the experience"),
|
|
7646
|
+
description: z109.string().describe("Description of the experience"),
|
|
7691
7647
|
experienceTemplate: ExperienceTemplateResourceLinkSchema.describe(
|
|
7692
7648
|
"Resource link to the ExperienceTemplate this experience is backed by"
|
|
7693
7649
|
),
|
|
7694
|
-
viewports:
|
|
7695
|
-
designProperties:
|
|
7650
|
+
viewports: z109.array(ViewportSchema).describe("Viewport definitions for the experience (may be empty)"),
|
|
7651
|
+
designProperties: z109.record(z109.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
7696
7652
|
"Design property values keyed by property ID. Each value is a dimensioned map (viewport ID \u2192 design value). May be an empty object."
|
|
7697
7653
|
),
|
|
7698
7654
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7699
7655
|
"Optional content bindings linking this experience to a data assembly"
|
|
7700
7656
|
),
|
|
7701
|
-
slots:
|
|
7657
|
+
slots: z109.record(z109.string(), z109.array(ExperienceSlotNodeSchema)).optional().describe(
|
|
7702
7658
|
"Optional slot contents keyed by slot ID. Each value is an array of ExperienceFragmentNode or InlineExperienceFragmentNode."
|
|
7703
7659
|
),
|
|
7704
7660
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
@@ -7733,22 +7689,22 @@ function createExperienceTool(config) {
|
|
|
7733
7689
|
}
|
|
7734
7690
|
|
|
7735
7691
|
// src/tools/exo/experiences/upsertExperience.ts
|
|
7736
|
-
import { z as
|
|
7692
|
+
import { z as z110 } from "zod";
|
|
7737
7693
|
var UpsertExperienceToolParams = BaseToolSchema.extend({
|
|
7738
|
-
experienceId:
|
|
7739
|
-
version:
|
|
7694
|
+
experienceId: z110.string().describe("The ID of the experience to update"),
|
|
7695
|
+
version: z110.number().describe(
|
|
7740
7696
|
"REQUIRED. The experience's sys.version as returned by get_experience. You must call get_experience first to read the current state and version. The update is rejected if this does not match the current version, which means the experience changed since you read it."
|
|
7741
7697
|
),
|
|
7742
|
-
name:
|
|
7743
|
-
description:
|
|
7744
|
-
viewports:
|
|
7745
|
-
designProperties:
|
|
7698
|
+
name: z110.string().optional().describe("The name of the experience"),
|
|
7699
|
+
description: z110.string().optional().describe("Description of the experience"),
|
|
7700
|
+
viewports: z110.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7701
|
+
designProperties: z110.record(z110.string(), DimensionedDesignPropertyValueSchema).optional().describe(
|
|
7746
7702
|
"Design property values keyed by property ID; replaces existing if provided"
|
|
7747
7703
|
),
|
|
7748
7704
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7749
7705
|
"Content bindings linking this experience to a data assembly; replaces existing if provided"
|
|
7750
7706
|
),
|
|
7751
|
-
slots:
|
|
7707
|
+
slots: z110.record(z110.string(), z110.array(ExperienceSlotNodeSchema)).optional().describe("Slot contents keyed by slot ID; replaces existing if provided"),
|
|
7752
7708
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
7753
7709
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7754
7710
|
)
|
|
@@ -7793,13 +7749,13 @@ function upsertExperienceTool(config) {
|
|
|
7793
7749
|
}
|
|
7794
7750
|
|
|
7795
7751
|
// src/tools/exo/experiences/deleteExperience.ts
|
|
7796
|
-
import { z as
|
|
7752
|
+
import { z as z111 } from "zod";
|
|
7797
7753
|
var DeleteExperienceToolParams = BaseToolSchema.extend({
|
|
7798
|
-
experienceId:
|
|
7799
|
-
confirm:
|
|
7754
|
+
experienceId: z111.string().describe("The ID of the experience to delete"),
|
|
7755
|
+
confirm: z111.boolean().optional().describe(
|
|
7800
7756
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7801
7757
|
),
|
|
7802
|
-
confirmToken:
|
|
7758
|
+
confirmToken: z111.string().optional().describe(
|
|
7803
7759
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7804
7760
|
)
|
|
7805
7761
|
});
|
|
@@ -7841,10 +7797,10 @@ function deleteExperienceTool(config) {
|
|
|
7841
7797
|
}
|
|
7842
7798
|
|
|
7843
7799
|
// src/tools/exo/experiences/publishExperience.ts
|
|
7844
|
-
import { z as
|
|
7800
|
+
import { z as z112 } from "zod";
|
|
7845
7801
|
var PublishExperienceToolParams = BaseToolSchema.extend({
|
|
7846
|
-
experienceId:
|
|
7847
|
-
version:
|
|
7802
|
+
experienceId: z112.string().describe("The ID of the experience to publish"),
|
|
7803
|
+
version: z112.number().describe(
|
|
7848
7804
|
"REQUIRED. The experience's sys.version as returned by get_experience. You must call get_experience first to read the current state and version. The publish is rejected if this does not match the current version, which means the experience changed since you read it."
|
|
7849
7805
|
)
|
|
7850
7806
|
});
|
|
@@ -7878,10 +7834,10 @@ function publishExperienceTool(config) {
|
|
|
7878
7834
|
}
|
|
7879
7835
|
|
|
7880
7836
|
// src/tools/exo/experiences/unpublishExperience.ts
|
|
7881
|
-
import { z as
|
|
7837
|
+
import { z as z113 } from "zod";
|
|
7882
7838
|
var UnpublishExperienceToolParams = BaseToolSchema.extend({
|
|
7883
|
-
experienceId:
|
|
7884
|
-
version:
|
|
7839
|
+
experienceId: z113.string().describe("The ID of the experience to unpublish"),
|
|
7840
|
+
version: z113.number().describe(
|
|
7885
7841
|
"REQUIRED. The experience's sys.version as returned by get_experience. You must call get_experience first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the experience changed since you read it."
|
|
7886
7842
|
)
|
|
7887
7843
|
});
|
|
@@ -8010,9 +7966,9 @@ function createExperienceTools(config) {
|
|
|
8010
7966
|
}
|
|
8011
7967
|
|
|
8012
7968
|
// src/tools/exo/data-assemblies/getDataAssembly.ts
|
|
8013
|
-
import { z as
|
|
7969
|
+
import { z as z114 } from "zod";
|
|
8014
7970
|
var GetDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8015
|
-
dataAssemblyId:
|
|
7971
|
+
dataAssemblyId: z114.string().describe("The ID of the data assembly to retrieve")
|
|
8016
7972
|
});
|
|
8017
7973
|
function getDataAssemblyTool(config) {
|
|
8018
7974
|
async function tool2(args) {
|
|
@@ -8030,9 +7986,9 @@ function getDataAssemblyTool(config) {
|
|
|
8030
7986
|
}
|
|
8031
7987
|
|
|
8032
7988
|
// src/tools/exo/data-assemblies/getPublishedDataAssembly.ts
|
|
8033
|
-
import { z as
|
|
7989
|
+
import { z as z115 } from "zod";
|
|
8034
7990
|
var GetPublishedDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8035
|
-
dataAssemblyId:
|
|
7991
|
+
dataAssemblyId: z115.string().describe("The ID of the published data assembly to retrieve")
|
|
8036
7992
|
});
|
|
8037
7993
|
function getPublishedDataAssemblyTool(config) {
|
|
8038
7994
|
async function tool2(args) {
|
|
@@ -8050,12 +8006,12 @@ function getPublishedDataAssemblyTool(config) {
|
|
|
8050
8006
|
}
|
|
8051
8007
|
|
|
8052
8008
|
// src/tools/exo/data-assemblies/listDataAssemblies.ts
|
|
8053
|
-
import { z as
|
|
8009
|
+
import { z as z116 } from "zod";
|
|
8054
8010
|
var ListDataAssembliesToolParams = BaseToolSchema.extend({
|
|
8055
|
-
limit:
|
|
8056
|
-
pageNext:
|
|
8057
|
-
pagePrev:
|
|
8058
|
-
sysIdIn:
|
|
8011
|
+
limit: z116.number().optional().describe("Maximum number of data assemblies to return (max 10)"),
|
|
8012
|
+
pageNext: z116.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8013
|
+
pagePrev: z116.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8014
|
+
sysIdIn: z116.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
8059
8015
|
});
|
|
8060
8016
|
function listDataAssembliesTool(config) {
|
|
8061
8017
|
async function tool2(args) {
|
|
@@ -8084,12 +8040,12 @@ function listDataAssembliesTool(config) {
|
|
|
8084
8040
|
}
|
|
8085
8041
|
|
|
8086
8042
|
// src/tools/exo/data-assemblies/listPublishedDataAssemblies.ts
|
|
8087
|
-
import { z as
|
|
8043
|
+
import { z as z117 } from "zod";
|
|
8088
8044
|
var ListPublishedDataAssembliesToolParams = BaseToolSchema.extend({
|
|
8089
|
-
limit:
|
|
8090
|
-
pageNext:
|
|
8091
|
-
pagePrev:
|
|
8092
|
-
sysIdIn:
|
|
8045
|
+
limit: z117.number().optional().describe("Maximum number of published data assemblies to return (max 10)"),
|
|
8046
|
+
pageNext: z117.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8047
|
+
pagePrev: z117.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8048
|
+
sysIdIn: z117.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
8093
8049
|
});
|
|
8094
8050
|
function listPublishedDataAssembliesTool(config) {
|
|
8095
8051
|
async function tool2(args) {
|
|
@@ -8118,35 +8074,35 @@ function listPublishedDataAssembliesTool(config) {
|
|
|
8118
8074
|
}
|
|
8119
8075
|
|
|
8120
8076
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
8121
|
-
import { z as
|
|
8077
|
+
import { z as z119 } from "zod";
|
|
8122
8078
|
|
|
8123
8079
|
// src/types/dataAssemblySchemas.ts
|
|
8124
|
-
import { z as
|
|
8125
|
-
var PointerExpressionValueSchema =
|
|
8126
|
-
() =>
|
|
8127
|
-
|
|
8128
|
-
|
|
8129
|
-
$from:
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
source:
|
|
8080
|
+
import { z as z118 } from "zod";
|
|
8081
|
+
var PointerExpressionValueSchema = z118.lazy(
|
|
8082
|
+
() => z118.union([
|
|
8083
|
+
z118.string(),
|
|
8084
|
+
z118.object({
|
|
8085
|
+
$from: z118.union([
|
|
8086
|
+
z118.string(),
|
|
8087
|
+
z118.object({
|
|
8088
|
+
source: z118.string(),
|
|
8133
8089
|
select: PointerExpressionValueSchema.optional()
|
|
8134
8090
|
})
|
|
8135
8091
|
])
|
|
8136
8092
|
}),
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
$on:
|
|
8141
|
-
type:
|
|
8093
|
+
z118.object({ $literal: z118.custom() }),
|
|
8094
|
+
z118.object({ $object: z118.record(z118.string(), PointerExpressionValueSchema) }),
|
|
8095
|
+
z118.object({
|
|
8096
|
+
$on: z118.object({
|
|
8097
|
+
type: z118.record(z118.string(), PointerExpressionValueSchema),
|
|
8142
8098
|
default: PointerExpressionValueSchema.optional()
|
|
8143
8099
|
})
|
|
8144
8100
|
}),
|
|
8145
|
-
|
|
8101
|
+
z118.record(z118.string(), PointerExpressionValueSchema)
|
|
8146
8102
|
])
|
|
8147
8103
|
);
|
|
8148
|
-
var CanonicalDataTypeArmSchema =
|
|
8149
|
-
type:
|
|
8104
|
+
var CanonicalDataTypeArmSchema = z118.object({
|
|
8105
|
+
type: z118.enum([
|
|
8150
8106
|
"String",
|
|
8151
8107
|
"Number",
|
|
8152
8108
|
"Integer",
|
|
@@ -8158,72 +8114,72 @@ var CanonicalDataTypeArmSchema = z119.object({
|
|
|
8158
8114
|
"Literal",
|
|
8159
8115
|
"DiscriminatedUnion"
|
|
8160
8116
|
]),
|
|
8161
|
-
id:
|
|
8162
|
-
name:
|
|
8163
|
-
required:
|
|
8164
|
-
}).catchall(
|
|
8165
|
-
var LegacyDataTypeArmSchema =
|
|
8166
|
-
id:
|
|
8167
|
-
name:
|
|
8168
|
-
type:
|
|
8169
|
-
required:
|
|
8170
|
-
source:
|
|
8171
|
-
ref:
|
|
8172
|
-
});
|
|
8173
|
-
var DataAssemblyDataTypeFieldSchema =
|
|
8117
|
+
id: z118.string().describe("Data type field identifier"),
|
|
8118
|
+
name: z118.string().describe("Human-readable name"),
|
|
8119
|
+
required: z118.boolean().optional()
|
|
8120
|
+
}).catchall(z118.unknown());
|
|
8121
|
+
var LegacyDataTypeArmSchema = z118.object({
|
|
8122
|
+
id: z118.string().describe("Data type field identifier"),
|
|
8123
|
+
name: z118.string().describe("Human-readable name"),
|
|
8124
|
+
type: z118.string(),
|
|
8125
|
+
required: z118.boolean().optional(),
|
|
8126
|
+
source: z118.string().optional(),
|
|
8127
|
+
ref: z118.unknown().optional()
|
|
8128
|
+
});
|
|
8129
|
+
var DataAssemblyDataTypeFieldSchema = z118.union([
|
|
8174
8130
|
CanonicalDataTypeArmSchema,
|
|
8175
8131
|
LegacyDataTypeArmSchema
|
|
8176
8132
|
]);
|
|
8177
8133
|
var SAME_SPACE_CONTENT_SOURCE = "crn:contentful:::content:spaces/$self/environments/$self";
|
|
8178
|
-
var DataAssemblyResourceLinkParameterSchema =
|
|
8179
|
-
name:
|
|
8180
|
-
description:
|
|
8181
|
-
type:
|
|
8182
|
-
linkType:
|
|
8183
|
-
allowedResources:
|
|
8184
|
-
|
|
8185
|
-
type:
|
|
8186
|
-
source:
|
|
8187
|
-
allowedTypes:
|
|
8134
|
+
var DataAssemblyResourceLinkParameterSchema = z118.object({
|
|
8135
|
+
name: z118.string().optional(),
|
|
8136
|
+
description: z118.string().optional(),
|
|
8137
|
+
type: z118.literal("ResourceLink"),
|
|
8138
|
+
linkType: z118.literal("Contentful:Entry"),
|
|
8139
|
+
allowedResources: z118.array(
|
|
8140
|
+
z118.object({
|
|
8141
|
+
type: z118.literal("Contentful:Entry"),
|
|
8142
|
+
source: z118.literal(SAME_SPACE_CONTENT_SOURCE),
|
|
8143
|
+
allowedTypes: z118.array(z118.string())
|
|
8188
8144
|
})
|
|
8189
8145
|
)
|
|
8190
8146
|
});
|
|
8191
|
-
var DataAssemblyParameterConfigSchema =
|
|
8192
|
-
|
|
8147
|
+
var DataAssemblyParameterConfigSchema = z118.record(
|
|
8148
|
+
z118.string(),
|
|
8193
8149
|
DataAssemblyResourceLinkParameterSchema
|
|
8194
8150
|
);
|
|
8195
|
-
var DataAssemblyGraphQLResolverSchema =
|
|
8196
|
-
source:
|
|
8197
|
-
query:
|
|
8151
|
+
var DataAssemblyGraphQLResolverSchema = z118.object({
|
|
8152
|
+
source: z118.literal("Contentful:GraphQL"),
|
|
8153
|
+
query: z118.string().describe("GraphQL query string"),
|
|
8198
8154
|
parameters: PointerExpressionValueSchema.optional()
|
|
8199
8155
|
});
|
|
8200
|
-
var DataAssemblyNestedResolverSchema =
|
|
8201
|
-
source:
|
|
8202
|
-
dataAssembly:
|
|
8203
|
-
sys:
|
|
8204
|
-
type:
|
|
8205
|
-
linkType:
|
|
8206
|
-
urn:
|
|
8156
|
+
var DataAssemblyNestedResolverSchema = z118.object({
|
|
8157
|
+
source: z118.literal("Contentful:DataAssembly"),
|
|
8158
|
+
dataAssembly: z118.object({
|
|
8159
|
+
sys: z118.object({
|
|
8160
|
+
type: z118.literal("ResourceLink"),
|
|
8161
|
+
linkType: z118.literal("Contentful:DataAssembly"),
|
|
8162
|
+
urn: z118.string()
|
|
8207
8163
|
})
|
|
8208
8164
|
}),
|
|
8209
8165
|
parameters: PointerExpressionValueSchema.optional()
|
|
8210
8166
|
});
|
|
8211
|
-
var DataAssemblyResolverDefinitionSchema =
|
|
8167
|
+
var DataAssemblyResolverDefinitionSchema = z118.union([
|
|
8212
8168
|
DataAssemblyGraphQLResolverSchema,
|
|
8213
8169
|
DataAssemblyNestedResolverSchema
|
|
8214
8170
|
]);
|
|
8215
|
-
var DataAssemblyResolverConfigSchema =
|
|
8216
|
-
|
|
8171
|
+
var DataAssemblyResolverConfigSchema = z118.record(
|
|
8172
|
+
z118.string(),
|
|
8217
8173
|
DataAssemblyResolverDefinitionSchema
|
|
8218
8174
|
);
|
|
8219
8175
|
var DataAssemblyReturnMappingConfigSchema = PointerExpressionValueSchema;
|
|
8220
|
-
var DataAssemblyMetadataSchema =
|
|
8221
|
-
tags:
|
|
8222
|
-
|
|
8223
|
-
sys:
|
|
8224
|
-
type:
|
|
8225
|
-
linkType:
|
|
8226
|
-
id:
|
|
8176
|
+
var DataAssemblyMetadataSchema = z118.object({
|
|
8177
|
+
tags: z118.array(
|
|
8178
|
+
z118.object({
|
|
8179
|
+
sys: z118.object({
|
|
8180
|
+
type: z118.literal("Link"),
|
|
8181
|
+
linkType: z118.literal("Tag"),
|
|
8182
|
+
id: z118.string()
|
|
8227
8183
|
})
|
|
8228
8184
|
})
|
|
8229
8185
|
)
|
|
@@ -8231,8 +8187,8 @@ var DataAssemblyMetadataSchema = z119.object({
|
|
|
8231
8187
|
|
|
8232
8188
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
8233
8189
|
var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8234
|
-
name:
|
|
8235
|
-
description:
|
|
8190
|
+
name: z119.string().describe("The name of the data assembly"),
|
|
8191
|
+
description: z119.string().describe("Description of the data assembly"),
|
|
8236
8192
|
parameters: DataAssemblyParameterConfigSchema.describe(
|
|
8237
8193
|
"Parameter definitions keyed by parameter name (may be empty object)"
|
|
8238
8194
|
),
|
|
@@ -8242,8 +8198,8 @@ var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
8242
8198
|
return: DataAssemblyReturnMappingConfigSchema.describe(
|
|
8243
8199
|
"Return mapping configuration specifying how to map resolved data"
|
|
8244
8200
|
),
|
|
8245
|
-
dataType:
|
|
8246
|
-
variant:
|
|
8201
|
+
dataType: z119.array(DataAssemblyDataTypeFieldSchema).describe("Data type field definitions for this data assembly (may be empty array)"),
|
|
8202
|
+
variant: z119.string().optional().describe("Optional variant identifier for this data assembly"),
|
|
8247
8203
|
metadata: DataAssemblyMetadataSchema.optional().describe("Optional metadata (tags)")
|
|
8248
8204
|
});
|
|
8249
8205
|
function createDataAssemblyTool(config) {
|
|
@@ -8277,14 +8233,14 @@ function createDataAssemblyTool(config) {
|
|
|
8277
8233
|
}
|
|
8278
8234
|
|
|
8279
8235
|
// src/tools/exo/data-assemblies/updateDataAssembly.ts
|
|
8280
|
-
import { z as
|
|
8236
|
+
import { z as z120 } from "zod";
|
|
8281
8237
|
var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8282
|
-
dataAssemblyId:
|
|
8283
|
-
version:
|
|
8238
|
+
dataAssemblyId: z120.string().describe("The ID of the data assembly to update"),
|
|
8239
|
+
version: z120.number().describe(
|
|
8284
8240
|
"REQUIRED. The data assembly's sys.version as returned by get_data_assembly. You must call get_data_assembly first to read the current state and version. The update is rejected if this does not match the current version, which means the data assembly changed since you read it."
|
|
8285
8241
|
),
|
|
8286
|
-
name:
|
|
8287
|
-
description:
|
|
8242
|
+
name: z120.string().optional().describe("The name of the data assembly"),
|
|
8243
|
+
description: z120.string().optional().describe("Description of the data assembly"),
|
|
8288
8244
|
parameters: DataAssemblyParameterConfigSchema.optional().describe(
|
|
8289
8245
|
"Parameter definitions; replaces existing if provided"
|
|
8290
8246
|
),
|
|
@@ -8294,8 +8250,8 @@ var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
8294
8250
|
return: DataAssemblyReturnMappingConfigSchema.optional().describe(
|
|
8295
8251
|
"Return mapping configuration; replaces existing if provided"
|
|
8296
8252
|
),
|
|
8297
|
-
dataType:
|
|
8298
|
-
variant:
|
|
8253
|
+
dataType: z120.array(DataAssemblyDataTypeFieldSchema).optional().describe("Data type field definitions; replaces existing if provided"),
|
|
8254
|
+
variant: z120.string().optional().describe("Optional variant identifier; replaces existing if provided"),
|
|
8299
8255
|
metadata: DataAssemblyMetadataSchema.optional().describe(
|
|
8300
8256
|
"Metadata (tags); replaces existing if provided"
|
|
8301
8257
|
)
|
|
@@ -8341,13 +8297,13 @@ function updateDataAssemblyTool(config) {
|
|
|
8341
8297
|
}
|
|
8342
8298
|
|
|
8343
8299
|
// src/tools/exo/data-assemblies/deleteDataAssembly.ts
|
|
8344
|
-
import { z as
|
|
8300
|
+
import { z as z121 } from "zod";
|
|
8345
8301
|
var DeleteDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8346
|
-
dataAssemblyId:
|
|
8347
|
-
confirm:
|
|
8302
|
+
dataAssemblyId: z121.string().describe("The ID of the data assembly to delete"),
|
|
8303
|
+
confirm: z121.boolean().optional().describe(
|
|
8348
8304
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
8349
8305
|
),
|
|
8350
|
-
confirmToken:
|
|
8306
|
+
confirmToken: z121.string().optional().describe(
|
|
8351
8307
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
8352
8308
|
)
|
|
8353
8309
|
});
|
|
@@ -8389,10 +8345,10 @@ function deleteDataAssemblyTool(config) {
|
|
|
8389
8345
|
}
|
|
8390
8346
|
|
|
8391
8347
|
// src/tools/exo/data-assemblies/publishDataAssembly.ts
|
|
8392
|
-
import { z as
|
|
8348
|
+
import { z as z122 } from "zod";
|
|
8393
8349
|
var PublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8394
|
-
dataAssemblyId:
|
|
8395
|
-
version:
|
|
8350
|
+
dataAssemblyId: z122.string().describe("The ID of the data assembly to publish"),
|
|
8351
|
+
version: z122.number().describe(
|
|
8396
8352
|
"REQUIRED. The data assembly's sys.version as returned by get_data_assembly. You must call get_data_assembly first to read the current state and version. The publish is rejected if this does not match the current version, which means the data assembly changed since you read it."
|
|
8397
8353
|
)
|
|
8398
8354
|
});
|
|
@@ -8426,10 +8382,10 @@ function publishDataAssemblyTool(config) {
|
|
|
8426
8382
|
}
|
|
8427
8383
|
|
|
8428
8384
|
// src/tools/exo/data-assemblies/unpublishDataAssembly.ts
|
|
8429
|
-
import { z as
|
|
8385
|
+
import { z as z123 } from "zod";
|
|
8430
8386
|
var UnpublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8431
|
-
dataAssemblyId:
|
|
8432
|
-
version:
|
|
8387
|
+
dataAssemblyId: z123.string().describe("The ID of the data assembly to unpublish"),
|
|
8388
|
+
version: z123.number().describe(
|
|
8433
8389
|
"REQUIRED. The data assembly's sys.version as returned by get_data_assembly. You must call get_data_assembly first to read the current state and version. The unpublish is rejected if this does not match the current version, which means the data assembly changed since you read it."
|
|
8434
8390
|
)
|
|
8435
8391
|
});
|
|
@@ -8581,6 +8537,231 @@ function createDataAssemblyTools(config) {
|
|
|
8581
8537
|
};
|
|
8582
8538
|
}
|
|
8583
8539
|
|
|
8540
|
+
// src/tools/exo/design-tokens/getDesignToken.ts
|
|
8541
|
+
import { z as z124 } from "zod";
|
|
8542
|
+
var GetDesignTokenToolParams = BaseToolSchema.extend({
|
|
8543
|
+
designTokenId: z124.string().describe("The ID of the design token to retrieve details for")
|
|
8544
|
+
});
|
|
8545
|
+
function getDesignTokenTool(config) {
|
|
8546
|
+
async function tool2(args) {
|
|
8547
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
8548
|
+
const designToken = await contentfulClient.designToken.get({
|
|
8549
|
+
spaceId: args.spaceId,
|
|
8550
|
+
environmentId: args.environmentId,
|
|
8551
|
+
designTokenId: args.designTokenId
|
|
8552
|
+
});
|
|
8553
|
+
return createSuccessResponse("Design token retrieved successfully", {
|
|
8554
|
+
designToken
|
|
8555
|
+
});
|
|
8556
|
+
}
|
|
8557
|
+
return withErrorHandling(tool2, "Error retrieving design token");
|
|
8558
|
+
}
|
|
8559
|
+
|
|
8560
|
+
// src/tools/exo/design-tokens/listDesignTokens.ts
|
|
8561
|
+
import { z as z125 } from "zod";
|
|
8562
|
+
var ListDesignTokensToolParams = BaseToolSchema.extend({
|
|
8563
|
+
limit: z125.number().optional().describe("Maximum number of design tokens to return (max 10)"),
|
|
8564
|
+
pageNext: z125.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8565
|
+
pagePrev: z125.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8566
|
+
type: z125.enum(DTCG_DESIGN_PROPERTY_TYPES).optional().describe("Filter to design tokens of this DTCG type (e.g. DTCG.Color)")
|
|
8567
|
+
});
|
|
8568
|
+
function listDesignTokensTool(config) {
|
|
8569
|
+
async function tool2(args) {
|
|
8570
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
8571
|
+
const cursorParam = args.pageNext ? { pageNext: args.pageNext } : args.pagePrev ? { pagePrev: args.pagePrev } : {};
|
|
8572
|
+
const designTokens = await contentfulClient.designToken.getMany({
|
|
8573
|
+
spaceId: args.spaceId,
|
|
8574
|
+
environmentId: args.environmentId,
|
|
8575
|
+
query: {
|
|
8576
|
+
limit: Math.min(args.limit || 10, 10),
|
|
8577
|
+
...args.type && { type: args.type },
|
|
8578
|
+
...cursorParam
|
|
8579
|
+
}
|
|
8580
|
+
});
|
|
8581
|
+
const summarized = summarizeData(designTokens, {
|
|
8582
|
+
maxItems: 10,
|
|
8583
|
+
remainingMessage: "To see more design tokens, ask me to retrieve the next page using the pageNext cursor."
|
|
8584
|
+
});
|
|
8585
|
+
return createSuccessResponse("Design tokens retrieved successfully", {
|
|
8586
|
+
designTokens: summarized,
|
|
8587
|
+
total: designTokens.total,
|
|
8588
|
+
limit: designTokens.limit,
|
|
8589
|
+
pages: designTokens.pages
|
|
8590
|
+
});
|
|
8591
|
+
}
|
|
8592
|
+
return withErrorHandling(tool2, "Error listing design tokens");
|
|
8593
|
+
}
|
|
8594
|
+
|
|
8595
|
+
// src/tools/exo/design-tokens/upsertDesignToken.ts
|
|
8596
|
+
import { z as z126 } from "zod";
|
|
8597
|
+
var UpsertDesignTokenToolParams = BaseToolSchema.extend({
|
|
8598
|
+
designTokenId: z126.string().describe("The ID of the design token to create or update"),
|
|
8599
|
+
version: z126.number().optional().describe(
|
|
8600
|
+
"The design token's sys.version, required when updating an existing token. You must call get_design_token first to read the current state and version. The update is rejected if this does not match the current version, which means the token changed since you read it. Omit this entirely to create a new design token with this designTokenId \u2014 in that case name and type are required. Design tokens have no separate publish step: every upsert auto-publishes server-side, which bumps sys.version by 2 (not 1) per call."
|
|
8601
|
+
),
|
|
8602
|
+
name: z126.string().optional().describe("The name of the design token; required when creating"),
|
|
8603
|
+
type: z126.enum(DTCG_DESIGN_PROPERTY_TYPES).optional().describe("The DTCG type of the design token; required when creating"),
|
|
8604
|
+
metadata: ExoMetadataSchema.optional().describe(
|
|
8605
|
+
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
8606
|
+
)
|
|
8607
|
+
});
|
|
8608
|
+
function upsertDesignTokenTool(config) {
|
|
8609
|
+
async function tool2(args) {
|
|
8610
|
+
assertEnvironmentNotProtected(
|
|
8611
|
+
args.environmentId,
|
|
8612
|
+
config.protectedEnvironments
|
|
8613
|
+
);
|
|
8614
|
+
const params = {
|
|
8615
|
+
spaceId: args.spaceId,
|
|
8616
|
+
environmentId: args.environmentId,
|
|
8617
|
+
designTokenId: args.designTokenId
|
|
8618
|
+
};
|
|
8619
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
8620
|
+
if (args.version !== void 0) {
|
|
8621
|
+
const current = await contentfulClient.designToken.get(params);
|
|
8622
|
+
if (args.version !== current.sys.version) {
|
|
8623
|
+
throw new Error(
|
|
8624
|
+
`Version conflict: the design token has changed since you read it (your version: ${args.version}, current version: ${current.sys.version}). Re-fetch the design token with get_design_token and retry the update with the latest sys.version.`
|
|
8625
|
+
);
|
|
8626
|
+
}
|
|
8627
|
+
const designToken2 = await contentfulClient.designToken.upsert(params, {
|
|
8628
|
+
sys: {
|
|
8629
|
+
id: current.sys.id,
|
|
8630
|
+
type: "DesignToken",
|
|
8631
|
+
version: current.sys.version
|
|
8632
|
+
},
|
|
8633
|
+
name: args.name ?? current.name,
|
|
8634
|
+
type: args.type ?? current.type,
|
|
8635
|
+
...(args.metadata ?? current.metadata) && {
|
|
8636
|
+
metadata: args.metadata ?? current.metadata
|
|
8637
|
+
}
|
|
8638
|
+
});
|
|
8639
|
+
return createSuccessResponse("Design token updated successfully", {
|
|
8640
|
+
designToken: designToken2
|
|
8641
|
+
});
|
|
8642
|
+
}
|
|
8643
|
+
if (!args.name || !args.type) {
|
|
8644
|
+
throw new Error(
|
|
8645
|
+
"name and type are required when creating a new design token (no version supplied)."
|
|
8646
|
+
);
|
|
8647
|
+
}
|
|
8648
|
+
const designToken = await contentfulClient.designToken.upsert(params, {
|
|
8649
|
+
sys: { id: args.designTokenId, type: "DesignToken" },
|
|
8650
|
+
name: args.name,
|
|
8651
|
+
type: args.type,
|
|
8652
|
+
...args.metadata && { metadata: args.metadata }
|
|
8653
|
+
});
|
|
8654
|
+
return createSuccessResponse("Design token created successfully", {
|
|
8655
|
+
designToken
|
|
8656
|
+
});
|
|
8657
|
+
}
|
|
8658
|
+
return withErrorHandling(tool2, "Error upserting design token");
|
|
8659
|
+
}
|
|
8660
|
+
|
|
8661
|
+
// src/tools/exo/design-tokens/deleteDesignToken.ts
|
|
8662
|
+
import { z as z127 } from "zod";
|
|
8663
|
+
var DeleteDesignTokenToolParams = BaseToolSchema.extend({
|
|
8664
|
+
designTokenId: z127.string().describe("The ID of the design token to delete"),
|
|
8665
|
+
confirm: z127.boolean().optional().describe(
|
|
8666
|
+
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
8667
|
+
),
|
|
8668
|
+
confirmToken: z127.string().optional().describe(
|
|
8669
|
+
"Token returned by the preview call; must be supplied with confirm: true."
|
|
8670
|
+
)
|
|
8671
|
+
});
|
|
8672
|
+
function deleteDesignTokenTool(config) {
|
|
8673
|
+
async function tool2(args) {
|
|
8674
|
+
assertEnvironmentNotProtected(
|
|
8675
|
+
args.environmentId,
|
|
8676
|
+
config.protectedEnvironments
|
|
8677
|
+
);
|
|
8678
|
+
const params = {
|
|
8679
|
+
spaceId: args.spaceId,
|
|
8680
|
+
environmentId: args.environmentId,
|
|
8681
|
+
designTokenId: args.designTokenId
|
|
8682
|
+
};
|
|
8683
|
+
const contentfulClient = createExoToolClient(config, args);
|
|
8684
|
+
const designToken = await contentfulClient.designToken.get(params);
|
|
8685
|
+
const expectedToken = buildConfirmToken(
|
|
8686
|
+
"designToken",
|
|
8687
|
+
args.designTokenId,
|
|
8688
|
+
designToken.sys.version
|
|
8689
|
+
);
|
|
8690
|
+
if (args.confirm !== true || args.confirmToken !== expectedToken) {
|
|
8691
|
+
return createSuccessResponse(
|
|
8692
|
+
`${CONFIRMATION_MESSAGE_PREFIX} design token`,
|
|
8693
|
+
buildConfirmationPreview(
|
|
8694
|
+
"designToken",
|
|
8695
|
+
args.designTokenId,
|
|
8696
|
+
{ designToken },
|
|
8697
|
+
expectedToken
|
|
8698
|
+
)
|
|
8699
|
+
);
|
|
8700
|
+
}
|
|
8701
|
+
await contentfulClient.designToken.delete(params);
|
|
8702
|
+
return createSuccessResponse("Design token deleted successfully", {
|
|
8703
|
+
designTokenId: args.designTokenId
|
|
8704
|
+
});
|
|
8705
|
+
}
|
|
8706
|
+
return withErrorHandling(tool2, "Error deleting design token");
|
|
8707
|
+
}
|
|
8708
|
+
|
|
8709
|
+
// src/tools/exo/design-tokens/register.ts
|
|
8710
|
+
function createDesignTokenTools(config) {
|
|
8711
|
+
const getDesignToken = getDesignTokenTool(config);
|
|
8712
|
+
const listDesignTokens = listDesignTokensTool(config);
|
|
8713
|
+
const upsertDesignToken = upsertDesignTokenTool(config);
|
|
8714
|
+
const deleteDesignToken = deleteDesignTokenTool(config);
|
|
8715
|
+
return {
|
|
8716
|
+
getDesignToken: {
|
|
8717
|
+
title: "get_design_token",
|
|
8718
|
+
description: "Get details about a specific ExO design token (a named DTCG-typed value, such as a color, dimension, or typography token, referenced by token-backed design properties on components).",
|
|
8719
|
+
inputParams: GetDesignTokenToolParams.shape,
|
|
8720
|
+
annotations: {
|
|
8721
|
+
readOnlyHint: true,
|
|
8722
|
+
destructiveHint: false,
|
|
8723
|
+
openWorldHint: false
|
|
8724
|
+
},
|
|
8725
|
+
tool: getDesignToken
|
|
8726
|
+
},
|
|
8727
|
+
listDesignTokens: {
|
|
8728
|
+
title: "list_design_tokens",
|
|
8729
|
+
description: "List ExO design tokens in a space and environment. Returns a maximum of 10 items per request; use the pageNext cursor (returned in pages.next) to paginate.",
|
|
8730
|
+
inputParams: ListDesignTokensToolParams.shape,
|
|
8731
|
+
annotations: {
|
|
8732
|
+
readOnlyHint: true,
|
|
8733
|
+
destructiveHint: false,
|
|
8734
|
+
openWorldHint: false
|
|
8735
|
+
},
|
|
8736
|
+
tool: listDesignTokens
|
|
8737
|
+
},
|
|
8738
|
+
upsertDesignToken: {
|
|
8739
|
+
title: "upsert_design_token",
|
|
8740
|
+
description: "Create or update an ExO design token. To update an existing token, call get_design_token first and pass the returned sys.version as the version parameter; the handler merges your updates with the existing fields, so you only need to provide what changes. If the version is stale, the update is rejected and you must re-fetch with get_design_token. To create a new token, omit version and supply designTokenId, name, and type. Design tokens have no separate publish step: every upsert auto-publishes server-side, bumping sys.version by 2 (not 1) per call.",
|
|
8741
|
+
inputParams: UpsertDesignTokenToolParams.shape,
|
|
8742
|
+
annotations: {
|
|
8743
|
+
readOnlyHint: false,
|
|
8744
|
+
destructiveHint: false,
|
|
8745
|
+
idempotentHint: false,
|
|
8746
|
+
openWorldHint: false
|
|
8747
|
+
},
|
|
8748
|
+
tool: upsertDesignToken
|
|
8749
|
+
},
|
|
8750
|
+
deleteDesignToken: {
|
|
8751
|
+
title: "delete_design_token",
|
|
8752
|
+
description: "Delete an ExO design token. Two-phase: the first call (without confirm/confirmToken) returns a preview and a confirmToken. To complete the deletion, call again with the same designTokenId, confirm: true, and the confirmToken from the preview.",
|
|
8753
|
+
inputParams: DeleteDesignTokenToolParams.shape,
|
|
8754
|
+
annotations: {
|
|
8755
|
+
readOnlyHint: false,
|
|
8756
|
+
destructiveHint: true,
|
|
8757
|
+
idempotentHint: false,
|
|
8758
|
+
openWorldHint: false
|
|
8759
|
+
},
|
|
8760
|
+
tool: deleteDesignToken
|
|
8761
|
+
}
|
|
8762
|
+
};
|
|
8763
|
+
}
|
|
8764
|
+
|
|
8584
8765
|
// src/ContentfulMcpTools.ts
|
|
8585
8766
|
var ContentfulMcpTools = class {
|
|
8586
8767
|
config;
|
|
@@ -8713,6 +8894,12 @@ var ContentfulMcpTools = class {
|
|
|
8713
8894
|
getDataAssemblyTools() {
|
|
8714
8895
|
return createDataAssemblyTools(this.config);
|
|
8715
8896
|
}
|
|
8897
|
+
/**
|
|
8898
|
+
* Get ExO design token tools
|
|
8899
|
+
*/
|
|
8900
|
+
getDesignTokenTools() {
|
|
8901
|
+
return createDesignTokenTools(this.config);
|
|
8902
|
+
}
|
|
8716
8903
|
/**
|
|
8717
8904
|
* Get job tools (space-to-space migration)
|
|
8718
8905
|
*/
|