@cmo-so/mcp 0.12.9 → 0.12.10

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.
Files changed (2) hide show
  1. package/dist/cmo-mcp.mjs +24 -4
  2. package/package.json +1 -1
package/dist/cmo-mcp.mjs CHANGED
@@ -7199,7 +7199,7 @@ var require_dist = __commonJS({
7199
7199
  // package.json
7200
7200
  var package_default = {
7201
7201
  name: "@cmo-so/cli",
7202
- version: "0.12.9",
7202
+ version: "0.12.10",
7203
7203
  description: "CMO.so on the command line: your websites, ideas, blog posts, LinkedIn queue and results, plus a local MCP server for Claude Desktop, Cursor and other MCP clients.",
7204
7204
  type: "module",
7205
7205
  license: "MIT",
@@ -17243,7 +17243,7 @@ var childTools = [
17243
17243
  }),
17244
17244
  tool({
17245
17245
  name: "wp_child_theme_update",
17246
- description: "Change a Maggie child theme's files (default: the active child): brand colours (by name, hex) and fonts (by name, CSS font-family of fonts already in it) in theme.json, extra theme.json styles, plain CSS (replace or append), the header or footer (block markup), templates, and the site's own patterns (shown in the editor's inserter). Data only, never code. Each change keeps a backup (wp_child_theme_restore). Changes made with wp_style_set / wp_header_set are stored in the database and win over the child's files.",
17246
+ description: "Change a Maggie child theme's files (default: the active child): brand colours (by name, hex) and fonts (by name, CSS font-family of fonts already in it) in theme.json, extra theme.json styles, plain CSS (replace or append), the site's own JavaScript (assets/js/site.js, replace or append; runs for every visitor), the header or footer (block markup), templates, and the site's own patterns (shown in the editor's inserter). No PHP or server code. Each change keeps a backup (wp_child_theme_restore). Changes made with wp_style_set / wp_header_set are stored in the database and win over the child's files.",
17247
17247
  parameters: {
17248
17248
  type: "object",
17249
17249
  properties: {
@@ -17264,6 +17264,10 @@ var childTools = [
17264
17264
  styles: obj('theme.json styles to merge in (e.g. { "elements": { "button": { \u2026 } } }).'),
17265
17265
  css: str2("Replace the child's CSS (plain CSS)."),
17266
17266
  css_append: str2("Add CSS at the end."),
17267
+ js: str2(
17268
+ `Replace the site's own script (assets/js/site.js, plain JavaScript loaded deferred on every page; "" turns it off). Needs Maggie Core 0.12+ and a login allowed to add scripts. No eval or new Function; addresses only on the site or cdn.jsdelivr.net, unpkg.com, cdnjs.cloudflare.com.`
17269
+ ),
17270
+ js_append: str2("Add JavaScript at the end of the site's script."),
17267
17271
  header: str2("Header block markup (parts/header.html)."),
17268
17272
  footer: str2("Footer block markup (parts/footer.html)."),
17269
17273
  templates: obj('Templates by slug \u2192 block markup, e.g. { "page-landing": "\u2026" }.'),
@@ -17277,8 +17281,8 @@ var childTools = [
17277
17281
  gates: [...GATES],
17278
17282
  confirm: (a, lang) => say(
17279
17283
  lang,
17280
- `Change the child theme ${q2(a.slug, "(the active one)")} on your website.`,
17281
- `\u4FEE\u6539\u7DB2\u7AD9\u7684\u5B50\u4E3B\u984C ${q2(a.slug, "\uFF08\u76EE\u524D\u4F7F\u7528\u4E2D\u7684\uFF09")}\u3002`
17284
+ `Change the child theme ${q2(a.slug, "(the active one)")} on your website.${typeof a.js === "string" || typeof a.js_append === "string" ? a.js === "" ? " Turns off the site's own script." : " Includes JavaScript that runs in every visitor's browser on every page." : ""}`,
17285
+ `\u4FEE\u6539\u7DB2\u7AD9\u7684\u5B50\u4E3B\u984C ${q2(a.slug, "\uFF08\u76EE\u524D\u4F7F\u7528\u4E2D\u7684\uFF09")}\u3002${typeof a.js === "string" || typeof a.js_append === "string" ? a.js === "" ? "\u95DC\u9589\u7DB2\u7AD9\u81EA\u8A02\u8173\u672C\u3002" : "\u5305\u542B\u6703\u5728\u6BCF\u4F4D\u8A2A\u5BA2\u700F\u89BD\u5668\u3001\u6BCF\u500B\u9801\u9762\u57F7\u884C\u7684 JavaScript\u3002" : ""}`
17282
17286
  ),
17283
17287
  run: async (ctx, a) => {
17284
17288
  const site = siteOf(ctx);
@@ -17376,6 +17380,22 @@ var childTools = [
17376
17380
  if (typeof a.css_append === "string")
17377
17381
  files["style.css"] = `${(files["style.css"] ?? cur["style.css"] ?? "").replace(/\n*$/, "\n")}${a.css_append}
17378
17382
  `;
17383
+ if (typeof a.js === "string" || typeof a.js_append === "string") {
17384
+ const parentV = String(info.parent?.version ?? "0");
17385
+ const [maj, min] = parentV.split(".").map(Number);
17386
+ if ((maj ?? 0) === 0 && (min ?? 0) < 12)
17387
+ throw new Error(
17388
+ `The site's script needs Maggie Core 0.12 or later (the site has ${parentV}): update it with wp_theme_update first.`
17389
+ );
17390
+ const js = typeof a.js === "string" ? a.js : `${(cur["assets/js/site.js"] ?? "").replace(/\n*$/, "\n")}${String(a.js_append)}
17391
+ `.trimStart();
17392
+ if (/<\/?script\b/i.test(js)) throw new Error("js: plain JavaScript only, no <script> tags.");
17393
+ if (/<\?(php|=)?/i.test(js)) throw new Error("js: PHP isn't allowed.");
17394
+ files["assets/js/site.js"] = js;
17395
+ notes.push(
17396
+ js.trim() ? "assets/js/site.js runs deferred on every page; undo with wp_child_theme_restore." : "The site's own script is off."
17397
+ );
17398
+ }
17379
17399
  const markup = (path2, m) => {
17380
17400
  if (typeof m !== "string" || !m.trim()) return;
17381
17401
  if (!parse(m).some((b) => b.name)) throw new Error(`${path2}: give block markup (<!-- wp:\u2026 -->).`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmo-so/mcp",
3
- "version": "0.12.9",
3
+ "version": "0.12.10",
4
4
  "description": "CMO.so's MCP server for Claude Desktop, Cursor, VS Code and other MCP clients: manage your websites, blog posts, LinkedIn queue and results with Maggie.",
5
5
  "type": "module",
6
6
  "license": "MIT",