@se-studio/contentful-cms 3.14.0 → 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.
Files changed (93) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +6 -2
  3. package/dist/commands/add.d.ts.map +1 -1
  4. package/dist/commands/add.js +15 -101
  5. package/dist/commands/add.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/create-taxonomy.d.ts +11 -0
  10. package/dist/commands/create-taxonomy.d.ts.map +1 -1
  11. package/dist/commands/create-taxonomy.js +45 -4
  12. package/dist/commands/create-taxonomy.js.map +1 -1
  13. package/dist/contentful/asset-concepts.d.ts +53 -0
  14. package/dist/contentful/asset-concepts.d.ts.map +1 -0
  15. package/dist/contentful/asset-concepts.js +137 -0
  16. package/dist/contentful/asset-concepts.js.map +1 -0
  17. package/dist/contentful/asset-replace.d.ts +29 -0
  18. package/dist/contentful/asset-replace.d.ts.map +1 -0
  19. package/dist/contentful/asset-replace.js +57 -0
  20. package/dist/contentful/asset-replace.js.map +1 -0
  21. package/dist/contentful/assets.d.ts +11 -0
  22. package/dist/contentful/assets.d.ts.map +1 -1
  23. package/dist/contentful/assets.js +48 -2
  24. package/dist/contentful/assets.js.map +1 -1
  25. package/dist/contentful/client.d.ts +9 -0
  26. package/dist/contentful/client.d.ts.map +1 -1
  27. package/dist/contentful/client.js +27 -0
  28. package/dist/contentful/client.js.map +1 -1
  29. package/dist/contentful/cma-user-agent.d.ts +1 -1
  30. package/dist/contentful/entry-fields.d.ts +10 -0
  31. package/dist/contentful/entry-fields.d.ts.map +1 -1
  32. package/dist/contentful/entry-fields.js +23 -1
  33. package/dist/contentful/entry-fields.js.map +1 -1
  34. package/dist/contentful/linkedEntryFields.d.ts.map +1 -1
  35. package/dist/contentful/linkedEntryFields.js +1 -0
  36. package/dist/contentful/linkedEntryFields.js.map +1 -1
  37. package/dist/contentful/media-dimensions.d.ts +7 -0
  38. package/dist/contentful/media-dimensions.d.ts.map +1 -0
  39. package/dist/contentful/media-dimensions.js +169 -0
  40. package/dist/contentful/media-dimensions.js.map +1 -0
  41. package/dist/contentful/upload-limits.d.ts +10 -4
  42. package/dist/contentful/upload-limits.d.ts.map +1 -1
  43. package/dist/contentful/upload-limits.js +14 -7
  44. package/dist/contentful/upload-limits.js.map +1 -1
  45. package/dist/editor-pack/generate.js +2 -2
  46. package/dist/editor-pack/generate.js.map +1 -1
  47. package/dist/generated/help-topics.d.ts.map +1 -1
  48. package/dist/generated/help-topics.js +1 -1
  49. package/dist/generated/help-topics.js.map +1 -1
  50. package/dist/generated/hosted-guide.d.ts +1 -1
  51. package/dist/generated/hosted-guide.d.ts.map +1 -1
  52. package/dist/generated/hosted-guide.js +1 -1
  53. package/dist/generated/hosted-guide.js.map +1 -1
  54. package/dist/generated/version.d.ts +1 -1
  55. package/dist/generated/version.js +1 -1
  56. package/dist/mcp/tools/cms-edit.d.ts +1 -1
  57. package/dist/mcp/tools/cms-edit.d.ts.map +1 -1
  58. package/dist/mcp/tools/cms-edit.js +1 -1
  59. package/dist/mcp/tools/media.d.ts.map +1 -1
  60. package/dist/mcp/tools/media.js +3 -3
  61. package/dist/mcp/tools/media.js.map +1 -1
  62. package/dist/mcp/tools/staged-upload.d.ts.map +1 -1
  63. package/dist/mcp/tools/staged-upload.js +4 -3
  64. package/dist/mcp/tools/staged-upload.js.map +1 -1
  65. package/dist/session/refs.d.ts.map +1 -1
  66. package/dist/session/refs.js +2 -0
  67. package/dist/session/refs.js.map +1 -1
  68. package/dist/staged-upload/direct-intake.d.ts +23 -0
  69. package/dist/staged-upload/direct-intake.d.ts.map +1 -0
  70. package/dist/staged-upload/direct-intake.js +71 -0
  71. package/dist/staged-upload/direct-intake.js.map +1 -0
  72. package/dist/staged-upload/intake-policy.d.ts +13 -0
  73. package/dist/staged-upload/intake-policy.d.ts.map +1 -0
  74. package/dist/staged-upload/intake-policy.js +37 -0
  75. package/dist/staged-upload/intake-policy.js.map +1 -0
  76. package/dist/staged-upload/request.d.ts +5 -1
  77. package/dist/staged-upload/request.d.ts.map +1 -1
  78. package/dist/staged-upload/request.js +31 -2
  79. package/dist/staged-upload/request.js.map +1 -1
  80. package/dist/staged-upload/types.d.ts +4 -0
  81. package/dist/staged-upload/types.d.ts.map +1 -1
  82. package/dist/validation/allowed-types.d.ts.map +1 -1
  83. package/dist/validation/allowed-types.js +12 -1
  84. package/dist/validation/allowed-types.js.map +1 -1
  85. package/docs/FUNCTIONAL_SPEC.md +1 -1
  86. package/docs/editor-tasks/media-pipeline-prepare.md +12 -2
  87. package/docs/editor-tasks/media-reuse-and-upload.md +40 -8
  88. package/docs/editor-tasks/taxonomy.md +2 -0
  89. package/docs/help/index.md +1 -1
  90. package/docs/mcp/hosted-guide.md +8 -6
  91. package/package.json +2 -1
  92. package/skills/core/SKILL.md +11 -5
  93. package/skills/editor-tasks/SKILL.md +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @se-studio/contentful-cms Changelog
2
2
 
3
+ ## 3.15.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Add asset replace (same id, same file name, dry-run, draft), asset set-title, concept assign and unassign, and asset search by concept. Video and image masters over 4MB upload direct to storage up to 100MB, then the media pipeline. The 4MB function cap stays for JSON, text, SVG, PDF, and Lottie.
8
+
9
+ Every cms-edit host gets this on the next package bump. No site code change. Hosts that intake video or large masters need `BLOB_READ_WRITE_TOKEN`. The media pipeline fetch timeout for HTTPS sources is 180s in the media-pipeline app, which deploys separately.
10
+
11
+ ## 3.14.2
12
+
13
+ ### Patch Changes
14
+
15
+ - e947c0f: cms-edit add places new sections on a person type index or person page. Publishing an index template or directory schema refreshes person type pages.
16
+
17
+ ## 3.14.1
18
+
19
+ ### Patch Changes
20
+
21
+ - Person type directories now render like article type indexes. A person type can carry index page content and index schema, and personPageTopContent, personPageIndexed, and personPageHidden apply to every person of that type. personTemplate is read as personPageTemplate once migration 35 renames the field.
22
+
3
23
  ## 3.14.0
4
24
 
5
25
  ### Minor Changes
package/README.md CHANGED
@@ -233,7 +233,7 @@ For content types that follow the `${contentType}Type` naming convention (e.g. `
233
233
  | `create taxonomy-from-json --json '…' [--if-not-exists] [--dry-run]` | Batch-create tagType, articleType, and tag entries from JSON |
234
234
  | `create person-from-json --json '…' [--if-not-exists] [--dry-run]` | Batch-create person/author entries from JSON |
235
235
  | `create person --slug <slug> --name "X" [--job-title <t>] [--person-type-id <id>] [--person-type-slug <slug>] [--indexed true\|false] [--hidden true\|false] [--if-not-exists] [--dry-run]` | Create a person entry (draft) |
236
- | `create person-type --slug <slug> --name "X" [--person-template-id <id>] [--index-page-template-id <id>] [--indexed true\|false] [--hidden true\|false] [--if-not-exists] [--dry-run]` | Create a personType entry (draft) |
236
+ | `create person-type --slug <slug> --name "X" [--person-page-template-id <id>] [--index-page-template-id <id>] [--index-page-top-content-ids <ids>] [--person-page-indexed true\|false] [--person-page-hidden true\|false] [--indexed true\|false] [--hidden true\|false] [--if-not-exists] [--dry-run]` | Create a personType entry (draft). Index flags default indexed on and hidden off. Person-page flags stay unset when omitted. |
237
237
  | `create person … [--bio-markdown <md>]` or `[--bio-file <path>]` | Bio as Markdown (mutually exclusive paths) |
238
238
  | `create tag-type --slug <slug> --name "X" [--json-file <path>] [--if-not-exists] [--dry-run]` | Create a tagType entry (draft) |
239
239
  | `create article-type --slug <slug> --name "X" [--json-file <path>] [--if-not-exists] [--dry-run]` | Create an articleType entry (draft) |
@@ -347,9 +347,13 @@ Configure optional tokens in `.contentful-cms.json` (`previewAccessToken` for de
347
347
  | `asset upload … --with-media [--media-name "X"] [--media-position Left\|Middle\|Right] [--media-width <1–100>]` | Also create a draft Media wrapper |
348
348
  | `asset upload … --if-exists-by-filename` | Return existing asset (and media if `--with-media`) when fileName matches |
349
349
  | `asset info <asset-id>` | Show asset details |
350
+ | `asset search --concept <id> [--concept-all <id>]` | Live concept search (id, title, file name, description, concepts). Not the blog tag index |
351
+ | `asset set-title <asset-id> <title>` | Set the asset title. Draft. Does not change the file name |
352
+ | `asset replace <asset-id> --url <ready-url> [--dry-run]` | New binary on the same id. Keeps the file name. Draft. Raster/video URL must be a processed pack |
353
+ | `asset concept assign\|unassign <asset-id> <concept-id...>` | Write `metadata.concepts`. Fails if the concept does not exist |
350
354
  | `asset set <ref> <field> <asset-id>` | Set a visual/asset field |
351
355
 
352
- JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?, mediaIds? }`. Uploads are limited to **10MB** per file (local/URL/base64) or **4MB** per staged file on hosted MCP. With `--if-exists-by-filename`, run uploads **one at a time** per `fileName` if your script uses parallelism (see idempotent note above).
356
+ JSON output for upload (`CMS_EDIT_JSON=1`): `{ ok, id, fileName, url, mediaId?, mediaIds? }`. Bytes that pass through this process are limited to **10MB** (local/URL/base64) or **4MB** (hosted function POST for JSON, text, SVG, PDF, and Lottie). Video, and an image master over 4MB, use a presigned direct upload of up to **100MB**, then the media pipeline. Contentful stores the processed file. With `--if-exists-by-filename`, run uploads **one at a time** per `fileName` if your script uses parallelism (see idempotent note above).
353
357
 
354
358
  ### Navigation Entries
355
359
 
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BzC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiazD"}
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAEvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BzC,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsUzD"}
@@ -8,7 +8,7 @@ import { errorMsg, successMsg, warnMsg } from '../output/print.js';
8
8
  import { buildTree, findTreeNode, makeEntryLink, resolveRef } from '../session/refs.js';
9
9
  import { requireSession, saveSession } from '../session/store.js';
10
10
  import { renderSnapshot } from '../snapshot/render.js';
11
- import { addContentTypeError } from '../validation/allowed-types.js';
11
+ import { addContentTypeError, resolveAddTargetField } from '../validation/allowed-types.js';
12
12
  import { buildAddCreateFields } from './add-initial-fields.js';
13
13
  import { assertAddTargetIsEntryLinkArray } from './add-target-field.js';
14
14
  function getValidTypeValues(ctDef, typeFieldId) {
@@ -71,54 +71,12 @@ export function registerAddCommand(program) {
71
71
  process.exit(1);
72
72
  }
73
73
  const parentCtId = parentEntryEarly.sys.contentType.sys.id;
74
- if (parentCtId === 'collection') {
75
- targetField = opts.target ?? 'contents';
76
- }
77
- else if (parentCtId === 'page' ||
78
- parentCtId === 'article' ||
79
- parentCtId === 'articleType' ||
80
- parentCtId === 'tag') {
81
- const contentRootAllowed = ['topContent', 'content', 'bottomContent'];
82
- if (opts.target && !contentRootAllowed.includes(opts.target)) {
83
- errorMsg(`--target must be one of: ${contentRootAllowed.join(', ')}. Got: ${opts.target}`);
84
- process.exit(1);
85
- }
86
- targetField = opts.target ?? 'content';
87
- }
88
- else if (parentCtId === 'template') {
89
- const templateAllowed = ['preContent', 'postContent'];
90
- if (!opts.target || !templateAllowed.includes(opts.target)) {
91
- errorMsg('For template parent, --target preContent or postContent is required.');
92
- process.exit(1);
93
- }
94
- targetField = opts.target;
95
- }
96
- else if (parentCtId === 'pageVariant') {
97
- if (opts.target && opts.target !== 'alternativeContents') {
98
- errorMsg(`--target on a page variant must be alternativeContents. Got: ${opts.target}`);
99
- process.exit(1);
100
- }
101
- targetField = 'alternativeContents';
102
- }
103
- else if (parentCtId === 'customType') {
104
- const customAllowed = ['topContent', 'indexPageTopContent'];
105
- if (opts.target && !customAllowed.includes(opts.target)) {
106
- errorMsg(`--target must be one of: ${customAllowed.join(', ')}. Got: ${opts.target}`);
107
- process.exit(1);
108
- }
109
- targetField = opts.target ?? 'topContent';
110
- }
111
- else {
112
- // Non-container parents (component, media, …): require explicit --target and schema check.
113
- if (!opts.target) {
114
- errorMsg(`Parent content type "${parentCtId}" is not a page/article/collection/template. ` +
115
- `add cannot invent a target field. For singular links (e.g. visual) use:\n` +
116
- ` set ${opts.parent} visual <entryId> --link\n` +
117
- `Or pass --parent pointing at a collection/page and --target content|contents.`);
118
- process.exit(1);
119
- }
120
- targetField = opts.target;
74
+ const resolved = resolveAddTargetField(parentCtId, opts.target, 'parent');
75
+ if (!resolved.ok) {
76
+ errorMsg(resolved.message);
77
+ process.exit(1);
121
78
  }
79
+ targetField = resolved.field;
122
80
  }
123
81
  else if (opts.after) {
124
82
  resolveRef(session, opts.after);
@@ -132,61 +90,17 @@ export function registerAddCommand(program) {
132
90
  }
133
91
  else {
134
92
  parentEntryId = session.rootEntryId;
135
- if (opts.target) {
136
- if (session.rootEntryType === 'template') {
137
- const templateAllowed = ['preContent', 'postContent'];
138
- if (!templateAllowed.includes(opts.target)) {
139
- errorMsg('For template use preContent or postContent.');
140
- process.exit(1);
141
- }
142
- targetField = opts.target;
143
- }
144
- else if (session.rootEntryType === 'pageVariant') {
145
- if (opts.target !== 'alternativeContents') {
146
- errorMsg(`--target on a page variant must be alternativeContents. Got: ${opts.target}`);
147
- process.exit(1);
148
- }
149
- targetField = 'alternativeContents';
150
- }
151
- else if (session.rootEntryType === 'customType') {
152
- const customAllowed = ['topContent', 'indexPageTopContent'];
153
- if (!customAllowed.includes(opts.target)) {
154
- errorMsg(`--target must be one of: ${customAllowed.join(', ')}. Got: ${opts.target}`);
155
- process.exit(1);
156
- }
157
- targetField = opts.target;
158
- }
159
- else if (session.rootEntryType === 'page' ||
160
- session.rootEntryType === 'article' ||
161
- session.rootEntryType === 'articleType' ||
162
- session.rootEntryType === 'tag') {
163
- const contentRootAllowed = ['topContent', 'content', 'bottomContent'];
164
- if (!contentRootAllowed.includes(opts.target)) {
165
- errorMsg(`--target must be one of: ${contentRootAllowed.join(', ')}. Got: ${opts.target}`);
166
- process.exit(1);
167
- }
168
- targetField = opts.target;
169
- }
170
- else {
171
- errorMsg(`--target is only supported when the session root is a page, article, articleType, or tag. Current root is ${session.rootEntryType}.`);
172
- process.exit(1);
173
- }
93
+ const rootEntry = session.entries[parentEntryId];
94
+ if (!rootEntry) {
95
+ errorMsg('Parent entry not found in session.');
96
+ process.exit(1);
174
97
  }
175
- else {
176
- if (session.rootEntryType === 'template') {
177
- errorMsg('For template, --target is required. Use preContent or postContent.');
178
- process.exit(1);
179
- }
180
- if (session.rootEntryType === 'pageVariant') {
181
- targetField = 'alternativeContents';
182
- }
183
- else if (session.rootEntryType === 'customType') {
184
- targetField = 'topContent';
185
- }
186
- else {
187
- targetField = 'content';
188
- }
98
+ const resolved = resolveAddTargetField(rootEntry.sys.contentType.sys.id, opts.target, 'root');
99
+ if (!resolved.ok) {
100
+ errorMsg(resolved.message);
101
+ process.exit(1);
189
102
  }
103
+ targetField = resolved.field;
190
104
  }
191
105
  const parentEntry = session.entries[parentEntryId];
192
106
  if (!parentEntry) {
@@ -1 +1 @@
1
- {"version":3,"file":"add.js","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAIvF,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,cAAc,EAA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AS,UAAU,GAAG;oBAC9D,CAAC,CAAC,WAAW,IAAI,OAAO,MAAM,SAAS,UAAU,qCAAqC,MAAM,mBAAmB,CAClH,CAAC;YACJ,CAAC;YACD,OAAO,CACL,2DAA2D;gBACzD,8GAA8G;gBAC9G,6EAA6E;gBAC7E,8FAA8F,CACjG,CAAC;YACF,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC;gBAClB,cAAc,CAAC,OAAO,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CACF,CAAC;AACN,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/commands/asset.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoDzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAm1B3D"}
1
+ {"version":3,"file":"asset.d.ts","sourceRoot":"","sources":["../../src/commands/asset.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqEzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+jC3D"}
@@ -4,7 +4,9 @@ import pc from 'picocolors';
4
4
  import { attachAssetUsages } from '../audit/asset-usage.js';
5
5
  import { runMediaReview } from '../audit/media-review.js';
6
6
  import { loadConfig, resolveSpaceConfig } from '../config/load.js';
7
- import { defaultFileNameForMime, getAssetBacklinks, getAssetSummary, uploadAssetBuffer, } from '../contentful/assets.js';
7
+ import { assertConceptsExist, assetConceptHit, assignConceptIds, CONCEPT_SEARCH_SCAN_PAGE, conceptIdsFromLinks, conceptLink, conceptSearchHasLocalFilter, conceptSearchQuery, matchesConceptSearch, unassignConceptIds, windowConceptHits, } from '../contentful/asset-concepts.js';
8
+ import { planAssetReplace } from '../contentful/asset-replace.js';
9
+ import { defaultFileNameForMime, getAssetBacklinks, getAssetSummary, replaceAssetFile, summariseAsset, uploadAssetBuffer, } from '../contentful/assets.js';
8
10
  import { createSafeEnvironment } from '../contentful/client.js';
9
11
  import { HOSTED_ASSET_UPLOAD_BASE64_ERROR, isHostedAssetUploadContext, } from '../contentful/hosted-asset-upload.js';
10
12
  import { createMediaEntry } from '../contentful/media.js';
@@ -22,6 +24,7 @@ import { errorMsg, infoMsg, successMsg, warnMsg } from '../output/print.js';
22
24
  import { getRuntimeContext } from '../runtime/context.js';
23
25
  import { makeAssetLink, makeEntryLink, resolveRef } from '../session/refs.js';
24
26
  import { requireSession, saveSession } from '../session/store.js';
27
+ import { tryConsumeStagedUpload } from '../staged-upload/consume-text.js';
25
28
  import { assertStagedKind } from '../staged-upload/mime.js';
26
29
  function handleAssetCommandError(err) {
27
30
  if (err instanceof ContentIndexSyncError) {
@@ -36,12 +39,14 @@ export function registerAssetCommand(program) {
36
39
  const asset = program.command('asset').description('Search and inspect Contentful assets');
37
40
  asset
38
41
  .command('search [query]')
39
- .description('Search assets by title and/or filename')
42
+ .description('Search assets by title, filename, or concept id')
40
43
  .option('-n, --limit <n>', 'Max results (default 10)', '10')
41
44
  .option('--skip <n>', 'Skip first N results for pagination', '0')
42
45
  .option('--type <mime>', 'Filter by MIME type prefix (e.g. image/, application/pdf)')
43
46
  .option('--filename <name>', 'Exact match on file.fileName')
44
47
  .option('--filename-match <pattern>', 'Regex match on file.fileName')
48
+ .option('--concept <id>', 'Concept id. Repeat to match any of them.', collectIds, [])
49
+ .option('--concept-all <id>', 'Concept id that must be present. Repeat when several are required.', collectIds, [])
45
50
  .action(async (query, opts, cmd) => {
46
51
  const parentOpts = cmd.parent?.parent?.opts() ?? {};
47
52
  try {
@@ -49,9 +54,73 @@ export function registerAssetCommand(program) {
49
54
  const { space } = resolveSpaceConfig(config, parentOpts.space);
50
55
  const limit = Number.parseInt(opts.limit, 10) || 10;
51
56
  const skip = Number.parseInt(opts.skip, 10) || 0;
57
+ const conceptIds = opts.concept ?? [];
58
+ const conceptAllIds = opts.conceptAll ?? [];
59
+ if (conceptIds.length > 0 || conceptAllIds.length > 0) {
60
+ const env = await createSafeEnvironment(space);
61
+ const filter = {
62
+ title: query,
63
+ contentTypePrefix: opts.type,
64
+ fileName: opts.filename,
65
+ fileNamePattern: opts.filenameMatch
66
+ ? parseSafeRegExpPattern(opts.filenameMatch, '--filename-match')
67
+ : undefined,
68
+ };
69
+ if (!conceptSearchHasLocalFilter(filter)) {
70
+ const page = await env.getAssets(conceptSearchQuery({ conceptIds, conceptAllIds, limit, skip }));
71
+ const hits = page.items.map(assetConceptHit);
72
+ const scanned = (page.skip ?? skip) + page.items.length;
73
+ printConceptHits(hits, {
74
+ query,
75
+ conceptIds,
76
+ conceptAllIds,
77
+ limit,
78
+ skip,
79
+ more: scanned < page.total,
80
+ });
81
+ return;
82
+ }
83
+ const matched = [];
84
+ let cmaSkip = 0;
85
+ let total = Number.POSITIVE_INFINITY;
86
+ let scannedAll = false;
87
+ const wanted = skip + limit;
88
+ while (cmaSkip < total) {
89
+ const page = await env.getAssets(conceptSearchQuery({
90
+ conceptIds,
91
+ conceptAllIds,
92
+ limit: CONCEPT_SEARCH_SCAN_PAGE,
93
+ skip: cmaSkip,
94
+ }));
95
+ total = page.total;
96
+ for (const asset of page.items) {
97
+ if (matchesConceptSearch(asset, filter)) {
98
+ matched.push(assetConceptHit(asset));
99
+ }
100
+ }
101
+ cmaSkip += page.items.length;
102
+ if (page.items.length === 0 || cmaSkip >= total) {
103
+ scannedAll = true;
104
+ break;
105
+ }
106
+ if (matched.length >= wanted) {
107
+ break;
108
+ }
109
+ }
110
+ const window = windowConceptHits(matched, skip, limit, scannedAll);
111
+ printConceptHits(window.hits, {
112
+ query,
113
+ conceptIds,
114
+ conceptAllIds,
115
+ limit,
116
+ skip,
117
+ more: window.more,
118
+ });
119
+ return;
120
+ }
52
121
  await ensureContentIndex(space, { onRebuild: warnMsg });
53
122
  if (!query && !opts.filename && !opts.filenameMatch) {
54
- errorMsg('Provide a title query and/or --filename / --filename-match.');
123
+ errorMsg('Provide a title query, --filename / --filename-match, or --concept / --concept-all.');
55
124
  process.exit(1);
56
125
  }
57
126
  if (opts.filename && query) {
@@ -684,6 +753,244 @@ export function registerAssetCommand(program) {
684
753
  process.exit(1);
685
754
  }
686
755
  });
756
+ asset
757
+ .command('set-title <asset-id> <title>')
758
+ .description('Set the title on an existing asset. Saves as draft. Does not change the file name or description.\n' +
759
+ 'Example: cms-edit asset set-title abc123 "Parent and clinician"')
760
+ .action(async (assetId, title, _opts, cmd) => {
761
+ const parentOpts = cmd.parent?.parent?.opts() ?? {};
762
+ try {
763
+ const nextTitle = title.trim();
764
+ if (!nextTitle) {
765
+ errorMsg('Title is empty.');
766
+ process.exit(1);
767
+ }
768
+ const config = loadConfig(parentOpts.config);
769
+ const { space } = resolveSpaceConfig(config, parentOpts.space);
770
+ const env = await createSafeEnvironment(space);
771
+ const locale = space.defaultLocale;
772
+ const asset = await env.getAsset(assetId);
773
+ const fields = asset.fields;
774
+ if (!fields['title']) {
775
+ fields['title'] = {};
776
+ }
777
+ fields['title'][locale] = nextTitle;
778
+ await env.updateAsset(asset);
779
+ const summary = await getAssetSummary(env, assetId);
780
+ if (summary) {
781
+ await notifyContentIndexChanged(space, {
782
+ upsertAssets: [assetSummaryToIndexRow(summary)],
783
+ });
784
+ }
785
+ if (isJsonMode()) {
786
+ console.log(JSON.stringify({ ok: true, assetId, title: nextTitle }, null, 2));
787
+ }
788
+ else {
789
+ successMsg(`Updated title on asset ${assetId} (saved as draft).`);
790
+ }
791
+ }
792
+ catch (err) {
793
+ errorMsg(err instanceof Error ? err.message : String(err));
794
+ process.exit(1);
795
+ }
796
+ });
797
+ asset
798
+ .command('replace <asset-id>')
799
+ .description('Replace the binary on an existing asset id. Links stay. The current file name stays. Draft only.\n' +
800
+ 'Raster and video: --url of the processed pack (…/packs/…/ready/…), after direct intake and the media pipeline.\n' +
801
+ 'SVG, PDF, and Lottie: --staged or --url. --dry-run returns id, file name, old dimensions, new dimensions.\n' +
802
+ 'Refuses a replace that would turn an image into a non-image, or the reverse.')
803
+ .option('--staged <uploadId>', 'Staged SVG, PDF, or Lottie upload id')
804
+ .option('--url <https-url>', 'Processed pack URL, or an SVG/PDF/Lottie URL')
805
+ .option('--mime <type>', 'MIME type when the response does not send one')
806
+ .option('--dry-run', 'Read dimensions and refuse an image-class change. Does not write.')
807
+ .action(async (assetId, opts, cmd) => {
808
+ const parentOpts = cmd.parent?.parent?.opts() ?? {};
809
+ try {
810
+ const sources = [opts.url, opts.staged].filter(Boolean);
811
+ if (sources.length !== 1) {
812
+ errorMsg('Provide exactly one replacement source: --url or --staged.');
813
+ process.exit(1);
814
+ }
815
+ const config = loadConfig(parentOpts.config);
816
+ const { space } = resolveSpaceConfig(config, parentOpts.space);
817
+ const env = await createSafeEnvironment(space);
818
+ const current = await env.getAsset(assetId);
819
+ const summary = summariseAsset(current);
820
+ const loaded = await loadReplacementSource(opts);
821
+ const nextContentType = (opts.mime ?? loaded.mimeType).trim().toLowerCase();
822
+ const plan = planAssetReplace({
823
+ id: assetId,
824
+ fileName: summary.fileName,
825
+ contentType: summary.contentType,
826
+ width: summary.width,
827
+ height: summary.height,
828
+ nextBuffer: loaded.buffer,
829
+ nextContentType,
830
+ sourceUrl: opts.url,
831
+ });
832
+ if (opts.dryRun) {
833
+ printReplacePlan(plan, true);
834
+ return;
835
+ }
836
+ const replaced = await replaceAssetFile(env, assetId, loaded.buffer, {
837
+ mimeType: nextContentType,
838
+ locale: space.defaultLocale,
839
+ sourceUrl: opts.url,
840
+ }, (msg) => infoMsg(msg));
841
+ await notifyContentIndexChanged(space, {
842
+ upsertAssets: [assetSummaryToIndexRow(replaced)],
843
+ });
844
+ if (opts.staged) {
845
+ await tryConsumeStagedUpload(() => consumeStagedReplacement(opts.staged ?? ''), 'Replaced the asset file');
846
+ }
847
+ printReplacePlan({
848
+ ...plan,
849
+ new: {
850
+ width: replaced.width ?? plan.new.width,
851
+ height: replaced.height ?? plan.new.height,
852
+ },
853
+ }, false);
854
+ }
855
+ catch (err) {
856
+ errorMsg(err instanceof Error ? err.message : String(err));
857
+ process.exit(1);
858
+ }
859
+ });
860
+ const concept = asset
861
+ .command('concept')
862
+ .description('Assign or remove Contentful taxonomy concepts on an asset. Does not create schemes.');
863
+ concept
864
+ .command('assign <asset-id> <concept-id...>')
865
+ .description('Add concept ids to metadata.concepts. Fails if a concept does not exist. Draft only.\n' +
866
+ 'Example: cms-edit asset concept assign abc123 conceptId1 conceptId2')
867
+ .action(async (assetId, conceptIds, _opts, cmd) => {
868
+ await writeAssetConcepts(assetId, conceptIds, 'assign', cmd);
869
+ });
870
+ concept
871
+ .command('unassign <asset-id> <concept-id...>')
872
+ .description('Remove concept ids from metadata.concepts. Fails if a concept does not exist. Draft only.')
873
+ .action(async (assetId, conceptIds, _opts, cmd) => {
874
+ await writeAssetConcepts(assetId, conceptIds, 'unassign', cmd);
875
+ });
876
+ }
877
+ function collectIds(value, previous = []) {
878
+ return [...previous, value];
879
+ }
880
+ function programOpts(cmd) {
881
+ let current = cmd;
882
+ while (current.parent) {
883
+ current = current.parent;
884
+ }
885
+ return current.opts();
886
+ }
887
+ function printConceptHits(hits, label) {
888
+ if (isJsonMode()) {
889
+ console.log(JSON.stringify(hits, null, 2));
890
+ return;
891
+ }
892
+ if (hits.length === 0) {
893
+ console.log(pc.dim('No assets found for those concepts.'));
894
+ return;
895
+ }
896
+ const name = [...label.conceptIds, ...label.conceptAllIds.map((id) => `all:${id}`)].join(', ');
897
+ console.log(`\n${pc.bold('Assets with concepts: ')}${pc.cyan(name)}\n`);
898
+ for (const hit of hits) {
899
+ console.log(` ${pc.bold(hit.id)} ${hit.title}`);
900
+ console.log(` ${pc.dim(hit.fileName)}`);
901
+ console.log(` ${hit.description ?? pc.dim('(no description)')}`);
902
+ console.log(` ${pc.dim(`concepts: ${hit.concepts.join(', ') || '(none)'}`)}`);
903
+ }
904
+ console.log('');
905
+ if (label.more) {
906
+ console.log(pc.dim(`Use --skip ${String(label.skip + hits.length)} to see the next page.`));
907
+ }
908
+ }
909
+ function printReplacePlan(plan, dryRun) {
910
+ const body = {
911
+ ok: true,
912
+ dryRun,
913
+ id: plan.id,
914
+ fileName: plan.fileName,
915
+ old: plan.old,
916
+ new: plan.new,
917
+ };
918
+ if (isJsonMode()) {
919
+ console.log(JSON.stringify(body, null, 2));
920
+ return;
921
+ }
922
+ const dims = (value) => value.width && value.height ? `${String(value.width)}×${String(value.height)}` : 'unknown';
923
+ if (dryRun) {
924
+ console.log(`\n${pc.bold('Replace dry-run')}\n`);
925
+ }
926
+ else {
927
+ successMsg(`Replaced file on asset ${plan.id} (saved as draft). File name unchanged.`);
928
+ }
929
+ console.log(` id: ${plan.id}`);
930
+ console.log(` fileName: ${plan.fileName}`);
931
+ console.log(` old: ${dims(plan.old)}`);
932
+ console.log(` new: ${dims(plan.new)}\n`);
933
+ }
934
+ async function loadReplacementSource(opts) {
935
+ if (opts.url) {
936
+ const fetched = await fetchUploadSource(opts.url);
937
+ return { buffer: fetched.buffer, mimeType: opts.mime ?? fetched.contentType ?? '' };
938
+ }
939
+ const staged = await peekStagedReplacement(opts.staged ?? '');
940
+ return { buffer: staged.buffer, mimeType: opts.mime ?? staged.mimeType };
941
+ }
942
+ async function peekStagedReplacement(uploadId) {
943
+ const context = getRuntimeContext();
944
+ const userId = context?.user?.userId;
945
+ const stagedStore = context?.stagedUploadStore;
946
+ if (!userId || !stagedStore) {
947
+ throw new Error('--staged requires hosted MCP context (authenticated user and Redis staged upload store).');
948
+ }
949
+ const staged = await stagedStore.peekFile(userId, uploadId);
950
+ assertStagedKind(staged.kind, ['asset']);
951
+ return staged;
952
+ }
953
+ async function consumeStagedReplacement(uploadId) {
954
+ const context = getRuntimeContext();
955
+ const userId = context?.user?.userId;
956
+ const stagedStore = context?.stagedUploadStore;
957
+ if (!userId || !stagedStore) {
958
+ throw new Error('--staged requires hosted MCP context (authenticated user and Redis staged upload store).');
959
+ }
960
+ await stagedStore.consume(userId, uploadId);
961
+ }
962
+ async function writeAssetConcepts(assetId, conceptIds, mode, cmd) {
963
+ const parentOpts = programOpts(cmd);
964
+ try {
965
+ const config = loadConfig(parentOpts.config);
966
+ const { space } = resolveSpaceConfig(config, parentOpts.space);
967
+ const env = await createSafeEnvironment(space);
968
+ await assertConceptsExist(env, conceptIds);
969
+ const asset = await env.getAsset(assetId);
970
+ const current = conceptIdsFromLinks(asset.metadata?.concepts);
971
+ const next = mode === 'assign'
972
+ ? assignConceptIds(current, conceptIds)
973
+ : unassignConceptIds(current, conceptIds);
974
+ asset.metadata = {
975
+ ...(asset.metadata ?? {}),
976
+ tags: asset.metadata?.tags ?? [],
977
+ concepts: next.map(conceptLink),
978
+ };
979
+ await env.updateAsset(asset);
980
+ if (isJsonMode()) {
981
+ console.log(JSON.stringify({ ok: true, assetId, concepts: next }, null, 2));
982
+ }
983
+ else {
984
+ successMsg(mode === 'assign'
985
+ ? `Assigned concepts on asset ${assetId} (saved as draft).`
986
+ : `Removed concepts on asset ${assetId} (saved as draft).`);
987
+ console.log(pc.dim(` concepts: ${next.join(', ') || '(none)'}`));
988
+ }
989
+ }
990
+ catch (err) {
991
+ errorMsg(err instanceof Error ? err.message : String(err));
992
+ process.exit(1);
993
+ }
687
994
  }
688
995
  function assetSummaryToIndexRow(summary) {
689
996
  return {