@se-studio/contentful-cms 3.13.1 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/HOSTED.md +3 -3
  3. package/README.md +8 -10
  4. package/dist/cli/parse-boolean.d.ts +3 -0
  5. package/dist/cli/parse-boolean.d.ts.map +1 -0
  6. package/dist/cli/parse-boolean.js +9 -0
  7. package/dist/cli/parse-boolean.js.map +1 -0
  8. package/dist/cli/program.d.ts.map +1 -1
  9. package/dist/cli/program.js +3 -1
  10. package/dist/cli/program.js.map +1 -1
  11. package/dist/commands/create-person.d.ts.map +1 -1
  12. package/dist/commands/create-person.js +9 -0
  13. package/dist/commands/create-person.js.map +1 -1
  14. package/dist/commands/create-taxonomy.d.ts +8 -3
  15. package/dist/commands/create-taxonomy.d.ts.map +1 -1
  16. package/dist/commands/create-taxonomy.js +54 -0
  17. package/dist/commands/create-taxonomy.js.map +1 -1
  18. package/dist/commands/release.d.ts +4 -0
  19. package/dist/commands/release.d.ts.map +1 -0
  20. package/dist/commands/release.js +331 -0
  21. package/dist/commands/release.js.map +1 -0
  22. package/dist/contentful/cda-sync.d.ts.map +1 -1
  23. package/dist/contentful/cda-sync.js +5 -1
  24. package/dist/contentful/cda-sync.js.map +1 -1
  25. package/dist/contentful/cma-user-agent.d.ts +1 -1
  26. package/dist/contentful/entry-fields.d.ts +7 -1
  27. package/dist/contentful/entry-fields.d.ts.map +1 -1
  28. package/dist/contentful/entry-fields.js +39 -0
  29. package/dist/contentful/entry-fields.js.map +1 -1
  30. package/dist/contentful/person-create.d.ts +4 -0
  31. package/dist/contentful/person-create.d.ts.map +1 -1
  32. package/dist/contentful/person-create.js +7 -0
  33. package/dist/contentful/person-create.js.map +1 -1
  34. package/dist/contentful/person-type-resolve.d.ts +8 -0
  35. package/dist/contentful/person-type-resolve.d.ts.map +1 -0
  36. package/dist/contentful/person-type-resolve.js +20 -0
  37. package/dist/contentful/person-type-resolve.js.map +1 -0
  38. package/dist/editor-pack/capabilities.d.ts.map +1 -1
  39. package/dist/editor-pack/capabilities.js +9 -2
  40. package/dist/editor-pack/capabilities.js.map +1 -1
  41. package/dist/editor-pack/generate.d.ts.map +1 -1
  42. package/dist/editor-pack/generate.js +2 -1
  43. package/dist/editor-pack/generate.js.map +1 -1
  44. package/dist/generated/help-topics.d.ts +1 -1
  45. package/dist/generated/help-topics.d.ts.map +1 -1
  46. package/dist/generated/help-topics.js +2 -2
  47. package/dist/generated/help-topics.js.map +1 -1
  48. package/dist/generated/version.d.ts +1 -1
  49. package/dist/generated/version.js +1 -1
  50. package/dist/hosted/next/routes/mcp.d.ts.map +1 -1
  51. package/dist/hosted/next/routes/mcp.js +18 -0
  52. package/dist/hosted/next/routes/mcp.js.map +1 -1
  53. package/dist/index/schema.d.ts +2 -2
  54. package/dist/index/schema.d.ts.map +1 -1
  55. package/dist/index/schema.js +1 -0
  56. package/dist/index/schema.js.map +1 -1
  57. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  58. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  59. package/dist/mcp/tools/cms-edit.js +4 -3
  60. package/dist/mcp/tools/cms-edit.js.map +1 -1
  61. package/dist/project/types.d.ts +3 -0
  62. package/dist/project/types.d.ts.map +1 -1
  63. package/dist/project/types.js +19 -1
  64. package/dist/project/types.js.map +1 -1
  65. package/dist/publish/attribution.d.ts +16 -0
  66. package/dist/publish/attribution.d.ts.map +1 -0
  67. package/dist/publish/attribution.js +28 -0
  68. package/dist/publish/attribution.js.map +1 -0
  69. package/dist/publish/classify.d.ts +15 -0
  70. package/dist/publish/classify.d.ts.map +1 -0
  71. package/dist/publish/classify.js +79 -0
  72. package/dist/publish/classify.js.map +1 -0
  73. package/dist/publish/cma.d.ts +33 -0
  74. package/dist/publish/cma.d.ts.map +1 -0
  75. package/dist/publish/cma.js +267 -0
  76. package/dist/publish/cma.js.map +1 -0
  77. package/dist/publish/fields.d.ts +9 -0
  78. package/dist/publish/fields.d.ts.map +1 -0
  79. package/dist/publish/fields.js +56 -0
  80. package/dist/publish/fields.js.map +1 -0
  81. package/dist/publish/permissions.d.ts +23 -0
  82. package/dist/publish/permissions.d.ts.map +1 -0
  83. package/dist/publish/permissions.js +131 -0
  84. package/dist/publish/permissions.js.map +1 -0
  85. package/dist/publish/plan.d.ts +116 -0
  86. package/dist/publish/plan.d.ts.map +1 -0
  87. package/dist/publish/plan.js +361 -0
  88. package/dist/publish/plan.js.map +1 -0
  89. package/dist/publish/revalidate-request.d.ts +29 -0
  90. package/dist/publish/revalidate-request.d.ts.map +1 -0
  91. package/dist/publish/revalidate-request.js +26 -0
  92. package/dist/publish/revalidate-request.js.map +1 -0
  93. package/dist/publish/store.d.ts +13 -0
  94. package/dist/publish/store.d.ts.map +1 -0
  95. package/dist/publish/store.js +102 -0
  96. package/dist/publish/store.js.map +1 -0
  97. package/dist/runtime/context.d.ts +5 -0
  98. package/dist/runtime/context.d.ts.map +1 -1
  99. package/dist/runtime/context.js.map +1 -1
  100. package/docs/FUNCTIONAL_SPEC.md +10 -7
  101. package/docs/editor-tasks/publish-handoff.md +24 -23
  102. package/docs/help/index.md +4 -2
  103. package/docs/help/person-from-json.md +2 -1
  104. package/docs/help/publish.md +45 -0
  105. package/package.json +2 -2
  106. package/skills/core/SKILL.md +4 -4
@@ -1,4 +1,8 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import path from 'node:path';
1
3
  import { MediaPipelineJobStore } from '../../../media-pipeline/job-store.js';
4
+ import { isAllowedExtraRoot } from '../../../publish/classify.js';
5
+ import { redisPlanStore } from '../../../publish/store.js';
2
6
  import { StagedUploadStore } from '../../../staged-upload/store.js';
3
7
  import { buildHostedConfig, handleHostedMcpRequest, isMcpUnauthorizedError, isTransientContentfulFailure, isUnusableContentfulCacheReason, loadHostedDeploymentFromEnv, oauthLogAuthFailure, oauthLogMcpHandlerError, patValidationFailureReason, RedisIndexCacheStore, RedisSessionStore, resolveContentfulTokenFromRequest, resolvePatForDeployment, runWithContentfulRequestStats, unauthorizedMcpResponse, } from '../../index.js';
4
8
  import { createOAuthHandlerContext } from '../context.js';
@@ -6,6 +10,18 @@ import { getHostedEditorPackPath } from '../editor-pack-path.js';
6
10
  import { createRedisClient } from '../redis.js';
7
11
  const redisClient = createRedisClient();
8
12
  const editorPackPath = getHostedEditorPackPath();
13
+ function readExtraRootContentTypes(packPath) {
14
+ try {
15
+ const raw = readFileSync(path.join(packPath, 'publish.json'), 'utf8');
16
+ const parsed = JSON.parse(raw);
17
+ if (!Array.isArray(parsed.extraRootContentTypes))
18
+ return [];
19
+ return parsed.extraRootContentTypes.filter((type) => typeof type === 'string' && isAllowedExtraRoot(type));
20
+ }
21
+ catch {
22
+ return [];
23
+ }
24
+ }
9
25
  export async function GET(request) {
10
26
  return handleMcp(request);
11
27
  }
@@ -83,6 +99,8 @@ async function handleMcpInner(request) {
83
99
  mediaPipelineJobStore: new MediaPipelineJobStore(redisClient),
84
100
  projectKey: deployment.projectKey,
85
101
  user: { userId: user.userId, email: user.email },
102
+ planStore: redisPlanStore(redisClient),
103
+ extraRootContentTypes: readExtraRootContentTypes(editorPackPath),
86
104
  onCmaUnauthorized: mcpSub === undefined
87
105
  ? undefined
88
106
  : async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../../../src/hosted/next/routes/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,+BAA+B,EAC/B,2BAA2B,EAC3B,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,oBAAoB,EACpB,iBAAiB,EACjB,iCAAiC,EACjC,uBAAuB,EACvB,6BAA6B,EAC7B,uBAAuB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K,IAAI,EAAE,CAAC,cAAc;YAC1C,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;gBACjB,UAAU,EAAE,UAAU,CAAC,UAAU;gBACjC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;gBACjD,OAAO,EAAE,UAAU,CAAC,OAAO;aAC5B,CAAC;YACF,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,cAAc,GAA8C,EAAE,CAAC;QACnE,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,2BAA2B,EAAE,CAAC;YACjD,cAAc,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,CAAC,UAAU,EAAE,CAAC;QACtF,CAAC;QAAC,MAAM,CAAC;YACP,4EAA4E;QAC9E,CAAC;QACD,uBAAuB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACjD,OAAO,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
@@ -1,8 +1,8 @@
1
1
  export declare const SCHEMA_VERSION = 5;
2
- export declare const CATALOG_CONTENT_TYPES: readonly ['page', 'article', 'pageVariant', 'template', 'articleType', 'tagType', 'tag', 'navigation', 'navigationItem', 'banner', 'pageTest', 'customType'];
2
+ export declare const CATALOG_CONTENT_TYPES: readonly ['page', 'article', 'pageVariant', 'template', 'articleType', 'personType', 'tagType', 'tag', 'navigation', 'navigationItem', 'banner', 'pageTest', 'customType'];
3
3
  export type CatalogContentType = (typeof CATALOG_CONTENT_TYPES)[number];
4
4
  /** @deprecated Use {@link CATALOG_CONTENT_TYPES}. */
5
- export declare const REFERENCE_CONTENT_TYPES: readonly ["page", "article", "pageVariant", "template", "articleType", "tagType", "tag", "navigation", "navigationItem", "banner", "pageTest", "customType"];
5
+ export declare const REFERENCE_CONTENT_TYPES: readonly ["page", "article", "pageVariant", "template", "articleType", "personType", "tagType", "tag", "navigation", "navigationItem", "banner", "pageTest", "customType"];
6
6
  /** @deprecated Use {@link CatalogContentType}. */
7
7
  export type ReferenceContentType = CatalogContentType;
8
8
  export declare function isCatalogContentType(type: string): type is CatalogContentType;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/index/schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,eAAO,MAAM,qBAAqB,YAChC,MAAM,EACN,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,SAAS,EACT,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,YAAY,CACJ,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,8JAAwB,CAAC;AAE7D,kDAAkD;AAClD,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,kBAAkB,CAE7E;AAED,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,oBAAoB,CAEjF;AAED,eAAO,MAAM,SAAS,uxBAsCrB,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,cAAc,ycAO1B,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,mTAIlC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,sBAAsB,iGAElC,CAAC;AAEF,eAAO,MAAM,GAAG,qmDAAoF,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/index/schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,eAAO,MAAM,qBAAqB,YAChC,MAAM,EACN,SAAS,EACT,aAAa,EACb,UAAU,EACV,aAAa,EACb,YAAY,EACZ,SAAS,EACT,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,YAAY,CACJ,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,4KAAwB,CAAC;AAE7D,kDAAkD;AAClD,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,kBAAkB,CAE7E;AAED,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,oBAAoB,CAEjF;AAED,eAAO,MAAM,SAAS,uxBAsCrB,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,cAAc,ycAO1B,CAAC;AAEF,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,mTAIlC,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,sBAAsB,iGAElC,CAAC;AAEF,eAAO,MAAM,GAAG,qmDAAoF,CAAC"}
@@ -5,6 +5,7 @@ export const CATALOG_CONTENT_TYPES = [
5
5
  'pageVariant',
6
6
  'template',
7
7
  'articleType',
8
+ 'personType',
8
9
  'tagType',
9
10
  'tag',
10
11
  'navigation',
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/index/schema.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC,MAAM,CAAC,MAAM,qBAAqB,GA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K7D,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAQ,qBAA2C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,sBAAsB,CAAC,IAAY;IACjD,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCxB,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;CAO7B,CAAC;AAEF,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAG;;;;CAIrC,CAAC;AAEF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,sBAAsB,GAAG;;CAErC,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,cAAc,GAAG,sBAAsB,GAAG,sBAAsB,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { HostedMcpInfo } from '../guide.js';
3
3
  import type { RunCmsEditFn } from '../types.js';
4
- export declare const TOOL_DESCRIPTION = "Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).\n\nUse hosted MCP only for content. Do not run a local cms-edit binary, --file, or stdin for pages.\n\nJSON-first (preferred for a whole page):\n [\"schema\", \"component\"] then [\"schema\", \"types\", \"component\"] \u2014 field ids and enums for THIS space\n [\"help\", \"create-from-json\"] or cms_edit_help {topic:\"create-from-json\"}\n Hosted payloads over 8192 bytes MUST use staged upload (kind=json), not --json / --json-base64.\n Filesystem client: write JSON on disk, cms_edit_request_staged_upload kind=json, curl, then\n [\"create\", \"from-json\", \"--staged\", \"<id>\", \"--dry-run\", \"--strict\"]\n Tiny JSON only: [\"create\", \"from-json\", \"--json\", \"{...}\", \"--dry-run\", \"--strict\"]\n Then the same command without --dry-run. Never publish.\n Edit existing: [\"open\", \"--page-slug\", \"/x\"] \u2192 [\"export\", \"from-json\"] \u2192 staged json \u2192 [\"apply\", \"from-json\", \"--staged\", \"<id>\"]\n Tiny patches only: set / rtf / add. Long Text (rawHtml/customCss/customJs): kind=text then set --staged.\n Object JSON, rtf --content, batch run, person/taxonomy imports: --staged when over 8k (kind=json or kind=text).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide or playbooks (including create-from-json).\n Topic \"workflow\" is the playbook; use topic \"guide/workflow\" for the short hosted-guide section.\nOutput: command JSON, then a last line {\"cma_requests\":N,\"cpa_requests\":N} (parse the last line for CMA counts; JSON.parse the command body separately).\nUse cms_edit_customer to read site-specific playbooks (articles, routing, blog-tag-matrix, etc.).\nIf Integrations only exposes cms_edit, use [\"customer\", \"index\"] or [\"customer\", \"resource=index\"] instead.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow (patches): open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nAll saves create drafts only \u2014 a human must publish in Contentful.\n\nCRITICAL \u2014 sessions and open:\n set/rtf field edits are staged until save. Plain open while dirty HARD-FAILS (does not wipe silently).\n [\"open\", \"--resume\"] \u2014 re-print current session; keeps all staged edits (no Contentful refetch)\n [\"open\", \"--overwrite\", \"--confirm-discard\", \"--id\", \"<id>\"] \u2014 abandon staged work and load a new entry\n [\"discard\"] then open \u2014 also valid abandon path\n Never re-open the same article mid-edit without save/discard \u2014 use --resume if you only need the tree again.\n\nCommon command sequences:\n [\"open\", \"--page-slug\", \"/\"] \u2014 homepage (CMS slug index; /index is equivalent)\n [\"open\", \"--page-slug\", \"/pricing\"] \u2014 load a page by slug (skips template menu/footer)\n [\"open\", \"--include-chrome\", \"--page-slug\", \"/pricing\"] \u2014 also fetch template nav chrome\n [\"open\", \"--id\", \"<entry-id>\"] \u2014 load by Contentful entry ID\n [\"open\", \"--resume\"] \u2014 keep staged work; re-print snapshot\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"--page-slug\", \"/pricing\"] \u2014 preview tree + root fields (no session)\n [\"peek\", \"--id\", \"<entry-id>\"] \u2014 preview by entry ID with rootFields in JSON\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"set\", \"<entry-id>\", \"autoplay\", \"true\"] \u2014 mid-session scalar by ID (e.g. media; no re-open)\n [\"set\", \"<entry-id>:autoplay=true\"] \u2014 same, batch-shaped token on page session\n [\"set\", \"@c1\", \"visual\", \"<media-id>\", \"--link\"] \u2014 single Entry link field only\n [\"set\", \"@c2\", \"contents\", \"<id1>,<id2>\", \"--links\"] \u2014 array of links (full replace); never --link on arrays\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"set\", \"@c1\", \"rawHtml\", \"--staged\", \"<id>\"] \u2014 long Text from staged upload (kind=text)\n [\"read\", \"@c0\", \"--hash\"] \u2014 byte lengths + sha256 (no bodies)\n [\"diff\"] \u2014 pending changes; long Text is bytes/sha256/head only\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"links\", \"set\", \"@c0\", \"0\", \"variant\", \"link\"] \u2014 set scalar field on link at index 0\n [\"batch\", \"set\", \"<entry-id>:variant=link\"] \u2014 scalar by ID (OK mid-page session; then save)\n [\"batch\", \"diff\"] \u2014 show pending batch edits\n [\"batch\", \"save\"] \u2014 save all batch edits as drafts\n [\"health\"] \u2014 verify config and connectivity\n [\"diagnose\"] \u2014 session/MCP diagnostics (store, userId, active session)\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n [\"customer\", \"index\"] \u2014 list site editor playbooks\n [\"customer\", \"articles\"] \u2014 read articles playbook\n [\"customer\", \"resource=index\"] \u2014 same as index (Integrations fallback)\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"] \u2014 recent articles by publication date\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\"] \u2014 list articles (preview index includes drafts)\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n [\"preview\", \"url\", \"/pricing\"] \u2014 staging page URL (open in browser MCP)\n [\"preview\", \"urls\", \"/pricing\"] \u2014 all preview targets; slug wins over leftover session root\n [\"nav\", \"open\", \"--nav-id\", \"<id>\"] \u2014 persist a navigation session (not --id)\n [\"nav\", \"open\", \"--nav-name\", \"Main menu\"] \u2014 same by navigation name\n [\"preview\", \"showcase\", \"--component\", \"HeroSimple\"] \u2014 component showcase URL (mock data)\n [\"preview\", \"showcase\", \"--collection\", \"CardGrid\", \"--param\", \"backgroundColour=Navy\"]\n\nDiscovery notes:\n Visual checks: use preview url / preview showcase, then open the returned URL with a browser MCP (cms-edit does not capture screenshots).\n peek/open/read --id load draft content via CMA \u2014 NOT published-only.\n Only list --published / resolve --published use the published-only Delivery API index.\n Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted Integrations).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session). open / nav open persist. preview urls /slug follows that slug even if _mcp is another page (JSON may include sessionRootIgnored).\nBefore set on a nested nav item (often a shared header CTA): ask whether the change is global or page-specific. Page-specific \u2192 new NavigationItem + page.menu (or a cloned menu), do not mutate the shared entry.\nTemplate menu is site-wide; page.menu overrides one page. nav clone is shallow for nested navigationItems.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (hosted: max 8192 bytes)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --staged \"<id>\" kind=text (or kind=json with --rtf-json)\n\nJSON bulk input (create/apply from-json, batch run, taxonomy/person/article-tags imports, set object fields, rtf patch):\n --json \"<string>\" inline JSON (hosted: max 8192 bytes)\n --json-base64 \"<b64>\" base64-encoded JSON (hosted: max 8192 decoded bytes)\n --staged \"<id>\" after cms_edit_request_staged_upload kind=json\n\nAsset upload (hosted MCP):\n Raster/video: cms_edit_request_staged_upload \u2192 curl \u2192 cms_edit_media prepare with stagedUploadIds \u2192 wait \u2192 catalog \u2192 import (video: import only; overrides[].alt required). Never asset upload --staged/--url/--base64 for jpeg/png/webp/gif/mp4. Never ffmpeg/convert GIF or PNG locally \u2014 leave the original file; the pipeline encodes (animated GIF \u2192 gif-converted MP4, mute-loop Media, not featuredImage).\n SVG/PDF/Lottie: [\"staged-upload\", \"request\", ...] then curl, then [\"asset\", \"upload\", \"--staged\", \"<id>\", ...].\n Long Text / large page JSON: cms_edit_request_staged_upload kind=text|json \u2192 curl \u2192 set --staged or create from-json --staged.\n Pipeline ready **image** URLs may use import or asset upload --url on a Blob pack host.";
4
+ export declare const TOOL_DESCRIPTION = "Run any cms-edit command. Saves create Contentful drafts. Publish, unpublish, archive, and revalidate are separate plan commands and run only after the user says yes.\n\nUse hosted MCP only for content. Do not run a local cms-edit binary, --file, or stdin for pages.\n\nJSON-first (preferred for a whole page):\n [\"schema\", \"component\"] then [\"schema\", \"types\", \"component\"] \u2014 field ids and enums for THIS space\n [\"help\", \"create-from-json\"] or cms_edit_help {topic:\"create-from-json\"}\n Hosted payloads over 8192 bytes MUST use staged upload (kind=json), not --json / --json-base64.\n Filesystem client: write JSON on disk, cms_edit_request_staged_upload kind=json, curl, then\n [\"create\", \"from-json\", \"--staged\", \"<id>\", \"--dry-run\", \"--strict\"]\n Tiny JSON only: [\"create\", \"from-json\", \"--json\", \"{...}\", \"--dry-run\", \"--strict\"]\n Then the same command without --dry-run. That writes drafts. Do not publish them in the same step.\n Edit existing: [\"open\", \"--page-slug\", \"/x\"] \u2192 [\"export\", \"from-json\"] \u2192 staged json \u2192 [\"apply\", \"from-json\", \"--staged\", \"<id>\"]\n Tiny patches only: set / rtf / add. Long Text (rawHtml/customCss/customJs): kind=text then set --staged.\n Object JSON, rtf --content, batch run, person/taxonomy imports: --staged when over 8k (kind=json or kind=text).\n\nUse cms_edit_version (no args) to check the installed version.\nUse cms_edit_help to read the getting-started guide or playbooks (including create-from-json).\n Topic \"workflow\" is the playbook; use topic \"guide/workflow\" for the short hosted-guide section.\nOutput: command JSON, then a last line {\"cma_requests\":N,\"cpa_requests\":N} (parse the last line for CMA counts; JSON.parse the command body separately).\nUse cms_edit_customer to read site-specific playbooks (articles, routing, blog-tag-matrix, etc.).\nIf Integrations only exposes cms_edit, use [\"customer\", \"index\"] or [\"customer\", \"resource=index\"] instead.\nRead the cms-edit://guide resource for the full guide.\n\nWorkflow (patches): open \u2192 snapshot \u2192 read/set/rtf/add/remove \u2192 diff \u2192 save\nSaves create drafts. To go live: publish plan \u2192 if the plan asks all vs mine, ask the user and publish choose \u2192 publish apply only after the user says yes.\nThe Contentful role must allow publish. AI Editor cannot. Same plan-then-yes rule for unpublish, archive, and revalidate.\n\nCRITICAL \u2014 sessions and open:\n set/rtf field edits are staged until save. Plain open while dirty HARD-FAILS (does not wipe silently).\n [\"open\", \"--resume\"] \u2014 re-print current session; keeps all staged edits (no Contentful refetch)\n [\"open\", \"--overwrite\", \"--confirm-discard\", \"--id\", \"<id>\"] \u2014 abandon staged work and load a new entry\n [\"discard\"] then open \u2014 also valid abandon path\n Never re-open the same article mid-edit without save/discard \u2014 use --resume if you only need the tree again.\n\nCommon command sequences:\n [\"open\", \"--page-slug\", \"/\"] \u2014 homepage (CMS slug index; /index is equivalent)\n [\"open\", \"--page-slug\", \"/pricing\"] \u2014 load a page by slug (skips template menu/footer)\n [\"open\", \"--include-chrome\", \"--page-slug\", \"/pricing\"] \u2014 also fetch template nav chrome\n [\"open\", \"--id\", \"<entry-id>\"] \u2014 load by Contentful entry ID\n [\"open\", \"--resume\"] \u2014 keep staged work; re-print snapshot\n [\"snapshot\"] \u2014 print content tree with @refs\n [\"read\", \"@c0\"] \u2014 read all fields of a component (requires open session)\n [\"read\", \"@c0\", \"heading\"] \u2014 read a specific field (requires open session)\n [\"read\", \"@root\"] \u2014 read root entry fields (requires open session)\n [\"read\", \"<entry-id>\", \"--id\"] \u2014 read entry by ID (no session)\n [\"read\", \"<entry-id>\", \"--id\", \"heading\"] \u2014 read one field by entry ID (no session)\n [\"peek\", \"--page-slug\", \"/pricing\"] \u2014 preview tree + root fields (no session)\n [\"peek\", \"--id\", \"<entry-id>\"] \u2014 preview by entry ID with rootFields in JSON\n [\"set\", \"@c0\", \"heading\", \"New heading\"] \u2014 set a scalar field\n [\"set\", \"<entry-id>\", \"autoplay\", \"true\"] \u2014 mid-session scalar by ID (e.g. media; no re-open)\n [\"set\", \"<entry-id>:autoplay=true\"] \u2014 same, batch-shaped token on page session\n [\"set\", \"@c1\", \"visual\", \"<media-id>\", \"--link\"] \u2014 single Entry link field only\n [\"set\", \"@c2\", \"contents\", \"<id1>,<id2>\", \"--links\"] \u2014 array of links (full replace); never --link on arrays\n [\"rtf\", \"@c0\", \"body\", \"--content\", \"# H1\\n\\nBody.\"] \u2014 set rich text (preferred for AI)\n [\"rtf\", \"@c0\", \"body\", \"--base64\", \"<encoded>\"] \u2014 set rich text via base64 (no filesystem)\n [\"set\", \"@c1\", \"rawHtml\", \"--staged\", \"<id>\"] \u2014 long Text from staged upload (kind=text)\n [\"read\", \"@c0\", \"--hash\"] \u2014 byte lengths + sha256 (no bodies)\n [\"diff\"] \u2014 pending changes; long Text is bytes/sha256/head only\n [\"save\"] \u2014 write drafts to Contentful\n [\"discard\"] \u2014 discard unsaved changes\n [\"links\", \"set\", \"@c0\", \"0\", \"variant\", \"link\"] \u2014 set scalar field on link at index 0\n [\"batch\", \"set\", \"<entry-id>:variant=link\"] \u2014 scalar by ID (OK mid-page session; then save)\n [\"batch\", \"diff\"] \u2014 show pending batch edits\n [\"batch\", \"save\"] \u2014 save all batch edits as drafts\n [\"health\"] \u2014 verify config and connectivity\n [\"diagnose\"] \u2014 session/MCP diagnostics (store, userId, active session)\n [\"version\"] \u2014 print installed cms-edit version\n [\"guide\"] \u2014 print getting-started guide\n [\"guide\", \"workflow\"] \u2014 print a guide section\n [\"customer\", \"index\"] \u2014 list site editor playbooks\n [\"customer\", \"articles\"] \u2014 read articles playbook\n [\"customer\", \"resource=index\"] \u2014 same as index (Integrations fallback)\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"] \u2014 recent articles by publication date\n [\"list\", \"--type\", \"article\", \"--sort\", \"date\"] \u2014 list articles (preview index includes drafts)\n [\"peek\", \"--article-slug\", \"<slug>\"] \u2014 preview draft or published article (CMA)\n [\"preview\", \"url\", \"/pricing\"] \u2014 staging page URL (open in browser MCP)\n [\"preview\", \"urls\", \"/pricing\"] \u2014 all preview targets; slug wins over leftover session root\n [\"nav\", \"open\", \"--nav-id\", \"<id>\"] \u2014 persist a navigation session (not --id)\n [\"nav\", \"open\", \"--nav-name\", \"Main menu\"] \u2014 same by navigation name\n [\"preview\", \"showcase\", \"--component\", \"HeroSimple\"] \u2014 component showcase URL (mock data)\n [\"preview\", \"showcase\", \"--collection\", \"CardGrid\", \"--param\", \"backgroundColour=Navy\"]\n\nDiscovery notes:\n Visual checks: use preview url / preview showcase, then open the returned URL with a browser MCP (cms-edit does not capture screenshots).\n peek/open/read --id load draft content via CMA \u2014 NOT published-only.\n Only list --published / resolve --published use the published-only Delivery API index.\n Articles: use --article-slug (not --page-slug). search --type article sorts by publication date.\n\nSessions persist between MCP calls (Redis on hosted, disk locally). MCP auto-uses session \"_mcp\" unless you pass --session.\nUse --session <name> before the subcommand to isolate concurrent workflows, e.g. [\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"].\nUse --space <name> to target a specific Contentful space (local MCP only \u2014 omit for hosted Integrations).\nStateless read (no open required): [\"read\", \"<entry-id>\", \"--id\"] or [\"read\", \"<entry-id>\", \"--id\", \"heading\"].\npeek is one-shot (no session). open / nav open persist. preview urls /slug follows that slug even if _mcp is another page (JSON may include sessionRootIgnored).\nBefore set on a nested nav item (often a shared header CTA): ask whether the change is global or page-specific. Page-specific \u2192 new NavigationItem + page.menu (or a cloned menu), do not mutate the shared entry.\nTemplate menu is site-wide; page.menu overrides one page. nav clone is shallow for nested navigationItems.\nOutput is always JSON (CMS_EDIT_JSON=1 is forced by the MCP server).\n\n\nRich text tips:\n --content \"<markdown>\" preferred named flag for inline content (hosted: max 8192 bytes)\n --base64 \"<encoded>\" fully environment-agnostic, no filesystem needed\n --staged \"<id>\" kind=text (or kind=json with --rtf-json)\n\nJSON bulk input (create/apply from-json, batch run, taxonomy/person/article-tags imports, set object fields, rtf patch):\n --json \"<string>\" inline JSON (hosted: max 8192 bytes)\n --json-base64 \"<b64>\" base64-encoded JSON (hosted: max 8192 decoded bytes)\n --staged \"<id>\" after cms_edit_request_staged_upload kind=json\n\nAsset upload (hosted MCP):\n Raster/video: cms_edit_request_staged_upload \u2192 curl \u2192 cms_edit_media prepare with stagedUploadIds \u2192 wait \u2192 catalog \u2192 import (video: import only; overrides[].alt required). Never asset upload --staged/--url/--base64 for jpeg/png/webp/gif/mp4. Never ffmpeg/convert GIF or PNG locally \u2014 leave the original file; the pipeline encodes (animated GIF \u2192 gif-converted MP4, mute-loop Media, not featuredImage).\n SVG/PDF/Lottie: [\"staged-upload\", \"request\", ...] then curl, then [\"asset\", \"upload\", \"--staged\", \"<id>\", ...].\n Long Text / large page JSON: cms_edit_request_staged_upload kind=text|json \u2192 curl \u2192 set --staged or create from-json --staged.\n Pipeline ready **image** URLs may use import or asset upload --url on a Blob pack host.";
5
5
  export declare function registerCmsEditTools(server: McpServer, runCmsEdit: RunCmsEditFn, hosted?: HostedMcpInfo): void;
6
6
  export declare function getMcpServerInfo(hosted?: HostedMcpInfo): {
7
7
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,wkVAgH6D,CAAC;AAE3F,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,YAAY,EACxB,MAAM,CAAC,EAAE,aAAa,GACrB,IAAI,CAmEN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAE1F"}
1
+ {"version":3,"file":"cms-edit.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,gBAAgB,g6VAiH6D,CAAC;AAE3F,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,YAAY,EACxB,MAAM,CAAC,EAAE,aAAa,GACrB,IAAI,CAmEN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAE1F"}
@@ -3,7 +3,7 @@ import { sessionLog, sessionLogVerbose } from '../../session/log.js';
3
3
  import { CMS_EDIT_VERSION, getVersionInfo } from '../../version.js';
4
4
  import { buildHostedVersionPayload, getHostedMcpServerName, prefixHostedToolDescription, } from '../hosted-metadata.js';
5
5
  import { withMcpSession } from '../session-args.js';
6
- export const TOOL_DESCRIPTION = `Run any cms-edit command. cms-edit edits Contentful draft content (no publishing).
6
+ export const TOOL_DESCRIPTION = `Run any cms-edit command. Saves create Contentful drafts. Publish, unpublish, archive, and revalidate are separate plan commands and run only after the user says yes.
7
7
 
8
8
  Use hosted MCP only for content. Do not run a local cms-edit binary, --file, or stdin for pages.
9
9
 
@@ -14,7 +14,7 @@ JSON-first (preferred for a whole page):
14
14
  Filesystem client: write JSON on disk, cms_edit_request_staged_upload kind=json, curl, then
15
15
  ["create", "from-json", "--staged", "<id>", "--dry-run", "--strict"]
16
16
  Tiny JSON only: ["create", "from-json", "--json", "{...}", "--dry-run", "--strict"]
17
- Then the same command without --dry-run. Never publish.
17
+ Then the same command without --dry-run. That writes drafts. Do not publish them in the same step.
18
18
  Edit existing: ["open", "--page-slug", "/x"] → ["export", "from-json"] → staged json → ["apply", "from-json", "--staged", "<id>"]
19
19
  Tiny patches only: set / rtf / add. Long Text (rawHtml/customCss/customJs): kind=text then set --staged.
20
20
  Object JSON, rtf --content, batch run, person/taxonomy imports: --staged when over 8k (kind=json or kind=text).
@@ -28,7 +28,8 @@ If Integrations only exposes cms_edit, use ["customer", "index"] or ["customer",
28
28
  Read the cms-edit://guide resource for the full guide.
29
29
 
30
30
  Workflow (patches): open → snapshot → read/set/rtf/add/remove → diff → save
31
- All saves create drafts only — a human must publish in Contentful.
31
+ Saves create drafts. To go live: publish plan → if the plan asks all vs mine, ask the user and publish choose → publish apply only after the user says yes.
32
+ The Contentful role must allow publish. AI Editor cannot. Same plan-then-yes rule for unpublish, archive, and revalidate.
32
33
 
33
34
  CRITICAL — sessions and open:
34
35
  set/rtf field edits are staged until save. Plain open while dirty HARD-FAILS (does not wipe silently).
@@ -1 +1 @@
1
- {"version":3,"file":"cms-edit.js","sourceRoot":"","sources":["../../../src/mcp/tools/cms-edit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEpE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0FAgH0D,CAAC;AAE3F,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,UAAwB,EACxB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,kBAAkB,EAClB,2BAA2B,CACzB,8JAA8J,EAC9J,MAAM,CACP,EACD,EAAE,EACF,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;QAC9B,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;iBAC9D;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAA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cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;gBACvC,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC,CAAC;YACH,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,UAAU,GACd,KAAK;YACL,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACrC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC3B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC/B,UAAU,CAAC,eAAe,EAAE;YAC1B,UAAU;YACV,IAAI,EAAE,UAAU,IAAI,MAAM;YAC1B,EAAE,EAAE,CAAC,UAAU;YACf,WAAW,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;SACxC,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxD,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAsB;IACrD,OAAO,EAAE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC7E,CAAC"}
@@ -49,6 +49,9 @@ export declare const CmsEditProjectSchema: z.ZodObject<{
49
49
  featuredImageAssetId: z.ZodOptional<z.ZodString>;
50
50
  }, z.core.$strip>>;
51
51
  }, z.core.$strip>>;
52
+ publish: z.ZodOptional<z.ZodObject<{
53
+ extraRootContentTypes: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ }, z.core.$strip>>;
52
55
  }, z.core.$strip>;
53
56
  export type CmsEditProject = z.infer<typeof CmsEditProjectSchema>;
54
57
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB;;;;;;;iBAS/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmC/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,+FAA+F;AAC/F,eAAO,MAAM,oBAAoB;;;;;;;iBAS/B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAExE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoD7B,CAAC;AAEL,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { isAllowedExtraRoot } from '../publish/classify.js';
2
3
  export const EditorDefaultsSchema = z.object({
3
4
  featuredImageAssetFilename: z.string().min(1).optional(),
4
5
  featuredImageAssetId: z.string().min(1).optional(),
@@ -14,7 +15,8 @@ export const MarkdownAccessSchema = z.object({
14
15
  people: z.string().min(1).optional(),
15
16
  notes: z.string().optional(),
16
17
  });
17
- export const CmsEditProjectSchema = z.object({
18
+ export const CmsEditProjectSchema = z
19
+ .object({
18
20
  projectKey: z
19
21
  .string()
20
22
  .min(1)
@@ -49,5 +51,21 @@ export const CmsEditProjectSchema = z.object({
49
51
  defaults: EditorDefaultsSchema.optional(),
50
52
  })
51
53
  .optional(),
54
+ publish: z
55
+ .object({
56
+ extraRootContentTypes: z.array(z.string().min(1)).optional(),
57
+ })
58
+ .optional(),
59
+ })
60
+ .superRefine((project, ctx) => {
61
+ for (const contentType of project.publish?.extraRootContentTypes ?? []) {
62
+ if (!isAllowedExtraRoot(contentType)) {
63
+ ctx.addIssue({
64
+ code: 'custom',
65
+ path: ['publish', 'extraRootContentTypes'],
66
+ message: `${contentType} cannot be a publish root. It has no production revalidation handler.`,
67
+ });
68
+ }
69
+ }
52
70
  });
53
71
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/project/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACxD,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAIH,+FAA+F;AAC/F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;I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F,MAAM,EAAE,CAAC;SACN,MAAM,CAAC;QACN,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;KAC1C,CAAC;SACD,QAAQ,EAAE;IACb,OAAO,EAAE,CAAC;SACP,MAAM,CAAC;QACN,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KAC7D,CAAC;SACD,QAAQ,EAAE;CACd,CAAC;KACD,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;IAC5B,KAAK,MAAM,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,qBAAqB,IAAI,EAAE,EAAE,CAAC;QACvE,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,uBAAuB,CAAC;gBAC1C,OAAO,EAAE,GAAG,WAAW,uEAAuE;aAC/F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ export type Attribution = 'mine' | 'theirs' | 'mixed';
2
+ export interface AttributionInput {
3
+ userId: string;
4
+ version: number;
5
+ publishedVersion?: number | null;
6
+ updatedById?: string;
7
+ createdById?: string;
8
+ }
9
+ /**
10
+ * Contentful only stores the latest editor on the entry. Snapshots are taken
11
+ * on publish, not on each draft save. One save after publish
12
+ * (version === publishedVersion + 2) has a single editor. More than one save
13
+ * is mixed when we cannot prove every save was this user.
14
+ */
15
+ export declare function attributeChange(input: AttributionInput): Attribution;
16
+ //# sourceMappingURL=attribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../src/publish/attribution.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,WAAW,CAkBpE"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Contentful only stores the latest editor on the entry. Snapshots are taken
3
+ * on publish, not on each draft save. One save after publish
4
+ * (version === publishedVersion + 2) has a single editor. More than one save
5
+ * is mixed when we cannot prove every save was this user.
6
+ */
7
+ export function attributeChange(input) {
8
+ const { userId, version, publishedVersion, updatedById, createdById } = input;
9
+ const updatedIsUser = updatedById === userId;
10
+ const createdIsUser = createdById === userId;
11
+ if (publishedVersion == null) {
12
+ if (!updatedById)
13
+ return 'mixed';
14
+ if (updatedIsUser && (!createdById || createdIsUser))
15
+ return 'mine';
16
+ if (updatedIsUser || createdIsUser)
17
+ return 'mixed';
18
+ return 'theirs';
19
+ }
20
+ const savesAfterPublish = version - publishedVersion - 1;
21
+ if (savesAfterPublish <= 1) {
22
+ if (!updatedById)
23
+ return 'mixed';
24
+ return updatedIsUser ? 'mine' : 'theirs';
25
+ }
26
+ return 'mixed';
27
+ }
28
+ //# sourceMappingURL=attribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution.js","sourceRoot":"","sources":["../../src/publish/attribution.ts"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,KAAuB;IACrD,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9E,MAAM,aAAa,GAAG,WAAW,KAAK,MAAM,CAAC;IAC7C,MAAM,aAAa,GAAG,WAAW,KAAK,MAAM,CAAC;IAE7C,IAAI,gBAAgB,IAAI,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,WAAW;YAAE,OAAO,OAAO,CAAC;QACjC,IAAI,aAAa,IAAI,CAAC,CAAC,WAAW,IAAI,aAAa,CAAC;YAAE,OAAO,MAAM,CAAC;QACpE,IAAI,aAAa,IAAI,aAAa;YAAE,OAAO,OAAO,CAAC;QACnD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,iBAAiB,GAAG,OAAO,GAAG,gBAAgB,GAAG,CAAC,CAAC;IACzD,IAAI,iBAAiB,IAAI,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,WAAW;YAAE,OAAO,OAAO,CAAC;QACjC,OAAO,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Content types that have a production revalidation handler.
3
+ * Keep this aligned with REVALIDATION_WEBHOOK_ENTRY_CONTENT_TYPES in
4
+ * @se-studio/contentful-rest-api (contentful-cms does not depend on that package).
5
+ */
6
+ export declare const WEBHOOK_CONTENT_TYPES: readonly ['article', 'articleType', 'banner', 'customType', 'document', 'link', 'location', 'navigation', 'navigationItem', 'page', 'pageVariant', 'person', 'personType', 'schema', 'tag', 'tagType', 'template'];
7
+ export declare const DEFAULT_ROOT_CONTENT_TYPES: readonly ['article', 'articleType', 'customType', 'page', 'pageVariant', 'person', 'personType', 'tag', 'tagType'];
8
+ export type ContentClass = 'root' | 'webhook' | 'embedded' | 'refused';
9
+ export declare function isAllowedExtraRoot(contentType: string): boolean;
10
+ export declare function rootContentTypes(extraRoots: readonly string[]): Set<string>;
11
+ export declare function classifyContentType(contentType: string | undefined, extraRoots: readonly string[]): ContentClass;
12
+ /** Shared chrome. A page publish must not walk into it. */
13
+ export declare function isSharedTemplate(contentType: string | undefined): boolean;
14
+ export declare function cascadeNote(contentType: string | undefined): string | undefined;
15
+ //# sourceMappingURL=classify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../../src/publish/classify.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,YAChC,SAAS,EACT,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,MAAM,EACN,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,SAAS,EACT,UAAU,CACF,CAAC;AAEX,eAAO,MAAM,0BAA0B,YACrC,SAAS,EACT,aAAa,EACb,YAAY,EACZ,MAAM,EACN,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,SAAS,CACD,CAAC;AAKX,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,CAM3E;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,YAAY,CAKd;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzE;AAqBD,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAG/E"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Content types that have a production revalidation handler.
3
+ * Keep this aligned with REVALIDATION_WEBHOOK_ENTRY_CONTENT_TYPES in
4
+ * @se-studio/contentful-rest-api (contentful-cms does not depend on that package).
5
+ */
6
+ export const WEBHOOK_CONTENT_TYPES = [
7
+ 'article',
8
+ 'articleType',
9
+ 'banner',
10
+ 'customType',
11
+ 'document',
12
+ 'link',
13
+ 'location',
14
+ 'navigation',
15
+ 'navigationItem',
16
+ 'page',
17
+ 'pageVariant',
18
+ 'person',
19
+ 'personType',
20
+ 'schema',
21
+ 'tag',
22
+ 'tagType',
23
+ 'template',
24
+ ];
25
+ export const DEFAULT_ROOT_CONTENT_TYPES = [
26
+ 'article',
27
+ 'articleType',
28
+ 'customType',
29
+ 'page',
30
+ 'pageVariant',
31
+ 'person',
32
+ 'personType',
33
+ 'tag',
34
+ 'tagType',
35
+ ];
36
+ const webhookSet = new Set(WEBHOOK_CONTENT_TYPES);
37
+ const defaultRootSet = new Set(DEFAULT_ROOT_CONTENT_TYPES);
38
+ export function isAllowedExtraRoot(contentType) {
39
+ return webhookSet.has(contentType);
40
+ }
41
+ export function rootContentTypes(extraRoots) {
42
+ const roots = new Set(defaultRootSet);
43
+ for (const type of extraRoots) {
44
+ if (isAllowedExtraRoot(type))
45
+ roots.add(type);
46
+ }
47
+ return roots;
48
+ }
49
+ export function classifyContentType(contentType, extraRoots) {
50
+ if (!contentType || contentType === 'redirect')
51
+ return 'refused';
52
+ if (rootContentTypes(extraRoots).has(contentType))
53
+ return 'root';
54
+ if (webhookSet.has(contentType))
55
+ return 'webhook';
56
+ return 'embedded';
57
+ }
58
+ /** Shared chrome. A page publish must not walk into it. */
59
+ export function isSharedTemplate(contentType) {
60
+ return contentType === 'template';
61
+ }
62
+ const CASCADE_NOTES = {
63
+ schema: 'Publishing schema refreshes page, article, tag, person, articleType, and customType caches. Those pages are not republished.',
64
+ template: 'Publishing a template refreshes page, article, tag, person, and articleType caches. Those pages are not republished.',
65
+ articleType: 'Publishing an article type refreshes article caches and the sitemap. Articles are not republished.',
66
+ customType: 'Publishing a custom type refreshes tag and person caches and the sitemap. Those pages are not republished.',
67
+ navigation: 'Publishing navigation refreshes menu caches. Pages that show the menu are not republished.',
68
+ navigationItem: 'Publishing a navigation item refreshes menu caches. Pages that show the menu are not republished.',
69
+ link: 'Publishing a link refreshes link caches. Pages are not republished.',
70
+ banner: 'Publishing a banner refreshes banner caches. Pages are not republished.',
71
+ location: 'Publishing a location refreshes that location cache. Pages are not republished.',
72
+ document: 'Publishing a document refreshes that document cache.',
73
+ };
74
+ export function cascadeNote(contentType) {
75
+ if (!contentType)
76
+ return undefined;
77
+ return CASCADE_NOTES[contentType];
78
+ }
79
+ //# sourceMappingURL=classify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify.js","sourceRoot":"","sources":["../../src/publish/classify.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,SAAS;IACT,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,MAAM;IACN,UAAU;IACV,YAAY;IACZ,gBAAgB;IAChB,MAAM;IACN,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,QAAQ;IACR,KAAK;IACL,SAAS;IACT,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,SAAS;IACT,aAAa;IACb,YAAY;IACZ,MAAM;IACN,aAAa;IACb,QAAQ;IACR,YAAY;IACZ,KAAK;IACL,SAAS;CACD,CAAC;AAEX,MAAM,UAAU,GAAG,IAAI,GAAG,CAAS,qBAAqB,CAAC,CAAC;AAC1D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS,0BAA0B,CAAC,CAAC;AAInE,MAAM,UAAU,kBAAkB,CAAC,WAAmB;IACpD,OAAO,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,UAA6B;IAC5D,MAAM,KAAK,GAAG,IAAI,GAAG,CAAS,cAAc,CAAC,CAAC;IAC9C,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,IAAI,kBAAkB,CAAC,IAAI,CAAC;YAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,WAA+B,EAC/B,UAA6B;IAE7B,IAAI,CAAC,WAAW,IAAI,WAAW,KAAK,UAAU;QAAE,OAAO,SAAS,CAAC;IACjE,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,MAAM,CAAC;IACjE,IAAI,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC;QAAE,OAAO,SAAS,CAAC;IAClD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,gBAAgB,CAAC,WAA+B;IAC9D,OAAO,WAAW,KAAK,UAAU,CAAC;AACpC,CAAC;AAED,MAAM,aAAa,GAA2B;IAC5C,MAAM,EACJ,8HAA8H;IAChI,QAAQ,EACN,sHAAsH;IACxH,WAAW,EACT,oGAAoG;IACtG,UAAU,EACR,4GAA4G;IAC9G,UAAU,EACR,4FAA4F;IAC9F,cAAc,EACZ,mGAAmG;IACrG,IAAI,EAAE,qEAAqE;IAC3E,MAAM,EAAE,yEAAyE;IACjF,QAAQ,EAAE,iFAAiF;IAC3F,QAAQ,EAAE,sDAAsD;CACjE,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,WAA+B;IACzD,IAAI,CAAC,WAAW;QAAE,OAAO,SAAS,CAAC;IACnC,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC;AACpC,CAAC"}
@@ -0,0 +1,33 @@
1
+ import type { SpaceConfig } from '../config/types.js';
2
+ import { type PermissionInput, type ReleasePermission } from './permissions.js';
3
+ import { type EntryParent, type GraphNode } from './plan.js';
4
+ export interface ReleaseCma {
5
+ userId: string;
6
+ locale: string;
7
+ productionSiteUrl?: string;
8
+ bypassToken?: string;
9
+ permissions: PermissionInput;
10
+ can(action: ReleasePermission, node: GraphNode): {
11
+ allowed: boolean;
12
+ reason?: string;
13
+ };
14
+ loadNodes(ids: string[], extraRoots: readonly string[]): Promise<Map<string, GraphNode>>;
15
+ loadByContentType(contentType: string, since: string | undefined, limit: number): Promise<{
16
+ nodes: GraphNode[];
17
+ total: number;
18
+ }>;
19
+ loadParents(entryId: string): Promise<EntryParent[]>;
20
+ loadUpstream(entryId: string, extraRoots: readonly string[]): Promise<{
21
+ nodes: GraphNode[];
22
+ truncated: boolean;
23
+ }>;
24
+ loadInbound(entryId: string): Promise<GraphNode[]>;
25
+ publishEntry(id: string, expectedVersion: number): Promise<void>;
26
+ touchEntry(id: string, expectedVersion: number): Promise<void>;
27
+ publishAsset(id: string, expectedVersion: number): Promise<void>;
28
+ unpublishEntry(id: string): Promise<void>;
29
+ archiveEntry(id: string): Promise<void>;
30
+ entryFields(id: string): Promise<Record<string, Record<string, unknown>> | undefined>;
31
+ }
32
+ export declare function createReleaseCma(space: SpaceConfig): Promise<ReleaseCma>;
33
+ //# sourceMappingURL=cma.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cma.d.ts","sourceRoot":"","sources":["../../src/publish/cma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKtD,OAAO,EAAoB,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,SAAS,EACf,MAAM,WAAW,CAAC;AA0DnB,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,eAAe,CAAC;IAC7B,GAAG,CAAC,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,SAAS,GAAG;QAAE,OAAO,EAAE,OAAO,CAAC;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