@se-studio/contentful-cms 3.8.0 → 3.9.1
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/CHANGELOG.md +12 -0
- package/README.md +7 -6
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +15 -9
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/runner.d.ts +4 -0
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runner.js +29 -3
- package/dist/cli/runner.js.map +1 -1
- package/dist/commands/apply-from-json.d.ts +4 -0
- package/dist/commands/apply-from-json.d.ts.map +1 -0
- package/dist/commands/apply-from-json.js +198 -0
- package/dist/commands/apply-from-json.js.map +1 -0
- package/dist/commands/assignment-value.d.ts +6 -0
- package/dist/commands/assignment-value.d.ts.map +1 -0
- package/dist/commands/assignment-value.js +13 -0
- package/dist/commands/assignment-value.js.map +1 -0
- package/dist/commands/batch-assignments.d.ts.map +1 -1
- package/dist/commands/batch-assignments.js +2 -1
- package/dist/commands/batch-assignments.js.map +1 -1
- package/dist/commands/create-from-json.d.ts +9 -0
- package/dist/commands/create-from-json.d.ts.map +1 -1
- package/dist/commands/create-from-json.js +187 -113
- package/dist/commands/create-from-json.js.map +1 -1
- package/dist/commands/export-from-json.d.ts +4 -0
- package/dist/commands/export-from-json.d.ts.map +1 -0
- package/dist/commands/export-from-json.js +28 -0
- package/dist/commands/export-from-json.js.map +1 -0
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +18 -32
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +9 -3
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/multiset-assignments.d.ts.map +1 -1
- package/dist/commands/multiset-assignments.js +2 -1
- package/dist/commands/multiset-assignments.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +28 -10
- package/dist/commands/schema.js.map +1 -1
- package/dist/contentful/cma-user-agent.d.ts +1 -1
- package/dist/contentful/create-from-json-types.d.ts +56 -0
- package/dist/contentful/create-from-json-types.d.ts.map +1 -0
- package/dist/contentful/create-from-json-types.js +24 -0
- package/dist/contentful/create-from-json-types.js.map +1 -0
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +5 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/field-value-from-json.d.ts +2 -1
- package/dist/contentful/field-value-from-json.d.ts.map +1 -1
- package/dist/contentful/field-value-from-json.js +16 -11
- package/dist/contentful/field-value-from-json.js.map +1 -1
- package/dist/contentful/link-fields.d.ts +4 -1
- package/dist/contentful/link-fields.d.ts.map +1 -1
- package/dist/contentful/link-fields.js +8 -2
- package/dist/contentful/link-fields.js.map +1 -1
- package/dist/contentful/media.d.ts +1 -0
- package/dist/contentful/media.d.ts.map +1 -1
- package/dist/contentful/media.js +1 -1
- package/dist/contentful/media.js.map +1 -1
- package/dist/contentful/session-to-from-json.d.ts +7 -0
- package/dist/contentful/session-to-from-json.d.ts.map +1 -0
- package/dist/contentful/session-to-from-json.js +180 -0
- package/dist/contentful/session-to-from-json.js.map +1 -0
- package/dist/contentful/set-field-schema.d.ts +1 -0
- package/dist/contentful/set-field-schema.d.ts.map +1 -1
- package/dist/contentful/set-field-schema.js +8 -0
- package/dist/contentful/set-field-schema.js.map +1 -1
- package/dist/contentful/validate-from-json.d.ts +12 -0
- package/dist/contentful/validate-from-json.d.ts.map +1 -0
- package/dist/contentful/validate-from-json.js +106 -0
- package/dist/contentful/validate-from-json.js.map +1 -0
- package/dist/contentful/write.d.ts +8 -4
- package/dist/contentful/write.d.ts.map +1 -1
- package/dist/contentful/write.js +45 -21
- package/dist/contentful/write.js.map +1 -1
- package/dist/generated/help-topics.d.ts +3 -0
- package/dist/generated/help-topics.d.ts.map +1 -0
- package/dist/generated/help-topics.js +4 -0
- package/dist/generated/help-topics.js.map +1 -0
- package/dist/generated/hosted-guide.d.ts +1 -1
- package/dist/generated/hosted-guide.d.ts.map +1 -1
- package/dist/generated/hosted-guide.js +1 -1
- package/dist/generated/hosted-guide.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/hosted/index.d.ts +1 -1
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/hosted/index.js +1 -1
- package/dist/hosted/index.js.map +1 -1
- package/dist/index/reference-lookup.d.ts +5 -1
- package/dist/index/reference-lookup.d.ts.map +1 -1
- package/dist/index/reference-lookup.js +19 -2
- package/dist/index/reference-lookup.js.map +1 -1
- package/dist/mcp/http-handler.d.ts.map +1 -1
- package/dist/mcp/http-handler.js +2 -3
- package/dist/mcp/http-handler.js.map +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +2 -3
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/cms-edit.d.ts +1 -1
- package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
- package/dist/mcp/tools/cms-edit.js +15 -2
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/dist/mcp/tools/help.d.ts.map +1 -1
- package/dist/mcp/tools/help.js +47 -6
- package/dist/mcp/tools/help.js.map +1 -1
- package/docs/editor-tasks/create-page.md +6 -6
- package/docs/help/create-from-json.md +24 -1
- package/docs/help/index.md +3 -1
- package/docs/mcp/hosted-guide.md +18 -7
- package/package.json +5 -5
- package/skills/core/SKILL.md +22 -25
package/docs/mcp/hosted-guide.md
CHANGED
|
@@ -22,7 +22,7 @@ All `save` operations create **drafts only**. A human must review and publish in
|
|
|
22
22
|
| `cms_edit` | Run any cms-edit command via an `args` array |
|
|
23
23
|
| `cms_edit_request_staged_upload` | Get a presigned upload URL for binary files (then `curl` + `asset upload --staged`) |
|
|
24
24
|
| `cms_edit_version` | Check the installed cms-edit version (no session required) |
|
|
25
|
-
| `cms_edit_help` |
|
|
25
|
+
| `cms_edit_help` | Guide topics (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) **or** playbooks (`create-from-json`, `fields-component`, …) |
|
|
26
26
|
|
|
27
27
|
## Customer editor pack (read first)
|
|
28
28
|
|
|
@@ -183,18 +183,29 @@ Read `cms-edit://customer/defaults` when present. Otherwise:
|
|
|
183
183
|
|
|
184
184
|
Run `["index", "sync"]` before resolving assets by filename.
|
|
185
185
|
|
|
186
|
+
## JSON payloads (filesystem vs no filesystem)
|
|
187
|
+
|
|
188
|
+
Hosted MCP cannot see your disk. Same commands either way:
|
|
189
|
+
|
|
190
|
+
- **Filesystem client:** write `page.json`, then `cms_edit ["create", "from-json", "--json-base64", "<base64 of file>", "--dry-run", "--strict"]`
|
|
191
|
+
- **No filesystem (Desktop):** put the JSON in `--json` on the tool call
|
|
192
|
+
|
|
193
|
+
Never use a local `cms-edit` binary, `--file`, or stdin for content.
|
|
194
|
+
|
|
186
195
|
## Create content
|
|
187
196
|
|
|
188
197
|
### Create a page
|
|
189
198
|
|
|
190
199
|
```
|
|
191
|
-
["
|
|
192
|
-
["
|
|
193
|
-
["create", "
|
|
194
|
-
["
|
|
200
|
+
["schema", "component"]
|
|
201
|
+
["help", "create-from-json"]
|
|
202
|
+
["create", "from-json", "--json", "{...}", "--dry-run", "--strict"]
|
|
203
|
+
["create", "from-json", "--json", "{...}"]
|
|
195
204
|
```
|
|
196
205
|
|
|
197
|
-
|
|
206
|
+
Use `"components"` (not `"content"`) and nested `"type"` (not `"componentType"`). Peek a live entry or `schema <ct>` before authoring field ids.
|
|
207
|
+
|
|
208
|
+
Empty `components` fails validation. Incremental `add`/`set` is for tiny patches only.
|
|
198
209
|
|
|
199
210
|
### Create an article
|
|
200
211
|
|
|
@@ -349,6 +360,6 @@ After upgrading cms-edit, run `["index", "sync"]` once so the local index includ
|
|
|
349
360
|
|
|
350
361
|
**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content "<md>"`, `diff`, `save`, `discard`
|
|
351
362
|
|
|
352
|
-
**Creating:** `create
|
|
363
|
+
**Creating:** `create from-json --json … --dry-run --strict`, `export from-json`, `apply from-json --json …`, `create page` / `create article` for empty shells, `add` for tiny inserts
|
|
353
364
|
|
|
354
365
|
**Other:** `health`, `version`, `guide [topic]`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/contentful-cms",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.1",
|
|
4
4
|
"description": "CLI tool for AI agents to read and edit Contentful draft content without publish permissions",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@biomejs/biome": "^2.5.10",
|
|
75
|
-
"@types/node": "^
|
|
75
|
+
"@types/node": "^24.13.3",
|
|
76
76
|
"@types/react": "^19.2.18",
|
|
77
|
-
"@types/react-dom": "^19.2.
|
|
78
|
-
"@upstash/redis": "^1.38.
|
|
79
|
-
"next": "^16.3.
|
|
77
|
+
"@types/react-dom": "^19.2.5",
|
|
78
|
+
"@upstash/redis": "^1.38.3",
|
|
79
|
+
"next": "^16.3.3",
|
|
80
80
|
"react": "^19.2.8",
|
|
81
81
|
"react-dom": "^19.2.8",
|
|
82
82
|
"typescript": "^7.0.2",
|
package/skills/core/SKILL.md
CHANGED
|
@@ -13,14 +13,13 @@ Use this skill when you need to read or edit content in Contentful using **hoste
|
|
|
13
13
|
|
|
14
14
|
## Overview
|
|
15
15
|
|
|
16
|
-
`cms-edit` lets you read and edit Contentful draft content without publishing.
|
|
16
|
+
`cms-edit` lets you read and edit Contentful draft content without publishing.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
6. `save` to write drafts to Contentful (NEVER publishes)
|
|
18
|
+
**New page/article:** `schema` for this space → `create from-json --dry-run --strict` → `create from-json` (`--json` or `--json-base64`). Nested tree key is `components`; discriminator is `type`.
|
|
19
|
+
|
|
20
|
+
**Edit a tree:** `open` → `export from-json` → edit JSON → `apply from-json`. Tiny patches: `set` / `rtf` / `add` then `diff` → `save`.
|
|
21
|
+
|
|
22
|
+
**Never publish.** Hosted MCP cannot see your disk — send JSON in the tool call.
|
|
24
23
|
|
|
25
24
|
## Safety Rules
|
|
26
25
|
|
|
@@ -159,15 +158,10 @@ Markdown support:
|
|
|
159
158
|
- `` `inline code` ``
|
|
160
159
|
- `---` for horizontal rule
|
|
161
160
|
|
|
162
|
-
For
|
|
161
|
+
For multi-paragraph Markdown, pass `--content` or `--base64` on MCP (no stdin, no `--file`):
|
|
163
162
|
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
printf '## Why it matters\n\nOur platform helps teams **move faster**.\n\n- Instant setup\n- No code required\n' | cms-edit rtf @c1 body --markdown -
|
|
167
|
-
|
|
168
|
-
# Also correct — file input
|
|
169
|
-
cms-edit rtf @c1 body --markdown --content "# Heading\n\nBody."
|
|
170
|
-
cms-edit rtf @c1 body --markdown - < path/to/file.md
|
|
163
|
+
```
|
|
164
|
+
cms_edit ["rtf", "@c1", "body", "--content", "## Why it matters\n\nOur platform helps teams **move faster**."]
|
|
171
165
|
```
|
|
172
166
|
|
|
173
167
|
Single-line content (no newlines) can be passed as a quoted argument directly:
|
|
@@ -679,12 +673,11 @@ cms-edit peek --id <entryId> # Look up by entry ID
|
|
|
679
673
|
|
|
680
674
|
## Batch Operations (batch run)
|
|
681
675
|
|
|
682
|
-
Run a sequence of operations from
|
|
676
|
+
Run a sequence of operations from `--json` or `--json-base64` (hosted MCP).
|
|
683
677
|
|
|
684
|
-
```
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
cms-edit batch run --json '[...]' --dry-run # Validate without saving
|
|
678
|
+
```
|
|
679
|
+
cms_edit ["batch", "run", "--json", "[...]"]
|
|
680
|
+
cms_edit ["batch", "run", "--json-base64", "<b64>", "--dry-run"]
|
|
688
681
|
```
|
|
689
682
|
|
|
690
683
|
Supported ops: `open`, `set`, `rtf`, `rtf-replace`, `save`, `add`, `links-add`.
|
|
@@ -715,13 +708,17 @@ Example `ops.json` — update an existing page with a new CTA that has two butto
|
|
|
715
708
|
|
|
716
709
|
## Create Page or Article from JSON
|
|
717
710
|
|
|
718
|
-
Create a complete page or article
|
|
711
|
+
Create a complete page or article from `--json` or `--json-base64`. Dry-run is local (no CMA) once the index is warm.
|
|
719
712
|
|
|
720
|
-
```bash
|
|
721
|
-
cms-edit create from-json --json '{...}' # Create from inline JSON
|
|
722
|
-
cms-edit create from-json --json '{...}' --dry-run # Preview without writing
|
|
723
|
-
cat page.json | cms-edit create from-json # Pipe from stdin
|
|
724
713
|
```
|
|
714
|
+
cms_edit ["help", "create-from-json"]
|
|
715
|
+
cms_edit ["create", "from-json", "--json", "{...}", "--dry-run", "--strict"]
|
|
716
|
+
cms_edit ["create", "from-json", "--json-base64", "<b64>"]
|
|
717
|
+
cms_edit ["export", "from-json"]
|
|
718
|
+
cms_edit ["apply", "from-json", "--json-base64", "<b64>"]
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
Use `"components"` not `"content"`. Nested discriminator is `"type"` not `"componentType"`. Empty `components` fails. `schema <contentType>` for this space’s field ids.
|
|
725
722
|
|
|
726
723
|
**Page JSON schema:**
|
|
727
724
|
|