@se-studio/contentful-cms 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/HOSTED.md +2 -2
- package/INSTALL.md +14 -136
- package/README.md +16 -40
- package/dist/bin/contentful-cms.js +2 -12
- package/dist/bin/contentful-cms.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +10 -8
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/article-tags-from-json.d.ts +4 -0
- package/dist/commands/article-tags-from-json.d.ts.map +1 -0
- package/dist/commands/article-tags-from-json.js +54 -0
- package/dist/commands/article-tags-from-json.js.map +1 -0
- package/dist/commands/bulk-rtf-replace.d.ts +4 -0
- package/dist/commands/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/commands/bulk-rtf-replace.js +103 -0
- package/dist/commands/bulk-rtf-replace.js.map +1 -0
- package/dist/commands/create-person-from-json.d.ts +4 -0
- package/dist/commands/create-person-from-json.d.ts.map +1 -0
- package/dist/commands/create-person-from-json.js +85 -0
- package/dist/commands/create-person-from-json.js.map +1 -0
- package/dist/commands/create-person.d.ts +4 -0
- package/dist/commands/create-person.d.ts.map +1 -0
- package/dist/commands/create-person.js +56 -0
- package/dist/commands/create-person.js.map +1 -0
- package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -1
- package/dist/commands/create-taxonomy-from-json.js +47 -31
- package/dist/commands/create-taxonomy-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +2 -0
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +7 -6
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/ensure.d.ts.map +1 -1
- package/dist/commands/ensure.js +49 -0
- package/dist/commands/ensure.js.map +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +35 -0
- package/dist/commands/project.js.map +1 -1
- package/dist/contentful/article-tags-from-json.d.ts +25 -0
- package/dist/contentful/article-tags-from-json.d.ts.map +1 -0
- package/dist/contentful/article-tags-from-json.js +121 -0
- package/dist/contentful/article-tags-from-json.js.map +1 -0
- package/dist/contentful/bulk-rtf-replace.d.ts +29 -0
- package/dist/contentful/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/contentful/bulk-rtf-replace.js +119 -0
- package/dist/contentful/bulk-rtf-replace.js.map +1 -0
- package/dist/contentful/entry-fields.d.ts +1 -1
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +13 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/person-create.d.ts +31 -0
- package/dist/contentful/person-create.d.ts.map +1 -0
- package/dist/contentful/person-create.js +111 -0
- package/dist/contentful/person-create.js.map +1 -0
- package/dist/editor-pack/capabilities.d.ts +82 -0
- package/dist/editor-pack/capabilities.d.ts.map +1 -0
- package/dist/editor-pack/capabilities.js +350 -0
- package/dist/editor-pack/capabilities.js.map +1 -0
- package/dist/editor-pack/generate.d.ts.map +1 -1
- package/dist/editor-pack/generate.js +57 -15
- package/dist/editor-pack/generate.js.map +1 -1
- package/dist/generated/hosted-guide.d.ts +1 -1
- package/dist/generated/hosted-guide.d.ts.map +1 -1
- package/dist/generated/hosted-guide.js +1 -1
- package/dist/generated/hosted-guide.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/hosted/customer-playbooks.d.ts.map +1 -1
- package/dist/hosted/customer-playbooks.js +3 -16
- package/dist/hosted/customer-playbooks.js.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js +12 -3
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js.map +1 -1
- package/dist/hosted/next/pages/HomePage.d.ts.map +1 -1
- package/dist/hosted/next/pages/HomePage.js +1 -1
- package/dist/hosted/next/pages/HomePage.js.map +1 -1
- package/dist/mcp/guide.d.ts +2 -2
- package/dist/mcp/guide.d.ts.map +1 -1
- package/dist/mcp/guide.js +10 -5
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +116 -2
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/project/doctor.d.ts +9 -0
- package/dist/project/doctor.d.ts.map +1 -0
- package/dist/project/doctor.js +136 -0
- package/dist/project/doctor.js.map +1 -0
- package/docs/FUNCTIONAL_SPEC.md +1 -1
- package/docs/MEDIA_INDEX_PLAN.md +1 -1
- package/docs/SKILLS.md +3 -3
- package/docs/help/article-tags-from-json.md +62 -0
- package/docs/help/bulk-rtf-replace.md +80 -0
- package/docs/help/index.md +16 -1
- package/docs/help/person-from-json.md +82 -0
- package/docs/mcp/hosted-guide.md +15 -4
- package/package.json +2 -5
- package/skills/README.md +1 -1
- package/skills/core/SKILL.md +7 -1
- package/skills/editor-tasks/SKILL.md +83 -0
- package/skills/manifest.json +2 -1
- package/skills/setup/SKILL.md +21 -87
- package/dist/bin/cms-edit-mcp.d.ts +0 -3
- package/dist/bin/cms-edit-mcp.d.ts.map +0 -1
- package/dist/bin/cms-edit-mcp.js +0 -15
- package/dist/bin/cms-edit-mcp.js.map +0 -1
- package/dist/bin/cms-edit-setup.d.ts +0 -3
- package/dist/bin/cms-edit-setup.d.ts.map +0 -1
- package/dist/bin/cms-edit-setup.js +0 -7
- package/dist/bin/cms-edit-setup.js.map +0 -1
- package/dist/setup/wizard.d.ts +0 -4
- package/dist/setup/wizard.d.ts.map +0 -1
- package/dist/setup/wizard.js +0 -260
- package/dist/setup/wizard.js.map +0 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { CmsEditProject } from '../project/types.js';
|
|
2
|
+
import type { RoutingConstants } from './parse-constants.js';
|
|
3
|
+
import type { RegistrationEntry } from './parse-registrations.js';
|
|
4
|
+
export interface SiteCapabilities {
|
|
5
|
+
projectKey: string;
|
|
6
|
+
generatedAt: string;
|
|
7
|
+
content: {
|
|
8
|
+
pages: boolean;
|
|
9
|
+
articles: boolean;
|
|
10
|
+
persons: boolean;
|
|
11
|
+
tags: boolean;
|
|
12
|
+
navigation: boolean;
|
|
13
|
+
};
|
|
14
|
+
routing: {
|
|
15
|
+
homepageSlug: string;
|
|
16
|
+
articlesBase?: string;
|
|
17
|
+
tagsBase?: string;
|
|
18
|
+
peopleBase?: string;
|
|
19
|
+
enablePrimaryTagPartOfSlug?: boolean;
|
|
20
|
+
};
|
|
21
|
+
registrations: {
|
|
22
|
+
components: number;
|
|
23
|
+
collections: number;
|
|
24
|
+
externals: number;
|
|
25
|
+
};
|
|
26
|
+
mechanisms: {
|
|
27
|
+
scalarEdit: boolean;
|
|
28
|
+
richTextEdit: boolean;
|
|
29
|
+
batchScalar: boolean;
|
|
30
|
+
bulkRtfFindReplace: boolean;
|
|
31
|
+
createFromJson: boolean;
|
|
32
|
+
assetSearch: boolean;
|
|
33
|
+
assetUpload: boolean;
|
|
34
|
+
taxonomyImport: boolean;
|
|
35
|
+
articleTagLinks: boolean;
|
|
36
|
+
personEntries: boolean;
|
|
37
|
+
navigationEdit: boolean;
|
|
38
|
+
};
|
|
39
|
+
devTools: {
|
|
40
|
+
cmsSeoAudit: boolean;
|
|
41
|
+
};
|
|
42
|
+
hasSiteFacts: boolean;
|
|
43
|
+
hasBrand: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface EditorTaskDefinition {
|
|
46
|
+
id: string;
|
|
47
|
+
title: string;
|
|
48
|
+
resourceName: string;
|
|
49
|
+
sourceFile: string;
|
|
50
|
+
intentPhrases: string[];
|
|
51
|
+
mcpPrompt?: string;
|
|
52
|
+
isEnabled: (caps: SiteCapabilities) => boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare const EDITOR_TASKS_DIR: string;
|
|
55
|
+
export declare const EDITOR_TASK_REGISTRY: EditorTaskDefinition[];
|
|
56
|
+
export declare function buildSiteCapabilities(options: {
|
|
57
|
+
project: CmsEditProject;
|
|
58
|
+
constants: RoutingConstants;
|
|
59
|
+
registrations: RegistrationEntry[];
|
|
60
|
+
repoRoot: string;
|
|
61
|
+
appDir: string;
|
|
62
|
+
hasArticlesPlaybook: boolean;
|
|
63
|
+
hasSiteFacts: boolean;
|
|
64
|
+
hasBrand: boolean;
|
|
65
|
+
homepageSlug: string;
|
|
66
|
+
}): SiteCapabilities;
|
|
67
|
+
export declare function getEnabledTasks(caps: SiteCapabilities): EditorTaskDefinition[];
|
|
68
|
+
export declare function buildTasksIndexMarkdown(caps: SiteCapabilities, enabledTasks: EditorTaskDefinition[]): string;
|
|
69
|
+
export declare function buildChecklistMarkdown(caps: SiteCapabilities): string;
|
|
70
|
+
export declare function copyEditorTaskPlaybooks(outDir: string, enabledTasks: EditorTaskDefinition[]): void;
|
|
71
|
+
export declare function findSiteFacts(repoRoot: string, projectKey: string): Record<string, unknown> | null;
|
|
72
|
+
/** Site-specific task overrides from docs/cms-editor/<projectKey>/tasks/*.md */
|
|
73
|
+
export declare function findSiteTaskOverrides(repoRoot: string, projectKey: string): {
|
|
74
|
+
resourceName: string;
|
|
75
|
+
content: string;
|
|
76
|
+
}[];
|
|
77
|
+
export declare const CUSTOMER_REQUIRED_READING: readonly ["tasks-index", "capabilities", "checklist", "overview", "routing", "components-index"];
|
|
78
|
+
export declare function buildRequiredReadingUris(resources: {
|
|
79
|
+
name: string;
|
|
80
|
+
uri: string;
|
|
81
|
+
}[]): string[];
|
|
82
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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jB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAchC;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAc7C;AAED,eAAO,MAAM,yBAAyB,kGAO5B,CAAC;AAEX,wBAAgB,wBAAwB,CAAC,SAAS,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,EAAE,CAU7F"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', '..');
|
|
5
|
+
export const EDITOR_TASKS_DIR = path.join(PACKAGE_ROOT, 'docs', 'editor-tasks');
|
|
6
|
+
export const EDITOR_TASK_REGISTRY = [
|
|
7
|
+
{
|
|
8
|
+
id: 'edit-scalar-fields',
|
|
9
|
+
title: 'Edit scalar fields',
|
|
10
|
+
resourceName: 'task-edit-scalar-fields',
|
|
11
|
+
sourceFile: 'edit-scalar-fields.md',
|
|
12
|
+
intentPhrases: ['change a field', 'update title', 'set description'],
|
|
13
|
+
isEnabled: () => true,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
id: 'edit-rich-text',
|
|
17
|
+
title: 'Edit rich text',
|
|
18
|
+
resourceName: 'task-edit-rich-text',
|
|
19
|
+
sourceFile: 'edit-rich-text.md',
|
|
20
|
+
intentPhrases: ['edit body copy', 'update paragraph', 'change rich text'],
|
|
21
|
+
isEnabled: () => true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: 'bulk-find-replace',
|
|
25
|
+
title: 'Bulk find-replace in rich text',
|
|
26
|
+
resourceName: 'task-bulk-find-replace',
|
|
27
|
+
sourceFile: 'bulk-find-replace.md',
|
|
28
|
+
intentPhrases: [
|
|
29
|
+
'find and replace across pages',
|
|
30
|
+
'replace text sitewide in body copy',
|
|
31
|
+
'update legal boilerplate',
|
|
32
|
+
],
|
|
33
|
+
mcpPrompt: 'cms_edit_bulk_find_replace',
|
|
34
|
+
isEnabled: (caps) => caps.mechanisms.bulkRtfFindReplace,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'seo-descriptions',
|
|
38
|
+
title: 'SEO meta descriptions',
|
|
39
|
+
resourceName: 'task-seo-descriptions',
|
|
40
|
+
sourceFile: 'seo-descriptions.md',
|
|
41
|
+
intentPhrases: [
|
|
42
|
+
'update meta descriptions',
|
|
43
|
+
'improve SEO descriptions',
|
|
44
|
+
'google search descriptions',
|
|
45
|
+
],
|
|
46
|
+
mcpPrompt: 'cms_edit_bulk_seo',
|
|
47
|
+
isEnabled: (caps) => caps.content.pages || caps.content.articles,
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'create-page',
|
|
51
|
+
title: 'Create a page',
|
|
52
|
+
resourceName: 'task-create-page',
|
|
53
|
+
sourceFile: 'create-page.md',
|
|
54
|
+
intentPhrases: ['create a new page', 'add a landing page'],
|
|
55
|
+
mcpPrompt: 'cms_edit_create_page',
|
|
56
|
+
isEnabled: (caps) => caps.content.pages,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: 'create-article',
|
|
60
|
+
title: 'Create an article',
|
|
61
|
+
resourceName: 'task-create-article',
|
|
62
|
+
sourceFile: 'create-article.md',
|
|
63
|
+
intentPhrases: ['create a blog post', 'new article', 'publish content'],
|
|
64
|
+
mcpPrompt: 'cms_edit_create_article',
|
|
65
|
+
isEnabled: (caps) => caps.content.articles,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'create-from-document',
|
|
69
|
+
title: 'Create from a document',
|
|
70
|
+
resourceName: 'task-create-from-document',
|
|
71
|
+
sourceFile: 'create-from-document.md',
|
|
72
|
+
intentPhrases: ['create from google doc', 'import from document', 'build page from doc'],
|
|
73
|
+
mcpPrompt: 'cms_edit_create_from_doc',
|
|
74
|
+
isEnabled: (caps) => caps.content.pages || caps.content.articles,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'taxonomy',
|
|
78
|
+
title: 'Taxonomy setup',
|
|
79
|
+
resourceName: 'task-taxonomy',
|
|
80
|
+
sourceFile: 'taxonomy.md',
|
|
81
|
+
intentPhrases: ['create tags', 'set up taxonomy', 'add tag types'],
|
|
82
|
+
mcpPrompt: 'cms_edit_taxonomy',
|
|
83
|
+
isEnabled: (caps) => caps.content.tags,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: 'article-tags',
|
|
87
|
+
title: 'Article tags',
|
|
88
|
+
resourceName: 'task-article-tags',
|
|
89
|
+
sourceFile: 'article-tags.md',
|
|
90
|
+
intentPhrases: ['update article tags', 'retag articles', 'add tags to posts'],
|
|
91
|
+
mcpPrompt: 'cms_edit_bulk_article_tags',
|
|
92
|
+
isEnabled: (caps) => caps.content.articles && caps.content.tags,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: 'authors-import',
|
|
96
|
+
title: 'Authors (person entries)',
|
|
97
|
+
resourceName: 'task-authors-import',
|
|
98
|
+
sourceFile: 'authors-import.md',
|
|
99
|
+
intentPhrases: ['create authors', 'import people from spreadsheet', 'add team members'],
|
|
100
|
+
mcpPrompt: 'cms_edit_import_authors',
|
|
101
|
+
isEnabled: (caps) => caps.content.persons,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'navigation',
|
|
105
|
+
title: 'Navigation',
|
|
106
|
+
resourceName: 'task-navigation',
|
|
107
|
+
sourceFile: 'navigation.md',
|
|
108
|
+
intentPhrases: ['update menu', 'change navigation', 'footer links'],
|
|
109
|
+
isEnabled: (caps) => caps.content.navigation,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'media-reuse-and-upload',
|
|
113
|
+
title: 'Media — reuse and upload',
|
|
114
|
+
resourceName: 'task-media-reuse-and-upload',
|
|
115
|
+
sourceFile: 'media-reuse-and-upload.md',
|
|
116
|
+
intentPhrases: ['upload image', 'find existing asset', 'add photo to page'],
|
|
117
|
+
mcpPrompt: 'cms_edit_media',
|
|
118
|
+
isEnabled: (caps) => caps.mechanisms.assetSearch && caps.mechanisms.assetUpload,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: 'clone-page',
|
|
122
|
+
title: 'Clone page structure',
|
|
123
|
+
resourceName: 'task-clone-page',
|
|
124
|
+
sourceFile: 'clone-page.md',
|
|
125
|
+
intentPhrases: ['copy page layout', 'duplicate page structure', 'use page as template'],
|
|
126
|
+
isEnabled: (caps) => caps.content.pages,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'featured-images',
|
|
130
|
+
title: 'Featured images',
|
|
131
|
+
resourceName: 'task-featured-images',
|
|
132
|
+
sourceFile: 'featured-images.md',
|
|
133
|
+
intentPhrases: ['set featured image', 'social sharing image', 'og image'],
|
|
134
|
+
isEnabled: (caps) => caps.content.pages || caps.content.articles,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'preview-verify',
|
|
138
|
+
title: 'Preview verification',
|
|
139
|
+
resourceName: 'task-preview-verify',
|
|
140
|
+
sourceFile: 'preview-verify.md',
|
|
141
|
+
intentPhrases: ['preview changes', 'check staging', 'verify page looks right'],
|
|
142
|
+
isEnabled: () => true,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'publish-handoff',
|
|
146
|
+
title: 'Publish handoff',
|
|
147
|
+
resourceName: 'task-publish-handoff',
|
|
148
|
+
sourceFile: 'publish-handoff.md',
|
|
149
|
+
intentPhrases: ['publish changes', 'go live', 'make changes live'],
|
|
150
|
+
isEnabled: () => true,
|
|
151
|
+
},
|
|
152
|
+
];
|
|
153
|
+
function detectCmsSeoAudit(repoRoot, appDir) {
|
|
154
|
+
const candidates = [
|
|
155
|
+
path.join(appDir, 'scripts', 'seo-audit.ts'),
|
|
156
|
+
path.join(repoRoot, 'scripts', 'seo-audit.ts'),
|
|
157
|
+
path.join(appDir, 'package.json'),
|
|
158
|
+
];
|
|
159
|
+
for (const candidate of candidates.slice(0, 2)) {
|
|
160
|
+
if (fs.existsSync(candidate))
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
if (fs.existsSync(candidates[2])) {
|
|
164
|
+
try {
|
|
165
|
+
const pkg = JSON.parse(fs.readFileSync(candidates[2], 'utf8'));
|
|
166
|
+
if (pkg.scripts?.['cms:seo-audit'] || pkg.scripts?.['seo-audit'])
|
|
167
|
+
return true;
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
/* ignore */
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
export function buildSiteCapabilities(options) {
|
|
176
|
+
const { project, constants, registrations, repoRoot, appDir } = options;
|
|
177
|
+
const hasArticles = options.hasArticlesPlaybook ||
|
|
178
|
+
Boolean(constants.articlesSlug || constants.articlesBase) ||
|
|
179
|
+
constants.enableArticleTypeIndex === true;
|
|
180
|
+
const hasPersons = constants.enablePerson === true || Boolean(constants.peopleBase);
|
|
181
|
+
const hasTags = constants.enableTag !== false;
|
|
182
|
+
const hasNavigation = registrations.some((entry) => entry.kind === 'component' && /navigation|footer/i.test(entry.name));
|
|
183
|
+
return {
|
|
184
|
+
projectKey: project.projectKey,
|
|
185
|
+
generatedAt: new Date().toISOString(),
|
|
186
|
+
content: {
|
|
187
|
+
pages: true,
|
|
188
|
+
articles: hasArticles,
|
|
189
|
+
persons: hasPersons,
|
|
190
|
+
tags: hasTags,
|
|
191
|
+
navigation: hasNavigation || hasTags,
|
|
192
|
+
},
|
|
193
|
+
routing: {
|
|
194
|
+
homepageSlug: options.homepageSlug,
|
|
195
|
+
articlesBase: constants.articlesBase,
|
|
196
|
+
tagsBase: constants.tagsBase,
|
|
197
|
+
peopleBase: constants.peopleBase,
|
|
198
|
+
enablePrimaryTagPartOfSlug: constants.enablePrimaryTagPartOfSlug,
|
|
199
|
+
},
|
|
200
|
+
registrations: {
|
|
201
|
+
components: registrations.filter((e) => e.kind === 'component').length,
|
|
202
|
+
collections: registrations.filter((e) => e.kind === 'collection').length,
|
|
203
|
+
externals: registrations.filter((e) => e.kind === 'external').length,
|
|
204
|
+
},
|
|
205
|
+
mechanisms: {
|
|
206
|
+
scalarEdit: true,
|
|
207
|
+
richTextEdit: true,
|
|
208
|
+
batchScalar: true,
|
|
209
|
+
bulkRtfFindReplace: true,
|
|
210
|
+
createFromJson: true,
|
|
211
|
+
assetSearch: true,
|
|
212
|
+
assetUpload: true,
|
|
213
|
+
taxonomyImport: hasTags,
|
|
214
|
+
articleTagLinks: hasArticles && hasTags,
|
|
215
|
+
personEntries: hasPersons,
|
|
216
|
+
navigationEdit: true,
|
|
217
|
+
},
|
|
218
|
+
devTools: {
|
|
219
|
+
cmsSeoAudit: detectCmsSeoAudit(repoRoot, appDir),
|
|
220
|
+
},
|
|
221
|
+
hasSiteFacts: options.hasSiteFacts,
|
|
222
|
+
hasBrand: options.hasBrand,
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
export function getEnabledTasks(caps) {
|
|
226
|
+
return EDITOR_TASK_REGISTRY.filter((task) => task.isEnabled(caps));
|
|
227
|
+
}
|
|
228
|
+
export function buildTasksIndexMarkdown(caps, enabledTasks) {
|
|
229
|
+
const lines = [
|
|
230
|
+
'# CMS edit tasks',
|
|
231
|
+
'',
|
|
232
|
+
'Intent → capability playbook mapping for **this site**. Only tasks listed here apply.',
|
|
233
|
+
'',
|
|
234
|
+
'Read `cms-edit://customer/capabilities` for the machine-readable capability list.',
|
|
235
|
+
'',
|
|
236
|
+
'## First steps',
|
|
237
|
+
'',
|
|
238
|
+
'1. Read `cms-edit://customer/checklist`',
|
|
239
|
+
'2. Read `cms-edit://customer/overview` and `cms-edit://customer/routing`',
|
|
240
|
+
'3. Pick a task below and read its playbook before editing',
|
|
241
|
+
'',
|
|
242
|
+
'## Available tasks',
|
|
243
|
+
'',
|
|
244
|
+
];
|
|
245
|
+
for (const task of enabledTasks) {
|
|
246
|
+
lines.push(`### ${task.title}`, '');
|
|
247
|
+
lines.push(`- **Playbook:** \`cms-edit://customer/${task.resourceName}\``);
|
|
248
|
+
if (task.mcpPrompt) {
|
|
249
|
+
lines.push(`- **MCP prompt:** \`${task.mcpPrompt}\``);
|
|
250
|
+
}
|
|
251
|
+
lines.push('- **Example requests:**');
|
|
252
|
+
for (const phrase of task.intentPhrases) {
|
|
253
|
+
lines.push(` - "${phrase}"`);
|
|
254
|
+
}
|
|
255
|
+
lines.push('');
|
|
256
|
+
}
|
|
257
|
+
if (caps.devTools.cmsSeoAudit) {
|
|
258
|
+
lines.push('## Dev-only SEO audit', '', 'This site has a `cms:seo-audit` script. Developers can run a full-site SEO CSV workflow;', 'hosted editors should use **SEO meta descriptions** task for per-page updates.', '');
|
|
259
|
+
}
|
|
260
|
+
return `${lines.join('\n')}\n`;
|
|
261
|
+
}
|
|
262
|
+
export function buildChecklistMarkdown(caps) {
|
|
263
|
+
const lines = [
|
|
264
|
+
'# First-session checklist',
|
|
265
|
+
'',
|
|
266
|
+
'Complete these steps before editing Contentful content on this site.',
|
|
267
|
+
'',
|
|
268
|
+
'1. **Verify connectivity** — MCP prompt `cms_edit_verify` or `cms_edit ["health"]`',
|
|
269
|
+
'2. **Read capabilities** — `cms-edit://customer/capabilities`',
|
|
270
|
+
'3. **Read tasks index** — `cms-edit://customer/tasks-index`',
|
|
271
|
+
'4. **Read site overview** — `cms-edit://customer/overview`',
|
|
272
|
+
'5. **Read routing** — `cms-edit://customer/routing`',
|
|
273
|
+
'6. **Sync index** — `cms_edit ["index", "sync"]` (assets, media, templates, taxonomy)',
|
|
274
|
+
'7. **Read components index** — `cms-edit://customer/components-index` before creating content',
|
|
275
|
+
];
|
|
276
|
+
if (caps.content.articles) {
|
|
277
|
+
lines.push('8. **Read articles playbook** — `cms-edit://customer/articles` (if present)');
|
|
278
|
+
}
|
|
279
|
+
if (caps.hasBrand) {
|
|
280
|
+
lines.push('- **Read brand** — `cms-edit://customer/brand` when writing copy');
|
|
281
|
+
}
|
|
282
|
+
if (caps.hasSiteFacts) {
|
|
283
|
+
lines.push('- **Read site facts** — `cms-edit://customer/site-facts` for canonical business values');
|
|
284
|
+
}
|
|
285
|
+
lines.push('', '## Safety', '', '- All `save` operations create **drafts only** — a human publishes in Contentful UI', '- **Search for existing assets before uploading** — see `task-media-reuse-and-upload`', '');
|
|
286
|
+
return `${lines.join('\n')}\n`;
|
|
287
|
+
}
|
|
288
|
+
export function copyEditorTaskPlaybooks(outDir, enabledTasks) {
|
|
289
|
+
for (const task of enabledTasks) {
|
|
290
|
+
const sourcePath = path.join(EDITOR_TASKS_DIR, task.sourceFile);
|
|
291
|
+
if (!fs.existsSync(sourcePath)) {
|
|
292
|
+
throw new Error(`Missing editor task playbook: ${sourcePath}`);
|
|
293
|
+
}
|
|
294
|
+
const content = fs.readFileSync(sourcePath, 'utf8');
|
|
295
|
+
fs.writeFileSync(path.join(outDir, `${task.resourceName}.md`), content);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export function findSiteFacts(repoRoot, projectKey) {
|
|
299
|
+
const candidates = [
|
|
300
|
+
path.join(repoRoot, 'docs', 'cms-editor', projectKey, 'site-facts.json'),
|
|
301
|
+
path.join(repoRoot, 'docs', 'cms-editor', 'site-facts.json'),
|
|
302
|
+
];
|
|
303
|
+
for (const candidate of candidates) {
|
|
304
|
+
if (!fs.existsSync(candidate))
|
|
305
|
+
continue;
|
|
306
|
+
try {
|
|
307
|
+
return JSON.parse(fs.readFileSync(candidate, 'utf8'));
|
|
308
|
+
}
|
|
309
|
+
catch {
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
/** Site-specific task overrides from docs/cms-editor/<projectKey>/tasks/*.md */
|
|
316
|
+
export function findSiteTaskOverrides(repoRoot, projectKey) {
|
|
317
|
+
const dir = path.join(repoRoot, 'docs', 'cms-editor', projectKey, 'tasks');
|
|
318
|
+
if (!fs.existsSync(dir))
|
|
319
|
+
return [];
|
|
320
|
+
const overrides = [];
|
|
321
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
322
|
+
if (!entry.isFile() || !entry.name.endsWith('.md'))
|
|
323
|
+
continue;
|
|
324
|
+
const slug = entry.name.replace(/\.md$/i, '');
|
|
325
|
+
overrides.push({
|
|
326
|
+
resourceName: `task-${slug}`,
|
|
327
|
+
content: fs.readFileSync(path.join(dir, entry.name), 'utf8'),
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
return overrides.sort((a, b) => a.resourceName.localeCompare(b.resourceName));
|
|
331
|
+
}
|
|
332
|
+
export const CUSTOMER_REQUIRED_READING = [
|
|
333
|
+
'tasks-index',
|
|
334
|
+
'capabilities',
|
|
335
|
+
'checklist',
|
|
336
|
+
'overview',
|
|
337
|
+
'routing',
|
|
338
|
+
'components-index',
|
|
339
|
+
];
|
|
340
|
+
export function buildRequiredReadingUris(resources) {
|
|
341
|
+
const byName = new Map(resources.map((r) => [r.name, r.uri]));
|
|
342
|
+
const required = CUSTOMER_REQUIRED_READING.filter((name) => byName.has(name)).map((name) => byName.get(name));
|
|
343
|
+
for (const optional of ['defaults', 'articles']) {
|
|
344
|
+
const uri = byName.get(optional);
|
|
345
|
+
if (uri)
|
|
346
|
+
required.push(uri);
|
|
347
|
+
}
|
|
348
|
+
return required;
|
|
349
|
+
}
|
|
350
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/editor-pack/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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,CAAC,CAAC,CAAC,GAAG,CAC/E,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAC5B,CAAC;IACF,KAAK,MAAM,QAAQ,IAAI,CAAC,UAAU,EAAE,UAAU,CAAU,EAAE,CAAC;QACzD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACjC,IAAI,GAAG;YAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/editor-pack/generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/editor-pack/generate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,qBAAqB,CAAC;AAchF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AA4OD,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,wBAAwB,CAgK/F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as fs from 'node:fs';
|
|
2
2
|
import * as path from 'node:path';
|
|
3
3
|
import { resolveRepoRoot, resolveWebsiteAppDir } from '../project/load.js';
|
|
4
|
+
import { buildChecklistMarkdown, buildSiteCapabilities, buildTasksIndexMarkdown, copyEditorTaskPlaybooks, findSiteFacts, findSiteTaskOverrides, getEnabledTasks, } from './capabilities.js';
|
|
4
5
|
import { buildRoutingMarkdown, parseConstants } from './parse-constants.js';
|
|
5
6
|
import { buildComponentIndex, copyGuidelineFragments } from './parse-guidelines.js';
|
|
6
7
|
import { parseRegistrations } from './parse-registrations.js';
|
|
@@ -114,13 +115,13 @@ function buildDefaultsMarkdown(project) {
|
|
|
114
115
|
'',
|
|
115
116
|
'Rules for featured images, article types, and when to use Contentful UI vs Claude.',
|
|
116
117
|
'',
|
|
117
|
-
'## Contentful UI — publish
|
|
118
|
+
'## Contentful UI — publish only',
|
|
118
119
|
'',
|
|
119
|
-
'Marketing editors should use **Claude + cms-edit** for
|
|
120
|
-
'Open Contentful only to
|
|
120
|
+
'Marketing editors should use **Claude + cms-edit** for copy, structure, and assets.',
|
|
121
|
+
'Open Contentful only to **publish** approved drafts (cms-edit cannot publish).',
|
|
121
122
|
'',
|
|
122
|
-
'
|
|
123
|
-
'
|
|
123
|
+
'**Assets:** search and reuse existing files first (`asset search`, `index sync`).',
|
|
124
|
+
'Upload via cms-edit when no match (`asset upload --if-exists-by-filename`).',
|
|
124
125
|
'',
|
|
125
126
|
'Do not edit page or article copy directly in Contentful.',
|
|
126
127
|
'',
|
|
@@ -177,11 +178,14 @@ function buildOverviewMarkdown(project, options) {
|
|
|
177
178
|
lines.push(`- **Site title:** ${project.website.siteTitle}`);
|
|
178
179
|
}
|
|
179
180
|
const beforeSteps = [
|
|
180
|
-
'1. Read `cms-edit://customer/
|
|
181
|
-
'2. Read `cms-edit://customer/
|
|
181
|
+
'1. Read `cms-edit://customer/checklist` — first-session steps.',
|
|
182
|
+
'2. Read `cms-edit://customer/capabilities` — what this site supports.',
|
|
183
|
+
'3. Read `cms-edit://customer/tasks-index` — pick a task playbook for your goal.',
|
|
184
|
+
'4. Read `cms-edit://customer/routing` for URL rules.',
|
|
185
|
+
'5. Read `cms-edit://customer/components-index` to pick component types.',
|
|
182
186
|
];
|
|
183
187
|
if (options.hasDefaults) {
|
|
184
|
-
beforeSteps.push('
|
|
188
|
+
beforeSteps.push('6. Read `cms-edit://customer/defaults` for featured image rules.');
|
|
185
189
|
}
|
|
186
190
|
if (options.hasArticles) {
|
|
187
191
|
beforeSteps.push(`${String(beforeSteps.length + 1)}. Read \`cms-edit://customer/articles\` for article/publication playbook.`);
|
|
@@ -189,7 +193,7 @@ function buildOverviewMarkdown(project, options) {
|
|
|
189
193
|
beforeSteps.push(`${String(beforeSteps.length + 1)}. Read \`cms-edit://customer/brand\` when writing copy (if available).`);
|
|
190
194
|
beforeSteps.push(`${String(beforeSteps.length + 1)}. Use \`cms_edit\` with \`create from-json --dry-run --strict\` before saving new pages or articles.`);
|
|
191
195
|
lines.push('', '## Before editing', '', ...beforeSteps, '');
|
|
192
|
-
lines.push('##
|
|
196
|
+
lines.push('## Assets', '', 'Search and reuse existing assets before uploading. Use `asset upload` only when no match exists.', 'See `cms-edit://customer/task-media-reuse-and-upload`.', '', '## Publish handoff', '', 'All `save` operations create **drafts only**. A human must **publish in Contentful** for changes to go live.', '');
|
|
193
197
|
return `${lines.join('\n')}\n`;
|
|
194
198
|
}
|
|
195
199
|
export function generateEditorPack(options) {
|
|
@@ -201,26 +205,63 @@ export function generateEditorPack(options) {
|
|
|
201
205
|
const constants = parseConstants(appDir);
|
|
202
206
|
const registrations = parseRegistrations(appDir);
|
|
203
207
|
const { entries: componentEntries, guidelinesDir } = buildComponentIndex(appDir, repoRoot, registrations);
|
|
208
|
+
const articles = findArticlesPlaybook(repoRoot, project.projectKey);
|
|
209
|
+
const defaultsMd = buildDefaultsMarkdown(project);
|
|
210
|
+
const hasDefaults = defaultsMd !== null;
|
|
211
|
+
const hasArticles = articles !== null;
|
|
212
|
+
const homepageSlug = project.website.homepageSlug ?? constants.homepageSlug ?? 'index';
|
|
213
|
+
const siteFacts = findSiteFacts(repoRoot, project.projectKey);
|
|
214
|
+
const hasSiteFacts = siteFacts !== null;
|
|
215
|
+
const brandSource = findSiteContext(repoRoot);
|
|
216
|
+
const hasBrand = buildBrandMarkdown(brandSource) !== null;
|
|
217
|
+
const capabilities = buildSiteCapabilities({
|
|
218
|
+
project,
|
|
219
|
+
constants,
|
|
220
|
+
registrations,
|
|
221
|
+
repoRoot,
|
|
222
|
+
appDir,
|
|
223
|
+
hasArticlesPlaybook: hasArticles,
|
|
224
|
+
hasSiteFacts,
|
|
225
|
+
hasBrand,
|
|
226
|
+
homepageSlug,
|
|
227
|
+
});
|
|
228
|
+
const enabledTasks = getEnabledTasks(capabilities);
|
|
229
|
+
fs.writeFileSync(path.join(outDir, 'capabilities.json'), `${JSON.stringify(capabilities, null, 2)}\n`);
|
|
230
|
+
fs.writeFileSync(path.join(outDir, 'tasks-index.md'), buildTasksIndexMarkdown(capabilities, enabledTasks));
|
|
231
|
+
fs.writeFileSync(path.join(outDir, 'checklist.md'), buildChecklistMarkdown(capabilities));
|
|
232
|
+
copyEditorTaskPlaybooks(outDir, enabledTasks);
|
|
233
|
+
const taskResources = enabledTasks.map((task) => task.resourceName);
|
|
234
|
+
for (const override of findSiteTaskOverrides(repoRoot, project.projectKey)) {
|
|
235
|
+
fs.writeFileSync(path.join(outDir, `${override.resourceName}.md`), override.content);
|
|
236
|
+
if (!taskResources.includes(override.resourceName)) {
|
|
237
|
+
taskResources.push(override.resourceName);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (siteFacts) {
|
|
241
|
+
fs.writeFileSync(path.join(outDir, 'site-facts.json'), `${JSON.stringify(siteFacts, null, 2)}\n`);
|
|
242
|
+
}
|
|
204
243
|
const resources = [
|
|
244
|
+
'capabilities',
|
|
245
|
+
'checklist',
|
|
246
|
+
'tasks-index',
|
|
247
|
+
...taskResources,
|
|
205
248
|
'overview',
|
|
206
249
|
'routing',
|
|
207
250
|
'components-index',
|
|
208
251
|
'collections-index',
|
|
209
252
|
'externals-index',
|
|
210
253
|
];
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const hasArticles = articles !== null;
|
|
254
|
+
if (siteFacts) {
|
|
255
|
+
resources.push('site-facts');
|
|
256
|
+
}
|
|
215
257
|
fs.writeFileSync(path.join(outDir, 'overview.md'), buildOverviewMarkdown(project, { hasDefaults, hasArticles }));
|
|
216
|
-
const homepageSlug = project.website.homepageSlug ?? constants.homepageSlug ?? 'index';
|
|
217
258
|
fs.writeFileSync(path.join(outDir, 'routing.md'), buildRoutingMarkdown(constants, homepageSlug));
|
|
218
259
|
if (defaultsMd && project.editor?.defaults) {
|
|
219
260
|
fs.writeFileSync(path.join(outDir, 'defaults.md'), defaultsMd);
|
|
220
261
|
fs.writeFileSync(path.join(outDir, 'defaults.json'), buildDefaultsJson(project.editor.defaults));
|
|
221
262
|
resources.push('defaults');
|
|
222
263
|
}
|
|
223
|
-
const brand = buildBrandMarkdown(
|
|
264
|
+
const brand = buildBrandMarkdown(brandSource);
|
|
224
265
|
if (brand) {
|
|
225
266
|
fs.writeFileSync(path.join(outDir, 'brand.md'), brand);
|
|
226
267
|
resources.push('brand');
|
|
@@ -262,6 +303,7 @@ export function generateEditorPack(options) {
|
|
|
262
303
|
` Collections: ${collections.length}`,
|
|
263
304
|
` Externals: ${externals.length}`,
|
|
264
305
|
` With guidelines: ${componentEntries.filter((e) => e.hasGuideline).length}`,
|
|
306
|
+
` Enabled tasks: ${enabledTasks.length}`,
|
|
265
307
|
];
|
|
266
308
|
return { outDir, manifest, summary };
|
|
267
309
|
}
|