create-nextblock 0.10.9 → 0.11.2
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/package.json +1 -1
- package/templates/nextblock-template/app/actions/interactions.test.ts +301 -0
- package/templates/nextblock-template/app/actions/interactions.ts +372 -0
- package/templates/nextblock-template/app/api/ai/cortex/build-widget/route.ts +4 -4
- package/templates/nextblock-template/app/api/ai/generate-blocks/route.ts +2 -2
- package/templates/nextblock-template/app/api/ai/global-agent/route.ts +56 -57
- package/templates/nextblock-template/app/api/cron/reset-sandbox/route.ts +1 -1
- package/templates/nextblock-template/app/api/cron/reset-sandbox/sandboxResetSql.ts +837 -0
- package/templates/nextblock-template/app/article/[slug]/PostClientContent.tsx +6 -0
- package/templates/nextblock-template/app/cms/CmsClientLayout.tsx +4 -0
- package/templates/nextblock-template/app/cms/components/ConnectGitHubButton.tsx +122 -0
- package/templates/nextblock-template/app/cms/components/github-connect-actions.ts +102 -0
- package/templates/nextblock-template/app/cms/dashboard/components/DashboardOnboarding.tsx +18 -13
- package/templates/nextblock-template/app/cms/interactions/InteractionsModerationClient.tsx +408 -0
- package/templates/nextblock-template/app/cms/interactions/page.tsx +51 -0
- package/templates/nextblock-template/app/cms/settings/cortex-ai/SandboxCortexAiSettingsClient.tsx +4 -3
- package/templates/nextblock-template/app/cms/settings/cortex-ai/StoredCortexAiSettingsClient.tsx +1 -1
- package/templates/nextblock-template/app/cms/settings/cortex-ai/actions.ts +3 -5
- package/templates/nextblock-template/app/cms/settings/cortex-ai/page.tsx +1 -1
- package/templates/nextblock-template/app/page.tsx +2 -2
- package/templates/nextblock-template/app/product/[slug]/page.tsx +2 -0
- package/templates/nextblock-template/components/AppShell.tsx +1 -1
- package/templates/nextblock-template/components/PostCommentsSection.tsx +369 -0
- package/templates/nextblock-template/components/ProductReviewsSection.tsx +419 -0
- package/templates/nextblock-template/components/blocks/renderers/ProductDetailsBlockRenderer.tsx +2 -0
- package/templates/nextblock-template/components/privacy/ConsentBanner.tsx +62 -19
- package/templates/nextblock-template/docs/08-NEXTBLOCK-CORTEX-AI-ARCHITECTURE.md +19 -19
- package/templates/nextblock-template/docs/10-CUSTOM-BLOCKS.md +4 -4
- package/templates/nextblock-template/docs/12-VERCEL-DEPLOYMENT.md +9 -8
- package/templates/nextblock-template/docs/13-STAYING-UP-TO-DATE.md +38 -9
- package/templates/nextblock-template/lib/blocks/ProductGridBlock.tsx +2 -0
- package/templates/nextblock-template/lib/onboarding/status.ts +13 -6
- package/templates/nextblock-template/lib/setup/actions.ts +3 -1
- package/templates/nextblock-template/lib/setup/migrations-bundle.ts +30 -0
- package/templates/nextblock-template/lib/updates/check-upstream.ts +44 -7
- package/templates/nextblock-template/lib/updates/github-device.ts +206 -0
- package/templates/nextblock-template/lib/updates/repo-identity.ts +11 -1
- package/templates/nextblock-template/package.json +2 -1
- package/templates/nextblock-template/scripts/verify-cortex-ai-build-widget.tsx +2 -4
- package/templates/nextblock-template/scripts/verify-cortex-ai-generate-blocks.ts +1 -1
- package/templates/nextblock-template/scripts/verify-cortex-ai-global-tools.ts +1 -1
- package/templates/nextblock-template/scripts/verify-cortex-ai-routing.ts +1 -1
- package/templates/nextblock-template/tsconfig.tsbuildinfo +1 -1
- package/templates/nextblock-template/lib/ai-block-generation.ts +0 -339
- package/templates/nextblock-template/lib/ai-client.ts +0 -247
- package/templates/nextblock-template/lib/ai-config.ts +0 -98
- package/templates/nextblock-template/lib/ai-cortex-widget-builder.ts +0 -125
- package/templates/nextblock-template/lib/ai-global-agent-custom-block-tools.ts +0 -363
- package/templates/nextblock-template/lib/ai-global-agent-db-tools.test.ts +0 -405
- package/templates/nextblock-template/lib/ai-global-agent-db-tools.ts +0 -1228
- package/templates/nextblock-template/lib/ai-global-agent-ecommerce.ts +0 -5
- package/templates/nextblock-template/lib/ai-global-agent-tools-stats.test.ts +0 -223
- package/templates/nextblock-template/lib/ai-global-agent-tools.test.ts +0 -2183
- package/templates/nextblock-template/lib/ai-global-agent-tools.ts +0 -4807
- package/templates/nextblock-template/lib/ai-key-crypto.test.ts +0 -70
- package/templates/nextblock-template/lib/ai-key-crypto.ts +0 -132
- package/templates/nextblock-template/lib/ai-model-catalog.test.ts +0 -49
- package/templates/nextblock-template/lib/ai-model-catalog.ts +0 -41
- package/templates/nextblock-template/lib/ai-model-registry.test.ts +0 -231
- package/templates/nextblock-template/lib/ai-model-registry.ts +0 -522
- package/templates/nextblock-template/lib/cortex-widget-registry.test.ts +0 -199
- package/templates/nextblock-template/lib/cortex-widget-registry.ts +0 -88
- package/templates/nextblock-template/lib/cortex-widget-schema.test.tsx +0 -237
- package/templates/nextblock-template/lib/cortex-widget-schema.ts +0 -393
|
@@ -3,14 +3,14 @@ import { revalidatePath, revalidateTag } from 'next/cache';
|
|
|
3
3
|
|
|
4
4
|
import { createClient, verifyPackageOnline } from '@nextblock-cms/db/server';
|
|
5
5
|
|
|
6
|
-
import { generateCortexWidgetDefinition } from '
|
|
6
|
+
import { generateCortexWidgetDefinition } from '@nextblock/cortex';
|
|
7
7
|
import {
|
|
8
8
|
cortexWidgetBuildRequestSchema,
|
|
9
|
-
} from '
|
|
9
|
+
} from '@nextblock/cortex';
|
|
10
10
|
import {
|
|
11
11
|
CortexWidgetRegistryInsertError,
|
|
12
12
|
insertCortexWidgetDefinition,
|
|
13
|
-
} from '
|
|
13
|
+
} from '@nextblock/cortex';
|
|
14
14
|
import {
|
|
15
15
|
CUSTOM_BLOCK_DEFINITIONS_CACHE_TAG,
|
|
16
16
|
getCustomBlockDefinitionCacheTag,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
safeParseCortexAiModelSelection,
|
|
20
20
|
summarizeCortexAiRoutingError,
|
|
21
|
-
} from '
|
|
21
|
+
} from '@nextblock/cortex';
|
|
22
22
|
|
|
23
23
|
export const dynamic = 'force-dynamic';
|
|
24
24
|
|
|
@@ -5,11 +5,11 @@ import { createClient } from '@nextblock-cms/db/server';
|
|
|
5
5
|
import {
|
|
6
6
|
generateEditorHtmlFragment,
|
|
7
7
|
generateEditorBlocksRequestSchema,
|
|
8
|
-
} from '
|
|
8
|
+
} from '@nextblock/cortex';
|
|
9
9
|
import {
|
|
10
10
|
safeParseCortexAiModelSelection,
|
|
11
11
|
summarizeCortexAiRoutingError,
|
|
12
|
-
} from '
|
|
12
|
+
} from '@nextblock/cortex';
|
|
13
13
|
|
|
14
14
|
export const dynamic = 'force-dynamic';
|
|
15
15
|
|
|
@@ -1,44 +1,40 @@
|
|
|
1
|
-
import { stepCountIs, streamText } from 'ai';
|
|
2
|
-
import { NextResponse } from 'next/server';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from '
|
|
37
|
-
import {
|
|
38
|
-
executeDatabaseActionPlan,
|
|
39
|
-
executeDatabaseMutation,
|
|
40
|
-
} from '../../../../lib/ai-global-agent-db-tools';
|
|
41
|
-
import { executeDeleteCustomBlock } from '../../../../lib/ai-global-agent-custom-block-tools';
|
|
1
|
+
import { stepCountIs, streamText } from 'ai';
|
|
2
|
+
import { NextResponse } from 'next/server';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
createClient,
|
|
6
|
+
getServiceRoleSupabaseClient,
|
|
7
|
+
verifyPackageOnline,
|
|
8
|
+
} from '@nextblock-cms/db/server';
|
|
9
|
+
import {
|
|
10
|
+
buildCortexAiRoutingPolicy,
|
|
11
|
+
buildVisibleContactIntroActionPlan,
|
|
12
|
+
cortexAiPageContextSchema,
|
|
13
|
+
createCortexGlobalAgentTools,
|
|
14
|
+
createCortexAiOpenRouterClient,
|
|
15
|
+
executeCmsActionPlan,
|
|
16
|
+
executeCreateCmsPage,
|
|
17
|
+
executeCreateCmsPost,
|
|
18
|
+
executeCreateCmsProduct,
|
|
19
|
+
executeDatabaseActionPlan,
|
|
20
|
+
executeDatabaseMutation,
|
|
21
|
+
executeDeleteCmsItem,
|
|
22
|
+
executeDeleteCustomBlock,
|
|
23
|
+
executeInsertContentBlock,
|
|
24
|
+
executeUpdateContentBlock,
|
|
25
|
+
executeUpdateCmsItemField,
|
|
26
|
+
executeUpdateCurrentCmsFields,
|
|
27
|
+
executeUpdateFooter,
|
|
28
|
+
executeUpdateNavigationBar,
|
|
29
|
+
executeUpdateSectionColumnBlock,
|
|
30
|
+
isOpenRouterRateLimitError,
|
|
31
|
+
omitUnsupportedCortexAiModelOptions,
|
|
32
|
+
safeParseCortexAiModelSelection,
|
|
33
|
+
summarizeCortexAiRoutingError,
|
|
34
|
+
type CortexAiPageContext,
|
|
35
|
+
z,
|
|
36
|
+
} from '@nextblock/cortex';
|
|
37
|
+
import { validateBlockContent } from '../../../../lib/blocks/blockRegistry';
|
|
42
38
|
|
|
43
39
|
export const dynamic = 'force-dynamic';
|
|
44
40
|
|
|
@@ -661,12 +657,13 @@ export async function POST(request: Request) {
|
|
|
661
657
|
if (parsedRequest.data.confirmedToolCall) {
|
|
662
658
|
const confirmedToolCall = parsedRequest.data.confirmedToolCall;
|
|
663
659
|
const stream = createConfirmedToolCallStream({
|
|
664
|
-
context: {
|
|
665
|
-
actorUserId: adminAccess.userId,
|
|
666
|
-
latestUserMessage: confirmedToolCall.confirmationPhrase,
|
|
667
|
-
pageContext,
|
|
668
|
-
supabase: getServiceRoleSupabaseClient(),
|
|
669
|
-
|
|
660
|
+
context: {
|
|
661
|
+
actorUserId: adminAccess.userId,
|
|
662
|
+
latestUserMessage: confirmedToolCall.confirmationPhrase,
|
|
663
|
+
pageContext,
|
|
664
|
+
supabase: getServiceRoleSupabaseClient(),
|
|
665
|
+
validateBlockContent,
|
|
666
|
+
},
|
|
670
667
|
input: confirmedToolCall.input,
|
|
671
668
|
toolName: confirmedToolCall.toolName,
|
|
672
669
|
});
|
|
@@ -685,12 +682,13 @@ export async function POST(request: Request) {
|
|
|
685
682
|
|
|
686
683
|
if (directActionPlan) {
|
|
687
684
|
const stream = createConfirmedToolCallStream({
|
|
688
|
-
context: {
|
|
689
|
-
actorUserId: adminAccess.userId,
|
|
690
|
-
latestUserMessage,
|
|
691
|
-
pageContext,
|
|
692
|
-
supabase: getServiceRoleSupabaseClient(),
|
|
693
|
-
|
|
685
|
+
context: {
|
|
686
|
+
actorUserId: adminAccess.userId,
|
|
687
|
+
latestUserMessage,
|
|
688
|
+
pageContext,
|
|
689
|
+
supabase: getServiceRoleSupabaseClient(),
|
|
690
|
+
validateBlockContent,
|
|
691
|
+
},
|
|
694
692
|
input: directActionPlan,
|
|
695
693
|
toolName: 'execute_cms_action_plan',
|
|
696
694
|
});
|
|
@@ -730,10 +728,11 @@ export async function POST(request: Request) {
|
|
|
730
728
|
actorUserId: adminAccess.userId,
|
|
731
729
|
cortexAiApiKey: sandboxKey,
|
|
732
730
|
cortexAiModelSelection: sandboxKey && modelSelection ? modelSelection : undefined,
|
|
733
|
-
latestUserMessage,
|
|
734
|
-
pageContext,
|
|
735
|
-
supabase: getServiceRoleSupabaseClient(),
|
|
736
|
-
|
|
731
|
+
latestUserMessage,
|
|
732
|
+
pageContext,
|
|
733
|
+
supabase: getServiceRoleSupabaseClient(),
|
|
734
|
+
validateBlockContent,
|
|
735
|
+
});
|
|
737
736
|
const systemPrompt = buildGlobalAgentSystemPrompt(pageContext);
|
|
738
737
|
|
|
739
738
|
const stream = new ReadableStream({
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from '@nextblock-cms/ecommerce/server';
|
|
15
15
|
import postgres from 'postgres';
|
|
16
16
|
|
|
17
|
-
import { CORTEX_AI_PACKAGE_ID } from '
|
|
17
|
+
import { CORTEX_AI_PACKAGE_ID } from '@nextblock/cortex';
|
|
18
18
|
import { SANDBOX_RESET_SQL } from './sandboxResetSql';
|
|
19
19
|
|
|
20
20
|
export const dynamic = 'force-dynamic';
|