@engenty/wizards-runtime 0.9.7 → 0.9.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/apps/runtime/dist/agents/architect.js +4 -2
- package/apps/runtime/dist/agents/company.js +1 -1
- package/apps/runtime/dist/agents/studio-assistant.js +1 -1
- package/apps/runtime/dist/assistant/primer.js +1 -1
- package/apps/runtime/dist/authoring/example.js +2 -2
- package/apps/runtime/dist/authoring/guide.js +11 -11
- package/apps/runtime/dist/credits/estimate.js +5 -5
- package/apps/runtime/dist/db/adopt.js +4 -3
- package/apps/runtime/dist/db/migrations/control/0011_model_classes.sql +11 -0
- package/apps/runtime/dist/db/migrations/control/meta/0011_snapshot.json +600 -0
- package/apps/runtime/dist/db/migrations/control/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/migrations/tenant/0021_model_classes.sql +41 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0021_snapshot.json +3475 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/docs/dev/plugins/quick-start.md +2 -2
- package/apps/runtime/dist/docs/dev/plugins/server.md +2 -2
- package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +9 -5
- package/apps/runtime/dist/docs/dev/wizard-format/film-steps.md +2 -2
- package/apps/runtime/dist/docs/dev/wizard-format/index.md +14 -8
- package/apps/runtime/dist/docs/user-guide/models.md +22 -13
- package/apps/runtime/dist/docs/user-guide/steps.md +6 -6
- package/apps/runtime/dist/documents/parse.js +1 -1
- package/apps/runtime/dist/engine/requirements.js +11 -11
- package/apps/runtime/dist/engine/steps.js +4 -4
- package/apps/runtime/dist/env.js +4 -4
- package/apps/runtime/dist/film/step.js +1 -1
- package/apps/runtime/dist/harness/antigravity.js +3 -3
- package/apps/runtime/dist/harness/apple.js +1 -1
- package/apps/runtime/dist/harness/claude.js +2 -2
- package/apps/runtime/dist/harness/codex.js +3 -3
- package/apps/runtime/dist/harness/cursor.js +1 -1
- package/apps/runtime/dist/mcp/tools.js +6 -3
- package/apps/runtime/dist/models.js +64 -10
- package/apps/runtime/dist/plugins/loader.js +1 -1
- package/apps/runtime/dist/routes/studio.js +16 -5
- package/apps/runtime/dist/services/assistant-chats.js +1 -1
- package/apps/runtime/dist/services/brand.js +1 -1
- package/apps/runtime/dist/services/knowledge-model.js +1 -1
- package/apps/runtime/dist/services/marketplace.js +3 -1
- package/apps/runtime/dist/services/project-files.js +1 -1
- package/apps/runtime/dist/services/translations.js +2 -2
- package/apps/runtime/dist/services/wizards.js +2 -2
- package/apps/runtime/dist/sharing/agent.js +1 -1
- package/apps/runtime/dist/texts.js +12 -0
- package/apps/web/dist/assets/{AboutDialog-B3tljxg5.js → AboutDialog-B_Ixp_Tb.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-DfWTNzyl.js → ChangelogDialog-BpEIbAZ8.js} +1 -1
- package/apps/web/dist/assets/{EditorPage-XDdz2UM4.js → EditorPage-CKHY4hn4.js} +4 -4
- package/apps/web/dist/assets/{FlowPreview-CKNVCFbp.js → FlowPreview-APXdRflR.js} +1 -1
- package/apps/web/dist/assets/{Harness-BCec49Cq.js → Harness-BsGXMlLg.js} +1 -1
- package/apps/web/dist/assets/{Marketplace-BuYeaxK2.js → Marketplace-Dr-Qnb-F.js} +2 -2
- package/apps/web/dist/assets/{NewWizardChannels-DRNji-bk.js → NewWizardChannels-0JrRdUFd.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-4TpgYOaI.js → NewWizardPage-9igFL5O8.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-Cf52NOIt.js → OnboardingPage-BcK9FUnU.js} +1 -1
- package/apps/web/dist/assets/{PreviewPane-C4yMcZPM.js → PreviewPane-X4LBqA0D.js} +3 -3
- package/apps/web/dist/assets/ProjectPage-CG0i-KhR.js +1 -0
- package/apps/web/dist/assets/{PublicRunner-Bftc1c4m.js → PublicRunner-CZR1ziQ4.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-DVQm9IYx.js → ReadOnly-BraZbEG_.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-Bw4tdoV7.js +2 -0
- package/apps/web/dist/assets/SetupPage-CvkE2aKx.js +1 -0
- package/apps/web/dist/assets/{SharePage-Cn-bqSyr.js → SharePage-Dk7zC5Zo.js} +1 -1
- package/apps/web/dist/assets/changelog-DDXnAaHm.js +1 -0
- package/apps/web/dist/assets/{coins-DgDTBbeg.js → coins-391m1e4_.js} +1 -1
- package/apps/web/dist/assets/index-BTUtot4r.js +14 -0
- package/apps/web/dist/assets/index-DcUL6teA.css +1 -0
- package/apps/web/dist/assets/{phone-D1Drdiio.js → phone-DvgrtyNO.js} +1 -1
- package/apps/web/dist/assets/{runners-CTd0YAiA.js → runners-4OBelIgF.js} +1 -1
- package/apps/web/dist/assets/{session-DX2BcTfz.js → session-DvnGHbDz.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-ay9jNbQu.js → settings-menu-xK9A-gaP.js} +1 -1
- package/apps/web/dist/assets/theme-D3yDT4QT.js +11 -0
- package/apps/web/dist/assets/ui-BVQk2DtW.js +137 -0
- package/apps/web/dist/assets/{upload-Dj7KPL--.js → upload-BgXbzG6C.js} +1 -1
- package/apps/web/dist/assets/{useMutation-CUSQpD-i.js → useMutation-DkwSQWoD.js} +1 -1
- package/apps/web/dist/assets/{volume-2-CcHZOU2m.js → volume-2-DHGoe3Cg.js} +1 -1
- package/apps/web/dist/assets/{wrench-CfJTFnMJ.js → wrench-Cf_aE3O0.js} +1 -1
- package/apps/web/dist/index.html +8 -8
- package/apps/web/dist/mcp/flow.html +56 -56
- package/node_modules/@engenty/wizards/dist/plugin/index.d.ts +2 -2
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +872 -18
- package/node_modules/@engenty/wizards-shared/dist/definition.js +52 -11
- package/node_modules/@engenty/wizards-shared/dist/json-schema.js +3 -3
- package/node_modules/@engenty/wizards-shared/dist/providers.d.ts +37 -0
- package/node_modules/@engenty/wizards-shared/dist/providers.js +64 -12
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/ProjectPage-D6Tah3QK.js +0 -1
- package/apps/web/dist/assets/SettingsPage-Cd-osLDu.js +0 -2
- package/apps/web/dist/assets/SetupPage-Dc8U5k5P.js +0 -1
- package/apps/web/dist/assets/changelog-CjSBB-a4.js +0 -1
- package/apps/web/dist/assets/index-DS3zUVw_.css +0 -1
- package/apps/web/dist/assets/index-Da7hPToW.js +0 -14
- package/apps/web/dist/assets/theme-DanjuO1H.js +0 -11
- package/apps/web/dist/assets/ui-CJCF3Mhe.js +0 -137
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { anthropic } from "@ai-sdk/anthropic";
|
|
2
|
+
import { DEFINITION_VERSION, upgradeDefinition, } from "@engenty/wizards-shared/definition";
|
|
2
3
|
import { SURFACE_GUIDE } from "@engenty/wizards-shared/surface";
|
|
3
4
|
import { isTextMime } from "@engenty/wizards-shared/workspace";
|
|
4
5
|
import { Agent } from "@mastra/core/agent";
|
|
@@ -135,7 +136,8 @@ function buildTools(input, resolved, wrote) {
|
|
|
135
136
|
execute: async ({ wizard }) => attempt(async () => {
|
|
136
137
|
const w = await ownedWizard(userId, wizardId);
|
|
137
138
|
const { issues } = await writeDraft(userId, wizardId, {
|
|
138
|
-
|
|
139
|
+
// Written from today's authoring guide: today's version, said or not.
|
|
140
|
+
definition: upgradeDefinition(wizard, DEFINITION_VERSION),
|
|
139
141
|
baseRevision: w.revision,
|
|
140
142
|
});
|
|
141
143
|
wrote();
|
|
@@ -321,7 +323,7 @@ export async function runArchitect(input) {
|
|
|
321
323
|
const files = await listFiles(input.userId, input.wizardId);
|
|
322
324
|
let changed = false;
|
|
323
325
|
// Building a wizard is the hardest job here: widgets are code.
|
|
324
|
-
const resolved = await chatModel(input.way, "
|
|
326
|
+
const resolved = await chatModel(input.way, "high");
|
|
325
327
|
const tools = buildTools(input, resolved, () => {
|
|
326
328
|
changed = true;
|
|
327
329
|
});
|
|
@@ -44,7 +44,7 @@ export async function readCompany(input) {
|
|
|
44
44
|
if (!(await canSpend())) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
const reader = await textModel("
|
|
47
|
+
const reader = await textModel("low");
|
|
48
48
|
const { output } = await generateText({
|
|
49
49
|
model: reader.model,
|
|
50
50
|
abortSignal: input.signal,
|
|
@@ -681,7 +681,7 @@ export async function runStudioAssistant(input) {
|
|
|
681
681
|
let changes = 0;
|
|
682
682
|
// The way the settings chose for the studio's chats: on a client, its tools reach it over MCP.
|
|
683
683
|
const way = managed ? "models" : await chatEngine(await hasTextModel());
|
|
684
|
-
const resolved = await chatModel(way, "
|
|
684
|
+
const resolved = await chatModel(way, "standard");
|
|
685
685
|
const wrote = () => {
|
|
686
686
|
changes++;
|
|
687
687
|
input.onChanged?.();
|
|
@@ -11,7 +11,7 @@ Words
|
|
|
11
11
|
- Wizard: a flow of steps a person walks through on a link. Step kinds: a page (fields to fill in), an AI step (an agent with tools: web search, reading files, writing documents, images, video, pages, other services), a review, and the result.
|
|
12
12
|
- Run: one person going through a wizard once. Results lists every run that reached its result.
|
|
13
13
|
- Space: what all wizards of an organization know. Its page has four parts: Info & brand (title, about, logos, colours, assets, facts), Knowledge (pages, tables and files the AI steps look things up in, kept apart by typed categories), Data (tables and pages the wizards keep) and Results (finished runs).
|
|
14
|
-
- Model class: the kind of model a step needs (Classifier, Standard, High
|
|
14
|
+
- Model class: the kind of model a step needs (Classifier, Low, Standard, High for text; Image, Video, Speech, Audio). Which model serves a class is a setting (Settings › Models), not part of the wizard.
|
|
15
15
|
|
|
16
16
|
Thinking: an installed AI client on the person's subscription (Claude Code, Codex, Antigravity, Cursor Agent), own API keys (OpenAI, Anthropic, Google, fal.ai, ElevenLabs, Replicate, Vercel AI Gateway), a local model (Ollama), or engenty credits from an account. Settings › Models shows which way serves each class and what is missing.
|
|
17
17
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* the guide's own, not a marketplace entry, so the guide never depends on the marketplace.
|
|
4
4
|
*/
|
|
5
5
|
export const EXAMPLE_WIZARD = {
|
|
6
|
-
version:
|
|
6
|
+
version: 2,
|
|
7
7
|
title: "X post with an image",
|
|
8
8
|
description: "Turns a topic into a finished post with an image.",
|
|
9
9
|
avatar: "flame",
|
|
@@ -40,7 +40,7 @@ export const EXAMPLE_WIZARD = {
|
|
|
40
40
|
instructions: "Write a post for X (Twitter) on the topic: {{topic}}. Tone: {{tone}}. At most 270 characters including the link, and at most two hashtags. If a link is given ({{link}}), put it at the end. A strong first sentence. Output only the post.",
|
|
41
41
|
tools: [],
|
|
42
42
|
output: { format: "text" },
|
|
43
|
-
model: "
|
|
43
|
+
model: "low",
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
id: "visual",
|
|
@@ -8,7 +8,7 @@ import { EXAMPLE_WIZARD } from "./example.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export const SCHEMA_DOC = `
|
|
10
10
|
type Wizard = {
|
|
11
|
-
version:
|
|
11
|
+
version: 2 // always write it: the class names below are those of version 2
|
|
12
12
|
title: string // short, what the end user gets ("Rechnung erstellen")
|
|
13
13
|
description: string // one sentence
|
|
14
14
|
avatar: "round"|"drop"|"dome"|"flame"|"oval"|"bean"|"pebble"|"sprout"|"tower"|"wedge" // the engenty mascot shown to end users
|
|
@@ -164,8 +164,8 @@ type AgentStep = {
|
|
|
164
164
|
// one table, steps.<id>.rows: the entry's columns plus the step's output fields, a row per entry.
|
|
165
165
|
// a table with columns gives rows as objects with exactly those keys — what widgets read
|
|
166
166
|
// "yesno" answers the question in its description with true/false; "choice" picks one of its options
|
|
167
|
-
model?: "classifier"|"
|
|
168
|
-
effort?: "low"|"medium"|"high"
|
|
167
|
+
model?: "classifier"|"low"|"standard"|"high" // the kind of model, see "Models"; default "standard"
|
|
168
|
+
effort?: "low"|"medium"|"high" // how hard it should think; leave out unless it matters
|
|
169
169
|
working?: string // shown while it runs ("Recherchiert im Web …")
|
|
170
170
|
}
|
|
171
171
|
// Every agent step also has, without listing them: list_read / list_write (the wizard's lists), files_list,
|
|
@@ -287,7 +287,7 @@ type FilmStep = {
|
|
|
287
287
|
from?: string // "steps.<filmStepId>": start from that earlier film's code and lay it out for this format —
|
|
288
288
|
// the second format of a film in minutes; made from scratch when that step did not run
|
|
289
289
|
seconds?: number // about how long
|
|
290
|
-
model?: "
|
|
290
|
+
model?: "low" | "standard" // the model class; default "low"
|
|
291
291
|
effort?: Effort
|
|
292
292
|
working?: string
|
|
293
293
|
}
|
|
@@ -349,7 +349,7 @@ How good wizards look:
|
|
|
349
349
|
correct or regenerate. A result people can simply make again needs no review before it.
|
|
350
350
|
- Money/totals: use an "items" field with vat — the runner computes totals; documents must use {{items}} verbatim. Never let a model compute totals.
|
|
351
351
|
- Facts from the web need an agent step with web_search + web_fetch BEFORE writing; documents then cite those notes.
|
|
352
|
-
- Live data with a free public JSON API (weather and wind: api.open-meteo.com; sunrise/sunset is in it too) → an agent step with the http tool and model "
|
|
352
|
+
- Live data with a free public JSON API (weather and wind: api.open-meteo.com; sunrise/sunset is in it too) → an agent step with the http tool and model "low" that calls the API and returns json. Far cheaper and more exact than web research; use web research only when no API exists.
|
|
353
353
|
- Writing into other systems (CRM, database, spreadsheet, website): an agent step with the matching mcp server, http, or browser tool, preceded by a review step. Such a step hands over an earlier step's output as a file by naming it "result:<stepId>.<format>" — to browser_upload, or as "file:result:<stepId>.<format>" where a connector action takes "*_base64".
|
|
354
354
|
- Sending the finished result on (mail it, file it in a cloud folder, post it on social media or a website, put it into an ads account): do not build a step for it. Put the targets into the result step's "share": the person sees the result first and sends it with one button. Build an agent step only when the wizard must write somewhere without being asked.
|
|
355
355
|
${sandboxGuideLine()}
|
|
@@ -368,8 +368,8 @@ ${sandboxGuideLine()}
|
|
|
368
368
|
- Going through documents one by one (receipts against payments): never one model step per document. One step reads them in batches (scan_documents takes 30 at once) and writes rows into a list with "check"; the review shows that list split-screen — the person answers each row beside its file, without any model call.
|
|
369
369
|
- Video that convinces is built in stages, each with its own review: idea and script (agent, json with a table of shots) → one still per shot (generate image with "each", starting from the person's product photo) → one clip per still (generate video with "each" and referenceImage = the stills step) → a voice-over (generate voice) → a film widget (video: true) that cuts clips, captions, voice and a closing card with the call to action. The starters "facebook-video-ad" and "property-film" carry such a widget (film/film.js) to copy. Offer a cheaper path without clips: the film animates the stills.
|
|
370
370
|
- Motion-graphics films (explainers, product spots, shorts) are a "film" step after the preparation, each with a review:
|
|
371
|
-
research and script (agent,
|
|
372
|
-
word timings itself) → film (inputs: the voice, pictures, the script). The look comes from a style kit in the workspace (kit), so the film step stays on "
|
|
371
|
+
research and script (agent, standard) → the voice-over (one generate voice step for the whole script; the film step finds the
|
|
372
|
+
word timings itself) → film (inputs: the voice, pictures, the script). The look comes from a style kit in the workspace (kit), so the film step stays on "low".
|
|
373
373
|
- Prices come from a file the admin keeps in the workspace (a CSV price list): the agent step looks them up with read_workspace_file and proposes positions as a table; the next page shows them in an "items" field with "prefill" for the person to correct; the runner computes the totals.
|
|
374
374
|
- AI media is marked for you (EU AI Act, Art. 50): images, clips, voice-overs and films carry the marking in their file metadata, and the pages lay the EU's "AI" label over them. Never ask an image step to draw such a label into the picture. A film is different — it leaves the page as a video file, so its widget shows the EU label in the picture: wizard.ai tells a widget whether the run's media in its data is "generated" or "edited" (film/film.js draws the matching icon).
|
|
375
375
|
- Every step a person sees later (review/result) must come from an earlier step id.
|
|
@@ -455,11 +455,11 @@ ${connectorsLine(connectors)}${pluginToolsLine(pluginTools)}
|
|
|
455
455
|
Models: a step names the KIND of model it needs, never a model. Pick the cheapest class that does the job:
|
|
456
456
|
- "classifier": routing, yes/no, picking from options, pulling a few values out of text.
|
|
457
457
|
A DECISION is a "classifier" step with no tools whose json output has only "yesno", "choice" and "score" fields: it is answered in one fast, very cheap call. A branch can also read how sure it is: "steps.<id>.<field>.p" is the probability of its answer (a number 0–1; 1 or 0 where no decision model is set up), e.g. { field: "steps.check.urgent.p", op: "gt", value: 0.8 }. Write the question into each field's description, give the step everything it must judge in its instructions via {{templates}}, and branch on the answer with "next" (e.g. { when: { field: "steps.check.refund", op: "equals", value: true }, goto: "refund" }).
|
|
458
|
-
- "
|
|
459
|
-
- "
|
|
460
|
-
- "
|
|
458
|
+
- "low": short copy, calling an API, reformatting, simple summaries.
|
|
459
|
+
- "standard": research with tools, long documents, reasoning over many sources (the default).
|
|
460
|
+
- "high": hard reasoning or writing code; rare in a run, several times the cost of "standard".
|
|
461
461
|
"effort" ("low" | "medium" | "high") tells the model how hard to think where it can be told; leave it out unless a step is clearly trivial ("low") or clearly hard ("high").
|
|
462
|
-
A generate step for a document or dashboard takes the same "model" (default "
|
|
462
|
+
A generate step for a document or dashboard takes the same "model" (default "standard"). Image and video steps use the image and video class; which model serves a class is set by the platform, not in the wizard.
|
|
463
463
|
|
|
464
464
|
Editing:
|
|
465
465
|
- Every write returns the new "revision" and the validator's "issues". Pass the revision you last saw as "baseRevision"; on revision_conflict re-read with get_wizard and apply your change again.
|
|
@@ -51,7 +51,7 @@ function stepFormula(step, catalog) {
|
|
|
51
51
|
? TOKENS.tools
|
|
52
52
|
: TOKENS.plain;
|
|
53
53
|
// A step with `each` runs once per entry; until it has run, three stand in.
|
|
54
|
-
let credits = textCredits(cls(step.model ?? "
|
|
54
|
+
let credits = textCredits(cls(step.model ?? "standard"), shape) * (step.each ? 3 : 1);
|
|
55
55
|
if (step.tools.includes("web_search")) {
|
|
56
56
|
credits += 4 * catalog.webSearchCredits;
|
|
57
57
|
}
|
|
@@ -62,20 +62,20 @@ function stepFormula(step, catalog) {
|
|
|
62
62
|
credits += textCredits(cls("classifier"), TOKENS.structure);
|
|
63
63
|
}
|
|
64
64
|
if (step.output.surface === true) {
|
|
65
|
-
credits += textCredits(cls("
|
|
65
|
+
credits += textCredits(cls("low"), TOKENS.structure);
|
|
66
66
|
}
|
|
67
67
|
return credits;
|
|
68
68
|
}
|
|
69
69
|
if (step.type === "generate") {
|
|
70
70
|
if (step.asset === "image") {
|
|
71
|
-
return (
|
|
71
|
+
return (catalog.classes.image?.creditsPerImage ?? 0) + textCredits(cls("low"), TOKENS.prompt);
|
|
72
72
|
}
|
|
73
73
|
if (step.asset === "video") {
|
|
74
74
|
const seconds = Math.min(Math.max(Math.round(step.options?.duration ?? 8), 4), 10);
|
|
75
75
|
return (seconds * (catalog.classes.video?.creditsPerSecond ?? 0) +
|
|
76
|
-
textCredits(cls("
|
|
76
|
+
textCredits(cls("low"), TOKENS.prompt));
|
|
77
77
|
}
|
|
78
|
-
return textCredits(cls(step.model ?? "
|
|
78
|
+
return textCredits(cls(step.model ?? "standard"), TOKENS.document);
|
|
79
79
|
}
|
|
80
80
|
return 0;
|
|
81
81
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { cp } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { upgradeDefinition } from "@engenty/wizards-shared/definition";
|
|
4
5
|
import { createClient } from "@libsql/client";
|
|
5
6
|
import { env } from "../env.js";
|
|
6
7
|
import { readSetting, writeSetting } from "../settings.js";
|
|
@@ -26,14 +27,14 @@ const TABLES = [
|
|
|
26
27
|
"store_file",
|
|
27
28
|
"store_secret",
|
|
28
29
|
];
|
|
29
|
-
const CLASS_OF = { fast: "
|
|
30
|
-
/** Steps named a model speed before they named a model class. */
|
|
30
|
+
const CLASS_OF = { fast: "low", smart: "standard" };
|
|
31
|
+
/** Steps named a model speed before they named a model class; then classes of version 1. */
|
|
31
32
|
function withClasses(json) {
|
|
32
33
|
if (typeof json !== "string") {
|
|
33
34
|
return json;
|
|
34
35
|
}
|
|
35
36
|
try {
|
|
36
|
-
const def = JSON.parse(json);
|
|
37
|
+
const def = upgradeDefinition(JSON.parse(json));
|
|
37
38
|
for (const step of def.steps ?? []) {
|
|
38
39
|
if (step.model && CLASS_OF[step.model]) {
|
|
39
40
|
step.model = CLASS_OF[step.model];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
-- Definition version 2: the bindings of the text classes standard, high and highest of version 1
|
|
2
|
+
-- belong to low, standard and high now. json_patch leaves out a class that had no binding.
|
|
3
|
+
UPDATE `setting` SET `value` = json_set(`value`, '$.bindings', json_patch(
|
|
4
|
+
json_remove(json_extract(`value`, '$.bindings'), '$.standard', '$.high', '$.highest'),
|
|
5
|
+
json_object(
|
|
6
|
+
'low', json_extract(`value`, '$.bindings.standard'),
|
|
7
|
+
'standard', json_extract(`value`, '$.bindings.high'),
|
|
8
|
+
'high', json_extract(`value`, '$.bindings.highest')
|
|
9
|
+
)))
|
|
10
|
+
WHERE (`key` = 'models' OR `key` LIKE 'models:%')
|
|
11
|
+
AND json_valid(`value`) AND json_type(`value`, '$.bindings') = 'object';
|