@prenta/mcp-server 0.23.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 +583 -0
- package/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +44 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +1348 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +1019 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/instructions.d.ts +13 -0
- package/dist/instructions.d.ts.map +1 -0
- package/dist/instructions.js +61 -0
- package/dist/instructions.js.map +1 -0
- package/dist/navigation.d.ts +76 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +228 -0
- package/dist/navigation.js.map +1 -0
- package/dist/resources.d.ts +28 -0
- package/dist/resources.d.ts.map +1 -0
- package/dist/resources.js +88 -0
- package/dist/resources.js.map +1 -0
- package/dist/server.d.ts +25 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +90 -0
- package/dist/server.js.map +1 -0
- package/dist/tools.d.ts +25 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/tools.js +1920 -0
- package/dist/tools.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IACjC,MAAM,CAAQ;IACvB,YAAY,OAAe,EAAE,MAAc;QACzC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AAED,MAAM,OA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AAmB,CAAC,UAAkB,EAAE,EAAU,EAAE,UAAoB;QACtE,OAAO,IAAI,CAAC,OAAO,CACjB,MAAM,EACN,kBAAkB,kBAAkB,CAAC,UAAU,CAAC,IAAI,kBAAkB,CAAC,EAAE,CAAC,UAAU,EACpF,EAAE,UAAU,EAAE,CACf,CAAA;IACH,CAAC;IAED,oEAAoE;IACpE,iBAAiB,CAAC,UAAkB,EAAE,EAAU,EAAE,SAAiB;QACjE,OAAO,IAAI,CAAC,OAAO,CACjB,QAAQ,EACR,kBAAkB,kBAAkB,CAAC,UAAU,CAAC,IAAI,kBAAkB,CAAC,EAAE,CAAC,IAAI,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAC9G,CAAA;IACH,CAAC;IAED,2BAA2B;IAC3B,EAAE;IACF,wEAAwE;IACxE,wEAAwE;IACxE,uEAAuE;IACvE,sBAAsB;IAEtB;;;;OAIG;IACH,eAAe,CAAC,QAAgB;QAC9B,OAAO,IAAI,CAAC,OAAO,CAEhB,KAAK,EAAE,mBAAmB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAC9D,CAAC;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,QAAgB,EAAE,IAA4D;QAC7F,OAAO,IAAI,CAAC,OAAO,CAEhB,KAAK,EAAE,mBAAmB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;IACpE,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PrentaClient, type PrentaClientOptions } from './client.js';
|
|
2
|
+
export { buildTools, type McpTool } from './tools.js';
|
|
3
|
+
export { buildResources, AUTHORING_GUIDE, type McpResource } from './resources.js';
|
|
4
|
+
export { SERVER_INSTRUCTIONS } from './instructions.js';
|
|
5
|
+
export { createPrentaMcpServer, type CreateMcpServerOptions, type PrentaMcpServer, } from './server.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,UAAU,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EACL,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,GACrB,MAAM,aAAa,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PrentaClient } from './client.js';
|
|
2
|
+
export { buildTools } from './tools.js';
|
|
3
|
+
export { buildResources, AUTHORING_GUIDE } from './resources.js';
|
|
4
|
+
export { SERVER_INSTRUCTIONS } from './instructions.js';
|
|
5
|
+
export { createPrentaMcpServer, } from './server.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA4B,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,UAAU,EAAgB,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAoB,MAAM,gBAAgB,CAAA;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,EACL,qBAAqB,GAGtB,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-level onboarding guidance surfaced to the AI client during MCP
|
|
3
|
+
* `initialize` (the SDK returns this as `instructions`). Most MCP clients inject
|
|
4
|
+
* it into the model's system context, so this is the one place we can teach an
|
|
5
|
+
* agent how to drive Prenta CMS *before* it starts guessing from tool names.
|
|
6
|
+
*
|
|
7
|
+
* Keep it short and high-signal: the canonical workflow, the page-content
|
|
8
|
+
* contract, and the safety rails. Per-tool detail lives in each tool's
|
|
9
|
+
* `description`; live content-model detail lives in the MCP resources
|
|
10
|
+
* (`prenta://collections`, `prenta://section-types`).
|
|
11
|
+
*/
|
|
12
|
+
export declare const SERVER_INSTRUCTIONS = "You are connected to an Prenta CMS instance over MCP. You can author and manage real site content (pages, posts, media, forms, navigation, SEO) by calling the tools below. Everything you write goes through the CMS's audited, access-controlled API \u2014 treat it as production data.\n\n## Start here (discovery first)\n1. Call `health_check` once \u2014 a `degraded`/`unhealthy` status reveals operator config problems early.\n2. Call `list_collections` to learn what content types exist (slugs, labels, page-vs-post type, fields). Never assume a collection exists.\n3. Read the `prenta://collections` and `prenta://section-types` resources for the live content model and the building blocks of a page.\n\n## The page-content contract (important)\nA page is an ordered array of **sections** stored on the document's `sections` field. This is the canonical model the public renderer (`@prenta/sections-react`) reads. To build a page:\n1. `list_section_types` (optionally scoped `page`/`post`) \u2192 choose section types.\n2. `add_page_section` / `update_page_section` / `reorder_page_sections` to compose the page. The server seeds each type's registry defaults; you shallow-merge `content`/`settings`.\n3. `validate_section_content` before/after to catch unknown types or bad fields.\nPrefer the section tools over `generate_page`/`create_page_from_prompt` when you want predictable, canonical output \u2014 the prompt-driven page builder stores a richer `_layout` tree that is *compiled* to `sections` on save.\n\n**One owner per page.** A page authored via the section tools is yours to edit section-by-section. A page that has a `_layout` (built in the visual Page Builder, `create_page_from_prompt`, or `create_document` with a `layout`) is **builder-owned**: its `sections` are recompiled from the layout on every save, so the section write tools (`add_page_section` etc.) **refuse it with a 409**. You can still read its compiled `sections` via `get_document`. Don't fight a 409 by retrying \u2014 tell the user the page is builder-owned.\n\n## Authoring lifecycle\n- Documents have a status: `DRAFT`, `PUBLISHED`, `SCHEDULED`, `ARCHIVED`. `create_document` defaults to draft \u2014 set status explicitly or use `schedule_publish` to go live.\n- **Every image must go through the media library.** Use `upload_media` first \u2014 never reference `/public/`, `/images/`, or other static paths in section `imageUrl` fields. The CMS optimizes, tracks usage, and stores alt text on media records.\n- After uploading an image, call `generate_media_alt({ mediaId })` then `update_media({ id, alt })` to set WCAG-aligned alt text (vision model when configured).\n- For library-wide metadata backfills, prefer `bulk_update_media({ items })` (max 50 per call, per-id results) over looping `update_media`. Use `bulk_delete_media({ ids, confirm: true })` for cleanup batches.\n- `upload_media` is content-hash idempotent: re-uploading the same final bytes returns the existing row with `deduplicated: true` / `duplicateOf`. Pass `forceUpload: true` only when you intentionally want a second copy.\n- Use `resolve_url` to verify a published page renders at its public path.\n\n## Images & performance (build fast pages)\nThe renderer (`@prenta/sections-react`) does the Core Web Vitals heavy lifting for you \u2014 your job is to give it the right inputs:\n- **Pick a hero image for the LCP.** For a page's main banner, set the `hero` section's `imageUrl` (+ required `imageAlt`). The renderer marks **exactly one** image per page as the priority/eager LCP element and lazy-loads the rest. Don't expect to \"prioritise\" several above-the-fold images \u2014 only one wins, so put it on the hero (or the post's `featuredImage`).\n- **Always set alt text.** It's an accessibility requirement (a hero image without alt is rejected) and feeds SEO. Workflow: `generate_media_alt` \u2192 review \u2192 `update_media({ alt })`, or set `imageAlt` inline when inserting into a section.\n- **Don't hand-optimise content images.** `upload_media` compresses to **high-quality WebP** (quality 82, 86 for transparent PNGs), downscales beyond 4096px, and **keeps the original when WebP would be larger** \u2014 upload a full-resolution source and let the pipeline balance size vs fidelity. Only pass `skipOptimize: true` for brand logos/favicons. The public site also serves AVIF/WebP via `next/image` with responsive `sizes`.\n\n## Safety rails\n- Some tools require `confirm: true` and refuse otherwise: `delete_document`, `delete_media`, `bulk_delete_media`, `delete_form`, `delete_form_entry` (destructive \u2014 confirm with the user first, prefer archiving where available), `export_form_entries` (bulk PII egress), `seo_scan_run` (expensive site-wide scan), `apply_seo_issue_fix` (writes SEO metadata + resolves an issue), and `batch_generate_seo_content_briefs` (batch AI content briefs).\n- Your API key carries scopes. A `Forbidden` error means the key lacks a permission, not that the tool is broken \u2014 surface that to the user rather than retrying blindly.\n- Tool inputs are schema-validated; read each tool's `description` for the exact shape and the response envelope (most list tools return `{ docs, total, page, pageSize }`).\n\n## SEO audit fix workflow (via MCP)\n1. `run_seo_audit` or `list_seo_issues` \u2192 triage open issues.\n2. **Metadata fixes** (meta title/desc, canonical, schema): `suggest_seo_issue_fix` \u2192 review `suggestion.changes` \u2192 `apply_seo_issue_fix` with `fingerprint` + `confirm: true`.\n3. **Content fixes** (thin content, headings, alt text): `research_and_brief_seo_issue` (thin content + optional competitor URLs) or `generate_seo_issue_content_brief`. Briefs are suggestions only \u2014 implement in page content yourself (`add_page_section`, `update_document`, etc.).\n4. `batch_generate_seo_content_briefs` with `confirm: true` to pre-warm briefs, then `export_seo_fix_brief` to pull the full markdown handoff into your workspace.\n5. `set_seo_issue_status` to resolve/ignore when done; re-run `run_seo_audit` to verify.\n\n## SEO links & technical settings (via MCP)\n- `seo_links_snapshot` / `seo_link_health` \u2014 site-wide link graph and broken-link scan (Links tab parity).\n- `run_seo_link_ai_index` with `confirm: true`, then `seo_link_suggest` \u2014 AI contextual internal link suggestions.\n- `get_seo_crawl_settings` / `update_seo_crawl_settings`, `get_seo_robots` / `update_seo_robots`, `get_seo_sitemap_status` / `regenerate_seo_sitemap` \u2014 technical SEO controls.\n- `list_seo_content` / `get_seo_content` / `update_seo_content` \u2014 bulk content SEO records without opening the admin UI.\n- Redirect advanced: `flatten_redirect_chain`, `list_redirect_suggestions`, recovery settings, `import_redirects_csv` (confirm), `export_redirects_csv`.\n- AI assistant: `ai_seo_generate_field`, `ai_seo_explain_issue`, `ai_seo_generate_schema`, `ai_seo_summarize_audit` \u2014 degrade gracefully when plugin-ai is unconfigured.";
|
|
13
|
+
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,mBAAmB,w0NAgDiJ,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-level onboarding guidance surfaced to the AI client during MCP
|
|
3
|
+
* `initialize` (the SDK returns this as `instructions`). Most MCP clients inject
|
|
4
|
+
* it into the model's system context, so this is the one place we can teach an
|
|
5
|
+
* agent how to drive Prenta CMS *before* it starts guessing from tool names.
|
|
6
|
+
*
|
|
7
|
+
* Keep it short and high-signal: the canonical workflow, the page-content
|
|
8
|
+
* contract, and the safety rails. Per-tool detail lives in each tool's
|
|
9
|
+
* `description`; live content-model detail lives in the MCP resources
|
|
10
|
+
* (`prenta://collections`, `prenta://section-types`).
|
|
11
|
+
*/
|
|
12
|
+
export const SERVER_INSTRUCTIONS = `You are connected to an Prenta CMS instance over MCP. You can author and manage real site content (pages, posts, media, forms, navigation, SEO) by calling the tools below. Everything you write goes through the CMS's audited, access-controlled API — treat it as production data.
|
|
13
|
+
|
|
14
|
+
## Start here (discovery first)
|
|
15
|
+
1. Call \`health_check\` once — a \`degraded\`/\`unhealthy\` status reveals operator config problems early.
|
|
16
|
+
2. Call \`list_collections\` to learn what content types exist (slugs, labels, page-vs-post type, fields). Never assume a collection exists.
|
|
17
|
+
3. Read the \`prenta://collections\` and \`prenta://section-types\` resources for the live content model and the building blocks of a page.
|
|
18
|
+
|
|
19
|
+
## The page-content contract (important)
|
|
20
|
+
A page is an ordered array of **sections** stored on the document's \`sections\` field. This is the canonical model the public renderer (\`@prenta/sections-react\`) reads. To build a page:
|
|
21
|
+
1. \`list_section_types\` (optionally scoped \`page\`/\`post\`) → choose section types.
|
|
22
|
+
2. \`add_page_section\` / \`update_page_section\` / \`reorder_page_sections\` to compose the page. The server seeds each type's registry defaults; you shallow-merge \`content\`/\`settings\`.
|
|
23
|
+
3. \`validate_section_content\` before/after to catch unknown types or bad fields.
|
|
24
|
+
Prefer the section tools over \`generate_page\`/\`create_page_from_prompt\` when you want predictable, canonical output — the prompt-driven page builder stores a richer \`_layout\` tree that is *compiled* to \`sections\` on save.
|
|
25
|
+
|
|
26
|
+
**One owner per page.** A page authored via the section tools is yours to edit section-by-section. A page that has a \`_layout\` (built in the visual Page Builder, \`create_page_from_prompt\`, or \`create_document\` with a \`layout\`) is **builder-owned**: its \`sections\` are recompiled from the layout on every save, so the section write tools (\`add_page_section\` etc.) **refuse it with a 409**. You can still read its compiled \`sections\` via \`get_document\`. Don't fight a 409 by retrying — tell the user the page is builder-owned.
|
|
27
|
+
|
|
28
|
+
## Authoring lifecycle
|
|
29
|
+
- Documents have a status: \`DRAFT\`, \`PUBLISHED\`, \`SCHEDULED\`, \`ARCHIVED\`. \`create_document\` defaults to draft — set status explicitly or use \`schedule_publish\` to go live.
|
|
30
|
+
- **Every image must go through the media library.** Use \`upload_media\` first — never reference \`/public/\`, \`/images/\`, or other static paths in section \`imageUrl\` fields. The CMS optimizes, tracks usage, and stores alt text on media records.
|
|
31
|
+
- After uploading an image, call \`generate_media_alt({ mediaId })\` then \`update_media({ id, alt })\` to set WCAG-aligned alt text (vision model when configured).
|
|
32
|
+
- For library-wide metadata backfills, prefer \`bulk_update_media({ items })\` (max 50 per call, per-id results) over looping \`update_media\`. Use \`bulk_delete_media({ ids, confirm: true })\` for cleanup batches.
|
|
33
|
+
- \`upload_media\` is content-hash idempotent: re-uploading the same final bytes returns the existing row with \`deduplicated: true\` / \`duplicateOf\`. Pass \`forceUpload: true\` only when you intentionally want a second copy.
|
|
34
|
+
- Use \`resolve_url\` to verify a published page renders at its public path.
|
|
35
|
+
|
|
36
|
+
## Images & performance (build fast pages)
|
|
37
|
+
The renderer (\`@prenta/sections-react\`) does the Core Web Vitals heavy lifting for you — your job is to give it the right inputs:
|
|
38
|
+
- **Pick a hero image for the LCP.** For a page's main banner, set the \`hero\` section's \`imageUrl\` (+ required \`imageAlt\`). The renderer marks **exactly one** image per page as the priority/eager LCP element and lazy-loads the rest. Don't expect to "prioritise" several above-the-fold images — only one wins, so put it on the hero (or the post's \`featuredImage\`).
|
|
39
|
+
- **Always set alt text.** It's an accessibility requirement (a hero image without alt is rejected) and feeds SEO. Workflow: \`generate_media_alt\` → review → \`update_media({ alt })\`, or set \`imageAlt\` inline when inserting into a section.
|
|
40
|
+
- **Don't hand-optimise content images.** \`upload_media\` compresses to **high-quality WebP** (quality 82, 86 for transparent PNGs), downscales beyond 4096px, and **keeps the original when WebP would be larger** — upload a full-resolution source and let the pipeline balance size vs fidelity. Only pass \`skipOptimize: true\` for brand logos/favicons. The public site also serves AVIF/WebP via \`next/image\` with responsive \`sizes\`.
|
|
41
|
+
|
|
42
|
+
## Safety rails
|
|
43
|
+
- Some tools require \`confirm: true\` and refuse otherwise: \`delete_document\`, \`delete_media\`, \`bulk_delete_media\`, \`delete_form\`, \`delete_form_entry\` (destructive — confirm with the user first, prefer archiving where available), \`export_form_entries\` (bulk PII egress), \`seo_scan_run\` (expensive site-wide scan), \`apply_seo_issue_fix\` (writes SEO metadata + resolves an issue), and \`batch_generate_seo_content_briefs\` (batch AI content briefs).
|
|
44
|
+
- Your API key carries scopes. A \`Forbidden\` error means the key lacks a permission, not that the tool is broken — surface that to the user rather than retrying blindly.
|
|
45
|
+
- Tool inputs are schema-validated; read each tool's \`description\` for the exact shape and the response envelope (most list tools return \`{ docs, total, page, pageSize }\`).
|
|
46
|
+
|
|
47
|
+
## SEO audit fix workflow (via MCP)
|
|
48
|
+
1. \`run_seo_audit\` or \`list_seo_issues\` → triage open issues.
|
|
49
|
+
2. **Metadata fixes** (meta title/desc, canonical, schema): \`suggest_seo_issue_fix\` → review \`suggestion.changes\` → \`apply_seo_issue_fix\` with \`fingerprint\` + \`confirm: true\`.
|
|
50
|
+
3. **Content fixes** (thin content, headings, alt text): \`research_and_brief_seo_issue\` (thin content + optional competitor URLs) or \`generate_seo_issue_content_brief\`. Briefs are suggestions only — implement in page content yourself (\`add_page_section\`, \`update_document\`, etc.).
|
|
51
|
+
4. \`batch_generate_seo_content_briefs\` with \`confirm: true\` to pre-warm briefs, then \`export_seo_fix_brief\` to pull the full markdown handoff into your workspace.
|
|
52
|
+
5. \`set_seo_issue_status\` to resolve/ignore when done; re-run \`run_seo_audit\` to verify.
|
|
53
|
+
|
|
54
|
+
## SEO links & technical settings (via MCP)
|
|
55
|
+
- \`seo_links_snapshot\` / \`seo_link_health\` — site-wide link graph and broken-link scan (Links tab parity).
|
|
56
|
+
- \`run_seo_link_ai_index\` with \`confirm: true\`, then \`seo_link_suggest\` — AI contextual internal link suggestions.
|
|
57
|
+
- \`get_seo_crawl_settings\` / \`update_seo_crawl_settings\`, \`get_seo_robots\` / \`update_seo_robots\`, \`get_seo_sitemap_status\` / \`regenerate_seo_sitemap\` — technical SEO controls.
|
|
58
|
+
- \`list_seo_content\` / \`get_seo_content\` / \`update_seo_content\` — bulk content SEO records without opening the admin UI.
|
|
59
|
+
- Redirect advanced: \`flatten_redirect_chain\`, \`list_redirect_suggestions\`, recovery settings, \`import_redirects_csv\` (confirm), \`export_redirects_csv\`.
|
|
60
|
+
- AI assistant: \`ai_seo_generate_field\`, \`ai_seo_explain_issue\`, \`ai_seo_generate_schema\`, \`ai_seo_summarize_audit\` — degrade gracefully when plugin-ai is unconfigured.`;
|
|
61
|
+
//# sourceMappingURL=instructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iLAgD8I,CAAA"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation menu helpers (WS-C C3).
|
|
3
|
+
*
|
|
4
|
+
* Menus live in the `navigations` collection as ordinary documents; the menu
|
|
5
|
+
* tree is stored on `data.items` as a recursive list of `NavItem`s — the exact
|
|
6
|
+
* shape the admin Nav builder (@prenta/plugin-navigation) reads and
|
|
7
|
+
* writes. These are PURE functions (no I/O) so the MCP tools can compose them
|
|
8
|
+
* and so they're trivially unit-testable. The tools layer is responsible for
|
|
9
|
+
* loading/saving the document via the standard document API (which preserves
|
|
10
|
+
* versioning, access control, hooks, and cache invalidation).
|
|
11
|
+
*/
|
|
12
|
+
export declare const NAVIGATION_COLLECTION = "navigations";
|
|
13
|
+
/** A single navigation link. Mirrors `NavItem` in the admin Nav builder. */
|
|
14
|
+
export interface NavItem {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
url: string;
|
|
18
|
+
target?: '_blank' | '_self';
|
|
19
|
+
children?: NavItem[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Stable-ish id for a new item, matching the admin builder's scheme
|
|
23
|
+
* (`nav-<time>-<rand>`) so menus authored over MCP remain editable in the UI,
|
|
24
|
+
* which keys its move/remove operations off `id`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function genNavItemId(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Build a relative path for a document — same precedence as cms-core
|
|
29
|
+
* `documentPublicPath`: explicit `data.path` → home → `<urlPrefix>/<slug>`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildDocPath(urlPrefix: string | undefined, slug: string, isHome: boolean, data?: Record<string, unknown> | null): string;
|
|
32
|
+
/**
|
|
33
|
+
* Defensively coerce untrusted stored JSON into a `NavItem[]`. Unknown/garbage
|
|
34
|
+
* entries are dropped rather than throwing — the stored `items` field is free
|
|
35
|
+
* JSON and may predate the current shape. Children recurse; ids are preserved
|
|
36
|
+
* when present and minted when missing.
|
|
37
|
+
*/
|
|
38
|
+
export declare function coerceNavItems(value: unknown): NavItem[];
|
|
39
|
+
/** Find an item anywhere in the tree by id. */
|
|
40
|
+
export declare function findNavItem(items: NavItem[], id: string): NavItem | null;
|
|
41
|
+
/**
|
|
42
|
+
* Append `item` to the tree. With no `parentId` it lands at the top level;
|
|
43
|
+
* otherwise it's appended to the parent's children. Throws if `parentId`
|
|
44
|
+
* doesn't exist so the caller surfaces a clear error rather than silently
|
|
45
|
+
* dropping the link.
|
|
46
|
+
*/
|
|
47
|
+
export declare function addNavItem(items: NavItem[], item: NavItem, parentId?: string | null): NavItem[];
|
|
48
|
+
/** Remove an item (and its subtree) by id. Reports whether anything matched. */
|
|
49
|
+
export declare function removeNavItem(items: NavItem[], id: string): {
|
|
50
|
+
items: NavItem[];
|
|
51
|
+
removed: boolean;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Reorder one level of the tree to match `orderedIds`. `parentId` of null/undefined
|
|
55
|
+
* targets the top level; otherwise the named parent's children. `orderedIds`
|
|
56
|
+
* must be a permutation of exactly the ids at that level — a mismatch throws so
|
|
57
|
+
* an agent can't accidentally drop or duplicate items.
|
|
58
|
+
*/
|
|
59
|
+
export declare function reorderNavLevel(items: NavItem[], orderedIds: string[], parentId?: string | null): NavItem[];
|
|
60
|
+
export interface NavTreeValidation {
|
|
61
|
+
valid: boolean;
|
|
62
|
+
errors: string[];
|
|
63
|
+
warnings: string[];
|
|
64
|
+
stats: {
|
|
65
|
+
itemCount: number;
|
|
66
|
+
maxDepth: number;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Validate a navigation tree without persisting. Errors are hard problems an
|
|
71
|
+
* agent must fix (non-array, missing label/url, duplicate ids, exceeding
|
|
72
|
+
* `maxDepth`); warnings are soft smells (placeholder `#`/empty urls, unknown
|
|
73
|
+
* `target`). `maxDepth` is 1-based: depth 1 = top level.
|
|
74
|
+
*/
|
|
75
|
+
export declare function validateNavTree(items: unknown, maxDepth?: number): NavTreeValidation;
|
|
76
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;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6BX;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,SAAI,GAAG,iBAAiB,CA+D/E"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation menu helpers (WS-C C3).
|
|
3
|
+
*
|
|
4
|
+
* Menus live in the `navigations` collection as ordinary documents; the menu
|
|
5
|
+
* tree is stored on `data.items` as a recursive list of `NavItem`s — the exact
|
|
6
|
+
* shape the admin Nav builder (@prenta/plugin-navigation) reads and
|
|
7
|
+
* writes. These are PURE functions (no I/O) so the MCP tools can compose them
|
|
8
|
+
* and so they're trivially unit-testable. The tools layer is responsible for
|
|
9
|
+
* loading/saving the document via the standard document API (which preserves
|
|
10
|
+
* versioning, access control, hooks, and cache invalidation).
|
|
11
|
+
*/
|
|
12
|
+
export const NAVIGATION_COLLECTION = 'navigations';
|
|
13
|
+
/**
|
|
14
|
+
* Stable-ish id for a new item, matching the admin builder's scheme
|
|
15
|
+
* (`nav-<time>-<rand>`) so menus authored over MCP remain editable in the UI,
|
|
16
|
+
* which keys its move/remove operations off `id`.
|
|
17
|
+
*/
|
|
18
|
+
export function genNavItemId() {
|
|
19
|
+
return `nav-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Build a relative path for a document — same precedence as cms-core
|
|
23
|
+
* `documentPublicPath`: explicit `data.path` → home → `<urlPrefix>/<slug>`.
|
|
24
|
+
*/
|
|
25
|
+
export function buildDocPath(urlPrefix, slug, isHome, data) {
|
|
26
|
+
const explicit = typeof data?.path === 'string' ? data.path.trim() : '';
|
|
27
|
+
if (explicit) {
|
|
28
|
+
const normalized = `/${explicit.replace(/^\/+|\/+$/g, '')}`;
|
|
29
|
+
return normalized === '/' ? '/' : normalized;
|
|
30
|
+
}
|
|
31
|
+
const clean = slug.replace(/^\/+|\/+$/g, '');
|
|
32
|
+
if (isHome || clean === 'home' || clean === 'index' || clean === '')
|
|
33
|
+
return '/';
|
|
34
|
+
const prefix = (urlPrefix ?? '').replace(/^\/+|\/+$/g, '');
|
|
35
|
+
return prefix ? `/${prefix}/${clean}` : `/${clean}`;
|
|
36
|
+
}
|
|
37
|
+
function isObj(v) {
|
|
38
|
+
return typeof v === 'object' && v !== null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Defensively coerce untrusted stored JSON into a `NavItem[]`. Unknown/garbage
|
|
42
|
+
* entries are dropped rather than throwing — the stored `items` field is free
|
|
43
|
+
* JSON and may predate the current shape. Children recurse; ids are preserved
|
|
44
|
+
* when present and minted when missing.
|
|
45
|
+
*/
|
|
46
|
+
export function coerceNavItems(value) {
|
|
47
|
+
if (!Array.isArray(value))
|
|
48
|
+
return [];
|
|
49
|
+
const out = [];
|
|
50
|
+
for (const raw of value) {
|
|
51
|
+
if (!isObj(raw))
|
|
52
|
+
continue;
|
|
53
|
+
const label = typeof raw.label === 'string' ? raw.label : '';
|
|
54
|
+
const url = typeof raw.url === 'string' ? raw.url : '';
|
|
55
|
+
const item = {
|
|
56
|
+
id: typeof raw.id === 'string' && raw.id.length > 0 ? raw.id : genNavItemId(),
|
|
57
|
+
label,
|
|
58
|
+
url,
|
|
59
|
+
};
|
|
60
|
+
if (raw.target === '_blank' || raw.target === '_self')
|
|
61
|
+
item.target = raw.target;
|
|
62
|
+
if (Array.isArray(raw.children)) {
|
|
63
|
+
const kids = coerceNavItems(raw.children);
|
|
64
|
+
if (kids.length > 0)
|
|
65
|
+
item.children = kids;
|
|
66
|
+
}
|
|
67
|
+
out.push(item);
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
/** Find an item anywhere in the tree by id. */
|
|
72
|
+
export function findNavItem(items, id) {
|
|
73
|
+
for (const item of items) {
|
|
74
|
+
if (item.id === id)
|
|
75
|
+
return item;
|
|
76
|
+
if (item.children) {
|
|
77
|
+
const found = findNavItem(item.children, id);
|
|
78
|
+
if (found)
|
|
79
|
+
return found;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Append `item` to the tree. With no `parentId` it lands at the top level;
|
|
86
|
+
* otherwise it's appended to the parent's children. Throws if `parentId`
|
|
87
|
+
* doesn't exist so the caller surfaces a clear error rather than silently
|
|
88
|
+
* dropping the link.
|
|
89
|
+
*/
|
|
90
|
+
export function addNavItem(items, item, parentId) {
|
|
91
|
+
if (!parentId)
|
|
92
|
+
return [...items, item];
|
|
93
|
+
let attached = false;
|
|
94
|
+
const attach = (list) => list.map((it) => {
|
|
95
|
+
if (it.id === parentId) {
|
|
96
|
+
attached = true;
|
|
97
|
+
return { ...it, children: [...(it.children ?? []), item] };
|
|
98
|
+
}
|
|
99
|
+
if (it.children)
|
|
100
|
+
return { ...it, children: attach(it.children) };
|
|
101
|
+
return it;
|
|
102
|
+
});
|
|
103
|
+
const next = attach(items);
|
|
104
|
+
if (!attached)
|
|
105
|
+
throw new Error(`Parent item "${parentId}" not found in this menu.`);
|
|
106
|
+
return next;
|
|
107
|
+
}
|
|
108
|
+
/** Remove an item (and its subtree) by id. Reports whether anything matched. */
|
|
109
|
+
export function removeNavItem(items, id) {
|
|
110
|
+
let removed = false;
|
|
111
|
+
const strip = (list) => list
|
|
112
|
+
.filter((it) => {
|
|
113
|
+
if (it.id === id) {
|
|
114
|
+
removed = true;
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
return true;
|
|
118
|
+
})
|
|
119
|
+
.map((it) => (it.children ? { ...it, children: strip(it.children) } : it));
|
|
120
|
+
const next = strip(items);
|
|
121
|
+
return { items: next, removed };
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Reorder one level of the tree to match `orderedIds`. `parentId` of null/undefined
|
|
125
|
+
* targets the top level; otherwise the named parent's children. `orderedIds`
|
|
126
|
+
* must be a permutation of exactly the ids at that level — a mismatch throws so
|
|
127
|
+
* an agent can't accidentally drop or duplicate items.
|
|
128
|
+
*/
|
|
129
|
+
export function reorderNavLevel(items, orderedIds, parentId) {
|
|
130
|
+
const reorder = (list) => {
|
|
131
|
+
const currentIds = list.map((i) => i.id);
|
|
132
|
+
const wanted = [...orderedIds].sort();
|
|
133
|
+
const have = [...currentIds].sort();
|
|
134
|
+
if (wanted.length !== have.length || wanted.some((id, i) => id !== have[i])) {
|
|
135
|
+
throw new Error(`orderedIds must be a permutation of the ${list.length} item id(s) at this level: [${currentIds.join(', ')}].`);
|
|
136
|
+
}
|
|
137
|
+
const byId = new Map(list.map((i) => [i.id, i]));
|
|
138
|
+
return orderedIds.map((id) => byId.get(id));
|
|
139
|
+
};
|
|
140
|
+
if (!parentId)
|
|
141
|
+
return reorder(items);
|
|
142
|
+
let found = false;
|
|
143
|
+
const walk = (list) => list.map((it) => {
|
|
144
|
+
if (it.id === parentId) {
|
|
145
|
+
found = true;
|
|
146
|
+
return { ...it, children: reorder(it.children ?? []) };
|
|
147
|
+
}
|
|
148
|
+
if (it.children)
|
|
149
|
+
return { ...it, children: walk(it.children) };
|
|
150
|
+
return it;
|
|
151
|
+
});
|
|
152
|
+
const next = walk(items);
|
|
153
|
+
if (!found)
|
|
154
|
+
throw new Error(`Parent item "${parentId}" not found in this menu.`);
|
|
155
|
+
return next;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Validate a navigation tree without persisting. Errors are hard problems an
|
|
159
|
+
* agent must fix (non-array, missing label/url, duplicate ids, exceeding
|
|
160
|
+
* `maxDepth`); warnings are soft smells (placeholder `#`/empty urls, unknown
|
|
161
|
+
* `target`). `maxDepth` is 1-based: depth 1 = top level.
|
|
162
|
+
*/
|
|
163
|
+
export function validateNavTree(items, maxDepth = 5) {
|
|
164
|
+
const errors = [];
|
|
165
|
+
const warnings = [];
|
|
166
|
+
const seenIds = new Set();
|
|
167
|
+
let itemCount = 0;
|
|
168
|
+
let observedMaxDepth = 0;
|
|
169
|
+
if (!Array.isArray(items)) {
|
|
170
|
+
return {
|
|
171
|
+
valid: false,
|
|
172
|
+
errors: ['Navigation items must be an array.'],
|
|
173
|
+
warnings: [],
|
|
174
|
+
stats: { itemCount: 0, maxDepth: 0 },
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
const walk = (list, depth, path) => {
|
|
178
|
+
if (!Array.isArray(list)) {
|
|
179
|
+
errors.push(`${path}: children must be an array.`);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (list.length > 0)
|
|
183
|
+
observedMaxDepth = Math.max(observedMaxDepth, depth);
|
|
184
|
+
if (depth > maxDepth) {
|
|
185
|
+
errors.push(`${path}: nesting exceeds maxDepth of ${maxDepth} (found depth ${depth}).`);
|
|
186
|
+
}
|
|
187
|
+
list.forEach((raw, i) => {
|
|
188
|
+
const here = `${path}[${i}]`;
|
|
189
|
+
if (!isObj(raw)) {
|
|
190
|
+
errors.push(`${here}: each item must be an object.`);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
itemCount++;
|
|
194
|
+
const id = raw.id;
|
|
195
|
+
if (typeof id !== 'string' || id.length === 0) {
|
|
196
|
+
warnings.push(`${here}: missing id — one will be generated on save.`);
|
|
197
|
+
}
|
|
198
|
+
else if (seenIds.has(id)) {
|
|
199
|
+
errors.push(`${here}: duplicate item id "${id}".`);
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
seenIds.add(id);
|
|
203
|
+
}
|
|
204
|
+
if (typeof raw.label !== 'string' || raw.label.trim().length === 0) {
|
|
205
|
+
errors.push(`${here}: "label" is required and must be a non-empty string.`);
|
|
206
|
+
}
|
|
207
|
+
if (typeof raw.url !== 'string') {
|
|
208
|
+
errors.push(`${here}: "url" is required and must be a string.`);
|
|
209
|
+
}
|
|
210
|
+
else if (raw.url.trim().length === 0 || raw.url.trim() === '#') {
|
|
211
|
+
warnings.push(`${here}: url "${raw.url}" is a placeholder — the link will not navigate.`);
|
|
212
|
+
}
|
|
213
|
+
if (raw.target !== undefined && raw.target !== '_blank' && raw.target !== '_self') {
|
|
214
|
+
warnings.push(`${here}: target "${String(raw.target)}" is not "_blank" or "_self".`);
|
|
215
|
+
}
|
|
216
|
+
if (raw.children !== undefined)
|
|
217
|
+
walk(raw.children, depth + 1, `${here}.children`);
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
walk(items, 1, 'items');
|
|
221
|
+
return {
|
|
222
|
+
valid: errors.length === 0,
|
|
223
|
+
errors,
|
|
224
|
+
warnings,
|
|
225
|
+
stats: { itemCount, maxDepth: observedMaxDepth },
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=navigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.js","sourceRoot":"","sources":["../src/navigation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAA;AAWlD;;;;GAIG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAA;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAC1B,SAA6B,EAC7B,IAAY,EACZ,MAAe,EACf,IAAqC;IAErC,MAAM,QAAQ,GAAG,OAAO,IAAI,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CA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B,MAAM;QACN,QAAQ;QACR,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE;KACjD,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP resources expose read-only, self-describing context an agent can pull on
|
|
3
|
+
* demand — distinct from tools (actions). We surface the *live* content model
|
|
4
|
+
* (collections + section types) plus a static authoring guide, so an agent can
|
|
5
|
+
* learn "what is on this CMS and how do I build a page" without external docs.
|
|
6
|
+
*
|
|
7
|
+
* Resources are fetched lazily on read so they always reflect the connected
|
|
8
|
+
* instance. A read that fails (e.g. an older CMS server missing the discovery
|
|
9
|
+
* endpoint) returns an explanatory payload instead of throwing, so the agent
|
|
10
|
+
* gets an actionable message rather than an opaque protocol error.
|
|
11
|
+
*/
|
|
12
|
+
import type { PrentaClient } from './client.js';
|
|
13
|
+
export interface McpResource {
|
|
14
|
+
uri: string;
|
|
15
|
+
name: string;
|
|
16
|
+
description: string;
|
|
17
|
+
mimeType: string;
|
|
18
|
+
/** Produce the resource body on read. Must not throw — return a useful payload on failure. */
|
|
19
|
+
read: () => Promise<string>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Static, high-signal guide to the canonical authoring workflow. Mirrors the
|
|
23
|
+
* server `instructions` but is available as a pullable resource for clients
|
|
24
|
+
* that surface resources but not instructions.
|
|
25
|
+
*/
|
|
26
|
+
export declare const AUTHORING_GUIDE = "# Prenta CMS \u2014 agent authoring guide\n\n## Discovery\n- `health_check` \u2014 confirm the instance is healthy before writing.\n- `list_collections` \u2014 the content types you can author (slugs, labels, fields).\n- Resource `prenta://section-types` \u2014 the section building blocks for pages.\n\n## Build a page (canonical `sections[]` model)\n1. `list_section_types` \u2192 pick types (scope to `page`/`post`).\n2. `add_page_section` / `update_page_section` / `reorder_page_sections`.\n3. `validate_section_content` to verify.\nThe public renderer (`@prenta/sections-react`) renders this `sections` array.\n\n## Page ownership\nA page with a `_layout` (built in the visual Page Builder or via `create_page_from_prompt`/`create_document` with a `layout`) is **builder-owned**: its `sections` are compiled from the layout on save, so the section write tools refuse it with a 409. Read its compiled `sections` via `get_document`. Section-authored pages (no `_layout`) are freely editable.\n\n## Lifecycle\n- Status: DRAFT \u2192 PUBLISHED (or SCHEDULED / ARCHIVED). `create_document` is draft by default.\n- `upload_media` before referencing assets; `schedule_publish` to go live; `resolve_url` to verify.\n\n## Images & performance (Core Web Vitals)\nThe public renderer (`@prenta/sections-react`) optimises images for you \u2014 give it the right inputs:\n- **One LCP image per page.** Put a page's main banner on the `hero` section's `imageUrl` (+ required `imageAlt`); for posts use `featuredImage`. The renderer marks exactly one image as the eager/priority LCP element and lazy-loads the rest \u2014 only one image can \"win\" priority.\n- **Always set alt text** (`imageAlt`, or `update_media({ alt })`). A hero image without alt is rejected.\n- **No manual optimisation needed.** `upload_media` recompresses to WebP; the site serves AVIF/WebP via `next/image`, backfills intrinsic width/height (prevents layout shift / CLS), and emits responsive `sizes`. Upload a large source, reference its URL, done.\n\n## Safety\n- `delete_*` tools require `confirm: true`. Prefer archiving. Confirm destructive actions with the user.\n- API-key scopes apply; `Forbidden` means a missing permission.\n";
|
|
27
|
+
export declare function buildResources(client: PrentaClient): McpResource[];
|
|
28
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,8FAA8F;IAC9F,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAC5B;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,+pEA6B3B,CAAA;AAMD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,EAAE,CAiDlE"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static, high-signal guide to the canonical authoring workflow. Mirrors the
|
|
3
|
+
* server `instructions` but is available as a pullable resource for clients
|
|
4
|
+
* that surface resources but not instructions.
|
|
5
|
+
*/
|
|
6
|
+
export const AUTHORING_GUIDE = `# Prenta CMS — agent authoring guide
|
|
7
|
+
|
|
8
|
+
## Discovery
|
|
9
|
+
- \`health_check\` — confirm the instance is healthy before writing.
|
|
10
|
+
- \`list_collections\` — the content types you can author (slugs, labels, fields).
|
|
11
|
+
- Resource \`prenta://section-types\` — the section building blocks for pages.
|
|
12
|
+
|
|
13
|
+
## Build a page (canonical \`sections[]\` model)
|
|
14
|
+
1. \`list_section_types\` → pick types (scope to \`page\`/\`post\`).
|
|
15
|
+
2. \`add_page_section\` / \`update_page_section\` / \`reorder_page_sections\`.
|
|
16
|
+
3. \`validate_section_content\` to verify.
|
|
17
|
+
The public renderer (\`@prenta/sections-react\`) renders this \`sections\` array.
|
|
18
|
+
|
|
19
|
+
## Page ownership
|
|
20
|
+
A page with a \`_layout\` (built in the visual Page Builder or via \`create_page_from_prompt\`/\`create_document\` with a \`layout\`) is **builder-owned**: its \`sections\` are compiled from the layout on save, so the section write tools refuse it with a 409. Read its compiled \`sections\` via \`get_document\`. Section-authored pages (no \`_layout\`) are freely editable.
|
|
21
|
+
|
|
22
|
+
## Lifecycle
|
|
23
|
+
- Status: DRAFT → PUBLISHED (or SCHEDULED / ARCHIVED). \`create_document\` is draft by default.
|
|
24
|
+
- \`upload_media\` before referencing assets; \`schedule_publish\` to go live; \`resolve_url\` to verify.
|
|
25
|
+
|
|
26
|
+
## Images & performance (Core Web Vitals)
|
|
27
|
+
The public renderer (\`@prenta/sections-react\`) optimises images for you — give it the right inputs:
|
|
28
|
+
- **One LCP image per page.** Put a page's main banner on the \`hero\` section's \`imageUrl\` (+ required \`imageAlt\`); for posts use \`featuredImage\`. The renderer marks exactly one image as the eager/priority LCP element and lazy-loads the rest — only one image can "win" priority.
|
|
29
|
+
- **Always set alt text** (\`imageAlt\`, or \`update_media({ alt })\`). A hero image without alt is rejected.
|
|
30
|
+
- **No manual optimisation needed.** \`upload_media\` recompresses to WebP; the site serves AVIF/WebP via \`next/image\`, backfills intrinsic width/height (prevents layout shift / CLS), and emits responsive \`sizes\`. Upload a large source, reference its URL, done.
|
|
31
|
+
|
|
32
|
+
## Safety
|
|
33
|
+
- \`delete_*\` tools require \`confirm: true\`. Prefer archiving. Confirm destructive actions with the user.
|
|
34
|
+
- API-key scopes apply; \`Forbidden\` means a missing permission.
|
|
35
|
+
`;
|
|
36
|
+
function safeJson(value) {
|
|
37
|
+
return JSON.stringify(value, null, 2);
|
|
38
|
+
}
|
|
39
|
+
export function buildResources(client) {
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
uri: 'prenta://guide',
|
|
43
|
+
name: 'Prenta authoring guide',
|
|
44
|
+
description: 'How to drive this CMS: the discovery-first workflow, the canonical sections[] page model, the publish lifecycle, and the safety rails.',
|
|
45
|
+
mimeType: 'text/markdown',
|
|
46
|
+
read: async () => AUTHORING_GUIDE,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
uri: 'prenta://collections',
|
|
50
|
+
name: 'Collections (live content model)',
|
|
51
|
+
description: 'The collections configured on this CMS instance, with field summaries. Pull this before authoring to learn what content types and fields exist.',
|
|
52
|
+
mimeType: 'application/json',
|
|
53
|
+
read: async () => {
|
|
54
|
+
try {
|
|
55
|
+
const res = await client.listCollections();
|
|
56
|
+
return safeJson(res.data);
|
|
57
|
+
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
return safeJson({
|
|
60
|
+
error: 'Could not load collections from this CMS instance.',
|
|
61
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
62
|
+
hint: 'Call the list_collections tool, or confirm the server is reachable and the API key has read scope.',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
uri: 'prenta://section-types',
|
|
69
|
+
name: 'Page section types (live)',
|
|
70
|
+
description: 'Registered section types and their content/field schemas — the building blocks of the canonical sections[] page model used by add_page_section.',
|
|
71
|
+
mimeType: 'application/json',
|
|
72
|
+
read: async () => {
|
|
73
|
+
try {
|
|
74
|
+
const res = await client.listSectionTypes();
|
|
75
|
+
return safeJson(res.data);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
return safeJson({
|
|
79
|
+
error: 'Could not load section types from this CMS instance.',
|
|
80
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
81
|
+
hint: 'Call the list_section_types tool, or confirm the CMS ships the page-sections registry.',
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=resources.js.map
|