@awesomate/hosting-mcp 0.45.0 → 0.46.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/dist/index.js CHANGED
@@ -39984,6 +39984,9 @@ function hubGet(config3, path) {
39984
39984
  function hubPost(config3, path, jsonBody = {}, opts = {}) {
39985
39985
  return hubRequest(config3, "POST", path, jsonBody, opts);
39986
39986
  }
39987
+ function hubPut(config3, path, jsonBody = {}) {
39988
+ return hubRequest(config3, "PUT", path, jsonBody);
39989
+ }
39987
39990
  function hubPatch(config3, path, jsonBody = {}) {
39988
39991
  return hubRequest(config3, "PATCH", path, jsonBody);
39989
39992
  }
@@ -41190,6 +41193,8 @@ var TITLES = {
41190
41193
  awesomate_crm_write: "Write app data records",
41191
41194
  awesomate_crm_queries: "Save and run named data queries",
41192
41195
  awesomate_crm_recipes: "Save named write recipes",
41196
+ awesomate_crm_apps: "Set up sign-in for your own apps",
41197
+ awesomate_crm_app_users: "Manage the people who sign in to your apps",
41193
41198
  awesomate_crm_email: "Draft an email to a contact list"
41194
41199
  };
41195
41200
  function annotate(name, kind) {
@@ -42792,25 +42797,35 @@ server.registerTool(
42792
42797
  "awesomate_crm_kinds",
42793
42798
  {
42794
42799
  annotations: annotate("awesomate_crm_kinds", MUTATING),
42795
- description: "The kinds of app data in the client's own database (the tables an app keeps: jobs, memos, bookings, messages), created directly from here on Support Plus and above. action 'list': every kind with its attributes and links. 'define' {key, label?, label_plural?, attributes, links?}: a new kind; links: [{key, to, label?, required?}] where to is 'contact' or a kind already made, and each shows as <key>_id. 'add_attribute' {kind, attribute}. 'archive_attribute' {kind, key}: leaves the views, values kept. 'archive' {kind}: kept, restorable. No migration and no SQL: a kind is registry rows plus generated views. Business things whose values must be traced to a source (a property, an installed system) are 'tracked' kinds the owner accepts in the hub; they are refused here. Mark an attribute readable_by_ai only when the owner wants Claude and agents to see it, and never for anything sensitive. Confirm the design with the user before defining: a kind is part of their data, not scratch space.",
42800
+ description: "The kinds of app data in the client's own database (the tables an app keeps: jobs, memos, bookings, messages), created directly from here on Support Plus and above. action 'list': every kind with its attributes and links. 'define' {key, label?, label_plural?, attributes, links?}: a new kind; links: [{key, to, label?, required?}] where to is 'contact' or a kind already made, and each shows as <key>_id. 'add_attribute' {kind, attribute}. 'archive_attribute' {kind, key}: leaves the views, values kept. 'archive' {kind}: kept, restorable. No migration and no SQL: a kind is registry rows plus generated views. Business things whose values must be traced to a source (a property, an installed system) are 'tracked' kinds the owner accepts in the hub; they are refused here. Mark an attribute readable_by_ai only when the owner wants Claude and agents to see it, and never for anything sensitive. 'set_access' {kind, access} (or access on define): who among the people signed in to the account's apps (awesomate_crm_apps) may read and change records of this kind, by their role: {read: {<role>: <rule>}, write: {<role>: <rule>}}. A rule is all, none, own (records they created), or linked:<link path ending at a contact> (linked:customer: jobs whose customer is them; linked:job.customer: memos on their jobs), joined with |. A role with no rule gets nothing; the default lets owner and staff do everything and members nothing. A write must leave the record inside the person's rule. Confirm the design with the user before defining: a kind is part of their data, not scratch space.",
42796
42801
  inputSchema: {
42797
- action: external_exports.enum(["list", "define", "add_attribute", "archive_attribute", "archive"]),
42798
- kind: external_exports.string().max(41).optional().describe("the kind to change (add_attribute, archive_attribute, archive)"),
42802
+ action: external_exports.enum(["list", "define", "add_attribute", "archive_attribute", "archive", "set_access"]),
42803
+ kind: external_exports.string().max(41).optional().describe("the kind to change (add_attribute, archive_attribute, archive, set_access)"),
42799
42804
  key: external_exports.string().max(41).optional().describe("define: the new kind; archive_attribute: the attribute"),
42800
42805
  label: external_exports.string().max(80).optional(),
42801
42806
  label_plural: external_exports.string().max(80).optional(),
42802
42807
  attributes: external_exports.array(crmAttribute).max(60).optional(),
42803
42808
  links: external_exports.array(external_exports.object({ key: external_exports.string().max(38), to: external_exports.string().max(41), label: external_exports.string().max(80).optional(), to_label: external_exports.string().max(80).optional(), required: external_exports.boolean().optional() })).max(20).optional(),
42804
- attribute: crmAttribute.optional().describe("add_attribute")
42809
+ attribute: crmAttribute.optional().describe("add_attribute"),
42810
+ access: external_exports.object({
42811
+ read: external_exports.record(external_exports.string().max(200)).optional(),
42812
+ write: external_exports.record(external_exports.string().max(200)).optional()
42813
+ }).optional().describe("define / set_access: {read: {<role>: <rule>}, write: {<role>: <rule>}}")
42805
42814
  }
42806
42815
  },
42807
- async ({ action, kind, key, label, label_plural, attributes, links, attribute }) => {
42816
+ async ({ action, kind, key, label, label_plural, attributes, links, attribute, access }) => {
42808
42817
  try {
42809
42818
  const cfg = requireConfig();
42810
42819
  if (action === "list") return textResult(await hubGet(cfg, "/api/my-crm/v1/kinds"));
42811
- if (action === "define") return textResult(await hubPost(cfg, "/api/my-crm/v1/kinds", { key, label, label_plural, attributes: attributes ?? [], links: links ?? [] }));
42820
+ if (action === "define") {
42821
+ return textResult(await hubPost(cfg, "/api/my-crm/v1/kinds", { key, label, label_plural, attributes: attributes ?? [], links: links ?? [], ...access ? { access } : {} }));
42822
+ }
42812
42823
  if (!kind) return errorResult(new Error(`${action} needs the kind.`));
42813
42824
  const k = encodeURIComponent(kind);
42825
+ if (action === "set_access") {
42826
+ if (!access) return errorResult(new Error("set_access needs access: {read: {<role>: <rule>}, write: {<role>: <rule>}}."));
42827
+ return textResult(await hubPut(cfg, `/api/my-crm/v1/kinds/${k}/access`, { access }));
42828
+ }
42814
42829
  if (action === "add_attribute") return textResult(await hubPost(cfg, `/api/my-crm/v1/kinds/${k}/attributes`, { attribute }));
42815
42830
  if (action === "archive_attribute") {
42816
42831
  if (!key) return errorResult(new Error("archive_attribute needs key, the attribute."));
@@ -42855,6 +42870,64 @@ server.registerTool(
42855
42870
  }
42856
42871
  }
42857
42872
  );
42873
+ server.registerTool(
42874
+ "awesomate_crm_apps",
42875
+ {
42876
+ annotations: annotate("awesomate_crm_apps", MUTATING),
42877
+ description: "The account's own apps (a client portal, a members' app) whose users sign in by email link and then read and change only what each kind's access rules allow them (awesomate_crm_kinds set_access). Pro and above to create or change; reading is every plan. action 'list': each app with its publishable key, allowed origins, sign-up mode and default role. action 'create' {name, allowed_origins, sign_up?, default_role?}: name appears in the sign-in email; allowed_origins are the exact origins the app runs on (https://portal.example.com; http://localhost:5173 for development; capacitor://localhost for the mobile shell), with no path and no wildcard; sign_up 'invite' (default: only people added with awesomate_crm_app_users) or 'open' (anyone who uses the email link gets the default role). action 'update' {app_id, ...any of those, status?}: status 'disabled' signs everyone out of that app. The publishable key (pk_...) is not a secret: it goes in the app's browser code, with @awesomate/sdk. Never put the account's own token (amt_pat_...) in browser code. Confirm origins and sign-up mode with the user: open sign-up lets strangers in under the default role.",
42878
+ inputSchema: {
42879
+ action: external_exports.enum(["list", "create", "update"]),
42880
+ app_id: external_exports.string().max(48).optional().describe("update: the app"),
42881
+ name: external_exports.string().max(80).optional(),
42882
+ allowed_origins: external_exports.array(external_exports.string().max(200)).max(10).optional(),
42883
+ sign_up: external_exports.enum(["invite", "open"]).optional(),
42884
+ default_role: external_exports.string().max(31).optional().describe("lower case; the role open sign-up gives"),
42885
+ status: external_exports.enum(["active", "disabled"]).optional().describe("update only")
42886
+ }
42887
+ },
42888
+ async ({ action, app_id, name, allowed_origins, sign_up, default_role, status }) => {
42889
+ try {
42890
+ const cfg = requireConfig();
42891
+ if (action === "list") return textResult(await hubGet(cfg, "/api/my-crm/v1/apps"));
42892
+ const fields = Object.fromEntries(Object.entries({ name, allowed_origins, sign_up, default_role }).filter(([, v]) => v !== void 0));
42893
+ if (action === "create") return textResult(await hubPost(cfg, "/api/my-crm/v1/apps", fields));
42894
+ if (!app_id) return errorResult(new Error("update needs app_id, from list."));
42895
+ return textResult(await hubPatch(cfg, `/api/my-crm/v1/apps/${encodeURIComponent(app_id)}`, { ...fields, ...status ? { status } : {} }));
42896
+ } catch (err) {
42897
+ return errorResult(err);
42898
+ }
42899
+ }
42900
+ );
42901
+ server.registerTool(
42902
+ "awesomate_crm_app_users",
42903
+ {
42904
+ annotations: annotate("awesomate_crm_app_users", MUTATING),
42905
+ description: "The people who sign in to the account's apps (awesomate_crm_apps): their email, role, the contact they are (matched on email when they are added or first sign in), last sign-in and whether they are disabled. Pro and above to change; reading is every plan. action 'list'. action 'add' {email, role?}: lets them sign in to an invite-only app (no email is sent; they ask for a link in the app). action 'update' {id, role?, disabled?, contact_id?}: a role change applies to their very next request; disabled: true stops their next request and signs them out of every app at once; contact_id links them to a contact (null unlinks), which is what linked: rules follow. These are people's email addresses: show them only when the user asks, and never paste them anywhere else.",
42906
+ inputSchema: {
42907
+ action: external_exports.enum(["list", "add", "update"]),
42908
+ id: external_exports.string().max(64).optional().describe("update: the person's id from list"),
42909
+ email: external_exports.string().max(254).optional().describe("add"),
42910
+ role: external_exports.string().max(31).optional().describe("lower case: owner, staff, member, or one of your own"),
42911
+ disabled: external_exports.boolean().optional(),
42912
+ contact_id: external_exports.string().max(64).nullable().optional()
42913
+ }
42914
+ },
42915
+ async ({ action, id, email: email2, role, disabled, contact_id }) => {
42916
+ try {
42917
+ const cfg = requireConfig();
42918
+ if (action === "list") return textResult(await hubGet(cfg, "/api/my-crm/v1/app-users"));
42919
+ if (action === "add") {
42920
+ if (!email2) return errorResult(new Error("add needs the email."));
42921
+ return textResult(await hubPost(cfg, "/api/my-crm/v1/app-users", { email: email2, ...role ? { role } : {} }));
42922
+ }
42923
+ if (!id) return errorResult(new Error("update needs id, from list."));
42924
+ const patch = Object.fromEntries(Object.entries({ role, disabled, contact_id }).filter(([, v]) => v !== void 0));
42925
+ return textResult(await hubPatch(cfg, `/api/my-crm/v1/app-users/${encodeURIComponent(id)}`, patch));
42926
+ } catch (err) {
42927
+ return errorResult(err);
42928
+ }
42929
+ }
42930
+ );
42858
42931
  var crmParam = external_exports.object({
42859
42932
  name: external_exports.string().max(41).describe("lower_case"),
42860
42933
  type: external_exports.enum(["text", "number", "date", "datetime", "boolean", "uuid", "text_list", "number_list"]).optional().describe("default text"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/hosting-mcp",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "description": "Awesomate MCP server — lets Claude manage your Awesomate WordPress hosting, plan, limits, n8n automations, and build Node/static apps + databases",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -1,5 +1,13 @@
1
1
  {
2
2
  "versions": [
3
+ {
4
+ "version": "0.46.0",
5
+ "highlights": [
6
+ "Your own apps can now sign people in. Claude can set up an app (awesomate_crm_apps): where it runs, whether anyone can sign up or only people you add, and the key that goes in the app. Each person gets an email link, no passwords. Pro and above",
7
+ "You decide who sees what, per kind of record: members see their own jobs and the memos on them, staff see everything (awesomate_crm_kinds, set_access). The rules are kept in your own database, so a mistake in an app can't show anyone more",
8
+ "Add, re-role or switch off the people who sign in (awesomate_crm_app_users). Switching someone off takes effect on their very next click and signs them out everywhere"
9
+ ]
10
+ },
3
11
  {
4
12
  "version": "0.45.0",
5
13
  "highlights": [