@cmo-so/mcp 0.12.7 → 0.12.8

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 +73 -6
  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.7",
7202
+ version: "0.12.8",
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",
@@ -17187,7 +17187,7 @@ var childTools = [
17187
17187
  files[`assets/fonts/${name}`] = btoa(bin);
17188
17188
  let fam = fams.find((x) => x.slug === f.slug);
17189
17189
  const stack = `"${f.family}", ${f.fallback || "sans-serif"}`;
17190
- if (!fam || !fam.fontFamily.includes(`"${f.family}"`)) {
17190
+ if (!fam?.fontFamily.includes(`"${f.family}"`)) {
17191
17191
  const keep = fam ? fams.indexOf(fam) : -1;
17192
17192
  fam = { slug: f.slug, name: f.family, fontFamily: stack, fontFace: [] };
17193
17193
  if (keep >= 0) fams[keep] = fam;
@@ -18006,6 +18006,49 @@ var fullTools = [
18006
18006
  });
18007
18007
  }
18008
18008
  }),
18009
+ tool({
18010
+ name: "wp_term_delete",
18011
+ description: "Delete a category or tag by id. Posts keep their other terms; posts left without a category go to the default category, which can't be deleted. Terms have no trash: the result gives name, slug and description to recreate it with wp_term_save.",
18012
+ parameters: {
18013
+ type: "object",
18014
+ properties: {
18015
+ taxonomy: { type: "string", enum: ["categories", "tags"], description: "Default categories." },
18016
+ id: int2("The term to delete (from wp_terms_list).")
18017
+ },
18018
+ required: ["id"]
18019
+ },
18020
+ group: "site",
18021
+ need: WRITE,
18022
+ risk: "W3",
18023
+ gates: [...GATES],
18024
+ confirm: (a, lang) => say(
18025
+ lang,
18026
+ `Delete the ${a.taxonomy === "tags" ? "tag" : "category"} #${String(a.id)} from your website (posts stay; it can be recreated, not restored).`,
18027
+ `\u522A\u9664\u7DB2\u7AD9\u7684${a.taxonomy === "tags" ? "\u6A19\u7C64" : "\u5206\u985E"} #${String(a.id)}\uFF08\u6587\u7AE0\u4FDD\u7559\uFF1B\u53EF\u91CD\u65B0\u5EFA\u7ACB\uFF0C\u7121\u6CD5\u9084\u539F\uFF09\u3002`
18028
+ ),
18029
+ run: async (ctx, a) => {
18030
+ const site = siteOf(ctx);
18031
+ const tax = a.taxonomy === "tags" ? "tags" : "categories";
18032
+ const id = Number(a.id);
18033
+ if (!Number.isInteger(id) || id <= 0) throw new Error("id: the term id from wp_terms_list.");
18034
+ if (tax === "categories") {
18035
+ const st = await call(site, {
18036
+ path: "/wp/v2/settings",
18037
+ query: { _fields: "default_category" }
18038
+ });
18039
+ if (Number(st.default_category ?? 1) === id)
18040
+ throw new Error("That is the default category; it can't be deleted.");
18041
+ }
18042
+ const before = await call(site, { path: `/wp/v2/${tax}/${id}`, query: { _fields: "id,name,slug,description,count,parent" } });
18043
+ await call(site, { method: "DELETE", path: `/wp/v2/${tax}/${id}`, query: { force: "true" } });
18044
+ return {
18045
+ deleted: true,
18046
+ taxonomy: tax,
18047
+ ...before,
18048
+ undo: `wp_term_save ${tax} name "${before.name}" slug ${before.slug}`
18049
+ };
18050
+ }
18051
+ }),
18009
18052
  tool({
18010
18053
  name: "wp_settings_get",
18011
18054
  description: "The site's general settings: title, tagline, search-engine visibility, language, timezone, date and time formats, start of week, posts per page, homepage and posts page, logo and icon.",
@@ -18091,7 +18134,7 @@ var fullTools = [
18091
18134
  }),
18092
18135
  tool({
18093
18136
  name: "wp_plugin_set",
18094
- description: "Install a plugin from WordPress.org by its slug (e.g. wpforms-lite), and/or activate or deactivate an installed one (plugin id from wp_plugins_list, e.g. akismet/akismet). Plugins can't be deleted from here. Installing runs the plugin's code on the site: only well-known plugins the owner asked for.",
18137
+ description: "Install a plugin from WordPress.org by its slug (e.g. wpforms-lite), and/or activate, deactivate or delete an installed one (plugin id from wp_plugins_list, e.g. akismet/akismet; only an inactive plugin can be deleted, and its settings may go with it). Installing runs the plugin's code on the site: only well-known plugins the owner asked for.",
18095
18138
  parameters: {
18096
18139
  type: "object",
18097
18140
  properties: {
@@ -18099,8 +18142,8 @@ var fullTools = [
18099
18142
  plugin: str2("Installed plugin id (folder/file) to change."),
18100
18143
  status: {
18101
18144
  type: "string",
18102
- enum: ["active", "inactive"],
18103
- description: "Activate or deactivate (after installing, default inactive)."
18145
+ enum: ["active", "inactive", "deleted"],
18146
+ description: "Activate, deactivate (after installing, default inactive), or deleted: remove an inactive plugin's files (deactivate it first; Maggie Press can't be removed here)."
18104
18147
  }
18105
18148
  }
18106
18149
  },
@@ -18112,6 +18155,10 @@ var fullTools = [
18112
18155
  lang,
18113
18156
  `Install the plugin ${q2(a.install, "")} from WordPress.org on your website${a.status === "active" ? " and activate it" : ""}.`,
18114
18157
  `\u5728\u7DB2\u7AD9\u4E0A\u5B89\u88DD WordPress.org \u63D2\u4EF6 ${q2(a.install, "")}${a.status === "active" ? "\u4E26\u555F\u7528" : ""}\u3002`
18158
+ ) : a.status === "deleted" ? say(
18159
+ lang,
18160
+ `Delete the plugin ${q2(a.plugin, "")} from your website (its files are removed; reinstall it from WordPress.org to undo, its settings may be lost).`,
18161
+ `\u5F9E\u7DB2\u7AD9\u522A\u9664\u63D2\u4EF6 ${q2(a.plugin, "")}\uFF08\u6A94\u6848\u6703\u88AB\u79FB\u9664\uFF1B\u53EF\u5F9E WordPress.org \u91CD\u65B0\u5B89\u88DD\uFF0C\u8A2D\u5B9A\u53EF\u80FD\u907A\u5931\uFF09\u3002`
18115
18162
  ) : say(
18116
18163
  lang,
18117
18164
  `${a.status === "active" ? "Activate" : "Deactivate"} the plugin ${q2(a.plugin, "")} on your website.`,
@@ -18132,9 +18179,29 @@ var fullTools = [
18132
18179
  if (!a.plugin || !a.status) throw new Error("Give install (a slug), or plugin and status.");
18133
18180
  if (!/^[a-z0-9._-]+(\/[a-z0-9._-]+)?$/i.test(String(a.plugin)))
18134
18181
  throw new Error("plugin: the id from wp_plugins_list, e.g. akismet/akismet.");
18182
+ const id = String(a.plugin).replace(/\.php$/, "");
18183
+ if (a.status === "deleted") {
18184
+ if (/^maggie-?press\//i.test(id))
18185
+ throw new Error("Maggie Press runs the site's styles; it can't be deleted here.");
18186
+ const cur = await call(site, {
18187
+ path: `/wp/v2/plugins/${id}`,
18188
+ query: { _fields: "plugin,name,version,status" }
18189
+ });
18190
+ if (cur.status !== "inactive")
18191
+ throw new Error(`${cur.name} is ${cur.status}: deactivate it first (status inactive), then delete it.`);
18192
+ await call(site, { method: "DELETE", path: `/wp/v2/plugins/${id}` });
18193
+ const slug = id.split("/")[0];
18194
+ return {
18195
+ deleted: true,
18196
+ plugin: cur.plugin,
18197
+ name: cur.name,
18198
+ version: cur.version,
18199
+ undo: `wp_plugin_set install ${slug}`
18200
+ };
18201
+ }
18135
18202
  return call(site, {
18136
18203
  method: "POST",
18137
- path: `/wp/v2/plugins/${String(a.plugin).replace(/\.php$/, "")}`,
18204
+ path: `/wp/v2/plugins/${id}`,
18138
18205
  query: { _fields: "plugin,name,version,status" },
18139
18206
  body: { status: a.status }
18140
18207
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmo-so/mcp",
3
- "version": "0.12.7",
3
+ "version": "0.12.8",
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",