@se-studio/contentful-cms 3.7.4 → 3.9.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.
- package/CHANGELOG.md +12 -0
- package/HOSTED.md +1 -1
- package/README.md +9 -8
- package/dist/bin/cms-edit.js +5 -0
- package/dist/bin/cms-edit.js.map +1 -1
- package/dist/cli/local-cli-allowed.d.ts +6 -0
- package/dist/cli/local-cli-allowed.d.ts.map +1 -0
- package/dist/cli/local-cli-allowed.js +28 -0
- package/dist/cli/local-cli-allowed.js.map +1 -0
- 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/config/types.d.ts +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/hosted/next/page-styles.js +1 -1
- package/dist/hosted/next/page-styles.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/guide.js +2 -2
- package/dist/mcp/guide.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/FUNCTIONAL_SPEC.md +1 -1
- package/docs/editor-tasks/create-page.md +6 -6
- package/docs/editor-tasks/media-reuse-and-upload.md +1 -1
- 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 +3 -3
- package/skills/core/SKILL.md +28 -30
- package/skills/manifest.json +1 -1
|
@@ -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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+GAmG+E,CAAC;AAEhH,MAAM,UAAU,oBAAoB,CAClC,MAAiB,EACjB,UAAwB,EACxB,MAAsB;IAEtB,MAAM,CAAC,IAAI,CACT,kBAAkB,EA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,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/help.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGzE,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAGrB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CAuEhF"}
|
package/dist/mcp/tools/help.js
CHANGED
|
@@ -1,20 +1,61 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { EMBEDDED_HELP_TOPIC_NAMES, EMBEDDED_HELP_TOPICS } from '../../generated/help-topics.js';
|
|
2
3
|
import { GUIDE_TOPICS, getGuideTopicMarkdown, } from '../guide.js';
|
|
3
4
|
import { prefixHostedToolDescription } from '../hosted-metadata.js';
|
|
4
5
|
export function registerHelpTool(server, hosted) {
|
|
5
|
-
server.tool('cms_edit_help', prefixHostedToolDescription('Return
|
|
6
|
+
server.tool('cms_edit_help', prefixHostedToolDescription('Return cms-edit help: getting-started guide topics (overview, workflow, commands, troubleshooting, hosted) or embedded playbooks (create-from-json, workflow, fields, …). No Contentful credentials required.', hosted), {
|
|
6
7
|
topic: z
|
|
7
|
-
.
|
|
8
|
+
.string()
|
|
8
9
|
.optional()
|
|
9
|
-
.describe(
|
|
10
|
+
.describe(`Guide: ${GUIDE_TOPICS.join(', ')} (default overview). Playbooks: ${EMBEDDED_HELP_TOPIC_NAMES.join(', ')}.`),
|
|
10
11
|
}, async ({ topic }) => {
|
|
11
|
-
const resolvedTopic =
|
|
12
|
-
const
|
|
12
|
+
const resolvedTopic = topic ?? 'overview';
|
|
13
|
+
const guideAlias = resolvedTopic.startsWith('guide/')
|
|
14
|
+
? resolvedTopic.slice('guide/'.length)
|
|
15
|
+
: resolvedTopic === 'guide'
|
|
16
|
+
? 'overview'
|
|
17
|
+
: undefined;
|
|
18
|
+
if (guideAlias && GUIDE_TOPICS.includes(guideAlias)) {
|
|
19
|
+
const markdown = getGuideTopicMarkdown(guideAlias, hosted);
|
|
20
|
+
return {
|
|
21
|
+
content: [
|
|
22
|
+
{
|
|
23
|
+
type: 'text',
|
|
24
|
+
text: JSON.stringify({ ok: true, topic: resolvedTopic, markdown }),
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const playbook = EMBEDDED_HELP_TOPICS[resolvedTopic];
|
|
30
|
+
if (playbook) {
|
|
31
|
+
return {
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: JSON.stringify({ ok: true, topic: resolvedTopic, markdown: playbook }),
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (GUIDE_TOPICS.includes(resolvedTopic)) {
|
|
41
|
+
const markdown = getGuideTopicMarkdown(resolvedTopic, hosted);
|
|
42
|
+
return {
|
|
43
|
+
content: [
|
|
44
|
+
{
|
|
45
|
+
type: 'text',
|
|
46
|
+
text: JSON.stringify({ ok: true, topic: resolvedTopic, markdown }),
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
13
51
|
return {
|
|
14
52
|
content: [
|
|
15
53
|
{
|
|
16
54
|
type: 'text',
|
|
17
|
-
text: JSON.stringify({
|
|
55
|
+
text: JSON.stringify({
|
|
56
|
+
ok: false,
|
|
57
|
+
error: `Unknown help topic "${resolvedTopic}". Guide: ${GUIDE_TOPICS.join(', ')}. Playbooks: ${EMBEDDED_HELP_TOPIC_NAMES.join(', ')}.`,
|
|
58
|
+
}),
|
|
18
59
|
},
|
|
19
60
|
],
|
|
20
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/mcp/tools/help.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EAEZ,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE,MAAM,UAAU,gBAAgB,CAAC,MA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`cms-edit`)** — invoked with subcommands and arguments from a terminal or shell script.
|
|
12
12
|
|
|
13
|
-
**Hosted MCP server** — deployed per site at `/api/mcp` (OAuth). Exposes `cms_edit`, `cms_edit_help`, `cms_edit_customer`, guide/customer resources, and onboarding prompts. Local stdio MCP is not supported
|
|
13
|
+
**Hosted MCP server** — deployed per site at `/api/mcp` (OAuth). Exposes `cms_edit`, `cms_edit_help`, `cms_edit_customer`, guide/customer resources, and onboarding prompts. Local stdio MCP is not supported. The local `cms-edit` binary is for pack/host tooling only.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
@@ -17,13 +17,13 @@
|
|
|
17
17
|
|
|
18
18
|
## Steps
|
|
19
19
|
|
|
20
|
-
1. `cms_edit ["
|
|
21
|
-
2. `
|
|
22
|
-
3. `
|
|
23
|
-
4.
|
|
24
|
-
5. `
|
|
20
|
+
1. `cms_edit ["schema", "component"]` and `cms_edit ["schema", "types", "component"]` — this space’s fields/enums
|
|
21
|
+
2. `cms_edit_help` topic `create-from-json` (or `cms_edit ["help", "create-from-json"]`)
|
|
22
|
+
3. Draft JSON with `"components"` and nested `"type"`. Filesystem: `--json-base64`. Desktop: `--json`.
|
|
23
|
+
4. `cms_edit ["create", "from-json", "--json", "{…}", "--dry-run", "--strict"]` then without `--dry-run`
|
|
24
|
+
5. To edit later: `open` → `export from-json` → `apply from-json`
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
`add` / `set` / `rtf` only for tiny patches after the tree exists.
|
|
27
27
|
|
|
28
28
|
After each `add`, set `heading` then `cmsLabel` (not left as `New Generic`).
|
|
29
29
|
|
|
@@ -78,7 +78,7 @@ The URL must be fetchable by the hosted MCP server. Do not use local-only URLs.
|
|
|
78
78
|
|
|
79
79
|
### Local CLI (only when user approves)
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
Hosted MCP uses `cms_edit_request_staged_upload` then `asset upload --staged`. Do not use the local `cms-edit` CLI for uploads.
|
|
82
82
|
|
|
83
83
|
## Link uploaded asset to an entry
|
|
84
84
|
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
# cms-edit create from-json — Complete Guide
|
|
2
2
|
|
|
3
|
-
`create from-json` creates a complete new page or article — including all components, collections, and CTA links — from
|
|
3
|
+
`create from-json` creates a complete new page or article — including all components, collections, and CTA links — from `--json` or `--json-base64`. It is the recommended way to create new pages on hosted MCP.
|
|
4
|
+
|
|
5
|
+
**Agents:** do not use a local `cms-edit` binary, `--file`, or stdin. Filesystem clients encode the file as `--json-base64`. Desktop clients pass `--json` in the `cms_edit` args array.
|
|
6
|
+
|
|
7
|
+
Also: `export from-json` (open session → same JSON with `existingId` / `version`) and `apply from-json` (validate, then update/create).
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
cms_edit ["help", "create-from-json"]
|
|
11
|
+
cms_edit_help { "topic": "create-from-json" }
|
|
12
|
+
cms_edit ["create", "from-json", "--json", "{...}", "--dry-run", "--strict"]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Validation traps (fail before CMA)
|
|
16
|
+
|
|
17
|
+
- Nested tree key is **`components`**, not `content` (`content` is a page field — empty page).
|
|
18
|
+
- Discriminator is **`type`**, not `componentType` / `collectionType`.
|
|
19
|
+
- **`components` must be non-empty**.
|
|
20
|
+
- Unknown nested keys fail (`html` vs `htmlContent` — run `schema htmlComponent` for this space).
|
|
21
|
+
- CTA text is **`label`**, not `linkText`.
|
|
22
|
+
- Quoted `set @c1:field="value"` is rejected (quotes would be stored). Use `["set", "@c1", "field", "value"]`.
|
|
23
|
+
|
|
24
|
+
Dry-run does not call CMA (slug checks use the local CDA index).
|
|
25
|
+
|
|
26
|
+
---
|
|
4
27
|
|
|
5
28
|
```bash
|
|
6
29
|
cms-edit create from-json --json '{...}'
|
package/docs/help/index.md
CHANGED
|
@@ -126,7 +126,9 @@ cms-edit batch run --json '[...]'
|
|
|
126
126
|
### Content Creation
|
|
127
127
|
| Command | Description |
|
|
128
128
|
|---|---|
|
|
129
|
-
| `create from-json` | Create a page/article from
|
|
129
|
+
| `create from-json` | Create a page/article from `--json` / `--json-base64` |
|
|
130
|
+
| `export from-json` | Export the open session as from-json |
|
|
131
|
+
| `apply from-json` | Apply from-json to the open session |
|
|
130
132
|
| `create taxonomy-from-json` | Batch-create tagType, articleType, and tag entries |
|
|
131
133
|
| `create person-from-json` | Batch-create person entries from JSON |
|
|
132
134
|
| `create person` | Create a person entry (draft) |
|
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.0",
|
|
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,9 +72,9 @@
|
|
|
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.
|
|
77
|
+
"@types/react-dom": "^19.2.5",
|
|
78
78
|
"@upstash/redis": "^1.38.2",
|
|
79
79
|
"next": "^16.3.2",
|
|
80
80
|
"react": "^19.2.8",
|
package/skills/core/SKILL.md
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: contentful-cms-core
|
|
3
|
-
description: "
|
|
3
|
+
description: "Edit Contentful drafts via hosted cms-edit MCP (open → snapshot → read → set/rtf → diff → save). Local CLI content commands are disabled."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Skill: contentful-cms
|
|
6
|
+
# Skill: contentful-cms (hosted MCP)
|
|
7
7
|
|
|
8
|
-
Use this skill when you need to read or edit content in Contentful
|
|
8
|
+
Use this skill when you need to read or edit content in Contentful using **hosted cms-edit MCP** (`cms_edit` with an `args` array). Command names match the old CLI (`open` → `snapshot` → `read` → `set`/`rtf` → `diff` → `save`).
|
|
9
|
+
|
|
10
|
+
**Do not** run the local `cms-edit` binary for content. It refuses `open`, `save`, `set`, and other content commands. Local CLI is only for `host`, `editor-pack`, `project`, `schema`, and `guide`.
|
|
9
11
|
|
|
10
12
|
**Before editing:** use skill **`contentful-cms-editor-tasks`** to read `tasks-index` and the matching capability playbook for this site (hosted MCP or local `cms-edit/<site>/editor-pack/`).
|
|
11
13
|
|
|
12
14
|
## Overview
|
|
13
15
|
|
|
14
|
-
`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
|
+
|
|
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`.
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
2. `snapshot` to see the tree with `@ref` labels
|
|
18
|
-
3. `read` an entry to inspect its fields
|
|
19
|
-
4. `set` / `rtf` to modify fields
|
|
20
|
-
5. `diff` to review changes
|
|
21
|
-
6. `save` to write drafts to Contentful (NEVER publishes)
|
|
22
|
+
**Never publish.** Hosted MCP cannot see your disk — send JSON in the tool call.
|
|
22
23
|
|
|
23
24
|
## Safety Rules
|
|
24
25
|
|
|
@@ -31,7 +32,6 @@ All `save` operations create **draft** versions. A human must review and publish
|
|
|
31
32
|
|
|
32
33
|
**Assets:** Upload **is** supported (`asset upload`). Default workflow: **search and reuse** existing assets first (`index sync` → `asset search`). When uploading:
|
|
33
34
|
- **Hosted MCP:** always `cms_edit_request_staged_upload` → curl → `asset upload --staged` (never `--base64`)
|
|
34
|
-
- **Local CLI:** `--base64` or `--url` when user approves local CLI
|
|
35
35
|
- Use a **sensible fileName** and **descriptive title** (and alt text where the site uses it)
|
|
36
36
|
- Avoid oversized images — width over **2000px** is usually wasteful for web (exact limits vary by project; check `asset audit` / media review guidance)
|
|
37
37
|
- Prefer `--if-exists-by-filename` to avoid duplicates
|
|
@@ -158,15 +158,10 @@ Markdown support:
|
|
|
158
158
|
- `` `inline code` ``
|
|
159
159
|
- `---` for horizontal rule
|
|
160
160
|
|
|
161
|
-
For
|
|
161
|
+
For multi-paragraph Markdown, pass `--content` or `--base64` on MCP (no stdin, no `--file`):
|
|
162
162
|
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
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 -
|
|
166
|
-
|
|
167
|
-
# Also correct — file input
|
|
168
|
-
cms-edit rtf @c1 body --markdown --content "# Heading\n\nBody."
|
|
169
|
-
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**."]
|
|
170
165
|
```
|
|
171
166
|
|
|
172
167
|
Single-line content (no newlines) can be passed as a quoted argument directly:
|
|
@@ -609,7 +604,7 @@ cms-edit does not capture screenshots. Use preview URL commands, then open the U
|
|
|
609
604
|
{
|
|
610
605
|
"spaces": {
|
|
611
606
|
"om1": {
|
|
612
|
-
"devBaseUrl": "
|
|
607
|
+
"devBaseUrl": "https://om1.localhost"
|
|
613
608
|
}
|
|
614
609
|
}
|
|
615
610
|
}
|
|
@@ -678,12 +673,11 @@ cms-edit peek --id <entryId> # Look up by entry ID
|
|
|
678
673
|
|
|
679
674
|
## Batch Operations (batch run)
|
|
680
675
|
|
|
681
|
-
Run a sequence of operations from
|
|
676
|
+
Run a sequence of operations from `--json` or `--json-base64` (hosted MCP).
|
|
682
677
|
|
|
683
|
-
```
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
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"]
|
|
687
681
|
```
|
|
688
682
|
|
|
689
683
|
Supported ops: `open`, `set`, `rtf`, `rtf-replace`, `save`, `add`, `links-add`.
|
|
@@ -714,13 +708,17 @@ Example `ops.json` — update an existing page with a new CTA that has two butto
|
|
|
714
708
|
|
|
715
709
|
## Create Page or Article from JSON
|
|
716
710
|
|
|
717
|
-
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.
|
|
718
712
|
|
|
719
|
-
```bash
|
|
720
|
-
cms-edit create from-json --json '{...}' # Create from inline JSON
|
|
721
|
-
cms-edit create from-json --json '{...}' --dry-run # Preview without writing
|
|
722
|
-
cat page.json | cms-edit create from-json # Pipe from stdin
|
|
723
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.
|
|
724
722
|
|
|
725
723
|
**Page JSON schema:**
|
|
726
724
|
|
package/skills/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"core": "
|
|
2
|
+
"core": "Edit Contentful drafts via hosted cms-edit MCP (open → snapshot → read → set/rtf → diff → save). Local CLI content commands are disabled.",
|
|
3
3
|
"editor-tasks": "Route CMS editing intents to site task playbooks via tasks-index (hosted MCP resources or local editor-pack files).",
|
|
4
4
|
"templates": "Create or edit templates (preContent, postContent, menu, footer, colours) in Contentful via cms-edit.",
|
|
5
5
|
"setup": "Guide a user through connecting hosted cms-edit MCP for Claude or Grok (OAuth)."
|