fastmode-mcp 1.0.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/README.md +561 -0
- package/bin/run.js +50 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +802 -0
- package/dist/lib/api-client.d.ts +81 -0
- package/dist/lib/api-client.d.ts.map +1 -0
- package/dist/lib/api-client.js +237 -0
- package/dist/lib/auth-state.d.ts +13 -0
- package/dist/lib/auth-state.d.ts.map +1 -0
- package/dist/lib/auth-state.js +24 -0
- package/dist/lib/context-fetcher.d.ts +67 -0
- package/dist/lib/context-fetcher.d.ts.map +1 -0
- package/dist/lib/context-fetcher.js +190 -0
- package/dist/lib/credentials.d.ts +52 -0
- package/dist/lib/credentials.d.ts.map +1 -0
- package/dist/lib/credentials.js +196 -0
- package/dist/lib/device-flow.d.ts +14 -0
- package/dist/lib/device-flow.d.ts.map +1 -0
- package/dist/lib/device-flow.js +244 -0
- package/dist/tools/cms-items.d.ts +56 -0
- package/dist/tools/cms-items.d.ts.map +1 -0
- package/dist/tools/cms-items.js +376 -0
- package/dist/tools/create-site.d.ts +9 -0
- package/dist/tools/create-site.d.ts.map +1 -0
- package/dist/tools/create-site.js +202 -0
- package/dist/tools/deploy-package.d.ts +9 -0
- package/dist/tools/deploy-package.d.ts.map +1 -0
- package/dist/tools/deploy-package.js +434 -0
- package/dist/tools/generate-samples.d.ts +19 -0
- package/dist/tools/generate-samples.d.ts.map +1 -0
- package/dist/tools/generate-samples.js +272 -0
- package/dist/tools/get-conversion-guide.d.ts +7 -0
- package/dist/tools/get-conversion-guide.d.ts.map +1 -0
- package/dist/tools/get-conversion-guide.js +1323 -0
- package/dist/tools/get-example.d.ts +7 -0
- package/dist/tools/get-example.d.ts.map +1 -0
- package/dist/tools/get-example.js +1568 -0
- package/dist/tools/get-field-types.d.ts +30 -0
- package/dist/tools/get-field-types.d.ts.map +1 -0
- package/dist/tools/get-field-types.js +154 -0
- package/dist/tools/get-schema.d.ts +5 -0
- package/dist/tools/get-schema.d.ts.map +1 -0
- package/dist/tools/get-schema.js +320 -0
- package/dist/tools/get-started.d.ts +21 -0
- package/dist/tools/get-started.d.ts.map +1 -0
- package/dist/tools/get-started.js +624 -0
- package/dist/tools/get-tenant-schema.d.ts +18 -0
- package/dist/tools/get-tenant-schema.d.ts.map +1 -0
- package/dist/tools/get-tenant-schema.js +158 -0
- package/dist/tools/list-projects.d.ts +5 -0
- package/dist/tools/list-projects.d.ts.map +1 -0
- package/dist/tools/list-projects.js +101 -0
- package/dist/tools/sync-schema.d.ts +41 -0
- package/dist/tools/sync-schema.d.ts.map +1 -0
- package/dist/tools/sync-schema.js +483 -0
- package/dist/tools/validate-manifest.d.ts +5 -0
- package/dist/tools/validate-manifest.d.ts.map +1 -0
- package/dist/tools/validate-manifest.js +311 -0
- package/dist/tools/validate-package.d.ts +5 -0
- package/dist/tools/validate-package.d.ts.map +1 -0
- package/dist/tools/validate-package.js +337 -0
- package/dist/tools/validate-template.d.ts +12 -0
- package/dist/tools/validate-template.d.ts.map +1 -0
- package/dist/tools/validate-template.js +790 -0
- package/package.json +54 -0
- package/scripts/postinstall.js +129 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get Available Field Types Tool
|
|
3
|
+
*
|
|
4
|
+
* Returns the list of field types that can be used when CREATING new fields
|
|
5
|
+
* in collections. This is NOT the list of fields in your schema - use
|
|
6
|
+
* get_tenant_schema for that.
|
|
7
|
+
*
|
|
8
|
+
* No authentication required.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Field type definition
|
|
12
|
+
*/
|
|
13
|
+
export interface FieldType {
|
|
14
|
+
value: string;
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
requiresOptions?: boolean;
|
|
18
|
+
requiresReferenceCollection?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Available field types for creating custom fields
|
|
22
|
+
* This matches the API's supported field types
|
|
23
|
+
*/
|
|
24
|
+
export declare const AVAILABLE_FIELD_TYPES: FieldType[];
|
|
25
|
+
/**
|
|
26
|
+
* Returns the list of available field types for creating fields.
|
|
27
|
+
* No authentication required.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getFieldTypes(): Promise<string>;
|
|
30
|
+
//# sourceMappingURL=get-field-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-field-types.d.ts","sourceRoot":"","sources":["../../src/tools/get-field-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,SAAS,EA+E5C,CAAC;AAEF;;;GAGG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAqDrD"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Get Available Field Types Tool
|
|
4
|
+
*
|
|
5
|
+
* Returns the list of field types that can be used when CREATING new fields
|
|
6
|
+
* in collections. This is NOT the list of fields in your schema - use
|
|
7
|
+
* get_tenant_schema for that.
|
|
8
|
+
*
|
|
9
|
+
* No authentication required.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AVAILABLE_FIELD_TYPES = void 0;
|
|
13
|
+
exports.getFieldTypes = getFieldTypes;
|
|
14
|
+
/**
|
|
15
|
+
* Available field types for creating custom fields
|
|
16
|
+
* This matches the API's supported field types
|
|
17
|
+
*/
|
|
18
|
+
exports.AVAILABLE_FIELD_TYPES = [
|
|
19
|
+
{
|
|
20
|
+
value: 'text',
|
|
21
|
+
label: 'Text',
|
|
22
|
+
description: 'Single line text field. Use for titles, names, short descriptions.'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
value: 'textarea',
|
|
26
|
+
label: 'Textarea',
|
|
27
|
+
description: 'Multi-line plain text. No formatting or paragraphs, just more space for longer text entries like summaries or excerpts.'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
value: 'richText',
|
|
31
|
+
label: 'Rich Text',
|
|
32
|
+
description: 'Multi-line formatted text (HTML). Use for body content, descriptions with formatting. Use {{{fieldName}}} in templates (triple braces for unescaped HTML).'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: 'number',
|
|
36
|
+
label: 'Number',
|
|
37
|
+
description: 'Numeric value. Use for prices, quantities, order numbers.'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: 'boolean',
|
|
41
|
+
label: 'Boolean',
|
|
42
|
+
description: 'True/False toggle. Use for featured flags, visibility toggles.'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
value: 'date',
|
|
46
|
+
label: 'Date',
|
|
47
|
+
description: 'Date picker (date only). Use for publication dates, event dates.'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
value: 'datetime',
|
|
51
|
+
label: 'Date & Time',
|
|
52
|
+
description: 'Date and time picker. Use when you need both date and time.'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
value: 'image',
|
|
56
|
+
label: 'Image',
|
|
57
|
+
description: 'Image file or URL. Supports direct file uploads to storage. Use for photos, thumbnails, hero images.'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
value: 'file',
|
|
61
|
+
label: 'File',
|
|
62
|
+
description: 'Downloadable file (PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, ZIP, MP3, MP4, etc.). Max 10MB. Use in templates as a download link: <a href="{{field}}" download>Download</a>'
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
value: 'url',
|
|
66
|
+
label: 'URL',
|
|
67
|
+
description: 'Web link. Use for external links, social media URLs.'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
value: 'videoEmbed',
|
|
71
|
+
label: 'Video Embed',
|
|
72
|
+
description: 'YouTube, Vimeo, Wistia, or Loom URL. Use {{#videoEmbed fieldName}}{{/videoEmbed}} helper in templates for responsive iframes.'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
value: 'email',
|
|
76
|
+
label: 'Email',
|
|
77
|
+
description: 'Email address field with validation.'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
value: 'select',
|
|
81
|
+
label: 'Select',
|
|
82
|
+
description: 'Dropdown with predefined options. Requires "options" parameter: comma-separated string like "Option1, Option2, Option3".',
|
|
83
|
+
requiresOptions: true,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
value: 'multiSelect',
|
|
87
|
+
label: 'Multi-Select',
|
|
88
|
+
description: 'Multiple selections from options. Requires "options" parameter: comma-separated string like "Tag1, Tag2, Tag3".',
|
|
89
|
+
requiresOptions: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
value: 'relation',
|
|
93
|
+
label: 'Relation',
|
|
94
|
+
description: 'Link to another collection item. Requires "referenceCollection" parameter with the collection slug. Only for custom collections.',
|
|
95
|
+
requiresReferenceCollection: true,
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
/**
|
|
99
|
+
* Returns the list of available field types for creating fields.
|
|
100
|
+
* No authentication required.
|
|
101
|
+
*/
|
|
102
|
+
async function getFieldTypes() {
|
|
103
|
+
const typeList = exports.AVAILABLE_FIELD_TYPES.map(ft => {
|
|
104
|
+
let entry = `- **${ft.value}** (${ft.label}): ${ft.description}`;
|
|
105
|
+
if (ft.requiresOptions) {
|
|
106
|
+
entry += '\n - ⚠️ Requires `options` parameter (comma-separated values)';
|
|
107
|
+
}
|
|
108
|
+
if (ft.requiresReferenceCollection) {
|
|
109
|
+
entry += '\n - ⚠️ Requires `referenceCollection` parameter (collection slug)';
|
|
110
|
+
}
|
|
111
|
+
return entry;
|
|
112
|
+
}).join('\n');
|
|
113
|
+
return `# Available Field Types
|
|
114
|
+
|
|
115
|
+
These are the field types you can use when CREATING new fields with the \`sync_schema\` tool.
|
|
116
|
+
|
|
117
|
+
**Note:** This is NOT the list of fields in your schema. Use \`get_tenant_schema\` to see a specific project's schema.
|
|
118
|
+
|
|
119
|
+
## Field Types
|
|
120
|
+
|
|
121
|
+
${typeList}
|
|
122
|
+
|
|
123
|
+
## Usage Example
|
|
124
|
+
|
|
125
|
+
When calling \`sync_schema\` to add fields, specify the \`type\` parameter:
|
|
126
|
+
|
|
127
|
+
\`\`\`json
|
|
128
|
+
{
|
|
129
|
+
"fieldsToAdd": [
|
|
130
|
+
{
|
|
131
|
+
"collectionSlug": "posts",
|
|
132
|
+
"fields": [
|
|
133
|
+
{ "slug": "heroImage", "name": "Hero Image", "type": "image" },
|
|
134
|
+
{ "slug": "featured", "name": "Featured", "type": "boolean" },
|
|
135
|
+
{ "slug": "category", "name": "Category", "type": "select", "options": "Tech, Business, Lifestyle" },
|
|
136
|
+
{ "slug": "tags", "name": "Tags", "type": "multiSelect", "options": "Featured, Popular, New, Sale" },
|
|
137
|
+
{ "slug": "author", "name": "Author", "type": "relation", "referenceCollection": "authors" }
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
## Select/MultiSelect Options Format
|
|
145
|
+
|
|
146
|
+
For **select** and **multiSelect** fields, provide options as a comma-separated string:
|
|
147
|
+
|
|
148
|
+
✅ CORRECT: \`"options": "Red, Green, Blue"\`
|
|
149
|
+
✅ CORRECT: \`"options": "Option1,Option2,Option3"\`
|
|
150
|
+
|
|
151
|
+
❌ WRONG: \`"options": ["Red", "Green", "Blue"]\` (Don't use JSON array)
|
|
152
|
+
❌ WRONG: \`"options": "\\"Red,Green,Blue\\""\` (Don't wrap in extra quotes)
|
|
153
|
+
`;
|
|
154
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-schema.d.ts","sourceRoot":"","sources":["../../src/tools/get-schema.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAyTjD"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSchema = getSchema;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the complete CMS schema reference for custom collections
|
|
6
|
+
*/
|
|
7
|
+
async function getSchema() {
|
|
8
|
+
return `# CMS Schema Reference
|
|
9
|
+
|
|
10
|
+
## Collections Overview
|
|
11
|
+
|
|
12
|
+
All CMS content is managed through **custom collections**. Collections are content types you define (e.g., Blog Posts, Team Members, Services, Products) with custom fields.
|
|
13
|
+
|
|
14
|
+
**To see the exact collections and fields for a specific project, use the \`get_tenant_schema\` tool.**
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Collection Templates
|
|
19
|
+
|
|
20
|
+
When creating a new collection, you can start from a **template** that pre-configures common field sets:
|
|
21
|
+
|
|
22
|
+
- **Blog Posts** - Articles with images, summary, body, author reference
|
|
23
|
+
- **Authors** - Content creators with bio, photo, social links
|
|
24
|
+
- **Team Members** - Staff profiles with role, photo, bio
|
|
25
|
+
- **Downloads** - Downloadable files with description and category
|
|
26
|
+
- **FAQs** - Question and answer pairs
|
|
27
|
+
- **Products** - Items with price, description, images
|
|
28
|
+
|
|
29
|
+
Templates are just starting points - you can customize fields after creation.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Token Syntax
|
|
34
|
+
|
|
35
|
+
### Basic Tokens
|
|
36
|
+
\`\`\`html
|
|
37
|
+
{{fieldSlug}} <!-- For text, number, boolean, image, url, date, select -->
|
|
38
|
+
{{{fieldSlug}}} <!-- For richText fields (MUST use triple braces) -->
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
### Built-in Tokens (Available on ALL items)
|
|
42
|
+
- \`{{name}}\` - Item name/title (REQUIRED - every item has a name)
|
|
43
|
+
- \`{{slug}}\` - Item URL slug (if collection has detail pages)
|
|
44
|
+
- \`{{url}}\` - Full item URL (e.g., /services/my-service)
|
|
45
|
+
|
|
46
|
+
### Date Tokens (Automatically tracked)
|
|
47
|
+
- \`{{createdAt}}\` - When the item was first created
|
|
48
|
+
- \`{{publishedAt}}\` - When the item was published (empty for drafts)
|
|
49
|
+
- \`{{updatedAt}}\` - When the item was last updated
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Loop Syntax
|
|
54
|
+
|
|
55
|
+
### Basic Loop
|
|
56
|
+
\`\`\`html
|
|
57
|
+
{{#each collectionSlug}}
|
|
58
|
+
<article>
|
|
59
|
+
<h2>{{name}}</h2>
|
|
60
|
+
</article>
|
|
61
|
+
{{/each}}
|
|
62
|
+
\`\`\`
|
|
63
|
+
|
|
64
|
+
### Loop Modifiers
|
|
65
|
+
- \`limit=N\` - Limit to N items
|
|
66
|
+
- \`featured=true\` - Only featured items (if collection has a boolean "featured" field)
|
|
67
|
+
- \`sort="fieldName"\` - Sort by field
|
|
68
|
+
- \`order="asc|desc"\` - Sort direction
|
|
69
|
+
|
|
70
|
+
\`\`\`html
|
|
71
|
+
{{#each posts limit=6 sort="publishedAt" order="desc"}}
|
|
72
|
+
<article>{{name}}</article>
|
|
73
|
+
{{/each}}
|
|
74
|
+
\`\`\`
|
|
75
|
+
|
|
76
|
+
### Loop Variables
|
|
77
|
+
Inside \`{{#each}}\` blocks:
|
|
78
|
+
- \`{{@first}}\` - true for first item
|
|
79
|
+
- \`{{@last}}\` - true for last item
|
|
80
|
+
- \`{{@index}}\` - zero-based index
|
|
81
|
+
|
|
82
|
+
\`\`\`html
|
|
83
|
+
{{#each services limit=3}}
|
|
84
|
+
<div class="{{#if @first}}featured{{/if}}">
|
|
85
|
+
{{name}}
|
|
86
|
+
</div>
|
|
87
|
+
{{/each}}
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Conditionals
|
|
93
|
+
|
|
94
|
+
### Check if field has value
|
|
95
|
+
\`\`\`html
|
|
96
|
+
{{#if image}}
|
|
97
|
+
<img src="{{image}}" alt="{{name}}">
|
|
98
|
+
{{else}}
|
|
99
|
+
<div class="placeholder"></div>
|
|
100
|
+
{{/if}}
|
|
101
|
+
|
|
102
|
+
{{#unless featured}}
|
|
103
|
+
<span>Regular item</span>
|
|
104
|
+
{{/unless}}
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
### Collection Empty Checks
|
|
108
|
+
\`\`\`html
|
|
109
|
+
{{#each posts}}
|
|
110
|
+
<article>{{name}}</article>
|
|
111
|
+
{{/each}}
|
|
112
|
+
|
|
113
|
+
{{#unless posts}}
|
|
114
|
+
<p>No posts yet. Check back soon!</p>
|
|
115
|
+
{{/unless}}
|
|
116
|
+
\`\`\`
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Equality Comparisons
|
|
121
|
+
|
|
122
|
+
Compare field values using the \`(eq field1 field2)\` helper:
|
|
123
|
+
|
|
124
|
+
\`\`\`html
|
|
125
|
+
<!-- Show content when fields ARE equal -->
|
|
126
|
+
{{#if (eq category.slug ../slug)}}
|
|
127
|
+
<span>Current category</span>
|
|
128
|
+
{{/if}}
|
|
129
|
+
|
|
130
|
+
<!-- Show content when fields are NOT equal (exclude current) -->
|
|
131
|
+
{{#unless (eq slug ../slug)}}
|
|
132
|
+
<a href="{{url}}">{{name}}</a>
|
|
133
|
+
{{/unless}}
|
|
134
|
+
\`\`\`
|
|
135
|
+
|
|
136
|
+
### Related Items Pattern (Exclude Current)
|
|
137
|
+
\`\`\`html
|
|
138
|
+
<h3>Other Posts</h3>
|
|
139
|
+
{{#each posts limit=3}}
|
|
140
|
+
{{#unless (eq slug ../slug)}}
|
|
141
|
+
<article>
|
|
142
|
+
<a href="{{url}}">{{name}}</a>
|
|
143
|
+
</article>
|
|
144
|
+
{{/unless}}
|
|
145
|
+
{{/each}}
|
|
146
|
+
\`\`\`
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Parent Context References
|
|
151
|
+
|
|
152
|
+
Inside loops, access the parent scope using \`../\`:
|
|
153
|
+
|
|
154
|
+
\`\`\`html
|
|
155
|
+
<!-- On author detail page, show only posts by THIS author -->
|
|
156
|
+
{{#each posts}}
|
|
157
|
+
{{#if (eq author.name ../name)}}
|
|
158
|
+
<h3>{{name}}</h3>
|
|
159
|
+
{{/if}}
|
|
160
|
+
{{/each}}
|
|
161
|
+
\`\`\`
|
|
162
|
+
|
|
163
|
+
- \`../name\` - Parent item's name field
|
|
164
|
+
- \`../slug\` - Parent item's slug
|
|
165
|
+
- \`../fieldName\` - Any field from the parent scope
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Relation Fields
|
|
170
|
+
|
|
171
|
+
Link items from one collection to another. Access related item data using dot notation:
|
|
172
|
+
|
|
173
|
+
\`\`\`html
|
|
174
|
+
{{#each projects}}
|
|
175
|
+
<article>
|
|
176
|
+
<h2>{{name}}</h2>
|
|
177
|
+
{{#if category}}
|
|
178
|
+
<span class="tag">{{category.name}}</span>
|
|
179
|
+
<a href="{{category.url}}">View all {{category.name}}</a>
|
|
180
|
+
{{/if}}
|
|
181
|
+
</article>
|
|
182
|
+
{{/each}}
|
|
183
|
+
\`\`\`
|
|
184
|
+
|
|
185
|
+
**Available tokens for related items:**
|
|
186
|
+
- \`{{relationField.name}}\` - Related item's name
|
|
187
|
+
- \`{{relationField.slug}}\` - Related item's slug
|
|
188
|
+
- \`{{relationField.url}}\` - Related item's full URL
|
|
189
|
+
- \`{{relationField.anyField}}\` - Any field from the related collection
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## Rich Text (Triple Braces)
|
|
194
|
+
|
|
195
|
+
For HTML content that should NOT be escaped:
|
|
196
|
+
\`\`\`html
|
|
197
|
+
{{{description}}} ✓ Correct - renders HTML
|
|
198
|
+
{{description}} ✗ Wrong - escapes HTML as text
|
|
199
|
+
\`\`\`
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Important Rules
|
|
204
|
+
|
|
205
|
+
1. **Triple braces for richText fields** - \`{{{body}}}\`, \`{{{bio}}}\`
|
|
206
|
+
2. **Double braces for everything else** - \`{{name}}\`, \`{{image}}\`
|
|
207
|
+
3. **Always wrap optional fields in {{#if}}** - Check before rendering
|
|
208
|
+
4. **Use {{url}} for links** - Generates correct path based on manifest
|
|
209
|
+
5. **Match field slugs exactly** - Case-sensitive
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Image Handling
|
|
214
|
+
|
|
215
|
+
### Static UI Images (logos, icons)
|
|
216
|
+
\`\`\`html
|
|
217
|
+
<img src="/public/images/logo.png" alt="Logo">
|
|
218
|
+
\`\`\`
|
|
219
|
+
|
|
220
|
+
### CMS Content Images
|
|
221
|
+
\`\`\`html
|
|
222
|
+
{{#if heroImage}}
|
|
223
|
+
<img src="{{heroImage}}" alt="{{name}}">
|
|
224
|
+
{{/if}}
|
|
225
|
+
\`\`\`
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## CMS Template Configuration
|
|
230
|
+
|
|
231
|
+
Configure templates in manifest.json:
|
|
232
|
+
|
|
233
|
+
\`\`\`json
|
|
234
|
+
{
|
|
235
|
+
"cmsTemplates": {
|
|
236
|
+
"postsIndex": "pages/blog.html",
|
|
237
|
+
"postsIndexPath": "/blog",
|
|
238
|
+
"postsDetail": "templates/blog-post.html",
|
|
239
|
+
"postsDetailPath": "/blog",
|
|
240
|
+
|
|
241
|
+
"servicesIndex": "pages/services.html",
|
|
242
|
+
"servicesIndexPath": "/services",
|
|
243
|
+
"servicesDetail": "templates/service-detail.html",
|
|
244
|
+
"servicesDetailPath": "/services"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
\`\`\`
|
|
248
|
+
|
|
249
|
+
### Template Keys Pattern
|
|
250
|
+
- **{collectionSlug}Index** - Template file for listing page
|
|
251
|
+
- **{collectionSlug}IndexPath** - URL path for listing page
|
|
252
|
+
- **{collectionSlug}Detail** - Template file for detail page
|
|
253
|
+
- **{collectionSlug}DetailPath** - URL base for detail pages
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Form Handling
|
|
258
|
+
|
|
259
|
+
Forms are automatically captured and stored in the CMS.
|
|
260
|
+
|
|
261
|
+
\`\`\`html
|
|
262
|
+
<form data-form-name="contact">
|
|
263
|
+
<input type="text" name="firstName" required>
|
|
264
|
+
<input type="email" name="email" required>
|
|
265
|
+
<textarea name="message"></textarea>
|
|
266
|
+
<button type="submit">Send</button>
|
|
267
|
+
</form>
|
|
268
|
+
\`\`\`
|
|
269
|
+
|
|
270
|
+
### Form Handler Script
|
|
271
|
+
\`\`\`javascript
|
|
272
|
+
document.querySelectorAll('form[data-form-name]').forEach(form => {
|
|
273
|
+
form.addEventListener('submit', async (e) => {
|
|
274
|
+
e.preventDefault();
|
|
275
|
+
const formName = form.dataset.formName || 'general';
|
|
276
|
+
const formData = new FormData(form);
|
|
277
|
+
const data = Object.fromEntries(formData);
|
|
278
|
+
|
|
279
|
+
const response = await fetch('/_forms/' + formName, {
|
|
280
|
+
method: 'POST',
|
|
281
|
+
headers: { 'Content-Type': 'application/json' },
|
|
282
|
+
body: JSON.stringify(data)
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
if (response.ok) {
|
|
286
|
+
form.reset();
|
|
287
|
+
alert(form.dataset.successMessage || 'Thank you!');
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
\`\`\`
|
|
292
|
+
|
|
293
|
+
**CRITICAL:** Endpoint is \`/_forms/{formName}\` - NOT \`/api/forms/submit\`
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## SEO Template Tokens
|
|
298
|
+
|
|
299
|
+
For CMS detail pages, use tokens in SEO templates:
|
|
300
|
+
- \`{{name}}\` - Item name for title
|
|
301
|
+
- \`{{description}}\` or summary field - For meta description
|
|
302
|
+
- \`{{image}}\` field - For OG image
|
|
303
|
+
|
|
304
|
+
SEO templates are configured in the Fast Mode Editor.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Next Steps
|
|
309
|
+
|
|
310
|
+
**To see exact collections and fields for a specific project, use:**
|
|
311
|
+
\`\`\`
|
|
312
|
+
get_tenant_schema(projectId: "your-project-name-or-id")
|
|
313
|
+
\`\`\`
|
|
314
|
+
|
|
315
|
+
This will show you:
|
|
316
|
+
- All collections with their slugs
|
|
317
|
+
- All fields with their tokens, types, and descriptions
|
|
318
|
+
- Relation field targets
|
|
319
|
+
`;
|
|
320
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get Started Tool
|
|
3
|
+
*
|
|
4
|
+
* Intelligent entry point for the MCP server that performs:
|
|
5
|
+
* 1. State Detection - Understand project state automatically
|
|
6
|
+
* 2. Intent Inference - Determine what user wants to do
|
|
7
|
+
* 3. Guided Execution - Provide exact tool calls with real values
|
|
8
|
+
*/
|
|
9
|
+
export type Intent = 'explore' | 'add_content' | 'update_schema' | 'convert' | 'deploy';
|
|
10
|
+
export interface GetStartedInput {
|
|
11
|
+
intent?: Intent;
|
|
12
|
+
projectId?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Get Started - Intelligent entry point for the MCP server
|
|
16
|
+
*
|
|
17
|
+
* @param input.intent - What the user wants to do (explore, add_content, update_schema, convert, deploy)
|
|
18
|
+
* @param input.projectId - Specific project to get details for
|
|
19
|
+
*/
|
|
20
|
+
export declare function getStarted(input: GetStartedInput): Promise<string>;
|
|
21
|
+
//# sourceMappingURL=get-started.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-started.d.ts","sourceRoot":"","sources":["../../src/tools/get-started.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,eAAe,GAAG,SAAS,GAAG,QAAQ,CAAC;AAExF,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmjBD;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CA4FxE"}
|