@ampless/mcp-server 1.0.0-alpha.10 → 1.0.0-alpha.11

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.
@@ -253,11 +253,17 @@ var createPostSchema = {
253
253
  tags: { type: "array", items: { type: "string" } },
254
254
  metadata: {
255
255
  type: "object",
256
- description: "Free-form per-post metadata. Reserved well-known keys: `no_layout` (boolean) \u2014 when true, the public page is served as bare HTML with no theme chrome (the route redirects to /_/<slug>); meaningful only with format=html. Other keys pass through unchanged for themes/plugins.",
256
+ description: "Free-form per-post metadata. Reserved well-known keys: `no_layout` (boolean) \u2014 when true, the public page is served as bare HTML with no theme chrome (middleware rewrites /<slug> to the internal bare-HTML route); meaningful only with format=html. `cache` (auto|deep|hot) \u2014 override the per-post cache strategy. See `cacheStrategy` in get_schema.notes for details. Other keys pass through unchanged for themes/plugins.",
257
257
  properties: {
258
258
  no_layout: {
259
259
  type: "boolean",
260
260
  description: "Serve the post as bare HTML with no theme chrome. Only meaningful when format=html; ignored otherwise."
261
+ },
262
+ cache: {
263
+ type: "string",
264
+ enum: ["auto", "deep", "hot"],
265
+ default: "auto",
266
+ description: "Override the response Cache-Control strategy. 'auto' (default): no-store within `cms.config.cache.cooldownMs` of updatedAt, then `max-age=freshTtlSeconds`. 'deep': always `max-age=deepTtlSeconds`. 'hot': always no-store. Independent of no_layout; applies uniformly to themed, no_layout, and static posts."
261
267
  }
262
268
  },
263
269
  additionalProperties: true
@@ -321,11 +327,17 @@ var updatePostSchema = {
321
327
  tags: { type: "array", items: { type: "string" } },
322
328
  metadata: {
323
329
  type: "object",
324
- description: "Free-form per-post metadata. Reserved well-known keys: `no_layout` (boolean) \u2014 when true, the public page is served as bare HTML with no theme chrome (the route redirects to /_/<slug>); meaningful only with format=html. Passing metadata replaces the existing metadata object \u2014 read the current post first if you only want to add a key.",
330
+ description: "Free-form per-post metadata. Reserved well-known keys: `no_layout` (boolean) \u2014 when true, the public page is served as bare HTML with no theme chrome (middleware rewrites /<slug> to the internal bare-HTML route); meaningful only with format=html. `cache` (auto|deep|hot) \u2014 override the per-post cache strategy. See `cacheStrategy` in get_schema.notes for details. Passing metadata replaces the existing metadata object \u2014 read the current post first if you only want to add a key.",
325
331
  properties: {
326
332
  no_layout: {
327
333
  type: "boolean",
328
334
  description: "Serve the post as bare HTML with no theme chrome. Only meaningful when format=html; ignored otherwise."
335
+ },
336
+ cache: {
337
+ type: "string",
338
+ enum: ["auto", "deep", "hot"],
339
+ default: "auto",
340
+ description: "Override the response Cache-Control strategy. 'auto' (default): no-store within `cms.config.cache.cooldownMs` of updatedAt, then `max-age=freshTtlSeconds`. 'deep': always `max-age=deepTtlSeconds`. 'hot': always no-store. Independent of no_layout; applies uniformly to themed, no_layout, and static posts."
329
341
  }
330
342
  },
331
343
  additionalProperties: true
@@ -461,7 +473,7 @@ function getSchema() {
461
473
  tags: { type: "string[]" },
462
474
  metadata: {
463
475
  type: "json",
464
- description: "Free-form per-post key/value bag. Reserved well-known keys (owned by ampless): `no_layout` (boolean). Other keys pass through unchanged for themes/plugins."
476
+ description: "Free-form per-post key/value bag. Reserved well-known keys (owned by ampless): `no_layout` (boolean), `cache` (auto|deep|hot). Other keys pass through unchanged for themes/plugins."
465
477
  }
466
478
  }
467
479
  },
@@ -494,8 +506,9 @@ function getSchema() {
494
506
  notes: {
495
507
  editorTrust: 'editor stores arbitrary HTML/JS verbatim \u2014 same trust shape as WordPress unfiltered_html capability. See docs/architecture/04-access-layer-mcp.md \xA7"editor \u306E\u4FE1\u983C\u30E2\u30C7\u30EB".',
496
508
  tiptapBody: 'When format=tiptap, body is the tiptap document JSON: { type: "doc", content: [...] }. The renderer expects this shape.',
497
- noLayout: "metadata.no_layout=true serves the post as bare HTML with no theme chrome \u2014 the public route at /<slug> 308-redirects to /_/<slug>, and that route renders the body verbatim with no wrapping <html>/<head>/layout. Use this for landing pages, embeds, or any post whose body is a full HTML document. Only meaningful with format=html (the other formats need the theme renderer).",
498
- staticFormat: "A fourth format value `static` exists on the underlying data model for posts whose body is a JSON manifest pointing to a pre-uploaded HTML/CSS/JS bundle in S3 at public/static/<slug>/. Public URL pattern: /_/<slug>/ for the entrypoint and /_/<slug>/<file> for every bundle file (308 redirect from /<slug> via the post dispatcher). Static posts are created/edited through the dedicated tools `upload_static_bundle` (zip in one shot), `upload_static_file` / `delete_static_file` (incremental per-file ops), and `commit_static_post` (rebuild the manifest from the current S3 prefix). `create_post` / `update_post` intentionally do NOT accept format=static \u2014 the bundle tools are the only supported entry point so the Post manifest stays in sync with the S3 prefix."
509
+ noLayout: "metadata.no_layout=true serves the post as bare HTML with no theme chrome \u2014 middleware rewrites the public /<slug> request to the internal bare-HTML handler, which renders the body verbatim with no wrapping <html>/<head>/layout. Use this for landing pages, embeds, or any post whose body is a full HTML document. Only meaningful with format=html (the other formats need the theme renderer).",
510
+ staticFormat: "A fourth format value `static` exists on the underlying data model for posts whose body is a JSON manifest pointing to a pre-uploaded HTML/CSS/JS bundle in S3 at public/static/<slug>/. Public URL pattern: /<slug>/ for the entrypoint and /<slug>/<file> for every bundle file (middleware rewrites both to an internal static-bundle handler). Static posts are created/edited through the dedicated tools `upload_static_bundle` (zip in one shot), `upload_static_file` / `delete_static_file` (incremental per-file ops), and `commit_static_post` (rebuild the manifest from the current S3 prefix). `create_post` / `update_post` intentionally do NOT accept format=static \u2014 the bundle tools are the only supported entry point so the Post manifest stays in sync with the S3 prefix.",
511
+ cacheStrategy: "metadata.cache controls the response Cache-Control header (set by middleware). Values:\n - 'auto' (default): cooldown by edit time. Posts updated within cms.config.cache.cooldownMs (default 1h) emit `public, max-age=0, must-revalidate, s-maxage=0` so editors see fresh content immediately; older posts emit `public, max-age=<freshTtlSeconds>, s-maxage=<freshTtlSeconds>` (default 300 sec / 5 min).\n - 'deep': always `public, max-age=<deepTtlSeconds>, s-maxage=<deepTtlSeconds>` (default 3600 sec / 1 hour). Use for posts whose content is fixed for the foreseeable future.\n - 'hot': always `public, max-age=0, must-revalidate, s-maxage=0`. Use for rapidly-evolving posts or posts whose body is computed per request.\nIndependent of metadata.no_layout and post.format \u2014 applies uniformly to themed, no_layout, and static posts. Override the defaults per project via `cms.config.cache` ({ cooldownMs, freshTtlSeconds, deepTtlSeconds })."
499
512
  }
500
513
  };
501
514
  }
@@ -867,7 +880,7 @@ var tools = [
867
880
  },
868
881
  {
869
882
  name: "create_post",
870
- description: "Create a new post. Title and slug are required. Body shape depends on format: tiptap=JSON node tree, markdown=source string, html=raw HTML string. Defaults to status=draft. Pass `metadata: { no_layout: true }` alongside format=html to publish the body as a bare HTML page with no theme chrome (the public route redirects to /_/<slug>).",
883
+ description: 'Create a new post. Title and slug are required. Body shape depends on format: tiptap=JSON node tree, markdown=source string, html=raw HTML string. Defaults to status=draft. Pass `metadata: { no_layout: true }` alongside format=html to publish the body as a bare HTML page with no theme chrome (middleware rewrites the /<slug> request to the internal bare-HTML handler). Pass `metadata: { cache: "deep" | "hot" }` to override the default cooldown-based cache strategy \u2014 see get_schema.notes.cacheStrategy for details.',
871
884
  inputSchema: createPostSchema,
872
885
  handler: (args, ctx) => createPost(ctx.graphql, args)
873
886
  },
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-IW52OUIR.js";
8
8
  import {
9
9
  tools
10
- } from "./chunk-DAR6AHSX.js";
10
+ } from "./chunk-K4GTND6P.js";
11
11
  import {
12
12
  AwsCrc32,
13
13
  __awaiter,
@@ -5,7 +5,7 @@ import {
5
5
  extractZipFromBuffer,
6
6
  getTools,
7
7
  tools
8
- } from "../chunk-DAR6AHSX.js";
8
+ } from "../chunk-K4GTND6P.js";
9
9
  import "../chunk-LMMQX4CK.js";
10
10
  export {
11
11
  decodeUtf8,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/mcp-server",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.11",
4
4
  "description": "MCP server for ampless — lets AI agents (Claude Desktop, Cursor, Claude Code) read and write posts and media via AppSync",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  "@aws-sdk/client-s3": "^3.1048.0",
37
37
  "amazon-cognito-identity-js": "^6.3.12",
38
38
  "fflate": "^0.8.2",
39
- "ampless": "1.0.0-alpha.9"
39
+ "ampless": "1.0.0-alpha.10"
40
40
  },
41
41
  "keywords": [
42
42
  "ampless",