@awesomate/hosting-mcp 0.25.0 → 0.27.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
|
@@ -40083,7 +40083,22 @@ var KNOWLEDGE_GATE_COPY = {
|
|
|
40083
40083
|
"Hosted in Sydney, isolated to your account, and gone the moment you delete it"
|
|
40084
40084
|
]
|
|
40085
40085
|
};
|
|
40086
|
-
function upsellPayload(apiBase, plan) {
|
|
40086
|
+
function upsellPayload(apiBase, plan, body) {
|
|
40087
|
+
const capability = typeof body?.capability === "string" ? body.capability : null;
|
|
40088
|
+
const requiredPlan = typeof body?.requiredPlan === "string" ? body.requiredPlan : KNOWLEDGE_GATE_COPY.requiredPlan;
|
|
40089
|
+
const message = typeof body?.message === "string" ? body.message : null;
|
|
40090
|
+
if (capability && message) {
|
|
40091
|
+
return {
|
|
40092
|
+
upgrade_required: true,
|
|
40093
|
+
capability,
|
|
40094
|
+
requiredPlan,
|
|
40095
|
+
...typeof plan === "string" ? { plan } : {},
|
|
40096
|
+
...typeof body?.dimension === "string" ? { dimension: body.dimension } : {},
|
|
40097
|
+
message,
|
|
40098
|
+
billingUrl: `${apiBase}/billing?upgrade=${encodeURIComponent(requiredPlan)}`,
|
|
40099
|
+
note: capability === "knowledge_packs" ? `The included allowance is used up and this plan cannot buy Ingestion Packs (they start at ${requiredPlan}). NOTHING was added or purchased. Say so plainly, share the billing link, and let the user decide; never retry.` : `This kind of content needs ${requiredPlan} or above. NOTHING was added. Relay the message honestly, share the billing link, and let the user decide; never retry.`
|
|
40100
|
+
};
|
|
40101
|
+
}
|
|
40087
40102
|
return {
|
|
40088
40103
|
upgrade_required: true,
|
|
40089
40104
|
...typeof plan === "string" ? { plan } : {},
|
|
@@ -40124,7 +40139,7 @@ function mapKnowledgeError(err, apiBase) {
|
|
|
40124
40139
|
if (!(err instanceof HubApiError)) throw err;
|
|
40125
40140
|
const body = bodyOf(err);
|
|
40126
40141
|
if (err.status === 404) return notAvailablePayload(apiBase);
|
|
40127
|
-
if (err.status === 403 && body?.upgrade_required) return upsellPayload(apiBase, body.plan);
|
|
40142
|
+
if ((err.status === 403 || err.status === 402) && body?.upgrade_required) return upsellPayload(apiBase, body.plan, body);
|
|
40128
40143
|
if (err.status === 403 && body?.consent_required) {
|
|
40129
40144
|
return consentPayload(typeof body.error === "string" ? body.error : "Knowledge Platform consent is off");
|
|
40130
40145
|
}
|
|
@@ -40633,6 +40648,40 @@ async function knowledgeSearch(config3, args) {
|
|
|
40633
40648
|
return mapKnowledgeError(err, config3.apiBase);
|
|
40634
40649
|
}
|
|
40635
40650
|
}
|
|
40651
|
+
function touchesScope(args) {
|
|
40652
|
+
return Boolean(args.collectionIds || args.kinds || args.sourceIds);
|
|
40653
|
+
}
|
|
40654
|
+
var SCOPE_KEYS = ["source_ids", "tags", "datasets", "kinds", "data_sets", "allow_media", "allow_data"];
|
|
40655
|
+
function agentPatchBody(args, currentScope = {}) {
|
|
40656
|
+
let scope;
|
|
40657
|
+
if (touchesScope(args)) {
|
|
40658
|
+
const kept = {};
|
|
40659
|
+
for (const k of SCOPE_KEYS) if (currentScope[k] !== void 0) kept[k] = currentScope[k];
|
|
40660
|
+
const currentTags = Array.isArray(kept.tags) ? kept.tags.filter((t) => typeof t === "string") : [];
|
|
40661
|
+
scope = {
|
|
40662
|
+
...kept,
|
|
40663
|
+
...args.collectionIds ? { tags: [...currentTags.filter((t) => !t.startsWith("collection:")), ...args.collectionIds.map((id) => `collection:${id}`)] } : {},
|
|
40664
|
+
...args.kinds ? { kinds: args.kinds } : {},
|
|
40665
|
+
...args.sourceIds ? { source_ids: args.sourceIds } : {}
|
|
40666
|
+
};
|
|
40667
|
+
}
|
|
40668
|
+
return {
|
|
40669
|
+
...args.name ? { name: args.name } : {},
|
|
40670
|
+
...args.description !== void 0 ? { description: args.description } : {},
|
|
40671
|
+
...args.systemMessage !== void 0 ? { system_message: args.systemMessage } : {},
|
|
40672
|
+
...args.noAnswerMessage !== void 0 ? { no_answer_message: args.noAnswerMessage } : {},
|
|
40673
|
+
...args.grounding ? { grounding: args.grounding } : {},
|
|
40674
|
+
...args.audience ? { audience: args.audience } : {},
|
|
40675
|
+
...args.maxSources !== void 0 ? { max_sources: args.maxSources } : {},
|
|
40676
|
+
...args.temperature !== void 0 ? { temperature: args.temperature } : {},
|
|
40677
|
+
...scope ? { scope } : {}
|
|
40678
|
+
};
|
|
40679
|
+
}
|
|
40680
|
+
async function currentAgentScope(config3, agentId) {
|
|
40681
|
+
const got = await hubGet(config3, `/api/knowledge/agents/${encodeURIComponent(agentId)}`);
|
|
40682
|
+
const scope = got.agent?.scope ?? got.scope;
|
|
40683
|
+
return scope && typeof scope === "object" && !Array.isArray(scope) ? scope : {};
|
|
40684
|
+
}
|
|
40636
40685
|
function mapAgentsError(err, apiBase) {
|
|
40637
40686
|
if (err instanceof HubApiError && err.status === 404) {
|
|
40638
40687
|
const body = bodyOf(err);
|
|
@@ -40662,6 +40711,23 @@ async function knowledgeAgents(config3, args) {
|
|
|
40662
40711
|
if (!args.name) return { error: "name (or goal) is required for create" };
|
|
40663
40712
|
return await hubPost(config3, "/api/knowledge/agents", { name: args.name, ...args.audience ? { audience: args.audience } : {} });
|
|
40664
40713
|
}
|
|
40714
|
+
if (args.action === "update") {
|
|
40715
|
+
if (!args.agentId) return { error: "agentId is required for update" };
|
|
40716
|
+
const currentScope = touchesScope(args) ? await currentAgentScope(config3, args.agentId) : {};
|
|
40717
|
+
const body = agentPatchBody(args, currentScope);
|
|
40718
|
+
if (!Object.keys(body).length) {
|
|
40719
|
+
return {
|
|
40720
|
+
error: "invalid_request",
|
|
40721
|
+
note: "update needs at least one of name, description, systemMessage, noAnswerMessage, grounding, audience, collectionIds, kinds, sourceIds, maxSources, temperature"
|
|
40722
|
+
};
|
|
40723
|
+
}
|
|
40724
|
+
const out = await hubPatch(config3, `/api/knowledge/agents/${encodeURIComponent(args.agentId)}`, body);
|
|
40725
|
+
return {
|
|
40726
|
+
...out,
|
|
40727
|
+
requested: body,
|
|
40728
|
+
status_note: "Draft updated. A published agent keeps serving its last published version until you publish again: test the draft, then publish when the user approves."
|
|
40729
|
+
};
|
|
40730
|
+
}
|
|
40665
40731
|
if (args.action === "publish") {
|
|
40666
40732
|
if (!args.agentId) return { error: "agentId is required for publish" };
|
|
40667
40733
|
const out = await hubPost(config3, `/api/knowledge/agents/${encodeURIComponent(args.agentId)}/publish`, {});
|
|
@@ -40903,6 +40969,7 @@ var TITLES = {
|
|
|
40903
40969
|
awesomate_app_scaffold: "Get app scaffold guide",
|
|
40904
40970
|
awesomate_app_deploy_info: "Get app deploy briefing",
|
|
40905
40971
|
awesomate_app_health: "Check app health",
|
|
40972
|
+
awesomate_app_run_state: "Start or stop an app environment",
|
|
40906
40973
|
awesomate_app_set_env: "Set app secret",
|
|
40907
40974
|
awesomate_app_provision_db: "Add database to app",
|
|
40908
40975
|
awesomate_n8n_workflows: "List n8n workflows",
|
|
@@ -41737,6 +41804,27 @@ server.registerTool(
|
|
|
41737
41804
|
}
|
|
41738
41805
|
}
|
|
41739
41806
|
);
|
|
41807
|
+
server.registerTool(
|
|
41808
|
+
"awesomate_app_run_state",
|
|
41809
|
+
{
|
|
41810
|
+
annotations: annotate("awesomate_app_run_state", MUTATING),
|
|
41811
|
+
description: "Start or stop ONE environment of a Node app (its pm2 process). Use `stopped` to turn off a dev or staging environment the user has finished with. This frees process capacity on their hosting account, which is a real constraint: the account has a fixed number of processes it can run at once, and idle environments can starve the account's own websites. Use `running` to bring one back before you build or test on it. Stopping deletes NOTHING: code, database and address all stay, and starting again takes seconds. PRODUCTION CANNOT BE STOPPED (400 `prod_not_stoppable`); it is the address the user's customers reach. A 409 `run_state_failed` on a start means the account has no spare capacity, and the response carries nprocUsed/nprocLimit; tell the user which environment to stop rather than retrying. Static sites have no process (400 `static_app`). Requires apps:write (Support Plus+). Good habit: start dev before a build session, stop it after.",
|
|
41812
|
+
inputSchema: {
|
|
41813
|
+
appId: external_exports.number().int().positive().describe("The app id from awesomate_app_list / _get"),
|
|
41814
|
+
env: external_exports.enum(["dev", "staging", "prod"]).describe("Which environment to act on"),
|
|
41815
|
+
desiredState: external_exports.enum(["running", "stopped"]).describe("'stopped' frees capacity; 'running' starts it again")
|
|
41816
|
+
}
|
|
41817
|
+
},
|
|
41818
|
+
async ({ appId, env, desiredState }) => {
|
|
41819
|
+
try {
|
|
41820
|
+
return textResult(
|
|
41821
|
+
await hubPost(requireConfig(), `/api/my-apps/apps/${appId}/envs/${env}/run-state`, { desiredState })
|
|
41822
|
+
);
|
|
41823
|
+
} catch (err) {
|
|
41824
|
+
return errorResult(err);
|
|
41825
|
+
}
|
|
41826
|
+
}
|
|
41827
|
+
);
|
|
41740
41828
|
server.registerTool(
|
|
41741
41829
|
"awesomate_n8n_provision_pg",
|
|
41742
41830
|
{
|
|
@@ -41927,13 +42015,22 @@ server.registerTool(
|
|
|
41927
42015
|
"awesomate_knowledge_agents",
|
|
41928
42016
|
{
|
|
41929
42017
|
annotations: annotate("awesomate_knowledge_agents", MUTATING),
|
|
41930
|
-
description: "The agent builder (multi-agent; the older awesomate_knowledge_agent tool is the single workspace default). action 'list'
|
|
42018
|
+
description: "The agent builder (multi-agent; the older awesomate_knowledge_agent tool is the single workspace default). action 'list': every agent with status (draft/published vN/suspended). 'get' {agentId}: full config incl. system message and scope. 'create' {goal}: AI drafts the whole setup (instructions, scope, tone, test questions) from the account's own content and saves it as a PRIVATE DRAFT (never live, nothing lost); or {name} for a blank draft. 'update' {agentId, ...fields}: edit the DRAFT config: name, description, systemMessage, noAnswerMessage, grounding, audience, collectionIds (scope to collections from awesomate_knowledge_collections), kinds, sourceIds, maxSources, temperature. Nothing changes for callers until 'publish'. 'test' {agentId, message, sessionId?}: chat with the DRAFT config: free, unmetered, the right way to check behaviour before going live. 'publish' {agentId}: makes the draft LIVE immediately for every key bound to the agent: get the user's explicit approval first, and read the version back. Policies, API keys and the request log live in the hub UI (Knowledge \u2192 Agents); keys are shown once there and never pass through this tool.",
|
|
41931
42019
|
inputSchema: {
|
|
41932
|
-
action: external_exports.enum(["list", "get", "create", "publish", "test"]),
|
|
41933
|
-
agentId: external_exports.string().max(64).optional().describe("get/publish/test: agent_id from list"),
|
|
41934
|
-
name: external_exports.string().max(80).optional().describe("create: blank draft with this name"),
|
|
42020
|
+
action: external_exports.enum(["list", "get", "create", "update", "publish", "test"]),
|
|
42021
|
+
agentId: external_exports.string().max(64).optional().describe("get/update/publish/test: agent_id from list"),
|
|
42022
|
+
name: external_exports.string().max(80).optional().describe("create: blank draft with this name; update: rename"),
|
|
41935
42023
|
goal: external_exports.string().max(2e3).optional().describe("create: describe the agent and AI drafts it from the account content"),
|
|
41936
|
-
audience: external_exports.enum(["private", "internal", "public"]).optional().describe("create: who the agent serves
|
|
42024
|
+
audience: external_exports.enum(["private", "internal", "public"]).optional().describe("create/update: who the agent serves: 'public' for anything customers or a website will talk to (it then answers from sources marked public ONLY), 'internal' for the team, 'private' (default) for the owner's own tools. Widening later is a publish, so choose now."),
|
|
42025
|
+
description: external_exports.string().max(300).optional().describe("update: one-line description shown in the hub"),
|
|
42026
|
+
systemMessage: external_exports.string().max(8e3).optional().describe("update: the agent instructions (system message)"),
|
|
42027
|
+
noAnswerMessage: external_exports.string().max(500).optional().describe("update: what the agent says when the grounding gate declines to answer"),
|
|
42028
|
+
grounding: external_exports.enum(["strict", "grounded_chat"]).optional().describe("update: 'strict' refuses anything not in the retrieved content (use it for anything customer-facing); 'grounded_chat' may add general knowledge around the cited content"),
|
|
42029
|
+
collectionIds: external_exports.array(external_exports.string().max(64)).max(16).optional().describe("update: scope the agent to these collections (collection_id from awesomate_knowledge_collections list); replaces the collection scope only, other scope fields and free-form tags are kept"),
|
|
42030
|
+
kinds: external_exports.array(external_exports.string().max(40)).max(16).optional().describe("update: restrict retrieval to source kinds (web, document, video, audio, image, book, dataset); omit for all kinds"),
|
|
42031
|
+
sourceIds: external_exports.array(external_exports.string().max(200)).max(500).optional().describe("update: pin the scope to specific sources"),
|
|
42032
|
+
maxSources: external_exports.number().int().min(1).max(10).optional().describe("update: how many sources one answer may cite (1-10)"),
|
|
42033
|
+
temperature: external_exports.number().min(0).max(1).optional().describe("update: 0 is the most literal"),
|
|
41937
42034
|
message: external_exports.string().max(4e3).optional().describe("test: the question to ask the draft"),
|
|
41938
42035
|
sessionId: external_exports.string().max(128).optional().describe("test: keep follow-ups in one thread")
|
|
41939
42036
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesomate/hosting-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.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",
|
|
@@ -140,6 +140,14 @@ target; never touch prod without an explicit ask.**
|
|
|
140
140
|
addresses from `awesomate_app_get` rather than constructing them — an
|
|
141
141
|
account without the branded domains falls back to subdomains of its own
|
|
142
142
|
primary domain (`dev-{app}.{domain}`).
|
|
143
|
+
**If dev is stopped, start it before you deploy to it.** `awesomate_app_get`
|
|
144
|
+
reports each environment's `desired_state`. A stopped environment is off to
|
|
145
|
+
free capacity on the account, not broken. `awesomate_app_run_state` with
|
|
146
|
+
`running` brings it back in seconds, and a health probe against a stopped
|
|
147
|
+
env fails for that reason and no other. **Offer to stop it again when the
|
|
148
|
+
session's work is done**: the account can only run a limited number of app
|
|
149
|
+
processes at once, so an idle dev environment is capacity taken from
|
|
150
|
+
something the user actually needs. Never stop `prod`; the tool refuses it.
|
|
143
151
|
**Publishing to their WordPress site** (as opposed to an app) has its own
|
|
144
152
|
tools, and `awesomate_run_wp_cli` is the wrong one for content: its
|
|
145
153
|
argument gate rejects spaces outright, so a title or tagline can't go
|
|
@@ -64,7 +64,7 @@ platform's answer beats anything you remember.
|
|
|
64
64
|
| Instant search with facet counts (find WHAT is in there: moments, pages, datasets; free) | `awesomate_knowledge_search` |
|
|
65
65
|
| Ask a question → verified answer + numbered sources (accepts the same facet `filters` to ask within a slice) | `awesomate_knowledge_ask` |
|
|
66
66
|
| Agent persona / fallback message / model tier — get & set (the single workspace default) | `awesomate_knowledge_agent` |
|
|
67
|
-
| Agent BUILDER: list / get / create (AI-drafted from their content, saved as a private draft; pass `audience:'public'` for anything customers will talk to
|
|
67
|
+
| Agent BUILDER: list / get / create (AI-drafted from their content, saved as a private draft; pass `audience:'public'` for anything customers will talk to; it then answers from sources marked public ONLY) / update (edit the draft's instructions, grounding, no-answer message, audience and collection scope; nothing changes for callers until publish) / test the draft / publish (explicit approval first) | `awesomate_knowledge_agents` |
|
|
68
68
|
| People, places, topics: list / name / hide / merge / alias suggestions / re-run resolution | `awesomate_knowledge_people` |
|
|
69
69
|
| Business-data warehouse: `metrics` / `datasets` / `query` / `imports` — answer quantitative questions from their own imported business data (query is free-form but read-only) | `awesomate_knowledge_data` |
|
|
70
70
|
| Refresh these skills from the latest package | `awesomate_skill_update` |
|