@nextblock-cms/cortex 0.20.0 → 0.20.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 +1 -1
- package/index.es.js +99 -95
- package/lib/mcp-server.cjs.js +1 -1
- package/lib/mcp-server.d.ts +42 -0
- package/lib/mcp-server.es.js +83 -59
- package/lib/mcp-tool-registry.cjs.js +2 -2
- package/lib/mcp-tool-registry.d.ts +239 -0
- package/lib/mcp-tool-registry.es.js +145 -69
- package/package.json +4 -4
package/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./lib/ai-block-generation.cjs.js"),T=require("./lib/ai-client.cjs.js"),t=require("./lib/ai-config.cjs.js"),I=require("./lib/ai-cortex-widget-builder.cjs.js"),u=require("./lib/ai-global-agent-custom-block-tools.cjs.js"),S=require("./lib/ai-global-agent-db-tools.cjs.js"),o=require("./lib/ai-global-agent-site-tools.cjs.js"),e=require("./lib/ai-global-agent-tools.cjs.js"),_=require("./lib/ai-key-crypto.cjs.js"),m=require("./lib/ai-key-verification.cjs.js"),O=require("./lib/ai-model-catalog.cjs.js"),r=require("./lib/ai-model-registry.cjs.js"),s=require("./lib/ai-seo-metadata.cjs.js"),l=require("./lib/ai-vision.cjs.js"),C=require("./lib/block-content-schemas.cjs.js"),A=require("./lib/cortex-widget-registry.cjs.js"),n=require("./lib/cortex-widget-schema.cjs.js"),a=require("./lib/mcp-server.cjs.js"),i=require("./lib/mcp-tokens.cjs.js"),c=require("./lib/mcp-tool-registry.cjs.js"),E=require("./lib/site-brief.cjs.js");require("./lib/zod-config.cjs.js");const d=require("zod");exports.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT=R.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT;exports.generateEditorBlocksRequestSchema=R.generateEditorBlocksRequestSchema;exports.generateEditorHtmlFragment=R.generateEditorHtmlFragment;exports.validateGeneratedEditorHtmlFragment=R.validateGeneratedEditorHtmlFragment;exports.createCortexAiOpenRouterClient=T.createCortexAiOpenRouterClient;exports.createCortexAiOpenRouterProvider=T.createCortexAiOpenRouterProvider;exports.generateCortexAiText=T.generateCortexAiText;exports.getStoredCortexAiModelSelection=T.getStoredCortexAiModelSelection;exports.resolveCortexAiOpenRouterCredential=T.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=I.generateCortexWidgetDefinition;exports.createCortexCustomBlockTools=u.createCortexCustomBlockTools;exports.createCustomBlockInputSchema=u.createCustomBlockInputSchema;exports.deleteCustomBlockInputSchema=u.deleteCustomBlockInputSchema;exports.executeCreateCustomBlock=u.executeCreateCustomBlock;exports.executeDeleteCustomBlock=u.executeDeleteCustomBlock;exports.executeListCustomBlocks=u.executeListCustomBlocks;exports.executeUpdateCustomBlock=u.executeUpdateCustomBlock;exports.listCustomBlocksInputSchema=u.listCustomBlocksInputSchema;exports.updateCustomBlockInputSchema=u.updateCustomBlockInputSchema;exports.createCortexDatabaseAgentTools=S.createCortexDatabaseAgentTools;exports.describeDatabaseSchemaInputSchema=S.describeDatabaseSchemaInputSchema;exports.executeDatabaseActionPlan=S.executeDatabaseActionPlan;exports.executeDatabaseActionPlanInputSchema=S.executeDatabaseActionPlanInputSchema;exports.executeDatabaseMutation=S.executeDatabaseMutation;exports.executeDatabaseMutationInputSchema=S.executeDatabaseMutationInputSchema;exports.executeDescribeDatabaseSchema=S.executeDescribeDatabaseSchema;exports.executeReadDatabaseRecords=S.executeReadDatabaseRecords;exports.readDatabaseRecordsInputSchema=S.readDatabaseRecordsInputSchema;exports.NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS=o.NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS;exports.NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS=o.NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS;exports.createCortexSiteTools=o.createCortexSiteTools;exports.executeFinishSiteBuild=o.executeFinishSiteBuild;exports.executeGetSiteOverview=o.executeGetSiteOverview;exports.executeResetSiteContent=o.executeResetSiteContent;exports.executeSaveSiteBrief=o.executeSaveSiteBrief;exports.executeStartSiteBuild=o.executeStartSiteBuild;exports.executeUpdateSiteIdentity=o.executeUpdateSiteIdentity;exports.finishSiteBuildInputSchema=o.finishSiteBuildInputSchema;exports.formatCortexSiteOverviewForPrompt=o.formatCortexSiteOverviewForPrompt;exports.getSiteOverviewInputSchema=o.getSiteOverviewInputSchema;exports.readCortexBuildSession=o.readCortexBuildSession;exports.readCortexSiteBrief=o.readCortexSiteBrief;exports.resetSiteContentInputSchema=o.resetSiteContentInputSchema;exports.resolveCortexBuildSession=o.resolveCortexBuildSession;exports.saveSiteBriefInputSchema=o.saveSiteBriefInputSchema;exports.startSiteBuildInputSchema=o.startSiteBuildInputSchema;exports.updateSiteIdentityInputSchema=o.updateSiteIdentityInputSchema;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=_.CORTEX_AI_KEY_ALGORITHM;exports.CORTEX_AI_KEY_ENVELOPE_VERSION=_.CORTEX_AI_KEY_ENVELOPE_VERSION;exports.decryptOpenRouterApiKey=_.decryptOpenRouterApiKey;exports.encryptOpenRouterApiKey=_.encryptOpenRouterApiKey;exports.getMaskedOpenRouterKey=_.getMaskedOpenRouterKey;exports.getOpenRouterKeyEnvelopeStatus=_.getOpenRouterKeyEnvelopeStatus;exports.verifyOpenRouterApiKey=m.verifyOpenRouterApiKey;exports.verifyPexelsApiKey=m.verifyPexelsApiKey;exports.verifyUnsplashAccessKey=m.verifyUnsplashAccessKey;exports.listCortexAiCompatibleOpenRouterModels=O.listCortexAiCompatibleOpenRouterModels;exports.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY=r.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY;exports.CORTEX_AI_MODEL_REGISTRY=r.CORTEX_AI_MODEL_REGISTRY;exports.CORTEX_AI_OPENROUTER_BASE_URL=r.CORTEX_AI_OPENROUTER_BASE_URL;exports.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL=r.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL;exports.CORTEX_AI_REQUIRED_MODEL_PARAMETERS=r.CORTEX_AI_REQUIRED_MODEL_PARAMETERS;exports.CortexAiRoutingError=r.CortexAiRoutingError;exports.buildCortexAiModelFallbackChain=r.buildCortexAiModelFallbackChain;exports.buildCortexAiRoutingPolicy=r.buildCortexAiRoutingPolicy;exports.createCortexAiStoredModelSelection=r.createCortexAiStoredModelSelection;exports.filterCortexAiCompatibleOpenRouterModels=r.filterCortexAiCompatibleOpenRouterModels;exports.getHttpStatusCode=r.getHttpStatusCode;exports.getOpenRouterErrorStatus=r.getOpenRouterErrorStatus;exports.isCortexAiFreeModelId=r.isCortexAiFreeModelId;exports.isOpenRouterRateLimitError=r.isOpenRouterRateLimitError;exports.isOpenRouterRecoverableRoutingError=r.isOpenRouterRecoverableRoutingError;exports.omitUnsupportedCortexAiModelOptions=r.omitUnsupportedCortexAiModelOptions;exports.runWithCortexAiModelFallback=r.runWithCortexAiModelFallback;exports.safeParseCortexAiModelSelection=r.safeParseCortexAiModelSelection;exports.summarizeCortexAiRoutingError=r.summarizeCortexAiRoutingError;exports.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET=s.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET;exports.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS=s.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS;exports.cortexAiSeoMetadataOutputSchema=s.cortexAiSeoMetadataOutputSchema;exports.extractJsonObject=s.extractJsonObject;exports.generateCortexAiSeoMetadata=s.generateCortexAiSeoMetadata;exports.truncateOnWordBoundary=s.truncateOnWordBoundary;exports.CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH=l.CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH;exports.CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY=l.CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY;exports.buildCortexAiVisionRoutingPolicy=l.buildCortexAiVisionRoutingPolicy;exports.generateCortexAiAltText=l.generateCortexAiAltText;exports.isKnownVisionCapableCortexAiModelId=l.isKnownVisionCapableCortexAiModelId;exports.normalizeGeneratedAltText=l.normalizeGeneratedAltText;exports.availableCortexAiBlockTypes=C.availableCortexAiBlockTypes;exports.cortexAiBlockTypeSchema=C.cortexAiBlockTypeSchema;exports.customBlockSlugPatternSchema=C.customBlockSlugPatternSchema;exports.fallbackBlockSchemas=C.fallbackBlockSchemas;exports.isValidBlockType=C.isValidBlockType;exports.loadCustomBlockDefinitions=C.loadCustomBlockDefinitions;exports.readCustomBlockFields=C.readCustomBlockFields;exports.sectionBlockFallbackSchema=C.sectionBlockFallbackSchema;exports.validateCortexBlockContent=C.validateCortexBlockContent;exports.validateCustomBlockInstanceContent=C.validateCustomBlockInstanceContent;exports.CORTEX_WIDGET_DEFINITION_SELECT=A.CORTEX_WIDGET_DEFINITION_SELECT;exports.CortexWidgetRegistryInsertError=A.CortexWidgetRegistryInsertError;exports.buildCortexWidgetDefinitionInsertPayload=A.buildCortexWidgetDefinitionInsertPayload;exports.insertCortexWidgetDefinition=A.insertCortexWidgetDefinition;exports.CORTEX_WIDGET_ALLOWED_RELATION_TABLES=n.CORTEX_WIDGET_ALLOWED_RELATION_TABLES;exports.buildCortexProfileCardVerificationDefinition=n.buildCortexProfileCardVerificationDefinition;exports.buildCortexWidgetBuilderPrompt=n.buildCortexWidgetBuilderPrompt;exports.buildCortexWidgetBuilderSystemPrompt=n.buildCortexWidgetBuilderSystemPrompt;exports.cortexWidgetBuildRequestSchema=n.cortexWidgetBuildRequestSchema;exports.cortexWidgetDbRelationFieldSchema=n.cortexWidgetDbRelationFieldSchema;exports.cortexWidgetDefinitionSchema=n.cortexWidgetDefinitionSchema;exports.cortexWidgetFieldSchema=n.cortexWidgetFieldSchema;exports.cortexWidgetImageR2FieldSchema=n.cortexWidgetImageR2FieldSchema;exports.cortexWidgetLayoutNodeSchema=n.cortexWidgetLayoutNodeSchema;exports.cortexWidgetRichTextFieldSchema=n.cortexWidgetRichTextFieldSchema;exports.cortexWidgetTextFieldSchema=n.cortexWidgetTextFieldSchema;exports.validateCortexWidgetDefinitionOutput=n.validateCortexWidgetDefinitionOutput;exports.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION=a.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION;exports.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION=a.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION;exports.CORTEX_MCP_MODERN_PROTOCOL_VERSION=a.CORTEX_MCP_MODERN_PROTOCOL_VERSION;exports.CORTEX_MCP_SERVER_NAME=a.CORTEX_MCP_SERVER_NAME;exports.CORTEX_MCP_SERVER_TITLE=a.CORTEX_MCP_SERVER_TITLE;exports.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS=a.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS;exports.JSON_RPC_INTERNAL_ERROR=a.JSON_RPC_INTERNAL_ERROR;exports.JSON_RPC_INVALID_PARAMS=a.JSON_RPC_INVALID_PARAMS;exports.JSON_RPC_INVALID_REQUEST=a.JSON_RPC_INVALID_REQUEST;exports.JSON_RPC_METHOD_NOT_FOUND=a.JSON_RPC_METHOD_NOT_FOUND;exports.JSON_RPC_PARSE_ERROR=a.JSON_RPC_PARSE_ERROR;exports.handleCortexMcpMessage=a.handleCortexMcpMessage;exports.isJsonRpcNotification=a.isJsonRpcNotification;exports.isModernEraMessage=a.isModernEraMessage;exports.CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH=i.CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH;exports.CORTEX_AI_MCP_ENV_TOKEN_VAR=i.CORTEX_AI_MCP_ENV_TOKEN_VAR;exports.CORTEX_AI_MCP_SCOPES=i.CORTEX_AI_MCP_SCOPES;exports.CORTEX_AI_MCP_SETTINGS_DEFAULTS=i.CORTEX_AI_MCP_SETTINGS_DEFAULTS;exports.CORTEX_AI_MCP_SETTINGS_KEY=i.CORTEX_AI_MCP_SETTINGS_KEY;exports.CORTEX_AI_MCP_TOKENS_TABLE=i.CORTEX_AI_MCP_TOKENS_TABLE;exports.CORTEX_AI_MCP_TOKEN_PREFIX=i.CORTEX_AI_MCP_TOKEN_PREFIX;exports.hashCortexAiMcpToken=i.hashCortexAiMcpToken;exports.isLocalhostHost=i.isLocalhostHost;exports.matchesCortexAiMcpEnvToken=i.matchesCortexAiMcpEnvToken;exports.mintCortexAiMcpToken=i.mintCortexAiMcpToken;exports.normalizeCortexAiMcpSettings=i.normalizeCortexAiMcpSettings;exports.parseBearerToken=i.parseBearerToken;exports.readCortexAiMcpEnvToken=i.readCortexAiMcpEnvToken;exports.resolveCortexAiMcpSettings=i.resolveCortexAiMcpSettings;exports.shouldTrustLocalMcpRequest=i.shouldTrustLocalMcpRequest;exports.touchCortexAiMcpToken=i.touchCortexAiMcpToken;exports.verifyCortexAiMcpToken=i.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;exports.CORTEX_AI_BUILD_SESSION_SETTING_KEY=E.CORTEX_AI_BUILD_SESSION_SETTING_KEY;exports.CORTEX_AI_SITE_BRIEF_SETTING_KEY=E.CORTEX_AI_SITE_BRIEF_SETTING_KEY;exports.cortexBuildSessionSchema=E.cortexBuildSessionSchema;exports.cortexSiteBriefInputSchema=E.cortexSiteBriefInputSchema;exports.cortexSiteBriefSchema=E.cortexSiteBriefSchema;exports.formatCortexSiteBriefForPrompt=E.formatCortexSiteBriefForPrompt;exports.isCortexBuildSessionUsable=E.isCortexBuildSessionUsable;exports.isCortexSiteBriefComplete=E.isCortexSiteBriefComplete;exports.safeParseCortexSiteBrief=E.safeParseCortexSiteBrief;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>d.z});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("./lib/ai-block-generation.cjs.js"),T=require("./lib/ai-client.cjs.js"),t=require("./lib/ai-config.cjs.js"),m=require("./lib/ai-cortex-widget-builder.cjs.js"),u=require("./lib/ai-global-agent-custom-block-tools.cjs.js"),S=require("./lib/ai-global-agent-db-tools.cjs.js"),o=require("./lib/ai-global-agent-site-tools.cjs.js"),e=require("./lib/ai-global-agent-tools.cjs.js"),_=require("./lib/ai-key-crypto.cjs.js"),O=require("./lib/ai-key-verification.cjs.js"),I=require("./lib/ai-model-catalog.cjs.js"),r=require("./lib/ai-model-registry.cjs.js"),s=require("./lib/ai-seo-metadata.cjs.js"),l=require("./lib/ai-vision.cjs.js"),C=require("./lib/block-content-schemas.cjs.js"),A=require("./lib/cortex-widget-registry.cjs.js"),n=require("./lib/cortex-widget-schema.cjs.js"),a=require("./lib/mcp-server.cjs.js"),i=require("./lib/mcp-tokens.cjs.js"),c=require("./lib/mcp-tool-registry.cjs.js"),E=require("./lib/site-brief.cjs.js");require("./lib/zod-config.cjs.js");const p=require("zod");exports.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT=R.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT;exports.generateEditorBlocksRequestSchema=R.generateEditorBlocksRequestSchema;exports.generateEditorHtmlFragment=R.generateEditorHtmlFragment;exports.validateGeneratedEditorHtmlFragment=R.validateGeneratedEditorHtmlFragment;exports.createCortexAiOpenRouterClient=T.createCortexAiOpenRouterClient;exports.createCortexAiOpenRouterProvider=T.createCortexAiOpenRouterProvider;exports.generateCortexAiText=T.generateCortexAiText;exports.getStoredCortexAiModelSelection=T.getStoredCortexAiModelSelection;exports.resolveCortexAiOpenRouterCredential=T.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=m.generateCortexWidgetDefinition;exports.createCortexCustomBlockTools=u.createCortexCustomBlockTools;exports.createCustomBlockInputSchema=u.createCustomBlockInputSchema;exports.deleteCustomBlockInputSchema=u.deleteCustomBlockInputSchema;exports.executeCreateCustomBlock=u.executeCreateCustomBlock;exports.executeDeleteCustomBlock=u.executeDeleteCustomBlock;exports.executeListCustomBlocks=u.executeListCustomBlocks;exports.executeUpdateCustomBlock=u.executeUpdateCustomBlock;exports.listCustomBlocksInputSchema=u.listCustomBlocksInputSchema;exports.updateCustomBlockInputSchema=u.updateCustomBlockInputSchema;exports.createCortexDatabaseAgentTools=S.createCortexDatabaseAgentTools;exports.describeDatabaseSchemaInputSchema=S.describeDatabaseSchemaInputSchema;exports.executeDatabaseActionPlan=S.executeDatabaseActionPlan;exports.executeDatabaseActionPlanInputSchema=S.executeDatabaseActionPlanInputSchema;exports.executeDatabaseMutation=S.executeDatabaseMutation;exports.executeDatabaseMutationInputSchema=S.executeDatabaseMutationInputSchema;exports.executeDescribeDatabaseSchema=S.executeDescribeDatabaseSchema;exports.executeReadDatabaseRecords=S.executeReadDatabaseRecords;exports.readDatabaseRecordsInputSchema=S.readDatabaseRecordsInputSchema;exports.NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS=o.NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS;exports.NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS=o.NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS;exports.createCortexSiteTools=o.createCortexSiteTools;exports.executeFinishSiteBuild=o.executeFinishSiteBuild;exports.executeGetSiteOverview=o.executeGetSiteOverview;exports.executeResetSiteContent=o.executeResetSiteContent;exports.executeSaveSiteBrief=o.executeSaveSiteBrief;exports.executeStartSiteBuild=o.executeStartSiteBuild;exports.executeUpdateSiteIdentity=o.executeUpdateSiteIdentity;exports.finishSiteBuildInputSchema=o.finishSiteBuildInputSchema;exports.formatCortexSiteOverviewForPrompt=o.formatCortexSiteOverviewForPrompt;exports.getSiteOverviewInputSchema=o.getSiteOverviewInputSchema;exports.readCortexBuildSession=o.readCortexBuildSession;exports.readCortexSiteBrief=o.readCortexSiteBrief;exports.resetSiteContentInputSchema=o.resetSiteContentInputSchema;exports.resolveCortexBuildSession=o.resolveCortexBuildSession;exports.saveSiteBriefInputSchema=o.saveSiteBriefInputSchema;exports.startSiteBuildInputSchema=o.startSiteBuildInputSchema;exports.updateSiteIdentityInputSchema=o.updateSiteIdentityInputSchema;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=_.CORTEX_AI_KEY_ALGORITHM;exports.CORTEX_AI_KEY_ENVELOPE_VERSION=_.CORTEX_AI_KEY_ENVELOPE_VERSION;exports.decryptOpenRouterApiKey=_.decryptOpenRouterApiKey;exports.encryptOpenRouterApiKey=_.encryptOpenRouterApiKey;exports.getMaskedOpenRouterKey=_.getMaskedOpenRouterKey;exports.getOpenRouterKeyEnvelopeStatus=_.getOpenRouterKeyEnvelopeStatus;exports.verifyOpenRouterApiKey=O.verifyOpenRouterApiKey;exports.verifyPexelsApiKey=O.verifyPexelsApiKey;exports.verifyUnsplashAccessKey=O.verifyUnsplashAccessKey;exports.listCortexAiCompatibleOpenRouterModels=I.listCortexAiCompatibleOpenRouterModels;exports.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY=r.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY;exports.CORTEX_AI_MODEL_REGISTRY=r.CORTEX_AI_MODEL_REGISTRY;exports.CORTEX_AI_OPENROUTER_BASE_URL=r.CORTEX_AI_OPENROUTER_BASE_URL;exports.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL=r.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL;exports.CORTEX_AI_REQUIRED_MODEL_PARAMETERS=r.CORTEX_AI_REQUIRED_MODEL_PARAMETERS;exports.CortexAiRoutingError=r.CortexAiRoutingError;exports.buildCortexAiModelFallbackChain=r.buildCortexAiModelFallbackChain;exports.buildCortexAiRoutingPolicy=r.buildCortexAiRoutingPolicy;exports.createCortexAiStoredModelSelection=r.createCortexAiStoredModelSelection;exports.filterCortexAiCompatibleOpenRouterModels=r.filterCortexAiCompatibleOpenRouterModels;exports.getHttpStatusCode=r.getHttpStatusCode;exports.getOpenRouterErrorStatus=r.getOpenRouterErrorStatus;exports.isCortexAiFreeModelId=r.isCortexAiFreeModelId;exports.isOpenRouterRateLimitError=r.isOpenRouterRateLimitError;exports.isOpenRouterRecoverableRoutingError=r.isOpenRouterRecoverableRoutingError;exports.omitUnsupportedCortexAiModelOptions=r.omitUnsupportedCortexAiModelOptions;exports.runWithCortexAiModelFallback=r.runWithCortexAiModelFallback;exports.safeParseCortexAiModelSelection=r.safeParseCortexAiModelSelection;exports.summarizeCortexAiRoutingError=r.summarizeCortexAiRoutingError;exports.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET=s.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET;exports.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS=s.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS;exports.cortexAiSeoMetadataOutputSchema=s.cortexAiSeoMetadataOutputSchema;exports.extractJsonObject=s.extractJsonObject;exports.generateCortexAiSeoMetadata=s.generateCortexAiSeoMetadata;exports.truncateOnWordBoundary=s.truncateOnWordBoundary;exports.CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH=l.CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH;exports.CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY=l.CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY;exports.buildCortexAiVisionRoutingPolicy=l.buildCortexAiVisionRoutingPolicy;exports.generateCortexAiAltText=l.generateCortexAiAltText;exports.isKnownVisionCapableCortexAiModelId=l.isKnownVisionCapableCortexAiModelId;exports.normalizeGeneratedAltText=l.normalizeGeneratedAltText;exports.availableCortexAiBlockTypes=C.availableCortexAiBlockTypes;exports.cortexAiBlockTypeSchema=C.cortexAiBlockTypeSchema;exports.customBlockSlugPatternSchema=C.customBlockSlugPatternSchema;exports.fallbackBlockSchemas=C.fallbackBlockSchemas;exports.isValidBlockType=C.isValidBlockType;exports.loadCustomBlockDefinitions=C.loadCustomBlockDefinitions;exports.readCustomBlockFields=C.readCustomBlockFields;exports.sectionBlockFallbackSchema=C.sectionBlockFallbackSchema;exports.validateCortexBlockContent=C.validateCortexBlockContent;exports.validateCustomBlockInstanceContent=C.validateCustomBlockInstanceContent;exports.CORTEX_WIDGET_DEFINITION_SELECT=A.CORTEX_WIDGET_DEFINITION_SELECT;exports.CortexWidgetRegistryInsertError=A.CortexWidgetRegistryInsertError;exports.buildCortexWidgetDefinitionInsertPayload=A.buildCortexWidgetDefinitionInsertPayload;exports.insertCortexWidgetDefinition=A.insertCortexWidgetDefinition;exports.CORTEX_WIDGET_ALLOWED_RELATION_TABLES=n.CORTEX_WIDGET_ALLOWED_RELATION_TABLES;exports.buildCortexProfileCardVerificationDefinition=n.buildCortexProfileCardVerificationDefinition;exports.buildCortexWidgetBuilderPrompt=n.buildCortexWidgetBuilderPrompt;exports.buildCortexWidgetBuilderSystemPrompt=n.buildCortexWidgetBuilderSystemPrompt;exports.cortexWidgetBuildRequestSchema=n.cortexWidgetBuildRequestSchema;exports.cortexWidgetDbRelationFieldSchema=n.cortexWidgetDbRelationFieldSchema;exports.cortexWidgetDefinitionSchema=n.cortexWidgetDefinitionSchema;exports.cortexWidgetFieldSchema=n.cortexWidgetFieldSchema;exports.cortexWidgetImageR2FieldSchema=n.cortexWidgetImageR2FieldSchema;exports.cortexWidgetLayoutNodeSchema=n.cortexWidgetLayoutNodeSchema;exports.cortexWidgetRichTextFieldSchema=n.cortexWidgetRichTextFieldSchema;exports.cortexWidgetTextFieldSchema=n.cortexWidgetTextFieldSchema;exports.validateCortexWidgetDefinitionOutput=n.validateCortexWidgetDefinitionOutput;exports.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION=a.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION;exports.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION=a.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION;exports.CORTEX_MCP_MODERN_PROTOCOL_VERSION=a.CORTEX_MCP_MODERN_PROTOCOL_VERSION;exports.CORTEX_MCP_SERVER_NAME=a.CORTEX_MCP_SERVER_NAME;exports.CORTEX_MCP_SERVER_TITLE=a.CORTEX_MCP_SERVER_TITLE;exports.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS=a.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS;exports.JSON_RPC_INTERNAL_ERROR=a.JSON_RPC_INTERNAL_ERROR;exports.JSON_RPC_INVALID_PARAMS=a.JSON_RPC_INVALID_PARAMS;exports.JSON_RPC_INVALID_REQUEST=a.JSON_RPC_INVALID_REQUEST;exports.JSON_RPC_METHOD_NOT_FOUND=a.JSON_RPC_METHOD_NOT_FOUND;exports.JSON_RPC_PARSE_ERROR=a.JSON_RPC_PARSE_ERROR;exports.buildCortexMcpDiscoveryDocument=a.buildCortexMcpDiscoveryDocument;exports.handleCortexMcpMessage=a.handleCortexMcpMessage;exports.isJsonRpcNotification=a.isJsonRpcNotification;exports.isModernEraMessage=a.isModernEraMessage;exports.wantsMcpEventStream=a.wantsMcpEventStream;exports.CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH=i.CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH;exports.CORTEX_AI_MCP_ENV_TOKEN_VAR=i.CORTEX_AI_MCP_ENV_TOKEN_VAR;exports.CORTEX_AI_MCP_SCOPES=i.CORTEX_AI_MCP_SCOPES;exports.CORTEX_AI_MCP_SETTINGS_DEFAULTS=i.CORTEX_AI_MCP_SETTINGS_DEFAULTS;exports.CORTEX_AI_MCP_SETTINGS_KEY=i.CORTEX_AI_MCP_SETTINGS_KEY;exports.CORTEX_AI_MCP_TOKENS_TABLE=i.CORTEX_AI_MCP_TOKENS_TABLE;exports.CORTEX_AI_MCP_TOKEN_PREFIX=i.CORTEX_AI_MCP_TOKEN_PREFIX;exports.hashCortexAiMcpToken=i.hashCortexAiMcpToken;exports.isLocalhostHost=i.isLocalhostHost;exports.matchesCortexAiMcpEnvToken=i.matchesCortexAiMcpEnvToken;exports.mintCortexAiMcpToken=i.mintCortexAiMcpToken;exports.normalizeCortexAiMcpSettings=i.normalizeCortexAiMcpSettings;exports.parseBearerToken=i.parseBearerToken;exports.readCortexAiMcpEnvToken=i.readCortexAiMcpEnvToken;exports.resolveCortexAiMcpSettings=i.resolveCortexAiMcpSettings;exports.shouldTrustLocalMcpRequest=i.shouldTrustLocalMcpRequest;exports.touchCortexAiMcpToken=i.touchCortexAiMcpToken;exports.verifyCortexAiMcpToken=i.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.CORTEX_MCP_WRITE_TOOL_BEHAVIOURS=c.CORTEX_MCP_WRITE_TOOL_BEHAVIOURS;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.getCortexMcpToolAnnotations=c.getCortexMcpToolAnnotations;exports.getCortexMcpToolKind=c.getCortexMcpToolKind;exports.readCortexMcpResource=c.readCortexMcpResource;exports.resolveCortexMcpToolName=c.resolveCortexMcpToolName;exports.CORTEX_AI_BUILD_SESSION_SETTING_KEY=E.CORTEX_AI_BUILD_SESSION_SETTING_KEY;exports.CORTEX_AI_SITE_BRIEF_SETTING_KEY=E.CORTEX_AI_SITE_BRIEF_SETTING_KEY;exports.cortexBuildSessionSchema=E.cortexBuildSessionSchema;exports.cortexSiteBriefInputSchema=E.cortexSiteBriefInputSchema;exports.cortexSiteBriefSchema=E.cortexSiteBriefSchema;exports.formatCortexSiteBriefForPrompt=E.formatCortexSiteBriefForPrompt;exports.isCortexBuildSessionUsable=E.isCortexBuildSessionUsable;exports.isCortexSiteBriefComplete=E.isCortexSiteBriefComplete;exports.safeParseCortexSiteBrief=E.safeParseCortexSiteBrief;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>p.z});
|
package/index.es.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import { INLINE_HTML_ASSISTANT_SYSTEM_PROMPT as r, generateEditorBlocksRequestSchema as a, generateEditorHtmlFragment as i, validateGeneratedEditorHtmlFragment as c } from "./lib/ai-block-generation.es.js";
|
|
2
2
|
import { createCortexAiOpenRouterClient as C, createCortexAiOpenRouterProvider as E, generateCortexAiText as _, getStoredCortexAiModelSelection as S, resolveCortexAiOpenRouterCredential as u } from "./lib/ai-client.es.js";
|
|
3
|
-
import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as
|
|
3
|
+
import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as T, CORTEX_AI_AGENT_SETTINGS_DEFAULTS as l, CORTEX_AI_AGENT_SETTINGS_KEY as m, CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY as p, CORTEX_AI_OPENROUTER_SETTING_KEY as x, CORTEX_AI_PACKAGE_ID as R, CORTEX_AI_PACKAGE_NAME as I, CORTEX_AI_PEXELS_SETTING_KEY as O, CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY as A, CORTEX_AI_UNSPLASH_SETTING_KEY as d, decryptStoredOpenRouterApiKey as P, encryptStoredOpenRouterApiKey as h, getCortexAiEnvConfig as M, getEnvOpenRouterKeyStatus as g, getOpenRouterEnvApiKey as N, getPexelsEnvApiKey as B, getStoredOpenRouterKeyStatus as D, getUnsplashEnvApiKey as f, normalizeCortexAiAgentSettings as L, resolveCortexAiAgentSettings as X } from "./lib/ai-config.es.js";
|
|
4
4
|
import { generateCortexWidgetDefinition as v } from "./lib/ai-cortex-widget-builder.es.js";
|
|
5
|
-
import { createCortexCustomBlockTools as
|
|
5
|
+
import { createCortexCustomBlockTools as K, createCustomBlockInputSchema as U, deleteCustomBlockInputSchema as F, executeCreateCustomBlock as y, executeDeleteCustomBlock as G, executeListCustomBlocks as V, executeUpdateCustomBlock as W, listCustomBlocksInputSchema as Y, updateCustomBlockInputSchema as H } from "./lib/ai-global-agent-custom-block-tools.es.js";
|
|
6
6
|
import { createCortexDatabaseAgentTools as J, 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 { NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS as re, NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS as ae, createCortexSiteTools as ie, executeFinishSiteBuild as ce, executeGetSiteOverview as ne, executeResetSiteContent as Ce, executeSaveSiteBrief as Ee, executeStartSiteBuild as _e, executeUpdateSiteIdentity as Se, finishSiteBuildInputSchema as ue, formatCortexSiteOverviewForPrompt as se, getSiteOverviewInputSchema as
|
|
8
|
-
import { buildVisibleContactIntroActionPlan as de, cortexAiPageContextSchema as Pe, createCmsPageInputSchema as he, createCmsPostInputSchema as Me, createCmsProductInputSchema as
|
|
9
|
-
import { CORTEX_AI_KEY_ALGORITHM as
|
|
10
|
-
import { verifyOpenRouterApiKey as kt, verifyPexelsApiKey as vt, verifyUnsplashAccessKey as
|
|
11
|
-
import { listCortexAiCompatibleOpenRouterModels as
|
|
7
|
+
import { NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS as re, NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS as ae, createCortexSiteTools as ie, executeFinishSiteBuild as ce, executeGetSiteOverview as ne, executeResetSiteContent as Ce, executeSaveSiteBrief as Ee, executeStartSiteBuild as _e, executeUpdateSiteIdentity as Se, finishSiteBuildInputSchema as ue, formatCortexSiteOverviewForPrompt as se, getSiteOverviewInputSchema as Te, readCortexBuildSession as le, readCortexSiteBrief as me, resetSiteContentInputSchema as pe, resolveCortexBuildSession as xe, saveSiteBriefInputSchema as Re, startSiteBuildInputSchema as Ie, updateSiteIdentityInputSchema as Oe } from "./lib/ai-global-agent-site-tools.es.js";
|
|
8
|
+
import { buildVisibleContactIntroActionPlan as de, cortexAiPageContextSchema as Pe, createCmsPageInputSchema as he, createCmsPostInputSchema as Me, createCmsProductInputSchema as ge, createCortexGlobalAgentTools as Ne, deleteCmsItemInputSchema as Be, executeCmsActionPlan as De, executeCmsActionPlanInputSchema as fe, executeCreateCmsPage as Le, executeCreateCmsPost as Xe, executeCreateCmsProduct as ke, executeDeleteCmsItem as ve, executeFetchEcommerceStats as be, executeFetchUrlContent as Ke, executeInsertContentBlock as Ue, executeManageProductVariants as Fe, executePrepareDeleteCmsItem as ye, executePublishContentDraft as Ge, executeReadCurrentCmsItem as Ve, executeRewritePageDraft as We, executeSearchDocumentation as Ye, executeSearchDocumentationWithTimeout as He, executeSearchStockPhotos as we, executeSetContentImages as Je, executeTranslateContentBulk as ze, executeTranslatePage as qe, executeUpdateCmsItemField as Qe, executeUpdateContentBlock as je, executeUpdateCurrentCmsFields as Ze, executeUpdateFooter as $e, executeUpdateNavigationBar as et, executeUpdateSectionColumnBlock as tt, fetchEcommerceStatsInputSchema as ot, fetchUrlContentInputSchema as rt, insertContentBlockInputSchema as at, isBlockedFetchHost as it, manageProductVariantsInputSchema as ct, maybeTriggerStockPhotoDownloads as nt, navigationItemInputSchema as Ct, prepareDeleteCmsItemInputSchema as Et, publishContentDraftInputSchema as _t, readCurrentCmsItemInputSchema as St, resolveCortexAiStockPhotoProvider as ut, resolveCortexAiStockPhotoProviders as st, rewritePageDraftInputSchema as Tt, searchDocumentationInputSchema as lt, searchStockPhotosInputSchema as mt, setContentImagesInputSchema as pt, translateContentBulkInputSchema as xt, translatePageInputSchema as Rt, updateCmsItemFieldInputSchema as It, updateContentBlockInputSchema as Ot, updateCurrentCmsFieldsInputSchema as At, updateFooterInputSchema as dt, updateNavigationBarInputSchema as Pt, updateSectionColumnBlockInputSchema as ht } from "./lib/ai-global-agent-tools.es.js";
|
|
9
|
+
import { CORTEX_AI_KEY_ALGORITHM as gt, CORTEX_AI_KEY_ENVELOPE_VERSION as Nt, decryptOpenRouterApiKey as Bt, encryptOpenRouterApiKey as Dt, getMaskedOpenRouterKey as ft, getOpenRouterKeyEnvelopeStatus as Lt } from "./lib/ai-key-crypto.es.js";
|
|
10
|
+
import { verifyOpenRouterApiKey as kt, verifyPexelsApiKey as vt, verifyUnsplashAccessKey as bt } from "./lib/ai-key-verification.es.js";
|
|
11
|
+
import { listCortexAiCompatibleOpenRouterModels as Ut } from "./lib/ai-model-catalog.es.js";
|
|
12
12
|
import { CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY as yt, CORTEX_AI_MODEL_REGISTRY as Gt, CORTEX_AI_OPENROUTER_BASE_URL as Vt, CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL as Wt, CORTEX_AI_REQUIRED_MODEL_PARAMETERS as Yt, CortexAiRoutingError as Ht, buildCortexAiModelFallbackChain as wt, buildCortexAiRoutingPolicy as Jt, createCortexAiStoredModelSelection as zt, filterCortexAiCompatibleOpenRouterModels as qt, getHttpStatusCode as Qt, getOpenRouterErrorStatus as jt, isCortexAiFreeModelId as Zt, isOpenRouterRateLimitError as $t, isOpenRouterRecoverableRoutingError as eo, omitUnsupportedCortexAiModelOptions as to, runWithCortexAiModelFallback as oo, safeParseCortexAiModelSelection as ro, summarizeCortexAiRoutingError as ao } from "./lib/ai-model-registry.es.js";
|
|
13
13
|
import { CORTEX_AI_SEO_METADATA_CONTENT_BUDGET as co, CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS as no, cortexAiSeoMetadataOutputSchema as Co, extractJsonObject as Eo, generateCortexAiSeoMetadata as _o, truncateOnWordBoundary as So } from "./lib/ai-seo-metadata.es.js";
|
|
14
|
-
import { CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH as so, CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY as
|
|
15
|
-
import { availableCortexAiBlockTypes as Io, cortexAiBlockTypeSchema as
|
|
14
|
+
import { CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH as so, CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY as To, buildCortexAiVisionRoutingPolicy as lo, generateCortexAiAltText as mo, isKnownVisionCapableCortexAiModelId as po, normalizeGeneratedAltText as xo } from "./lib/ai-vision.es.js";
|
|
15
|
+
import { availableCortexAiBlockTypes as Io, cortexAiBlockTypeSchema as Oo, customBlockSlugPatternSchema as Ao, fallbackBlockSchemas as Po, isValidBlockType as ho, loadCustomBlockDefinitions as Mo, readCustomBlockFields as go, sectionBlockFallbackSchema as No, validateCortexBlockContent as Bo, validateCustomBlockInstanceContent as Do } from "./lib/block-content-schemas.es.js";
|
|
16
16
|
import { CORTEX_WIDGET_DEFINITION_SELECT as Lo, CortexWidgetRegistryInsertError as Xo, buildCortexWidgetDefinitionInsertPayload as ko, insertCortexWidgetDefinition as vo } from "./lib/cortex-widget-registry.es.js";
|
|
17
|
-
import { CORTEX_WIDGET_ALLOWED_RELATION_TABLES as
|
|
18
|
-
import { CORTEX_MCP_DEFAULT_PROTOCOL_VERSION as jo, CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION as Zo, CORTEX_MCP_MODERN_PROTOCOL_VERSION as $o, CORTEX_MCP_SERVER_NAME as er, CORTEX_MCP_SERVER_TITLE as tr, CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS as or, JSON_RPC_INTERNAL_ERROR as rr, JSON_RPC_INVALID_PARAMS as ar, JSON_RPC_INVALID_REQUEST as ir, JSON_RPC_METHOD_NOT_FOUND as cr, JSON_RPC_PARSE_ERROR as nr,
|
|
19
|
-
import { CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH as
|
|
20
|
-
import { CORTEX_MCP_PROMPTS as
|
|
21
|
-
import { CORTEX_AI_BUILD_SESSION_SETTING_KEY as
|
|
17
|
+
import { CORTEX_WIDGET_ALLOWED_RELATION_TABLES as Ko, buildCortexProfileCardVerificationDefinition as Uo, buildCortexWidgetBuilderPrompt as Fo, buildCortexWidgetBuilderSystemPrompt as yo, cortexWidgetBuildRequestSchema as Go, cortexWidgetDbRelationFieldSchema as Vo, cortexWidgetDefinitionSchema as Wo, cortexWidgetFieldSchema as Yo, cortexWidgetImageR2FieldSchema as Ho, cortexWidgetLayoutNodeSchema as wo, cortexWidgetRichTextFieldSchema as Jo, cortexWidgetTextFieldSchema as zo, validateCortexWidgetDefinitionOutput as qo } from "./lib/cortex-widget-schema.es.js";
|
|
18
|
+
import { CORTEX_MCP_DEFAULT_PROTOCOL_VERSION as jo, CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION as Zo, CORTEX_MCP_MODERN_PROTOCOL_VERSION as $o, CORTEX_MCP_SERVER_NAME as er, CORTEX_MCP_SERVER_TITLE as tr, CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS as or, JSON_RPC_INTERNAL_ERROR as rr, JSON_RPC_INVALID_PARAMS as ar, JSON_RPC_INVALID_REQUEST as ir, JSON_RPC_METHOD_NOT_FOUND as cr, JSON_RPC_PARSE_ERROR as nr, buildCortexMcpDiscoveryDocument as Cr, handleCortexMcpMessage as Er, isJsonRpcNotification as _r, isModernEraMessage as Sr, wantsMcpEventStream as ur } from "./lib/mcp-server.es.js";
|
|
19
|
+
import { CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH as Tr, CORTEX_AI_MCP_ENV_TOKEN_VAR as lr, CORTEX_AI_MCP_SCOPES as mr, CORTEX_AI_MCP_SETTINGS_DEFAULTS as pr, CORTEX_AI_MCP_SETTINGS_KEY as xr, CORTEX_AI_MCP_TOKENS_TABLE as Rr, CORTEX_AI_MCP_TOKEN_PREFIX as Ir, hashCortexAiMcpToken as Or, isLocalhostHost as Ar, matchesCortexAiMcpEnvToken as dr, mintCortexAiMcpToken as Pr, normalizeCortexAiMcpSettings as hr, parseBearerToken as Mr, readCortexAiMcpEnvToken as gr, resolveCortexAiMcpSettings as Nr, shouldTrustLocalMcpRequest as Br, touchCortexAiMcpToken as Dr, verifyCortexAiMcpToken as fr } from "./lib/mcp-tokens.es.js";
|
|
20
|
+
import { CORTEX_MCP_PROMPTS as Xr, CORTEX_MCP_RESOURCES as kr, CORTEX_MCP_TOOL_ALIASES as vr, CORTEX_MCP_TOOL_KINDS as br, CORTEX_MCP_WRITE_TOOL_BEHAVIOURS as Kr, CortexMcpForbiddenToolError as Ur, CortexMcpUnknownToolError as Fr, assertCortexMcpToolCoverage as yr, buildCortexMcpToolDefinitions as Gr, callCortexMcpTool as Vr, cortexMcpScopesAllow as Wr, getCortexMcpPrompt as Yr, getCortexMcpToolAnnotations as Hr, getCortexMcpToolKind as wr, readCortexMcpResource as Jr, resolveCortexMcpToolName as zr } from "./lib/mcp-tool-registry.es.js";
|
|
21
|
+
import { CORTEX_AI_BUILD_SESSION_SETTING_KEY as Qr, CORTEX_AI_SITE_BRIEF_SETTING_KEY as jr, cortexBuildSessionSchema as Zr, cortexSiteBriefInputSchema as $r, cortexSiteBriefSchema as ea, formatCortexSiteBriefForPrompt as ta, isCortexBuildSessionUsable as oa, isCortexSiteBriefComplete as ra, safeParseCortexSiteBrief as aa } from "./lib/site-brief.es.js";
|
|
22
22
|
import "./lib/zod-config.es.js";
|
|
23
|
-
import { z as
|
|
23
|
+
import { z as ca } from "zod";
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
T as CORTEX_AI_AGENT_SETTINGS_BOUNDS,
|
|
26
|
+
l as CORTEX_AI_AGENT_SETTINGS_DEFAULTS,
|
|
27
27
|
m as CORTEX_AI_AGENT_SETTINGS_KEY,
|
|
28
|
-
|
|
28
|
+
Qr as CORTEX_AI_BUILD_SESSION_SETTING_KEY,
|
|
29
29
|
so as CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH,
|
|
30
30
|
yt as CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
gt as CORTEX_AI_KEY_ALGORITHM,
|
|
32
|
+
Nt as CORTEX_AI_KEY_ENVELOPE_VERSION,
|
|
33
|
+
Tr as CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH,
|
|
34
|
+
lr as CORTEX_AI_MCP_ENV_TOKEN_VAR,
|
|
35
|
+
mr as CORTEX_AI_MCP_SCOPES,
|
|
36
|
+
pr as CORTEX_AI_MCP_SETTINGS_DEFAULTS,
|
|
37
|
+
xr as CORTEX_AI_MCP_SETTINGS_KEY,
|
|
38
|
+
Rr as CORTEX_AI_MCP_TOKENS_TABLE,
|
|
39
|
+
Ir as CORTEX_AI_MCP_TOKEN_PREFIX,
|
|
40
40
|
Gt as CORTEX_AI_MODEL_REGISTRY,
|
|
41
41
|
Vt as CORTEX_AI_OPENROUTER_BASE_URL,
|
|
42
42
|
Wt as CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,
|
|
@@ -44,29 +44,30 @@ export {
|
|
|
44
44
|
x as CORTEX_AI_OPENROUTER_SETTING_KEY,
|
|
45
45
|
R as CORTEX_AI_PACKAGE_ID,
|
|
46
46
|
I as CORTEX_AI_PACKAGE_NAME,
|
|
47
|
-
|
|
47
|
+
O as CORTEX_AI_PEXELS_SETTING_KEY,
|
|
48
48
|
Yt as CORTEX_AI_REQUIRED_MODEL_PARAMETERS,
|
|
49
49
|
co as CORTEX_AI_SEO_METADATA_CONTENT_BUDGET,
|
|
50
50
|
no as CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
jr as CORTEX_AI_SITE_BRIEF_SETTING_KEY,
|
|
52
|
+
A as CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY,
|
|
53
53
|
d as CORTEX_AI_UNSPLASH_SETTING_KEY,
|
|
54
|
-
|
|
54
|
+
To as CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY,
|
|
55
55
|
jo as CORTEX_MCP_DEFAULT_PROTOCOL_VERSION,
|
|
56
56
|
Zo as CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION,
|
|
57
57
|
$o as CORTEX_MCP_MODERN_PROTOCOL_VERSION,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
Xr as CORTEX_MCP_PROMPTS,
|
|
59
|
+
kr as CORTEX_MCP_RESOURCES,
|
|
60
60
|
er as CORTEX_MCP_SERVER_NAME,
|
|
61
61
|
tr as CORTEX_MCP_SERVER_TITLE,
|
|
62
62
|
or as CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
vr as CORTEX_MCP_TOOL_ALIASES,
|
|
64
|
+
br as CORTEX_MCP_TOOL_KINDS,
|
|
65
|
+
Kr as CORTEX_MCP_WRITE_TOOL_BEHAVIOURS,
|
|
66
|
+
Ko as CORTEX_WIDGET_ALLOWED_RELATION_TABLES,
|
|
66
67
|
Lo as CORTEX_WIDGET_DEFINITION_SELECT,
|
|
67
68
|
Ht as CortexAiRoutingError,
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
Ur as CortexMcpForbiddenToolError,
|
|
70
|
+
Fr as CortexMcpUnknownToolError,
|
|
70
71
|
Xo as CortexWidgetRegistryInsertError,
|
|
71
72
|
r as INLINE_HTML_ASSISTANT_SYSTEM_PROMPT,
|
|
72
73
|
rr as JSON_RPC_INTERNAL_ERROR,
|
|
@@ -76,25 +77,26 @@ export {
|
|
|
76
77
|
nr as JSON_RPC_PARSE_ERROR,
|
|
77
78
|
re as NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS,
|
|
78
79
|
ae as NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS,
|
|
79
|
-
|
|
80
|
+
yr as assertCortexMcpToolCoverage,
|
|
80
81
|
Io as availableCortexAiBlockTypes,
|
|
81
82
|
wt as buildCortexAiModelFallbackChain,
|
|
82
83
|
Jt as buildCortexAiRoutingPolicy,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Uo as
|
|
84
|
+
lo as buildCortexAiVisionRoutingPolicy,
|
|
85
|
+
Cr as buildCortexMcpDiscoveryDocument,
|
|
86
|
+
Gr as buildCortexMcpToolDefinitions,
|
|
87
|
+
Uo as buildCortexProfileCardVerificationDefinition,
|
|
88
|
+
Fo as buildCortexWidgetBuilderPrompt,
|
|
87
89
|
yo as buildCortexWidgetBuilderSystemPrompt,
|
|
88
90
|
ko as buildCortexWidgetDefinitionInsertPayload,
|
|
89
91
|
de as buildVisibleContactIntroActionPlan,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
Vr as callCortexMcpTool,
|
|
93
|
+
Oo as cortexAiBlockTypeSchema,
|
|
92
94
|
Pe as cortexAiPageContextSchema,
|
|
93
95
|
Co as cortexAiSeoMetadataOutputSchema,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
Zr as cortexBuildSessionSchema,
|
|
97
|
+
Wr as cortexMcpScopesAllow,
|
|
98
|
+
$r as cortexSiteBriefInputSchema,
|
|
99
|
+
ea as cortexSiteBriefSchema,
|
|
98
100
|
Go as cortexWidgetBuildRequestSchema,
|
|
99
101
|
Vo as cortexWidgetDbRelationFieldSchema,
|
|
100
102
|
Wo as cortexWidgetDefinitionSchema,
|
|
@@ -105,20 +107,20 @@ export {
|
|
|
105
107
|
zo as cortexWidgetTextFieldSchema,
|
|
106
108
|
he as createCmsPageInputSchema,
|
|
107
109
|
Me as createCmsPostInputSchema,
|
|
108
|
-
|
|
110
|
+
ge as createCmsProductInputSchema,
|
|
109
111
|
C as createCortexAiOpenRouterClient,
|
|
110
112
|
E as createCortexAiOpenRouterProvider,
|
|
111
113
|
zt as createCortexAiStoredModelSelection,
|
|
112
|
-
|
|
114
|
+
K as createCortexCustomBlockTools,
|
|
113
115
|
J as createCortexDatabaseAgentTools,
|
|
114
|
-
|
|
116
|
+
Ne as createCortexGlobalAgentTools,
|
|
115
117
|
ie as createCortexSiteTools,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
U as createCustomBlockInputSchema,
|
|
119
|
+
Ao as customBlockSlugPatternSchema,
|
|
118
120
|
Bt as decryptOpenRouterApiKey,
|
|
119
121
|
P as decryptStoredOpenRouterApiKey,
|
|
120
122
|
Be as deleteCmsItemInputSchema,
|
|
121
|
-
|
|
123
|
+
F as deleteCustomBlockInputSchema,
|
|
122
124
|
z as describeDatabaseSchemaInputSchema,
|
|
123
125
|
Dt as encryptOpenRouterApiKey,
|
|
124
126
|
h as encryptStoredOpenRouterApiKey,
|
|
@@ -135,13 +137,13 @@ export {
|
|
|
135
137
|
ve as executeDeleteCmsItem,
|
|
136
138
|
G as executeDeleteCustomBlock,
|
|
137
139
|
$ as executeDescribeDatabaseSchema,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
be as executeFetchEcommerceStats,
|
|
141
|
+
Ke as executeFetchUrlContent,
|
|
140
142
|
ce as executeFinishSiteBuild,
|
|
141
143
|
ne as executeGetSiteOverview,
|
|
142
|
-
|
|
144
|
+
Ue as executeInsertContentBlock,
|
|
143
145
|
V as executeListCustomBlocks,
|
|
144
|
-
|
|
146
|
+
Fe as executeManageProductVariants,
|
|
145
147
|
ye as executePrepareDeleteCmsItem,
|
|
146
148
|
Ge as executePublishContentDraft,
|
|
147
149
|
Ve as executeReadCurrentCmsItem,
|
|
@@ -170,7 +172,7 @@ export {
|
|
|
170
172
|
rt as fetchUrlContentInputSchema,
|
|
171
173
|
qt as filterCortexAiCompatibleOpenRouterModels,
|
|
172
174
|
ue as finishSiteBuildInputSchema,
|
|
173
|
-
|
|
175
|
+
ta as formatCortexSiteBriefForPrompt,
|
|
174
176
|
se as formatCortexSiteOverviewForPrompt,
|
|
175
177
|
mo as generateCortexAiAltText,
|
|
176
178
|
_o as generateCortexAiSeoMetadata,
|
|
@@ -179,95 +181,97 @@ export {
|
|
|
179
181
|
a as generateEditorBlocksRequestSchema,
|
|
180
182
|
i as generateEditorHtmlFragment,
|
|
181
183
|
M as getCortexAiEnvConfig,
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
Yr as getCortexMcpPrompt,
|
|
185
|
+
Hr as getCortexMcpToolAnnotations,
|
|
186
|
+
wr as getCortexMcpToolKind,
|
|
187
|
+
g as getEnvOpenRouterKeyStatus,
|
|
185
188
|
Qt as getHttpStatusCode,
|
|
186
189
|
ft as getMaskedOpenRouterKey,
|
|
187
|
-
|
|
190
|
+
N as getOpenRouterEnvApiKey,
|
|
188
191
|
jt as getOpenRouterErrorStatus,
|
|
189
192
|
Lt as getOpenRouterKeyEnvelopeStatus,
|
|
190
193
|
B as getPexelsEnvApiKey,
|
|
191
|
-
|
|
194
|
+
Te as getSiteOverviewInputSchema,
|
|
192
195
|
S as getStoredCortexAiModelSelection,
|
|
193
196
|
D as getStoredOpenRouterKeyStatus,
|
|
194
197
|
f as getUnsplashEnvApiKey,
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
Er as handleCortexMcpMessage,
|
|
199
|
+
Or as hashCortexAiMcpToken,
|
|
197
200
|
at as insertContentBlockInputSchema,
|
|
198
201
|
vo as insertCortexWidgetDefinition,
|
|
199
202
|
it as isBlockedFetchHost,
|
|
200
203
|
Zt as isCortexAiFreeModelId,
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
+
oa as isCortexBuildSessionUsable,
|
|
205
|
+
ra as isCortexSiteBriefComplete,
|
|
206
|
+
_r as isJsonRpcNotification,
|
|
204
207
|
po as isKnownVisionCapableCortexAiModelId,
|
|
205
|
-
|
|
206
|
-
|
|
208
|
+
Ar as isLocalhostHost,
|
|
209
|
+
Sr as isModernEraMessage,
|
|
207
210
|
$t as isOpenRouterRateLimitError,
|
|
208
211
|
eo as isOpenRouterRecoverableRoutingError,
|
|
209
212
|
ho as isValidBlockType,
|
|
210
|
-
|
|
213
|
+
Ut as listCortexAiCompatibleOpenRouterModels,
|
|
211
214
|
Y as listCustomBlocksInputSchema,
|
|
212
215
|
Mo as loadCustomBlockDefinitions,
|
|
213
216
|
ct as manageProductVariantsInputSchema,
|
|
214
|
-
|
|
217
|
+
dr as matchesCortexAiMcpEnvToken,
|
|
215
218
|
nt as maybeTriggerStockPhotoDownloads,
|
|
216
|
-
|
|
219
|
+
Pr as mintCortexAiMcpToken,
|
|
217
220
|
Ct as navigationItemInputSchema,
|
|
218
221
|
L as normalizeCortexAiAgentSettings,
|
|
219
|
-
|
|
222
|
+
hr as normalizeCortexAiMcpSettings,
|
|
220
223
|
xo as normalizeGeneratedAltText,
|
|
221
224
|
to as omitUnsupportedCortexAiModelOptions,
|
|
222
|
-
|
|
225
|
+
Mr as parseBearerToken,
|
|
223
226
|
Et as prepareDeleteCmsItemInputSchema,
|
|
224
227
|
_t as publishContentDraftInputSchema,
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
gr as readCortexAiMcpEnvToken,
|
|
229
|
+
le as readCortexBuildSession,
|
|
230
|
+
Jr as readCortexMcpResource,
|
|
228
231
|
me as readCortexSiteBrief,
|
|
229
232
|
St as readCurrentCmsItemInputSchema,
|
|
230
|
-
|
|
233
|
+
go as readCustomBlockFields,
|
|
231
234
|
te as readDatabaseRecordsInputSchema,
|
|
232
235
|
pe as resetSiteContentInputSchema,
|
|
233
236
|
X as resolveCortexAiAgentSettings,
|
|
234
|
-
|
|
237
|
+
Nr as resolveCortexAiMcpSettings,
|
|
235
238
|
u as resolveCortexAiOpenRouterCredential,
|
|
236
239
|
ut as resolveCortexAiStockPhotoProvider,
|
|
237
240
|
st as resolveCortexAiStockPhotoProviders,
|
|
238
241
|
xe as resolveCortexBuildSession,
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
zr as resolveCortexMcpToolName,
|
|
243
|
+
Tt as rewritePageDraftInputSchema,
|
|
241
244
|
oo as runWithCortexAiModelFallback,
|
|
242
245
|
ro as safeParseCortexAiModelSelection,
|
|
243
|
-
|
|
246
|
+
aa as safeParseCortexSiteBrief,
|
|
244
247
|
Re as saveSiteBriefInputSchema,
|
|
245
|
-
|
|
248
|
+
lt as searchDocumentationInputSchema,
|
|
246
249
|
mt as searchStockPhotosInputSchema,
|
|
247
|
-
|
|
250
|
+
No as sectionBlockFallbackSchema,
|
|
248
251
|
pt as setContentImagesInputSchema,
|
|
249
|
-
|
|
252
|
+
Br as shouldTrustLocalMcpRequest,
|
|
250
253
|
Ie as startSiteBuildInputSchema,
|
|
251
254
|
ao as summarizeCortexAiRoutingError,
|
|
252
|
-
|
|
255
|
+
Dr as touchCortexAiMcpToken,
|
|
253
256
|
xt as translateContentBulkInputSchema,
|
|
254
257
|
Rt as translatePageInputSchema,
|
|
255
258
|
So as truncateOnWordBoundary,
|
|
256
259
|
It as updateCmsItemFieldInputSchema,
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
Ot as updateContentBlockInputSchema,
|
|
261
|
+
At as updateCurrentCmsFieldsInputSchema,
|
|
259
262
|
H as updateCustomBlockInputSchema,
|
|
260
263
|
dt as updateFooterInputSchema,
|
|
261
264
|
Pt as updateNavigationBarInputSchema,
|
|
262
265
|
ht as updateSectionColumnBlockInputSchema,
|
|
263
|
-
|
|
266
|
+
Oe as updateSiteIdentityInputSchema,
|
|
264
267
|
Bo as validateCortexBlockContent,
|
|
265
268
|
qo as validateCortexWidgetDefinitionOutput,
|
|
266
269
|
Do as validateCustomBlockInstanceContent,
|
|
267
270
|
c as validateGeneratedEditorHtmlFragment,
|
|
268
|
-
|
|
271
|
+
fr as verifyCortexAiMcpToken,
|
|
269
272
|
kt as verifyOpenRouterApiKey,
|
|
270
273
|
vt as verifyPexelsApiKey,
|
|
271
|
-
|
|
272
|
-
|
|
274
|
+
bt as verifyUnsplashAccessKey,
|
|
275
|
+
ur as wantsMcpEventStream,
|
|
276
|
+
ca as z
|
|
273
277
|
};
|
package/lib/mcp-server.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./mcp-tool-registry.cjs.js"),C="nextblock-cortex-ai",E="NextBlock Cortex AI",M="2025-06-18",f="2025-11-25",R="2026-07-28",T=[R,f,"2025-06-18","2025-03-26","2024-11-05"],x=-32700,p=-32600,S=-32601,_=-32602,O=-32603;function u(t,o){return{body:{id:t,jsonrpc:"2.0",result:o},status:200}}function a(t,o,i,e=200,c){return{body:{error:{code:o,message:i},id:t,jsonrpc:"2.0"},status:e}}const s={body:null,status:202};function N(t){return typeof t.method=="string"&&t.id===void 0}function b(t,o){const i=t.params?._meta;if(i&&typeof i=="object"){const e=i["io.modelcontextprotocol/protocolVersion"];if(typeof e=="string"&&e>=R)return!0}return!!(o&&o>=R)}function g(t){return typeof t!="string"||!t?M:T.includes(t)?t:f}function A(t,o){const i=t.scopes.includes("write");return{capabilities:{prompts:{},resources:{},tools:{}},instructions:t.instructions??["NextBlock Cortex AI exposes this CMS through typed tools.","Call get_database_schema first when you are unsure what exists.","Conventions: a page or post feature_image_id renders as a full-width title banner above the content and is its share preview — give posts one, never the home page or a page with its own hero section (use update_site_identity social_image for the site-wide preview); mark hero sections is_hero:true; slider:true plus slides makes a carousel.",i?"Page builds should go through generate_jsonb_layout, which stages a reviewable Live Draft rather than publishing directly.":"This connection is READ-ONLY. Mutating tools are not available on this token."].join(" "),protocolVersion:g(o),serverInfo:{name:C,title:E,version:t.serverVersion,websiteUrl:"https://nextblock.dev"}}}function v(t){return{authentication:{header:"Authorization",instructions:"POST JSON-RPC 2.0 messages with `Authorization: Bearer <token>`. Create the token in the NextBlock CMS (Settings → Cortex AI → MCP server access) or set MCP_BEARER_TOKEN in the environment. Cortex AI must be active on the site.",required:!0,schemes:["bearer"]},capabilities:{prompts:{},resources:{},tools:{}},endpoint:{transport:"streamable-http",url:t.endpointUrl},name:C,protocolVersions:T,serverCard:t.serverCardUrl,status:"ok",title:E,version:t.serverVersion,websiteUrl:"https://nextblock.dev"}}function y(t){return!!(t&&t.toLowerCase().includes("text/event-stream"))}async function I(t,o){if(t===null||typeof t!="object"||Array.isArray(t))return a(null,p,"Expected a single JSON-RPC message.",400);if(typeof t.method!="string")return"result"in t||"error"in t?s:a(t.id??null,p,'Missing "method".',400);const{method:i}=t,e=t.id??null,c=N(t);if(i.startsWith("notifications/"))return s;switch(i){case"initialize":return c?s:u(e,A(o,t.params?.protocolVersion));case"ping":return c?s:u(e,{});case"tools/list":return c?s:u(e,{tools:l.buildCortexMcpToolDefinitions({context:o.context,scopes:o.scopes})});case"tools/call":{if(c)return s;const n=t.params?.name;if(typeof n!="string"||!n)return a(e,_,"tools/call requires params.name.");try{const r=await l.callCortexMcpTool({args:t.params?.arguments,context:o.context,name:n,scopes:o.scopes});return u(e,r)}catch(r){return r instanceof l.CortexMcpUnknownToolError||r instanceof l.CortexMcpForbiddenToolError?a(e,_,r.message):a(e,O,r instanceof Error?r.message:"Tool execution failed.")}}case"resources/list":return c?s:u(e,{resources:l.CORTEX_MCP_RESOURCES});case"resources/templates/list":return c?s:u(e,{resourceTemplates:[]});case"resources/read":{if(c)return s;const n=t.params?.uri;if(typeof n!="string"||!n)return a(e,_,"resources/read requires params.uri.");try{const r=await l.readCortexMcpResource({context:o.context,uri:n});return r?u(e,{contents:[r]}):a(e,_,`Unknown resource: ${n}`)}catch(r){return a(e,O,r instanceof Error?r.message:"Resource read failed.")}}case"prompts/list":return c?s:u(e,{prompts:l.CORTEX_MCP_PROMPTS});case"prompts/get":{if(c)return s;const n=t.params?.name;if(typeof n!="string"||!n)return a(e,_,"prompts/get requires params.name.");const r=t.params?.arguments,P={};if(r&&typeof r=="object")for(const[m,d]of Object.entries(r))typeof d=="string"&&(P[m]=d);const h=l.getCortexMcpPrompt({args:P,name:n});return h?u(e,h):a(e,_,`Unknown prompt: ${n}`)}default:return c?s:a(e,S,`Method not found: ${i}`)}}exports.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION=M;exports.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION=f;exports.CORTEX_MCP_MODERN_PROTOCOL_VERSION=R;exports.CORTEX_MCP_SERVER_NAME=C;exports.CORTEX_MCP_SERVER_TITLE=E;exports.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS=T;exports.JSON_RPC_INTERNAL_ERROR=O;exports.JSON_RPC_INVALID_PARAMS=_;exports.JSON_RPC_INVALID_REQUEST=p;exports.JSON_RPC_METHOD_NOT_FOUND=S;exports.JSON_RPC_PARSE_ERROR=x;exports.buildCortexMcpDiscoveryDocument=v;exports.handleCortexMcpMessage=I;exports.isJsonRpcNotification=N;exports.isModernEraMessage=b;exports.wantsMcpEventStream=y;
|
package/lib/mcp-server.d.ts
CHANGED
|
@@ -67,6 +67,48 @@ export declare function isJsonRpcNotification(message: JsonRpcMessage): boolean;
|
|
|
67
67
|
* transport-supplied `MCP-Protocol-Version` header as a secondary signal.
|
|
68
68
|
*/
|
|
69
69
|
export declare function isModernEraMessage(message: JsonRpcMessage, protocolVersionHeader?: string | null): boolean;
|
|
70
|
+
export type CortexMcpDiscoveryDocument = {
|
|
71
|
+
authentication: {
|
|
72
|
+
header: 'Authorization';
|
|
73
|
+
instructions: string;
|
|
74
|
+
required: true;
|
|
75
|
+
schemes: ['bearer'];
|
|
76
|
+
};
|
|
77
|
+
capabilities: {
|
|
78
|
+
prompts: Record<string, never>;
|
|
79
|
+
resources: Record<string, never>;
|
|
80
|
+
tools: Record<string, never>;
|
|
81
|
+
};
|
|
82
|
+
endpoint: {
|
|
83
|
+
transport: 'streamable-http';
|
|
84
|
+
url: string;
|
|
85
|
+
};
|
|
86
|
+
name: string;
|
|
87
|
+
protocolVersions: readonly string[];
|
|
88
|
+
serverCard: string;
|
|
89
|
+
status: 'ok';
|
|
90
|
+
title: string;
|
|
91
|
+
version: string;
|
|
92
|
+
websiteUrl: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* The document a plain `GET /api/mcp` (no `Accept: text/event-stream`) answers with.
|
|
96
|
+
*
|
|
97
|
+
* Directory crawlers, uptime monitors and people pasting the URL into a browser all GET
|
|
98
|
+
* the endpoint before they ever POST `initialize`. A real MCP client opening the
|
|
99
|
+
* server→client stream sends `Accept: text/event-stream` (a spec MUST), so the route can
|
|
100
|
+
* tell the two apart and keep answering that one with 405. This one is static on
|
|
101
|
+
* purpose: nothing here reads the database or checks a token, so it cannot fail, and it
|
|
102
|
+
* reveals nothing an `initialize` would not — the tool inventory stays on the server
|
|
103
|
+
* card, which is served only where the operator switched MCP on.
|
|
104
|
+
*/
|
|
105
|
+
export declare function buildCortexMcpDiscoveryDocument(params: {
|
|
106
|
+
endpointUrl: string;
|
|
107
|
+
serverCardUrl: string;
|
|
108
|
+
serverVersion: string;
|
|
109
|
+
}): CortexMcpDiscoveryDocument;
|
|
110
|
+
/** True when the caller is an MCP client opening the optional server→client SSE stream. */
|
|
111
|
+
export declare function wantsMcpEventStream(acceptHeader: string | null | undefined): boolean;
|
|
70
112
|
/**
|
|
71
113
|
* Handle one JSON-RPC message.
|
|
72
114
|
*
|