@cmo-so/cli 0.12.19 → 0.12.20

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.mjs +115 -2
  2. package/package.json +1 -1
package/dist/cmo.mjs CHANGED
@@ -38047,7 +38047,23 @@ var MB_RESOURCES = {
38047
38047
  write: false,
38048
38048
  what: "booking rules, location, languages (change with wp_booking_settings_set)"
38049
38049
  },
38050
- imports: { path: "/import", write: false, what: "import history (undo with wp_booking_import undo_id)" }
38050
+ imports: { path: "/import", write: false, what: "import history (undo with wp_booking_import undo_id)" },
38051
+ products: { path: "/products", write: true, what: "retail products with price, tax, stock and low-stock level" },
38052
+ sales: { path: "/sales", write: false, what: "till sales (items, payments, refunds); search, id \u2192 one sale" },
38053
+ plans: { path: "/plans", write: true, what: "prepaid packages and membership plans for sale" },
38054
+ memberships: {
38055
+ path: "/memberships",
38056
+ write: false,
38057
+ what: "customers' memberships (pause, cancel\u2026 with wp_booking_membership)"
38058
+ },
38059
+ loyalty: { path: "/loyalty", write: false, what: "loyalty programme settings and points" },
38060
+ campaigns: {
38061
+ path: "/campaigns",
38062
+ write: true,
38063
+ what: "email campaigns (subject, body, button, segment) \u2014 send with wp_booking_campaign_send"
38064
+ },
38065
+ automations: { path: "/automations", write: false, what: "automated emails: we miss you, time to rebook, birthday" },
38066
+ messages: { path: "/messages", write: false, what: "conversations with customers; id = customer id \u2192 the thread" }
38051
38067
  };
38052
38068
  var bookingTools = [
38053
38069
  tool({
@@ -38475,6 +38491,103 @@ var bookingTools = [
38475
38491
  }
38476
38492
  }
38477
38493
  }),
38494
+ tool({
38495
+ name: "wp_booking_reports",
38496
+ description: "Business reports for a date range (from/to Y-m-d, venue time; group day | week | month): revenue (bookings and till sales), bookings by status, no-show rate, by treatment, by team member, by channel, new vs returning customers, gift cards sold vs redeemed. team_pay true: each team member's pay (commission on treatments, products and tips plus hourly pay). Read-only.",
38497
+ parameters: {
38498
+ type: "object",
38499
+ properties: {
38500
+ from: str2("From (Y-m-d)."),
38501
+ to: str2("To (Y-m-d)."),
38502
+ group: str2("day | week | month"),
38503
+ team_pay: bool("Team pay instead.")
38504
+ }
38505
+ },
38506
+ group: "site",
38507
+ need: READ,
38508
+ risk: "R0",
38509
+ gates: ["WP"],
38510
+ run: (ctx, a3) => mb(ctx, "GET", a3.team_pay ? "/reports/team-pay" : "/reports", void 0, {
38511
+ from: a3.from,
38512
+ to: a3.to,
38513
+ group: a3.group
38514
+ })
38515
+ }),
38516
+ tool({
38517
+ name: "wp_booking_message",
38518
+ description: "Send a customer a message from the business (customer id from wp_booking_list resource customers): they get it by email (and text when SMS is on) with a link to reply; replies show in wp_booking_list resource messages id=<customer id>.",
38519
+ parameters: {
38520
+ type: "object",
38521
+ properties: {
38522
+ customer_id: int2("Customer id."),
38523
+ body: str2("The message (plain text)."),
38524
+ booking_id: int2("About this booking (optional).")
38525
+ },
38526
+ required: ["customer_id", "body"]
38527
+ },
38528
+ group: "site",
38529
+ need: WRITE,
38530
+ risk: "W2",
38531
+ gates: [...GATES],
38532
+ confirm: (a3, lang) => say(
38533
+ lang,
38534
+ `Send customer #${a3.customer_id} this message by email: ${q2(a3.body, "")}`,
38535
+ `\u4EE5\u96FB\u90F5\u767C\u9001\u6B64\u8A0A\u606F\u7D66\u5BA2\u6236 #${a3.customer_id}\uFF1A${q2(a3.body, "")}`
38536
+ ),
38537
+ run: (ctx, a3) => mb(ctx, "POST", `/messages/${Number(a3.customer_id)}`, { body: a3.body, booking_id: a3.booking_id })
38538
+ }),
38539
+ tool({
38540
+ name: "wp_booking_campaign_send",
38541
+ description: "Send (or schedule with at, ISO time) an email campaign saved with wp_booking_save resource campaigns. Only customers who agreed to marketing emails get it, each with an unsubscribe link. Check the audience first: wp_booking_list resource campaigns id=<id>.",
38542
+ parameters: {
38543
+ type: "object",
38544
+ properties: {
38545
+ id: int2("Campaign id."),
38546
+ at: str2("Send at (ISO time); default now."),
38547
+ cancel: bool("Cancel a scheduled or running send instead.")
38548
+ },
38549
+ required: ["id"]
38550
+ },
38551
+ group: "site",
38552
+ need: WRITE,
38553
+ risk: "W3",
38554
+ gates: [...GATES],
38555
+ confirm: (a3, lang) => a3.cancel ? say(lang, `Stop campaign #${a3.id}.`, `\u505C\u6B62\u63A8\u5EE3\u6D3B\u52D5 #${a3.id}\u3002`) : say(
38556
+ lang,
38557
+ `Email campaign #${a3.id} to every customer in its audience who agreed to marketing emails${a3.at ? ` at ${a3.at}` : " now"}.`,
38558
+ `\u628A\u63A8\u5EE3\u6D3B\u52D5 #${a3.id}${a3.at ? `\u65BC ${a3.at}` : "\u7ACB\u5373"}\u5BC4\u7D66\u53D7\u773E\u4E2D\u540C\u610F\u63A5\u6536\u884C\u92B7\u96FB\u90F5\u7684\u5BA2\u6236\u3002`
38559
+ ),
38560
+ run: (ctx, a3) => mb(ctx, "POST", `/campaigns/${Number(a3.id)}/${a3.cancel ? "cancel" : "send"}`, a3.cancel ? {} : { at: a3.at })
38561
+ }),
38562
+ tool({
38563
+ name: "wp_booking_membership",
38564
+ description: "Change a customer's membership (id from wp_booking_list resource memberships): pause, resume, cancel (at the end of the period), cancel_now, add_sessions (sessions), add_credit (amount_minor), mark_paid (a renewal paid at the desk) or charge (retry the renewal on the saved card).",
38565
+ parameters: {
38566
+ type: "object",
38567
+ properties: {
38568
+ id: int2("Membership id."),
38569
+ action: str2("pause | resume | cancel | cancel_now | add_sessions | add_credit | mark_paid | charge"),
38570
+ sessions: int2("For add_sessions."),
38571
+ amount_minor: int2("For add_credit."),
38572
+ note: str2("Note.")
38573
+ },
38574
+ required: ["id", "action"]
38575
+ },
38576
+ group: "site",
38577
+ need: WRITE,
38578
+ risk: "W3",
38579
+ gates: [...GATES],
38580
+ confirm: (a3, lang) => say(
38581
+ lang,
38582
+ `Membership #${a3.id}: ${a3.action}${a3.action === "charge" ? " (charges the saved card)" : ""}.`,
38583
+ `\u6703\u7C4D #${a3.id}\uFF1A${a3.action}${a3.action === "charge" ? "\uFF08\u5F9E\u5DF2\u5B58\u5361\u7247\u6263\u6B3E\uFF09" : ""}\u3002`
38584
+ ),
38585
+ run: (ctx, a3) => mb(ctx, "POST", `/memberships/${Number(a3.id)}/${String(a3.action)}`, {
38586
+ sessions: a3.sessions,
38587
+ amount_minor: a3.amount_minor,
38588
+ note: a3.note
38589
+ })
38590
+ }),
38478
38591
  tool({
38479
38592
  name: "wp_booking_translate",
38480
38593
  description: "Read or write the translations of booking content (type service | variant | category | staff | voucher, id, lang such as zh-hans or es; fields name, description). Without fields: read. The site's extra languages are set with wp_booking_settings_set settings.languages.",
@@ -41953,7 +42066,7 @@ var program = new Command();
41953
42066
  // package.json
41954
42067
  var package_default = {
41955
42068
  name: "@cmo-so/cli",
41956
- version: "0.12.19",
42069
+ version: "0.12.20",
41957
42070
  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.",
41958
42071
  type: "module",
41959
42072
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmo-so/cli",
3
- "version": "0.12.19",
3
+ "version": "0.12.20",
4
4
  "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.",
5
5
  "type": "module",
6
6
  "license": "MIT",