@se-studio/contentful-cms 2.5.1 → 2.6.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.
- package/CHANGELOG.md +49 -12
- package/INSTALL.md +1 -1
- package/README.md +10 -17
- package/dist/audit/asset-usage.d.ts +29 -0
- package/dist/audit/asset-usage.d.ts.map +1 -0
- package/dist/audit/asset-usage.js +99 -0
- package/dist/audit/asset-usage.js.map +1 -0
- package/dist/audit/media-review.d.ts +6 -0
- package/dist/audit/media-review.d.ts.map +1 -1
- package/dist/audit/media-review.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +4 -22
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/add.js +1 -1
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/asset.d.ts.map +1 -1
- package/dist/commands/asset.js +15 -0
- package/dist/commands/asset.js.map +1 -1
- package/dist/commands/batch.d.ts.map +1 -1
- package/dist/commands/batch.js +5 -2
- package/dist/commands/batch.js.map +1 -1
- package/dist/commands/create-from-json.d.ts.map +1 -1
- package/dist/commands/create-from-json.js +24 -2
- package/dist/commands/create-from-json.js.map +1 -1
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +3 -2
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/run.d.ts +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +3 -3
- package/dist/commands/run.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +228 -85
- package/dist/commands/schema.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/guide.js +1 -1
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.js +7 -7
- package/dist/mcp/prompts/onboarding.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 +1 -1
- package/docs/FUNCTIONAL_SPEC.md +2 -2
- package/docs/SKILLS.md +3 -3
- package/docs/editor-tasks/bulk-find-replace.md +2 -2
- package/docs/editor-tasks/seo-descriptions.md +1 -1
- package/docs/editor-tasks/taxonomy.md +2 -2
- package/docs/help/asset-review.md +6 -0
- package/docs/help/{run.md → batch-run.md} +8 -8
- package/docs/help/create-from-json.md +3 -2
- package/docs/help/fields-article.md +2 -2
- package/docs/help/fields-component.md +3 -3
- package/docs/help/fields-taxonomy.md +6 -6
- package/docs/help/fields.md +2 -2
- package/docs/help/index-sync.md +1 -1
- package/docs/help/index.md +23 -18
- package/docs/help/lookup.md +1 -1
- package/docs/help/person-from-json.md +3 -3
- package/docs/help/taxonomy-from-json.md +3 -3
- package/docs/help/workflow.md +1 -1
- package/docs/mcp/e2e-test-prompt.md +159 -0
- package/docs/mcp/hosted-guide.md +10 -6
- package/package.json +2 -3
- package/skills/README.md +2 -2
- package/skills/core/SKILL.md +33 -40
- package/skills/setup/SKILL.md +1 -1
- package/dist/bin/contentful-cms.d.ts +0 -3
- package/dist/bin/contentful-cms.d.ts.map +0 -1
- package/dist/bin/contentful-cms.js +0 -5
- package/dist/bin/contentful-cms.js.map +0 -1
- package/dist/commands/audit.d.ts +0 -4
- package/dist/commands/audit.d.ts.map +0 -1
- package/dist/commands/audit.js +0 -399
- package/dist/commands/audit.js.map +0 -1
- package/dist/commands/backup.d.ts +0 -3
- package/dist/commands/backup.d.ts.map +0 -1
- package/dist/commands/backup.js +0 -143
- package/dist/commands/backup.js.map +0 -1
- package/dist/commands/colours.d.ts +0 -4
- package/dist/commands/colours.d.ts.map +0 -1
- package/dist/commands/colours.js +0 -91
- package/dist/commands/colours.js.map +0 -1
- package/dist/commands/ensure.d.ts +0 -4
- package/dist/commands/ensure.d.ts.map +0 -1
- package/dist/commands/ensure.js +0 -152
- package/dist/commands/ensure.js.map +0 -1
- package/dist/commands/restore.d.ts +0 -4
- package/dist/commands/restore.d.ts.map +0 -1
- package/dist/commands/restore.js +0 -146
- package/dist/commands/restore.js.map +0 -1
- package/dist/commands/revert.d.ts +0 -4
- package/dist/commands/revert.d.ts.map +0 -1
- package/dist/commands/revert.js +0 -143
- package/dist/commands/revert.js.map +0 -1
- package/dist/commands/sitemap.d.ts +0 -4
- package/dist/commands/sitemap.d.ts.map +0 -1
- package/dist/commands/sitemap.js +0 -151
- package/dist/commands/sitemap.js.map +0 -1
- package/dist/commands/skill.d.ts +0 -4
- package/dist/commands/skill.d.ts.map +0 -1
- package/dist/commands/skill.js +0 -40
- package/dist/commands/skill.js.map +0 -1
- package/dist/commands/types.d.ts +0 -4
- package/dist/commands/types.d.ts.map +0 -1
- package/dist/commands/types.js +0 -78
- package/dist/commands/types.js.map +0 -1
- package/dist/session/backup.d.ts +0 -34
- package/dist/session/backup.d.ts.map +0 -1
- package/dist/session/backup.js +0 -64
- package/dist/session/backup.js.map +0 -1
- package/dist/skills/install.d.ts +0 -13
- package/dist/skills/install.d.ts.map +0 -1
- package/dist/skills/install.js +0 -37
- package/dist/skills/install.js.map +0 -1
package/dist/commands/schema.js
CHANGED
|
@@ -10,102 +10,44 @@ const FIELD_ANNOTATIONS = {
|
|
|
10
10
|
description: 'SEO meta description — max 160 chars',
|
|
11
11
|
summary: 'Short excerpt for listing pages — not the full body',
|
|
12
12
|
};
|
|
13
|
+
function extractInValues(field) {
|
|
14
|
+
const values = [];
|
|
15
|
+
for (const v of field.validations ?? []) {
|
|
16
|
+
if (Array.isArray(v.in)) {
|
|
17
|
+
values.push(...v.in);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return values;
|
|
21
|
+
}
|
|
13
22
|
export function registerSchemaCommand(program) {
|
|
14
23
|
program
|
|
15
|
-
.command('schema
|
|
16
|
-
.description('
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
|
|
24
|
+
.command('schema [target] [arg]')
|
|
25
|
+
.description('Content model introspection.\n' +
|
|
26
|
+
' cms-edit schema <content-type> — field definitions (page, component, collection, …)\n' +
|
|
27
|
+
' cms-edit schema colours — valid backgroundColour and textColour values\n' +
|
|
28
|
+
' cms-edit schema types <content-type> — type discriminator enum values (componentType, …)')
|
|
29
|
+
.action(async (target, arg, _opts, cmd) => {
|
|
20
30
|
const parentOpts = cmd.parent?.opts() ?? {};
|
|
21
31
|
try {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const env = await createSafeEnvironment(space);
|
|
25
|
-
let ct;
|
|
26
|
-
try {
|
|
27
|
-
ct = await env.getContentType(contentType);
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
errorMsg(`Content type "${contentType}" not found. Check the ID (e.g. component, collection, page).`);
|
|
32
|
+
if (!target) {
|
|
33
|
+
errorMsg('Usage: cms-edit schema <content-type> | cms-edit schema colours | cms-edit schema types <content-type>');
|
|
31
34
|
process.exit(1);
|
|
32
35
|
return;
|
|
33
36
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
.map((f) => {
|
|
37
|
-
const summary = {
|
|
38
|
-
id: f.id,
|
|
39
|
-
name: f.name,
|
|
40
|
-
type: f.type,
|
|
41
|
-
required: f.required ?? false,
|
|
42
|
-
localized: f.localized ?? false,
|
|
43
|
-
};
|
|
44
|
-
const fieldDescription = readContentfulFieldDescription(f);
|
|
45
|
-
if (fieldDescription) {
|
|
46
|
-
summary.description = fieldDescription;
|
|
47
|
-
}
|
|
48
|
-
// Static annotation for well-known fields
|
|
49
|
-
const annotation = FIELD_ANNOTATIONS[f.id];
|
|
50
|
-
if (annotation) {
|
|
51
|
-
summary.annotation = annotation;
|
|
52
|
-
}
|
|
53
|
-
// Extract enum values from Symbol/Text fields
|
|
54
|
-
const validations = f.validations ?? [];
|
|
55
|
-
for (const v of validations) {
|
|
56
|
-
const inVals = v.in;
|
|
57
|
-
if (Array.isArray(inVals) && inVals.length > 0) {
|
|
58
|
-
summary.enumValues = inVals;
|
|
59
|
-
}
|
|
60
|
-
const linkCts = v.linkContentType;
|
|
61
|
-
if (Array.isArray(linkCts) && linkCts.length > 0) {
|
|
62
|
-
summary.linkContentTypes = linkCts;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
// For Link fields, capture linkType
|
|
66
|
-
if (f.type === 'Link') {
|
|
67
|
-
summary.itemLinkType = f.linkType;
|
|
68
|
-
}
|
|
69
|
-
// For Array fields, capture items info
|
|
70
|
-
if (f.type === 'Array') {
|
|
71
|
-
const items = f.items;
|
|
72
|
-
if (items) {
|
|
73
|
-
summary.itemType = items.type;
|
|
74
|
-
summary.itemLinkType = items.linkType;
|
|
75
|
-
const itemValidations = items.validations ?? [];
|
|
76
|
-
for (const iv of itemValidations) {
|
|
77
|
-
if (Array.isArray(iv.linkContentType) && iv.linkContentType.length > 0) {
|
|
78
|
-
summary.linkContentTypes = iv.linkContentType;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return summary;
|
|
84
|
-
});
|
|
85
|
-
if (isJsonMode()) {
|
|
86
|
-
console.log(JSON.stringify({ contentType, fields }, null, 2));
|
|
37
|
+
if (target === 'colours') {
|
|
38
|
+
await runSchemaColours(parentOpts);
|
|
87
39
|
return;
|
|
88
40
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const id = f.id.padEnd(idWidth);
|
|
95
|
-
const type = formatFieldType(f).padEnd(typeWidth);
|
|
96
|
-
const req = f.required ? pc.yellow('required') : ' ';
|
|
97
|
-
const extras = formatExtras(f);
|
|
98
|
-
console.log(` ${pc.cyan(id)} ${pc.dim(type)} ${req}${extras}`);
|
|
99
|
-
if (f.description) {
|
|
100
|
-
console.log(` ${' '.repeat(idWidth)}${pc.dim(`↳ ${f.description}`)}`);
|
|
101
|
-
}
|
|
102
|
-
if (f.annotation) {
|
|
103
|
-
console.log(` ${' '.repeat(idWidth)}${pc.yellow(`↳ ${f.annotation}`)}`);
|
|
41
|
+
if (target === 'types') {
|
|
42
|
+
if (!arg) {
|
|
43
|
+
errorMsg('Usage: cms-edit schema types <content-type> (e.g. cms-edit schema types component)');
|
|
44
|
+
process.exit(1);
|
|
45
|
+
return;
|
|
104
46
|
}
|
|
47
|
+
await runSchemaTypes(parentOpts, arg);
|
|
48
|
+
return;
|
|
105
49
|
}
|
|
106
|
-
|
|
107
|
-
console.log(pc.dim(`${String(fields.length)} fields · Use: cms-edit schema ${contentType} --json for full detail`));
|
|
108
|
-
console.log('');
|
|
50
|
+
await runSchemaFields(parentOpts, target);
|
|
109
51
|
}
|
|
110
52
|
catch (err) {
|
|
111
53
|
errorMsg(err instanceof Error ? err.message : String(err));
|
|
@@ -113,6 +55,207 @@ export function registerSchemaCommand(program) {
|
|
|
113
55
|
}
|
|
114
56
|
});
|
|
115
57
|
}
|
|
58
|
+
async function runSchemaFields(parentOpts, contentType) {
|
|
59
|
+
const config = loadConfig(parentOpts.config);
|
|
60
|
+
const { space } = resolveSpaceConfig(config, parentOpts.space);
|
|
61
|
+
const env = await createSafeEnvironment(space);
|
|
62
|
+
let ct;
|
|
63
|
+
try {
|
|
64
|
+
ct = await env.getContentType(contentType);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
errorMsg(`Content type "${contentType}" not found. Check the ID (e.g. component, collection, page).`);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const fields = ct.fields
|
|
72
|
+
.filter((f) => !f.disabled && !f.omitted)
|
|
73
|
+
.map((f) => {
|
|
74
|
+
const summary = {
|
|
75
|
+
id: f.id,
|
|
76
|
+
name: f.name,
|
|
77
|
+
type: f.type,
|
|
78
|
+
required: f.required ?? false,
|
|
79
|
+
localized: f.localized ?? false,
|
|
80
|
+
};
|
|
81
|
+
const fieldDescription = readContentfulFieldDescription(f);
|
|
82
|
+
if (fieldDescription) {
|
|
83
|
+
summary.description = fieldDescription;
|
|
84
|
+
}
|
|
85
|
+
const annotation = FIELD_ANNOTATIONS[f.id];
|
|
86
|
+
if (annotation) {
|
|
87
|
+
summary.annotation = annotation;
|
|
88
|
+
}
|
|
89
|
+
const validations = f.validations ?? [];
|
|
90
|
+
for (const v of validations) {
|
|
91
|
+
const inVals = v.in;
|
|
92
|
+
if (Array.isArray(inVals) && inVals.length > 0) {
|
|
93
|
+
summary.enumValues = inVals;
|
|
94
|
+
}
|
|
95
|
+
const linkCts = v.linkContentType;
|
|
96
|
+
if (Array.isArray(linkCts) && linkCts.length > 0) {
|
|
97
|
+
summary.linkContentTypes = linkCts;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (f.type === 'Link') {
|
|
101
|
+
summary.itemLinkType = f.linkType;
|
|
102
|
+
}
|
|
103
|
+
if (f.type === 'Array') {
|
|
104
|
+
const items = f.items;
|
|
105
|
+
if (items) {
|
|
106
|
+
summary.itemType = items.type;
|
|
107
|
+
summary.itemLinkType = items.linkType;
|
|
108
|
+
const itemValidations = items.validations ?? [];
|
|
109
|
+
for (const iv of itemValidations) {
|
|
110
|
+
if (Array.isArray(iv.linkContentType) && iv.linkContentType.length > 0) {
|
|
111
|
+
summary.linkContentTypes = iv.linkContentType;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return summary;
|
|
117
|
+
});
|
|
118
|
+
if (isJsonMode()) {
|
|
119
|
+
console.log(JSON.stringify({ contentType, fields }, null, 2));
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const ctLabel = contentType.charAt(0).toUpperCase() + contentType.slice(1);
|
|
123
|
+
console.log(`\n${pc.bold(`Content type: ${ctLabel}`)}\n`);
|
|
124
|
+
const idWidth = Math.min(30, Math.max(16, ...fields.map((f) => f.id.length)) + 2);
|
|
125
|
+
const typeWidth = 14;
|
|
126
|
+
for (const f of fields) {
|
|
127
|
+
const id = f.id.padEnd(idWidth);
|
|
128
|
+
const type = formatFieldType(f).padEnd(typeWidth);
|
|
129
|
+
const req = f.required ? pc.yellow('required') : ' ';
|
|
130
|
+
const extras = formatExtras(f);
|
|
131
|
+
console.log(` ${pc.cyan(id)} ${pc.dim(type)} ${req}${extras}`);
|
|
132
|
+
if (f.description) {
|
|
133
|
+
console.log(` ${' '.repeat(idWidth)}${pc.dim(`↳ ${f.description}`)}`);
|
|
134
|
+
}
|
|
135
|
+
if (f.annotation) {
|
|
136
|
+
console.log(` ${' '.repeat(idWidth)}${pc.yellow(`↳ ${f.annotation}`)}`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
console.log('');
|
|
140
|
+
console.log(pc.dim(`${String(fields.length)} fields · Use: cms-edit schema ${contentType} --json for full detail`));
|
|
141
|
+
console.log('');
|
|
142
|
+
}
|
|
143
|
+
async function runSchemaColours(parentOpts) {
|
|
144
|
+
const config = loadConfig(parentOpts.config);
|
|
145
|
+
const { space } = resolveSpaceConfig(config, parentOpts.space);
|
|
146
|
+
const env = await createSafeEnvironment(space);
|
|
147
|
+
const collection = await env.getContentTypes();
|
|
148
|
+
let backgroundColours = [];
|
|
149
|
+
let textColours = [];
|
|
150
|
+
for (const ct of collection.items) {
|
|
151
|
+
if (backgroundColours.length === 0) {
|
|
152
|
+
const field = ct.fields.find((f) => f.id === 'backgroundColour');
|
|
153
|
+
if (field) {
|
|
154
|
+
const values = extractInValues(field);
|
|
155
|
+
if (values.length > 0)
|
|
156
|
+
backgroundColours = values.sort();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (textColours.length === 0) {
|
|
160
|
+
const field = ct.fields.find((f) => f.id === 'textColour');
|
|
161
|
+
if (field) {
|
|
162
|
+
const values = extractInValues(field);
|
|
163
|
+
if (values.length > 0)
|
|
164
|
+
textColours = values.sort();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (backgroundColours.length > 0 && textColours.length > 0)
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
if (isJsonMode()) {
|
|
171
|
+
console.log(JSON.stringify({ backgroundColour: backgroundColours, textColour: textColours }, null, 2));
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (backgroundColours.length === 0 && textColours.length === 0) {
|
|
175
|
+
console.log(pc.dim('No backgroundColour or textColour fields with valid values found in this space.'));
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (backgroundColours.length > 0) {
|
|
179
|
+
console.log(`\n${pc.bold('Background colours')} (${backgroundColours.length}):\n`);
|
|
180
|
+
for (const v of backgroundColours) {
|
|
181
|
+
console.log(` ${pc.cyan(v)}`);
|
|
182
|
+
}
|
|
183
|
+
console.log('');
|
|
184
|
+
console.log(pc.dim('Use with: cms-edit set @ref backgroundColour "<Value>"'));
|
|
185
|
+
console.log('');
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
console.log(pc.dim('\nNo backgroundColour values found in this space.\n'));
|
|
189
|
+
}
|
|
190
|
+
if (textColours.length > 0) {
|
|
191
|
+
console.log(`${pc.bold('Text colours')} (${textColours.length}):\n`);
|
|
192
|
+
for (const v of textColours) {
|
|
193
|
+
console.log(` ${pc.cyan(v)}`);
|
|
194
|
+
}
|
|
195
|
+
console.log('');
|
|
196
|
+
console.log(pc.dim('Use with: cms-edit set @ref textColour "<Value>"'));
|
|
197
|
+
console.log('');
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
console.log(pc.dim('No textColour values found in this space.\n'));
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async function runSchemaTypes(parentOpts, contentType) {
|
|
204
|
+
const config = loadConfig(parentOpts.config);
|
|
205
|
+
const { space } = resolveSpaceConfig(config, parentOpts.space);
|
|
206
|
+
const env = await createSafeEnvironment(space);
|
|
207
|
+
const typeFieldId = `${contentType}Type`;
|
|
208
|
+
let ct;
|
|
209
|
+
try {
|
|
210
|
+
ct = await env.getContentType(contentType);
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
errorMsg(`Content type "${contentType}" not found in this space. ` +
|
|
214
|
+
`Check the ID is correct (IDs are camelCase, e.g. externalComponent).`);
|
|
215
|
+
process.exit(1);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const typeField = ct.fields.find((f) => f.id === typeFieldId);
|
|
219
|
+
if (!typeField) {
|
|
220
|
+
if (isJsonMode()) {
|
|
221
|
+
console.log(JSON.stringify({
|
|
222
|
+
contentType,
|
|
223
|
+
typeField: typeFieldId,
|
|
224
|
+
values: [],
|
|
225
|
+
message: `No "${typeFieldId}" field found — this content type may not use a type discriminator.`,
|
|
226
|
+
}));
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
console.log(pc.dim(`No "${typeFieldId}" field found on the "${contentType}" content type. ` +
|
|
230
|
+
`This content type may not use a type discriminator.`));
|
|
231
|
+
}
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const validations = typeField.validations ?? [];
|
|
235
|
+
const values = [];
|
|
236
|
+
for (const v of validations) {
|
|
237
|
+
const inValues = v.in;
|
|
238
|
+
if (Array.isArray(inValues)) {
|
|
239
|
+
values.push(...inValues);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if (isJsonMode()) {
|
|
243
|
+
console.log(JSON.stringify({ contentType, typeField: typeFieldId, values: values.sort() }, null, 2));
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (values.length === 0) {
|
|
247
|
+
console.log(pc.dim(`No enum values found for "${typeFieldId}".`));
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const label = contentType.charAt(0).toUpperCase() + contentType.slice(1);
|
|
251
|
+
console.log(`\n${pc.bold(`${label} types`)} (${values.length}):\n`);
|
|
252
|
+
for (const v of values.sort()) {
|
|
253
|
+
console.log(` ${pc.cyan(v)}`);
|
|
254
|
+
}
|
|
255
|
+
console.log('');
|
|
256
|
+
console.log(pc.dim(`Use with: cms-edit add "<Type>" --content-type ${contentType}`));
|
|
257
|
+
console.log('');
|
|
258
|
+
}
|
|
116
259
|
function formatFieldType(f) {
|
|
117
260
|
if (f.type === 'Link') {
|
|
118
261
|
return `Link → ${f.itemLinkType ?? 'Entry'}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/commands/schema.ts"],"names":[],"mappings":"AAAA,uFAAuF;AAGvF,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAgB9C,2FAA2F;AAC3F,MAAM,iBAAiB,GAA2B;IAChD,WAAW,EAAE,sCAAsC;IACnD,OAAO,EAAE,qDAAqD;CAC/D,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,OAAgB;IACpD,OAAO;SACJ,OAAO,CAAC,uBAAuB,CAAC;SAChC,WAAW,CACV,6DAA6D;QAC3D,6EAA6E;QAC7E,yFAAyF,CAC5F;SACA,MAAM,CAAC,KAAK,EAAE,WAAmB,EAAE,KAAc,EAAE,GAAY,EAAE,EAAE;QAClE,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,IAAI,EAAuC,IAAI,EAAE,CAAC;QACjF,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC7C,MAAM,EAAE,KAAK,EAAE,GAAG,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;YAC/D,MAAM,GAAG,GAAG,MAAM,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B,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;QACzF,KAAK,CAAC,IAAI,CAAC,YAAY,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC;IAC1C,CAAC;IACD,IAAI,CAAC,CAAC,gBAAgB,IAAI,CAAC,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth).\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n**Assets:** cms-edit **can upload** draft assets (`asset upload` from file, URL, or base64). Always **search and reuse existing assets first** (`index sync`, then `asset search` or `list --type media`). Use `--if-exists-by-filename` when uploading to avoid duplicates.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/tasks-index` | Intent \u2192 task playbook map (filtered for this site) |\n| `cms-edit://customer/capabilities` | Machine-readable list of what this site supports |\n| `cms-edit://customer/checklist` | First-session onboarding steps |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n| `cms-edit://customer/defaults` | Featured image rules and article types (if configured) |\n| `cms-edit://customer/site-facts` | Optional canonical business facts (if configured) |\n| `cms-edit://customer/task-*` | Capability playbooks (e.g. `task-media-reuse-and-upload`) |\n\n**Workflow:** read `tasks-index` \u2192 `capabilities` \u2192 `checklist` \u2192 `overview` \u2192 `routing` \u2192 pick a `task-*` playbook for your goal \u2192 `components-index` \u2192 then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff \u2192 save |\n| `cms_edit_edit_article` | Edit an article through diff \u2192 save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_article` | Create an article (requires article type; featured image rules) |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer \u2192 confirm \u2192 dry-run) |\n| `cms_edit_create_article_from_doc` | Create an article from a freeform document |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n| `cms_edit_bulk_seo` | Update SEO meta descriptions (read `task-seo-descriptions`) |\n| `cms_edit_bulk_find_replace` | Bulk find-replace in rich text across entries |\n| `cms_edit_bulk_article_tags` | Update tags on one or more articles |\n| `cms_edit_import_authors` | Create person/author entries from a list or sheet |\n| `cms_edit_media` | Find existing assets or upload new ones (reuse-first) |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open \u2192 snapshot \u2192 read \u2192 set/rtf \u2192 diff \u2192 save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). `sitemap` displays this page as `/index` \u2014 that is formatting, not a different slug. Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot \u2014 see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, \u2026 refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## When to use Contentful UI\n\n| Task | Where |\n|------|-------|\n| Edit copy, add sections, create pages/articles | **Claude + cms-edit** (drafts) |\n| Publish approved drafts | **Contentful UI** |\n| Upload new images and files | **Contentful UI** asset library |\n| Edit copy directly in Contentful | **Avoid** \u2014 use Claude instead |\n\ncms-edit saves **drafts only**. A colleague must **publish in Contentful** for changes to go live.\n\n## Featured images (articles)\n\nRead `cms-edit://customer/defaults` when present. Otherwise:\n\n1. **Custom** \u2014 set `featuredImage` or `featuredImageAssetFilename` on the article when the editor provides a specific image\n2. **Article type** \u2014 if omitted, cms-edit inherits the linked **articleType** `featuredImage`\n3. **Site default** \u2014 from `editor.defaults` in the site config (also in `defaults.json` in the editor pack)\n\nRun `[\"index\", \"sync\"]` before resolving assets by filename.\n\n## Create content\n\n### Create a page\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"template\"]\n[\"create\", \"page\", \"--slug\", \"/about-us\", \"--title\", \"About Us\", \"--template-id\", \"<id>\"]\n[\"snapshot\"]\n```\n\nOr use `create from-json` with `--dry-run --strict` for multi-section pages.\n\n### Create an article\n\nEvery article requires an **articleType**:\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"articleType\"]\n[\"create\", \"article\", \"--slug\", \"resources/blog/my-post\", \"--title\", \"My Post\", \"--article-type-slug\", \"resources/blog\"]\n```\n\nOr `create from-json` with `\"type\": \"article\"` and `articleTypeSlug` / `articleTypeId`.\n\nUse MCP prompt `cms_edit_create_article` for guided creation.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted connector rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages \u2014 pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` \u2014 reports store, userId, active session key |\n\n- **`peek` is one-shot** \u2014 prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` \u2014 same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** \u2014 there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / connection failed** | Claude \u2192 Settings \u2192 Integrations \u2192 Connect again; complete Contentful sign-in. On Vercel, search runtime logs for `[cms-edit:oauth] auth_failure` (always logged). Set `LOG_CMS_OAUTH=1` for connect success traces. |\n| **No cms_edit tool** | Confirm the integration is connected under Settings \u2192 Integrations |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` \u2014 `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"--page-slug\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Your Contentful account must have access to this deployment's space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternatives: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date), `[\"sitemap\", \"--include\", \"article\", \"--sort\", \"date\"]`.\n\n**Draft articles** \u2014 `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` \u2014 session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug \u2026 --title \u2026`, `create article --slug \u2026 --title \u2026 --article-type-slug \u2026`, `create from-json --file \u2026`, `add <type> --content-type \u2026 --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
|
|
1
|
+
export declare const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth).\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n**Assets:** cms-edit **can upload** draft assets (`asset upload` from file, URL, or base64). Always **search and reuse existing assets first** (`index sync`, then `asset search` or `list --type media`). Use `--if-exists-by-filename` when uploading to avoid duplicates.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/tasks-index` | Intent \u2192 task playbook map (filtered for this site) |\n| `cms-edit://customer/capabilities` | Machine-readable list of what this site supports |\n| `cms-edit://customer/checklist` | First-session onboarding steps |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n| `cms-edit://customer/defaults` | Featured image rules and article types (if configured) |\n| `cms-edit://customer/site-facts` | Optional canonical business facts (if configured) |\n| `cms-edit://customer/task-*` | Capability playbooks (e.g. `task-media-reuse-and-upload`) |\n\n**Workflow:** read `tasks-index` \u2192 `capabilities` \u2192 `checklist` \u2192 `overview` \u2192 `routing` \u2192 pick a `task-*` playbook for your goal \u2192 `components-index` \u2192 then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff \u2192 save |\n| `cms_edit_edit_article` | Edit an article through diff \u2192 save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_article` | Create an article (requires article type; featured image rules) |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer \u2192 confirm \u2192 dry-run) |\n| `cms_edit_create_article_from_doc` | Create an article from a freeform document |\n| `cms_edit_taxonomy` | Import taxonomy entries (`create \u2026 --if-not-exists`) |\n| `cms_edit_bulk_seo` | Update SEO meta descriptions (read `task-seo-descriptions`) |\n| `cms_edit_bulk_find_replace` | Bulk find-replace in rich text across entries |\n| `cms_edit_bulk_article_tags` | Update tags on one or more articles |\n| `cms_edit_import_authors` | Create person/author entries from a list or sheet |\n| `cms_edit_media` | Find existing assets or upload new ones (reuse-first) |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## End-to-end QA prompt\n\nFor release QA after cms-edit or editor-pack upgrades, use a **copy-paste Claude Desktop test script** (phases: connector \u2192 customer resources \u2192 discovery \u2192 session \u2192 schema \u2192 media \u2192 dry-run writes \u2192 negatives). See [e2e-test-prompt.md](./e2e-test-prompt.md) to author one per customer site. Example: Brightline `docs/cms-edit/MCP-E2E-TEST.md`.\n\n## Core workflow\n\nStandard editing flow: **open \u2192 snapshot \u2192 read \u2192 set/rtf \u2192 diff \u2192 save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot \u2014 see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, \u2026 refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## When to use Contentful UI\n\n| Task | Where |\n|------|-------|\n| Edit copy, add sections, create pages/articles | **Claude + cms-edit** (drafts) |\n| Publish approved drafts | **Contentful UI** |\n| Upload new images and files | **Contentful UI** asset library |\n| Edit copy directly in Contentful | **Avoid** \u2014 use Claude instead |\n\ncms-edit saves **drafts only**. A colleague must **publish in Contentful** for changes to go live.\n\n## Featured images (articles)\n\nRead `cms-edit://customer/defaults` when present. Otherwise:\n\n1. **Custom** \u2014 set `featuredImage` or `featuredImageAssetFilename` on the article when the editor provides a specific image\n2. **Article type** \u2014 if omitted, cms-edit inherits the linked **articleType** `featuredImage`\n3. **Site default** \u2014 from `editor.defaults` in the site config (also in `defaults.json` in the editor pack)\n\nRun `[\"index\", \"sync\"]` before resolving assets by filename.\n\n## Create content\n\n### Create a page\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"template\"]\n[\"create\", \"page\", \"--slug\", \"/about-us\", \"--title\", \"About Us\", \"--template-id\", \"<id>\"]\n[\"snapshot\"]\n```\n\nOr use `create from-json` with `--dry-run --strict` for multi-section pages.\n\n### Create an article\n\nEvery article requires an **articleType**:\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"articleType\"]\n[\"create\", \"article\", \"--slug\", \"resources/blog/my-post\", \"--title\", \"My Post\", \"--article-type-slug\", \"resources/blog\"]\n```\n\nOr `create from-json` with `\"type\": \"article\"` and `articleTypeSlug` / `articleTypeId`.\n\nUse MCP prompt `cms_edit_create_article` for guided creation.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"list\", \"--type\", \"page\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted connector rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages \u2014 pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` \u2014 reports store, userId, active session key |\n\n- **`peek` is one-shot** \u2014 prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` \u2014 same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** \u2014 there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / connection failed** | Claude \u2192 Settings \u2192 Integrations \u2192 Connect again; complete Contentful sign-in. On Vercel, search runtime logs for `[cms-edit:oauth] auth_failure` (always logged). Set `LOG_CMS_OAUTH=1` for connect success traces. |\n| **No cms_edit tool** | Confirm the integration is connected under Settings \u2192 Integrations |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` \u2014 `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"--page-slug\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Your Contentful account must have access to this deployment's space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternative: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date).\n\n**Draft articles** \u2014 `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` \u2014 session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug \u2026 --title \u2026`, `create article --slug \u2026 --title \u2026 --article-type-slug \u2026`, `create from-json --file \u2026`, `add <type> --content-type \u2026 --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
|
|
2
2
|
//# sourceMappingURL=hosted-guide.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-guide.d.ts","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"hosted-guide.d.ts","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,w+YAA8uY,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// Generated by scripts/generate-embedded-assets.mjs — do not edit manually.
|
|
2
|
-
export const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth).\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n**Assets:** cms-edit **can upload** draft assets (`asset upload` from file, URL, or base64). Always **search and reuse existing assets first** (`index sync`, then `asset search` or `list --type media`). Use `--if-exists-by-filename` when uploading to avoid duplicates.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/tasks-index` | Intent → task playbook map (filtered for this site) |\n| `cms-edit://customer/capabilities` | Machine-readable list of what this site supports |\n| `cms-edit://customer/checklist` | First-session onboarding steps |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n| `cms-edit://customer/defaults` | Featured image rules and article types (if configured) |\n| `cms-edit://customer/site-facts` | Optional canonical business facts (if configured) |\n| `cms-edit://customer/task-*` | Capability playbooks (e.g. `task-media-reuse-and-upload`) |\n\n**Workflow:** read `tasks-index` → `capabilities` → `checklist` → `overview` → `routing` → pick a `task-*` playbook for your goal → `components-index` → then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff → save |\n| `cms_edit_edit_article` | Edit an article through diff → save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_article` | Create an article (requires article type; featured image rules) |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer → confirm → dry-run) |\n| `cms_edit_create_article_from_doc` | Create an article from a freeform document |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\n| `cms_edit_bulk_seo` | Update SEO meta descriptions (read `task-seo-descriptions`) |\n| `cms_edit_bulk_find_replace` | Bulk find-replace in rich text across entries |\n| `cms_edit_bulk_article_tags` | Update tags on one or more articles |\n| `cms_edit_import_authors` | Create person/author entries from a list or sheet |\n| `cms_edit_media` | Find existing assets or upload new ones (reuse-first) |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## Core workflow\n\nStandard editing flow: **open → snapshot → read → set/rtf → diff → save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). `sitemap` displays this page as `/index` — that is formatting, not a different slug. Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot — see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, … refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## When to use Contentful UI\n\n| Task | Where |\n|------|-------|\n| Edit copy, add sections, create pages/articles | **Claude + cms-edit** (drafts) |\n| Publish approved drafts | **Contentful UI** |\n| Upload new images and files | **Contentful UI** asset library |\n| Edit copy directly in Contentful | **Avoid** — use Claude instead |\n\ncms-edit saves **drafts only**. A colleague must **publish in Contentful** for changes to go live.\n\n## Featured images (articles)\n\nRead `cms-edit://customer/defaults` when present. Otherwise:\n\n1. **Custom** — set `featuredImage` or `featuredImageAssetFilename` on the article when the editor provides a specific image\n2. **Article type** — if omitted, cms-edit inherits the linked **articleType** `featuredImage`\n3. **Site default** — from `editor.defaults` in the site config (also in `defaults.json` in the editor pack)\n\nRun `[\"index\", \"sync\"]` before resolving assets by filename.\n\n## Create content\n\n### Create a page\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"template\"]\n[\"create\", \"page\", \"--slug\", \"/about-us\", \"--title\", \"About Us\", \"--template-id\", \"<id>\"]\n[\"snapshot\"]\n```\n\nOr use `create from-json` with `--dry-run --strict` for multi-section pages.\n\n### Create an article\n\nEvery article requires an **articleType**:\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"articleType\"]\n[\"create\", \"article\", \"--slug\", \"resources/blog/my-post\", \"--title\", \"My Post\", \"--article-type-slug\", \"resources/blog\"]\n```\n\nOr `create from-json` with `\"type\": \"article\"` and `articleTypeSlug` / `articleTypeId`.\n\nUse MCP prompt `cms_edit_create_article` for guided creation.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"sitemap\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted connector rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` — reports store, userId, active session key |\n\n- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` — same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / connection failed** | Claude → Settings → Integrations → Connect again; complete Contentful sign-in. On Vercel, search runtime logs for `[cms-edit:oauth] auth_failure` (always logged). Set `LOG_CMS_OAUTH=1` for connect success traces. |\n| **No cms_edit tool** | Confirm the integration is connected under Settings → Integrations |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` — `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"--page-slug\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Your Contentful account must have access to this deployment's space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternatives: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date), `[\"sitemap\", \"--include\", \"article\", \"--sort\", \"date\"]`.\n\n**Draft articles** — `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"sitemap\", \"--include\", \"article\", \"--status\", \"draft\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `sitemap`, `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` — session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug … --title …`, `create article --slug … --title … --article-type-slug …`, `create from-json --file …`, `add <type> --content-type … --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
|
|
2
|
+
export const HOSTED_GUIDE_TEMPLATE = "# cms-edit MCP guide\n\nUse this guide when editing Contentful draft content through Claude Desktop (hosted Integrations + OAuth).\n\n{{SITE_INTRO}}\n\n## Safety rules\n\ncms-edit **cannot and will not**:\n\n- Publish or unpublish entries\n- Archive or delete published entries\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\n\n**Assets:** cms-edit **can upload** draft assets (`asset upload` from file, URL, or base64). Always **search and reuse existing assets first** (`index sync`, then `asset search` or `list --type media`). Use `--if-exists-by-filename` when uploading to avoid duplicates.\n\n## MCP tools\n\n| Tool | Purpose |\n|------|---------|\n| `cms_edit` | Run any cms-edit command via an `args` array |\n| `cms_edit_version` | Check the installed cms-edit version (no session required) |\n| `cms_edit_help` | Read this guide by topic (`overview`, `workflow`, `commands`, `troubleshooting`, `hosted`) |\n\n## Customer editor pack (read first)\n\nWhen a site editor pack is deployed, these MCP resources provide **site-specific** context. Read them before creating or editing content:\n\n| Resource | Purpose |\n|----------|---------|\n| `cms-edit://customer/index` | List of all customer resources |\n| `cms-edit://customer/tasks-index` | Intent → task playbook map (filtered for this site) |\n| `cms-edit://customer/capabilities` | Machine-readable list of what this site supports |\n| `cms-edit://customer/checklist` | First-session onboarding steps |\n| `cms-edit://customer/overview` | Site name, space, staging URL, handoff rules |\n| `cms-edit://customer/routing` | Article/tag URL rules for this site |\n| `cms-edit://customer/components-index` | Component types and when to use each |\n| `cms-edit://customer/collections-index` | Collection types |\n| `cms-edit://customer/brand` | Brand voice and terminology (if configured) |\n| `cms-edit://customer/articles` | Article/publication playbook (if configured) |\n| `cms-edit://customer/defaults` | Featured image rules and article types (if configured) |\n| `cms-edit://customer/site-facts` | Optional canonical business facts (if configured) |\n| `cms-edit://customer/task-*` | Capability playbooks (e.g. `task-media-reuse-and-upload`) |\n\n**Workflow:** read `tasks-index` → `capabilities` → `checklist` → `overview` → `routing` → pick a `task-*` playbook for your goal → `components-index` → then use `cms_edit` commands.\n\n## MCP prompts\n\n| Prompt | Purpose |\n|--------|---------|\n| `cms_edit_verify` | Check version and connectivity |\n| `cms_edit_explore` | List site content and open a page |\n| `cms_edit_edit_page` | Edit a page through diff → save |\n| `cms_edit_edit_article` | Edit an article through diff → save |\n| `cms_edit_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_create_article` | Create an article (requires article type; featured image rules) |\n| `cms_edit_create_from_doc` | Create a page from a freeform document (infer → confirm → dry-run) |\n| `cms_edit_create_article_from_doc` | Create an article from a freeform document |\n| `cms_edit_taxonomy` | Import taxonomy entries (`create … --if-not-exists`) |\n| `cms_edit_bulk_seo` | Update SEO meta descriptions (read `task-seo-descriptions`) |\n| `cms_edit_bulk_find_replace` | Bulk find-replace in rich text across entries |\n| `cms_edit_bulk_article_tags` | Update tags on one or more articles |\n| `cms_edit_import_authors` | Create person/author entries from a list or sheet |\n| `cms_edit_media` | Find existing assets or upload new ones (reuse-first) |\n\nRead the full guide anytime via the `cms-edit://guide` resource or `cms_edit_help`.\n\n## End-to-end QA prompt\n\nFor release QA after cms-edit or editor-pack upgrades, use a **copy-paste Claude Desktop test script** (phases: connector → customer resources → discovery → session → schema → media → dry-run writes → negatives). See [e2e-test-prompt.md](./e2e-test-prompt.md) to author one per customer site. Example: Brightline `docs/cms-edit/MCP-E2E-TEST.md`.\n\n## Core workflow\n\nStandard editing flow: **open → snapshot → read → set/rtf → diff → save**\n\nEach step is a separate `cms_edit` call. Sessions persist in Redis between calls (hosted) or on disk (local). MCP auto-uses session `_mcp`.\n\n### 1. Open a page\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"open\", \"--page-slug\", \"/pricing\"]\n[\"open\", \"--id\", \"<entry-id>\"]\n```\n\n**Homepage (all SE Studio sites):** Contentful stores the marketing homepage slug as `index`. The live site URL is `/`. In cms-edit, `--page-slug /` and `--page-slug /index` are equivalent (both resolve to `index`). Read `cms-edit://customer/routing` for site-specific exceptions (e.g. Pedestal uses `home`).\n\n### 2. Snapshot — see the content tree\n\n```\n[\"snapshot\"]\n```\n\nOutput shows `@c0`, `@c1`, … refs for each component. Use these refs in `read`, `set`, and `rtf`.\n\n### 3. Read fields\n\n```\n[\"read\", \"@c1\"]\n[\"read\", \"@c1\", \"heading\"]\n```\n\n### 4. Edit fields\n\n```\n[\"set\", \"@c1\", \"heading\", \"New heading text\"]\n[\"rtf\", \"@c1\", \"body\", \"--content\", \"# Title\\n\\nParagraph text.\"]\n```\n\nFor rich text, prefer `--content` with inline markdown. Use `--base64` when special characters cause issues.\n\n### 5. Review and save\n\n```\n[\"diff\"]\n[\"save\"]\n```\n\nAlways run `diff` before `save`. To abandon changes: `[\"discard\"]`.\n\n## When to use Contentful UI\n\n| Task | Where |\n|------|-------|\n| Edit copy, add sections, create pages/articles | **Claude + cms-edit** (drafts) |\n| Publish approved drafts | **Contentful UI** |\n| Upload new images and files | **Contentful UI** asset library |\n| Edit copy directly in Contentful | **Avoid** — use Claude instead |\n\ncms-edit saves **drafts only**. A colleague must **publish in Contentful** for changes to go live.\n\n## Featured images (articles)\n\nRead `cms-edit://customer/defaults` when present. Otherwise:\n\n1. **Custom** — set `featuredImage` or `featuredImageAssetFilename` on the article when the editor provides a specific image\n2. **Article type** — if omitted, cms-edit inherits the linked **articleType** `featuredImage`\n3. **Site default** — from `editor.defaults` in the site config (also in `defaults.json` in the editor pack)\n\nRun `[\"index\", \"sync\"]` before resolving assets by filename.\n\n## Create content\n\n### Create a page\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"template\"]\n[\"create\", \"page\", \"--slug\", \"/about-us\", \"--title\", \"About Us\", \"--template-id\", \"<id>\"]\n[\"snapshot\"]\n```\n\nOr use `create from-json` with `--dry-run --strict` for multi-section pages.\n\n### Create an article\n\nEvery article requires an **articleType**:\n\n```\n[\"index\", \"sync\"]\n[\"list\", \"--type\", \"articleType\"]\n[\"create\", \"article\", \"--slug\", \"resources/blog/my-post\", \"--title\", \"My Post\", \"--article-type-slug\", \"resources/blog\"]\n```\n\nOr `create from-json` with `\"type\": \"article\"` and `articleTypeSlug` / `articleTypeId`.\n\nUse MCP prompt `cms_edit_create_article` for guided creation.\n\n## Common sequences\n\n### List all pages\n\n```\n[\"list\", \"--type\", \"page\"]\n```\n\n### Refresh local index (assets, media, templates, taxonomy)\n\nRun before asset filename search, media-by-filename list, or fast template/taxonomy lookup:\n\n```\n[\"index\", \"sync\"]\n[\"index\", \"status\"]\n[\"list\", \"--type\", \"template\"]\n```\n\nAsset search and media-by-filename list **require** the index. Template/taxonomy list prefers the index when built.\n\n### Explore the homepage\n\n```\n[\"open\", \"--page-slug\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"--page-slug\", \"{{EXAMPLE_SLUG}}\"]\n[\"snapshot\"]\n[\"read\", \"@c1\", \"heading\"]\n[\"set\", \"@c1\", \"heading\", \"Updated heading\"]\n[\"diff\"]\n[\"save\"]\n```\n\n## Field discovery\n\n```\n[\"schema\", \"component\"]\n[\"list\", \"--type\", \"page\"]\n[\"search\", \"pricing\"]\n```\n\n## Hosted connector rules\n\n{{HOSTED_RULES}}\n\n## Session tips\n\n- After `open`, subsequent MCP commands share session `_mcp` automatically (stored in Redis on hosted).\n- Use `--session <name>` only when juggling multiple pages — pass it **before** the subcommand on every call: `[\"--session\", \"my-work\", \"open\", \"--page-slug\", \"/\"]`.\n- Snapshot JSON includes `sessionName` and `sessionKey` for debugging.\n- If you see \"No active session\", check `/api/health` (Redis must be ok), then run `open` again. Set `LOG_CMS_SESSION=1` on Vercel and search runtime logs for `[cms-edit:session]` (`redis save ok` / `redis load hit` / `requireSession miss`).\n\n### peek vs open vs read\n\n| Goal | MCP args |\n|------|----------|\n| Edit workflow (session) | `[\"open\", \"--page-slug\", \"/\"]` then `[\"read\", \"@c0\"]` |\n| Preview tree + fields, no session | `[\"peek\", \"--page-slug\", \"/pricing\"]` or `[\"peek\", \"--id\", \"<entry-id>\"]` (JSON includes `rootFields`) |\n| Read fields by entry ID, no session | `[\"read\", \"<entry-id>\", \"--id\"]` or `[\"read\", \"<entry-id>\", \"--id\", \"heading\"]` |\n| Debug session persistence | `[\"diagnose\"]` — reports store, userId, active session key |\n\n- **`peek` is one-shot** — prints tree and **root field values** (`rootFields` in JSON). No session is created; do not chain `read @ref` afterward.\n- **Use flat lookup flags** for `open` and `peek` — same as CLI (`--page-slug`, `--id`, etc.). See `help lookup`.\n- **`read @root`** only works after `open` (uses the active session). The hint in peek output is for terminal users who already ran `open`.\n- **Do not invent flags** — there is no `--read`, `--then`, or chained peek+read syntax. One command per `cms_edit` call.\n\n## Troubleshooting\n\n| Problem | What to do |\n|---------|------------|\n| **401 / connection failed** | Claude → Settings → Integrations → Connect again; complete Contentful sign-in. On Vercel, search runtime logs for `[cms-edit:oauth] auth_failure` (always logged). Set `LOG_CMS_OAUTH=1` for connect success traces. |\n| **No cms_edit tool** | Confirm the integration is connected under Settings → Integrations |\n| **No active session** | Do not pass `--space` on hosted. Check `/api/health` — `redis` must be ok. MCP uses `_mcp` session automatically. Manual session: `[\"--session\", \"name\", \"open\", \"--page-slug\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Your Contentful account must have access to this deployment's space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\n\n## Articles\n\n**Recent articles** (by publication `date`, not last-updated):\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\", \"-n\", \"10\"]\n```\n\nAlternative: `[\"search\", \"<keyword>\", \"--type\", \"article\"]` (also sorts by date).\n\n**Draft articles** — `peek` and `open` load drafts via CMA (not published-only). To discover drafts:\n\n```json\n[\"list\", \"--type\", \"article\", \"--sort\", \"date\"]\n[\"search\", \"<title>\", \"--type\", \"article\"]\n[\"list\", \"--type\", \"article\", \"--slug\", \"<slug>\"]\n```\n\nThen open: `[\"peek\", \"--article-slug\", \"<slug>\"]` or `[\"open\", \"--id\", \"<entry-id>\"]`. Use `--article-slug`, not `--page-slug`.\n\n**Published-only** is opt-in: `list --published` and `resolve --published` use the Delivery API index and omit never-published drafts.\n\nAfter upgrading cms-edit, run `[\"index\", \"sync\"]` once so the local index includes article `date` values (schema v4).\n\n## Command reference (cms_edit args)\n\n**Discovery:** `list --type <type>`, `search <query>`, `schema <contentType>`, `index sync`, `index status`\n\n**Reading:** `open --page-slug <slug>`, `open --id <id>`, `peek --page-slug <slug>`, `peek --id <id>`, `snapshot`, `read <ref>`, `read <ref> <field>`, `read <id> --id [field]`\n\n**Diagnostics:** `diagnose` — session store, userId, active session (after open/read issues)\n\n**Editing:** `set <ref> <field> <value>`, `rtf <ref> <field> --content \"<md>\"`, `diff`, `save`, `discard`\n\n**Creating:** `create page --slug … --title …`, `create article --slug … --title … --article-type-slug …`, `create from-json --file …`, `add <type> --content-type … --parent @c0 --target content`\n\n**Other:** `health`, `version`, `guide [topic]`\n";
|
|
3
3
|
//# sourceMappingURL=hosted-guide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-guide.js","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,
|
|
1
|
+
{"version":3,"file":"hosted-guide.js","sourceRoot":"","sources":["../../src/generated/hosted-guide.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,2uYAA2uY,CAAC"}
|
package/dist/mcp/guide.js
CHANGED
|
@@ -56,7 +56,7 @@ function buildHostedRules(hosted) {
|
|
|
56
56
|
}
|
|
57
57
|
return ("- Connect Claude via your site's `/cms-edit` hosted MCP URL — do not use local `mcpServers` config.\n" +
|
|
58
58
|
'- For CLI/agents in a repo: `.contentful-cms.json` and `--space <name>` when multiple spaces are configured.\n' +
|
|
59
|
-
'- Install skills: `npx skills add @se-studio/skills
|
|
59
|
+
'- Install skills: `npx skills add @se-studio/skills`.');
|
|
60
60
|
}
|
|
61
61
|
export function buildGuideMarkdown(hosted) {
|
|
62
62
|
const exampleSlug = hosted?.exampleSlugs?.[1] ?? DEFAULT_EXAMPLE_SLUGS[1] ?? '/pricing';
|
package/dist/mcp/guide.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide.js","sourceRoot":"","sources":["../../src/mcp/guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAUrE,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,UAAU;IACV,UAAU;IACV,UAAU;IACV,iBAAiB;IACjB,QAAQ;C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CAAC;QAC5B,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAAiB,EAAE,MAAsB;IAC7E,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QACnC,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,IAAK,YAAkC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,OAAO,KAAmB,CAAC;IAC7B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,oBAAoB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -27,7 +27,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
}));
|
|
30
|
-
server.prompt('cms_edit_explore', 'Explore site content:
|
|
30
|
+
server.prompt('cms_edit_explore', 'Explore site content: list pages, open a page, and show the content tree.', {
|
|
31
31
|
slug: z
|
|
32
32
|
.string()
|
|
33
33
|
.optional()
|
|
@@ -42,9 +42,9 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
42
42
|
type: 'text',
|
|
43
43
|
text: `${note}\n\n` +
|
|
44
44
|
'Homepage note: SE Studio sites store the homepage as CMS slug `index`. ' +
|
|
45
|
-
'`--page-slug /` and `--page-slug /index` are equivalent
|
|
45
|
+
'`--page-slug /` and `--page-slug /index` are equivalent.\n\n' +
|
|
46
46
|
'Explore this Contentful site:\n' +
|
|
47
|
-
'1. cms_edit ["
|
|
47
|
+
'1. cms_edit ["list", "--type", "page"] — list pages\n' +
|
|
48
48
|
`2. cms_edit ["open", "--page-slug", "${targetSlug}"] — load the page\n` +
|
|
49
49
|
'3. cms_edit ["snapshot"] — show @ref tree\n' +
|
|
50
50
|
'4. Summarize what you found',
|
|
@@ -180,11 +180,11 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
180
180
|
jsonFile: z
|
|
181
181
|
.string()
|
|
182
182
|
.optional()
|
|
183
|
-
.describe('Path to taxonomy JSON (if omitted, ask user or use
|
|
183
|
+
.describe('Path to taxonomy JSON (if omitted, ask user or use create --if-not-exists)'),
|
|
184
184
|
}, async ({ jsonFile }) => {
|
|
185
185
|
const importStep = jsonFile
|
|
186
186
|
? `2. cms_edit ["create", "taxonomy-from-json", "--file", "${jsonFile}", "--if-not-exists"]\n`
|
|
187
|
-
: '2. Use cms_edit ["
|
|
187
|
+
: '2. Use cms_edit ["create", "tag-type", ..., "--if-not-exists"] — or taxonomy-from-json\n';
|
|
188
188
|
return {
|
|
189
189
|
messages: [
|
|
190
190
|
{
|
|
@@ -285,7 +285,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
285
285
|
text: `${note}\n\n${TASKS_PREAMBLE}${scope}` +
|
|
286
286
|
'Update SEO meta descriptions:\n' +
|
|
287
287
|
'1. cms_edit ["customer", "task-seo-descriptions"]\n' +
|
|
288
|
-
'2. cms_edit ["
|
|
288
|
+
'2. cms_edit ["list", "--type", "page"] or list target slugs from user\n' +
|
|
289
289
|
'3. Per page/article: open → set @p0 description "…" → diff → save\n' +
|
|
290
290
|
'4. Or batch set when entry IDs are known\n' +
|
|
291
291
|
'Field name is **description** (not seoDescription). Show diff before every save.',
|
|
@@ -309,7 +309,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
309
309
|
text: `${note}\n\n${TASKS_PREAMBLE}${scope}` +
|
|
310
310
|
`Bulk find-replace: "${find}" → "${replace}"\n` +
|
|
311
311
|
'1. cms_edit ["customer", "task-bulk-find-replace"]\n' +
|
|
312
|
-
'2. cms_edit ["search", "<find>"] or
|
|
312
|
+
'2. cms_edit ["search", "<find>"] or list --type page|article — propose affected count; wait for user approval\n' +
|
|
313
313
|
'3. cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…", "--dry-run"] — confirm match count\n' +
|
|
314
314
|
'4. cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…"] — or per-entry open/rtf/diff/save for small sets\n' +
|
|
315
315
|
'5. Summarize entries updated',
|