@se-studio/contentful-cms 1.2.5 → 1.3.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 +6 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +6 -0
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/editor-pack.d.ts +4 -0
- package/dist/commands/editor-pack.d.ts.map +1 -0
- package/dist/commands/editor-pack.js +31 -0
- package/dist/commands/editor-pack.js.map +1 -0
- package/dist/commands/mcpb-pack.d.ts +4 -0
- package/dist/commands/mcpb-pack.d.ts.map +1 -0
- package/dist/commands/mcpb-pack.js +60 -0
- package/dist/commands/mcpb-pack.js.map +1 -0
- package/dist/commands/project.d.ts +4 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +26 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/editor-pack/generate.d.ts +19 -0
- package/dist/editor-pack/generate.d.ts.map +1 -0
- package/dist/editor-pack/generate.js +171 -0
- package/dist/editor-pack/generate.js.map +1 -0
- package/dist/editor-pack/load.d.ts +13 -0
- package/dist/editor-pack/load.d.ts.map +1 -0
- package/dist/editor-pack/load.js +82 -0
- package/dist/editor-pack/load.js.map +1 -0
- package/dist/editor-pack/parse-constants.d.ts +22 -0
- package/dist/editor-pack/parse-constants.d.ts.map +1 -0
- package/dist/editor-pack/parse-constants.js +85 -0
- package/dist/editor-pack/parse-constants.js.map +1 -0
- package/dist/editor-pack/parse-guidelines.d.ts +17 -0
- package/dist/editor-pack/parse-guidelines.d.ts.map +1 -0
- package/dist/editor-pack/parse-guidelines.js +93 -0
- package/dist/editor-pack/parse-guidelines.js.map +1 -0
- package/dist/editor-pack/parse-registrations.d.ts +7 -0
- package/dist/editor-pack/parse-registrations.d.ts.map +1 -0
- package/dist/editor-pack/parse-registrations.js +54 -0
- package/dist/editor-pack/parse-registrations.js.map +1 -0
- 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/index.d.ts +1 -0
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/hosted/index.js +1 -0
- package/dist/hosted/index.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 +1 -0
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/http-handler.d.ts +2 -0
- package/dist/mcp/http-handler.d.ts.map +1 -1
- package/dist/mcp/http-handler.js +5 -1
- package/dist/mcp/http-handler.js.map +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +33 -2
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/mcp/resources/customer.d.ts +7 -0
- package/dist/mcp/resources/customer.d.ts.map +1 -0
- package/dist/mcp/resources/customer.js +69 -0
- package/dist/mcp/resources/customer.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +2 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/project/load.d.ts +5 -0
- package/dist/project/load.d.ts.map +1 -0
- package/dist/project/load.js +66 -0
- package/dist/project/load.js.map +1 -0
- package/dist/project/types.d.ts +29 -0
- package/dist/project/types.d.ts.map +1 -0
- package/dist/project/types.js +31 -0
- package/dist/project/types.js.map +1 -0
- package/dist/project/validate-secrets.d.ts +7 -0
- package/dist/project/validate-secrets.d.ts.map +1 -0
- package/dist/project/validate-secrets.js +61 -0
- package/dist/project/validate-secrets.js.map +1 -0
- package/docs/mcp/hosted-guide.md +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
function readStringConstant(content, name) {
|
|
4
|
+
const match = new RegExp(`export const ${name}\\s*=\\s*(?:\`([^\`]+)\`|'([^']+)'|"([^"]+)")`).exec(content);
|
|
5
|
+
return match?.[1] ?? match?.[2] ?? match?.[3];
|
|
6
|
+
}
|
|
7
|
+
function readBooleanConstant(content, name) {
|
|
8
|
+
const match = new RegExp(`export const ${name}\\s*=\\s*(true|false)`).exec(content);
|
|
9
|
+
if (!match?.[1])
|
|
10
|
+
return undefined;
|
|
11
|
+
return match[1] === 'true';
|
|
12
|
+
}
|
|
13
|
+
export function parseConstants(appDir) {
|
|
14
|
+
const constantsPath = path.join(appDir, 'src', 'lib', 'constants.ts');
|
|
15
|
+
if (!fs.existsSync(constantsPath)) {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
const content = fs.readFileSync(constantsPath, 'utf8');
|
|
19
|
+
return {
|
|
20
|
+
articlesSlug: readStringConstant(content, 'ARTICLES_SLUG'),
|
|
21
|
+
tagsSlug: readStringConstant(content, 'TAGS_SLUG'),
|
|
22
|
+
peopleSlug: readStringConstant(content, 'PEOPLE_SLUG'),
|
|
23
|
+
articlesBase: readStringConstant(content, 'ARTICLES_BASE'),
|
|
24
|
+
tagsBase: readStringConstant(content, 'TAGS_BASE'),
|
|
25
|
+
peopleBase: readStringConstant(content, 'PEOPLE_BASE'),
|
|
26
|
+
defaultTopic: readStringConstant(content, 'DEFAULT_TOPIC'),
|
|
27
|
+
customerName: readStringConstant(content, 'customerName'),
|
|
28
|
+
siteTitle: readStringConstant(content, 'siteTitle'),
|
|
29
|
+
enablePerson: readBooleanConstant(content, 'enablePerson'),
|
|
30
|
+
enableTag: readBooleanConstant(content, 'enableTag'),
|
|
31
|
+
enableTagsIndex: readBooleanConstant(content, 'enableTagsIndex'),
|
|
32
|
+
enableArticleTypeIndex: readBooleanConstant(content, 'enableArticleTypeIndex'),
|
|
33
|
+
enableArticleTypeTagIndex: readBooleanConstant(content, 'enableArticleTypeTagIndex'),
|
|
34
|
+
enablePrimaryTagPartOfSlug: readBooleanConstant(content, 'enablePrimaryTagPartOfSlug'),
|
|
35
|
+
articlesBaseIsPage: readBooleanConstant(content, 'articlesBaseIsPage'),
|
|
36
|
+
requireCustomTypeForArticleTypes: readBooleanConstant(content, 'requireCustomTypeForArticleTypes'),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function buildRoutingMarkdown(constants) {
|
|
40
|
+
const lines = [
|
|
41
|
+
'# Routing',
|
|
42
|
+
'',
|
|
43
|
+
'URL and content routing rules for this site.',
|
|
44
|
+
'',
|
|
45
|
+
'## Article paths',
|
|
46
|
+
'',
|
|
47
|
+
];
|
|
48
|
+
if (constants.articlesSlug) {
|
|
49
|
+
lines.push(`- **Articles slug segment:** \`${constants.articlesSlug}\``);
|
|
50
|
+
}
|
|
51
|
+
if (constants.articlesBase) {
|
|
52
|
+
lines.push(`- **Articles base path:** \`${constants.articlesBase}\``);
|
|
53
|
+
}
|
|
54
|
+
if (constants.enablePrimaryTagPartOfSlug !== undefined) {
|
|
55
|
+
lines.push(`- **Primary tag in URL:** ${constants.enablePrimaryTagPartOfSlug ? 'yes' : 'no (flat article URLs)'}`);
|
|
56
|
+
}
|
|
57
|
+
if (constants.enableArticleTypeIndex !== undefined) {
|
|
58
|
+
lines.push(`- **Article type index enabled:** ${constants.enableArticleTypeIndex}`);
|
|
59
|
+
}
|
|
60
|
+
lines.push('', '## Tags and people', '');
|
|
61
|
+
if (constants.tagsBase) {
|
|
62
|
+
lines.push(`- **Tags base:** \`${constants.tagsBase}\``);
|
|
63
|
+
}
|
|
64
|
+
if (constants.peopleBase) {
|
|
65
|
+
lines.push(`- **People base:** \`${constants.peopleBase}\``);
|
|
66
|
+
}
|
|
67
|
+
if (constants.defaultTopic) {
|
|
68
|
+
lines.push(`- **Default topic (untagged articles):** \`${constants.defaultTopic}\``);
|
|
69
|
+
}
|
|
70
|
+
lines.push('', '## Feature flags', '');
|
|
71
|
+
const flags = [
|
|
72
|
+
['enableTag', constants.enableTag],
|
|
73
|
+
['enableTagsIndex', constants.enableTagsIndex],
|
|
74
|
+
['enablePerson', constants.enablePerson],
|
|
75
|
+
['enableArticleTypeTagIndex', constants.enableArticleTypeTagIndex],
|
|
76
|
+
['articlesBaseIsPage', constants.articlesBaseIsPage],
|
|
77
|
+
];
|
|
78
|
+
for (const [name, value] of flags) {
|
|
79
|
+
if (value !== undefined) {
|
|
80
|
+
lines.push(`- **${name}:** ${value}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return `${lines.join('\n')}\n`;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=parse-constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-constants.js","sourceRoot":"","sources":["../../src/editor-pack/parse-constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAsBlC,SAAS,kBAAkB,CAAC,OAAe,EAAE,IAAY;IACvD,MAAM,KAAK,GAAG,IAAI,MAAM,CACtB,gBAAgB,IAAI,+CAA+C,CACpE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChB,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAe,EAAE,IAAY;IACxD,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,gBAAgB,IAAI,uBAAuB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpF,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IAClC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,aAAa,GAA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AAY,IAAI,CAAC,CAAC;IACvF,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACvC,MAAM,KAAK,GAAoC;QAC7C,CAAC,WAAW,EAAE,SAAS,CAAC,SAAS,CAAC;QAClC,CAAC,iBAAiB,EAAE,SAAS,CAAC,eAAe,CAAC;QAC9C,CAAC,cAAc,EAAE,SAAS,CAAC,YAAY,CAAC;QACxC,CAAC,2BAA2B,EAAE,SAAS,CAAC,yBAAyB,CAAC;QAClE,CAAC,oBAAoB,EAAE,SAAS,CAAC,kBAAkB,CAAC;KACrD,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;QAClC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ComponentIndexEntry {
|
|
2
|
+
name: string;
|
|
3
|
+
slug: string;
|
|
4
|
+
kind: 'component' | 'collection' | 'external';
|
|
5
|
+
whenToUse?: string;
|
|
6
|
+
requiredFields: string[];
|
|
7
|
+
hasGuideline: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildComponentIndex(appDir: string, repoRoot: string, registrations: {
|
|
10
|
+
name: string;
|
|
11
|
+
kind: ComponentIndexEntry['kind'];
|
|
12
|
+
}[]): {
|
|
13
|
+
entries: ComponentIndexEntry[];
|
|
14
|
+
guidelinesDir: string | null;
|
|
15
|
+
};
|
|
16
|
+
export declare function copyGuidelineFragments(guidelinesDir: string | null, entries: ComponentIndexEntry[], outDir: string): void;
|
|
17
|
+
//# sourceMappingURL=parse-guidelines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-guidelines.d.ts","sourceRoot":"","sources":["../../src/editor-pack/parse-guidelines.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;CACvB;AAgDD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,mBAAmB,CAAC,MAAM,CAAC,CAAA;CAAE,EAAE,GACnE;IAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAqClE;AAED,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,GAAG,IAAI,EAC5B,OAAO,EAAE,mBAAmB,EAAE,EAC9B,MAAM,EAAE,MAAM,GACb,IAAI,CAaN"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
const KIND_DIRS = [
|
|
4
|
+
{ kind: 'component', dir: 'components' },
|
|
5
|
+
{ kind: 'collection', dir: 'collections' },
|
|
6
|
+
{ kind: 'external', dir: 'externals' },
|
|
7
|
+
];
|
|
8
|
+
function slugify(name) {
|
|
9
|
+
return name
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
12
|
+
.replace(/^-+|-+$/g, '');
|
|
13
|
+
}
|
|
14
|
+
function extractSection(markdown, heading) {
|
|
15
|
+
const pattern = new RegExp(`## ${heading}\\s*\\n+([\\s\\S]*?)(?=\\n## |$)`, 'i');
|
|
16
|
+
const match = pattern.exec(markdown);
|
|
17
|
+
return match?.[1]?.trim();
|
|
18
|
+
}
|
|
19
|
+
function extractFieldList(markdown) {
|
|
20
|
+
const fieldsSection = extractSection(markdown, 'Fields');
|
|
21
|
+
if (!fieldsSection)
|
|
22
|
+
return [];
|
|
23
|
+
const fields = [];
|
|
24
|
+
for (const line of fieldsSection.split('\n')) {
|
|
25
|
+
const match = /^\s*[-*]\s+\*\*`?([^`*]+)`?\*\*/.exec(line.trim());
|
|
26
|
+
if (match?.[1]) {
|
|
27
|
+
fields.push(match[1].trim());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return fields;
|
|
31
|
+
}
|
|
32
|
+
function findGuidelinesDir(appDir, repoRoot) {
|
|
33
|
+
const candidates = [
|
|
34
|
+
path.join(appDir, 'docs', 'cms-guidelines'),
|
|
35
|
+
path.join(repoRoot, 'docs', 'cms-guidelines'),
|
|
36
|
+
];
|
|
37
|
+
for (const candidate of candidates) {
|
|
38
|
+
if (fs.existsSync(candidate)) {
|
|
39
|
+
return candidate;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
export function buildComponentIndex(appDir, repoRoot, registrations) {
|
|
45
|
+
const guidelinesDir = findGuidelinesDir(appDir, repoRoot);
|
|
46
|
+
const entries = [];
|
|
47
|
+
for (const registration of registrations) {
|
|
48
|
+
const slug = slugify(registration.name);
|
|
49
|
+
let whenToUse;
|
|
50
|
+
let requiredFields = [];
|
|
51
|
+
let hasGuideline = false;
|
|
52
|
+
if (guidelinesDir) {
|
|
53
|
+
const subdir = KIND_DIRS.find((k) => k.kind === registration.kind)?.dir;
|
|
54
|
+
if (subdir) {
|
|
55
|
+
const guidelinePath = path.join(guidelinesDir, subdir, `${slug}.md`);
|
|
56
|
+
if (fs.existsSync(guidelinePath)) {
|
|
57
|
+
hasGuideline = true;
|
|
58
|
+
const markdown = fs.readFileSync(guidelinePath, 'utf8');
|
|
59
|
+
whenToUse =
|
|
60
|
+
extractSection(markdown, 'When to use') ??
|
|
61
|
+
extractSection(markdown, 'Purpose') ??
|
|
62
|
+
extractSection(markdown, 'Overview');
|
|
63
|
+
requiredFields = extractFieldList(markdown);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
entries.push({
|
|
68
|
+
name: registration.name,
|
|
69
|
+
slug,
|
|
70
|
+
kind: registration.kind,
|
|
71
|
+
whenToUse,
|
|
72
|
+
requiredFields,
|
|
73
|
+
hasGuideline,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return { entries, guidelinesDir };
|
|
77
|
+
}
|
|
78
|
+
export function copyGuidelineFragments(guidelinesDir, entries, outDir) {
|
|
79
|
+
if (!guidelinesDir)
|
|
80
|
+
return;
|
|
81
|
+
for (const entry of entries) {
|
|
82
|
+
if (!entry.hasGuideline)
|
|
83
|
+
continue;
|
|
84
|
+
const subdir = KIND_DIRS.find((k) => k.kind === entry.kind)?.dir;
|
|
85
|
+
if (!subdir)
|
|
86
|
+
continue;
|
|
87
|
+
const src = path.join(guidelinesDir, subdir, `${entry.slug}.md`);
|
|
88
|
+
const destDir = path.join(outDir, subdir);
|
|
89
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
90
|
+
fs.copyFileSync(src, path.join(destDir, `${entry.slug}.md`));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=parse-guidelines.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-guidelines.js","sourceRoot":"","sources":["../../src/editor-pack/parse-guidelines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAWlC,MAAM,SAAS,GAAyD;IACtE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE;IACxC,EAAE,IAAI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
|
|
|
1
|
+
{"version":3,"file":"parse-registrations.d.ts","sourceRoot":"","sources":["../../src/editor-pack/parse-registrations.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;IAC9C,UAAU,EAAE,MAAM,CAAC;CACpB;AA2BD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,EAAE,CA4BtE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
const DEFINE_PATTERNS = [
|
|
4
|
+
{ kind: 'component', pattern: /defineComponent\s*\(\s*\{[^}]*\bname:\s*['"]([^'"]+)['"]/gs },
|
|
5
|
+
{ kind: 'collection', pattern: /defineCollection\s*\(\s*\{[^}]*\bname:\s*['"]([^'"]+)['"]/gs },
|
|
6
|
+
{
|
|
7
|
+
kind: 'external',
|
|
8
|
+
pattern: /defineExternal(?:Component)?\s*\(\s*\{[^}]*\bname:\s*['"]([^'"]+)['"]/gs,
|
|
9
|
+
},
|
|
10
|
+
];
|
|
11
|
+
function walkTsxFiles(dir, results) {
|
|
12
|
+
if (!fs.existsSync(dir)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
16
|
+
const fullPath = path.join(dir, entry.name);
|
|
17
|
+
if (entry.isDirectory()) {
|
|
18
|
+
walkTsxFiles(fullPath, results);
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (/\.(tsx|ts)$/.test(entry.name)) {
|
|
22
|
+
results.push(fullPath);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export function parseRegistrations(appDir) {
|
|
27
|
+
const projectDir = path.join(appDir, 'src', 'project');
|
|
28
|
+
const files = [];
|
|
29
|
+
walkTsxFiles(projectDir, files);
|
|
30
|
+
const entries = [];
|
|
31
|
+
const seen = new Set();
|
|
32
|
+
for (const file of files) {
|
|
33
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
34
|
+
for (const { kind, pattern } of DEFINE_PATTERNS) {
|
|
35
|
+
pattern.lastIndex = 0;
|
|
36
|
+
for (const match of content.matchAll(pattern)) {
|
|
37
|
+
const name = match[1];
|
|
38
|
+
if (!name)
|
|
39
|
+
continue;
|
|
40
|
+
const key = `${kind}:${name}`;
|
|
41
|
+
if (seen.has(key))
|
|
42
|
+
continue;
|
|
43
|
+
seen.add(key);
|
|
44
|
+
entries.push({
|
|
45
|
+
name,
|
|
46
|
+
kind,
|
|
47
|
+
sourceFile: path.relative(appDir, file),
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return entries.sort((a, b) => a.name.localeCompare(b.name));
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=parse-registrations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-registrations.js","sourceRoot":"","sources":["../../src/editor-pack/parse-registrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAQlC,MAAM,eAAe,GAA2D;IAC9E,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,4DAA4D,EAAE;IAC5F,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,6DAA6D,EAAE;IAC9F;QACE,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,yEAAyE;KACnF;CACF,CAAC;AAEF,SAAS,YAAY,CAAC,GAAW,EAAE,OAAiB;IAClD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,EAAE,CAAC,WAAW,CA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AAC,GAAG,CAAC,GAAG,CAAC;oBAAE,SAAS;gBAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;gBACd,OAAO,CAAC,IAAI,CAAC;oBACX,IAAI;oBACJ,IAAI;oBACJ,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;iBACxC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,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 `.mcpb` extension) or local stdio MCP.\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- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\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## 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_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\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\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\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## 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\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{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 extension 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\", \"/\"]`.\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 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop \u2192 Settings \u2192 Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\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\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\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`, `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 `.mcpb` extension) or local stdio MCP.\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- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\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/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\n**Workflow:** read `cms-edit://customer/index` \u2192 `overview` \u2192 `routing` \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_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_from_doc` | Create a page from a freeform document (infer \u2192 confirm \u2192 dry-run) |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\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\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\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## 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\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{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 extension 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\", \"/\"]`.\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 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop \u2192 Settings \u2192 Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\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\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\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`, `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,g4OAA8vO,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 `.mcpb` extension) or local stdio MCP.\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- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\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## 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_index_sync` | Build/refresh local index (assets, media, templates, taxonomy) |\n| `cms_edit_create_page` | Create a page with template selection |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\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\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\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## 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\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{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 extension 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\", \"/\"]`.\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 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop → Settings → Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\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\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\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 …`, `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 `.mcpb` extension) or local stdio MCP.\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- Upload new assets (use Contentful UI for assets)\n\nAll `save` operations create **drafts only**. A human must review and publish in Contentful.\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/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\n**Workflow:** read `cms-edit://customer/index` → `overview` → `routing` → `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_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_from_doc` | Create a page from a freeform document (infer → confirm → dry-run) |\n| `cms_edit_taxonomy` | Import or ensure taxonomy entries |\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\", \"/\"]\n[\"open\", \"/pricing\"]\n[\"open\", \"<entry-id>\", \"--id\"]\n```\n\nHomepage slug is `/` (or `index` depending on the site).\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## 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\", \"/\"]\n[\"snapshot\"]\n[\"read\", \"@c1\"]\n```\n\n### Edit copy on a page\n\n```\n[\"open\", \"{{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 extension 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\", \"/\"]`.\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 / invalid token** | Regenerate CMA token in Contentful; update token in Claude Desktop → Settings → Extensions |\n| **No cms_edit tool** | Quit Claude fully and reopen; confirm extension is enabled |\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\", \"/\"]`. Fallback: `[\"read\", \"<entry-id>\", \"--id\"]` |\n| **Wrong space** | Token must belong to this deployment's Contentful space |\n| **Check version** | Call `cms_edit_version` or `curl /api/health` and read `cmsEdit` |\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 …`, `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,2vOAA2vO,CAAC"}
|
package/dist/hosted/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { CmsEditProcessExit, type RunCmsEditArgsResult, runCmsEditArgs } from '.
|
|
|
2
2
|
export { assertPatSpaceAccess, buildHostedConfig, buildHostedSpaceConfig, extractBearerToken, type HostedDeploymentConfig, loadHostedDeploymentFromEnv, type ValidatePatResult, validateContentfulPat, validatePatForDeployment, } from '../config/hosted.js';
|
|
3
3
|
export type { CmsEditConfig, SpaceConfig } from '../config/types.js';
|
|
4
4
|
export { createSafeEnvironment } from '../contentful/client.js';
|
|
5
|
+
export { CUSTOMER_RESOURCE_URI_PREFIX, getEditorPackResource, listEditorPackResources, loadEditorPackManifest, resolveEditorPackPath, } from '../editor-pack/load.js';
|
|
5
6
|
export { GETTING_STARTED_INFO, GUIDE_RESOURCE_URI, type HostedMcpInfo } from '../mcp/guide.js';
|
|
6
7
|
export { type HostedMcpHandlerOptions, handleHostedMcpRequest } from '../mcp/http-handler.js';
|
|
7
8
|
export { type CreateMcpServerOptions, createMcpServer, runCmsEditInProcess, } from '../mcp/server.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hosted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,sBAAsB,EAC3B,2BAA2B,EAC3B,KAAK,iBAAiB,EACtB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC/F,OAAO,EAAE,KAAK,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EACL,KAAK,sBAAsB,EAC3B,eAAe,EACf,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,cAAc,EACd,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uB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AO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,kBAAkB,EACvB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
package/dist/hosted/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { CmsEditProcessExit, runCmsEditArgs } from '../cli/runner.js';
|
|
2
2
|
export { assertPatSpaceAccess, buildHostedConfig, buildHostedSpaceConfig, extractBearerToken, loadHostedDeploymentFromEnv, validateContentfulPat, validatePatForDeployment, } from '../config/hosted.js';
|
|
3
3
|
export { createSafeEnvironment } from '../contentful/client.js';
|
|
4
|
+
export { CUSTOMER_RESOURCE_URI_PREFIX, getEditorPackResource, listEditorPackResources, loadEditorPackManifest, resolveEditorPackPath, } from '../editor-pack/load.js';
|
|
4
5
|
export { GETTING_STARTED_INFO, GUIDE_RESOURCE_URI } from '../mcp/guide.js';
|
|
5
6
|
export { handleHostedMcpRequest } from '../mcp/http-handler.js';
|
|
6
7
|
export { createMcpServer, runCmsEditInProcess, } from '../mcp/server.js';
|
package/dist/hosted/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hosted/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA6B,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,sBAAsB,EACtB,kBAAkB,EAElB,2BAA2B,EAE3B,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EA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EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EACL,eAAe,GAGhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAEhB,cAAc,GACf,MAAM,eAAe,CAAC"}
|
package/dist/mcp/guide.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export interface HostedMcpInfo {
|
|
|
6
6
|
export type GuideTopic = 'overview' | 'workflow' | 'commands' | 'troubleshooting' | 'hosted';
|
|
7
7
|
export declare const GUIDE_TOPICS: GuideTopic[];
|
|
8
8
|
export declare const GUIDE_RESOURCE_URI = "cms-edit://guide";
|
|
9
|
-
export declare const ONBOARDING_PROMPTS: readonly ["cms_edit_verify", "cms_edit_explore", "cms_edit_edit_page", "cms_edit_index_sync", "cms_edit_create_page", "cms_edit_taxonomy"];
|
|
9
|
+
export declare const ONBOARDING_PROMPTS: readonly ["cms_edit_verify", "cms_edit_explore", "cms_edit_edit_page", "cms_edit_index_sync", "cms_edit_create_page", "cms_edit_create_from_doc", "cms_edit_taxonomy"];
|
|
10
10
|
export declare const GETTING_STARTED_INFO: {
|
|
11
11
|
readonly resourceUri: "cms-edit://guide";
|
|
12
|
-
readonly prompts: readonly ["cms_edit_verify", "cms_edit_explore", "cms_edit_edit_page", "cms_edit_index_sync", "cms_edit_create_page", "cms_edit_taxonomy"];
|
|
12
|
+
readonly prompts: readonly ["cms_edit_verify", "cms_edit_explore", "cms_edit_edit_page", "cms_edit_index_sync", "cms_edit_create_page", "cms_edit_create_from_doc", "cms_edit_taxonomy"];
|
|
13
13
|
readonly helpTool: "cms_edit_help";
|
|
14
14
|
};
|
|
15
15
|
export declare function loadHostedGuideTemplate(): string;
|
package/dist/mcp/guide.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guide.d.ts","sourceRoot":"","sources":["../../src/m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1D"}
|
package/dist/mcp/guide.js
CHANGED
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;CACT,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,iBAAiB;IACjB,kBAAkB;IAClB,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,mBAAmB;CACX,CAAC;AAEX,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,CAAC,GAAG,kBAAkB,CAAC;IAChC,QAAQ,EAAE,eAAe;CACjB,CAAC;AAEX,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AAEhD,MAAM,cAAc,GAAoD;IACtE,QAAQ,EAAE,kBAAkB;IAC5B,QAAQ,EAAE,sCAAsC;IAChD,eAAe,EAAE,oBAAoB;IACrC,MAAM,EAAE,2BAA2B;CACpC,CAAC;AAEF,MAAM,UAAU,uBAAuB;IACrC,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAED,SAAS,cAAc,CAAC,MAAsB;IAC5C,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC;QACzD,OAAO,CACL,uCAAuC,QAAQ,qBAAqB,MAAM,CAAC,UAAU,OAAO;YAC5F,qGAAqG,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,CACL,kGAAkG;QAClG,2CAA2C,CAC5C,CAAC;AACJ,CAA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Options {
|
|
|
5
5
|
resolveContext: (request: Request) => Promise<CmsEditRuntimeContext>;
|
|
6
6
|
/** Optional deployment info for guide/prompt interpolation. */
|
|
7
7
|
getMcpInfo?: () => HostedMcpInfo | undefined;
|
|
8
|
+
/** Path to generated editor-pack/ for cms-edit://customer/* resources. */
|
|
9
|
+
editorPackPath?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Handles a Streamable HTTP MCP request in stateless mode (suitable for Vercel serverless).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-handler.d.ts","sourceRoot":"","sources":["../../src/mcp/http-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACtC,sFAAsF;IACtF,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrE,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"http-handler.d.ts","sourceRoot":"","sources":["../../src/mcp/http-handler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,MAAM,WAAW,uBAAuB;IACtC,sFAAsF;IACtF,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACrE,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;IAC7C,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAOD;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CA0BnB"}
|
package/dist/mcp/http-handler.js
CHANGED
|
@@ -23,7 +23,11 @@ export async function handleHostedMcpRequest(request, options) {
|
|
|
23
23
|
return defaultRunCmsEdit(args);
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
const server = createMcpServer({
|
|
26
|
+
const server = createMcpServer({
|
|
27
|
+
runCmsEdit,
|
|
28
|
+
hosted: options.getMcpInfo?.(),
|
|
29
|
+
editorPackPath: options.editorPackPath,
|
|
30
|
+
});
|
|
27
31
|
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
28
32
|
sessionIdGenerator: undefined,
|
|
29
33
|
enableJsonResponse: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-handler.js","sourceRoot":"","sources":["../../src/mcp/http-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"http-handler.js","sourceRoot":"","sources":["../../src/mcp/http-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAW9C,KAAK,UAAU,iBAAiB,CAAC,IAAc;IAC7C,MAAM,EAAE,QAAQ,EA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ceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAajD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,aAAa,GAAG,IAAI,CA6MzF"}
|
|
@@ -37,7 +37,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
37
37
|
text: `${note}\n\n` +
|
|
38
38
|
'Explore this Contentful site:\n' +
|
|
39
39
|
'1. cms_edit ["sitemap"] — list pages\n' +
|
|
40
|
-
`2. cms_edit ["open", "${targetSlug}"] — load the page\n` +
|
|
40
|
+
`2. cms_edit ["open", "--page-slug", "${targetSlug}"] — load the page\n` +
|
|
41
41
|
'3. cms_edit ["snapshot"] — show @ref tree\n' +
|
|
42
42
|
'4. Summarize what you found',
|
|
43
43
|
},
|
|
@@ -61,7 +61,7 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
61
61
|
text: `${note}\n\n` +
|
|
62
62
|
`${editLine}` +
|
|
63
63
|
`Edit page "${slug}":\n` +
|
|
64
|
-
`1. cms_edit ["open", "${slug}"]\n` +
|
|
64
|
+
`1. cms_edit ["open", "--page-slug", "${slug}"]\n` +
|
|
65
65
|
'2. cms_edit ["snapshot"] — find @refs\n' +
|
|
66
66
|
'3. cms_edit ["read", "@cN", "field"] — inspect fields\n' +
|
|
67
67
|
'4. cms_edit ["set", ...] or ["rtf", ..., "--content", "..."] — make changes\n' +
|
|
@@ -134,5 +134,36 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
134
134
|
],
|
|
135
135
|
};
|
|
136
136
|
});
|
|
137
|
+
server.prompt('cms_edit_create_from_doc', 'Create a new page from a freeform document (e.g. Google Doc): infer structure, confirm, dry-run, create.', {
|
|
138
|
+
slug: z.string().describe('Page slug, e.g. /solutions/hepatology'),
|
|
139
|
+
title: z.string().optional().describe('Page title if known'),
|
|
140
|
+
docSummary: z
|
|
141
|
+
.string()
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('Document content or summary from Google Drive MCP'),
|
|
144
|
+
}, async ({ slug, title, docSummary }) => {
|
|
145
|
+
const docLine = docSummary
|
|
146
|
+
? `Document content:\n${docSummary}\n`
|
|
147
|
+
: 'Fetch the document via Google Drive MCP if the user provided a link.\n';
|
|
148
|
+
const titleLine = title ? `Title: ${title}\n` : '';
|
|
149
|
+
return {
|
|
150
|
+
messages: [
|
|
151
|
+
{
|
|
152
|
+
role: 'user',
|
|
153
|
+
content: {
|
|
154
|
+
type: 'text',
|
|
155
|
+
text: `${note}\n\n` +
|
|
156
|
+
`Create page at slug "${slug}" from a freeform document.\n` +
|
|
157
|
+
`${titleLine}${docLine}\n` +
|
|
158
|
+
'1. Read cms-edit://customer/index, overview, routing, components-index\n' +
|
|
159
|
+
'2. Infer page structure: map sections to component types using components-index\n' +
|
|
160
|
+
'3. Propose a plain-English page plan (slug, title, template, components) — ask user to confirm\n' +
|
|
161
|
+
'4. Build create-from-json payload; run cms_edit ["create", "from-json", "--file", "<path>", "--dry-run", "--strict"]\n' +
|
|
162
|
+
'5. On approval, create and save draft; remind user to publish in Contentful',
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
});
|
|
137
168
|
}
|
|
138
169
|
//# sourceMappingURL=onboarding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-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EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;QAClE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAC5D,UAAU,EAAE,CAAC;aACV,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,mDAAmD,CAAC;KACjE,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE;QACpC,MAAM,OAAO,GAAG,UAAU;YACxB,CAAC,CAAC,sBAAsB,UAAU,IAAI;YACtC,CAAC,CAAC,wEAAwE,CAAC;QAC7E,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,OAAO;YACL,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,MAAe;oBACrB,OAAO,EAAE;wBACP,IAAI,EAAE,MAAe;wBACrB,IAAI,EACF,GAAG,IAAI,MAAM;4BACb,wBAAwB,IAAI,+BAA+B;4BAC3D,GAAG,SAAS,GAAG,OAAO,IAAI;4BAC1B,0EAA0E;4BAC1E,mFAAmF;4BACnF,kGAAkG;4BAClG,wHAAwH;4BACxH,6EAA6E;qBAChF;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
export interface CustomerResourceOptions {
|
|
3
|
+
editorPackPath?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function registerCustomerResources(server: McpServer, options?: CustomerResourceOptions): void;
|
|
6
|
+
export declare function readCustomerResourceText(resourceName: string, options?: CustomerResourceOptions): string | null;
|
|
7
|
+
//# sourceMappingURL=customer.d.ts.map
|