create-nextblock 0.12.1 → 0.12.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/bin/create-nextblock.js +2 -1
- package/package.json +1 -1
- 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 +909 -909
- package/templates/nextblock-template/app/api/cron/reset-sandbox/route.ts +3490 -3490
- package/templates/nextblock-template/app/cms/settings/cortex-ai/SandboxCortexAiSettingsClient.tsx +1 -1
- package/templates/nextblock-template/app/cms/settings/cortex-ai/StoredCortexAiSettingsClient.tsx +1 -1
- package/templates/nextblock-template/app/cms/settings/cortex-ai/actions.ts +1 -1
- package/templates/nextblock-template/app/cms/settings/cortex-ai/page.tsx +80 -80
- package/templates/nextblock-template/next-env.d.ts +1 -1
- package/templates/nextblock-template/package.json +2 -2
- package/templates/nextblock-template/scripts/verify-cortex-ai-build-widget.tsx +1 -1
- 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/app/cms/settings/cortex-ai/SandboxCortexAiSettingsClient.tsx
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
import {
|
|
31
31
|
createCortexAiStoredModelSelection,
|
|
32
32
|
type CortexAiStoredModelSelection,
|
|
33
|
-
} from '@nextblock/cortex/client';
|
|
33
|
+
} from '@nextblock-cms/cortex/client';
|
|
34
34
|
|
|
35
35
|
const CORTEX_AI_SANDBOX_KEY_LOCAL_STORAGE = 'cortex_ai_sandbox_openrouter_api_key';
|
|
36
36
|
const CORTEX_AI_SANDBOX_MODEL_LOCAL_STORAGE = 'cortex_ai_sandbox_openrouter_model_selection';
|
package/templates/nextblock-template/app/cms/settings/cortex-ai/StoredCortexAiSettingsClient.tsx
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
Trash2,
|
|
28
28
|
} from 'lucide-react';
|
|
29
29
|
|
|
30
|
-
import type { CortexAiStoredModelSelection } from '@nextblock/cortex/client';
|
|
30
|
+
import type { CortexAiStoredModelSelection } from '@nextblock-cms/cortex/client';
|
|
31
31
|
import {
|
|
32
32
|
clearCortexAiModelSelectionAction,
|
|
33
33
|
clearOpenRouterApiKeyAction,
|
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
import { listCortexAiCompatibleOpenRouterModels } from '@nextblock/cortex';
|
|
2
|
-
import { getCortexAiSettingsStatus } from './actions';
|
|
3
|
-
import { SandboxCortexAiSettingsClient } from './SandboxCortexAiSettingsClient';
|
|
4
|
-
import { StoredCortexAiSettingsClient } from './StoredCortexAiSettingsClient';
|
|
5
|
-
import { redirect } from 'next/navigation';
|
|
6
|
-
|
|
7
|
-
type CortexAiSettingsPageProps = {
|
|
8
|
-
searchParams?: Promise<{
|
|
9
|
-
error?: string;
|
|
10
|
-
success?: string;
|
|
11
|
-
}>;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function formatDate(value: string | null) {
|
|
15
|
-
if (!value) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return new Intl.DateTimeFormat('en', {
|
|
20
|
-
dateStyle: 'medium',
|
|
21
|
-
timeStyle: 'short',
|
|
22
|
-
}).format(new Date(value));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default async function CortexAiSettingsPage({
|
|
26
|
-
searchParams,
|
|
27
|
-
}: CortexAiSettingsPageProps) {
|
|
28
|
-
const status = await getCortexAiSettingsStatus();
|
|
29
|
-
|
|
30
|
-
if (!status.isPackageActive) {
|
|
31
|
-
redirect('/cms/dashboard');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const params: { error?: string; success?: string } = searchParams
|
|
35
|
-
? await searchParams
|
|
36
|
-
: {};
|
|
37
|
-
const storedKeyUpdatedAt = formatDate(status.storedOpenRouterKeyUpdatedAt);
|
|
38
|
-
const selectedModelUpdatedAt = formatDate(status.selectedModel?.updatedAt || null);
|
|
39
|
-
let compatibleModels: Awaited<ReturnType<typeof listCortexAiCompatibleOpenRouterModels>> = [];
|
|
40
|
-
let modelCatalogError: string | null = null;
|
|
41
|
-
|
|
42
|
-
if (status.hasStoredOpenRouterKey || process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
|
|
43
|
-
try {
|
|
44
|
-
compatibleModels = await listCortexAiCompatibleOpenRouterModels();
|
|
45
|
-
} catch (error) {
|
|
46
|
-
modelCatalogError =
|
|
47
|
-
error instanceof Error ? error.message : 'Failed to load compatible OpenRouter models.';
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
|
|
52
|
-
return (
|
|
53
|
-
<SandboxCortexAiSettingsClient
|
|
54
|
-
compatibleModels={compatibleModels as any}
|
|
55
|
-
isPackageActive={status.isPackageActive}
|
|
56
|
-
hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
|
|
57
|
-
maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
|
|
58
|
-
modelCatalogError={modelCatalogError}
|
|
59
|
-
/>
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<StoredCortexAiSettingsClient
|
|
65
|
-
compatibleModels={compatibleModels as any}
|
|
66
|
-
isPackageActive={status.isPackageActive}
|
|
67
|
-
hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
|
|
68
|
-
maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
|
|
69
|
-
hasStoredOpenRouterKey={status.hasStoredOpenRouterKey}
|
|
70
|
-
maskedStoredOpenRouterKey={status.maskedStoredOpenRouterKey}
|
|
71
|
-
storedKeyUpdatedAt={storedKeyUpdatedAt}
|
|
72
|
-
selectedModel={status.selectedModel}
|
|
73
|
-
selectedModelUpdatedAt={selectedModelUpdatedAt}
|
|
74
|
-
hasEncryptionKey={status.hasEncryptionKey}
|
|
75
|
-
modelCatalogError={modelCatalogError}
|
|
76
|
-
successMessage={params.success}
|
|
77
|
-
errorMessage={params.error}
|
|
78
|
-
/>
|
|
79
|
-
);
|
|
80
|
-
}
|
|
1
|
+
import { listCortexAiCompatibleOpenRouterModels } from '@nextblock-cms/cortex';
|
|
2
|
+
import { getCortexAiSettingsStatus } from './actions';
|
|
3
|
+
import { SandboxCortexAiSettingsClient } from './SandboxCortexAiSettingsClient';
|
|
4
|
+
import { StoredCortexAiSettingsClient } from './StoredCortexAiSettingsClient';
|
|
5
|
+
import { redirect } from 'next/navigation';
|
|
6
|
+
|
|
7
|
+
type CortexAiSettingsPageProps = {
|
|
8
|
+
searchParams?: Promise<{
|
|
9
|
+
error?: string;
|
|
10
|
+
success?: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function formatDate(value: string | null) {
|
|
15
|
+
if (!value) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return new Intl.DateTimeFormat('en', {
|
|
20
|
+
dateStyle: 'medium',
|
|
21
|
+
timeStyle: 'short',
|
|
22
|
+
}).format(new Date(value));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default async function CortexAiSettingsPage({
|
|
26
|
+
searchParams,
|
|
27
|
+
}: CortexAiSettingsPageProps) {
|
|
28
|
+
const status = await getCortexAiSettingsStatus();
|
|
29
|
+
|
|
30
|
+
if (!status.isPackageActive) {
|
|
31
|
+
redirect('/cms/dashboard');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const params: { error?: string; success?: string } = searchParams
|
|
35
|
+
? await searchParams
|
|
36
|
+
: {};
|
|
37
|
+
const storedKeyUpdatedAt = formatDate(status.storedOpenRouterKeyUpdatedAt);
|
|
38
|
+
const selectedModelUpdatedAt = formatDate(status.selectedModel?.updatedAt || null);
|
|
39
|
+
let compatibleModels: Awaited<ReturnType<typeof listCortexAiCompatibleOpenRouterModels>> = [];
|
|
40
|
+
let modelCatalogError: string | null = null;
|
|
41
|
+
|
|
42
|
+
if (status.hasStoredOpenRouterKey || process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
|
|
43
|
+
try {
|
|
44
|
+
compatibleModels = await listCortexAiCompatibleOpenRouterModels();
|
|
45
|
+
} catch (error) {
|
|
46
|
+
modelCatalogError =
|
|
47
|
+
error instanceof Error ? error.message : 'Failed to load compatible OpenRouter models.';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (process.env.NEXT_PUBLIC_IS_SANDBOX === 'true') {
|
|
52
|
+
return (
|
|
53
|
+
<SandboxCortexAiSettingsClient
|
|
54
|
+
compatibleModels={compatibleModels as any}
|
|
55
|
+
isPackageActive={status.isPackageActive}
|
|
56
|
+
hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
|
|
57
|
+
maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
|
|
58
|
+
modelCatalogError={modelCatalogError}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<StoredCortexAiSettingsClient
|
|
65
|
+
compatibleModels={compatibleModels as any}
|
|
66
|
+
isPackageActive={status.isPackageActive}
|
|
67
|
+
hasEnvOpenRouterKey={status.hasEnvOpenRouterKey}
|
|
68
|
+
maskedEnvOpenRouterKey={status.maskedEnvOpenRouterKey}
|
|
69
|
+
hasStoredOpenRouterKey={status.hasStoredOpenRouterKey}
|
|
70
|
+
maskedStoredOpenRouterKey={status.maskedStoredOpenRouterKey}
|
|
71
|
+
storedKeyUpdatedAt={storedKeyUpdatedAt}
|
|
72
|
+
selectedModel={status.selectedModel}
|
|
73
|
+
selectedModelUpdatedAt={selectedModelUpdatedAt}
|
|
74
|
+
hasEncryptionKey={status.hasEncryptionKey}
|
|
75
|
+
modelCatalogError={modelCatalogError}
|
|
76
|
+
successMessage={params.success}
|
|
77
|
+
errorMessage={params.error}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="next" />
|
|
2
2
|
/// <reference types="next/image-types/global" />
|
|
3
|
-
import "./.next/
|
|
3
|
+
import "./.next/types/routes.d.ts";
|
|
4
4
|
|
|
5
5
|
// NOTE: This file should not be edited
|
|
6
6
|
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextblock-cms/template",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "next dev",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"@dnd-kit/utilities": "^3.2.2",
|
|
25
25
|
"@hookform/resolvers": "^5.2.2",
|
|
26
26
|
"@next/third-parties": "^16.2.7",
|
|
27
|
+
"@nextblock-cms/cortex": "workspace:*",
|
|
27
28
|
"@nextblock-cms/db": "workspace:*",
|
|
28
29
|
"@nextblock-cms/ecommerce": "npm:@nextblock-cms/ecom@latest",
|
|
29
30
|
"@nextblock-cms/editor": "workspace:*",
|
|
30
31
|
"@nextblock-cms/sdk": "workspace:*",
|
|
31
32
|
"@nextblock-cms/ui": "workspace:*",
|
|
32
33
|
"@nextblock-cms/utils": "workspace:*",
|
|
33
|
-
"@nextblock/cortex": "workspace:*",
|
|
34
34
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
35
35
|
"@supabase/ssr": "^0.10.2",
|
|
36
36
|
"@supabase/supabase-js": "^2.105.1",
|