@engenty/wizards-runtime 0.11.3 → 0.11.5
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 +3 -5
- package/apps/runtime/dist/agents/studio-assistant.js +1 -3
- package/apps/runtime/dist/assistant/knows.js +1 -1
- package/apps/runtime/dist/authoring/guide.js +2 -8
- package/apps/runtime/dist/credits/estimate.js +1 -1
- package/apps/runtime/dist/db/migrations/tenant/0025_drop_mcp_servers.sql +1 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/0025_snapshot.json +3959 -0
- package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
- package/apps/runtime/dist/db/schema.js +0 -4
- package/apps/runtime/dist/docs/dev/plugins/events.md +2 -2
- package/apps/runtime/dist/docs/dev/wizard-format/agent-steps.md +1 -2
- package/apps/runtime/dist/docs/dev/wizard-format/wizard-file.md +6 -8
- package/apps/runtime/dist/docs/user-guide/cloud-sync.md +2 -2
- package/apps/runtime/dist/docs/user-guide/connectors.md +1 -10
- package/apps/runtime/dist/docs/user-guide/steps.md +2 -3
- package/apps/runtime/dist/engine/steps.js +126 -131
- package/apps/runtime/dist/live/views.js +1 -3
- package/apps/runtime/dist/mcp/tools.js +1 -1
- package/apps/runtime/dist/services/architect.js +0 -1
- package/apps/runtime/dist/services/package-file.js +0 -1
- package/apps/runtime/dist/services/package.js +0 -10
- package/apps/runtime/dist/services/projects.js +1 -31
- package/apps/runtime/dist/services/spaces.js +5 -23
- package/apps/runtime/dist/sync/records.js +0 -9
- package/apps/runtime/dist/tools/index.js +0 -28
- package/apps/web/dist/assets/{AboutDialog-DlbfynVv.js → AboutDialog-B525L37O.js} +1 -1
- package/apps/web/dist/assets/{ChangelogDialog-DciD55wO.js → ChangelogDialog-gInSm1Xe.js} +1 -1
- package/apps/web/dist/assets/{CodeEditor-9kXX-juf.js → CodeEditor-C0TmdCrb.js} +1 -1
- package/apps/web/dist/assets/EditorPage-7t3vhZi6.js +3 -0
- package/apps/web/dist/assets/{FlowPreview-BY3kJO9l.js → FlowPreview-BBN-APkG.js} +1 -1
- package/apps/web/dist/assets/{Harness-BqcSaPmJ.js → Harness-fAoC908y.js} +1 -1
- package/apps/web/dist/assets/Marketplace-CotMMcJ-.js +2 -0
- package/apps/web/dist/assets/{NewWizardChannels-CmeAOy0q.js → NewWizardChannels-X32lBGMf.js} +1 -1
- package/apps/web/dist/assets/{NewWizardPage-C2Ne-QFZ.js → NewWizardPage-DMoqDhsh.js} +1 -1
- package/apps/web/dist/assets/{OnboardingPage-CGEgLpx0.js → OnboardingPage-BjZy-bhI.js} +1 -1
- package/apps/web/dist/assets/{PreviewPane-VnxYvrbF.js → PreviewPane-Bt-ForJG.js} +2 -2
- package/apps/web/dist/assets/{ProjectPage-CGpsFPJ4.js → ProjectPage-B5a-nod-.js} +1 -1
- package/apps/web/dist/assets/{PublicRunner-b4vSNmVB.js → PublicRunner-Cq_XzX54.js} +1 -1
- package/apps/web/dist/assets/{ReadOnly-C7Kk-1Vg.js → ReadOnly-DX3beZJz.js} +1 -1
- package/apps/web/dist/assets/SettingsPage-DPuwA3QL.js +2 -0
- package/apps/web/dist/assets/{SetupPage-DmYnhiMq.js → SetupPage-BI9bgEkI.js} +1 -1
- package/apps/web/dist/assets/{SharePage-DMgm31Y_.js → SharePage-Ch-1oLBs.js} +1 -1
- package/apps/web/dist/assets/changelog-BlJc9UFS.js +1 -0
- package/apps/web/dist/assets/{coins-Dd9IUAaR.js → coins-D_yN56kT.js} +1 -1
- package/apps/web/dist/assets/i18n-Dy3fTQM3.js +55 -0
- package/apps/web/dist/assets/{index-Cfn8Jnfl.js → index-Dt1Ps3ge.js} +5 -5
- package/apps/web/dist/assets/{index-DQc1EITf.css → index-rX7eCvWh.css} +1 -1
- package/apps/web/dist/assets/oss-credits-CZT1KRIp.js +1 -0
- package/apps/web/dist/assets/{phone-DKeaGjd9.js → phone-DxC6eM6O.js} +1 -1
- package/apps/web/dist/assets/{runners-D2_oJdgS.js → runners-SQHfvvNQ.js} +1 -1
- package/apps/web/dist/assets/{session-DBNhp6sF.js → session-4CTNIlai.js} +1 -1
- package/apps/web/dist/assets/{settings-menu-B09fSEin.js → settings-menu-B0af5EBE.js} +1 -1
- package/apps/web/dist/assets/{theme-CdWeSjNs.js → theme-mtamawa_.js} +1 -1
- package/apps/web/dist/assets/{ui-BPfapiMz.js → ui-CL8v8Goa.js} +1 -1
- package/apps/web/dist/assets/{upload-DCYRRi4d.js → upload-DXJQU2lL.js} +1 -1
- package/apps/web/dist/assets/{useMutation-BGqWiJkl.js → useMutation-DwRYrG3V.js} +1 -1
- package/apps/web/dist/assets/{volume-2-D_FTVDPk.js → volume-2-CYbbBiXP.js} +1 -1
- package/apps/web/dist/assets/{wrench-BYwez0dN.js → wrench-D8lG2BH7.js} +1 -1
- package/apps/web/dist/index.html +9 -9
- package/apps/web/dist/mcp/flow.html +3 -3
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +0 -4
- package/node_modules/@engenty/wizards-shared/dist/definition.js +0 -3
- package/node_modules/@engenty/wizards-shared/dist/fit.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/fit.js +0 -4
- package/node_modules/@engenty/wizards-shared/dist/marketplace.js +2 -2
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +0 -2
- package/node_modules/@engenty/wizards-shared/dist/run.js +0 -4
- package/node_modules/@engenty/wizards-shared/dist/wizard-package.d.ts +0 -4
- package/node_modules/@engenty/wizards-shared/dist/wizard-package.js +0 -5
- package/package.json +1 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/web/dist/assets/EditorPage-ovstPrvJ.js +0 -3
- package/apps/web/dist/assets/Marketplace-DxcNtFdJ.js +0 -2
- package/apps/web/dist/assets/SettingsPage-Cgt3zVu5.js +0 -2
- package/apps/web/dist/assets/changelog-CJYpF3Mx.js +0 -1
- package/apps/web/dist/assets/i18n-QZC6TtrB.js +0 -55
- package/apps/web/dist/assets/oss-credits-C6bPkfSE.js +0 -1
|
@@ -5,7 +5,7 @@ import { isTextMime } from "@engenty/wizards-shared/workspace";
|
|
|
5
5
|
import { Agent } from "@mastra/core/agent";
|
|
6
6
|
import { createTool } from "@mastra/core/tools";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
-
import { connectorsLine, exampleWizard,
|
|
8
|
+
import { connectorsLine, exampleWizard, PRINCIPLES, pluginToolsLine, SCHEMA_DOC, WIDGET_GUIDE, } from "../authoring/guide.js";
|
|
9
9
|
import { wizardOpSchema } from "../authoring/ops.js";
|
|
10
10
|
import { importFromRegistry, listConnectors, searchRegistry } from "../connectors/external.js";
|
|
11
11
|
import { agentModel, attachTools, chatModel, costOf, gatewayTools, totalUsage, } from "../models.js";
|
|
@@ -21,7 +21,7 @@ import { attempt as attemptTool, imageOutput } from "../tools/shared.js";
|
|
|
21
21
|
import { runScript } from "../widgets/script.js";
|
|
22
22
|
import { thoughtLine } from "./thought.js";
|
|
23
23
|
const MAX_STEPS = 45;
|
|
24
|
-
function systemPrompt(
|
|
24
|
+
function systemPrompt(connectors, pluginTools) {
|
|
25
25
|
return `You design wizards for "engenty wizards": a page-by-page flow an end user walks through, where AI steps research, write, draw images, render video, build documents, dashboards and interactive widgets, or write into other systems.
|
|
26
26
|
|
|
27
27
|
You talk to the ADMIN who builds the wizard. Answer in the admin's language, briefly and warmly. Never mention JSON, ids, schemas, files or templates to them — talk about pages, questions, steps, the widget and results.
|
|
@@ -33,8 +33,6 @@ ${WIDGET_GUIDE}
|
|
|
33
33
|
Surface catalog (for surface steps and output.surface):
|
|
34
34
|
${SURFACE_GUIDE}
|
|
35
35
|
|
|
36
|
-
${mcpServersLine(mcp)}
|
|
37
|
-
|
|
38
36
|
${connectorsLine(connectors)}${pluginToolsLine(pluginTools)}
|
|
39
37
|
|
|
40
38
|
Example of a complete wizard:
|
|
@@ -334,7 +332,7 @@ export async function runArchitect(input) {
|
|
|
334
332
|
// The system prompt is long and identical on every turn: cache it.
|
|
335
333
|
instructions: {
|
|
336
334
|
role: "system",
|
|
337
|
-
content: systemPrompt(input.
|
|
335
|
+
content: systemPrompt(input.connectors, await pluginToolsOf(currentTenant())),
|
|
338
336
|
providerOptions: { anthropic: { cacheControl: { type: "ephemeral" } } },
|
|
339
337
|
},
|
|
340
338
|
model: agentModel(resolved),
|
|
@@ -698,9 +698,7 @@ export async function runStudioAssistant(input) {
|
|
|
698
698
|
const tools = {
|
|
699
699
|
...knowsTools({
|
|
700
700
|
user: input.user,
|
|
701
|
-
project: project
|
|
702
|
-
? { id: project.id, name: project.name, mcpServers: project.mcpServers }
|
|
703
|
-
: null,
|
|
701
|
+
project: project ? { id: project.id, name: project.name } : null,
|
|
704
702
|
lang: input.lang,
|
|
705
703
|
chatId: input.chat.id,
|
|
706
704
|
doing: (label) => input.onActivity?.(label),
|
|
@@ -68,7 +68,7 @@ export function knowsTools(ctx) {
|
|
|
68
68
|
inputSchema: z.object({ from: z.number().int().min(0).optional() }),
|
|
69
69
|
execute: ({ from }) => attempt(async () => {
|
|
70
70
|
ctx.doing(serverText(ctx.lang, "doingAuthoringGuide"));
|
|
71
|
-
const guide = authoringGuide(ctx.project
|
|
71
|
+
const guide = authoringGuide(ctx.project ? await listConnectors(ctx.project.id) : [], await pluginToolsOf(user.tenantId));
|
|
72
72
|
const start = Math.min(from ?? 0, guide.length);
|
|
73
73
|
return {
|
|
74
74
|
text: guide.slice(start, start + 14_000),
|
|
@@ -153,7 +153,6 @@ type AgentStep = {
|
|
|
153
153
|
// data (free appointment times) — it answers in a second instead of half a minute.
|
|
154
154
|
// String inputs are templates; a filled-in whole number or true/false is passed as one.
|
|
155
155
|
tools: ("web_search"|"web_fetch"|"browser"|"sandbox"|"image"|"http"|"pages"|"code")[]
|
|
156
|
-
mcp?: string[] // ids of the project's MCP servers this step may use
|
|
157
156
|
connections?: string[] // ids of wizard connections this step may read (mail → mail_search, mail_read, mail_save)
|
|
158
157
|
output: { format: "text"|"markdown"|"json", fields?: { id, kind: "text"|"number"|"list"|"table"|"yesno"|"choice"|"score", description, columns?: string[], options?: string[] }[], schema?: Schema, surface?: SurfaceComponent[] | true }
|
|
159
158
|
// "score" answers its description on the scale in options, lowest first ("low", "medium", "high")
|
|
@@ -350,7 +349,7 @@ How good wizards look:
|
|
|
350
349
|
- Money/totals: use an "items" field with vat — the runner computes totals; documents must use {{items}} verbatim. Never let a model compute totals.
|
|
351
350
|
- Facts from the web need an agent step with web_search + web_fetch BEFORE writing; documents then cite those notes.
|
|
352
351
|
- 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
|
-
- Writing into other systems (CRM, database, spreadsheet, website): an agent step with the matching
|
|
352
|
+
- Writing into other systems (CRM, database, spreadsheet, website): an agent step with the matching connector, 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
353
|
- 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
354
|
${sandboxGuideLine()}
|
|
356
355
|
- Remembering between runs ("merke dir", "führe eine Liste"): declare a list and let an agent step save into it with list_write; a later run reads it as {{lists.id}} or list_read. Give it a key column so known rows are updated, not duplicated. Never make the person re-upload last time's result.
|
|
@@ -431,14 +430,11 @@ export function pluginToolsLine(tools) {
|
|
|
431
430
|
const lines = tools.map((t) => `- ${t.id} — ${t.description}`);
|
|
432
431
|
return `\n\nTools of this app's plugins. An agent step lists one in "tools" by its full id, next to the built-in ones; a wizard that uses one runs only where that plugin is installed:\n${lines.join("\n")}`;
|
|
433
432
|
}
|
|
434
|
-
export function mcpServersLine(mcp) {
|
|
435
|
-
return `Project MCP servers available to agent steps: ${mcp.length ? mcp.map((m) => `${m.id} (${m.name})`).join(", ") : "none — if the admin wants to write into an external system that needs one, build the step with http or browser, and tell them they can connect a server in the project settings"}.`;
|
|
436
|
-
}
|
|
437
433
|
export function exampleWizard() {
|
|
438
434
|
return JSON.stringify(EXAMPLE_WIZARD, null, 2);
|
|
439
435
|
}
|
|
440
436
|
/** The guide an MCP client reads before it writes a wizard. */
|
|
441
|
-
export function authoringGuide(
|
|
437
|
+
export function authoringGuide(connectors = [], pluginTools = []) {
|
|
442
438
|
return `engenty wizards: a wizard is a page-by-page flow an end user walks through on a shared link. Pages ask questions; AI steps research, write, draw images, render video, build documents and dashboards, or write into other systems. You author the wizard as JSON; the person who asked you is the ADMIN, the people who later open the link are END USERS.
|
|
443
439
|
|
|
444
440
|
${SCHEMA_DOC}
|
|
@@ -448,8 +444,6 @@ ${WIDGET_GUIDE}
|
|
|
448
444
|
Surface catalog (for surface steps and output.surface):
|
|
449
445
|
${SURFACE_GUIDE}
|
|
450
446
|
|
|
451
|
-
${mcpServersLine(mcp)}
|
|
452
|
-
|
|
453
447
|
${connectorsLine(connectors)}${pluginToolsLine(pluginTools)}
|
|
454
448
|
|
|
455
449
|
Models: a step names the KIND of model it needs, never a model. Pick the cheapest class that does the job:
|
|
@@ -47,7 +47,7 @@ function stepFormula(step, catalog) {
|
|
|
47
47
|
}
|
|
48
48
|
const shape = step.tools.includes("browser")
|
|
49
49
|
? TOKENS.browser
|
|
50
|
-
: step.tools.length || step.
|
|
50
|
+
: step.tools.length || step.connections?.length
|
|
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.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ALTER TABLE `project` DROP COLUMN `mcp_servers`;
|