@se-studio/contentful-cms 3.14.2 → 3.15.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +5 -1
  3. package/dist/commands/apply-from-json.d.ts.map +1 -1
  4. package/dist/commands/apply-from-json.js +2 -1
  5. package/dist/commands/apply-from-json.js.map +1 -1
  6. package/dist/commands/asset.d.ts.map +1 -1
  7. package/dist/commands/asset.js +310 -3
  8. package/dist/commands/asset.js.map +1 -1
  9. package/dist/commands/batch.d.ts.map +1 -1
  10. package/dist/commands/batch.js +2 -9
  11. package/dist/commands/batch.js.map +1 -1
  12. package/dist/commands/create-from-json.d.ts.map +1 -1
  13. package/dist/commands/create-from-json.js +22 -18
  14. package/dist/commands/create-from-json.js.map +1 -1
  15. package/dist/commands/run.js +2 -2
  16. package/dist/commands/run.js.map +1 -1
  17. package/dist/commands/save.d.ts.map +1 -1
  18. package/dist/commands/save.js +2 -11
  19. package/dist/commands/save.js.map +1 -1
  20. package/dist/contentful/asset-concepts.d.ts +53 -0
  21. package/dist/contentful/asset-concepts.d.ts.map +1 -0
  22. package/dist/contentful/asset-concepts.js +137 -0
  23. package/dist/contentful/asset-concepts.js.map +1 -0
  24. package/dist/contentful/asset-replace.d.ts +29 -0
  25. package/dist/contentful/asset-replace.d.ts.map +1 -0
  26. package/dist/contentful/asset-replace.js +57 -0
  27. package/dist/contentful/asset-replace.js.map +1 -0
  28. package/dist/contentful/assets.d.ts +11 -0
  29. package/dist/contentful/assets.d.ts.map +1 -1
  30. package/dist/contentful/assets.js +48 -2
  31. package/dist/contentful/assets.js.map +1 -1
  32. package/dist/contentful/client.d.ts +9 -0
  33. package/dist/contentful/client.d.ts.map +1 -1
  34. package/dist/contentful/client.js +27 -0
  35. package/dist/contentful/client.js.map +1 -1
  36. package/dist/contentful/cma-user-agent.d.ts +1 -1
  37. package/dist/contentful/entry-fields.d.ts +2 -0
  38. package/dist/contentful/entry-fields.d.ts.map +1 -1
  39. package/dist/contentful/entry-fields.js +33 -1
  40. package/dist/contentful/entry-fields.js.map +1 -1
  41. package/dist/contentful/media-dimensions.d.ts +7 -0
  42. package/dist/contentful/media-dimensions.d.ts.map +1 -0
  43. package/dist/contentful/media-dimensions.js +169 -0
  44. package/dist/contentful/media-dimensions.js.map +1 -0
  45. package/dist/contentful/upload-limits.d.ts +10 -4
  46. package/dist/contentful/upload-limits.d.ts.map +1 -1
  47. package/dist/contentful/upload-limits.js +14 -7
  48. package/dist/contentful/upload-limits.js.map +1 -1
  49. package/dist/contentful/write.d.ts +5 -0
  50. package/dist/contentful/write.d.ts.map +1 -1
  51. package/dist/contentful/write.js +17 -0
  52. package/dist/contentful/write.js.map +1 -1
  53. package/dist/editor-pack/generate.js +2 -2
  54. package/dist/editor-pack/generate.js.map +1 -1
  55. package/dist/generated/help-topics.d.ts.map +1 -1
  56. package/dist/generated/help-topics.js +1 -1
  57. package/dist/generated/help-topics.js.map +1 -1
  58. package/dist/generated/hosted-guide.d.ts +1 -1
  59. package/dist/generated/hosted-guide.d.ts.map +1 -1
  60. package/dist/generated/hosted-guide.js +1 -1
  61. package/dist/generated/hosted-guide.js.map +1 -1
  62. package/dist/generated/version.d.ts +1 -1
  63. package/dist/generated/version.js +1 -1
  64. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  65. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  66. package/dist/mcp/tools/cms-edit.js +1 -1
  67. package/dist/mcp/tools/media.d.ts.map +1 -1
  68. package/dist/mcp/tools/media.js +3 -3
  69. package/dist/mcp/tools/media.js.map +1 -1
  70. package/dist/mcp/tools/staged-upload.d.ts.map +1 -1
  71. package/dist/mcp/tools/staged-upload.js +4 -3
  72. package/dist/mcp/tools/staged-upload.js.map +1 -1
  73. package/dist/staged-upload/direct-intake.d.ts +23 -0
  74. package/dist/staged-upload/direct-intake.d.ts.map +1 -0
  75. package/dist/staged-upload/direct-intake.js +71 -0
  76. package/dist/staged-upload/direct-intake.js.map +1 -0
  77. package/dist/staged-upload/intake-policy.d.ts +13 -0
  78. package/dist/staged-upload/intake-policy.d.ts.map +1 -0
  79. package/dist/staged-upload/intake-policy.js +37 -0
  80. package/dist/staged-upload/intake-policy.js.map +1 -0
  81. package/dist/staged-upload/request.d.ts +5 -1
  82. package/dist/staged-upload/request.d.ts.map +1 -1
  83. package/dist/staged-upload/request.js +31 -2
  84. package/dist/staged-upload/request.js.map +1 -1
  85. package/dist/staged-upload/types.d.ts +4 -0
  86. package/dist/staged-upload/types.d.ts.map +1 -1
  87. package/docs/editor-tasks/media-pipeline-prepare.md +12 -2
  88. package/docs/editor-tasks/media-reuse-and-upload.md +40 -8
  89. package/docs/editor-tasks/taxonomy.md +2 -0
  90. package/docs/help/create-from-json.md +1 -0
  91. package/docs/mcp/hosted-guide.md +8 -6
  92. package/package.json +2 -1
  93. package/skills/core/SKILL.md +11 -5
  94. package/skills/editor-tasks/SKILL.md +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"intake-policy.js","sourceRoot":"","sources":["../../src/staged-upload/intake-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAyB,MAAM,WAAW,CAAC;AAKrE,MAAM,UAAU,WAAW,CAAC,MAK3B;IACC,IAAI,MAAM,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,CAAC,sBAAsB,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnD,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,UAAU,GAAG,uBAAuB,EAAE,CAAC;QACnF,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAkB;IAC/C,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,uBAAuB,CAAC;AAChF,CAAC;AAED,qGAAqG;AACrG,MAAM,UAAU,sBAAsB,CAAC,KAAkB,EAAE,UAA8B;IACvF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,UAAU,GAAG,GAAG,EAAE,CAAC;QACrB,MAAM,KAAK,GACT,KAAK,KAAK,QAAQ;YAChB,CAAC,CAAC,GAAG,MAAM,CAAC,uBAAuB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,kBAAkB;YACtE,CAAC,CAAC,GAAG,MAAM,CAAC,uBAAuB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,yBAAyB,CAAC;QAClF,MAAM,IAAI,KAAK,CACb,uBAAuB,MAAM,CAAC,UAAU,CAAC,gBAAgB,KAAK,WAAW,MAAM,CAAC,GAAG,CAAC,UAAU,CAC/F,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type DirectIntakeParams, type DirectIntakeResult } from './direct-intake.js';
1
2
  import { type StagedUploadKind } from './mime.js';
2
3
  import type { StagedUploadStore } from './store.js';
3
4
  import type { StagedUploadRequestResult } from './types.js';
@@ -9,5 +10,8 @@ export interface CreateStagedUploadRequestParams {
9
10
  title?: string;
10
11
  kind?: StagedUploadKind | string;
11
12
  }
12
- export declare function createStagedUploadRequest(store: StagedUploadStore, params: CreateStagedUploadRequestParams): Promise<StagedUploadRequestResult>;
13
+ export interface StagedUploadDeps {
14
+ createDirectIntake?: (params: DirectIntakeParams) => Promise<DirectIntakeResult>;
15
+ }
16
+ export declare function createStagedUploadRequest(store: StagedUploadStore, params: CreateStagedUploadRequestParams, deps?: StagedUploadDeps): Promise<StagedUploadRequestResult>;
13
17
  //# sourceMappingURL=request.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/staged-upload/request.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;CAClC;AAgCD,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,+BAA+B,GACtC,OAAO,CAAC,yBAAyB,CAAC,CA6BpC"}
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/staged-upload/request.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAI5B,OAAO,EAAkD,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;CAClC;AAMD,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClF;AA4BD,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE,+BAA+B,EACvC,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CA0DpC"}
@@ -1,8 +1,10 @@
1
1
  import { requiresPipelineEncode } from '../contentful/pipeline-encode-gate.js';
2
2
  import { getPublicOrigin } from '../hosted/oauth/config.js';
3
+ import { createDirectIntakeUpload, directIntakeCurl, } from './direct-intake.js';
3
4
  import { buildStagedUploadUrl, getUploadHmacSecret } from './hmac.js';
5
+ import { assertIntakeByteLength, intakeRoute } from './intake-policy.js';
4
6
  import { hostedStagedMaxBytes, STAGED_UPLOAD_TTL_SECONDS } from './limits.js';
5
- import { parseStagedUploadKind } from './mime.js';
7
+ import { isAllowedStagedMimeType, parseStagedUploadKind } from './mime.js';
6
8
  function shellQuote(value) {
7
9
  return `'${value.replace(/'/g, `'\\''`)}'`;
8
10
  }
@@ -27,8 +29,34 @@ function buildConsumeArgs(kind, uploadId, params) {
27
29
  ...(params.title ? ['--title', params.title] : []),
28
30
  ];
29
31
  }
30
- export async function createStagedUploadRequest(store, params) {
32
+ export async function createStagedUploadRequest(store, params, deps = {}) {
31
33
  const kind = parseStagedUploadKind(typeof params.kind === 'string' ? params.kind : undefined);
34
+ if (!isAllowedStagedMimeType(params.mimeType, kind)) {
35
+ throw new Error(`MIME type not allowed for staged upload (${kind}): ${params.mimeType}`);
36
+ }
37
+ const route = intakeRoute({
38
+ kind,
39
+ mimeType: params.mimeType,
40
+ fileName: params.fileName,
41
+ byteLength: params.byteLength,
42
+ });
43
+ assertIntakeByteLength(route, params.byteLength);
44
+ if (route === 'direct') {
45
+ await store.assertRateLimit(params.userId);
46
+ const createDirect = deps.createDirectIntake ?? createDirectIntakeUpload;
47
+ const direct = await createDirect(params);
48
+ return {
49
+ uploadId: direct.uploadId,
50
+ uploadUrl: direct.presignedUrl,
51
+ expiresIn: STAGED_UPLOAD_TTL_SECONDS,
52
+ expiresAt: direct.expiresAt,
53
+ maxBytes: direct.maxBytes,
54
+ curlCommand: directIntakeCurl(direct.presignedUrl, params.mimeType, params.fileName),
55
+ consumeArgs: ['media', 'prepare', '--https-urls', direct.publicUrl],
56
+ intake: 'direct',
57
+ publicUrl: direct.publicUrl,
58
+ };
59
+ }
32
60
  const uploadId = await store.createPending({
33
61
  userId: params.userId,
34
62
  fileName: params.fileName,
@@ -50,6 +78,7 @@ export async function createStagedUploadRequest(store, params) {
50
78
  maxBytes: hostedStagedMaxBytes(),
51
79
  curlCommand,
52
80
  consumeArgs,
81
+ intake: 'function',
53
82
  };
54
83
  }
55
84
  //# sourceMappingURL=request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/staged-upload/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAyB,MAAM,WAAW,CAAC;AAaz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E,MAAM,CAAC,UAAU;KAC9B,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,mBAAmB,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,yBAAyB,CAAC;IACtE,MAAM,SAAS,GAAG,oBAAoB,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IAErF,MAAM,WAAW,GAAG,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE7D,MAAM,WAAW,GAAG,sBAAsB,UAAU,CAAC,kBAAkB,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;IAErH,OAAO;QACL,QAAQ;QACR,SAAS;QACT,SAAS,EAAE,yBAAyB;QACpC,SAAS,EAAE,GAAG;QACd,QAAQ,EAAE,oBAAoB,EAAE;QAChC,WAAW;QACX,WAAW;QACX,MAAM,EAAE,UAAU;KACnB,CAAC;AACJ,CAAC"}
@@ -20,6 +20,10 @@ export interface StagedUploadRequestResult {
20
20
  maxBytes: number;
21
21
  curlCommand: string;
22
22
  consumeArgs: string[];
23
+ /** `function` POSTs to the cms-edit route. `direct` PUTs to blob storage. */
24
+ intake: 'function' | 'direct';
25
+ /** Set when intake is `direct`. Pass this URL to media prepare after the PUT. */
26
+ publicUrl?: string;
23
27
  }
24
28
  export interface StagedUploadConsumeResult {
25
29
  buffer: Buffer;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/staged-upload/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,M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C;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,6EAA6E;IAC7E,MAAM,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC9B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,gBAAgB,CAAC;CACxB"}
@@ -34,7 +34,7 @@ Normalize a **folder of designer masters** into short-lived **public HTTPS URLs*
34
34
  | Situation | Action |
35
35
  |-----------|--------|
36
36
  | Drive folder of masters | This task with `driveFolderUrl` |
37
- | Staged files (curl after `cms_edit_request_staged_upload`) | This task with `stagedUploadIds` — one prepare for the batch |
37
+ | Staged files (curl after `cms_edit_request_staged_upload`) | This task with `stagedUploadIds` when `intake` is `function`, or `httpsUrls` / `--https-urls` when `intake` is `direct` |
38
38
  | Public HTTPS on allowed hosts | This task with `httpsUrls` |
39
39
  | Single SVG/PDF/Lottie | `task-media-reuse-and-upload` asset upload --staged |
40
40
  | Prior prepare already reached `succeeded` + catalog | **Reuse that jobId** — do not re-prepare |
@@ -61,7 +61,7 @@ Drive:
61
61
  }
62
62
  ```
63
63
 
64
- Staged (after curl POST to each `uploadUrl`):
64
+ Function POST (image at or under 4MB, after curl POST to `uploadUrl`):
65
65
 
66
66
  ```json
67
67
  {
@@ -70,6 +70,15 @@ Staged (after curl POST to each `uploadUrl`):
70
70
  }
71
71
  ```
72
72
 
73
+ Direct (video, or an image over 4MB, after the presigned PUT). Do not POST that file through the function:
74
+
75
+ ```json
76
+ {
77
+ "action": "prepare",
78
+ "httpsUrls": ["https://….public.blob.vercel-storage.com/intake/…/file.mp4"]
79
+ }
80
+ ```
81
+
73
82
  CLI:
74
83
 
75
84
  ```bash
@@ -77,6 +86,7 @@ cms-edit media prepare --drive-folder "https://drive.google.com/drive/folders/
77
86
  --source-names "BusinessCards copy.jpg,ADB_Macbook_HomeLoop.mp4"
78
87
 
79
88
  cms-edit media prepare --staged-ids "id1,id2"
89
+ cms-edit media prepare --https-urls "https://….public.blob.vercel-storage.com/intake/…/file.mp4"
80
90
  ```
81
91
 
82
92
  Expect `{ ok: true, jobId, status: "queued", pollHint }`.
@@ -37,10 +37,42 @@
37
37
  Encode via **`task-media-pipeline-prepare`**. Intake can be:
38
38
 
39
39
  1. A **Drive folder**, or
40
- 2. **Staged upload** (4 MB): `cms_edit_request_staged_upload` → curl → `cms_edit_media` prepare with `stagedUploadIds` (see returned `consumeArgs`), or
40
+ 2. **Staged upload**: `cms_edit_request_staged_upload` → curl → follow `consumeArgs`, or
41
41
  3. **httpsUrls** on pipeline-allowed hosts
42
42
 
43
- Then wait → catalog → **import** with `overrides[].alt`. Do **not** `asset upload --staged/--base64` for jpeg/png/webp/gif/mp4. Do **not** `asset upload --url` for **video** (import only). Raster `--url` only for pipeline ready image hosts.
43
+ Then wait → catalog → **import** with `overrides[].alt` for a **new** asset. Do **not** `asset upload --staged/--base64` for jpeg/png/webp/gif/mp4. Do **not** `asset upload --url` for **video** (import only). Raster `--url` only for pipeline ready image hosts.
44
+
45
+ **Search before upload still applies.** `asset search` (title or file name) first. **Search by concept** is how an editor finds a subject and a tone, including files no page uses yet:
46
+
47
+ ```
48
+ cms_edit ["asset", "search", "--concept", "<subject-concept-id>", "--concept-all", "<tone-concept-id>"]
49
+ ```
50
+
51
+ `--concept` matches any listed id. Repeat `--concept-all` when several concepts are required. The result is id, title, file name, description, concepts. Concept search reads Contentful. It does not use the local index.
52
+
53
+ **Size.** Video source intake is **100MB** via direct-to-storage. An image master over **4MB** uses the same path. JSON, text, SVG, PDF, and Lottie stay on the **4MB** function POST. Pass `byteLength` for an image that might be over 4MB so the tool returns a presigned PUT (`intake: "direct"`) instead of the function URL. Run the curl, then `consumeArgs` (`media prepare --https-urls` of the public intake URL). The asset stored in Contentful is the **processed** file from the pack (`…/packs/…/ready/…`), not the 100MB source. Do not re-encode every asset. Size targets come from the site sizing standard. `asset review` still flags a stored video over **8MB**.
54
+
55
+ **Replace the file on an existing id** when pages already point at it. A second upload leaves those links on the old id.
56
+
57
+ ```
58
+ cms_edit ["asset", "replace", "<asset-id>", "--url", "<processed-ready-url>", "--dry-run"]
59
+ cms_edit ["asset", "replace", "<asset-id>", "--url", "<processed-ready-url>"]
60
+ ```
61
+
62
+ Replace keeps the id and the current file name. Dry-run returns id, file name, old dimensions, new dimensions, and writes nothing. The write is a draft. There is no publish flag. It refuses a replace that would turn an image into a non-image, or the reverse. SVG, PDF, and Lottie may use `--staged` or `--url`. Raster and video must use the processed pack URL.
63
+
64
+ **Title.** `asset set-title <asset-id> "<title>"` sets the asset title. Draft. It does not change the file name. Description stays `asset set-description`, written from the picture.
65
+
66
+ **Concepts are not blog tags.** `taxonomy-from-json` stays the blog importer (`tag` / `tagType`). Do not turn `taxonomyImport` on. Asset concepts are Contentful `metadata.concepts`, assigned by concept id after a person creates the scheme in the Taxonomy manager. The same organisation concepts show in every space. Files do not cross spaces. cms-edit does not create the scheme.
67
+
68
+ ```
69
+ cms_edit ["asset", "concept", "assign", "<asset-id>", "<concept-id>"]
70
+ cms_edit ["asset", "concept", "unassign", "<asset-id>", "<concept-id>"]
71
+ ```
72
+
73
+ A missing concept fails with the id. Do not invent one.
74
+
75
+ **Do not emotion-score headshots, logos, icons, or illustrations.** Tone concepts are for lifestyle photos only. Alt text is still the asset description, one sentence from looking at the picture, not a keyword list and not the file name.
44
76
 
45
77
  Animated GIFs become **MP4** (`gif-converted`) — attach as mute-loop Media / video visual, not `featuredImage`. **Do not** convert the GIF (or PNG) with local ffmpeg first; prepare the original file. If prepare gaps say `staged GET failed 405`, stop and report a cms-edit host bump — do not retry and do not use the Contentful web UI. If they say `staged GET failed 404`, re-stage (POST) and prepare once — the GET route exists.
46
78
 
@@ -48,19 +80,19 @@ Animated GIFs become **MP4** (`gif-converted`) — attach as mute-loop Media / v
48
80
 
49
81
  These may skip the pipeline. On hosted MCP use staged upload then `asset upload --staged`.
50
82
 
51
- ### Hosted MCP (SVG/PDF/Lottie only)
83
+ ### Hosted MCP
52
84
 
53
85
  **Always use staged upload** for ad-hoc binaries. Do not pass base64 in `cms_edit` args — hosted MCP rejects `asset upload --base64`.
54
86
 
55
- 1. `cms_edit_request_staged_upload` with `fileName`, `mimeType`, optional `byteLength`, optional `title`
56
- 2. Run the returned `curlCommand` in a shell (POST file to `uploadUrl`)
57
- 3. Follow `consumeArgs`: **media prepare** for photos/video; **asset upload --staged** for SVG/PDF/Lottie
87
+ 1. `cms_edit_request_staged_upload` with `fileName`, `mimeType`, `byteLength` when the file may be over 4MB, optional `title`
88
+ 2. Run the returned `curlCommand`. `intake: "direct"` (video, or an image over 4MB) is a PUT of the file. `intake: "function"` is a POST to `uploadUrl`. Do not POST a video through the function.
89
+ 3. Follow `consumeArgs`. Direct intake: **media prepare** with `--https-urls` / `httpsUrls`. Function intake of an image at or under 4MB: **media prepare** with `stagedUploadIds`. SVG/PDF/Lottie: **asset upload --staged**.
58
90
 
59
91
  Rules:
60
92
 
61
93
  - Staged upload keeps binary **out of MCP args**
62
- - Hosted limit: **4 MB** per file; **1000 upload URLs per user per hour**; TTL **60 minutes**
63
- - Raster/video staged files stay in Redis until pipeline fetches them (GET); they are not written to CMA
94
+ - Function POST (JSON, text, SVG, PDF, Lottie, and an image at or under 4MB): **4 MB**. Video, and an image master over 4MB: **100MB** presigned PUT to storage, then the media pipeline. **1000 upload URLs per user per hour**; TTL **60 minutes**
95
+ - Direct intake bytes are not stored in Redis. An image at or under 4MB stays in Redis until the pipeline fetches it (GET). Neither path writes the source to CMA
64
96
  - Upload/import alone does **not** attach the asset — follow with **link + save** (below)
65
97
  - Use `--if-exists-by-filename` (with `--file-name`) to avoid duplicate assets when re-running
66
98
 
@@ -1,5 +1,7 @@
1
1
  # Capability: Taxonomy setup
2
2
 
3
+ Blog `tag` / `tagType` / `articleType` entries. This is not Contentful asset concepts (`metadata.concepts`). Do not use `taxonomy-from-json` to label assets. Asset concepts are assigned with `asset concept assign` after a person creates the scheme in the Taxonomy manager.
4
+
3
5
  ## Intent phrases
4
6
 
5
7
  - create tags
@@ -110,6 +110,7 @@ Use **named keys** only — the CLI does not infer whether a string is an asset
110
110
  | `templateId` | `template` | Entry ID |
111
111
  | `articleTypeId` | `articleType` | Entry ID (articles) |
112
112
  | `topContentIds`, `visualsIds`, … | See `cms-edit help fields-taxonomy` | Entry ID arrays |
113
+ | `tagSlugs` | `tags` | Tag slug strings (articles). `tagsIds` is rejected. |
113
114
 
114
115
  ### Component `fields`
115
116
 
@@ -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`** (staged upload or Drive → prepare → import). 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.**
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: staged intake then **media pipeline**. SVG/PDF/Lottie: staged then `asset upload --staged`.
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
- | **Staged + pipeline** | jpeg/png/webp/gif/mp4 | `cms_edit_media` prepare `stagedUploadIds` → import (required for video) |
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:** media prepare for jpeg/png/webp/gif/mp4; **asset upload --staged** for SVG/PDF/Lottie
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**. Staged files: **4 MB**. Rate limit: **1000 upload URLs per user per hour**. TTL: **60 minutes**.
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.14.2",
3
+ "version": "3.15.1",
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",
@@ -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 (`stagedUploadIds`) → wait → catalog → import with real alt. Never `asset upload --staged/--url/--base64` for jpeg/png/webp/gif/mp4.
37
- - **SVG/PDF/Lottie:** `cms_edit_request_staged_upload` → curl → `asset upload --staged` (never `--base64`)
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? }`. Max upload size is **10MB** per file.
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