@blinkk/root-cms 2.4.7 → 2.4.8
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/dist/app.js +6 -6
- package/dist/{client-wkm3JBRI.d.ts → client-pSzji9ZN.d.ts} +2 -3
- package/dist/client.d.ts +1 -1
- package/dist/core.d.ts +2 -2
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.js +29 -15
- package/dist/ui/ui.js +10 -10
- package/package.json +7 -7
package/dist/app.js
CHANGED
|
@@ -83,7 +83,7 @@ function convertOneOfTypes(collection) {
|
|
|
83
83
|
// package.json
|
|
84
84
|
var package_default = {
|
|
85
85
|
name: "@blinkk/root-cms",
|
|
86
|
-
version: "2.4.
|
|
86
|
+
version: "2.4.8",
|
|
87
87
|
author: "s@blinkk.com",
|
|
88
88
|
license: "MIT",
|
|
89
89
|
engines: {
|
|
@@ -152,9 +152,9 @@ var package_default = {
|
|
|
152
152
|
"@ag-grid-community/core": "32.3.9",
|
|
153
153
|
"@ag-grid-community/react": "32.3.9",
|
|
154
154
|
"@ag-grid-community/styles": "32.3.9",
|
|
155
|
-
"@genkit-ai/ai": "1.
|
|
156
|
-
"@genkit-ai/core": "1.
|
|
157
|
-
"@genkit-ai/
|
|
155
|
+
"@genkit-ai/ai": "1.26.0",
|
|
156
|
+
"@genkit-ai/core": "1.26.0",
|
|
157
|
+
"@genkit-ai/google-genai": "1.26.0",
|
|
158
158
|
"@google-cloud/firestore": "7.11.3",
|
|
159
159
|
"@hello-pangea/dnd": "18.0.1",
|
|
160
160
|
"@types/cli-progress": "3.11.6",
|
|
@@ -168,7 +168,7 @@ var package_default = {
|
|
|
168
168
|
diff: "8.0.2",
|
|
169
169
|
"dts-dom": "3.7.0",
|
|
170
170
|
"fnv-plus": "1.3.1",
|
|
171
|
-
genkit: "1.
|
|
171
|
+
genkit: "1.26.0",
|
|
172
172
|
jsonwebtoken: "9.0.2",
|
|
173
173
|
kleur: "4.1.5",
|
|
174
174
|
sirv: "2.0.3",
|
|
@@ -248,7 +248,7 @@ var package_default = {
|
|
|
248
248
|
yjs: "13.6.27"
|
|
249
249
|
},
|
|
250
250
|
peerDependencies: {
|
|
251
|
-
"@blinkk/root": "2.4.
|
|
251
|
+
"@blinkk/root": "2.4.8",
|
|
252
252
|
"firebase-admin": ">=11",
|
|
253
253
|
"firebase-functions": ">=4",
|
|
254
254
|
preact: ">=10",
|
|
@@ -3,10 +3,9 @@ import { App } from 'firebase-admin/app';
|
|
|
3
3
|
import { Firestore, WriteBatch, Timestamp, Query } from 'firebase-admin/firestore';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Supported Root AI models. Defaults to '
|
|
7
|
-
* Custom model identifiers can also be provided as strings.
|
|
6
|
+
* Supported Root AI models. Defaults to 'gemini-3-flash-preview'.
|
|
8
7
|
*/
|
|
9
|
-
type RootAiModel = '
|
|
8
|
+
type RootAiModel = 'gemini-3-pro-preview' | 'gemini-3-flash-preview' | 'gemini-2.5-flash' | 'gemini-2.0-pro' | string;
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Built-in sidebar tools that can be toggled on/off in the CMS UI.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@blinkk/root';
|
|
2
2
|
import 'firebase-admin/app';
|
|
3
3
|
import 'firebase-admin/firestore';
|
|
4
|
-
export { A as Action, p as ArrayObject, z as BatchRequest, B as BatchRequestOptions, w as BatchRequestQuery, x as BatchRequestQueryOptions, C as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, D as DocMode, h as GetCountOptions, G as GetDocOptions, H as HttpMethod, k as ListActionsOptions, g as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, j as Release, R as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, i as Translation, y as TranslationsDoc, T as TranslationsMap, U as UserRole, m as getCmsPlugin, l as isRichTextData, q as marshalArray, n as marshalData, o as normalizeData, v as parseDocId, t as toArrayObject, s as translationsForLocale, r as unmarshalArray, u as unmarshalData } from './client-
|
|
4
|
+
export { A as Action, p as ArrayObject, z as BatchRequest, B as BatchRequestOptions, w as BatchRequestQuery, x as BatchRequestQueryOptions, C as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, D as DocMode, h as GetCountOptions, G as GetDocOptions, H as HttpMethod, k as ListActionsOptions, g as ListDocsOptions, L as LoadTranslationsOptions, a as LocaleTranslations, j as Release, R as RootCMSClient, f as SaveDraftOptions, S as SetDocOptions, i as Translation, y as TranslationsDoc, T as TranslationsMap, U as UserRole, m as getCmsPlugin, l as isRichTextData, q as marshalArray, n as marshalData, o as normalizeData, v as parseDocId, t as toArrayObject, s as translationsForLocale, r as unmarshalArray, u as unmarshalData } from './client-pSzji9ZN.js';
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-
|
|
2
|
-
export { A as Action, p as ArrayObject, z as BatchRequest, B as BatchRequestOptions, w as BatchRequestQuery, x as BatchRequestQueryOptions, C as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, h as GetCountOptions, G as GetDocOptions, H as HttpMethod, k as ListActionsOptions, g as ListDocsOptions, E as Locale, N as MultiLocaleTranslationsMap, j as Release, f as SaveDraftOptions, S as SetDocOptions, O as SingleLocaleTranslationsMap, F as SourceString, I as TranslatedString, i as Translation, y as TranslationsDoc, J as TranslationsDocMode, M as TranslationsLocaleDocEntry, K as TranslationsLocaleDocHashMap, P as TranslationsManager, U as UserRole, Q as buildTranslationsDbPath, V as buildTranslationsLocaleDocDbPath, m as getCmsPlugin, l as isRichTextData, q as marshalArray, n as marshalData, o as normalizeData, v as parseDocId, t as toArrayObject, s as translationsForLocale, r as unmarshalArray, u as unmarshalData } from './client-
|
|
1
|
+
import { R as RootCMSClient, D as DocMode, L as LoadTranslationsOptions, T as TranslationsMap, a as LocaleTranslations } from './client-pSzji9ZN.js';
|
|
2
|
+
export { A as Action, p as ArrayObject, z as BatchRequest, B as BatchRequestOptions, w as BatchRequestQuery, x as BatchRequestQueryOptions, C as BatchResponse, c as DataSource, d as DataSourceData, e as DataSourceMode, b as Doc, h as GetCountOptions, G as GetDocOptions, H as HttpMethod, k as ListActionsOptions, g as ListDocsOptions, E as Locale, N as MultiLocaleTranslationsMap, j as Release, f as SaveDraftOptions, S as SetDocOptions, O as SingleLocaleTranslationsMap, F as SourceString, I as TranslatedString, i as Translation, y as TranslationsDoc, J as TranslationsDocMode, M as TranslationsLocaleDocEntry, K as TranslationsLocaleDocHashMap, P as TranslationsManager, U as UserRole, Q as buildTranslationsDbPath, V as buildTranslationsLocaleDocDbPath, m as getCmsPlugin, l as isRichTextData, q as marshalArray, n as marshalData, o as normalizeData, v as parseDocId, t as toArrayObject, s as translationsForLocale, r as unmarshalArray, u as unmarshalData } from './client-pSzji9ZN.js';
|
|
3
3
|
import { Request, RootConfig, Response, RouteParams, GetStaticProps, GetStaticPaths } from '@blinkk/root';
|
|
4
4
|
import { Query } from 'firebase-admin/firestore';
|
|
5
5
|
export { s as schema } from './schema-Bux4PrV2.js';
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import '@blinkk/root';
|
|
2
2
|
import 'firebase-admin/app';
|
|
3
3
|
import 'firebase-admin/firestore';
|
|
4
|
-
export { Y as CMSAIConfig, W as CMSBuiltInSidebarTool, $ as CMSPlugin, _ as CMSPluginOptions, Z as CMSSidebarTool, X as CMSUser, a0 as cmsPlugin } from './client-
|
|
4
|
+
export { Y as CMSAIConfig, W as CMSBuiltInSidebarTool, $ as CMSPlugin, _ as CMSPluginOptions, Z as CMSSidebarTool, X as CMSUser, a0 as cmsPlugin } from './client-pSzji9ZN.js';
|
package/dist/plugin.js
CHANGED
|
@@ -56,7 +56,7 @@ __export(ai_exports, {
|
|
|
56
56
|
import crypto from "crypto";
|
|
57
57
|
import fs from "fs";
|
|
58
58
|
import path from "path";
|
|
59
|
-
import { vertexAI } from "@genkit-ai/
|
|
59
|
+
import { vertexAI } from "@genkit-ai/google-genai";
|
|
60
60
|
import { Timestamp } from "firebase-admin/firestore";
|
|
61
61
|
import { genkit } from "genkit";
|
|
62
62
|
import { logger } from "genkit/logging";
|
|
@@ -94,7 +94,7 @@ async function summarizeDiff(cmsClient, options) {
|
|
|
94
94
|
"Summarize the differences between the two payloads."
|
|
95
95
|
].join("\n");
|
|
96
96
|
const res = await ai.generate({
|
|
97
|
-
model,
|
|
97
|
+
model: vertexAI.model(model),
|
|
98
98
|
messages: [
|
|
99
99
|
{
|
|
100
100
|
role: "system",
|
|
@@ -108,7 +108,7 @@ async function summarizeDiff(cmsClient, options) {
|
|
|
108
108
|
async function generateImage(cmsClient, options) {
|
|
109
109
|
const cmsPluginOptions = cmsClient.cmsPlugin.getConfig();
|
|
110
110
|
const firebaseConfig = cmsPluginOptions.firebaseConfig;
|
|
111
|
-
const model =
|
|
111
|
+
const model = options.model || DEFAULT_IMAGEGEN_MODEL;
|
|
112
112
|
const ai = genkit({
|
|
113
113
|
plugins: [
|
|
114
114
|
vertexAI({
|
|
@@ -118,7 +118,7 @@ async function generateImage(cmsClient, options) {
|
|
|
118
118
|
]
|
|
119
119
|
});
|
|
120
120
|
const res = await ai.generate({
|
|
121
|
-
model,
|
|
121
|
+
model: vertexAI.model(model),
|
|
122
122
|
prompt: [
|
|
123
123
|
{
|
|
124
124
|
text: options.prompt
|
|
@@ -138,12 +138,20 @@ async function generateImage(cmsClient, options) {
|
|
|
138
138
|
}
|
|
139
139
|
return res.media.url;
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
function cleanModelName(model) {
|
|
142
|
+
return LEGACY_MODEL_RENAME[model] || model;
|
|
143
|
+
}
|
|
144
|
+
var DEFAULT_MODEL, DEFAULT_IMAGEGEN_MODEL, LEGACY_MODEL_RENAME, Chat, ChatClient;
|
|
142
145
|
var init_ai = __esm({
|
|
143
146
|
"core/ai.ts"() {
|
|
144
147
|
"use strict";
|
|
145
148
|
logger.setLogLevel("warn");
|
|
146
|
-
DEFAULT_MODEL = "
|
|
149
|
+
DEFAULT_MODEL = "gemini-3-flash-preview";
|
|
150
|
+
DEFAULT_IMAGEGEN_MODEL = "gemini-2.5-flash-image";
|
|
151
|
+
LEGACY_MODEL_RENAME = {
|
|
152
|
+
"vertexai/gemini-2.5-flash": "gemini-2.5-flash",
|
|
153
|
+
"vertexai/gemini-2.0-pro": "gemini-2.0-pro"
|
|
154
|
+
};
|
|
147
155
|
Chat = class {
|
|
148
156
|
constructor(chatClient, id, options) {
|
|
149
157
|
this.chatClient = chatClient;
|
|
@@ -151,7 +159,9 @@ var init_ai = __esm({
|
|
|
151
159
|
this.cmsPluginOptions = this.cmsClient.cmsPlugin.getConfig();
|
|
152
160
|
this.id = id;
|
|
153
161
|
this.history = options?.history ?? [];
|
|
154
|
-
this.model =
|
|
162
|
+
this.model = cleanModelName(
|
|
163
|
+
options?.model || (typeof this.cmsPluginOptions.experiments?.ai === "object" ? this.cmsPluginOptions.experiments.ai.model : void 0) || DEFAULT_MODEL
|
|
164
|
+
);
|
|
155
165
|
const firebaseConfig = this.cmsPluginOptions.firebaseConfig;
|
|
156
166
|
this.ai = genkit({
|
|
157
167
|
plugins: [
|
|
@@ -209,9 +219,13 @@ var init_ai = __esm({
|
|
|
209
219
|
async sendPrompt(prompt, options = {}) {
|
|
210
220
|
const chatRequest = await this.buildGenerateRequest(prompt, options);
|
|
211
221
|
const res = await this.ai.generate({
|
|
212
|
-
model: chatRequest.model,
|
|
222
|
+
model: vertexAI.model(chatRequest.model),
|
|
213
223
|
messages: chatRequest.messages,
|
|
214
|
-
prompt: Array.isArray(prompt) ? prompt.flat() : prompt
|
|
224
|
+
prompt: Array.isArray(prompt) ? prompt.flat() : prompt,
|
|
225
|
+
// NOTE(stevenle): the global location is required for
|
|
226
|
+
// `gemini-3-flash-preview`, it may be possible to remove this in the
|
|
227
|
+
// future.
|
|
228
|
+
config: { location: "global" }
|
|
215
229
|
});
|
|
216
230
|
this.history = res.messages;
|
|
217
231
|
await this.dbDoc().update({
|
|
@@ -2639,7 +2653,7 @@ function api(server, options) {
|
|
|
2639
2653
|
// package.json
|
|
2640
2654
|
var package_default = {
|
|
2641
2655
|
name: "@blinkk/root-cms",
|
|
2642
|
-
version: "2.4.
|
|
2656
|
+
version: "2.4.8",
|
|
2643
2657
|
author: "s@blinkk.com",
|
|
2644
2658
|
license: "MIT",
|
|
2645
2659
|
engines: {
|
|
@@ -2708,9 +2722,9 @@ var package_default = {
|
|
|
2708
2722
|
"@ag-grid-community/core": "32.3.9",
|
|
2709
2723
|
"@ag-grid-community/react": "32.3.9",
|
|
2710
2724
|
"@ag-grid-community/styles": "32.3.9",
|
|
2711
|
-
"@genkit-ai/ai": "1.
|
|
2712
|
-
"@genkit-ai/core": "1.
|
|
2713
|
-
"@genkit-ai/
|
|
2725
|
+
"@genkit-ai/ai": "1.26.0",
|
|
2726
|
+
"@genkit-ai/core": "1.26.0",
|
|
2727
|
+
"@genkit-ai/google-genai": "1.26.0",
|
|
2714
2728
|
"@google-cloud/firestore": "7.11.3",
|
|
2715
2729
|
"@hello-pangea/dnd": "18.0.1",
|
|
2716
2730
|
"@types/cli-progress": "3.11.6",
|
|
@@ -2724,7 +2738,7 @@ var package_default = {
|
|
|
2724
2738
|
diff: "8.0.2",
|
|
2725
2739
|
"dts-dom": "3.7.0",
|
|
2726
2740
|
"fnv-plus": "1.3.1",
|
|
2727
|
-
genkit: "1.
|
|
2741
|
+
genkit: "1.26.0",
|
|
2728
2742
|
jsonwebtoken: "9.0.2",
|
|
2729
2743
|
kleur: "4.1.5",
|
|
2730
2744
|
sirv: "2.0.3",
|
|
@@ -2804,7 +2818,7 @@ var package_default = {
|
|
|
2804
2818
|
yjs: "13.6.27"
|
|
2805
2819
|
},
|
|
2806
2820
|
peerDependencies: {
|
|
2807
|
-
"@blinkk/root": "2.4.
|
|
2821
|
+
"@blinkk/root": "2.4.8",
|
|
2808
2822
|
"firebase-admin": ">=11",
|
|
2809
2823
|
"firebase-functions": ">=4",
|
|
2810
2824
|
preact: ">=10",
|