@nextblock-cms/cortex 0.20.3 → 0.21.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/README.md +46 -0
- package/client.cjs +1 -0
- package/client.es.js +3 -7
- package/index.cjs +1 -0
- package/index.es.js +24 -277
- package/lib/ai-block-generation.cjs +4 -0
- package/lib/ai-block-generation.es.js +143 -182
- package/lib/ai-client.cjs +1 -0
- package/lib/ai-client.d.ts +1 -1
- package/lib/ai-client.es.js +101 -135
- package/lib/ai-config.cjs +1 -0
- package/lib/ai-config.es.js +89 -108
- package/lib/ai-cortex-widget-builder.cjs +1 -0
- package/lib/ai-cortex-widget-builder.es.js +56 -70
- package/lib/ai-global-agent-content-ops-tools.cjs +1 -0
- package/lib/ai-global-agent-content-ops-tools.d.ts +1943 -68
- package/lib/ai-global-agent-content-ops-tools.es.js +185 -199
- package/lib/ai-global-agent-custom-block-tools.cjs +1 -0
- package/lib/ai-global-agent-custom-block-tools.d.ts +2160 -95
- package/lib/ai-global-agent-custom-block-tools.es.js +226 -223
- package/lib/ai-global-agent-db-tools.cjs +1 -0
- package/lib/ai-global-agent-db-tools.d.ts +2708 -98
- package/lib/ai-global-agent-db-tools.es.js +1013 -986
- package/lib/ai-global-agent-ecommerce.cjs +1 -0
- package/lib/ai-global-agent-ecommerce.es.js +3 -7
- package/lib/ai-global-agent-site-tools.cjs +2 -0
- package/lib/ai-global-agent-site-tools.d.ts +10695 -500
- package/lib/ai-global-agent-site-tools.es.js +750 -757
- package/lib/ai-global-agent-theming-tools.cjs +1 -0
- package/lib/ai-global-agent-theming-tools.d.ts +2905 -105
- package/lib/ai-global-agent-theming-tools.es.js +326 -396
- package/lib/ai-global-agent-tools.cjs +15 -0
- package/lib/ai-global-agent-tools.d.ts +4 -2230
- package/lib/ai-global-agent-tools.es.js +3899 -4328
- package/lib/ai-key-crypto.cjs +1 -0
- package/lib/ai-key-crypto.es.js +63 -82
- package/lib/ai-key-verification.cjs +1 -0
- package/lib/ai-key-verification.es.js +74 -63
- package/lib/ai-model-catalog.cjs +1 -0
- package/lib/ai-model-catalog.es.js +18 -22
- package/lib/ai-model-registry.cjs +2 -0
- package/lib/ai-model-registry.es.js +246 -309
- package/lib/ai-seo-metadata.cjs +3 -0
- package/lib/ai-seo-metadata.es.js +143 -185
- package/lib/ai-vision.cjs +3 -0
- package/lib/ai-vision.d.ts +6 -6
- package/lib/ai-vision.es.js +161 -215
- package/lib/block-content-schemas.cjs +1 -0
- package/lib/block-content-schemas.es.js +324 -254
- package/lib/cortex-widget-registry.cjs +1 -0
- package/lib/cortex-widget-registry.es.js +35 -43
- package/lib/cortex-widget-schema.cjs +4 -0
- package/lib/cortex-widget-schema.es.js +280 -309
- package/lib/editor-document-from-html.cjs +1 -0
- package/lib/editor-document-from-html.es.js +334 -278
- package/lib/fetch-host-guard.cjs +1 -0
- package/lib/fetch-host-guard.d.ts +2 -0
- package/lib/fetch-host-guard.es.js +30 -0
- package/lib/mcp-server.cjs +1 -0
- package/lib/mcp-server.es.js +155 -173
- package/lib/mcp-tokens.cjs +1 -0
- package/lib/mcp-tokens.es.js +95 -107
- package/lib/mcp-tool-registry.cjs +5 -0
- package/lib/mcp-tool-registry.es.js +533 -411
- package/lib/site-brief.cjs +2 -0
- package/lib/site-brief.es.js +102 -108
- package/lib/vision-image-download.cjs +1 -0
- package/lib/vision-image-download.d.ts +43 -0
- package/lib/vision-image-download.es.js +120 -0
- package/lib/zod-config.cjs +1 -0
- package/lib/zod-config.es.js +5 -6
- package/package.json +13 -12
- package/client.cjs.js +0 -1
- package/index.cjs.js +0 -1
- package/lib/ai-block-generation.cjs.js +0 -5
- package/lib/ai-client.cjs.js +0 -1
- package/lib/ai-config.cjs.js +0 -1
- package/lib/ai-cortex-widget-builder.cjs.js +0 -1
- package/lib/ai-global-agent-content-ops-tools.cjs.js +0 -1
- package/lib/ai-global-agent-custom-block-tools.cjs.js +0 -1
- package/lib/ai-global-agent-db-tools.cjs.js +0 -1
- package/lib/ai-global-agent-ecommerce.cjs.js +0 -1
- package/lib/ai-global-agent-site-tools.cjs.js +0 -3
- package/lib/ai-global-agent-theming-tools.cjs.js +0 -3
- package/lib/ai-global-agent-tools.cjs.js +0 -15
- package/lib/ai-key-crypto.cjs.js +0 -1
- package/lib/ai-key-verification.cjs.js +0 -1
- package/lib/ai-model-catalog.cjs.js +0 -1
- package/lib/ai-model-registry.cjs.js +0 -2
- package/lib/ai-seo-metadata.cjs.js +0 -4
- package/lib/ai-vision.cjs.js +0 -3
- package/lib/block-content-schemas.cjs.js +0 -1
- package/lib/cortex-widget-registry.cjs.js +0 -1
- package/lib/cortex-widget-schema.cjs.js +0 -5
- package/lib/editor-document-from-html.cjs.js +0 -1
- package/lib/mcp-server.cjs.js +0 -1
- package/lib/mcp-tokens.cjs.js +0 -1
- package/lib/mcp-tool-registry.cjs.js +0 -6
- package/lib/site-brief.cjs.js +0 -2
- package/lib/zod-config.cjs.js +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# @nextblock-cms/cortex
|
|
2
|
+
|
|
3
|
+
Cortex AI, the premium AI module of [NextBlock](https://github.com/nextblock-cms/nextblock), the
|
|
4
|
+
open-core CMS for Next.js and Supabase. It powers the CMS assistant that builds and edits pages,
|
|
5
|
+
posts and products through tools, inline block and HTML generation, SEO metadata, image alt
|
|
6
|
+
text, and the MCP server that lets external agents work on a NextBlock site.
|
|
7
|
+
|
|
8
|
+
Models are called through [OpenRouter](https://openrouter.ai) with the Vercel AI SDK, and the
|
|
9
|
+
site operator chooses the model.
|
|
10
|
+
|
|
11
|
+
Projects created with `npm create nextblock@latest` already depend on it. It needs Next.js 16
|
|
12
|
+
(peer dependency), Node.js 22.12 or later, and the project's own `ai` at ^7 and
|
|
13
|
+
`@ai-sdk/openai-compatible` at ^3, the versions this package builds its models with.
|
|
14
|
+
|
|
15
|
+
## Licensing
|
|
16
|
+
|
|
17
|
+
The source is public under AGPL-3.0-or-later, and the features are license-gated under the
|
|
18
|
+
package id `cortex-ai`. A NextBlock project enables Cortex AI only after its license is active:
|
|
19
|
+
start the free trial or buy one in the CMS under **Settings → Packages**. The app checks it with
|
|
20
|
+
`verifyPackageOnline('cortex-ai')` from `@nextblock-cms/db/server`.
|
|
21
|
+
|
|
22
|
+
## Entry points
|
|
23
|
+
|
|
24
|
+
| Import | Use it from | What it holds |
|
|
25
|
+
| :-- | :-- | :-- |
|
|
26
|
+
| `@nextblock-cms/cortex` | server only | The OpenRouter client and model registry, the global agent and its tools, block and widget generation, SEO metadata, alt text, and the MCP server, tokens and tool registry. It imports `next/headers` and `server-only` modules. |
|
|
27
|
+
| `@nextblock-cms/cortex/client` | client or server | The browser-safe values a Client Component may need: `createCortexAiStoredModelSelection`, `formatCortexSiteBriefForPrompt` and `isCortexSiteBriefComplete` |
|
|
28
|
+
|
|
29
|
+
Types from the main entry are safe to import anywhere; runtime values used by a Client
|
|
30
|
+
Component must come from `/client`.
|
|
31
|
+
|
|
32
|
+
## Environment
|
|
33
|
+
|
|
34
|
+
- `OPENROUTER_API_KEY`: the server-side key, used when no key is stored in the CMS. A key saved
|
|
35
|
+
in the CMS takes precedence.
|
|
36
|
+
- `CORTEX_AI_ENCRYPTION_KEY`: required to save and read the key stored in the CMS. Changing it
|
|
37
|
+
makes stored keys unreadable.
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
- [Cortex AI architecture](https://github.com/nextblock-cms/nextblock/blob/master/docs/08-NEXTBLOCK-CORTEX-AI-ARCHITECTURE.md)
|
|
42
|
+
- [Project overview](https://github.com/nextblock-cms/nextblock/blob/master/docs/01-PROJECT-OVERVIEW.md)
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
AGPL-3.0-or-later.
|
package/client.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib/ai-model-registry.cjs"),t=require("./lib/site-brief.cjs");exports.createCortexAiStoredModelSelection=e.createCortexAiStoredModelSelection,exports.formatCortexSiteBriefForPrompt=t.formatCortexSiteBriefForPrompt,exports.isCortexSiteBriefComplete=t.isCortexSiteBriefComplete;
|
package/client.es.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { createCortexAiStoredModelSelection as
|
|
2
|
-
import { formatCortexSiteBriefForPrompt as
|
|
3
|
-
export {
|
|
4
|
-
r as createCortexAiStoredModelSelection,
|
|
5
|
-
i as formatCortexSiteBriefForPrompt,
|
|
6
|
-
f as isCortexSiteBriefComplete
|
|
7
|
-
};
|
|
1
|
+
import { createCortexAiStoredModelSelection as e } from "./lib/ai-model-registry.es.js";
|
|
2
|
+
import { formatCortexSiteBriefForPrompt as t, isCortexSiteBriefComplete as n } from "./lib/site-brief.es.js";
|
|
3
|
+
export { e as createCortexAiStoredModelSelection, t as formatCortexSiteBriefForPrompt, n as isCortexSiteBriefComplete };
|
package/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib/ai-model-registry.cjs");require("./lib/zod-config.cjs");const t=require("./lib/site-brief.cjs"),n=require("./lib/ai-key-crypto.cjs"),r=require("./lib/ai-config.cjs"),i=require("./lib/ai-model-catalog.cjs"),a=require("./lib/ai-client.cjs"),o=require("./lib/ai-block-generation.cjs"),s=require("./lib/cortex-widget-schema.cjs"),c=require("./lib/ai-cortex-widget-builder.cjs"),l=require("./lib/ai-global-agent-custom-block-tools.cjs"),u=require("./lib/block-content-schemas.cjs"),d=require("./lib/ai-global-agent-db-tools.cjs"),f=require("./lib/ai-global-agent-site-tools.cjs"),p=require("./lib/fetch-host-guard.cjs"),m=require("./lib/ai-global-agent-tools.cjs"),h=require("./lib/ai-key-verification.cjs"),g=require("./lib/ai-seo-metadata.cjs"),_=require("./lib/ai-vision.cjs"),v=require("./lib/cortex-widget-registry.cjs"),y=require("./lib/mcp-tool-registry.cjs"),b=require("./lib/mcp-server.cjs"),x=require("./lib/mcp-tokens.cjs");let S=require("zod");exports.CORTEX_AI_AGENT_SETTINGS_BOUNDS=r.CORTEX_AI_AGENT_SETTINGS_BOUNDS,exports.CORTEX_AI_AGENT_SETTINGS_DEFAULTS=r.CORTEX_AI_AGENT_SETTINGS_DEFAULTS,exports.CORTEX_AI_AGENT_SETTINGS_KEY=r.CORTEX_AI_AGENT_SETTINGS_KEY,exports.CORTEX_AI_BUILD_SESSION_SETTING_KEY=t.CORTEX_AI_BUILD_SESSION_SETTING_KEY,exports.CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH=_.CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH,exports.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY=e.CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY,exports.CORTEX_AI_KEY_ALGORITHM=n.CORTEX_AI_KEY_ALGORITHM,exports.CORTEX_AI_KEY_ENVELOPE_VERSION=n.CORTEX_AI_KEY_ENVELOPE_VERSION,exports.CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH=x.CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH,exports.CORTEX_AI_MCP_ENV_TOKEN_VAR=x.CORTEX_AI_MCP_ENV_TOKEN_VAR,exports.CORTEX_AI_MCP_SCOPES=x.CORTEX_AI_MCP_SCOPES,exports.CORTEX_AI_MCP_SETTINGS_DEFAULTS=x.CORTEX_AI_MCP_SETTINGS_DEFAULTS,exports.CORTEX_AI_MCP_SETTINGS_KEY=x.CORTEX_AI_MCP_SETTINGS_KEY,exports.CORTEX_AI_MCP_TOKENS_TABLE=x.CORTEX_AI_MCP_TOKENS_TABLE,exports.CORTEX_AI_MCP_TOKEN_PREFIX=x.CORTEX_AI_MCP_TOKEN_PREFIX,exports.CORTEX_AI_MODEL_REGISTRY=e.CORTEX_AI_MODEL_REGISTRY,exports.CORTEX_AI_OPENROUTER_BASE_URL=e.CORTEX_AI_OPENROUTER_BASE_URL,exports.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL=e.CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,exports.CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY=r.CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY,exports.CORTEX_AI_OPENROUTER_SETTING_KEY=r.CORTEX_AI_OPENROUTER_SETTING_KEY,exports.CORTEX_AI_PACKAGE_ID=r.CORTEX_AI_PACKAGE_ID,exports.CORTEX_AI_PACKAGE_NAME=r.CORTEX_AI_PACKAGE_NAME,exports.CORTEX_AI_PEXELS_SETTING_KEY=r.CORTEX_AI_PEXELS_SETTING_KEY,exports.CORTEX_AI_REQUIRED_MODEL_PARAMETERS=e.CORTEX_AI_REQUIRED_MODEL_PARAMETERS,exports.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET=g.CORTEX_AI_SEO_METADATA_CONTENT_BUDGET,exports.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS=g.CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS,exports.CORTEX_AI_SITE_BRIEF_SETTING_KEY=t.CORTEX_AI_SITE_BRIEF_SETTING_KEY,exports.CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY=r.CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY,exports.CORTEX_AI_UNSPLASH_SETTING_KEY=r.CORTEX_AI_UNSPLASH_SETTING_KEY,exports.CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY=_.CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY,exports.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION=b.CORTEX_MCP_DEFAULT_PROTOCOL_VERSION,exports.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION=b.CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION,exports.CORTEX_MCP_MODERN_PROTOCOL_VERSION=b.CORTEX_MCP_MODERN_PROTOCOL_VERSION,exports.CORTEX_MCP_PROMPTS=y.CORTEX_MCP_PROMPTS,exports.CORTEX_MCP_RESOURCES=y.CORTEX_MCP_RESOURCES,exports.CORTEX_MCP_SERVER_NAME=b.CORTEX_MCP_SERVER_NAME,exports.CORTEX_MCP_SERVER_TITLE=b.CORTEX_MCP_SERVER_TITLE,exports.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS=b.CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS,exports.CORTEX_MCP_TOOL_ALIASES=y.CORTEX_MCP_TOOL_ALIASES,exports.CORTEX_MCP_TOOL_KINDS=y.CORTEX_MCP_TOOL_KINDS,exports.CORTEX_MCP_WRITE_TOOL_BEHAVIOURS=y.CORTEX_MCP_WRITE_TOOL_BEHAVIOURS,exports.CORTEX_WIDGET_ALLOWED_RELATION_TABLES=s.CORTEX_WIDGET_ALLOWED_RELATION_TABLES,exports.CORTEX_WIDGET_DEFINITION_SELECT=v.CORTEX_WIDGET_DEFINITION_SELECT,exports.CortexAiRoutingError=e.CortexAiRoutingError,exports.CortexMcpForbiddenToolError=y.CortexMcpForbiddenToolError,exports.CortexMcpUnknownToolError=y.CortexMcpUnknownToolError,exports.CortexWidgetRegistryInsertError=v.CortexWidgetRegistryInsertError,exports.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT=o.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT,exports.JSON_RPC_INTERNAL_ERROR=b.JSON_RPC_INTERNAL_ERROR,exports.JSON_RPC_INVALID_PARAMS=b.JSON_RPC_INVALID_PARAMS,exports.JSON_RPC_INVALID_REQUEST=b.JSON_RPC_INVALID_REQUEST,exports.JSON_RPC_METHOD_NOT_FOUND=b.JSON_RPC_METHOD_NOT_FOUND,exports.JSON_RPC_PARSE_ERROR=b.JSON_RPC_PARSE_ERROR,exports.NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS=f.NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS,exports.NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS=f.NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS,exports.assertCortexMcpToolCoverage=y.assertCortexMcpToolCoverage,exports.availableCortexAiBlockTypes=u.availableCortexAiBlockTypes,exports.buildCortexAiModelFallbackChain=e.buildCortexAiModelFallbackChain,exports.buildCortexAiRoutingPolicy=e.buildCortexAiRoutingPolicy,exports.buildCortexAiVisionRoutingPolicy=_.buildCortexAiVisionRoutingPolicy,exports.buildCortexMcpDiscoveryDocument=b.buildCortexMcpDiscoveryDocument,exports.buildCortexMcpToolDefinitions=y.buildCortexMcpToolDefinitions,exports.buildCortexProfileCardVerificationDefinition=s.buildCortexProfileCardVerificationDefinition,exports.buildCortexWidgetBuilderPrompt=s.buildCortexWidgetBuilderPrompt,exports.buildCortexWidgetBuilderSystemPrompt=s.buildCortexWidgetBuilderSystemPrompt,exports.buildCortexWidgetDefinitionInsertPayload=v.buildCortexWidgetDefinitionInsertPayload,exports.buildVisibleContactIntroActionPlan=m.buildVisibleContactIntroActionPlan,exports.callCortexMcpTool=y.callCortexMcpTool,exports.cortexAiBlockTypeSchema=u.cortexAiBlockTypeSchema,exports.cortexAiPageContextSchema=m.cortexAiPageContextSchema,exports.cortexAiSeoMetadataOutputSchema=g.cortexAiSeoMetadataOutputSchema,exports.cortexBuildSessionSchema=t.cortexBuildSessionSchema,exports.cortexMcpScopesAllow=y.cortexMcpScopesAllow,exports.cortexSiteBriefInputSchema=t.cortexSiteBriefInputSchema,exports.cortexSiteBriefSchema=t.cortexSiteBriefSchema,exports.cortexWidgetBuildRequestSchema=s.cortexWidgetBuildRequestSchema,exports.cortexWidgetDbRelationFieldSchema=s.cortexWidgetDbRelationFieldSchema,exports.cortexWidgetDefinitionSchema=s.cortexWidgetDefinitionSchema,exports.cortexWidgetFieldSchema=s.cortexWidgetFieldSchema,exports.cortexWidgetImageR2FieldSchema=s.cortexWidgetImageR2FieldSchema,exports.cortexWidgetLayoutNodeSchema=s.cortexWidgetLayoutNodeSchema,exports.cortexWidgetRichTextFieldSchema=s.cortexWidgetRichTextFieldSchema,exports.cortexWidgetTextFieldSchema=s.cortexWidgetTextFieldSchema,exports.createCmsPageInputSchema=m.createCmsPageInputSchema,exports.createCmsPostInputSchema=m.createCmsPostInputSchema,exports.createCmsProductInputSchema=m.createCmsProductInputSchema,exports.createCortexAiOpenRouterClient=a.createCortexAiOpenRouterClient,exports.createCortexAiOpenRouterProvider=a.createCortexAiOpenRouterProvider,exports.createCortexAiStoredModelSelection=e.createCortexAiStoredModelSelection,exports.createCortexCustomBlockTools=l.createCortexCustomBlockTools,exports.createCortexDatabaseAgentTools=d.createCortexDatabaseAgentTools,exports.createCortexGlobalAgentTools=m.createCortexGlobalAgentTools,exports.createCortexSiteTools=f.createCortexSiteTools,exports.createCustomBlockInputSchema=l.createCustomBlockInputSchema,exports.customBlockSlugPatternSchema=u.customBlockSlugPatternSchema,exports.decryptOpenRouterApiKey=n.decryptOpenRouterApiKey,exports.decryptStoredOpenRouterApiKey=r.decryptStoredOpenRouterApiKey,exports.deleteCmsItemInputSchema=m.deleteCmsItemInputSchema,exports.deleteCustomBlockInputSchema=l.deleteCustomBlockInputSchema,exports.describeDatabaseSchemaInputSchema=d.describeDatabaseSchemaInputSchema,exports.encryptOpenRouterApiKey=n.encryptOpenRouterApiKey,exports.encryptStoredOpenRouterApiKey=r.encryptStoredOpenRouterApiKey,exports.executeCmsActionPlan=m.executeCmsActionPlan,exports.executeCmsActionPlanInputSchema=m.executeCmsActionPlanInputSchema,exports.executeCreateCmsPage=m.executeCreateCmsPage,exports.executeCreateCmsPost=m.executeCreateCmsPost,exports.executeCreateCmsProduct=m.executeCreateCmsProduct,exports.executeCreateCustomBlock=l.executeCreateCustomBlock,exports.executeDatabaseActionPlan=d.executeDatabaseActionPlan,exports.executeDatabaseActionPlanInputSchema=d.executeDatabaseActionPlanInputSchema,exports.executeDatabaseMutation=d.executeDatabaseMutation,exports.executeDatabaseMutationInputSchema=d.executeDatabaseMutationInputSchema,exports.executeDeleteCmsItem=m.executeDeleteCmsItem,exports.executeDeleteCustomBlock=l.executeDeleteCustomBlock,exports.executeDescribeDatabaseSchema=d.executeDescribeDatabaseSchema,exports.executeFetchEcommerceStats=m.executeFetchEcommerceStats,exports.executeFetchUrlContent=m.executeFetchUrlContent,exports.executeFinishSiteBuild=f.executeFinishSiteBuild,exports.executeGetSiteOverview=f.executeGetSiteOverview,exports.executeInsertContentBlock=m.executeInsertContentBlock,exports.executeListCustomBlocks=l.executeListCustomBlocks,exports.executeManageProductVariants=m.executeManageProductVariants,exports.executePrepareDeleteCmsItem=m.executePrepareDeleteCmsItem,exports.executePublishContentDraft=m.executePublishContentDraft,exports.executeReadCurrentCmsItem=m.executeReadCurrentCmsItem,exports.executeReadDatabaseRecords=d.executeReadDatabaseRecords,exports.executeResetSiteContent=f.executeResetSiteContent,exports.executeRewritePageDraft=m.executeRewritePageDraft,exports.executeSaveSiteBrief=f.executeSaveSiteBrief,exports.executeSearchDocumentation=m.executeSearchDocumentation,exports.executeSearchDocumentationWithTimeout=m.executeSearchDocumentationWithTimeout,exports.executeSearchStockPhotos=m.executeSearchStockPhotos,exports.executeSetContentImages=m.executeSetContentImages,exports.executeStartSiteBuild=f.executeStartSiteBuild,exports.executeTranslateContentBulk=m.executeTranslateContentBulk,exports.executeTranslatePage=m.executeTranslatePage,exports.executeUpdateCmsItemField=m.executeUpdateCmsItemField,exports.executeUpdateContentBlock=m.executeUpdateContentBlock,exports.executeUpdateCurrentCmsFields=m.executeUpdateCurrentCmsFields,exports.executeUpdateCustomBlock=l.executeUpdateCustomBlock,exports.executeUpdateFooter=m.executeUpdateFooter,exports.executeUpdateNavigationBar=m.executeUpdateNavigationBar,exports.executeUpdateSectionColumnBlock=m.executeUpdateSectionColumnBlock,exports.executeUpdateSiteIdentity=f.executeUpdateSiteIdentity,exports.extractJsonObject=g.extractJsonObject,exports.fallbackBlockSchemas=u.fallbackBlockSchemas,exports.fetchEcommerceStatsInputSchema=m.fetchEcommerceStatsInputSchema,exports.fetchUrlContentInputSchema=m.fetchUrlContentInputSchema,exports.filterCortexAiCompatibleOpenRouterModels=e.filterCortexAiCompatibleOpenRouterModels,exports.finishSiteBuildInputSchema=f.finishSiteBuildInputSchema,exports.formatCortexSiteBriefForPrompt=t.formatCortexSiteBriefForPrompt,exports.formatCortexSiteOverviewForPrompt=f.formatCortexSiteOverviewForPrompt,exports.generateCortexAiAltText=_.generateCortexAiAltText,exports.generateCortexAiSeoMetadata=g.generateCortexAiSeoMetadata,exports.generateCortexAiText=a.generateCortexAiText,exports.generateCortexWidgetDefinition=c.generateCortexWidgetDefinition,exports.generateEditorBlocksRequestSchema=o.generateEditorBlocksRequestSchema,exports.generateEditorHtmlFragment=o.generateEditorHtmlFragment,exports.getCortexAiEnvConfig=r.getCortexAiEnvConfig,exports.getCortexMcpPrompt=y.getCortexMcpPrompt,exports.getCortexMcpToolAnnotations=y.getCortexMcpToolAnnotations,exports.getCortexMcpToolKind=y.getCortexMcpToolKind,exports.getEnvOpenRouterKeyStatus=r.getEnvOpenRouterKeyStatus,exports.getHttpStatusCode=e.getHttpStatusCode,exports.getMaskedOpenRouterKey=n.getMaskedOpenRouterKey,exports.getOpenRouterEnvApiKey=r.getOpenRouterEnvApiKey,exports.getOpenRouterErrorStatus=e.getOpenRouterErrorStatus,exports.getOpenRouterKeyEnvelopeStatus=n.getOpenRouterKeyEnvelopeStatus,exports.getPexelsEnvApiKey=r.getPexelsEnvApiKey,exports.getSiteOverviewInputSchema=f.getSiteOverviewInputSchema,exports.getStoredCortexAiModelSelection=a.getStoredCortexAiModelSelection,exports.getStoredOpenRouterKeyStatus=r.getStoredOpenRouterKeyStatus,exports.getUnsplashEnvApiKey=r.getUnsplashEnvApiKey,exports.handleCortexMcpMessage=b.handleCortexMcpMessage,exports.hashCortexAiMcpToken=x.hashCortexAiMcpToken,exports.insertContentBlockInputSchema=m.insertContentBlockInputSchema,exports.insertCortexWidgetDefinition=v.insertCortexWidgetDefinition,exports.isBlockedFetchHost=p.isBlockedFetchHost,exports.isCortexAiFreeModelId=e.isCortexAiFreeModelId,exports.isCortexBuildSessionUsable=t.isCortexBuildSessionUsable,exports.isCortexSiteBriefComplete=t.isCortexSiteBriefComplete,exports.isJsonRpcNotification=b.isJsonRpcNotification,exports.isKnownVisionCapableCortexAiModelId=_.isKnownVisionCapableCortexAiModelId,exports.isLocalhostHost=x.isLocalhostHost,exports.isModernEraMessage=b.isModernEraMessage,exports.isOpenRouterRateLimitError=e.isOpenRouterRateLimitError,exports.isOpenRouterRecoverableRoutingError=e.isOpenRouterRecoverableRoutingError,exports.isValidBlockType=u.isValidBlockType,exports.listCortexAiCompatibleOpenRouterModels=i.listCortexAiCompatibleOpenRouterModels,exports.listCustomBlocksInputSchema=l.listCustomBlocksInputSchema,exports.loadCustomBlockDefinitions=u.loadCustomBlockDefinitions,exports.manageProductVariantsInputSchema=m.manageProductVariantsInputSchema,exports.matchesCortexAiMcpEnvToken=x.matchesCortexAiMcpEnvToken,exports.maybeTriggerStockPhotoDownloads=m.maybeTriggerStockPhotoDownloads,exports.mintCortexAiMcpToken=x.mintCortexAiMcpToken,exports.navigationItemInputSchema=m.navigationItemInputSchema,exports.normalizeCortexAiAgentSettings=r.normalizeCortexAiAgentSettings,exports.normalizeCortexAiMcpSettings=x.normalizeCortexAiMcpSettings,exports.normalizeGeneratedAltText=_.normalizeGeneratedAltText,exports.omitUnsupportedCortexAiModelOptions=e.omitUnsupportedCortexAiModelOptions,exports.parseBearerToken=x.parseBearerToken,exports.prepareDeleteCmsItemInputSchema=m.prepareDeleteCmsItemInputSchema,exports.publishContentDraftInputSchema=m.publishContentDraftInputSchema,exports.readCortexAiMcpEnvToken=x.readCortexAiMcpEnvToken,exports.readCortexBuildSession=f.readCortexBuildSession,exports.readCortexMcpResource=y.readCortexMcpResource,exports.readCortexSiteBrief=f.readCortexSiteBrief,exports.readCurrentCmsItemInputSchema=m.readCurrentCmsItemInputSchema,exports.readCustomBlockFields=u.readCustomBlockFields,exports.readDatabaseRecordsInputSchema=d.readDatabaseRecordsInputSchema,exports.resetSiteContentInputSchema=f.resetSiteContentInputSchema,exports.resolveCortexAiAgentSettings=r.resolveCortexAiAgentSettings,exports.resolveCortexAiMcpSettings=x.resolveCortexAiMcpSettings,exports.resolveCortexAiOpenRouterCredential=a.resolveCortexAiOpenRouterCredential,exports.resolveCortexAiStockPhotoProvider=m.resolveCortexAiStockPhotoProvider,exports.resolveCortexAiStockPhotoProviders=m.resolveCortexAiStockPhotoProviders,exports.resolveCortexBuildSession=f.resolveCortexBuildSession,exports.resolveCortexMcpToolName=y.resolveCortexMcpToolName,exports.rewritePageDraftInputSchema=m.rewritePageDraftInputSchema,exports.runWithCortexAiModelFallback=e.runWithCortexAiModelFallback,exports.safeParseCortexAiModelSelection=e.safeParseCortexAiModelSelection,exports.safeParseCortexSiteBrief=t.safeParseCortexSiteBrief,exports.saveSiteBriefInputSchema=f.saveSiteBriefInputSchema,exports.searchDocumentationInputSchema=m.searchDocumentationInputSchema,exports.searchStockPhotosInputSchema=m.searchStockPhotosInputSchema,exports.sectionBlockFallbackSchema=u.sectionBlockFallbackSchema,exports.setContentImagesInputSchema=m.setContentImagesInputSchema,exports.shouldTrustLocalMcpRequest=x.shouldTrustLocalMcpRequest,exports.startSiteBuildInputSchema=f.startSiteBuildInputSchema,exports.summarizeCortexAiRoutingError=e.summarizeCortexAiRoutingError,exports.touchCortexAiMcpToken=x.touchCortexAiMcpToken,exports.translateContentBulkInputSchema=m.translateContentBulkInputSchema,exports.translatePageInputSchema=m.translatePageInputSchema,exports.truncateOnWordBoundary=g.truncateOnWordBoundary,exports.updateCmsItemFieldInputSchema=m.updateCmsItemFieldInputSchema,exports.updateContentBlockInputSchema=m.updateContentBlockInputSchema,exports.updateCurrentCmsFieldsInputSchema=m.updateCurrentCmsFieldsInputSchema,exports.updateCustomBlockInputSchema=l.updateCustomBlockInputSchema,exports.updateFooterInputSchema=m.updateFooterInputSchema,exports.updateNavigationBarInputSchema=m.updateNavigationBarInputSchema,exports.updateSectionColumnBlockInputSchema=m.updateSectionColumnBlockInputSchema,exports.updateSiteIdentityInputSchema=f.updateSiteIdentityInputSchema,exports.validateCortexBlockContent=u.validateCortexBlockContent,exports.validateCortexWidgetDefinitionOutput=s.validateCortexWidgetDefinitionOutput,exports.validateCustomBlockInstanceContent=u.validateCustomBlockInstanceContent,exports.validateGeneratedEditorHtmlFragment=o.validateGeneratedEditorHtmlFragment,exports.verifyCortexAiMcpToken=x.verifyCortexAiMcpToken,exports.verifyOpenRouterApiKey=h.verifyOpenRouterApiKey,exports.verifyPexelsApiKey=h.verifyPexelsApiKey,exports.verifyUnsplashAccessKey=h.verifyUnsplashAccessKey,exports.wantsMcpEventStream=b.wantsMcpEventStream,exports.z=S.z;
|
package/index.es.js
CHANGED
|
@@ -1,277 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import "./lib/
|
|
23
|
-
import {
|
|
24
|
-
export {
|
|
25
|
-
T as CORTEX_AI_AGENT_SETTINGS_BOUNDS,
|
|
26
|
-
l as CORTEX_AI_AGENT_SETTINGS_DEFAULTS,
|
|
27
|
-
m as CORTEX_AI_AGENT_SETTINGS_KEY,
|
|
28
|
-
Qr as CORTEX_AI_BUILD_SESSION_SETTING_KEY,
|
|
29
|
-
so as CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH,
|
|
30
|
-
yt as CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY,
|
|
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
|
-
Gt as CORTEX_AI_MODEL_REGISTRY,
|
|
41
|
-
Vt as CORTEX_AI_OPENROUTER_BASE_URL,
|
|
42
|
-
Wt as CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL,
|
|
43
|
-
p as CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY,
|
|
44
|
-
x as CORTEX_AI_OPENROUTER_SETTING_KEY,
|
|
45
|
-
R as CORTEX_AI_PACKAGE_ID,
|
|
46
|
-
I as CORTEX_AI_PACKAGE_NAME,
|
|
47
|
-
O as CORTEX_AI_PEXELS_SETTING_KEY,
|
|
48
|
-
Yt as CORTEX_AI_REQUIRED_MODEL_PARAMETERS,
|
|
49
|
-
co as CORTEX_AI_SEO_METADATA_CONTENT_BUDGET,
|
|
50
|
-
no as CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS,
|
|
51
|
-
jr as CORTEX_AI_SITE_BRIEF_SETTING_KEY,
|
|
52
|
-
A as CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY,
|
|
53
|
-
d as CORTEX_AI_UNSPLASH_SETTING_KEY,
|
|
54
|
-
To as CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY,
|
|
55
|
-
jo as CORTEX_MCP_DEFAULT_PROTOCOL_VERSION,
|
|
56
|
-
Zo as CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION,
|
|
57
|
-
$o as CORTEX_MCP_MODERN_PROTOCOL_VERSION,
|
|
58
|
-
Xr as CORTEX_MCP_PROMPTS,
|
|
59
|
-
kr as CORTEX_MCP_RESOURCES,
|
|
60
|
-
er as CORTEX_MCP_SERVER_NAME,
|
|
61
|
-
tr as CORTEX_MCP_SERVER_TITLE,
|
|
62
|
-
or as CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
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,
|
|
67
|
-
Lo as CORTEX_WIDGET_DEFINITION_SELECT,
|
|
68
|
-
Ht as CortexAiRoutingError,
|
|
69
|
-
Ur as CortexMcpForbiddenToolError,
|
|
70
|
-
Fr as CortexMcpUnknownToolError,
|
|
71
|
-
Xo as CortexWidgetRegistryInsertError,
|
|
72
|
-
r as INLINE_HTML_ASSISTANT_SYSTEM_PROMPT,
|
|
73
|
-
rr as JSON_RPC_INTERNAL_ERROR,
|
|
74
|
-
ar as JSON_RPC_INVALID_PARAMS,
|
|
75
|
-
ir as JSON_RPC_INVALID_REQUEST,
|
|
76
|
-
cr as JSON_RPC_METHOD_NOT_FOUND,
|
|
77
|
-
nr as JSON_RPC_PARSE_ERROR,
|
|
78
|
-
re as NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS,
|
|
79
|
-
ae as NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS,
|
|
80
|
-
yr as assertCortexMcpToolCoverage,
|
|
81
|
-
Io as availableCortexAiBlockTypes,
|
|
82
|
-
wt as buildCortexAiModelFallbackChain,
|
|
83
|
-
Jt as buildCortexAiRoutingPolicy,
|
|
84
|
-
lo as buildCortexAiVisionRoutingPolicy,
|
|
85
|
-
Cr as buildCortexMcpDiscoveryDocument,
|
|
86
|
-
Gr as buildCortexMcpToolDefinitions,
|
|
87
|
-
Uo as buildCortexProfileCardVerificationDefinition,
|
|
88
|
-
Fo as buildCortexWidgetBuilderPrompt,
|
|
89
|
-
yo as buildCortexWidgetBuilderSystemPrompt,
|
|
90
|
-
ko as buildCortexWidgetDefinitionInsertPayload,
|
|
91
|
-
de as buildVisibleContactIntroActionPlan,
|
|
92
|
-
Vr as callCortexMcpTool,
|
|
93
|
-
Oo as cortexAiBlockTypeSchema,
|
|
94
|
-
Pe as cortexAiPageContextSchema,
|
|
95
|
-
Co as cortexAiSeoMetadataOutputSchema,
|
|
96
|
-
Zr as cortexBuildSessionSchema,
|
|
97
|
-
Wr as cortexMcpScopesAllow,
|
|
98
|
-
$r as cortexSiteBriefInputSchema,
|
|
99
|
-
ea as cortexSiteBriefSchema,
|
|
100
|
-
Go as cortexWidgetBuildRequestSchema,
|
|
101
|
-
Vo as cortexWidgetDbRelationFieldSchema,
|
|
102
|
-
Wo as cortexWidgetDefinitionSchema,
|
|
103
|
-
Yo as cortexWidgetFieldSchema,
|
|
104
|
-
Ho as cortexWidgetImageR2FieldSchema,
|
|
105
|
-
wo as cortexWidgetLayoutNodeSchema,
|
|
106
|
-
Jo as cortexWidgetRichTextFieldSchema,
|
|
107
|
-
zo as cortexWidgetTextFieldSchema,
|
|
108
|
-
he as createCmsPageInputSchema,
|
|
109
|
-
Me as createCmsPostInputSchema,
|
|
110
|
-
ge as createCmsProductInputSchema,
|
|
111
|
-
C as createCortexAiOpenRouterClient,
|
|
112
|
-
E as createCortexAiOpenRouterProvider,
|
|
113
|
-
zt as createCortexAiStoredModelSelection,
|
|
114
|
-
K as createCortexCustomBlockTools,
|
|
115
|
-
J as createCortexDatabaseAgentTools,
|
|
116
|
-
Ne as createCortexGlobalAgentTools,
|
|
117
|
-
ie as createCortexSiteTools,
|
|
118
|
-
U as createCustomBlockInputSchema,
|
|
119
|
-
Ao as customBlockSlugPatternSchema,
|
|
120
|
-
Bt as decryptOpenRouterApiKey,
|
|
121
|
-
P as decryptStoredOpenRouterApiKey,
|
|
122
|
-
Be as deleteCmsItemInputSchema,
|
|
123
|
-
F as deleteCustomBlockInputSchema,
|
|
124
|
-
z as describeDatabaseSchemaInputSchema,
|
|
125
|
-
Dt as encryptOpenRouterApiKey,
|
|
126
|
-
h as encryptStoredOpenRouterApiKey,
|
|
127
|
-
De as executeCmsActionPlan,
|
|
128
|
-
fe as executeCmsActionPlanInputSchema,
|
|
129
|
-
Le as executeCreateCmsPage,
|
|
130
|
-
Xe as executeCreateCmsPost,
|
|
131
|
-
ke as executeCreateCmsProduct,
|
|
132
|
-
y as executeCreateCustomBlock,
|
|
133
|
-
q as executeDatabaseActionPlan,
|
|
134
|
-
Q as executeDatabaseActionPlanInputSchema,
|
|
135
|
-
j as executeDatabaseMutation,
|
|
136
|
-
Z as executeDatabaseMutationInputSchema,
|
|
137
|
-
ve as executeDeleteCmsItem,
|
|
138
|
-
G as executeDeleteCustomBlock,
|
|
139
|
-
$ as executeDescribeDatabaseSchema,
|
|
140
|
-
be as executeFetchEcommerceStats,
|
|
141
|
-
Ke as executeFetchUrlContent,
|
|
142
|
-
ce as executeFinishSiteBuild,
|
|
143
|
-
ne as executeGetSiteOverview,
|
|
144
|
-
Ue as executeInsertContentBlock,
|
|
145
|
-
V as executeListCustomBlocks,
|
|
146
|
-
Fe as executeManageProductVariants,
|
|
147
|
-
ye as executePrepareDeleteCmsItem,
|
|
148
|
-
Ge as executePublishContentDraft,
|
|
149
|
-
Ve as executeReadCurrentCmsItem,
|
|
150
|
-
ee as executeReadDatabaseRecords,
|
|
151
|
-
Ce as executeResetSiteContent,
|
|
152
|
-
We as executeRewritePageDraft,
|
|
153
|
-
Ee as executeSaveSiteBrief,
|
|
154
|
-
Ye as executeSearchDocumentation,
|
|
155
|
-
He as executeSearchDocumentationWithTimeout,
|
|
156
|
-
we as executeSearchStockPhotos,
|
|
157
|
-
Je as executeSetContentImages,
|
|
158
|
-
_e as executeStartSiteBuild,
|
|
159
|
-
ze as executeTranslateContentBulk,
|
|
160
|
-
qe as executeTranslatePage,
|
|
161
|
-
Qe as executeUpdateCmsItemField,
|
|
162
|
-
je as executeUpdateContentBlock,
|
|
163
|
-
Ze as executeUpdateCurrentCmsFields,
|
|
164
|
-
W as executeUpdateCustomBlock,
|
|
165
|
-
$e as executeUpdateFooter,
|
|
166
|
-
et as executeUpdateNavigationBar,
|
|
167
|
-
tt as executeUpdateSectionColumnBlock,
|
|
168
|
-
Se as executeUpdateSiteIdentity,
|
|
169
|
-
Eo as extractJsonObject,
|
|
170
|
-
Po as fallbackBlockSchemas,
|
|
171
|
-
ot as fetchEcommerceStatsInputSchema,
|
|
172
|
-
rt as fetchUrlContentInputSchema,
|
|
173
|
-
qt as filterCortexAiCompatibleOpenRouterModels,
|
|
174
|
-
ue as finishSiteBuildInputSchema,
|
|
175
|
-
ta as formatCortexSiteBriefForPrompt,
|
|
176
|
-
se as formatCortexSiteOverviewForPrompt,
|
|
177
|
-
mo as generateCortexAiAltText,
|
|
178
|
-
_o as generateCortexAiSeoMetadata,
|
|
179
|
-
_ as generateCortexAiText,
|
|
180
|
-
v as generateCortexWidgetDefinition,
|
|
181
|
-
a as generateEditorBlocksRequestSchema,
|
|
182
|
-
i as generateEditorHtmlFragment,
|
|
183
|
-
M as getCortexAiEnvConfig,
|
|
184
|
-
Yr as getCortexMcpPrompt,
|
|
185
|
-
Hr as getCortexMcpToolAnnotations,
|
|
186
|
-
wr as getCortexMcpToolKind,
|
|
187
|
-
g as getEnvOpenRouterKeyStatus,
|
|
188
|
-
Qt as getHttpStatusCode,
|
|
189
|
-
ft as getMaskedOpenRouterKey,
|
|
190
|
-
N as getOpenRouterEnvApiKey,
|
|
191
|
-
jt as getOpenRouterErrorStatus,
|
|
192
|
-
Lt as getOpenRouterKeyEnvelopeStatus,
|
|
193
|
-
B as getPexelsEnvApiKey,
|
|
194
|
-
Te as getSiteOverviewInputSchema,
|
|
195
|
-
S as getStoredCortexAiModelSelection,
|
|
196
|
-
D as getStoredOpenRouterKeyStatus,
|
|
197
|
-
f as getUnsplashEnvApiKey,
|
|
198
|
-
Er as handleCortexMcpMessage,
|
|
199
|
-
Or as hashCortexAiMcpToken,
|
|
200
|
-
at as insertContentBlockInputSchema,
|
|
201
|
-
vo as insertCortexWidgetDefinition,
|
|
202
|
-
it as isBlockedFetchHost,
|
|
203
|
-
Zt as isCortexAiFreeModelId,
|
|
204
|
-
oa as isCortexBuildSessionUsable,
|
|
205
|
-
ra as isCortexSiteBriefComplete,
|
|
206
|
-
_r as isJsonRpcNotification,
|
|
207
|
-
po as isKnownVisionCapableCortexAiModelId,
|
|
208
|
-
Ar as isLocalhostHost,
|
|
209
|
-
Sr as isModernEraMessage,
|
|
210
|
-
$t as isOpenRouterRateLimitError,
|
|
211
|
-
eo as isOpenRouterRecoverableRoutingError,
|
|
212
|
-
ho as isValidBlockType,
|
|
213
|
-
Ut as listCortexAiCompatibleOpenRouterModels,
|
|
214
|
-
Y as listCustomBlocksInputSchema,
|
|
215
|
-
Mo as loadCustomBlockDefinitions,
|
|
216
|
-
ct as manageProductVariantsInputSchema,
|
|
217
|
-
dr as matchesCortexAiMcpEnvToken,
|
|
218
|
-
nt as maybeTriggerStockPhotoDownloads,
|
|
219
|
-
Pr as mintCortexAiMcpToken,
|
|
220
|
-
Ct as navigationItemInputSchema,
|
|
221
|
-
L as normalizeCortexAiAgentSettings,
|
|
222
|
-
hr as normalizeCortexAiMcpSettings,
|
|
223
|
-
xo as normalizeGeneratedAltText,
|
|
224
|
-
to as omitUnsupportedCortexAiModelOptions,
|
|
225
|
-
Mr as parseBearerToken,
|
|
226
|
-
Et as prepareDeleteCmsItemInputSchema,
|
|
227
|
-
_t as publishContentDraftInputSchema,
|
|
228
|
-
gr as readCortexAiMcpEnvToken,
|
|
229
|
-
le as readCortexBuildSession,
|
|
230
|
-
Jr as readCortexMcpResource,
|
|
231
|
-
me as readCortexSiteBrief,
|
|
232
|
-
St as readCurrentCmsItemInputSchema,
|
|
233
|
-
go as readCustomBlockFields,
|
|
234
|
-
te as readDatabaseRecordsInputSchema,
|
|
235
|
-
pe as resetSiteContentInputSchema,
|
|
236
|
-
X as resolveCortexAiAgentSettings,
|
|
237
|
-
Nr as resolveCortexAiMcpSettings,
|
|
238
|
-
u as resolveCortexAiOpenRouterCredential,
|
|
239
|
-
ut as resolveCortexAiStockPhotoProvider,
|
|
240
|
-
st as resolveCortexAiStockPhotoProviders,
|
|
241
|
-
xe as resolveCortexBuildSession,
|
|
242
|
-
zr as resolveCortexMcpToolName,
|
|
243
|
-
Tt as rewritePageDraftInputSchema,
|
|
244
|
-
oo as runWithCortexAiModelFallback,
|
|
245
|
-
ro as safeParseCortexAiModelSelection,
|
|
246
|
-
aa as safeParseCortexSiteBrief,
|
|
247
|
-
Re as saveSiteBriefInputSchema,
|
|
248
|
-
lt as searchDocumentationInputSchema,
|
|
249
|
-
mt as searchStockPhotosInputSchema,
|
|
250
|
-
No as sectionBlockFallbackSchema,
|
|
251
|
-
pt as setContentImagesInputSchema,
|
|
252
|
-
Br as shouldTrustLocalMcpRequest,
|
|
253
|
-
Ie as startSiteBuildInputSchema,
|
|
254
|
-
ao as summarizeCortexAiRoutingError,
|
|
255
|
-
Dr as touchCortexAiMcpToken,
|
|
256
|
-
xt as translateContentBulkInputSchema,
|
|
257
|
-
Rt as translatePageInputSchema,
|
|
258
|
-
So as truncateOnWordBoundary,
|
|
259
|
-
It as updateCmsItemFieldInputSchema,
|
|
260
|
-
Ot as updateContentBlockInputSchema,
|
|
261
|
-
At as updateCurrentCmsFieldsInputSchema,
|
|
262
|
-
H as updateCustomBlockInputSchema,
|
|
263
|
-
dt as updateFooterInputSchema,
|
|
264
|
-
Pt as updateNavigationBarInputSchema,
|
|
265
|
-
ht as updateSectionColumnBlockInputSchema,
|
|
266
|
-
Oe as updateSiteIdentityInputSchema,
|
|
267
|
-
Bo as validateCortexBlockContent,
|
|
268
|
-
qo as validateCortexWidgetDefinitionOutput,
|
|
269
|
-
Do as validateCustomBlockInstanceContent,
|
|
270
|
-
c as validateGeneratedEditorHtmlFragment,
|
|
271
|
-
fr as verifyCortexAiMcpToken,
|
|
272
|
-
kt as verifyOpenRouterApiKey,
|
|
273
|
-
vt as verifyPexelsApiKey,
|
|
274
|
-
bt as verifyUnsplashAccessKey,
|
|
275
|
-
ur as wantsMcpEventStream,
|
|
276
|
-
ca as z
|
|
277
|
-
};
|
|
1
|
+
import { CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY as e, CORTEX_AI_MODEL_REGISTRY as t, CORTEX_AI_OPENROUTER_BASE_URL as n, CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL as r, CORTEX_AI_REQUIRED_MODEL_PARAMETERS as i, CortexAiRoutingError as a, buildCortexAiModelFallbackChain as o, buildCortexAiRoutingPolicy as s, createCortexAiStoredModelSelection as c, filterCortexAiCompatibleOpenRouterModels as l, getHttpStatusCode as u, getOpenRouterErrorStatus as d, isCortexAiFreeModelId as f, isOpenRouterRateLimitError as p, isOpenRouterRecoverableRoutingError as m, omitUnsupportedCortexAiModelOptions as h, runWithCortexAiModelFallback as g, safeParseCortexAiModelSelection as _, summarizeCortexAiRoutingError as v } from "./lib/ai-model-registry.es.js";
|
|
2
|
+
import { z as y } from "./lib/zod-config.es.js";
|
|
3
|
+
import { CORTEX_AI_BUILD_SESSION_SETTING_KEY as b, CORTEX_AI_SITE_BRIEF_SETTING_KEY as x, cortexBuildSessionSchema as S, cortexSiteBriefInputSchema as C, cortexSiteBriefSchema as w, formatCortexSiteBriefForPrompt as T, isCortexBuildSessionUsable as E, isCortexSiteBriefComplete as D, safeParseCortexSiteBrief as O } from "./lib/site-brief.es.js";
|
|
4
|
+
import { CORTEX_AI_KEY_ALGORITHM as k, CORTEX_AI_KEY_ENVELOPE_VERSION as A, decryptOpenRouterApiKey as j, encryptOpenRouterApiKey as M, getMaskedOpenRouterKey as N, getOpenRouterKeyEnvelopeStatus as P } from "./lib/ai-key-crypto.es.js";
|
|
5
|
+
import { CORTEX_AI_AGENT_SETTINGS_BOUNDS as F, CORTEX_AI_AGENT_SETTINGS_DEFAULTS as I, CORTEX_AI_AGENT_SETTINGS_KEY as L, CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY as R, CORTEX_AI_OPENROUTER_SETTING_KEY as z, CORTEX_AI_PACKAGE_ID as B, CORTEX_AI_PACKAGE_NAME as V, CORTEX_AI_PEXELS_SETTING_KEY as H, CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY as U, CORTEX_AI_UNSPLASH_SETTING_KEY as W, decryptStoredOpenRouterApiKey as G, encryptStoredOpenRouterApiKey as K, getCortexAiEnvConfig as q, getEnvOpenRouterKeyStatus as J, getOpenRouterEnvApiKey as Y, getPexelsEnvApiKey as X, getStoredOpenRouterKeyStatus as Z, getUnsplashEnvApiKey as Q, normalizeCortexAiAgentSettings as $, resolveCortexAiAgentSettings as ee } from "./lib/ai-config.es.js";
|
|
6
|
+
import { listCortexAiCompatibleOpenRouterModels as te } from "./lib/ai-model-catalog.es.js";
|
|
7
|
+
import { createCortexAiOpenRouterClient as ne, createCortexAiOpenRouterProvider as re, generateCortexAiText as ie, getStoredCortexAiModelSelection as ae, resolveCortexAiOpenRouterCredential as oe } from "./lib/ai-client.es.js";
|
|
8
|
+
import { INLINE_HTML_ASSISTANT_SYSTEM_PROMPT as se, generateEditorBlocksRequestSchema as ce, generateEditorHtmlFragment as le, validateGeneratedEditorHtmlFragment as ue } from "./lib/ai-block-generation.es.js";
|
|
9
|
+
import { CORTEX_WIDGET_ALLOWED_RELATION_TABLES as de, buildCortexProfileCardVerificationDefinition as fe, buildCortexWidgetBuilderPrompt as pe, buildCortexWidgetBuilderSystemPrompt as me, cortexWidgetBuildRequestSchema as he, cortexWidgetDbRelationFieldSchema as ge, cortexWidgetDefinitionSchema as _e, cortexWidgetFieldSchema as ve, cortexWidgetImageR2FieldSchema as ye, cortexWidgetLayoutNodeSchema as be, cortexWidgetRichTextFieldSchema as xe, cortexWidgetTextFieldSchema as Se, validateCortexWidgetDefinitionOutput as Ce } from "./lib/cortex-widget-schema.es.js";
|
|
10
|
+
import { generateCortexWidgetDefinition as we } from "./lib/ai-cortex-widget-builder.es.js";
|
|
11
|
+
import { createCortexCustomBlockTools as Te, createCustomBlockInputSchema as Ee, deleteCustomBlockInputSchema as De, executeCreateCustomBlock as Oe, executeDeleteCustomBlock as ke, executeListCustomBlocks as Ae, executeUpdateCustomBlock as je, listCustomBlocksInputSchema as Me, updateCustomBlockInputSchema as Ne } from "./lib/ai-global-agent-custom-block-tools.es.js";
|
|
12
|
+
import { availableCortexAiBlockTypes as Pe, cortexAiBlockTypeSchema as Fe, customBlockSlugPatternSchema as Ie, fallbackBlockSchemas as Le, isValidBlockType as Re, loadCustomBlockDefinitions as ze, readCustomBlockFields as Be, sectionBlockFallbackSchema as Ve, validateCortexBlockContent as He, validateCustomBlockInstanceContent as Ue } from "./lib/block-content-schemas.es.js";
|
|
13
|
+
import { createCortexDatabaseAgentTools as We, describeDatabaseSchemaInputSchema as Ge, executeDatabaseActionPlan as Ke, executeDatabaseActionPlanInputSchema as qe, executeDatabaseMutation as Je, executeDatabaseMutationInputSchema as Ye, executeDescribeDatabaseSchema as Xe, executeReadDatabaseRecords as Ze, readDatabaseRecordsInputSchema as Qe } from "./lib/ai-global-agent-db-tools.es.js";
|
|
14
|
+
import { NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS as $e, NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS as et, createCortexSiteTools as tt, executeFinishSiteBuild as nt, executeGetSiteOverview as rt, executeResetSiteContent as it, executeSaveSiteBrief as at, executeStartSiteBuild as ot, executeUpdateSiteIdentity as st, finishSiteBuildInputSchema as ct, formatCortexSiteOverviewForPrompt as lt, getSiteOverviewInputSchema as ut, readCortexBuildSession as dt, readCortexSiteBrief as ft, resetSiteContentInputSchema as pt, resolveCortexBuildSession as mt, saveSiteBriefInputSchema as ht, startSiteBuildInputSchema as gt, updateSiteIdentityInputSchema as _t } from "./lib/ai-global-agent-site-tools.es.js";
|
|
15
|
+
import { isBlockedFetchHost as vt } from "./lib/fetch-host-guard.es.js";
|
|
16
|
+
import { buildVisibleContactIntroActionPlan as yt, cortexAiPageContextSchema as bt, createCmsPageInputSchema as xt, createCmsPostInputSchema as St, createCmsProductInputSchema as Ct, createCortexGlobalAgentTools as wt, deleteCmsItemInputSchema as Tt, executeCmsActionPlan as Et, executeCmsActionPlanInputSchema as Dt, executeCreateCmsPage as Ot, executeCreateCmsPost as kt, executeCreateCmsProduct as At, executeDeleteCmsItem as jt, executeFetchEcommerceStats as Mt, executeFetchUrlContent as Nt, executeInsertContentBlock as Pt, executeManageProductVariants as Ft, executePrepareDeleteCmsItem as It, executePublishContentDraft as Lt, executeReadCurrentCmsItem as Rt, executeRewritePageDraft as zt, executeSearchDocumentation as Bt, executeSearchDocumentationWithTimeout as Vt, executeSearchStockPhotos as Ht, executeSetContentImages as Ut, executeTranslateContentBulk as Wt, executeTranslatePage as Gt, executeUpdateCmsItemField as Kt, executeUpdateContentBlock as qt, executeUpdateCurrentCmsFields as Jt, executeUpdateFooter as Yt, executeUpdateNavigationBar as Xt, executeUpdateSectionColumnBlock as Zt, fetchEcommerceStatsInputSchema as Qt, fetchUrlContentInputSchema as $t, insertContentBlockInputSchema as en, manageProductVariantsInputSchema as tn, maybeTriggerStockPhotoDownloads as nn, navigationItemInputSchema as rn, prepareDeleteCmsItemInputSchema as an, publishContentDraftInputSchema as on, readCurrentCmsItemInputSchema as sn, resolveCortexAiStockPhotoProvider as cn, resolveCortexAiStockPhotoProviders as ln, rewritePageDraftInputSchema as un, searchDocumentationInputSchema as dn, searchStockPhotosInputSchema as fn, setContentImagesInputSchema as pn, translateContentBulkInputSchema as mn, translatePageInputSchema as hn, updateCmsItemFieldInputSchema as gn, updateContentBlockInputSchema as _n, updateCurrentCmsFieldsInputSchema as vn, updateFooterInputSchema as yn, updateNavigationBarInputSchema as bn, updateSectionColumnBlockInputSchema as xn } from "./lib/ai-global-agent-tools.es.js";
|
|
17
|
+
import { verifyOpenRouterApiKey as Sn, verifyPexelsApiKey as Cn, verifyUnsplashAccessKey as wn } from "./lib/ai-key-verification.es.js";
|
|
18
|
+
import { CORTEX_AI_SEO_METADATA_CONTENT_BUDGET as Tn, CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS as En, cortexAiSeoMetadataOutputSchema as Dn, extractJsonObject as On, generateCortexAiSeoMetadata as kn, truncateOnWordBoundary as An } from "./lib/ai-seo-metadata.es.js";
|
|
19
|
+
import { CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH as jn, CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY as Mn, buildCortexAiVisionRoutingPolicy as Nn, generateCortexAiAltText as Pn, isKnownVisionCapableCortexAiModelId as Fn, normalizeGeneratedAltText as In } from "./lib/ai-vision.es.js";
|
|
20
|
+
import { CORTEX_WIDGET_DEFINITION_SELECT as Ln, CortexWidgetRegistryInsertError as Rn, buildCortexWidgetDefinitionInsertPayload as zn, insertCortexWidgetDefinition as Bn } from "./lib/cortex-widget-registry.es.js";
|
|
21
|
+
import { CORTEX_MCP_PROMPTS as Vn, CORTEX_MCP_RESOURCES as Hn, CORTEX_MCP_TOOL_ALIASES as Un, CORTEX_MCP_TOOL_KINDS as Wn, CORTEX_MCP_WRITE_TOOL_BEHAVIOURS as Gn, CortexMcpForbiddenToolError as Kn, CortexMcpUnknownToolError as qn, assertCortexMcpToolCoverage as Jn, buildCortexMcpToolDefinitions as Yn, callCortexMcpTool as Xn, cortexMcpScopesAllow as Zn, getCortexMcpPrompt as Qn, getCortexMcpToolAnnotations as $n, getCortexMcpToolKind as er, readCortexMcpResource as tr, resolveCortexMcpToolName as nr } from "./lib/mcp-tool-registry.es.js";
|
|
22
|
+
import { CORTEX_MCP_DEFAULT_PROTOCOL_VERSION as rr, CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION as ir, CORTEX_MCP_MODERN_PROTOCOL_VERSION as ar, CORTEX_MCP_SERVER_NAME as or, CORTEX_MCP_SERVER_TITLE as sr, CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS as cr, JSON_RPC_INTERNAL_ERROR as lr, JSON_RPC_INVALID_PARAMS as ur, JSON_RPC_INVALID_REQUEST as dr, JSON_RPC_METHOD_NOT_FOUND as fr, JSON_RPC_PARSE_ERROR as pr, buildCortexMcpDiscoveryDocument as mr, handleCortexMcpMessage as hr, isJsonRpcNotification as gr, isModernEraMessage as _r, wantsMcpEventStream as vr } from "./lib/mcp-server.es.js";
|
|
23
|
+
import { CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH as yr, CORTEX_AI_MCP_ENV_TOKEN_VAR as br, CORTEX_AI_MCP_SCOPES as xr, CORTEX_AI_MCP_SETTINGS_DEFAULTS as Sr, CORTEX_AI_MCP_SETTINGS_KEY as Cr, CORTEX_AI_MCP_TOKENS_TABLE as wr, CORTEX_AI_MCP_TOKEN_PREFIX as Tr, hashCortexAiMcpToken as Er, isLocalhostHost as Dr, matchesCortexAiMcpEnvToken as Or, mintCortexAiMcpToken as kr, normalizeCortexAiMcpSettings as Ar, parseBearerToken as jr, readCortexAiMcpEnvToken as Mr, resolveCortexAiMcpSettings as Nr, shouldTrustLocalMcpRequest as Pr, touchCortexAiMcpToken as Fr, verifyCortexAiMcpToken as Ir } from "./lib/mcp-tokens.es.js";
|
|
24
|
+
export { F as CORTEX_AI_AGENT_SETTINGS_BOUNDS, I as CORTEX_AI_AGENT_SETTINGS_DEFAULTS, L as CORTEX_AI_AGENT_SETTINGS_KEY, b as CORTEX_AI_BUILD_SESSION_SETTING_KEY, jn as CORTEX_AI_DEFAULT_ALT_TEXT_MAX_LENGTH, e as CORTEX_AI_FREE_MODEL_FALLBACK_REGISTRY, k as CORTEX_AI_KEY_ALGORITHM, A as CORTEX_AI_KEY_ENVELOPE_VERSION, yr as CORTEX_AI_MCP_ENV_TOKEN_MIN_LENGTH, br as CORTEX_AI_MCP_ENV_TOKEN_VAR, xr as CORTEX_AI_MCP_SCOPES, Sr as CORTEX_AI_MCP_SETTINGS_DEFAULTS, Cr as CORTEX_AI_MCP_SETTINGS_KEY, wr as CORTEX_AI_MCP_TOKENS_TABLE, Tr as CORTEX_AI_MCP_TOKEN_PREFIX, t as CORTEX_AI_MODEL_REGISTRY, n as CORTEX_AI_OPENROUTER_BASE_URL, r as CORTEX_AI_OPENROUTER_FREE_ROUTER_MODEL, R as CORTEX_AI_OPENROUTER_MODEL_SELECTION_SETTING_KEY, z as CORTEX_AI_OPENROUTER_SETTING_KEY, B as CORTEX_AI_PACKAGE_ID, V as CORTEX_AI_PACKAGE_NAME, H as CORTEX_AI_PEXELS_SETTING_KEY, i as CORTEX_AI_REQUIRED_MODEL_PARAMETERS, Tn as CORTEX_AI_SEO_METADATA_CONTENT_BUDGET, En as CORTEX_AI_SEO_METADATA_LENGTH_BUDGETS, x as CORTEX_AI_SITE_BRIEF_SETTING_KEY, U as CORTEX_AI_UNSPLASH_APP_NAME_SETTING_KEY, W as CORTEX_AI_UNSPLASH_SETTING_KEY, Mn as CORTEX_AI_VISION_MODEL_FALLBACK_REGISTRY, rr as CORTEX_MCP_DEFAULT_PROTOCOL_VERSION, ir as CORTEX_MCP_LATEST_LEGACY_PROTOCOL_VERSION, ar as CORTEX_MCP_MODERN_PROTOCOL_VERSION, Vn as CORTEX_MCP_PROMPTS, Hn as CORTEX_MCP_RESOURCES, or as CORTEX_MCP_SERVER_NAME, sr as CORTEX_MCP_SERVER_TITLE, cr as CORTEX_MCP_SUPPORTED_PROTOCOL_VERSIONS, Un as CORTEX_MCP_TOOL_ALIASES, Wn as CORTEX_MCP_TOOL_KINDS, Gn as CORTEX_MCP_WRITE_TOOL_BEHAVIOURS, de as CORTEX_WIDGET_ALLOWED_RELATION_TABLES, Ln as CORTEX_WIDGET_DEFINITION_SELECT, a as CortexAiRoutingError, Kn as CortexMcpForbiddenToolError, qn as CortexMcpUnknownToolError, Rn as CortexWidgetRegistryInsertError, se as INLINE_HTML_ASSISTANT_SYSTEM_PROMPT, lr as JSON_RPC_INTERNAL_ERROR, ur as JSON_RPC_INVALID_PARAMS, dr as JSON_RPC_INVALID_REQUEST, fr as JSON_RPC_METHOD_NOT_FOUND, pr as JSON_RPC_PARSE_ERROR, $e as NEXTBLOCK_SEED_MEDIA_OBJECT_KEYS, et as NEXTBLOCK_SEED_TRANSLATION_GROUP_IDS, Jn as assertCortexMcpToolCoverage, Pe as availableCortexAiBlockTypes, o as buildCortexAiModelFallbackChain, s as buildCortexAiRoutingPolicy, Nn as buildCortexAiVisionRoutingPolicy, mr as buildCortexMcpDiscoveryDocument, Yn as buildCortexMcpToolDefinitions, fe as buildCortexProfileCardVerificationDefinition, pe as buildCortexWidgetBuilderPrompt, me as buildCortexWidgetBuilderSystemPrompt, zn as buildCortexWidgetDefinitionInsertPayload, yt as buildVisibleContactIntroActionPlan, Xn as callCortexMcpTool, Fe as cortexAiBlockTypeSchema, bt as cortexAiPageContextSchema, Dn as cortexAiSeoMetadataOutputSchema, S as cortexBuildSessionSchema, Zn as cortexMcpScopesAllow, C as cortexSiteBriefInputSchema, w as cortexSiteBriefSchema, he as cortexWidgetBuildRequestSchema, ge as cortexWidgetDbRelationFieldSchema, _e as cortexWidgetDefinitionSchema, ve as cortexWidgetFieldSchema, ye as cortexWidgetImageR2FieldSchema, be as cortexWidgetLayoutNodeSchema, xe as cortexWidgetRichTextFieldSchema, Se as cortexWidgetTextFieldSchema, xt as createCmsPageInputSchema, St as createCmsPostInputSchema, Ct as createCmsProductInputSchema, ne as createCortexAiOpenRouterClient, re as createCortexAiOpenRouterProvider, c as createCortexAiStoredModelSelection, Te as createCortexCustomBlockTools, We as createCortexDatabaseAgentTools, wt as createCortexGlobalAgentTools, tt as createCortexSiteTools, Ee as createCustomBlockInputSchema, Ie as customBlockSlugPatternSchema, j as decryptOpenRouterApiKey, G as decryptStoredOpenRouterApiKey, Tt as deleteCmsItemInputSchema, De as deleteCustomBlockInputSchema, Ge as describeDatabaseSchemaInputSchema, M as encryptOpenRouterApiKey, K as encryptStoredOpenRouterApiKey, Et as executeCmsActionPlan, Dt as executeCmsActionPlanInputSchema, Ot as executeCreateCmsPage, kt as executeCreateCmsPost, At as executeCreateCmsProduct, Oe as executeCreateCustomBlock, Ke as executeDatabaseActionPlan, qe as executeDatabaseActionPlanInputSchema, Je as executeDatabaseMutation, Ye as executeDatabaseMutationInputSchema, jt as executeDeleteCmsItem, ke as executeDeleteCustomBlock, Xe as executeDescribeDatabaseSchema, Mt as executeFetchEcommerceStats, Nt as executeFetchUrlContent, nt as executeFinishSiteBuild, rt as executeGetSiteOverview, Pt as executeInsertContentBlock, Ae as executeListCustomBlocks, Ft as executeManageProductVariants, It as executePrepareDeleteCmsItem, Lt as executePublishContentDraft, Rt as executeReadCurrentCmsItem, Ze as executeReadDatabaseRecords, it as executeResetSiteContent, zt as executeRewritePageDraft, at as executeSaveSiteBrief, Bt as executeSearchDocumentation, Vt as executeSearchDocumentationWithTimeout, Ht as executeSearchStockPhotos, Ut as executeSetContentImages, ot as executeStartSiteBuild, Wt as executeTranslateContentBulk, Gt as executeTranslatePage, Kt as executeUpdateCmsItemField, qt as executeUpdateContentBlock, Jt as executeUpdateCurrentCmsFields, je as executeUpdateCustomBlock, Yt as executeUpdateFooter, Xt as executeUpdateNavigationBar, Zt as executeUpdateSectionColumnBlock, st as executeUpdateSiteIdentity, On as extractJsonObject, Le as fallbackBlockSchemas, Qt as fetchEcommerceStatsInputSchema, $t as fetchUrlContentInputSchema, l as filterCortexAiCompatibleOpenRouterModels, ct as finishSiteBuildInputSchema, T as formatCortexSiteBriefForPrompt, lt as formatCortexSiteOverviewForPrompt, Pn as generateCortexAiAltText, kn as generateCortexAiSeoMetadata, ie as generateCortexAiText, we as generateCortexWidgetDefinition, ce as generateEditorBlocksRequestSchema, le as generateEditorHtmlFragment, q as getCortexAiEnvConfig, Qn as getCortexMcpPrompt, $n as getCortexMcpToolAnnotations, er as getCortexMcpToolKind, J as getEnvOpenRouterKeyStatus, u as getHttpStatusCode, N as getMaskedOpenRouterKey, Y as getOpenRouterEnvApiKey, d as getOpenRouterErrorStatus, P as getOpenRouterKeyEnvelopeStatus, X as getPexelsEnvApiKey, ut as getSiteOverviewInputSchema, ae as getStoredCortexAiModelSelection, Z as getStoredOpenRouterKeyStatus, Q as getUnsplashEnvApiKey, hr as handleCortexMcpMessage, Er as hashCortexAiMcpToken, en as insertContentBlockInputSchema, Bn as insertCortexWidgetDefinition, vt as isBlockedFetchHost, f as isCortexAiFreeModelId, E as isCortexBuildSessionUsable, D as isCortexSiteBriefComplete, gr as isJsonRpcNotification, Fn as isKnownVisionCapableCortexAiModelId, Dr as isLocalhostHost, _r as isModernEraMessage, p as isOpenRouterRateLimitError, m as isOpenRouterRecoverableRoutingError, Re as isValidBlockType, te as listCortexAiCompatibleOpenRouterModels, Me as listCustomBlocksInputSchema, ze as loadCustomBlockDefinitions, tn as manageProductVariantsInputSchema, Or as matchesCortexAiMcpEnvToken, nn as maybeTriggerStockPhotoDownloads, kr as mintCortexAiMcpToken, rn as navigationItemInputSchema, $ as normalizeCortexAiAgentSettings, Ar as normalizeCortexAiMcpSettings, In as normalizeGeneratedAltText, h as omitUnsupportedCortexAiModelOptions, jr as parseBearerToken, an as prepareDeleteCmsItemInputSchema, on as publishContentDraftInputSchema, Mr as readCortexAiMcpEnvToken, dt as readCortexBuildSession, tr as readCortexMcpResource, ft as readCortexSiteBrief, sn as readCurrentCmsItemInputSchema, Be as readCustomBlockFields, Qe as readDatabaseRecordsInputSchema, pt as resetSiteContentInputSchema, ee as resolveCortexAiAgentSettings, Nr as resolveCortexAiMcpSettings, oe as resolveCortexAiOpenRouterCredential, cn as resolveCortexAiStockPhotoProvider, ln as resolveCortexAiStockPhotoProviders, mt as resolveCortexBuildSession, nr as resolveCortexMcpToolName, un as rewritePageDraftInputSchema, g as runWithCortexAiModelFallback, _ as safeParseCortexAiModelSelection, O as safeParseCortexSiteBrief, ht as saveSiteBriefInputSchema, dn as searchDocumentationInputSchema, fn as searchStockPhotosInputSchema, Ve as sectionBlockFallbackSchema, pn as setContentImagesInputSchema, Pr as shouldTrustLocalMcpRequest, gt as startSiteBuildInputSchema, v as summarizeCortexAiRoutingError, Fr as touchCortexAiMcpToken, mn as translateContentBulkInputSchema, hn as translatePageInputSchema, An as truncateOnWordBoundary, gn as updateCmsItemFieldInputSchema, _n as updateContentBlockInputSchema, vn as updateCurrentCmsFieldsInputSchema, Ne as updateCustomBlockInputSchema, yn as updateFooterInputSchema, bn as updateNavigationBarInputSchema, xn as updateSectionColumnBlockInputSchema, _t as updateSiteIdentityInputSchema, He as validateCortexBlockContent, Ce as validateCortexWidgetDefinitionOutput, Ue as validateCustomBlockInstanceContent, ue as validateGeneratedEditorHtmlFragment, Ir as verifyCortexAiMcpToken, Sn as verifyOpenRouterApiKey, Cn as verifyPexelsApiKey, wn as verifyUnsplashAccessKey, vr as wantsMcpEventStream, y as z };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e=require("./ai-model-registry.cjs");require("./zod-config.cjs");const t=require("./ai-client.cjs");let n=require("ai"),r=require("zod");var i=r.z.strictObject({context:r.z.string().max(2e3).optional(),prompt:r.z.string().min(3).max(4e3)}),a=6e4;function o(){return[`You are NextBlock Cortex AI, an inline rich-text assistant for a Tiptap editor.`,`Return ONLY an HTML fragment. Do not return markdown fences, JSON, prose explanations, or commentary.`,`Do not include <!doctype>, <html>, <head>, or <body>. The output is inserted inside an existing editor document.`,`Use semantic HTML: headings, paragraphs, unordered and ordered lists, blockquotes, pre/code blocks, horizontal rules, and tables.`,`Use the current editor context for continuity, but do not repeat existing copy unless the user explicitly asks for a rewrite.`,`For tables, use valid <table>, <thead>, <tbody>, <tr>, <th>, and <td> markup with aligned rows and non-empty cells.`,`Never use blank table spacer rows, blank spacer columns, empty cells, <colgroup>, colspan, or rowspan unless the user explicitly asks for a blank template.`,`If CSS or JavaScript is explicitly requested, use proper <style> or <script> tags. The editor preserves those tags through its source-mode HTML parser.`,`Keep copy production-ready, editable, and concise unless the user asks for longer content.`].join(` `)}function s(e){return[`Create an HTML fragment for this inline editor request:`,e.prompt,/\b(table|pricing table|comparison table)\b/i.test(e.prompt)?[`Table requirements:`,`- Use a short header row.`,`- Use only the real content columns requested by the user.`,`- Do not add blank spacer columns or blank spacer rows.`,`- Do not use <colgroup>, colspan, or rowspan.`,`- Put normal descriptive prose before or after the table, not inside a table cell.`,`- Body rows must match the header column count.`,`- Every header and body cell must contain meaningful text.`].join(`
|
|
2
|
+
`):null,e.context?`Current editor context:\n${e.context}`:null].filter(Boolean).join(`
|
|
3
|
+
|
|
4
|
+
`)}function c(e){return e.replace(/ /gi,` `).replace(/&/gi,`&`).replace(/</gi,`<`).replace(/>/gi,`>`).replace(/"/gi,`"`).replace(/'/gi,`'`)}function l(e){return c(e.replace(/<script\b[\s\S]*?<\/script>/gi,``).replace(/<style\b[\s\S]*?<\/style>/gi,``).replace(/<br\s*\/?>/gi,` `).replace(/<[^>]+>/g,` `)).replace(/\s+/g,` `).trim()}function u(e){return l(e).length===0}function d(e){return e.replace(/<(p|h[1-6])\b[^>]*>(?:\s| |<br\s*\/?>)*<\/\1>/gi,``).trim()}function f(e){let t=[...e.matchAll(/<tr\b[^>]*>([\s\S]*?)<\/tr>/gi)];if(t.length===0)return e;let n=t.map(e=>({cells:[...e[1].matchAll(/<(td|th)\b[^>]*>([\s\S]*?)<\/\1>/gi)].map(e=>({innerHtml:e[2].trim(),tag:e[1].toLowerCase()}))})).filter(e=>e.cells.some(e=>!u(e.innerHtml)));if(n.length===0)return e;let r=Math.max(...n.map(e=>e.cells.length)),i=new Set;for(let e=0;e<r;e++)n.every(t=>{let n=t.cells[e];return!n||u(n.innerHtml)})&&i.add(e);let a=n.map(e=>({cells:e.cells.filter((e,t)=>!i.has(t))})).filter(e=>e.cells.length>0);if(a.length===0)return e;let o=e=>`<tr>${e.cells.map(e=>`<${e.tag}>${e.innerHtml}</${e.tag}>`).join(``)}</tr>`;if(!a[0].cells.some(e=>e.tag===`th`))return`<table><tbody>${a.map(o).join(``)}</tbody></table>`;let[s,...c]=a;return`<table><thead>${o(s)}</thead><tbody>${c.map(o).join(``)}</tbody></table>`}function p(e){return e.replace(/<table\b[\s\S]*?<\/table>/gi,e=>f(e))}function m(e){let t=[...e.matchAll(/<table\b[\s\S]*?<\/table>/gi)];for(let e of t){let t=[...e[0].matchAll(/<tr\b[^>]*>([\s\S]*?)<\/tr>/gi)];if(t.length===0)throw Error(`Cortex AI returned a table without rows.`);let n=[];for(let e of t){let t=[...e[1].matchAll(/<(td|th)\b[^>]*>([\s\S]*?)<\/\1>/gi)];if(t.length===0)throw Error(`Cortex AI returned a table row without cells.`);for(let e of t)if(u(e[2]))throw Error(`Cortex AI returned a table with empty cells.`);n.push(t.length)}if(new Set(n).size>1)throw Error(`Cortex AI returned a table with uneven row widths.`)}}function h(e){let t=e.trim();(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))&&t.slice(1,-1).includes(`<`)&&(t=t.slice(1,-1).trim());let n=t.match(/<body\b[^>]*>([\s\S]*?)<\/body>/i);return n?.[1]&&(t=n[1].trim()),d(p(t))}function g(e){let t=h(e);if(!t.trim())throw Error(`Cortex AI returned empty HTML.`);if(/```/.test(t))throw Error(`Cortex AI returned markdown code fences instead of an HTML fragment.`);if(/<!doctype\b|<html\b|<head\b|<body\b/i.test(t))throw Error(`Cortex AI returned a full HTML document instead of an HTML fragment.`);if(/^(sure|certainly|of course|here(?:'s| is)|below is|i can)\b/i.test(t))throw Error(`Cortex AI returned a conversational response instead of an HTML fragment.`);if(!/<[a-z][\w:-]*(?:\s[^>]*)?>/i.test(t))throw Error(`Cortex AI returned plain text instead of semantic HTML.`);return m(t),t}function _(t){let n=e.getHttpStatusCode(t);if(n===401||n===402||n===403)return!1;if(e.isOpenRouterRecoverableRoutingError(t)||n&&n>=500)return!0;let r=t instanceof Error?t.message:String(t);return/NoContentGenerated|No content generated|Provider returned error|empty HTML|markdown code fences|full HTML document|conversational response|plain text|aborted|abort|timeout|timed out/i.test(r)}async function v(r){let{apiKey:c,fallbackModelIds:l,modelId:u,modelSelection:d,...f}=r,p=i.parse(f),m=await t.createCortexAiOpenRouterClient({apiKey:c,modelSelection:d}),h=e.buildCortexAiRoutingPolicy({credentialSource:m.credentialSource,fallbackModelIds:l,requestedModelId:u,selectedModel:m.modelSelection}),v=await e.runWithCortexAiModelFallback({modelIds:h.modelIds,shouldRetry:_,execute:async t=>{let r=new AbortController,i=setTimeout(()=>r.abort(),a);try{let i=e.omitUnsupportedCortexAiModelOptions({abortSignal:r.signal,maxOutputTokens:5e3,maxRetries:0,prompt:s(p),instructions:o(),temperature:.2},{modelId:t,modelSelection:h.modelSelection});return g((await(0,n.generateText)({...i,model:m.model(t)})).text)}finally{clearTimeout(i)}}});return{attempts:v.attempts,credentialSource:m.credentialSource,html:v.result,modelId:v.modelId}}var y=`Built at runtime for HTML-fragment rich-text assistance.`;exports.INLINE_HTML_ASSISTANT_SYSTEM_PROMPT=y,exports.generateEditorBlocksRequestSchema=i,exports.generateEditorHtmlFragment=v,exports.validateGeneratedEditorHtmlFragment=g;
|