@awesomate/hosting-mcp 0.16.4 → 0.16.5

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
@@ -40014,13 +40014,20 @@ async function knowledgeStatus(config3) {
40014
40014
  return { ...status, upsell: upsellPayload(config3.apiBase, status.plan) };
40015
40015
  }
40016
40016
  const usage = status.usage;
40017
- if (usage && usage.sources_total_truncated === true) {
40018
- return {
40019
- ...status,
40020
- note: `usage.sources_total is a floor: the live count stopped at ${String(usage.sources_total)} sources (paged-count cap). The library holds at least that many \u2014 never quote it as the exact total.`
40021
- };
40017
+ if (!usage) return status;
40018
+ const annotated = {
40019
+ ...status,
40020
+ usage_glossary: {
40021
+ pages: "month-to-date hub-submitted page quota used (vs usage.included.pages) \u2014 NOT the size of the library",
40022
+ sources_total: 'sources currently in the library; kinds in usage.sources_by_kind or awesomate_knowledge_sources {action:"summary"}'
40023
+ }
40024
+ };
40025
+ if (usage.sources_total_source === "hourly_gauge") {
40026
+ annotated.note = "The live source count failed for this call: usage.sources_total / sources_failed are the last hourly gauge \u2014 possibly stale, and 0 for a library the gauge could never count. Retry before quoting them; the tenant itself is active.";
40027
+ } else if (usage.sources_total_truncated === true) {
40028
+ annotated.note = `usage.sources_total is a floor: the live count stopped at ${String(usage.sources_total)} sources (paged-count cap). The library holds at least that many \u2014 never quote it as the exact total.`;
40022
40029
  }
40023
- return status;
40030
+ return annotated;
40024
40031
  } catch (err) {
40025
40032
  return mapKnowledgeError(err, config3.apiBase);
40026
40033
  }
@@ -40065,6 +40072,24 @@ async function knowledgeSources(config3, args) {
40065
40072
  const page = await hubGet(config3, `/api/knowledge/sources${qs ? `?${qs}` : ""}`);
40066
40073
  return describeSourcePage(page);
40067
40074
  }
40075
+ if (args.action === "summary") {
40076
+ try {
40077
+ const s = await hubGet(config3, "/api/knowledge/sources/summary");
40078
+ return {
40079
+ ...s,
40080
+ note: "Exact whole-library counts. by_kind is what the knowledge base answers from; the paged list is only for browsing individual sources."
40081
+ };
40082
+ } catch (err) {
40083
+ if (err instanceof HubApiError && err.status === 404) {
40084
+ return {
40085
+ available: false,
40086
+ reason: "summary_unavailable",
40087
+ note: "The knowledge platform predates the sources summary. Use awesomate_knowledge_status \u2192 usage.sources_total for the total and page the list (cursor) to see kinds."
40088
+ };
40089
+ }
40090
+ throw err;
40091
+ }
40092
+ }
40068
40093
  if (args.action === "jobs") {
40069
40094
  const q = args.status ? `?status=${encodeURIComponent(args.status)}` : "";
40070
40095
  return await hubGet(config3, `/api/knowledge/jobs${q}`);
@@ -41035,9 +41060,9 @@ server.registerTool(
41035
41060
  server.registerTool(
41036
41061
  "awesomate_knowledge_sources",
41037
41062
  {
41038
- description: "The knowledge base's content sources. action 'list' \u2014 ONE page of sources, most recently ingested first (default 50, max 200 via limit): read `page.has_more`/`next_cursor` and pass cursor to continue \u2014 a page is never the whole library, and the total lives in awesomate_knowledge_status \u2192 usage.sources_total. 'jobs' \u2014 ingest job statuses (optional status filter: queued|running|succeeded|failed). 'add' \u2014 ingest a public page {url} or a whole site {sitemap, since?}; ALWAYS get explicit approval first (ingest costs money and counts against quota), and for local FILES send the user to the hub's Knowledge \u2192 Sources upload page \u2014 this tool cannot carry file bytes. A pack_required response means the allowance is exhausted: NOTHING was purchased \u2014 present the pack price (1 credit = $100) and let the user buy from the hub if they want it. 'remove' {sourceId} \u2014 deletes the source AND its indexed content; explicit approval required.",
41063
+ description: "The knowledge base's content sources. action 'list' \u2014 ONE page of sources, most recently ingested first (default 50, max 200 via limit): read `page.has_more`/`next_cursor` and pass cursor to continue \u2014 a page is never the whole library. 'summary' \u2014 exact whole-library counts {total, by_kind, chunks, indexed_chunks, failed_sources}: use THIS to say what the knowledge base contains. 'jobs' \u2014 ingest job statuses (optional status filter: queued|running|succeeded|failed). 'add' \u2014 ingest a public page {url} or a whole site {sitemap, since?}; ALWAYS get explicit approval first (ingest costs money and counts against quota), and for local FILES send the user to the hub's Knowledge \u2192 Sources upload page \u2014 this tool cannot carry file bytes. A pack_required response means the allowance is exhausted: NOTHING was purchased \u2014 present the pack price (1 credit = $100) and let the user buy from the hub if they want it. 'remove' {sourceId} \u2014 deletes the source AND its indexed content; explicit approval required.",
41039
41064
  inputSchema: {
41040
- action: external_exports.enum(["list", "add", "remove", "jobs"]),
41065
+ action: external_exports.enum(["list", "summary", "add", "remove", "jobs"]),
41041
41066
  url: external_exports.string().url().optional().describe("add: one public page / blog post / YouTube link"),
41042
41067
  sitemap: external_exports.string().url().optional().describe("add: sitemap.xml URL \u2014 ingests every listed page"),
41043
41068
  since: external_exports.string().optional().describe("add+sitemap only: skip entries with lastmod older than this ISO date"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awesomate/hosting-mcp",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "Awesomate MCP server \u2014 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",
@@ -38,8 +38,9 @@ platform's answer beats anything you remember.
38
38
  still building; `usage` → month-to-date vs `usage.included` quota.
39
39
  3. Only then design: what content exists, what's already ingested, what the
40
40
  user wants the bot to answer. For "what's ingested" use
41
- `status.usage.sources_total` (with `sources_total_truncated:true` it is a
42
- floor). `awesomate_knowledge_sources {action:'list'}` returns ONE page —
41
+ `awesomate_knowledge_sources {action:'summary'}` (exact `total` +
42
+ `by_kind`; falls back to `status.usage.sources_total`, a floor when
43
+ `sources_total_truncated:true`). `{action:'list'}` returns ONE page —
43
44
  the most recently ingested first (default 50, `limit` up to 200) — read
44
45
  `page.kinds_on_this_page` / `page.has_more` and follow `next_cursor`;
45
46
  never describe the library from a single page.