@nextblock-cms/cortex 0.20.3 → 0.21.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.
Files changed (71) hide show
  1. package/client.cjs.js +1 -1
  2. package/client.es.js +3 -7
  3. package/index.cjs.js +1 -1
  4. package/index.es.js +24 -277
  5. package/lib/ai-block-generation.cjs.js +3 -4
  6. package/lib/ai-block-generation.es.js +143 -182
  7. package/lib/ai-client.cjs.js +1 -1
  8. package/lib/ai-client.d.ts +1 -1
  9. package/lib/ai-client.es.js +101 -135
  10. package/lib/ai-config.cjs.js +1 -1
  11. package/lib/ai-config.es.js +89 -108
  12. package/lib/ai-cortex-widget-builder.cjs.js +1 -1
  13. package/lib/ai-cortex-widget-builder.es.js +56 -70
  14. package/lib/ai-global-agent-content-ops-tools.cjs.js +1 -1
  15. package/lib/ai-global-agent-content-ops-tools.d.ts +1943 -68
  16. package/lib/ai-global-agent-content-ops-tools.es.js +185 -199
  17. package/lib/ai-global-agent-custom-block-tools.cjs.js +1 -1
  18. package/lib/ai-global-agent-custom-block-tools.d.ts +2160 -95
  19. package/lib/ai-global-agent-custom-block-tools.es.js +226 -223
  20. package/lib/ai-global-agent-db-tools.cjs.js +1 -1
  21. package/lib/ai-global-agent-db-tools.d.ts +2708 -98
  22. package/lib/ai-global-agent-db-tools.es.js +1013 -986
  23. package/lib/ai-global-agent-ecommerce.cjs.js +1 -1
  24. package/lib/ai-global-agent-ecommerce.es.js +3 -7
  25. package/lib/ai-global-agent-site-tools.cjs.js +2 -3
  26. package/lib/ai-global-agent-site-tools.d.ts +10695 -500
  27. package/lib/ai-global-agent-site-tools.es.js +750 -757
  28. package/lib/ai-global-agent-theming-tools.cjs.js +1 -3
  29. package/lib/ai-global-agent-theming-tools.d.ts +2905 -105
  30. package/lib/ai-global-agent-theming-tools.es.js +326 -396
  31. package/lib/ai-global-agent-tools.cjs.js +2 -2
  32. package/lib/ai-global-agent-tools.d.ts +4 -2230
  33. package/lib/ai-global-agent-tools.es.js +3899 -4328
  34. package/lib/ai-key-crypto.cjs.js +1 -1
  35. package/lib/ai-key-crypto.es.js +63 -82
  36. package/lib/ai-key-verification.cjs.js +1 -1
  37. package/lib/ai-key-verification.es.js +74 -63
  38. package/lib/ai-model-catalog.cjs.js +1 -1
  39. package/lib/ai-model-catalog.es.js +18 -22
  40. package/lib/ai-model-registry.cjs.js +2 -2
  41. package/lib/ai-model-registry.es.js +246 -309
  42. package/lib/ai-seo-metadata.cjs.js +2 -3
  43. package/lib/ai-seo-metadata.es.js +143 -185
  44. package/lib/ai-vision.cjs.js +2 -2
  45. package/lib/ai-vision.d.ts +6 -6
  46. package/lib/ai-vision.es.js +161 -215
  47. package/lib/block-content-schemas.cjs.js +1 -1
  48. package/lib/block-content-schemas.es.js +324 -254
  49. package/lib/cortex-widget-registry.cjs.js +1 -1
  50. package/lib/cortex-widget-registry.es.js +35 -43
  51. package/lib/cortex-widget-schema.cjs.js +2 -3
  52. package/lib/cortex-widget-schema.es.js +280 -309
  53. package/lib/editor-document-from-html.cjs.js +1 -1
  54. package/lib/editor-document-from-html.es.js +334 -278
  55. package/lib/fetch-host-guard.cjs.js +1 -0
  56. package/lib/fetch-host-guard.d.ts +2 -0
  57. package/lib/fetch-host-guard.es.js +30 -0
  58. package/lib/mcp-server.cjs.js +1 -1
  59. package/lib/mcp-server.es.js +155 -173
  60. package/lib/mcp-tokens.cjs.js +1 -1
  61. package/lib/mcp-tokens.es.js +95 -107
  62. package/lib/mcp-tool-registry.cjs.js +5 -6
  63. package/lib/mcp-tool-registry.es.js +533 -411
  64. package/lib/site-brief.cjs.js +2 -2
  65. package/lib/site-brief.es.js +102 -108
  66. package/lib/vision-image-download.cjs.js +1 -0
  67. package/lib/vision-image-download.d.ts +43 -0
  68. package/lib/vision-image-download.es.js +120 -0
  69. package/lib/zod-config.cjs.js +1 -1
  70. package/lib/zod-config.es.js +5 -6
  71. package/package.json +8 -8
@@ -1,121 +1,109 @@
1
- import { createHash as E, timingSafeEqual as f, randomBytes as m } from "node:crypto";
2
- const p = "Cortex AI MCP token utilities can only be imported from server-side code.";
3
- function a() {
4
- if (!(typeof window > "u"))
5
- throw new Error(p);
1
+ import { createHash as e, randomBytes as t, timingSafeEqual as n } from "node:crypto";
2
+ //#region libs/cortex/src/lib/mcp-tokens.ts
3
+ var r = "Cortex AI MCP token utilities can only be imported from server-side code.";
4
+ function i() {
5
+ if (typeof window < "u") throw Error(r);
6
6
  }
7
- const C = "cortex_ai_mcp_settings", _ = "mcp_access_tokens", u = "nbmcp_", A = 32, k = 8, S = ["read", "write"], i = {
8
- allowLocalhostWithoutToken: !0,
9
- enabled: !1
7
+ var a = "cortex_ai_mcp_settings", o = "mcp_access_tokens", s = "nbmcp_", c = 32, l = ["read", "write"], u = {
8
+ allowLocalhostWithoutToken: !0,
9
+ enabled: !1
10
10
  };
11
- function O(e) {
12
- const t = e && typeof e == "object" && !Array.isArray(e) ? e : {};
13
- return {
14
- allowLocalhostWithoutToken: typeof t.allowLocalhostWithoutToken == "boolean" ? t.allowLocalhostWithoutToken : i.allowLocalhostWithoutToken,
15
- enabled: typeof t.enabled == "boolean" ? t.enabled : i.enabled
16
- };
11
+ function d(e) {
12
+ let t = e && typeof e == "object" && !Array.isArray(e) ? e : {};
13
+ return {
14
+ allowLocalhostWithoutToken: typeof t.allowLocalhostWithoutToken == "boolean" ? t.allowLocalhostWithoutToken : u.allowLocalhostWithoutToken,
15
+ enabled: typeof t.enabled == "boolean" ? t.enabled : u.enabled
16
+ };
17
17
  }
18
- async function R(e) {
19
- if (e)
20
- try {
21
- const { data: t } = await e.from("site_settings").select("value").eq("key", C).maybeSingle();
22
- if (t?.value)
23
- return O(t.value);
24
- } catch {
25
- }
26
- return { ...i };
18
+ async function f(e) {
19
+ if (e) try {
20
+ let { data: t } = await e.from("site_settings").select("value").eq("key", a).maybeSingle();
21
+ if (t?.value) return d(t.value);
22
+ } catch {}
23
+ return { ...u };
27
24
  }
28
- function s(e) {
29
- return a(), E("sha256").update(e.trim(), "utf8").digest("hex");
25
+ function p(t) {
26
+ return i(), e("sha256").update(t.trim(), "utf8").digest("hex");
30
27
  }
31
- function g() {
32
- a();
33
- const e = `${u}${m(A).toString(
34
- "base64url"
35
- )}`;
36
- return {
37
- token: e,
38
- tokenHash: s(e),
39
- tokenPrefix: e.slice(
40
- 0,
41
- u.length + k
42
- )
43
- };
28
+ function m() {
29
+ i();
30
+ let e = `${s}${t(c).toString("base64url")}`;
31
+ return {
32
+ token: e,
33
+ tokenHash: p(e),
34
+ tokenPrefix: e.slice(0, 14)
35
+ };
44
36
  }
45
- function N(e) {
46
- const t = e?.trim();
47
- if (!t)
48
- return null;
49
- const o = /^Bearer\s+(.+)$/i.exec(t);
50
- return (o ? o[1] : t).trim() || null;
37
+ function h(e) {
38
+ let t = e?.trim();
39
+ if (!t) return null;
40
+ let n = /^Bearer\s+(.+)$/i.exec(t);
41
+ return (n ? n[1] : t).trim() || null;
51
42
  }
52
- function M(e) {
53
- const o = (Array.isArray(e) ? e : []).filter(
54
- (n) => S.includes(n)
55
- );
56
- return o.length > 0 ? Array.from(new Set(o)) : ["read"];
43
+ function g(e) {
44
+ let t = (Array.isArray(e) ? e : []).filter((e) => l.includes(e));
45
+ return t.length > 0 ? Array.from(new Set(t)) : ["read"];
57
46
  }
58
- async function I(e, t, o = /* @__PURE__ */ new Date()) {
59
- a();
60
- const n = t?.trim();
61
- if (!n || n.length < 16)
62
- return { reason: "malformed", valid: !1 };
63
- const c = s(n), { data: l, error: h } = await e.from(_).select("id, name, scopes, token_prefix, created_at, created_by, expires_at, last_used_at, revoked_at").eq("token_hash", c).maybeSingle();
64
- if (h || !l)
65
- return { reason: "unknown", valid: !1 };
66
- const T = Buffer.from(c, "utf8");
67
- if (!f(T, Buffer.from(s(n), "utf8")))
68
- return { reason: "unknown", valid: !1 };
69
- const r = l;
70
- return r.revoked_at ? { reason: "revoked", valid: !1 } : r.expires_at && new Date(r.expires_at).getTime() <= o.getTime() ? { reason: "expired", valid: !1 } : { scopes: M(r.scopes), token: r, valid: !0 };
47
+ async function _(e, t, r = /* @__PURE__ */ new Date()) {
48
+ i();
49
+ let a = t?.trim();
50
+ if (!a || a.length < 16) return {
51
+ reason: "malformed",
52
+ valid: !1
53
+ };
54
+ let s = p(a), { data: c, error: l } = await e.from(o).select("id, name, scopes, token_prefix, created_at, created_by, expires_at, last_used_at, revoked_at").eq("token_hash", s).maybeSingle();
55
+ if (l || !c) return {
56
+ reason: "unknown",
57
+ valid: !1
58
+ };
59
+ let u = Buffer.from(s, "utf8");
60
+ if (!n(u, Buffer.from(p(a), "utf8"))) return {
61
+ reason: "unknown",
62
+ valid: !1
63
+ };
64
+ let d = c;
65
+ return d.revoked_at ? {
66
+ reason: "revoked",
67
+ valid: !1
68
+ } : d.expires_at && new Date(d.expires_at).getTime() <= r.getTime() ? {
69
+ reason: "expired",
70
+ valid: !1
71
+ } : {
72
+ scopes: g(d.scopes),
73
+ token: d,
74
+ valid: !0
75
+ };
71
76
  }
72
- async function L(e, t, o = /* @__PURE__ */ new Date()) {
73
- try {
74
- await e.from(_).update({ last_used_at: o.toISOString() }).eq("id", t);
75
- } catch {
76
- }
77
+ async function v(e, t, n = /* @__PURE__ */ new Date()) {
78
+ try {
79
+ await e.from(o).update({ last_used_at: n.toISOString() }).eq("id", t);
80
+ } catch {}
77
81
  }
78
- const v = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]", "::1", "0.0.0.0"]);
79
- function y(e) {
80
- const t = e?.trim().toLowerCase();
81
- if (!t)
82
- return !1;
83
- const o = t.startsWith("[") ? t.replace(/\]:\d+$/, "]") : t.replace(/:\d+$/, "");
84
- return v.has(o) || o.endsWith(".localhost");
82
+ var y = /* @__PURE__ */ new Set([
83
+ "localhost",
84
+ "127.0.0.1",
85
+ "[::1]",
86
+ "::1",
87
+ "0.0.0.0"
88
+ ]);
89
+ function b(e) {
90
+ let t = e?.trim().toLowerCase();
91
+ if (!t) return !1;
92
+ let n = t.startsWith("[") ? t.replace(/\]:\d+$/, "]") : t.replace(/:\d+$/, "");
93
+ return y.has(n) || n.endsWith(".localhost");
85
94
  }
86
- function P(e) {
87
- return !e.settings.allowLocalhostWithoutToken || process.env.NODE_ENV === "production" ? !1 : y(e.hostHeader);
95
+ function x(e) {
96
+ return !e.settings.allowLocalhostWithoutToken || process.env.NODE_ENV === "production" ? !1 : b(e.hostHeader);
88
97
  }
89
- const w = "MCP_BEARER_TOKEN", d = 32;
90
- function b(e = process.env) {
91
- const t = e[w]?.trim();
92
- return !t || t.length < d ? null : t;
98
+ var S = "MCP_BEARER_TOKEN", C = 32;
99
+ function w(e = process.env) {
100
+ let t = e[S]?.trim();
101
+ return !t || t.length < 32 ? null : t;
93
102
  }
94
- function B(e, t) {
95
- a();
96
- const o = e?.trim(), n = t?.trim();
97
- return !o || !n || n.length < d ? !1 : f(
98
- Buffer.from(s(o), "utf8"),
99
- Buffer.from(s(n), "utf8")
100
- );
103
+ function T(e, t) {
104
+ i();
105
+ let r = e?.trim(), a = t?.trim();
106
+ return !r || !a || a.length < 32 ? !1 : n(Buffer.from(p(r), "utf8"), Buffer.from(p(a), "utf8"));
101
107
  }
102
- export {
103
- d as CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH,
104
- w as CORTEX_AI_MCP_ENV_TOKEN_VAR,
105
- S as CORTEX_AI_MCP_SCOPES,
106
- i as CORTEX_AI_MCP_SETTINGS_DEFAULTS,
107
- C as CORTEX_AI_MCP_SETTINGS_KEY,
108
- _ as CORTEX_AI_MCP_TOKENS_TABLE,
109
- u as CORTEX_AI_MCP_TOKEN_PREFIX,
110
- s as hashCortexAiMcpToken,
111
- y as isLocalhostHost,
112
- B as matchesCortexAiMcpEnvToken,
113
- g as mintCortexAiMcpToken,
114
- O as normalizeCortexAiMcpSettings,
115
- N as parseBearerToken,
116
- b as readCortexAiMcpEnvToken,
117
- R as resolveCortexAiMcpSettings,
118
- P as shouldTrustLocalMcpRequest,
119
- L as touchCortexAiMcpToken,
120
- I as verifyCortexAiMcpToken
121
- };
108
+ //#endregion
109
+ export { C as CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH, S as CORTEX_AI_MCP_ENV_TOKEN_VAR, l as CORTEX_AI_MCP_SCOPES, u as CORTEX_AI_MCP_SETTINGS_DEFAULTS, a as CORTEX_AI_MCP_SETTINGS_KEY, o as CORTEX_AI_MCP_TOKENS_TABLE, s as CORTEX_AI_MCP_TOKEN_PREFIX, p as hashCortexAiMcpToken, b as isLocalhostHost, T as matchesCortexAiMcpEnvToken, m as mintCortexAiMcpToken, d as normalizeCortexAiMcpSettings, h as parseBearerToken, w as readCortexAiMcpEnvToken, f as resolveCortexAiMcpSettings, x as shouldTrustLocalMcpRequest, v as touchCortexAiMcpToken, _ as verifyCortexAiMcpToken };
@@ -1,6 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./ai-global-agent-tools.cjs.js"),C=require("./block-content-schemas.cjs.js");require("./zod-config.cjs.js");const T=require("zod"),s={create_cms_page:"write",create_cms_post:"write",create_cms_product:"write",create_custom_block:"write",delete_cms_item:"write",delete_custom_block:"write",describe_database_schema:"read",execute_cms_action_plan:"write",execute_database_action_plan:"write",execute_database_mutation:"write",fetch_ecommerce_stats:"read",fetch_url_content:"read",finish_site_build:"write",get_site_overview:"read",insert_content_block:"write",list_custom_blocks:"read",list_media:"read",list_product_categories:"read",list_site_script_revisions:"read",list_site_scripts:"read",list_site_themes:"read",manage_language:"write",manage_product_category:"write",manage_product_variants:"write",manage_site_script:"write",manage_site_theme:"write",prepare_delete_cms_item:"read",publish_content_draft:"write",read_current_cms_item:"read",read_database_records:"read",reset_site_content:"write",revert_site_script:"write",rewrite_page_draft:"write",save_site_brief:"write",search_documentation:"read",search_stock_photos:"read",set_content_images:"write",start_site_build:"write",translate_content_bulk:"write",translate_page:"write",update_cms_item_field:"write",upload_media:"write",update_content_block:"write",update_current_cms_fields:"write",update_custom_block:"write",update_footer:"write",update_global_css:"write",update_navigation_bar:"write",update_section_column_block:"write",update_site_identity:"write"},b={create_cms_page:{destructive:!1,idempotent:!0,openWorld:!0},create_cms_post:{destructive:!1,idempotent:!0,openWorld:!0},create_cms_product:{destructive:!1,idempotent:!0,openWorld:!0},create_custom_block:{destructive:!1,idempotent:!1,openWorld:!1},delete_cms_item:{destructive:!0,idempotent:!0,openWorld:!1},delete_custom_block:{destructive:!0,idempotent:!0,openWorld:!1},execute_cms_action_plan:{destructive:!0,idempotent:!1,openWorld:!0},execute_database_action_plan:{destructive:!0,idempotent:!1,openWorld:!1},execute_database_mutation:{destructive:!0,idempotent:!1,openWorld:!1},finish_site_build:{destructive:!1,idempotent:!0,openWorld:!1},insert_content_block:{destructive:!1,idempotent:!1,openWorld:!1},manage_language:{destructive:!1,idempotent:!0,openWorld:!1},manage_product_category:{destructive:!0,idempotent:!0,openWorld:!1},manage_product_variants:{destructive:!0,idempotent:!1,openWorld:!1},manage_site_script:{destructive:!0,idempotent:!0,openWorld:!1},manage_site_theme:{destructive:!1,idempotent:!0,openWorld:!1},publish_content_draft:{destructive:!1,idempotent:!0,openWorld:!1},reset_site_content:{destructive:!0,idempotent:!0,openWorld:!1},revert_site_script:{destructive:!1,idempotent:!0,openWorld:!1},rewrite_page_draft:{destructive:!1,idempotent:!0,openWorld:!1},save_site_brief:{destructive:!0,idempotent:!0,openWorld:!1},set_content_images:{destructive:!0,idempotent:!1,openWorld:!0},start_site_build:{destructive:!0,idempotent:!1,openWorld:!1},translate_content_bulk:{destructive:!1,idempotent:!0,openWorld:!1},translate_page:{destructive:!1,idempotent:!0,openWorld:!1},update_cms_item_field:{destructive:!1,idempotent:!0,openWorld:!1},upload_media:{destructive:!1,idempotent:!1,openWorld:!0},update_content_block:{destructive:!1,idempotent:!0,openWorld:!1},update_current_cms_fields:{destructive:!1,idempotent:!0,openWorld:!1},update_custom_block:{destructive:!0,idempotent:!1,openWorld:!1},update_footer:{destructive:!0,idempotent:!0,openWorld:!1},update_global_css:{destructive:!0,idempotent:!1,openWorld:!1},update_navigation_bar:{destructive:!0,idempotent:!0,openWorld:!1},update_section_column_block:{destructive:!1,idempotent:!0,openWorld:!1},update_site_identity:{destructive:!1,idempotent:!0,openWorld:!1}},S=new Set(["fetch_url_content","search_stock_photos"]),c={create_page_layout:{canonical:"create_cms_page",description:'Create a new page from a slug, a title and a strictly typed block layout in one call. Every block is normalized and validated against the NextBlock block schema (built-in types from the `cortex://schema/blocks` resource, or a custom block slug from `list_custom_blocks`) before anything is written; an invalid block rejects the whole call. Pass `status: "published"` to go live immediately, or leave the default draft and publish later. To rewrite an existing page instead, use `generate_jsonb_layout`. Alias of `create_cms_page`.',title:"Create page layout"},generate_jsonb_layout:{canonical:"rewrite_page_draft",description:"Generate a complete, strictly-validated JSONB block layout and write it into a target page or post. Blocks are normalized and validated against the NextBlock block schema, then staged as a Live Draft on the target record — nothing goes live until an editor publishes the draft, and publishing snapshots a revision so the change is reversible. Use for whole-page builds and redesigns. Alias of `rewrite_page_draft`.",title:"Generate JSONB layout"},get_database_schema:{canonical:"describe_database_schema",description:"Return the current CMS database structure: every table Cortex AI may read or mutate, its columns, primary keys, and whether it is read-only. Pair with `list_custom_blocks` for the active data-defined block definitions and with the `cortex://schema/blocks` resource for the built-in block types. Read-only. Alias of `describe_database_schema`.",title:"Get database schema"},query_site_analytics:{canonical:"fetch_ecommerce_stats",description:"Query quantitative site analytics: revenue, order counts, order-status breakdowns, and top-selling products over a time range. Read-only. For inventory levels and post/page metrics that this report does not cover, use `read_database_records` against the `products`, `product_variants`, `posts`, or `pages` tables. Alias of `fetch_ecommerce_stats`.",title:"Query site analytics"},search_stock_media:{canonical:"search_stock_photos",description:"Search free stock media (Pexels, then Unsplash) for contextually relevant imagery, returning direct image URLs with dimensions, alt text, and photographer attribution. Drop a returned `url` straight into an image block's `external_url` or a section background. Read-only and zero cost. Requires a stock provider key in CMS Settings → Cortex AI. Alias of `search_stock_photos`.",title:"Search stock media"},update_site_navigation:{canonical:"update_navigation_bar",description:'Alter the public site navigation: header menu items and their nested child hierarchy, per locale. Use mode "append" to add links while preserving the existing menu, "update" to rename or re-point one link, and "replace" only when rebuilding the whole menu. For footer links and copyright use `update_footer`. Alias of `update_navigation_bar`.',title:"Update site navigation"}};function d(e){return e in c?c[e].canonical:e in s?e:null}function y(e){const t=d(e);return t?s[t]:null}function _(e){const t=d(e);if(!t)return null;if(s[t]==="read")return{destructiveHint:!1,idempotentHint:!0,openWorldHint:S.has(t),readOnlyHint:!0};const r=b[t];return{destructiveHint:r.destructive,idempotentHint:r.idempotent,openWorldHint:r.openWorld,readOnlyHint:!1}}function l(e,t){const r=y(t);return r?r==="read"?e.length>0:e.includes("write"):!1}function h(e){return e.split("_").map((r,o)=>o===0?r.charAt(0).toUpperCase()+r.slice(1):r).join(" ")}function g(e){const t={additionalProperties:!1,type:"object"};if(!e||typeof e!="object")return t;try{const r=T.z.toJSONSchema(e,{cycles:"ref",io:"input",reused:"inline",target:"draft-2020-12",unrepresentable:"any"});return delete r.$schema,r.type==="object"?r:t}catch{return t}}function u(e){return x.createCortexGlobalAgentTools(e)}function O(e){const t=Object.keys(u(e)),r=Object.keys(s);return{missingFromRegistry:r.filter(o=>!t.includes(o)),unclassified:t.filter(o=>!r.includes(o))}}function M(e){const t=u(e.context),r=[];for(const[o,i]of Object.entries(t)){if(!(o in s)||!l(e.scopes,o))continue;const a=_(o);a&&r.push({annotations:a,description:i.description??`Cortex AI ${h(o)} tool.`,inputSchema:g(i.inputSchema),name:o,title:h(o)})}for(const[o,i]of Object.entries(c)){const a=t[i.canonical];if(!a||!l(e.scopes,o))continue;const n=_(o);n&&r.push({annotations:n,description:i.description,inputSchema:g(a.inputSchema),name:o,title:i.title})}return r.sort((o,i)=>o.name.localeCompare(i.name))}function f(e,t){return{content:[{text:e,type:"text"}],isError:t}}function R(e){return e.issues.map(t=>`${t.path.length>0?t.path.join("."):"(root)"}: ${t.message}`).join("; ")}class m extends Error{constructor(t){super(`Unknown tool: ${t}`),this.name="CortexMcpUnknownToolError"}}class v extends Error{constructor(t){super(`Tool "${t}" requires the "write" scope. This MCP token is read-only — mint a read+write token in CMS Settings → Cortex AI.`),this.name="CortexMcpForbiddenToolError"}}async function W(e){const t=d(e.name);if(!t)throw new m(e.name);if(!l(e.scopes,e.name))throw new v(e.name);const o=u(e.context)[t];if(!o||typeof o.execute!="function")throw new m(e.name);const i=e.args&&typeof e.args=="object"?e.args:{};if(o.inputSchema&&typeof o.inputSchema.safeParse=="function"){const a=o.inputSchema.safeParse(i);if(!a.success)return f(`Invalid arguments for "${e.name}": ${R(a.error)}`,!0)}try{const a=await o.execute(i),n=JSON.stringify(a??{success:!0},null,2),p=a&&typeof a=="object"&&!Array.isArray(a)?a:null,k=p?.success===!1;return{content:[{text:n,type:"text"}],isError:k,...p?{structuredContent:p}:{}}}catch(a){const n=a instanceof Error?a.message:String(a);return f(`Tool "${e.name}" failed: ${n}`,!0)}}const E=[{description:"The CMS database structure Cortex AI can read and mutate: tables, columns, primary keys, and read-only flags.",mimeType:"application/json",name:"database-schema",title:"NextBlock database schema",uri:"cortex://schema/database"},{description:"The built-in NextBlock block types available when composing page, post, and product layouts.",mimeType:"application/json",name:"block-types",title:"NextBlock block types",uri:"cortex://schema/blocks"},{description:"Data-defined custom block definitions registered in this workspace, keyed by the slug used as a block instance `block_type`.",mimeType:"application/json",name:"custom-blocks",title:"NextBlock custom block definitions",uri:"cortex://schema/custom-blocks"}];async function P(e){const t=u(e.context);if(e.uri==="cortex://schema/database"){const r=await t.describe_database_schema?.execute?.({includeReadOnly:!0});return{mimeType:"application/json",text:JSON.stringify(r??{},null,2),uri:e.uri}}if(e.uri==="cortex://schema/blocks")return{mimeType:"application/json",text:JSON.stringify({blockTypes:C.availableCortexAiBlockTypes},null,2),uri:e.uri};if(e.uri==="cortex://schema/custom-blocks"){const r=await t.list_custom_blocks?.execute?.({});return{mimeType:"application/json",text:JSON.stringify(r??{},null,2),uri:e.uri}}return null}const w=[{arguments:[{description:'Everything known about the client and the site they want: business, audience, goals, pages (or "one landing page"), languages, brand, contact details. Leave blank to be asked.',name:"brief",required:!1}],description:"Build (or rebuild) the whole NextBlock site from a brief: remove the sample content, set the identity and theme, create and publish every page, the menus, the footer, and the translations.",name:"build-site",title:"Build the whole site"},{arguments:[{description:"What the page is for, and any brand or tone notes.",name:"brief",required:!0},{description:'Slug of the page or post to rewrite, e.g. "home".',name:"slug",required:!0}],description:"Build or redesign a NextBlock page from a brief, following the section-based layout recipe, and stage it as a reviewable Live Draft.",name:"build-page",title:"Build a NextBlock page"},{arguments:[{description:"Source URL to draw structure and copy from.",name:"url",required:!0},{description:"Slug of the page to write the result into.",name:"slug",required:!0}],description:"Read an external page and rebuild an equivalent NextBlock page from it, reusing its imagery where available.",name:"clone-from-url",title:"Rebuild a page from a URL"},{arguments:[{description:'Target language code, e.g. "fr".',name:"languageCode",required:!0},{description:"Slug of the page or post to translate.",name:"slug",required:!0}],description:"Translate an existing page or post into another language, preserving its layout and imagery.",name:"translate-content",title:"Translate a page or post"}],A={"build-site":e=>["Build the whole NextBlock site for this client.","",e.brief?.trim()?`Brief:
2
- ${e.brief}`:"A site brief may already be saved (get_site_overview returns it under `brief`): if it is, use it and skip the questions; otherwise ask, in one short numbered list, about the business and what it does, the audience and the one action visitors should take, the site shape (one landing page or which pages), the languages, brand colours and tone, contact details, and whether existing content is kept.","","Process:","1. Call get_site_overview to see what exists, the active languages, and whether the NextBlock demo content is still present. Record what you know with save_site_brief.","2. Present the plan (what is removed, every page with its sections, menus, footer, theme, languages) and call start_site_build with `summary`, `brief`, and `reset` (keepLanguages = the languages wanted) unless existing content is kept. Over MCP the host approves the call; there is no chat confirmation.",'3. Build: update_site_identity (title, description, keywords, copyright, and social_image for the share preview of pages without a feature image); manage_language as needed; manage_site_theme with the brand colours; search_stock_media for imagery when available; rewrite the empty "home" page with generate_jsonb_layout then publish_content_draft; create_cms_page (status "published") for every other page; update_site_navigation (mode "replace") and update_footer for every language; translate_content_bulk for each extra language.',"4. Call finish_site_build with a summary, then report every page with its URL.","Write real copy from the brief, never placeholders. Every page must exist in every active language.","Conventions: mark each page's opening section is_hero:true (priority image loading, centred content); slider:true with a slides array makes a rotating banner; NEVER set feature_image_id on the home page or on a page that opens with a hero section — on a page it renders a full-width title banner above the blocks — but give every post one."].join(`
3
- `),"build-page":e=>[`Build the NextBlock page with slug "${e.slug??"<slug>"}" from this brief:`,"",e.brief??"<brief>","","Process:","1. Call get_database_schema and read_current_cms_item (or read_database_records on `pages`) to ground yourself in what exists.",'2. Compose the page from `section` blocks: one column entry per grid track, the first section a hero (is_hero:true), alternating none / theme:"muted" / theme:"primary" backgrounds for rhythm. Use discrete heading blocks rather than <h2> inside text HTML. Do not set feature_image_id on a page that opens with a hero: on a page it renders a full-width title banner above the blocks.',"3. Call search_stock_media for real photography; copy each photo's attribution fields onto the image block.","4. Write the result with generate_jsonb_layout. It stages a Live Draft — tell the user to preview and publish it."].join(`
4
- `),"clone-from-url":e=>[`Rebuild the NextBlock page "${e.slug??"<slug>"}" based on ${e.url??"<url>"}.`,"","Process:","1. Call fetch_url_content on the URL first. Use its headings, text, and mainImage — never invent an image URL.","2. Map the source structure onto NextBlock `section` blocks; do not copy its markup verbatim.","3. Write the result with generate_jsonb_layout so it lands as a reviewable Live Draft."].join(`
5
- `),"translate-content":e=>[`Translate the page or post "${e.slug??"<slug>"}" into "${e.languageCode??"<languageCode>"}".`,"","Use the translate_page tool: it copies layout, structure, and imagery automatically and links the copy to the original translation group. Supply only the text translations — every visible string, including headings, paragraph text, button labels, image alt text, and captions. Do not rebuild the layout and do not search for new imagery."].join(`
6
- `)};function N(e){const t=w.find(o=>o.name===e.name),r=A[e.name];return!t||!r?null:{description:t.description,messages:[{content:{text:r(e.args??{}),type:"text"},role:"user"}]}}exports.CORTEX_MCP_PROMPTS=w;exports.CORTEX_MCP_RESOURCES=E;exports.CORTEX_MCP_TOOL_ALIASES=c;exports.CORTEX_MCP_TOOL_KINDS=s;exports.CORTEX_MCP_WRITE_TOOL_BEHAVIOURS=b;exports.CortexMcpForbiddenToolError=v;exports.CortexMcpUnknownToolError=m;exports.assertCortexMcpToolCoverage=O;exports.buildCortexMcpToolDefinitions=M;exports.callCortexMcpTool=W;exports.cortexMcpScopesAllow=l;exports.getCortexMcpPrompt=N;exports.getCortexMcpToolAnnotations=_;exports.getCortexMcpToolKind=y;exports.readCortexMcpResource=P;exports.resolveCortexMcpToolName=d;
1
+ require("./zod-config.cjs.js");const e=require("./block-content-schemas.cjs.js"),t=require("./ai-global-agent-tools.cjs.js");let n=require("zod");var r={create_cms_page:`write`,create_cms_post:`write`,create_cms_product:`write`,create_custom_block:`write`,delete_cms_item:`write`,delete_custom_block:`write`,describe_database_schema:`read`,execute_cms_action_plan:`write`,execute_database_action_plan:`write`,execute_database_mutation:`write`,fetch_ecommerce_stats:`read`,fetch_url_content:`read`,finish_site_build:`write`,get_site_overview:`read`,insert_content_block:`write`,list_custom_blocks:`read`,list_media:`read`,list_product_categories:`read`,list_site_script_revisions:`read`,list_site_scripts:`read`,list_site_themes:`read`,manage_language:`write`,manage_product_category:`write`,manage_product_variants:`write`,manage_site_script:`write`,manage_site_theme:`write`,prepare_delete_cms_item:`read`,publish_content_draft:`write`,read_current_cms_item:`read`,read_database_records:`read`,reset_site_content:`write`,revert_site_script:`write`,rewrite_page_draft:`write`,save_site_brief:`write`,search_documentation:`read`,search_stock_photos:`read`,set_content_images:`write`,start_site_build:`write`,translate_content_bulk:`write`,translate_page:`write`,update_cms_item_field:`write`,upload_media:`write`,update_content_block:`write`,update_current_cms_fields:`write`,update_custom_block:`write`,update_footer:`write`,update_global_css:`write`,update_navigation_bar:`write`,update_section_column_block:`write`,update_site_identity:`write`},i={create_cms_page:{destructive:!1,idempotent:!0,openWorld:!0},create_cms_post:{destructive:!1,idempotent:!0,openWorld:!0},create_cms_product:{destructive:!1,idempotent:!0,openWorld:!0},create_custom_block:{destructive:!1,idempotent:!1,openWorld:!1},delete_cms_item:{destructive:!0,idempotent:!0,openWorld:!1},delete_custom_block:{destructive:!0,idempotent:!0,openWorld:!1},execute_cms_action_plan:{destructive:!0,idempotent:!1,openWorld:!0},execute_database_action_plan:{destructive:!0,idempotent:!1,openWorld:!1},execute_database_mutation:{destructive:!0,idempotent:!1,openWorld:!1},finish_site_build:{destructive:!1,idempotent:!0,openWorld:!1},insert_content_block:{destructive:!1,idempotent:!1,openWorld:!1},manage_language:{destructive:!1,idempotent:!0,openWorld:!1},manage_product_category:{destructive:!0,idempotent:!0,openWorld:!1},manage_product_variants:{destructive:!0,idempotent:!1,openWorld:!1},manage_site_script:{destructive:!0,idempotent:!0,openWorld:!1},manage_site_theme:{destructive:!1,idempotent:!0,openWorld:!1},publish_content_draft:{destructive:!1,idempotent:!0,openWorld:!1},reset_site_content:{destructive:!0,idempotent:!0,openWorld:!1},revert_site_script:{destructive:!1,idempotent:!0,openWorld:!1},rewrite_page_draft:{destructive:!1,idempotent:!0,openWorld:!1},save_site_brief:{destructive:!0,idempotent:!0,openWorld:!1},set_content_images:{destructive:!0,idempotent:!1,openWorld:!0},start_site_build:{destructive:!0,idempotent:!1,openWorld:!1},translate_content_bulk:{destructive:!1,idempotent:!0,openWorld:!1},translate_page:{destructive:!1,idempotent:!0,openWorld:!1},update_cms_item_field:{destructive:!1,idempotent:!0,openWorld:!1},upload_media:{destructive:!1,idempotent:!1,openWorld:!0},update_content_block:{destructive:!1,idempotent:!0,openWorld:!1},update_current_cms_fields:{destructive:!1,idempotent:!0,openWorld:!1},update_custom_block:{destructive:!0,idempotent:!1,openWorld:!1},update_footer:{destructive:!0,idempotent:!0,openWorld:!1},update_global_css:{destructive:!0,idempotent:!1,openWorld:!1},update_navigation_bar:{destructive:!0,idempotent:!0,openWorld:!1},update_section_column_block:{destructive:!1,idempotent:!0,openWorld:!1},update_site_identity:{destructive:!1,idempotent:!0,openWorld:!1}},a=new Set([`fetch_url_content`,`search_stock_photos`]),o={create_page_layout:{canonical:`create_cms_page`,description:'Create a new page from a slug, a title and a strictly typed block layout in one call. Every block is normalized and validated against the NextBlock block schema (built-in types from the `cortex://schema/blocks` resource, or a custom block slug from `list_custom_blocks`) before anything is written; an invalid block rejects the whole call. Pass `status: "published"` to go live immediately, or leave the default draft and publish later. To rewrite an existing page instead, use `generate_jsonb_layout`. Alias of `create_cms_page`.',title:`Create page layout`},generate_jsonb_layout:{canonical:`rewrite_page_draft`,description:"Generate a complete, strictly-validated JSONB block layout and write it into a target page or post. Blocks are normalized and validated against the NextBlock block schema, then staged as a Live Draft on the target record — nothing goes live until an editor publishes the draft, and publishing snapshots a revision so the change is reversible. Use for whole-page builds and redesigns. Alias of `rewrite_page_draft`.",title:`Generate JSONB layout`},get_database_schema:{canonical:`describe_database_schema`,description:"Return the current CMS database structure: every table Cortex AI may read or mutate, its columns, primary keys, and whether it is read-only. Pair with `list_custom_blocks` for the active data-defined block definitions and with the `cortex://schema/blocks` resource for the built-in block types. Read-only. Alias of `describe_database_schema`.",title:`Get database schema`},query_site_analytics:{canonical:`fetch_ecommerce_stats`,description:"Query quantitative site analytics: revenue, order counts, order-status breakdowns, and top-selling products over a time range. Read-only. For inventory levels and post/page metrics that this report does not cover, use `read_database_records` against the `products`, `product_variants`, `posts`, or `pages` tables. Alias of `fetch_ecommerce_stats`.",title:`Query site analytics`},search_stock_media:{canonical:`search_stock_photos`,description:"Search free stock media (Pexels, then Unsplash) for contextually relevant imagery, returning direct image URLs with dimensions, alt text, and photographer attribution. Drop a returned `url` straight into an image block's `external_url` or a section background. Read-only and zero cost. Requires a stock provider key in CMS Settings → Cortex AI. Alias of `search_stock_photos`.",title:`Search stock media`},update_site_navigation:{canonical:`update_navigation_bar`,description:'Alter the public site navigation: header menu items and their nested child hierarchy, per locale. Use mode "append" to add links while preserving the existing menu, "update" to rename or re-point one link, and "replace" only when rebuilding the whole menu. For footer links and copyright use `update_footer`. Alias of `update_navigation_bar`.',title:`Update site navigation`}};function s(e){return e in o?o[e].canonical:e in r?e:null}function c(e){let t=s(e);return t?r[t]:null}function l(e){let t=s(e);if(!t)return null;if(r[t]===`read`)return{destructiveHint:!1,idempotentHint:!0,openWorldHint:a.has(t),readOnlyHint:!0};let n=i[t];return{destructiveHint:n.destructive,idempotentHint:n.idempotent,openWorldHint:n.openWorld,readOnlyHint:!1}}function u(e,t){let n=c(t);return n?n===`read`?e.length>0:e.includes(`write`):!1}function d(e){return e.split(`_`).map((e,t)=>t===0?e.charAt(0).toUpperCase()+e.slice(1):e).join(` `)}function f(e){let t={additionalProperties:!1,type:`object`};if(!e||typeof e!=`object`)return t;try{let r=n.z.toJSONSchema(e,{cycles:`ref`,io:`input`,reused:`inline`,target:`draft-2020-12`,unrepresentable:`any`});return delete r.$schema,r.type===`object`?r:t}catch{return t}}function p(e){return t.createCortexGlobalAgentTools(e)}function m(e){let t=Object.keys(p(e)),n=Object.keys(r);return{missingFromRegistry:n.filter(e=>!t.includes(e)),unclassified:t.filter(e=>!n.includes(e))}}function h(e){let t=p(e.context),n=[];for(let[i,a]of Object.entries(t)){if(!(i in r)||!u(e.scopes,i))continue;let t=l(i);t&&n.push({annotations:t,description:a.description??`Cortex AI ${d(i)} tool.`,inputSchema:f(a.inputSchema),name:i,title:d(i)})}for(let[r,i]of Object.entries(o)){let a=t[i.canonical];if(!a||!u(e.scopes,r))continue;let o=l(r);o&&n.push({annotations:o,description:i.description,inputSchema:f(a.inputSchema),name:r,title:i.title})}return n.sort((e,t)=>e.name.localeCompare(t.name))}function g(e,t){return{content:[{text:e,type:`text`}],isError:t}}function _(e){return e.issues.map(e=>`${e.path.length>0?e.path.join(`.`):`(root)`}: ${e.message}`).join(`; `)}var v=class extends Error{constructor(e){super(`Unknown tool: ${e}`),this.name=`CortexMcpUnknownToolError`}},y=class extends Error{constructor(e){super(`Tool "${e}" requires the "write" scope. This MCP token is read-only — mint a read+write token in CMS Settings → Cortex AI.`),this.name=`CortexMcpForbiddenToolError`}};async function b(e){let t=s(e.name);if(!t)throw new v(e.name);if(!u(e.scopes,e.name))throw new y(e.name);let n=p(e.context)[t];if(!n||typeof n.execute!=`function`)throw new v(e.name);let r=e.args&&typeof e.args==`object`?e.args:{};if(n.inputSchema&&typeof n.inputSchema.safeParse==`function`){let t=n.inputSchema.safeParse(r);if(!t.success)return g(`Invalid arguments for "${e.name}": ${_(t.error)}`,!0)}try{let e=await n.execute(r),t=JSON.stringify(e??{success:!0},null,2),i=e&&typeof e==`object`&&!Array.isArray(e)?e:null,a=i?.success===!1;return{content:[{text:t,type:`text`}],isError:a,...i?{structuredContent:i}:{}}}catch(t){let n=t instanceof Error?t.message:String(t);return g(`Tool "${e.name}" failed: ${n}`,!0)}}var x=[{description:`The CMS database structure Cortex AI can read and mutate: tables, columns, primary keys, and read-only flags.`,mimeType:`application/json`,name:`database-schema`,title:`NextBlock database schema`,uri:`cortex://schema/database`},{description:`The built-in NextBlock block types available when composing page, post, and product layouts.`,mimeType:`application/json`,name:`block-types`,title:`NextBlock block types`,uri:`cortex://schema/blocks`},{description:"Data-defined custom block definitions registered in this workspace, keyed by the slug used as a block instance `block_type`.",mimeType:`application/json`,name:`custom-blocks`,title:`NextBlock custom block definitions`,uri:`cortex://schema/custom-blocks`}];async function S(t){let n=p(t.context);if(t.uri===`cortex://schema/database`){let e=await n.describe_database_schema?.execute?.({includeReadOnly:!0});return{mimeType:`application/json`,text:JSON.stringify(e??{},null,2),uri:t.uri}}if(t.uri===`cortex://schema/blocks`)return{mimeType:`application/json`,text:JSON.stringify({blockTypes:e.availableCortexAiBlockTypes},null,2),uri:t.uri};if(t.uri===`cortex://schema/custom-blocks`){let e=await n.list_custom_blocks?.execute?.({});return{mimeType:`application/json`,text:JSON.stringify(e??{},null,2),uri:t.uri}}return null}var C=[{arguments:[{description:`Everything known about the client and the site they want: business, audience, goals, pages (or "one landing page"), languages, brand, contact details. Leave blank to be asked.`,name:`brief`,required:!1}],description:`Build (or rebuild) the whole NextBlock site from a brief: remove the sample content, set the identity and theme, create and publish every page, the menus, the footer, and the translations.`,name:`build-site`,title:`Build the whole site`},{arguments:[{description:`What the page is for, and any brand or tone notes.`,name:`brief`,required:!0},{description:`Slug of the page or post to rewrite, e.g. "home".`,name:`slug`,required:!0}],description:`Build or redesign a NextBlock page from a brief, following the section-based layout recipe, and stage it as a reviewable Live Draft.`,name:`build-page`,title:`Build a NextBlock page`},{arguments:[{description:`Source URL to draw structure and copy from.`,name:`url`,required:!0},{description:`Slug of the page to write the result into.`,name:`slug`,required:!0}],description:`Read an external page and rebuild an equivalent NextBlock page from it, reusing its imagery where available.`,name:`clone-from-url`,title:`Rebuild a page from a URL`},{arguments:[{description:`Target language code, e.g. "fr".`,name:`languageCode`,required:!0},{description:`Slug of the page or post to translate.`,name:`slug`,required:!0}],description:`Translate an existing page or post into another language, preserving its layout and imagery.`,name:`translate-content`,title:`Translate a page or post`}],w={"build-site":e=>[`Build the whole NextBlock site for this client.`,``,e.brief?.trim()?`Brief:\n${e.brief}`:"A site brief may already be saved (get_site_overview returns it under `brief`): if it is, use it and skip the questions; otherwise ask, in one short numbered list, about the business and what it does, the audience and the one action visitors should take, the site shape (one landing page or which pages), the languages, brand colours and tone, contact details, and whether existing content is kept.",``,`Process:`,`1. Call get_site_overview to see what exists, the active languages, and whether the NextBlock demo content is still present. Record what you know with save_site_brief.`,"2. Present the plan (what is removed, every page with its sections, menus, footer, theme, languages) and call start_site_build with `summary`, `brief`, and `reset` (keepLanguages = the languages wanted) unless existing content is kept. Over MCP the host approves the call; there is no chat confirmation.",`3. Build: update_site_identity (title, description, keywords, copyright, and social_image for the share preview of pages without a feature image); manage_language as needed; manage_site_theme with the brand colours; search_stock_media for imagery when available; rewrite the empty "home" page with generate_jsonb_layout then publish_content_draft; create_cms_page (status "published") for every other page; update_site_navigation (mode "replace") and update_footer for every language; translate_content_bulk for each extra language.`,`4. Call finish_site_build with a summary, then report every page with its URL.`,`Write real copy from the brief, never placeholders. Every page must exist in every active language.`,`Conventions: mark each page's opening section is_hero:true (priority image loading, centred content); slider:true with a slides array makes a rotating banner; NEVER set feature_image_id on the home page or on a page that opens with a hero section — on a page it renders a full-width title banner above the blocks — but give every post one.`].join(`
2
+ `),"build-page":e=>[`Build the NextBlock page with slug "${e.slug??`<slug>`}" from this brief:`,``,e.brief??`<brief>`,``,`Process:`,"1. Call get_database_schema and read_current_cms_item (or read_database_records on `pages`) to ground yourself in what exists.",'2. Compose the page from `section` blocks: one column entry per grid track, the first section a hero (is_hero:true), alternating none / theme:"muted" / theme:"primary" backgrounds for rhythm. Use discrete heading blocks rather than <h2> inside text HTML. Do not set feature_image_id on a page that opens with a hero: on a page it renders a full-width title banner above the blocks.',`3. Call search_stock_media for real photography; copy each photo's attribution fields onto the image block.`,`4. Write the result with generate_jsonb_layout. It stages a Live Draft — tell the user to preview and publish it.`].join(`
3
+ `),"clone-from-url":e=>[`Rebuild the NextBlock page "${e.slug??`<slug>`}" based on ${e.url??`<url>`}.`,``,`Process:`,`1. Call fetch_url_content on the URL first. Use its headings, text, and mainImage — never invent an image URL.`,"2. Map the source structure onto NextBlock `section` blocks; do not copy its markup verbatim.",`3. Write the result with generate_jsonb_layout so it lands as a reviewable Live Draft.`].join(`
4
+ `),"translate-content":e=>[`Translate the page or post "${e.slug??`<slug>`}" into "${e.languageCode??`<languageCode>`}".`,``,`Use the translate_page tool: it copies layout, structure, and imagery automatically and links the copy to the original translation group. Supply only the text translations — every visible string, including headings, paragraph text, button labels, image alt text, and captions. Do not rebuild the layout and do not search for new imagery.`].join(`
5
+ `)};function T(e){let t=C.find(t=>t.name===e.name),n=w[e.name];return!t||!n?null:{description:t.description,messages:[{content:{text:n(e.args??{}),type:`text`},role:`user`}]}}exports.CORTEX_MCP_PROMPTS=C,exports.CORTEX_MCP_RESOURCES=x,exports.CORTEX_MCP_TOOL_ALIASES=o,exports.CORTEX_MCP_TOOL_KINDS=r,exports.CORTEX_MCP_WRITE_TOOL_BEHAVIOURS=i,exports.CortexMcpForbiddenToolError=y,exports.CortexMcpUnknownToolError=v,exports.assertCortexMcpToolCoverage=m,exports.buildCortexMcpToolDefinitions=h,exports.callCortexMcpTool=b,exports.cortexMcpScopesAllow=u,exports.getCortexMcpPrompt=T,exports.getCortexMcpToolAnnotations=l,exports.getCortexMcpToolKind=c,exports.readCortexMcpResource=S,exports.resolveCortexMcpToolName=s;