@contentful/mcp-tools 0.12.7 → 0.12.8
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 +84 -34
- package/dist/index.js +1422 -1049
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -34,12 +34,52 @@ function createSuccessResponse(message, data) {
|
|
|
34
34
|
]
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
+
function isRecord(value) {
|
|
38
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39
|
+
}
|
|
40
|
+
function formatErrorMessage(error) {
|
|
41
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
42
|
+
if (!/^\s*[[{]/.test(message)) return message;
|
|
43
|
+
let data;
|
|
44
|
+
try {
|
|
45
|
+
data = JSON.parse(message);
|
|
46
|
+
} catch {
|
|
47
|
+
return "Request failed.";
|
|
48
|
+
}
|
|
49
|
+
if (!isRecord(data)) return "Request failed.";
|
|
50
|
+
const diagnostics = {};
|
|
51
|
+
if (error instanceof Error && error.name !== "Error" && /^[A-Za-z]\w*$/.test(error.name)) {
|
|
52
|
+
diagnostics["name"] = error.name;
|
|
53
|
+
}
|
|
54
|
+
if (typeof data["status"] === "number" && Number.isInteger(data["status"]) && data["status"] >= 100 && data["status"] <= 599) {
|
|
55
|
+
diagnostics["status"] = data["status"];
|
|
56
|
+
}
|
|
57
|
+
for (const key of ["statusText", "message", "requestId"]) {
|
|
58
|
+
if (typeof data[key] === "string" && !/^\s*[[{]/.test(data[key])) {
|
|
59
|
+
diagnostics[key] = data[key];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (isRecord(data["details"]) && Array.isArray(data["details"]["errors"])) {
|
|
63
|
+
const errors = data["details"]["errors"].filter(isRecord).map((item) => {
|
|
64
|
+
const diagnostic = {};
|
|
65
|
+
if (typeof item["name"] === "string") diagnostic["name"] = item["name"];
|
|
66
|
+
if (Array.isArray(item["path"]) && item["path"].every(
|
|
67
|
+
(part) => typeof part === "string" || typeof part === "number"
|
|
68
|
+
)) {
|
|
69
|
+
diagnostic["path"] = item["path"];
|
|
70
|
+
}
|
|
71
|
+
return diagnostic;
|
|
72
|
+
}).filter((item) => Object.keys(item).length > 0);
|
|
73
|
+
if (errors.length > 0) diagnostics["details"] = { errors };
|
|
74
|
+
}
|
|
75
|
+
return Object.keys(diagnostics).length > 0 ? JSON.stringify(diagnostics, null, " ") : "Request failed.";
|
|
76
|
+
}
|
|
37
77
|
function withErrorHandling(handler, errorPrefix = "Error") {
|
|
38
78
|
return async (params, extra) => {
|
|
39
79
|
try {
|
|
40
80
|
return await handler(params, extra);
|
|
41
81
|
} catch (error) {
|
|
42
|
-
const errorMessage =
|
|
82
|
+
const errorMessage = formatErrorMessage(error);
|
|
43
83
|
return {
|
|
44
84
|
isError: true,
|
|
45
85
|
content: [
|
|
@@ -563,7 +603,7 @@ function publishAiActionTool(config) {
|
|
|
563
603
|
});
|
|
564
604
|
} catch (error) {
|
|
565
605
|
return createSuccessResponse("AI action publish failed", {
|
|
566
|
-
status: error,
|
|
606
|
+
status: formatErrorMessage(error),
|
|
567
607
|
aiActionId: args.aiActionId
|
|
568
608
|
});
|
|
569
609
|
}
|
|
@@ -595,7 +635,7 @@ function unpublishAiActionTool(config) {
|
|
|
595
635
|
});
|
|
596
636
|
} catch (error) {
|
|
597
637
|
return createSuccessResponse("AI action unpublish failed", {
|
|
598
|
-
status: error,
|
|
638
|
+
status: formatErrorMessage(error),
|
|
599
639
|
aiActionId: args.aiActionId
|
|
600
640
|
});
|
|
601
641
|
}
|
|
@@ -1285,7 +1325,7 @@ function publishAssetTool(config) {
|
|
|
1285
1325
|
});
|
|
1286
1326
|
} catch (error) {
|
|
1287
1327
|
return createSuccessResponse("Asset publish failed", {
|
|
1288
|
-
status: error,
|
|
1328
|
+
status: formatErrorMessage(error),
|
|
1289
1329
|
assetId: assetIds[0]
|
|
1290
1330
|
});
|
|
1291
1331
|
}
|
|
@@ -1365,7 +1405,7 @@ function unpublishAssetTool(config) {
|
|
|
1365
1405
|
});
|
|
1366
1406
|
} catch (error) {
|
|
1367
1407
|
return createSuccessResponse("Asset unpublish failed", {
|
|
1368
|
-
status: error,
|
|
1408
|
+
status: formatErrorMessage(error),
|
|
1369
1409
|
assetId: assetIds[0]
|
|
1370
1410
|
});
|
|
1371
1411
|
}
|
|
@@ -1437,7 +1477,7 @@ function archiveAssetTool(config) {
|
|
|
1437
1477
|
await contentfulClient.asset.archive(params);
|
|
1438
1478
|
successfullyArchived.push(assetId);
|
|
1439
1479
|
} catch (error) {
|
|
1440
|
-
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive asset '${assetId}' after successfully archiving ${successfullyArchived.length} asset(s): [${successfullyArchived.join(", ")}]. Original error: ${
|
|
1480
|
+
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive asset '${assetId}' after successfully archiving ${successfullyArchived.length} asset(s): [${successfullyArchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to archive asset '${assetId}': ${formatErrorMessage(error)}`;
|
|
1441
1481
|
throw new Error(errorMessage);
|
|
1442
1482
|
}
|
|
1443
1483
|
}
|
|
@@ -1503,7 +1543,7 @@ function unarchiveAssetTool(config) {
|
|
|
1503
1543
|
await contentfulClient.asset.unarchive(params);
|
|
1504
1544
|
successfullyUnarchived.push(assetId);
|
|
1505
1545
|
} catch (error) {
|
|
1506
|
-
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive asset '${assetId}' after successfully unarchiving ${successfullyUnarchived.length} asset(s): [${successfullyUnarchived.join(", ")}]. Original error: ${
|
|
1546
|
+
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive asset '${assetId}' after successfully unarchiving ${successfullyUnarchived.length} asset(s): [${successfullyUnarchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to unarchive asset '${assetId}': ${formatErrorMessage(error)}`;
|
|
1507
1547
|
throw new Error(errorMessage);
|
|
1508
1548
|
}
|
|
1509
1549
|
}
|
|
@@ -1645,10 +1685,341 @@ function createAssetTools(config) {
|
|
|
1645
1685
|
};
|
|
1646
1686
|
}
|
|
1647
1687
|
|
|
1648
|
-
// src/tools/content-
|
|
1688
|
+
// src/tools/content-previews/listContentPreviews.ts
|
|
1649
1689
|
import { z as z23 } from "zod";
|
|
1690
|
+
import { createClient as createClient2 } from "contentful-management";
|
|
1691
|
+
|
|
1692
|
+
// src/tools/content-previews/types.ts
|
|
1693
|
+
function configurationContentTypeId(configuration) {
|
|
1694
|
+
if (configuration.entityType && configuration.entityType !== "ContentType") {
|
|
1695
|
+
return void 0;
|
|
1696
|
+
}
|
|
1697
|
+
return configuration.entityId ?? configuration.contentType ?? void 0;
|
|
1698
|
+
}
|
|
1699
|
+
function findEnabledConfiguration(previewEnvironment, contentTypeId) {
|
|
1700
|
+
return previewEnvironment.configurations.find(
|
|
1701
|
+
(configuration) => configuration.enabled && configurationContentTypeId(configuration) === contentTypeId
|
|
1702
|
+
);
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
// src/tools/content-previews/client.ts
|
|
1706
|
+
function previewEnvironmentsPath(spaceId) {
|
|
1707
|
+
return `/spaces/${spaceId}/preview_environments`;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
// src/tools/content-previews/listContentPreviews.ts
|
|
1711
|
+
var ListContentPreviewsToolParams = z23.object({
|
|
1712
|
+
spaceId: z23.string().describe("The ID of the Contentful space"),
|
|
1713
|
+
contentTypeId: z23.string().optional().describe(
|
|
1714
|
+
"Only return previews that have an enabled configuration for this content type"
|
|
1715
|
+
),
|
|
1716
|
+
limit: z23.number().optional().describe("Maximum number of content previews to return (default 100)"),
|
|
1717
|
+
skip: z23.number().optional().describe("Skip this many content previews for pagination")
|
|
1718
|
+
});
|
|
1719
|
+
function listContentPreviewsTool(config) {
|
|
1720
|
+
async function tool2(args) {
|
|
1721
|
+
const contentfulClient = createClient2(createClientConfig(config));
|
|
1722
|
+
const previews = await contentfulClient.raw.get(previewEnvironmentsPath(args.spaceId), {
|
|
1723
|
+
params: {
|
|
1724
|
+
limit: args.limit ?? 100,
|
|
1725
|
+
...args.skip ? { skip: args.skip } : {}
|
|
1726
|
+
}
|
|
1727
|
+
});
|
|
1728
|
+
const summarized = previews.items.map((preview) => ({
|
|
1729
|
+
id: preview.sys.id,
|
|
1730
|
+
name: preview.name,
|
|
1731
|
+
description: preview.description ?? null,
|
|
1732
|
+
configurations: preview.configurations.filter(
|
|
1733
|
+
(configuration) => !args.contentTypeId || configuration.enabled && configurationContentTypeId(configuration) === args.contentTypeId
|
|
1734
|
+
).map((configuration) => ({
|
|
1735
|
+
contentTypeId: configurationContentTypeId(configuration) ?? null,
|
|
1736
|
+
entityType: configuration.entityType ?? "ContentType",
|
|
1737
|
+
urlTemplate: configuration.url,
|
|
1738
|
+
enabled: configuration.enabled
|
|
1739
|
+
}))
|
|
1740
|
+
})).filter(
|
|
1741
|
+
(preview) => !args.contentTypeId || preview.configurations.length > 0
|
|
1742
|
+
);
|
|
1743
|
+
return createSuccessResponse("Content previews retrieved successfully", {
|
|
1744
|
+
contentPreviews: summarized,
|
|
1745
|
+
total: previews.total
|
|
1746
|
+
});
|
|
1747
|
+
}
|
|
1748
|
+
return withErrorHandling(tool2, "Error listing content previews");
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
// src/tools/content-previews/getEntryPreviewUrl.ts
|
|
1752
|
+
import { z as z24 } from "zod";
|
|
1753
|
+
|
|
1754
|
+
// src/tools/content-previews/previewUrl.ts
|
|
1755
|
+
import { cloneDeep, get } from "lodash-es";
|
|
1756
|
+
var LOCALE_TOKEN = /{\s*locale\s*}/g;
|
|
1757
|
+
var TOKEN = /{(\s*([\S]+?)\s*)}/g;
|
|
1758
|
+
var PLACEHOLDER = /\{.*?\}/g;
|
|
1759
|
+
var LINKED_BY = /linkedBy/g;
|
|
1760
|
+
var NESTED_REFERENCE = /^entry\.fields\.\w+\.[a-zA-Z-]+\.(fields|sys)/;
|
|
1761
|
+
var NESTED_REFERENCE_PREFIX = /^entry\.fields\.\w+\.[a-zA-Z-]+\./;
|
|
1762
|
+
var SECOND_REFERENCE_HOP = /fields\.[a-zA-Z]+\.fields/;
|
|
1763
|
+
function addLocale(path, locale) {
|
|
1764
|
+
const fieldsIndex = path.indexOf("fields");
|
|
1765
|
+
if (fieldsIndex === -1) {
|
|
1766
|
+
return path;
|
|
1767
|
+
}
|
|
1768
|
+
const separatorIndex = path.indexOf(".", fieldsIndex + "fields".length + 1);
|
|
1769
|
+
if (separatorIndex === -1) {
|
|
1770
|
+
return path;
|
|
1771
|
+
}
|
|
1772
|
+
return `${path.slice(0, separatorIndex + 1)}${locale}.${path.slice(separatorIndex + 1)}`;
|
|
1773
|
+
}
|
|
1774
|
+
function countIncomingLinkHops(template) {
|
|
1775
|
+
const placeholders = template.match(PLACEHOLDER) ?? [];
|
|
1776
|
+
if (placeholders.length === 0) {
|
|
1777
|
+
return 0;
|
|
1778
|
+
}
|
|
1779
|
+
return Math.max(
|
|
1780
|
+
...placeholders.map(
|
|
1781
|
+
(placeholder) => (placeholder.match(LINKED_BY) ?? []).length
|
|
1782
|
+
)
|
|
1783
|
+
);
|
|
1784
|
+
}
|
|
1785
|
+
function isEntryLink(value) {
|
|
1786
|
+
const sys = value?.sys;
|
|
1787
|
+
return sys?.type === "Link" && sys?.linkType === "Entry";
|
|
1788
|
+
}
|
|
1789
|
+
function asTokenValue(value) {
|
|
1790
|
+
if (typeof value === "string") {
|
|
1791
|
+
return value;
|
|
1792
|
+
}
|
|
1793
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
1794
|
+
return String(value);
|
|
1795
|
+
}
|
|
1796
|
+
return void 0;
|
|
1797
|
+
}
|
|
1798
|
+
function unwrapValue(value, defaultLocaleCode) {
|
|
1799
|
+
if (value !== null && typeof value === "object") {
|
|
1800
|
+
return asTokenValue(value[defaultLocaleCode]);
|
|
1801
|
+
}
|
|
1802
|
+
return asTokenValue(value);
|
|
1803
|
+
}
|
|
1804
|
+
async function readContextPath(path, context, getEntry) {
|
|
1805
|
+
if (getEntry && NESTED_REFERENCE.test(path)) {
|
|
1806
|
+
const prefix = NESTED_REFERENCE_PREFIX.exec(path)?.[0];
|
|
1807
|
+
const referencePath = prefix?.slice(0, -1);
|
|
1808
|
+
if (referencePath) {
|
|
1809
|
+
const nestedPath = path.slice(referencePath.length + 1);
|
|
1810
|
+
if (SECOND_REFERENCE_HOP.test(nestedPath)) {
|
|
1811
|
+
return void 0;
|
|
1812
|
+
}
|
|
1813
|
+
const link = get(context, referencePath);
|
|
1814
|
+
if (isEntryLink(link)) {
|
|
1815
|
+
const nestedEntry = await getEntry(link.sys.id);
|
|
1816
|
+
return nestedEntry ? get(nestedEntry, nestedPath) : void 0;
|
|
1817
|
+
}
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
return get(context, path);
|
|
1821
|
+
}
|
|
1822
|
+
async function attachIncomingLinks(entry, template, getIncomingLink) {
|
|
1823
|
+
const hops = countIncomingLinkHops(template);
|
|
1824
|
+
if (hops === 0 || !getIncomingLink) {
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
const seen = /* @__PURE__ */ new Map();
|
|
1828
|
+
let current = entry;
|
|
1829
|
+
for (let hop = 0; hop < hops; hop += 1) {
|
|
1830
|
+
const entryId = current.sys.id;
|
|
1831
|
+
if (!seen.has(entryId)) {
|
|
1832
|
+
seen.set(entryId, await getIncomingLink(entryId));
|
|
1833
|
+
}
|
|
1834
|
+
const linkedBy = seen.get(entryId);
|
|
1835
|
+
if (!linkedBy) {
|
|
1836
|
+
return;
|
|
1837
|
+
}
|
|
1838
|
+
current.linkedBy = cloneDeep(linkedBy);
|
|
1839
|
+
current = current.linkedBy;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
async function resolvePreviewUrl(options) {
|
|
1843
|
+
const {
|
|
1844
|
+
template,
|
|
1845
|
+
environmentId,
|
|
1846
|
+
defaultLocaleCode,
|
|
1847
|
+
currentLocaleCode,
|
|
1848
|
+
getEntry,
|
|
1849
|
+
getIncomingLink
|
|
1850
|
+
} = options;
|
|
1851
|
+
const entry = cloneDeep(options.entry);
|
|
1852
|
+
await attachIncomingLinks(entry, template, getIncomingLink);
|
|
1853
|
+
const context = {
|
|
1854
|
+
entry,
|
|
1855
|
+
env_id: environmentId,
|
|
1856
|
+
entry_id: entry.sys.id,
|
|
1857
|
+
entry_field: entry.fields
|
|
1858
|
+
};
|
|
1859
|
+
let url = template.replace(
|
|
1860
|
+
LOCALE_TOKEN,
|
|
1861
|
+
currentLocaleCode ?? defaultLocaleCode
|
|
1862
|
+
);
|
|
1863
|
+
const unresolvedTokens = [];
|
|
1864
|
+
for (const [token, rawPath] of [...url.matchAll(TOKEN)]) {
|
|
1865
|
+
const path = rawPath?.trim() || token;
|
|
1866
|
+
const raw = await readContextPath(
|
|
1867
|
+
addLocale(path, defaultLocaleCode),
|
|
1868
|
+
context,
|
|
1869
|
+
getEntry
|
|
1870
|
+
);
|
|
1871
|
+
const value = unwrapValue(raw, defaultLocaleCode);
|
|
1872
|
+
if (value === void 0) {
|
|
1873
|
+
if (!unresolvedTokens.includes(path)) {
|
|
1874
|
+
unresolvedTokens.push(path);
|
|
1875
|
+
}
|
|
1876
|
+
continue;
|
|
1877
|
+
}
|
|
1878
|
+
url = url.replace(token, () => value);
|
|
1879
|
+
}
|
|
1880
|
+
return { url, unresolvedTokens };
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
// src/tools/content-previews/getEntryPreviewUrl.ts
|
|
1884
|
+
var GetEntryPreviewUrlToolParams = BaseToolSchema.extend({
|
|
1885
|
+
entryId: z24.string().describe("The ID of the entry to build a preview URL for"),
|
|
1886
|
+
previewId: z24.string().optional().describe(
|
|
1887
|
+
"ID of the content preview to use. Defaults to the first preview with an enabled configuration for the entry content type. Use list_content_previews to see the options."
|
|
1888
|
+
),
|
|
1889
|
+
locale: z24.string().optional().describe(
|
|
1890
|
+
"Locale code substituted into the {locale} token. Defaults to the space default locale."
|
|
1891
|
+
)
|
|
1892
|
+
});
|
|
1893
|
+
function toEntryContext(entry) {
|
|
1894
|
+
return {
|
|
1895
|
+
sys: entry.sys,
|
|
1896
|
+
fields: entry.fields
|
|
1897
|
+
};
|
|
1898
|
+
}
|
|
1899
|
+
function getEntryPreviewUrlTool(config) {
|
|
1900
|
+
async function tool2(args) {
|
|
1901
|
+
const scope = {
|
|
1902
|
+
spaceId: args.spaceId,
|
|
1903
|
+
environmentId: args.environmentId
|
|
1904
|
+
};
|
|
1905
|
+
const contentfulClient = createToolClient(config, args);
|
|
1906
|
+
const entry = await contentfulClient.entry.get({
|
|
1907
|
+
...scope,
|
|
1908
|
+
entryId: args.entryId
|
|
1909
|
+
});
|
|
1910
|
+
const contentTypeId = entry.sys.contentType?.sys.id;
|
|
1911
|
+
if (!contentTypeId) {
|
|
1912
|
+
throw new Error(
|
|
1913
|
+
`Entry "${args.entryId}" has no content type, so no preview configuration can be matched.`
|
|
1914
|
+
);
|
|
1915
|
+
}
|
|
1916
|
+
const previews = await contentfulClient.raw.get(previewEnvironmentsPath(args.spaceId), { params: { limit: 100 } });
|
|
1917
|
+
const candidates = previews.items.flatMap((preview2) => {
|
|
1918
|
+
const configuration2 = findEnabledConfiguration(preview2, contentTypeId);
|
|
1919
|
+
return configuration2 ? [{ preview: preview2, configuration: configuration2 }] : [];
|
|
1920
|
+
});
|
|
1921
|
+
if (candidates.length === 0) {
|
|
1922
|
+
throw new Error(
|
|
1923
|
+
`No content preview with an enabled configuration for content type "${contentTypeId}" exists in space "${args.spaceId}". Add one under Settings \u2192 Content Preview, or call list_content_previews to see what is configured.`
|
|
1924
|
+
);
|
|
1925
|
+
}
|
|
1926
|
+
const selected = args.previewId ? candidates.find(
|
|
1927
|
+
(candidate) => candidate.preview.sys.id === args.previewId
|
|
1928
|
+
) : candidates[0];
|
|
1929
|
+
if (!selected) {
|
|
1930
|
+
throw new Error(
|
|
1931
|
+
`Content preview "${args.previewId}" has no enabled configuration for content type "${contentTypeId}". Available previews for this content type: ${candidates.map(({ preview: preview2 }) => `${preview2.name} (${preview2.sys.id})`).join(", ")}.`
|
|
1932
|
+
);
|
|
1933
|
+
}
|
|
1934
|
+
const { preview, configuration } = selected;
|
|
1935
|
+
const locales = await contentfulClient.locale.getMany({
|
|
1936
|
+
...scope,
|
|
1937
|
+
query: { limit: 100 }
|
|
1938
|
+
});
|
|
1939
|
+
const defaultLocaleCode = locales.items.find((locale) => locale.default)?.code ?? locales.items[0]?.code;
|
|
1940
|
+
if (!defaultLocaleCode) {
|
|
1941
|
+
throw new Error(
|
|
1942
|
+
`No locales found for ${args.spaceId}/${args.environmentId}, so localized preview tokens cannot be resolved.`
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
const { url, unresolvedTokens } = await resolvePreviewUrl({
|
|
1946
|
+
template: configuration.url,
|
|
1947
|
+
entry: toEntryContext(entry),
|
|
1948
|
+
environmentId: args.environmentId,
|
|
1949
|
+
defaultLocaleCode,
|
|
1950
|
+
currentLocaleCode: args.locale,
|
|
1951
|
+
getEntry: async (entryId) => {
|
|
1952
|
+
try {
|
|
1953
|
+
return toEntryContext(
|
|
1954
|
+
await contentfulClient.entry.get({ ...scope, entryId })
|
|
1955
|
+
);
|
|
1956
|
+
} catch {
|
|
1957
|
+
return void 0;
|
|
1958
|
+
}
|
|
1959
|
+
},
|
|
1960
|
+
getIncomingLink: async (entryId) => {
|
|
1961
|
+
try {
|
|
1962
|
+
const linking = await contentfulClient.entry.getMany({
|
|
1963
|
+
...scope,
|
|
1964
|
+
query: { links_to_entry: entryId, limit: 1 }
|
|
1965
|
+
});
|
|
1966
|
+
const first = linking.items[0];
|
|
1967
|
+
return first ? toEntryContext(first) : void 0;
|
|
1968
|
+
} catch {
|
|
1969
|
+
return void 0;
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
});
|
|
1973
|
+
return createSuccessResponse("Entry preview URL resolved successfully", {
|
|
1974
|
+
previewUrl: url,
|
|
1975
|
+
previewId: preview.sys.id,
|
|
1976
|
+
previewName: preview.name,
|
|
1977
|
+
contentTypeId,
|
|
1978
|
+
urlTemplate: configuration.url,
|
|
1979
|
+
locale: args.locale ?? defaultLocaleCode,
|
|
1980
|
+
...unresolvedTokens.length > 0 ? {
|
|
1981
|
+
unresolvedTokens,
|
|
1982
|
+
warning: "The URL still contains the tokens listed above because no value could be resolved for them. Verify the link before sharing it."
|
|
1983
|
+
} : {}
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
return withErrorHandling(tool2, "Error resolving entry preview URL");
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
// src/tools/content-previews/register.ts
|
|
1990
|
+
function createContentPreviewTools(config) {
|
|
1991
|
+
const listContentPreviews = listContentPreviewsTool(config);
|
|
1992
|
+
const getEntryPreviewUrl = getEntryPreviewUrlTool(config);
|
|
1993
|
+
return {
|
|
1994
|
+
listContentPreviews: {
|
|
1995
|
+
title: "list_content_previews",
|
|
1996
|
+
description: "List the content previews (Settings \u2192 Content Preview) configured for a space, including the URL template for each content type. URL templates can contain secret tokens, so treat the output as sensitive.",
|
|
1997
|
+
inputParams: ListContentPreviewsToolParams.shape,
|
|
1998
|
+
annotations: {
|
|
1999
|
+
readOnlyHint: true,
|
|
2000
|
+
destructiveHint: false,
|
|
2001
|
+
openWorldHint: false
|
|
2002
|
+
},
|
|
2003
|
+
tool: listContentPreviews
|
|
2004
|
+
},
|
|
2005
|
+
getEntryPreviewUrl: {
|
|
2006
|
+
title: "get_entry_preview_url",
|
|
2007
|
+
description: "Resolve the draft-preview URL for an entry by substituting the entry's data into the content preview URL template configured for its content type. Returns the same link an editor would get from the Content Preview dropdown in the entry editor, plus any tokens that could not be resolved.",
|
|
2008
|
+
inputParams: GetEntryPreviewUrlToolParams.shape,
|
|
2009
|
+
annotations: {
|
|
2010
|
+
readOnlyHint: true,
|
|
2011
|
+
destructiveHint: false,
|
|
2012
|
+
openWorldHint: false
|
|
2013
|
+
},
|
|
2014
|
+
tool: getEntryPreviewUrl
|
|
2015
|
+
}
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
|
|
2019
|
+
// src/tools/content-types/getContentType.ts
|
|
2020
|
+
import { z as z25 } from "zod";
|
|
1650
2021
|
var GetContentTypeToolParams = BaseToolSchema.extend({
|
|
1651
|
-
contentTypeId:
|
|
2022
|
+
contentTypeId: z25.string().describe("The ID of the content type to retrieve details for")
|
|
1652
2023
|
});
|
|
1653
2024
|
function getContentTypeTool(config) {
|
|
1654
2025
|
async function tool2(args) {
|
|
@@ -1669,13 +2040,13 @@ function getContentTypeTool(config) {
|
|
|
1669
2040
|
}
|
|
1670
2041
|
|
|
1671
2042
|
// src/tools/content-types/listContentTypes.ts
|
|
1672
|
-
import { z as
|
|
2043
|
+
import { z as z26 } from "zod";
|
|
1673
2044
|
var ListContentTypesToolParams = BaseToolSchema.extend({
|
|
1674
|
-
limit:
|
|
1675
|
-
skip:
|
|
1676
|
-
select:
|
|
1677
|
-
include:
|
|
1678
|
-
order:
|
|
2045
|
+
limit: z26.number().optional().describe("Maximum number of content types to return (max 10)"),
|
|
2046
|
+
skip: z26.number().optional().describe("Skip this many content types for pagination"),
|
|
2047
|
+
select: z26.string().optional().describe("Comma-separated list of fields to return"),
|
|
2048
|
+
include: z26.number().optional().describe("Include this many levels of linked entries"),
|
|
2049
|
+
order: z26.string().optional().describe("Order content types by this field")
|
|
1679
2050
|
});
|
|
1680
2051
|
function listContentTypesTool(config) {
|
|
1681
2052
|
async function tool2(args) {
|
|
@@ -1720,74 +2091,74 @@ function listContentTypesTool(config) {
|
|
|
1720
2091
|
}
|
|
1721
2092
|
|
|
1722
2093
|
// src/tools/content-types/createContentType.ts
|
|
1723
|
-
import { z as
|
|
2094
|
+
import { z as z29 } from "zod";
|
|
1724
2095
|
|
|
1725
2096
|
// src/types/fieldSchema.ts
|
|
1726
|
-
import { z as
|
|
2097
|
+
import { z as z28 } from "zod";
|
|
1727
2098
|
|
|
1728
2099
|
// src/types/contentTypeFieldValidationSchema.ts
|
|
1729
|
-
import { z as
|
|
2100
|
+
import { z as z27 } from "zod";
|
|
1730
2101
|
import { INLINES, BLOCKS } from "@contentful/rich-text-types";
|
|
1731
|
-
var NumRange =
|
|
1732
|
-
min:
|
|
1733
|
-
max:
|
|
2102
|
+
var NumRange = z27.object({
|
|
2103
|
+
min: z27.number().optional(),
|
|
2104
|
+
max: z27.number().optional()
|
|
1734
2105
|
});
|
|
1735
|
-
var DateRange =
|
|
1736
|
-
min:
|
|
1737
|
-
max:
|
|
2106
|
+
var DateRange = z27.object({
|
|
2107
|
+
min: z27.string().optional(),
|
|
2108
|
+
max: z27.string().optional()
|
|
1738
2109
|
});
|
|
1739
|
-
var RegExpSchema =
|
|
1740
|
-
pattern:
|
|
1741
|
-
flags:
|
|
2110
|
+
var RegExpSchema = z27.object({
|
|
2111
|
+
pattern: z27.string(),
|
|
2112
|
+
flags: z27.string()
|
|
1742
2113
|
});
|
|
1743
|
-
var AssetImageDimensions =
|
|
2114
|
+
var AssetImageDimensions = z27.object({
|
|
1744
2115
|
width: NumRange.optional(),
|
|
1745
2116
|
height: NumRange.optional()
|
|
1746
2117
|
});
|
|
1747
|
-
var ExternalResource =
|
|
1748
|
-
type:
|
|
2118
|
+
var ExternalResource = z27.object({
|
|
2119
|
+
type: z27.string()
|
|
1749
2120
|
});
|
|
1750
|
-
var ContentfulEntryResource =
|
|
1751
|
-
type:
|
|
1752
|
-
source:
|
|
1753
|
-
contentTypes:
|
|
2121
|
+
var ContentfulEntryResource = z27.object({
|
|
2122
|
+
type: z27.literal("Contentful:Entry"),
|
|
2123
|
+
source: z27.string(),
|
|
2124
|
+
contentTypes: z27.array(z27.string())
|
|
1754
2125
|
});
|
|
1755
|
-
var ContentTypeAllowedResources =
|
|
2126
|
+
var ContentTypeAllowedResources = z27.union([
|
|
1756
2127
|
ContentfulEntryResource,
|
|
1757
2128
|
ExternalResource
|
|
1758
2129
|
]);
|
|
1759
|
-
var NodesValidation =
|
|
1760
|
-
|
|
1761
|
-
|
|
2130
|
+
var NodesValidation = z27.record(
|
|
2131
|
+
z27.array(
|
|
2132
|
+
z27.object({
|
|
1762
2133
|
// subset of ContentTypeFieldValidation used for node validations
|
|
1763
2134
|
size: NumRange.optional(),
|
|
1764
|
-
linkContentType:
|
|
1765
|
-
message:
|
|
2135
|
+
linkContentType: z27.array(z27.string()).optional(),
|
|
2136
|
+
message: z27.string().nullable().optional()
|
|
1766
2137
|
})
|
|
1767
2138
|
).or(
|
|
1768
|
-
|
|
1769
|
-
validations:
|
|
1770
|
-
|
|
2139
|
+
z27.object({
|
|
2140
|
+
validations: z27.array(
|
|
2141
|
+
z27.object({
|
|
1771
2142
|
size: NumRange.optional(),
|
|
1772
|
-
message:
|
|
2143
|
+
message: z27.string().nullable().optional()
|
|
1773
2144
|
})
|
|
1774
2145
|
),
|
|
1775
|
-
allowedResources:
|
|
2146
|
+
allowedResources: z27.array(ContentTypeAllowedResources)
|
|
1776
2147
|
})
|
|
1777
2148
|
)
|
|
1778
2149
|
);
|
|
1779
|
-
var ContentTypeFieldValidationSchema =
|
|
1780
|
-
linkContentType:
|
|
1781
|
-
in:
|
|
1782
|
-
linkMimetypeGroup:
|
|
1783
|
-
enabledNodeTypes:
|
|
1784
|
-
enabledMarks:
|
|
1785
|
-
unique:
|
|
2150
|
+
var ContentTypeFieldValidationSchema = z27.object({
|
|
2151
|
+
linkContentType: z27.array(z27.string()).optional(),
|
|
2152
|
+
in: z27.array(z27.union([z27.string(), z27.number()])).optional(),
|
|
2153
|
+
linkMimetypeGroup: z27.array(z27.string()).optional(),
|
|
2154
|
+
enabledNodeTypes: z27.array(z27.union([z27.nativeEnum(BLOCKS), z27.nativeEnum(INLINES)])).optional(),
|
|
2155
|
+
enabledMarks: z27.array(z27.string()).optional(),
|
|
2156
|
+
unique: z27.boolean().optional(),
|
|
1786
2157
|
size: NumRange.optional(),
|
|
1787
2158
|
range: NumRange.optional(),
|
|
1788
2159
|
dateRange: DateRange.optional(),
|
|
1789
2160
|
regexp: RegExpSchema.optional(),
|
|
1790
|
-
message:
|
|
2161
|
+
message: z27.string().nullable().optional(),
|
|
1791
2162
|
prohibitRegexp: RegExpSchema.optional(),
|
|
1792
2163
|
assetImageDimensions: AssetImageDimensions.optional(),
|
|
1793
2164
|
assetFileSize: NumRange.optional(),
|
|
@@ -1795,36 +2166,36 @@ var ContentTypeFieldValidationSchema = z25.object({
|
|
|
1795
2166
|
});
|
|
1796
2167
|
|
|
1797
2168
|
// src/types/fieldSchema.ts
|
|
1798
|
-
var FieldSchema =
|
|
1799
|
-
id:
|
|
1800
|
-
name:
|
|
1801
|
-
type:
|
|
2169
|
+
var FieldSchema = z28.object({
|
|
2170
|
+
id: z28.string().describe("The field ID"),
|
|
2171
|
+
name: z28.string().describe("The field name"),
|
|
2172
|
+
type: z28.string().describe(
|
|
1802
2173
|
'The field type (e.g., "Symbol", "Text", "Integer", "Boolean", "Date", "Location", "Link", "Array", "Object")'
|
|
1803
2174
|
),
|
|
1804
|
-
required:
|
|
1805
|
-
localized:
|
|
1806
|
-
disabled:
|
|
1807
|
-
omitted:
|
|
1808
|
-
validations:
|
|
1809
|
-
settings:
|
|
1810
|
-
defaultValue:
|
|
1811
|
-
linkType:
|
|
1812
|
-
items:
|
|
1813
|
-
type:
|
|
1814
|
-
linkType:
|
|
1815
|
-
validations:
|
|
2175
|
+
required: z28.boolean().describe("Whether the field is required"),
|
|
2176
|
+
localized: z28.boolean().describe("Whether the field is localized"),
|
|
2177
|
+
disabled: z28.boolean().optional().describe("Whether the field is disabled"),
|
|
2178
|
+
omitted: z28.boolean().optional().describe("Whether the field is omitted from the API response"),
|
|
2179
|
+
validations: z28.array(ContentTypeFieldValidationSchema).optional().describe("Field validations"),
|
|
2180
|
+
settings: z28.record(z28.any()).optional().describe("Field-specific settings"),
|
|
2181
|
+
defaultValue: z28.any().optional().describe("Default value for the field"),
|
|
2182
|
+
linkType: z28.string().optional().describe('Link type for Link fields (e.g., "Entry", "Asset")'),
|
|
2183
|
+
items: z28.object({
|
|
2184
|
+
type: z28.string(),
|
|
2185
|
+
linkType: z28.string().optional(),
|
|
2186
|
+
validations: z28.array(ContentTypeFieldValidationSchema).optional()
|
|
1816
2187
|
}).optional().describe("Items configuration for Array fields")
|
|
1817
2188
|
});
|
|
1818
2189
|
|
|
1819
2190
|
// src/tools/content-types/createContentType.ts
|
|
1820
2191
|
var CreateContentTypeToolParams = BaseToolSchema.extend({
|
|
1821
|
-
name:
|
|
1822
|
-
displayField:
|
|
1823
|
-
description:
|
|
1824
|
-
contentTypeId:
|
|
2192
|
+
name: z29.string().describe("The name of the content type"),
|
|
2193
|
+
displayField: z29.string().describe("The field ID to use as the display field"),
|
|
2194
|
+
description: z29.string().optional().describe("Description of the content type"),
|
|
2195
|
+
contentTypeId: z29.string().optional().describe(
|
|
1825
2196
|
"Optional ID for the content type. If provided, will use createWithId method"
|
|
1826
2197
|
),
|
|
1827
|
-
fields:
|
|
2198
|
+
fields: z29.array(FieldSchema).describe("Array of field definitions for the content type"),
|
|
1828
2199
|
metadata: ContentTypeMetadataSchema
|
|
1829
2200
|
});
|
|
1830
2201
|
function createContentTypeTool(config) {
|
|
@@ -1857,13 +2228,13 @@ function createContentTypeTool(config) {
|
|
|
1857
2228
|
}
|
|
1858
2229
|
|
|
1859
2230
|
// src/tools/content-types/updateContentType.ts
|
|
1860
|
-
import { z as
|
|
2231
|
+
import { z as z30 } from "zod";
|
|
1861
2232
|
var UpdateContentTypeToolParams = BaseToolSchema.extend({
|
|
1862
|
-
contentTypeId:
|
|
1863
|
-
name:
|
|
1864
|
-
displayField:
|
|
1865
|
-
description:
|
|
1866
|
-
fields:
|
|
2233
|
+
contentTypeId: z30.string().describe("The ID of the content type to update"),
|
|
2234
|
+
name: z30.string().optional().describe("The name of the content type"),
|
|
2235
|
+
displayField: z30.string().optional().describe("The field ID to use as the display field"),
|
|
2236
|
+
description: z30.string().optional().describe("Description of the content type"),
|
|
2237
|
+
fields: z30.array(FieldSchema).optional().describe(
|
|
1867
2238
|
"Array of field definitions for the content type. Will be merged with existing fields."
|
|
1868
2239
|
),
|
|
1869
2240
|
metadata: ContentTypeMetadataSchema
|
|
@@ -1922,13 +2293,13 @@ function updateContentTypeTool(config) {
|
|
|
1922
2293
|
}
|
|
1923
2294
|
|
|
1924
2295
|
// src/tools/content-types/deleteContentType.ts
|
|
1925
|
-
import { z as
|
|
2296
|
+
import { z as z31 } from "zod";
|
|
1926
2297
|
var DeleteContentTypeToolParams = BaseToolSchema.extend({
|
|
1927
|
-
contentTypeId:
|
|
1928
|
-
confirm:
|
|
2298
|
+
contentTypeId: z31.string().describe("The ID of the content type to delete"),
|
|
2299
|
+
confirm: z31.boolean().optional().describe(
|
|
1929
2300
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
1930
2301
|
),
|
|
1931
|
-
confirmToken:
|
|
2302
|
+
confirmToken: z31.string().optional().describe(
|
|
1932
2303
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
1933
2304
|
)
|
|
1934
2305
|
});
|
|
@@ -1970,9 +2341,9 @@ function deleteContentTypeTool(config) {
|
|
|
1970
2341
|
}
|
|
1971
2342
|
|
|
1972
2343
|
// src/tools/content-types/publishContentType.ts
|
|
1973
|
-
import { z as
|
|
2344
|
+
import { z as z32 } from "zod";
|
|
1974
2345
|
var PublishContentTypeToolParams = BaseToolSchema.extend({
|
|
1975
|
-
contentTypeId:
|
|
2346
|
+
contentTypeId: z32.string().describe("The ID of the content type to publish")
|
|
1976
2347
|
});
|
|
1977
2348
|
function publishContentTypeTool(config) {
|
|
1978
2349
|
async function tool2(args) {
|
|
@@ -1999,9 +2370,9 @@ function publishContentTypeTool(config) {
|
|
|
1999
2370
|
}
|
|
2000
2371
|
|
|
2001
2372
|
// src/tools/content-types/unpublishContentType.ts
|
|
2002
|
-
import { z as
|
|
2373
|
+
import { z as z33 } from "zod";
|
|
2003
2374
|
var UnpublishContentTypeToolParams = BaseToolSchema.extend({
|
|
2004
|
-
contentTypeId:
|
|
2375
|
+
contentTypeId: z33.string().describe("The ID of the content type to unpublish")
|
|
2005
2376
|
});
|
|
2006
2377
|
function unpublishContentTypeTool(config) {
|
|
2007
2378
|
async function tool2(args) {
|
|
@@ -2024,11 +2395,11 @@ function unpublishContentTypeTool(config) {
|
|
|
2024
2395
|
}
|
|
2025
2396
|
|
|
2026
2397
|
// src/tools/content-types/omitContentTypeField.ts
|
|
2027
|
-
import { z as
|
|
2398
|
+
import { z as z34 } from "zod";
|
|
2028
2399
|
var OmitContentTypeFieldToolParams = BaseToolSchema.extend({
|
|
2029
|
-
contentTypeId:
|
|
2030
|
-
fieldId:
|
|
2031
|
-
omitted:
|
|
2400
|
+
contentTypeId: z34.string().describe("The ID of the content type containing the field"),
|
|
2401
|
+
fieldId: z34.string().describe("The ID of the field to omit"),
|
|
2402
|
+
omitted: z34.boolean().default(true).describe(
|
|
2032
2403
|
"Whether the field should be omitted. Defaults to true. Set to false to un-omit a field."
|
|
2033
2404
|
)
|
|
2034
2405
|
});
|
|
@@ -2063,10 +2434,10 @@ function omitContentTypeFieldTool(config) {
|
|
|
2063
2434
|
}
|
|
2064
2435
|
|
|
2065
2436
|
// src/tools/content-types/deleteContentTypeField.ts
|
|
2066
|
-
import { z as
|
|
2437
|
+
import { z as z35 } from "zod";
|
|
2067
2438
|
var DeleteContentTypeFieldToolParams = BaseToolSchema.extend({
|
|
2068
|
-
contentTypeId:
|
|
2069
|
-
fieldId:
|
|
2439
|
+
contentTypeId: z35.string().describe("The ID of the content type containing the field"),
|
|
2440
|
+
fieldId: z35.string().describe("The ID of the field to delete")
|
|
2070
2441
|
});
|
|
2071
2442
|
function deleteContentTypeFieldTool(config) {
|
|
2072
2443
|
async function tool2(args) {
|
|
@@ -2109,14 +2480,14 @@ function deleteContentTypeFieldTool(config) {
|
|
|
2109
2480
|
}
|
|
2110
2481
|
|
|
2111
2482
|
// src/tools/content-types/disableContentTypeField.ts
|
|
2112
|
-
import { z as
|
|
2483
|
+
import { z as z36 } from "zod";
|
|
2113
2484
|
var DisableContentTypeFieldToolParams = BaseToolSchema.extend({
|
|
2114
|
-
contentTypeId:
|
|
2115
|
-
fieldId:
|
|
2116
|
-
disabled:
|
|
2485
|
+
contentTypeId: z36.string().describe("The ID of the content type containing the field"),
|
|
2486
|
+
fieldId: z36.string().describe("The ID of the field to update"),
|
|
2487
|
+
disabled: z36.boolean().optional().describe(
|
|
2117
2488
|
"Set to true to disable the field in the editor UI (editors cannot edit it), false to re-enable. Takes effect once the content type is published."
|
|
2118
2489
|
),
|
|
2119
|
-
omitted:
|
|
2490
|
+
omitted: z36.boolean().optional().describe(
|
|
2120
2491
|
"Set to true to omit the field from API responses, false to include it again. Takes effect once the content type is published. Prefer omit_content_type_field when only changing the omitted flag."
|
|
2121
2492
|
)
|
|
2122
2493
|
});
|
|
@@ -2298,7 +2669,7 @@ function createContentTypeTools(config) {
|
|
|
2298
2669
|
}
|
|
2299
2670
|
|
|
2300
2671
|
// src/tools/context/getInitialContextTool.ts
|
|
2301
|
-
import { z as
|
|
2672
|
+
import { z as z37 } from "zod";
|
|
2302
2673
|
import { outdent } from "outdent";
|
|
2303
2674
|
|
|
2304
2675
|
// src/tools/context/store.ts
|
|
@@ -2343,7 +2714,7 @@ var EXO_DISPOSITION = `# Tool disposition: Experience Orchestration by default
|
|
|
2343
2714
|
Experience Orchestration (ExO) tools are enabled. Use ExO primitives \u2014 Components, Experiences, Experience Templates, Experience Fragments, and Data Assemblies \u2014 for all content modeling and authoring. Do not create classic content types or entries unless the user explicitly instructs you to. If you are unsure how to model something with ExO, inspect the tool schemas and proceed with ExO.`;
|
|
2344
2715
|
|
|
2345
2716
|
// src/tools/context/getInitialContextTool.ts
|
|
2346
|
-
var GetInitialContextToolParams =
|
|
2717
|
+
var GetInitialContextToolParams = z37.object({});
|
|
2347
2718
|
function getInitialContextTool(config) {
|
|
2348
2719
|
async function tool2(_params) {
|
|
2349
2720
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("en-US", {
|
|
@@ -2443,9 +2814,9 @@ function listEditorInterfacesTool(config) {
|
|
|
2443
2814
|
}
|
|
2444
2815
|
|
|
2445
2816
|
// src/tools/editor-interfaces/getEditorInterface.ts
|
|
2446
|
-
import { z as
|
|
2817
|
+
import { z as z38 } from "zod";
|
|
2447
2818
|
var GetEditorInterfaceToolParams = BaseToolSchema.extend({
|
|
2448
|
-
contentTypeId:
|
|
2819
|
+
contentTypeId: z38.string().describe(
|
|
2449
2820
|
"The ID of the content type to retrieve the editor interface for"
|
|
2450
2821
|
)
|
|
2451
2822
|
});
|
|
@@ -2466,42 +2837,42 @@ function getEditorInterfaceTool(config) {
|
|
|
2466
2837
|
}
|
|
2467
2838
|
|
|
2468
2839
|
// src/tools/editor-interfaces/updateEditorInterface.ts
|
|
2469
|
-
import { z as
|
|
2470
|
-
var ControlSchema =
|
|
2471
|
-
fieldId:
|
|
2472
|
-
widgetId:
|
|
2473
|
-
widgetNamespace:
|
|
2840
|
+
import { z as z39 } from "zod";
|
|
2841
|
+
var ControlSchema = z39.object({
|
|
2842
|
+
fieldId: z39.string().describe("The field ID this control applies to"),
|
|
2843
|
+
widgetId: z39.string().describe("The widget ID to use for this field"),
|
|
2844
|
+
widgetNamespace: z39.enum(["builtin", "extension", "app", "editor-builtin"]).optional().describe(
|
|
2474
2845
|
"The namespace of the widget (builtin, extension, app, or editor-builtin)"
|
|
2475
2846
|
),
|
|
2476
|
-
settings:
|
|
2847
|
+
settings: z39.record(z39.any()).optional().describe("Settings object for the widget")
|
|
2477
2848
|
});
|
|
2478
|
-
var SidebarItemSchema =
|
|
2479
|
-
widgetId:
|
|
2480
|
-
widgetNamespace:
|
|
2481
|
-
settings:
|
|
2482
|
-
disabled:
|
|
2849
|
+
var SidebarItemSchema = z39.object({
|
|
2850
|
+
widgetId: z39.string().describe("The widget ID for the sidebar item"),
|
|
2851
|
+
widgetNamespace: z39.enum(["sidebar-builtin", "extension", "app"]).describe("The namespace of the sidebar widget"),
|
|
2852
|
+
settings: z39.record(z39.any()).optional().describe("Settings object for the sidebar widget"),
|
|
2853
|
+
disabled: z39.boolean().optional().describe("Whether the sidebar item is disabled")
|
|
2483
2854
|
});
|
|
2484
|
-
var EditorLayoutItemSchema =
|
|
2485
|
-
fieldId:
|
|
2486
|
-
settings:
|
|
2855
|
+
var EditorLayoutItemSchema = z39.object({
|
|
2856
|
+
fieldId: z39.string().describe("The field ID"),
|
|
2857
|
+
settings: z39.record(z39.any()).optional().describe("Layout settings for the field")
|
|
2487
2858
|
});
|
|
2488
|
-
var EditorLayoutSchema =
|
|
2489
|
-
items:
|
|
2859
|
+
var EditorLayoutSchema = z39.object({
|
|
2860
|
+
items: z39.array(EditorLayoutItemSchema).optional().describe("Array of editor layout items")
|
|
2490
2861
|
});
|
|
2491
|
-
var GroupControlSchema =
|
|
2492
|
-
groupId:
|
|
2493
|
-
widgetId:
|
|
2494
|
-
widgetNamespace:
|
|
2495
|
-
settings:
|
|
2862
|
+
var GroupControlSchema = z39.object({
|
|
2863
|
+
groupId: z39.string().describe("The group ID"),
|
|
2864
|
+
widgetId: z39.string().describe("The widget ID for the group control"),
|
|
2865
|
+
widgetNamespace: z39.enum(["builtin", "extension", "app"]).optional().describe("The namespace of the group control widget"),
|
|
2866
|
+
settings: z39.record(z39.any()).optional().describe("Settings object for the group control")
|
|
2496
2867
|
});
|
|
2497
2868
|
var UpdateEditorInterfaceToolParams = BaseToolSchema.extend({
|
|
2498
|
-
contentTypeId:
|
|
2499
|
-
controls:
|
|
2869
|
+
contentTypeId: z39.string().describe("The ID of the content type to update the editor interface for"),
|
|
2870
|
+
controls: z39.array(ControlSchema).optional().describe(
|
|
2500
2871
|
"Array of control definitions for fields in the content type. Each control defines which widget to use for a field."
|
|
2501
2872
|
),
|
|
2502
|
-
sidebar:
|
|
2503
|
-
editorLayout:
|
|
2504
|
-
groupControls:
|
|
2873
|
+
sidebar: z39.array(SidebarItemSchema).optional().describe("Array of sidebar widget configurations"),
|
|
2874
|
+
editorLayout: z39.array(EditorLayoutSchema).optional().describe("Editor layout configuration for organizing fields"),
|
|
2875
|
+
groupControls: z39.array(GroupControlSchema).optional().describe("Array of group control definitions for field groups")
|
|
2505
2876
|
});
|
|
2506
2877
|
function updateEditorInterfaceTool(config) {
|
|
2507
2878
|
async function tool2(args) {
|
|
@@ -2586,7 +2957,7 @@ function createEditorInterfaceTools(config) {
|
|
|
2586
2957
|
}
|
|
2587
2958
|
|
|
2588
2959
|
// src/tools/entries/searchEntries.ts
|
|
2589
|
-
import { z as
|
|
2960
|
+
import { z as z40 } from "zod";
|
|
2590
2961
|
|
|
2591
2962
|
// src/utils/limits.ts
|
|
2592
2963
|
function searchLimit(userLimit) {
|
|
@@ -2609,38 +2980,38 @@ function normalizeArrayFilters(query) {
|
|
|
2609
2980
|
|
|
2610
2981
|
// src/tools/entries/searchEntries.ts
|
|
2611
2982
|
var SearchEntriesToolParams = BaseToolSchema.extend({
|
|
2612
|
-
query:
|
|
2983
|
+
query: z40.object({
|
|
2613
2984
|
// Core parameters (maintain backward compatibility)
|
|
2614
|
-
content_type:
|
|
2615
|
-
include:
|
|
2616
|
-
select:
|
|
2617
|
-
links_to_entry:
|
|
2618
|
-
limit:
|
|
2985
|
+
content_type: z40.string().optional().describe("Filter by content type"),
|
|
2986
|
+
include: z40.number().optional().describe("Include this many levels of linked entries"),
|
|
2987
|
+
select: z40.string().optional().describe("Comma-separated list of fields to return"),
|
|
2988
|
+
links_to_entry: z40.string().optional().describe("Find entries that link to the specified entry ID"),
|
|
2989
|
+
limit: z40.number().optional().describe(
|
|
2619
2990
|
"Maximum number of entries to return (default: 10, max: 100)"
|
|
2620
2991
|
),
|
|
2621
|
-
skip:
|
|
2622
|
-
order:
|
|
2992
|
+
skip: z40.number().optional().describe("Skip this many entries for pagination"),
|
|
2993
|
+
order: z40.string().optional().describe("Order entries by this field"),
|
|
2623
2994
|
// Full-text search
|
|
2624
|
-
query:
|
|
2995
|
+
query: z40.string().optional().describe("Full-text search across all fields"),
|
|
2625
2996
|
// Common field-based searches (examples - any field is supported via catchall)
|
|
2626
|
-
"fields.title":
|
|
2627
|
-
"fields.slug":
|
|
2628
|
-
"fields.internalName":
|
|
2629
|
-
"fields.text":
|
|
2630
|
-
"fields.title[match]":
|
|
2631
|
-
"fields.slug[match]":
|
|
2632
|
-
"fields.title[exists]":
|
|
2633
|
-
"fields.slug[exists]":
|
|
2997
|
+
"fields.title": z40.string().optional().describe("Search by title field"),
|
|
2998
|
+
"fields.slug": z40.string().optional().describe("Search by slug field"),
|
|
2999
|
+
"fields.internalName": z40.string().optional().describe("Search by internal name field"),
|
|
3000
|
+
"fields.text": z40.string().optional().describe("Search by text field (useful for testimonials)"),
|
|
3001
|
+
"fields.title[match]": z40.string().optional().describe("Pattern match on title field"),
|
|
3002
|
+
"fields.slug[match]": z40.string().optional().describe("Pattern match on slug field"),
|
|
3003
|
+
"fields.title[exists]": z40.boolean().optional().describe("Check if title field exists"),
|
|
3004
|
+
"fields.slug[exists]": z40.boolean().optional().describe("Check if slug field exists"),
|
|
2634
3005
|
// System field searches
|
|
2635
|
-
"sys.id[in]":
|
|
2636
|
-
"sys.contentType.sys.id":
|
|
2637
|
-
"sys.createdAt[gte]":
|
|
2638
|
-
"sys.createdAt[lte]":
|
|
2639
|
-
"sys.updatedAt[gte]":
|
|
2640
|
-
"sys.updatedAt[lte]":
|
|
3006
|
+
"sys.id[in]": z40.array(z40.string()).optional().describe("Search by multiple entry IDs"),
|
|
3007
|
+
"sys.contentType.sys.id": z40.string().optional().describe("Filter by content type ID"),
|
|
3008
|
+
"sys.createdAt[gte]": z40.string().optional().describe("Created after date (ISO format)"),
|
|
3009
|
+
"sys.createdAt[lte]": z40.string().optional().describe("Created before date (ISO format)"),
|
|
3010
|
+
"sys.updatedAt[gte]": z40.string().optional().describe("Updated after date (ISO format)"),
|
|
3011
|
+
"sys.updatedAt[lte]": z40.string().optional().describe("Updated before date (ISO format)"),
|
|
2641
3012
|
// Metadata searches
|
|
2642
|
-
"metadata.tags.sys.id[in]":
|
|
2643
|
-
}).catchall(
|
|
3013
|
+
"metadata.tags.sys.id[in]": z40.array(z40.string()).optional().describe("Filter by tag IDs")
|
|
3014
|
+
}).catchall(z40.any()).describe(
|
|
2644
3015
|
"Flexible search parameters supporting ANY Contentful API query parameter. Use fields.* for field searches, sys.* for system fields, and any other Contentful API parameter."
|
|
2645
3016
|
)
|
|
2646
3017
|
});
|
|
@@ -2671,12 +3042,12 @@ function searchEntriesTool(config) {
|
|
|
2671
3042
|
}
|
|
2672
3043
|
|
|
2673
3044
|
// src/tools/entries/semanticSearch.ts
|
|
2674
|
-
import { z as
|
|
3045
|
+
import { z as z41 } from "zod";
|
|
2675
3046
|
var SemanticSearchToolParams = BaseToolSchema.extend({
|
|
2676
|
-
query:
|
|
3047
|
+
query: z41.string().describe(
|
|
2677
3048
|
"Natural-language description of what you are looking for. Phrases that resemble the content of the entries you want match best \u2014 avoid questions or JSON."
|
|
2678
3049
|
),
|
|
2679
|
-
contentTypeIds:
|
|
3050
|
+
contentTypeIds: z41.array(z41.string()).min(1).optional().describe("Restrict the search to entries of these content type IDs")
|
|
2680
3051
|
});
|
|
2681
3052
|
function semanticSearchTool(config) {
|
|
2682
3053
|
async function tool2(args) {
|
|
@@ -2707,110 +3078,110 @@ function semanticSearchTool(config) {
|
|
|
2707
3078
|
}
|
|
2708
3079
|
|
|
2709
3080
|
// src/tools/entries/createEntry.ts
|
|
2710
|
-
import { z as
|
|
3081
|
+
import { z as z44 } from "zod";
|
|
2711
3082
|
|
|
2712
3083
|
// src/types/entryFieldSchema.ts
|
|
2713
|
-
import { z as
|
|
3084
|
+
import { z as z43 } from "zod";
|
|
2714
3085
|
|
|
2715
3086
|
// src/types/richTextSchema.ts
|
|
2716
3087
|
import { BLOCKS as BLOCKS2, INLINES as INLINES2, MARKS } from "@contentful/rich-text-types";
|
|
2717
|
-
import { z as
|
|
2718
|
-
var emptyNodeDataSchema =
|
|
2719
|
-
var entryLinkTargetSchema =
|
|
2720
|
-
sys:
|
|
2721
|
-
id:
|
|
2722
|
-
type:
|
|
2723
|
-
linkType:
|
|
3088
|
+
import { z as z42 } from "zod";
|
|
3089
|
+
var emptyNodeDataSchema = z42.object({});
|
|
3090
|
+
var entryLinkTargetSchema = z42.object({
|
|
3091
|
+
sys: z42.object({
|
|
3092
|
+
id: z42.string(),
|
|
3093
|
+
type: z42.literal("Link"),
|
|
3094
|
+
linkType: z42.literal("Entry")
|
|
2724
3095
|
})
|
|
2725
3096
|
});
|
|
2726
|
-
var assetLinkTargetSchema =
|
|
2727
|
-
sys:
|
|
2728
|
-
id:
|
|
2729
|
-
type:
|
|
2730
|
-
linkType:
|
|
3097
|
+
var assetLinkTargetSchema = z42.object({
|
|
3098
|
+
sys: z42.object({
|
|
3099
|
+
id: z42.string(),
|
|
3100
|
+
type: z42.literal("Link"),
|
|
3101
|
+
linkType: z42.literal("Asset")
|
|
2731
3102
|
})
|
|
2732
3103
|
});
|
|
2733
|
-
var resourceLinkTargetSchema =
|
|
2734
|
-
sys:
|
|
2735
|
-
type:
|
|
2736
|
-
linkType:
|
|
2737
|
-
urn:
|
|
3104
|
+
var resourceLinkTargetSchema = z42.object({
|
|
3105
|
+
sys: z42.object({
|
|
3106
|
+
type: z42.literal("ResourceLink"),
|
|
3107
|
+
linkType: z42.string(),
|
|
3108
|
+
urn: z42.string()
|
|
2738
3109
|
})
|
|
2739
3110
|
});
|
|
2740
|
-
var richTextMarkSchema =
|
|
2741
|
-
type:
|
|
3111
|
+
var richTextMarkSchema = z42.object({
|
|
3112
|
+
type: z42.nativeEnum(MARKS)
|
|
2742
3113
|
});
|
|
2743
|
-
var richTextTextNodeSchema =
|
|
2744
|
-
nodeType:
|
|
2745
|
-
value:
|
|
2746
|
-
marks:
|
|
3114
|
+
var richTextTextNodeSchema = z42.object({
|
|
3115
|
+
nodeType: z42.literal("text"),
|
|
3116
|
+
value: z42.string(),
|
|
3117
|
+
marks: z42.array(richTextMarkSchema),
|
|
2747
3118
|
data: emptyNodeDataSchema
|
|
2748
3119
|
});
|
|
2749
|
-
var embeddedEntryBlockNodeSchema =
|
|
2750
|
-
nodeType:
|
|
2751
|
-
data:
|
|
3120
|
+
var embeddedEntryBlockNodeSchema = z42.object({
|
|
3121
|
+
nodeType: z42.literal(BLOCKS2.EMBEDDED_ENTRY),
|
|
3122
|
+
data: z42.object({
|
|
2752
3123
|
target: entryLinkTargetSchema
|
|
2753
3124
|
}),
|
|
2754
|
-
content:
|
|
3125
|
+
content: z42.array(z42.never())
|
|
2755
3126
|
});
|
|
2756
|
-
var embeddedEntryInlineNodeSchema =
|
|
2757
|
-
nodeType:
|
|
2758
|
-
data:
|
|
3127
|
+
var embeddedEntryInlineNodeSchema = z42.object({
|
|
3128
|
+
nodeType: z42.literal(INLINES2.EMBEDDED_ENTRY),
|
|
3129
|
+
data: z42.object({
|
|
2759
3130
|
target: entryLinkTargetSchema
|
|
2760
3131
|
}),
|
|
2761
|
-
content:
|
|
3132
|
+
content: z42.array(z42.never())
|
|
2762
3133
|
});
|
|
2763
|
-
var embeddedAssetBlockNodeSchema =
|
|
2764
|
-
nodeType:
|
|
2765
|
-
data:
|
|
3134
|
+
var embeddedAssetBlockNodeSchema = z42.object({
|
|
3135
|
+
nodeType: z42.literal(BLOCKS2.EMBEDDED_ASSET),
|
|
3136
|
+
data: z42.object({
|
|
2766
3137
|
target: assetLinkTargetSchema
|
|
2767
3138
|
}),
|
|
2768
|
-
content:
|
|
3139
|
+
content: z42.array(z42.never())
|
|
2769
3140
|
});
|
|
2770
|
-
var hyperlinkInlineNodeSchema =
|
|
2771
|
-
nodeType:
|
|
2772
|
-
data:
|
|
2773
|
-
uri:
|
|
3141
|
+
var hyperlinkInlineNodeSchema = z42.object({
|
|
3142
|
+
nodeType: z42.literal(INLINES2.HYPERLINK),
|
|
3143
|
+
data: z42.object({
|
|
3144
|
+
uri: z42.string().url()
|
|
2774
3145
|
}),
|
|
2775
|
-
content:
|
|
3146
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2776
3147
|
});
|
|
2777
|
-
var entryHyperlinkInlineNodeSchema =
|
|
2778
|
-
nodeType:
|
|
2779
|
-
data:
|
|
3148
|
+
var entryHyperlinkInlineNodeSchema = z42.object({
|
|
3149
|
+
nodeType: z42.literal(INLINES2.ENTRY_HYPERLINK),
|
|
3150
|
+
data: z42.object({
|
|
2780
3151
|
target: entryLinkTargetSchema
|
|
2781
3152
|
}),
|
|
2782
|
-
content:
|
|
3153
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2783
3154
|
});
|
|
2784
|
-
var assetHyperlinkInlineNodeSchema =
|
|
2785
|
-
nodeType:
|
|
2786
|
-
data:
|
|
3155
|
+
var assetHyperlinkInlineNodeSchema = z42.object({
|
|
3156
|
+
nodeType: z42.literal(INLINES2.ASSET_HYPERLINK),
|
|
3157
|
+
data: z42.object({
|
|
2787
3158
|
target: assetLinkTargetSchema
|
|
2788
3159
|
}),
|
|
2789
|
-
content:
|
|
3160
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2790
3161
|
});
|
|
2791
|
-
var embeddedResourceBlockNodeSchema =
|
|
2792
|
-
nodeType:
|
|
2793
|
-
data:
|
|
3162
|
+
var embeddedResourceBlockNodeSchema = z42.object({
|
|
3163
|
+
nodeType: z42.literal(BLOCKS2.EMBEDDED_RESOURCE),
|
|
3164
|
+
data: z42.object({
|
|
2794
3165
|
target: resourceLinkTargetSchema
|
|
2795
3166
|
}),
|
|
2796
|
-
content:
|
|
3167
|
+
content: z42.array(z42.never())
|
|
2797
3168
|
});
|
|
2798
|
-
var embeddedResourceInlineNodeSchema =
|
|
2799
|
-
nodeType:
|
|
2800
|
-
data:
|
|
3169
|
+
var embeddedResourceInlineNodeSchema = z42.object({
|
|
3170
|
+
nodeType: z42.literal(INLINES2.EMBEDDED_RESOURCE),
|
|
3171
|
+
data: z42.object({
|
|
2801
3172
|
target: resourceLinkTargetSchema
|
|
2802
3173
|
}),
|
|
2803
|
-
content:
|
|
3174
|
+
content: z42.array(z42.never())
|
|
2804
3175
|
});
|
|
2805
|
-
var resourceHyperlinkInlineNodeSchema =
|
|
2806
|
-
nodeType:
|
|
2807
|
-
data:
|
|
3176
|
+
var resourceHyperlinkInlineNodeSchema = z42.object({
|
|
3177
|
+
nodeType: z42.literal(INLINES2.RESOURCE_HYPERLINK),
|
|
3178
|
+
data: z42.object({
|
|
2808
3179
|
target: resourceLinkTargetSchema
|
|
2809
3180
|
}),
|
|
2810
|
-
content:
|
|
3181
|
+
content: z42.array(richTextTextNodeSchema)
|
|
2811
3182
|
});
|
|
2812
|
-
var richTextInlineNodeSchema =
|
|
2813
|
-
() =>
|
|
3183
|
+
var richTextInlineNodeSchema = z42.lazy(
|
|
3184
|
+
() => z42.union([
|
|
2814
3185
|
richTextTextNodeSchema,
|
|
2815
3186
|
embeddedEntryInlineNodeSchema,
|
|
2816
3187
|
hyperlinkInlineNodeSchema,
|
|
@@ -2820,17 +3191,17 @@ var richTextInlineNodeSchema = z40.lazy(
|
|
|
2820
3191
|
resourceHyperlinkInlineNodeSchema
|
|
2821
3192
|
])
|
|
2822
3193
|
);
|
|
2823
|
-
var paragraphNodeSchema =
|
|
2824
|
-
() =>
|
|
2825
|
-
nodeType:
|
|
3194
|
+
var paragraphNodeSchema = z42.lazy(
|
|
3195
|
+
() => z42.object({
|
|
3196
|
+
nodeType: z42.literal(BLOCKS2.PARAGRAPH),
|
|
2826
3197
|
data: emptyNodeDataSchema,
|
|
2827
|
-
content:
|
|
3198
|
+
content: z42.array(richTextInlineNodeSchema)
|
|
2828
3199
|
})
|
|
2829
3200
|
);
|
|
2830
|
-
var headingNodeSchema = (headingNodeType) =>
|
|
2831
|
-
nodeType:
|
|
3201
|
+
var headingNodeSchema = (headingNodeType) => z42.object({
|
|
3202
|
+
nodeType: z42.literal(headingNodeType),
|
|
2832
3203
|
data: emptyNodeDataSchema,
|
|
2833
|
-
content:
|
|
3204
|
+
content: z42.array(richTextInlineNodeSchema)
|
|
2834
3205
|
});
|
|
2835
3206
|
var heading1NodeSchema = headingNodeSchema(BLOCKS2.HEADING_1);
|
|
2836
3207
|
var heading2NodeSchema = headingNodeSchema(BLOCKS2.HEADING_2);
|
|
@@ -2838,56 +3209,56 @@ var heading3NodeSchema = headingNodeSchema(BLOCKS2.HEADING_3);
|
|
|
2838
3209
|
var heading4NodeSchema = headingNodeSchema(BLOCKS2.HEADING_4);
|
|
2839
3210
|
var heading5NodeSchema = headingNodeSchema(BLOCKS2.HEADING_5);
|
|
2840
3211
|
var heading6NodeSchema = headingNodeSchema(BLOCKS2.HEADING_6);
|
|
2841
|
-
var hrNodeSchema =
|
|
2842
|
-
nodeType:
|
|
3212
|
+
var hrNodeSchema = z42.object({
|
|
3213
|
+
nodeType: z42.literal(BLOCKS2.HR),
|
|
2843
3214
|
data: emptyNodeDataSchema,
|
|
2844
|
-
content:
|
|
3215
|
+
content: z42.array(z42.never())
|
|
2845
3216
|
});
|
|
2846
|
-
var quoteNodeSchema =
|
|
2847
|
-
nodeType:
|
|
3217
|
+
var quoteNodeSchema = z42.object({
|
|
3218
|
+
nodeType: z42.literal(BLOCKS2.QUOTE),
|
|
2848
3219
|
data: emptyNodeDataSchema,
|
|
2849
|
-
content:
|
|
3220
|
+
content: z42.array(paragraphNodeSchema)
|
|
2850
3221
|
});
|
|
2851
|
-
var tableHeaderCellNodeSchema =
|
|
2852
|
-
nodeType:
|
|
3222
|
+
var tableHeaderCellNodeSchema = z42.object({
|
|
3223
|
+
nodeType: z42.literal(BLOCKS2.TABLE_HEADER_CELL),
|
|
2853
3224
|
data: emptyNodeDataSchema,
|
|
2854
|
-
content:
|
|
3225
|
+
content: z42.array(paragraphNodeSchema)
|
|
2855
3226
|
});
|
|
2856
|
-
var tableCellNodeSchema =
|
|
2857
|
-
nodeType:
|
|
3227
|
+
var tableCellNodeSchema = z42.object({
|
|
3228
|
+
nodeType: z42.literal(BLOCKS2.TABLE_CELL),
|
|
2858
3229
|
data: emptyNodeDataSchema,
|
|
2859
|
-
content:
|
|
3230
|
+
content: z42.array(paragraphNodeSchema)
|
|
2860
3231
|
});
|
|
2861
|
-
var tableRowNodeSchema =
|
|
2862
|
-
nodeType:
|
|
3232
|
+
var tableRowNodeSchema = z42.object({
|
|
3233
|
+
nodeType: z42.literal(BLOCKS2.TABLE_ROW),
|
|
2863
3234
|
data: emptyNodeDataSchema,
|
|
2864
|
-
content:
|
|
3235
|
+
content: z42.array(z42.union([tableHeaderCellNodeSchema, tableCellNodeSchema]))
|
|
2865
3236
|
});
|
|
2866
|
-
var tableNodeSchema =
|
|
2867
|
-
nodeType:
|
|
3237
|
+
var tableNodeSchema = z42.object({
|
|
3238
|
+
nodeType: z42.literal(BLOCKS2.TABLE),
|
|
2868
3239
|
data: emptyNodeDataSchema,
|
|
2869
|
-
content:
|
|
3240
|
+
content: z42.array(tableRowNodeSchema)
|
|
2870
3241
|
});
|
|
2871
|
-
var orderedListNodeSchema =
|
|
2872
|
-
() =>
|
|
2873
|
-
nodeType:
|
|
3242
|
+
var orderedListNodeSchema = z42.lazy(
|
|
3243
|
+
() => z42.object({
|
|
3244
|
+
nodeType: z42.literal(BLOCKS2.OL_LIST),
|
|
2874
3245
|
data: emptyNodeDataSchema,
|
|
2875
|
-
content:
|
|
3246
|
+
content: z42.array(listItemNodeSchema)
|
|
2876
3247
|
})
|
|
2877
3248
|
);
|
|
2878
|
-
var unorderedListNodeSchema =
|
|
2879
|
-
() =>
|
|
2880
|
-
nodeType:
|
|
3249
|
+
var unorderedListNodeSchema = z42.lazy(
|
|
3250
|
+
() => z42.object({
|
|
3251
|
+
nodeType: z42.literal(BLOCKS2.UL_LIST),
|
|
2881
3252
|
data: emptyNodeDataSchema,
|
|
2882
|
-
content:
|
|
3253
|
+
content: z42.array(listItemNodeSchema)
|
|
2883
3254
|
})
|
|
2884
3255
|
);
|
|
2885
|
-
var listItemNodeSchema =
|
|
2886
|
-
() =>
|
|
2887
|
-
nodeType:
|
|
3256
|
+
var listItemNodeSchema = z42.lazy(
|
|
3257
|
+
() => z42.object({
|
|
3258
|
+
nodeType: z42.literal(BLOCKS2.LIST_ITEM),
|
|
2888
3259
|
data: emptyNodeDataSchema,
|
|
2889
|
-
content:
|
|
2890
|
-
|
|
3260
|
+
content: z42.array(
|
|
3261
|
+
z42.union([
|
|
2891
3262
|
paragraphNodeSchema,
|
|
2892
3263
|
orderedListNodeSchema,
|
|
2893
3264
|
unorderedListNodeSchema
|
|
@@ -2895,8 +3266,8 @@ var listItemNodeSchema = z40.lazy(
|
|
|
2895
3266
|
)
|
|
2896
3267
|
})
|
|
2897
3268
|
);
|
|
2898
|
-
var topLevelBlockNodeSchema =
|
|
2899
|
-
() =>
|
|
3269
|
+
var topLevelBlockNodeSchema = z42.lazy(
|
|
3270
|
+
() => z42.union([
|
|
2900
3271
|
paragraphNodeSchema,
|
|
2901
3272
|
heading1NodeSchema,
|
|
2902
3273
|
heading2NodeSchema,
|
|
@@ -2914,56 +3285,56 @@ var topLevelBlockNodeSchema = z40.lazy(
|
|
|
2914
3285
|
tableNodeSchema
|
|
2915
3286
|
])
|
|
2916
3287
|
);
|
|
2917
|
-
var richTextDocumentSchema =
|
|
2918
|
-
nodeType:
|
|
3288
|
+
var richTextDocumentSchema = z42.object({
|
|
3289
|
+
nodeType: z42.literal(BLOCKS2.DOCUMENT),
|
|
2919
3290
|
data: emptyNodeDataSchema,
|
|
2920
|
-
content:
|
|
3291
|
+
content: z42.array(topLevelBlockNodeSchema)
|
|
2921
3292
|
}).describe("Contentful Rich Text document");
|
|
2922
3293
|
|
|
2923
3294
|
// src/types/entryFieldSchema.ts
|
|
2924
|
-
var linkSchema =
|
|
2925
|
-
sys:
|
|
2926
|
-
type:
|
|
2927
|
-
linkType:
|
|
2928
|
-
id:
|
|
3295
|
+
var linkSchema = z43.object({
|
|
3296
|
+
sys: z43.object({
|
|
3297
|
+
type: z43.literal("Link"),
|
|
3298
|
+
linkType: z43.enum(["Entry", "Asset"]),
|
|
3299
|
+
id: z43.string()
|
|
2929
3300
|
})
|
|
2930
3301
|
});
|
|
2931
|
-
var resourceLinkSchema =
|
|
2932
|
-
sys:
|
|
2933
|
-
type:
|
|
2934
|
-
linkType:
|
|
2935
|
-
urn:
|
|
3302
|
+
var resourceLinkSchema = z43.object({
|
|
3303
|
+
sys: z43.object({
|
|
3304
|
+
type: z43.literal("ResourceLink"),
|
|
3305
|
+
linkType: z43.string(),
|
|
3306
|
+
urn: z43.string()
|
|
2936
3307
|
})
|
|
2937
3308
|
});
|
|
2938
|
-
var locationSchema =
|
|
2939
|
-
lat:
|
|
2940
|
-
lon:
|
|
3309
|
+
var locationSchema = z43.object({
|
|
3310
|
+
lat: z43.number(),
|
|
3311
|
+
lon: z43.number()
|
|
2941
3312
|
});
|
|
2942
|
-
var jsonPrimitive =
|
|
2943
|
-
var jsonValueSchema =
|
|
2944
|
-
() =>
|
|
3313
|
+
var jsonPrimitive = z43.union([z43.string(), z43.number(), z43.boolean(), z43.null()]);
|
|
3314
|
+
var jsonValueSchema = z43.lazy(
|
|
3315
|
+
() => z43.union([jsonPrimitive, z43.array(jsonValueSchema), z43.record(jsonValueSchema)]).describe("Freeform JSON value (not for Rich Text)")
|
|
2945
3316
|
);
|
|
2946
|
-
var fieldValueSchema =
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
3317
|
+
var fieldValueSchema = z43.union([
|
|
3318
|
+
z43.string().describe("Symbol, Text, or Date field"),
|
|
3319
|
+
z43.number().describe("Integer or Number field"),
|
|
3320
|
+
z43.boolean().describe("Boolean field"),
|
|
2950
3321
|
richTextDocumentSchema,
|
|
2951
3322
|
linkSchema.describe("Link field (Entry or Asset reference)"),
|
|
2952
3323
|
resourceLinkSchema.describe("ResourceLink field"),
|
|
2953
3324
|
locationSchema.describe("Location field"),
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
3325
|
+
z43.array(z43.string()).describe("Array field of Symbols"),
|
|
3326
|
+
z43.array(linkSchema).describe("Array field of Links"),
|
|
3327
|
+
z43.array(resourceLinkSchema).describe("Array field of ResourceLinks"),
|
|
2957
3328
|
jsonValueSchema
|
|
2958
3329
|
]);
|
|
2959
|
-
var localizedFieldSchema =
|
|
2960
|
-
var entryFieldsSchema =
|
|
3330
|
+
var localizedFieldSchema = z43.record(fieldValueSchema);
|
|
3331
|
+
var entryFieldsSchema = z43.record(localizedFieldSchema).describe(
|
|
2961
3332
|
"Field values to update. Keys are field IDs, values are locale-keyed objects. Will be merged with existing fields."
|
|
2962
3333
|
);
|
|
2963
3334
|
|
|
2964
3335
|
// src/tools/entries/createEntry.ts
|
|
2965
3336
|
var CreateEntryToolParams = BaseToolSchema.extend({
|
|
2966
|
-
contentTypeId:
|
|
3337
|
+
contentTypeId: z44.string().describe("The ID of the content type to create an entry for"),
|
|
2967
3338
|
fields: entryFieldsSchema.describe(
|
|
2968
3339
|
"The field values for the new entry. Keys should be field IDs and values should be the field content."
|
|
2969
3340
|
),
|
|
@@ -2996,13 +3367,13 @@ function createEntryTool(config) {
|
|
|
2996
3367
|
}
|
|
2997
3368
|
|
|
2998
3369
|
// src/tools/entries/deleteEntry.ts
|
|
2999
|
-
import { z as
|
|
3370
|
+
import { z as z45 } from "zod";
|
|
3000
3371
|
var DeleteEntryToolParams = BaseToolSchema.extend({
|
|
3001
|
-
entryId:
|
|
3002
|
-
confirm:
|
|
3372
|
+
entryId: z45.string().describe("The ID of the entry to delete"),
|
|
3373
|
+
confirm: z45.boolean().optional().describe(
|
|
3003
3374
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
3004
3375
|
),
|
|
3005
|
-
confirmToken:
|
|
3376
|
+
confirmToken: z45.string().optional().describe(
|
|
3006
3377
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
3007
3378
|
)
|
|
3008
3379
|
});
|
|
@@ -3042,10 +3413,10 @@ function deleteEntryTool(config) {
|
|
|
3042
3413
|
}
|
|
3043
3414
|
|
|
3044
3415
|
// src/tools/entries/updateEntry.ts
|
|
3045
|
-
import { z as
|
|
3416
|
+
import { z as z46 } from "zod";
|
|
3046
3417
|
var UpdateEntryToolParams = BaseToolSchema.extend({
|
|
3047
|
-
entryId:
|
|
3048
|
-
version:
|
|
3418
|
+
entryId: z46.string().describe("The ID of the entry to update"),
|
|
3419
|
+
version: z46.number().describe(
|
|
3049
3420
|
"REQUIRED. The entry's sys.version as returned by get_entry. You must call get_entry first to read the current state and version. The update is rejected if this does not match the entry's current version, which means the entry changed since you read it."
|
|
3050
3421
|
),
|
|
3051
3422
|
fields: entryFieldsSchema.describe(
|
|
@@ -3099,9 +3470,9 @@ function updateEntryTool(config) {
|
|
|
3099
3470
|
}
|
|
3100
3471
|
|
|
3101
3472
|
// src/tools/entries/getEntry.ts
|
|
3102
|
-
import { z as
|
|
3473
|
+
import { z as z47 } from "zod";
|
|
3103
3474
|
var GetEntryToolParams = BaseToolSchema.extend({
|
|
3104
|
-
entryId:
|
|
3475
|
+
entryId: z47.string().describe("The ID of the entry to retrieve")
|
|
3105
3476
|
});
|
|
3106
3477
|
function getEntryTool(config) {
|
|
3107
3478
|
async function tool2(args) {
|
|
@@ -3118,10 +3489,10 @@ function getEntryTool(config) {
|
|
|
3118
3489
|
}
|
|
3119
3490
|
|
|
3120
3491
|
// src/tools/entries/resolveEntryReferences.ts
|
|
3121
|
-
import { z as
|
|
3492
|
+
import { z as z48 } from "zod";
|
|
3122
3493
|
var ResolveEntryReferencesToolParams = BaseToolSchema.extend({
|
|
3123
|
-
entryId:
|
|
3124
|
-
include:
|
|
3494
|
+
entryId: z48.string().describe("The ID of the entry whose references should be resolved"),
|
|
3495
|
+
include: z48.number().int().min(1).max(10).optional().default(2).describe(
|
|
3125
3496
|
"How many levels of linked entries to walk (1-10, default: 2). The CMA caps this at 10."
|
|
3126
3497
|
)
|
|
3127
3498
|
});
|
|
@@ -3144,10 +3515,10 @@ function resolveEntryReferencesTool(config) {
|
|
|
3144
3515
|
}
|
|
3145
3516
|
|
|
3146
3517
|
// src/tools/entries/getEntrySnapshot.ts
|
|
3147
|
-
import { z as
|
|
3518
|
+
import { z as z49 } from "zod";
|
|
3148
3519
|
var GetEntrySnapshotToolParams = BaseToolSchema.extend({
|
|
3149
|
-
entryId:
|
|
3150
|
-
snapshotId:
|
|
3520
|
+
entryId: z49.string().describe("The ID of the entry to retrieve snapshots for"),
|
|
3521
|
+
snapshotId: z49.string().optional().describe(
|
|
3151
3522
|
"Optional snapshot ID. When provided, returns the full content of that single snapshot. When omitted, lists all available snapshots for the entry."
|
|
3152
3523
|
)
|
|
3153
3524
|
});
|
|
@@ -3178,12 +3549,12 @@ function getEntrySnapshotTool(config) {
|
|
|
3178
3549
|
}
|
|
3179
3550
|
|
|
3180
3551
|
// src/tools/entries/publishEntry.ts
|
|
3181
|
-
import { z as
|
|
3552
|
+
import { z as z50 } from "zod";
|
|
3182
3553
|
var PublishEntryToolParams = BaseToolSchema.extend({
|
|
3183
|
-
entryId:
|
|
3554
|
+
entryId: z50.array(z50.string()).min(1).max(100).describe(
|
|
3184
3555
|
"Array of entry IDs to publish. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3185
3556
|
),
|
|
3186
|
-
dryRun:
|
|
3557
|
+
dryRun: z50.boolean().optional().describe(
|
|
3187
3558
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3188
3559
|
)
|
|
3189
3560
|
});
|
|
@@ -3251,12 +3622,12 @@ function publishEntryTool(config) {
|
|
|
3251
3622
|
}
|
|
3252
3623
|
|
|
3253
3624
|
// src/tools/entries/unpublishEntry.ts
|
|
3254
|
-
import { z as
|
|
3625
|
+
import { z as z51 } from "zod";
|
|
3255
3626
|
var UnpublishEntryToolParams = BaseToolSchema.extend({
|
|
3256
|
-
entryId:
|
|
3627
|
+
entryId: z51.array(z51.string()).min(1).max(100).describe(
|
|
3257
3628
|
"Array of entry IDs to unpublish. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3258
3629
|
),
|
|
3259
|
-
dryRun:
|
|
3630
|
+
dryRun: z51.boolean().optional().describe(
|
|
3260
3631
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3261
3632
|
)
|
|
3262
3633
|
});
|
|
@@ -3324,12 +3695,12 @@ function unpublishEntryTool(config) {
|
|
|
3324
3695
|
}
|
|
3325
3696
|
|
|
3326
3697
|
// src/tools/entries/archiveEntry.ts
|
|
3327
|
-
import { z as
|
|
3698
|
+
import { z as z52 } from "zod";
|
|
3328
3699
|
var ArchiveEntryToolParams = BaseToolSchema.extend({
|
|
3329
|
-
entryId:
|
|
3700
|
+
entryId: z52.array(z52.string()).min(1).max(100).describe(
|
|
3330
3701
|
"Array of entry IDs to archive. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3331
3702
|
),
|
|
3332
|
-
dryRun:
|
|
3703
|
+
dryRun: z52.boolean().optional().describe(
|
|
3333
3704
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3334
3705
|
)
|
|
3335
3706
|
});
|
|
@@ -3368,7 +3739,7 @@ function archiveEntryTool(config) {
|
|
|
3368
3739
|
await contentfulClient.entry.archive(params);
|
|
3369
3740
|
successfullyArchived.push(entryId);
|
|
3370
3741
|
} catch (error) {
|
|
3371
|
-
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive entry '${entryId}' after successfully archiving ${successfullyArchived.length} entry(s): [${successfullyArchived.join(", ")}]. Original error: ${
|
|
3742
|
+
const errorMessage = successfullyArchived.length > 0 ? `Failed to archive entry '${entryId}' after successfully archiving ${successfullyArchived.length} entry(s): [${successfullyArchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to archive entry '${entryId}': ${formatErrorMessage(error)}`;
|
|
3372
3743
|
throw new Error(errorMessage);
|
|
3373
3744
|
}
|
|
3374
3745
|
}
|
|
@@ -3390,12 +3761,12 @@ function archiveEntryTool(config) {
|
|
|
3390
3761
|
}
|
|
3391
3762
|
|
|
3392
3763
|
// src/tools/entries/unarchiveEntry.ts
|
|
3393
|
-
import { z as
|
|
3764
|
+
import { z as z53 } from "zod";
|
|
3394
3765
|
var UnarchiveEntryToolParams = BaseToolSchema.extend({
|
|
3395
|
-
entryId:
|
|
3766
|
+
entryId: z53.array(z53.string()).min(1).max(100).describe(
|
|
3396
3767
|
"Array of entry IDs to unarchive. Single-element array for one entry, or up to MAX_BULK_SIZE per call (default 10, max 100 \u2014 configurable via MAX_BULK_SIZE env var)."
|
|
3397
3768
|
),
|
|
3398
|
-
dryRun:
|
|
3769
|
+
dryRun: z53.boolean().optional().describe(
|
|
3399
3770
|
"When true, returns a preview of the operation without executing it. Still subject to MAX_BULK_SIZE \u2014 use this to confirm intent for within-limit calls."
|
|
3400
3771
|
)
|
|
3401
3772
|
});
|
|
@@ -3434,7 +3805,7 @@ function unarchiveEntryTool(config) {
|
|
|
3434
3805
|
await contentfulClient.entry.unarchive(params);
|
|
3435
3806
|
successfullyUnarchived.push(entryId);
|
|
3436
3807
|
} catch (error) {
|
|
3437
|
-
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive entry '${entryId}' after successfully unarchiving ${successfullyUnarchived.length} entry(s): [${successfullyUnarchived.join(", ")}]. Original error: ${
|
|
3808
|
+
const errorMessage = successfullyUnarchived.length > 0 ? `Failed to unarchive entry '${entryId}' after successfully unarchiving ${successfullyUnarchived.length} entry(s): [${successfullyUnarchived.join(", ")}]. Original error: ${formatErrorMessage(error)}` : `Failed to unarchive entry '${entryId}': ${formatErrorMessage(error)}`;
|
|
3438
3809
|
throw new Error(errorMessage);
|
|
3439
3810
|
}
|
|
3440
3811
|
}
|
|
@@ -3456,17 +3827,17 @@ function unarchiveEntryTool(config) {
|
|
|
3456
3827
|
}
|
|
3457
3828
|
|
|
3458
3829
|
// src/tools/entries/appendEntryField.ts
|
|
3459
|
-
import { z as
|
|
3830
|
+
import { z as z54 } from "zod";
|
|
3460
3831
|
var AppendEntryFieldToolParams = BaseToolSchema.extend({
|
|
3461
|
-
entryId:
|
|
3462
|
-
fieldId:
|
|
3463
|
-
locale:
|
|
3832
|
+
entryId: z54.string().describe("The ID of the entry to modify"),
|
|
3833
|
+
fieldId: z54.string().describe("The ID of the array field to append to"),
|
|
3834
|
+
locale: z54.string().describe(
|
|
3464
3835
|
'The locale key to target (e.g. "en-US"). Fields are locale-keyed; you must supply the exact locale string.'
|
|
3465
3836
|
),
|
|
3466
|
-
values:
|
|
3837
|
+
values: z54.array(z54.unknown()).min(1).describe(
|
|
3467
3838
|
'One or more items to append. Each item must match the element shape of the target array field: a plain string for Array of Symbols, { sys: { type: "Link", linkType: "Entry"|"Asset", id: "..." } } for Array of Links, or { sys: { type: "ResourceLink", linkType: "...", urn: "..." } } for Array of ResourceLinks.'
|
|
3468
3839
|
),
|
|
3469
|
-
version:
|
|
3840
|
+
version: z54.number().optional().describe(
|
|
3470
3841
|
"Optional. The entry's sys.version as returned by get_entry. If provided, the append is rejected when the entry has changed since you read it (same conflict check as update_entry). If omitted, the append targets the current server state without a version check \u2014 safe for additive operations."
|
|
3471
3842
|
)
|
|
3472
3843
|
});
|
|
@@ -3720,11 +4091,11 @@ function createEntryTools(config) {
|
|
|
3720
4091
|
}
|
|
3721
4092
|
|
|
3722
4093
|
// src/tools/environments/createEnvironment.ts
|
|
3723
|
-
import { z as
|
|
4094
|
+
import { z as z55 } from "zod";
|
|
3724
4095
|
var CreateEnvironmentToolParams = BaseToolSchema.extend({
|
|
3725
|
-
environmentId:
|
|
3726
|
-
name:
|
|
3727
|
-
sourceEnvironmentId:
|
|
4096
|
+
environmentId: z55.string().describe("The ID of the environment to create"),
|
|
4097
|
+
name: z55.string().describe("The name of the environment to create"),
|
|
4098
|
+
sourceEnvironmentId: z55.string().describe(
|
|
3728
4099
|
"The ID of the source environment to clone from (defaults to master)"
|
|
3729
4100
|
).optional()
|
|
3730
4101
|
});
|
|
@@ -3755,15 +4126,15 @@ function createEnvironmentTool(config) {
|
|
|
3755
4126
|
}
|
|
3756
4127
|
|
|
3757
4128
|
// src/tools/environments/listEnvironments.ts
|
|
3758
|
-
import { z as
|
|
4129
|
+
import { z as z56 } from "zod";
|
|
3759
4130
|
var ListEnvironmentsToolParams = BaseToolSchema.extend({
|
|
3760
|
-
environmentId:
|
|
4131
|
+
environmentId: z56.string().optional().describe(
|
|
3761
4132
|
"The ID of the Contentful environment (not required for listing)"
|
|
3762
4133
|
),
|
|
3763
|
-
limit:
|
|
3764
|
-
skip:
|
|
3765
|
-
select:
|
|
3766
|
-
order:
|
|
4134
|
+
limit: z56.number().optional().describe("Maximum number of environments to return (max 10)"),
|
|
4135
|
+
skip: z56.number().optional().describe("Skip this many environments for pagination"),
|
|
4136
|
+
select: z56.string().optional().describe("Comma-separated list of fields to return"),
|
|
4137
|
+
order: z56.string().optional().describe("Order environments by this field")
|
|
3767
4138
|
});
|
|
3768
4139
|
function listEnvironmentsTool(config) {
|
|
3769
4140
|
async function tool2(args) {
|
|
@@ -3809,13 +4180,13 @@ function listEnvironmentsTool(config) {
|
|
|
3809
4180
|
}
|
|
3810
4181
|
|
|
3811
4182
|
// src/tools/environments/deleteEnvironment.ts
|
|
3812
|
-
import { z as
|
|
4183
|
+
import { z as z57 } from "zod";
|
|
3813
4184
|
var DeleteEnvironmentToolParams = BaseToolSchema.extend({
|
|
3814
|
-
environmentId:
|
|
3815
|
-
confirm:
|
|
4185
|
+
environmentId: z57.string().describe("The ID of the environment to delete"),
|
|
4186
|
+
confirm: z57.boolean().optional().describe(
|
|
3816
4187
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
3817
4188
|
),
|
|
3818
|
-
confirmToken:
|
|
4189
|
+
confirmToken: z57.string().optional().describe(
|
|
3819
4190
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
3820
4191
|
)
|
|
3821
4192
|
});
|
|
@@ -3900,9 +4271,9 @@ function createEnvironmentTools(config) {
|
|
|
3900
4271
|
}
|
|
3901
4272
|
|
|
3902
4273
|
// src/tools/locales/getLocale.ts
|
|
3903
|
-
import { z as
|
|
4274
|
+
import { z as z58 } from "zod";
|
|
3904
4275
|
var GetLocaleToolParams = BaseToolSchema.extend({
|
|
3905
|
-
localeId:
|
|
4276
|
+
localeId: z58.string().describe("The ID of the locale to retrieve")
|
|
3906
4277
|
});
|
|
3907
4278
|
function getLocaleTool(config) {
|
|
3908
4279
|
async function tool2(args) {
|
|
@@ -3919,21 +4290,21 @@ function getLocaleTool(config) {
|
|
|
3919
4290
|
}
|
|
3920
4291
|
|
|
3921
4292
|
// src/tools/locales/createLocale.ts
|
|
3922
|
-
import { z as
|
|
4293
|
+
import { z as z59 } from "zod";
|
|
3923
4294
|
var CreateLocaleToolParams = BaseToolSchema.extend({
|
|
3924
|
-
name:
|
|
3925
|
-
code:
|
|
3926
|
-
fallbackCode:
|
|
4295
|
+
name: z59.string().describe("The name of the locale"),
|
|
4296
|
+
code: z59.string().describe('The locale code (e.g., "en-US")'),
|
|
4297
|
+
fallbackCode: z59.string().nullable().describe(
|
|
3927
4298
|
"The locale code to fallback to when there is no content for the current locale"
|
|
3928
4299
|
),
|
|
3929
|
-
contentDeliveryApi:
|
|
4300
|
+
contentDeliveryApi: z59.boolean().optional().default(true).describe(
|
|
3930
4301
|
"If the content under this locale should be available on the CDA (for public reading)"
|
|
3931
4302
|
),
|
|
3932
|
-
contentManagementApi:
|
|
4303
|
+
contentManagementApi: z59.boolean().optional().default(true).describe(
|
|
3933
4304
|
"If the content under this locale should be available on the CMA (for editing)"
|
|
3934
4305
|
),
|
|
3935
|
-
default:
|
|
3936
|
-
optional:
|
|
4306
|
+
default: z59.boolean().optional().default(false).describe("If this is the default locale"),
|
|
4307
|
+
optional: z59.boolean().optional().default(false).describe("If the locale needs to be filled in on entries or not")
|
|
3937
4308
|
});
|
|
3938
4309
|
function createLocaleTool(config) {
|
|
3939
4310
|
async function tool2(args) {
|
|
@@ -3960,13 +4331,13 @@ function createLocaleTool(config) {
|
|
|
3960
4331
|
}
|
|
3961
4332
|
|
|
3962
4333
|
// src/tools/locales/listLocales.ts
|
|
3963
|
-
import { z as
|
|
4334
|
+
import { z as z60 } from "zod";
|
|
3964
4335
|
var ListLocaleToolParams = BaseToolSchema.extend({
|
|
3965
|
-
limit:
|
|
3966
|
-
skip:
|
|
3967
|
-
select:
|
|
3968
|
-
include:
|
|
3969
|
-
order:
|
|
4336
|
+
limit: z60.number().optional().describe("Maximum number of locales to return"),
|
|
4337
|
+
skip: z60.number().optional().describe("Skip this many locales for pagination"),
|
|
4338
|
+
select: z60.string().optional().describe("Comma-separated list of fields to return"),
|
|
4339
|
+
include: z60.number().optional().describe("Include this many levels of linked entries"),
|
|
4340
|
+
order: z60.string().optional().describe("Order locales by this field")
|
|
3970
4341
|
});
|
|
3971
4342
|
function listLocaleTool(config) {
|
|
3972
4343
|
async function tool2(args) {
|
|
@@ -4019,23 +4390,23 @@ function listLocaleTool(config) {
|
|
|
4019
4390
|
}
|
|
4020
4391
|
|
|
4021
4392
|
// src/tools/locales/updateLocale.ts
|
|
4022
|
-
import { z as
|
|
4393
|
+
import { z as z61 } from "zod";
|
|
4023
4394
|
var UpdateLocaleToolParams = BaseToolSchema.extend({
|
|
4024
|
-
localeId:
|
|
4025
|
-
fields:
|
|
4026
|
-
name:
|
|
4395
|
+
localeId: z61.string().describe("The ID of the locale to update"),
|
|
4396
|
+
fields: z61.object({
|
|
4397
|
+
name: z61.string().optional().describe("The name of the locale"),
|
|
4027
4398
|
// NOTE: internal_code changes are not allowed
|
|
4028
|
-
code:
|
|
4029
|
-
fallbackCode:
|
|
4399
|
+
code: z61.string().optional().describe("The code of the locale"),
|
|
4400
|
+
fallbackCode: z61.string().optional().describe(
|
|
4030
4401
|
"The locale code to fallback to when there is no content for the current locale"
|
|
4031
4402
|
),
|
|
4032
|
-
contentDeliveryApi:
|
|
4403
|
+
contentDeliveryApi: z61.boolean().optional().describe(
|
|
4033
4404
|
"If the content under this locale should be available on the CDA (for public reading)"
|
|
4034
4405
|
),
|
|
4035
|
-
contentManagementApi:
|
|
4406
|
+
contentManagementApi: z61.boolean().optional().describe(
|
|
4036
4407
|
"If the content under this locale should be available on the CMA (for editing)"
|
|
4037
4408
|
),
|
|
4038
|
-
optional:
|
|
4409
|
+
optional: z61.boolean().optional().describe("If the locale needs to be filled in on entries or not")
|
|
4039
4410
|
})
|
|
4040
4411
|
});
|
|
4041
4412
|
function updateLocaleTool(config) {
|
|
@@ -4065,13 +4436,13 @@ function updateLocaleTool(config) {
|
|
|
4065
4436
|
}
|
|
4066
4437
|
|
|
4067
4438
|
// src/tools/locales/deleteLocale.ts
|
|
4068
|
-
import { z as
|
|
4439
|
+
import { z as z62 } from "zod";
|
|
4069
4440
|
var DeleteLocaleToolParams = BaseToolSchema.extend({
|
|
4070
|
-
localeId:
|
|
4071
|
-
confirm:
|
|
4441
|
+
localeId: z62.string().describe("The ID of the locale to delete"),
|
|
4442
|
+
confirm: z62.boolean().optional().describe(
|
|
4072
4443
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4073
4444
|
),
|
|
4074
|
-
confirmToken:
|
|
4445
|
+
confirmToken: z62.string().optional().describe(
|
|
4075
4446
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4076
4447
|
)
|
|
4077
4448
|
});
|
|
@@ -4180,19 +4551,19 @@ function createLocaleTools(config) {
|
|
|
4180
4551
|
}
|
|
4181
4552
|
|
|
4182
4553
|
// src/tools/orgs/listOrgs.ts
|
|
4183
|
-
import { z as
|
|
4184
|
-
import { createClient as
|
|
4185
|
-
var ListOrgsToolParams =
|
|
4186
|
-
limit:
|
|
4187
|
-
skip:
|
|
4188
|
-
select:
|
|
4189
|
-
order:
|
|
4554
|
+
import { z as z63 } from "zod";
|
|
4555
|
+
import { createClient as createClient3 } from "contentful-management";
|
|
4556
|
+
var ListOrgsToolParams = z63.object({
|
|
4557
|
+
limit: z63.number().optional().describe("Maximum number of organizations to return (max 10)"),
|
|
4558
|
+
skip: z63.number().optional().describe("Skip this many organizations for pagination"),
|
|
4559
|
+
select: z63.string().optional().describe("Comma-separated list of fields to return"),
|
|
4560
|
+
order: z63.string().optional().describe("Order organizations by this field")
|
|
4190
4561
|
});
|
|
4191
4562
|
function listOrgsTool(config) {
|
|
4192
4563
|
async function tool2(args) {
|
|
4193
4564
|
const clientConfig = createClientConfig(config);
|
|
4194
4565
|
delete clientConfig.space;
|
|
4195
|
-
const contentfulClient =
|
|
4566
|
+
const contentfulClient = createClient3(clientConfig);
|
|
4196
4567
|
const organizations = await contentfulClient.organization.getAll({
|
|
4197
4568
|
query: {
|
|
4198
4569
|
limit: Math.min(args.limit || 10, 10),
|
|
@@ -4228,16 +4599,16 @@ function listOrgsTool(config) {
|
|
|
4228
4599
|
}
|
|
4229
4600
|
|
|
4230
4601
|
// src/tools/orgs/getOrg.ts
|
|
4231
|
-
import { z as
|
|
4232
|
-
import { createClient as
|
|
4233
|
-
var GetOrgToolParams =
|
|
4234
|
-
organizationId:
|
|
4602
|
+
import { z as z64 } from "zod";
|
|
4603
|
+
import { createClient as createClient4 } from "contentful-management";
|
|
4604
|
+
var GetOrgToolParams = z64.object({
|
|
4605
|
+
organizationId: z64.string().describe("The ID of the organization to retrieve")
|
|
4235
4606
|
});
|
|
4236
4607
|
function getOrgTool(config) {
|
|
4237
4608
|
async function tool2(args) {
|
|
4238
4609
|
const clientConfig = createClientConfig(config);
|
|
4239
4610
|
delete clientConfig.space;
|
|
4240
|
-
const contentfulClient =
|
|
4611
|
+
const contentfulClient = createClient4(clientConfig);
|
|
4241
4612
|
const organization = await contentfulClient.organization.get({
|
|
4242
4613
|
organizationId: args.organizationId
|
|
4243
4614
|
});
|
|
@@ -4279,19 +4650,19 @@ function createOrgTools(config) {
|
|
|
4279
4650
|
}
|
|
4280
4651
|
|
|
4281
4652
|
// src/tools/spaces/listSpaces.ts
|
|
4282
|
-
import { z as
|
|
4283
|
-
import { createClient as
|
|
4284
|
-
var ListSpacesToolParams =
|
|
4285
|
-
limit:
|
|
4286
|
-
skip:
|
|
4287
|
-
select:
|
|
4288
|
-
order:
|
|
4653
|
+
import { z as z65 } from "zod";
|
|
4654
|
+
import { createClient as createClient5 } from "contentful-management";
|
|
4655
|
+
var ListSpacesToolParams = z65.object({
|
|
4656
|
+
limit: z65.number().optional().describe("Maximum number of spaces to return (max 10)"),
|
|
4657
|
+
skip: z65.number().optional().describe("Skip this many spaces for pagination"),
|
|
4658
|
+
select: z65.string().optional().describe("Comma-separated list of fields to return"),
|
|
4659
|
+
order: z65.string().optional().describe("Order spaces by this field")
|
|
4289
4660
|
});
|
|
4290
4661
|
function listSpacesTool(config) {
|
|
4291
4662
|
async function tool2(args) {
|
|
4292
4663
|
const clientConfig = createClientConfig(config);
|
|
4293
4664
|
delete clientConfig.space;
|
|
4294
|
-
const contentfulClient =
|
|
4665
|
+
const contentfulClient = createClient5(clientConfig);
|
|
4295
4666
|
const spaces = await contentfulClient.space.getMany({
|
|
4296
4667
|
query: {
|
|
4297
4668
|
limit: Math.min(args.limit || 10, 10),
|
|
@@ -4327,16 +4698,16 @@ function listSpacesTool(config) {
|
|
|
4327
4698
|
}
|
|
4328
4699
|
|
|
4329
4700
|
// src/tools/spaces/getSpace.ts
|
|
4330
|
-
import { z as
|
|
4331
|
-
import { createClient as
|
|
4332
|
-
var GetSpaceToolParams =
|
|
4333
|
-
spaceId:
|
|
4701
|
+
import { z as z66 } from "zod";
|
|
4702
|
+
import { createClient as createClient6 } from "contentful-management";
|
|
4703
|
+
var GetSpaceToolParams = z66.object({
|
|
4704
|
+
spaceId: z66.string().describe("The ID of the space to retrieve")
|
|
4334
4705
|
});
|
|
4335
4706
|
function getSpaceTool(config) {
|
|
4336
4707
|
async function tool2(args) {
|
|
4337
4708
|
const clientConfig = createClientConfig(config);
|
|
4338
4709
|
delete clientConfig.space;
|
|
4339
|
-
const contentfulClient =
|
|
4710
|
+
const contentfulClient = createClient6(clientConfig);
|
|
4340
4711
|
const space = await contentfulClient.space.get({
|
|
4341
4712
|
spaceId: args.spaceId
|
|
4342
4713
|
});
|
|
@@ -4376,12 +4747,12 @@ function createSpaceTools(config) {
|
|
|
4376
4747
|
}
|
|
4377
4748
|
|
|
4378
4749
|
// src/tools/tags/listTags.ts
|
|
4379
|
-
import { z as
|
|
4750
|
+
import { z as z67 } from "zod";
|
|
4380
4751
|
var ListTagsToolParams = BaseToolSchema.extend({
|
|
4381
|
-
limit:
|
|
4382
|
-
skip:
|
|
4383
|
-
select:
|
|
4384
|
-
order:
|
|
4752
|
+
limit: z67.number().optional().describe("Maximum number of tags to return"),
|
|
4753
|
+
skip: z67.number().optional().describe("Skip this many tags for pagination"),
|
|
4754
|
+
select: z67.string().optional().describe("Comma-separated list of fields to return"),
|
|
4755
|
+
order: z67.string().optional().describe("Order tags by this field")
|
|
4385
4756
|
});
|
|
4386
4757
|
function listTagsTool(config) {
|
|
4387
4758
|
async function tool2(args) {
|
|
@@ -4427,11 +4798,11 @@ function listTagsTool(config) {
|
|
|
4427
4798
|
}
|
|
4428
4799
|
|
|
4429
4800
|
// src/tools/tags/createTag.ts
|
|
4430
|
-
import { z as
|
|
4801
|
+
import { z as z68 } from "zod";
|
|
4431
4802
|
var CreateTagToolParams = BaseToolSchema.extend({
|
|
4432
|
-
name:
|
|
4433
|
-
id:
|
|
4434
|
-
visibility:
|
|
4803
|
+
name: z68.string().describe("The name of the tag"),
|
|
4804
|
+
id: z68.string().describe("The ID of the tag"),
|
|
4805
|
+
visibility: z68.enum(["public", "private"]).describe("The visibility of the tag. Default to private if not specified")
|
|
4435
4806
|
});
|
|
4436
4807
|
function createTagTool(config) {
|
|
4437
4808
|
async function tool2(args) {
|
|
@@ -4486,40 +4857,40 @@ function createTagTools(config) {
|
|
|
4486
4857
|
}
|
|
4487
4858
|
|
|
4488
4859
|
// src/tools/taxonomies/concept-schemes/createConceptScheme.ts
|
|
4489
|
-
import { z as
|
|
4490
|
-
import { createClient as
|
|
4860
|
+
import { z as z70 } from "zod";
|
|
4861
|
+
import { createClient as createClient7 } from "contentful-management";
|
|
4491
4862
|
|
|
4492
4863
|
// src/types/conceptPayloadTypes.ts
|
|
4493
|
-
import { z as
|
|
4494
|
-
var TaxonomyConceptLinkSchema =
|
|
4495
|
-
sys:
|
|
4496
|
-
type:
|
|
4497
|
-
linkType:
|
|
4498
|
-
id:
|
|
4864
|
+
import { z as z69 } from "zod";
|
|
4865
|
+
var TaxonomyConceptLinkSchema = z69.object({
|
|
4866
|
+
sys: z69.object({
|
|
4867
|
+
type: z69.literal("Link"),
|
|
4868
|
+
linkType: z69.literal("TaxonomyConcept"),
|
|
4869
|
+
id: z69.string()
|
|
4499
4870
|
})
|
|
4500
4871
|
});
|
|
4501
4872
|
|
|
4502
4873
|
// src/tools/taxonomies/concept-schemes/createConceptScheme.ts
|
|
4503
|
-
var CreateConceptSchemeToolParams =
|
|
4504
|
-
organizationId:
|
|
4505
|
-
conceptSchemeId:
|
|
4874
|
+
var CreateConceptSchemeToolParams = z70.object({
|
|
4875
|
+
organizationId: z70.string().describe("The ID of the Contentful organization"),
|
|
4876
|
+
conceptSchemeId: z70.string().optional().describe(
|
|
4506
4877
|
"Optional user-defined ID for the concept scheme. If not provided, Contentful will generate one automatically."
|
|
4507
4878
|
),
|
|
4508
|
-
prefLabel:
|
|
4509
|
-
uri:
|
|
4510
|
-
definition:
|
|
4511
|
-
editorialNote:
|
|
4512
|
-
historyNote:
|
|
4513
|
-
example:
|
|
4514
|
-
note:
|
|
4515
|
-
scopeNote:
|
|
4516
|
-
topConcepts:
|
|
4879
|
+
prefLabel: z70.record(z70.string()).describe("The preferred label for the concept scheme (localized)"),
|
|
4880
|
+
uri: z70.string().nullable().optional().describe("The URI for the concept scheme"),
|
|
4881
|
+
definition: z70.record(z70.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
|
|
4882
|
+
editorialNote: z70.record(z70.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
|
|
4883
|
+
historyNote: z70.record(z70.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
|
|
4884
|
+
example: z70.record(z70.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
|
|
4885
|
+
note: z70.record(z70.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
|
|
4886
|
+
scopeNote: z70.record(z70.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
|
|
4887
|
+
topConcepts: z70.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme")
|
|
4517
4888
|
});
|
|
4518
4889
|
function createConceptSchemeTool(config) {
|
|
4519
4890
|
async function tool2(args) {
|
|
4520
4891
|
const clientConfig = createClientConfig(config);
|
|
4521
4892
|
delete clientConfig.space;
|
|
4522
|
-
const contentfulClient =
|
|
4893
|
+
const contentfulClient = createClient7(clientConfig);
|
|
4523
4894
|
const conceptSchemePayload = {
|
|
4524
4895
|
prefLabel: args.prefLabel,
|
|
4525
4896
|
...Object.fromEntries(
|
|
@@ -4553,17 +4924,17 @@ function createConceptSchemeTool(config) {
|
|
|
4553
4924
|
}
|
|
4554
4925
|
|
|
4555
4926
|
// src/tools/taxonomies/concept-schemes/getConceptScheme.ts
|
|
4556
|
-
import { z as
|
|
4557
|
-
import { createClient as
|
|
4558
|
-
var GetConceptSchemeToolParams =
|
|
4559
|
-
organizationId:
|
|
4560
|
-
conceptSchemeId:
|
|
4927
|
+
import { z as z71 } from "zod";
|
|
4928
|
+
import { createClient as createClient8 } from "contentful-management";
|
|
4929
|
+
var GetConceptSchemeToolParams = z71.object({
|
|
4930
|
+
organizationId: z71.string().describe("The ID of the Contentful organization"),
|
|
4931
|
+
conceptSchemeId: z71.string().describe("The ID of the concept scheme to retrieve")
|
|
4561
4932
|
});
|
|
4562
4933
|
function getConceptSchemeTool(config) {
|
|
4563
4934
|
async function tool2(args) {
|
|
4564
4935
|
const clientConfig = createClientConfig(config);
|
|
4565
4936
|
delete clientConfig.space;
|
|
4566
|
-
const contentfulClient =
|
|
4937
|
+
const contentfulClient = createClient8(clientConfig);
|
|
4567
4938
|
const params = {
|
|
4568
4939
|
organizationId: args.organizationId,
|
|
4569
4940
|
conceptSchemeId: args.conceptSchemeId
|
|
@@ -4577,25 +4948,25 @@ function getConceptSchemeTool(config) {
|
|
|
4577
4948
|
}
|
|
4578
4949
|
|
|
4579
4950
|
// src/tools/taxonomies/concept-schemes/listConceptSchemes.ts
|
|
4580
|
-
import { z as
|
|
4581
|
-
import { createClient as
|
|
4582
|
-
import { cloneDeep } from "lodash-es";
|
|
4583
|
-
var ListConceptSchemesToolParams =
|
|
4584
|
-
organizationId:
|
|
4585
|
-
query:
|
|
4586
|
-
|
|
4587
|
-
query:
|
|
4588
|
-
pageNext:
|
|
4589
|
-
pagePrev:
|
|
4951
|
+
import { z as z72 } from "zod";
|
|
4952
|
+
import { createClient as createClient9 } from "contentful-management";
|
|
4953
|
+
import { cloneDeep as cloneDeep2 } from "lodash-es";
|
|
4954
|
+
var ListConceptSchemesToolParams = z72.object({
|
|
4955
|
+
organizationId: z72.string(),
|
|
4956
|
+
query: z72.union([
|
|
4957
|
+
z72.object({
|
|
4958
|
+
query: z72.string().optional(),
|
|
4959
|
+
pageNext: z72.string().optional().describe("Cursor token for the next page of concept schemes"),
|
|
4960
|
+
pagePrev: z72.string().optional().describe(
|
|
4590
4961
|
"Cursor token for the previous page of concept schemes"
|
|
4591
4962
|
),
|
|
4592
|
-
limit:
|
|
4593
|
-
order:
|
|
4594
|
-
skip:
|
|
4963
|
+
limit: z72.number().optional().describe("Maximum number of concept schemes to return"),
|
|
4964
|
+
order: z72.string().optional().describe("Order concept schemes by this field"),
|
|
4965
|
+
skip: z72.never().optional()
|
|
4595
4966
|
}).passthrough(),
|
|
4596
4967
|
// handles [key: string]: any from BasicQueryOptions
|
|
4597
|
-
|
|
4598
|
-
pageUrl:
|
|
4968
|
+
z72.object({
|
|
4969
|
+
pageUrl: z72.string().optional()
|
|
4599
4970
|
})
|
|
4600
4971
|
]).optional().describe(
|
|
4601
4972
|
'Query parameters for listing concept schemes, supports either pageUrl for cursor-based pagination. Offset "skip" pagination is not supported.'
|
|
@@ -4607,13 +4978,13 @@ function listConceptSchemesTool(config) {
|
|
|
4607
4978
|
async function tool2(args) {
|
|
4608
4979
|
const clientConfig = createClientConfig(config);
|
|
4609
4980
|
delete clientConfig.space;
|
|
4610
|
-
const contentfulClient =
|
|
4981
|
+
const contentfulClient = createClient9(clientConfig);
|
|
4611
4982
|
const query = {};
|
|
4612
4983
|
if (args.query) {
|
|
4613
4984
|
if ("pageUrl" in args.query && args.query.pageUrl) {
|
|
4614
4985
|
query["pageUrl"] = args.query.pageUrl;
|
|
4615
4986
|
} else {
|
|
4616
|
-
const complexQuery =
|
|
4987
|
+
const complexQuery = cloneDeep2(args.query);
|
|
4617
4988
|
if (complexQuery["query"]) query["query"] = complexQuery["query"];
|
|
4618
4989
|
if (complexQuery["pageNext"])
|
|
4619
4990
|
query["pageNext"] = complexQuery["pageNext"];
|
|
@@ -4665,22 +5036,22 @@ function listConceptSchemesTool(config) {
|
|
|
4665
5036
|
}
|
|
4666
5037
|
|
|
4667
5038
|
// src/tools/taxonomies/concept-schemes/updateConceptScheme.ts
|
|
4668
|
-
import { z as
|
|
4669
|
-
import { createClient as
|
|
4670
|
-
var UpdateConceptSchemeToolParams =
|
|
4671
|
-
organizationId:
|
|
4672
|
-
conceptSchemeId:
|
|
4673
|
-
version:
|
|
4674
|
-
prefLabel:
|
|
4675
|
-
uri:
|
|
4676
|
-
definition:
|
|
4677
|
-
editorialNote:
|
|
4678
|
-
historyNote:
|
|
4679
|
-
example:
|
|
4680
|
-
note:
|
|
4681
|
-
scopeNote:
|
|
4682
|
-
topConcepts:
|
|
4683
|
-
addConcept:
|
|
5039
|
+
import { z as z73 } from "zod";
|
|
5040
|
+
import { createClient as createClient10 } from "contentful-management";
|
|
5041
|
+
var UpdateConceptSchemeToolParams = z73.object({
|
|
5042
|
+
organizationId: z73.string().describe("The ID of the Contentful organization"),
|
|
5043
|
+
conceptSchemeId: z73.string().describe("The ID of the concept scheme to update"),
|
|
5044
|
+
version: z73.number().describe("The current version of the concept scheme"),
|
|
5045
|
+
prefLabel: z73.record(z73.string()).optional().describe("The preferred label for the concept scheme (localized)"),
|
|
5046
|
+
uri: z73.string().nullable().optional().describe("The URI for the concept scheme"),
|
|
5047
|
+
definition: z73.record(z73.string().nullable()).optional().describe("Definition of the concept scheme (localized)"),
|
|
5048
|
+
editorialNote: z73.record(z73.string().nullable()).optional().describe("Editorial note for the concept scheme (localized)"),
|
|
5049
|
+
historyNote: z73.record(z73.string().nullable()).optional().describe("History note for the concept scheme (localized)"),
|
|
5050
|
+
example: z73.record(z73.string().nullable()).optional().describe("Example for the concept scheme (localized)"),
|
|
5051
|
+
note: z73.record(z73.string().nullable()).optional().describe("General note for the concept scheme (localized)"),
|
|
5052
|
+
scopeNote: z73.record(z73.string().nullable()).optional().describe("Scope note for the concept scheme (localized)"),
|
|
5053
|
+
topConcepts: z73.array(TaxonomyConceptLinkSchema).optional().describe("Links to top-level concepts in this scheme"),
|
|
5054
|
+
addConcept: z73.string().optional().describe(
|
|
4684
5055
|
"ID of a concept to add to this scheme (adds to both concepts and topConcepts)"
|
|
4685
5056
|
)
|
|
4686
5057
|
});
|
|
@@ -4688,7 +5059,7 @@ function updateConceptSchemeTool(config) {
|
|
|
4688
5059
|
async function tool2(args) {
|
|
4689
5060
|
const clientConfig = createClientConfig(config);
|
|
4690
5061
|
delete clientConfig.space;
|
|
4691
|
-
const contentfulClient =
|
|
5062
|
+
const contentfulClient = createClient10(clientConfig);
|
|
4692
5063
|
const params = {
|
|
4693
5064
|
organizationId: args.organizationId,
|
|
4694
5065
|
conceptSchemeId: args.conceptSchemeId
|
|
@@ -4755,15 +5126,15 @@ function updateConceptSchemeTool(config) {
|
|
|
4755
5126
|
}
|
|
4756
5127
|
|
|
4757
5128
|
// src/tools/taxonomies/concept-schemes/deleteConceptScheme.ts
|
|
4758
|
-
import { z as
|
|
4759
|
-
import { createClient as
|
|
4760
|
-
var DeleteConceptSchemeToolParams =
|
|
4761
|
-
organizationId:
|
|
4762
|
-
conceptSchemeId:
|
|
4763
|
-
confirm:
|
|
5129
|
+
import { z as z74 } from "zod";
|
|
5130
|
+
import { createClient as createClient11 } from "contentful-management";
|
|
5131
|
+
var DeleteConceptSchemeToolParams = z74.object({
|
|
5132
|
+
organizationId: z74.string().describe("The ID of the Contentful organization"),
|
|
5133
|
+
conceptSchemeId: z74.string().describe("The ID of the concept scheme to delete"),
|
|
5134
|
+
confirm: z74.boolean().optional().describe(
|
|
4764
5135
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4765
5136
|
),
|
|
4766
|
-
confirmToken:
|
|
5137
|
+
confirmToken: z74.string().optional().describe(
|
|
4767
5138
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4768
5139
|
)
|
|
4769
5140
|
});
|
|
@@ -4771,7 +5142,7 @@ function deleteConceptSchemeTool(config) {
|
|
|
4771
5142
|
async function tool2(args) {
|
|
4772
5143
|
const clientConfig = createClientConfig(config);
|
|
4773
5144
|
delete clientConfig.space;
|
|
4774
|
-
const contentfulClient =
|
|
5145
|
+
const contentfulClient = createClient11(clientConfig);
|
|
4775
5146
|
const conceptScheme = await contentfulClient.conceptScheme.get({
|
|
4776
5147
|
organizationId: args.organizationId,
|
|
4777
5148
|
conceptSchemeId: args.conceptSchemeId
|
|
@@ -4874,32 +5245,32 @@ function createConceptSchemeTools(config) {
|
|
|
4874
5245
|
}
|
|
4875
5246
|
|
|
4876
5247
|
// src/tools/taxonomies/concepts/createConcept.ts
|
|
4877
|
-
import { z as
|
|
4878
|
-
import { createClient as
|
|
4879
|
-
var CreateConceptToolParams =
|
|
4880
|
-
organizationId:
|
|
4881
|
-
conceptId:
|
|
5248
|
+
import { z as z75 } from "zod";
|
|
5249
|
+
import { createClient as createClient12 } from "contentful-management";
|
|
5250
|
+
var CreateConceptToolParams = z75.object({
|
|
5251
|
+
organizationId: z75.string().describe("The ID of the Contentful organization"),
|
|
5252
|
+
conceptId: z75.string().optional().describe(
|
|
4882
5253
|
"Optional user-defined ID for the concept. If not provided, Contentful will generate one automatically."
|
|
4883
5254
|
),
|
|
4884
|
-
prefLabel:
|
|
4885
|
-
uri:
|
|
4886
|
-
altLabels:
|
|
4887
|
-
hiddenLabels:
|
|
4888
|
-
definition:
|
|
4889
|
-
editorialNote:
|
|
4890
|
-
historyNote:
|
|
4891
|
-
example:
|
|
4892
|
-
note:
|
|
4893
|
-
scopeNote:
|
|
4894
|
-
notations:
|
|
4895
|
-
broader:
|
|
4896
|
-
related:
|
|
5255
|
+
prefLabel: z75.record(z75.string()).describe("The preferred label for the concept (localized)"),
|
|
5256
|
+
uri: z75.string().nullable().optional().describe("The URI for the concept"),
|
|
5257
|
+
altLabels: z75.record(z75.array(z75.string())).optional().describe("Alternative labels for the concept (localized)"),
|
|
5258
|
+
hiddenLabels: z75.record(z75.array(z75.string())).optional().describe("Hidden labels for the concept (localized)"),
|
|
5259
|
+
definition: z75.record(z75.string().nullable()).optional().describe("Definition of the concept (localized)"),
|
|
5260
|
+
editorialNote: z75.record(z75.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
|
|
5261
|
+
historyNote: z75.record(z75.string().nullable()).optional().describe("History note for the concept (localized)"),
|
|
5262
|
+
example: z75.record(z75.string().nullable()).optional().describe("Example for the concept (localized)"),
|
|
5263
|
+
note: z75.record(z75.string().nullable()).optional().describe("General note for the concept (localized)"),
|
|
5264
|
+
scopeNote: z75.record(z75.string().nullable()).optional().describe("Scope note for the concept (localized)"),
|
|
5265
|
+
notations: z75.array(z75.string()).optional().describe("Notations for the concept"),
|
|
5266
|
+
broader: z75.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
|
|
5267
|
+
related: z75.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
|
|
4897
5268
|
});
|
|
4898
5269
|
function createConceptTool(config) {
|
|
4899
5270
|
async function tool2(args) {
|
|
4900
5271
|
const clientConfig = createClientConfig(config);
|
|
4901
5272
|
delete clientConfig.space;
|
|
4902
|
-
const contentfulClient =
|
|
5273
|
+
const contentfulClient = createClient12(clientConfig);
|
|
4903
5274
|
const conceptPayload = {
|
|
4904
5275
|
prefLabel: args.prefLabel,
|
|
4905
5276
|
...args.uri !== void 0 && { uri: args.uri },
|
|
@@ -4928,15 +5299,15 @@ function createConceptTool(config) {
|
|
|
4928
5299
|
}
|
|
4929
5300
|
|
|
4930
5301
|
// src/tools/taxonomies/concepts/deleteConcept.ts
|
|
4931
|
-
import { z as
|
|
4932
|
-
import { createClient as
|
|
4933
|
-
var DeleteConceptToolParams =
|
|
4934
|
-
organizationId:
|
|
4935
|
-
conceptId:
|
|
4936
|
-
confirm:
|
|
5302
|
+
import { z as z76 } from "zod";
|
|
5303
|
+
import { createClient as createClient13 } from "contentful-management";
|
|
5304
|
+
var DeleteConceptToolParams = z76.object({
|
|
5305
|
+
organizationId: z76.string().describe("The ID of the Contentful organization"),
|
|
5306
|
+
conceptId: z76.string().describe("The ID of the concept to delete"),
|
|
5307
|
+
confirm: z76.boolean().optional().describe(
|
|
4937
5308
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
4938
5309
|
),
|
|
4939
|
-
confirmToken:
|
|
5310
|
+
confirmToken: z76.string().optional().describe(
|
|
4940
5311
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
4941
5312
|
)
|
|
4942
5313
|
});
|
|
@@ -4944,7 +5315,7 @@ function deleteConceptTool(config) {
|
|
|
4944
5315
|
async function tool2(args) {
|
|
4945
5316
|
const clientConfig = createClientConfig(config);
|
|
4946
5317
|
delete clientConfig.space;
|
|
4947
|
-
const contentfulClient =
|
|
5318
|
+
const contentfulClient = createClient13(clientConfig);
|
|
4948
5319
|
const concept = await contentfulClient.concept.get({
|
|
4949
5320
|
organizationId: args.organizationId,
|
|
4950
5321
|
conceptId: args.conceptId
|
|
@@ -4973,31 +5344,31 @@ function deleteConceptTool(config) {
|
|
|
4973
5344
|
}
|
|
4974
5345
|
|
|
4975
5346
|
// src/tools/taxonomies/concepts/updateConcept.ts
|
|
4976
|
-
import { z as
|
|
4977
|
-
import { createClient as
|
|
4978
|
-
var UpdateConceptToolParams =
|
|
4979
|
-
organizationId:
|
|
4980
|
-
conceptId:
|
|
4981
|
-
version:
|
|
4982
|
-
prefLabel:
|
|
4983
|
-
uri:
|
|
4984
|
-
altLabels:
|
|
4985
|
-
hiddenLabels:
|
|
4986
|
-
definition:
|
|
4987
|
-
editorialNote:
|
|
4988
|
-
historyNote:
|
|
4989
|
-
example:
|
|
4990
|
-
note:
|
|
4991
|
-
scopeNote:
|
|
4992
|
-
notations:
|
|
4993
|
-
broader:
|
|
4994
|
-
related:
|
|
5347
|
+
import { z as z77 } from "zod";
|
|
5348
|
+
import { createClient as createClient14 } from "contentful-management";
|
|
5349
|
+
var UpdateConceptToolParams = z77.object({
|
|
5350
|
+
organizationId: z77.string().describe("The ID of the Contentful organization"),
|
|
5351
|
+
conceptId: z77.string().describe("The ID of the concept to update"),
|
|
5352
|
+
version: z77.number().describe("The current version of the concept"),
|
|
5353
|
+
prefLabel: z77.record(z77.string()).optional().describe("The preferred label for the concept (localized)"),
|
|
5354
|
+
uri: z77.string().nullable().optional().describe("The URI for the concept"),
|
|
5355
|
+
altLabels: z77.record(z77.array(z77.string())).optional().describe("Alternative labels for the concept (localized)"),
|
|
5356
|
+
hiddenLabels: z77.record(z77.array(z77.string())).optional().describe("Hidden labels for the concept (localized)"),
|
|
5357
|
+
definition: z77.record(z77.string().nullable()).optional().describe("Definition of the concept (localized)"),
|
|
5358
|
+
editorialNote: z77.record(z77.string().nullable()).optional().describe("Editorial note for the concept (localized)"),
|
|
5359
|
+
historyNote: z77.record(z77.string().nullable()).optional().describe("History note for the concept (localized)"),
|
|
5360
|
+
example: z77.record(z77.string().nullable()).optional().describe("Example for the concept (localized)"),
|
|
5361
|
+
note: z77.record(z77.string().nullable()).optional().describe("General note for the concept (localized)"),
|
|
5362
|
+
scopeNote: z77.record(z77.string().nullable()).optional().describe("Scope note for the concept (localized)"),
|
|
5363
|
+
notations: z77.array(z77.string()).optional().describe("Notations for the concept"),
|
|
5364
|
+
broader: z77.array(TaxonomyConceptLinkSchema).optional().describe("Links to broader concepts"),
|
|
5365
|
+
related: z77.array(TaxonomyConceptLinkSchema).optional().describe("Links to related concepts")
|
|
4995
5366
|
});
|
|
4996
5367
|
function updateConceptTool(config) {
|
|
4997
5368
|
async function tool2(args) {
|
|
4998
5369
|
const clientConfig = createClientConfig(config);
|
|
4999
5370
|
delete clientConfig.space;
|
|
5000
|
-
const contentfulClient =
|
|
5371
|
+
const contentfulClient = createClient14(clientConfig);
|
|
5001
5372
|
const existingConcept = await contentfulClient.concept.get({
|
|
5002
5373
|
organizationId: args.organizationId,
|
|
5003
5374
|
conceptId: args.conceptId
|
|
@@ -5033,17 +5404,17 @@ function updateConceptTool(config) {
|
|
|
5033
5404
|
}
|
|
5034
5405
|
|
|
5035
5406
|
// src/tools/taxonomies/concepts/getConcept.ts
|
|
5036
|
-
import { z as
|
|
5037
|
-
import { createClient as
|
|
5038
|
-
var GetConceptToolParams =
|
|
5039
|
-
organizationId:
|
|
5040
|
-
conceptId:
|
|
5407
|
+
import { z as z78 } from "zod";
|
|
5408
|
+
import { createClient as createClient15 } from "contentful-management";
|
|
5409
|
+
var GetConceptToolParams = z78.object({
|
|
5410
|
+
organizationId: z78.string().describe("The ID of the Contentful organization"),
|
|
5411
|
+
conceptId: z78.string().describe("The ID of the concept to retrieve")
|
|
5041
5412
|
});
|
|
5042
5413
|
function getConceptTool(config) {
|
|
5043
5414
|
async function tool2(args) {
|
|
5044
5415
|
const clientConfig = createClientConfig(config);
|
|
5045
5416
|
delete clientConfig.space;
|
|
5046
|
-
const contentfulClient =
|
|
5417
|
+
const contentfulClient = createClient15(clientConfig);
|
|
5047
5418
|
const concept = await contentfulClient.concept.get({
|
|
5048
5419
|
organizationId: args.organizationId,
|
|
5049
5420
|
conceptId: args.conceptId
|
|
@@ -5054,24 +5425,24 @@ function getConceptTool(config) {
|
|
|
5054
5425
|
}
|
|
5055
5426
|
|
|
5056
5427
|
// src/tools/taxonomies/concepts/listConcepts.ts
|
|
5057
|
-
import { z as
|
|
5058
|
-
import { createClient as
|
|
5059
|
-
var ListConceptsToolParams =
|
|
5060
|
-
organizationId:
|
|
5061
|
-
conceptId:
|
|
5062
|
-
limit:
|
|
5063
|
-
select:
|
|
5064
|
-
include:
|
|
5065
|
-
order:
|
|
5066
|
-
getDescendants:
|
|
5067
|
-
getAncestors:
|
|
5068
|
-
getTotalOnly:
|
|
5428
|
+
import { z as z79 } from "zod";
|
|
5429
|
+
import { createClient as createClient16 } from "contentful-management";
|
|
5430
|
+
var ListConceptsToolParams = z79.object({
|
|
5431
|
+
organizationId: z79.string().describe("The ID of the Contentful organization"),
|
|
5432
|
+
conceptId: z79.string().optional().describe("The ID of the concept (required for descendants/ancestors)"),
|
|
5433
|
+
limit: z79.number().optional().describe("Maximum number of concepts to return"),
|
|
5434
|
+
select: z79.string().optional().describe("Comma-separated list of fields to return"),
|
|
5435
|
+
include: z79.number().optional().describe("Include this many levels of linked entries"),
|
|
5436
|
+
order: z79.string().optional().describe("Order concepts by this field"),
|
|
5437
|
+
getDescendants: z79.boolean().optional().describe("Get descendants of the specified concept (requires conceptId)"),
|
|
5438
|
+
getAncestors: z79.boolean().optional().describe("Get ancestors of the specified concept (requires conceptId)"),
|
|
5439
|
+
getTotalOnly: z79.boolean().optional().describe("Get only the total number of concepts without full data")
|
|
5069
5440
|
});
|
|
5070
5441
|
function listConceptsTool(config) {
|
|
5071
5442
|
async function tool2(args) {
|
|
5072
5443
|
const clientConfig = createClientConfig(config);
|
|
5073
5444
|
delete clientConfig.space;
|
|
5074
|
-
const contentfulClient =
|
|
5445
|
+
const contentfulClient = createClient16(clientConfig);
|
|
5075
5446
|
if ((args.getDescendants || args.getAncestors) && !args.conceptId) {
|
|
5076
5447
|
throw new Error(
|
|
5077
5448
|
"conceptId is required when getting descendants or ancestors"
|
|
@@ -5243,8 +5614,8 @@ function createTaxonomyTools(config) {
|
|
|
5243
5614
|
}
|
|
5244
5615
|
|
|
5245
5616
|
// src/tools/usage/getUsages.ts
|
|
5246
|
-
import { z as
|
|
5247
|
-
import { createClient as
|
|
5617
|
+
import { z as z80 } from "zod";
|
|
5618
|
+
import { createClient as createClient17 } from "contentful-management";
|
|
5248
5619
|
var AGGREGATED_USAGE_METRIC_KEYS = [
|
|
5249
5620
|
"api_call_cma",
|
|
5250
5621
|
"api_call_cpa",
|
|
@@ -5256,35 +5627,35 @@ var AGGREGATED_USAGE_METRIC_KEYS = [
|
|
|
5256
5627
|
"ai_action_word_count",
|
|
5257
5628
|
"ai_consumption_unit"
|
|
5258
5629
|
];
|
|
5259
|
-
var FilterValueSchema =
|
|
5260
|
-
|
|
5261
|
-
|
|
5630
|
+
var FilterValueSchema = z80.union([
|
|
5631
|
+
z80.string().min(1),
|
|
5632
|
+
z80.array(z80.string().min(1)).min(1).max(10)
|
|
5262
5633
|
]);
|
|
5263
|
-
var GetUsagesToolParams =
|
|
5264
|
-
organizationId:
|
|
5634
|
+
var GetUsagesToolParams = z80.object({
|
|
5635
|
+
organizationId: z80.string().optional().describe(
|
|
5265
5636
|
"Organization ID. If omitted, falls back to the ORGANIZATION_ID configured on the server."
|
|
5266
5637
|
),
|
|
5267
|
-
metricKey:
|
|
5638
|
+
metricKey: z80.enum(AGGREGATED_USAGE_METRIC_KEYS).describe(
|
|
5268
5639
|
'Metric to aggregate. Availability depends on the products enabled for the organization. Allowed dimensions per metric (used by "group", "filter", and "order", all in the form sys.dimensions.<name>.sys.<suffix>): api_call_cma / api_call_cpa / api_call_cda / api_call_graphql \u2192 sys.dimensions.space.sys.id. asset_bandwidth \u2192 sys.dimensions.space.sys.id, sys.dimensions.asset.sys.id. functions_invocations \u2192 sys.dimensions.space.sys.id, sys.dimensions.app.sys.id, sys.dimensions.function.sys.id. ai_action_invocation / ai_action_word_count / ai_consumption_unit \u2192 sys.dimensions.space.sys.id, sys.dimensions.ai_action.sys.id, sys.dimensions.model.sys.provider, sys.dimensions.model.sys.id.'
|
|
5269
5640
|
),
|
|
5270
|
-
dateGte:
|
|
5641
|
+
dateGte: z80.string().describe(
|
|
5271
5642
|
"Start date (inclusive) in ISO-8601 format (YYYY-MM-DD or full date-time). Sent as query param date[gte]. Max lookback: 12 months from now."
|
|
5272
5643
|
),
|
|
5273
|
-
dateLte:
|
|
5644
|
+
dateLte: z80.string().describe(
|
|
5274
5645
|
"End date (inclusive) in ISO-8601 format (YYYY-MM-DD or full date-time). Sent as query param date[lte]."
|
|
5275
5646
|
),
|
|
5276
|
-
granularity:
|
|
5647
|
+
granularity: z80.enum(["P1D", "P1M"]).optional().describe(
|
|
5277
5648
|
'Bucket size as an ISO-8601 duration: "P1D" (daily, max 31-day range) or "P1M" (monthly, max 12 calendar months including current). Default P1D.'
|
|
5278
5649
|
),
|
|
5279
|
-
group:
|
|
5650
|
+
group: z80.string().optional().describe(
|
|
5280
5651
|
'Comma-separated dimension keys (in the form sys.dimensions.<name>.sys.<suffix>) to group results by. Values must come from the allowed dimensions for the chosen metricKey (see metricKey description), e.g. "sys.dimensions.space.sys.id" or "sys.dimensions.space.sys.id,sys.dimensions.function.sys.id".'
|
|
5281
5652
|
),
|
|
5282
|
-
filter:
|
|
5653
|
+
filter: z80.record(z80.string(), FilterValueSchema).optional().describe(
|
|
5283
5654
|
'Filter by dimension values. Keys use the shape "sys.dimensions.<dimension>.sys.<attribute>", for example "sys.dimensions.space.sys.id" for the space_id dimension. Pass a string for a single-value filter or an array of up to 10 strings to filter by multiple values (uses the [in] operator). Available dimensions per metric are listed in the metricKey description.'
|
|
5284
5655
|
),
|
|
5285
|
-
limit:
|
|
5286
|
-
skip:
|
|
5287
|
-
order:
|
|
5656
|
+
limit: z80.number().int().positive().max(1e3).optional().describe("Maximum number of items to return (1\u20131000, default 1000)."),
|
|
5657
|
+
skip: z80.number().int().min(0).max(1e4).optional().describe("Number of items to skip for pagination (0\u201310000, default 0)."),
|
|
5658
|
+
order: z80.string().optional().describe(
|
|
5288
5659
|
'Column to sort by, in the form sys.dimensions.<name>.sys.<suffix>; prefix with "-" for descending (e.g. "-sys.dimensions.space.sys.id"). Allowed dimension columns match the metricKey (see metricKey description). The synthetic column "total_usage" is a bare token (e.g. "total_usage" or "-total_usage") and sums usage per group across the requested date range. When "group" is set, non-synthetic order columns must be a subset of grouped columns. Legacy underscore-form tokens (e.g. "space_id") return a 422.'
|
|
5289
5660
|
)
|
|
5290
5661
|
});
|
|
@@ -5316,7 +5687,7 @@ function getUsagesTool(config) {
|
|
|
5316
5687
|
"organizationId is required (either as a tool argument or via the ORGANIZATION_ID env var)."
|
|
5317
5688
|
);
|
|
5318
5689
|
}
|
|
5319
|
-
const client =
|
|
5690
|
+
const client = createClient17(createClientConfig(config), { type: "plain" });
|
|
5320
5691
|
const metricKey = args.metricKey;
|
|
5321
5692
|
const collection = await client.raw.get(
|
|
5322
5693
|
`/organizations/${organizationId}/usages/${metricKey}`,
|
|
@@ -5357,54 +5728,54 @@ function createUsageTools(config) {
|
|
|
5357
5728
|
}
|
|
5358
5729
|
|
|
5359
5730
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5360
|
-
import { z as
|
|
5731
|
+
import { z as z82 } from "zod";
|
|
5361
5732
|
|
|
5362
5733
|
// src/types/querySchema.ts
|
|
5363
|
-
import { z as
|
|
5364
|
-
var EntryQuerySchema =
|
|
5365
|
-
content_type:
|
|
5366
|
-
include:
|
|
5367
|
-
select:
|
|
5368
|
-
links_to_entry:
|
|
5369
|
-
limit:
|
|
5370
|
-
skip:
|
|
5371
|
-
order:
|
|
5372
|
-
});
|
|
5373
|
-
var AssetQuerySchema =
|
|
5374
|
-
mimetype_group:
|
|
5375
|
-
select:
|
|
5376
|
-
limit:
|
|
5377
|
-
skip:
|
|
5378
|
-
order:
|
|
5734
|
+
import { z as z81 } from "zod";
|
|
5735
|
+
var EntryQuerySchema = z81.object({
|
|
5736
|
+
content_type: z81.string().optional().describe("Filter by content type"),
|
|
5737
|
+
include: z81.number().optional().describe("Include this many levels of linked entries"),
|
|
5738
|
+
select: z81.string().optional().describe("Comma-separated list of fields to return"),
|
|
5739
|
+
links_to_entry: z81.string().optional().describe("Find entries that link to the specified entry ID"),
|
|
5740
|
+
limit: z81.number().optional().describe("Maximum number of entries to return"),
|
|
5741
|
+
skip: z81.number().optional().describe("Skip this many entries"),
|
|
5742
|
+
order: z81.string().optional().describe("Order entries by this field")
|
|
5743
|
+
});
|
|
5744
|
+
var AssetQuerySchema = z81.object({
|
|
5745
|
+
mimetype_group: z81.string().optional().describe("Filter by MIME type group"),
|
|
5746
|
+
select: z81.string().optional().describe("Comma-separated list of fields to return"),
|
|
5747
|
+
limit: z81.number().optional().describe("Maximum number of assets to return"),
|
|
5748
|
+
skip: z81.number().optional().describe("Skip this many assets"),
|
|
5749
|
+
order: z81.string().optional().describe("Order assets by this field")
|
|
5379
5750
|
});
|
|
5380
5751
|
|
|
5381
5752
|
// src/tools/jobs/space-to-space-migration/exportSpace.ts
|
|
5382
5753
|
var ExportSpaceToolParams = BaseToolSchema.extend({
|
|
5383
|
-
exportDir:
|
|
5754
|
+
exportDir: z82.string().optional().describe(
|
|
5384
5755
|
"Directory to save the exported space data (optional, defaults to current directory)"
|
|
5385
5756
|
),
|
|
5386
|
-
saveFile:
|
|
5387
|
-
contentFile:
|
|
5388
|
-
includeDrafts:
|
|
5389
|
-
includeArchived:
|
|
5390
|
-
skipContentModel:
|
|
5391
|
-
skipEditorInterfaces:
|
|
5392
|
-
skipContent:
|
|
5393
|
-
skipRoles:
|
|
5394
|
-
skipTags:
|
|
5395
|
-
skipWebhooks:
|
|
5396
|
-
stripTags:
|
|
5397
|
-
contentOnly:
|
|
5757
|
+
saveFile: z82.boolean().optional().default(true).describe("Save the exported space data to a file"),
|
|
5758
|
+
contentFile: z82.string().optional().describe("Custom filename for the exported space data (optional)"),
|
|
5759
|
+
includeDrafts: z82.boolean().optional().default(false).describe("Include draft entries in the export"),
|
|
5760
|
+
includeArchived: z82.boolean().optional().default(false).describe("Include archived entries in the export"),
|
|
5761
|
+
skipContentModel: z82.boolean().optional().default(false).describe("Skip exporting content types"),
|
|
5762
|
+
skipEditorInterfaces: z82.boolean().optional().default(false).describe("Skip exporting editor interfaces"),
|
|
5763
|
+
skipContent: z82.boolean().optional().default(false).describe("Skip exporting entries and assets"),
|
|
5764
|
+
skipRoles: z82.boolean().optional().default(false).describe("Skip exporting roles and permissions"),
|
|
5765
|
+
skipTags: z82.boolean().optional().default(false).describe("Skip exporting tags"),
|
|
5766
|
+
skipWebhooks: z82.boolean().optional().default(false).describe("Skip exporting webhooks"),
|
|
5767
|
+
stripTags: z82.boolean().optional().default(false).describe("Untag assets and entries"),
|
|
5768
|
+
contentOnly: z82.boolean().optional().default(false).describe("Only export assets and entries"),
|
|
5398
5769
|
queryEntries: EntryQuerySchema.optional().describe(
|
|
5399
5770
|
"Export only entries that match query parameters"
|
|
5400
5771
|
),
|
|
5401
5772
|
queryAssets: AssetQuerySchema.optional().describe(
|
|
5402
5773
|
"Export only assets that match query parameters"
|
|
5403
5774
|
),
|
|
5404
|
-
downloadAssets:
|
|
5405
|
-
maxAllowedLimit:
|
|
5406
|
-
errorLogFile:
|
|
5407
|
-
useVerboseRenderer:
|
|
5775
|
+
downloadAssets: z82.boolean().optional().default(false).describe("Download actual asset files"),
|
|
5776
|
+
maxAllowedLimit: z82.number().optional().default(1e3).describe("Maximum number of items per request"),
|
|
5777
|
+
errorLogFile: z82.string().optional().describe("Path to error log output file"),
|
|
5778
|
+
useVerboseRenderer: z82.boolean().optional().describe("Line-by-line logging, useful for CI")
|
|
5408
5779
|
});
|
|
5409
5780
|
function createExportSpaceTool(config) {
|
|
5410
5781
|
async function tool2(args) {
|
|
@@ -5445,79 +5816,77 @@ function createExportSpaceTool(config) {
|
|
|
5445
5816
|
editorInterfaces: result.editorInterfaces?.length || 0
|
|
5446
5817
|
});
|
|
5447
5818
|
} catch (error) {
|
|
5448
|
-
throw new Error(
|
|
5449
|
-
`Failed to export space: ${error instanceof Error ? error.message : String(error)}`
|
|
5450
|
-
);
|
|
5819
|
+
throw new Error(`Failed to export space: ${formatErrorMessage(error)}`);
|
|
5451
5820
|
}
|
|
5452
5821
|
}
|
|
5453
5822
|
return withErrorHandling(tool2, "Error exporting space");
|
|
5454
5823
|
}
|
|
5455
5824
|
|
|
5456
5825
|
// src/tools/jobs/space-to-space-migration/paramCollection.ts
|
|
5457
|
-
import { z as
|
|
5826
|
+
import { z as z83 } from "zod";
|
|
5458
5827
|
var ParamCollectionToolParams = BaseToolSchema.extend({
|
|
5459
|
-
confirmation:
|
|
5828
|
+
confirmation: z83.boolean().optional().describe(
|
|
5460
5829
|
"User confirmation that they are ready to proceed with the workflow"
|
|
5461
5830
|
),
|
|
5462
|
-
export:
|
|
5463
|
-
spaceId:
|
|
5464
|
-
environmentId:
|
|
5465
|
-
deliveryToken:
|
|
5466
|
-
exportDir:
|
|
5467
|
-
saveFile:
|
|
5468
|
-
contentFile:
|
|
5469
|
-
includeDrafts:
|
|
5470
|
-
includeArchived:
|
|
5471
|
-
skipContentModel:
|
|
5472
|
-
skipEditorInterfaces:
|
|
5473
|
-
skipContent:
|
|
5474
|
-
skipRoles:
|
|
5475
|
-
skipTags:
|
|
5476
|
-
skipWebhooks:
|
|
5477
|
-
stripTags:
|
|
5478
|
-
contentOnly:
|
|
5831
|
+
export: z83.object({
|
|
5832
|
+
spaceId: z83.string().optional().describe("ID of the space with source data"),
|
|
5833
|
+
environmentId: z83.string().optional().describe("ID of the environment in the source space"),
|
|
5834
|
+
deliveryToken: z83.string().optional().describe("CDA token to export only published content (excludes tags)"),
|
|
5835
|
+
exportDir: z83.string().optional().describe("Path to export JSON output"),
|
|
5836
|
+
saveFile: z83.boolean().optional().describe("Save the export as a JSON file"),
|
|
5837
|
+
contentFile: z83.string().optional().describe("Filename for exported data"),
|
|
5838
|
+
includeDrafts: z83.boolean().optional().describe("Include drafts in exported entries"),
|
|
5839
|
+
includeArchived: z83.boolean().optional().describe("Include archived entries"),
|
|
5840
|
+
skipContentModel: z83.boolean().optional().describe("Skip exporting content models"),
|
|
5841
|
+
skipEditorInterfaces: z83.boolean().optional().describe("Skip exporting editor interfaces"),
|
|
5842
|
+
skipContent: z83.boolean().optional().describe("Skip exporting entries and assets"),
|
|
5843
|
+
skipRoles: z83.boolean().optional().describe("Skip exporting roles and permissions"),
|
|
5844
|
+
skipTags: z83.boolean().optional().describe("Skip exporting tags"),
|
|
5845
|
+
skipWebhooks: z83.boolean().optional().describe("Skip exporting webhooks"),
|
|
5846
|
+
stripTags: z83.boolean().optional().describe("Remove tags from entries and assets"),
|
|
5847
|
+
contentOnly: z83.boolean().optional().describe("Export only entries and assets"),
|
|
5479
5848
|
queryEntries: EntryQuerySchema.optional().describe(
|
|
5480
5849
|
"Export only entries that match query parameters"
|
|
5481
5850
|
),
|
|
5482
5851
|
queryAssets: AssetQuerySchema.optional().describe(
|
|
5483
5852
|
"Export only assets that match query parameters"
|
|
5484
5853
|
),
|
|
5485
|
-
downloadAssets:
|
|
5486
|
-
host:
|
|
5487
|
-
hostDelivery:
|
|
5488
|
-
proxy:
|
|
5489
|
-
rawProxy:
|
|
5490
|
-
maxAllowedLimit:
|
|
5491
|
-
headers:
|
|
5492
|
-
errorLogFile:
|
|
5493
|
-
useVerboseRenderer:
|
|
5494
|
-
config:
|
|
5854
|
+
downloadAssets: z83.boolean().optional().describe("Download asset files to disk"),
|
|
5855
|
+
host: z83.string().optional().describe("Management API host"),
|
|
5856
|
+
hostDelivery: z83.string().optional().describe("Delivery API host"),
|
|
5857
|
+
proxy: z83.string().optional().describe("HTTP/HTTPS proxy config"),
|
|
5858
|
+
rawProxy: z83.boolean().optional().describe("Pass raw proxy config directly to Axios"),
|
|
5859
|
+
maxAllowedLimit: z83.number().optional().describe("Page size for requests"),
|
|
5860
|
+
headers: z83.record(z83.any()).optional().describe("Additional headers to include in requests"),
|
|
5861
|
+
errorLogFile: z83.string().optional().describe("Path to error log output file"),
|
|
5862
|
+
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line logging, useful for CI"),
|
|
5863
|
+
config: z83.string().optional().describe("Path to a JSON config file with all options")
|
|
5495
5864
|
}).optional(),
|
|
5496
|
-
import:
|
|
5497
|
-
spaceId:
|
|
5498
|
-
environmentId:
|
|
5499
|
-
contentFile:
|
|
5500
|
-
content:
|
|
5865
|
+
import: z83.object({
|
|
5866
|
+
spaceId: z83.string().optional().describe("ID of the space to import into"),
|
|
5867
|
+
environmentId: z83.string().optional().describe("Target environment in destination space"),
|
|
5868
|
+
contentFile: z83.string().optional().describe("Path to JSON file containing the content to import"),
|
|
5869
|
+
content: z83.record(z83.any()).optional().describe(
|
|
5501
5870
|
"JS object containing import content (must match expected structure)"
|
|
5502
5871
|
),
|
|
5503
|
-
contentModelOnly:
|
|
5504
|
-
skipContentModel:
|
|
5505
|
-
skipLocales:
|
|
5506
|
-
skipContentUpdates:
|
|
5507
|
-
skipContentPublishing:
|
|
5508
|
-
uploadAssets:
|
|
5509
|
-
skipAssetUpdates:
|
|
5510
|
-
assetsDirectory:
|
|
5511
|
-
timeout:
|
|
5512
|
-
retryLimit:
|
|
5513
|
-
host:
|
|
5514
|
-
proxy:
|
|
5515
|
-
rawProxy:
|
|
5516
|
-
rateLimit:
|
|
5517
|
-
headers:
|
|
5518
|
-
errorLogFile:
|
|
5519
|
-
useVerboseRenderer:
|
|
5520
|
-
config:
|
|
5872
|
+
contentModelOnly: z83.boolean().optional().describe("Import only content types"),
|
|
5873
|
+
skipContentModel: z83.boolean().optional().describe("Skip importing content types and locales"),
|
|
5874
|
+
skipLocales: z83.boolean().optional().describe("Skip importing locales"),
|
|
5875
|
+
skipContentUpdates: z83.boolean().optional().describe("Do not update existing content"),
|
|
5876
|
+
skipContentPublishing: z83.boolean().optional().describe("Create but do not publish content"),
|
|
5877
|
+
uploadAssets: z83.boolean().optional().describe("Upload asset files (requires assetsDirectory)"),
|
|
5878
|
+
skipAssetUpdates: z83.boolean().optional().describe("Do not update existing assets"),
|
|
5879
|
+
assetsDirectory: z83.string().optional().describe("Path to directory containing exported asset files"),
|
|
5880
|
+
timeout: z83.number().optional().describe("Time between retries during asset processing (ms)"),
|
|
5881
|
+
retryLimit: z83.number().optional().describe("Max retries for asset processing"),
|
|
5882
|
+
host: z83.string().optional().describe("Management API host"),
|
|
5883
|
+
proxy: z83.string().optional().describe("HTTP/HTTPS proxy string (host:port or user:pass@host:port)"),
|
|
5884
|
+
rawProxy: z83.boolean().optional().describe("Pass proxy config directly to Axios"),
|
|
5885
|
+
rateLimit: z83.number().optional().describe("Max requests per second to the API"),
|
|
5886
|
+
headers: z83.record(z83.any()).optional().describe("Additional headers to attach to requests"),
|
|
5887
|
+
errorLogFile: z83.string().optional().describe("Path to error log file"),
|
|
5888
|
+
useVerboseRenderer: z83.boolean().optional().describe("Line-by-line progress output (good for CI)"),
|
|
5889
|
+
config: z83.string().optional().describe("Path to config JSON file (merged with CLI args)")
|
|
5521
5890
|
}).optional()
|
|
5522
5891
|
});
|
|
5523
5892
|
var paramCollectionConfig = {
|
|
@@ -5633,25 +6002,25 @@ var createParamCollectionTool = withErrorHandling(
|
|
|
5633
6002
|
);
|
|
5634
6003
|
|
|
5635
6004
|
// src/tools/jobs/space-to-space-migration/importSpace.ts
|
|
5636
|
-
import { z as
|
|
6005
|
+
import { z as z84 } from "zod";
|
|
5637
6006
|
var ImportSpaceToolParams = BaseToolSchema.extend({
|
|
5638
|
-
contentFile:
|
|
5639
|
-
content:
|
|
6007
|
+
contentFile: z84.string().optional().describe("Path to JSON file containing the content to import"),
|
|
6008
|
+
content: z84.record(z84.any()).optional().describe(
|
|
5640
6009
|
"JS object containing import content (must match expected structure)"
|
|
5641
6010
|
),
|
|
5642
|
-
contentModelOnly:
|
|
5643
|
-
skipContentModel:
|
|
5644
|
-
skipLocales:
|
|
5645
|
-
skipContentUpdates:
|
|
5646
|
-
skipContentPublishing:
|
|
5647
|
-
uploadAssets:
|
|
5648
|
-
skipAssetUpdates:
|
|
5649
|
-
assetsDirectory:
|
|
5650
|
-
timeout:
|
|
5651
|
-
retryLimit:
|
|
5652
|
-
rateLimit:
|
|
5653
|
-
errorLogFile:
|
|
5654
|
-
useVerboseRenderer:
|
|
6011
|
+
contentModelOnly: z84.boolean().optional().default(false).describe("Import only content types"),
|
|
6012
|
+
skipContentModel: z84.boolean().optional().default(false).describe("Skip importing content types and locales"),
|
|
6013
|
+
skipLocales: z84.boolean().optional().default(false).describe("Skip importing locales"),
|
|
6014
|
+
skipContentUpdates: z84.boolean().optional().default(false).describe("Do not update existing content"),
|
|
6015
|
+
skipContentPublishing: z84.boolean().optional().default(false).describe("Create but do not publish content"),
|
|
6016
|
+
uploadAssets: z84.boolean().optional().default(false).describe("Upload asset files (requires assetsDirectory)"),
|
|
6017
|
+
skipAssetUpdates: z84.boolean().optional().default(false).describe("Do not update existing assets"),
|
|
6018
|
+
assetsDirectory: z84.string().optional().describe("Path to directory containing exported asset files"),
|
|
6019
|
+
timeout: z84.number().optional().default(3e3).describe("Time between retries during asset processing (ms)"),
|
|
6020
|
+
retryLimit: z84.number().optional().default(10).describe("Max retries for asset processing"),
|
|
6021
|
+
rateLimit: z84.number().optional().default(7).describe("Max requests per second to the API"),
|
|
6022
|
+
errorLogFile: z84.string().optional().describe("Path to error log file"),
|
|
6023
|
+
useVerboseRenderer: z84.boolean().optional().describe("Line-by-line progress output (good for CI)")
|
|
5655
6024
|
});
|
|
5656
6025
|
function createImportSpaceTool(config) {
|
|
5657
6026
|
async function tool2(args) {
|
|
@@ -5687,16 +6056,14 @@ function createImportSpaceTool(config) {
|
|
|
5687
6056
|
editorInterfaces: result.editorInterfaces?.length || 0
|
|
5688
6057
|
});
|
|
5689
6058
|
} catch (error) {
|
|
5690
|
-
throw new Error(
|
|
5691
|
-
`Failed to import space: ${error instanceof Error ? error.message : String(error)}`
|
|
5692
|
-
);
|
|
6059
|
+
throw new Error(`Failed to import space: ${formatErrorMessage(error)}`);
|
|
5693
6060
|
}
|
|
5694
6061
|
}
|
|
5695
6062
|
return withErrorHandling(tool2, "Error importing space");
|
|
5696
6063
|
}
|
|
5697
6064
|
|
|
5698
6065
|
// src/tools/jobs/space-to-space-migration/migrationHandler.ts
|
|
5699
|
-
import { z as
|
|
6066
|
+
import { z as z85 } from "zod";
|
|
5700
6067
|
|
|
5701
6068
|
// src/tools/jobs/space-to-space-migration/instructions.ts
|
|
5702
6069
|
var S2S_MIGRATION_INSTRUCTIONS = `
|
|
@@ -5739,7 +6106,7 @@ The space to space migration workflow has been concluded and all related tools h
|
|
|
5739
6106
|
The workflow is now complete. You can start a new migration workflow by calling space_to_space_migration_handler with enableWorkflow=true if needed.
|
|
5740
6107
|
`;
|
|
5741
6108
|
var SpaceToSpaceMigrationHandlerToolParams = BaseToolSchema.extend({
|
|
5742
|
-
enableWorkflow:
|
|
6109
|
+
enableWorkflow: z85.boolean().describe(
|
|
5743
6110
|
"Set to true to enable the workflow tools, false to disable them and conclude the workflow"
|
|
5744
6111
|
)
|
|
5745
6112
|
});
|
|
@@ -5837,9 +6204,9 @@ function createJobTools(config) {
|
|
|
5837
6204
|
}
|
|
5838
6205
|
|
|
5839
6206
|
// src/tools/exo/components/getComponent.ts
|
|
5840
|
-
import { z as
|
|
6207
|
+
import { z as z86 } from "zod";
|
|
5841
6208
|
var GetComponentToolParams = BaseToolSchema.extend({
|
|
5842
|
-
componentId:
|
|
6209
|
+
componentId: z86.string().describe("The ID of the component to retrieve details for")
|
|
5843
6210
|
});
|
|
5844
6211
|
function getComponentTool(config) {
|
|
5845
6212
|
async function tool2(args) {
|
|
@@ -5857,12 +6224,12 @@ function getComponentTool(config) {
|
|
|
5857
6224
|
}
|
|
5858
6225
|
|
|
5859
6226
|
// src/tools/exo/components/listComponents.ts
|
|
5860
|
-
import { z as
|
|
6227
|
+
import { z as z87 } from "zod";
|
|
5861
6228
|
var ListComponentsToolParams = BaseToolSchema.extend({
|
|
5862
|
-
limit:
|
|
5863
|
-
pageNext:
|
|
5864
|
-
pagePrev:
|
|
5865
|
-
order:
|
|
6229
|
+
limit: z87.number().optional().describe("Maximum number of components to return (max 10)"),
|
|
6230
|
+
pageNext: z87.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6231
|
+
pagePrev: z87.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6232
|
+
order: z87.string().optional().describe("Order components by this field (e.g. sys.createdAt)")
|
|
5866
6233
|
});
|
|
5867
6234
|
function listComponentsTool(config) {
|
|
5868
6235
|
async function tool2(args) {
|
|
@@ -5892,10 +6259,10 @@ function listComponentsTool(config) {
|
|
|
5892
6259
|
}
|
|
5893
6260
|
|
|
5894
6261
|
// src/tools/exo/components/createComponent.ts
|
|
5895
|
-
import { z as
|
|
6262
|
+
import { z as z89 } from "zod";
|
|
5896
6263
|
|
|
5897
6264
|
// src/types/exoSchemas.ts
|
|
5898
|
-
import { z as
|
|
6265
|
+
import { z as z88 } from "zod";
|
|
5899
6266
|
var URN_EXAMPLES = {
|
|
5900
6267
|
"Contentful:Component": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/components/{id}",
|
|
5901
6268
|
"Contentful:ExperienceFragment": "crn:contentful:::experience:spaces/{spaceId}/environments/{envId}/experienceFragments/{id}",
|
|
@@ -5905,19 +6272,19 @@ var URN_EXAMPLES = {
|
|
|
5905
6272
|
var resourceLinkSchema2 = (linkType) => {
|
|
5906
6273
|
const example = URN_EXAMPLES[linkType];
|
|
5907
6274
|
const urnDesc = example ? `URN of the linked resource (e.g. "${example}")` : "URN of the linked resource";
|
|
5908
|
-
return
|
|
5909
|
-
sys:
|
|
5910
|
-
type:
|
|
5911
|
-
linkType:
|
|
5912
|
-
urn:
|
|
6275
|
+
return z88.object({
|
|
6276
|
+
sys: z88.object({
|
|
6277
|
+
type: z88.literal("ResourceLink"),
|
|
6278
|
+
linkType: z88.literal(linkType),
|
|
6279
|
+
urn: z88.string().describe(urnDesc)
|
|
5913
6280
|
})
|
|
5914
6281
|
});
|
|
5915
6282
|
};
|
|
5916
|
-
var linkSchema2 = (linkType) =>
|
|
5917
|
-
sys:
|
|
5918
|
-
type:
|
|
5919
|
-
linkType:
|
|
5920
|
-
id:
|
|
6283
|
+
var linkSchema2 = (linkType) => z88.object({
|
|
6284
|
+
sys: z88.object({
|
|
6285
|
+
type: z88.literal("Link"),
|
|
6286
|
+
linkType: z88.literal(linkType),
|
|
6287
|
+
id: z88.string()
|
|
5921
6288
|
})
|
|
5922
6289
|
});
|
|
5923
6290
|
var ComponentResourceLinkSchema = resourceLinkSchema2(
|
|
@@ -5929,71 +6296,71 @@ var ExperienceFragmentResourceLinkSchema = resourceLinkSchema2(
|
|
|
5929
6296
|
var ExperienceTemplateResourceLinkSchema = resourceLinkSchema2(
|
|
5930
6297
|
"Contentful:ExperienceTemplate"
|
|
5931
6298
|
);
|
|
5932
|
-
var ViewportSchema =
|
|
5933
|
-
id:
|
|
5934
|
-
query:
|
|
5935
|
-
displayName:
|
|
5936
|
-
previewSize:
|
|
5937
|
-
});
|
|
5938
|
-
var DataTypeDefinitionSchema =
|
|
5939
|
-
() =>
|
|
5940
|
-
|
|
5941
|
-
type:
|
|
5942
|
-
name:
|
|
5943
|
-
required:
|
|
6299
|
+
var ViewportSchema = z88.object({
|
|
6300
|
+
id: z88.string().describe("Viewport identifier"),
|
|
6301
|
+
query: z88.string().describe("CSS media query string"),
|
|
6302
|
+
displayName: z88.string().describe("Human-readable viewport name"),
|
|
6303
|
+
previewSize: z88.string().describe('Preview size (e.g. "1024px")')
|
|
6304
|
+
});
|
|
6305
|
+
var DataTypeDefinitionSchema = z88.lazy(
|
|
6306
|
+
() => z88.discriminatedUnion("type", [
|
|
6307
|
+
z88.object({
|
|
6308
|
+
type: z88.enum(["String", "Number", "Integer", "Boolean"]),
|
|
6309
|
+
name: z88.string().optional(),
|
|
6310
|
+
required: z88.boolean().optional()
|
|
5944
6311
|
}),
|
|
5945
|
-
|
|
5946
|
-
type:
|
|
5947
|
-
name:
|
|
5948
|
-
required:
|
|
6312
|
+
z88.object({
|
|
6313
|
+
type: z88.literal("RichText"),
|
|
6314
|
+
name: z88.string().optional(),
|
|
6315
|
+
required: z88.boolean().optional()
|
|
5949
6316
|
}),
|
|
5950
|
-
|
|
5951
|
-
type:
|
|
5952
|
-
name:
|
|
5953
|
-
required:
|
|
6317
|
+
z88.object({
|
|
6318
|
+
type: z88.literal("Array"),
|
|
6319
|
+
name: z88.string().optional(),
|
|
6320
|
+
required: z88.boolean().optional(),
|
|
5954
6321
|
items: DataTypeDefinitionSchema
|
|
5955
6322
|
}),
|
|
5956
|
-
|
|
5957
|
-
type:
|
|
5958
|
-
name:
|
|
5959
|
-
required:
|
|
5960
|
-
fields:
|
|
6323
|
+
z88.object({
|
|
6324
|
+
type: z88.literal("Record"),
|
|
6325
|
+
name: z88.string().optional(),
|
|
6326
|
+
required: z88.boolean().optional(),
|
|
6327
|
+
fields: z88.record(z88.string(), DataTypeDefinitionSchema)
|
|
5961
6328
|
}),
|
|
5962
|
-
|
|
5963
|
-
type:
|
|
5964
|
-
name:
|
|
5965
|
-
required:
|
|
5966
|
-
ref:
|
|
5967
|
-
sys:
|
|
5968
|
-
type:
|
|
5969
|
-
linkType:
|
|
5970
|
-
urn:
|
|
6329
|
+
z88.object({
|
|
6330
|
+
type: z88.literal("TypeRef"),
|
|
6331
|
+
name: z88.string().optional(),
|
|
6332
|
+
required: z88.boolean().optional(),
|
|
6333
|
+
ref: z88.object({
|
|
6334
|
+
sys: z88.object({
|
|
6335
|
+
type: z88.literal("ResourceLink"),
|
|
6336
|
+
linkType: z88.string(),
|
|
6337
|
+
urn: z88.string()
|
|
5971
6338
|
})
|
|
5972
6339
|
})
|
|
5973
6340
|
}),
|
|
5974
|
-
|
|
5975
|
-
type:
|
|
5976
|
-
name:
|
|
5977
|
-
required:
|
|
5978
|
-
value:
|
|
6341
|
+
z88.object({
|
|
6342
|
+
type: z88.literal("Literal"),
|
|
6343
|
+
name: z88.string().optional(),
|
|
6344
|
+
required: z88.boolean().optional(),
|
|
6345
|
+
value: z88.custom().describe("JSON literal value"),
|
|
5979
6346
|
valueType: DataTypeDefinitionSchema
|
|
5980
6347
|
}),
|
|
5981
|
-
|
|
5982
|
-
type:
|
|
5983
|
-
name:
|
|
5984
|
-
required:
|
|
5985
|
-
discriminator:
|
|
5986
|
-
members:
|
|
6348
|
+
z88.object({
|
|
6349
|
+
type: z88.literal("DiscriminatedUnion"),
|
|
6350
|
+
name: z88.string().optional(),
|
|
6351
|
+
required: z88.boolean().optional(),
|
|
6352
|
+
discriminator: z88.string(),
|
|
6353
|
+
members: z88.array(DataTypeDefinitionSchema)
|
|
5987
6354
|
})
|
|
5988
6355
|
])
|
|
5989
6356
|
);
|
|
5990
|
-
var ContentPropertySchema =
|
|
6357
|
+
var ContentPropertySchema = z88.intersection(
|
|
5991
6358
|
DataTypeDefinitionSchema,
|
|
5992
|
-
|
|
5993
|
-
id:
|
|
5994
|
-
name:
|
|
5995
|
-
required:
|
|
5996
|
-
defaultValue:
|
|
6359
|
+
z88.object({
|
|
6360
|
+
id: z88.string().describe("Content property identifier"),
|
|
6361
|
+
name: z88.string().describe("Human-readable name"),
|
|
6362
|
+
required: z88.boolean().describe("Whether the property is required"),
|
|
6363
|
+
defaultValue: z88.unknown().optional().describe("Default value")
|
|
5997
6364
|
})
|
|
5998
6365
|
);
|
|
5999
6366
|
var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
@@ -6011,186 +6378,186 @@ var DTCG_DESIGN_PROPERTY_TYPES = [
|
|
|
6011
6378
|
"DTCG.Gradient",
|
|
6012
6379
|
"DTCG.Typography"
|
|
6013
6380
|
];
|
|
6014
|
-
var DesignPropertyCommonFieldsSchema =
|
|
6015
|
-
id:
|
|
6016
|
-
name:
|
|
6017
|
-
description:
|
|
6381
|
+
var DesignPropertyCommonFieldsSchema = z88.object({
|
|
6382
|
+
id: z88.string().describe("Design property identifier"),
|
|
6383
|
+
name: z88.string().describe("Human-readable name"),
|
|
6384
|
+
description: z88.string().optional().describe("Optional description")
|
|
6018
6385
|
});
|
|
6019
6386
|
var StringDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6020
|
-
type:
|
|
6021
|
-
fallbackValue:
|
|
6022
|
-
type:
|
|
6023
|
-
value:
|
|
6387
|
+
type: z88.literal("String"),
|
|
6388
|
+
fallbackValue: z88.object({
|
|
6389
|
+
type: z88.literal("ManualDesignValue"),
|
|
6390
|
+
value: z88.string()
|
|
6024
6391
|
}).optional().describe("Manual fallback value for this design property"),
|
|
6025
|
-
validations:
|
|
6026
|
-
|
|
6027
|
-
regexp:
|
|
6028
|
-
pattern:
|
|
6392
|
+
validations: z88.array(
|
|
6393
|
+
z88.object({
|
|
6394
|
+
regexp: z88.object({
|
|
6395
|
+
pattern: z88.string().describe("Regular expression pattern")
|
|
6029
6396
|
})
|
|
6030
6397
|
})
|
|
6031
6398
|
).optional().describe("Regexp validations constraining allowed string values")
|
|
6032
6399
|
});
|
|
6033
6400
|
var BooleanDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend({
|
|
6034
|
-
type:
|
|
6035
|
-
fallbackValue:
|
|
6036
|
-
type:
|
|
6037
|
-
value:
|
|
6401
|
+
type: z88.literal("Boolean"),
|
|
6402
|
+
fallbackValue: z88.object({
|
|
6403
|
+
type: z88.literal("ManualDesignValue"),
|
|
6404
|
+
value: z88.boolean()
|
|
6038
6405
|
}).optional().describe("Manual fallback value for this design property")
|
|
6039
6406
|
});
|
|
6040
|
-
var DesignTokenValueSchema =
|
|
6041
|
-
type:
|
|
6042
|
-
value:
|
|
6407
|
+
var DesignTokenValueSchema = z88.object({
|
|
6408
|
+
type: z88.literal("DesignToken"),
|
|
6409
|
+
value: z88.string().min(1).describe("Design token reference (non-empty)")
|
|
6043
6410
|
});
|
|
6044
6411
|
var TokenBackedDesignPropertySchema = DesignPropertyCommonFieldsSchema.extend(
|
|
6045
6412
|
{
|
|
6046
|
-
type:
|
|
6413
|
+
type: z88.enum(DTCG_DESIGN_PROPERTY_TYPES),
|
|
6047
6414
|
fallbackValue: DesignTokenValueSchema.optional().describe(
|
|
6048
6415
|
"Design-token-backed fallback value for this design property"
|
|
6049
6416
|
),
|
|
6050
|
-
allowedResources:
|
|
6051
|
-
|
|
6052
|
-
type:
|
|
6053
|
-
value:
|
|
6054
|
-
name:
|
|
6417
|
+
allowedResources: z88.array(
|
|
6418
|
+
z88.object({
|
|
6419
|
+
type: z88.literal("DesignToken"),
|
|
6420
|
+
value: z88.string(),
|
|
6421
|
+
name: z88.string().optional()
|
|
6055
6422
|
})
|
|
6056
6423
|
).optional().describe("Allowed design token resources")
|
|
6057
6424
|
}
|
|
6058
6425
|
);
|
|
6059
|
-
var DesignPropertySchema =
|
|
6426
|
+
var DesignPropertySchema = z88.union([
|
|
6060
6427
|
StringDesignPropertySchema,
|
|
6061
6428
|
BooleanDesignPropertySchema,
|
|
6062
6429
|
TokenBackedDesignPropertySchema
|
|
6063
6430
|
]);
|
|
6064
|
-
var ManualDesignValueSchema =
|
|
6065
|
-
type:
|
|
6066
|
-
value:
|
|
6431
|
+
var ManualDesignValueSchema = z88.object({
|
|
6432
|
+
type: z88.literal("ManualDesignValue"),
|
|
6433
|
+
value: z88.union([z88.string(), z88.number(), z88.boolean()])
|
|
6067
6434
|
});
|
|
6068
|
-
var DesignPropertyValueSchema =
|
|
6435
|
+
var DesignPropertyValueSchema = z88.union([
|
|
6069
6436
|
ManualDesignValueSchema,
|
|
6070
6437
|
DesignTokenValueSchema
|
|
6071
6438
|
]);
|
|
6072
|
-
var DesignPropertyPointerValueSchema =
|
|
6439
|
+
var DesignPropertyPointerValueSchema = z88.custom(
|
|
6073
6440
|
(val) => typeof val === "string" && /^\$designProperties\//.test(val),
|
|
6074
6441
|
{ message: 'Must be a "$designProperties/..." pointer' }
|
|
6075
6442
|
);
|
|
6076
|
-
var DimensionedDesignPropertyValueSchema =
|
|
6077
|
-
|
|
6443
|
+
var DimensionedDesignPropertyValueSchema = z88.record(
|
|
6444
|
+
z88.string(),
|
|
6078
6445
|
DesignPropertyValueSchema
|
|
6079
6446
|
);
|
|
6080
|
-
var ComponentTreeDesignPropertyValueSchema =
|
|
6447
|
+
var ComponentTreeDesignPropertyValueSchema = z88.union([
|
|
6081
6448
|
DesignPropertyValueSchema,
|
|
6082
6449
|
DesignPropertyPointerValueSchema,
|
|
6083
6450
|
DimensionedDesignPropertyValueSchema
|
|
6084
6451
|
]);
|
|
6085
6452
|
var COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE = "crn:contentful:::experience:spaces/$self/environments/$self";
|
|
6086
|
-
var SlotDefinitionSchema =
|
|
6087
|
-
id:
|
|
6088
|
-
name:
|
|
6089
|
-
required:
|
|
6090
|
-
validations:
|
|
6091
|
-
|
|
6092
|
-
size:
|
|
6093
|
-
min:
|
|
6094
|
-
max:
|
|
6453
|
+
var SlotDefinitionSchema = z88.object({
|
|
6454
|
+
id: z88.string().describe("Slot identifier"),
|
|
6455
|
+
name: z88.string().describe("Human-readable name"),
|
|
6456
|
+
required: z88.boolean().describe("Whether the slot must be filled"),
|
|
6457
|
+
validations: z88.array(
|
|
6458
|
+
z88.object({
|
|
6459
|
+
size: z88.object({
|
|
6460
|
+
min: z88.number().optional(),
|
|
6461
|
+
max: z88.number().optional()
|
|
6095
6462
|
}).optional()
|
|
6096
6463
|
})
|
|
6097
6464
|
).describe("Slot cardinality validations"),
|
|
6098
|
-
allowedResources:
|
|
6099
|
-
|
|
6100
|
-
type:
|
|
6101
|
-
source:
|
|
6102
|
-
allowedTypes:
|
|
6465
|
+
allowedResources: z88.array(
|
|
6466
|
+
z88.object({
|
|
6467
|
+
type: z88.literal("Contentful:Component"),
|
|
6468
|
+
source: z88.literal(COMPONENT_TYPE_ALLOWED_RESOURCE_SOURCE),
|
|
6469
|
+
allowedTypes: z88.array(z88.string()).describe("IDs of components allowed in this slot")
|
|
6103
6470
|
})
|
|
6104
6471
|
).optional().describe("Constrains which components may be placed in this slot")
|
|
6105
6472
|
});
|
|
6106
|
-
var ExperienceFragmentNodeSchema =
|
|
6107
|
-
id:
|
|
6108
|
-
name:
|
|
6109
|
-
nodeType:
|
|
6473
|
+
var ExperienceFragmentNodeSchema = z88.object({
|
|
6474
|
+
id: z88.string().describe("Node identifier"),
|
|
6475
|
+
name: z88.string().optional().describe("Optional display name"),
|
|
6476
|
+
nodeType: z88.literal("ExperienceFragment").describe('Must be "ExperienceFragment"'),
|
|
6110
6477
|
experienceFragment: ExperienceFragmentResourceLinkSchema.describe(
|
|
6111
6478
|
"Resource link to the referenced experience fragment"
|
|
6112
6479
|
)
|
|
6113
6480
|
});
|
|
6114
|
-
var SlotNodeSchema =
|
|
6115
|
-
id:
|
|
6116
|
-
nodeType:
|
|
6117
|
-
slotId:
|
|
6481
|
+
var SlotNodeSchema = z88.object({
|
|
6482
|
+
id: z88.string().describe("Node identifier"),
|
|
6483
|
+
nodeType: z88.literal("Slot").describe('Must be "Slot"'),
|
|
6484
|
+
slotId: z88.string().describe("ID of the slot definition to render")
|
|
6118
6485
|
});
|
|
6119
|
-
var TreeNodeSchema =
|
|
6120
|
-
() =>
|
|
6486
|
+
var TreeNodeSchema = z88.lazy(
|
|
6487
|
+
() => z88.union([ComponentNodeSchema, ExperienceFragmentNodeSchema, SlotNodeSchema])
|
|
6121
6488
|
);
|
|
6122
|
-
var ComponentNodeSchema =
|
|
6123
|
-
() =>
|
|
6124
|
-
id:
|
|
6125
|
-
name:
|
|
6126
|
-
nodeType:
|
|
6489
|
+
var ComponentNodeSchema = z88.lazy(
|
|
6490
|
+
() => z88.object({
|
|
6491
|
+
id: z88.string().describe("Node identifier"),
|
|
6492
|
+
name: z88.string().optional().describe("Optional display name"),
|
|
6493
|
+
nodeType: z88.literal("Component").describe('Must be "Component"'),
|
|
6127
6494
|
component: ComponentResourceLinkSchema.describe(
|
|
6128
6495
|
"Resource link to the component to render"
|
|
6129
6496
|
),
|
|
6130
|
-
contentProperties:
|
|
6131
|
-
|
|
6132
|
-
|
|
6497
|
+
contentProperties: z88.union([
|
|
6498
|
+
z88.record(z88.string(), z88.unknown()),
|
|
6499
|
+
z88.string().describe('"$contentProperties/..." pointer')
|
|
6133
6500
|
]).describe(
|
|
6134
6501
|
'Content property bindings \u2014 values or "$contentProperties/..." pointers'
|
|
6135
6502
|
),
|
|
6136
|
-
designProperties:
|
|
6503
|
+
designProperties: z88.record(z88.string(), ComponentTreeDesignPropertyValueSchema).describe(
|
|
6137
6504
|
'Design property values \u2014 ManualDesignValue, DesignTokenValue, or "$designProperties/..." pointers'
|
|
6138
6505
|
),
|
|
6139
|
-
slots:
|
|
6506
|
+
slots: z88.record(z88.string(), z88.array(TreeNodeSchema)).describe("Child tree nodes keyed by slot ID")
|
|
6140
6507
|
})
|
|
6141
6508
|
);
|
|
6142
6509
|
var TagLinkSchema = linkSchema2("Tag");
|
|
6143
6510
|
var ConceptLinkSchema = linkSchema2("TaxonomyConcept");
|
|
6144
|
-
var ExoMetadataSchema =
|
|
6145
|
-
tags:
|
|
6146
|
-
concepts:
|
|
6511
|
+
var ExoMetadataSchema = z88.object({
|
|
6512
|
+
tags: z88.array(TagLinkSchema).optional().describe("Tags attached to this entity"),
|
|
6513
|
+
concepts: z88.array(ConceptLinkSchema).optional().describe("Taxonomy concepts attached to this entity")
|
|
6147
6514
|
});
|
|
6148
6515
|
var ExperienceMetadataSchema = ExoMetadataSchema.extend({
|
|
6149
|
-
name:
|
|
6516
|
+
name: z88.string().optional().describe("Variant label for this metadata entry")
|
|
6150
6517
|
});
|
|
6151
6518
|
var DataAssemblyResourceLinkSchema = resourceLinkSchema2(
|
|
6152
6519
|
"Contentful:DataAssembly"
|
|
6153
6520
|
);
|
|
6154
|
-
var ExperienceContentBindingsSchema =
|
|
6521
|
+
var ExperienceContentBindingsSchema = z88.object({
|
|
6155
6522
|
sys: DataAssemblyResourceLinkSchema.shape.sys,
|
|
6156
|
-
parameters:
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
sys:
|
|
6160
|
-
type:
|
|
6161
|
-
linkType:
|
|
6162
|
-
urn:
|
|
6523
|
+
parameters: z88.record(
|
|
6524
|
+
z88.string(),
|
|
6525
|
+
z88.object({
|
|
6526
|
+
sys: z88.object({
|
|
6527
|
+
type: z88.literal("ResourceLink"),
|
|
6528
|
+
linkType: z88.string(),
|
|
6529
|
+
urn: z88.string()
|
|
6163
6530
|
})
|
|
6164
6531
|
})
|
|
6165
6532
|
).describe("Parameter bindings keyed by parameter ID")
|
|
6166
6533
|
});
|
|
6167
|
-
var InlineExperienceFragmentNodeSchema =
|
|
6168
|
-
() =>
|
|
6169
|
-
id:
|
|
6170
|
-
nodeType:
|
|
6534
|
+
var InlineExperienceFragmentNodeSchema = z88.lazy(
|
|
6535
|
+
() => z88.object({
|
|
6536
|
+
id: z88.string().describe("Node identifier"),
|
|
6537
|
+
nodeType: z88.literal("InlineExperienceFragment").describe('Must be "InlineExperienceFragment"'),
|
|
6171
6538
|
component: ComponentResourceLinkSchema.describe(
|
|
6172
6539
|
"Resource link to the component this inline experience fragment renders"
|
|
6173
6540
|
),
|
|
6174
|
-
designProperties:
|
|
6541
|
+
designProperties: z88.record(z88.string(), DimensionedDesignPropertyValueSchema).describe("Design property values for this inline experience fragment"),
|
|
6175
6542
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6176
6543
|
"Optional content bindings linking this inline experience fragment to a data assembly"
|
|
6177
6544
|
),
|
|
6178
|
-
slots:
|
|
6545
|
+
slots: z88.record(z88.string(), z88.array(ExperienceSlotNodeSchema)).optional().describe("Child slot contents keyed by slot ID")
|
|
6179
6546
|
})
|
|
6180
6547
|
);
|
|
6181
|
-
var ExperienceSlotNodeSchema =
|
|
6182
|
-
() =>
|
|
6548
|
+
var ExperienceSlotNodeSchema = z88.lazy(
|
|
6549
|
+
() => z88.union([ExperienceFragmentNodeSchema, InlineExperienceFragmentNodeSchema])
|
|
6183
6550
|
);
|
|
6184
6551
|
|
|
6185
6552
|
// src/tools/exo/components/createComponent.ts
|
|
6186
6553
|
var CreateComponentToolParams = BaseToolSchema.extend({
|
|
6187
|
-
name:
|
|
6188
|
-
description:
|
|
6189
|
-
viewports:
|
|
6190
|
-
contentProperties:
|
|
6191
|
-
designProperties:
|
|
6192
|
-
componentTree:
|
|
6193
|
-
slots:
|
|
6554
|
+
name: z89.string().describe("The name of the component"),
|
|
6555
|
+
description: z89.string().describe("Description of the component"),
|
|
6556
|
+
viewports: z89.array(ViewportSchema).describe("Viewport definitions for the component (may be empty)"),
|
|
6557
|
+
contentProperties: z89.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
6558
|
+
designProperties: z89.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
6559
|
+
componentTree: z89.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
6560
|
+
slots: z89.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
6194
6561
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6195
6562
|
"Optional ExO metadata (tags, concepts)"
|
|
6196
6563
|
)
|
|
@@ -6223,19 +6590,19 @@ function createComponentTool(config) {
|
|
|
6223
6590
|
}
|
|
6224
6591
|
|
|
6225
6592
|
// src/tools/exo/components/upsertComponent.ts
|
|
6226
|
-
import { z as
|
|
6593
|
+
import { z as z90 } from "zod";
|
|
6227
6594
|
var UpsertComponentToolParams = BaseToolSchema.extend({
|
|
6228
|
-
componentId:
|
|
6229
|
-
version:
|
|
6595
|
+
componentId: z90.string().describe("The ID of the component to update"),
|
|
6596
|
+
version: z90.number().describe(
|
|
6230
6597
|
"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."
|
|
6231
6598
|
),
|
|
6232
|
-
name:
|
|
6233
|
-
description:
|
|
6234
|
-
viewports:
|
|
6235
|
-
contentProperties:
|
|
6236
|
-
designProperties:
|
|
6237
|
-
componentTree:
|
|
6238
|
-
slots:
|
|
6599
|
+
name: z90.string().optional().describe("The name of the component"),
|
|
6600
|
+
description: z90.string().optional().describe("Description of the component"),
|
|
6601
|
+
viewports: z90.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6602
|
+
contentProperties: z90.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
6603
|
+
designProperties: z90.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
6604
|
+
componentTree: z90.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
6605
|
+
slots: z90.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
6239
6606
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6240
6607
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6241
6608
|
)
|
|
@@ -6282,13 +6649,13 @@ function upsertComponentTool(config) {
|
|
|
6282
6649
|
}
|
|
6283
6650
|
|
|
6284
6651
|
// src/tools/exo/components/deleteComponent.ts
|
|
6285
|
-
import { z as
|
|
6652
|
+
import { z as z91 } from "zod";
|
|
6286
6653
|
var DeleteComponentToolParams = BaseToolSchema.extend({
|
|
6287
|
-
componentId:
|
|
6288
|
-
confirm:
|
|
6654
|
+
componentId: z91.string().describe("The ID of the component to delete"),
|
|
6655
|
+
confirm: z91.boolean().optional().describe(
|
|
6289
6656
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
6290
6657
|
),
|
|
6291
|
-
confirmToken:
|
|
6658
|
+
confirmToken: z91.string().optional().describe(
|
|
6292
6659
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
6293
6660
|
)
|
|
6294
6661
|
});
|
|
@@ -6330,10 +6697,10 @@ function deleteComponentTool(config) {
|
|
|
6330
6697
|
}
|
|
6331
6698
|
|
|
6332
6699
|
// src/tools/exo/components/publishComponent.ts
|
|
6333
|
-
import { z as
|
|
6700
|
+
import { z as z92 } from "zod";
|
|
6334
6701
|
var PublishComponentToolParams = BaseToolSchema.extend({
|
|
6335
|
-
componentId:
|
|
6336
|
-
version:
|
|
6702
|
+
componentId: z92.string().describe("The ID of the component to publish"),
|
|
6703
|
+
version: z92.number().describe(
|
|
6337
6704
|
"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."
|
|
6338
6705
|
)
|
|
6339
6706
|
});
|
|
@@ -6367,10 +6734,10 @@ function publishComponentTool(config) {
|
|
|
6367
6734
|
}
|
|
6368
6735
|
|
|
6369
6736
|
// src/tools/exo/components/unpublishComponent.ts
|
|
6370
|
-
import { z as
|
|
6737
|
+
import { z as z93 } from "zod";
|
|
6371
6738
|
var UnpublishComponentToolParams = BaseToolSchema.extend({
|
|
6372
|
-
componentId:
|
|
6373
|
-
version:
|
|
6739
|
+
componentId: z93.string().describe("The ID of the component to unpublish"),
|
|
6740
|
+
version: z93.number().describe(
|
|
6374
6741
|
"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."
|
|
6375
6742
|
)
|
|
6376
6743
|
});
|
|
@@ -6499,9 +6866,9 @@ function createComponentTools(config) {
|
|
|
6499
6866
|
}
|
|
6500
6867
|
|
|
6501
6868
|
// src/tools/exo/experience-fragments/getExperienceFragment.ts
|
|
6502
|
-
import { z as
|
|
6869
|
+
import { z as z94 } from "zod";
|
|
6503
6870
|
var GetExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6504
|
-
experienceFragmentId:
|
|
6871
|
+
experienceFragmentId: z94.string().describe("The ID of the experience fragment to retrieve details for")
|
|
6505
6872
|
});
|
|
6506
6873
|
function getExperienceFragmentTool(config) {
|
|
6507
6874
|
async function tool2(args) {
|
|
@@ -6519,12 +6886,12 @@ function getExperienceFragmentTool(config) {
|
|
|
6519
6886
|
}
|
|
6520
6887
|
|
|
6521
6888
|
// src/tools/exo/experience-fragments/listExperienceFragments.ts
|
|
6522
|
-
import { z as
|
|
6889
|
+
import { z as z95 } from "zod";
|
|
6523
6890
|
var ListExperienceFragmentsToolParams = BaseToolSchema.extend({
|
|
6524
|
-
limit:
|
|
6525
|
-
pageNext:
|
|
6526
|
-
pagePrev:
|
|
6527
|
-
order:
|
|
6891
|
+
limit: z95.number().optional().describe("Maximum number of experience fragments to return (max 10)"),
|
|
6892
|
+
pageNext: z95.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
6893
|
+
pagePrev: z95.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
6894
|
+
order: z95.string().optional().describe("Order experience fragments by this field (e.g. sys.createdAt)")
|
|
6528
6895
|
});
|
|
6529
6896
|
function listExperienceFragmentsTool(config) {
|
|
6530
6897
|
async function tool2(args) {
|
|
@@ -6554,21 +6921,21 @@ function listExperienceFragmentsTool(config) {
|
|
|
6554
6921
|
}
|
|
6555
6922
|
|
|
6556
6923
|
// src/tools/exo/experience-fragments/createExperienceFragment.ts
|
|
6557
|
-
import { z as
|
|
6924
|
+
import { z as z96 } from "zod";
|
|
6558
6925
|
var CreateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6559
|
-
name:
|
|
6560
|
-
description:
|
|
6926
|
+
name: z96.string().describe("The name of the experience fragment"),
|
|
6927
|
+
description: z96.string().describe("Description of the experience fragment"),
|
|
6561
6928
|
component: ComponentResourceLinkSchema.describe(
|
|
6562
6929
|
"Resource link to the component this experience fragment is based on"
|
|
6563
6930
|
),
|
|
6564
|
-
viewports:
|
|
6565
|
-
designProperties:
|
|
6931
|
+
viewports: z96.array(ViewportSchema).describe("Viewport definitions (may be empty)"),
|
|
6932
|
+
designProperties: z96.record(z96.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
6566
6933
|
"Design property values keyed by property ID (may be empty object)"
|
|
6567
6934
|
),
|
|
6568
6935
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6569
6936
|
"Optional content bindings for the experience fragment"
|
|
6570
6937
|
),
|
|
6571
|
-
slots:
|
|
6938
|
+
slots: z96.record(z96.string(), z96.array(ExperienceSlotNodeSchema)).optional().describe("Optional slot node definitions keyed by slot ID"),
|
|
6572
6939
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6573
6940
|
"Optional ExO metadata (tags, concepts)"
|
|
6574
6941
|
)
|
|
@@ -6601,20 +6968,20 @@ function createExperienceFragmentTool(config) {
|
|
|
6601
6968
|
}
|
|
6602
6969
|
|
|
6603
6970
|
// src/tools/exo/experience-fragments/updateExperienceFragment.ts
|
|
6604
|
-
import { z as
|
|
6971
|
+
import { z as z97 } from "zod";
|
|
6605
6972
|
var UpdateExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6606
|
-
experienceFragmentId:
|
|
6607
|
-
version:
|
|
6973
|
+
experienceFragmentId: z97.string().describe("The ID of the experience fragment to update"),
|
|
6974
|
+
version: z97.number().describe(
|
|
6608
6975
|
"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."
|
|
6609
6976
|
),
|
|
6610
|
-
name:
|
|
6611
|
-
description:
|
|
6612
|
-
viewports:
|
|
6613
|
-
designProperties:
|
|
6977
|
+
name: z97.string().optional().describe("The name of the experience fragment"),
|
|
6978
|
+
description: z97.string().optional().describe("Description of the experience fragment"),
|
|
6979
|
+
viewports: z97.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
6980
|
+
designProperties: z97.record(z97.string(), DimensionedDesignPropertyValueSchema).optional().describe("Design property values; replaces existing if provided"),
|
|
6614
6981
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
6615
6982
|
"Content bindings; replaces existing if provided"
|
|
6616
6983
|
),
|
|
6617
|
-
slots:
|
|
6984
|
+
slots: z97.record(z97.string(), z97.array(ExperienceSlotNodeSchema)).optional().describe("Slot node definitions; replaces existing if provided"),
|
|
6618
6985
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
6619
6986
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6620
6987
|
)
|
|
@@ -6662,13 +7029,13 @@ function updateExperienceFragmentTool(config) {
|
|
|
6662
7029
|
}
|
|
6663
7030
|
|
|
6664
7031
|
// src/tools/exo/experience-fragments/deleteExperienceFragment.ts
|
|
6665
|
-
import { z as
|
|
7032
|
+
import { z as z98 } from "zod";
|
|
6666
7033
|
var DeleteExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6667
|
-
experienceFragmentId:
|
|
6668
|
-
confirm:
|
|
7034
|
+
experienceFragmentId: z98.string().describe("The ID of the experience fragment to delete"),
|
|
7035
|
+
confirm: z98.boolean().optional().describe(
|
|
6669
7036
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
6670
7037
|
),
|
|
6671
|
-
confirmToken:
|
|
7038
|
+
confirmToken: z98.string().optional().describe(
|
|
6672
7039
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
6673
7040
|
)
|
|
6674
7041
|
});
|
|
@@ -6710,10 +7077,10 @@ function deleteExperienceFragmentTool(config) {
|
|
|
6710
7077
|
}
|
|
6711
7078
|
|
|
6712
7079
|
// src/tools/exo/experience-fragments/publishExperienceFragment.ts
|
|
6713
|
-
import { z as
|
|
7080
|
+
import { z as z99 } from "zod";
|
|
6714
7081
|
var PublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6715
|
-
experienceFragmentId:
|
|
6716
|
-
version:
|
|
7082
|
+
experienceFragmentId: z99.string().describe("The ID of the experience fragment to publish"),
|
|
7083
|
+
version: z99.number().describe(
|
|
6717
7084
|
"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."
|
|
6718
7085
|
)
|
|
6719
7086
|
});
|
|
@@ -6747,10 +7114,10 @@ function publishExperienceFragmentTool(config) {
|
|
|
6747
7114
|
}
|
|
6748
7115
|
|
|
6749
7116
|
// src/tools/exo/experience-fragments/unpublishExperienceFragment.ts
|
|
6750
|
-
import { z as
|
|
7117
|
+
import { z as z100 } from "zod";
|
|
6751
7118
|
var UnpublishExperienceFragmentToolParams = BaseToolSchema.extend({
|
|
6752
|
-
experienceFragmentId:
|
|
6753
|
-
version:
|
|
7119
|
+
experienceFragmentId: z100.string().describe("The ID of the experience fragment to unpublish"),
|
|
7120
|
+
version: z100.number().describe(
|
|
6754
7121
|
"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."
|
|
6755
7122
|
)
|
|
6756
7123
|
});
|
|
@@ -6882,9 +7249,9 @@ function createExperienceFragmentTools(config) {
|
|
|
6882
7249
|
}
|
|
6883
7250
|
|
|
6884
7251
|
// src/tools/exo/experience-templates/getExperienceTemplate.ts
|
|
6885
|
-
import { z as
|
|
7252
|
+
import { z as z101 } from "zod";
|
|
6886
7253
|
var GetExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
6887
|
-
experienceTemplateId:
|
|
7254
|
+
experienceTemplateId: z101.string().describe("The ID of the experience template to retrieve details for")
|
|
6888
7255
|
});
|
|
6889
7256
|
function getExperienceTemplateTool(config) {
|
|
6890
7257
|
async function tool2(args) {
|
|
@@ -6902,12 +7269,12 @@ function getExperienceTemplateTool(config) {
|
|
|
6902
7269
|
}
|
|
6903
7270
|
|
|
6904
7271
|
// src/tools/exo/experience-templates/listExperienceTemplates.ts
|
|
6905
|
-
import { z as
|
|
7272
|
+
import { z as z102 } from "zod";
|
|
6906
7273
|
var ListExperienceTemplatesToolParams = BaseToolSchema.extend({
|
|
6907
|
-
limit:
|
|
6908
|
-
pageNext:
|
|
6909
|
-
pagePrev:
|
|
6910
|
-
order:
|
|
7274
|
+
limit: z102.number().optional().describe("Maximum number of experience templates to return (max 10)"),
|
|
7275
|
+
pageNext: z102.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7276
|
+
pagePrev: z102.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7277
|
+
order: z102.string().optional().describe("Order experience templates by this field (e.g. sys.createdAt)")
|
|
6911
7278
|
});
|
|
6912
7279
|
function listExperienceTemplatesTool(config) {
|
|
6913
7280
|
async function tool2(args) {
|
|
@@ -6937,17 +7304,17 @@ function listExperienceTemplatesTool(config) {
|
|
|
6937
7304
|
}
|
|
6938
7305
|
|
|
6939
7306
|
// src/tools/exo/experience-templates/createExperienceTemplate.ts
|
|
6940
|
-
import { z as
|
|
7307
|
+
import { z as z103 } from "zod";
|
|
6941
7308
|
var CreateExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
6942
|
-
name:
|
|
6943
|
-
description:
|
|
6944
|
-
viewports:
|
|
7309
|
+
name: z103.string().describe("The name of the experience template"),
|
|
7310
|
+
description: z103.string().describe("Description of the experience template"),
|
|
7311
|
+
viewports: z103.array(ViewportSchema).describe(
|
|
6945
7312
|
"Viewport definitions for the experience template (may be empty)"
|
|
6946
7313
|
),
|
|
6947
|
-
contentProperties:
|
|
6948
|
-
designProperties:
|
|
6949
|
-
componentTree:
|
|
6950
|
-
slots:
|
|
7314
|
+
contentProperties: z103.array(ContentPropertySchema).describe("Content property definitions (may be empty)"),
|
|
7315
|
+
designProperties: z103.array(DesignPropertySchema).describe("Design property definitions (may be empty)"),
|
|
7316
|
+
componentTree: z103.array(TreeNodeSchema).optional().describe("Optional component tree node definitions"),
|
|
7317
|
+
slots: z103.array(SlotDefinitionSchema).optional().describe("Optional slot definitions"),
|
|
6951
7318
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6952
7319
|
"Optional ExO metadata (tags, concepts)"
|
|
6953
7320
|
)
|
|
@@ -6980,19 +7347,19 @@ function createExperienceTemplateTool(config) {
|
|
|
6980
7347
|
}
|
|
6981
7348
|
|
|
6982
7349
|
// src/tools/exo/experience-templates/upsertExperienceTemplate.ts
|
|
6983
|
-
import { z as
|
|
7350
|
+
import { z as z104 } from "zod";
|
|
6984
7351
|
var UpsertExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
6985
|
-
experienceTemplateId:
|
|
6986
|
-
version:
|
|
7352
|
+
experienceTemplateId: z104.string().describe("The ID of the experience template to update"),
|
|
7353
|
+
version: z104.number().describe(
|
|
6987
7354
|
"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."
|
|
6988
7355
|
),
|
|
6989
|
-
name:
|
|
6990
|
-
description:
|
|
6991
|
-
viewports:
|
|
6992
|
-
contentProperties:
|
|
6993
|
-
designProperties:
|
|
6994
|
-
componentTree:
|
|
6995
|
-
slots:
|
|
7356
|
+
name: z104.string().optional().describe("The name of the experience template"),
|
|
7357
|
+
description: z104.string().optional().describe("Description of the experience template"),
|
|
7358
|
+
viewports: z104.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7359
|
+
contentProperties: z104.array(ContentPropertySchema).optional().describe("Content property definitions; replaces existing if provided"),
|
|
7360
|
+
designProperties: z104.array(DesignPropertySchema).optional().describe("Design property definitions; replaces existing if provided"),
|
|
7361
|
+
componentTree: z104.array(TreeNodeSchema).optional().describe("Component tree node definitions; replaces existing if provided"),
|
|
7362
|
+
slots: z104.array(SlotDefinitionSchema).optional().describe("Slot definitions; replaces existing if provided"),
|
|
6996
7363
|
metadata: ExoMetadataSchema.optional().describe(
|
|
6997
7364
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
6998
7365
|
)
|
|
@@ -7042,13 +7409,13 @@ function upsertExperienceTemplateTool(config) {
|
|
|
7042
7409
|
}
|
|
7043
7410
|
|
|
7044
7411
|
// src/tools/exo/experience-templates/deleteExperienceTemplate.ts
|
|
7045
|
-
import { z as
|
|
7412
|
+
import { z as z105 } from "zod";
|
|
7046
7413
|
var DeleteExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7047
|
-
experienceTemplateId:
|
|
7048
|
-
confirm:
|
|
7414
|
+
experienceTemplateId: z105.string().describe("The ID of the experience template to delete"),
|
|
7415
|
+
confirm: z105.boolean().optional().describe(
|
|
7049
7416
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7050
7417
|
),
|
|
7051
|
-
confirmToken:
|
|
7418
|
+
confirmToken: z105.string().optional().describe(
|
|
7052
7419
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7053
7420
|
)
|
|
7054
7421
|
});
|
|
@@ -7090,10 +7457,10 @@ function deleteExperienceTemplateTool(config) {
|
|
|
7090
7457
|
}
|
|
7091
7458
|
|
|
7092
7459
|
// src/tools/exo/experience-templates/publishExperienceTemplate.ts
|
|
7093
|
-
import { z as
|
|
7460
|
+
import { z as z106 } from "zod";
|
|
7094
7461
|
var PublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7095
|
-
experienceTemplateId:
|
|
7096
|
-
version:
|
|
7462
|
+
experienceTemplateId: z106.string().describe("The ID of the experience template to publish"),
|
|
7463
|
+
version: z106.number().describe(
|
|
7097
7464
|
"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."
|
|
7098
7465
|
)
|
|
7099
7466
|
});
|
|
@@ -7127,10 +7494,10 @@ function publishExperienceTemplateTool(config) {
|
|
|
7127
7494
|
}
|
|
7128
7495
|
|
|
7129
7496
|
// src/tools/exo/experience-templates/unpublishExperienceTemplate.ts
|
|
7130
|
-
import { z as
|
|
7497
|
+
import { z as z107 } from "zod";
|
|
7131
7498
|
var UnpublishExperienceTemplateToolParams = BaseToolSchema.extend({
|
|
7132
|
-
experienceTemplateId:
|
|
7133
|
-
version:
|
|
7499
|
+
experienceTemplateId: z107.string().describe("The ID of the experience template to unpublish"),
|
|
7500
|
+
version: z107.number().describe(
|
|
7134
7501
|
"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."
|
|
7135
7502
|
)
|
|
7136
7503
|
});
|
|
@@ -7262,9 +7629,9 @@ function createExperienceTemplateTools(config) {
|
|
|
7262
7629
|
}
|
|
7263
7630
|
|
|
7264
7631
|
// src/tools/exo/experiences/getExperience.ts
|
|
7265
|
-
import { z as
|
|
7632
|
+
import { z as z108 } from "zod";
|
|
7266
7633
|
var GetExperienceToolParams = BaseToolSchema.extend({
|
|
7267
|
-
experienceId:
|
|
7634
|
+
experienceId: z108.string().describe("The ID of the experience to retrieve")
|
|
7268
7635
|
});
|
|
7269
7636
|
function getExperienceTool(config) {
|
|
7270
7637
|
async function tool2(args) {
|
|
@@ -7282,12 +7649,12 @@ function getExperienceTool(config) {
|
|
|
7282
7649
|
}
|
|
7283
7650
|
|
|
7284
7651
|
// src/tools/exo/experiences/listExperiences.ts
|
|
7285
|
-
import { z as
|
|
7652
|
+
import { z as z109 } from "zod";
|
|
7286
7653
|
var ListExperiencesToolParams = BaseToolSchema.extend({
|
|
7287
|
-
limit:
|
|
7288
|
-
pageNext:
|
|
7289
|
-
pagePrev:
|
|
7290
|
-
order:
|
|
7654
|
+
limit: z109.number().optional().describe("Maximum number of experiences to return (max 10)"),
|
|
7655
|
+
pageNext: z109.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
7656
|
+
pagePrev: z109.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
7657
|
+
order: z109.string().optional().describe("Order experiences by this field (e.g. sys.createdAt)")
|
|
7291
7658
|
});
|
|
7292
7659
|
function listExperiencesTool(config) {
|
|
7293
7660
|
async function tool2(args) {
|
|
@@ -7317,21 +7684,21 @@ function listExperiencesTool(config) {
|
|
|
7317
7684
|
}
|
|
7318
7685
|
|
|
7319
7686
|
// src/tools/exo/experiences/createExperience.ts
|
|
7320
|
-
import { z as
|
|
7687
|
+
import { z as z110 } from "zod";
|
|
7321
7688
|
var CreateExperienceToolParams = BaseToolSchema.extend({
|
|
7322
|
-
name:
|
|
7323
|
-
description:
|
|
7689
|
+
name: z110.string().describe("The name of the experience"),
|
|
7690
|
+
description: z110.string().describe("Description of the experience"),
|
|
7324
7691
|
experienceTemplate: ExperienceTemplateResourceLinkSchema.describe(
|
|
7325
7692
|
"Resource link to the ExperienceTemplate this experience is backed by"
|
|
7326
7693
|
),
|
|
7327
|
-
viewports:
|
|
7328
|
-
designProperties:
|
|
7694
|
+
viewports: z110.array(ViewportSchema).describe("Viewport definitions for the experience (may be empty)"),
|
|
7695
|
+
designProperties: z110.record(z110.string(), DimensionedDesignPropertyValueSchema).describe(
|
|
7329
7696
|
"Design property values keyed by property ID. Each value is a dimensioned map (viewport ID \u2192 design value). May be an empty object."
|
|
7330
7697
|
),
|
|
7331
7698
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7332
7699
|
"Optional content bindings linking this experience to a data assembly"
|
|
7333
7700
|
),
|
|
7334
|
-
slots:
|
|
7701
|
+
slots: z110.record(z110.string(), z110.array(ExperienceSlotNodeSchema)).optional().describe(
|
|
7335
7702
|
"Optional slot contents keyed by slot ID. Each value is an array of ExperienceFragmentNode or InlineExperienceFragmentNode."
|
|
7336
7703
|
),
|
|
7337
7704
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
@@ -7366,22 +7733,22 @@ function createExperienceTool(config) {
|
|
|
7366
7733
|
}
|
|
7367
7734
|
|
|
7368
7735
|
// src/tools/exo/experiences/upsertExperience.ts
|
|
7369
|
-
import { z as
|
|
7736
|
+
import { z as z111 } from "zod";
|
|
7370
7737
|
var UpsertExperienceToolParams = BaseToolSchema.extend({
|
|
7371
|
-
experienceId:
|
|
7372
|
-
version:
|
|
7738
|
+
experienceId: z111.string().describe("The ID of the experience to update"),
|
|
7739
|
+
version: z111.number().describe(
|
|
7373
7740
|
"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."
|
|
7374
7741
|
),
|
|
7375
|
-
name:
|
|
7376
|
-
description:
|
|
7377
|
-
viewports:
|
|
7378
|
-
designProperties:
|
|
7742
|
+
name: z111.string().optional().describe("The name of the experience"),
|
|
7743
|
+
description: z111.string().optional().describe("Description of the experience"),
|
|
7744
|
+
viewports: z111.array(ViewportSchema).optional().describe("Viewport definitions; replaces existing viewports if provided"),
|
|
7745
|
+
designProperties: z111.record(z111.string(), DimensionedDesignPropertyValueSchema).optional().describe(
|
|
7379
7746
|
"Design property values keyed by property ID; replaces existing if provided"
|
|
7380
7747
|
),
|
|
7381
7748
|
contentBindings: ExperienceContentBindingsSchema.optional().describe(
|
|
7382
7749
|
"Content bindings linking this experience to a data assembly; replaces existing if provided"
|
|
7383
7750
|
),
|
|
7384
|
-
slots:
|
|
7751
|
+
slots: z111.record(z111.string(), z111.array(ExperienceSlotNodeSchema)).optional().describe("Slot contents keyed by slot ID; replaces existing if provided"),
|
|
7385
7752
|
metadata: ExperienceMetadataSchema.optional().describe(
|
|
7386
7753
|
"ExO metadata (tags, concepts); replaces existing if provided"
|
|
7387
7754
|
)
|
|
@@ -7426,13 +7793,13 @@ function upsertExperienceTool(config) {
|
|
|
7426
7793
|
}
|
|
7427
7794
|
|
|
7428
7795
|
// src/tools/exo/experiences/deleteExperience.ts
|
|
7429
|
-
import { z as
|
|
7796
|
+
import { z as z112 } from "zod";
|
|
7430
7797
|
var DeleteExperienceToolParams = BaseToolSchema.extend({
|
|
7431
|
-
experienceId:
|
|
7432
|
-
confirm:
|
|
7798
|
+
experienceId: z112.string().describe("The ID of the experience to delete"),
|
|
7799
|
+
confirm: z112.boolean().optional().describe(
|
|
7433
7800
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7434
7801
|
),
|
|
7435
|
-
confirmToken:
|
|
7802
|
+
confirmToken: z112.string().optional().describe(
|
|
7436
7803
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7437
7804
|
)
|
|
7438
7805
|
});
|
|
@@ -7474,10 +7841,10 @@ function deleteExperienceTool(config) {
|
|
|
7474
7841
|
}
|
|
7475
7842
|
|
|
7476
7843
|
// src/tools/exo/experiences/publishExperience.ts
|
|
7477
|
-
import { z as
|
|
7844
|
+
import { z as z113 } from "zod";
|
|
7478
7845
|
var PublishExperienceToolParams = BaseToolSchema.extend({
|
|
7479
|
-
experienceId:
|
|
7480
|
-
version:
|
|
7846
|
+
experienceId: z113.string().describe("The ID of the experience to publish"),
|
|
7847
|
+
version: z113.number().describe(
|
|
7481
7848
|
"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."
|
|
7482
7849
|
)
|
|
7483
7850
|
});
|
|
@@ -7511,10 +7878,10 @@ function publishExperienceTool(config) {
|
|
|
7511
7878
|
}
|
|
7512
7879
|
|
|
7513
7880
|
// src/tools/exo/experiences/unpublishExperience.ts
|
|
7514
|
-
import { z as
|
|
7881
|
+
import { z as z114 } from "zod";
|
|
7515
7882
|
var UnpublishExperienceToolParams = BaseToolSchema.extend({
|
|
7516
|
-
experienceId:
|
|
7517
|
-
version:
|
|
7883
|
+
experienceId: z114.string().describe("The ID of the experience to unpublish"),
|
|
7884
|
+
version: z114.number().describe(
|
|
7518
7885
|
"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."
|
|
7519
7886
|
)
|
|
7520
7887
|
});
|
|
@@ -7643,9 +8010,9 @@ function createExperienceTools(config) {
|
|
|
7643
8010
|
}
|
|
7644
8011
|
|
|
7645
8012
|
// src/tools/exo/data-assemblies/getDataAssembly.ts
|
|
7646
|
-
import { z as
|
|
8013
|
+
import { z as z115 } from "zod";
|
|
7647
8014
|
var GetDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7648
|
-
dataAssemblyId:
|
|
8015
|
+
dataAssemblyId: z115.string().describe("The ID of the data assembly to retrieve")
|
|
7649
8016
|
});
|
|
7650
8017
|
function getDataAssemblyTool(config) {
|
|
7651
8018
|
async function tool2(args) {
|
|
@@ -7663,9 +8030,9 @@ function getDataAssemblyTool(config) {
|
|
|
7663
8030
|
}
|
|
7664
8031
|
|
|
7665
8032
|
// src/tools/exo/data-assemblies/getPublishedDataAssembly.ts
|
|
7666
|
-
import { z as
|
|
8033
|
+
import { z as z116 } from "zod";
|
|
7667
8034
|
var GetPublishedDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7668
|
-
dataAssemblyId:
|
|
8035
|
+
dataAssemblyId: z116.string().describe("The ID of the published data assembly to retrieve")
|
|
7669
8036
|
});
|
|
7670
8037
|
function getPublishedDataAssemblyTool(config) {
|
|
7671
8038
|
async function tool2(args) {
|
|
@@ -7683,12 +8050,12 @@ function getPublishedDataAssemblyTool(config) {
|
|
|
7683
8050
|
}
|
|
7684
8051
|
|
|
7685
8052
|
// src/tools/exo/data-assemblies/listDataAssemblies.ts
|
|
7686
|
-
import { z as
|
|
8053
|
+
import { z as z117 } from "zod";
|
|
7687
8054
|
var ListDataAssembliesToolParams = BaseToolSchema.extend({
|
|
7688
|
-
limit:
|
|
7689
|
-
pageNext:
|
|
7690
|
-
pagePrev:
|
|
7691
|
-
sysIdIn:
|
|
8055
|
+
limit: z117.number().optional().describe("Maximum number of data assemblies to return (max 10)"),
|
|
8056
|
+
pageNext: z117.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8057
|
+
pagePrev: z117.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8058
|
+
sysIdIn: z117.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
7692
8059
|
});
|
|
7693
8060
|
function listDataAssembliesTool(config) {
|
|
7694
8061
|
async function tool2(args) {
|
|
@@ -7717,12 +8084,12 @@ function listDataAssembliesTool(config) {
|
|
|
7717
8084
|
}
|
|
7718
8085
|
|
|
7719
8086
|
// src/tools/exo/data-assemblies/listPublishedDataAssemblies.ts
|
|
7720
|
-
import { z as
|
|
8087
|
+
import { z as z118 } from "zod";
|
|
7721
8088
|
var ListPublishedDataAssembliesToolParams = BaseToolSchema.extend({
|
|
7722
|
-
limit:
|
|
7723
|
-
pageNext:
|
|
7724
|
-
pagePrev:
|
|
7725
|
-
sysIdIn:
|
|
8089
|
+
limit: z118.number().optional().describe("Maximum number of published data assemblies to return (max 10)"),
|
|
8090
|
+
pageNext: z118.string().optional().describe("Cursor token to fetch the next page of results"),
|
|
8091
|
+
pagePrev: z118.string().optional().describe("Cursor token to fetch the previous page of results"),
|
|
8092
|
+
sysIdIn: z118.string().optional().describe("Comma-separated list of data assembly IDs to filter by")
|
|
7726
8093
|
});
|
|
7727
8094
|
function listPublishedDataAssembliesTool(config) {
|
|
7728
8095
|
async function tool2(args) {
|
|
@@ -7751,35 +8118,35 @@ function listPublishedDataAssembliesTool(config) {
|
|
|
7751
8118
|
}
|
|
7752
8119
|
|
|
7753
8120
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
7754
|
-
import { z as
|
|
8121
|
+
import { z as z120 } from "zod";
|
|
7755
8122
|
|
|
7756
8123
|
// src/types/dataAssemblySchemas.ts
|
|
7757
|
-
import { z as
|
|
7758
|
-
var PointerExpressionValueSchema =
|
|
7759
|
-
() =>
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
$from:
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
source:
|
|
8124
|
+
import { z as z119 } from "zod";
|
|
8125
|
+
var PointerExpressionValueSchema = z119.lazy(
|
|
8126
|
+
() => z119.union([
|
|
8127
|
+
z119.string(),
|
|
8128
|
+
z119.object({
|
|
8129
|
+
$from: z119.union([
|
|
8130
|
+
z119.string(),
|
|
8131
|
+
z119.object({
|
|
8132
|
+
source: z119.string(),
|
|
7766
8133
|
select: PointerExpressionValueSchema.optional()
|
|
7767
8134
|
})
|
|
7768
8135
|
])
|
|
7769
8136
|
}),
|
|
7770
|
-
|
|
7771
|
-
|
|
7772
|
-
|
|
7773
|
-
$on:
|
|
7774
|
-
type:
|
|
8137
|
+
z119.object({ $literal: z119.custom() }),
|
|
8138
|
+
z119.object({ $object: z119.record(z119.string(), PointerExpressionValueSchema) }),
|
|
8139
|
+
z119.object({
|
|
8140
|
+
$on: z119.object({
|
|
8141
|
+
type: z119.record(z119.string(), PointerExpressionValueSchema),
|
|
7775
8142
|
default: PointerExpressionValueSchema.optional()
|
|
7776
8143
|
})
|
|
7777
8144
|
}),
|
|
7778
|
-
|
|
8145
|
+
z119.record(z119.string(), PointerExpressionValueSchema)
|
|
7779
8146
|
])
|
|
7780
8147
|
);
|
|
7781
|
-
var CanonicalDataTypeArmSchema =
|
|
7782
|
-
type:
|
|
8148
|
+
var CanonicalDataTypeArmSchema = z119.object({
|
|
8149
|
+
type: z119.enum([
|
|
7783
8150
|
"String",
|
|
7784
8151
|
"Number",
|
|
7785
8152
|
"Integer",
|
|
@@ -7791,72 +8158,72 @@ var CanonicalDataTypeArmSchema = z117.object({
|
|
|
7791
8158
|
"Literal",
|
|
7792
8159
|
"DiscriminatedUnion"
|
|
7793
8160
|
]),
|
|
7794
|
-
id:
|
|
7795
|
-
name:
|
|
7796
|
-
required:
|
|
7797
|
-
}).catchall(
|
|
7798
|
-
var LegacyDataTypeArmSchema =
|
|
7799
|
-
id:
|
|
7800
|
-
name:
|
|
7801
|
-
type:
|
|
7802
|
-
required:
|
|
7803
|
-
source:
|
|
7804
|
-
ref:
|
|
7805
|
-
});
|
|
7806
|
-
var DataAssemblyDataTypeFieldSchema =
|
|
8161
|
+
id: z119.string().describe("Data type field identifier"),
|
|
8162
|
+
name: z119.string().describe("Human-readable name"),
|
|
8163
|
+
required: z119.boolean().optional()
|
|
8164
|
+
}).catchall(z119.unknown());
|
|
8165
|
+
var LegacyDataTypeArmSchema = z119.object({
|
|
8166
|
+
id: z119.string().describe("Data type field identifier"),
|
|
8167
|
+
name: z119.string().describe("Human-readable name"),
|
|
8168
|
+
type: z119.string(),
|
|
8169
|
+
required: z119.boolean().optional(),
|
|
8170
|
+
source: z119.string().optional(),
|
|
8171
|
+
ref: z119.unknown().optional()
|
|
8172
|
+
});
|
|
8173
|
+
var DataAssemblyDataTypeFieldSchema = z119.union([
|
|
7807
8174
|
CanonicalDataTypeArmSchema,
|
|
7808
8175
|
LegacyDataTypeArmSchema
|
|
7809
8176
|
]);
|
|
7810
8177
|
var SAME_SPACE_CONTENT_SOURCE = "crn:contentful:::content:spaces/$self/environments/$self";
|
|
7811
|
-
var DataAssemblyResourceLinkParameterSchema =
|
|
7812
|
-
name:
|
|
7813
|
-
description:
|
|
7814
|
-
type:
|
|
7815
|
-
linkType:
|
|
7816
|
-
allowedResources:
|
|
7817
|
-
|
|
7818
|
-
type:
|
|
7819
|
-
source:
|
|
7820
|
-
allowedTypes:
|
|
8178
|
+
var DataAssemblyResourceLinkParameterSchema = z119.object({
|
|
8179
|
+
name: z119.string().optional(),
|
|
8180
|
+
description: z119.string().optional(),
|
|
8181
|
+
type: z119.literal("ResourceLink"),
|
|
8182
|
+
linkType: z119.literal("Contentful:Entry"),
|
|
8183
|
+
allowedResources: z119.array(
|
|
8184
|
+
z119.object({
|
|
8185
|
+
type: z119.literal("Contentful:Entry"),
|
|
8186
|
+
source: z119.literal(SAME_SPACE_CONTENT_SOURCE),
|
|
8187
|
+
allowedTypes: z119.array(z119.string())
|
|
7821
8188
|
})
|
|
7822
8189
|
)
|
|
7823
8190
|
});
|
|
7824
|
-
var DataAssemblyParameterConfigSchema =
|
|
7825
|
-
|
|
8191
|
+
var DataAssemblyParameterConfigSchema = z119.record(
|
|
8192
|
+
z119.string(),
|
|
7826
8193
|
DataAssemblyResourceLinkParameterSchema
|
|
7827
8194
|
);
|
|
7828
|
-
var DataAssemblyGraphQLResolverSchema =
|
|
7829
|
-
source:
|
|
7830
|
-
query:
|
|
8195
|
+
var DataAssemblyGraphQLResolverSchema = z119.object({
|
|
8196
|
+
source: z119.literal("Contentful:GraphQL"),
|
|
8197
|
+
query: z119.string().describe("GraphQL query string"),
|
|
7831
8198
|
parameters: PointerExpressionValueSchema.optional()
|
|
7832
8199
|
});
|
|
7833
|
-
var DataAssemblyNestedResolverSchema =
|
|
7834
|
-
source:
|
|
7835
|
-
dataAssembly:
|
|
7836
|
-
sys:
|
|
7837
|
-
type:
|
|
7838
|
-
linkType:
|
|
7839
|
-
urn:
|
|
8200
|
+
var DataAssemblyNestedResolverSchema = z119.object({
|
|
8201
|
+
source: z119.literal("Contentful:DataAssembly"),
|
|
8202
|
+
dataAssembly: z119.object({
|
|
8203
|
+
sys: z119.object({
|
|
8204
|
+
type: z119.literal("ResourceLink"),
|
|
8205
|
+
linkType: z119.literal("Contentful:DataAssembly"),
|
|
8206
|
+
urn: z119.string()
|
|
7840
8207
|
})
|
|
7841
8208
|
}),
|
|
7842
8209
|
parameters: PointerExpressionValueSchema.optional()
|
|
7843
8210
|
});
|
|
7844
|
-
var DataAssemblyResolverDefinitionSchema =
|
|
8211
|
+
var DataAssemblyResolverDefinitionSchema = z119.union([
|
|
7845
8212
|
DataAssemblyGraphQLResolverSchema,
|
|
7846
8213
|
DataAssemblyNestedResolverSchema
|
|
7847
8214
|
]);
|
|
7848
|
-
var DataAssemblyResolverConfigSchema =
|
|
7849
|
-
|
|
8215
|
+
var DataAssemblyResolverConfigSchema = z119.record(
|
|
8216
|
+
z119.string(),
|
|
7850
8217
|
DataAssemblyResolverDefinitionSchema
|
|
7851
8218
|
);
|
|
7852
8219
|
var DataAssemblyReturnMappingConfigSchema = PointerExpressionValueSchema;
|
|
7853
|
-
var DataAssemblyMetadataSchema =
|
|
7854
|
-
tags:
|
|
7855
|
-
|
|
7856
|
-
sys:
|
|
7857
|
-
type:
|
|
7858
|
-
linkType:
|
|
7859
|
-
id:
|
|
8220
|
+
var DataAssemblyMetadataSchema = z119.object({
|
|
8221
|
+
tags: z119.array(
|
|
8222
|
+
z119.object({
|
|
8223
|
+
sys: z119.object({
|
|
8224
|
+
type: z119.literal("Link"),
|
|
8225
|
+
linkType: z119.literal("Tag"),
|
|
8226
|
+
id: z119.string()
|
|
7860
8227
|
})
|
|
7861
8228
|
})
|
|
7862
8229
|
)
|
|
@@ -7864,8 +8231,8 @@ var DataAssemblyMetadataSchema = z117.object({
|
|
|
7864
8231
|
|
|
7865
8232
|
// src/tools/exo/data-assemblies/createDataAssembly.ts
|
|
7866
8233
|
var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7867
|
-
name:
|
|
7868
|
-
description:
|
|
8234
|
+
name: z120.string().describe("The name of the data assembly"),
|
|
8235
|
+
description: z120.string().describe("Description of the data assembly"),
|
|
7869
8236
|
parameters: DataAssemblyParameterConfigSchema.describe(
|
|
7870
8237
|
"Parameter definitions keyed by parameter name (may be empty object)"
|
|
7871
8238
|
),
|
|
@@ -7875,8 +8242,8 @@ var CreateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
7875
8242
|
return: DataAssemblyReturnMappingConfigSchema.describe(
|
|
7876
8243
|
"Return mapping configuration specifying how to map resolved data"
|
|
7877
8244
|
),
|
|
7878
|
-
dataType:
|
|
7879
|
-
variant:
|
|
8245
|
+
dataType: z120.array(DataAssemblyDataTypeFieldSchema).describe("Data type field definitions for this data assembly (may be empty array)"),
|
|
8246
|
+
variant: z120.string().optional().describe("Optional variant identifier for this data assembly"),
|
|
7880
8247
|
metadata: DataAssemblyMetadataSchema.optional().describe("Optional metadata (tags)")
|
|
7881
8248
|
});
|
|
7882
8249
|
function createDataAssemblyTool(config) {
|
|
@@ -7910,14 +8277,14 @@ function createDataAssemblyTool(config) {
|
|
|
7910
8277
|
}
|
|
7911
8278
|
|
|
7912
8279
|
// src/tools/exo/data-assemblies/updateDataAssembly.ts
|
|
7913
|
-
import { z as
|
|
8280
|
+
import { z as z121 } from "zod";
|
|
7914
8281
|
var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7915
|
-
dataAssemblyId:
|
|
7916
|
-
version:
|
|
8282
|
+
dataAssemblyId: z121.string().describe("The ID of the data assembly to update"),
|
|
8283
|
+
version: z121.number().describe(
|
|
7917
8284
|
"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."
|
|
7918
8285
|
),
|
|
7919
|
-
name:
|
|
7920
|
-
description:
|
|
8286
|
+
name: z121.string().optional().describe("The name of the data assembly"),
|
|
8287
|
+
description: z121.string().optional().describe("Description of the data assembly"),
|
|
7921
8288
|
parameters: DataAssemblyParameterConfigSchema.optional().describe(
|
|
7922
8289
|
"Parameter definitions; replaces existing if provided"
|
|
7923
8290
|
),
|
|
@@ -7927,8 +8294,8 @@ var UpdateDataAssemblyToolParams = BaseToolSchema.extend({
|
|
|
7927
8294
|
return: DataAssemblyReturnMappingConfigSchema.optional().describe(
|
|
7928
8295
|
"Return mapping configuration; replaces existing if provided"
|
|
7929
8296
|
),
|
|
7930
|
-
dataType:
|
|
7931
|
-
variant:
|
|
8297
|
+
dataType: z121.array(DataAssemblyDataTypeFieldSchema).optional().describe("Data type field definitions; replaces existing if provided"),
|
|
8298
|
+
variant: z121.string().optional().describe("Optional variant identifier; replaces existing if provided"),
|
|
7932
8299
|
metadata: DataAssemblyMetadataSchema.optional().describe(
|
|
7933
8300
|
"Metadata (tags); replaces existing if provided"
|
|
7934
8301
|
)
|
|
@@ -7974,13 +8341,13 @@ function updateDataAssemblyTool(config) {
|
|
|
7974
8341
|
}
|
|
7975
8342
|
|
|
7976
8343
|
// src/tools/exo/data-assemblies/deleteDataAssembly.ts
|
|
7977
|
-
import { z as
|
|
8344
|
+
import { z as z122 } from "zod";
|
|
7978
8345
|
var DeleteDataAssemblyToolParams = BaseToolSchema.extend({
|
|
7979
|
-
dataAssemblyId:
|
|
7980
|
-
confirm:
|
|
8346
|
+
dataAssemblyId: z122.string().describe("The ID of the data assembly to delete"),
|
|
8347
|
+
confirm: z122.boolean().optional().describe(
|
|
7981
8348
|
"Set to true on the second call to actually perform the deletion. Required together with confirmToken."
|
|
7982
8349
|
),
|
|
7983
|
-
confirmToken:
|
|
8350
|
+
confirmToken: z122.string().optional().describe(
|
|
7984
8351
|
"Token returned by the preview call; must be supplied with confirm: true."
|
|
7985
8352
|
)
|
|
7986
8353
|
});
|
|
@@ -8022,10 +8389,10 @@ function deleteDataAssemblyTool(config) {
|
|
|
8022
8389
|
}
|
|
8023
8390
|
|
|
8024
8391
|
// src/tools/exo/data-assemblies/publishDataAssembly.ts
|
|
8025
|
-
import { z as
|
|
8392
|
+
import { z as z123 } from "zod";
|
|
8026
8393
|
var PublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8027
|
-
dataAssemblyId:
|
|
8028
|
-
version:
|
|
8394
|
+
dataAssemblyId: z123.string().describe("The ID of the data assembly to publish"),
|
|
8395
|
+
version: z123.number().describe(
|
|
8029
8396
|
"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."
|
|
8030
8397
|
)
|
|
8031
8398
|
});
|
|
@@ -8059,10 +8426,10 @@ function publishDataAssemblyTool(config) {
|
|
|
8059
8426
|
}
|
|
8060
8427
|
|
|
8061
8428
|
// src/tools/exo/data-assemblies/unpublishDataAssembly.ts
|
|
8062
|
-
import { z as
|
|
8429
|
+
import { z as z124 } from "zod";
|
|
8063
8430
|
var UnpublishDataAssemblyToolParams = BaseToolSchema.extend({
|
|
8064
|
-
dataAssemblyId:
|
|
8065
|
-
version:
|
|
8431
|
+
dataAssemblyId: z124.string().describe("The ID of the data assembly to unpublish"),
|
|
8432
|
+
version: z124.number().describe(
|
|
8066
8433
|
"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."
|
|
8067
8434
|
)
|
|
8068
8435
|
});
|
|
@@ -8244,6 +8611,12 @@ var ContentfulMcpTools = class {
|
|
|
8244
8611
|
getAssetTools() {
|
|
8245
8612
|
return createAssetTools(this.config);
|
|
8246
8613
|
}
|
|
8614
|
+
/**
|
|
8615
|
+
* Get content preview tools
|
|
8616
|
+
*/
|
|
8617
|
+
getContentPreviewTools() {
|
|
8618
|
+
return createContentPreviewTools(this.config);
|
|
8619
|
+
}
|
|
8247
8620
|
/**
|
|
8248
8621
|
* Get content type tools
|
|
8249
8622
|
*/
|
|
@@ -8349,10 +8722,10 @@ var ContentfulMcpTools = class {
|
|
|
8349
8722
|
};
|
|
8350
8723
|
|
|
8351
8724
|
// src/utils/entitlements.ts
|
|
8352
|
-
import { createClient as
|
|
8725
|
+
import { createClient as createClient18 } from "contentful-management";
|
|
8353
8726
|
var EXO_M1_FEATURE = "exoM1";
|
|
8354
8727
|
function createPlainClient(config) {
|
|
8355
|
-
return
|
|
8728
|
+
return createClient18(createClientConfig(config), { type: "plain" });
|
|
8356
8729
|
}
|
|
8357
8730
|
async function orgHasExoM1(client, organizationId) {
|
|
8358
8731
|
try {
|