@se-studio/contentful-cms 3.14.2 → 3.15.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 +8 -0
- package/README.md +5 -1
- package/dist/commands/asset.d.ts.map +1 -1
- package/dist/commands/asset.js +310 -3
- package/dist/commands/asset.js.map +1 -1
- package/dist/contentful/asset-concepts.d.ts +53 -0
- package/dist/contentful/asset-concepts.d.ts.map +1 -0
- package/dist/contentful/asset-concepts.js +137 -0
- package/dist/contentful/asset-concepts.js.map +1 -0
- package/dist/contentful/asset-replace.d.ts +29 -0
- package/dist/contentful/asset-replace.d.ts.map +1 -0
- package/dist/contentful/asset-replace.js +57 -0
- package/dist/contentful/asset-replace.js.map +1 -0
- package/dist/contentful/assets.d.ts +11 -0
- package/dist/contentful/assets.d.ts.map +1 -1
- package/dist/contentful/assets.js +48 -2
- package/dist/contentful/assets.js.map +1 -1
- package/dist/contentful/client.d.ts +9 -0
- package/dist/contentful/client.d.ts.map +1 -1
- package/dist/contentful/client.js +27 -0
- package/dist/contentful/client.js.map +1 -1
- package/dist/contentful/cma-user-agent.d.ts +1 -1
- package/dist/contentful/media-dimensions.d.ts +7 -0
- package/dist/contentful/media-dimensions.d.ts.map +1 -0
- package/dist/contentful/media-dimensions.js +169 -0
- package/dist/contentful/media-dimensions.js.map +1 -0
- package/dist/contentful/upload-limits.d.ts +10 -4
- package/dist/contentful/upload-limits.d.ts.map +1 -1
- package/dist/contentful/upload-limits.js +14 -7
- package/dist/contentful/upload-limits.js.map +1 -1
- package/dist/editor-pack/generate.js +2 -2
- package/dist/editor-pack/generate.js.map +1 -1
- 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/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 +1 -1
- package/dist/mcp/tools/media.d.ts.map +1 -1
- package/dist/mcp/tools/media.js +3 -3
- package/dist/mcp/tools/media.js.map +1 -1
- package/dist/mcp/tools/staged-upload.d.ts.map +1 -1
- package/dist/mcp/tools/staged-upload.js +4 -3
- package/dist/mcp/tools/staged-upload.js.map +1 -1
- package/dist/staged-upload/direct-intake.d.ts +23 -0
- package/dist/staged-upload/direct-intake.d.ts.map +1 -0
- package/dist/staged-upload/direct-intake.js +71 -0
- package/dist/staged-upload/direct-intake.js.map +1 -0
- package/dist/staged-upload/intake-policy.d.ts +13 -0
- package/dist/staged-upload/intake-policy.d.ts.map +1 -0
- package/dist/staged-upload/intake-policy.js +37 -0
- package/dist/staged-upload/intake-policy.js.map +1 -0
- package/dist/staged-upload/request.d.ts +5 -1
- package/dist/staged-upload/request.d.ts.map +1 -1
- package/dist/staged-upload/request.js +31 -2
- package/dist/staged-upload/request.js.map +1 -1
- package/dist/staged-upload/types.d.ts +4 -0
- package/dist/staged-upload/types.d.ts.map +1 -1
- package/docs/editor-tasks/media-pipeline-prepare.md +12 -2
- package/docs/editor-tasks/media-reuse-and-upload.md +40 -8
- package/docs/editor-tasks/taxonomy.md +2 -0
- package/docs/mcp/hosted-guide.md +8 -6
- package/package.json +2 -1
- package/skills/core/SKILL.md +11 -5
- package/skills/editor-tasks/SKILL.md +1 -1
package/docs/mcp/hosted-guide.md
CHANGED
|
@@ -13,7 +13,7 @@ cms-edit **cannot and will not**:
|
|
|
13
13
|
|
|
14
14
|
All `save` operations create **drafts only**. A human must review and publish in Contentful.
|
|
15
15
|
|
|
16
|
-
**Assets:** Always **search and reuse** first (`index sync`, then `asset search`). Raster/video go through **`cms_edit_media`** (
|
|
16
|
+
**Assets:** Always **search and reuse** first (`index sync`, then `asset search`). Raster/video go through **`cms_edit_media`** (Drive, or intake then prepare → import). Video, and an image master over 4MB, is a presigned PUT (`intake: direct`) then prepare with `httpsUrls`. An image at or under 4MB uses a function POST then `stagedUploadIds`. Never `asset upload` jpeg/png/webp/gif/mp4, and never convert those files with local ffmpeg. SVG/PDF/Lottie: staged upload then `asset upload --staged`. **`--base64` is not supported on hosted MCP.**
|
|
17
17
|
|
|
18
18
|
## MCP tools
|
|
19
19
|
|
|
@@ -138,11 +138,12 @@ cms-edit saves **drafts only**. A colleague must **publish in Contentful** for c
|
|
|
138
138
|
|
|
139
139
|
## Asset upload (hosted MCP)
|
|
140
140
|
|
|
141
|
-
Hosted connectors have **no server filesystem** and **reject `asset upload --base64`**. Raster/video:
|
|
141
|
+
Hosted connectors have **no server filesystem** and **reject `asset upload --base64`**. Raster/video: intake then the **media pipeline**. SVG/PDF/Lottie: staged then `asset upload --staged`.
|
|
142
142
|
|
|
143
143
|
| Source | When | Example |
|
|
144
144
|
|--------|------|---------|
|
|
145
|
-
| **
|
|
145
|
+
| **Direct + pipeline** | video, or an image over 4MB | Presigned PUT, then `cms_edit_media` prepare `httpsUrls` → import (required for video) |
|
|
146
|
+
| **Staged + pipeline** | image at or under 4MB | Function POST, then prepare `stagedUploadIds` → import |
|
|
146
147
|
| **`--url`** | Pipeline-ready **images** only, or SVG/PDF | `["asset", "upload", "--url", "https://….blob.vercel-storage.com/ready.jpg"]` |
|
|
147
148
|
| **Staged consume** | SVG/PDF/Lottie | `asset upload --staged` |
|
|
148
149
|
|
|
@@ -168,14 +169,15 @@ Full workflow: `cms-edit://customer/task-media-reuse-and-upload`.
|
|
|
168
169
|
Keeps binary **and large text/JSON** out of MCP tool args. The agent uploads via `curl`, then passes only a short `uploadId`.
|
|
169
170
|
|
|
170
171
|
1. `cms_edit_request_staged_upload` with `fileName`, `mimeType`, optional `kind` (`asset` \| `text` \| `json`), optional `byteLength`, optional `title`. If the wrapper schema has no `kind`, use `cms_edit` `["staged-upload", "request", "--kind", "json", "--file-name", "...", "--mime", "application/json"]` (or `--kind text` for HtmlComponent fields).
|
|
171
|
-
2. Run the returned `curlCommand` in a shell (POST multipart to `uploadUrl`)
|
|
172
|
+
2. Run the returned `curlCommand` in a shell (function route: POST multipart to `uploadUrl`; direct intake: PUT `--data-binary`)
|
|
172
173
|
3. Follow `consumeArgs`:
|
|
173
|
-
- **asset
|
|
174
|
+
- **asset, intake direct** (video, or an image over 4MB): media prepare with the public intake URL
|
|
175
|
+
- **asset, intake function:** media prepare for jpeg/png/webp/gif at or under 4MB; **asset upload --staged** for SVG/PDF/Lottie
|
|
174
176
|
- **text:** `set @ref field --staged <id>` (insert ref and field id)
|
|
175
177
|
- **json:** `create from-json --staged <id>` (add `--dry-run --strict` first). Dry-run does not consume the slot.
|
|
176
178
|
4. For pipeline jobs: wait → catalog → **import** (required for video). Then link and save
|
|
177
179
|
|
|
178
|
-
Hosted **inline** `--json` / `--content` / `--*-base64` is capped at **8192 bytes**.
|
|
180
|
+
Hosted **inline** `--json` / `--content` / `--*-base64` is capped at **8192 bytes**. Function POST (JSON, text, SVG, PDF, Lottie, image ≤ 4MB): **4 MB**. Video and an image master over 4MB: **100MB** presigned PUT (`BLOB_READ_WRITE_TOKEN` on the host), then the media pipeline. Rate limit: **1000 upload URLs per user per hour**. TTL: **60 minutes**.
|
|
179
181
|
|
|
180
182
|
## Featured images (articles)
|
|
181
183
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/contentful-cms",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
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",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@contentful/rich-text-types": "^17.2.7",
|
|
64
64
|
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
65
|
+
"@vercel/blob": "^2.8.0",
|
|
65
66
|
"commander": "^15.0.0",
|
|
66
67
|
"contentful": "^11.12.10",
|
|
67
68
|
"contentful-management": "^12.19.0",
|
package/skills/core/SKILL.md
CHANGED
|
@@ -32,9 +32,11 @@ Use this skill when you need to read or edit content in Contentful using **hoste
|
|
|
32
32
|
|
|
33
33
|
All `save` operations create **draft** versions. A human must review and publish in Contentful.
|
|
34
34
|
|
|
35
|
-
**Assets:** Upload **is** supported (`asset upload`). Default workflow: **search and reuse** existing assets first (`index sync` → `asset search`). When uploading:
|
|
36
|
-
- **Raster/video:** `cms_edit_request_staged_upload` → curl → `cms_edit_media` prepare
|
|
37
|
-
- **
|
|
35
|
+
**Assets:** Upload **is** supported (`asset upload`). Default workflow: **search and reuse** existing assets first (`index sync` → `asset search`). Search by concept (`asset search --concept` / `--concept-all`) finds a subject and a tone, including files no page uses yet. Concepts are not blog tags. When uploading:
|
|
36
|
+
- **Raster/video:** `cms_edit_request_staged_upload` → curl → `cms_edit_media` prepare → wait → catalog → import with real alt. Video, and an image master over 4MB, is a presigned direct PUT (100MB, `intake: direct`) then prepare with that URL. Smaller images still use `stagedUploadIds`. Never `asset upload --staged/--url/--base64` for jpeg/png/webp/gif/mp4. The stored asset is the processed file.
|
|
37
|
+
- **Replace** an existing id with `asset replace --url` of the processed `…/packs/…/ready/…` file (`--dry-run` first). The id and the file name stay. Draft. No publish flag.
|
|
38
|
+
- **SVG/PDF/Lottie:** `cms_edit_request_staged_upload` → curl → `asset upload --staged` (never `--base64`). 4MB function cap.
|
|
39
|
+
- **Title:** `asset set-title`. **Alt:** `asset set-description`, written from the picture. Do not emotion-score headshots, logos, icons, or illustrations.
|
|
38
40
|
- **HtmlComponent / large JSON:** `cms_edit_request_staged_upload` with `kind=text` or `kind=json` → curl → `set --staged`, `rtf --staged`, `create from-json --staged`, or `apply from-json --staged`. Hosted MCP rejects inline `--json`/`--content` over 8192 bytes. If the wrapper schema has no `kind`, use `cms_edit` `["staged-upload", "request", "--kind", "json", "--file-name", "...", "--mime", "application/json"]` (or `--kind text`), then curl, then `--staged`.
|
|
39
41
|
- Use a **sensible fileName** and **descriptive title** (and alt text where the site uses it)
|
|
40
42
|
- Avoid oversized images — width over **2000px** is usually wasteful for web (exact limits vary by project; check `asset audit` / media review guidance)
|
|
@@ -376,9 +378,13 @@ cms-edit asset search --filename istockphoto-123.jpg
|
|
|
376
378
|
cms-edit asset search --filename-match 'istockphoto-.*'
|
|
377
379
|
|
|
378
380
|
# Raster/video: cms_edit_media prepare → wait → catalog → import (video: import only).
|
|
381
|
+
# Video and image masters over 4MB: direct intake (100MB), then prepare --https-urls.
|
|
379
382
|
# Do not `asset upload` jpeg/png/webp/gif/mp4. Do not convert GIF/MP4 with local ffmpeg.
|
|
380
383
|
# Animated GIF: leave as GIF; pipeline emits gif-converted MP4 for Media mute-loop, not featuredImage.
|
|
381
|
-
# SVG/PDF/Lottie: cms_edit_request_staged_upload → curl → asset upload --staged
|
|
384
|
+
# SVG/PDF/Lottie: cms_edit_request_staged_upload → curl → asset upload --staged (4MB)
|
|
385
|
+
# Replace in place: asset replace <id> --url <processed ready url> --dry-run
|
|
386
|
+
# Title: asset set-title. Alt: asset set-description. Concepts: asset concept assign (not taxonomy-from-json)
|
|
387
|
+
# Concept search: asset search --concept <id> --concept-all <id>
|
|
382
388
|
|
|
383
389
|
# Create a Media wrapper for an existing asset (name defaults to asset title)
|
|
384
390
|
cms-edit create media --asset-id <asset-id>
|
|
@@ -394,7 +400,7 @@ cms-edit asset info 5xKj2abcDef
|
|
|
394
400
|
cms-edit asset set @c0 visual 5xKj2abcDef
|
|
395
401
|
```
|
|
396
402
|
|
|
397
|
-
JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?, mediaIds? }`.
|
|
403
|
+
JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?, mediaIds? }`. Bytes through the process are **10MB**. Hosted function POST is **4MB**. Video and large image masters are **100MB** direct-to-storage, then the pipeline.
|
|
398
404
|
|
|
399
405
|
**Idempotent upload:** `--if-exists-by-filename` is check-then-create. Do not upload the same `fileName` in parallel — serialize per fileName or re-run to converge.
|
|
400
406
|
|
|
@@ -64,7 +64,7 @@ Capability playbooks require:
|
|
|
64
64
|
|
|
65
65
|
## Media default
|
|
66
66
|
|
|
67
|
-
**Search and reuse assets first** (`index sync` → `asset search`). Upload only when no match; use `--if-exists-by-filename` when uploading.
|
|
67
|
+
**Search and reuse assets first** (`index sync` → `asset search`). Search by concept (`--concept`, `--concept-all`) finds a subject and a tone. Concepts are not blog tags. Upload only when no match; use `--if-exists-by-filename` when uploading. Replace an in-use file with `asset replace` so the id and the file name stay. Alt is `asset set-description`, written from the picture. Do not emotion-score headshots, logos, icons, or illustrations.
|
|
68
68
|
|
|
69
69
|
**Space-wide media audit** (filename, alt, size, dimensions, usage) → read **`task-media-review`**, then skill **`contentful-cms-media-review`** for the spreadsheet.
|
|
70
70
|
|