@contentful/mcp-tools 0.12.9 → 0.12.11
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 +153 -231
- package/dist/index.js +484 -538
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -270,7 +270,7 @@ var InvokeAiActionToolParams = BaseToolSchema.extend({
|
|
|
270
270
|
async function pollForCompletion(contentfulClient, params, aiActions, pollInterval = 3e4, maxAttempts = 10) {
|
|
271
271
|
const completedActions = /* @__PURE__ */ new Map();
|
|
272
272
|
for (let attempt = 0; attempt < maxAttempts && completedActions.size < aiActions.length; attempt++) {
|
|
273
|
-
await new Promise((
|
|
273
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
274
274
|
await Promise.allSettled(
|
|
275
275
|
aiActions.filter((action) => !completedActions.has(action.sys.id)).map(async (action) => {
|
|
276
276
|
try {
|
|
@@ -1153,7 +1153,7 @@ async function waitForBulkActionCompletion(contentfulClient, baseParams, bulkAct
|
|
|
1153
1153
|
bulkActionId
|
|
1154
1154
|
});
|
|
1155
1155
|
while (action.sys.status === "inProgress" || action.sys.status === "created") {
|
|
1156
|
-
await new Promise((
|
|
1156
|
+
await new Promise((resolve2) => setTimeout(resolve2, 1e3));
|
|
1157
1157
|
action = await contentfulClient.bulkAction.get({
|
|
1158
1158
|
...baseParams,
|
|
1159
1159
|
bulkActionId
|
|
@@ -5729,6 +5729,10 @@ function createUsageTools(config) {
|
|
|
5729
5729
|
}
|
|
5730
5730
|
|
|
5731
5731
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5732
|
+
import { mkdir, mkdtemp, realpath } from "fs/promises";
|
|
5733
|
+
import { join, resolve } from "path";
|
|
5734
|
+
|
|
5735
|
+
// src/tools/jobs/space-to-space-migration/types.ts
|
|
5732
5736
|
import { z as z82 } from "zod";
|
|
5733
5737
|
|
|
5734
5738
|
// src/types/querySchema.ts
|
|
@@ -5750,13 +5754,23 @@ var AssetQuerySchema = z81.object({
|
|
|
5750
5754
|
order: z81.string().optional().describe("Order assets by this field")
|
|
5751
5755
|
});
|
|
5752
5756
|
|
|
5753
|
-
// src/tools/jobs/space-to-space-migration/
|
|
5754
|
-
var
|
|
5755
|
-
|
|
5756
|
-
|
|
5757
|
-
)
|
|
5757
|
+
// src/tools/jobs/space-to-space-migration/types.ts
|
|
5758
|
+
var DYNAMIC_QUERY_KEY_PATTERN = /^(fields|sys|metadata)\./;
|
|
5759
|
+
function stripUnsupportedQueryKeys(knownKeys) {
|
|
5760
|
+
const knownKeySet = new Set(knownKeys);
|
|
5761
|
+
return (value) => {
|
|
5762
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
5763
|
+
return value;
|
|
5764
|
+
}
|
|
5765
|
+
return Object.fromEntries(
|
|
5766
|
+
Object.entries(value).filter(
|
|
5767
|
+
([key]) => knownKeySet.has(key) || DYNAMIC_QUERY_KEY_PATTERN.test(key)
|
|
5768
|
+
)
|
|
5769
|
+
);
|
|
5770
|
+
};
|
|
5771
|
+
}
|
|
5772
|
+
var ExportParamsSchema = BaseToolSchema.extend({
|
|
5758
5773
|
saveFile: z82.boolean().optional().default(true).describe("Save the exported space data to a file"),
|
|
5759
|
-
contentFile: z82.string().optional().describe("Custom filename for the exported space data (optional)"),
|
|
5760
5774
|
includeDrafts: z82.boolean().optional().default(false).describe("Include draft entries in the export"),
|
|
5761
5775
|
includeArchived: z82.boolean().optional().default(false).describe("Include archived entries in the export"),
|
|
5762
5776
|
skipContentModel: z82.boolean().optional().default(false).describe("Skip exporting content types"),
|
|
@@ -5767,17 +5781,41 @@ var ExportSpaceToolParams = BaseToolSchema.extend({
|
|
|
5767
5781
|
skipWebhooks: z82.boolean().optional().default(false).describe("Skip exporting webhooks"),
|
|
5768
5782
|
stripTags: z82.boolean().optional().default(false).describe("Untag assets and entries"),
|
|
5769
5783
|
contentOnly: z82.boolean().optional().default(false).describe("Only export assets and entries"),
|
|
5770
|
-
queryEntries: EntryQuerySchema.optional().describe(
|
|
5771
|
-
|
|
5772
|
-
),
|
|
5773
|
-
queryAssets: AssetQuerySchema.optional().describe(
|
|
5774
|
-
"Export only assets that match query parameters"
|
|
5775
|
-
),
|
|
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"),
|
|
5776
5786
|
downloadAssets: z82.boolean().optional().default(false).describe("Download actual asset files"),
|
|
5777
5787
|
maxAllowedLimit: z82.number().optional().default(1e3).describe("Maximum number of items per request"),
|
|
5778
|
-
errorLogFile: z82.string().optional().describe("Path to error log output file"),
|
|
5779
5788
|
useVerboseRenderer: z82.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
5780
5789
|
});
|
|
5790
|
+
var ImportParamsSchema = BaseToolSchema.extend({
|
|
5791
|
+
contentFile: z82.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5792
|
+
content: z82.record(z82.any()).optional().describe(
|
|
5793
|
+
"JS object containing import content (must match expected structure)"
|
|
5794
|
+
),
|
|
5795
|
+
contentModelOnly: z82.boolean().optional().default(false).describe("Import only content types"),
|
|
5796
|
+
skipContentModel: z82.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
5797
|
+
skipLocales: z82.boolean().optional().default(false).describe("Skip importing locales"),
|
|
5798
|
+
skipContentUpdates: z82.boolean().optional().default(false).describe("Do not update existing content"),
|
|
5799
|
+
skipContentPublishing: z82.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
5800
|
+
uploadAssets: z82.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
5801
|
+
skipAssetUpdates: z82.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
5802
|
+
assetsDirectory: z82.string().optional().describe("Path to directory containing exported asset files"),
|
|
5803
|
+
timeout: z82.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
5804
|
+
retryLimit: z82.number().optional().default(10).describe("Max retries for asset processing"),
|
|
5805
|
+
rateLimit: z82.number().optional().default(7).describe("Max requests per second to the API"),
|
|
5806
|
+
errorLogFile: z82.string().optional().describe("Path to error log file"),
|
|
5807
|
+
useVerboseRenderer: z82.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
5808
|
+
});
|
|
5809
|
+
|
|
5810
|
+
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5811
|
+
var EXPORT_FILE_NAME = "contentful-export.json";
|
|
5812
|
+
var EXPORT_ERROR_LOG_FILE_NAME = "contentful-export-error.log";
|
|
5813
|
+
async function createExportDirectory(baseDir) {
|
|
5814
|
+
const configuredBase = resolve(baseDir ?? process.cwd());
|
|
5815
|
+
await mkdir(configuredBase, { recursive: true });
|
|
5816
|
+
const canonicalBase = await realpath(configuredBase);
|
|
5817
|
+
return mkdtemp(join(canonicalBase, "contentful-export-"));
|
|
5818
|
+
}
|
|
5781
5819
|
function createExportSpaceTool(config) {
|
|
5782
5820
|
async function tool2(args) {
|
|
5783
5821
|
const clientConfig = createClientConfig(config);
|
|
@@ -5785,27 +5823,30 @@ function createExportSpaceTool(config) {
|
|
|
5785
5823
|
if (!managementToken) {
|
|
5786
5824
|
throw new Error("Contentful management token is not configured");
|
|
5787
5825
|
}
|
|
5788
|
-
const
|
|
5826
|
+
const safeOptions = ExportParamsSchema.parse({
|
|
5789
5827
|
...args,
|
|
5828
|
+
environmentId: args.environmentId || "master"
|
|
5829
|
+
});
|
|
5830
|
+
const exportDir = await createExportDirectory(config.exportBaseDir);
|
|
5831
|
+
const exportOptions = {
|
|
5832
|
+
...safeOptions,
|
|
5833
|
+
exportDir,
|
|
5834
|
+
contentFile: EXPORT_FILE_NAME,
|
|
5835
|
+
// contentful-export resolves a caller-provided errorLogFile relative to
|
|
5836
|
+
// process.cwd(). Pass an absolute, server-generated path instead.
|
|
5837
|
+
errorLogFile: join(exportDir, EXPORT_ERROR_LOG_FILE_NAME),
|
|
5790
5838
|
managementToken,
|
|
5791
5839
|
host: config.host ?? "api.contentful.com",
|
|
5792
5840
|
...config.deliveryToken && { deliveryToken: config.deliveryToken },
|
|
5793
|
-
...config.hostDelivery && { hostDelivery: config.hostDelivery }
|
|
5794
|
-
environmentId: args.environmentId || "master",
|
|
5795
|
-
exportDir: args.exportDir || process.cwd(),
|
|
5796
|
-
contentFile: args.contentFile || `contentful-export-${args.spaceId}.json`
|
|
5841
|
+
...config.hostDelivery && { hostDelivery: config.hostDelivery }
|
|
5797
5842
|
};
|
|
5798
5843
|
try {
|
|
5799
5844
|
const contentfulExport = await import("contentful-export");
|
|
5800
|
-
const path = await import("path");
|
|
5801
5845
|
const result = await contentfulExport.default(exportOptions);
|
|
5802
|
-
const exportPath =
|
|
5803
|
-
exportOptions.exportDir,
|
|
5804
|
-
exportOptions.contentFile
|
|
5805
|
-
);
|
|
5846
|
+
const exportPath = join(exportDir, EXPORT_FILE_NAME);
|
|
5806
5847
|
return createSuccessResponse("Space exported successfully", {
|
|
5807
|
-
spaceId:
|
|
5808
|
-
environmentId:
|
|
5848
|
+
spaceId: safeOptions.spaceId,
|
|
5849
|
+
environmentId: safeOptions.environmentId,
|
|
5809
5850
|
exportPath,
|
|
5810
5851
|
contentTypes: result.contentTypes?.length || 0,
|
|
5811
5852
|
entries: result.entries?.length || 0,
|
|
@@ -5829,66 +5870,8 @@ var ParamCollectionToolParams = BaseToolSchema.extend({
|
|
|
5829
5870
|
confirmation: z83.boolean().optional().describe(
|
|
5830
5871
|
"User confirmation that they are ready to proceed with the workflow"
|
|
5831
5872
|
),
|
|
5832
|
-
export:
|
|
5833
|
-
|
|
5834
|
-
environmentId: z83.string().optional().describe("ID of the environment in the source space"),
|
|
5835
|
-
deliveryToken: z83.string().optional().describe("CDA token to export only published content (excludes tags)"),
|
|
5836
|
-
exportDir: z83.string().optional().describe("Path to export JSON output"),
|
|
5837
|
-
saveFile: z83.boolean().optional().describe("Save the export as a JSON file"),
|
|
5838
|
-
contentFile: z83.string().optional().describe("Filename for exported data"),
|
|
5839
|
-
includeDrafts: z83.boolean().optional().describe("Include drafts in exported entries"),
|
|
5840
|
-
includeArchived: z83.boolean().optional().describe("Include archived entries"),
|
|
5841
|
-
skipContentModel: z83.boolean().optional().describe("Skip exporting content models"),
|
|
5842
|
-
skipEditorInterfaces: z83.boolean().optional().describe("Skip exporting editor interfaces"),
|
|
5843
|
-
skipContent: z83.boolean().optional().describe("Skip exporting entries and assets"),
|
|
5844
|
-
skipRoles: z83.boolean().optional().describe("Skip exporting roles and permissions"),
|
|
5845
|
-
skipTags: z83.boolean().optional().describe("Skip exporting tags"),
|
|
5846
|
-
skipWebhooks: z83.boolean().optional().describe("Skip exporting webhooks"),
|
|
5847
|
-
stripTags: z83.boolean().optional().describe("Remove tags from entries and assets"),
|
|
5848
|
-
contentOnly: z83.boolean().optional().describe("Export only entries and assets"),
|
|
5849
|
-
queryEntries: EntryQuerySchema.optional().describe(
|
|
5850
|
-
"Export only entries that match query parameters"
|
|
5851
|
-
),
|
|
5852
|
-
queryAssets: AssetQuerySchema.optional().describe(
|
|
5853
|
-
"Export only assets that match query parameters"
|
|
5854
|
-
),
|
|
5855
|
-
downloadAssets: z83.boolean().optional().describe("Download asset files to disk"),
|
|
5856
|
-
host: z83.string().optional().describe("Management API host"),
|
|
5857
|
-
hostDelivery: z83.string().optional().describe("Delivery API host"),
|
|
5858
|
-
proxy: z83.string().optional().describe("HTTP/HTTPS proxy config"),
|
|
5859
|
-
rawProxy: z83.boolean().optional().describe("Pass raw proxy config directly to Axios"),
|
|
5860
|
-
maxAllowedLimit: z83.number().optional().describe("Page size for requests"),
|
|
5861
|
-
headers: z83.record(z83.any()).optional().describe("Additional headers to include in requests"),
|
|
5862
|
-
errorLogFile: z83.string().optional().describe("Path to error log output file"),
|
|
5863
|
-
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line logging, useful for CI"),
|
|
5864
|
-
config: z83.string().optional().describe("Path to a JSON config file with all options")
|
|
5865
|
-
}).optional(),
|
|
5866
|
-
import: z83.object({
|
|
5867
|
-
spaceId: z83.string().optional().describe("ID of the space to import into"),
|
|
5868
|
-
environmentId: z83.string().optional().describe("Target environment in destination space"),
|
|
5869
|
-
contentFile: z83.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5870
|
-
content: z83.record(z83.any()).optional().describe(
|
|
5871
|
-
"JS object containing import content (must match expected structure)"
|
|
5872
|
-
),
|
|
5873
|
-
contentModelOnly: z83.boolean().optional().describe("Import only content types"),
|
|
5874
|
-
skipContentModel: z83.boolean().optional().describe("Skip importing content types and locales"),
|
|
5875
|
-
skipLocales: z83.boolean().optional().describe("Skip importing locales"),
|
|
5876
|
-
skipContentUpdates: z83.boolean().optional().describe("Do not update existing content"),
|
|
5877
|
-
skipContentPublishing: z83.boolean().optional().describe("Create but do not publish content"),
|
|
5878
|
-
uploadAssets: z83.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
|
|
5879
|
-
skipAssetUpdates: z83.boolean().optional().describe("Do not update existing assets"),
|
|
5880
|
-
assetsDirectory: z83.string().optional().describe("Path to directory containing exported asset files"),
|
|
5881
|
-
timeout: z83.number().optional().describe("Time between retries during asset processing (ms)"),
|
|
5882
|
-
retryLimit: z83.number().optional().describe("Max retries for asset processing"),
|
|
5883
|
-
host: z83.string().optional().describe("Management API host"),
|
|
5884
|
-
proxy: z83.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
|
|
5885
|
-
rawProxy: z83.boolean().optional().describe("Pass proxy config directly to Axios"),
|
|
5886
|
-
rateLimit: z83.number().optional().describe("Max requests per second to the API"),
|
|
5887
|
-
headers: z83.record(z83.any()).optional().describe("Additional headers to attach to requests"),
|
|
5888
|
-
errorLogFile: z83.string().optional().describe("Path to error log file"),
|
|
5889
|
-
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line progress output (good for CI)"),
|
|
5890
|
-
config: z83.string().optional().describe("Path to config JSON file (merged with CLI args)")
|
|
5891
|
-
}).optional()
|
|
5873
|
+
export: ExportParamsSchema.partial().optional(),
|
|
5874
|
+
import: ImportParamsSchema.partial().optional()
|
|
5892
5875
|
});
|
|
5893
5876
|
var paramCollectionConfig = {
|
|
5894
5877
|
export: {
|
|
@@ -5897,11 +5880,7 @@ spaceId // [string] [required] - ID of the space with source dat
|
|
|
5897
5880
|
`,
|
|
5898
5881
|
optionalParams: `
|
|
5899
5882
|
environmentId // [string] [default: 'master'] - ID of the environment in the source space
|
|
5900
|
-
deliveryToken // [string] - CDA token to export only published content (excludes tags)
|
|
5901
|
-
|
|
5902
|
-
exportDir // [string] [default: process.cwd()] - Path to export JSON output
|
|
5903
5883
|
saveFile // [boolean] [default: true] - Save the export as a JSON file
|
|
5904
|
-
contentFile // [string] - Filename for exported data
|
|
5905
5884
|
|
|
5906
5885
|
includeDrafts // [boolean] [default: false] - Include drafts in exported entries
|
|
5907
5886
|
includeArchived // [boolean] [default: false] - Include archived entries
|
|
@@ -5918,22 +5897,14 @@ queryEntries // [array] - Export only entries that match query parame
|
|
|
5918
5897
|
queryAssets // [array] - Export only assets that match query parameters
|
|
5919
5898
|
downloadAssets // [boolean] - Download asset files to disk
|
|
5920
5899
|
|
|
5921
|
-
host // [string] [default: 'api.contentful.com'] - Management API host
|
|
5922
|
-
hostDelivery // [string] [default: 'cdn.contentful.com'] - Delivery API host
|
|
5923
|
-
proxy // [string] - HTTP/HTTPS proxy config
|
|
5924
|
-
rawProxy // [boolean] - Pass raw proxy config directly to Axios
|
|
5925
5900
|
maxAllowedLimit // [number] [default: 1000] - Page size for requests
|
|
5926
|
-
headers // [object] - Additional headers to include in requests
|
|
5927
5901
|
|
|
5928
|
-
errorLogFile // [string] - Path to error log output file
|
|
5929
5902
|
useVerboseRenderer // [boolean] [default: false] - Line-by-line logging, useful for CI
|
|
5930
|
-
config // [string] - Path to a JSON config file with all options
|
|
5931
5903
|
`
|
|
5932
5904
|
},
|
|
5933
5905
|
import: {
|
|
5934
5906
|
requiredParams: `
|
|
5935
5907
|
spaceId // [string] [required] - ID of the space to import into
|
|
5936
|
-
managementToken // [string] [required] - Contentful Management API token
|
|
5937
5908
|
`,
|
|
5938
5909
|
optionalParams: `
|
|
5939
5910
|
environmentId // [string] [default: 'master'] - Target environment in destination space
|
|
@@ -5952,25 +5923,16 @@ assetsDirectory // [string] - Path to directory containing exported asse
|
|
|
5952
5923
|
timeout // [number] [default: 3000] - Time between retries during asset processing (ms)
|
|
5953
5924
|
retryLimit // [number] [default: 10] - Max retries for asset processing
|
|
5954
5925
|
|
|
5955
|
-
host // [string] [default: 'api.contentful.com'] - Management API host
|
|
5956
|
-
proxy // [string] - HTTP/HTTPS proxy string (host:port or user:pass@host:port)
|
|
5957
|
-
rawProxy // [boolean] - Pass proxy config directly to Axios
|
|
5958
5926
|
rateLimit // [number] [default: 7] - Max requests per second to the API
|
|
5959
|
-
headers // [object] - Additional headers to attach to requests
|
|
5960
5927
|
|
|
5961
5928
|
errorLogFile // [string] - Path to error log file
|
|
5962
5929
|
useVerboseRenderer // [boolean] [default: false] - Line-by-line progress output (good for CI)
|
|
5963
|
-
config // [string] - Path to config JSON file (merged with CLI args)
|
|
5964
5930
|
`
|
|
5965
5931
|
}
|
|
5966
5932
|
};
|
|
5967
5933
|
async function tool(args) {
|
|
5968
|
-
const exportParams = args.export ?
|
|
5969
|
-
|
|
5970
|
-
) : {};
|
|
5971
|
-
const importParams = args.import ? Object.fromEntries(
|
|
5972
|
-
Object.entries(args.import).filter(([, value]) => value !== void 0)
|
|
5973
|
-
) : {};
|
|
5934
|
+
const exportParams = args.export ? ExportParamsSchema.partial().parse(args.export) : {};
|
|
5935
|
+
const importParams = args.import ? ImportParamsSchema.partial().parse(args.import) : {};
|
|
5974
5936
|
const params = {
|
|
5975
5937
|
export: Object.keys(exportParams).length > 0 ? exportParams : void 0,
|
|
5976
5938
|
import: Object.keys(importParams).length > 0 ? importParams : void 0
|
|
@@ -6003,26 +5965,6 @@ var createParamCollectionTool = withErrorHandling(
|
|
|
6003
5965
|
);
|
|
6004
5966
|
|
|
6005
5967
|
// src/tools/jobs/space-to-space-migration/importSpace.ts
|
|
6006
|
-
import { z as z84 } from "zod";
|
|
6007
|
-
var ImportSpaceToolParams = BaseToolSchema.extend({
|
|
6008
|
-
contentFile: z84.string().optional().describe("Path to JSON file containing the content to import"),
|
|
6009
|
-
content: z84.record(z84.any()).optional().describe(
|
|
6010
|
-
"JS object containing import content (must match expected structure)"
|
|
6011
|
-
),
|
|
6012
|
-
contentModelOnly: z84.boolean().optional().default(false).describe("Import only content types"),
|
|
6013
|
-
skipContentModel: z84.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
6014
|
-
skipLocales: z84.boolean().optional().default(false).describe("Skip importing locales"),
|
|
6015
|
-
skipContentUpdates: z84.boolean().optional().default(false).describe("Do not update existing content"),
|
|
6016
|
-
skipContentPublishing: z84.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
6017
|
-
uploadAssets: z84.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
6018
|
-
skipAssetUpdates: z84.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
6019
|
-
assetsDirectory: z84.string().optional().describe("Path to directory containing exported asset files"),
|
|
6020
|
-
timeout: z84.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
6021
|
-
retryLimit: z84.number().optional().default(10).describe("Max retries for asset processing"),
|
|
6022
|
-
rateLimit: z84.number().optional().default(7).describe("Max requests per second to the API"),
|
|
6023
|
-
errorLogFile: z84.string().optional().describe("Path to error log file"),
|
|
6024
|
-
useVerboseRenderer: z84.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
6025
|
-
});
|
|
6026
5968
|
function createImportSpaceTool(config) {
|
|
6027
5969
|
async function tool2(args) {
|
|
6028
5970
|
const targetEnvironmentId = args.environmentId || "master";
|
|
@@ -6035,11 +5977,14 @@ function createImportSpaceTool(config) {
|
|
|
6035
5977
|
if (!managementToken) {
|
|
6036
5978
|
throw new Error("Contentful management token is not configured");
|
|
6037
5979
|
}
|
|
6038
|
-
const
|
|
5980
|
+
const safeOptions = ImportParamsSchema.parse({
|
|
6039
5981
|
...args,
|
|
6040
|
-
managementToken,
|
|
6041
|
-
host: config.host ?? "api.contentful.com",
|
|
6042
5982
|
environmentId: targetEnvironmentId
|
|
5983
|
+
});
|
|
5984
|
+
const importOptions = {
|
|
5985
|
+
...safeOptions,
|
|
5986
|
+
managementToken,
|
|
5987
|
+
host: config.host ?? "api.contentful.com"
|
|
6043
5988
|
};
|
|
6044
5989
|
try {
|
|
6045
5990
|
const contentfulImport = await import("contentful-import");
|
|
@@ -6064,7 +6009,7 @@ function createImportSpaceTool(config) {
|
|
|
6064
6009
|
}
|
|
6065
6010
|
|
|
6066
6011
|
// src/tools/jobs/space-to-space-migration/migrationHandler.ts
|
|
6067
|
-
import { z as
|
|
6012
|
+
import { z as z84 } from "zod";
|
|
6068
6013
|
|
|
6069
6014
|
// src/tools/jobs/space-to-space-migration/instructions.ts
|
|
6070
6015
|
var S2S_MIGRATION_INSTRUCTIONS = `
|
|
@@ -6087,17 +6032,18 @@ Once the workflow is started, you will need to call the tools in the following o
|
|
|
6087
6032
|
5. import_space
|
|
6088
6033
|
6. space_to_space_migration_handler with enableWorkflow=false (to conclude the workflow)
|
|
6089
6034
|
|
|
6090
|
-
## Path Configuration
|
|
6091
|
-
-
|
|
6035
|
+
## Path Configuration:
|
|
6036
|
+
- Export output paths are managed by the server and are not user-configurable.
|
|
6037
|
+
- Use the exportPath returned by export_space as the source content file for the import step.
|
|
6092
6038
|
|
|
6093
6039
|
### Asset Handling Paths:
|
|
6094
|
-
- When downloadAssets=true, the export tool creates an assets directory structure
|
|
6040
|
+
- When downloadAssets=true, the export tool creates an assets directory structure next to the returned export file, under: <export directory>/images.ctfassets.net/
|
|
6095
6041
|
- The import tool expects assetsDirectory to point to the images.ctfassets.net directory, not the parent export directory
|
|
6096
6042
|
|
|
6097
6043
|
Troubleshooting:
|
|
6098
6044
|
- If the start_space_to_space_migration is not found, try to call it again on behalf of the user.
|
|
6099
6045
|
- If space_to_space_param_collection or other tools are not found, ask the user to confirm they are ready to proceed, as the tools need to be enabled first.
|
|
6100
|
-
- If import fails with path errors, verify that
|
|
6046
|
+
- If import fails with path errors, verify that the returned exportPath and assetsDirectory paths are correctly aligned and accessible.
|
|
6101
6047
|
`;
|
|
6102
6048
|
|
|
6103
6049
|
// src/tools/jobs/space-to-space-migration/migrationHandler.ts
|
|
@@ -6107,7 +6053,7 @@ The space to space migration workflow has been concluded and all related tools h
|
|
|
6107
6053
|
The workflow is now complete. You can start a new migration workflow by calling space_to_space_migration_handler with enableWorkflow=true if needed.
|
|
6108
6054
|
`;
|
|
6109
6055
|
var SpaceToSpaceMigrationHandlerToolParams = BaseToolSchema.extend({
|
|
6110
|
-
enableWorkflow:
|
|
6056
|
+
enableWorkflow: z84.boolean().describe(
|
|
6111
6057
|
"Set to true to enable the workflow tools, false to disable them and conclude the workflow"
|
|
6112
6058
|
)
|
|
6113
6059
|
});
|
|
@@ -6169,7 +6115,7 @@ function createJobTools(config) {
|
|
|
6169
6115
|
exportSpace: {
|
|
6170
6116
|
title: "export_space",
|
|
6171
6117
|
description: "Export a space to a file",
|
|
6172
|
-
inputParams:
|
|
6118
|
+
inputParams: ExportParamsSchema.shape,
|
|
6173
6119
|
annotations: {
|
|
6174
6120
|
readOnlyHint: true,
|
|
6175
6121
|
destructiveHint: false,
|
|
@@ -6180,7 +6126,7 @@ function createJobTools(config) {
|
|
|
6180
6126
|
importSpace: {
|
|
6181
6127
|
title: "import_space",
|
|
6182
6128
|
description: "Import a space from a file. Step 4 of the space to space migration workflow.",
|
|
6183
|
-
inputParams:
|
|
6129
|
+
inputParams: ImportParamsSchema.shape,
|
|
6184
6130
|
annotations: {
|
|
6185
6131
|
readOnlyHint: false,
|
|
6186
6132
|
destructiveHint: false,
|
|
@@ -6205,9 +6151,9 @@ function createJobTools(config) {
|
|
|
6205
6151
|
}
|
|
6206
6152
|
|
|
6207
6153
|
// src/tools/exo/components/getComponent.ts
|
|
6208
|
-
import { z as
|
|
6154
|
+
import { z as z85 } from "zod";
|
|
6209
6155
|
var GetComponentToolParams = BaseToolSchema.extend({
|
|
6210
|
-
componentId:
|
|
6156
|
+
componentId: z85.string().describe("The ID of the component to retrieve details for")
|
|
6211
6157
|
});
|
|
6212
6158
|
function getComponentTool(config) {
|
|
6213
6159
|
async function tool2(args) {
|
|
@@ -6225,12 +6171,12 @@ function getComponentTool(config) {
|
|
|
6225
6171
|
}
|
|
6226
6172
|
|
|
6227
6173
|
// src/tools/exo/components/listComponents.ts
|
|
6228
|
-
import { z as
|
|
6174
|
+
import { z as z86 } from "zod";
|
|
6229
6175
|
var ListComponentsToolParams = BaseToolSchema.extend({
|
|
6230
|
-
limit:
|
|
6231
|
-
pageNext:
|
|
6232
|
-
pagePrev:
|
|
6233
|
-
order:
|
|
6176
|
+
limit: z86.number().optional().describe("Maximum number of components to return (max 10)"),
|
|
6177
|
+
pageNext: z86.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6178
|
+
pagePrev: z86.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6179
|
+
order: z86.string().optional().describe("Order components by this field (e.g. sys.createdAt)")
|
|
6234
6180
|
});
|
|
6235
6181
|
function listComponentsTool(config) {
|
|
6236
6182
|
async function tool2(args) {
|
|
@@ -6260,10 +6206,10 @@ function listComponentsTool(config) {
|
|
|
6260
6206
|
}
|
|
6261
6207
|
|
|
6262
6208
|
// src/tools/exo/components/createComponent.ts
|
|
6263
|
-
import { z as
|
|
6209
|
+
import { z as z88 } from "zod";
|
|
6264
6210
|
|
|
6265
6211
|
// src/types/exoSchemas.ts
|
|
6266
|
-
import { z as
|
|
6212
|
+
import { z as z87 } from "zod";
|
|
6267
6213
|
var URN_EXAMPLES = {
|
|
6268
6214
|
"Contentful:Component": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/components/{id}",
|
|
6269
6215
|
"Contentful:ExperienceFragment": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/experienceFragments/{id}",
|
|
@@ -6273,19 +6219,19 @@ var URN_EXAMPLES = {
|
|
|
6273
6219
|
var resourceLinkSchema2 = (linkType) => {
|
|
6274
6220
|
const example = URN_EXAMPLES[linkType];
|
|
6275
6221
|
const urnDesc = example ? `URN of the linked resource (e.g. "${example}")` : "URN of the linked resource";
|
|
6276
|
-
return
|
|
6277
|
-
sys:
|
|
6278
|
-
type:
|
|
6279
|
-
linkType:
|
|
6280
|
-
urn:
|
|
6222
|
+
return z87.object({
|
|
6223
|
+
sys: z87.object({
|
|
6224
|
+
type: z87.literal("ResourceLink"),
|
|
6225
|
+
linkType: z87.literal(linkType),
|
|
6226
|
+
urn: z87.string().describe(urnDesc)
|
|
6281
6227
|
})
|
|
6282
6228
|
});
|
|
6283
6229
|
};
|
|
6284
|
-
var linkSchema2 = (linkType) =>
|
|
6285
|
-
sys:
|
|
6286
|
-
type:
|
|
6287
|
-
linkType:
|
|
6288
|
-
id:
|
|
6230
|
+
var linkSchema2 = (linkType) => z87.object({
|
|
6231
|
+
sys: z87.object({
|
|
6232
|
+
type: z87.literal("Link"),
|
|
6233
|
+
linkType: z87.literal(linkType),
|
|
6234
|
+
id: z87.string()
|
|
6289
6235
|
})
|
|
6290
6236
|
});
|
|
6291
6237
|
var ComponentResourceLinkSchema = resourceLinkSchema2(
|
|
@@ -6297,71 +6243,71 @@ var ExperienceFragmentResourceLinkSchema = resourceLinkSchema2(
|
|
|
6297
6243
|
var ExperienceTemplateResourceLinkSchema = resourceLinkSchema2(
|
|
6298
6244
|
"Contentful:ExperienceTemplate"
|
|
6299
6245
|
);
|
|
6300
|
-
var ViewportSchema =
|
|
6301
|
-
id:
|
|
6302
|
-
query:
|
|
6303
|
-
displayName:
|
|
6304
|
-
previewSize:
|
|
6305
|
-
});
|
|
6306
|
-
var DataTypeDefinitionSchema =
|
|
6307
|
-
() =>
|
|
6308
|
-
|
|
6309
|
-
type:
|
|
6310
|
-
name:
|
|
6311
|
-
required:
|
|
6246
|
+
var ViewportSchema = z87.object({
|
|
6247
|
+
id: z87.string().describe("Viewport identifier"),
|
|
6248
|
+
query: z87.string().describe("CSS media query string"),
|
|
6249
|
+
displayName: z87.string().describe("Human-readable viewport name"),
|
|
6250
|
+
previewSize: z87.string().describe('Preview size (e.g. "1024px")')
|
|
6251
|
+
});
|
|
6252
|
+
var DataTypeDefinitionSchema = z87.lazy(
|
|
6253
|
+
() => z87.discriminatedUnion("type", [
|
|
6254
|
+
z87.object({
|
|
6255
|
+
type: z87.enum(["String", "Number", "Integer", "Boolean"]),
|
|
6256
|
+
name: z87.string().optional(),
|
|
6257
|
+
required: z87.boolean().optional()
|
|
6312
6258
|
}),
|
|
6313
|
-
|
|
6314
|
-
type:
|
|
6315
|
-
name:
|
|
6316
|
-
required:
|
|
6259
|
+
z87.object({
|
|
6260
|
+
type: z87.literal("RichText"),
|
|
6261
|
+
name: z87.string().optional(),
|
|
6262
|
+
required: z87.boolean().optional()
|
|
6317
6263
|
}),
|
|
6318
|
-
|
|
6319
|
-
type:
|
|
6320
|
-
name:
|
|
6321
|
-
required:
|
|
6264
|
+
z87.object({
|
|
6265
|
+
type: z87.literal("Array"),
|
|
6266
|
+
name: z87.string().optional(),
|
|
6267
|
+
required: z87.boolean().optional(),
|
|
6322
6268
|
items: DataTypeDefinitionSchema
|
|
6323
6269
|
}),
|
|
6324
|
-
|
|
6325
|
-
type:
|
|
6326
|
-
name:
|
|
6327
|
-
required:
|
|
6328
|
-
fields:
|
|
6270
|
+
z87.object({
|
|
6271
|
+
type: z87.literal("Record"),
|
|
6272
|
+
name: z87.string().optional(),
|
|
6273
|
+
required: z87.boolean().optional(),
|
|
6274
|
+
fields: z87.record(z87.string(), DataTypeDefinitionSchema)
|
|
6329
6275
|
}),
|
|
6330
|
-
|
|
6331
|
-
type:
|
|
6332
|
-
name:
|
|
6333
|
-
required:
|
|
6334
|
-
ref:
|
|
6335
|
-
sys:
|
|
6336
|
-
type:
|
|
6337
|
-
linkType:
|
|
6338
|
-
urn:
|
|
6276
|
+
z87.object({
|
|
6277
|
+
type: z87.literal("TypeRef"),
|
|
6278
|
+
name: z87.string().optional(),
|
|
6279
|
+
required: z87.boolean().optional(),
|
|
6280
|
+
ref: z87.object({
|
|
6281
|
+
sys: z87.object({
|
|
6282
|
+
type: z87.literal("ResourceLink"),
|
|
6283
|
+
linkType: z87.string(),
|
|
6284
|
+
urn: z87.string()
|
|
6339
6285
|
})
|
|
6340
6286
|
})
|
|
6341
6287
|
}),
|
|
6342
|
-
|
|
6343
|
-
type:
|
|
6344
|
-
name:
|
|
6345
|
-
required:
|
|
6346
|
-
value:
|
|
6288
|
+
z87.object({
|
|
6289
|
+
type: z87.literal("Literal"),
|
|
6290
|
+
name: z87.string().optional(),
|
|
6291
|
+
required: z87.boolean().optional(),
|
|
6292
|
+
value: z87.custom().describe("JSON literal value"),
|
|
6347
6293
|
valueType: DataTypeDefinitionSchema
|
|
6348
6294
|
}),
|
|
6349
|
-
|
|
6350
|
-
type:
|
|
6351
|
-
name:
|
|
6352
|
-
required:
|
|
6353
|
-
discriminator:
|
|
6354
|
-
members:
|
|
6295
|
+
z87.object({
|
|
6296
|
+
type: z87.literal("DiscriminatedUnion"),
|
|
6297
|
+
name: z87.string().optional(),
|
|
6298
|
+
required: z87.boolean().optional(),
|
|
6299
|
+
discriminator: z87.string(),
|
|
6300
|
+
members: z87.array(DataTypeDefinitionSchema)
|
|
6355
6301
|
})
|
|
6356
6302
|
])
|
|
6357
6303
|
);
|
|
6358
|
-
var ContentPropertySchema =
|
|
6304
|
+
var ContentPropertySchema = z87.intersection(
|
|
6359
6305
|
DataTypeDefinitionSchema,
|
|
6360
|
-
|
|
6361
|
-
id:
|
|
6362
|
-
name:
|
|
6363
|
-
required:
|
|
6364
|
-
defaultValue:
|
|
6306
|
+
z87.object({
|
|
6307
|
+
id: z87.string().describe("Content property identifier"),
|
|
6308
|
+
name: z87.string().describe("Human-readable name"),
|
|
6309
|
+
required: z87.boolean().describe("Whether the property is required"),
|
|
6310
|
+
defaultValue: z87.unknown().optional().describe("Default value")
|
|
6365
6311
|
})
|
|
6366
6312
|
);
|
|
6367
6313
|
var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
@@ -6379,189 +6325,189 @@ var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
|
6379
6325
|
"DTCG.Gradient",
|
|
6380
6326
|
"DTCG.Typography"
|
|
6381
6327
|
];
|
|
6382
|
-
var DesignPropertyCommonFieldsSchema =
|
|
6383
|
-
id:
|
|
6384
|
-
name:
|
|
6385
|
-
description:
|
|
6328
|
+
var DesignPropertyCommonFieldsSchema = z87.object({
|
|
6329
|
+
id: z87.string().describe("Design property identifier"),
|
|
6330
|
+
name: z87.string().describe("Human-readable name"),
|
|
6331
|
+
description: z87.string().optional().describe("Optional description")
|
|
6386
6332
|
});
|
|
6387
6333
|
var StringDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6388
|
-
type:
|
|
6389
|
-
fallbackValue:
|
|
6390
|
-
type:
|
|
6391
|
-
value:
|
|
6334
|
+
type: z87.literal("String"),
|
|
6335
|
+
fallbackValue: z87.object({
|
|
6336
|
+
type: z87.literal("ManualDesignValue"),
|
|
6337
|
+
value: z87.string()
|
|
6392
6338
|
}).optional().describe("Manual fallback value for this design property"),
|
|
6393
|
-
validations:
|
|
6394
|
-
|
|
6395
|
-
regexp:
|
|
6396
|
-
pattern:
|
|
6339
|
+
validations: z87.array(
|
|
6340
|
+
z87.object({
|
|
6341
|
+
regexp: z87.object({
|
|
6342
|
+
pattern: z87.string().describe("Regular expression pattern")
|
|
6397
6343
|
})
|
|
6398
6344
|
})
|
|
6399
6345
|
).optional().describe("Regexp validations constraining allowed string values")
|
|
6400
6346
|
});
|
|
6401
6347
|
var BooleanDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6402
|
-
type:
|
|
6403
|
-
fallbackValue:
|
|
6404
|
-
type:
|
|
6405
|
-
value:
|
|
6348
|
+
type: z87.literal("Boolean"),
|
|
6349
|
+
fallbackValue: z87.object({
|
|
6350
|
+
type: z87.literal("ManualDesignValue"),
|
|
6351
|
+
value: z87.boolean()
|
|
6406
6352
|
}).optional().describe("Manual fallback value for this design property")
|
|
6407
6353
|
});
|
|
6408
|
-
var DesignTokenValueSchema =
|
|
6409
|
-
type:
|
|
6410
|
-
value:
|
|
6354
|
+
var DesignTokenValueSchema = z87.object({
|
|
6355
|
+
type: z87.literal("DesignToken"),
|
|
6356
|
+
value: z87.string().min(1).describe("Design token reference (non-empty)")
|
|
6411
6357
|
});
|
|
6412
6358
|
var TokenBackedDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend(
|
|
6413
6359
|
{
|
|
6414
|
-
type:
|
|
6360
|
+
type: z87.enum(DTCG_DESIGN_PROPERTY_TYPES),
|
|
6415
6361
|
fallbackValue: DesignTokenValueSchema.optional().describe(
|
|
6416
6362
|
"Design-token-backed fallback value for this design property"
|
|
6417
6363
|
),
|
|
6418
|
-
allowedResources:
|
|
6419
|
-
|
|
6420
|
-
type:
|
|
6421
|
-
value:
|
|
6422
|
-
name:
|
|
6364
|
+
allowedResources: z87.array(
|
|
6365
|
+
z87.object({
|
|
6366
|
+
type: z87.literal("DesignToken"),
|
|
6367
|
+
value: z87.string(),
|
|
6368
|
+
name: z87.string().optional()
|
|
6423
6369
|
})
|
|
6424
6370
|
).optional().describe("Allowed design token resources")
|
|
6425
6371
|
}
|
|
6426
6372
|
);
|
|
6427
|
-
var DesignPropertySchema =
|
|
6373
|
+
var DesignPropertySchema = z87.union([
|
|
6428
6374
|
StringDesignPropertySchema,
|
|
6429
6375
|
BooleanDesignPropertySchema,
|
|
6430
6376
|
TokenBackedDesignPropertySchema
|
|
6431
6377
|
]);
|
|
6432
|
-
var ManualDesignValueSchema =
|
|
6433
|
-
type:
|
|
6434
|
-
value:
|
|
6378
|
+
var ManualDesignValueSchema = z87.object({
|
|
6379
|
+
type: z87.literal("ManualDesignValue"),
|
|
6380
|
+
value: z87.union([z87.string(), z87.number(), z87.boolean()])
|
|
6435
6381
|
});
|
|
6436
|
-
var DesignPropertyValueSchema =
|
|
6382
|
+
var DesignPropertyValueSchema = z87.union([
|
|
6437
6383
|
ManualDesignValueSchema,
|
|
6438
6384
|
DesignTokenValueSchema
|
|
6439
6385
|
]);
|
|
6440
|
-
var DesignPropertyPointerValueSchema =
|
|
6386
|
+
var DesignPropertyPointerValueSchema = z87.custom(
|
|
6441
6387
|
(val) => typeof val === "string" && /^\$designProperties\//.test(val),
|
|
6442
6388
|
{ message: 'Must be a "$designProperties/..." pointer' }
|
|
6443
6389
|
);
|
|
6444
|
-
var DimensionedDesignPropertyValueSchema =
|
|
6445
|
-
|
|
6390
|
+
var DimensionedDesignPropertyValueSchema = z87.record(
|
|
6391
|
+
z87.string(),
|
|
6446
6392
|
DesignPropertyValueSchema
|
|
6447
6393
|
);
|
|
6448
|
-
var ComponentTreeDesignPropertyValueSchema =
|
|
6394
|
+
var ComponentTreeDesignPropertyValueSchema = z87.union([
|
|
6449
6395
|
DesignPropertyValueSchema,
|
|
6450
6396
|
DesignPropertyPointerValueSchema,
|
|
6451
6397
|
DimensionedDesignPropertyValueSchema
|
|
6452
6398
|
]);
|
|
6453
6399
|
var COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE = "crn:contentful:::experience:spaces/$self/environments/$self";
|
|
6454
|
-
var SlotDefinitionSchema =
|
|
6455
|
-
id:
|
|
6456
|
-
name:
|
|
6457
|
-
required:
|
|
6458
|
-
validations:
|
|
6459
|
-
|
|
6460
|
-
size:
|
|
6461
|
-
min:
|
|
6462
|
-
max:
|
|
6400
|
+
var SlotDefinitionSchema = z87.object({
|
|
6401
|
+
id: z87.string().describe("Slot identifier"),
|
|
6402
|
+
name: z87.string().describe("Human-readable name"),
|
|
6403
|
+
required: z87.boolean().describe("Whether the slot must be filled"),
|
|
6404
|
+
validations: z87.array(
|
|
6405
|
+
z87.object({
|
|
6406
|
+
size: z87.object({
|
|
6407
|
+
min: z87.number().optional(),
|
|
6408
|
+
max: z87.number().optional()
|
|
6463
6409
|
}).optional()
|
|
6464
6410
|
})
|
|
6465
6411
|
).describe("Slot cardinality validations"),
|
|
6466
|
-
allowedResources:
|
|
6467
|
-
|
|
6468
|
-
type:
|
|
6469
|
-
source:
|
|
6470
|
-
allowedTypes:
|
|
6412
|
+
allowedResources: z87.array(
|
|
6413
|
+
z87.object({
|
|
6414
|
+
type: z87.literal("Contentful:Component"),
|
|
6415
|
+
source: z87.literal(COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE),
|
|
6416
|
+
allowedTypes: z87.array(z87.string()).describe("IDs of components allowed in this slot")
|
|
6471
6417
|
})
|
|
6472
6418
|
).optional().describe("Constrains which components may be placed in this slot")
|
|
6473
6419
|
});
|
|
6474
|
-
var ExperienceFragmentNodeSchema =
|
|
6475
|
-
id:
|
|
6476
|
-
name:
|
|
6477
|
-
nodeType:
|
|
6420
|
+
var ExperienceFragmentNodeSchema = z87.object({
|
|
6421
|
+
id: z87.string().describe("Node identifier"),
|
|
6422
|
+
name: z87.string().optional().describe("Optional display name"),
|
|
6423
|
+
nodeType: z87.literal("ExperienceFragment").describe('Must be "ExperienceFragment"'),
|
|
6478
6424
|
experienceFragment: ExperienceFragmentResourceLinkSchema.describe(
|
|
6479
6425
|
"Resource link to the referenced experience fragment"
|
|
6480
6426
|
)
|
|
6481
6427
|
});
|
|
6482
|
-
var SlotNodeSchema =
|
|
6483
|
-
id:
|
|
6484
|
-
nodeType:
|
|
6485
|
-
slotId:
|
|
6428
|
+
var SlotNodeSchema = z87.object({
|
|
6429
|
+
id: z87.string().describe("Node identifier"),
|
|
6430
|
+
nodeType: z87.literal("Slot").describe('Must be "Slot"'),
|
|
6431
|
+
slotId: z87.string().describe("ID of the slot definition to render")
|
|
6486
6432
|
});
|
|
6487
|
-
var TreeNodeSchema =
|
|
6488
|
-
() =>
|
|
6433
|
+
var TreeNodeSchema = z87.lazy(
|
|
6434
|
+
() => z87.union([ComponentNodeSchema, ExperienceFragmentNodeSchema, SlotNodeSchema])
|
|
6489
6435
|
);
|
|
6490
|
-
var ComponentNodeSchema =
|
|
6491
|
-
() =>
|
|
6492
|
-
id:
|
|
6493
|
-
name:
|
|
6494
|
-
nodeType:
|
|
6436
|
+
var ComponentNodeSchema = z87.lazy(
|
|
6437
|
+
() => z87.object({
|
|
6438
|
+
id: z87.string().describe("Node identifier"),
|
|
6439
|
+
name: z87.string().optional().describe("Optional display name"),
|
|
6440
|
+
nodeType: z87.literal("Component").describe('Must be "Component"'),
|
|
6495
6441
|
component: ComponentResourceLinkSchema.describe(
|
|
6496
6442
|
"Resource link to the component to render"
|
|
6497
6443
|
),
|
|
6498
|
-
contentProperties:
|
|
6499
|
-
|
|
6500
|
-
|
|
6444
|
+
contentProperties: z87.union([
|
|
6445
|
+
z87.record(z87.string(), z87.unknown()),
|
|
6446
|
+
z87.string().describe('"$contentProperties/..." pointer')
|
|
6501
6447
|
]).describe(
|
|
6502
6448
|
'Content property bindings \u2014 values or "$contentProperties/..." pointers'
|
|
6503
6449
|
),
|
|
6504
|
-
designProperties:
|
|
6450
|
+
designProperties: z87.record(z87.string(), ComponentTreeDesignPropertyValueSchema).describe(
|
|
6505
6451
|
'Design property values \u2014 ManualDesignValue, DesignTokenValue, or "$designProperties/..." pointers'
|
|
6506
6452
|
),
|
|
6507
|
-
slots:
|
|
6453
|
+
slots: z87.record(z87.string(), z87.array(TreeNodeSchema)).describe("Child tree nodes keyed by slot ID")
|
|
6508
6454
|
})
|
|
6509
6455
|
);
|
|
6510
6456
|
var TagLinkSchema = linkSchema2("Tag");
|
|
6511
6457
|
var ConceptLinkSchema = linkSchema2("TaxonomyConcept");
|
|
6512
|
-
var ExoMetadataSchema =
|
|
6513
|
-
tags:
|
|
6514
|
-
concepts:
|
|
6458
|
+
var ExoMetadataSchema = z87.object({
|
|
6459
|
+
tags: z87.array(TagLinkSchema).optional().describe("Tags attached to this entity"),
|
|
6460
|
+
concepts: z87.array(ConceptLinkSchema).optional().describe("Taxonomy concepts attached to this entity")
|
|
6515
6461
|
});
|
|
6516
6462
|
var ExperienceMetadataSchema = ExoMetadataSchema.extend({
|
|
6517
|
-
name:
|
|
6463
|
+
name: z87.string().optional().describe("Variant label for this metadata entry")
|
|
6518
6464
|
});
|
|
6519
6465
|
var DataAssemblyResourceLinkSchema = resourceLinkSchema2(
|
|
6520
6466
|
"Contentful:DataAssembly"
|
|
6521
6467
|
);
|
|
6522
|
-
var ExperienceContentBindingsSchema =
|
|
6468
|
+
var ExperienceContentBindingsSchema = z87.object({
|
|
6523
6469
|
sys: DataAssemblyResourceLinkSchema.shape.sys,
|
|
6524
|
-
parameters:
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
sys:
|
|
6528
|
-
type:
|
|
6529
|
-
linkType:
|
|
6530
|
-
urn:
|
|
6470
|
+
parameters: z87.record(
|
|
6471
|
+
z87.string(),
|
|
6472
|
+
z87.object({
|
|
6473
|
+
sys: z87.object({
|
|
6474
|
+
type: z87.literal("ResourceLink"),
|
|
6475
|
+
linkType: z87.string(),
|
|
6476
|
+
urn: z87.string()
|
|
6531
6477
|
})
|
|
6532
6478
|
})
|
|
6533
6479
|
).describe("Parameter bindings keyed by parameter ID")
|
|
6534
6480
|
});
|
|
6535
|
-
var InlineExperienceFragmentNodeSchema =
|
|
6536
|
-
() =>
|
|
6537
|
-
id:
|
|
6538
|
-
nodeType:
|
|
6481
|
+
var InlineExperienceFragmentNodeSchema = z87.lazy(
|
|
6482
|
+
() => z87.object({
|
|
6483
|
+
id: z87.string().describe("Node identifier"),
|
|
6484
|
+
nodeType: z87.literal("InlineExperienceFragment").describe('Must be "InlineExperienceFragment"'),
|
|
6539
6485
|
component: ComponentResourceLinkSchema.describe(
|
|
6540
6486
|
"Resource link to the component this inline experience fragment renders"
|
|
6541
6487
|
),
|
|
6542
|
-
designProperties:
|
|
6488
|
+
designProperties: z87.record(z87.string(), DimensionedDesignPropertyValueSchema).describe("Design property values for this inline experience fragment"),
|
|
6543
6489
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6544
6490
|
"Optional content bindings linking this inline experience fragment to a data assembly"
|
|
6545
6491
|
),
|
|
6546
|
-
slots:
|
|
6492
|
+
slots: z87.record(z87.string(), z87.array(ExperienceSlotNodeSchema)).optional().describe("Child slot contents keyed by slot ID")
|
|
6547
6493
|
})
|
|
6548
6494
|
);
|
|
6549
|
-
var ExperienceSlotNodeSchema =
|
|
6550
|
-
() =>
|
|
6495
|
+
var ExperienceSlotNodeSchema = z87.lazy(
|
|
6496
|
+
() => z87.union([ExperienceFragmentNodeSchema, InlineExperienceFragmentNodeSchema])
|
|
6551
6497
|
);
|
|
6552
6498
|
|
|
6553
6499
|
// src/tools/exo/components/createComponent.ts
|
|
6554
6500
|
var CreateComponentToolParams = BaseToolSchema.extend({
|
|
6555
|
-
componentId:
|
|
6501
|
+
componentId: z88.string().optional().describe(
|
|
6556
6502
|
"Optional ID for the component. If provided, will use upsert (create via PUT) with this ID"
|
|
6557
6503
|
),
|
|
6558
|
-
name:
|
|
6559
|
-
description:
|
|
6560
|
-
viewports:
|
|
6561
|
-
contentProperties:
|
|
6562
|
-
designProperties:
|
|
6563
|
-
componentTree:
|
|
6564
|
-
slots:
|
|
6504
|
+
name: z88.string().describe("The name of the component"),
|
|
6505
|
+
description: z88.string().describe("Description of the component"),
|
|
6506
|
+
viewports: z88.array(ViewportSchema).describe("Viewport definitions for the component (may be empty)"),
|
|
6507
|
+
contentProperties: z88.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
6508
|
+
designProperties: z88.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
6509
|
+
componentTree: z88.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
6510
|
+
slots: z88.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
6565
6511
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6566
6512
|
"Optional ExO metadata (tags, concepts)"
|
|
6567
6513
|
)
|
|
@@ -6605,19 +6551,19 @@ function createComponentTool(config) {
|
|
|
6605
6551
|
}
|
|
6606
6552
|
|
|
6607
6553
|
// src/tools/exo/components/upsertComponent.ts
|
|
6608
|
-
import { z as
|
|
6554
|
+
import { z as z89 } from "zod";
|
|
6609
6555
|
var UpsertComponentToolParams = BaseToolSchema.extend({
|
|
6610
|
-
componentId:
|
|
6611
|
-
version:
|
|
6556
|
+
componentId: z89.string().describe("The ID of the component to update"),
|
|
6557
|
+
version: z89.number().describe(
|
|
6612
6558
|
"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."
|
|
6613
6559
|
),
|
|
6614
|
-
name:
|
|
6615
|
-
description:
|
|
6616
|
-
viewports:
|
|
6617
|
-
contentProperties:
|
|
6618
|
-
designProperties:
|
|
6619
|
-
componentTree:
|
|
6620
|
-
slots:
|
|
6560
|
+
name: z89.string().optional().describe("The name of the component"),
|
|
6561
|
+
description: z89.string().optional().describe("Description of the component"),
|
|
6562
|
+
viewports: z89.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6563
|
+
contentProperties: z89.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
6564
|
+
designProperties: z89.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
6565
|
+
componentTree: z89.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
6566
|
+
slots: z89.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
6621
6567
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6622
6568
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6623
6569
|
)
|
|
@@ -6664,13 +6610,13 @@ function upsertComponentTool(config) {
|
|
|
6664
6610
|
}
|
|
6665
6611
|
|
|
6666
6612
|
// src/tools/exo/components/deleteComponent.ts
|
|
6667
|
-
import { z as
|
|
6613
|
+
import { z as z90 } from "zod";
|
|
6668
6614
|
var DeleteComponentToolParams = BaseToolSchema.extend({
|
|
6669
|
-
componentId:
|
|
6670
|
-
confirm:
|
|
6615
|
+
componentId: z90.string().describe("The ID of the component to delete"),
|
|
6616
|
+
confirm: z90.boolean().optional().describe(
|
|
6671
6617
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
6672
6618
|
),
|
|
6673
|
-
confirmToken:
|
|
6619
|
+
confirmToken: z90.string().optional().describe(
|
|
6674
6620
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
6675
6621
|
)
|
|
6676
6622
|
});
|
|
@@ -6712,10 +6658,10 @@ function deleteComponentTool(config) {
|
|
|
6712
6658
|
}
|
|
6713
6659
|
|
|
6714
6660
|
// src/tools/exo/components/publishComponent.ts
|
|
6715
|
-
import { z as
|
|
6661
|
+
import { z as z91 } from "zod";
|
|
6716
6662
|
var PublishComponentToolParams = BaseToolSchema.extend({
|
|
6717
|
-
componentId:
|
|
6718
|
-
version:
|
|
6663
|
+
componentId: z91.string().describe("The ID of the component to publish"),
|
|
6664
|
+
version: z91.number().describe(
|
|
6719
6665
|
"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."
|
|
6720
6666
|
)
|
|
6721
6667
|
});
|
|
@@ -6749,10 +6695,10 @@ function publishComponentTool(config) {
|
|
|
6749
6695
|
}
|
|
6750
6696
|
|
|
6751
6697
|
// src/tools/exo/components/unpublishComponent.ts
|
|
6752
|
-
import { z as
|
|
6698
|
+
import { z as z92 } from "zod";
|
|
6753
6699
|
var UnpublishComponentToolParams = BaseToolSchema.extend({
|
|
6754
|
-
componentId:
|
|
6755
|
-
version:
|
|
6700
|
+
componentId: z92.string().describe("The ID of the component to unpublish"),
|
|
6701
|
+
version: z92.number().describe(
|
|
6756
6702
|
"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."
|
|
6757
6703
|
)
|
|
6758
6704
|
});
|
|
@@ -6881,9 +6827,9 @@ function createComponentTools(config) {
|
|
|
6881
6827
|
}
|
|
6882
6828
|
|
|
6883
6829
|
// src/tools/exo/experience-fragments/getExperienceFragment.ts
|
|
6884
|
-
import { z as
|
|
6830
|
+
import { z as z93 } from "zod";
|
|
6885
6831
|
var GetExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6886
|
-
experienceFragmentId:
|
|
6832
|
+
experienceFragmentId: z93.string().describe("The ID of the experience fragment to retrieve details for")
|
|
6887
6833
|
});
|
|
6888
6834
|
function getExperienceFragmentTool(config) {
|
|
6889
6835
|
async function tool2(args) {
|
|
@@ -6901,12 +6847,12 @@ function getExperienceFragmentTool(config) {
|
|
|
6901
6847
|
}
|
|
6902
6848
|
|
|
6903
6849
|
// src/tools/exo/experience-fragments/listExperienceFragments.ts
|
|
6904
|
-
import { z as
|
|
6850
|
+
import { z as z94 } from "zod";
|
|
6905
6851
|
var ListExperienceFragmentsToolParams = BaseToolSchema.extend({
|
|
6906
|
-
limit:
|
|
6907
|
-
pageNext:
|
|
6908
|
-
pagePrev:
|
|
6909
|
-
order:
|
|
6852
|
+
limit: z94.number().optional().describe("Maximum number of experience fragments to return (max 10)"),
|
|
6853
|
+
pageNext: z94.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6854
|
+
pagePrev: z94.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6855
|
+
order: z94.string().optional().describe("Order experience fragments by this field (e.g. sys.createdAt)")
|
|
6910
6856
|
});
|
|
6911
6857
|
function listExperienceFragmentsTool(config) {
|
|
6912
6858
|
async function tool2(args) {
|
|
@@ -6936,21 +6882,21 @@ function listExperienceFragmentsTool(config) {
|
|
|
6936
6882
|
}
|
|
6937
6883
|
|
|
6938
6884
|
// src/tools/exo/experience-fragments/createExperienceFragment.ts
|
|
6939
|
-
import { z as
|
|
6885
|
+
import { z as z95 } from "zod";
|
|
6940
6886
|
var CreateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6941
|
-
name:
|
|
6942
|
-
description:
|
|
6887
|
+
name: z95.string().describe("The name of the experience fragment"),
|
|
6888
|
+
description: z95.string().describe("Description of the experience fragment"),
|
|
6943
6889
|
component: ComponentResourceLinkSchema.describe(
|
|
6944
6890
|
"Resource link to the component this experience fragment is based on"
|
|
6945
6891
|
),
|
|
6946
|
-
viewports:
|
|
6947
|
-
designProperties:
|
|
6892
|
+
viewports: z95.array(ViewportSchema).describe("Viewport definitions (may be empty)"),
|
|
6893
|
+
designProperties: z95.record(z95.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
6948
6894
|
"Design property values keyed by property ID (may be empty object)"
|
|
6949
6895
|
),
|
|
6950
6896
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6951
6897
|
"Optional content bindings for the experience fragment"
|
|
6952
6898
|
),
|
|
6953
|
-
slots:
|
|
6899
|
+
slots: z95.record(z95.string(), z95.array(ExperienceSlotNodeSchema)).optional().describe("Optional slot node definitions keyed by slot ID"),
|
|
6954
6900
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6955
6901
|
"Optional ExO metadata (tags, concepts)"
|
|
6956
6902
|
)
|
|
@@ -6983,20 +6929,20 @@ function createExperienceFragmentTool(config) {
|
|
|
6983
6929
|
}
|
|
6984
6930
|
|
|
6985
6931
|
// src/tools/exo/experience-fragments/updateExperienceFragment.ts
|
|
6986
|
-
import { z as
|
|
6932
|
+
import { z as z96 } from "zod";
|
|
6987
6933
|
var UpdateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6988
|
-
experienceFragmentId:
|
|
6989
|
-
version:
|
|
6934
|
+
experienceFragmentId: z96.string().describe("The ID of the experience fragment to update"),
|
|
6935
|
+
version: z96.number().describe(
|
|
6990
6936
|
"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."
|
|
6991
6937
|
),
|
|
6992
|
-
name:
|
|
6993
|
-
description:
|
|
6994
|
-
viewports:
|
|
6995
|
-
designProperties:
|
|
6938
|
+
name: z96.string().optional().describe("The name of the experience fragment"),
|
|
6939
|
+
description: z96.string().optional().describe("Description of the experience fragment"),
|
|
6940
|
+
viewports: z96.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6941
|
+
designProperties: z96.record(z96.string(), DimensionedDesignPropertyValueSchema).optional().describe("Design property values; replaces existing if provided"),
|
|
6996
6942
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6997
6943
|
"Content bindings; replaces existing if provided"
|
|
6998
6944
|
),
|
|
6999
|
-
slots:
|
|
6945
|
+
slots: z96.record(z96.string(), z96.array(ExperienceSlotNodeSchema)).optional().describe("Slot node definitions; replaces existing if provided"),
|
|
7000
6946
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
7001
6947
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7002
6948
|
)
|
|
@@ -7044,13 +6990,13 @@ function updateExperienceFragmentTool(config) {
|
|
|
7044
6990
|
}
|
|
7045
6991
|
|
|
7046
6992
|
// src/tools/exo/experience-fragments/deleteExperienceFragment.ts
|
|
7047
|
-
import { z as
|
|
6993
|
+
import { z as z97 } from "zod";
|
|
7048
6994
|
var DeleteExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
7049
|
-
experienceFragmentId:
|
|
7050
|
-
confirm:
|
|
6995
|
+
experienceFragmentId: z97.string().describe("The ID of the experience fragment to delete"),
|
|
6996
|
+
confirm: z97.boolean().optional().describe(
|
|
7051
6997
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7052
6998
|
),
|
|
7053
|
-
confirmToken:
|
|
6999
|
+
confirmToken: z97.string().optional().describe(
|
|
7054
7000
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7055
7001
|
)
|
|
7056
7002
|
});
|
|
@@ -7092,10 +7038,10 @@ function deleteExperienceFragmentTool(config) {
|
|
|
7092
7038
|
}
|
|
7093
7039
|
|
|
7094
7040
|
// src/tools/exo/experience-fragments/publishExperienceFragment.ts
|
|
7095
|
-
import { z as
|
|
7041
|
+
import { z as z98 } from "zod";
|
|
7096
7042
|
var PublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
7097
|
-
experienceFragmentId:
|
|
7098
|
-
version:
|
|
7043
|
+
experienceFragmentId: z98.string().describe("The ID of the experience fragment to publish"),
|
|
7044
|
+
version: z98.number().describe(
|
|
7099
7045
|
"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."
|
|
7100
7046
|
)
|
|
7101
7047
|
});
|
|
@@ -7129,10 +7075,10 @@ function publishExperienceFragmentTool(config) {
|
|
|
7129
7075
|
}
|
|
7130
7076
|
|
|
7131
7077
|
// src/tools/exo/experience-fragments/unpublishExperienceFragment.ts
|
|
7132
|
-
import { z as
|
|
7078
|
+
import { z as z99 } from "zod";
|
|
7133
7079
|
var UnpublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
7134
|
-
experienceFragmentId:
|
|
7135
|
-
version:
|
|
7080
|
+
experienceFragmentId: z99.string().describe("The ID of the experience fragment to unpublish"),
|
|
7081
|
+
version: z99.number().describe(
|
|
7136
7082
|
"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."
|
|
7137
7083
|
)
|
|
7138
7084
|
});
|
|
@@ -7264,9 +7210,9 @@ function createExperienceFragmentTools(config) {
|
|
|
7264
7210
|
}
|
|
7265
7211
|
|
|
7266
7212
|
// src/tools/exo/experience-templates/getExperienceTemplate.ts
|
|
7267
|
-
import { z as
|
|
7213
|
+
import { z as z100 } from "zod";
|
|
7268
7214
|
var GetExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7269
|
-
experienceTemplateId:
|
|
7215
|
+
experienceTemplateId: z100.string().describe("The ID of the experience template to retrieve details for")
|
|
7270
7216
|
});
|
|
7271
7217
|
function getExperienceTemplateTool(config) {
|
|
7272
7218
|
async function tool2(args) {
|
|
@@ -7284,12 +7230,12 @@ function getExperienceTemplateTool(config) {
|
|
|
7284
7230
|
}
|
|
7285
7231
|
|
|
7286
7232
|
// src/tools/exo/experience-templates/listExperienceTemplates.ts
|
|
7287
|
-
import { z as
|
|
7233
|
+
import { z as z101 } from "zod";
|
|
7288
7234
|
var ListExperienceTemplatesToolParams = BaseToolSchema.extend({
|
|
7289
|
-
limit:
|
|
7290
|
-
pageNext:
|
|
7291
|
-
pagePrev:
|
|
7292
|
-
order:
|
|
7235
|
+
limit: z101.number().optional().describe("Maximum number of experience templates to return (max 10)"),
|
|
7236
|
+
pageNext: z101.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7237
|
+
pagePrev: z101.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7238
|
+
order: z101.string().optional().describe("Order experience templates by this field (e.g. sys.createdAt)")
|
|
7293
7239
|
});
|
|
7294
7240
|
function listExperienceTemplatesTool(config) {
|
|
7295
7241
|
async function tool2(args) {
|
|
@@ -7319,17 +7265,17 @@ function listExperienceTemplatesTool(config) {
|
|
|
7319
7265
|
}
|
|
7320
7266
|
|
|
7321
7267
|
// src/tools/exo/experience-templates/createExperienceTemplate.ts
|
|
7322
|
-
import { z as
|
|
7268
|
+
import { z as z102 } from "zod";
|
|
7323
7269
|
var CreateExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7324
|
-
name:
|
|
7325
|
-
description:
|
|
7326
|
-
viewports:
|
|
7270
|
+
name: z102.string().describe("The name of the experience template"),
|
|
7271
|
+
description: z102.string().describe("Description of the experience template"),
|
|
7272
|
+
viewports: z102.array(ViewportSchema).describe(
|
|
7327
7273
|
"Viewport definitions for the experience template (may be empty)"
|
|
7328
7274
|
),
|
|
7329
|
-
contentProperties:
|
|
7330
|
-
designProperties:
|
|
7331
|
-
componentTree:
|
|
7332
|
-
slots:
|
|
7275
|
+
contentProperties: z102.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
7276
|
+
designProperties: z102.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
7277
|
+
componentTree: z102.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
7278
|
+
slots: z102.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
7333
7279
|
metadata: ExoMetadataSchema.optional().describe(
|
|
7334
7280
|
"Optional ExO metadata (tags, concepts)"
|
|
7335
7281
|
)
|
|
@@ -7362,19 +7308,19 @@ function createExperienceTemplateTool(config) {
|
|
|
7362
7308
|
}
|
|
7363
7309
|
|
|
7364
7310
|
// src/tools/exo/experience-templates/upsertExperienceTemplate.ts
|
|
7365
|
-
import { z as
|
|
7311
|
+
import { z as z103 } from "zod";
|
|
7366
7312
|
var UpsertExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7367
|
-
experienceTemplateId:
|
|
7368
|
-
version:
|
|
7313
|
+
experienceTemplateId: z103.string().describe("The ID of the experience template to update"),
|
|
7314
|
+
version: z103.number().describe(
|
|
7369
7315
|
"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."
|
|
7370
7316
|
),
|
|
7371
|
-
name:
|
|
7372
|
-
description:
|
|
7373
|
-
viewports:
|
|
7374
|
-
contentProperties:
|
|
7375
|
-
designProperties:
|
|
7376
|
-
componentTree:
|
|
7377
|
-
slots:
|
|
7317
|
+
name: z103.string().optional().describe("The name of the experience template"),
|
|
7318
|
+
description: z103.string().optional().describe("Description of the experience template"),
|
|
7319
|
+
viewports: z103.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7320
|
+
contentProperties: z103.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
7321
|
+
designProperties: z103.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
7322
|
+
componentTree: z103.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
7323
|
+
slots: z103.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
7378
7324
|
metadata: ExoMetadataSchema.optional().describe(
|
|
7379
7325
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7380
7326
|
)
|
|
@@ -7424,13 +7370,13 @@ function upsertExperienceTemplateTool(config) {
|
|
|
7424
7370
|
}
|
|
7425
7371
|
|
|
7426
7372
|
// src/tools/exo/experience-templates/deleteExperienceTemplate.ts
|
|
7427
|
-
import { z as
|
|
7373
|
+
import { z as z104 } from "zod";
|
|
7428
7374
|
var DeleteExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7429
|
-
experienceTemplateId:
|
|
7430
|
-
confirm:
|
|
7375
|
+
experienceTemplateId: z104.string().describe("The ID of the experience template to delete"),
|
|
7376
|
+
confirm: z104.boolean().optional().describe(
|
|
7431
7377
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7432
7378
|
),
|
|
7433
|
-
confirmToken:
|
|
7379
|
+
confirmToken: z104.string().optional().describe(
|
|
7434
7380
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7435
7381
|
)
|
|
7436
7382
|
});
|
|
@@ -7472,10 +7418,10 @@ function deleteExperienceTemplateTool(config) {
|
|
|
7472
7418
|
}
|
|
7473
7419
|
|
|
7474
7420
|
// src/tools/exo/experience-templates/publishExperienceTemplate.ts
|
|
7475
|
-
import { z as
|
|
7421
|
+
import { z as z105 } from "zod";
|
|
7476
7422
|
var PublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7477
|
-
experienceTemplateId:
|
|
7478
|
-
version:
|
|
7423
|
+
experienceTemplateId: z105.string().describe("The ID of the experience template to publish"),
|
|
7424
|
+
version: z105.number().describe(
|
|
7479
7425
|
"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."
|
|
7480
7426
|
)
|
|
7481
7427
|
});
|
|
@@ -7509,10 +7455,10 @@ function publishExperienceTemplateTool(config) {
|
|
|
7509
7455
|
}
|
|
7510
7456
|
|
|
7511
7457
|
// src/tools/exo/experience-templates/unpublishExperienceTemplate.ts
|
|
7512
|
-
import { z as
|
|
7458
|
+
import { z as z106 } from "zod";
|
|
7513
7459
|
var UnpublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7514
|
-
experienceTemplateId:
|
|
7515
|
-
version:
|
|
7460
|
+
experienceTemplateId: z106.string().describe("The ID of the experience template to unpublish"),
|
|
7461
|
+
version: z106.number().describe(
|
|
7516
7462
|
"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."
|
|
7517
7463
|
)
|
|
7518
7464
|
});
|
|
@@ -7644,9 +7590,9 @@ function createExperienceTemplateTools(config) {
|
|
|
7644
7590
|
}
|
|
7645
7591
|
|
|
7646
7592
|
// src/tools/exo/experiences/getExperience.ts
|
|
7647
|
-
import { z as
|
|
7593
|
+
import { z as z107 } from "zod";
|
|
7648
7594
|
var GetExperienceToolParams = BaseToolSchema.extend({
|
|
7649
|
-
experienceId:
|
|
7595
|
+
experienceId: z107.string().describe("The ID of the experience to retrieve")
|
|
7650
7596
|
});
|
|
7651
7597
|
function getExperienceTool(config) {
|
|
7652
7598
|
async function tool2(args) {
|
|
@@ -7664,12 +7610,12 @@ function getExperienceTool(config) {
|
|
|
7664
7610
|
}
|
|
7665
7611
|
|
|
7666
7612
|
// src/tools/exo/experiences/listExperiences.ts
|
|
7667
|
-
import { z as
|
|
7613
|
+
import { z as z108 } from "zod";
|
|
7668
7614
|
var ListExperiencesToolParams = BaseToolSchema.extend({
|
|
7669
|
-
limit:
|
|
7670
|
-
pageNext:
|
|
7671
|
-
pagePrev:
|
|
7672
|
-
order:
|
|
7615
|
+
limit: z108.number().optional().describe("Maximum number of experiences to return (max 10)"),
|
|
7616
|
+
pageNext: z108.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7617
|
+
pagePrev: z108.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7618
|
+
order: z108.string().optional().describe("Order experiences by this field (e.g. sys.createdAt)")
|
|
7673
7619
|
});
|
|
7674
7620
|
function listExperiencesTool(config) {
|
|
7675
7621
|
async function tool2(args) {
|
|
@@ -7699,21 +7645,21 @@ function listExperiencesTool(config) {
|
|
|
7699
7645
|
}
|
|
7700
7646
|
|
|
7701
7647
|
// src/tools/exo/experiences/createExperience.ts
|
|
7702
|
-
import { z as
|
|
7648
|
+
import { z as z109 } from "zod";
|
|
7703
7649
|
var CreateExperienceToolParams = BaseToolSchema.extend({
|
|
7704
|
-
name:
|
|
7705
|
-
description:
|
|
7650
|
+
name: z109.string().describe("The name of the experience"),
|
|
7651
|
+
description: z109.string().describe("Description of the experience"),
|
|
7706
7652
|
experienceTemplate: ExperienceTemplateResourceLinkSchema.describe(
|
|
7707
7653
|
"Resource link to the ExperienceTemplate this experience is backed by"
|
|
7708
7654
|
),
|
|
7709
|
-
viewports:
|
|
7710
|
-
designProperties:
|
|
7655
|
+
viewports: z109.array(ViewportSchema).describe("Viewport definitions for the experience (may be empty)"),
|
|
7656
|
+
designProperties: z109.record(z109.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
7711
7657
|
"Design property values keyed by property ID. Each value is a dimensioned map (viewport ID \u2192 design value). May be an empty object."
|
|
7712
7658
|
),
|
|
7713
7659
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7714
7660
|
"Optional content bindings linking this experience to a data assembly"
|
|
7715
7661
|
),
|
|
7716
|
-
slots:
|
|
7662
|
+
slots: z109.record(z109.string(), z109.array(ExperienceSlotNodeSchema)).optional().describe(
|
|
7717
7663
|
"Optional slot contents keyed by slot ID. Each value is an array of ExperienceFragmentNode or InlineExperienceFragmentNode."
|
|
7718
7664
|
),
|
|
7719
7665
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
@@ -7748,22 +7694,22 @@ function createExperienceTool(config) {
|
|
|
7748
7694
|
}
|
|
7749
7695
|
|
|
7750
7696
|
// src/tools/exo/experiences/upsertExperience.ts
|
|
7751
|
-
import { z as
|
|
7697
|
+
import { z as z110 } from "zod";
|
|
7752
7698
|
var UpsertExperienceToolParams = BaseToolSchema.extend({
|
|
7753
|
-
experienceId:
|
|
7754
|
-
version:
|
|
7699
|
+
experienceId: z110.string().describe("The ID of the experience to update"),
|
|
7700
|
+
version: z110.number().describe(
|
|
7755
7701
|
"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."
|
|
7756
7702
|
),
|
|
7757
|
-
name:
|
|
7758
|
-
description:
|
|
7759
|
-
viewports:
|
|
7760
|
-
designProperties:
|
|
7703
|
+
name: z110.string().optional().describe("The name of the experience"),
|
|
7704
|
+
description: z110.string().optional().describe("Description of the experience"),
|
|
7705
|
+
viewports: z110.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7706
|
+
designProperties: z110.record(z110.string(), DimensionedDesignPropertyValueSchema).optional().describe(
|
|
7761
7707
|
"Design property values keyed by property ID; replaces existing if provided"
|
|
7762
7708
|
),
|
|
7763
7709
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7764
7710
|
"Content bindings linking this experience to a data assembly; replaces existing if provided"
|
|
7765
7711
|
),
|
|
7766
|
-
slots:
|
|
7712
|
+
slots: z110.record(z110.string(), z110.array(ExperienceSlotNodeSchema)).optional().describe("Slot contents keyed by slot ID; replaces existing if provided"),
|
|
7767
7713
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
7768
7714
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7769
7715
|
)
|
|
@@ -7808,13 +7754,13 @@ function upsertExperienceTool(config) {
|
|
|
7808
7754
|
}
|
|
7809
7755
|
|
|
7810
7756
|
// src/tools/exo/experiences/deleteExperience.ts
|
|
7811
|
-
import { z as
|
|
7757
|
+
import { z as z111 } from "zod";
|
|
7812
7758
|
var DeleteExperienceToolParams = BaseToolSchema.extend({
|
|
7813
|
-
experienceId:
|
|
7814
|
-
confirm:
|
|
7759
|
+
experienceId: z111.string().describe("The ID of the experience to delete"),
|
|
7760
|
+
confirm: z111.boolean().optional().describe(
|
|
7815
7761
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7816
7762
|
),
|
|
7817
|
-
confirmToken:
|
|
7763
|
+
confirmToken: z111.string().optional().describe(
|
|
7818
7764
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7819
7765
|
)
|
|
7820
7766
|
});
|
|
@@ -7856,10 +7802,10 @@ function deleteExperienceTool(config) {
|
|
|
7856
7802
|
}
|
|
7857
7803
|
|
|
7858
7804
|
// src/tools/exo/experiences/publishExperience.ts
|
|
7859
|
-
import { z as
|
|
7805
|
+
import { z as z112 } from "zod";
|
|
7860
7806
|
var PublishExperienceToolParams = BaseToolSchema.extend({
|
|
7861
|
-
experienceId:
|
|
7862
|
-
version:
|
|
7807
|
+
experienceId: z112.string().describe("The ID of the experience to publish"),
|
|
7808
|
+
version: z112.number().describe(
|
|
7863
7809
|
"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."
|
|
7864
7810
|
)
|
|
7865
7811
|
});
|
|
@@ -7893,10 +7839,10 @@ function publishExperienceTool(config) {
|
|
|
7893
7839
|
}
|
|
7894
7840
|
|
|
7895
7841
|
// src/tools/exo/experiences/unpublishExperience.ts
|
|
7896
|
-
import { z as
|
|
7842
|
+
import { z as z113 } from "zod";
|
|
7897
7843
|
var UnpublishExperienceToolParams = BaseToolSchema.extend({
|
|
7898
|
-
experienceId:
|
|
7899
|
-
version:
|
|
7844
|
+
experienceId: z113.string().describe("The ID of the experience to unpublish"),
|
|
7845
|
+
version: z113.number().describe(
|
|
7900
7846
|
"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."
|
|
7901
7847
|
)
|
|
7902
7848
|
});
|
|
@@ -8025,9 +7971,9 @@ function createExperienceTools(config) {
|
|
|
8025
7971
|
}
|
|
8026
7972
|
|
|
8027
7973
|
// src/tools/exo/data-assemblies/getDataAssembly.ts
|
|
8028
|
-
import { z as
|
|
7974
|
+
import { z as z114 } from "zod";
|
|
8029
7975
|
var GetDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8030
|
-
dataAssemblyId:
|
|
7976
|
+
dataAssemblyId: z114.string().describe("The ID of the data assembly to retrieve")
|
|
8031
7977
|
});
|
|
8032
7978
|
function getDataAssemblyTool(config) {
|
|
8033
7979
|
async function tool2(args) {
|
|
@@ -8045,9 +7991,9 @@ function getDataAssemblyTool(config) {
|
|
|
8045
7991
|
}
|
|
8046
7992
|
|
|
8047
7993
|
// src/tools/exo/data-assemblies/getPublishedDataAssembly.ts
|
|
8048
|
-
import { z as
|
|
7994
|
+
import { z as z115 } from "zod";
|
|
8049
7995
|
var GetPublishedDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8050
|
-
dataAssemblyId:
|
|
7996
|
+
dataAssemblyId: z115.string().describe("The ID of the published data assembly to retrieve")
|
|
8051
7997
|
});
|
|
8052
7998
|
function getPublishedDataAssemblyTool(config) {
|
|
8053
7999
|
async function tool2(args) {
|
|
@@ -8065,12 +8011,12 @@ function getPublishedDataAssemblyTool(config) {
|
|
|
8065
8011
|
}
|
|
8066
8012
|
|
|
8067
8013
|
// src/tools/exo/data-assemblies/listDataAssemblies.ts
|
|
8068
|
-
import { z as
|
|
8014
|
+
import { z as z116 } from "zod";
|
|
8069
8015
|
var ListDataAssembliesToolParams = BaseToolSchema.extend({
|
|
8070
|
-
limit:
|
|
8071
|
-
pageNext:
|
|
8072
|
-
pagePrev:
|
|
8073
|
-
sysIdIn:
|
|
8016
|
+
limit: z116.number().optional().describe("Maximum number of data assemblies to return (max 10)"),
|
|
8017
|
+
pageNext: z116.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8018
|
+
pagePrev: z116.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8019
|
+
sysIdIn: z116.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
8074
8020
|
});
|
|
8075
8021
|
function listDataAssembliesTool(config) {
|
|
8076
8022
|
async function tool2(args) {
|
|
@@ -8099,12 +8045,12 @@ function listDataAssembliesTool(config) {
|
|
|
8099
8045
|
}
|
|
8100
8046
|
|
|
8101
8047
|
// src/tools/exo/data-assemblies/listPublishedDataAssemblies.ts
|
|
8102
|
-
import { z as
|
|
8048
|
+
import { z as z117 } from "zod";
|
|
8103
8049
|
var ListPublishedDataAssembliesToolParams = BaseToolSchema.extend({
|
|
8104
|
-
limit:
|
|
8105
|
-
pageNext:
|
|
8106
|
-
pagePrev:
|
|
8107
|
-
sysIdIn:
|
|
8050
|
+
limit: z117.number().optional().describe("Maximum number of published data assemblies to return (max 10)"),
|
|
8051
|
+
pageNext: z117.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8052
|
+
pagePrev: z117.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8053
|
+
sysIdIn: z117.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
8108
8054
|
});
|
|
8109
8055
|
function listPublishedDataAssembliesTool(config) {
|
|
8110
8056
|
async function tool2(args) {
|
|
@@ -8133,35 +8079,35 @@ function listPublishedDataAssembliesTool(config) {
|
|
|
8133
8079
|
}
|
|
8134
8080
|
|
|
8135
8081
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
8136
|
-
import { z as
|
|
8082
|
+
import { z as z119 } from "zod";
|
|
8137
8083
|
|
|
8138
8084
|
// src/types/dataAssemblySchemas.ts
|
|
8139
|
-
import { z as
|
|
8140
|
-
var PointerExpressionValueSchema =
|
|
8141
|
-
() =>
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
$from:
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
source:
|
|
8085
|
+
import { z as z118 } from "zod";
|
|
8086
|
+
var PointerExpressionValueSchema = z118.lazy(
|
|
8087
|
+
() => z118.union([
|
|
8088
|
+
z118.string(),
|
|
8089
|
+
z118.object({
|
|
8090
|
+
$from: z118.union([
|
|
8091
|
+
z118.string(),
|
|
8092
|
+
z118.object({
|
|
8093
|
+
source: z118.string(),
|
|
8148
8094
|
select: PointerExpressionValueSchema.optional()
|
|
8149
8095
|
})
|
|
8150
8096
|
])
|
|
8151
8097
|
}),
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
$on:
|
|
8156
|
-
type:
|
|
8098
|
+
z118.object({ $literal: z118.custom() }),
|
|
8099
|
+
z118.object({ $object: z118.record(z118.string(), PointerExpressionValueSchema) }),
|
|
8100
|
+
z118.object({
|
|
8101
|
+
$on: z118.object({
|
|
8102
|
+
type: z118.record(z118.string(), PointerExpressionValueSchema),
|
|
8157
8103
|
default: PointerExpressionValueSchema.optional()
|
|
8158
8104
|
})
|
|
8159
8105
|
}),
|
|
8160
|
-
|
|
8106
|
+
z118.record(z118.string(), PointerExpressionValueSchema)
|
|
8161
8107
|
])
|
|
8162
8108
|
);
|
|
8163
|
-
var CanonicalDataTypeArmSchema =
|
|
8164
|
-
type:
|
|
8109
|
+
var CanonicalDataTypeArmSchema = z118.object({
|
|
8110
|
+
type: z118.enum([
|
|
8165
8111
|
"String",
|
|
8166
8112
|
"Number",
|
|
8167
8113
|
"Integer",
|
|
@@ -8173,72 +8119,72 @@ var CanonicalDataTypeArmSchema = z119.object({
|
|
|
8173
8119
|
"Literal",
|
|
8174
8120
|
"DiscriminatedUnion"
|
|
8175
8121
|
]),
|
|
8176
|
-
id:
|
|
8177
|
-
name:
|
|
8178
|
-
required:
|
|
8179
|
-
}).catchall(
|
|
8180
|
-
var LegacyDataTypeArmSchema =
|
|
8181
|
-
id:
|
|
8182
|
-
name:
|
|
8183
|
-
type:
|
|
8184
|
-
required:
|
|
8185
|
-
source:
|
|
8186
|
-
ref:
|
|
8187
|
-
});
|
|
8188
|
-
var DataAssemblyDataTypeFieldSchema =
|
|
8122
|
+
id: z118.string().describe("Data type field identifier"),
|
|
8123
|
+
name: z118.string().describe("Human-readable name"),
|
|
8124
|
+
required: z118.boolean().optional()
|
|
8125
|
+
}).catchall(z118.unknown());
|
|
8126
|
+
var LegacyDataTypeArmSchema = z118.object({
|
|
8127
|
+
id: z118.string().describe("Data type field identifier"),
|
|
8128
|
+
name: z118.string().describe("Human-readable name"),
|
|
8129
|
+
type: z118.string(),
|
|
8130
|
+
required: z118.boolean().optional(),
|
|
8131
|
+
source: z118.string().optional(),
|
|
8132
|
+
ref: z118.unknown().optional()
|
|
8133
|
+
});
|
|
8134
|
+
var DataAssemblyDataTypeFieldSchema = z118.union([
|
|
8189
8135
|
CanonicalDataTypeArmSchema,
|
|
8190
8136
|
LegacyDataTypeArmSchema
|
|
8191
8137
|
]);
|
|
8192
8138
|
var SAME_SPACE_CONTENT_SOURCE = "crn:contentful:::content:spaces/$self/environments/$self";
|
|
8193
|
-
var DataAssemblyResourceLinkParameterSchema =
|
|
8194
|
-
name:
|
|
8195
|
-
description:
|
|
8196
|
-
type:
|
|
8197
|
-
linkType:
|
|
8198
|
-
allowedResources:
|
|
8199
|
-
|
|
8200
|
-
type:
|
|
8201
|
-
source:
|
|
8202
|
-
allowedTypes:
|
|
8139
|
+
var DataAssemblyResourceLinkParameterSchema = z118.object({
|
|
8140
|
+
name: z118.string().optional(),
|
|
8141
|
+
description: z118.string().optional(),
|
|
8142
|
+
type: z118.literal("ResourceLink"),
|
|
8143
|
+
linkType: z118.literal("Contentful:Entry"),
|
|
8144
|
+
allowedResources: z118.array(
|
|
8145
|
+
z118.object({
|
|
8146
|
+
type: z118.literal("Contentful:Entry"),
|
|
8147
|
+
source: z118.literal(SAME_SPACE_CONTENT_SOURCE),
|
|
8148
|
+
allowedTypes: z118.array(z118.string())
|
|
8203
8149
|
})
|
|
8204
8150
|
)
|
|
8205
8151
|
});
|
|
8206
|
-
var DataAssemblyParameterConfigSchema =
|
|
8207
|
-
|
|
8152
|
+
var DataAssemblyParameterConfigSchema = z118.record(
|
|
8153
|
+
z118.string(),
|
|
8208
8154
|
DataAssemblyResourceLinkParameterSchema
|
|
8209
8155
|
);
|
|
8210
|
-
var DataAssemblyGraphQLResolverSchema =
|
|
8211
|
-
source:
|
|
8212
|
-
query:
|
|
8156
|
+
var DataAssemblyGraphQLResolverSchema = z118.object({
|
|
8157
|
+
source: z118.literal("Contentful:GraphQL"),
|
|
8158
|
+
query: z118.string().describe("GraphQL query string"),
|
|
8213
8159
|
parameters: PointerExpressionValueSchema.optional()
|
|
8214
8160
|
});
|
|
8215
|
-
var DataAssemblyNestedResolverSchema =
|
|
8216
|
-
source:
|
|
8217
|
-
dataAssembly:
|
|
8218
|
-
sys:
|
|
8219
|
-
type:
|
|
8220
|
-
linkType:
|
|
8221
|
-
urn:
|
|
8161
|
+
var DataAssemblyNestedResolverSchema = z118.object({
|
|
8162
|
+
source: z118.literal("Contentful:DataAssembly"),
|
|
8163
|
+
dataAssembly: z118.object({
|
|
8164
|
+
sys: z118.object({
|
|
8165
|
+
type: z118.literal("ResourceLink"),
|
|
8166
|
+
linkType: z118.literal("Contentful:DataAssembly"),
|
|
8167
|
+
urn: z118.string()
|
|
8222
8168
|
})
|
|
8223
8169
|
}),
|
|
8224
8170
|
parameters: PointerExpressionValueSchema.optional()
|
|
8225
8171
|
});
|
|
8226
|
-
var DataAssemblyResolverDefinitionSchema =
|
|
8172
|
+
var DataAssemblyResolverDefinitionSchema = z118.union([
|
|
8227
8173
|
DataAssemblyGraphQLResolverSchema,
|
|
8228
8174
|
DataAssemblyNestedResolverSchema
|
|
8229
8175
|
]);
|
|
8230
|
-
var DataAssemblyResolverConfigSchema =
|
|
8231
|
-
|
|
8176
|
+
var DataAssemblyResolverConfigSchema = z118.record(
|
|
8177
|
+
z118.string(),
|
|
8232
8178
|
DataAssemblyResolverDefinitionSchema
|
|
8233
8179
|
);
|
|
8234
8180
|
var DataAssemblyReturnMappingConfigSchema = PointerExpressionValueSchema;
|
|
8235
|
-
var DataAssemblyMetadataSchema =
|
|
8236
|
-
tags:
|
|
8237
|
-
|
|
8238
|
-
sys:
|
|
8239
|
-
type:
|
|
8240
|
-
linkType:
|
|
8241
|
-
id:
|
|
8181
|
+
var DataAssemblyMetadataSchema = z118.object({
|
|
8182
|
+
tags: z118.array(
|
|
8183
|
+
z118.object({
|
|
8184
|
+
sys: z118.object({
|
|
8185
|
+
type: z118.literal("Link"),
|
|
8186
|
+
linkType: z118.literal("Tag"),
|
|
8187
|
+
id: z118.string()
|
|
8242
8188
|
})
|
|
8243
8189
|
})
|
|
8244
8190
|
)
|
|
@@ -8246,8 +8192,8 @@ var DataAssemblyMetadataSchema = z119.object({
|
|
|
8246
8192
|
|
|
8247
8193
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
8248
8194
|
var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8249
|
-
name:
|
|
8250
|
-
description:
|
|
8195
|
+
name: z119.string().describe("The name of the data assembly"),
|
|
8196
|
+
description: z119.string().describe("Description of the data assembly"),
|
|
8251
8197
|
parameters: DataAssemblyParameterConfigSchema.describe(
|
|
8252
8198
|
"Parameter definitions keyed by parameter name (may be empty object)"
|
|
8253
8199
|
),
|
|
@@ -8257,8 +8203,8 @@ var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
8257
8203
|
return: DataAssemblyReturnMappingConfigSchema.describe(
|
|
8258
8204
|
"Return mapping configuration specifying how to map resolved data"
|
|
8259
8205
|
),
|
|
8260
|
-
dataType:
|
|
8261
|
-
variant:
|
|
8206
|
+
dataType: z119.array(DataAssemblyDataTypeFieldSchema).describe("Data type field definitions for this data assembly (may be empty array)"),
|
|
8207
|
+
variant: z119.string().optional().describe("Optional variant identifier for this data assembly"),
|
|
8262
8208
|
metadata: DataAssemblyMetadataSchema.optional().describe("Optional metadata (tags)")
|
|
8263
8209
|
});
|
|
8264
8210
|
function createDataAssemblyTool(config) {
|
|
@@ -8292,14 +8238,14 @@ function createDataAssemblyTool(config) {
|
|
|
8292
8238
|
}
|
|
8293
8239
|
|
|
8294
8240
|
// src/tools/exo/data-assemblies/updateDataAssembly.ts
|
|
8295
|
-
import { z as
|
|
8241
|
+
import { z as z120 } from "zod";
|
|
8296
8242
|
var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8297
|
-
dataAssemblyId:
|
|
8298
|
-
version:
|
|
8243
|
+
dataAssemblyId: z120.string().describe("The ID of the data assembly to update"),
|
|
8244
|
+
version: z120.number().describe(
|
|
8299
8245
|
"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."
|
|
8300
8246
|
),
|
|
8301
|
-
name:
|
|
8302
|
-
description:
|
|
8247
|
+
name: z120.string().optional().describe("The name of the data assembly"),
|
|
8248
|
+
description: z120.string().optional().describe("Description of the data assembly"),
|
|
8303
8249
|
parameters: DataAssemblyParameterConfigSchema.optional().describe(
|
|
8304
8250
|
"Parameter definitions; replaces existing if provided"
|
|
8305
8251
|
),
|
|
@@ -8309,8 +8255,8 @@ var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
8309
8255
|
return: DataAssemblyReturnMappingConfigSchema.optional().describe(
|
|
8310
8256
|
"Return mapping configuration; replaces existing if provided"
|
|
8311
8257
|
),
|
|
8312
|
-
dataType:
|
|
8313
|
-
variant:
|
|
8258
|
+
dataType: z120.array(DataAssemblyDataTypeFieldSchema).optional().describe("Data type field definitions; replaces existing if provided"),
|
|
8259
|
+
variant: z120.string().optional().describe("Optional variant identifier; replaces existing if provided"),
|
|
8314
8260
|
metadata: DataAssemblyMetadataSchema.optional().describe(
|
|
8315
8261
|
"Metadata (tags); replaces existing if provided"
|
|
8316
8262
|
)
|
|
@@ -8356,13 +8302,13 @@ function updateDataAssemblyTool(config) {
|
|
|
8356
8302
|
}
|
|
8357
8303
|
|
|
8358
8304
|
// src/tools/exo/data-assemblies/deleteDataAssembly.ts
|
|
8359
|
-
import { z as
|
|
8305
|
+
import { z as z121 } from "zod";
|
|
8360
8306
|
var DeleteDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8361
|
-
dataAssemblyId:
|
|
8362
|
-
confirm:
|
|
8307
|
+
dataAssemblyId: z121.string().describe("The ID of the data assembly to delete"),
|
|
8308
|
+
confirm: z121.boolean().optional().describe(
|
|
8363
8309
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
8364
8310
|
),
|
|
8365
|
-
confirmToken:
|
|
8311
|
+
confirmToken: z121.string().optional().describe(
|
|
8366
8312
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
8367
8313
|
)
|
|
8368
8314
|
});
|
|
@@ -8404,10 +8350,10 @@ function deleteDataAssemblyTool(config) {
|
|
|
8404
8350
|
}
|
|
8405
8351
|
|
|
8406
8352
|
// src/tools/exo/data-assemblies/publishDataAssembly.ts
|
|
8407
|
-
import { z as
|
|
8353
|
+
import { z as z122 } from "zod";
|
|
8408
8354
|
var PublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8409
|
-
dataAssemblyId:
|
|
8410
|
-
version:
|
|
8355
|
+
dataAssemblyId: z122.string().describe("The ID of the data assembly to publish"),
|
|
8356
|
+
version: z122.number().describe(
|
|
8411
8357
|
"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."
|
|
8412
8358
|
)
|
|
8413
8359
|
});
|
|
@@ -8441,10 +8387,10 @@ function publishDataAssemblyTool(config) {
|
|
|
8441
8387
|
}
|
|
8442
8388
|
|
|
8443
8389
|
// src/tools/exo/data-assemblies/unpublishDataAssembly.ts
|
|
8444
|
-
import { z as
|
|
8390
|
+
import { z as z123 } from "zod";
|
|
8445
8391
|
var UnpublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8446
|
-
dataAssemblyId:
|
|
8447
|
-
version:
|
|
8392
|
+
dataAssemblyId: z123.string().describe("The ID of the data assembly to unpublish"),
|
|
8393
|
+
version: z123.number().describe(
|
|
8448
8394
|
"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."
|
|
8449
8395
|
)
|
|
8450
8396
|
});
|
|
@@ -8597,9 +8543,9 @@ function createDataAssemblyTools(config) {
|
|
|
8597
8543
|
}
|
|
8598
8544
|
|
|
8599
8545
|
// src/tools/exo/design-tokens/getDesignToken.ts
|
|
8600
|
-
import { z as
|
|
8546
|
+
import { z as z124 } from "zod";
|
|
8601
8547
|
var GetDesignTokenToolParams = BaseToolSchema.extend({
|
|
8602
|
-
designTokenId:
|
|
8548
|
+
designTokenId: z124.string().describe("The ID of the design token to retrieve details for")
|
|
8603
8549
|
});
|
|
8604
8550
|
function getDesignTokenTool(config) {
|
|
8605
8551
|
async function tool2(args) {
|
|
@@ -8617,12 +8563,12 @@ function getDesignTokenTool(config) {
|
|
|
8617
8563
|
}
|
|
8618
8564
|
|
|
8619
8565
|
// src/tools/exo/design-tokens/listDesignTokens.ts
|
|
8620
|
-
import { z as
|
|
8566
|
+
import { z as z125 } from "zod";
|
|
8621
8567
|
var ListDesignTokensToolParams = BaseToolSchema.extend({
|
|
8622
|
-
limit:
|
|
8623
|
-
pageNext:
|
|
8624
|
-
pagePrev:
|
|
8625
|
-
type:
|
|
8568
|
+
limit: z125.number().optional().describe("Maximum number of design tokens to return (max 10)"),
|
|
8569
|
+
pageNext: z125.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8570
|
+
pagePrev: z125.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8571
|
+
type: z125.enum(DTCG_DESIGN_PROPERTY_TYPES).optional().describe("Filter to design tokens of this DTCG type (e.g. DTCG.Color)")
|
|
8626
8572
|
});
|
|
8627
8573
|
function listDesignTokensTool(config) {
|
|
8628
8574
|
async function tool2(args) {
|
|
@@ -8652,14 +8598,14 @@ function listDesignTokensTool(config) {
|
|
|
8652
8598
|
}
|
|
8653
8599
|
|
|
8654
8600
|
// src/tools/exo/design-tokens/upsertDesignToken.ts
|
|
8655
|
-
import { z as
|
|
8601
|
+
import { z as z126 } from "zod";
|
|
8656
8602
|
var UpsertDesignTokenToolParams = BaseToolSchema.extend({
|
|
8657
|
-
designTokenId:
|
|
8658
|
-
version:
|
|
8603
|
+
designTokenId: z126.string().describe("The ID of the design token to create or update"),
|
|
8604
|
+
version: z126.number().optional().describe(
|
|
8659
8605
|
"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."
|
|
8660
8606
|
),
|
|
8661
|
-
name:
|
|
8662
|
-
type:
|
|
8607
|
+
name: z126.string().optional().describe("The name of the design token; required when creating"),
|
|
8608
|
+
type: z126.enum(DTCG_DESIGN_PROPERTY_TYPES).optional().describe("The DTCG type of the design token; required when creating"),
|
|
8663
8609
|
metadata: ExoMetadataSchema.optional().describe(
|
|
8664
8610
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
8665
8611
|
)
|
|
@@ -8718,13 +8664,13 @@ function upsertDesignTokenTool(config) {
|
|
|
8718
8664
|
}
|
|
8719
8665
|
|
|
8720
8666
|
// src/tools/exo/design-tokens/deleteDesignToken.ts
|
|
8721
|
-
import { z as
|
|
8667
|
+
import { z as z127 } from "zod";
|
|
8722
8668
|
var DeleteDesignTokenToolParams = BaseToolSchema.extend({
|
|
8723
|
-
designTokenId:
|
|
8724
|
-
confirm:
|
|
8669
|
+
designTokenId: z127.string().describe("The ID of the design token to delete"),
|
|
8670
|
+
confirm: z127.boolean().optional().describe(
|
|
8725
8671
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
8726
8672
|
),
|
|
8727
|
-
confirmToken:
|
|
8673
|
+
confirmToken: z127.string().optional().describe(
|
|
8728
8674
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
8729
8675
|
)
|
|
8730
8676
|
});
|