@nextblock-cms/cortex 0.17.13 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1 -1
- package/index.d.ts +1 -0
- package/index.es.js +143 -139
- package/lib/ai-key-verification.cjs.js +1 -0
- package/lib/ai-key-verification.d.ts +46 -0
- package/lib/ai-key-verification.es.js +69 -0
- 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"),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"),d=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"),I=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 A=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.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.listCortexAiCompatibleOpenRouterModels=d.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.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=I.CORTEX_WIDGET_DEFINITION_SELECT;exports.CortexWidgetRegistryInsertError=I.CortexWidgetRegistryInsertError;exports.buildCortexWidgetDefinitionInsertPayload=I.buildCortexWidgetDefinitionInsertPayload;exports.insertCortexWidgetDefinition=I.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_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.mintCortexAiMcpToken=i.mintCortexAiMcpToken;exports.normalizeCortexAiMcpSettings=i.normalizeCortexAiMcpSettings;exports.parseBearerToken=i.parseBearerToken;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.safeParseCortexSiteBrief=E.safeParseCortexSiteBrief;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>A.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"),A=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"),E=require("./lib/ai-key-crypto.cjs.js"),m=require("./lib/ai-key-verification.cjs.js"),d=require("./lib/ai-model-catalog.cjs.js"),r=require("./lib/ai-model-registry.cjs.js"),_=require("./lib/ai-seo-metadata.cjs.js"),l=require("./lib/ai-vision.cjs.js"),C=require("./lib/block-content-schemas.cjs.js"),I=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"),s=require("./lib/site-brief.cjs.js");require("./lib/zod-config.cjs.js");const O=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=A.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.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=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.verifyOpenRouterApiKey=m.verifyOpenRouterApiKey;exports.verifyPexelsApiKey=m.verifyPexelsApiKey;exports.verifyUnsplashAccessKey=m.verifyUnsplashAccessKey;exports.listCortexAiCompatibleOpenRouterModels=d.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.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=_.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET;exports.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS=_.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS;exports.cortexAiSeoMetadataOutputSchema=_.cortexAiSeoMetadataOutputSchema;exports.extractJsonObject=_.extractJsonObject;exports.generateCortexAiSeoMetadata=_.generateCortexAiSeoMetadata;exports.truncateOnWordBoundary=_.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=I.CORTEX_WIDGET_DEFINITION_SELECT;exports.CortexWidgetRegistryInsertError=I.CortexWidgetRegistryInsertError;exports.buildCortexWidgetDefinitionInsertPayload=I.buildCortexWidgetDefinitionInsertPayload;exports.insertCortexWidgetDefinition=I.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_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.mintCortexAiMcpToken=i.mintCortexAiMcpToken;exports.normalizeCortexAiMcpSettings=i.normalizeCortexAiMcpSettings;exports.parseBearerToken=i.parseBearerToken;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=s.CORTEX_AI_BUILD_SESSION_SETTING_KEY;exports.CORTEX_AI_SITE_BRIEF_SETTING_KEY=s.CORTEX_AI_SITE_BRIEF_SETTING_KEY;exports.cortexBuildSessionSchema=s.cortexBuildSessionSchema;exports.cortexSiteBriefInputSchema=s.cortexSiteBriefInputSchema;exports.cortexSiteBriefSchema=s.cortexSiteBriefSchema;exports.formatCortexSiteBriefForPrompt=s.formatCortexSiteBriefForPrompt;exports.isCortexBuildSessionUsable=s.isCortexBuildSessionUsable;exports.safeParseCortexSiteBrief=s.safeParseCortexSiteBrief;Object.defineProperty(exports,"z",{enumerable:!0,get:()=>O.z});
|
package/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './lib/ai-global-agent-db-tools';
|
|
|
7
7
|
export * from './lib/ai-global-agent-site-tools';
|
|
8
8
|
export * from './lib/ai-global-agent-tools';
|
|
9
9
|
export * from './lib/ai-key-crypto';
|
|
10
|
+
export * from './lib/ai-key-verification';
|
|
10
11
|
export * from './lib/ai-model-catalog';
|
|
11
12
|
export * from './lib/ai-model-registry';
|
|
12
13
|
export * from './lib/ai-seo-metadata';
|
package/index.es.js
CHANGED
|
@@ -1,147 +1,148 @@
|
|
|
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 S, generateCortexAiText as E, getStoredCortexAiModelSelection as _, resolveCortexAiOpenRouterCredential as u } from "./lib/ai-client.es.js";
|
|
3
|
-
import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as l, CORTEX_AI_AGENT_SETTINGS_DEFAULTS as T, 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 A, CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY as O, CORTEX_AI_UNSPLASH_SETTING_KEY as d, decryptStoredOpenRouterApiKey as h, encryptStoredOpenRouterApiKey as P, getCortexAiEnvConfig as M, getEnvOpenRouterKeyStatus as g, getOpenRouterEnvApiKey as N, getPexelsEnvApiKey as B, getStoredOpenRouterKeyStatus as D, getUnsplashEnvApiKey as
|
|
3
|
+
import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as l, CORTEX_AI_AGENT_SETTINGS_DEFAULTS as T, 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 A, CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY as O, CORTEX_AI_UNSPLASH_SETTING_KEY as d, decryptStoredOpenRouterApiKey as h, encryptStoredOpenRouterApiKey as P, 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 b } from "./lib/ai-cortex-widget-builder.es.js";
|
|
5
|
-
import { createCortexCustomBlockTools as U, createCustomBlockInputSchema as
|
|
5
|
+
import { createCortexCustomBlockTools as U, createCustomBlockInputSchema as v, deleteCustomBlockInputSchema as F, 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 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
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 Se, executeStartSiteBuild as Ee, executeUpdateSiteIdentity as _e, finishSiteBuildInputSchema as ue, getSiteOverviewInputSchema as se, readCortexBuildSession as le, readCortexSiteBrief as Te, resetSiteContentInputSchema as me, resolveCortexBuildSession as pe, saveSiteBriefInputSchema as xe, startSiteBuildInputSchema as Re, updateSiteIdentityInputSchema as Ie } from "./lib/ai-global-agent-site-tools.es.js";
|
|
8
|
-
import { buildVisibleContactIntroActionPlan as Oe, cortexAiPageContextSchema as de, createCmsPageInputSchema as he, createCmsPostInputSchema as Pe, createCmsProductInputSchema as Me, createCortexGlobalAgentTools as ge, deleteCmsItemInputSchema as Ne, executeCmsActionPlan as Be, executeCmsActionPlanInputSchema as De, executeCreateCmsPage as
|
|
9
|
-
import { CORTEX_AI_KEY_ALGORITHM as Mt, CORTEX_AI_KEY_ENVELOPE_VERSION as gt, decryptOpenRouterApiKey as Nt, encryptOpenRouterApiKey as Bt, getMaskedOpenRouterKey as Dt, getOpenRouterKeyEnvelopeStatus as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
8
|
+
import { buildVisibleContactIntroActionPlan as Oe, cortexAiPageContextSchema as de, createCmsPageInputSchema as he, createCmsPostInputSchema as Pe, createCmsProductInputSchema as Me, createCortexGlobalAgentTools as ge, deleteCmsItemInputSchema as Ne, executeCmsActionPlan as Be, executeCmsActionPlanInputSchema as De, executeCreateCmsPage as fe, executeCreateCmsPost as Le, executeCreateCmsProduct as Xe, executeDeleteCmsItem as ke, executeFetchEcommerceStats as be, executeFetchUrlContent as Ke, executeInsertContentBlock as Ue, executeManageProductVariants as ve, executePrepareDeleteCmsItem as Fe, executePublishContentDraft as ye, executeReadCurrentCmsItem as Ge, executeRewritePageDraft as We, executeSearchDocumentation as Ve, executeSearchDocumentationWithTimeout as Ye, executeSearchStockPhotos as He, executeSetContentImages as we, executeTranslateContentBulk as Je, executeTranslatePage as ze, executeUpdateCmsItemField as qe, executeUpdateContentBlock as Qe, executeUpdateCurrentCmsFields as je, executeUpdateFooter as Ze, executeUpdateNavigationBar as $e, executeUpdateSectionColumnBlock as et, fetchEcommerceStatsInputSchema as tt, fetchUrlContentInputSchema as ot, insertContentBlockInputSchema as rt, isBlockedFetchHost as at, manageProductVariantsInputSchema as it, maybeTriggerStockPhotoDownloads as ct, navigationItemInputSchema as nt, prepareDeleteCmsItemInputSchema as Ct, publishContentDraftInputSchema as St, readCurrentCmsItemInputSchema as Et, resolveCortexAiStockPhotoProvider as _t, resolveCortexAiStockPhotoProviders as ut, rewritePageDraftInputSchema as st, searchDocumentationInputSchema as lt, searchStockPhotosInputSchema as Tt, setContentImagesInputSchema as mt, translateContentBulkInputSchema as pt, translatePageInputSchema as xt, updateCmsItemFieldInputSchema as Rt, updateContentBlockInputSchema as It, updateCurrentCmsFieldsInputSchema as At, updateFooterInputSchema as Ot, updateNavigationBarInputSchema as dt, updateSectionColumnBlockInputSchema as ht } from "./lib/ai-global-agent-tools.es.js";
|
|
9
|
+
import { CORTEX_AI_KEY_ALGORITHM as Mt, CORTEX_AI_KEY_ENVELOPE_VERSION as gt, decryptOpenRouterApiKey as Nt, encryptOpenRouterApiKey as Bt, getMaskedOpenRouterKey as Dt, getOpenRouterKeyEnvelopeStatus as ft } from "./lib/ai-key-crypto.es.js";
|
|
10
|
+
import { verifyOpenRouterApiKey as Xt, verifyPexelsApiKey as kt, verifyUnsplashAccessKey as bt } from "./lib/ai-key-verification.es.js";
|
|
11
|
+
import { listCortexAiCompatibleOpenRouterModels as Ut } from "./lib/ai-model-catalog.es.js";
|
|
12
|
+
import { CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY as Ft, CORTEX_AI_MODEL_REGISTRY as yt, CORTEX_AI_OPENROUTER_BASE_URL as Gt, CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL as Wt, CORTEX_AI_REQUIRED_MODEL_PARAMETERS as Vt, CortexAiRoutingError as Yt, buildCortexAiModelFallbackChain as Ht, buildCortexAiRoutingPolicy as wt, createCortexAiStoredModelSelection as Jt, filterCortexAiCompatibleOpenRouterModels as zt, getHttpStatusCode as qt, isCortexAiFreeModelId as Qt, isOpenRouterRateLimitError as jt, isOpenRouterRecoverableRoutingError as Zt, omitUnsupportedCortexAiModelOptions as $t, runWithCortexAiModelFallback as eo, safeParseCortexAiModelSelection as to, summarizeCortexAiRoutingError as oo } from "./lib/ai-model-registry.es.js";
|
|
13
|
+
import { CORTEX_AI_SEO_METADATA_CONTENT_BUDGET as ao, CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS as io, cortexAiSeoMetadataOutputSchema as co, extractJsonObject as no, generateCortexAiSeoMetadata as Co, truncateOnWordBoundary as So } from "./lib/ai-seo-metadata.es.js";
|
|
14
|
+
import { CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH as _o, CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY as uo, buildCortexAiVisionRoutingPolicy as so, generateCortexAiAltText as lo, isKnownVisionCapableCortexAiModelId as To, normalizeGeneratedAltText as mo } from "./lib/ai-vision.es.js";
|
|
15
|
+
import { availableCortexAiBlockTypes as xo, cortexAiBlockTypeSchema as Ro, customBlockSlugPatternSchema as Io, fallbackBlockSchemas as Ao, isValidBlockType as Oo, loadCustomBlockDefinitions as ho, readCustomBlockFields as Po, sectionBlockFallbackSchema as Mo, validateCortexBlockContent as go, validateCustomBlockInstanceContent as No } from "./lib/block-content-schemas.es.js";
|
|
16
|
+
import { CORTEX_WIDGET_DEFINITION_SELECT as Do, CortexWidgetRegistryInsertError as fo, buildCortexWidgetDefinitionInsertPayload as Lo, insertCortexWidgetDefinition as Xo } from "./lib/cortex-widget-registry.es.js";
|
|
17
|
+
import { CORTEX_WIDGET_ALLOWED_RELATION_TABLES as bo, buildCortexProfileCardVerificationDefinition as Ko, buildCortexWidgetBuilderPrompt as Uo, buildCortexWidgetBuilderSystemPrompt as vo, cortexWidgetBuildRequestSchema as Fo, cortexWidgetDbRelationFieldSchema as yo, cortexWidgetDefinitionSchema as Go, cortexWidgetFieldSchema as Wo, cortexWidgetImageR2FieldSchema as Vo, cortexWidgetLayoutNodeSchema as Yo, cortexWidgetRichTextFieldSchema as Ho, cortexWidgetTextFieldSchema as wo, validateCortexWidgetDefinitionOutput as Jo } from "./lib/cortex-widget-schema.es.js";
|
|
18
|
+
import { CORTEX_MCP_DEFAULT_PROTOCOL_VERSION as qo, CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION as Qo, CORTEX_MCP_MODERN_PROTOCOL_VERSION as jo, CORTEX_MCP_SERVER_NAME as Zo, CORTEX_MCP_SERVER_TITLE as $o, CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS as er, JSON_RPC_INTERNAL_ERROR as tr, JSON_RPC_INVALID_PARAMS as or, JSON_RPC_INVALID_REQUEST as rr, JSON_RPC_METHOD_NOT_FOUND as ar, JSON_RPC_PARSE_ERROR as ir, handleCortexMcpMessage as cr, isJsonRpcNotification as nr, isModernEraMessage as Cr } from "./lib/mcp-server.es.js";
|
|
19
|
+
import { CORTEX_AI_MCP_SCOPES as Er, CORTEX_AI_MCP_SETTINGS_DEFAULTS as _r, CORTEX_AI_MCP_SETTINGS_KEY as ur, CORTEX_AI_MCP_TOKENS_TABLE as sr, CORTEX_AI_MCP_TOKEN_PREFIX as lr, hashCortexAiMcpToken as Tr, isLocalhostHost as mr, mintCortexAiMcpToken as pr, normalizeCortexAiMcpSettings as xr, parseBearerToken as Rr, resolveCortexAiMcpSettings as Ir, shouldTrustLocalMcpRequest as Ar, touchCortexAiMcpToken as Or, verifyCortexAiMcpToken as dr } from "./lib/mcp-tokens.es.js";
|
|
20
|
+
import { CORTEX_MCP_PROMPTS as Pr, CORTEX_MCP_RESOURCES as Mr, CORTEX_MCP_TOOL_ALIASES as gr, CORTEX_MCP_TOOL_KINDS as Nr, CortexMcpForbiddenToolError as Br, CortexMcpUnknownToolError as Dr, assertCortexMcpToolCoverage as fr, buildCortexMcpToolDefinitions as Lr, callCortexMcpTool as Xr, cortexMcpScopesAllow as kr, getCortexMcpPrompt as br, getCortexMcpToolKind as Kr, readCortexMcpResource as Ur, resolveCortexMcpToolName as vr } from "./lib/mcp-tool-registry.es.js";
|
|
21
|
+
import { CORTEX_AI_BUILD_SESSION_SETTING_KEY as yr, CORTEX_AI_SITE_BRIEF_SETTING_KEY as Gr, cortexBuildSessionSchema as Wr, cortexSiteBriefInputSchema as Vr, cortexSiteBriefSchema as Yr, formatCortexSiteBriefForPrompt as Hr, isCortexBuildSessionUsable as wr, safeParseCortexSiteBrief as Jr } from "./lib/site-brief.es.js";
|
|
21
22
|
import "./lib/zod-config.es.js";
|
|
22
|
-
import { z as
|
|
23
|
+
import { z as qr } from "zod";
|
|
23
24
|
export {
|
|
24
25
|
l as CORTEX_AI_AGENT_SETTINGS_BOUNDS,
|
|
25
26
|
T as CORTEX_AI_AGENT_SETTINGS_DEFAULTS,
|
|
26
27
|
m as CORTEX_AI_AGENT_SETTINGS_KEY,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
yr as CORTEX_AI_BUILD_SESSION_SETTING_KEY,
|
|
29
|
+
_o as CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH,
|
|
30
|
+
Ft as CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY,
|
|
30
31
|
Mt as CORTEX_AI_KEY_ALGORITHM,
|
|
31
32
|
gt as CORTEX_AI_KEY_ENVELOPE_VERSION,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
Er as CORTEX_AI_MCP_SCOPES,
|
|
34
|
+
_r as CORTEX_AI_MCP_SETTINGS_DEFAULTS,
|
|
35
|
+
ur as CORTEX_AI_MCP_SETTINGS_KEY,
|
|
36
|
+
sr as CORTEX_AI_MCP_TOKENS_TABLE,
|
|
37
|
+
lr as CORTEX_AI_MCP_TOKEN_PREFIX,
|
|
38
|
+
yt as CORTEX_AI_MODEL_REGISTRY,
|
|
39
|
+
Gt as CORTEX_AI_OPENROUTER_BASE_URL,
|
|
40
|
+
Wt as CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,
|
|
40
41
|
p as CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY,
|
|
41
42
|
x as CORTEX_AI_OPENROUTER_SETTING_KEY,
|
|
42
43
|
R as CORTEX_AI_PACKAGE_ID,
|
|
43
44
|
I as CORTEX_AI_PACKAGE_NAME,
|
|
44
45
|
A as CORTEX_AI_PEXELS_SETTING_KEY,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
Vt as CORTEX_AI_REQUIRED_MODEL_PARAMETERS,
|
|
47
|
+
ao as CORTEX_AI_SEO_METADATA_CONTENT_BUDGET,
|
|
48
|
+
io as CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS,
|
|
49
|
+
Gr as CORTEX_AI_SITE_BRIEF_SETTING_KEY,
|
|
49
50
|
O as CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY,
|
|
50
51
|
d as CORTEX_AI_UNSPLASH_SETTING_KEY,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
52
|
+
uo as CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY,
|
|
53
|
+
qo as CORTEX_MCP_DEFAULT_PROTOCOL_VERSION,
|
|
54
|
+
Qo as CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION,
|
|
55
|
+
jo as CORTEX_MCP_MODERN_PROTOCOL_VERSION,
|
|
56
|
+
Pr as CORTEX_MCP_PROMPTS,
|
|
57
|
+
Mr as CORTEX_MCP_RESOURCES,
|
|
58
|
+
Zo as CORTEX_MCP_SERVER_NAME,
|
|
59
|
+
$o as CORTEX_MCP_SERVER_TITLE,
|
|
60
|
+
er as CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
61
|
+
gr as CORTEX_MCP_TOOL_ALIASES,
|
|
62
|
+
Nr as CORTEX_MCP_TOOL_KINDS,
|
|
63
|
+
bo as CORTEX_WIDGET_ALLOWED_RELATION_TABLES,
|
|
64
|
+
Do as CORTEX_WIDGET_DEFINITION_SELECT,
|
|
65
|
+
Yt as CortexAiRoutingError,
|
|
66
|
+
Br as CortexMcpForbiddenToolError,
|
|
67
|
+
Dr as CortexMcpUnknownToolError,
|
|
68
|
+
fo as CortexWidgetRegistryInsertError,
|
|
68
69
|
r as INLINE_HTML_ASSISTANT_SYSTEM_PROMPT,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
tr as JSON_RPC_INTERNAL_ERROR,
|
|
71
|
+
or as JSON_RPC_INVALID_PARAMS,
|
|
72
|
+
rr as JSON_RPC_INVALID_REQUEST,
|
|
73
|
+
ar as JSON_RPC_METHOD_NOT_FOUND,
|
|
74
|
+
ir as JSON_RPC_PARSE_ERROR,
|
|
74
75
|
re as NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS,
|
|
75
76
|
ae as NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
fr as assertCortexMcpToolCoverage,
|
|
78
|
+
xo as availableCortexAiBlockTypes,
|
|
79
|
+
Ht as buildCortexAiModelFallbackChain,
|
|
80
|
+
wt as buildCortexAiRoutingPolicy,
|
|
81
|
+
so as buildCortexAiVisionRoutingPolicy,
|
|
82
|
+
Lr as buildCortexMcpToolDefinitions,
|
|
83
|
+
Ko as buildCortexProfileCardVerificationDefinition,
|
|
84
|
+
Uo as buildCortexWidgetBuilderPrompt,
|
|
85
|
+
vo as buildCortexWidgetBuilderSystemPrompt,
|
|
86
|
+
Lo as buildCortexWidgetDefinitionInsertPayload,
|
|
86
87
|
Oe as buildVisibleContactIntroActionPlan,
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
Xr as callCortexMcpTool,
|
|
89
|
+
Ro as cortexAiBlockTypeSchema,
|
|
89
90
|
de as cortexAiPageContextSchema,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
co as cortexAiSeoMetadataOutputSchema,
|
|
92
|
+
Wr as cortexBuildSessionSchema,
|
|
93
|
+
kr as cortexMcpScopesAllow,
|
|
94
|
+
Vr as cortexSiteBriefInputSchema,
|
|
95
|
+
Yr as cortexSiteBriefSchema,
|
|
96
|
+
Fo as cortexWidgetBuildRequestSchema,
|
|
97
|
+
yo as cortexWidgetDbRelationFieldSchema,
|
|
98
|
+
Go as cortexWidgetDefinitionSchema,
|
|
99
|
+
Wo as cortexWidgetFieldSchema,
|
|
100
|
+
Vo as cortexWidgetImageR2FieldSchema,
|
|
101
|
+
Yo as cortexWidgetLayoutNodeSchema,
|
|
102
|
+
Ho as cortexWidgetRichTextFieldSchema,
|
|
103
|
+
wo as cortexWidgetTextFieldSchema,
|
|
103
104
|
he as createCmsPageInputSchema,
|
|
104
105
|
Pe as createCmsPostInputSchema,
|
|
105
106
|
Me as createCmsProductInputSchema,
|
|
106
107
|
C as createCortexAiOpenRouterClient,
|
|
107
108
|
S as createCortexAiOpenRouterProvider,
|
|
108
|
-
|
|
109
|
+
Jt as createCortexAiStoredModelSelection,
|
|
109
110
|
U as createCortexCustomBlockTools,
|
|
110
111
|
J as createCortexDatabaseAgentTools,
|
|
111
112
|
ge as createCortexGlobalAgentTools,
|
|
112
113
|
ie as createCortexSiteTools,
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
v as createCustomBlockInputSchema,
|
|
115
|
+
Io as customBlockSlugPatternSchema,
|
|
115
116
|
Nt as decryptOpenRouterApiKey,
|
|
116
117
|
h as decryptStoredOpenRouterApiKey,
|
|
117
118
|
Ne as deleteCmsItemInputSchema,
|
|
118
|
-
|
|
119
|
+
F as deleteCustomBlockInputSchema,
|
|
119
120
|
z as describeDatabaseSchemaInputSchema,
|
|
120
121
|
Bt as encryptOpenRouterApiKey,
|
|
121
122
|
P as encryptStoredOpenRouterApiKey,
|
|
122
123
|
Be as executeCmsActionPlan,
|
|
123
124
|
De as executeCmsActionPlanInputSchema,
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
fe as executeCreateCmsPage,
|
|
126
|
+
Le as executeCreateCmsPost,
|
|
126
127
|
Xe as executeCreateCmsProduct,
|
|
127
|
-
|
|
128
|
+
y as executeCreateCustomBlock,
|
|
128
129
|
q as executeDatabaseActionPlan,
|
|
129
130
|
Q as executeDatabaseActionPlanInputSchema,
|
|
130
131
|
j as executeDatabaseMutation,
|
|
131
132
|
Z as executeDatabaseMutationInputSchema,
|
|
132
133
|
ke as executeDeleteCmsItem,
|
|
133
|
-
|
|
134
|
+
G as executeDeleteCustomBlock,
|
|
134
135
|
$ as executeDescribeDatabaseSchema,
|
|
135
136
|
be as executeFetchEcommerceStats,
|
|
136
|
-
|
|
137
|
+
Ke as executeFetchUrlContent,
|
|
137
138
|
ce as executeFinishSiteBuild,
|
|
138
139
|
ne as executeGetSiteOverview,
|
|
139
140
|
Ue as executeInsertContentBlock,
|
|
140
141
|
W as executeListCustomBlocks,
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
ve as executeManageProductVariants,
|
|
143
|
+
Fe as executePrepareDeleteCmsItem,
|
|
144
|
+
ye as executePublishContentDraft,
|
|
145
|
+
Ge as executeReadCurrentCmsItem,
|
|
145
146
|
ee as executeReadDatabaseRecords,
|
|
146
147
|
Ce as executeResetSiteContent,
|
|
147
148
|
We as executeRewritePageDraft,
|
|
@@ -161,90 +162,90 @@ export {
|
|
|
161
162
|
$e as executeUpdateNavigationBar,
|
|
162
163
|
et as executeUpdateSectionColumnBlock,
|
|
163
164
|
_e as executeUpdateSiteIdentity,
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
no as extractJsonObject,
|
|
166
|
+
Ao as fallbackBlockSchemas,
|
|
166
167
|
tt as fetchEcommerceStatsInputSchema,
|
|
167
168
|
ot as fetchUrlContentInputSchema,
|
|
168
|
-
|
|
169
|
+
zt as filterCortexAiCompatibleOpenRouterModels,
|
|
169
170
|
ue as finishSiteBuildInputSchema,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
Hr as formatCortexSiteBriefForPrompt,
|
|
172
|
+
lo as generateCortexAiAltText,
|
|
173
|
+
Co as generateCortexAiSeoMetadata,
|
|
173
174
|
E as generateCortexAiText,
|
|
174
175
|
b as generateCortexWidgetDefinition,
|
|
175
176
|
a as generateEditorBlocksRequestSchema,
|
|
176
177
|
i as generateEditorHtmlFragment,
|
|
177
178
|
M as getCortexAiEnvConfig,
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
br as getCortexMcpPrompt,
|
|
180
|
+
Kr as getCortexMcpToolKind,
|
|
180
181
|
g as getEnvOpenRouterKeyStatus,
|
|
181
|
-
|
|
182
|
+
qt as getHttpStatusCode,
|
|
182
183
|
Dt as getMaskedOpenRouterKey,
|
|
183
184
|
N as getOpenRouterEnvApiKey,
|
|
184
|
-
|
|
185
|
+
ft as getOpenRouterKeyEnvelopeStatus,
|
|
185
186
|
B as getPexelsEnvApiKey,
|
|
186
187
|
se as getSiteOverviewInputSchema,
|
|
187
188
|
_ as getStoredCortexAiModelSelection,
|
|
188
189
|
D as getStoredOpenRouterKeyStatus,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
f as getUnsplashEnvApiKey,
|
|
191
|
+
cr as handleCortexMcpMessage,
|
|
192
|
+
Tr as hashCortexAiMcpToken,
|
|
192
193
|
rt as insertContentBlockInputSchema,
|
|
193
|
-
|
|
194
|
+
Xo as insertCortexWidgetDefinition,
|
|
194
195
|
at as isBlockedFetchHost,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
196
|
+
Qt as isCortexAiFreeModelId,
|
|
197
|
+
wr as isCortexBuildSessionUsable,
|
|
198
|
+
nr as isJsonRpcNotification,
|
|
199
|
+
To as isKnownVisionCapableCortexAiModelId,
|
|
200
|
+
mr as isLocalhostHost,
|
|
201
|
+
Cr as isModernEraMessage,
|
|
202
|
+
jt as isOpenRouterRateLimitError,
|
|
203
|
+
Zt as isOpenRouterRecoverableRoutingError,
|
|
204
|
+
Oo as isValidBlockType,
|
|
205
|
+
Ut as listCortexAiCompatibleOpenRouterModels,
|
|
205
206
|
Y as listCustomBlocksInputSchema,
|
|
206
|
-
|
|
207
|
+
ho as loadCustomBlockDefinitions,
|
|
207
208
|
it as manageProductVariantsInputSchema,
|
|
208
209
|
ct as maybeTriggerStockPhotoDownloads,
|
|
209
|
-
|
|
210
|
+
pr as mintCortexAiMcpToken,
|
|
210
211
|
nt as navigationItemInputSchema,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
L as normalizeCortexAiAgentSettings,
|
|
213
|
+
xr as normalizeCortexAiMcpSettings,
|
|
214
|
+
mo as normalizeGeneratedAltText,
|
|
215
|
+
$t as omitUnsupportedCortexAiModelOptions,
|
|
216
|
+
Rr as parseBearerToken,
|
|
216
217
|
Ct as prepareDeleteCmsItemInputSchema,
|
|
217
218
|
St as publishContentDraftInputSchema,
|
|
218
219
|
le as readCortexBuildSession,
|
|
219
|
-
|
|
220
|
+
Ur as readCortexMcpResource,
|
|
220
221
|
Te as readCortexSiteBrief,
|
|
221
222
|
Et as readCurrentCmsItemInputSchema,
|
|
222
|
-
|
|
223
|
+
Po as readCustomBlockFields,
|
|
223
224
|
te as readDatabaseRecordsInputSchema,
|
|
224
225
|
me as resetSiteContentInputSchema,
|
|
225
226
|
X as resolveCortexAiAgentSettings,
|
|
226
|
-
|
|
227
|
+
Ir as resolveCortexAiMcpSettings,
|
|
227
228
|
u as resolveCortexAiOpenRouterCredential,
|
|
228
229
|
_t as resolveCortexAiStockPhotoProvider,
|
|
229
230
|
ut as resolveCortexAiStockPhotoProviders,
|
|
230
231
|
pe as resolveCortexBuildSession,
|
|
231
|
-
|
|
232
|
+
vr as resolveCortexMcpToolName,
|
|
232
233
|
st as rewritePageDraftInputSchema,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
234
|
+
eo as runWithCortexAiModelFallback,
|
|
235
|
+
to as safeParseCortexAiModelSelection,
|
|
236
|
+
Jr as safeParseCortexSiteBrief,
|
|
236
237
|
xe as saveSiteBriefInputSchema,
|
|
237
238
|
lt as searchDocumentationInputSchema,
|
|
238
239
|
Tt as searchStockPhotosInputSchema,
|
|
239
|
-
|
|
240
|
+
Mo as sectionBlockFallbackSchema,
|
|
240
241
|
mt as setContentImagesInputSchema,
|
|
241
|
-
|
|
242
|
+
Ar as shouldTrustLocalMcpRequest,
|
|
242
243
|
Re as startSiteBuildInputSchema,
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
oo as summarizeCortexAiRoutingError,
|
|
245
|
+
Or as touchCortexAiMcpToken,
|
|
245
246
|
pt as translateContentBulkInputSchema,
|
|
246
247
|
xt as translatePageInputSchema,
|
|
247
|
-
|
|
248
|
+
So as truncateOnWordBoundary,
|
|
248
249
|
Rt as updateCmsItemFieldInputSchema,
|
|
249
250
|
It as updateContentBlockInputSchema,
|
|
250
251
|
At as updateCurrentCmsFieldsInputSchema,
|
|
@@ -253,10 +254,13 @@ export {
|
|
|
253
254
|
dt as updateNavigationBarInputSchema,
|
|
254
255
|
ht as updateSectionColumnBlockInputSchema,
|
|
255
256
|
Ie as updateSiteIdentityInputSchema,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
go as validateCortexBlockContent,
|
|
258
|
+
Jo as validateCortexWidgetDefinitionOutput,
|
|
259
|
+
No as validateCustomBlockInstanceContent,
|
|
259
260
|
c as validateGeneratedEditorHtmlFragment,
|
|
260
|
-
|
|
261
|
-
|
|
261
|
+
dr as verifyCortexAiMcpToken,
|
|
262
|
+
Xt as verifyOpenRouterApiKey,
|
|
263
|
+
kt as verifyPexelsApiKey,
|
|
264
|
+
bt as verifyUnsplashAccessKey,
|
|
265
|
+
qr as z
|
|
262
266
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=1e4,h="https://openrouter.ai/api/v1/auth/key",y="https://api.pexels.com/v1/curated?per_page=1",p="https://api.unsplash.com/photos?per_page=1";async function c(t,s,e){const n=new AbortController,u=setTimeout(()=>n.abort(),f);try{const r=await t(s,{cache:"no-store",headers:{Accept:"application/json",...e},signal:n.signal});return{body:await r.json().catch(()=>null),status:r.status}}catch(r){return{failed:r instanceof Error&&r.name==="AbortError"?"The provider did not answer within 10 seconds.":r instanceof Error?r.message:"The provider could not be reached."}}finally{clearTimeout(u)}}function a(t,s){return{message:`${t} could not be reached to check the key (${s}). Check the connection and try again.`,ok:!1,reason:"unreachable"}}function i(t){return{message:t,ok:!1,reason:"invalid"}}async function d(t){const s=t.apiKey.trim();if(!s)return i("Enter an OpenRouter API key.");if(!s.startsWith("sk-or-"))return i('That does not look like an OpenRouter key: they start with "sk-or-".');const e=await c(t.fetch||globalThis.fetch,h,{Authorization:`Bearer ${s}`});if("failed"in e)return a("OpenRouter",e.failed);if(e.status===401||e.status===403)return i("OpenRouter rejected this key. Copy it again from openrouter.ai/keys.");if(e.status<200||e.status>=300)return a("OpenRouter",`HTTP ${e.status}`);const n=e.body&&typeof e.body=="object"&&"data"in e.body?e.body.data:void 0,u=typeof n?.label=="string"?n.label.trim():"",r=n?.is_free_tier===!0,l=typeof n?.limit_remaining=="number"?n.limit_remaining:null,o=[];return u&&o.push(`key "${u}"`),r?o.push("free tier: only free models until you add credits"):l!==null&&o.push(`$${l.toFixed(2)} of credit left`),{detail:o.length>0?o.join(" · "):null,ok:!0}}async function k(t){const s=t.apiKey.trim();if(!s)return i("Enter a Pexels API key.");const e=await c(t.fetch||globalThis.fetch,y,{Authorization:s});return"failed"in e?a("Pexels",e.failed):e.status===401||e.status===403?i("Pexels rejected this key. Copy it again from pexels.com/api."):e.status===429?{detail:"Pexels accepted the key (its hourly quota is currently exhausted).",ok:!0}:e.status<200||e.status>=300?a("Pexels",`HTTP ${e.status}`):{detail:null,ok:!0}}async function b(t){const s=t.accessKey.trim();if(!s)return i("Enter an Unsplash access key.");const e=await c(t.fetch||globalThis.fetch,p,{Authorization:`Client-ID ${s}`});return"failed"in e?a("Unsplash",e.failed):e.status===401?i("Unsplash rejected this key. Use the Access Key (not the Secret Key) from unsplash.com/developers."):e.status===403||e.status===429?{detail:"Unsplash accepted the key (its demo quota is currently exhausted).",ok:!0}:e.status<200||e.status>=300?a("Unsplash",`HTTP ${e.status}`):{detail:null,ok:!0}}exports.verifyOpenRouterApiKey=d;exports.verifyPexelsApiKey=k;exports.verifyUnsplashAccessKey=b;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live verification of the third-party keys the Cortex setup wizard collects.
|
|
3
|
+
*
|
|
4
|
+
* Each helper makes one cheap, read-only call to the provider with the key the
|
|
5
|
+
* operator just typed and reports whether the provider accepted it. The wizard
|
|
6
|
+
* refuses to store a key that fails here, so a typo surfaces on the setup screen
|
|
7
|
+
* with a precise message instead of hours later as a bare "request failed" in the
|
|
8
|
+
* chat drawer. Network trouble is reported separately from a rejected key so the
|
|
9
|
+
* UI can offer "save anyway" for the former and never for the latter.
|
|
10
|
+
*
|
|
11
|
+
* Nothing here touches the database or the encryption layer; that stays in the
|
|
12
|
+
* settings actions. `fetch` is injectable for tests.
|
|
13
|
+
*/
|
|
14
|
+
type FetchFunction = typeof globalThis.fetch;
|
|
15
|
+
export type CortexAiKeyVerification = {
|
|
16
|
+
ok: true;
|
|
17
|
+
detail: string | null;
|
|
18
|
+
} | {
|
|
19
|
+
ok: false;
|
|
20
|
+
reason: 'invalid' | 'unreachable';
|
|
21
|
+
message: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* OpenRouter's `/auth/key` returns the key's own metadata (label, spend limit, free
|
|
25
|
+
* tier) for a valid key and 401 for anything else, so it is the one endpoint that
|
|
26
|
+
* checks a key without spending credits.
|
|
27
|
+
*/
|
|
28
|
+
export declare function verifyOpenRouterApiKey(params: {
|
|
29
|
+
apiKey: string;
|
|
30
|
+
fetch?: FetchFunction;
|
|
31
|
+
}): Promise<CortexAiKeyVerification>;
|
|
32
|
+
/** Pexels answers every request with 401 for an unknown key and 200 otherwise. */
|
|
33
|
+
export declare function verifyPexelsApiKey(params: {
|
|
34
|
+
apiKey: string;
|
|
35
|
+
fetch?: FetchFunction;
|
|
36
|
+
}): Promise<CortexAiKeyVerification>;
|
|
37
|
+
/**
|
|
38
|
+
* Unsplash returns 401 for a bad access key. A 403 is "Rate Limit Exceeded" for a
|
|
39
|
+
* demo app (50 requests/hour), which only happens to a key that authenticated, so it
|
|
40
|
+
* counts as accepted.
|
|
41
|
+
*/
|
|
42
|
+
export declare function verifyUnsplashAccessKey(params: {
|
|
43
|
+
accessKey: string;
|
|
44
|
+
fetch?: FetchFunction;
|
|
45
|
+
}): Promise<CortexAiKeyVerification>;
|
|
46
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
const h = "https://openrouter.ai/api/v1/auth/key", f = "https://api.pexels.com/v1/curated?per_page=1", d = "https://api.unsplash.com/photos?per_page=1";
|
|
2
|
+
async function c(t, s, e) {
|
|
3
|
+
const n = new AbortController(), u = setTimeout(() => n.abort(), 1e4);
|
|
4
|
+
try {
|
|
5
|
+
const r = await t(s, {
|
|
6
|
+
cache: "no-store",
|
|
7
|
+
headers: { Accept: "application/json", ...e },
|
|
8
|
+
signal: n.signal
|
|
9
|
+
});
|
|
10
|
+
return { body: await r.json().catch(() => null), status: r.status };
|
|
11
|
+
} catch (r) {
|
|
12
|
+
return {
|
|
13
|
+
failed: r instanceof Error && r.name === "AbortError" ? "The provider did not answer within 10 seconds." : r instanceof Error ? r.message : "The provider could not be reached."
|
|
14
|
+
};
|
|
15
|
+
} finally {
|
|
16
|
+
clearTimeout(u);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function i(t, s) {
|
|
20
|
+
return {
|
|
21
|
+
message: `${t} could not be reached to check the key (${s}). Check the connection and try again.`,
|
|
22
|
+
ok: !1,
|
|
23
|
+
reason: "unreachable"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function a(t) {
|
|
27
|
+
return { message: t, ok: !1, reason: "invalid" };
|
|
28
|
+
}
|
|
29
|
+
async function p(t) {
|
|
30
|
+
const s = t.apiKey.trim();
|
|
31
|
+
if (!s)
|
|
32
|
+
return a("Enter an OpenRouter API key.");
|
|
33
|
+
if (!s.startsWith("sk-or-"))
|
|
34
|
+
return a('That does not look like an OpenRouter key: they start with "sk-or-".');
|
|
35
|
+
const e = await c(t.fetch || globalThis.fetch, h, {
|
|
36
|
+
Authorization: `Bearer ${s}`
|
|
37
|
+
});
|
|
38
|
+
if ("failed" in e)
|
|
39
|
+
return i("OpenRouter", e.failed);
|
|
40
|
+
if (e.status === 401 || e.status === 403)
|
|
41
|
+
return a("OpenRouter rejected this key. Copy it again from openrouter.ai/keys.");
|
|
42
|
+
if (e.status < 200 || e.status >= 300)
|
|
43
|
+
return i("OpenRouter", `HTTP ${e.status}`);
|
|
44
|
+
const n = e.body && typeof e.body == "object" && "data" in e.body ? e.body.data : void 0, u = typeof n?.label == "string" ? n.label.trim() : "", r = n?.is_free_tier === !0, l = typeof n?.limit_remaining == "number" ? n.limit_remaining : null, o = [];
|
|
45
|
+
return u && o.push(`key "${u}"`), r ? o.push("free tier: only free models until you add credits") : l !== null && o.push(`$${l.toFixed(2)} of credit left`), { detail: o.length > 0 ? o.join(" · ") : null, ok: !0 };
|
|
46
|
+
}
|
|
47
|
+
async function y(t) {
|
|
48
|
+
const s = t.apiKey.trim();
|
|
49
|
+
if (!s)
|
|
50
|
+
return a("Enter a Pexels API key.");
|
|
51
|
+
const e = await c(t.fetch || globalThis.fetch, f, {
|
|
52
|
+
Authorization: s
|
|
53
|
+
});
|
|
54
|
+
return "failed" in e ? i("Pexels", e.failed) : e.status === 401 || e.status === 403 ? a("Pexels rejected this key. Copy it again from pexels.com/api.") : e.status === 429 ? { detail: "Pexels accepted the key (its hourly quota is currently exhausted).", ok: !0 } : e.status < 200 || e.status >= 300 ? i("Pexels", `HTTP ${e.status}`) : { detail: null, ok: !0 };
|
|
55
|
+
}
|
|
56
|
+
async function k(t) {
|
|
57
|
+
const s = t.accessKey.trim();
|
|
58
|
+
if (!s)
|
|
59
|
+
return a("Enter an Unsplash access key.");
|
|
60
|
+
const e = await c(t.fetch || globalThis.fetch, d, {
|
|
61
|
+
Authorization: `Client-ID ${s}`
|
|
62
|
+
});
|
|
63
|
+
return "failed" in e ? i("Unsplash", e.failed) : e.status === 401 ? a("Unsplash rejected this key. Use the Access Key (not the Secret Key) from unsplash.com/developers.") : e.status === 403 || e.status === 429 ? { detail: "Unsplash accepted the key (its demo quota is currently exhausted).", ok: !0 } : e.status < 200 || e.status >= 300 ? i("Unsplash", `HTTP ${e.status}`) : { detail: null, ok: !0 };
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
p as verifyOpenRouterApiKey,
|
|
67
|
+
y as verifyPexelsApiKey,
|
|
68
|
+
k as verifyUnsplashAccessKey
|
|
69
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextblock-cms/cortex",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"license": "AGPL-3.0-or-later",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ai-sdk/openai-compatible": "^2.0.42",
|
|
31
|
-
"@nextblock-cms/db": "^0.
|
|
32
|
-
"@nextblock-cms/ecommerce": "npm:@nextblock-cms/ecom@^0.
|
|
33
|
-
"@nextblock-cms/utils": "^0.
|
|
31
|
+
"@nextblock-cms/db": "^0.18.0",
|
|
32
|
+
"@nextblock-cms/ecommerce": "npm:@nextblock-cms/ecom@^0.18.0",
|
|
33
|
+
"@nextblock-cms/utils": "^0.18.0",
|
|
34
34
|
"ai": "^6.0.170",
|
|
35
35
|
"zod": "^4.3.6"
|
|
36
36
|
},
|