@nextblock-cms/cortex 0.14.6 → 0.15.1

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/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./lib/ai-block-generation.cjs.js"),u=require("./lib/ai-client.cjs.js"),t=require("./lib/ai-config.cjs.js"),S=require("./lib/ai-cortex-widget-builder.cjs.js"),n=require("./lib/ai-global-agent-custom-block-tools.cjs.js"),C=require("./lib/ai-global-agent-db-tools.cjs.js"),e=require("./lib/ai-global-agent-tools.cjs.js"),E=require("./lib/ai-key-crypto.cjs.js"),l=require("./lib/ai-model-catalog.cjs.js"),o=require("./lib/ai-model-registry.cjs.js"),s=require("./lib/cortex-widget-registry.cjs.js"),c=require("./lib/cortex-widget-schema.cjs.js"),r=require("./lib/mcp-server.cjs.js"),a=require("./lib/mcp-tokens.cjs.js"),i=require("./lib/mcp-tool-registry.cjs.js");require("./lib/zod-config.cjs.js");const R=require("zod");exports.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT=_.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT;exports.generateEditorBlocksRequestSchema=_.generateEditorBlocksRequestSchema;exports.generateEditorHtmlFragment=_.generateEditorHtmlFragment;exports.validateGeneratedEditorHtmlFragment=_.validateGeneratedEditorHtmlFragment;exports.createCortexAiOpenRouterClient=u.createCortexAiOpenRouterClient;exports.createCortexAiOpenRouterProvider=u.createCortexAiOpenRouterProvider;exports.generateCortexAiText=u.generateCortexAiText;exports.getStoredCortexAiModelSelection=u.getStoredCortexAiModelSelection;exports.resolveCortexAiOpenRouterCredential=u.resolveCortexAiOpenRouterCredential;exports.CORTEX_AI_AGENT_SETTINGS_BOUNDS=t.CORTEX_AI_AGENT_SETTINGS_BOUNDS;exports.CORTEX_AI_AGENT_SETTINGS_DEFAULTS=t.CORTEX_AI_AGENT_SETTINGS_DEFAULTS;exports.CORTEX_AI_AGENT_SETTINGS_KEY=t.CORTEX_AI_AGENT_SETTINGS_KEY;exports.CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY=t.CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY;exports.CORTEX_AI_OPENROUTER_SETTING_KEY=t.CORTEX_AI_OPENROUTER_SETTING_KEY;exports.CORTEX_AI_PACKAGE_ID=t.CORTEX_AI_PACKAGE_ID;exports.CORTEX_AI_PACKAGE_NAME=t.CORTEX_AI_PACKAGE_NAME;exports.CORTEX_AI_PEXELS_SETTING_KEY=t.CORTEX_AI_PEXELS_SETTING_KEY;exports.CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY=t.CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY;exports.CORTEX_AI_UNSPLASH_SETTING_KEY=t.CORTEX_AI_UNSPLASH_SETTING_KEY;exports.decryptStoredOpenRouterApiKey=t.decryptStoredOpenRouterApiKey;exports.encryptStoredOpenRouterApiKey=t.encryptStoredOpenRouterApiKey;exports.getCortexAiEnvConfig=t.getCortexAiEnvConfig;exports.getEnvOpenRouterKeyStatus=t.getEnvOpenRouterKeyStatus;exports.getOpenRouterEnvApiKey=t.getOpenRouterEnvApiKey;exports.getPexelsEnvApiKey=t.getPexelsEnvApiKey;exports.getStoredOpenRouterKeyStatus=t.getStoredOpenRouterKeyStatus;exports.getUnsplashEnvApiKey=t.getUnsplashEnvApiKey;exports.normalizeCortexAiAgentSettings=t.normalizeCortexAiAgentSettings;exports.resolveCortexAiAgentSettings=t.resolveCortexAiAgentSettings;exports.generateCortexWidgetDefinition=S.generateCortexWidgetDefinition;exports.createCortexCustomBlockTools=n.createCortexCustomBlockTools;exports.createCustomBlockInputSchema=n.createCustomBlockInputSchema;exports.deleteCustomBlockInputSchema=n.deleteCustomBlockInputSchema;exports.executeCreateCustomBlock=n.executeCreateCustomBlock;exports.executeDeleteCustomBlock=n.executeDeleteCustomBlock;exports.executeListCustomBlocks=n.executeListCustomBlocks;exports.executeUpdateCustomBlock=n.executeUpdateCustomBlock;exports.listCustomBlocksInputSchema=n.listCustomBlocksInputSchema;exports.updateCustomBlockInputSchema=n.updateCustomBlockInputSchema;exports.createCortexDatabaseAgentTools=C.createCortexDatabaseAgentTools;exports.describeDatabaseSchemaInputSchema=C.describeDatabaseSchemaInputSchema;exports.executeDatabaseActionPlan=C.executeDatabaseActionPlan;exports.executeDatabaseActionPlanInputSchema=C.executeDatabaseActionPlanInputSchema;exports.executeDatabaseMutation=C.executeDatabaseMutation;exports.executeDatabaseMutationInputSchema=C.executeDatabaseMutationInputSchema;exports.executeDescribeDatabaseSchema=C.executeDescribeDatabaseSchema;exports.executeReadDatabaseRecords=C.executeReadDatabaseRecords;exports.readDatabaseRecordsInputSchema=C.readDatabaseRecordsInputSchema;exports.availableCortexAiBlockTypes=e.availableCortexAiBlockTypes;exports.buildVisibleContactIntroActionPlan=e.buildVisibleContactIntroActionPlan;exports.cortexAiPageContextSchema=e.cortexAiPageContextSchema;exports.createCmsPageInputSchema=e.createCmsPageInputSchema;exports.createCmsPostInputSchema=e.createCmsPostInputSchema;exports.createCmsProductInputSchema=e.createCmsProductInputSchema;exports.createCortexGlobalAgentTools=e.createCortexGlobalAgentTools;exports.deleteCmsItemInputSchema=e.deleteCmsItemInputSchema;exports.executeCmsActionPlan=e.executeCmsActionPlan;exports.executeCmsActionPlanInputSchema=e.executeCmsActionPlanInputSchema;exports.executeCreateCmsPage=e.executeCreateCmsPage;exports.executeCreateCmsPost=e.executeCreateCmsPost;exports.executeCreateCmsProduct=e.executeCreateCmsProduct;exports.executeDeleteCmsItem=e.executeDeleteCmsItem;exports.executeFetchEcommerceStats=e.executeFetchEcommerceStats;exports.executeFetchUrlContent=e.executeFetchUrlContent;exports.executeInsertContentBlock=e.executeInsertContentBlock;exports.executePrepareDeleteCmsItem=e.executePrepareDeleteCmsItem;exports.executeReadCurrentCmsItem=e.executeReadCurrentCmsItem;exports.executeRewritePageDraft=e.executeRewritePageDraft;exports.executeSearchDocumentation=e.executeSearchDocumentation;exports.executeSearchDocumentationWithTimeout=e.executeSearchDocumentationWithTimeout;exports.executeSearchStockPhotos=e.executeSearchStockPhotos;exports.executeSetContentImages=e.executeSetContentImages;exports.executeTranslatePage=e.executeTranslatePage;exports.executeUpdateCmsItemField=e.executeUpdateCmsItemField;exports.executeUpdateContentBlock=e.executeUpdateContentBlock;exports.executeUpdateCurrentCmsFields=e.executeUpdateCurrentCmsFields;exports.executeUpdateFooter=e.executeUpdateFooter;exports.executeUpdateNavigationBar=e.executeUpdateNavigationBar;exports.executeUpdateSectionColumnBlock=e.executeUpdateSectionColumnBlock;exports.fetchEcommerceStatsInputSchema=e.fetchEcommerceStatsInputSchema;exports.fetchUrlContentInputSchema=e.fetchUrlContentInputSchema;exports.insertContentBlockInputSchema=e.insertContentBlockInputSchema;exports.maybeTriggerStockPhotoDownloads=e.maybeTriggerStockPhotoDownloads;exports.navigationItemInputSchema=e.navigationItemInputSchema;exports.prepareDeleteCmsItemInputSchema=e.prepareDeleteCmsItemInputSchema;exports.readCurrentCmsItemInputSchema=e.readCurrentCmsItemInputSchema;exports.resolveCortexAiStockPhotoProvider=e.resolveCortexAiStockPhotoProvider;exports.resolveCortexAiStockPhotoProviders=e.resolveCortexAiStockPhotoProviders;exports.rewritePageDraftInputSchema=e.rewritePageDraftInputSchema;exports.searchDocumentationInputSchema=e.searchDocumentationInputSchema;exports.searchStockPhotosInputSchema=e.searchStockPhotosInputSchema;exports.setContentImagesInputSchema=e.setContentImagesInputSchema;exports.translatePageInputSchema=e.translatePageInputSchema;exports.updateCmsItemFieldInputSchema=e.updateCmsItemFieldInputSchema;exports.updateContentBlockInputSchema=e.updateContentBlockInputSchema;exports.updateCurrentCmsFieldsInputSchema=e.updateCurrentCmsFieldsInputSchema;exports.updateFooterInputSchema=e.updateFooterInputSchema;exports.updateNavigationBarInputSchema=e.updateNavigationBarInputSchema;exports.updateSectionColumnBlockInputSchema=e.updateSectionColumnBlockInputSchema;exports.CORTEX_AI_KEY_ALGORITHM=E.CORTEX_AI_KEY_ALGORITHM;exports.CORTEX_AI_KEY_ENVELOPE_VERSION=E.CORTEX_AI_KEY_ENVELOPE_VERSION;exports.decryptOpenRouterApiKey=E.decryptOpenRouterApiKey;exports.encryptOpenRouterApiKey=E.encryptOpenRouterApiKey;exports.getMaskedOpenRouterKey=E.getMaskedOpenRouterKey;exports.getOpenRouterKeyEnvelopeStatus=E.getOpenRouterKeyEnvelopeStatus;exports.listCortexAiCompatibleOpenRouterModels=l.listCortexAiCompatibleOpenRouterModels;exports.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY=o.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY;exports.CORTEX_AI_MODEL_REGISTRY=o.CORTEX_AI_MODEL_REGISTRY;exports.CORTEX_AI_OPENROUTER_BASE_URL=o.CORTEX_AI_OPENROUTER_BASE_URL;exports.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL=o.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL;exports.CORTEX_AI_REQUIRED_MODEL_PARAMETERS=o.CORTEX_AI_REQUIRED_MODEL_PARAMETERS;exports.CortexAiRoutingError=o.CortexAiRoutingError;exports.buildCortexAiModelFallbackChain=o.buildCortexAiModelFallbackChain;exports.buildCortexAiRoutingPolicy=o.buildCortexAiRoutingPolicy;exports.createCortexAiStoredModelSelection=o.createCortexAiStoredModelSelection;exports.filterCortexAiCompatibleOpenRouterModels=o.filterCortexAiCompatibleOpenRouterModels;exports.getHttpStatusCode=o.getHttpStatusCode;exports.isCortexAiFreeModelId=o.isCortexAiFreeModelId;exports.isOpenRouterRateLimitError=o.isOpenRouterRateLimitError;exports.isOpenRouterRecoverableRoutingError=o.isOpenRouterRecoverableRoutingError;exports.omitUnsupportedCortexAiModelOptions=o.omitUnsupportedCortexAiModelOptions;exports.runWithCortexAiModelFallback=o.runWithCortexAiModelFallback;exports.safeParseCortexAiModelSelection=o.safeParseCortexAiModelSelection;exports.summarizeCortexAiRoutingError=o.summarizeCortexAiRoutingError;exports.CORTEX_WIDGET_DEFINITION_SELECT=s.CORTEX_WIDGET_DEFINITION_SELECT;exports.CortexWidgetRegistryInsertError=s.CortexWidgetRegistryInsertError;exports.buildCortexWidgetDefinitionInsertPayload=s.buildCortexWidgetDefinitionInsertPayload;exports.insertCortexWidgetDefinition=s.insertCortexWidgetDefinition;exports.CORTEX_WIDGET_ALLOWED_RELATION_TABLES=c.CORTEX_WIDGET_ALLOWED_RELATION_TABLES;exports.buildCortexProfileCardVerificationDefinition=c.buildCortexProfileCardVerificationDefinition;exports.buildCortexWidgetBuilderPrompt=c.buildCortexWidgetBuilderPrompt;exports.buildCortexWidgetBuilderSystemPrompt=c.buildCortexWidgetBuilderSystemPrompt;exports.cortexWidgetBuildRequestSchema=c.cortexWidgetBuildRequestSchema;exports.cortexWidgetDbRelationFieldSchema=c.cortexWidgetDbRelationFieldSchema;exports.cortexWidgetDefinitionSchema=c.cortexWidgetDefinitionSchema;exports.cortexWidgetFieldSchema=c.cortexWidgetFieldSchema;exports.cortexWidgetImageR2FieldSchema=c.cortexWidgetImageR2FieldSchema;exports.cortexWidgetLayoutNodeSchema=c.cortexWidgetLayoutNodeSchema;exports.cortexWidgetRichTextFieldSchema=c.cortexWidgetRichTextFieldSchema;exports.cortexWidgetTextFieldSchema=c.cortexWidgetTextFieldSchema;exports.validateCortexWidgetDefinitionOutput=c.validateCortexWidgetDefinitionOutput;exports.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION=r.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION;exports.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION=r.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION;exports.CORTEX_MCP_MODERN_PROTOCOL_VERSION=r.CORTEX_MCP_MODERN_PROTOCOL_VERSION;exports.CORTEX_MCP_SERVER_NAME=r.CORTEX_MCP_SERVER_NAME;exports.CORTEX_MCP_SERVER_TITLE=r.CORTEX_MCP_SERVER_TITLE;exports.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS=r.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS;exports.JSON_RPC_INTERNAL_ERROR=r.JSON_RPC_INTERNAL_ERROR;exports.JSON_RPC_INVALID_PARAMS=r.JSON_RPC_INVALID_PARAMS;exports.JSON_RPC_INVALID_REQUEST=r.JSON_RPC_INVALID_REQUEST;exports.JSON_RPC_METHOD_NOT_FOUND=r.JSON_RPC_METHOD_NOT_FOUND;exports.JSON_RPC_PARSE_ERROR=r.JSON_RPC_PARSE_ERROR;exports.handleCortexMcpMessage=r.handleCortexMcpMessage;exports.isJsonRpcNotification=r.isJsonRpcNotification;exports.isModernEraMessage=r.isModernEraMessage;exports.CORTEX_AI_MCP_SCOPES=a.CORTEX_AI_MCP_SCOPES;exports.CORTEX_AI_MCP_SETTINGS_DEFAULTS=a.CORTEX_AI_MCP_SETTINGS_DEFAULTS;exports.CORTEX_AI_MCP_SETTINGS_KEY=a.CORTEX_AI_MCP_SETTINGS_KEY;exports.CORTEX_AI_MCP_TOKENS_TABLE=a.CORTEX_AI_MCP_TOKENS_TABLE;exports.CORTEX_AI_MCP_TOKEN_PREFIX=a.CORTEX_AI_MCP_TOKEN_PREFIX;exports.hashCortexAiMcpToken=a.hashCortexAiMcpToken;exports.isLocalhostHost=a.isLocalhostHost;exports.mintCortexAiMcpToken=a.mintCortexAiMcpToken;exports.normalizeCortexAiMcpSettings=a.normalizeCortexAiMcpSettings;exports.parseBearerToken=a.parseBearerToken;exports.resolveCortexAiMcpSettings=a.resolveCortexAiMcpSettings;exports.shouldTrustLocalMcpRequest=a.shouldTrustLocalMcpRequest;exports.touchCortexAiMcpToken=a.touchCortexAiMcpToken;exports.verifyCortexAiMcpToken=a.verifyCortexAiMcpToken;exports.CORTEX_MCP_PROMPTS=i.CORTEX_MCP_PROMPTS;exports.CORTEX_MCP_RESOURCES=i.CORTEX_MCP_RESOURCES;exports.CORTEX_MCP_TOOL_ALIASES=i.CORTEX_MCP_TOOL_ALIASES;exports.CORTEX_MCP_TOOL_KINDS=i.CORTEX_MCP_TOOL_KINDS;exports.CortexMcpForbiddenToolError=i.CortexMcpForbiddenToolError;exports.CortexMcpUnknownToolError=i.CortexMcpUnknownToolError;exports.assertCortexMcpToolCoverage=i.assertCortexMcpToolCoverage;exports.buildCortexMcpToolDefinitions=i.buildCortexMcpToolDefinitions;exports.callCortexMcpTool=i.callCortexMcpTool;exports.cortexMcpScopesAllow=i.cortexMcpScopesAllow;exports.getCortexMcpPrompt=i.getCortexMcpPrompt;exports.getCortexMcpToolKind=i.getCortexMcpToolKind;exports.readCortexMcpResource=i.readCortexMcpResource;exports.resolveCortexMcpToolName=i.resolveCortexMcpToolName;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>R.z});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./lib/ai-block-generation.cjs.js"),E=require("./lib/ai-client.cjs.js"),t=require("./lib/ai-config.cjs.js"),S=require("./lib/ai-cortex-widget-builder.cjs.js"),n=require("./lib/ai-global-agent-custom-block-tools.cjs.js"),C=require("./lib/ai-global-agent-db-tools.cjs.js"),e=require("./lib/ai-global-agent-tools.cjs.js"),u=require("./lib/ai-key-crypto.cjs.js"),l=require("./lib/ai-model-catalog.cjs.js"),o=require("./lib/ai-model-registry.cjs.js"),s=require("./lib/cortex-widget-registry.cjs.js"),i=require("./lib/cortex-widget-schema.cjs.js"),r=require("./lib/mcp-server.cjs.js"),a=require("./lib/mcp-tokens.cjs.js"),c=require("./lib/mcp-tool-registry.cjs.js");require("./lib/zod-config.cjs.js");const R=require("zod");exports.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT=_.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT;exports.generateEditorBlocksRequestSchema=_.generateEditorBlocksRequestSchema;exports.generateEditorHtmlFragment=_.generateEditorHtmlFragment;exports.validateGeneratedEditorHtmlFragment=_.validateGeneratedEditorHtmlFragment;exports.createCortexAiOpenRouterClient=E.createCortexAiOpenRouterClient;exports.createCortexAiOpenRouterProvider=E.createCortexAiOpenRouterProvider;exports.generateCortexAiText=E.generateCortexAiText;exports.getStoredCortexAiModelSelection=E.getStoredCortexAiModelSelection;exports.resolveCortexAiOpenRouterCredential=E.resolveCortexAiOpenRouterCredential;exports.CORTEX_AI_AGENT_SETTINGS_BOUNDS=t.CORTEX_AI_AGENT_SETTINGS_BOUNDS;exports.CORTEX_AI_AGENT_SETTINGS_DEFAULTS=t.CORTEX_AI_AGENT_SETTINGS_DEFAULTS;exports.CORTEX_AI_AGENT_SETTINGS_KEY=t.CORTEX_AI_AGENT_SETTINGS_KEY;exports.CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY=t.CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY;exports.CORTEX_AI_OPENROUTER_SETTING_KEY=t.CORTEX_AI_OPENROUTER_SETTING_KEY;exports.CORTEX_AI_PACKAGE_ID=t.CORTEX_AI_PACKAGE_ID;exports.CORTEX_AI_PACKAGE_NAME=t.CORTEX_AI_PACKAGE_NAME;exports.CORTEX_AI_PEXELS_SETTING_KEY=t.CORTEX_AI_PEXELS_SETTING_KEY;exports.CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY=t.CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY;exports.CORTEX_AI_UNSPLASH_SETTING_KEY=t.CORTEX_AI_UNSPLASH_SETTING_KEY;exports.decryptStoredOpenRouterApiKey=t.decryptStoredOpenRouterApiKey;exports.encryptStoredOpenRouterApiKey=t.encryptStoredOpenRouterApiKey;exports.getCortexAiEnvConfig=t.getCortexAiEnvConfig;exports.getEnvOpenRouterKeyStatus=t.getEnvOpenRouterKeyStatus;exports.getOpenRouterEnvApiKey=t.getOpenRouterEnvApiKey;exports.getPexelsEnvApiKey=t.getPexelsEnvApiKey;exports.getStoredOpenRouterKeyStatus=t.getStoredOpenRouterKeyStatus;exports.getUnsplashEnvApiKey=t.getUnsplashEnvApiKey;exports.normalizeCortexAiAgentSettings=t.normalizeCortexAiAgentSettings;exports.resolveCortexAiAgentSettings=t.resolveCortexAiAgentSettings;exports.generateCortexWidgetDefinition=S.generateCortexWidgetDefinition;exports.createCortexCustomBlockTools=n.createCortexCustomBlockTools;exports.createCustomBlockInputSchema=n.createCustomBlockInputSchema;exports.deleteCustomBlockInputSchema=n.deleteCustomBlockInputSchema;exports.executeCreateCustomBlock=n.executeCreateCustomBlock;exports.executeDeleteCustomBlock=n.executeDeleteCustomBlock;exports.executeListCustomBlocks=n.executeListCustomBlocks;exports.executeUpdateCustomBlock=n.executeUpdateCustomBlock;exports.listCustomBlocksInputSchema=n.listCustomBlocksInputSchema;exports.updateCustomBlockInputSchema=n.updateCustomBlockInputSchema;exports.createCortexDatabaseAgentTools=C.createCortexDatabaseAgentTools;exports.describeDatabaseSchemaInputSchema=C.describeDatabaseSchemaInputSchema;exports.executeDatabaseActionPlan=C.executeDatabaseActionPlan;exports.executeDatabaseActionPlanInputSchema=C.executeDatabaseActionPlanInputSchema;exports.executeDatabaseMutation=C.executeDatabaseMutation;exports.executeDatabaseMutationInputSchema=C.executeDatabaseMutationInputSchema;exports.executeDescribeDatabaseSchema=C.executeDescribeDatabaseSchema;exports.executeReadDatabaseRecords=C.executeReadDatabaseRecords;exports.readDatabaseRecordsInputSchema=C.readDatabaseRecordsInputSchema;exports.availableCortexAiBlockTypes=e.availableCortexAiBlockTypes;exports.buildVisibleContactIntroActionPlan=e.buildVisibleContactIntroActionPlan;exports.cortexAiPageContextSchema=e.cortexAiPageContextSchema;exports.createCmsPageInputSchema=e.createCmsPageInputSchema;exports.createCmsPostInputSchema=e.createCmsPostInputSchema;exports.createCmsProductInputSchema=e.createCmsProductInputSchema;exports.createCortexGlobalAgentTools=e.createCortexGlobalAgentTools;exports.deleteCmsItemInputSchema=e.deleteCmsItemInputSchema;exports.executeCmsActionPlan=e.executeCmsActionPlan;exports.executeCmsActionPlanInputSchema=e.executeCmsActionPlanInputSchema;exports.executeCreateCmsPage=e.executeCreateCmsPage;exports.executeCreateCmsPost=e.executeCreateCmsPost;exports.executeCreateCmsProduct=e.executeCreateCmsProduct;exports.executeDeleteCmsItem=e.executeDeleteCmsItem;exports.executeFetchEcommerceStats=e.executeFetchEcommerceStats;exports.executeFetchUrlContent=e.executeFetchUrlContent;exports.executeInsertContentBlock=e.executeInsertContentBlock;exports.executeManageProductVariants=e.executeManageProductVariants;exports.executePrepareDeleteCmsItem=e.executePrepareDeleteCmsItem;exports.executePublishContentDraft=e.executePublishContentDraft;exports.executeReadCurrentCmsItem=e.executeReadCurrentCmsItem;exports.executeRewritePageDraft=e.executeRewritePageDraft;exports.executeSearchDocumentation=e.executeSearchDocumentation;exports.executeSearchDocumentationWithTimeout=e.executeSearchDocumentationWithTimeout;exports.executeSearchStockPhotos=e.executeSearchStockPhotos;exports.executeSetContentImages=e.executeSetContentImages;exports.executeTranslateContentBulk=e.executeTranslateContentBulk;exports.executeTranslatePage=e.executeTranslatePage;exports.executeUpdateCmsItemField=e.executeUpdateCmsItemField;exports.executeUpdateContentBlock=e.executeUpdateContentBlock;exports.executeUpdateCurrentCmsFields=e.executeUpdateCurrentCmsFields;exports.executeUpdateFooter=e.executeUpdateFooter;exports.executeUpdateNavigationBar=e.executeUpdateNavigationBar;exports.executeUpdateSectionColumnBlock=e.executeUpdateSectionColumnBlock;exports.fetchEcommerceStatsInputSchema=e.fetchEcommerceStatsInputSchema;exports.fetchUrlContentInputSchema=e.fetchUrlContentInputSchema;exports.insertContentBlockInputSchema=e.insertContentBlockInputSchema;exports.isBlockedFetchHost=e.isBlockedFetchHost;exports.manageProductVariantsInputSchema=e.manageProductVariantsInputSchema;exports.maybeTriggerStockPhotoDownloads=e.maybeTriggerStockPhotoDownloads;exports.navigationItemInputSchema=e.navigationItemInputSchema;exports.prepareDeleteCmsItemInputSchema=e.prepareDeleteCmsItemInputSchema;exports.publishContentDraftInputSchema=e.publishContentDraftInputSchema;exports.readCurrentCmsItemInputSchema=e.readCurrentCmsItemInputSchema;exports.resolveCortexAiStockPhotoProvider=e.resolveCortexAiStockPhotoProvider;exports.resolveCortexAiStockPhotoProviders=e.resolveCortexAiStockPhotoProviders;exports.rewritePageDraftInputSchema=e.rewritePageDraftInputSchema;exports.searchDocumentationInputSchema=e.searchDocumentationInputSchema;exports.searchStockPhotosInputSchema=e.searchStockPhotosInputSchema;exports.setContentImagesInputSchema=e.setContentImagesInputSchema;exports.translateContentBulkInputSchema=e.translateContentBulkInputSchema;exports.translatePageInputSchema=e.translatePageInputSchema;exports.updateCmsItemFieldInputSchema=e.updateCmsItemFieldInputSchema;exports.updateContentBlockInputSchema=e.updateContentBlockInputSchema;exports.updateCurrentCmsFieldsInputSchema=e.updateCurrentCmsFieldsInputSchema;exports.updateFooterInputSchema=e.updateFooterInputSchema;exports.updateNavigationBarInputSchema=e.updateNavigationBarInputSchema;exports.updateSectionColumnBlockInputSchema=e.updateSectionColumnBlockInputSchema;exports.CORTEX_AI_KEY_ALGORITHM=u.CORTEX_AI_KEY_ALGORITHM;exports.CORTEX_AI_KEY_ENVELOPE_VERSION=u.CORTEX_AI_KEY_ENVELOPE_VERSION;exports.decryptOpenRouterApiKey=u.decryptOpenRouterApiKey;exports.encryptOpenRouterApiKey=u.encryptOpenRouterApiKey;exports.getMaskedOpenRouterKey=u.getMaskedOpenRouterKey;exports.getOpenRouterKeyEnvelopeStatus=u.getOpenRouterKeyEnvelopeStatus;exports.listCortexAiCompatibleOpenRouterModels=l.listCortexAiCompatibleOpenRouterModels;exports.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY=o.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY;exports.CORTEX_AI_MODEL_REGISTRY=o.CORTEX_AI_MODEL_REGISTRY;exports.CORTEX_AI_OPENROUTER_BASE_URL=o.CORTEX_AI_OPENROUTER_BASE_URL;exports.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL=o.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL;exports.CORTEX_AI_REQUIRED_MODEL_PARAMETERS=o.CORTEX_AI_REQUIRED_MODEL_PARAMETERS;exports.CortexAiRoutingError=o.CortexAiRoutingError;exports.buildCortexAiModelFallbackChain=o.buildCortexAiModelFallbackChain;exports.buildCortexAiRoutingPolicy=o.buildCortexAiRoutingPolicy;exports.createCortexAiStoredModelSelection=o.createCortexAiStoredModelSelection;exports.filterCortexAiCompatibleOpenRouterModels=o.filterCortexAiCompatibleOpenRouterModels;exports.getHttpStatusCode=o.getHttpStatusCode;exports.isCortexAiFreeModelId=o.isCortexAiFreeModelId;exports.isOpenRouterRateLimitError=o.isOpenRouterRateLimitError;exports.isOpenRouterRecoverableRoutingError=o.isOpenRouterRecoverableRoutingError;exports.omitUnsupportedCortexAiModelOptions=o.omitUnsupportedCortexAiModelOptions;exports.runWithCortexAiModelFallback=o.runWithCortexAiModelFallback;exports.safeParseCortexAiModelSelection=o.safeParseCortexAiModelSelection;exports.summarizeCortexAiRoutingError=o.summarizeCortexAiRoutingError;exports.CORTEX_WIDGET_DEFINITION_SELECT=s.CORTEX_WIDGET_DEFINITION_SELECT;exports.CortexWidgetRegistryInsertError=s.CortexWidgetRegistryInsertError;exports.buildCortexWidgetDefinitionInsertPayload=s.buildCortexWidgetDefinitionInsertPayload;exports.insertCortexWidgetDefinition=s.insertCortexWidgetDefinition;exports.CORTEX_WIDGET_ALLOWED_RELATION_TABLES=i.CORTEX_WIDGET_ALLOWED_RELATION_TABLES;exports.buildCortexProfileCardVerificationDefinition=i.buildCortexProfileCardVerificationDefinition;exports.buildCortexWidgetBuilderPrompt=i.buildCortexWidgetBuilderPrompt;exports.buildCortexWidgetBuilderSystemPrompt=i.buildCortexWidgetBuilderSystemPrompt;exports.cortexWidgetBuildRequestSchema=i.cortexWidgetBuildRequestSchema;exports.cortexWidgetDbRelationFieldSchema=i.cortexWidgetDbRelationFieldSchema;exports.cortexWidgetDefinitionSchema=i.cortexWidgetDefinitionSchema;exports.cortexWidgetFieldSchema=i.cortexWidgetFieldSchema;exports.cortexWidgetImageR2FieldSchema=i.cortexWidgetImageR2FieldSchema;exports.cortexWidgetLayoutNodeSchema=i.cortexWidgetLayoutNodeSchema;exports.cortexWidgetRichTextFieldSchema=i.cortexWidgetRichTextFieldSchema;exports.cortexWidgetTextFieldSchema=i.cortexWidgetTextFieldSchema;exports.validateCortexWidgetDefinitionOutput=i.validateCortexWidgetDefinitionOutput;exports.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION=r.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION;exports.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION=r.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION;exports.CORTEX_MCP_MODERN_PROTOCOL_VERSION=r.CORTEX_MCP_MODERN_PROTOCOL_VERSION;exports.CORTEX_MCP_SERVER_NAME=r.CORTEX_MCP_SERVER_NAME;exports.CORTEX_MCP_SERVER_TITLE=r.CORTEX_MCP_SERVER_TITLE;exports.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS=r.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS;exports.JSON_RPC_INTERNAL_ERROR=r.JSON_RPC_INTERNAL_ERROR;exports.JSON_RPC_INVALID_PARAMS=r.JSON_RPC_INVALID_PARAMS;exports.JSON_RPC_INVALID_REQUEST=r.JSON_RPC_INVALID_REQUEST;exports.JSON_RPC_METHOD_NOT_FOUND=r.JSON_RPC_METHOD_NOT_FOUND;exports.JSON_RPC_PARSE_ERROR=r.JSON_RPC_PARSE_ERROR;exports.handleCortexMcpMessage=r.handleCortexMcpMessage;exports.isJsonRpcNotification=r.isJsonRpcNotification;exports.isModernEraMessage=r.isModernEraMessage;exports.CORTEX_AI_MCP_SCOPES=a.CORTEX_AI_MCP_SCOPES;exports.CORTEX_AI_MCP_SETTINGS_DEFAULTS=a.CORTEX_AI_MCP_SETTINGS_DEFAULTS;exports.CORTEX_AI_MCP_SETTINGS_KEY=a.CORTEX_AI_MCP_SETTINGS_KEY;exports.CORTEX_AI_MCP_TOKENS_TABLE=a.CORTEX_AI_MCP_TOKENS_TABLE;exports.CORTEX_AI_MCP_TOKEN_PREFIX=a.CORTEX_AI_MCP_TOKEN_PREFIX;exports.hashCortexAiMcpToken=a.hashCortexAiMcpToken;exports.isLocalhostHost=a.isLocalhostHost;exports.mintCortexAiMcpToken=a.mintCortexAiMcpToken;exports.normalizeCortexAiMcpSettings=a.normalizeCortexAiMcpSettings;exports.parseBearerToken=a.parseBearerToken;exports.resolveCortexAiMcpSettings=a.resolveCortexAiMcpSettings;exports.shouldTrustLocalMcpRequest=a.shouldTrustLocalMcpRequest;exports.touchCortexAiMcpToken=a.touchCortexAiMcpToken;exports.verifyCortexAiMcpToken=a.verifyCortexAiMcpToken;exports.CORTEX_MCP_PROMPTS=c.CORTEX_MCP_PROMPTS;exports.CORTEX_MCP_RESOURCES=c.CORTEX_MCP_RESOURCES;exports.CORTEX_MCP_TOOL_ALIASES=c.CORTEX_MCP_TOOL_ALIASES;exports.CORTEX_MCP_TOOL_KINDS=c.CORTEX_MCP_TOOL_KINDS;exports.CortexMcpForbiddenToolError=c.CortexMcpForbiddenToolError;exports.CortexMcpUnknownToolError=c.CortexMcpUnknownToolError;exports.assertCortexMcpToolCoverage=c.assertCortexMcpToolCoverage;exports.buildCortexMcpToolDefinitions=c.buildCortexMcpToolDefinitions;exports.callCortexMcpTool=c.callCortexMcpTool;exports.cortexMcpScopesAllow=c.cortexMcpScopesAllow;exports.getCortexMcpPrompt=c.getCortexMcpPrompt;exports.getCortexMcpToolKind=c.getCortexMcpToolKind;exports.readCortexMcpResource=c.readCortexMcpResource;exports.resolveCortexMcpToolName=c.resolveCortexMcpToolName;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>R.z});
package/index.es.js CHANGED
@@ -1,106 +1,106 @@
1
- import { INLINE_HTML_ASSISTANT_SYSTEM_PROMPT as r, generateEditorBlocksRequestSchema as a, generateEditorHtmlFragment as c, validateGeneratedEditorHtmlFragment as i } from "./lib/ai-block-generation.es.js";
2
- import { createCortexAiOpenRouterClient as C, createCortexAiOpenRouterProvider as E, generateCortexAiText as _, getStoredCortexAiModelSelection as u, resolveCortexAiOpenRouterCredential as S } from "./lib/ai-client.es.js";
3
- import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as m, CORTEX_AI_AGENT_SETTINGS_DEFAULTS as p, CORTEX_AI_AGENT_SETTINGS_KEY as s, CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY as T, CORTEX_AI_OPENROUTER_SETTING_KEY as l, CORTEX_AI_PACKAGE_ID as x, CORTEX_AI_PACKAGE_NAME as O, CORTEX_AI_PEXELS_SETTING_KEY as I, CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY as A, CORTEX_AI_UNSPLASH_SETTING_KEY as d, decryptStoredOpenRouterApiKey as P, encryptStoredOpenRouterApiKey as h, getCortexAiEnvConfig as g, getEnvOpenRouterKeyStatus as M, getOpenRouterEnvApiKey as N, getPexelsEnvApiKey as D, getStoredOpenRouterKeyStatus as L, getUnsplashEnvApiKey as X, normalizeCortexAiAgentSettings as f, resolveCortexAiAgentSettings as k } from "./lib/ai-config.es.js";
4
- import { generateCortexWidgetDefinition as U } from "./lib/ai-cortex-widget-builder.es.js";
5
- import { createCortexCustomBlockTools as F, createCustomBlockInputSchema as K, deleteCustomBlockInputSchema as v, executeCreateCustomBlock as y, executeDeleteCustomBlock as G, executeListCustomBlocks as W, executeUpdateCustomBlock as Y, listCustomBlocksInputSchema as V, updateCustomBlockInputSchema as H } from "./lib/ai-global-agent-custom-block-tools.es.js";
1
+ import { INLINE_HTML_ASSISTANT_SYSTEM_PROMPT as r, generateEditorBlocksRequestSchema as a, generateEditorHtmlFragment as c, validateGeneratedEditorHtmlFragment as n } from "./lib/ai-block-generation.es.js";
2
+ import { createCortexAiOpenRouterClient as C, createCortexAiOpenRouterProvider as E, generateCortexAiText as u, getStoredCortexAiModelSelection as _, resolveCortexAiOpenRouterCredential as S } from "./lib/ai-client.es.js";
3
+ import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as m, CORTEX_AI_AGENT_SETTINGS_DEFAULTS as p, CORTEX_AI_AGENT_SETTINGS_KEY as l, CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY as R, CORTEX_AI_OPENROUTER_SETTING_KEY as T, CORTEX_AI_PACKAGE_ID as x, CORTEX_AI_PACKAGE_NAME as O, CORTEX_AI_PEXELS_SETTING_KEY as I, CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY as A, CORTEX_AI_UNSPLASH_SETTING_KEY as d, decryptStoredOpenRouterApiKey as P, encryptStoredOpenRouterApiKey as h, getCortexAiEnvConfig as g, getEnvOpenRouterKeyStatus as M, getOpenRouterEnvApiKey as N, getPexelsEnvApiKey as D, getStoredOpenRouterKeyStatus as L, getUnsplashEnvApiKey as f, normalizeCortexAiAgentSettings as X, resolveCortexAiAgentSettings as k } from "./lib/ai-config.es.js";
4
+ import { generateCortexWidgetDefinition as B } from "./lib/ai-cortex-widget-builder.es.js";
5
+ import { createCortexCustomBlockTools as U, createCustomBlockInputSchema as K, deleteCustomBlockInputSchema as v, executeCreateCustomBlock as y, executeDeleteCustomBlock as G, executeListCustomBlocks as W, executeUpdateCustomBlock as V, listCustomBlocksInputSchema as Y, updateCustomBlockInputSchema as H } from "./lib/ai-global-agent-custom-block-tools.es.js";
6
6
  import { createCortexDatabaseAgentTools as w, describeDatabaseSchemaInputSchema as z, executeDatabaseActionPlan as q, executeDatabaseActionPlanInputSchema as Q, executeDatabaseMutation as j, executeDatabaseMutationInputSchema as Z, executeDescribeDatabaseSchema as $, executeReadDatabaseRecords as ee, readDatabaseRecordsInputSchema as te } from "./lib/ai-global-agent-db-tools.es.js";
7
- import { availableCortexAiBlockTypes as re, buildVisibleContactIntroActionPlan as ae, cortexAiPageContextSchema as ce, createCmsPageInputSchema as ie, createCmsPostInputSchema as ne, createCmsProductInputSchema as Ce, createCortexGlobalAgentTools as Ee, deleteCmsItemInputSchema as _e, executeCmsActionPlan as ue, executeCmsActionPlanInputSchema as Se, executeCreateCmsPage as Re, executeCreateCmsPost as me, executeCreateCmsProduct as pe, executeDeleteCmsItem as se, executeFetchEcommerceStats as Te, executeFetchUrlContent as le, executeInsertContentBlock as xe, executePrepareDeleteCmsItem as Oe, executeReadCurrentCmsItem as Ie, executeRewritePageDraft as Ae, executeSearchDocumentation as de, executeSearchDocumentationWithTimeout as Pe, executeSearchStockPhotos as he, executeSetContentImages as ge, executeTranslatePage as Me, executeUpdateCmsItemField as Ne, executeUpdateContentBlock as De, executeUpdateCurrentCmsFields as Le, executeUpdateFooter as Xe, executeUpdateNavigationBar as fe, executeUpdateSectionColumnBlock as ke, fetchEcommerceStatsInputSchema as be, fetchUrlContentInputSchema as Ue, insertContentBlockInputSchema as Be, maybeTriggerStockPhotoDownloads as Fe, navigationItemInputSchema as Ke, prepareDeleteCmsItemInputSchema as ve, readCurrentCmsItemInputSchema as ye, resolveCortexAiStockPhotoProvider as Ge, resolveCortexAiStockPhotoProviders as We, rewritePageDraftInputSchema as Ye, searchDocumentationInputSchema as Ve, searchStockPhotosInputSchema as He, setContentImagesInputSchema as Je, translatePageInputSchema as we, updateCmsItemFieldInputSchema as ze, updateContentBlockInputSchema as qe, updateCurrentCmsFieldsInputSchema as Qe, updateFooterInputSchema as je, updateNavigationBarInputSchema as Ze, updateSectionColumnBlockInputSchema as $e } from "./lib/ai-global-agent-tools.es.js";
8
- import { CORTEX_AI_KEY_ALGORITHM as tt, CORTEX_AI_KEY_ENVELOPE_VERSION as ot, decryptOpenRouterApiKey as rt, encryptOpenRouterApiKey as at, getMaskedOpenRouterKey as ct, getOpenRouterKeyEnvelopeStatus as it } from "./lib/ai-key-crypto.es.js";
9
- import { listCortexAiCompatibleOpenRouterModels as Ct } from "./lib/ai-model-catalog.es.js";
10
- import { CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY as _t, CORTEX_AI_MODEL_REGISTRY as ut, CORTEX_AI_OPENROUTER_BASE_URL as St, CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL as Rt, CORTEX_AI_REQUIRED_MODEL_PARAMETERS as mt, CortexAiRoutingError as pt, buildCortexAiModelFallbackChain as st, buildCortexAiRoutingPolicy as Tt, createCortexAiStoredModelSelection as lt, filterCortexAiCompatibleOpenRouterModels as xt, getHttpStatusCode as Ot, isCortexAiFreeModelId as It, isOpenRouterRateLimitError as At, isOpenRouterRecoverableRoutingError as dt, omitUnsupportedCortexAiModelOptions as Pt, runWithCortexAiModelFallback as ht, safeParseCortexAiModelSelection as gt, summarizeCortexAiRoutingError as Mt } from "./lib/ai-model-registry.es.js";
11
- import { CORTEX_WIDGET_DEFINITION_SELECT as Dt, CortexWidgetRegistryInsertError as Lt, buildCortexWidgetDefinitionInsertPayload as Xt, insertCortexWidgetDefinition as ft } from "./lib/cortex-widget-registry.es.js";
12
- import { CORTEX_WIDGET_ALLOWED_RELATION_TABLES as bt, buildCortexProfileCardVerificationDefinition as Ut, buildCortexWidgetBuilderPrompt as Bt, buildCortexWidgetBuilderSystemPrompt as Ft, cortexWidgetBuildRequestSchema as Kt, cortexWidgetDbRelationFieldSchema as vt, cortexWidgetDefinitionSchema as yt, cortexWidgetFieldSchema as Gt, cortexWidgetImageR2FieldSchema as Wt, cortexWidgetLayoutNodeSchema as Yt, cortexWidgetRichTextFieldSchema as Vt, cortexWidgetTextFieldSchema as Ht, validateCortexWidgetDefinitionOutput as Jt } from "./lib/cortex-widget-schema.es.js";
13
- import { CORTEX_MCP_DEFAULT_PROTOCOL_VERSION as zt, CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION as qt, CORTEX_MCP_MODERN_PROTOCOL_VERSION as Qt, CORTEX_MCP_SERVER_NAME as jt, CORTEX_MCP_SERVER_TITLE as Zt, CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS as $t, JSON_RPC_INTERNAL_ERROR as eo, JSON_RPC_INVALID_PARAMS as to, JSON_RPC_INVALID_REQUEST as oo, JSON_RPC_METHOD_NOT_FOUND as ro, JSON_RPC_PARSE_ERROR as ao, handleCortexMcpMessage as co, isJsonRpcNotification as io, isModernEraMessage as no } from "./lib/mcp-server.es.js";
14
- import { CORTEX_AI_MCP_SCOPES as Eo, CORTEX_AI_MCP_SETTINGS_DEFAULTS as _o, CORTEX_AI_MCP_SETTINGS_KEY as uo, CORTEX_AI_MCP_TOKENS_TABLE as So, CORTEX_AI_MCP_TOKEN_PREFIX as Ro, hashCortexAiMcpToken as mo, isLocalhostHost as po, mintCortexAiMcpToken as so, normalizeCortexAiMcpSettings as To, parseBearerToken as lo, resolveCortexAiMcpSettings as xo, shouldTrustLocalMcpRequest as Oo, touchCortexAiMcpToken as Io, verifyCortexAiMcpToken as Ao } from "./lib/mcp-tokens.es.js";
15
- import { CORTEX_MCP_PROMPTS as ho, CORTEX_MCP_RESOURCES as go, CORTEX_MCP_TOOL_ALIASES as Mo, CORTEX_MCP_TOOL_KINDS as No, CortexMcpForbiddenToolError as Do, CortexMcpUnknownToolError as Lo, assertCortexMcpToolCoverage as Xo, buildCortexMcpToolDefinitions as fo, callCortexMcpTool as ko, cortexMcpScopesAllow as bo, getCortexMcpPrompt as Uo, getCortexMcpToolKind as Bo, readCortexMcpResource as Fo, resolveCortexMcpToolName as Ko } from "./lib/mcp-tool-registry.es.js";
7
+ import { availableCortexAiBlockTypes as re, buildVisibleContactIntroActionPlan as ae, cortexAiPageContextSchema as ce, createCmsPageInputSchema as ne, createCmsPostInputSchema as ie, createCmsProductInputSchema as Ce, createCortexGlobalAgentTools as Ee, deleteCmsItemInputSchema as ue, executeCmsActionPlan as _e, executeCmsActionPlanInputSchema as Se, executeCreateCmsPage as se, executeCreateCmsPost as me, executeCreateCmsProduct as pe, executeDeleteCmsItem as le, executeFetchEcommerceStats as Re, executeFetchUrlContent as Te, executeInsertContentBlock as xe, executeManageProductVariants as Oe, executePrepareDeleteCmsItem as Ie, executePublishContentDraft as Ae, executeReadCurrentCmsItem as de, executeRewritePageDraft as Pe, executeSearchDocumentation as he, executeSearchDocumentationWithTimeout as ge, executeSearchStockPhotos as Me, executeSetContentImages as Ne, executeTranslateContentBulk as De, executeTranslatePage as Le, executeUpdateCmsItemField as fe, executeUpdateContentBlock as Xe, executeUpdateCurrentCmsFields as ke, executeUpdateFooter as be, executeUpdateNavigationBar as Be, executeUpdateSectionColumnBlock as Fe, fetchEcommerceStatsInputSchema as Ue, fetchUrlContentInputSchema as Ke, insertContentBlockInputSchema as ve, isBlockedFetchHost as ye, manageProductVariantsInputSchema as Ge, maybeTriggerStockPhotoDownloads as We, navigationItemInputSchema as Ve, prepareDeleteCmsItemInputSchema as Ye, publishContentDraftInputSchema as He, readCurrentCmsItemInputSchema as Je, resolveCortexAiStockPhotoProvider as we, resolveCortexAiStockPhotoProviders as ze, rewritePageDraftInputSchema as qe, searchDocumentationInputSchema as Qe, searchStockPhotosInputSchema as je, setContentImagesInputSchema as Ze, translateContentBulkInputSchema as $e, translatePageInputSchema as et, updateCmsItemFieldInputSchema as tt, updateContentBlockInputSchema as ot, updateCurrentCmsFieldsInputSchema as rt, updateFooterInputSchema as at, updateNavigationBarInputSchema as ct, updateSectionColumnBlockInputSchema as nt } from "./lib/ai-global-agent-tools.es.js";
8
+ import { CORTEX_AI_KEY_ALGORITHM as Ct, CORTEX_AI_KEY_ENVELOPE_VERSION as Et, decryptOpenRouterApiKey as ut, encryptOpenRouterApiKey as _t, getMaskedOpenRouterKey as St, getOpenRouterKeyEnvelopeStatus as st } from "./lib/ai-key-crypto.es.js";
9
+ import { listCortexAiCompatibleOpenRouterModels as pt } from "./lib/ai-model-catalog.es.js";
10
+ import { CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY as Rt, CORTEX_AI_MODEL_REGISTRY as Tt, CORTEX_AI_OPENROUTER_BASE_URL as xt, CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL as Ot, CORTEX_AI_REQUIRED_MODEL_PARAMETERS as It, CortexAiRoutingError as At, buildCortexAiModelFallbackChain as dt, buildCortexAiRoutingPolicy as Pt, createCortexAiStoredModelSelection as ht, filterCortexAiCompatibleOpenRouterModels as gt, getHttpStatusCode as Mt, isCortexAiFreeModelId as Nt, isOpenRouterRateLimitError as Dt, isOpenRouterRecoverableRoutingError as Lt, omitUnsupportedCortexAiModelOptions as ft, runWithCortexAiModelFallback as Xt, safeParseCortexAiModelSelection as kt, summarizeCortexAiRoutingError as bt } from "./lib/ai-model-registry.es.js";
11
+ import { CORTEX_WIDGET_DEFINITION_SELECT as Ft, CortexWidgetRegistryInsertError as Ut, buildCortexWidgetDefinitionInsertPayload as Kt, insertCortexWidgetDefinition as vt } from "./lib/cortex-widget-registry.es.js";
12
+ import { CORTEX_WIDGET_ALLOWED_RELATION_TABLES as Gt, buildCortexProfileCardVerificationDefinition as Wt, buildCortexWidgetBuilderPrompt as Vt, buildCortexWidgetBuilderSystemPrompt as Yt, cortexWidgetBuildRequestSchema as Ht, cortexWidgetDbRelationFieldSchema as Jt, cortexWidgetDefinitionSchema as wt, cortexWidgetFieldSchema as zt, cortexWidgetImageR2FieldSchema as qt, cortexWidgetLayoutNodeSchema as Qt, cortexWidgetRichTextFieldSchema as jt, cortexWidgetTextFieldSchema as Zt, validateCortexWidgetDefinitionOutput as $t } from "./lib/cortex-widget-schema.es.js";
13
+ import { CORTEX_MCP_DEFAULT_PROTOCOL_VERSION as to, CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION as oo, CORTEX_MCP_MODERN_PROTOCOL_VERSION as ro, CORTEX_MCP_SERVER_NAME as ao, CORTEX_MCP_SERVER_TITLE as co, CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS as no, JSON_RPC_INTERNAL_ERROR as io, JSON_RPC_INVALID_PARAMS as Co, JSON_RPC_INVALID_REQUEST as Eo, JSON_RPC_METHOD_NOT_FOUND as uo, JSON_RPC_PARSE_ERROR as _o, handleCortexMcpMessage as So, isJsonRpcNotification as so, isModernEraMessage as mo } from "./lib/mcp-server.es.js";
14
+ import { CORTEX_AI_MCP_SCOPES as lo, CORTEX_AI_MCP_SETTINGS_DEFAULTS as Ro, CORTEX_AI_MCP_SETTINGS_KEY as To, CORTEX_AI_MCP_TOKENS_TABLE as xo, CORTEX_AI_MCP_TOKEN_PREFIX as Oo, hashCortexAiMcpToken as Io, isLocalhostHost as Ao, mintCortexAiMcpToken as Po, normalizeCortexAiMcpSettings as ho, parseBearerToken as go, resolveCortexAiMcpSettings as Mo, shouldTrustLocalMcpRequest as No, touchCortexAiMcpToken as Do, verifyCortexAiMcpToken as Lo } from "./lib/mcp-tokens.es.js";
15
+ import { CORTEX_MCP_PROMPTS as Xo, CORTEX_MCP_RESOURCES as ko, CORTEX_MCP_TOOL_ALIASES as bo, CORTEX_MCP_TOOL_KINDS as Bo, CortexMcpForbiddenToolError as Fo, CortexMcpUnknownToolError as Uo, assertCortexMcpToolCoverage as Ko, buildCortexMcpToolDefinitions as vo, callCortexMcpTool as yo, cortexMcpScopesAllow as Go, getCortexMcpPrompt as Wo, getCortexMcpToolKind as Vo, readCortexMcpResource as Yo, resolveCortexMcpToolName as Ho } from "./lib/mcp-tool-registry.es.js";
16
16
  import "./lib/zod-config.es.js";
17
- import { z as yo } from "zod";
17
+ import { z as wo } from "zod";
18
18
  export {
19
19
  m as CORTEX_AI_AGENT_SETTINGS_BOUNDS,
20
20
  p as CORTEX_AI_AGENT_SETTINGS_DEFAULTS,
21
- s as CORTEX_AI_AGENT_SETTINGS_KEY,
22
- _t as CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY,
23
- tt as CORTEX_AI_KEY_ALGORITHM,
24
- ot as CORTEX_AI_KEY_ENVELOPE_VERSION,
25
- Eo as CORTEX_AI_MCP_SCOPES,
26
- _o as CORTEX_AI_MCP_SETTINGS_DEFAULTS,
27
- uo as CORTEX_AI_MCP_SETTINGS_KEY,
28
- So as CORTEX_AI_MCP_TOKENS_TABLE,
29
- Ro as CORTEX_AI_MCP_TOKEN_PREFIX,
30
- ut as CORTEX_AI_MODEL_REGISTRY,
31
- St as CORTEX_AI_OPENROUTER_BASE_URL,
32
- Rt as CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,
33
- T as CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY,
34
- l as CORTEX_AI_OPENROUTER_SETTING_KEY,
21
+ l as CORTEX_AI_AGENT_SETTINGS_KEY,
22
+ Rt as CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY,
23
+ Ct as CORTEX_AI_KEY_ALGORITHM,
24
+ Et as CORTEX_AI_KEY_ENVELOPE_VERSION,
25
+ lo as CORTEX_AI_MCP_SCOPES,
26
+ Ro as CORTEX_AI_MCP_SETTINGS_DEFAULTS,
27
+ To as CORTEX_AI_MCP_SETTINGS_KEY,
28
+ xo as CORTEX_AI_MCP_TOKENS_TABLE,
29
+ Oo as CORTEX_AI_MCP_TOKEN_PREFIX,
30
+ Tt as CORTEX_AI_MODEL_REGISTRY,
31
+ xt as CORTEX_AI_OPENROUTER_BASE_URL,
32
+ Ot as CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,
33
+ R as CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY,
34
+ T as CORTEX_AI_OPENROUTER_SETTING_KEY,
35
35
  x as CORTEX_AI_PACKAGE_ID,
36
36
  O as CORTEX_AI_PACKAGE_NAME,
37
37
  I as CORTEX_AI_PEXELS_SETTING_KEY,
38
- mt as CORTEX_AI_REQUIRED_MODEL_PARAMETERS,
38
+ It as CORTEX_AI_REQUIRED_MODEL_PARAMETERS,
39
39
  A as CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY,
40
40
  d as CORTEX_AI_UNSPLASH_SETTING_KEY,
41
- zt as CORTEX_MCP_DEFAULT_PROTOCOL_VERSION,
42
- qt as CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION,
43
- Qt as CORTEX_MCP_MODERN_PROTOCOL_VERSION,
44
- ho as CORTEX_MCP_PROMPTS,
45
- go as CORTEX_MCP_RESOURCES,
46
- jt as CORTEX_MCP_SERVER_NAME,
47
- Zt as CORTEX_MCP_SERVER_TITLE,
48
- $t as CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS,
49
- Mo as CORTEX_MCP_TOOL_ALIASES,
50
- No as CORTEX_MCP_TOOL_KINDS,
51
- bt as CORTEX_WIDGET_ALLOWED_RELATION_TABLES,
52
- Dt as CORTEX_WIDGET_DEFINITION_SELECT,
53
- pt as CortexAiRoutingError,
54
- Do as CortexMcpForbiddenToolError,
55
- Lo as CortexMcpUnknownToolError,
56
- Lt as CortexWidgetRegistryInsertError,
41
+ to as CORTEX_MCP_DEFAULT_PROTOCOL_VERSION,
42
+ oo as CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION,
43
+ ro as CORTEX_MCP_MODERN_PROTOCOL_VERSION,
44
+ Xo as CORTEX_MCP_PROMPTS,
45
+ ko as CORTEX_MCP_RESOURCES,
46
+ ao as CORTEX_MCP_SERVER_NAME,
47
+ co as CORTEX_MCP_SERVER_TITLE,
48
+ no as CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS,
49
+ bo as CORTEX_MCP_TOOL_ALIASES,
50
+ Bo as CORTEX_MCP_TOOL_KINDS,
51
+ Gt as CORTEX_WIDGET_ALLOWED_RELATION_TABLES,
52
+ Ft as CORTEX_WIDGET_DEFINITION_SELECT,
53
+ At as CortexAiRoutingError,
54
+ Fo as CortexMcpForbiddenToolError,
55
+ Uo as CortexMcpUnknownToolError,
56
+ Ut as CortexWidgetRegistryInsertError,
57
57
  r as INLINE_HTML_ASSISTANT_SYSTEM_PROMPT,
58
- eo as JSON_RPC_INTERNAL_ERROR,
59
- to as JSON_RPC_INVALID_PARAMS,
60
- oo as JSON_RPC_INVALID_REQUEST,
61
- ro as JSON_RPC_METHOD_NOT_FOUND,
62
- ao as JSON_RPC_PARSE_ERROR,
63
- Xo as assertCortexMcpToolCoverage,
58
+ io as JSON_RPC_INTERNAL_ERROR,
59
+ Co as JSON_RPC_INVALID_PARAMS,
60
+ Eo as JSON_RPC_INVALID_REQUEST,
61
+ uo as JSON_RPC_METHOD_NOT_FOUND,
62
+ _o as JSON_RPC_PARSE_ERROR,
63
+ Ko as assertCortexMcpToolCoverage,
64
64
  re as availableCortexAiBlockTypes,
65
- st as buildCortexAiModelFallbackChain,
66
- Tt as buildCortexAiRoutingPolicy,
67
- fo as buildCortexMcpToolDefinitions,
68
- Ut as buildCortexProfileCardVerificationDefinition,
69
- Bt as buildCortexWidgetBuilderPrompt,
70
- Ft as buildCortexWidgetBuilderSystemPrompt,
71
- Xt as buildCortexWidgetDefinitionInsertPayload,
65
+ dt as buildCortexAiModelFallbackChain,
66
+ Pt as buildCortexAiRoutingPolicy,
67
+ vo as buildCortexMcpToolDefinitions,
68
+ Wt as buildCortexProfileCardVerificationDefinition,
69
+ Vt as buildCortexWidgetBuilderPrompt,
70
+ Yt as buildCortexWidgetBuilderSystemPrompt,
71
+ Kt as buildCortexWidgetDefinitionInsertPayload,
72
72
  ae as buildVisibleContactIntroActionPlan,
73
- ko as callCortexMcpTool,
73
+ yo as callCortexMcpTool,
74
74
  ce as cortexAiPageContextSchema,
75
- bo as cortexMcpScopesAllow,
76
- Kt as cortexWidgetBuildRequestSchema,
77
- vt as cortexWidgetDbRelationFieldSchema,
78
- yt as cortexWidgetDefinitionSchema,
79
- Gt as cortexWidgetFieldSchema,
80
- Wt as cortexWidgetImageR2FieldSchema,
81
- Yt as cortexWidgetLayoutNodeSchema,
82
- Vt as cortexWidgetRichTextFieldSchema,
83
- Ht as cortexWidgetTextFieldSchema,
84
- ie as createCmsPageInputSchema,
85
- ne as createCmsPostInputSchema,
75
+ Go as cortexMcpScopesAllow,
76
+ Ht as cortexWidgetBuildRequestSchema,
77
+ Jt as cortexWidgetDbRelationFieldSchema,
78
+ wt as cortexWidgetDefinitionSchema,
79
+ zt as cortexWidgetFieldSchema,
80
+ qt as cortexWidgetImageR2FieldSchema,
81
+ Qt as cortexWidgetLayoutNodeSchema,
82
+ jt as cortexWidgetRichTextFieldSchema,
83
+ Zt as cortexWidgetTextFieldSchema,
84
+ ne as createCmsPageInputSchema,
85
+ ie as createCmsPostInputSchema,
86
86
  Ce as createCmsProductInputSchema,
87
87
  C as createCortexAiOpenRouterClient,
88
88
  E as createCortexAiOpenRouterProvider,
89
- lt as createCortexAiStoredModelSelection,
90
- F as createCortexCustomBlockTools,
89
+ ht as createCortexAiStoredModelSelection,
90
+ U as createCortexCustomBlockTools,
91
91
  w as createCortexDatabaseAgentTools,
92
92
  Ee as createCortexGlobalAgentTools,
93
93
  K as createCustomBlockInputSchema,
94
- rt as decryptOpenRouterApiKey,
94
+ ut as decryptOpenRouterApiKey,
95
95
  P as decryptStoredOpenRouterApiKey,
96
- _e as deleteCmsItemInputSchema,
96
+ ue as deleteCmsItemInputSchema,
97
97
  v as deleteCustomBlockInputSchema,
98
98
  z as describeDatabaseSchemaInputSchema,
99
- at as encryptOpenRouterApiKey,
99
+ _t as encryptOpenRouterApiKey,
100
100
  h as encryptStoredOpenRouterApiKey,
101
- ue as executeCmsActionPlan,
101
+ _e as executeCmsActionPlan,
102
102
  Se as executeCmsActionPlanInputSchema,
103
- Re as executeCreateCmsPage,
103
+ se as executeCreateCmsPage,
104
104
  me as executeCreateCmsPost,
105
105
  pe as executeCreateCmsProduct,
106
106
  y as executeCreateCustomBlock,
@@ -108,96 +108,103 @@ export {
108
108
  Q as executeDatabaseActionPlanInputSchema,
109
109
  j as executeDatabaseMutation,
110
110
  Z as executeDatabaseMutationInputSchema,
111
- se as executeDeleteCmsItem,
111
+ le as executeDeleteCmsItem,
112
112
  G as executeDeleteCustomBlock,
113
113
  $ as executeDescribeDatabaseSchema,
114
- Te as executeFetchEcommerceStats,
115
- le as executeFetchUrlContent,
114
+ Re as executeFetchEcommerceStats,
115
+ Te as executeFetchUrlContent,
116
116
  xe as executeInsertContentBlock,
117
117
  W as executeListCustomBlocks,
118
- Oe as executePrepareDeleteCmsItem,
119
- Ie as executeReadCurrentCmsItem,
118
+ Oe as executeManageProductVariants,
119
+ Ie as executePrepareDeleteCmsItem,
120
+ Ae as executePublishContentDraft,
121
+ de as executeReadCurrentCmsItem,
120
122
  ee as executeReadDatabaseRecords,
121
- Ae as executeRewritePageDraft,
122
- de as executeSearchDocumentation,
123
- Pe as executeSearchDocumentationWithTimeout,
124
- he as executeSearchStockPhotos,
125
- ge as executeSetContentImages,
126
- Me as executeTranslatePage,
127
- Ne as executeUpdateCmsItemField,
128
- De as executeUpdateContentBlock,
129
- Le as executeUpdateCurrentCmsFields,
130
- Y as executeUpdateCustomBlock,
131
- Xe as executeUpdateFooter,
132
- fe as executeUpdateNavigationBar,
133
- ke as executeUpdateSectionColumnBlock,
134
- be as fetchEcommerceStatsInputSchema,
135
- Ue as fetchUrlContentInputSchema,
136
- xt as filterCortexAiCompatibleOpenRouterModels,
137
- _ as generateCortexAiText,
138
- U as generateCortexWidgetDefinition,
123
+ Pe as executeRewritePageDraft,
124
+ he as executeSearchDocumentation,
125
+ ge as executeSearchDocumentationWithTimeout,
126
+ Me as executeSearchStockPhotos,
127
+ Ne as executeSetContentImages,
128
+ De as executeTranslateContentBulk,
129
+ Le as executeTranslatePage,
130
+ fe as executeUpdateCmsItemField,
131
+ Xe as executeUpdateContentBlock,
132
+ ke as executeUpdateCurrentCmsFields,
133
+ V as executeUpdateCustomBlock,
134
+ be as executeUpdateFooter,
135
+ Be as executeUpdateNavigationBar,
136
+ Fe as executeUpdateSectionColumnBlock,
137
+ Ue as fetchEcommerceStatsInputSchema,
138
+ Ke as fetchUrlContentInputSchema,
139
+ gt as filterCortexAiCompatibleOpenRouterModels,
140
+ u as generateCortexAiText,
141
+ B as generateCortexWidgetDefinition,
139
142
  a as generateEditorBlocksRequestSchema,
140
143
  c as generateEditorHtmlFragment,
141
144
  g as getCortexAiEnvConfig,
142
- Uo as getCortexMcpPrompt,
143
- Bo as getCortexMcpToolKind,
145
+ Wo as getCortexMcpPrompt,
146
+ Vo as getCortexMcpToolKind,
144
147
  M as getEnvOpenRouterKeyStatus,
145
- Ot as getHttpStatusCode,
146
- ct as getMaskedOpenRouterKey,
148
+ Mt as getHttpStatusCode,
149
+ St as getMaskedOpenRouterKey,
147
150
  N as getOpenRouterEnvApiKey,
148
- it as getOpenRouterKeyEnvelopeStatus,
151
+ st as getOpenRouterKeyEnvelopeStatus,
149
152
  D as getPexelsEnvApiKey,
150
- u as getStoredCortexAiModelSelection,
153
+ _ as getStoredCortexAiModelSelection,
151
154
  L as getStoredOpenRouterKeyStatus,
152
- X as getUnsplashEnvApiKey,
153
- co as handleCortexMcpMessage,
154
- mo as hashCortexAiMcpToken,
155
- Be as insertContentBlockInputSchema,
156
- ft as insertCortexWidgetDefinition,
157
- It as isCortexAiFreeModelId,
158
- io as isJsonRpcNotification,
159
- po as isLocalhostHost,
160
- no as isModernEraMessage,
161
- At as isOpenRouterRateLimitError,
162
- dt as isOpenRouterRecoverableRoutingError,
163
- Ct as listCortexAiCompatibleOpenRouterModels,
164
- V as listCustomBlocksInputSchema,
165
- Fe as maybeTriggerStockPhotoDownloads,
166
- so as mintCortexAiMcpToken,
167
- Ke as navigationItemInputSchema,
168
- f as normalizeCortexAiAgentSettings,
169
- To as normalizeCortexAiMcpSettings,
170
- Pt as omitUnsupportedCortexAiModelOptions,
171
- lo as parseBearerToken,
172
- ve as prepareDeleteCmsItemInputSchema,
173
- Fo as readCortexMcpResource,
174
- ye as readCurrentCmsItemInputSchema,
155
+ f as getUnsplashEnvApiKey,
156
+ So as handleCortexMcpMessage,
157
+ Io as hashCortexAiMcpToken,
158
+ ve as insertContentBlockInputSchema,
159
+ vt as insertCortexWidgetDefinition,
160
+ ye as isBlockedFetchHost,
161
+ Nt as isCortexAiFreeModelId,
162
+ so as isJsonRpcNotification,
163
+ Ao as isLocalhostHost,
164
+ mo as isModernEraMessage,
165
+ Dt as isOpenRouterRateLimitError,
166
+ Lt as isOpenRouterRecoverableRoutingError,
167
+ pt as listCortexAiCompatibleOpenRouterModels,
168
+ Y as listCustomBlocksInputSchema,
169
+ Ge as manageProductVariantsInputSchema,
170
+ We as maybeTriggerStockPhotoDownloads,
171
+ Po as mintCortexAiMcpToken,
172
+ Ve as navigationItemInputSchema,
173
+ X as normalizeCortexAiAgentSettings,
174
+ ho as normalizeCortexAiMcpSettings,
175
+ ft as omitUnsupportedCortexAiModelOptions,
176
+ go as parseBearerToken,
177
+ Ye as prepareDeleteCmsItemInputSchema,
178
+ He as publishContentDraftInputSchema,
179
+ Yo as readCortexMcpResource,
180
+ Je as readCurrentCmsItemInputSchema,
175
181
  te as readDatabaseRecordsInputSchema,
176
182
  k as resolveCortexAiAgentSettings,
177
- xo as resolveCortexAiMcpSettings,
183
+ Mo as resolveCortexAiMcpSettings,
178
184
  S as resolveCortexAiOpenRouterCredential,
179
- Ge as resolveCortexAiStockPhotoProvider,
180
- We as resolveCortexAiStockPhotoProviders,
181
- Ko as resolveCortexMcpToolName,
182
- Ye as rewritePageDraftInputSchema,
183
- ht as runWithCortexAiModelFallback,
184
- gt as safeParseCortexAiModelSelection,
185
- Ve as searchDocumentationInputSchema,
186
- He as searchStockPhotosInputSchema,
187
- Je as setContentImagesInputSchema,
188
- Oo as shouldTrustLocalMcpRequest,
189
- Mt as summarizeCortexAiRoutingError,
190
- Io as touchCortexAiMcpToken,
191
- we as translatePageInputSchema,
192
- ze as updateCmsItemFieldInputSchema,
193
- qe as updateContentBlockInputSchema,
194
- Qe as updateCurrentCmsFieldsInputSchema,
185
+ we as resolveCortexAiStockPhotoProvider,
186
+ ze as resolveCortexAiStockPhotoProviders,
187
+ Ho as resolveCortexMcpToolName,
188
+ qe as rewritePageDraftInputSchema,
189
+ Xt as runWithCortexAiModelFallback,
190
+ kt as safeParseCortexAiModelSelection,
191
+ Qe as searchDocumentationInputSchema,
192
+ je as searchStockPhotosInputSchema,
193
+ Ze as setContentImagesInputSchema,
194
+ No as shouldTrustLocalMcpRequest,
195
+ bt as summarizeCortexAiRoutingError,
196
+ Do as touchCortexAiMcpToken,
197
+ $e as translateContentBulkInputSchema,
198
+ et as translatePageInputSchema,
199
+ tt as updateCmsItemFieldInputSchema,
200
+ ot as updateContentBlockInputSchema,
201
+ rt as updateCurrentCmsFieldsInputSchema,
195
202
  H as updateCustomBlockInputSchema,
196
- je as updateFooterInputSchema,
197
- Ze as updateNavigationBarInputSchema,
198
- $e as updateSectionColumnBlockInputSchema,
199
- Jt as validateCortexWidgetDefinitionOutput,
200
- i as validateGeneratedEditorHtmlFragment,
201
- Ao as verifyCortexAiMcpToken,
202
- yo as z
203
+ at as updateFooterInputSchema,
204
+ ct as updateNavigationBarInputSchema,
205
+ nt as updateSectionColumnBlockInputSchema,
206
+ $t as validateCortexWidgetDefinitionOutput,
207
+ n as validateGeneratedEditorHtmlFragment,
208
+ Lo as verifyCortexAiMcpToken,
209
+ wo as z
203
210
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("ai");require("./zod-config.cjs.js");const r=require("zod"),v="id, file_name, object_key, file_type, width, height, description, folder, created_at";function f(e){if(!e?.supabase)throw new Error("No database connection is available for this tool.");return e.supabase}function c(e){return e?e instanceof Error?e.message:typeof e=="object"&&"message"in e?String(e.message):String(e):"unknown error"}function S(e){return e.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,80)}const y=r.z.strictObject({limit:r.z.number().int().min(1).max(100).default(30),query:r.z.string().trim().max(120).optional().describe('Filter on file name or alt text, e.g. "wormwood" or "laboratory".')}),b=r.z.strictObject({altText:r.z.string().trim().max(300).optional().describe("Alt text describing the image. Write real alt text — it is what screen readers announce and what search engines index."),url:r.z.string().trim().min(1).max(2048).describe("Public https URL of the image to bring into the media library.")});async function z(e,i){const t=y.parse(e);let a=f(i).from("media").select(v).order("created_at",{ascending:!1}).limit(t.limit);if(t.query){const s=`%${t.query}%`;a=a.or(`file_name.ilike.${s},description.ilike.${s}`)}const{data:d,error:l}=await a;if(l)throw new Error(`Could not read the media library: ${c(l)}`);return{count:(d??[]).length,media:d??[],success:!0}}async function $(e,i){const t=b.parse(e),o=i?.importExternalImage;if(!o)throw new Error("Media import is not available on this connection.");const a=await o({...t.altText?{altText:t.altText}:{},url:t.url});if("error"in a)throw new Error(`Could not import that image: ${a.error}`);return{mediaId:a.id,mutationExecuted:!0,success:!0}}const x=r.z.strictObject({code:r.z.string().trim().min(2).max(10).describe('Locale code, e.g. "fr", "es", "de". Re-using an existing code updates that language.'),is_active:r.z.boolean().default(!0).describe("Inactive languages are hidden from the public switcher."),is_default:r.z.boolean().default(!1).describe("Make this the site default. Only one language can be default; setting it clears the others."),name:r.z.string().trim().min(1).max(80).describe('Display name, e.g. "Français".')});async function I(e,i){const t=x.parse(e),o=f(i),a=t.code.toLowerCase(),{data:d}=await o.from("languages").select("id, code").eq("code",a).maybeSingle(),l={code:a,is_active:t.is_active,name:t.name};let s=d?.id;if(s){const{error:u}=await o.from("languages").update(l).eq("id",s);if(u)throw new Error(`Could not update the "${a}" language: ${c(u)}`)}else{const{data:u,error:n}=await o.from("languages").insert(l).select("id").single();if(n||!u?.id)throw new Error(`Could not create the "${a}" language: ${c(n)}`);s=u.id}if(t.is_default){const{error:u}=await o.from("languages").update({is_default:!1}).neq("id",s);if(u)throw new Error(`Could not clear the previous default language: ${c(u)}`);const{error:n}=await o.from("languages").update({is_default:!0}).eq("id",s);if(n)throw new Error(`Could not set the default language: ${c(n)}`)}try{i?.revalidatePath?.("/","layout")}catch{}return{code:a,created:!d,languageId:s,mutationExecuted:!0,success:!0}}const _=r.z.strictObject({action:r.z.enum(["upsert","delete"]).default("upsert"),description:r.z.string().max(1e3).nullable().optional(),name:r.z.string().trim().min(1).max(120).describe('Category name, e.g. "Digestive Health".'),name_translations:r.z.record(r.z.string(),r.z.string()).optional().describe('Translated names keyed by locale code, e.g. { "fr": "Santé digestive" }.'),productSlugs:r.z.array(r.z.string().trim().min(1).max(300)).max(100).optional().describe("Product slugs to place in this category. Replaces the category's current membership."),slug:r.z.string().trim().min(1).max(120).optional().describe("URL slug. Derived from the name when omitted. Re-using a slug updates that category.")});async function L(e,i){const t=_.parse(e),o=f(i),a=t.slug?S(t.slug):S(t.name),{data:d}=await o.from("categories").select("id, name, slug").eq("slug",a).maybeSingle();if(t.action==="delete"){if(!d?.id)return{message:`No category with slug "${a}".`,mutationExecuted:!1,success:!1};const{error:n}=await o.from("categories").delete().eq("id",d.id);if(n)throw new Error(`Could not delete the category: ${c(n)}`);return{action:"delete",mutationExecuted:!0,slug:a,success:!0}}const l={name:t.name,slug:a,...t.description!==void 0?{description:t.description}:{},...t.name_translations?{name_translations:t.name_translations}:{}};let s=d?.id;if(s){const{error:n}=await o.from("categories").update(l).eq("id",s);if(n)throw new Error(`Could not update the category: ${c(n)}`)}else{const{data:n,error:g}=await o.from("categories").insert(l).select("id").single();if(g||!n?.id)throw new Error(`Could not create the category: ${c(g)}`);s=n.id}let u=0;if(t.productSlugs){const{data:n,error:g}=await o.from("products").select("id, slug").in("slug",t.productSlugs);if(g)throw new Error(`Could not resolve those products: ${c(g)}`);const p=n??[],C=t.productSlugs.filter(h=>!p.some(w=>w.slug===h));if(C.length>0)throw new Error(`No product found for slug(s): ${C.join(", ")}.`);const{error:E}=await o.from("product_categories").delete().eq("category_id",s);if(E)throw new Error(`Could not clear the category's products: ${c(E)}`);if(p.length>0){const{error:h}=await o.from("product_categories").insert(p.map(w=>({category_id:s,product_id:w.id})));if(h)throw new Error(`Could not add products to the category: ${c(h)}`);u=p.length}}return{categoryId:s,created:!d,linkedProducts:u,mutationExecuted:!0,slug:a,success:!0}}const M=r.z.strictObject({});async function q(e,i){const t=f(i),{data:o,error:a}=await t.from("categories").select("id, name, slug, description, name_translations").order("name");if(a)throw new Error(`Could not read the categories: ${c(a)}`);return{categories:o??[],count:(o??[]).length,success:!0}}function P(e){return{list_media:m.tool({description:"Browse the media library: file names, alt text, dimensions, and media ids. Read-only. Call this BEFORE importing an image so you reuse what is already stored instead of creating a duplicate — the returned `id` can be passed anywhere a media id or image reference is accepted (feature_image_id, product images, an image block).",execute:i=>z(i,e),inputSchema:y,strict:!0}),list_product_categories:m.tool({description:"List the product categories, with their slugs and translated names. Read-only. Use before creating one so an existing category is reused, and to get ids for a product_grid block filtered by category.",execute:i=>q(i,e),inputSchema:M,strict:!0}),manage_language:m.tool({description:"Add or update a site language, so the CMS can hold content in that locale. Creating the language is the FIRST step of making a site multilingual — translate_page cannot target a locale that does not exist yet. Re-using a code updates that language; set is_default to change the site default.",execute:i=>I(i,e),inputSchema:x,strict:!0}),manage_product_category:m.tool({description:"Create, update, or delete a product category, and optionally set exactly which products belong to it by slug. Categories are what a product_grid block filters on, so create these before building a shop page that shows one section of the catalogue. Passing productSlugs REPLACES the category's membership.",execute:i=>L(i,e),inputSchema:_,strict:!0}),upload_media:m.tool({description:"Import an image from a public https URL into the media library and return its media id, without attaching it to anything. Useful when you want one asset reused across several places — otherwise passing the URL straight to create_cms_product `images` or a page/post `feature_image_id` imports it in the same call. Check list_media first to avoid duplicates.",execute:i=>$(i,e),inputSchema:b,strict:!0})}}exports.createCortexContentOpsTools=P;exports.executeListMedia=z;exports.executeListProductCategories=q;exports.executeManageLanguage=I;exports.executeManageProductCategory=L;exports.executeUploadMedia=$;exports.listMediaInputSchema=y;exports.listProductCategoriesInputSchema=M;exports.manageLanguageInputSchema=x;exports.manageProductCategoryInputSchema=_;exports.uploadMediaInputSchema=b;