@se-studio/contentful-cms 1.0.91 → 1.2.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 (202) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +56 -2
  3. package/dist/cli/program.d.ts.map +1 -1
  4. package/dist/cli/program.js +10 -1
  5. package/dist/cli/program.js.map +1 -1
  6. package/dist/commands/asset.d.ts.map +1 -1
  7. package/dist/commands/asset.js +233 -56
  8. package/dist/commands/asset.js.map +1 -1
  9. package/dist/commands/create-from-json.d.ts.map +1 -1
  10. package/dist/commands/create-from-json.js +63 -69
  11. package/dist/commands/create-from-json.js.map +1 -1
  12. package/dist/commands/create-taxonomy-from-json.d.ts +4 -0
  13. package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -0
  14. package/dist/commands/create-taxonomy-from-json.js +79 -0
  15. package/dist/commands/create-taxonomy-from-json.js.map +1 -0
  16. package/dist/commands/create-taxonomy.d.ts +29 -0
  17. package/dist/commands/create-taxonomy.d.ts.map +1 -0
  18. package/dist/commands/create-taxonomy.js +191 -0
  19. package/dist/commands/create-taxonomy.js.map +1 -0
  20. package/dist/commands/create.d.ts.map +1 -1
  21. package/dist/commands/create.js +17 -36
  22. package/dist/commands/create.js.map +1 -1
  23. package/dist/commands/ensure.d.ts +4 -0
  24. package/dist/commands/ensure.d.ts.map +1 -0
  25. package/dist/commands/ensure.js +95 -0
  26. package/dist/commands/ensure.js.map +1 -0
  27. package/dist/commands/help.js +1 -1
  28. package/dist/commands/help.js.map +1 -1
  29. package/dist/commands/index-dump.d.ts +15 -0
  30. package/dist/commands/index-dump.d.ts.map +1 -0
  31. package/dist/commands/index-dump.js +207 -0
  32. package/dist/commands/index-dump.js.map +1 -0
  33. package/dist/commands/index.d.ts +4 -0
  34. package/dist/commands/index.d.ts.map +1 -0
  35. package/dist/commands/index.js +102 -0
  36. package/dist/commands/index.js.map +1 -0
  37. package/dist/commands/list.d.ts.map +1 -1
  38. package/dist/commands/list.js +147 -20
  39. package/dist/commands/list.js.map +1 -1
  40. package/dist/commands/resolve-options.d.ts +20 -0
  41. package/dist/commands/resolve-options.d.ts.map +1 -0
  42. package/dist/commands/resolve-options.js +51 -0
  43. package/dist/commands/resolve-options.js.map +1 -0
  44. package/dist/commands/resolve.d.ts.map +1 -1
  45. package/dist/commands/resolve.js +138 -27
  46. package/dist/commands/resolve.js.map +1 -1
  47. package/dist/commands/skill.d.ts.map +1 -1
  48. package/dist/commands/skill.js +11 -35
  49. package/dist/commands/skill.js.map +1 -1
  50. package/dist/config/load.d.ts.map +1 -1
  51. package/dist/config/load.js +10 -0
  52. package/dist/config/load.js.map +1 -1
  53. package/dist/config/types.d.ts +14 -0
  54. package/dist/config/types.d.ts.map +1 -1
  55. package/dist/contentful/asset-link-from-json.d.ts +17 -0
  56. package/dist/contentful/asset-link-from-json.d.ts.map +1 -0
  57. package/dist/contentful/asset-link-from-json.js +41 -0
  58. package/dist/contentful/asset-link-from-json.js.map +1 -0
  59. package/dist/contentful/assets.d.ts +19 -8
  60. package/dist/contentful/assets.d.ts.map +1 -1
  61. package/dist/contentful/assets.js +82 -31
  62. package/dist/contentful/assets.js.map +1 -1
  63. package/dist/contentful/cda-sync.d.ts +43 -0
  64. package/dist/contentful/cda-sync.d.ts.map +1 -0
  65. package/dist/contentful/cda-sync.js +157 -0
  66. package/dist/contentful/cda-sync.js.map +1 -0
  67. package/dist/contentful/delivery-token.d.ts +17 -0
  68. package/dist/contentful/delivery-token.d.ts.map +1 -0
  69. package/dist/contentful/delivery-token.js +103 -0
  70. package/dist/contentful/delivery-token.js.map +1 -0
  71. package/dist/contentful/entry-fields.d.ts +71 -0
  72. package/dist/contentful/entry-fields.d.ts.map +1 -0
  73. package/dist/contentful/entry-fields.js +341 -0
  74. package/dist/contentful/entry-fields.js.map +1 -0
  75. package/dist/contentful/fetch.d.ts +11 -1
  76. package/dist/contentful/fetch.d.ts.map +1 -1
  77. package/dist/contentful/fetch.js +30 -6
  78. package/dist/contentful/fetch.js.map +1 -1
  79. package/dist/contentful/field-value-from-json.d.ts +24 -0
  80. package/dist/contentful/field-value-from-json.d.ts.map +1 -0
  81. package/dist/contentful/field-value-from-json.js +205 -0
  82. package/dist/contentful/field-value-from-json.js.map +1 -0
  83. package/dist/contentful/list-entry-format.d.ts +18 -0
  84. package/dist/contentful/list-entry-format.d.ts.map +1 -0
  85. package/dist/contentful/list-entry-format.js +45 -0
  86. package/dist/contentful/list-entry-format.js.map +1 -0
  87. package/dist/contentful/media.d.ts +24 -0
  88. package/dist/contentful/media.d.ts.map +1 -0
  89. package/dist/contentful/media.js +70 -0
  90. package/dist/contentful/media.js.map +1 -0
  91. package/dist/contentful/reference-record.d.ts +32 -0
  92. package/dist/contentful/reference-record.d.ts.map +1 -0
  93. package/dist/contentful/reference-record.js +58 -0
  94. package/dist/contentful/reference-record.js.map +1 -0
  95. package/dist/contentful/regex.d.ts +14 -0
  96. package/dist/contentful/regex.d.ts.map +1 -0
  97. package/dist/contentful/regex.js +38 -0
  98. package/dist/contentful/regex.js.map +1 -0
  99. package/dist/contentful/resolve-content-type.d.ts +9 -0
  100. package/dist/contentful/resolve-content-type.d.ts.map +1 -0
  101. package/dist/contentful/resolve-content-type.js +38 -0
  102. package/dist/contentful/resolve-content-type.js.map +1 -0
  103. package/dist/contentful/upload-fetch.d.ts +11 -0
  104. package/dist/contentful/upload-fetch.d.ts.map +1 -0
  105. package/dist/contentful/upload-fetch.js +26 -0
  106. package/dist/contentful/upload-fetch.js.map +1 -0
  107. package/dist/contentful/upload-limits.d.ts +7 -0
  108. package/dist/contentful/upload-limits.d.ts.map +1 -0
  109. package/dist/contentful/upload-limits.js +13 -0
  110. package/dist/contentful/upload-limits.js.map +1 -0
  111. package/dist/generated/hosted-guide.d.ts +1 -1
  112. package/dist/generated/hosted-guide.d.ts.map +1 -1
  113. package/dist/generated/hosted-guide.js +1 -1
  114. package/dist/generated/hosted-guide.js.map +1 -1
  115. package/dist/generated/version.d.ts +1 -1
  116. package/dist/generated/version.d.ts.map +1 -1
  117. package/dist/generated/version.js +1 -1
  118. package/dist/generated/version.js.map +1 -1
  119. package/dist/index/db.d.ts +12 -0
  120. package/dist/index/db.d.ts.map +1 -0
  121. package/dist/index/db.js +29 -0
  122. package/dist/index/db.js.map +1 -0
  123. package/dist/index/errors.d.ts +18 -0
  124. package/dist/index/errors.d.ts.map +1 -0
  125. package/dist/index/errors.js +18 -0
  126. package/dist/index/errors.js.map +1 -0
  127. package/dist/index/mode.d.ts +7 -0
  128. package/dist/index/mode.d.ts.map +1 -0
  129. package/dist/index/mode.js +9 -0
  130. package/dist/index/mode.js.map +1 -0
  131. package/dist/index/paths.d.ts +6 -0
  132. package/dist/index/paths.d.ts.map +1 -0
  133. package/dist/index/paths.js +23 -0
  134. package/dist/index/paths.js.map +1 -0
  135. package/dist/index/query.d.ts +105 -0
  136. package/dist/index/query.d.ts.map +1 -0
  137. package/dist/index/query.js +338 -0
  138. package/dist/index/query.js.map +1 -0
  139. package/dist/index/reference-lookup.d.ts +18 -0
  140. package/dist/index/reference-lookup.d.ts.map +1 -0
  141. package/dist/index/reference-lookup.js +107 -0
  142. package/dist/index/reference-lookup.js.map +1 -0
  143. package/dist/index/require.d.ts +21 -0
  144. package/dist/index/require.d.ts.map +1 -0
  145. package/dist/index/require.js +54 -0
  146. package/dist/index/require.js.map +1 -0
  147. package/dist/index/run-sync.d.ts +18 -0
  148. package/dist/index/run-sync.d.ts.map +1 -0
  149. package/dist/index/run-sync.js +48 -0
  150. package/dist/index/run-sync.js.map +1 -0
  151. package/dist/index/schema.d.ts +6 -0
  152. package/dist/index/schema.d.ts.map +1 -0
  153. package/dist/index/schema.js +48 -0
  154. package/dist/index/schema.js.map +1 -0
  155. package/dist/index/sync-lock.d.ts +8 -0
  156. package/dist/index/sync-lock.d.ts.map +1 -0
  157. package/dist/index/sync-lock.js +85 -0
  158. package/dist/index/sync-lock.js.map +1 -0
  159. package/dist/index/sync.d.ts +42 -0
  160. package/dist/index/sync.d.ts.map +1 -0
  161. package/dist/index/sync.js +235 -0
  162. package/dist/index/sync.js.map +1 -0
  163. package/dist/mcp/guide.d.ts +2 -2
  164. package/dist/mcp/guide.d.ts.map +1 -1
  165. package/dist/mcp/guide.js +3 -0
  166. package/dist/mcp/guide.js.map +1 -1
  167. package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
  168. package/dist/mcp/prompts/onboarding.js +61 -0
  169. package/dist/mcp/prompts/onboarding.js.map +1 -1
  170. package/dist/output/json.d.ts +6 -0
  171. package/dist/output/json.d.ts.map +1 -1
  172. package/dist/output/json.js +21 -0
  173. package/dist/output/json.js.map +1 -1
  174. package/dist/output/terminal-table.d.ts +15 -0
  175. package/dist/output/terminal-table.d.ts.map +1 -0
  176. package/dist/output/terminal-table.js +60 -0
  177. package/dist/output/terminal-table.js.map +1 -0
  178. package/dist/setup/wizard.d.ts.map +1 -1
  179. package/dist/setup/wizard.js +23 -1
  180. package/dist/setup/wizard.js.map +1 -1
  181. package/dist/skills/install.d.ts +13 -0
  182. package/dist/skills/install.d.ts.map +1 -0
  183. package/dist/skills/install.js +37 -0
  184. package/dist/skills/install.js.map +1 -0
  185. package/docs/FUNCTIONAL_SPEC.md +11 -0
  186. package/docs/MEDIA_INDEX_PLAN.md +256 -0
  187. package/docs/SKILLS.md +29 -0
  188. package/docs/help/create-from-json.md +54 -2
  189. package/docs/help/fields-article.md +5 -0
  190. package/docs/help/fields-component.md +11 -1
  191. package/docs/help/fields-page.md +2 -0
  192. package/docs/help/fields-taxonomy.md +154 -0
  193. package/docs/help/index-sync.md +108 -0
  194. package/docs/help/index.md +16 -0
  195. package/docs/help/taxonomy-from-json.md +115 -0
  196. package/docs/mcp/hosted-guide.md +16 -1
  197. package/package.json +9 -4
  198. package/skills/README.md +30 -0
  199. package/skills/core/SKILL.md +873 -0
  200. package/skills/manifest.json +5 -0
  201. package/skills/setup/SKILL.md +129 -0
  202. package/skills/templates/SKILL.md +21 -0
@@ -0,0 +1,5 @@
1
+ {
2
+ "core": "Use cms-edit CLI to read/edit Contentful content (open → snapshot → read → set/rtf → diff → save).",
3
+ "templates": "Create or edit templates (preContent, postContent, menu, footer, colours) in Contentful via cms-edit.",
4
+ "setup": "Guide a user through installing and configuring the cms-edit MCP server for Claude Desktop."
5
+ }
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: contentful-cms-setup
3
+ description: "Guide a user through installing and configuring the cms-edit MCP server for Claude Desktop."
4
+ ---
5
+
6
+ # Skill: cms-edit Setup
7
+
8
+ Use this skill when the user wants to install or configure the `cms-edit` MCP server so Claude Desktop can read and edit Contentful content.
9
+
10
+ ## Choose the setup path first
11
+
12
+ | Path | When to use |
13
+ |------|-------------|
14
+ | **Hosted (`.mcpb`)** | User is a content editor; SE sent a `.mcpb` file; no Node.js |
15
+ | **Local (setup wizard)** | Developer; multi-space; or no hosted deployment |
16
+
17
+ Ask which applies if unclear.
18
+
19
+ ---
20
+
21
+ ## Hosted setup (`.mcpb` extension)
22
+
23
+ Use when the user has a **`.mcpb` file** from SE (e.g. `cms-edit-om1.mcpb`). Do **not** run the setup wizard.
24
+
25
+ ### Step 1: Get a Contentful token
26
+
27
+ Same as local — tell the user to create a **personal access token** in Contentful (Settings → CMA tokens), name it `Claude Desktop`, and copy it.
28
+
29
+ ### Step 2: Install the extension
30
+
31
+ 1. Open [Claude Desktop](https://claude.ai/download)
32
+ 2. **Settings → Extensions → Install Extension…** (or double-click the `.mcpb` file)
33
+ 3. Paste the Contentful token when prompted
34
+ 4. Fully quit and reopen Claude Desktop
35
+
36
+ Full editor guide: `packages/contentful-cms/HOSTED.md`
37
+
38
+ ### Step 3: Verify
39
+
40
+ In Claude, ask to list pages or open the homepage. If `cms_edit` returns content, setup is complete.
41
+
42
+ **Token update:** Settings → Extensions → open the cms-edit extension → update token.
43
+
44
+ ---
45
+
46
+ ## Local setup (setup wizard)
47
+
48
+ ## Overview
49
+
50
+ The setup wizard handles everything automatically:
51
+ - Collects the Contentful Management Token
52
+ - Discovers spaces and environments via the Contentful API
53
+ - Writes `~/.contentful-cms.json`
54
+ - Updates the Claude Desktop config to register the `cms-edit` MCP server
55
+
56
+ ## Prerequisites
57
+
58
+ The user needs:
59
+ 1. **Node.js** installed (LTS version from [nodejs.org](https://nodejs.org))
60
+ 2. **A Contentful Management Token** — see Step 1 below
61
+
62
+ ## Step 1: Get a Management Token
63
+
64
+ Tell the user:
65
+
66
+ > To get your Contentful Management Token:
67
+ > 1. Log in to [contentful.com](https://app.contentful.com)
68
+ > 2. Go to **Settings → API keys**
69
+ > 3. Click the **Content management tokens** tab
70
+ > 4. Click **Generate personal token**, name it `Claude Desktop`, and click **Generate**
71
+ > 5. Copy the token — you won't see it again
72
+
73
+ Ask them to confirm they have the token before continuing.
74
+
75
+ ## Step 2: Run the Setup Wizard
76
+
77
+ Tell the user to open a terminal and run:
78
+
79
+ ```bash
80
+ npx @se-studio/contentful-cms@latest setup
81
+ ```
82
+
83
+ Walk them through what each prompt means:
84
+
85
+ | Prompt | What to enter |
86
+ |--------|--------------|
87
+ | **Contentful Management Token** | The token they just copied (input will be hidden) |
88
+ | **Which Contentful space?** | Only appears if the token has multiple spaces — pick the one they want to connect |
89
+ | **Which environment?** | Auto-selects `master`; only asks if no `master` environment exists |
90
+ | **Short name for this project** | A slug like `my-project` or `om1` — used as the key in the config file |
91
+ | **Staging site URL** | Optional — their Vercel preview URL (e.g. `https://my-project.vercel.app`) |
92
+ | **Vercel bypass token** | Optional — only if their staging site has deployment protection |
93
+
94
+ ## Step 3: Restart Claude Desktop
95
+
96
+ After the wizard completes, tell the user:
97
+
98
+ > Fully quit Claude Desktop and reopen it.
99
+ > - **Mac:** Right-click the Dock icon → **Quit** (closing the window isn't enough)
100
+ > - **Windows/Linux:** Close and reopen from the Start menu
101
+
102
+ ## Step 4: Verify
103
+
104
+ Once they've reopened Claude Desktop, verify the setup worked by using the `cms_edit` tool:
105
+
106
+ ```
107
+ cms_edit ["open", "/"]
108
+ ```
109
+
110
+ If it returns a page structure, setup is complete. If it errors, see Troubleshooting below.
111
+
112
+ ## Troubleshooting
113
+
114
+ **"Invalid management token"**
115
+ → The token may have been copied incorrectly or already expired. Generate a new one in Contentful and run the wizard again.
116
+
117
+ **"No spaces found"**
118
+ → The token doesn't have access to any spaces. Check Contentful's token permissions — it needs at least read access to one space.
119
+
120
+ **`cms_edit` tool not available after restart**
121
+ → Check the Claude Desktop config was written correctly:
122
+ - Mac: `~/Library/Application Support/Claude/claude_desktop_config.json`
123
+ - Windows: `%APPDATA%\Claude\claude_desktop_config.json`
124
+ - Linux: `~/.config/Claude/claude_desktop_config.json`
125
+
126
+ It should contain an `mcpServers.cms-edit` entry. If missing, run the wizard again.
127
+
128
+ **Adding another space**
129
+ → Run `npx @se-studio/contentful-cms@latest setup` again — it merges the new space into the existing config.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: contentful-cms-templates
3
+ description: "Create or edit templates (preContent, postContent, menu, footer, colours) in Contentful via cms-edit."
4
+ ---
5
+
6
+ # Skill: contentful-cms — Templates
7
+
8
+ Use this skill when creating or editing **templates** (layout shells with preContent, postContent, menu, footer) in Contentful via `cms-edit`.
9
+
10
+ ## Workflow
11
+
12
+ 1. **Create** a template: `cms-edit create template --label 'Campaign Landing'`
13
+ 2. **List** templates: `cms-edit list --type template`
14
+ 3. **Open** by ID: `cms-edit open <template-id> --id`
15
+ 4. Edit content: set **preContent** and **postContent** (content arrays) via session snapshot refs; use `add`, `set`, `remove`, `move` as for pages. Set **menu** and **footer** (single navigation links) with `cms-edit set @ref menu <nav-entry-id> --link` and same for `footer`.
16
+ 5. Set **colours**: `cms-edit set @ref backgroundColour Navy`, `cms-edit set @ref textColour White` (or project colour names).
17
+ 6. **Save**: `cms-edit save`
18
+
19
+ ## Related skills
20
+
21
+ See the **core** skill for the full workflow (open, snapshot, set, save). For menu/footer navigation entries use the **navigation** skill.