@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.
- package/CHANGELOG.md +12 -0
- package/HOSTED.md +3 -3
- package/README.md +8 -10
- package/dist/cli/parse-boolean.d.ts +3 -0
- package/dist/cli/parse-boolean.d.ts.map +1 -0
- package/dist/cli/parse-boolean.js +9 -0
- package/dist/cli/parse-boolean.js.map +1 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +3 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/create-person.d.ts.map +1 -1
- package/dist/commands/create-person.js +9 -0
- package/dist/commands/create-person.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +8 -3
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +54 -0
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/release.d.ts +4 -0
- package/dist/commands/release.d.ts.map +1 -0
- package/dist/commands/release.js +331 -0
- package/dist/commands/release.js.map +1 -0
- package/dist/contentful/cda-sync.d.ts.map +1 -1
- package/dist/contentful/cda-sync.js +5 -1
- package/dist/contentful/cda-sync.js.map +1 -1
- package/dist/contentful/cma-user-agent.d.ts +1 -1
- package/dist/contentful/entry-fields.d.ts +7 -1
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +39 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/person-create.d.ts +4 -0
- package/dist/contentful/person-create.d.ts.map +1 -1
- package/dist/contentful/person-create.js +7 -0
- package/dist/contentful/person-create.js.map +1 -1
- package/dist/contentful/person-type-resolve.d.ts +8 -0
- package/dist/contentful/person-type-resolve.d.ts.map +1 -0
- package/dist/contentful/person-type-resolve.js +20 -0
- package/dist/contentful/person-type-resolve.js.map +1 -0
- package/dist/editor-pack/capabilities.d.ts.map +1 -1
- package/dist/editor-pack/capabilities.js +9 -2
- package/dist/editor-pack/capabilities.js.map +1 -1
- package/dist/editor-pack/generate.d.ts.map +1 -1
- package/dist/editor-pack/generate.js +2 -1
- package/dist/editor-pack/generate.js.map +1 -1
- package/dist/generated/help-topics.d.ts +1 -1
- package/dist/generated/help-topics.d.ts.map +1 -1
- package/dist/generated/help-topics.js +2 -2
- package/dist/generated/help-topics.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/hosted/next/routes/mcp.d.ts.map +1 -1
- package/dist/hosted/next/routes/mcp.js +18 -0
- package/dist/hosted/next/routes/mcp.js.map +1 -1
- package/dist/index/schema.d.ts +2 -2
- package/dist/index/schema.d.ts.map +1 -1
- package/dist/index/schema.js +1 -0
- package/dist/index/schema.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 +4 -3
- package/dist/mcp/tools/cms-edit.js.map +1 -1
- package/dist/project/types.d.ts +3 -0
- package/dist/project/types.d.ts.map +1 -1
- package/dist/project/types.js +19 -1
- package/dist/project/types.js.map +1 -1
- package/dist/publish/attribution.d.ts +16 -0
- package/dist/publish/attribution.d.ts.map +1 -0
- package/dist/publish/attribution.js +28 -0
- package/dist/publish/attribution.js.map +1 -0
- package/dist/publish/classify.d.ts +15 -0
- package/dist/publish/classify.d.ts.map +1 -0
- package/dist/publish/classify.js +79 -0
- package/dist/publish/classify.js.map +1 -0
- package/dist/publish/cma.d.ts +33 -0
- package/dist/publish/cma.d.ts.map +1 -0
- package/dist/publish/cma.js +267 -0
- package/dist/publish/cma.js.map +1 -0
- package/dist/publish/fields.d.ts +9 -0
- package/dist/publish/fields.d.ts.map +1 -0
- package/dist/publish/fields.js +56 -0
- package/dist/publish/fields.js.map +1 -0
- package/dist/publish/permissions.d.ts +23 -0
- package/dist/publish/permissions.d.ts.map +1 -0
- package/dist/publish/permissions.js +131 -0
- package/dist/publish/permissions.js.map +1 -0
- package/dist/publish/plan.d.ts +116 -0
- package/dist/publish/plan.d.ts.map +1 -0
- package/dist/publish/plan.js +361 -0
- package/dist/publish/plan.js.map +1 -0
- package/dist/publish/revalidate-request.d.ts +29 -0
- package/dist/publish/revalidate-request.d.ts.map +1 -0
- package/dist/publish/revalidate-request.js +26 -0
- package/dist/publish/revalidate-request.js.map +1 -0
- package/dist/publish/store.d.ts +13 -0
- package/dist/publish/store.d.ts.map +1 -0
- package/dist/publish/store.js +102 -0
- package/dist/publish/store.js.map +1 -0
- package/dist/runtime/context.d.ts +5 -0
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/context.js.map +1 -1
- package/docs/FUNCTIONAL_SPEC.md +10 -7
- package/docs/editor-tasks/publish-handoff.md +24 -23
- package/docs/help/index.md +4 -2
- package/docs/help/person-from-json.md +2 -1
- package/docs/help/publish.md +45 -0
- package/package.json +2 -2
- package/skills/core/SKILL.md +4 -4
|
@@ -1,41 +1,42 @@
|
|
|
1
|
-
# Capability: Publish
|
|
1
|
+
# Capability: Publish
|
|
2
2
|
|
|
3
3
|
## Intent phrases
|
|
4
4
|
|
|
5
5
|
- publish changes
|
|
6
|
+
- unpublish
|
|
7
|
+
- archive
|
|
8
|
+
- revalidate this page
|
|
6
9
|
- go live
|
|
7
|
-
- make changes live
|
|
8
10
|
|
|
9
11
|
## Requires capabilities
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
The signed-in Contentful user must have the matching role permission. AI Editor cannot publish.
|
|
12
14
|
|
|
13
15
|
## What cms-edit does
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
- **Cannot** publish, unpublish, archive, or delete published entries
|
|
17
|
+
`save` creates drafts. Publishing is a separate command.
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
1. `publish plan` (or `unpublish plan`, `archive plan`, `revalidate plan`) is read-only. It returns a plan id.
|
|
20
|
+
2. If someone else also changed an entry in that plan, stop and ask: publish **all** of those entries, or **mine** only. One entry cannot be split by field. Record the answer with `publish choose --plan <id> --scope all|mine`.
|
|
21
|
+
3. Apply only after the user says yes: `publish apply --plan <id>`. Do not apply on your own. The same yes is required for unpublish, archive, and revalidate.
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
2. Run `cms_edit ["preview", "urls", "<slug>"]` (or use session entry id after save)
|
|
22
|
-
3. Give the user **both** links:
|
|
23
|
-
- **Live preview (publish here)** — `app.contentful.com/.../entries/.../preview/...` — open this to review and click the green **Publish** button at the top
|
|
24
|
-
- **Preview (staging site)** — full staging URL for a full-page check (optional)
|
|
25
|
-
4. Tell the user which entry was changed (title, slug, CMS label)
|
|
26
|
-
5. Remind them: production URL updates 1–3 minutes after publish
|
|
23
|
+
## What gets published
|
|
27
24
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
- A page publishes its draft and changed assets and components first, then the page. That page publish is what refreshes the live site.
|
|
26
|
+
- The walk does not enter another page, article, or person, and it does not enter a shared template.
|
|
27
|
+
- `schema`, `template`, `navigation`, and the other webhook types can be the target (`--content-type schema`, `--id`, or `--from-session`). Publishing them refreshes caches through their own webhook. Do not republish every page that uses them.
|
|
28
|
+
- A schema linked only from an unpublished page is named in the plan. Publishing the schema does not add that link to the live page.
|
|
29
|
+
- A component publishes its own changes, then the pages that use it. The parent walk climbs through components and collections and stops at the first root. A template on that path is republished itself, because its webhook refreshes the pages that use it. The walk does not continue into those pages.
|
|
30
|
+
- `location` is a root only when the site's `project.json` lists it under `publish.extraRootContentTypes` and the editor pack has been regenerated.
|
|
31
|
+
- Unpublish and archive affect the named entries only, not their children. A published entry is unpublished before it is archived.
|
|
32
|
+
- `redirect` is refused. Redirects go live on deploy.
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Revalidate
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
`revalidate plan` refreshes production cache for the named pages and does not publish. The host needs `REVALIDATION_SECRET` and `PRODUCTION_SITE_URL`. If those are missing, publishing the page still refreshes the site through the Contentful webhook.
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Confirmation gates
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
1. Do not apply a plan unless the user has said yes for that plan id.
|
|
41
|
+
2. Do not claim the site is updated until apply succeeds.
|
|
42
|
+
3. There is no scheduled publish.
|
package/docs/help/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# cms-edit — Help Index
|
|
2
2
|
|
|
3
|
-
`cms-edit` is an opinionated CLI for reading and editing Contentful
|
|
3
|
+
`cms-edit` is an opinionated CLI for reading and editing Contentful content across SE Studio apps. It provides a snapshot → ref → edit → save workflow. **Saves create drafts.** Publish, unpublish, and archive use a plan and an explicit yes, and only when the Contentful role allows it.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -37,6 +37,7 @@ Available topics for `cms-edit help <topic>`:
|
|
|
37
37
|
| `patterns` | Census published page/article stacks (Delivery API) |
|
|
38
38
|
| `asset-review` | Visual asset quality review (filename, alt, size, dimensions) |
|
|
39
39
|
| `lookup` | Flat flags for `open`, `resolve`, and `nav open` |
|
|
40
|
+
| `publish` | Plan, then publish, unpublish, archive, or revalidate |
|
|
40
41
|
|
|
41
42
|
---
|
|
42
43
|
|
|
@@ -134,7 +135,8 @@ cms-edit batch run --json '[...]'
|
|
|
134
135
|
| `apply from-json` | Apply from-json to the open session |
|
|
135
136
|
| `create taxonomy-from-json` | Batch-create tagType, articleType, and tag entries |
|
|
136
137
|
| `create person-from-json` | Batch-create person entries from JSON |
|
|
137
|
-
| `create person` | Create a person entry (draft) |
|
|
138
|
+
| `create person` | Create a person entry (draft). `--person-type-id` / `--person-type-slug` link a person type. `--indexed` and `--hidden` take `true` or `false`. |
|
|
139
|
+
| `create person-type` | Create a personType entry (draft). `--person-template-id` links the profile template. |
|
|
138
140
|
| `article-tags-from-json` | Set tags on articles from JSON |
|
|
139
141
|
| `bulk-rtf-replace` | Find-replace in Rich Text across entry trees |
|
|
140
142
|
| `create tag-type` | Create a tagType entry (draft) |
|
|
@@ -78,6 +78,7 @@ Or batch-link in a `cms-edit batch run` ops file.
|
|
|
78
78
|
|
|
79
79
|
| Command | Purpose |
|
|
80
80
|
|---|---|
|
|
81
|
-
| `cms-edit create person` | Create one person |
|
|
81
|
+
| `cms-edit create person` | Create one person. Optional `--person-type-id`, `--person-type-slug`, `--indexed`, `--hidden` |
|
|
82
|
+
| `cms-edit create person-type` | Create one person type (draft) |
|
|
82
83
|
| `cms-edit create person … --if-not-exists` | Idempotent single create |
|
|
83
84
|
| `cms-edit help fields` | Field overview |
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Publish, unpublish, archive, revalidate
|
|
2
|
+
|
|
3
|
+
`save` writes drafts. These commands publish only after a plan and an explicit yes.
|
|
4
|
+
|
|
5
|
+
The signed-in Contentful user must be allowed to publish, unpublish, or archive. If the role cannot, the command stops before anything is written. AI Editor cannot publish.
|
|
6
|
+
|
|
7
|
+
## Plan, then yes
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
cms-edit publish plan
|
|
11
|
+
cms-edit publish choose --plan <id> --scope all
|
|
12
|
+
cms-edit publish apply --plan <id>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`plan` is read-only. If someone else also changed an entry, the plan waits. Ask whether to publish all of those entries or only this user's. Record that with `choose`. Apply only after the user says yes. The same pattern exists for `unpublish`, `archive`, and `revalidate`.
|
|
16
|
+
|
|
17
|
+
## Targets
|
|
18
|
+
|
|
19
|
+
Open a page, then `publish plan` publishes that page's draft and changed assets and components, then the page. A component plan climbs through other components and stops at the first page, article, or other root. A template on that path is republished itself.
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
cms-edit publish plan --content-type schema
|
|
23
|
+
cms-edit publish plan --content-type schema --since 2026-10-02
|
|
24
|
+
cms-edit publish plan --id <entryId>
|
|
25
|
+
cms-edit publish plan --from-session
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Schema, template, and navigation publish through their own webhooks. Pages that use them are not republished. A schema that is linked only from an unpublished page is named in the plan.
|
|
29
|
+
|
|
30
|
+
A site adds extra roots in `project.json`:
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
"publish": { "extraRootContentTypes": ["location"] }
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Regenerate the editor pack so hosted cms-edit reads `editor-pack/publish.json`.
|
|
37
|
+
|
|
38
|
+
## Revalidate
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
cms-edit revalidate plan --id <pageId>
|
|
42
|
+
cms-edit revalidate apply --plan <id>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This refreshes production cache and does not publish. The host needs `REVALIDATION_SECRET` and `PRODUCTION_SITE_URL`.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/contentful-cms",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "CLI tool for AI agents to
|
|
3
|
+
"version": "3.14.0",
|
|
4
|
+
"description": "CLI tool for AI agents to edit Contentful drafts and, when the user's role allows it, publish after an explicit yes",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/Something-Else-Studio/se-core-product",
|
package/skills/core/SKILL.md
CHANGED
|
@@ -21,7 +21,7 @@ Use this skill when you need to read or edit content in Contentful using **hoste
|
|
|
21
21
|
|
|
22
22
|
**Edit a tree:** `open` → `export from-json` → edit JSON → `apply from-json` (`--staged` when over 8k). Tiny patches: `set` / `rtf` / `add` then `diff` → `save`. Long HtmlComponent fields: `kind=text` then `set --staged`.
|
|
23
23
|
|
|
24
|
-
**
|
|
24
|
+
**Do not publish while saving.** Hosted MCP cannot see your disk — send JSON in the tool call **only if under 8192 bytes**. Publish is a later plan, and only after the user says yes.
|
|
25
25
|
|
|
26
26
|
## Safety Rules
|
|
27
27
|
|
|
@@ -576,7 +576,7 @@ cms-edit diff
|
|
|
576
576
|
|
|
577
577
|
# 7. Save as draft
|
|
578
578
|
cms-edit save
|
|
579
|
-
# → "Saved 1 entry as draft.
|
|
579
|
+
# → "Saved 1 entry as draft. Publish only if the user asks, with publish plan and an explicit yes."
|
|
580
580
|
```
|
|
581
581
|
|
|
582
582
|
## Common Patterns
|
|
@@ -828,7 +828,7 @@ Use `"components"` not `"content"`. Nested discriminator is `"type"` not `"compo
|
|
|
828
828
|
- String `fields` values become Rich Text when they auto-detect as Markdown (same heuristic), HTML (tag-like), or Rich Text JSON (`nodeType: document`). Otherwise strings stay as-is — use `{ "value": "…", "format": "text"|"markdown"|"html"|"json" }` or `cms-edit rtf` with `--text|--markdown|--html|--rtf-json`.
|
|
829
829
|
- `target` sets which content array to use: `topContent`, `content` (default), or `bottomContent`.
|
|
830
830
|
- Slugs must not have a trailing slash — `from-json` strips it with a warning, but avoid it in source JSON.
|
|
831
|
-
- All entries are created as **drafts**.
|
|
831
|
+
- All entries are created as **drafts**. Publish later with `publish plan`, then `publish apply` only after the user says yes.
|
|
832
832
|
- `--dry-run` prints the full plan without writing anything.
|
|
833
833
|
|
|
834
834
|
## Find Existing Entries (for existingId)
|
|
@@ -857,7 +857,7 @@ cms-edit list --type article --sort date -n 20
|
|
|
857
857
|
cms-edit index dump --reference-only # Full catalog snapshot in terminal
|
|
858
858
|
```
|
|
859
859
|
|
|
860
|
-
**Note on
|
|
860
|
+
**Note on publish:** Saves create drafts. `publish plan --content-type schema` (or the open page, `--id`, `--from-session`) lists what would go live. If someone else also changed an entry, ask all versus mine and `publish choose`. `publish apply --plan <id>` only after the user says yes. The Contentful role must allow it. Unpublish, archive, and revalidate use the same plan-then-yes rule. Do not apply a plan on your own.
|
|
861
861
|
|
|
862
862
|
## Concurrent Sessions
|
|
863
863
|
|