@awesomate/hosting-mcp 0.171.45 → 0.171.55
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 +202 -72
- package/package.json +1 -1
- package/skill/CHANGELOG.json +10 -0
- package/skill/awesomate-funnels/SKILL.md +1 -1
- package/skill/awesomate-hosting/SKILL.md +39 -22
- package/skill/awesomate-hosting/scripts/agent-clients.mjs +41 -7
- package/skill/awesomate-hosting/scripts/bootstrap.mjs +38 -2
- package/skill/awesomate-seo/SKILL.md +34 -21
- package/skill/awesomate-support/SKILL.md +36 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesomate/hosting-mcp",
|
|
3
|
-
"version": "0.171.
|
|
3
|
+
"version": "0.171.55",
|
|
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",
|
package/skill/CHANGELOG.json
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"versions": [
|
|
3
|
+
{"version": "0.171.55", "highlights": ["In Claude and ChatGPT chat, where the account has chat_more: awesomate_bookings (setup and open times only; never the diary, one booking or the website booking keys), awesomate_webinars (zoom, list, get and attendance counts; never a name) and awesomate_privacy_settings (read; changing a setting stays in the hub) are offered as reads, to read-only connections too. The support desk stays off chat. Claude Code is unchanged."]},
|
|
4
|
+
{"version": "0.171.54", "highlights": ["Changing a WordPress site from Claude (posts and pages, settings, media, WP-CLI, creating a site, adding a domain) now follows `site_manage` in awesomate_get_context: always on Support Plus and above, and on Essentials once Awesomate turns it on for the account. Snapshots and staging copies follow `capabilities.shell`; when it is false, Claude says the site has no restore point and asks before changing the live site. On Essentials with `site_manage`, a ticket about using the products answers `outside_plan`, which Claude relays with what Support Plus adds. The awesomate-seo, awesomate-hosting, awesomate-funnels and awesomate-support skills say the same."]},
|
|
5
|
+
{"version": "0.171.53", "highlights": ["awesomate_help_centre can check how the business's help centre answers. `search` {q} shows what a visitor finds, and `ask` {q} shows the centre's assistant's answer and sources; each check spends one Knowledge answer, and Claude says so first. awesomate_help_centre_change adds `update_topic`, and `icon` on `create_topic` and `update_topic` sets the picture beside a topic on the help pages. `centre` also gives `publicApi` and `v2` for help pages built with the SDK's createHelpClient."]},
|
|
6
|
+
{"version": "0.171.52", "highlights": ["From Claude or ChatGPT chat, awesomate_wp_post_change says how publishing works there: asking to publish or make a post private saves it as a draft and puts a Publish card in the owner's Tasks in the hub, and nothing goes live until an owner taps it. A change to a live post's title, content or excerpt files a card holding the new words, reported in `liveEdit`; asking for either card needs the account's Tasks and chat_more. Claude Code's description no longer mentions chat."]},
|
|
7
|
+
{"version": "0.171.51", "highlights": ["A new business on its first week path: awesomate_get_context's attention carries firstWeek ({next: {key, label, line, url} | null, done, of, complete}), the path's next step and its hub link, read by the account itself and not while the first session holds. The hosting skill names that step once a session, after the asked task, and never starts it for the owner."]},
|
|
8
|
+
{"version": "0.171.50", "highlights": ["In Claude and ChatGPT chat, where the account has chat_more: awesomate_get_hosting_account (the login name masked), awesomate_php_extensions (check only; enabling them stays in Claude Code) and awesomate_scenes (read; building, placing and file links stay in Claude Code) are offered as reads, to read-only connections too. Claude Code is unchanged."]},
|
|
9
|
+
{"version": "0.171.49", "highlights": ["In Claude and ChatGPT chat, where the account has chat_more: awesomate_n8n_inspect (nodes, datatables, possibilities; never data table rows), awesomate_n8n_node_docs, awesomate_n8n_storage and awesomate_n8n_agents (status, describe) are offered as reads, to read-only connections too. Claude Code is unchanged."]},
|
|
10
|
+
{"version": "0.171.48", "highlights": ["awesomate_support_desk_change works on the business's own support tickets with the new inbox: draft_reply holds a reply as Claude Code's suggestion for a person on the team to send, edit or discard in the hub (it goes from that person), add_note adds a note only the team sees, set_status changes a ticket's status (solving it sends no closing email), and assign gives a ticket to a person or role from awesomate_support_desk assignees. Nothing here ever emails a customer. awesomate_support_desk list takes the inbox's views (unassigned, mine, open, overdue, pending, hold, solved, spam) with counts, each ticket carries status_word, due_at and overdue, read names suggested_contact_id and who drafted a held reply, and the new assignees action lists who a ticket can go to."]},
|
|
11
|
+
{"version": "0.171.47", "highlights": ["awesomate_crm_contacts activity can show changes to a person's details: the new group 'changes' lists each field the key may read with its before and after (a Sensitive field as changed only) and tags taken off, from when the account began keeping them (CRM migration 077). Behind the contact_timeline feature."]},
|
|
12
|
+
{"version": "0.171.46", "highlights": ["Codex connect polish: the bootstrap and agent-clients scripts handle the cases found in review of the Codex connect work."]},
|
|
3
13
|
{"version": "0.171.45", "highlights": ["The Knowledge guide and skill say usage.playback_gb counts video and audio played, as the hub does."]},
|
|
4
14
|
{"version": "0.171.44", "highlights": ["awesomate_support_desk_change propose_ai: suggest the Inbox AI's settings for the owner to accept in the hub; the knowledge skill says hand-off wording goes in the desk instructions."]},
|
|
5
15
|
{"version": "0.171.43", "highlights": ["Setting up a business starts with its documents: the quickstart suggests \"Set up my business documents\", the business map skill starts a new business's 16 documents (research, then the open questions) before the map rounds, the Knowledge skill checks for the approved business documents' own copies in Knowledge (tagged business-doc) before ingesting the same facts, and the hosting skill reads the documents for a writing job with read 'context' and a purpose."]},
|
|
@@ -166,7 +166,7 @@ give them `reviewUrl`: nobody gets anything until an approver approves it and sw
|
|
|
166
166
|
| No email list yet | Offer a list: propose its name and promise, make it on their OK. A lead magnet works without one (the box is just not there) |
|
|
167
167
|
| The file is on their computer but `awesomate_files status` says Files is off or not on their plan | Put the file on their website first (WordPress Media, Add New), then pass its address as `file.url` |
|
|
168
168
|
| Essentials, and they want the follow-up series | Series are Support Plus and above: say so once and let them decide |
|
|
169
|
-
| Essentials, and they want a new WordPress site from Claude | Creating a site from Claude needs Support Plus and above; they can create one in the hub |
|
|
169
|
+
| Essentials, and they want a new WordPress site from Claude | Creating a site from Claude needs `features.site_manage` (always on Support Plus and above, on Essentials once Awesomate turns it on); without it they can create one in the hub |
|
|
170
170
|
| Webinar registration | `awesomate_webinars` and `awesomate_webinars_change`, with [references/webinar.md](references/webinar.md). When `features.webinars` is not available, say its message and stop; don't improvise one with n8n or Zoom's own registration page |
|
|
171
171
|
|
|
172
172
|
## Never
|
|
@@ -47,6 +47,12 @@ once (plus `awesomate_get_limits` before any create/change) and cache:
|
|
|
47
47
|
("two of your automations failed this week — want me to look?") before the
|
|
48
48
|
asked task, then get on with the task. `null` means unknown, never zero —
|
|
49
49
|
say nothing on null.
|
|
50
|
+
`attention.firstWeek` (only for a new business on its first week path, read
|
|
51
|
+
by the account itself: the owner, or Awesomate staff working in it): `{next: {key, label, line, url} | null, done, of,
|
|
52
|
+
complete}`. When `next` is set, name that step and its `url` ONCE this
|
|
53
|
+
session, after the asked task ("Next on your first week: Your enquiry agent,
|
|
54
|
+
at <url>"), never instead of it. Never start the step for them: each one is
|
|
55
|
+
the owner's own choice in the hub. Absent means no path: say nothing.
|
|
50
56
|
- **`patExpiresAt`** — within ~7 days, or any 401: re-run the setup prompt at
|
|
51
57
|
**hub.awesomate.ai/claude → Connect Claude Code** to refresh the token.
|
|
52
58
|
- **`skill.updateAvailable`** — covers all nine skills; the local files are
|
|
@@ -321,12 +327,12 @@ MCP, so say that rather than stopping.
|
|
|
321
327
|
| `awesomate_rollback_site` | Restore a snapshot after something went wrong (confirm first) |
|
|
322
328
|
| `awesomate_site_staging_create` / `_promote` / `_discard` | Private full copy on awesomate.dev to review changes; publish or throw away (§5a) |
|
|
323
329
|
| `awesomate_run_wp_cli` | **Account owner and Owner-level people only** (anyone else gets 403 `owner_only`: tell them to ask the account owner). The 10 allowlisted WP-CLI verbs only (see below) — plugin/theme list, activate, install-by-slug, update; `cache flush`; `option get`; `post`/`media`/`menu`/`comment`/`user list` |
|
|
324
|
-
| `awesomate_wp_settings` | Site title, tagline, timezone, date/time format, posts-per-page, search-engine visibility
|
|
330
|
+
| `awesomate_wp_settings` | Site title, tagline, timezone, date/time format, posts-per-page, search-engine visibility: THE path for any multi-word value, and it flushes the cache (needs `site_manage`) |
|
|
325
331
|
| `awesomate_elementor_mcp_connect` | A site uses Elementor and pages need building or editing: connects this Claude Code to Elementor's own MCP server on that site (see **Elementor sites** above). Mints an application password; Support Plus+ |
|
|
326
332
|
| `awesomate_wp_post` | List or search WP posts and pages (`list`, to find an id), read one (`get`). Read-only |
|
|
327
|
-
| `awesomate_wp_post_change` | Create/update a WP post or page: drafts by default (
|
|
328
|
-
| `awesomate_wp_media_import` | Pull an image/file into the WP media library from an https URL (
|
|
329
|
-
| `awesomate_uninstall_site` | Remove a WordPress install (destructive
|
|
333
|
+
| `awesomate_wp_post_change` | Create/update a WP post or page: drafts by default (needs `site_manage`) |
|
|
334
|
+
| `awesomate_wp_media_import` | Pull an image/file into the WP media library from an https URL (needs `site_manage`) |
|
|
335
|
+
| `awesomate_uninstall_site` | Remove a WordPress install (destructive: confirm explicitly; Support Plus and above) |
|
|
330
336
|
| `awesomate_privacy_settings` | Read which privacy/consent toggles are on — explain a 403 `consent_required` precisely (the user flips toggles themselves under Settings → Privacy at hub.awesomate.ai/settings?tab=privacy) |
|
|
331
337
|
| `awesomate_tasks` | What is waiting on the owner and their team (`list`), a task's record (`history`), and `decisions` (plus one decision's `decision_record`), read only: a person decides them in the hub |
|
|
332
338
|
| `awesomate_tasks_change` | Giving someone a task (`add`: emailed, and to their linked chats within their quiet hours and daily limit; `urgent: true` only when the user says it can't wait, such as a hot lead or a fault), changing one (`edit`), marking a task done (`done`, only what the user has done), dropping one (`drop`, confirm first), bringing a closed one back (`bring_back`), putting a card off (`not_now` / `cancel_not_now`) and passing a card on (`pass_on`); quotes and approvals stay on their own hub pages |
|
|
@@ -371,7 +377,7 @@ A 400 is a policy answer, not a transport hiccup: don't rephrase and retry.
|
|
|
371
377
|
|
|
372
378
|
| Plan | WP sites | Hosted apps | Custom domains | Shell / Claude Code | Notes |
|
|
373
379
|
|---|---|---|---|---|---|
|
|
374
|
-
| **Essentials** | 1 | 0 | 1 | **No** | read/status
|
|
380
|
+
| **Essentials** | 1 | 0 | 1 | **No** | read/status; WordPress changes from Claude once `site_manage` is on |
|
|
375
381
|
| **Support Plus** | 2 | 5 | 5 | **Yes** | shell, WP-CLI, snapshot/rollback, deploy, app builder |
|
|
376
382
|
| **Pro** | 10 | 20 | 20 | **Yes** | + higher limits |
|
|
377
383
|
| **Embedded** | 100 | 100 | 100 | **Yes** | agency tier, not generally available |
|
|
@@ -384,7 +390,7 @@ recommended plan instead.
|
|
|
384
390
|
|
|
385
391
|
## 2. Branch by capability
|
|
386
392
|
|
|
387
|
-
### Essentials (no shell)
|
|
393
|
+
### Essentials (no shell): read, report, and change WordPress when `site_manage` is on
|
|
388
394
|
|
|
389
395
|
Allowed: `awesomate_get_context`, `_get_hosting_status` (hosting stats),
|
|
390
396
|
`_get_hosting_account`, `_list_sites`, `_list_domains`, `_get_limits` (plan
|
|
@@ -393,22 +399,33 @@ ladder), the other reads (`_dns_check`, `_site_uptime`, `_notifications`,
|
|
|
393
399
|
`_dashboard_metrics`, `_account_report`, `_privacy_settings`), and 1-click
|
|
394
400
|
WP-admin / cPanel SSO links. Billing/plan changes: §4.
|
|
395
401
|
|
|
396
|
-
Never attempt SSH,
|
|
397
|
-
|
|
398
|
-
Support Plus/Pro unlocks (§4), and
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
`
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
402
|
+
Never attempt SSH, deploy, multi-site, hosted apps,
|
|
403
|
+
`awesomate_elementor_mcp_connect` or `awesomate_uninstall_site`: those are
|
|
404
|
+
Support Plus and above and will 403, whatever `site_manage` says. Surface the specific limit and what Support Plus/Pro unlocks (§4), and
|
|
405
|
+
link the hub billing page.
|
|
406
|
+
|
|
407
|
+
**WordPress changes from Claude follow `features.site_manage`** in
|
|
408
|
+
`awesomate_get_context`. When it is available on Essentials (Awesomate turns
|
|
409
|
+
it on account by account), you may create the site and add the domain within
|
|
410
|
+
the plan's counts, and use `awesomate_wp_post_change`,
|
|
411
|
+
`awesomate_wp_media_import`, `awesomate_wp_settings` and `awesomate_run_wp_cli`
|
|
412
|
+
(account owner only) with the same guardrails as every plan. Snapshots and
|
|
413
|
+
staging follow `capabilities.shell`: when it is false, do not call them; say
|
|
414
|
+
you cannot take a restore point from here and get the owner's yes before
|
|
415
|
+
changing the live site.
|
|
416
|
+
|
|
417
|
+
**When `site_manage` is not available, the plan table's "1 site / 1 custom
|
|
418
|
+
domain" is not a Claude allowance.** A PAT is then read-and-advise:
|
|
419
|
+
`awesomate_site_create`, `awesomate_domain_add` and every WordPress write
|
|
420
|
+
are refused (403 `upgrade_required`, or `feature_unavailable` with its own
|
|
421
|
+
message): the server enforces it, so no phrasing gets past it. That site and that domain are real; they are created and changed
|
|
422
|
+
**in the hub UI at hub.awesomate.ai/sites**, by the user, with deliberate
|
|
423
|
+
clicks. Say exactly that rather than letting them discover it as a failure:
|
|
424
|
+
*"Your plan lets me read and advise on your hosting. Creating the site itself
|
|
425
|
+
is a couple of clicks at hub.awesomate.ai/sites (I'll walk you through it),
|
|
426
|
+
or Support Plus lets me do it from here."* That line is for
|
|
427
|
+
`upgrade_required`; for `feature_unavailable`, say its message instead and
|
|
428
|
+
never pitch an upgrade.
|
|
412
429
|
|
|
413
430
|
### Support Plus and above (shell) — full workflow
|
|
414
431
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* its entry's own env, so the entry carries AWESOMATE_CLIENT=codex.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, statSync, writeFileSync } from 'node:fs';
|
|
18
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
|
|
19
19
|
import { join, dirname } from 'node:path';
|
|
20
20
|
|
|
21
21
|
export const SERVER_NAME = 'awesomate-hosting';
|
|
@@ -72,7 +72,7 @@ const tomlString = (s) => JSON.stringify(String(s));
|
|
|
72
72
|
* tool_timeout_sec, ...); keptEnv: their own env keys; keptTables: sub-tables
|
|
73
73
|
* such as [mcp_servers.awesomate-hosting.tools.x], all kept as written.
|
|
74
74
|
*/
|
|
75
|
-
export function codexEntryToml(entry, { keptMain = [], keptEnv = [], keptTables = [] } = {}) {
|
|
75
|
+
export function codexEntryToml(entry, { keptMain = [], keptEnvLead = [], keptEnv = [], keptTables = [] } = {}) {
|
|
76
76
|
const hasTimeout = keptMain.some((l) => /^\s*startup_timeout_sec\s*=/.test(l));
|
|
77
77
|
return [
|
|
78
78
|
`[mcp_servers.${SERVER_NAME}]`,
|
|
@@ -81,6 +81,7 @@ export function codexEntryToml(entry, { keptMain = [], keptEnv = [], keptTables
|
|
|
81
81
|
...(hasTimeout ? [] : ['startup_timeout_sec = 60']),
|
|
82
82
|
...keptMain,
|
|
83
83
|
'',
|
|
84
|
+
...keptEnvLead,
|
|
84
85
|
`[mcp_servers.${SERVER_NAME}.env]`,
|
|
85
86
|
'AWESOMATE_CLIENT = "codex"',
|
|
86
87
|
...keptEnv,
|
|
@@ -110,11 +111,22 @@ export function upsertCodexEntry(text, entry) {
|
|
|
110
111
|
const kept = [];
|
|
111
112
|
const keptMain = [];
|
|
112
113
|
const keptEnv = [];
|
|
114
|
+
const keptEnvLead = [];
|
|
113
115
|
const keptTables = [];
|
|
114
116
|
let section = 'root'; // root | mcp_servers | main | env | sub | other
|
|
115
117
|
let found = false;
|
|
116
118
|
let hadToken = false;
|
|
117
119
|
let skippingArray = false;
|
|
120
|
+
// Comment lines inside our entry that touch the next table's header belong to that table.
|
|
121
|
+
let pendingComments = [];
|
|
122
|
+
const flushComments = () => {
|
|
123
|
+
for (const c of pendingComments) {
|
|
124
|
+
if (section === 'main') keptMain.push(c.trim());
|
|
125
|
+
else if (section === 'env') keptEnv.push(c.trim());
|
|
126
|
+
else if (section === 'sub') keptTables.push(c);
|
|
127
|
+
}
|
|
128
|
+
pendingComments = [];
|
|
129
|
+
};
|
|
118
130
|
const refuse = () => {
|
|
119
131
|
throw new Error(`config.toml defines ${SERVER_NAME} in a form this script will not rewrite`);
|
|
120
132
|
};
|
|
@@ -124,6 +136,11 @@ export function upsertCodexEntry(text, entry) {
|
|
|
124
136
|
continue;
|
|
125
137
|
}
|
|
126
138
|
if (ANY_HEADER.test(line)) {
|
|
139
|
+
// A comment touching a header goes with that header: ours (re-written below it) or the next table's.
|
|
140
|
+
if (OUR_ENV_HEADER.test(line)) { keptEnvLead.push(...pendingComments); pendingComments = []; }
|
|
141
|
+
else if (OUR_HEADER.test(line) && !OUR_MAIN_HEADER.test(line)) { keptTables.push(...pendingComments); pendingComments = []; }
|
|
142
|
+
else if (OUR_MAIN_HEADER.test(line)) flushComments();
|
|
143
|
+
else { kept.push(...pendingComments); pendingComments = []; }
|
|
127
144
|
if (OUR_MAIN_HEADER.test(line)) { section = 'main'; found = true; continue; }
|
|
128
145
|
if (OUR_ENV_HEADER.test(line)) { section = 'env'; found = true; continue; }
|
|
129
146
|
if (OUR_HEADER.test(line)) { section = 'sub'; found = true; keptTables.push(line); continue; }
|
|
@@ -131,6 +148,11 @@ export function upsertCodexEntry(text, entry) {
|
|
|
131
148
|
kept.push(line);
|
|
132
149
|
continue;
|
|
133
150
|
}
|
|
151
|
+
if ((section === 'main' || section === 'env' || section === 'sub') && /^\s*#/.test(line)) {
|
|
152
|
+
pendingComments.push(line);
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
if (section === 'main' || section === 'env' || section === 'sub') flushComments();
|
|
134
156
|
// Dotted or inline forms of our entry, only where they would define it.
|
|
135
157
|
if (
|
|
136
158
|
(section === 'root' && new RegExp(`^\\s*mcp_servers\\s*(\\.\\s*${NAME}\\s*[.=]|=.*${SERVER_NAME})`).test(line)) ||
|
|
@@ -165,9 +187,10 @@ export function upsertCodexEntry(text, entry) {
|
|
|
165
187
|
}
|
|
166
188
|
kept.push(line);
|
|
167
189
|
}
|
|
190
|
+
flushComments();
|
|
168
191
|
while (kept.length && kept[kept.length - 1].trim() === '') kept.pop();
|
|
169
192
|
const body = kept.length ? `${kept.join('\n')}\n\n` : '';
|
|
170
|
-
return { text: `${body}${codexEntryToml(entry, { keptMain, keptEnv, keptTables })}`, found, hadToken };
|
|
193
|
+
return { text: `${body}${codexEntryToml(entry, { keptMain, keptEnvLead, keptEnv, keptTables })}`, found, hadToken };
|
|
171
194
|
}
|
|
172
195
|
|
|
173
196
|
/** Write the Codex registration, read it back, and say what happened. */
|
|
@@ -175,11 +198,21 @@ export function ensureCodexRegistration({ env, home, entry, log = console.log })
|
|
|
175
198
|
const path = join(codexHome(env, home), 'config.toml');
|
|
176
199
|
const exists = existsSync(path);
|
|
177
200
|
const before = exists ? readFileSync(path, 'utf8') : '';
|
|
178
|
-
const
|
|
201
|
+
const upserted = upsertCodexEntry(before, entry);
|
|
202
|
+
const { found, hadToken } = upserted;
|
|
203
|
+
// Keep the file's own line endings: a CRLF file stays CRLF.
|
|
204
|
+
const crlf = (before.match(/\r\n/g) ?? []).length > (before.match(/(?<!\r)\n/g) ?? []).length;
|
|
205
|
+
const text = crlf ? upserted.text.replace(/\r?\n/g, '\r\n') : upserted.text;
|
|
179
206
|
if (text === before) {
|
|
180
207
|
log(`✓ MCP server already registered for Codex in ${path}.`);
|
|
181
208
|
return { path, changed: false };
|
|
182
209
|
}
|
|
210
|
+
// Refuse before touching the file: our own output must read back as our entry and change nothing.
|
|
211
|
+
const selfCheck = (candidate) => {
|
|
212
|
+
const again = upsertCodexEntry(candidate, entry);
|
|
213
|
+
return again.found && (crlf ? again.text.replace(/\r?\n/g, '\r\n') : again.text) === candidate;
|
|
214
|
+
};
|
|
215
|
+
if (!selfCheck(text)) throw new Error(`the ${SERVER_NAME} entry for ${path} did not check out before writing; nothing was changed`);
|
|
183
216
|
mkdirSync(dirname(path), { recursive: true });
|
|
184
217
|
// Keep the file's own mode: config.toml can hold other servers' keys.
|
|
185
218
|
const mode = exists ? statSync(path).mode & 0o777 : 0o600;
|
|
@@ -187,9 +220,10 @@ export function ensureCodexRegistration({ env, home, entry, log = console.log })
|
|
|
187
220
|
writeFileSync(tmp, text, { mode });
|
|
188
221
|
chmodSync(tmp, mode);
|
|
189
222
|
renameSync(tmp, path);
|
|
190
|
-
|
|
191
|
-
if (
|
|
192
|
-
|
|
223
|
+
// Read-back: the file on disk is exactly what was written; if not, put the original back.
|
|
224
|
+
if (readFileSync(path, 'utf8') !== text) {
|
|
225
|
+
try { if (exists) writeFileSync(path, before, { mode }); else rmSync(path, { force: true }); } catch { /* best effort */ }
|
|
226
|
+
throw new Error(`wrote ${path} but the ${SERVER_NAME} entry did not verify on read-back; the original was put back`);
|
|
193
227
|
}
|
|
194
228
|
log(
|
|
195
229
|
hadToken
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
import { execFileSync, spawnSync } from 'node:child_process';
|
|
33
|
-
import { existsSync, mkdirSync, writeFileSync, chmodSync, readFileSync, cpSync, readdirSync, renameSync, statSync, realpathSync } from 'node:fs';
|
|
33
|
+
import { existsSync, mkdirSync, writeFileSync, chmodSync, readFileSync, cpSync, readdirSync, renameSync, rmSync, rmdirSync, statSync, realpathSync } from 'node:fs';
|
|
34
34
|
import { homedir, hostname } from 'node:os';
|
|
35
35
|
import { join, dirname, resolve, basename } from 'node:path';
|
|
36
36
|
import { fileURLToPath } from 'node:url';
|
|
@@ -57,7 +57,7 @@ try {
|
|
|
57
57
|
CLIENTS = detectClients(process.argv, process.env).clients;
|
|
58
58
|
} catch (err) {
|
|
59
59
|
console.error(err.message);
|
|
60
|
-
console.error('AWESOMATE CONNECT: FAILED reason=bad-client');
|
|
60
|
+
console.error(process.argv.includes('--update') ? 'Skill refresh failed: no changes made.' : 'AWESOMATE CONNECT: FAILED reason=bad-client');
|
|
61
61
|
process.exit(1);
|
|
62
62
|
}
|
|
63
63
|
const CLIENT_NAMES = CLIENTS.map(clientLabel).join(' and ');
|
|
@@ -335,6 +335,8 @@ function installSkill() {
|
|
|
335
335
|
if (src === dest) { installed += 1; continue; } // already running from the installed copy
|
|
336
336
|
mkdirSync(dirname(dest), { recursive: true });
|
|
337
337
|
cpSync(src, dest, { recursive: true, force: true });
|
|
338
|
+
// cpSync never deletes: drop what the bundle no longer ships (awesomate_skill_update does the same).
|
|
339
|
+
pruneStale(src, dest);
|
|
338
340
|
// Skill text names ~/.claude/skills paths; a Codex copy names its own folder.
|
|
339
341
|
if (client === 'codex') rewriteTree(dest);
|
|
340
342
|
// Make the shell/mjs helpers executable (npm can publish them non-+x).
|
|
@@ -357,6 +359,40 @@ function installSkill() {
|
|
|
357
359
|
return true;
|
|
358
360
|
}
|
|
359
361
|
|
|
362
|
+
function filesUnder(dir, base = '') {
|
|
363
|
+
const out = [];
|
|
364
|
+
for (const entry of readdirSync(join(dir, base), { withFileTypes: true })) {
|
|
365
|
+
const rel = base ? `${base}/${entry.name}` : entry.name;
|
|
366
|
+
if (entry.isDirectory()) out.push(...filesUnder(dir, rel));
|
|
367
|
+
else out.push(rel);
|
|
368
|
+
}
|
|
369
|
+
return out;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function dirsUnder(dir, base = '') {
|
|
373
|
+
const out = [];
|
|
374
|
+
for (const entry of readdirSync(join(dir, base), { withFileTypes: true })) {
|
|
375
|
+
if (!entry.isDirectory()) continue;
|
|
376
|
+
const rel = base ? `${base}/${entry.name}` : entry.name;
|
|
377
|
+
out.push(rel, ...dirsUnder(dir, rel));
|
|
378
|
+
}
|
|
379
|
+
return out;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
function pruneStale(src, dest) {
|
|
383
|
+
try {
|
|
384
|
+
const shipped = new Set(filesUnder(src));
|
|
385
|
+
for (const rel of filesUnder(dest)) {
|
|
386
|
+
if (rel === '.installed-version' || shipped.has(rel)) continue;
|
|
387
|
+
rmSync(join(dest, rel), { force: true });
|
|
388
|
+
}
|
|
389
|
+
// Folders the prune emptied (a dropped references/) go too, deepest first.
|
|
390
|
+
for (const dir of dirsUnder(dest).sort((a, b) => b.length - a.length)) {
|
|
391
|
+
try { if (readdirSync(join(dest, dir)).length === 0) rmdirSync(join(dest, dir)); } catch { /* not empty or gone */ }
|
|
392
|
+
}
|
|
393
|
+
} catch { /* pruning is best-effort: an unreadable folder must not fail the install */ }
|
|
394
|
+
}
|
|
395
|
+
|
|
360
396
|
function rewriteTree(dir) {
|
|
361
397
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
362
398
|
const path = join(dir, entry.name);
|
|
@@ -30,37 +30,49 @@ social links), titles and meta descriptions must use the owner's confirmed
|
|
|
30
30
|
details, never guesses. Leave out anything marked *suggestion* until the owner
|
|
31
31
|
confirms it, and list what's missing rather than inventing it.
|
|
32
32
|
|
|
33
|
-
### Plan gate
|
|
33
|
+
### Plan gate: check before promising any WordPress change
|
|
34
34
|
|
|
35
|
-
**Every
|
|
35
|
+
**Every hosting WRITE from Claude follows `site_manage`**:
|
|
36
36
|
`awesomate_run_wp_cli`, `awesomate_wp_post_change`, `awesomate_wp_media_import`,
|
|
37
37
|
`awesomate_wp_settings`, plus `awesomate_site_create` and
|
|
38
|
-
`awesomate_domain_add`.
|
|
39
|
-
`
|
|
40
|
-
|
|
38
|
+
`awesomate_domain_add`. Read `features.site_manage` and `plan` from
|
|
39
|
+
`awesomate_get_context` at the start. It is always available on Support Plus
|
|
40
|
+
and above; on **Essentials** it is available only once Awesomate turns it on
|
|
41
|
+
for the account. Without it these are refused (**403 `upgrade_required`**,
|
|
42
|
+
or `feature_unavailable` with its own message, which is not an upgrade
|
|
43
|
+
pitch): the server enforces it, so no retry or rewording gets through.
|
|
41
44
|
|
|
42
45
|
This matters more here than anywhere else: **Essentials is the plan that
|
|
43
46
|
gets exactly one WordPress site**, so it is the most likely plan for someone
|
|
44
|
-
asking about SEO.
|
|
45
|
-
branch honestly.
|
|
47
|
+
asking about SEO. Branch honestly on what `site_manage` says.
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
**`site_manage` available (any plan): apply the changes.** Snapshot first
|
|
50
|
+
with `awesomate_snapshot_site` before the session's first change to a live
|
|
51
|
+
site. When `capabilities.shell` is false (Essentials, or a team member's own
|
|
52
|
+
key), you cannot take a restore point from here: do not call it; say so
|
|
53
|
+
plainly and get the owner's yes before you
|
|
54
|
+
change the live site. Posts land as drafts; publish nothing the owner has
|
|
55
|
+
not seen.
|
|
56
|
+
|
|
57
|
+
**`site_manage` not available: assume no tool touches their WordPress.**
|
|
48
58
|
`awesomate_run_wp_cli` is gated even for its READS (`option get`,
|
|
49
|
-
`plugin list`)
|
|
59
|
+
`plugin list`): the whole route is behind the write gate, so "just reading
|
|
50
60
|
the options" is not a way round it. The account-level reads do work
|
|
51
61
|
(`awesomate_get_context`, `awesomate_list_sites`, `awesomate_list_domains`,
|
|
52
|
-
`awesomate_dns_check`, `awesomate_site_uptime`, and **`awesomate_site_audit
|
|
62
|
+
`awesomate_dns_check`, `awesomate_site_uptime`, and **`awesomate_site_audit`**:
|
|
53
63
|
the full gate sweep works on every plan, because it reads the public page).
|
|
54
64
|
|
|
55
|
-
**What
|
|
56
|
-
from the outside. Start with `awesomate_site_audit
|
|
57
|
-
in one call and is NOT plan-gated, so
|
|
58
|
-
findings
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
**What every account CAN do, which is most of the value:** audit and advise
|
|
66
|
+
from the outside. Start with `awesomate_site_audit`: it runs the whole sweep
|
|
67
|
+
in one call and is NOT plan-gated, so everyone gets exactly the same
|
|
68
|
+
findings. Then produce the exact changes: the titles and descriptions to
|
|
69
|
+
paste, the JSON-LD block, the llms.txt content, which plugin to install and
|
|
70
|
+
where its settings live. Without `site_manage` they apply them in wp-admin;
|
|
71
|
+
you verify by fetching the live page again. Say that up front (*"I can audit
|
|
72
|
+
the site and write every change out for you to paste in; me making them
|
|
73
|
+
directly needs Support Plus"*), not after a 403. That line is for
|
|
74
|
+
`upgrade_required`; when the refusal is `feature_unavailable`, say its
|
|
75
|
+
message instead and never pitch an upgrade.
|
|
64
76
|
|
|
65
77
|
## 1. Static / Node — write these
|
|
66
78
|
|
|
@@ -98,13 +110,14 @@ affected `<head>` tags, `sitemap.xml` `<lastmod>`, and `llms.txt`.
|
|
|
98
110
|
attached to which. Ask only when the answer is genuinely ambiguous (more
|
|
99
111
|
than one site, and the user hasn't said which).
|
|
100
112
|
|
|
101
|
-
**Snapshot before you change a live site
|
|
113
|
+
**Snapshot before you change a live site** (when `capabilities.shell` is
|
|
114
|
+
true; otherwise see the plan gate above). `awesomate_snapshot_site` first,
|
|
102
115
|
and tell the user the `snapshotId` — the hosting skill requires this and SEO
|
|
103
116
|
work is exactly the kind of change that touches the whole site at once (a
|
|
104
117
|
plugin, a theme option, an indexing flag). `awesomate_rollback_site` is the
|
|
105
118
|
undo.
|
|
106
119
|
|
|
107
|
-
Then,
|
|
120
|
+
Then, when `site_manage` is available:
|
|
108
121
|
|
|
109
122
|
- **Install + activate an SEO plugin** — `awesomate_run_wp_cli` with args
|
|
110
123
|
`['plugin','install','wordpress-seo','--activate']` for Yoast, or the
|
|
@@ -30,13 +30,16 @@ balance from memory.
|
|
|
30
30
|
|
|
31
31
|
**Which support?** This skill is help FROM Awesomate. If the user means their
|
|
32
32
|
OWN customers' support inbox ("anything in our support inbox?", "did the AI
|
|
33
|
-
answer that customer?"), that is `awesomate_support_desk`
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
answer that customer?", "what's overdue?"), that is `awesomate_support_desk`
|
|
34
|
+
(status, list by view or status, read, assignees) and
|
|
35
|
+
`awesomate_support_desk_change`: with the new inbox, draft a reply, add a team
|
|
36
|
+
note, set status and assign; on any desk, `propose_ai`, a SUGGESTION for the
|
|
37
|
+
inbox's AI that the owner accepts in the hub. Never raise an Awesomate ticket
|
|
38
|
+
for it. Say statuses in the desk's words (`status_word`: Open, Pending, On hold, Solved, Closed, Spam). Overdue
|
|
39
|
+
means no reply from a person by the time the business promised (`due_at`).
|
|
40
|
+
Claude never sends to a customer: a drafted reply waits for a person on the
|
|
41
|
+
team to send it from the hub, under Contacts, Inbox, and goes from them. Show
|
|
42
|
+
the user the draft before saving it.
|
|
40
43
|
|
|
41
44
|
## 1. Ask the Knowledge Base first
|
|
42
45
|
|
|
@@ -84,6 +87,14 @@ carries `outsidePlan: true` and a `note`. Tell the user what the note says
|
|
|
84
87
|
(our team will read it and reply with their options, which include Support
|
|
85
88
|
Plus), and offer an answer from §1 while they wait.
|
|
86
89
|
|
|
90
|
+
**One exception: Essentials with `site_manage`.** When `awesomate_get_context`
|
|
91
|
+
shows plan Essentials and `features.site_manage` available (Claude manages
|
|
92
|
+
their site), a ticket about USING the products is not filed: `create_ticket`
|
|
93
|
+
answers 403 `outside_plan`. Relay its message in one line with the link in `upgradeUrl`, answer from
|
|
94
|
+
§1, and stop. The three
|
|
95
|
+
every-plan categories still file as normal. Do not resend it under another
|
|
96
|
+
category: the same never-relabel rule applies.
|
|
97
|
+
|
|
87
98
|
Choose the category that is actually true. **Never relabel a workflow
|
|
88
99
|
question as an outage to move it inside the plan.** That is lying to your
|
|
89
100
|
own support team about the state of the platform, and it puts a false fault
|
|
@@ -118,8 +129,9 @@ report in front of an engineer.
|
|
|
118
129
|
asking to work inside their n8n), tell them; only the account owner allows
|
|
119
130
|
or declines it, signed in to the hub on the ticket's page. Never answer it
|
|
120
131
|
for them. These are tickets to Awesomate: the business's own customers'
|
|
121
|
-
inbox is `awesomate_support_desk`,
|
|
122
|
-
|
|
132
|
+
inbox is `awesomate_support_desk`, and Claude never replies to those
|
|
133
|
+
customers itself (drafts, notes, status, assigning and its AI's proposed
|
|
134
|
+
settings are `awesomate_support_desk_change`).
|
|
123
135
|
6. Screenshots and files go with a ticket or a reply from the hub (the
|
|
124
136
|
ticket's page, or Get help for a new ticket), never through Claude, and only
|
|
125
137
|
when `awesomate_get_context` shows `features.ticket_files.available`. If it
|
|
@@ -212,9 +224,10 @@ to the Awesomate team, who scope, build, test, and deliver it.
|
|
|
212
224
|
## 5b. Writing the business's own help centre
|
|
213
225
|
|
|
214
226
|
Some accounts have a public help centre: help pages for THEIR customers.
|
|
215
|
-
`awesomate_help_centre` reads it (`centre`, `articles`, `article
|
|
216
|
-
`awesomate_help_centre_change` writes it
|
|
217
|
-
`
|
|
227
|
+
`awesomate_help_centre` reads it (`centre`, `articles`, `article`,
|
|
228
|
+
`search`, `ask`) and `awesomate_help_centre_change` writes it
|
|
229
|
+
(`create_topic`, `update_topic`, `create_article`, `update_article`,
|
|
230
|
+
`publish`, `unpublish`, `archive`). This is not
|
|
218
231
|
Awesomate's help (that is §1), and not the support inbox.
|
|
219
232
|
|
|
220
233
|
- **It needs a key with `help:write`.** No plan gives it; the account
|
|
@@ -233,6 +246,17 @@ Awesomate's help (that is §1), and not the support inbox.
|
|
|
233
246
|
explicit yes, then `publish` with `confirm: true`. Taking one down
|
|
234
247
|
(`unpublish`) or archiving it needs a yes and `confirm: true` too. An
|
|
235
248
|
edit to a published article is not public until it is published again.
|
|
249
|
+
- **Check how it answers.** `search` {q} shows what a visitor typing those
|
|
250
|
+
words finds (published articles only); `ask` {q} shows the centre's
|
|
251
|
+
assistant's answer and sources. `ask` spends one of the business's
|
|
252
|
+
Knowledge answers: say so first, and use it to check answers, not to
|
|
253
|
+
answer the user's own questions. A wrong or missing answer usually means
|
|
254
|
+
an article to write or fix.
|
|
255
|
+
- **Topics can carry an icon** (`create_topic` or `update_topic` with
|
|
256
|
+
`icon`, one of the listed names), drawn beside the topic on the pages.
|
|
257
|
+
- **Help pages a business builds itself** read the centre through the SDK's
|
|
258
|
+
`createHelpClient` (no key; `centre` gives `publicApi` and says whether
|
|
259
|
+
the new design `v2` is on, which it needs).
|
|
236
260
|
- The centre's settings, its address, topic order and restoring an
|
|
237
261
|
archived article stay in the hub.
|
|
238
262
|
|